aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2010-03-01 17:19:05 -0500
committerTony Lindgren <tony@atomide.com>2010-03-01 17:19:05 -0500
commitd702d12167a2c05a346f49aac7a311d597762495 (patch)
treebaae42c299cce34d6df24b5d01f8b1d0b481bd9a /arch
parent9418c65f9bd861d0f7e39aab9cfb3aa6f2275d11 (diff)
parentac0f6f927db539e03e1f3f61bcd4ed57d5cde7a9 (diff)
Merge with mainline to remove plat-omap/Kconfig conflict
Conflicts: arch/arm/plat-omap/Kconfig
Diffstat (limited to 'arch')
-rw-r--r--arch/Kconfig26
-rw-r--r--arch/alpha/include/asm/pgtable.h2
-rw-r--r--arch/alpha/kernel/pci.c6
-rw-r--r--arch/arm/Kconfig51
-rw-r--r--arch/arm/Makefile1
-rw-r--r--arch/arm/boot/compressed/Makefile6
-rw-r--r--arch/arm/boot/compressed/decompress.c45
-rw-r--r--arch/arm/boot/compressed/misc.c109
-rw-r--r--arch/arm/boot/compressed/vmlinux.lds.in8
-rw-r--r--arch/arm/common/clkdev.c10
-rw-r--r--arch/arm/common/dmabounce.c4
-rw-r--r--arch/arm/common/vic.c265
-rw-r--r--arch/arm/configs/at572d940hfek_defconfig1640
-rw-r--r--arch/arm/configs/omap_4430sdp_defconfig3
-rw-r--r--arch/arm/include/asm/atomic.h228
-rw-r--r--arch/arm/include/asm/cacheflush.h69
-rw-r--r--arch/arm/include/asm/clkdev.h3
-rw-r--r--arch/arm/include/asm/dma-mapping.h79
-rw-r--r--arch/arm/include/asm/io.h11
-rw-r--r--arch/arm/include/asm/mach/time.h8
-rw-r--r--arch/arm/include/asm/memory.h23
-rw-r--r--arch/arm/include/asm/mmu.h1
-rw-r--r--arch/arm/include/asm/mmu_context.h15
-rw-r--r--arch/arm/include/asm/page.h7
-rw-r--r--arch/arm/include/asm/perf_event.h31
-rw-r--r--arch/arm/include/asm/pgtable-nommu.h4
-rw-r--r--arch/arm/include/asm/pmu.h75
-rw-r--r--arch/arm/include/asm/setup.h12
-rw-r--r--arch/arm/include/asm/smp_plat.h5
-rw-r--r--arch/arm/include/asm/spinlock.h36
-rw-r--r--arch/arm/include/asm/system.h3
-rw-r--r--arch/arm/include/asm/thread_info.h3
-rw-r--r--arch/arm/include/asm/tlbflush.h3
-rw-r--r--arch/arm/kernel/Makefile3
-rw-r--r--arch/arm/kernel/asm-offsets.c5
-rw-r--r--arch/arm/kernel/bios32.c8
-rw-r--r--arch/arm/kernel/leds.c115
-rw-r--r--arch/arm/kernel/perf_event.c2276
-rw-r--r--arch/arm/kernel/pmu.c103
-rw-r--r--arch/arm/kernel/ptrace.c53
-rw-r--r--arch/arm/kernel/setup.c80
-rw-r--r--arch/arm/kernel/time.c178
-rw-r--r--arch/arm/kernel/traps.c35
-rw-r--r--arch/arm/kernel/vmlinux.lds.S4
-rw-r--r--arch/arm/mach-at91/Kconfig23
-rw-r--r--arch/arm/mach-at91/Makefile4
-rw-r--r--arch/arm/mach-at91/at572d940hf.c377
-rw-r--r--arch/arm/mach-at91/at572d940hf_devices.c970
-rw-r--r--arch/arm/mach-at91/board-at572d940hf_ek.c328
-rw-r--r--arch/arm/mach-at91/clock.c8
-rw-r--r--arch/arm/mach-at91/clock.h2
-rw-r--r--arch/arm/mach-at91/generic.h2
-rw-r--r--arch/arm/mach-at91/include/mach/at572d940hf.h123
-rw-r--r--arch/arm/mach-at91/include/mach/at572d940hf_matrix.h123
-rw-r--r--arch/arm/mach-at91/include/mach/at91_pmc.h1
-rw-r--r--arch/arm/mach-at91/include/mach/board.h5
-rw-r--r--arch/arm/mach-at91/include/mach/cpu.h8
-rw-r--r--arch/arm/mach-at91/include/mach/hardware.h2
-rw-r--r--arch/arm/mach-at91/include/mach/timex.h5
-rw-r--r--arch/arm/mach-bcmring/core.c3
-rw-r--r--arch/arm/mach-davinci/board-dm365-evm.c71
-rw-r--r--arch/arm/mach-davinci/dm355.c43
-rw-r--r--arch/arm/mach-davinci/dm365.c102
-rw-r--r--arch/arm/mach-davinci/dm644x.c21
-rw-r--r--arch/arm/mach-davinci/include/mach/dm365.h2
-rw-r--r--arch/arm/mach-davinci/include/mach/hardware.h2
-rw-r--r--arch/arm/mach-davinci/io.c2
-rw-r--r--arch/arm/mach-dove/include/mach/vmalloc.h2
-rw-r--r--arch/arm/mach-ep93xx/Kconfig14
-rw-r--r--arch/arm/mach-ep93xx/Makefile2
-rw-r--r--arch/arm/mach-ep93xx/clock.c32
-rw-r--r--arch/arm/mach-ep93xx/core.c277
-rw-r--r--arch/arm/mach-ep93xx/dma-m2p.c6
-rw-r--r--arch/arm/mach-ep93xx/edb93xx.c21
-rw-r--r--arch/arm/mach-ep93xx/gpio.c235
-rw-r--r--arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h22
-rw-r--r--arch/arm/mach-ep93xx/include/mach/vmalloc.h2
-rw-r--r--arch/arm/mach-ep93xx/simone.c97
-rw-r--r--arch/arm/mach-ep93xx/snappercl15.c172
-rw-r--r--arch/arm/mach-footbridge/common.c7
-rw-r--r--arch/arm/mach-gemini/gpio.c4
-rw-r--r--arch/arm/mach-gemini/include/mach/vmalloc.h2
-rw-r--r--arch/arm/mach-integrator/core.c3
-rw-r--r--arch/arm/mach-integrator/integrator_cp.c4
-rw-r--r--arch/arm/mach-iop13xx/io.c7
-rw-r--r--arch/arm/mach-iop32x/include/mach/vmalloc.h2
-rw-r--r--arch/arm/mach-iop33x/include/mach/vmalloc.h2
-rw-r--r--arch/arm/mach-ixp2000/include/mach/vmalloc.h2
-rw-r--r--arch/arm/mach-ixp23xx/include/mach/vmalloc.h2
-rw-r--r--arch/arm/mach-ixp4xx/common.c11
-rw-r--r--arch/arm/mach-ixp4xx/include/mach/vmalloc.h2
-rw-r--r--arch/arm/mach-kirkwood/include/mach/vmalloc.h2
-rw-r--r--arch/arm/mach-lh7a40x/include/mach/vmalloc.h2
-rw-r--r--arch/arm/mach-loki/include/mach/vmalloc.h2
-rw-r--r--arch/arm/mach-mmp/clock.c8
-rw-r--r--arch/arm/mach-mmp/clock.h2
-rw-r--r--arch/arm/mach-mmp/include/mach/vmalloc.h2
-rw-r--r--arch/arm/mach-mmp/pxa168.c2
-rw-r--r--arch/arm/mach-mmp/pxa910.c2
-rw-r--r--arch/arm/mach-msm/io.c3
-rw-r--r--arch/arm/mach-mv78xx0/include/mach/vmalloc.h2
-rw-r--r--arch/arm/mach-mx1/clock.c4
-rw-r--r--arch/arm/mach-mx2/clock_imx21.c4
-rw-r--r--arch/arm/mach-mx2/clock_imx27.c4
-rw-r--r--arch/arm/mach-mx25/clock.c5
-rw-r--r--arch/arm/mach-mx3/clock-imx35.c4
-rw-r--r--arch/arm/mach-mx3/clock.c4
-rw-r--r--arch/arm/mach-mxc91231/clock.c4
-rw-r--r--arch/arm/mach-nomadik/cpu-8815.c8
-rw-r--r--arch/arm/mach-nomadik/include/mach/vmalloc.h2
-rw-r--r--arch/arm/mach-ns9xxx/include/mach/vmalloc.h2
-rw-r--r--arch/arm/mach-nuc93x/Kconfig19
-rw-r--r--arch/arm/mach-nuc93x/Makefile14
-rw-r--r--arch/arm/mach-nuc93x/Makefile.boot3
-rw-r--r--arch/arm/mach-nuc93x/clock.c83
-rw-r--r--arch/arm/mach-nuc93x/clock.h36
-rw-r--r--arch/arm/mach-nuc93x/cpu.c135
-rw-r--r--arch/arm/mach-nuc93x/cpu.h48
-rw-r--r--arch/arm/mach-nuc93x/dev.c42
-rw-r--r--arch/arm/mach-nuc93x/include/mach/clkdev.h7
-rw-r--r--arch/arm/mach-nuc93x/include/mach/entry-macro.S32
-rw-r--r--arch/arm/mach-nuc93x/include/mach/hardware.h22
-rw-r--r--arch/arm/mach-nuc93x/include/mach/io.h28
-rw-r--r--arch/arm/mach-nuc93x/include/mach/irqs.h59
-rw-r--r--arch/arm/mach-nuc93x/include/mach/map.h139
-rw-r--r--arch/arm/mach-nuc93x/include/mach/memory.h21
-rw-r--r--arch/arm/mach-nuc93x/include/mach/regs-clock.h53
-rw-r--r--arch/arm/mach-nuc93x/include/mach/regs-ebi.h33
-rw-r--r--arch/arm/mach-nuc93x/include/mach/regs-irq.h42
-rw-r--r--arch/arm/mach-nuc93x/include/mach/regs-serial.h52
-rw-r--r--arch/arm/mach-nuc93x/include/mach/regs-timer.h28
-rw-r--r--arch/arm/mach-nuc93x/include/mach/system.h28
-rw-r--r--arch/arm/mach-nuc93x/include/mach/timex.h25
-rw-r--r--arch/arm/mach-nuc93x/include/mach/uncompress.h50
-rw-r--r--arch/arm/mach-nuc93x/include/mach/vmalloc.h23
-rw-r--r--arch/arm/mach-nuc93x/irq.c66
-rw-r--r--arch/arm/mach-nuc93x/mach-nuc932evb.c45
-rw-r--r--arch/arm/mach-nuc93x/nuc932.c65
-rw-r--r--arch/arm/mach-nuc93x/nuc932.h29
-rw-r--r--arch/arm/mach-nuc93x/time.c100
-rw-r--r--arch/arm/mach-omap2/board-4430sdp.c54
-rw-r--r--arch/arm/mach-orion5x/include/mach/vmalloc.h2
-rw-r--r--arch/arm/mach-pnx4008/clock.c173
-rw-r--r--arch/arm/mach-pnx4008/clock.h6
-rw-r--r--arch/arm/mach-pnx4008/i2c.c108
-rw-r--r--arch/arm/mach-pnx4008/include/mach/clkdev.h7
-rw-r--r--arch/arm/mach-pnx4008/include/mach/timex.h54
-rw-r--r--arch/arm/mach-pnx4008/pm.c2
-rw-r--r--arch/arm/mach-pnx4008/time.c2
-rw-r--r--arch/arm/mach-pnx4008/time.h70
-rw-r--r--arch/arm/mach-pxa/clock.c8
-rw-r--r--arch/arm/mach-pxa/clock.h4
-rw-r--r--arch/arm/mach-pxa/eseries.c2
-rw-r--r--arch/arm/mach-pxa/include/mach/camera.h2
-rw-r--r--arch/arm/mach-pxa/include/mach/vmalloc.h2
-rw-r--r--arch/arm/mach-pxa/pxa25x.c4
-rw-r--r--arch/arm/mach-pxa/pxa27x.c2
-rw-r--r--arch/arm/mach-pxa/pxa300.c4
-rw-r--r--arch/arm/mach-pxa/pxa320.c2
-rw-r--r--arch/arm/mach-pxa/pxa3xx.c2
-rw-r--r--arch/arm/mach-realview/core.c5
-rw-r--r--arch/arm/mach-realview/include/mach/vmalloc.h2
-rw-r--r--arch/arm/mach-s3c24a0/include/mach/vmalloc.h2
-rw-r--r--arch/arm/mach-sa1100/include/mach/vmalloc.h2
-rw-r--r--arch/arm/mach-u300/clock.c29
-rw-r--r--arch/arm/mach-u300/core.c1029
-rw-r--r--arch/arm/mach-u300/gpio.c2
-rw-r--r--arch/arm/mach-u300/include/mach/dma_channels.h69
-rw-r--r--arch/arm/mach-u300/include/mach/vmalloc.h2
-rw-r--r--arch/arm/mach-ux500/board-mop500.c88
-rw-r--r--arch/arm/mach-ux500/clock.c5
-rw-r--r--arch/arm/mach-ux500/cpu-u8500.c1
-rw-r--r--arch/arm/mach-ux500/include/mach/debug-macro.S9
-rw-r--r--arch/arm/mach-ux500/include/mach/vmalloc.h2
-rw-r--r--arch/arm/mach-versatile/core.c3
-rw-r--r--arch/arm/mach-w90x900/clock.c9
-rw-r--r--arch/arm/mach-w90x900/clock.h1
-rw-r--r--arch/arm/mach-w90x900/cpu.c13
-rw-r--r--arch/arm/mach-w90x900/include/mach/vmalloc.h2
-rw-r--r--arch/arm/mm/Kconfig8
-rw-r--r--arch/arm/mm/alignment.c9
-rw-r--r--arch/arm/mm/cache-fa.S32
-rw-r--r--arch/arm/mm/cache-l2x0.c72
-rw-r--r--arch/arm/mm/cache-v3.S43
-rw-r--r--arch/arm/mm/cache-v4.S43
-rw-r--r--arch/arm/mm/cache-v4wb.S32
-rw-r--r--arch/arm/mm/cache-v4wt.S40
-rw-r--r--arch/arm/mm/cache-v6.S34
-rw-r--r--arch/arm/mm/cache-v7.S34
-rw-r--r--arch/arm/mm/context.c124
-rw-r--r--arch/arm/mm/copypage-feroceon.c3
-rw-r--r--arch/arm/mm/copypage-v3.c2
-rw-r--r--arch/arm/mm/copypage-v4mc.c2
-rw-r--r--arch/arm/mm/copypage-v4wb.c3
-rw-r--r--arch/arm/mm/copypage-v4wt.c2
-rw-r--r--arch/arm/mm/copypage-v6.c4
-rw-r--r--arch/arm/mm/copypage-xsc3.c3
-rw-r--r--arch/arm/mm/copypage-xscale.c2
-rw-r--r--arch/arm/mm/dma-mapping.c162
-rw-r--r--arch/arm/mm/fault-armv.c85
-rw-r--r--arch/arm/mm/fault.c7
-rw-r--r--arch/arm/mm/flush.c51
-rw-r--r--arch/arm/mm/init.c113
-rw-r--r--arch/arm/mm/ioremap.c57
-rw-r--r--arch/arm/mm/mmu.c41
-rw-r--r--arch/arm/mm/nommu.c12
-rw-r--r--arch/arm/mm/proc-arm1020.S32
-rw-r--r--arch/arm/mm/proc-arm1020e.S32
-rw-r--r--arch/arm/mm/proc-arm1022.S32
-rw-r--r--arch/arm/mm/proc-arm1026.S32
-rw-r--r--arch/arm/mm/proc-arm920.S32
-rw-r--r--arch/arm/mm/proc-arm922.S32
-rw-r--r--arch/arm/mm/proc-arm925.S32
-rw-r--r--arch/arm/mm/proc-arm926.S32
-rw-r--r--arch/arm/mm/proc-arm940.S32
-rw-r--r--arch/arm/mm/proc-arm946.S32
-rw-r--r--arch/arm/mm/proc-feroceon.S54
-rw-r--r--arch/arm/mm/proc-mohawk.S32
-rw-r--r--arch/arm/mm/proc-xsc3.S32
-rw-r--r--arch/arm/mm/proc-xscale.S49
-rw-r--r--arch/arm/oprofile/op_model_arm11_core.c4
-rw-r--r--arch/arm/oprofile/op_model_arm11_core.h4
-rw-r--r--arch/arm/oprofile/op_model_mpcore.c42
-rw-r--r--arch/arm/oprofile/op_model_v6.c30
-rw-r--r--arch/arm/oprofile/op_model_v7.c30
-rw-r--r--arch/arm/oprofile/op_model_v7.h4
-rw-r--r--arch/arm/oprofile/op_model_xscale.c35
-rw-r--r--arch/arm/plat-iop/io.c3
-rw-r--r--arch/arm/plat-mxc/Makefile4
-rw-r--r--arch/arm/plat-mxc/include/mach/vmalloc.h2
-rw-r--r--arch/arm/plat-mxc/ssi-fiq-ksym.c20
-rw-r--r--arch/arm/plat-mxc/ssi-fiq.S134
-rw-r--r--arch/arm/plat-nomadik/include/plat/i2c.h37
-rw-r--r--arch/arm/plat-omap/Kconfig1
-rw-r--r--arch/arm/plat-omap/include/plat/omap44xx.h1
-rw-r--r--arch/arm/plat-omap/io.c2
-rw-r--r--arch/arm/plat-s3c/include/mach/vmalloc.h2
-rw-r--r--arch/arm/plat-stmp3xxx/clock.c3
-rw-r--r--arch/arm/plat-stmp3xxx/include/mach/vmalloc.h2
-rw-r--r--arch/arm/tools/mach-types46
-rw-r--r--arch/arm/vfp/vfpmodule.c55
-rw-r--r--arch/avr32/include/asm/pgtable.h2
-rw-r--r--arch/avr32/mm/tlb.c4
-rw-r--r--arch/cris/arch-v32/drivers/pci/bios.c16
-rw-r--r--arch/cris/include/asm/pgtable.h2
-rw-r--r--arch/frv/include/asm/pgtable.h2
-rw-r--r--arch/frv/mb93090-mb00/pci-frv.c16
-rw-r--r--arch/h8300/mm/memory.c4
-rw-r--r--arch/ia64/include/asm/acpi.h2
-rw-r--r--arch/ia64/include/asm/elf.h4
-rw-r--r--arch/ia64/include/asm/pgtable.h2
-rw-r--r--arch/ia64/kernel/kprobes.c2
-rw-r--r--arch/ia64/kernel/time.c2
-rw-r--r--arch/ia64/pci/pci.c22
-rw-r--r--arch/ia64/sn/kernel/setup.c2
-rw-r--r--arch/m32r/include/asm/tlbflush.h2
-rw-r--r--arch/m32r/mm/fault-nommu.c2
-rw-r--r--arch/m32r/mm/fault.c6
-rw-r--r--arch/m68k/Kconfig6
-rw-r--r--arch/m68k/amiga/config.c2
-rw-r--r--arch/m68k/configs/mac_defconfig7
-rw-r--r--arch/m68k/configs/multi_defconfig6
-rw-r--r--arch/m68k/include/asm/machw.h25
-rw-r--r--arch/m68k/include/asm/macints.h22
-rw-r--r--arch/m68k/include/asm/pgtable_mm.h2
-rw-r--r--arch/m68k/include/asm/ptrace.h2
-rw-r--r--arch/m68k/include/asm/sigcontext.h6
-rw-r--r--arch/m68k/include/asm/siginfo.h91
-rw-r--r--arch/m68k/include/asm/swab.h2
-rw-r--r--arch/m68k/include/asm/thread_info_mm.h1
-rw-r--r--arch/m68k/include/asm/thread_info_no.h1
-rw-r--r--arch/m68k/include/asm/ucontext.h4
-rw-r--r--arch/m68k/include/asm/unistd.h6
-rw-r--r--arch/m68k/include/asm/virtconvert.h7
-rw-r--r--arch/m68k/kernel/entry.S4
-rw-r--r--arch/m68k/kernel/process.c4
-rw-r--r--arch/m68k/kernel/ptrace.c5
-rw-r--r--arch/m68k/kernel/signal.c7
-rw-r--r--arch/m68k/kernel/sys_m68k.c81
-rw-r--r--arch/m68k/mac/Makefile2
-rw-r--r--arch/m68k/mac/config.c344
-rw-r--r--arch/m68k/mac/debug.c365
-rw-r--r--arch/m68k/mac/macints.c101
-rw-r--r--arch/m68k/mac/oss.c20
-rw-r--r--arch/m68k/mac/via.c7
-rw-r--r--arch/m68k/mm/kmap.c5
-rw-r--r--arch/m68knommu/kernel/process.c4
-rw-r--r--arch/m68knommu/kernel/ptrace.c5
-rw-r--r--arch/m68knommu/kernel/sys_m68k.c36
-rw-r--r--arch/m68knommu/kernel/syscalltable.S4
-rw-r--r--arch/m68knommu/mm/memory.c1
-rw-r--r--arch/microblaze/Kconfig1
-rw-r--r--arch/microblaze/include/asm/io.h2
-rw-r--r--arch/microblaze/include/asm/prom.h20
-rw-r--r--arch/microblaze/include/asm/tlbflush.h2
-rw-r--r--arch/microblaze/kernel/cpu/cache.c27
-rw-r--r--arch/microblaze/kernel/of_platform.c2
-rw-r--r--arch/microblaze/kernel/prom.c990
-rw-r--r--arch/mips/Kconfig8
-rw-r--r--arch/mips/Kconfig.debug26
-rw-r--r--arch/mips/Makefile19
-rw-r--r--arch/mips/alchemy/Kconfig28
-rw-r--r--arch/mips/alchemy/common/Makefile7
-rw-r--r--arch/mips/alchemy/common/clocks.c7
-rw-r--r--arch/mips/alchemy/common/dbdma.c187
-rw-r--r--arch/mips/alchemy/common/dma.c36
-rw-r--r--arch/mips/alchemy/common/gpiolib-au1000.c10
-rw-r--r--arch/mips/alchemy/common/irq.c436
-rw-r--r--arch/mips/alchemy/common/platform.c153
-rw-r--r--arch/mips/alchemy/common/prom.c28
-rw-r--r--arch/mips/alchemy/common/puts.c68
-rw-r--r--arch/mips/alchemy/common/reset.c188
-rw-r--r--arch/mips/alchemy/common/setup.c40
-rw-r--r--arch/mips/alchemy/common/time.c35
-rw-r--r--arch/mips/alchemy/devboards/Makefile6
-rw-r--r--arch/mips/alchemy/devboards/bcsr.c148
-rw-r--r--arch/mips/alchemy/devboards/db1200/Makefile1
-rw-r--r--arch/mips/alchemy/devboards/db1200/platform.c561
-rw-r--r--arch/mips/alchemy/devboards/db1200/setup.c118
-rw-r--r--arch/mips/alchemy/devboards/db1x00/Makefile2
-rw-r--r--arch/mips/alchemy/devboards/db1x00/board_setup.c204
-rw-r--r--arch/mips/alchemy/devboards/db1x00/irqmap.c90
-rw-r--r--arch/mips/alchemy/devboards/db1x00/platform.c118
-rw-r--r--arch/mips/alchemy/devboards/pb1000/board_setup.c34
-rw-r--r--arch/mips/alchemy/devboards/pb1100/Makefile2
-rw-r--r--arch/mips/alchemy/devboards/pb1100/board_setup.c55
-rw-r--r--arch/mips/alchemy/devboards/pb1100/platform.c50
-rw-r--r--arch/mips/alchemy/devboards/pb1200/Makefile2
-rw-r--r--arch/mips/alchemy/devboards/pb1200/board_setup.c96
-rw-r--r--arch/mips/alchemy/devboards/pb1200/irqmap.c134
-rw-r--r--arch/mips/alchemy/devboards/pb1200/platform.c63
-rw-r--r--arch/mips/alchemy/devboards/pb1500/Makefile2
-rw-r--r--arch/mips/alchemy/devboards/pb1500/board_setup.c54
-rw-r--r--arch/mips/alchemy/devboards/pb1500/platform.c49
-rw-r--r--arch/mips/alchemy/devboards/pb1550/Makefile2
-rw-r--r--arch/mips/alchemy/devboards/pb1550/board_setup.c49
-rw-r--r--arch/mips/alchemy/devboards/pb1550/platform.c69
-rw-r--r--arch/mips/alchemy/devboards/platform.c222
-rw-r--r--arch/mips/alchemy/devboards/platform.h21
-rw-r--r--arch/mips/alchemy/devboards/pm.c32
-rw-r--r--arch/mips/alchemy/devboards/prom.c5
-rw-r--r--arch/mips/alchemy/mtx-1/Makefile2
-rw-r--r--arch/mips/alchemy/mtx-1/board_setup.c49
-rw-r--r--arch/mips/alchemy/mtx-1/init.c6
-rw-r--r--arch/mips/alchemy/mtx-1/irqmap.c56
-rw-r--r--arch/mips/alchemy/xxs1500/Makefile4
-rw-r--r--arch/mips/alchemy/xxs1500/board_setup.c60
-rw-r--r--arch/mips/alchemy/xxs1500/init.c6
-rw-r--r--arch/mips/alchemy/xxs1500/irqmap.c52
-rw-r--r--arch/mips/alchemy/xxs1500/platform.c63
-rw-r--r--arch/mips/ar7/clock.c109
-rw-r--r--arch/mips/ar7/gpio.c113
-rw-r--r--arch/mips/ar7/memory.c3
-rw-r--r--arch/mips/ar7/platform.c713
-rw-r--r--arch/mips/ar7/prom.c78
-rw-r--r--arch/mips/ar7/setup.c15
-rw-r--r--arch/mips/ar7/time.c12
-rw-r--r--arch/mips/bcm47xx/gpio.c1
-rw-r--r--arch/mips/bcm47xx/prom.c9
-rw-r--r--arch/mips/bcm47xx/setup.c1
-rw-r--r--arch/mips/bcm47xx/wgt634u.c1
-rw-r--r--arch/mips/bcm63xx/boards/board_bcm963xx.c1
-rw-r--r--arch/mips/bcm63xx/timer.c34
-rw-r--r--arch/mips/boot/compressed/Makefile11
-rw-r--r--arch/mips/boot/compressed/dbg.c4
-rw-r--r--arch/mips/boot/compressed/decompress.c4
-rw-r--r--arch/mips/boot/compressed/uart-alchemy.c7
-rw-r--r--arch/mips/cavium-octeon/dma-octeon.c10
-rw-r--r--arch/mips/cavium-octeon/executive/cvmx-bootmem.c6
-rw-r--r--arch/mips/cavium-octeon/executive/cvmx-sysinfo.c1
-rw-r--r--arch/mips/cavium-octeon/octeon-irq.c160
-rw-r--r--arch/mips/cavium-octeon/octeon-platform.c85
-rw-r--r--arch/mips/cavium-octeon/smp.c2
-rw-r--r--arch/mips/cobalt/pci.c2
-rw-r--r--arch/mips/configs/db1000_defconfig1150
-rw-r--r--arch/mips/configs/db1100_defconfig1137
-rw-r--r--arch/mips/configs/db1200_defconfig1578
-rw-r--r--arch/mips/configs/db1500_defconfig1372
-rw-r--r--arch/mips/configs/db1550_defconfig1380
-rw-r--r--arch/mips/configs/lemote2f_defconfig964
-rw-r--r--arch/mips/configs/pb1100_defconfig1159
-rw-r--r--arch/mips/configs/pb1200_defconfig1568
-rw-r--r--arch/mips/configs/pb1500_defconfig1324
-rw-r--r--arch/mips/configs/pb1550_defconfig1354
-rw-r--r--arch/mips/dec/kn01-berr.c10
-rw-r--r--arch/mips/dec/prom/locore.S1
-rw-r--r--arch/mips/include/asm/atomic.h16
-rw-r--r--arch/mips/include/asm/barrier.h60
-rw-r--r--arch/mips/include/asm/bitops.h8
-rw-r--r--arch/mips/include/asm/cmpxchg.h10
-rw-r--r--arch/mips/include/asm/cpu-features.h3
-rw-r--r--arch/mips/include/asm/cpu.h2
-rw-r--r--arch/mips/include/asm/current.h24
-rw-r--r--arch/mips/include/asm/dec/kn01.h1
-rw-r--r--arch/mips/include/asm/device.h1
-rw-r--r--arch/mips/include/asm/elf.h14
-rw-r--r--arch/mips/include/asm/ftrace.h2
-rw-r--r--arch/mips/include/asm/i8259.h6
-rw-r--r--arch/mips/include/asm/io.h18
-rw-r--r--arch/mips/include/asm/mach-ar7/ar7.h23
-rw-r--r--arch/mips/include/asm/mach-ar7/gpio.h86
-rw-r--r--arch/mips/include/asm/mach-au1x00/au1000.h876
-rw-r--r--arch/mips/include/asm/mach-au1x00/au1100_mmc.h2
-rw-r--r--arch/mips/include/asm/mach-au1x00/au1xxx_dbdma.h23
-rw-r--r--arch/mips/include/asm/mach-au1x00/au1xxx_eth.h17
-rw-r--r--arch/mips/include/asm/mach-au1x00/gpio-au1000.h164
-rw-r--r--arch/mips/include/asm/mach-au1x00/gpio.h2
-rw-r--r--arch/mips/include/asm/mach-au1x00/ioremap.h2
-rw-r--r--arch/mips/include/asm/mach-au1x00/prom.h1
-rw-r--r--arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h1
-rw-r--r--arch/mips/include/asm/mach-cavium-octeon/cpu-feature-overrides.h3
-rw-r--r--arch/mips/include/asm/mach-db1x00/bcsr.h238
-rw-r--r--arch/mips/include/asm/mach-db1x00/db1200.h156
-rw-r--r--arch/mips/include/asm/mach-db1x00/db1x00.h100
-rw-r--r--arch/mips/include/asm/mach-loongson/cpu-feature-overrides.h2
-rw-r--r--arch/mips/include/asm/mach-loongson/cs5536/cs5536_vsm.h2
-rw-r--r--arch/mips/include/asm/mach-loongson/loongson.h5
-rw-r--r--arch/mips/include/asm/mach-loongson/machine.h4
-rw-r--r--arch/mips/include/asm/mach-loongson/mem.h2
-rw-r--r--arch/mips/include/asm/mach-loongson/pci.h13
-rw-r--r--arch/mips/include/asm/mach-pb1x00/pb1100.h85
-rw-r--r--arch/mips/include/asm/mach-pb1x00/pb1200.h122
-rw-r--r--arch/mips/include/asm/mach-pb1x00/pb1500.h49
-rw-r--r--arch/mips/include/asm/mach-pb1x00/pb1550.h96
-rw-r--r--arch/mips/include/asm/mach-pnx833x/irq-mapping.h1
-rw-r--r--arch/mips/include/asm/mach-powertv/interrupts.h1
-rw-r--r--arch/mips/include/asm/mipsregs.h15
-rw-r--r--arch/mips/include/asm/msc01_ic.h1
-rw-r--r--arch/mips/include/asm/nile4.h1
-rw-r--r--arch/mips/include/asm/octeon/octeon-feature.h8
-rw-r--r--arch/mips/include/asm/octeon/octeon.h5
-rw-r--r--arch/mips/include/asm/page.h12
-rw-r--r--arch/mips/include/asm/param.h17
-rw-r--r--arch/mips/include/asm/parport.h16
-rw-r--r--arch/mips/include/asm/pgalloc.h4
-rw-r--r--arch/mips/include/asm/pgtable-32.h4
-rw-r--r--arch/mips/include/asm/pgtable-64.h40
-rw-r--r--arch/mips/include/asm/pgtable-bits.h120
-rw-r--r--arch/mips/include/asm/pgtable.h31
-rw-r--r--arch/mips/include/asm/pmc-sierra/msp71xx/msp_prom.h1
-rw-r--r--arch/mips/include/asm/serial.h23
-rw-r--r--arch/mips/include/asm/sgialib.h45
-rw-r--r--arch/mips/include/asm/sibyte/bigsur.h1
-rw-r--r--arch/mips/include/asm/sibyte/sb1250_ldt.h1
-rw-r--r--arch/mips/include/asm/sn/klkernvars.h1
-rw-r--r--arch/mips/include/asm/sparsemem.h1
-rw-r--r--arch/mips/include/asm/spinlock.h120
-rw-r--r--arch/mips/include/asm/spinlock_types.h24
-rw-r--r--arch/mips/include/asm/system.h4
-rw-r--r--arch/mips/include/asm/txx9/generic.h1
-rw-r--r--arch/mips/include/asm/uasm.h (renamed from arch/mips/mm/uasm.h)4
-rw-r--r--arch/mips/include/asm/ucontext.h22
-rw-r--r--arch/mips/jazz/irq.c10
-rw-r--r--arch/mips/kernel/Makefile1
-rw-r--r--arch/mips/kernel/asm-offsets.c4
-rw-r--r--arch/mips/kernel/cevt-gt641xx.c10
-rw-r--r--arch/mips/kernel/cpu-probe.c30
-rw-r--r--arch/mips/kernel/ftrace.c2
-rw-r--r--arch/mips/kernel/i8259.c22
-rw-r--r--arch/mips/kernel/irq-gt641xx.c18
-rw-r--r--arch/mips/kernel/linux32.c1
-rw-r--r--arch/mips/kernel/mcount.S2
-rw-r--r--arch/mips/kernel/octeon_switch.S1
-rw-r--r--arch/mips/kernel/rtlx.c1
-rw-r--r--arch/mips/kernel/spinlock_test.c141
-rw-r--r--arch/mips/kernel/traps.c23
-rw-r--r--arch/mips/kernel/vpe.c1
-rw-r--r--arch/mips/lasat/picvue.h1
-rw-r--r--arch/mips/loongson/common/cmdline.c9
-rw-r--r--arch/mips/loongson/common/cs5536/cs5536_acc.c2
-rw-r--r--arch/mips/loongson/common/cs5536/cs5536_ehci.c2
-rw-r--r--arch/mips/loongson/common/cs5536/cs5536_ide.c2
-rw-r--r--arch/mips/loongson/common/cs5536/cs5536_isa.c2
-rw-r--r--arch/mips/loongson/common/cs5536/cs5536_mfgpt.c2
-rw-r--r--arch/mips/loongson/common/cs5536/cs5536_ohci.c2
-rw-r--r--arch/mips/loongson/common/cs5536/cs5536_pci.c2
-rw-r--r--arch/mips/loongson/common/early_printk.c2
-rw-r--r--arch/mips/loongson/common/env.c29
-rw-r--r--arch/mips/loongson/common/init.c2
-rw-r--r--arch/mips/loongson/common/machtype.c12
-rw-r--r--arch/mips/loongson/common/mem.c7
-rw-r--r--arch/mips/loongson/common/platform.c2
-rw-r--r--arch/mips/loongson/common/pm.c2
-rw-r--r--arch/mips/loongson/common/reset.c20
-rw-r--r--arch/mips/loongson/common/serial.c2
-rw-r--r--arch/mips/loongson/common/time.c4
-rw-r--r--arch/mips/loongson/common/uart_base.c2
-rw-r--r--arch/mips/loongson/fuloong-2e/reset.c4
-rw-r--r--arch/mips/loongson/lemote-2f/Makefile2
-rw-r--r--arch/mips/loongson/lemote-2f/ec_kb3310b.c4
-rw-r--r--arch/mips/loongson/lemote-2f/irq.c4
-rw-r--r--arch/mips/loongson/lemote-2f/machtype.c45
-rw-r--r--arch/mips/loongson/lemote-2f/pm.c2
-rw-r--r--arch/mips/loongson/lemote-2f/reset.c2
-rw-r--r--arch/mips/math-emu/ieee754d.c1
-rw-r--r--arch/mips/math-emu/ieee754dp.c1
-rw-r--r--arch/mips/math-emu/ieee754sp.c1
-rw-r--r--arch/mips/math-emu/ieee754xcpt.c1
-rw-r--r--arch/mips/mm/c-octeon.c8
-rw-r--r--arch/mips/mm/cache.c53
-rw-r--r--arch/mips/mm/fault.c27
-rw-r--r--arch/mips/mm/highmem.c1
-rw-r--r--arch/mips/mm/hugetlbpage.c1
-rw-r--r--arch/mips/mm/init.c6
-rw-r--r--arch/mips/mm/page.c2
-rw-r--r--arch/mips/mm/pgtable-64.c44
-rw-r--r--arch/mips/mm/tlb-r4k.c84
-rw-r--r--arch/mips/mm/tlbex.c188
-rw-r--r--arch/mips/mm/uasm.c12
-rw-r--r--arch/mips/mti-malta/malta-int.c6
-rw-r--r--arch/mips/nxp/pnx833x/common/interrupts.c37
-rw-r--r--arch/mips/nxp/pnx833x/common/prom.c6
-rw-r--r--arch/mips/nxp/pnx8550/common/prom.c1
-rw-r--r--arch/mips/oprofile/common.c7
-rw-r--r--arch/mips/oprofile/op_model_loongson2.c9
-rw-r--r--arch/mips/pci/fixup-cobalt.c61
-rw-r--r--arch/mips/pci/fixup-lemote2f.c2
-rw-r--r--arch/mips/pci/ops-loongson2.c4
-rw-r--r--arch/mips/pci/ops-pmcmsp.c2
-rw-r--r--arch/mips/pci/pci-bcm47xx.c1
-rw-r--r--arch/mips/pci/pci-octeon.c6
-rw-r--r--arch/mips/pci/pci.c8
-rw-r--r--arch/mips/pmc-sierra/msp71xx/msp_irq_cic.c1
-rw-r--r--arch/mips/pmc-sierra/msp71xx/msp_prom.c6
-rw-r--r--arch/mips/pmc-sierra/yosemite/atmel_read_eeprom.c2
-rw-r--r--arch/mips/pmc-sierra/yosemite/atmel_read_eeprom.h1
-rw-r--r--arch/mips/pmc-sierra/yosemite/ht.c10
-rw-r--r--arch/mips/pmc-sierra/yosemite/smp.c8
-rw-r--r--arch/mips/power/cpu.c4
-rw-r--r--arch/mips/power/hibernate.S4
-rw-r--r--arch/mips/powertv/asic/asic_devices.c4
-rw-r--r--arch/mips/powertv/asic/asic_int.c6
-rw-r--r--arch/mips/powertv/powertv_setup.c102
-rw-r--r--arch/mips/sgi-ip27/ip27-klnuma.c1
-rw-r--r--arch/mips/sgi-ip27/ip27-nmi.c7
-rw-r--r--arch/mips/sgi-ip32/ip32-irq.c9
-rw-r--r--arch/mips/sibyte/bcm1480/irq.c14
-rw-r--r--arch/mips/sibyte/common/sb_tbprof.c1
-rw-r--r--arch/mips/sibyte/sb1250/irq.c14
-rw-r--r--arch/mips/sni/rm200.c22
-rw-r--r--arch/mips/txx9/generic/setup.c5
-rw-r--r--arch/mips/txx9/jmr3927/setup.c7
-rw-r--r--arch/mips/txx9/rbtx4927/setup.c7
-rw-r--r--arch/mips/txx9/rbtx4938/setup.c6
-rw-r--r--arch/mn10300/include/asm/pgtable.h2
-rw-r--r--arch/mn10300/mm/mmu-context.c3
-rw-r--r--arch/mn10300/unit-asb2305/pci-asb2305.c16
-rw-r--r--arch/mn10300/unit-asb2305/pci.c6
-rw-r--r--arch/parisc/Kconfig1
-rw-r--r--arch/parisc/include/asm/cacheflush.h12
-rw-r--r--arch/parisc/include/asm/pgtable.h2
-rw-r--r--arch/parisc/kernel/cache.c4
-rw-r--r--arch/parisc/kernel/pci.c17
-rw-r--r--arch/powerpc/Kconfig30
-rw-r--r--arch/powerpc/boot/dts/arches.dts12
-rw-r--r--arch/powerpc/boot/dts/gef_ppc9a.dts16
-rw-r--r--arch/powerpc/boot/dts/gef_sbc310.dts19
-rw-r--r--arch/powerpc/boot/dts/gef_sbc610.dts66
-rw-r--r--arch/powerpc/boot/dts/glacier.dts76
-rw-r--r--arch/powerpc/boot/dts/katmai.dts71
-rw-r--r--arch/powerpc/boot/dts/mpc5121ads.dts55
-rw-r--r--arch/powerpc/boot/dts/mpc8568mds.dts65
-rw-r--r--arch/powerpc/configs/44x/katmai_defconfig94
-rw-r--r--arch/powerpc/configs/86xx/gef_ppc9a_defconfig47
-rw-r--r--arch/powerpc/configs/86xx/gef_sbc610_defconfig65
-rw-r--r--arch/powerpc/configs/mpc512x_defconfig1694
-rw-r--r--arch/powerpc/configs/ppc64_defconfig75
-rw-r--r--arch/powerpc/configs/pseries_defconfig63
-rw-r--r--arch/powerpc/include/asm/asm-compat.h5
-rw-r--r--arch/powerpc/include/asm/atomic.h48
-rw-r--r--arch/powerpc/include/asm/bitops.h56
-rw-r--r--arch/powerpc/include/asm/cputable.h4
-rw-r--r--arch/powerpc/include/asm/cputime.h7
-rw-r--r--arch/powerpc/include/asm/feature-fixups.h2
-rw-r--r--arch/powerpc/include/asm/futex.h6
-rw-r--r--arch/powerpc/include/asm/hardirq.h30
-rw-r--r--arch/powerpc/include/asm/local.h12
-rw-r--r--arch/powerpc/include/asm/mpc5121.h24
-rw-r--r--arch/powerpc/include/asm/mpc52xx_psc.h4
-rw-r--r--arch/powerpc/include/asm/mpic.h2
-rw-r--r--arch/powerpc/include/asm/mutex.h6
-rw-r--r--arch/powerpc/include/asm/param.h23
-rw-r--r--arch/powerpc/include/asm/pgtable.h2
-rw-r--r--arch/powerpc/include/asm/pmac_feature.h2
-rw-r--r--arch/powerpc/include/asm/ppc-opcode.h18
-rw-r--r--arch/powerpc/include/asm/ppc-pci.h5
-rw-r--r--arch/powerpc/include/asm/processor.h36
-rw-r--r--arch/powerpc/include/asm/prom.h18
-rw-r--r--arch/powerpc/include/asm/ptrace.h77
-rw-r--r--arch/powerpc/include/asm/reg_booke.h96
-rw-r--r--arch/powerpc/include/asm/spinlock.h32
-rw-r--r--arch/powerpc/include/asm/synch.h12
-rw-r--r--arch/powerpc/include/asm/system.h21
-rw-r--r--arch/powerpc/include/asm/topology.h48
-rw-r--r--arch/powerpc/kernel/entry_64.S3
-rw-r--r--arch/powerpc/kernel/firmware.c2
-rw-r--r--arch/powerpc/kernel/head_fsl_booke.S4
-rw-r--r--arch/powerpc/kernel/irq.c140
-rw-r--r--arch/powerpc/kernel/kgdb.c2
-rw-r--r--arch/powerpc/kernel/kprobes.c4
-rw-r--r--arch/powerpc/kernel/lparcfg.c10
-rw-r--r--arch/powerpc/kernel/nvram_64.c6
-rw-r--r--arch/powerpc/kernel/of_platform.c2
-rw-r--r--arch/powerpc/kernel/pci-common.c24
-rw-r--r--arch/powerpc/kernel/pci_64.c2
-rw-r--r--arch/powerpc/kernel/pci_of_scan.c2
-rw-r--r--arch/powerpc/kernel/perf_callchain.c3
-rw-r--r--arch/powerpc/kernel/perf_event.c10
-rw-r--r--arch/powerpc/kernel/pmc.c10
-rw-r--r--arch/powerpc/kernel/process.c116
-rw-r--r--arch/powerpc/kernel/prom.c887
-rw-r--r--arch/powerpc/kernel/prom_init.c81
-rw-r--r--arch/powerpc/kernel/ptrace.c516
-rw-r--r--arch/powerpc/kernel/signal.c6
-rw-r--r--arch/powerpc/kernel/signal_32.c16
-rw-r--r--arch/powerpc/kernel/time.c10
-rw-r--r--arch/powerpc/kernel/traps.c128
-rw-r--r--arch/powerpc/lib/copypage_64.S28
-rw-r--r--arch/powerpc/lib/copyuser_64.S80
-rw-r--r--arch/powerpc/lib/feature-fixups.c3
-rw-r--r--arch/powerpc/mm/40x_mmu.c4
-rw-r--r--arch/powerpc/mm/hash_native_64.c19
-rw-r--r--arch/powerpc/mm/mem.c4
-rw-r--r--arch/powerpc/mm/mmu_context_hash64.c10
-rw-r--r--arch/powerpc/mm/mmu_context_nohash.c14
-rw-r--r--arch/powerpc/mm/tlb_low_64e.S2
-rw-r--r--arch/powerpc/mm/tlb_nohash.c6
-rw-r--r--arch/powerpc/platforms/512x/clock.c6
-rw-r--r--arch/powerpc/platforms/512x/mpc5121_ads.c3
-rw-r--r--arch/powerpc/platforms/512x/mpc5121_ads_cpld.c2
-rw-r--r--arch/powerpc/platforms/512x/mpc5121_generic.c3
-rw-r--r--arch/powerpc/platforms/512x/mpc512x.h3
-rw-r--r--arch/powerpc/platforms/512x/mpc512x_shared.c43
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_mds.c6
-rw-r--r--arch/powerpc/platforms/85xx/smp.c21
-rw-r--r--arch/powerpc/platforms/85xx/socrates_fpga_pic.c2
-rw-r--r--arch/powerpc/platforms/85xx/stx_gp3.c2
-rw-r--r--arch/powerpc/platforms/85xx/xes_mpc85xx.c4
-rw-r--r--arch/powerpc/platforms/cell/beat_htab.c24
-rw-r--r--arch/powerpc/platforms/cell/beat_interrupt.c20
-rw-r--r--arch/powerpc/platforms/cell/cbe_powerbutton.c2
-rw-r--r--arch/powerpc/platforms/cell/interrupt.c4
-rw-r--r--arch/powerpc/platforms/cell/ras.c2
-rw-r--r--arch/powerpc/platforms/cell/spider-pic.c2
-rw-r--r--arch/powerpc/platforms/cell/spu_manage.c6
-rw-r--r--arch/powerpc/platforms/fsl_uli1575.c12
-rw-r--r--arch/powerpc/platforms/iseries/irq.c2
-rw-r--r--arch/powerpc/platforms/iseries/proc.c2
-rw-r--r--arch/powerpc/platforms/iseries/setup.c2
-rw-r--r--arch/powerpc/platforms/pasemi/cpufreq.c4
-rw-r--r--arch/powerpc/platforms/powermac/bootx_init.c4
-rw-r--r--arch/powerpc/platforms/powermac/cpufreq_32.c14
-rw-r--r--arch/powerpc/platforms/powermac/cpufreq_64.c14
-rw-r--r--arch/powerpc/platforms/powermac/feature.c8
-rw-r--r--arch/powerpc/platforms/powermac/nvram.c14
-rw-r--r--arch/powerpc/platforms/powermac/pfunc_base.c24
-rw-r--r--arch/powerpc/platforms/powermac/pfunc_core.c2
-rw-r--r--arch/powerpc/platforms/powermac/pic.c40
-rw-r--r--arch/powerpc/platforms/powermac/smp.c12
-rw-r--r--arch/powerpc/platforms/powermac/time.c8
-rw-r--r--arch/powerpc/platforms/powermac/udbg_scc.c6
-rw-r--r--arch/powerpc/platforms/pseries/eeh.c18
-rw-r--r--arch/powerpc/platforms/pseries/eeh_driver.c10
-rw-r--r--arch/powerpc/platforms/pseries/eeh_event.c2
-rw-r--r--arch/powerpc/platforms/pseries/hotplug-cpu.c22
-rw-r--r--arch/powerpc/platforms/pseries/hvCall_inst.c4
-rw-r--r--arch/powerpc/platforms/pseries/pci_dlpar.c2
-rw-r--r--arch/powerpc/platforms/pseries/phyp_dump.c6
-rw-r--r--arch/powerpc/platforms/pseries/smp.c4
-rw-r--r--arch/powerpc/platforms/pseries/xics.c32
-rw-r--r--arch/powerpc/sysdev/cpm1.c2
-rw-r--r--arch/powerpc/sysdev/cpm2_pic.c2
-rw-r--r--arch/powerpc/sysdev/fsl_msi.c2
-rw-r--r--arch/powerpc/sysdev/grackle.c4
-rw-r--r--arch/powerpc/sysdev/i8259.c24
-rw-r--r--arch/powerpc/sysdev/ipic.c22
-rw-r--r--arch/powerpc/sysdev/mpc8xx_pic.c2
-rw-r--r--arch/powerpc/sysdev/mpic.c40
-rw-r--r--arch/powerpc/sysdev/mpic_pasemi_msi.c2
-rw-r--r--arch/powerpc/sysdev/mv64x60_dev.c3
-rw-r--r--arch/powerpc/sysdev/ppc4xx_soc.c3
-rw-r--r--arch/powerpc/sysdev/qe_lib/qe_ic.c4
-rw-r--r--arch/powerpc/sysdev/qe_lib/qe_io.c8
-rw-r--r--arch/powerpc/sysdev/uic.c2
-rw-r--r--arch/powerpc/xmon/xmon.c2
-rw-r--r--arch/s390/Kconfig7
-rw-r--r--arch/s390/Kconfig.debug13
-rw-r--r--arch/s390/Makefile13
-rw-r--r--arch/s390/boot/Makefile8
-rw-r--r--arch/s390/boot/compressed/Makefile60
-rw-r--r--arch/s390/boot/compressed/head31.S51
-rw-r--r--arch/s390/boot/compressed/head64.S48
-rw-r--r--arch/s390/boot/compressed/misc.c158
-rw-r--r--arch/s390/boot/compressed/vmlinux.lds.S55
-rw-r--r--arch/s390/boot/compressed/vmlinux.scr10
-rw-r--r--arch/s390/crypto/aes_s390.c6
-rw-r--r--arch/s390/defconfig7
-rw-r--r--arch/s390/hypfs/hypfs_diag.c4
-rw-r--r--arch/s390/include/asm/atomic.h86
-rw-r--r--arch/s390/include/asm/bitops.h83
-rw-r--r--arch/s390/include/asm/bug.h10
-rw-r--r--arch/s390/include/asm/crw.h1
-rw-r--r--arch/s390/include/asm/etr.h12
-rw-r--r--arch/s390/include/asm/irqflags.h36
-rw-r--r--arch/s390/include/asm/lowcore.h250
-rw-r--r--arch/s390/include/asm/page.h3
-rw-r--r--arch/s390/include/asm/pgtable.h2
-rw-r--r--arch/s390/include/asm/processor.h18
-rw-r--r--arch/s390/include/asm/ptrace.h13
-rw-r--r--arch/s390/include/asm/qdio.h3
-rw-r--r--arch/s390/include/asm/rwsem.h147
-rw-r--r--arch/s390/include/asm/setup.h9
-rw-r--r--arch/s390/include/asm/sigp.h142
-rw-r--r--arch/s390/include/asm/smp.h38
-rw-r--r--arch/s390/include/asm/spinlock.h18
-rw-r--r--arch/s390/include/asm/swab.h16
-rw-r--r--arch/s390/include/asm/syscall.h7
-rw-r--r--arch/s390/include/asm/sysinfo.h3
-rw-r--r--arch/s390/include/asm/system.h168
-rw-r--r--arch/s390/include/asm/thread_info.h2
-rw-r--r--arch/s390/include/asm/timex.h22
-rw-r--r--arch/s390/include/asm/uaccess.h12
-rw-r--r--arch/s390/include/asm/vdso.h2
-rw-r--r--arch/s390/kernel/Makefile3
-rw-r--r--arch/s390/kernel/asm-offsets.c99
-rw-r--r--arch/s390/kernel/base.S2
-rw-r--r--arch/s390/kernel/dis.c369
-rw-r--r--arch/s390/kernel/early.c22
-rw-r--r--arch/s390/kernel/entry.S1
-rw-r--r--arch/s390/kernel/entry64.S2
-rw-r--r--arch/s390/kernel/ftrace.c12
-rw-r--r--arch/s390/kernel/head.S60
-rw-r--r--arch/s390/kernel/head31.S16
-rw-r--r--arch/s390/kernel/head64.S92
-rw-r--r--arch/s390/kernel/ipl.c41
-rw-r--r--arch/s390/kernel/machine_kexec.c10
-rw-r--r--arch/s390/kernel/ptrace.c58
-rw-r--r--arch/s390/kernel/reipl.S2
-rw-r--r--arch/s390/kernel/reipl64.S2
-rw-r--r--arch/s390/kernel/sclp.S36
-rw-r--r--arch/s390/kernel/setup.c11
-rw-r--r--arch/s390/kernel/smp.c108
-rw-r--r--arch/s390/kernel/switch_cpu.S58
-rw-r--r--arch/s390/kernel/switch_cpu64.S51
-rw-r--r--arch/s390/kernel/swsusp_asm64.S2
-rw-r--r--arch/s390/kernel/time.c8
-rw-r--r--arch/s390/kernel/vdso.c1
-rw-r--r--arch/s390/kvm/diag.c4
-rw-r--r--arch/s390/kvm/intercept.c18
-rw-r--r--arch/s390/kvm/interrupt.c12
-rw-r--r--arch/s390/kvm/kvm-s390.c23
-rw-r--r--arch/s390/kvm/priv.c2
-rw-r--r--arch/s390/kvm/sigp.c4
-rw-r--r--arch/s390/lib/Makefile2
-rw-r--r--arch/s390/lib/spinlock.c53
-rw-r--r--arch/s390/lib/usercopy.c8
-rw-r--r--arch/s390/mm/extmem.c12
-rw-r--r--arch/s390/mm/fault.c5
-rw-r--r--arch/s390/mm/init.c33
-rw-r--r--arch/score/include/asm/pgtable.h3
-rw-r--r--arch/score/mm/init.c2
-rw-r--r--arch/sh/Kconfig32
-rw-r--r--arch/sh/Kconfig.cpu3
-rw-r--r--arch/sh/Makefile10
-rw-r--r--arch/sh/boards/Kconfig8
-rw-r--r--arch/sh/boards/Makefile1
-rw-r--r--arch/sh/boards/board-magicpanelr2.c74
-rw-r--r--arch/sh/boards/board-polaris.c37
-rw-r--r--arch/sh/boards/board-sh7785lcr.c32
-rw-r--r--arch/sh/boards/board-shmin.c4
-rw-r--r--arch/sh/boards/board-titan.c (renamed from arch/sh/boards/mach-titan/setup.c)24
-rw-r--r--arch/sh/boards/board-urquell.c46
-rw-r--r--arch/sh/boards/mach-ap325rxa/setup.c24
-rw-r--r--arch/sh/boards/mach-cayman/irq.c16
-rw-r--r--arch/sh/boards/mach-dreamcast/irq.c27
-rw-r--r--arch/sh/boards/mach-dreamcast/rtc.c20
-rw-r--r--arch/sh/boards/mach-dreamcast/setup.c18
-rw-r--r--arch/sh/boards/mach-ecovec24/sdram.S59
-rw-r--r--arch/sh/boards/mach-ecovec24/setup.c87
-rw-r--r--arch/sh/boards/mach-highlander/irq-r7780mp.c2
-rw-r--r--arch/sh/boards/mach-highlander/irq-r7780rp.c2
-rw-r--r--arch/sh/boards/mach-highlander/irq-r7785rp.c16
-rw-r--r--arch/sh/boards/mach-highlander/psw.c4
-rw-r--r--arch/sh/boards/mach-highlander/setup.c14
-rw-r--r--arch/sh/boards/mach-hp6xx/hp6xx_apm.c2
-rw-r--r--arch/sh/boards/mach-hp6xx/pm.c38
-rw-r--r--arch/sh/boards/mach-hp6xx/setup.c12
-rw-r--r--arch/sh/boards/mach-kfr2r09/setup.c16
-rw-r--r--arch/sh/boards/mach-landisk/gio.c12
-rw-r--r--arch/sh/boards/mach-landisk/irq.c6
-rw-r--r--arch/sh/boards/mach-landisk/psw.c4
-rw-r--r--arch/sh/boards/mach-landisk/setup.c6
-rw-r--r--arch/sh/boards/mach-lboxre2/setup.c4
-rw-r--r--arch/sh/boards/mach-microdev/io.c4
-rw-r--r--arch/sh/boards/mach-microdev/irq.c10
-rw-r--r--arch/sh/boards/mach-migor/setup.c24
-rw-r--r--arch/sh/boards/mach-r2d/irq.c4
-rw-r--r--arch/sh/boards/mach-r2d/setup.c8
-rw-r--r--arch/sh/boards/mach-rsk/devices-rsk7203.c2
-rw-r--r--arch/sh/boards/mach-sdk7780/irq.c4
-rw-r--r--arch/sh/boards/mach-sdk7780/setup.c29
-rw-r--r--arch/sh/boards/mach-sdk7786/Makefile1
-rw-r--r--arch/sh/boards/mach-sdk7786/fpga.c72
-rw-r--r--arch/sh/boards/mach-sdk7786/irq.c48
-rw-r--r--arch/sh/boards/mach-sdk7786/setup.c189
-rw-r--r--arch/sh/boards/mach-se/7206/io.c2
-rw-r--r--arch/sh/boards/mach-se/7206/irq.c43
-rw-r--r--arch/sh/boards/mach-se/7206/setup.c15
-rw-r--r--arch/sh/boards/mach-se/7343/irq.c45
-rw-r--r--arch/sh/boards/mach-se/7343/setup.c43
-rw-r--r--arch/sh/boards/mach-se/770x/irq.c14
-rw-r--r--arch/sh/boards/mach-se/770x/setup.c15
-rw-r--r--arch/sh/boards/mach-se/7721/irq.c2
-rw-r--r--arch/sh/boards/mach-se/7721/setup.c23
-rw-r--r--arch/sh/boards/mach-se/7722/irq.c10
-rw-r--r--arch/sh/boards/mach-se/7722/setup.c55
-rw-r--r--arch/sh/boards/mach-se/7724/irq.c62
-rw-r--r--arch/sh/boards/mach-se/7724/sdram.S79
-rw-r--r--arch/sh/boards/mach-se/7724/setup.c114
-rw-r--r--arch/sh/boards/mach-se/7780/irq.c18
-rw-r--r--arch/sh/boards/mach-se/7780/setup.c47
-rw-r--r--arch/sh/boards/mach-sh03/rtc.c50
-rw-r--r--arch/sh/boards/mach-sh03/setup.c2
-rw-r--r--arch/sh/boards/mach-sh7763rdp/irq.c10
-rw-r--r--arch/sh/boards/mach-sh7763rdp/setup.c40
-rw-r--r--arch/sh/boards/mach-snapgear/setup.c2
-rw-r--r--arch/sh/boards/mach-systemh/irq.c12
-rw-r--r--arch/sh/boards/mach-titan/Makefile5
-rw-r--r--arch/sh/boards/mach-titan/io.c108
-rw-r--r--arch/sh/boards/mach-x3proto/ilsel.c8
-rw-r--r--arch/sh/boards/mach-x3proto/setup.c2
-rw-r--r--arch/sh/boot/Makefile30
-rw-r--r--arch/sh/boot/compressed/Makefile7
-rw-r--r--arch/sh/boot/compressed/misc.c23
-rw-r--r--arch/sh/cchips/hd6446x/hd64461.c36
-rw-r--r--arch/sh/configs/sdk7786_defconfig1754
-rw-r--r--arch/sh/drivers/dma/dma-pvr2.c10
-rw-r--r--arch/sh/drivers/dma/dma-sh.c31
-rw-r--r--arch/sh/drivers/dma/dmabrg.c22
-rw-r--r--arch/sh/drivers/heartbeat.c22
-rw-r--r--arch/sh/drivers/pci/Makefile5
-rw-r--r--arch/sh/drivers/pci/common.c162
-rw-r--r--arch/sh/drivers/pci/fixups-dreamcast.c2
-rw-r--r--arch/sh/drivers/pci/fixups-r7780rp.c12
-rw-r--r--arch/sh/drivers/pci/fixups-rts7751r2d.c4
-rw-r--r--arch/sh/drivers/pci/fixups-sdk7780.c19
-rw-r--r--arch/sh/drivers/pci/fixups-se7751.c6
-rw-r--r--arch/sh/drivers/pci/ops-sh4.c30
-rw-r--r--arch/sh/drivers/pci/pci-dreamcast.c32
-rw-r--r--arch/sh/drivers/pci/pci-sh4.h18
-rw-r--r--arch/sh/drivers/pci/pci-sh5.c19
-rw-r--r--arch/sh/drivers/pci/pci-sh5.h12
-rw-r--r--arch/sh/drivers/pci/pci-sh7751.c52
-rw-r--r--arch/sh/drivers/pci/pci-sh7780.c408
-rw-r--r--arch/sh/drivers/pci/pci-sh7780.h64
-rw-r--r--arch/sh/drivers/pci/pci.c173
-rw-r--r--arch/sh/drivers/pci/pcie-sh7786.c205
-rw-r--r--arch/sh/drivers/pci/pcie-sh7786.h74
-rw-r--r--arch/sh/drivers/superhyway/ops-sh4-202.c8
-rw-r--r--arch/sh/include/asm/Kbuild4
-rw-r--r--arch/sh/include/asm/addrspace.h18
-rw-r--r--arch/sh/include/asm/alignment.h21
-rw-r--r--arch/sh/include/asm/atomic-grb.h46
-rw-r--r--arch/sh/include/asm/atomic-llsc.h27
-rw-r--r--arch/sh/include/asm/atomic.h73
-rw-r--r--arch/sh/include/asm/cacheflush.h8
-rw-r--r--arch/sh/include/asm/clock.h11
-rw-r--r--arch/sh/include/asm/cmpxchg-grb.h7
-rw-r--r--arch/sh/include/asm/dma-mapping.h2
-rw-r--r--arch/sh/include/asm/dma-sh.h55
-rw-r--r--arch/sh/include/asm/dwarf.h19
-rw-r--r--arch/sh/include/asm/fixmap.h15
-rw-r--r--arch/sh/include/asm/fpu.h35
-rw-r--r--arch/sh/include/asm/hw_breakpoint.h67
-rw-r--r--arch/sh/include/asm/io.h169
-rw-r--r--arch/sh/include/asm/kdebug.h2
-rw-r--r--arch/sh/include/asm/mmu.h49
-rw-r--r--arch/sh/include/asm/mmu_context.h6
-rw-r--r--arch/sh/include/asm/mmu_context_32.h4
-rw-r--r--arch/sh/include/asm/module.h17
-rw-r--r--arch/sh/include/asm/page.h19
-rw-r--r--arch/sh/include/asm/pci.h59
-rw-r--r--arch/sh/include/asm/pgalloc.h32
-rw-r--r--arch/sh/include/asm/pgtable-2level.h23
-rw-r--r--arch/sh/include/asm/pgtable-3level.h56
-rw-r--r--arch/sh/include/asm/pgtable.h29
-rw-r--r--arch/sh/include/asm/pgtable_32.h4
-rw-r--r--arch/sh/include/asm/pgtable_64.h26
-rw-r--r--arch/sh/include/asm/processor.h21
-rw-r--r--arch/sh/include/asm/processor_32.h35
-rw-r--r--arch/sh/include/asm/processor_64.h23
-rw-r--r--arch/sh/include/asm/ptrace.h20
-rw-r--r--arch/sh/include/asm/reboot.h21
-rw-r--r--arch/sh/include/asm/setup.h1
-rw-r--r--arch/sh/include/asm/sh_bios.h15
-rw-r--r--arch/sh/include/asm/siu.h26
-rw-r--r--arch/sh/include/asm/suspend.h1
-rw-r--r--arch/sh/include/asm/syscall.h2
-rw-r--r--arch/sh/include/asm/system.h9
-rw-r--r--arch/sh/include/asm/system_32.h15
-rw-r--r--arch/sh/include/asm/system_64.h10
-rw-r--r--arch/sh/include/asm/thread_info.h10
-rw-r--r--arch/sh/include/asm/tlb.h17
-rw-r--r--arch/sh/include/asm/ubc.h64
-rw-r--r--arch/sh/include/asm/uncached.h18
-rw-r--r--arch/sh/include/asm/vmlinux.lds.h8
-rw-r--r--arch/sh/include/asm/watchdog.h18
-rw-r--r--arch/sh/include/cpu-sh2/cpu/ubc.h32
-rw-r--r--arch/sh/include/cpu-sh2/cpu/watchdog.h4
-rw-r--r--arch/sh/include/cpu-sh3/cpu/dac.h12
-rw-r--r--arch/sh/include/cpu-sh3/cpu/dma.h20
-rw-r--r--arch/sh/include/cpu-sh3/cpu/ubc.h42
-rw-r--r--arch/sh/include/cpu-sh4/cpu/addrspace.h9
-rw-r--r--arch/sh/include/cpu-sh4/cpu/dma-sh4a.h108
-rw-r--r--arch/sh/include/cpu-sh4/cpu/dma.h35
-rw-r--r--arch/sh/include/cpu-sh4/cpu/mmu_context.h4
-rw-r--r--arch/sh/include/cpu-sh4/cpu/sq.h3
-rw-r--r--arch/sh/include/cpu-sh4/cpu/ubc.h64
-rw-r--r--arch/sh/include/mach-common/mach/magicpanelr2.h12
-rw-r--r--arch/sh/include/mach-dreamcast/mach/sysasic.h5
-rw-r--r--arch/sh/include/mach-sdk7786/mach/fpga.h114
-rw-r--r--arch/sh/include/mach-sdk7786/mach/irq.h7
-rw-r--r--arch/sh/include/mach-se/mach/se7343.h52
-rw-r--r--arch/sh/kernel/Makefile8
-rw-r--r--arch/sh/kernel/cpu/Makefile2
-rw-r--r--arch/sh/kernel/cpu/adc.c12
-rw-r--r--arch/sh/kernel/cpu/clock-cpg.c104
-rw-r--r--arch/sh/kernel/cpu/fpu.c84
-rw-r--r--arch/sh/kernel/cpu/init.c125
-rw-r--r--arch/sh/kernel/cpu/irq/intc-sh5.c14
-rw-r--r--arch/sh/kernel/cpu/sh2/clock-sh7619.c6
-rw-r--r--arch/sh/kernel/cpu/sh2a/clock-sh7201.c8
-rw-r--r--arch/sh/kernel/cpu/sh2a/clock-sh7203.c6
-rw-r--r--arch/sh/kernel/cpu/sh2a/clock-sh7206.c8
-rw-r--r--arch/sh/kernel/cpu/sh2a/fpu.c111
-rw-r--r--arch/sh/kernel/cpu/sh3/clock-sh3.c8
-rw-r--r--arch/sh/kernel/cpu/sh3/clock-sh7705.c8
-rw-r--r--arch/sh/kernel/cpu/sh3/clock-sh7706.c8
-rw-r--r--arch/sh/kernel/cpu/sh3/clock-sh7709.c8
-rw-r--r--arch/sh/kernel/cpu/sh3/clock-sh7710.c8
-rw-r--r--arch/sh/kernel/cpu/sh3/clock-sh7712.c6
-rw-r--r--arch/sh/kernel/cpu/sh3/ex.S2
-rw-r--r--arch/sh/kernel/cpu/sh3/probe.c28
-rw-r--r--arch/sh/kernel/cpu/sh3/setup-sh3.c2
-rw-r--r--arch/sh/kernel/cpu/sh4/clock-sh4-202.c10
-rw-r--r--arch/sh/kernel/cpu/sh4/clock-sh4.c8
-rw-r--r--arch/sh/kernel/cpu/sh4/fpu.c159
-rw-r--r--arch/sh/kernel/cpu/sh4/probe.c14
-rw-r--r--arch/sh/kernel/cpu/sh4/setup-sh4-202.c2
-rw-r--r--arch/sh/kernel/cpu/sh4/setup-sh7750.c2
-rw-r--r--arch/sh/kernel/cpu/sh4/setup-sh7760.c2
-rw-r--r--arch/sh/kernel/cpu/sh4/sq.c23
-rw-r--r--arch/sh/kernel/cpu/sh4a/Makefile9
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7343.c6
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7366.c6
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7722.c29
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7723.c30
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7724.c19
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7757.c8
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7763.c8
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7770.c8
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7780.c10
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7785.c6
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7786.c184
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-shx3.c10
-rw-r--r--arch/sh/kernel/cpu/sh4a/pinmux-sh7722.c21
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7722.c20
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7723.c39
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7724.c39
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7757.c26
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7763.c20
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7770.c24
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7780.c24
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7785.c26
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7786.c24
-rw-r--r--arch/sh/kernel/cpu/sh4a/smp-shx3.c5
-rw-r--r--arch/sh/kernel/cpu/sh4a/ubc.c133
-rw-r--r--arch/sh/kernel/cpu/sh5/clock-sh5.c8
-rw-r--r--arch/sh/kernel/cpu/sh5/entry.S6
-rw-r--r--arch/sh/kernel/cpu/sh5/fpu.c65
-rw-r--r--arch/sh/kernel/cpu/shmobile/pm.c3
-rw-r--r--arch/sh/kernel/cpu/shmobile/sleep.S121
-rw-r--r--arch/sh/kernel/debugtraps.S1
-rw-r--r--arch/sh/kernel/dwarf.c174
-rw-r--r--arch/sh/kernel/early_printk.c85
-rw-r--r--arch/sh/kernel/ftrace.c9
-rw-r--r--arch/sh/kernel/head_32.S221
-rw-r--r--arch/sh/kernel/head_64.S2
-rw-r--r--arch/sh/kernel/hw_breakpoint.c463
-rw-r--r--arch/sh/kernel/idle.c14
-rw-r--r--arch/sh/kernel/io_trapped.c18
-rw-r--r--arch/sh/kernel/kgdb.c46
-rw-r--r--arch/sh/kernel/machine_kexec.c16
-rw-r--r--arch/sh/kernel/perf_callchain.c3
-rw-r--r--arch/sh/kernel/process.c100
-rw-r--r--arch/sh/kernel/process_32.c164
-rw-r--r--arch/sh/kernel/process_64.c27
-rw-r--r--arch/sh/kernel/ptrace_32.c82
-rw-r--r--arch/sh/kernel/ptrace_64.c27
-rw-r--r--arch/sh/kernel/reboot.c98
-rw-r--r--arch/sh/kernel/setup.c12
-rw-r--r--arch/sh/kernel/sh_bios.c129
-rw-r--r--arch/sh/kernel/signal_32.c10
-rw-r--r--arch/sh/kernel/signal_64.c8
-rw-r--r--arch/sh/kernel/smp.c9
-rw-r--r--arch/sh/kernel/traps.c4
-rw-r--r--arch/sh/kernel/traps_32.c181
-rw-r--r--arch/sh/kernel/traps_64.c28
-rw-r--r--arch/sh/kernel/vmlinux.lds.S42
-rw-r--r--arch/sh/math-emu/math.c12
-rw-r--r--arch/sh/mm/Kconfig48
-rw-r--r--arch/sh/mm/Makefile12
-rw-r--r--arch/sh/mm/alignment.c189
-rw-r--r--arch/sh/mm/cache-debugfs.c7
-rw-r--r--arch/sh/mm/cache-sh2.c12
-rw-r--r--arch/sh/mm/cache-sh2a.c20
-rw-r--r--arch/sh/mm/cache-sh3.c6
-rw-r--r--arch/sh/mm/cache-sh4.c27
-rw-r--r--arch/sh/mm/cache-sh7705.c12
-rw-r--r--arch/sh/mm/cache.c13
-rw-r--r--arch/sh/mm/fault_32.c5
-rw-r--r--arch/sh/mm/init.c166
-rw-r--r--arch/sh/mm/ioremap.c (renamed from arch/sh/mm/ioremap_32.c)63
-rw-r--r--arch/sh/mm/ioremap_64.c326
-rw-r--r--arch/sh/mm/ioremap_fixed.c128
-rw-r--r--arch/sh/mm/nommu.c4
-rw-r--r--arch/sh/mm/pgtable.c56
-rw-r--r--arch/sh/mm/pmb.c586
-rw-r--r--arch/sh/mm/tlb-pteaex.c3
-rw-r--r--arch/sh/mm/tlb-sh3.c6
-rw-r--r--arch/sh/mm/tlb-sh4.c13
-rw-r--r--arch/sh/mm/tlb-sh5.c39
-rw-r--r--arch/sh/mm/tlb-urb.c81
-rw-r--r--arch/sh/mm/tlbflush_32.c4
-rw-r--r--arch/sh/mm/tlbflush_64.c2
-rw-r--r--arch/sh/mm/uncached.c34
-rw-r--r--arch/sh/tools/mach-types1
-rw-r--r--arch/sparc/include/asm/pgtable_32.h4
-rw-r--r--arch/sparc/include/asm/pgtable_64.h2
-rw-r--r--arch/sparc/include/asm/stat.h4
-rw-r--r--arch/sparc/include/asm/syscall.h7
-rw-r--r--arch/sparc/kernel/devices.c2
-rw-r--r--arch/sparc/kernel/ftrace.c11
-rw-r--r--arch/sparc/kernel/kstack.h4
-rw-r--r--arch/sparc/kernel/of_device_32.c4
-rw-r--r--arch/sparc/kernel/of_device_64.c2
-rw-r--r--arch/sparc/kernel/pci.c12
-rw-r--r--arch/sparc/kernel/pcic.c5
-rw-r--r--arch/sparc/kernel/perf_event.c10
-rw-r--r--arch/sparc/kernel/prom.h3
-rw-r--r--arch/sparc/kernel/prom_common.c18
-rw-r--r--arch/sparc/kernel/smp_64.c2
-rw-r--r--arch/sparc/kernel/tsb.S6
-rw-r--r--arch/sparc/mm/fault_32.c4
-rw-r--r--arch/sparc/mm/init_64.c3
-rw-r--r--arch/sparc/mm/nosun4c.c2
-rw-r--r--arch/sparc/mm/srmmu.c6
-rw-r--r--arch/sparc/mm/sun4c.c6
-rw-r--r--arch/um/drivers/ubd_kern.c4
-rw-r--r--arch/um/include/asm/pgtable.h2
-rw-r--r--arch/um/sys-x86_64/Makefile3
-rw-r--r--arch/x86/Kconfig1
-rw-r--r--arch/x86/Kconfig.cpu2
-rw-r--r--arch/x86/Makefile2
-rw-r--r--arch/x86/boot/compressed/misc.c15
-rw-r--r--arch/x86/boot/mkcpustr.c2
-rw-r--r--arch/x86/boot/video-vga.c9
-rw-r--r--arch/x86/boot/video.c7
-rw-r--r--arch/x86/ia32/ia32_aout.c2
-rw-r--r--arch/x86/include/asm/alternative.h12
-rw-r--r--arch/x86/include/asm/atomic.h299
-rw-r--r--arch/x86/include/asm/atomic64_32.h160
-rw-r--r--arch/x86/include/asm/atomic64_64.h224
-rw-r--r--arch/x86/include/asm/atomic_32.h415
-rw-r--r--arch/x86/include/asm/atomic_64.h485
-rw-r--r--arch/x86/include/asm/cpufeature.h4
-rw-r--r--arch/x86/include/asm/debugreg.h3
-rw-r--r--arch/x86/include/asm/elf.h5
-rw-r--r--arch/x86/include/asm/fb.h4
-rw-r--r--arch/x86/include/asm/fixmap.h16
-rw-r--r--arch/x86/include/asm/i387.h12
-rw-r--r--arch/x86/include/asm/io.h155
-rw-r--r--arch/x86/include/asm/io_32.h196
-rw-r--r--arch/x86/include/asm/io_64.h181
-rw-r--r--arch/x86/include/asm/mmzone_64.h6
-rw-r--r--arch/x86/include/asm/nmi.h1
-rw-r--r--arch/x86/include/asm/numa_64.h5
-rw-r--r--arch/x86/include/asm/numaq.h4
-rw-r--r--arch/x86/include/asm/page_types.h1
-rw-r--r--arch/x86/include/asm/pci_x86.h1
-rw-r--r--arch/x86/include/asm/perf_event.h16
-rw-r--r--arch/x86/include/asm/pgalloc.h5
-rw-r--r--arch/x86/include/asm/pgtable_32.h2
-rw-r--r--arch/x86/include/asm/pgtable_64.h2
-rw-r--r--arch/x86/include/asm/processor.h2
-rw-r--r--arch/x86/include/asm/ptrace.h4
-rw-r--r--arch/x86/include/asm/rwsem.h81
-rw-r--r--arch/x86/include/asm/smp.h9
-rw-r--r--arch/x86/include/asm/stacktrace.h2
-rw-r--r--arch/x86/include/asm/syscall.h2
-rw-r--r--arch/x86/include/asm/uaccess_64.h21
-rw-r--r--arch/x86/include/asm/user.h58
-rw-r--r--arch/x86/include/asm/uv/bios.h11
-rw-r--r--arch/x86/include/asm/uv/uv.h1
-rw-r--r--arch/x86/include/asm/uv/uv_hub.h3
-rw-r--r--arch/x86/include/asm/x86_init.h2
-rw-r--r--arch/x86/include/asm/xsave.h2
-rw-r--r--arch/x86/kernel/acpi/boot.c29
-rw-r--r--arch/x86/kernel/alternative.c22
-rw-r--r--arch/x86/kernel/apic/apic.c2
-rw-r--r--arch/x86/kernel/apic/io_apic.c2
-rw-r--r--arch/x86/kernel/apic/numaq_32.c2
-rw-r--r--arch/x86/kernel/apic/x2apic_uv_x.c89
-rw-r--r--arch/x86/kernel/apm_32.c4
-rw-r--r--arch/x86/kernel/bios_uv.c39
-rw-r--r--arch/x86/kernel/cpu/addon_cpuid_features.c4
-rw-r--r--arch/x86/kernel/cpu/intel_cacheinfo.c334
-rw-r--r--arch/x86/kernel/cpu/mtrr/Makefile2
-rw-r--r--arch/x86/kernel/cpu/mtrr/amd.c2
-rw-r--r--arch/x86/kernel/cpu/mtrr/centaur.c2
-rw-r--r--arch/x86/kernel/cpu/mtrr/cyrix.c2
-rw-r--r--arch/x86/kernel/cpu/mtrr/generic.c10
-rw-r--r--arch/x86/kernel/cpu/mtrr/main.c6
-rw-r--r--arch/x86/kernel/cpu/mtrr/mtrr.h6
-rw-r--r--arch/x86/kernel/cpu/mtrr/state.c94
-rw-r--r--arch/x86/kernel/cpu/perf_event.c1854
-rw-r--r--arch/x86/kernel/cpu/perf_event_amd.c416
-rw-r--r--arch/x86/kernel/cpu/perf_event_intel.c971
-rw-r--r--arch/x86/kernel/cpu/perf_event_p6.c157
-rw-r--r--arch/x86/kernel/cpu/perfctr-watchdog.c11
-rw-r--r--arch/x86/kernel/dumpstack_32.c5
-rw-r--r--arch/x86/kernel/dumpstack_64.c6
-rw-r--r--arch/x86/kernel/e820.c8
-rw-r--r--arch/x86/kernel/efi.c2
-rw-r--r--arch/x86/kernel/ftrace.c36
-rw-r--r--arch/x86/kernel/hpet.c2
-rw-r--r--arch/x86/kernel/hw_breakpoint.c40
-rw-r--r--arch/x86/kernel/i387.c71
-rw-r--r--arch/x86/kernel/kprobes.c5
-rw-r--r--arch/x86/kernel/microcode_intel.c2
-rw-r--r--arch/x86/kernel/process.c7
-rw-r--r--arch/x86/kernel/process_32.c6
-rw-r--r--arch/x86/kernel/process_64.c7
-rw-r--r--arch/x86/kernel/ptrace.c65
-rw-r--r--arch/x86/kernel/setup.c21
-rw-r--r--arch/x86/kernel/smpboot.c1
-rw-r--r--arch/x86/kernel/traps.c3
-rw-r--r--arch/x86/kernel/tsc.c4
-rw-r--r--arch/x86/kernel/uv_sysfs.c6
-rw-r--r--arch/x86/kernel/x8664_ksyms_64.c3
-rw-r--r--arch/x86/kernel/x86_init.c3
-rw-r--r--arch/x86/kernel/xsave.c1
-rw-r--r--arch/x86/lib/Makefile5
-rw-r--r--arch/x86/lib/cache-smp.c19
-rw-r--r--arch/x86/lib/copy_user_64.S6
-rw-r--r--arch/x86/lib/io_64.c25
-rw-r--r--arch/x86/lib/memcpy_64.S23
-rw-r--r--arch/x86/lib/memset_64.S18
-rw-r--r--arch/x86/lib/rwsem_64.S81
-rw-r--r--arch/x86/mm/init.c7
-rw-r--r--arch/x86/mm/init_32.c8
-rw-r--r--arch/x86/mm/ioremap.c41
-rw-r--r--arch/x86/mm/kmemcheck/kmemcheck.c2
-rw-r--r--arch/x86/mm/kmemcheck/shadow.c16
-rw-r--r--arch/x86/mm/kmemcheck/shadow.h2
-rw-r--r--arch/x86/mm/mmap.c4
-rw-r--r--arch/x86/mm/numa_64.c235
-rw-r--r--arch/x86/mm/pgtable.c31
-rw-r--r--arch/x86/mm/tlb.c8
-rw-r--r--arch/x86/oprofile/nmi_int.c17
-rw-r--r--arch/x86/oprofile/op_model_amd.c244
-rw-r--r--arch/x86/oprofile/op_model_p4.c6
-rw-r--r--arch/x86/oprofile/op_model_ppro.c17
-rw-r--r--arch/x86/oprofile/op_x86_model.h20
-rw-r--r--arch/x86/pci/acpi.c82
-rw-r--r--arch/x86/pci/bus_numa.c3
-rw-r--r--arch/x86/pci/bus_numa.h3
-rw-r--r--arch/x86/pci/common.c3
-rw-r--r--arch/x86/pci/i386.c14
-rw-r--r--arch/x86/pci/irq.c2
-rw-r--r--arch/x86/pci/mmconfig-shared.c17
-rw-r--r--arch/x86/pci/numaq_32.c6
-rw-r--r--arch/x86/tools/test_get_len.c4
-rw-r--r--arch/xtensa/include/asm/pgtable.h2
-rw-r--r--arch/xtensa/kernel/pci.c15
-rw-r--r--arch/xtensa/mm/cache.c4
1186 files changed, 44463 insertions, 22959 deletions
diff --git a/arch/Kconfig b/arch/Kconfig
index 9d055b4f0585..215e46073c45 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -3,11 +3,9 @@
3# 3#
4 4
5config OPROFILE 5config OPROFILE
6 tristate "OProfile system profiling (EXPERIMENTAL)" 6 tristate "OProfile system profiling"
7 depends on PROFILING 7 depends on PROFILING
8 depends on HAVE_OPROFILE 8 depends on HAVE_OPROFILE
9 depends on TRACING_SUPPORT
10 select TRACING
11 select RING_BUFFER 9 select RING_BUFFER
12 select RING_BUFFER_ALLOW_SWAP 10 select RING_BUFFER_ALLOW_SWAP
13 help 11 help
@@ -17,20 +15,6 @@ config OPROFILE
17 15
18 If unsure, say N. 16 If unsure, say N.
19 17
20config OPROFILE_IBS
21 bool "OProfile AMD IBS support (EXPERIMENTAL)"
22 default n
23 depends on OPROFILE && SMP && X86
24 help
25 Instruction-Based Sampling (IBS) is a new profiling
26 technique that provides rich, precise program performance
27 information. IBS is introduced by AMD Family10h processors
28 (AMD Opteron Quad-Core processor "Barcelona") to overcome
29 the limitations of conventional performance counter
30 sampling.
31
32 If unsure, say N.
33
34config OPROFILE_EVENT_MULTIPLEX 18config OPROFILE_EVENT_MULTIPLEX
35 bool "OProfile multiplexing support (EXPERIMENTAL)" 19 bool "OProfile multiplexing support (EXPERIMENTAL)"
36 default n 20 default n
@@ -121,6 +105,14 @@ config HAVE_DMA_ATTRS
121config USE_GENERIC_SMP_HELPERS 105config USE_GENERIC_SMP_HELPERS
122 bool 106 bool
123 107
108config HAVE_REGS_AND_STACK_ACCESS_API
109 bool
110 help
111 This symbol should be selected by an architecure if it supports
112 the API needed to access registers and stack entries from pt_regs,
113 declared in asm/ptrace.h
114 For example the kprobes-based event tracer needs this API.
115
124config HAVE_CLK 116config HAVE_CLK
125 bool 117 bool
126 help 118 help
diff --git a/arch/alpha/include/asm/pgtable.h b/arch/alpha/include/asm/pgtable.h
index 3f0c59f6d8aa..71a243294142 100644
--- a/arch/alpha/include/asm/pgtable.h
+++ b/arch/alpha/include/asm/pgtable.h
@@ -329,7 +329,7 @@ extern pgd_t swapper_pg_dir[1024];
329 * tables contain all the necessary information. 329 * tables contain all the necessary information.
330 */ 330 */
331extern inline void update_mmu_cache(struct vm_area_struct * vma, 331extern inline void update_mmu_cache(struct vm_area_struct * vma,
332 unsigned long address, pte_t pte) 332 unsigned long address, pte_t *ptep)
333{ 333{
334} 334}
335 335
diff --git a/arch/alpha/kernel/pci.c b/arch/alpha/kernel/pci.c
index a91ba28999b5..c9ab94ee1ca8 100644
--- a/arch/alpha/kernel/pci.c
+++ b/arch/alpha/kernel/pci.c
@@ -126,8 +126,8 @@ DECLARE_PCI_FIXUP_FINAL(PCI_ANY_ID, PCI_ANY_ID, pcibios_fixup_final);
126#define MB (1024*KB) 126#define MB (1024*KB)
127#define GB (1024*MB) 127#define GB (1024*MB)
128 128
129void 129resource_size_t
130pcibios_align_resource(void *data, struct resource *res, 130pcibios_align_resource(void *data, const struct resource *res,
131 resource_size_t size, resource_size_t align) 131 resource_size_t size, resource_size_t align)
132{ 132{
133 struct pci_dev *dev = data; 133 struct pci_dev *dev = data;
@@ -184,7 +184,7 @@ pcibios_align_resource(void *data, struct resource *res,
184 } 184 }
185 } 185 }
186 186
187 res->start = start; 187 return start;
188} 188}
189#undef KB 189#undef KB
190#undef MB 190#undef MB
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 184a6bd54825..3b181284970f 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -12,6 +12,7 @@ config ARM
12 select HAVE_IDE 12 select HAVE_IDE
13 select RTC_LIB 13 select RTC_LIB
14 select SYS_SUPPORTS_APM_EMULATION 14 select SYS_SUPPORTS_APM_EMULATION
15 select GENERIC_ATOMIC64 if (!CPU_32v6K)
15 select HAVE_OPROFILE 16 select HAVE_OPROFILE
16 select HAVE_ARCH_KGDB 17 select HAVE_ARCH_KGDB
17 select HAVE_KPROBES if (!XIP_KERNEL) 18 select HAVE_KPROBES if (!XIP_KERNEL)
@@ -20,6 +21,8 @@ config ARM
20 select HAVE_GENERIC_DMA_COHERENT 21 select HAVE_GENERIC_DMA_COHERENT
21 select HAVE_KERNEL_GZIP 22 select HAVE_KERNEL_GZIP
22 select HAVE_KERNEL_LZO 23 select HAVE_KERNEL_LZO
24 select HAVE_PERF_EVENTS
25 select PERF_USE_VMALLOC
23 help 26 help
24 The ARM series is a line of low-power-consumption RISC chip designs 27 The ARM series is a line of low-power-consumption RISC chip designs
25 licensed by ARM Ltd and targeted at embedded applications and 28 licensed by ARM Ltd and targeted at embedded applications and
@@ -52,6 +55,9 @@ config HAVE_TCM
52 bool 55 bool
53 select GENERIC_ALLOCATOR 56 select GENERIC_ALLOCATOR
54 57
58config HAVE_PROC_CPU
59 bool
60
55config NO_IOPORT 61config NO_IOPORT
56 bool 62 bool
57 63
@@ -161,6 +167,11 @@ config ARCH_MTD_XIP
161config GENERIC_HARDIRQS_NO__DO_IRQ 167config GENERIC_HARDIRQS_NO__DO_IRQ
162 def_bool y 168 def_bool y
163 169
170config ARM_L1_CACHE_SHIFT_6
171 bool
172 help
173 Setting ARM L1 cache line size to 64 Bytes.
174
164if OPROFILE 175if OPROFILE
165 176
166config OPROFILE_ARMV6 177config OPROFILE_ARMV6
@@ -550,10 +561,20 @@ config ARCH_W90X900
550 <http://www.nuvoton.com/hq/enu/ProductAndSales/ProductLines/ 561 <http://www.nuvoton.com/hq/enu/ProductAndSales/ProductLines/
551 ConsumerElectronicsIC/ARMMicrocontroller/ARMMicrocontroller> 562 ConsumerElectronicsIC/ARMMicrocontroller/ARMMicrocontroller>
552 563
564config ARCH_NUC93X
565 bool "Nuvoton NUC93X CPU"
566 select CPU_ARM926T
567 select HAVE_CLK
568 select COMMON_CLKDEV
569 help
570 Support for Nuvoton (Winbond logic dept.) NUC93X MCU,The NUC93X is a
571 low-power and high performance MPEG-4/JPEG multimedia controller chip.
572
553config ARCH_PNX4008 573config ARCH_PNX4008
554 bool "Philips Nexperia PNX4008 Mobile" 574 bool "Philips Nexperia PNX4008 Mobile"
555 select CPU_ARM926T 575 select CPU_ARM926T
556 select HAVE_CLK 576 select HAVE_CLK
577 select COMMON_CLKDEV
557 help 578 help
558 This enables support for Philips PNX4008 mobile platform. 579 This enables support for Philips PNX4008 mobile platform.
559 580
@@ -638,6 +659,7 @@ config ARCH_S5PC1XX
638 select GENERIC_GPIO 659 select GENERIC_GPIO
639 select HAVE_CLK 660 select HAVE_CLK
640 select CPU_V7 661 select CPU_V7
662 select ARM_L1_CACHE_SHIFT_6
641 help 663 help
642 Samsung S5PC1XX series based systems 664 Samsung S5PC1XX series based systems
643 665
@@ -785,6 +807,8 @@ source "arch/arm/plat-nomadik/Kconfig"
785 807
786source "arch/arm/mach-ns9xxx/Kconfig" 808source "arch/arm/mach-ns9xxx/Kconfig"
787 809
810source "arch/arm/mach-nuc93x/Kconfig"
811
788source "arch/arm/plat-omap/Kconfig" 812source "arch/arm/plat-omap/Kconfig"
789 813
790source "arch/arm/mach-omap1/Kconfig" 814source "arch/arm/mach-omap1/Kconfig"
@@ -867,6 +891,11 @@ config XSCALE_PMU
867 depends on CPU_XSCALE && !XSCALE_PMU_TIMER 891 depends on CPU_XSCALE && !XSCALE_PMU_TIMER
868 default y 892 default y
869 893
894config CPU_HAS_PMU
895 depends on CPU_V6 || CPU_V7 || XSCALE_PMU
896 default y
897 bool
898
870if !MMU 899if !MMU
871source "arch/arm/Kconfig-nommu" 900source "arch/arm/Kconfig-nommu"
872endif 901endif
@@ -921,6 +950,19 @@ config ARM_ERRATA_460075
921 ACTLR register. Note that setting specific bits in the ACTLR register 950 ACTLR register. Note that setting specific bits in the ACTLR register
922 may not be available in non-secure mode. 951 may not be available in non-secure mode.
923 952
953config PL310_ERRATA_588369
954 bool "Clean & Invalidate maintenance operations do not invalidate clean lines"
955 depends on CACHE_L2X0 && ARCH_OMAP4
956 help
957 The PL310 L2 cache controller implements three types of Clean &
958 Invalidate maintenance operations: by Physical Address
959 (offset 0x7F0), by Index/Way (0x7F8) and by Way (0x7FC).
960 They are architecturally defined to behave as the execution of a
961 clean operation followed immediately by an invalidate operation,
962 both performing to the same memory location. This functionality
963 is not correctly implemented in PL310 as clean lines are not
964 invalidated as a result of these operations. Note that this errata
965 uses Texas Instrument's secure monitor api.
924endmenu 966endmenu
925 967
926source "arch/arm/common/Kconfig" 968source "arch/arm/common/Kconfig"
@@ -1171,6 +1213,14 @@ config HIGHPTE
1171 depends on HIGHMEM 1213 depends on HIGHMEM
1172 depends on !OUTER_CACHE 1214 depends on !OUTER_CACHE
1173 1215
1216config HW_PERF_EVENTS
1217 bool "Enable hardware performance counter support for perf events"
1218 depends on PERF_EVENTS && CPU_HAS_PMU && (CPU_V6 || CPU_V7)
1219 default y
1220 help
1221 Enable hardware performance counter support for perf events. If
1222 disabled, perf events will use software events only.
1223
1174source "mm/Kconfig" 1224source "mm/Kconfig"
1175 1225
1176config LEDS 1226config LEDS
@@ -1230,6 +1280,7 @@ config ALIGNMENT_TRAP
1230 bool 1280 bool
1231 depends on CPU_CP15_MMU 1281 depends on CPU_CP15_MMU
1232 default y if !ARCH_EBSA110 1282 default y if !ARCH_EBSA110
1283 select HAVE_PROC_CPU if PROC_FS
1233 help 1284 help
1234 ARM processors cannot fetch/store information which is not 1285 ARM processors cannot fetch/store information which is not
1235 naturally aligned on the bus, i.e., a 4 byte fetch must start at an 1286 naturally aligned on the bus, i.e., a 4 byte fetch must start at an
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 356d702c0808..81f54ca30788 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -171,6 +171,7 @@ machine-$(CONFIG_ARCH_U300) := u300
171machine-$(CONFIG_ARCH_U8500) := ux500 171machine-$(CONFIG_ARCH_U8500) := ux500
172machine-$(CONFIG_ARCH_VERSATILE) := versatile 172machine-$(CONFIG_ARCH_VERSATILE) := versatile
173machine-$(CONFIG_ARCH_W90X900) := w90x900 173machine-$(CONFIG_ARCH_W90X900) := w90x900
174machine-$(CONFIG_ARCH_NUC93X) := nuc93x
174machine-$(CONFIG_FOOTBRIDGE) := footbridge 175machine-$(CONFIG_FOOTBRIDGE) := footbridge
175 176
176# Platform directory name. This list is sorted alphanumerically 177# Platform directory name. This list is sorted alphanumerically
diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile
index 2d4d88ba73bf..97c89e7de7d3 100644
--- a/arch/arm/boot/compressed/Makefile
+++ b/arch/arm/boot/compressed/Makefile
@@ -5,7 +5,7 @@
5# 5#
6 6
7HEAD = head.o 7HEAD = head.o
8OBJS = misc.o 8OBJS = misc.o decompress.o
9FONTC = $(srctree)/drivers/video/console/font_acorn_8x8.c 9FONTC = $(srctree)/drivers/video/console/font_acorn_8x8.c
10 10
11# 11#
@@ -106,10 +106,6 @@ lib1funcs = $(obj)/lib1funcs.o
106$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S FORCE 106$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S FORCE
107 $(call cmd,shipped) 107 $(call cmd,shipped)
108 108
109# Don't allow any static data in misc.o, which
110# would otherwise mess up our GOT table
111CFLAGS_misc.o := -Dstatic=
112
113$(obj)/vmlinux: $(obj)/vmlinux.lds $(obj)/$(HEAD) $(obj)/piggy.$(suffix_y).o \ 109$(obj)/vmlinux: $(obj)/vmlinux.lds $(obj)/$(HEAD) $(obj)/piggy.$(suffix_y).o \
114 $(addprefix $(obj)/, $(OBJS)) $(lib1funcs) FORCE 110 $(addprefix $(obj)/, $(OBJS)) $(lib1funcs) FORCE
115 $(call if_changed,ld) 111 $(call if_changed,ld)
diff --git a/arch/arm/boot/compressed/decompress.c b/arch/arm/boot/compressed/decompress.c
new file mode 100644
index 000000000000..0da382f33157
--- /dev/null
+++ b/arch/arm/boot/compressed/decompress.c
@@ -0,0 +1,45 @@
1#define _LINUX_STRING_H_
2
3#include <linux/compiler.h> /* for inline */
4#include <linux/types.h> /* for size_t */
5#include <linux/stddef.h> /* for NULL */
6#include <linux/linkage.h>
7#include <asm/string.h>
8
9extern unsigned long free_mem_ptr;
10extern unsigned long free_mem_end_ptr;
11extern void error(char *);
12
13#define STATIC static
14
15#define ARCH_HAS_DECOMP_WDOG
16
17/* Diagnostic functions */
18#ifdef DEBUG
19# define Assert(cond,msg) {if(!(cond)) error(msg);}
20# define Trace(x) fprintf x
21# define Tracev(x) {if (verbose) fprintf x ;}
22# define Tracevv(x) {if (verbose>1) fprintf x ;}
23# define Tracec(c,x) {if (verbose && (c)) fprintf x ;}
24# define Tracecv(c,x) {if (verbose>1 && (c)) fprintf x ;}
25#else
26# define Assert(cond,msg)
27# define Trace(x)
28# define Tracev(x)
29# define Tracevv(x)
30# define Tracec(c,x)
31# define Tracecv(c,x)
32#endif
33
34#ifdef CONFIG_KERNEL_GZIP
35#include "../../../../lib/decompress_inflate.c"
36#endif
37
38#ifdef CONFIG_KERNEL_LZO
39#include "../../../../lib/decompress_unlzo.c"
40#endif
41
42void do_decompress(u8 *input, int len, u8 *output, void (*error)(char *x))
43{
44 decompress(input, len, NULL, NULL, output, NULL, error);
45}
diff --git a/arch/arm/boot/compressed/misc.c b/arch/arm/boot/compressed/misc.c
index 56a0d116d271..d32bc71c1f78 100644
--- a/arch/arm/boot/compressed/misc.c
+++ b/arch/arm/boot/compressed/misc.c
@@ -23,8 +23,8 @@ unsigned int __machine_arch_type;
23#include <linux/compiler.h> /* for inline */ 23#include <linux/compiler.h> /* for inline */
24#include <linux/types.h> /* for size_t */ 24#include <linux/types.h> /* for size_t */
25#include <linux/stddef.h> /* for NULL */ 25#include <linux/stddef.h> /* for NULL */
26#include <asm/string.h>
27#include <linux/linkage.h> 26#include <linux/linkage.h>
27#include <asm/string.h>
28 28
29#include <asm/unaligned.h> 29#include <asm/unaligned.h>
30 30
@@ -117,57 +117,7 @@ static void putstr(const char *ptr)
117 117
118#endif 118#endif
119 119
120#define __ptr_t void * 120void *memcpy(void *__dest, __const void *__src, size_t __n)
121
122#define memzero(s,n) __memzero(s,n)
123
124/*
125 * Optimised C version of memzero for the ARM.
126 */
127void __memzero (__ptr_t s, size_t n)
128{
129 union { void *vp; unsigned long *ulp; unsigned char *ucp; } u;
130 int i;
131
132 u.vp = s;
133
134 for (i = n >> 5; i > 0; i--) {
135 *u.ulp++ = 0;
136 *u.ulp++ = 0;
137 *u.ulp++ = 0;
138 *u.ulp++ = 0;
139 *u.ulp++ = 0;
140 *u.ulp++ = 0;
141 *u.ulp++ = 0;
142 *u.ulp++ = 0;
143 }
144
145 if (n & 1 << 4) {
146 *u.ulp++ = 0;
147 *u.ulp++ = 0;
148 *u.ulp++ = 0;
149 *u.ulp++ = 0;
150 }
151
152 if (n & 1 << 3) {
153 *u.ulp++ = 0;
154 *u.ulp++ = 0;
155 }
156
157 if (n & 1 << 2)
158 *u.ulp++ = 0;
159
160 if (n & 1 << 1) {
161 *u.ucp++ = 0;
162 *u.ucp++ = 0;
163 }
164
165 if (n & 1)
166 *u.ucp++ = 0;
167}
168
169static inline __ptr_t memcpy(__ptr_t __dest, __const __ptr_t __src,
170 size_t __n)
171{ 121{
172 int i = 0; 122 int i = 0;
173 unsigned char *d = (unsigned char *)__dest, *s = (unsigned char *)__src; 123 unsigned char *d = (unsigned char *)__dest, *s = (unsigned char *)__src;
@@ -204,59 +154,20 @@ static inline __ptr_t memcpy(__ptr_t __dest, __const __ptr_t __src,
204/* 154/*
205 * gzip delarations 155 * gzip delarations
206 */ 156 */
207#define STATIC static
208
209/* Diagnostic functions */
210#ifdef DEBUG
211# define Assert(cond,msg) {if(!(cond)) error(msg);}
212# define Trace(x) fprintf x
213# define Tracev(x) {if (verbose) fprintf x ;}
214# define Tracevv(x) {if (verbose>1) fprintf x ;}
215# define Tracec(c,x) {if (verbose && (c)) fprintf x ;}
216# define Tracecv(c,x) {if (verbose>1 && (c)) fprintf x ;}
217#else
218# define Assert(cond,msg)
219# define Trace(x)
220# define Tracev(x)
221# define Tracevv(x)
222# define Tracec(c,x)
223# define Tracecv(c,x)
224#endif
225
226static void error(char *m);
227
228extern char input_data[]; 157extern char input_data[];
229extern char input_data_end[]; 158extern char input_data_end[];
230 159
231static unsigned char *output_data; 160unsigned char *output_data;
232static unsigned long output_ptr; 161unsigned long output_ptr;
233
234static void error(char *m);
235 162
236static void putstr(const char *); 163unsigned long free_mem_ptr;
237 164unsigned long free_mem_end_ptr;
238static unsigned long free_mem_ptr;
239static unsigned long free_mem_end_ptr;
240
241#ifdef STANDALONE_DEBUG
242#define NO_INFLATE_MALLOC
243#endif
244
245#define ARCH_HAS_DECOMP_WDOG
246
247#ifdef CONFIG_KERNEL_GZIP
248#include "../../../../lib/decompress_inflate.c"
249#endif
250
251#ifdef CONFIG_KERNEL_LZO
252#include "../../../../lib/decompress_unlzo.c"
253#endif
254 165
255#ifndef arch_error 166#ifndef arch_error
256#define arch_error(x) 167#define arch_error(x)
257#endif 168#endif
258 169
259static void error(char *x) 170void error(char *x)
260{ 171{
261 arch_error(x); 172 arch_error(x);
262 173
@@ -272,6 +183,8 @@ asmlinkage void __div0(void)
272 error("Attempting division by 0!"); 183 error("Attempting division by 0!");
273} 184}
274 185
186extern void do_decompress(u8 *input, int len, u8 *output, void (*error)(char *x));
187
275#ifndef STANDALONE_DEBUG 188#ifndef STANDALONE_DEBUG
276 189
277unsigned long 190unsigned long
@@ -292,8 +205,8 @@ decompress_kernel(unsigned long output_start, unsigned long free_mem_ptr_p,
292 output_ptr = get_unaligned_le32(tmp); 205 output_ptr = get_unaligned_le32(tmp);
293 206
294 putstr("Uncompressing Linux..."); 207 putstr("Uncompressing Linux...");
295 decompress(input_data, input_data_end - input_data, 208 do_decompress(input_data, input_data_end - input_data,
296 NULL, NULL, output_data, NULL, error); 209 output_data, error);
297 putstr(" done, booting the kernel.\n"); 210 putstr(" done, booting the kernel.\n");
298 return output_ptr; 211 return output_ptr;
299} 212}
diff --git a/arch/arm/boot/compressed/vmlinux.lds.in b/arch/arm/boot/compressed/vmlinux.lds.in
index a5924b9b88bd..7ca9ecff652f 100644
--- a/arch/arm/boot/compressed/vmlinux.lds.in
+++ b/arch/arm/boot/compressed/vmlinux.lds.in
@@ -14,6 +14,13 @@ SECTIONS
14 /DISCARD/ : { 14 /DISCARD/ : {
15 *(.ARM.exidx*) 15 *(.ARM.exidx*)
16 *(.ARM.extab*) 16 *(.ARM.extab*)
17 /*
18 * Discard any r/w data - this produces a link error if we have any,
19 * which is required for PIC decompression. Local data generates
20 * GOTOFF relocations, which prevents it being relocated independently
21 * of the text/got segments.
22 */
23 *(.data)
17 } 24 }
18 25
19 . = TEXT_START; 26 . = TEXT_START;
@@ -40,7 +47,6 @@ SECTIONS
40 .got : { *(.got) } 47 .got : { *(.got) }
41 _got_end = .; 48 _got_end = .;
42 .got.plt : { *(.got.plt) } 49 .got.plt : { *(.got.plt) }
43 .data : { *(.data) }
44 _edata = .; 50 _edata = .;
45 51
46 . = BSS_START; 52 . = BSS_START;
diff --git a/arch/arm/common/clkdev.c b/arch/arm/common/clkdev.c
index aae5bc01acc8..446b696196e3 100644
--- a/arch/arm/common/clkdev.c
+++ b/arch/arm/common/clkdev.c
@@ -99,6 +99,16 @@ void clkdev_add(struct clk_lookup *cl)
99} 99}
100EXPORT_SYMBOL(clkdev_add); 100EXPORT_SYMBOL(clkdev_add);
101 101
102void __init clkdev_add_table(struct clk_lookup *cl, size_t num)
103{
104 mutex_lock(&clocks_mutex);
105 while (num--) {
106 list_add_tail(&cl->node, &clocks);
107 cl++;
108 }
109 mutex_unlock(&clocks_mutex);
110}
111
102#define MAX_DEV_ID 20 112#define MAX_DEV_ID 20
103#define MAX_CON_ID 16 113#define MAX_CON_ID 16
104 114
diff --git a/arch/arm/common/dmabounce.c b/arch/arm/common/dmabounce.c
index cc32c1e54a59..cc0a932bbea9 100644
--- a/arch/arm/common/dmabounce.c
+++ b/arch/arm/common/dmabounce.c
@@ -277,7 +277,7 @@ static inline dma_addr_t map_single(struct device *dev, void *ptr, size_t size,
277 * We don't need to sync the DMA buffer since 277 * We don't need to sync the DMA buffer since
278 * it was allocated via the coherent allocators. 278 * it was allocated via the coherent allocators.
279 */ 279 */
280 dma_cache_maint(ptr, size, dir); 280 __dma_single_cpu_to_dev(ptr, size, dir);
281 } 281 }
282 282
283 return dma_addr; 283 return dma_addr;
@@ -315,6 +315,8 @@ static inline void unmap_single(struct device *dev, dma_addr_t dma_addr,
315 __cpuc_flush_dcache_area(ptr, size); 315 __cpuc_flush_dcache_area(ptr, size);
316 } 316 }
317 free_safe_buffer(dev->archdata.dmabounce, buf); 317 free_safe_buffer(dev->archdata.dmabounce, buf);
318 } else {
319 __dma_single_dev_to_cpu(dma_to_virt(dev, dma_addr), size, dir);
318 } 320 }
319} 321}
320 322
diff --git a/arch/arm/common/vic.c b/arch/arm/common/vic.c
index f232941de8ab..1cf999ade4bc 100644
--- a/arch/arm/common/vic.c
+++ b/arch/arm/common/vic.c
@@ -18,6 +18,7 @@
18 * along with this program; if not, write to the Free Software 18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */ 20 */
21
21#include <linux/init.h> 22#include <linux/init.h>
22#include <linux/list.h> 23#include <linux/list.h>
23#include <linux/io.h> 24#include <linux/io.h>
@@ -28,48 +29,6 @@
28#include <asm/mach/irq.h> 29#include <asm/mach/irq.h>
29#include <asm/hardware/vic.h> 30#include <asm/hardware/vic.h>
30 31
31static void vic_ack_irq(unsigned int irq)
32{
33 void __iomem *base = get_irq_chip_data(irq);
34 irq &= 31;
35 writel(1 << irq, base + VIC_INT_ENABLE_CLEAR);
36 /* moreover, clear the soft-triggered, in case it was the reason */
37 writel(1 << irq, base + VIC_INT_SOFT_CLEAR);
38}
39
40static void vic_mask_irq(unsigned int irq)
41{
42 void __iomem *base = get_irq_chip_data(irq);
43 irq &= 31;
44 writel(1 << irq, base + VIC_INT_ENABLE_CLEAR);
45}
46
47static void vic_unmask_irq(unsigned int irq)
48{
49 void __iomem *base = get_irq_chip_data(irq);
50 irq &= 31;
51 writel(1 << irq, base + VIC_INT_ENABLE);
52}
53
54/**
55 * vic_init2 - common initialisation code
56 * @base: Base of the VIC.
57 *
58 * Common initialisation code for registeration
59 * and resume.
60*/
61static void vic_init2(void __iomem *base)
62{
63 int i;
64
65 for (i = 0; i < 16; i++) {
66 void __iomem *reg = base + VIC_VECT_CNTL0 + (i * 4);
67 writel(VIC_VECT_CNTL_ENABLE | i, reg);
68 }
69
70 writel(32, base + VIC_PL190_DEF_VECT_ADDR);
71}
72
73#if defined(CONFIG_PM) 32#if defined(CONFIG_PM)
74/** 33/**
75 * struct vic_device - VIC PM device 34 * struct vic_device - VIC PM device
@@ -99,13 +58,34 @@ struct vic_device {
99/* we cannot allocate memory when VICs are initially registered */ 58/* we cannot allocate memory when VICs are initially registered */
100static struct vic_device vic_devices[CONFIG_ARM_VIC_NR]; 59static struct vic_device vic_devices[CONFIG_ARM_VIC_NR];
101 60
61static int vic_id;
62
102static inline struct vic_device *to_vic(struct sys_device *sys) 63static inline struct vic_device *to_vic(struct sys_device *sys)
103{ 64{
104 return container_of(sys, struct vic_device, sysdev); 65 return container_of(sys, struct vic_device, sysdev);
105} 66}
67#endif /* CONFIG_PM */
106 68
107static int vic_id; 69/**
70 * vic_init2 - common initialisation code
71 * @base: Base of the VIC.
72 *
73 * Common initialisation code for registeration
74 * and resume.
75*/
76static void vic_init2(void __iomem *base)
77{
78 int i;
79
80 for (i = 0; i < 16; i++) {
81 void __iomem *reg = base + VIC_VECT_CNTL0 + (i * 4);
82 writel(VIC_VECT_CNTL_ENABLE | i, reg);
83 }
84
85 writel(32, base + VIC_PL190_DEF_VECT_ADDR);
86}
108 87
88#if defined(CONFIG_PM)
109static int vic_class_resume(struct sys_device *dev) 89static int vic_class_resume(struct sys_device *dev)
110{ 90{
111 struct vic_device *vic = to_vic(dev); 91 struct vic_device *vic = to_vic(dev);
@@ -159,31 +139,6 @@ struct sysdev_class vic_class = {
159}; 139};
160 140
161/** 141/**
162 * vic_pm_register - Register a VIC for later power management control
163 * @base: The base address of the VIC.
164 * @irq: The base IRQ for the VIC.
165 * @resume_sources: bitmask of interrupts allowed for resume sources.
166 *
167 * Register the VIC with the system device tree so that it can be notified
168 * of suspend and resume requests and ensure that the correct actions are
169 * taken to re-instate the settings on resume.
170 */
171static void __init vic_pm_register(void __iomem *base, unsigned int irq, u32 resume_sources)
172{
173 struct vic_device *v;
174
175 if (vic_id >= ARRAY_SIZE(vic_devices))
176 printk(KERN_ERR "%s: too few VICs, increase CONFIG_ARM_VIC_NR\n", __func__);
177 else {
178 v = &vic_devices[vic_id];
179 v->base = base;
180 v->resume_sources = resume_sources;
181 v->irq = irq;
182 vic_id++;
183 }
184}
185
186/**
187 * vic_pm_init - initicall to register VIC pm 142 * vic_pm_init - initicall to register VIC pm
188 * 143 *
189 * This is called via late_initcall() to register 144 * This is called via late_initcall() to register
@@ -219,9 +174,60 @@ static int __init vic_pm_init(void)
219 174
220 return 0; 175 return 0;
221} 176}
222
223late_initcall(vic_pm_init); 177late_initcall(vic_pm_init);
224 178
179/**
180 * vic_pm_register - Register a VIC for later power management control
181 * @base: The base address of the VIC.
182 * @irq: The base IRQ for the VIC.
183 * @resume_sources: bitmask of interrupts allowed for resume sources.
184 *
185 * Register the VIC with the system device tree so that it can be notified
186 * of suspend and resume requests and ensure that the correct actions are
187 * taken to re-instate the settings on resume.
188 */
189static void __init vic_pm_register(void __iomem *base, unsigned int irq, u32 resume_sources)
190{
191 struct vic_device *v;
192
193 if (vic_id >= ARRAY_SIZE(vic_devices))
194 printk(KERN_ERR "%s: too few VICs, increase CONFIG_ARM_VIC_NR\n", __func__);
195 else {
196 v = &vic_devices[vic_id];
197 v->base = base;
198 v->resume_sources = resume_sources;
199 v->irq = irq;
200 vic_id++;
201 }
202}
203#else
204static inline void vic_pm_register(void __iomem *base, unsigned int irq, u32 arg1) { }
205#endif /* CONFIG_PM */
206
207static void vic_ack_irq(unsigned int irq)
208{
209 void __iomem *base = get_irq_chip_data(irq);
210 irq &= 31;
211 writel(1 << irq, base + VIC_INT_ENABLE_CLEAR);
212 /* moreover, clear the soft-triggered, in case it was the reason */
213 writel(1 << irq, base + VIC_INT_SOFT_CLEAR);
214}
215
216static void vic_mask_irq(unsigned int irq)
217{
218 void __iomem *base = get_irq_chip_data(irq);
219 irq &= 31;
220 writel(1 << irq, base + VIC_INT_ENABLE_CLEAR);
221}
222
223static void vic_unmask_irq(unsigned int irq)
224{
225 void __iomem *base = get_irq_chip_data(irq);
226 irq &= 31;
227 writel(1 << irq, base + VIC_INT_ENABLE);
228}
229
230#if defined(CONFIG_PM)
225static struct vic_device *vic_from_irq(unsigned int irq) 231static struct vic_device *vic_from_irq(unsigned int irq)
226{ 232{
227 struct vic_device *v = vic_devices; 233 struct vic_device *v = vic_devices;
@@ -255,10 +261,7 @@ static int vic_set_wake(unsigned int irq, unsigned int on)
255 261
256 return 0; 262 return 0;
257} 263}
258
259#else 264#else
260static inline void vic_pm_register(void __iomem *base, unsigned int irq, u32 arg1) { }
261
262#define vic_set_wake NULL 265#define vic_set_wake NULL
263#endif /* CONFIG_PM */ 266#endif /* CONFIG_PM */
264 267
@@ -270,9 +273,62 @@ static struct irq_chip vic_chip = {
270 .set_wake = vic_set_wake, 273 .set_wake = vic_set_wake,
271}; 274};
272 275
273/* The PL190 cell from ARM has been modified by ST, so handle both here */ 276/*
274static void vik_init_st(void __iomem *base, unsigned int irq_start, 277 * The PL190 cell from ARM has been modified by ST to handle 64 interrupts.
275 u32 vic_sources); 278 * The original cell has 32 interrupts, while the modified one has 64,
279 * replocating two blocks 0x00..0x1f in 0x20..0x3f. In that case
280 * the probe function is called twice, with base set to offset 000
281 * and 020 within the page. We call this "second block".
282 */
283static void __init vic_init_st(void __iomem *base, unsigned int irq_start,
284 u32 vic_sources)
285{
286 unsigned int i;
287 int vic_2nd_block = ((unsigned long)base & ~PAGE_MASK) != 0;
288
289 /* Disable all interrupts initially. */
290
291 writel(0, base + VIC_INT_SELECT);
292 writel(0, base + VIC_INT_ENABLE);
293 writel(~0, base + VIC_INT_ENABLE_CLEAR);
294 writel(0, base + VIC_IRQ_STATUS);
295 writel(0, base + VIC_ITCR);
296 writel(~0, base + VIC_INT_SOFT_CLEAR);
297
298 /*
299 * Make sure we clear all existing interrupts. The vector registers
300 * in this cell are after the second block of general registers,
301 * so we can address them using standard offsets, but only from
302 * the second base address, which is 0x20 in the page
303 */
304 if (vic_2nd_block) {
305 writel(0, base + VIC_PL190_VECT_ADDR);
306 for (i = 0; i < 19; i++) {
307 unsigned int value;
308
309 value = readl(base + VIC_PL190_VECT_ADDR);
310 writel(value, base + VIC_PL190_VECT_ADDR);
311 }
312 /* ST has 16 vectors as well, but we don't enable them by now */
313 for (i = 0; i < 16; i++) {
314 void __iomem *reg = base + VIC_VECT_CNTL0 + (i * 4);
315 writel(0, reg);
316 }
317
318 writel(32, base + VIC_PL190_DEF_VECT_ADDR);
319 }
320
321 for (i = 0; i < 32; i++) {
322 if (vic_sources & (1 << i)) {
323 unsigned int irq = irq_start + i;
324
325 set_irq_chip(irq, &vic_chip);
326 set_irq_chip_data(irq, base);
327 set_irq_handler(irq, handle_level_irq);
328 set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
329 }
330 }
331}
276 332
277/** 333/**
278 * vic_init - initialise a vectored interrupt controller 334 * vic_init - initialise a vectored interrupt controller
@@ -299,7 +355,7 @@ void __init vic_init(void __iomem *base, unsigned int irq_start,
299 355
300 switch(vendor) { 356 switch(vendor) {
301 case AMBA_VENDOR_ST: 357 case AMBA_VENDOR_ST:
302 vik_init_st(base, irq_start, vic_sources); 358 vic_init_st(base, irq_start, vic_sources);
303 return; 359 return;
304 default: 360 default:
305 printk(KERN_WARNING "VIC: unknown vendor, continuing anyways\n"); 361 printk(KERN_WARNING "VIC: unknown vendor, continuing anyways\n");
@@ -343,60 +399,3 @@ void __init vic_init(void __iomem *base, unsigned int irq_start,
343 399
344 vic_pm_register(base, irq_start, resume_sources); 400 vic_pm_register(base, irq_start, resume_sources);
345} 401}
346
347/*
348 * The PL190 cell from ARM has been modified by ST to handle 64 interrupts.
349 * The original cell has 32 interrupts, while the modified one has 64,
350 * replocating two blocks 0x00..0x1f in 0x20..0x3f. In that case
351 * the probe function is called twice, with base set to offset 000
352 * and 020 within the page. We call this "second block".
353 */
354static void __init vik_init_st(void __iomem *base, unsigned int irq_start,
355 u32 vic_sources)
356{
357 unsigned int i;
358 int vic_2nd_block = ((unsigned long)base & ~PAGE_MASK) != 0;
359
360 /* Disable all interrupts initially. */
361
362 writel(0, base + VIC_INT_SELECT);
363 writel(0, base + VIC_INT_ENABLE);
364 writel(~0, base + VIC_INT_ENABLE_CLEAR);
365 writel(0, base + VIC_IRQ_STATUS);
366 writel(0, base + VIC_ITCR);
367 writel(~0, base + VIC_INT_SOFT_CLEAR);
368
369 /*
370 * Make sure we clear all existing interrupts. The vector registers
371 * in this cell are after the second block of general registers,
372 * so we can address them using standard offsets, but only from
373 * the second base address, which is 0x20 in the page
374 */
375 if (vic_2nd_block) {
376 writel(0, base + VIC_PL190_VECT_ADDR);
377 for (i = 0; i < 19; i++) {
378 unsigned int value;
379
380 value = readl(base + VIC_PL190_VECT_ADDR);
381 writel(value, base + VIC_PL190_VECT_ADDR);
382 }
383 /* ST has 16 vectors as well, but we don't enable them by now */
384 for (i = 0; i < 16; i++) {
385 void __iomem *reg = base + VIC_VECT_CNTL0 + (i * 4);
386 writel(0, reg);
387 }
388
389 writel(32, base + VIC_PL190_DEF_VECT_ADDR);
390 }
391
392 for (i = 0; i < 32; i++) {
393 if (vic_sources & (1 << i)) {
394 unsigned int irq = irq_start + i;
395
396 set_irq_chip(irq, &vic_chip);
397 set_irq_chip_data(irq, base);
398 set_irq_handler(irq, handle_level_irq);
399 set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
400 }
401 }
402}
diff --git a/arch/arm/configs/at572d940hfek_defconfig b/arch/arm/configs/at572d940hfek_defconfig
new file mode 100644
index 000000000000..76d724b8041a
--- /dev/null
+++ b/arch/arm/configs/at572d940hfek_defconfig
@@ -0,0 +1,1640 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.28-rc7
4# Fri Dec 5 10:58:47 2008
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="-AT572D940HF"
37# CONFIG_LOCALVERSION_AUTO is not set
38CONFIG_SWAP=y
39CONFIG_SYSVIPC=y
40CONFIG_SYSVIPC_SYSCTL=y
41CONFIG_POSIX_MQUEUE=y
42CONFIG_BSD_PROCESS_ACCT=y
43CONFIG_BSD_PROCESS_ACCT_V3=y
44CONFIG_TASKSTATS=y
45# CONFIG_TASK_DELAY_ACCT is not set
46CONFIG_TASK_XACCT=y
47CONFIG_TASK_IO_ACCOUNTING=y
48CONFIG_AUDIT=y
49# CONFIG_IKCONFIG is not set
50CONFIG_LOG_BUF_SHIFT=17
51CONFIG_CGROUPS=y
52# CONFIG_CGROUP_DEBUG is not set
53# CONFIG_CGROUP_NS is not set
54# CONFIG_CGROUP_FREEZER is not set
55# CONFIG_CGROUP_DEVICE is not set
56CONFIG_GROUP_SCHED=y
57CONFIG_FAIR_GROUP_SCHED=y
58CONFIG_RT_GROUP_SCHED=y
59# CONFIG_USER_SCHED is not set
60CONFIG_CGROUP_SCHED=y
61CONFIG_CGROUP_CPUACCT=y
62# CONFIG_RESOURCE_COUNTERS is not set
63CONFIG_SYSFS_DEPRECATED=y
64CONFIG_SYSFS_DEPRECATED_V2=y
65CONFIG_RELAY=y
66# CONFIG_NAMESPACES is not set
67CONFIG_BLK_DEV_INITRD=y
68CONFIG_INITRAMFS_SOURCE=""
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
75# CONFIG_KALLSYMS_EXTRA_PASS is not set
76CONFIG_HOTPLUG=y
77CONFIG_PRINTK=y
78CONFIG_BUG=y
79CONFIG_ELF_CORE=y
80CONFIG_COMPAT_BRK=y
81CONFIG_BASE_FULL=y
82CONFIG_FUTEX=y
83CONFIG_ANON_INODES=y
84CONFIG_EPOLL=y
85CONFIG_SIGNALFD=y
86CONFIG_TIMERFD=y
87CONFIG_EVENTFD=y
88CONFIG_SHMEM=y
89CONFIG_AIO=y
90CONFIG_VM_EVENT_COUNTERS=y
91CONFIG_SLAB=y
92# CONFIG_SLUB is not set
93# CONFIG_SLOB is not set
94CONFIG_PROFILING=y
95CONFIG_MARKERS=y
96CONFIG_OPROFILE=m
97CONFIG_HAVE_OPROFILE=y
98CONFIG_KPROBES=y
99CONFIG_KRETPROBES=y
100CONFIG_HAVE_KPROBES=y
101CONFIG_HAVE_KRETPROBES=y
102CONFIG_HAVE_CLK=y
103CONFIG_HAVE_GENERIC_DMA_COHERENT=y
104CONFIG_SLABINFO=y
105CONFIG_RT_MUTEXES=y
106# CONFIG_TINY_SHMEM is not set
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
112CONFIG_MODVERSIONS=y
113CONFIG_MODULE_SRCVERSION_ALL=y
114CONFIG_KMOD=y
115CONFIG_BLOCK=y
116# CONFIG_LBD is not set
117CONFIG_BLK_DEV_IO_TRACE=y
118# CONFIG_LSF 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_CLASSIC_RCU=y
135# CONFIG_FREEZER is not set
136
137#
138# System Type
139#
140# CONFIG_ARCH_AAEC2000 is not set
141# CONFIG_ARCH_INTEGRATOR is not set
142# CONFIG_ARCH_REALVIEW is not set
143# CONFIG_ARCH_VERSATILE is not set
144CONFIG_ARCH_AT91=y
145# CONFIG_ARCH_CLPS7500 is not set
146# CONFIG_ARCH_CLPS711X is not set
147# CONFIG_ARCH_EBSA110 is not set
148# CONFIG_ARCH_EP93XX is not set
149# CONFIG_ARCH_FOOTBRIDGE is not set
150# CONFIG_ARCH_NETX is not set
151# CONFIG_ARCH_H720X is not set
152# CONFIG_ARCH_IMX is not set
153# CONFIG_ARCH_IOP13XX is not set
154# CONFIG_ARCH_IOP32X is not set
155# CONFIG_ARCH_IOP33X is not set
156# CONFIG_ARCH_IXP23XX is not set
157# CONFIG_ARCH_IXP2000 is not set
158# CONFIG_ARCH_IXP4XX is not set
159# CONFIG_ARCH_L7200 is not set
160# CONFIG_ARCH_KIRKWOOD is not set
161# CONFIG_ARCH_KS8695 is not set
162# CONFIG_ARCH_NS9XXX is not set
163# CONFIG_ARCH_LOKI is not set
164# CONFIG_ARCH_MV78XX0 is not set
165# CONFIG_ARCH_MXC is not set
166# CONFIG_ARCH_ORION5X is not set
167# CONFIG_ARCH_PNX4008 is not set
168# CONFIG_ARCH_PXA is not set
169# CONFIG_ARCH_RPC is not set
170# CONFIG_ARCH_SA1100 is not set
171# CONFIG_ARCH_S3C2410 is not set
172# CONFIG_ARCH_SHARK is not set
173# CONFIG_ARCH_LH7A40X is not set
174# CONFIG_ARCH_DAVINCI is not set
175# CONFIG_ARCH_OMAP is not set
176# CONFIG_ARCH_MSM is not set
177
178#
179# Boot options
180#
181
182#
183# Power management
184#
185
186#
187# Atmel AT91 System-on-Chip
188#
189# CONFIG_ARCH_AT91RM9200 is not set
190# CONFIG_ARCH_AT91SAM9260 is not set
191# CONFIG_ARCH_AT91SAM9261 is not set
192# CONFIG_ARCH_AT91SAM9263 is not set
193# CONFIG_ARCH_AT91SAM9RL is not set
194# CONFIG_ARCH_AT91SAM9G20 is not set
195# CONFIG_ARCH_AT91CAP9 is not set
196# CONFIG_ARCH_AT91X40 is not set
197CONFIG_ARCH_AT572D940HF=y
198CONFIG_AT91_PMC_UNIT=y
199
200#
201# AT572D940HF Board Type
202#
203CONFIG_MACH_AT572D940HFEB=y
204
205#
206# AT91 Board Options
207#
208# CONFIG_MTD_AT91_DATAFLASH_CARD is not set
209# CONFIG_MTD_NAND_ATMEL_BUSWIDTH_16 is not set
210CONFIG_NUM_SERIAL=3
211
212#
213# AT91 Feature Selections
214#
215CONFIG_AT91_PROGRAMMABLE_CLOCKS=y
216CONFIG_AT91_TIMER_HZ=100
217CONFIG_AT91_EARLY_DBGU=y
218# CONFIG_AT91_EARLY_USART0 is not set
219# CONFIG_AT91_EARLY_USART1 is not set
220# CONFIG_AT91_EARLY_USART2 is not set
221# CONFIG_AT91_EARLY_USART3 is not set
222# CONFIG_AT91_EARLY_USART4 is not set
223# CONFIG_AT91_EARLY_USART5 is not set
224
225#
226# Processor Type
227#
228CONFIG_CPU_32=y
229CONFIG_CPU_ARM926T=y
230CONFIG_CPU_32v5=y
231CONFIG_CPU_ABRT_EV5TJ=y
232CONFIG_CPU_PABRT_NOIFAR=y
233CONFIG_CPU_CACHE_VIVT=y
234CONFIG_CPU_COPY_V4WB=y
235CONFIG_CPU_TLB_V4WBI=y
236CONFIG_CPU_CP15=y
237CONFIG_CPU_CP15_MMU=y
238
239#
240# Processor Features
241#
242CONFIG_ARM_THUMB=y
243# CONFIG_CPU_ICACHE_DISABLE is not set
244# CONFIG_CPU_DCACHE_DISABLE is not set
245# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
246# CONFIG_CPU_CACHE_ROUND_ROBIN is not set
247# CONFIG_OUTER_CACHE is not set
248
249#
250# Bus support
251#
252# CONFIG_PCI_SYSCALL is not set
253# CONFIG_ARCH_SUPPORTS_MSI is not set
254# CONFIG_PCCARD is not set
255
256#
257# Kernel Features
258#
259CONFIG_TICK_ONESHOT=y
260CONFIG_NO_HZ=y
261CONFIG_HIGH_RES_TIMERS=y
262CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
263CONFIG_VMSPLIT_3G=y
264# CONFIG_VMSPLIT_2G is not set
265# CONFIG_VMSPLIT_1G is not set
266CONFIG_PAGE_OFFSET=0xC0000000
267CONFIG_PREEMPT=y
268CONFIG_HZ=100
269# CONFIG_AEABI is not set
270CONFIG_ARCH_FLATMEM_HAS_HOLES=y
271# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
272# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
273CONFIG_SELECT_MEMORY_MODEL=y
274CONFIG_FLATMEM_MANUAL=y
275# CONFIG_DISCONTIGMEM_MANUAL is not set
276# CONFIG_SPARSEMEM_MANUAL is not set
277CONFIG_FLATMEM=y
278CONFIG_FLAT_NODE_MEM_MAP=y
279CONFIG_PAGEFLAGS_EXTENDED=y
280CONFIG_SPLIT_PTLOCK_CPUS=4096
281CONFIG_RESOURCES_64BIT=y
282# CONFIG_PHYS_ADDR_T_64BIT is not set
283CONFIG_ZONE_DMA_FLAG=0
284CONFIG_VIRT_TO_BUS=y
285CONFIG_UNEVICTABLE_LRU=y
286# CONFIG_LEDS is not set
287CONFIG_ALIGNMENT_TRAP=y
288
289#
290# Boot options
291#
292CONFIG_ZBOOT_ROM_TEXT=0
293CONFIG_ZBOOT_ROM_BSS=0
294CONFIG_CMDLINE="mem=48M console=ttyS0 initrd=0x21100000,3145728 root=/dev/ram0 rw ip=172.16.1.181"
295# CONFIG_XIP_KERNEL is not set
296CONFIG_KEXEC=y
297CONFIG_ATAGS_PROC=y
298
299#
300# CPU Power Management
301#
302# CONFIG_CPU_IDLE is not set
303
304#
305# Floating point emulation
306#
307
308#
309# At least one emulation must be selected
310#
311CONFIG_FPE_NWFPE=y
312CONFIG_FPE_NWFPE_XP=y
313# CONFIG_FPE_FASTFPE is not set
314# CONFIG_VFP is not set
315
316#
317# Userspace binary formats
318#
319CONFIG_BINFMT_ELF=y
320# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
321CONFIG_HAVE_AOUT=y
322# CONFIG_BINFMT_AOUT is not set
323# CONFIG_BINFMT_MISC is not set
324# CONFIG_ARTHUR is not set
325
326#
327# Power management options
328#
329# CONFIG_PM is not set
330CONFIG_ARCH_SUSPEND_POSSIBLE=y
331CONFIG_NET=y
332
333#
334# Networking options
335#
336CONFIG_PACKET=m
337CONFIG_PACKET_MMAP=y
338CONFIG_UNIX=y
339# CONFIG_NET_KEY is not set
340CONFIG_INET=y
341# CONFIG_IP_MULTICAST is not set
342# CONFIG_IP_ADVANCED_ROUTER is not set
343CONFIG_IP_FIB_HASH=y
344# CONFIG_IP_PNP is not set
345# CONFIG_NET_IPIP is not set
346# CONFIG_NET_IPGRE is not set
347# CONFIG_ARPD is not set
348# CONFIG_SYN_COOKIES is not set
349# CONFIG_INET_AH is not set
350# CONFIG_INET_ESP is not set
351# CONFIG_INET_IPCOMP is not set
352# CONFIG_INET_XFRM_TUNNEL is not set
353# CONFIG_INET_TUNNEL is not set
354# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
355# CONFIG_INET_XFRM_MODE_TUNNEL is not set
356# CONFIG_INET_XFRM_MODE_BEET is not set
357# CONFIG_INET_LRO is not set
358# CONFIG_INET_DIAG is not set
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
367CONFIG_IP_SCTP=m
368# CONFIG_SCTP_DBG_MSG is not set
369# CONFIG_SCTP_DBG_OBJCNT is not set
370# CONFIG_SCTP_HMAC_NONE is not set
371# CONFIG_SCTP_HMAC_SHA1 is not set
372CONFIG_SCTP_HMAC_MD5=y
373# CONFIG_TIPC is not set
374# CONFIG_ATM is not set
375# CONFIG_BRIDGE is not set
376# CONFIG_NET_DSA is not set
377# CONFIG_VLAN_8021Q is not set
378# CONFIG_DECNET is not set
379# CONFIG_LLC2 is not set
380# CONFIG_IPX is not set
381# CONFIG_ATALK is not set
382# CONFIG_X25 is not set
383# CONFIG_LAPB is not set
384# CONFIG_ECONET is not set
385# CONFIG_WAN_ROUTER is not set
386# CONFIG_NET_SCHED is not set
387
388#
389# Network testing
390#
391CONFIG_NET_PKTGEN=m
392CONFIG_NET_TCPPROBE=m
393# CONFIG_HAMRADIO is not set
394CONFIG_CAN=m
395CONFIG_CAN_RAW=m
396CONFIG_CAN_BCM=m
397
398#
399# CAN Device Drivers
400#
401CONFIG_CAN_VCAN=m
402CONFIG_CAN_DEBUG_DEVICES=y
403# CONFIG_IRDA is not set
404# CONFIG_BT is not set
405# CONFIG_AF_RXRPC is not set
406# CONFIG_PHONET is not set
407CONFIG_WIRELESS=y
408# CONFIG_CFG80211 is not set
409CONFIG_WIRELESS_OLD_REGULATORY=y
410CONFIG_WIRELESS_EXT=y
411CONFIG_WIRELESS_EXT_SYSFS=y
412# CONFIG_MAC80211 is not set
413CONFIG_IEEE80211=m
414# CONFIG_IEEE80211_DEBUG is not set
415CONFIG_IEEE80211_CRYPT_WEP=m
416# CONFIG_IEEE80211_CRYPT_CCMP is not set
417# CONFIG_IEEE80211_CRYPT_TKIP is not set
418# CONFIG_RFKILL is not set
419# CONFIG_NET_9P is not set
420
421#
422# Device Drivers
423#
424
425#
426# Generic Driver Options
427#
428CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
429CONFIG_STANDALONE=y
430CONFIG_PREVENT_FIRMWARE_BUILD=y
431CONFIG_FW_LOADER=y
432CONFIG_FIRMWARE_IN_KERNEL=y
433CONFIG_EXTRA_FIRMWARE=""
434# CONFIG_SYS_HYPERVISOR is not set
435CONFIG_CONNECTOR=m
436CONFIG_MTD=m
437CONFIG_MTD_DEBUG=y
438CONFIG_MTD_DEBUG_VERBOSE=1
439CONFIG_MTD_CONCAT=m
440CONFIG_MTD_PARTITIONS=y
441# CONFIG_MTD_REDBOOT_PARTS is not set
442# CONFIG_MTD_AFS_PARTS is not set
443# CONFIG_MTD_AR7_PARTS is not set
444
445#
446# User Modules And Translation Layers
447#
448CONFIG_MTD_CHAR=m
449CONFIG_MTD_BLKDEVS=m
450CONFIG_MTD_BLOCK=m
451CONFIG_MTD_BLOCK_RO=m
452CONFIG_FTL=m
453CONFIG_NFTL=m
454CONFIG_NFTL_RW=y
455CONFIG_INFTL=m
456CONFIG_RFD_FTL=m
457CONFIG_SSFDC=m
458CONFIG_MTD_OOPS=m
459
460#
461# RAM/ROM/Flash chip drivers
462#
463CONFIG_MTD_CFI=m
464CONFIG_MTD_JEDECPROBE=m
465CONFIG_MTD_GEN_PROBE=m
466# CONFIG_MTD_CFI_ADV_OPTIONS is not set
467CONFIG_MTD_MAP_BANK_WIDTH_1=y
468CONFIG_MTD_MAP_BANK_WIDTH_2=y
469CONFIG_MTD_MAP_BANK_WIDTH_4=y
470# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
471# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
472# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
473CONFIG_MTD_CFI_I1=y
474CONFIG_MTD_CFI_I2=y
475# CONFIG_MTD_CFI_I4 is not set
476# CONFIG_MTD_CFI_I8 is not set
477CONFIG_MTD_CFI_INTELEXT=m
478CONFIG_MTD_CFI_AMDSTD=m
479CONFIG_MTD_CFI_STAA=m
480CONFIG_MTD_CFI_UTIL=m
481CONFIG_MTD_RAM=m
482CONFIG_MTD_ROM=m
483CONFIG_MTD_ABSENT=m
484
485#
486# Mapping drivers for chip access
487#
488CONFIG_MTD_COMPLEX_MAPPINGS=y
489CONFIG_MTD_PHYSMAP=m
490CONFIG_MTD_PHYSMAP_START=0x8000000
491CONFIG_MTD_PHYSMAP_LEN=0x4000000
492CONFIG_MTD_PHYSMAP_BANKWIDTH=2
493# CONFIG_MTD_ARM_INTEGRATOR is not set
494# CONFIG_MTD_IMPA7 is not set
495CONFIG_MTD_PLATRAM=m
496
497#
498# Self-contained MTD device drivers
499#
500CONFIG_MTD_DATAFLASH=m
501# CONFIG_MTD_DATAFLASH_WRITE_VERIFY is not set
502# CONFIG_MTD_DATAFLASH_OTP is not set
503CONFIG_MTD_M25P80=m
504CONFIG_M25PXX_USE_FAST_READ=y
505CONFIG_MTD_SLRAM=m
506CONFIG_MTD_PHRAM=m
507CONFIG_MTD_MTDRAM=m
508CONFIG_MTDRAM_TOTAL_SIZE=4096
509CONFIG_MTDRAM_ERASE_SIZE=128
510CONFIG_MTD_BLOCK2MTD=m
511
512#
513# Disk-On-Chip Device Drivers
514#
515# CONFIG_MTD_DOC2000 is not set
516# CONFIG_MTD_DOC2001 is not set
517# CONFIG_MTD_DOC2001PLUS is not set
518CONFIG_MTD_NAND=m
519CONFIG_MTD_NAND_VERIFY_WRITE=y
520# CONFIG_MTD_NAND_ECC_SMC is not set
521# CONFIG_MTD_NAND_MUSEUM_IDS is not set
522# CONFIG_MTD_NAND_GPIO is not set
523CONFIG_MTD_NAND_IDS=m
524CONFIG_MTD_NAND_DISKONCHIP=m
525# CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADVANCED is not set
526CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADDRESS=0
527# CONFIG_MTD_NAND_DISKONCHIP_BBTWRITE is not set
528# CONFIG_MTD_NAND_ATMEL is not set
529CONFIG_MTD_NAND_NANDSIM=m
530CONFIG_MTD_NAND_PLATFORM=m
531CONFIG_MTD_ALAUDA=m
532# CONFIG_MTD_ONENAND is not set
533
534#
535# UBI - Unsorted block images
536#
537CONFIG_MTD_UBI=m
538CONFIG_MTD_UBI_WL_THRESHOLD=4096
539CONFIG_MTD_UBI_BEB_RESERVE=1
540CONFIG_MTD_UBI_GLUEBI=y
541
542#
543# UBI debugging options
544#
545# CONFIG_MTD_UBI_DEBUG is not set
546# CONFIG_PARPORT is not set
547CONFIG_BLK_DEV=y
548# CONFIG_BLK_DEV_COW_COMMON is not set
549CONFIG_BLK_DEV_LOOP=y
550CONFIG_BLK_DEV_CRYPTOLOOP=m
551CONFIG_BLK_DEV_NBD=m
552# CONFIG_BLK_DEV_UB is not set
553CONFIG_BLK_DEV_RAM=y
554CONFIG_BLK_DEV_RAM_COUNT=16
555CONFIG_BLK_DEV_RAM_SIZE=65536
556# CONFIG_BLK_DEV_XIP is not set
557# CONFIG_CDROM_PKTCDVD is not set
558# CONFIG_ATA_OVER_ETH is not set
559CONFIG_MISC_DEVICES=y
560CONFIG_ATMEL_TCLIB=y
561CONFIG_ATMEL_TCB_CLKSRC=y
562CONFIG_ATMEL_TCB_CLKSRC_BLOCK=0
563# CONFIG_EEPROM_93CX6 is not set
564# CONFIG_ICS932S401 is not set
565CONFIG_ATMEL_SSC=m
566# CONFIG_ENCLOSURE_SERVICES is not set
567# CONFIG_C2PORT is not set
568CONFIG_HAVE_IDE=y
569# CONFIG_IDE is not set
570
571#
572# SCSI device support
573#
574CONFIG_RAID_ATTRS=m
575CONFIG_SCSI=m
576CONFIG_SCSI_DMA=y
577CONFIG_SCSI_TGT=m
578# CONFIG_SCSI_NETLINK is not set
579# CONFIG_SCSI_PROC_FS is not set
580
581#
582# SCSI support type (disk, tape, CD-ROM)
583#
584CONFIG_BLK_DEV_SD=m
585# CONFIG_CHR_DEV_ST is not set
586# CONFIG_CHR_DEV_OSST is not set
587CONFIG_BLK_DEV_SR=m
588# CONFIG_BLK_DEV_SR_VENDOR is not set
589CONFIG_CHR_DEV_SG=m
590CONFIG_CHR_DEV_SCH=m
591
592#
593# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
594#
595CONFIG_SCSI_MULTI_LUN=y
596CONFIG_SCSI_CONSTANTS=y
597CONFIG_SCSI_LOGGING=y
598CONFIG_SCSI_SCAN_ASYNC=y
599CONFIG_SCSI_WAIT_SCAN=m
600
601#
602# SCSI Transports
603#
604# CONFIG_SCSI_SPI_ATTRS is not set
605# CONFIG_SCSI_FC_ATTRS is not set
606CONFIG_SCSI_ISCSI_ATTRS=m
607# CONFIG_SCSI_SAS_LIBSAS is not set
608# CONFIG_SCSI_SRP_ATTRS is not set
609CONFIG_SCSI_LOWLEVEL=y
610# CONFIG_ISCSI_TCP is not set
611# CONFIG_SCSI_DEBUG is not set
612# CONFIG_SCSI_DH is not set
613# CONFIG_ATA is not set
614# CONFIG_MD is not set
615CONFIG_NETDEVICES=y
616CONFIG_DUMMY=m
617CONFIG_BONDING=m
618CONFIG_MACVLAN=m
619CONFIG_EQUALIZER=m
620CONFIG_TUN=m
621CONFIG_VETH=m
622CONFIG_PHYLIB=y
623
624#
625# MII PHY device drivers
626#
627CONFIG_MARVELL_PHY=m
628CONFIG_DAVICOM_PHY=m
629CONFIG_QSEMI_PHY=m
630CONFIG_LXT_PHY=m
631CONFIG_CICADA_PHY=m
632CONFIG_VITESSE_PHY=m
633CONFIG_SMSC_PHY=m
634CONFIG_BROADCOM_PHY=m
635CONFIG_ICPLUS_PHY=m
636# CONFIG_REALTEK_PHY is not set
637# CONFIG_FIXED_PHY is not set
638CONFIG_MDIO_BITBANG=m
639CONFIG_NET_ETHERNET=y
640CONFIG_MII=m
641CONFIG_MACB=y
642# CONFIG_AX88796 is not set
643# CONFIG_SMC91X is not set
644# CONFIG_DM9000 is not set
645# CONFIG_ENC28J60 is not set
646# CONFIG_SMC911X is not set
647# CONFIG_IBM_NEW_EMAC_ZMII is not set
648# CONFIG_IBM_NEW_EMAC_RGMII is not set
649# CONFIG_IBM_NEW_EMAC_TAH is not set
650# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
651# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
652# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
653# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
654# CONFIG_B44 is not set
655# CONFIG_NETDEV_1000 is not set
656# CONFIG_NETDEV_10000 is not set
657
658#
659# Wireless LAN
660#
661CONFIG_WLAN_PRE80211=y
662CONFIG_STRIP=m
663CONFIG_WLAN_80211=y
664CONFIG_LIBERTAS=m
665CONFIG_LIBERTAS_USB=m
666CONFIG_LIBERTAS_SDIO=m
667# CONFIG_LIBERTAS_DEBUG is not set
668CONFIG_USB_ZD1201=m
669# CONFIG_USB_NET_RNDIS_WLAN is not set
670# CONFIG_IWLWIFI_LEDS is not set
671CONFIG_HOSTAP=m
672CONFIG_HOSTAP_FIRMWARE=y
673CONFIG_HOSTAP_FIRMWARE_NVRAM=y
674
675#
676# USB Network Adapters
677#
678CONFIG_USB_CATC=m
679CONFIG_USB_KAWETH=m
680CONFIG_USB_PEGASUS=m
681CONFIG_USB_RTL8150=m
682CONFIG_USB_USBNET=m
683CONFIG_USB_NET_AX8817X=m
684CONFIG_USB_NET_CDCETHER=m
685CONFIG_USB_NET_DM9601=m
686# CONFIG_USB_NET_SMSC95XX is not set
687CONFIG_USB_NET_GL620A=m
688CONFIG_USB_NET_NET1080=m
689CONFIG_USB_NET_PLUSB=m
690CONFIG_USB_NET_MCS7830=m
691CONFIG_USB_NET_RNDIS_HOST=m
692CONFIG_USB_NET_CDC_SUBSET=m
693CONFIG_USB_ALI_M5632=y
694CONFIG_USB_AN2720=y
695CONFIG_USB_BELKIN=y
696CONFIG_USB_ARMLINUX=y
697CONFIG_USB_EPSON2888=y
698CONFIG_USB_KC2190=y
699# CONFIG_USB_NET_ZAURUS is not set
700# CONFIG_WAN is not set
701# CONFIG_PPP is not set
702# CONFIG_SLIP is not set
703# CONFIG_NETCONSOLE is not set
704# CONFIG_NETPOLL is not set
705# CONFIG_NET_POLL_CONTROLLER is not set
706# CONFIG_ISDN is not set
707
708#
709# Input device support
710#
711CONFIG_INPUT=y
712# CONFIG_INPUT_FF_MEMLESS is not set
713CONFIG_INPUT_POLLDEV=m
714
715#
716# Userland interfaces
717#
718CONFIG_INPUT_MOUSEDEV=m
719CONFIG_INPUT_MOUSEDEV_PSAUX=y
720CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
721CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
722# CONFIG_INPUT_JOYDEV is not set
723CONFIG_INPUT_EVDEV=m
724CONFIG_INPUT_EVBUG=m
725
726#
727# Input Device Drivers
728#
729CONFIG_INPUT_KEYBOARD=y
730CONFIG_KEYBOARD_ATKBD=y
731CONFIG_KEYBOARD_SUNKBD=m
732CONFIG_KEYBOARD_LKKBD=m
733CONFIG_KEYBOARD_XTKBD=m
734CONFIG_KEYBOARD_NEWTON=m
735CONFIG_KEYBOARD_STOWAWAY=m
736CONFIG_KEYBOARD_GPIO=m
737CONFIG_INPUT_MOUSE=y
738CONFIG_MOUSE_PS2=m
739CONFIG_MOUSE_PS2_ALPS=y
740CONFIG_MOUSE_PS2_LOGIPS2PP=y
741CONFIG_MOUSE_PS2_SYNAPTICS=y
742CONFIG_MOUSE_PS2_LIFEBOOK=y
743CONFIG_MOUSE_PS2_TRACKPOINT=y
744# CONFIG_MOUSE_PS2_ELANTECH is not set
745# CONFIG_MOUSE_PS2_TOUCHKIT is not set
746CONFIG_MOUSE_SERIAL=m
747CONFIG_MOUSE_APPLETOUCH=m
748# CONFIG_MOUSE_BCM5974 is not set
749CONFIG_MOUSE_VSXXXAA=m
750CONFIG_MOUSE_GPIO=m
751# CONFIG_INPUT_JOYSTICK is not set
752# CONFIG_INPUT_TABLET is not set
753# CONFIG_INPUT_TOUCHSCREEN is not set
754CONFIG_INPUT_MISC=y
755# CONFIG_INPUT_ATI_REMOTE is not set
756# CONFIG_INPUT_ATI_REMOTE2 is not set
757# CONFIG_INPUT_KEYSPAN_REMOTE is not set
758# CONFIG_INPUT_POWERMATE is not set
759# CONFIG_INPUT_YEALINK is not set
760# CONFIG_INPUT_CM109 is not set
761CONFIG_INPUT_UINPUT=m
762
763#
764# Hardware I/O ports
765#
766CONFIG_SERIO=y
767CONFIG_SERIO_SERPORT=m
768CONFIG_SERIO_LIBPS2=y
769CONFIG_SERIO_RAW=m
770# CONFIG_GAMEPORT is not set
771
772#
773# Character devices
774#
775CONFIG_VT=y
776CONFIG_CONSOLE_TRANSLATIONS=y
777CONFIG_VT_CONSOLE=y
778CONFIG_HW_CONSOLE=y
779CONFIG_VT_HW_CONSOLE_BINDING=y
780CONFIG_DEVKMEM=y
781CONFIG_SERIAL_NONSTANDARD=y
782CONFIG_N_HDLC=m
783# CONFIG_RISCOM8 is not set
784CONFIG_SPECIALIX=m
785CONFIG_RIO=m
786# CONFIG_RIO_OLDPCI is not set
787CONFIG_STALDRV=y
788
789#
790# Serial drivers
791#
792# CONFIG_SERIAL_8250 is not set
793
794#
795# Non-8250 serial port support
796#
797CONFIG_SERIAL_ATMEL=y
798CONFIG_SERIAL_ATMEL_CONSOLE=y
799CONFIG_SERIAL_ATMEL_PDC=y
800# CONFIG_SERIAL_ATMEL_TTYAT is not set
801CONFIG_SERIAL_CORE=y
802CONFIG_SERIAL_CORE_CONSOLE=y
803CONFIG_UNIX98_PTYS=y
804CONFIG_LEGACY_PTYS=y
805CONFIG_LEGACY_PTY_COUNT=256
806CONFIG_IPMI_HANDLER=m
807# CONFIG_IPMI_PANIC_EVENT is not set
808CONFIG_IPMI_DEVICE_INTERFACE=m
809CONFIG_IPMI_SI=m
810CONFIG_IPMI_WATCHDOG=m
811CONFIG_IPMI_POWEROFF=m
812CONFIG_HW_RANDOM=y
813CONFIG_NVRAM=m
814CONFIG_R3964=m
815CONFIG_RAW_DRIVER=m
816CONFIG_MAX_RAW_DEVS=256
817CONFIG_TCG_TPM=m
818CONFIG_TCG_NSC=m
819CONFIG_TCG_ATMEL=m
820CONFIG_I2C=m
821CONFIG_I2C_BOARDINFO=y
822CONFIG_I2C_CHARDEV=m
823CONFIG_I2C_HELPER_AUTO=y
824
825#
826# I2C Hardware Bus support
827#
828
829#
830# I2C system bus drivers (mostly embedded / system-on-chip)
831#
832# CONFIG_I2C_GPIO is not set
833# CONFIG_I2C_OCORES is not set
834# CONFIG_I2C_SIMTEC is not set
835
836#
837# External I2C/SMBus adapter drivers
838#
839# CONFIG_I2C_PARPORT_LIGHT is not set
840# CONFIG_I2C_TAOS_EVM is not set
841# CONFIG_I2C_TINY_USB is not set
842
843#
844# Other I2C/SMBus bus drivers
845#
846# CONFIG_I2C_PCA_PLATFORM is not set
847# CONFIG_I2C_STUB is not set
848
849#
850# Miscellaneous I2C Chip support
851#
852CONFIG_DS1682=m
853# CONFIG_AT24 is not set
854CONFIG_SENSORS_EEPROM=m
855CONFIG_SENSORS_PCF8574=m
856# CONFIG_PCF8575 is not set
857# CONFIG_SENSORS_PCA9539 is not set
858CONFIG_SENSORS_PCF8591=m
859CONFIG_SENSORS_MAX6875=m
860CONFIG_SENSORS_TSL2550=m
861# CONFIG_I2C_DEBUG_CORE is not set
862# CONFIG_I2C_DEBUG_ALGO is not set
863# CONFIG_I2C_DEBUG_BUS is not set
864# CONFIG_I2C_DEBUG_CHIP is not set
865CONFIG_SPI=y
866CONFIG_SPI_MASTER=y
867
868#
869# SPI Master Controller Drivers
870#
871CONFIG_SPI_ATMEL=y
872CONFIG_SPI_BITBANG=m
873
874#
875# SPI Protocol Masters
876#
877CONFIG_SPI_AT25=m
878CONFIG_SPI_SPIDEV=m
879# CONFIG_SPI_TLE62X0 is not set
880# CONFIG_W1 is not set
881# CONFIG_POWER_SUPPLY is not set
882# CONFIG_HWMON is not set
883# CONFIG_THERMAL is not set
884# CONFIG_THERMAL_HWMON is not set
885# CONFIG_WATCHDOG is not set
886CONFIG_SSB_POSSIBLE=y
887
888#
889# Sonics Silicon Backplane
890#
891# CONFIG_SSB is not set
892
893#
894# Multifunction device drivers
895#
896# CONFIG_MFD_CORE is not set
897# CONFIG_MFD_SM501 is not set
898# CONFIG_HTC_PASIC3 is not set
899# CONFIG_MFD_TMIO is not set
900# CONFIG_MFD_T7L66XB is not set
901# CONFIG_MFD_TC6387XB is not set
902# CONFIG_MFD_WM8400 is not set
903# CONFIG_MFD_WM8350_I2C is not set
904
905#
906# Multimedia devices
907#
908
909#
910# Multimedia core support
911#
912# CONFIG_VIDEO_DEV is not set
913# CONFIG_DVB_CORE is not set
914# CONFIG_VIDEO_MEDIA is not set
915
916#
917# Multimedia drivers
918#
919# CONFIG_DAB is not set
920
921#
922# Graphics support
923#
924# CONFIG_VGASTATE is not set
925# CONFIG_VIDEO_OUTPUT_CONTROL is not set
926# CONFIG_FB is not set
927# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
928
929#
930# Display device support
931#
932# CONFIG_DISPLAY_SUPPORT is not set
933
934#
935# Console display driver support
936#
937# CONFIG_VGA_CONSOLE is not set
938CONFIG_DUMMY_CONSOLE=y
939CONFIG_SOUND=m
940CONFIG_SOUND_OSS_CORE=y
941CONFIG_SND=m
942CONFIG_SND_TIMER=m
943CONFIG_SND_PCM=m
944CONFIG_SND_HWDEP=m
945CONFIG_SND_RAWMIDI=m
946CONFIG_SND_SEQUENCER=m
947CONFIG_SND_SEQ_DUMMY=m
948CONFIG_SND_OSSEMUL=y
949CONFIG_SND_MIXER_OSS=m
950CONFIG_SND_PCM_OSS=m
951# CONFIG_SND_PCM_OSS_PLUGINS is not set
952CONFIG_SND_SEQUENCER_OSS=y
953CONFIG_SND_DYNAMIC_MINORS=y
954CONFIG_SND_SUPPORT_OLD_API=y
955# CONFIG_SND_VERBOSE_PROCFS is not set
956# CONFIG_SND_VERBOSE_PRINTK is not set
957# CONFIG_SND_DEBUG is not set
958CONFIG_SND_DRIVERS=y
959CONFIG_SND_DUMMY=m
960CONFIG_SND_VIRMIDI=m
961# CONFIG_SND_MTPAV is not set
962# CONFIG_SND_SERIAL_U16550 is not set
963# CONFIG_SND_MPU401 is not set
964CONFIG_SND_ARM=y
965CONFIG_SND_SPI=y
966# CONFIG_SND_AT73C213 is not set
967CONFIG_SND_USB=y
968CONFIG_SND_USB_AUDIO=m
969CONFIG_SND_USB_CAIAQ=m
970CONFIG_SND_USB_CAIAQ_INPUT=y
971# CONFIG_SND_SOC is not set
972# CONFIG_SOUND_PRIME is not set
973CONFIG_HID_SUPPORT=y
974CONFIG_HID=m
975# CONFIG_HID_DEBUG is not set
976CONFIG_HIDRAW=y
977
978#
979# USB Input Devices
980#
981CONFIG_USB_HID=m
982# CONFIG_HID_PID is not set
983CONFIG_USB_HIDDEV=y
984
985#
986# USB HID Boot Protocol drivers
987#
988CONFIG_USB_KBD=m
989CONFIG_USB_MOUSE=m
990
991#
992# Special HID drivers
993#
994CONFIG_HID_COMPAT=y
995CONFIG_HID_A4TECH=m
996CONFIG_HID_APPLE=m
997CONFIG_HID_BELKIN=m
998CONFIG_HID_BRIGHT=m
999CONFIG_HID_CHERRY=m
1000CONFIG_HID_CHICONY=m
1001CONFIG_HID_CYPRESS=m
1002CONFIG_HID_DELL=m
1003CONFIG_HID_EZKEY=m
1004CONFIG_HID_GYRATION=m
1005CONFIG_HID_LOGITECH=m
1006# CONFIG_LOGITECH_FF is not set
1007# CONFIG_LOGIRUMBLEPAD2_FF is not set
1008CONFIG_HID_MICROSOFT=m
1009CONFIG_HID_MONTEREY=m
1010CONFIG_HID_PANTHERLORD=m
1011# CONFIG_PANTHERLORD_FF is not set
1012CONFIG_HID_PETALYNX=m
1013CONFIG_HID_SAMSUNG=m
1014CONFIG_HID_SONY=m
1015CONFIG_HID_SUNPLUS=m
1016# CONFIG_THRUSTMASTER_FF is not set
1017# CONFIG_ZEROPLUS_FF is not set
1018CONFIG_USB_SUPPORT=y
1019CONFIG_USB_ARCH_HAS_HCD=y
1020CONFIG_USB_ARCH_HAS_OHCI=y
1021# CONFIG_USB_ARCH_HAS_EHCI is not set
1022CONFIG_USB=y
1023# CONFIG_USB_DEBUG is not set
1024# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
1025
1026#
1027# Miscellaneous USB options
1028#
1029CONFIG_USB_DEVICEFS=y
1030# CONFIG_USB_DEVICE_CLASS is not set
1031CONFIG_USB_DYNAMIC_MINORS=y
1032# CONFIG_USB_OTG is not set
1033# CONFIG_USB_OTG_WHITELIST is not set
1034# CONFIG_USB_OTG_BLACKLIST_HUB is not set
1035CONFIG_USB_MON=y
1036# CONFIG_USB_WUSB is not set
1037# CONFIG_USB_WUSB_CBAF is not set
1038
1039#
1040# USB Host Controller Drivers
1041#
1042# CONFIG_USB_C67X00_HCD is not set
1043# CONFIG_USB_ISP116X_HCD is not set
1044CONFIG_USB_OHCI_HCD=y
1045# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
1046# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
1047CONFIG_USB_OHCI_LITTLE_ENDIAN=y
1048# CONFIG_USB_SL811_HCD is not set
1049# CONFIG_USB_R8A66597_HCD is not set
1050# CONFIG_USB_HWA_HCD is not set
1051# CONFIG_USB_MUSB_HDRC is not set
1052# CONFIG_USB_GADGET_MUSB_HDRC is not set
1053
1054#
1055# USB Device Class drivers
1056#
1057# CONFIG_USB_ACM is not set
1058# CONFIG_USB_PRINTER is not set
1059# CONFIG_USB_WDM is not set
1060# CONFIG_USB_TMC is not set
1061
1062#
1063# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
1064#
1065
1066#
1067# see USB_STORAGE Help for more information
1068#
1069CONFIG_USB_STORAGE=m
1070# CONFIG_USB_STORAGE_DEBUG is not set
1071CONFIG_USB_STORAGE_DATAFAB=y
1072CONFIG_USB_STORAGE_FREECOM=y
1073CONFIG_USB_STORAGE_ISD200=y
1074CONFIG_USB_STORAGE_DPCM=y
1075CONFIG_USB_STORAGE_USBAT=y
1076CONFIG_USB_STORAGE_SDDR09=y
1077CONFIG_USB_STORAGE_SDDR55=y
1078CONFIG_USB_STORAGE_JUMPSHOT=y
1079CONFIG_USB_STORAGE_ALAUDA=y
1080# CONFIG_USB_STORAGE_ONETOUCH is not set
1081CONFIG_USB_STORAGE_KARMA=y
1082# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
1083CONFIG_USB_LIBUSUAL=y
1084
1085#
1086# USB Imaging devices
1087#
1088# CONFIG_USB_MDC800 is not set
1089# CONFIG_USB_MICROTEK is not set
1090
1091#
1092# USB port drivers
1093#
1094CONFIG_USB_SERIAL=m
1095CONFIG_USB_EZUSB=y
1096CONFIG_USB_SERIAL_GENERIC=y
1097# CONFIG_USB_SERIAL_AIRCABLE is not set
1098# CONFIG_USB_SERIAL_ARK3116 is not set
1099# CONFIG_USB_SERIAL_BELKIN is not set
1100# CONFIG_USB_SERIAL_CH341 is not set
1101# CONFIG_USB_SERIAL_WHITEHEAT is not set
1102# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
1103# CONFIG_USB_SERIAL_CP2101 is not set
1104# CONFIG_USB_SERIAL_CYPRESS_M8 is not set
1105# CONFIG_USB_SERIAL_EMPEG is not set
1106# CONFIG_USB_SERIAL_FTDI_SIO is not set
1107# CONFIG_USB_SERIAL_FUNSOFT is not set
1108# CONFIG_USB_SERIAL_VISOR is not set
1109# CONFIG_USB_SERIAL_IPAQ is not set
1110# CONFIG_USB_SERIAL_IR is not set
1111# CONFIG_USB_SERIAL_EDGEPORT is not set
1112# CONFIG_USB_SERIAL_EDGEPORT_TI is not set
1113# CONFIG_USB_SERIAL_GARMIN is not set
1114# CONFIG_USB_SERIAL_IPW is not set
1115# CONFIG_USB_SERIAL_IUU is not set
1116# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
1117# CONFIG_USB_SERIAL_KEYSPAN is not set
1118# CONFIG_USB_SERIAL_KLSI is not set
1119# CONFIG_USB_SERIAL_KOBIL_SCT is not set
1120# CONFIG_USB_SERIAL_MCT_U232 is not set
1121# CONFIG_USB_SERIAL_MOS7720 is not set
1122# CONFIG_USB_SERIAL_MOS7840 is not set
1123# CONFIG_USB_SERIAL_MOTOROLA is not set
1124# CONFIG_USB_SERIAL_NAVMAN is not set
1125CONFIG_USB_SERIAL_PL2303=m
1126# CONFIG_USB_SERIAL_OTI6858 is not set
1127CONFIG_USB_SERIAL_SPCP8X5=m
1128# CONFIG_USB_SERIAL_HP4X is not set
1129# CONFIG_USB_SERIAL_SAFE is not set
1130# CONFIG_USB_SERIAL_SIERRAWIRELESS is not set
1131# CONFIG_USB_SERIAL_TI is not set
1132# CONFIG_USB_SERIAL_CYBERJACK is not set
1133# CONFIG_USB_SERIAL_XIRCOM is not set
1134# CONFIG_USB_SERIAL_OPTION is not set
1135# CONFIG_USB_SERIAL_OMNINET is not set
1136CONFIG_USB_SERIAL_DEBUG=m
1137
1138#
1139# USB Miscellaneous drivers
1140#
1141CONFIG_USB_EMI62=m
1142CONFIG_USB_EMI26=m
1143CONFIG_USB_ADUTUX=m
1144# CONFIG_USB_SEVSEG is not set
1145# CONFIG_USB_RIO500 is not set
1146# CONFIG_USB_LEGOTOWER is not set
1147# CONFIG_USB_LCD is not set
1148# CONFIG_USB_BERRY_CHARGE is not set
1149# CONFIG_USB_LED is not set
1150# CONFIG_USB_CYPRESS_CY7C63 is not set
1151# CONFIG_USB_CYTHERM is not set
1152# CONFIG_USB_PHIDGET is not set
1153# CONFIG_USB_IDMOUSE is not set
1154# CONFIG_USB_FTDI_ELAN is not set
1155# CONFIG_USB_APPLEDISPLAY is not set
1156# CONFIG_USB_LD is not set
1157# CONFIG_USB_TRANCEVIBRATOR is not set
1158# CONFIG_USB_IOWARRIOR is not set
1159CONFIG_USB_TEST=m
1160# CONFIG_USB_ISIGHTFW is not set
1161# CONFIG_USB_VST is not set
1162CONFIG_USB_GADGET=m
1163CONFIG_USB_GADGET_DEBUG_FILES=y
1164CONFIG_USB_GADGET_DEBUG_FS=y
1165CONFIG_USB_GADGET_VBUS_DRAW=2
1166CONFIG_USB_GADGET_SELECTED=y
1167CONFIG_USB_GADGET_AT91=y
1168CONFIG_USB_AT91=m
1169# CONFIG_USB_GADGET_ATMEL_USBA is not set
1170# CONFIG_USB_GADGET_FSL_USB2 is not set
1171# CONFIG_USB_GADGET_LH7A40X is not set
1172# CONFIG_USB_GADGET_OMAP is not set
1173# CONFIG_USB_GADGET_PXA25X is not set
1174# CONFIG_USB_GADGET_PXA27X is not set
1175# CONFIG_USB_GADGET_S3C2410 is not set
1176# CONFIG_USB_GADGET_M66592 is not set
1177# CONFIG_USB_GADGET_AMD5536UDC is not set
1178# CONFIG_USB_GADGET_FSL_QE is not set
1179# CONFIG_USB_GADGET_NET2280 is not set
1180# CONFIG_USB_GADGET_GOKU is not set
1181# CONFIG_USB_GADGET_DUMMY_HCD is not set
1182# CONFIG_USB_GADGET_DUALSPEED is not set
1183CONFIG_USB_ZERO=m
1184CONFIG_USB_ETH=m
1185CONFIG_USB_ETH_RNDIS=y
1186CONFIG_USB_GADGETFS=m
1187CONFIG_USB_FILE_STORAGE=m
1188# CONFIG_USB_FILE_STORAGE_TEST is not set
1189CONFIG_USB_G_SERIAL=m
1190CONFIG_USB_MIDI_GADGET=m
1191# CONFIG_USB_G_PRINTER is not set
1192# CONFIG_USB_CDC_COMPOSITE is not set
1193CONFIG_MMC=y
1194# CONFIG_MMC_DEBUG is not set
1195# CONFIG_MMC_UNSAFE_RESUME is not set
1196
1197#
1198# MMC/SD/SDIO Card Drivers
1199#
1200CONFIG_MMC_BLOCK=y
1201CONFIG_MMC_BLOCK_BOUNCE=y
1202CONFIG_SDIO_UART=m
1203# CONFIG_MMC_TEST is not set
1204
1205#
1206# MMC/SD/SDIO Host Controller Drivers
1207#
1208# CONFIG_MMC_SDHCI is not set
1209CONFIG_MMC_AT91=y
1210CONFIG_MMC_SPI=m
1211# CONFIG_MEMSTICK is not set
1212# CONFIG_ACCESSIBILITY is not set
1213CONFIG_NEW_LEDS=y
1214CONFIG_LEDS_CLASS=m
1215
1216#
1217# LED drivers
1218#
1219# CONFIG_LEDS_PCA9532 is not set
1220CONFIG_LEDS_GPIO=m
1221# CONFIG_LEDS_PCA955X is not set
1222
1223#
1224# LED Triggers
1225#
1226CONFIG_LEDS_TRIGGERS=y
1227CONFIG_LEDS_TRIGGER_TIMER=m
1228CONFIG_LEDS_TRIGGER_HEARTBEAT=m
1229# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set
1230# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set
1231CONFIG_RTC_LIB=y
1232CONFIG_RTC_CLASS=y
1233CONFIG_RTC_HCTOSYS=y
1234CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
1235# CONFIG_RTC_DEBUG is not set
1236
1237#
1238# RTC interfaces
1239#
1240CONFIG_RTC_INTF_SYSFS=y
1241CONFIG_RTC_INTF_PROC=y
1242CONFIG_RTC_INTF_DEV=y
1243CONFIG_RTC_INTF_DEV_UIE_EMUL=y
1244# CONFIG_RTC_DRV_TEST is not set
1245
1246#
1247# I2C RTC drivers
1248#
1249CONFIG_RTC_DRV_DS1307=m
1250# CONFIG_RTC_DRV_DS1374 is not set
1251# CONFIG_RTC_DRV_DS1672 is not set
1252# CONFIG_RTC_DRV_MAX6900 is not set
1253# CONFIG_RTC_DRV_RS5C372 is not set
1254# CONFIG_RTC_DRV_ISL1208 is not set
1255# CONFIG_RTC_DRV_X1205 is not set
1256# CONFIG_RTC_DRV_PCF8563 is not set
1257# CONFIG_RTC_DRV_PCF8583 is not set
1258# CONFIG_RTC_DRV_M41T80 is not set
1259# CONFIG_RTC_DRV_S35390A is not set
1260# CONFIG_RTC_DRV_FM3130 is not set
1261# CONFIG_RTC_DRV_RX8581 is not set
1262
1263#
1264# SPI RTC drivers
1265#
1266# CONFIG_RTC_DRV_M41T94 is not set
1267CONFIG_RTC_DRV_DS1305=y
1268# CONFIG_RTC_DRV_DS1390 is not set
1269# CONFIG_RTC_DRV_MAX6902 is not set
1270# CONFIG_RTC_DRV_R9701 is not set
1271# CONFIG_RTC_DRV_RS5C348 is not set
1272# CONFIG_RTC_DRV_DS3234 is not set
1273
1274#
1275# Platform RTC drivers
1276#
1277# CONFIG_RTC_DRV_CMOS is not set
1278# CONFIG_RTC_DRV_DS1286 is not set
1279# CONFIG_RTC_DRV_DS1511 is not set
1280# CONFIG_RTC_DRV_DS1553 is not set
1281# CONFIG_RTC_DRV_DS1742 is not set
1282# CONFIG_RTC_DRV_STK17TA8 is not set
1283# CONFIG_RTC_DRV_M48T86 is not set
1284# CONFIG_RTC_DRV_M48T35 is not set
1285# CONFIG_RTC_DRV_M48T59 is not set
1286# CONFIG_RTC_DRV_BQ4802 is not set
1287# CONFIG_RTC_DRV_V3020 is not set
1288
1289#
1290# on-CPU RTC drivers
1291#
1292# CONFIG_RTC_DRV_AT91SAM9 is not set
1293# CONFIG_DMADEVICES is not set
1294# CONFIG_REGULATOR is not set
1295# CONFIG_UIO is not set
1296
1297#
1298# File systems
1299#
1300CONFIG_EXT2_FS=y
1301CONFIG_EXT2_FS_XATTR=y
1302CONFIG_EXT2_FS_POSIX_ACL=y
1303CONFIG_EXT2_FS_SECURITY=y
1304# CONFIG_EXT2_FS_XIP is not set
1305CONFIG_EXT3_FS=y
1306CONFIG_EXT3_FS_XATTR=y
1307CONFIG_EXT3_FS_POSIX_ACL=y
1308CONFIG_EXT3_FS_SECURITY=y
1309# CONFIG_EXT4_FS is not set
1310CONFIG_JBD=y
1311CONFIG_JBD_DEBUG=y
1312CONFIG_FS_MBCACHE=y
1313CONFIG_REISERFS_FS=m
1314CONFIG_REISERFS_CHECK=y
1315CONFIG_REISERFS_PROC_INFO=y
1316CONFIG_REISERFS_FS_XATTR=y
1317CONFIG_REISERFS_FS_POSIX_ACL=y
1318CONFIG_REISERFS_FS_SECURITY=y
1319# CONFIG_JFS_FS is not set
1320CONFIG_FS_POSIX_ACL=y
1321CONFIG_FILE_LOCKING=y
1322# CONFIG_XFS_FS is not set
1323# CONFIG_OCFS2_FS is not set
1324CONFIG_DNOTIFY=y
1325CONFIG_INOTIFY=y
1326CONFIG_INOTIFY_USER=y
1327# CONFIG_QUOTA is not set
1328# CONFIG_AUTOFS_FS is not set
1329# CONFIG_AUTOFS4_FS is not set
1330CONFIG_FUSE_FS=m
1331CONFIG_GENERIC_ACL=y
1332
1333#
1334# CD-ROM/DVD Filesystems
1335#
1336# CONFIG_ISO9660_FS is not set
1337# CONFIG_UDF_FS is not set
1338
1339#
1340# DOS/FAT/NT Filesystems
1341#
1342CONFIG_FAT_FS=y
1343CONFIG_MSDOS_FS=m
1344CONFIG_VFAT_FS=y
1345CONFIG_FAT_DEFAULT_CODEPAGE=437
1346CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1347CONFIG_NTFS_FS=m
1348# CONFIG_NTFS_DEBUG is not set
1349CONFIG_NTFS_RW=y
1350
1351#
1352# Pseudo filesystems
1353#
1354CONFIG_PROC_FS=y
1355CONFIG_PROC_SYSCTL=y
1356CONFIG_PROC_PAGE_MONITOR=y
1357CONFIG_SYSFS=y
1358CONFIG_TMPFS=y
1359CONFIG_TMPFS_POSIX_ACL=y
1360# CONFIG_HUGETLB_PAGE is not set
1361CONFIG_CONFIGFS_FS=m
1362
1363#
1364# Miscellaneous filesystems
1365#
1366# CONFIG_ADFS_FS is not set
1367# CONFIG_AFFS_FS is not set
1368# CONFIG_HFS_FS is not set
1369# CONFIG_HFSPLUS_FS is not set
1370# CONFIG_BEFS_FS is not set
1371# CONFIG_BFS_FS is not set
1372# CONFIG_EFS_FS is not set
1373CONFIG_JFFS2_FS=m
1374CONFIG_JFFS2_FS_DEBUG=0
1375CONFIG_JFFS2_FS_WRITEBUFFER=y
1376# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
1377# CONFIG_JFFS2_SUMMARY is not set
1378# CONFIG_JFFS2_FS_XATTR is not set
1379CONFIG_JFFS2_COMPRESSION_OPTIONS=y
1380CONFIG_JFFS2_ZLIB=y
1381CONFIG_JFFS2_LZO=y
1382CONFIG_JFFS2_RTIME=y
1383# CONFIG_JFFS2_RUBIN is not set
1384# CONFIG_JFFS2_CMODE_NONE is not set
1385# CONFIG_JFFS2_CMODE_PRIORITY is not set
1386# CONFIG_JFFS2_CMODE_SIZE is not set
1387CONFIG_JFFS2_CMODE_FAVOURLZO=y
1388# CONFIG_UBIFS_FS is not set
1389CONFIG_CRAMFS=m
1390# CONFIG_VXFS_FS is not set
1391# CONFIG_MINIX_FS is not set
1392# CONFIG_OMFS_FS is not set
1393# CONFIG_HPFS_FS is not set
1394# CONFIG_QNX4FS_FS is not set
1395# CONFIG_ROMFS_FS is not set
1396# CONFIG_SYSV_FS is not set
1397# CONFIG_UFS_FS is not set
1398CONFIG_NETWORK_FILESYSTEMS=y
1399CONFIG_NFS_FS=m
1400CONFIG_NFS_V3=y
1401CONFIG_NFS_V3_ACL=y
1402CONFIG_NFS_V4=y
1403CONFIG_NFSD=m
1404CONFIG_NFSD_V2_ACL=y
1405CONFIG_NFSD_V3=y
1406CONFIG_NFSD_V3_ACL=y
1407CONFIG_NFSD_V4=y
1408CONFIG_LOCKD=m
1409CONFIG_LOCKD_V4=y
1410CONFIG_EXPORTFS=m
1411CONFIG_NFS_ACL_SUPPORT=m
1412CONFIG_NFS_COMMON=y
1413CONFIG_SUNRPC=m
1414CONFIG_SUNRPC_GSS=m
1415# CONFIG_SUNRPC_REGISTER_V4 is not set
1416CONFIG_RPCSEC_GSS_KRB5=m
1417# CONFIG_RPCSEC_GSS_SPKM3 is not set
1418# CONFIG_SMB_FS is not set
1419CONFIG_CIFS=m
1420# CONFIG_CIFS_STATS is not set
1421CONFIG_CIFS_WEAK_PW_HASH=y
1422# CONFIG_CIFS_XATTR is not set
1423# CONFIG_CIFS_DEBUG2 is not set
1424# CONFIG_CIFS_EXPERIMENTAL is not set
1425# CONFIG_NCP_FS is not set
1426# CONFIG_CODA_FS is not set
1427# CONFIG_AFS_FS is not set
1428
1429#
1430# Partition Types
1431#
1432CONFIG_PARTITION_ADVANCED=y
1433# CONFIG_ACORN_PARTITION is not set
1434# CONFIG_OSF_PARTITION is not set
1435# CONFIG_AMIGA_PARTITION is not set
1436# CONFIG_ATARI_PARTITION is not set
1437CONFIG_MAC_PARTITION=y
1438CONFIG_MSDOS_PARTITION=y
1439CONFIG_BSD_DISKLABEL=y
1440CONFIG_MINIX_SUBPARTITION=y
1441CONFIG_SOLARIS_X86_PARTITION=y
1442CONFIG_UNIXWARE_DISKLABEL=y
1443CONFIG_LDM_PARTITION=y
1444CONFIG_LDM_DEBUG=y
1445CONFIG_SGI_PARTITION=y
1446# CONFIG_ULTRIX_PARTITION is not set
1447CONFIG_SUN_PARTITION=y
1448# CONFIG_KARMA_PARTITION is not set
1449# CONFIG_EFI_PARTITION is not set
1450# CONFIG_SYSV68_PARTITION is not set
1451CONFIG_NLS=y
1452CONFIG_NLS_DEFAULT="cp437"
1453CONFIG_NLS_CODEPAGE_437=y
1454# CONFIG_NLS_CODEPAGE_737 is not set
1455# CONFIG_NLS_CODEPAGE_775 is not set
1456CONFIG_NLS_CODEPAGE_850=m
1457# CONFIG_NLS_CODEPAGE_852 is not set
1458# CONFIG_NLS_CODEPAGE_855 is not set
1459# CONFIG_NLS_CODEPAGE_857 is not set
1460# CONFIG_NLS_CODEPAGE_860 is not set
1461# CONFIG_NLS_CODEPAGE_861 is not set
1462# CONFIG_NLS_CODEPAGE_862 is not set
1463# CONFIG_NLS_CODEPAGE_863 is not set
1464# CONFIG_NLS_CODEPAGE_864 is not set
1465# CONFIG_NLS_CODEPAGE_865 is not set
1466# CONFIG_NLS_CODEPAGE_866 is not set
1467# CONFIG_NLS_CODEPAGE_869 is not set
1468# CONFIG_NLS_CODEPAGE_936 is not set
1469# CONFIG_NLS_CODEPAGE_950 is not set
1470# CONFIG_NLS_CODEPAGE_932 is not set
1471# CONFIG_NLS_CODEPAGE_949 is not set
1472# CONFIG_NLS_CODEPAGE_874 is not set
1473# CONFIG_NLS_ISO8859_8 is not set
1474# CONFIG_NLS_CODEPAGE_1250 is not set
1475# CONFIG_NLS_CODEPAGE_1251 is not set
1476CONFIG_NLS_ASCII=y
1477CONFIG_NLS_ISO8859_1=y
1478# CONFIG_NLS_ISO8859_2 is not set
1479# CONFIG_NLS_ISO8859_3 is not set
1480# CONFIG_NLS_ISO8859_4 is not set
1481# CONFIG_NLS_ISO8859_5 is not set
1482# CONFIG_NLS_ISO8859_6 is not set
1483# CONFIG_NLS_ISO8859_7 is not set
1484# CONFIG_NLS_ISO8859_9 is not set
1485# CONFIG_NLS_ISO8859_13 is not set
1486# CONFIG_NLS_ISO8859_14 is not set
1487# CONFIG_NLS_ISO8859_15 is not set
1488# CONFIG_NLS_KOI8_R is not set
1489# CONFIG_NLS_KOI8_U is not set
1490CONFIG_NLS_UTF8=m
1491CONFIG_DLM=m
1492# CONFIG_DLM_DEBUG is not set
1493
1494#
1495# Kernel hacking
1496#
1497CONFIG_PRINTK_TIME=y
1498CONFIG_ENABLE_WARN_DEPRECATED=y
1499CONFIG_ENABLE_MUST_CHECK=y
1500CONFIG_FRAME_WARN=1024
1501CONFIG_MAGIC_SYSRQ=y
1502CONFIG_UNUSED_SYMBOLS=y
1503CONFIG_DEBUG_FS=y
1504# CONFIG_HEADERS_CHECK is not set
1505# CONFIG_DEBUG_KERNEL is not set
1506# CONFIG_DEBUG_BUGVERBOSE is not set
1507# CONFIG_DEBUG_MEMORY_INIT is not set
1508CONFIG_FRAME_POINTER=y
1509# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1510# CONFIG_LATENCYTOP is not set
1511CONFIG_SYSCTL_SYSCALL_CHECK=y
1512CONFIG_HAVE_FUNCTION_TRACER=y
1513
1514#
1515# Tracers
1516#
1517# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
1518# CONFIG_SAMPLES is not set
1519CONFIG_HAVE_ARCH_KGDB=y
1520# CONFIG_DEBUG_USER is not set
1521
1522#
1523# Security options
1524#
1525# CONFIG_KEYS is not set
1526# CONFIG_SECURITY is not set
1527CONFIG_SECURITYFS=y
1528# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1529CONFIG_CRYPTO=y
1530
1531#
1532# Crypto core or helper
1533#
1534# CONFIG_CRYPTO_FIPS is not set
1535CONFIG_CRYPTO_ALGAPI=y
1536CONFIG_CRYPTO_AEAD=y
1537CONFIG_CRYPTO_BLKCIPHER=y
1538CONFIG_CRYPTO_HASH=y
1539CONFIG_CRYPTO_RNG=y
1540CONFIG_CRYPTO_MANAGER=y
1541CONFIG_CRYPTO_GF128MUL=m
1542# CONFIG_CRYPTO_NULL is not set
1543# CONFIG_CRYPTO_CRYPTD is not set
1544# CONFIG_CRYPTO_AUTHENC is not set
1545# CONFIG_CRYPTO_TEST is not set
1546
1547#
1548# Authenticated Encryption with Associated Data
1549#
1550# CONFIG_CRYPTO_CCM is not set
1551# CONFIG_CRYPTO_GCM is not set
1552# CONFIG_CRYPTO_SEQIV is not set
1553
1554#
1555# Block modes
1556#
1557CONFIG_CRYPTO_CBC=m
1558# CONFIG_CRYPTO_CTR is not set
1559# CONFIG_CRYPTO_CTS is not set
1560CONFIG_CRYPTO_ECB=m
1561# CONFIG_CRYPTO_LRW is not set
1562# CONFIG_CRYPTO_PCBC is not set
1563# CONFIG_CRYPTO_XTS is not set
1564
1565#
1566# Hash modes
1567#
1568CONFIG_CRYPTO_HMAC=y
1569# CONFIG_CRYPTO_XCBC is not set
1570
1571#
1572# Digest
1573#
1574# CONFIG_CRYPTO_CRC32C is not set
1575# CONFIG_CRYPTO_MD4 is not set
1576CONFIG_CRYPTO_MD5=y
1577# CONFIG_CRYPTO_MICHAEL_MIC is not set
1578# CONFIG_CRYPTO_RMD128 is not set
1579# CONFIG_CRYPTO_RMD160 is not set
1580# CONFIG_CRYPTO_RMD256 is not set
1581# CONFIG_CRYPTO_RMD320 is not set
1582CONFIG_CRYPTO_SHA1=m
1583# CONFIG_CRYPTO_SHA256 is not set
1584# CONFIG_CRYPTO_SHA512 is not set
1585# CONFIG_CRYPTO_TGR192 is not set
1586# CONFIG_CRYPTO_WP512 is not set
1587
1588#
1589# Ciphers
1590#
1591# CONFIG_CRYPTO_AES is not set
1592# CONFIG_CRYPTO_ANUBIS is not set
1593CONFIG_CRYPTO_ARC4=m
1594# CONFIG_CRYPTO_BLOWFISH is not set
1595# CONFIG_CRYPTO_CAMELLIA is not set
1596# CONFIG_CRYPTO_CAST5 is not set
1597# CONFIG_CRYPTO_CAST6 is not set
1598CONFIG_CRYPTO_DES=m
1599# CONFIG_CRYPTO_FCRYPT is not set
1600# CONFIG_CRYPTO_KHAZAD is not set
1601# CONFIG_CRYPTO_SALSA20 is not set
1602# CONFIG_CRYPTO_SEED is not set
1603# CONFIG_CRYPTO_SERPENT is not set
1604# CONFIG_CRYPTO_TEA is not set
1605# CONFIG_CRYPTO_TWOFISH is not set
1606
1607#
1608# Compression
1609#
1610# CONFIG_CRYPTO_DEFLATE is not set
1611# CONFIG_CRYPTO_LZO is not set
1612
1613#
1614# Random Number Generation
1615#
1616# CONFIG_CRYPTO_ANSI_CPRNG is not set
1617# CONFIG_CRYPTO_HW is not set
1618
1619#
1620# Library routines
1621#
1622CONFIG_BITREVERSE=y
1623CONFIG_CRC_CCITT=m
1624CONFIG_CRC16=m
1625# CONFIG_CRC_T10DIF is not set
1626CONFIG_CRC_ITU_T=m
1627CONFIG_CRC32=y
1628CONFIG_CRC7=m
1629CONFIG_LIBCRC32C=m
1630CONFIG_AUDIT_GENERIC=y
1631CONFIG_ZLIB_INFLATE=m
1632CONFIG_ZLIB_DEFLATE=m
1633CONFIG_LZO_COMPRESS=m
1634CONFIG_LZO_DECOMPRESS=m
1635CONFIG_REED_SOLOMON=m
1636CONFIG_REED_SOLOMON_DEC16=y
1637CONFIG_PLIST=y
1638CONFIG_HAS_IOMEM=y
1639CONFIG_HAS_IOPORT=y
1640CONFIG_HAS_DMA=y
diff --git a/arch/arm/configs/omap_4430sdp_defconfig b/arch/arm/configs/omap_4430sdp_defconfig
index 7ac3fbf0fe04..a96bca290cd1 100644
--- a/arch/arm/configs/omap_4430sdp_defconfig
+++ b/arch/arm/configs/omap_4430sdp_defconfig
@@ -242,10 +242,13 @@ CONFIG_CPU_CP15_MMU=y
242# CONFIG_CPU_DCACHE_DISABLE is not set 242# CONFIG_CPU_DCACHE_DISABLE is not set
243# CONFIG_CPU_BPREDICT_DISABLE is not set 243# CONFIG_CPU_BPREDICT_DISABLE is not set
244CONFIG_HAS_TLS_REG=y 244CONFIG_HAS_TLS_REG=y
245CONFIG_OUTER_CACHE=y
246CONFIG_CACHE_L2X0=y
245CONFIG_ARM_L1_CACHE_SHIFT=5 247CONFIG_ARM_L1_CACHE_SHIFT=5
246# CONFIG_ARM_ERRATA_430973 is not set 248# CONFIG_ARM_ERRATA_430973 is not set
247# CONFIG_ARM_ERRATA_458693 is not set 249# CONFIG_ARM_ERRATA_458693 is not set
248# CONFIG_ARM_ERRATA_460075 is not set 250# CONFIG_ARM_ERRATA_460075 is not set
251CONFIG_PL310_ERRATA_588369=y
249CONFIG_ARM_GIC=y 252CONFIG_ARM_GIC=y
250 253
251# 254#
diff --git a/arch/arm/include/asm/atomic.h b/arch/arm/include/asm/atomic.h
index d0daeab2234e..e8ddec2cb158 100644
--- a/arch/arm/include/asm/atomic.h
+++ b/arch/arm/include/asm/atomic.h
@@ -235,6 +235,234 @@ static inline int atomic_add_unless(atomic_t *v, int a, int u)
235#define smp_mb__before_atomic_inc() smp_mb() 235#define smp_mb__before_atomic_inc() smp_mb()
236#define smp_mb__after_atomic_inc() smp_mb() 236#define smp_mb__after_atomic_inc() smp_mb()
237 237
238#ifndef CONFIG_GENERIC_ATOMIC64
239typedef struct {
240 u64 __aligned(8) counter;
241} atomic64_t;
242
243#define ATOMIC64_INIT(i) { (i) }
244
245static inline u64 atomic64_read(atomic64_t *v)
246{
247 u64 result;
248
249 __asm__ __volatile__("@ atomic64_read\n"
250" ldrexd %0, %H0, [%1]"
251 : "=&r" (result)
252 : "r" (&v->counter)
253 );
254
255 return result;
256}
257
258static inline void atomic64_set(atomic64_t *v, u64 i)
259{
260 u64 tmp;
261
262 __asm__ __volatile__("@ atomic64_set\n"
263"1: ldrexd %0, %H0, [%1]\n"
264" strexd %0, %2, %H2, [%1]\n"
265" teq %0, #0\n"
266" bne 1b"
267 : "=&r" (tmp)
268 : "r" (&v->counter), "r" (i)
269 : "cc");
270}
271
272static inline void atomic64_add(u64 i, atomic64_t *v)
273{
274 u64 result;
275 unsigned long tmp;
276
277 __asm__ __volatile__("@ atomic64_add\n"
278"1: ldrexd %0, %H0, [%2]\n"
279" adds %0, %0, %3\n"
280" adc %H0, %H0, %H3\n"
281" strexd %1, %0, %H0, [%2]\n"
282" teq %1, #0\n"
283" bne 1b"
284 : "=&r" (result), "=&r" (tmp)
285 : "r" (&v->counter), "r" (i)
286 : "cc");
287}
288
289static inline u64 atomic64_add_return(u64 i, atomic64_t *v)
290{
291 u64 result;
292 unsigned long tmp;
293
294 smp_mb();
295
296 __asm__ __volatile__("@ atomic64_add_return\n"
297"1: ldrexd %0, %H0, [%2]\n"
298" adds %0, %0, %3\n"
299" adc %H0, %H0, %H3\n"
300" strexd %1, %0, %H0, [%2]\n"
301" teq %1, #0\n"
302" bne 1b"
303 : "=&r" (result), "=&r" (tmp)
304 : "r" (&v->counter), "r" (i)
305 : "cc");
306
307 smp_mb();
308
309 return result;
310}
311
312static inline void atomic64_sub(u64 i, atomic64_t *v)
313{
314 u64 result;
315 unsigned long tmp;
316
317 __asm__ __volatile__("@ atomic64_sub\n"
318"1: ldrexd %0, %H0, [%2]\n"
319" subs %0, %0, %3\n"
320" sbc %H0, %H0, %H3\n"
321" strexd %1, %0, %H0, [%2]\n"
322" teq %1, #0\n"
323" bne 1b"
324 : "=&r" (result), "=&r" (tmp)
325 : "r" (&v->counter), "r" (i)
326 : "cc");
327}
328
329static inline u64 atomic64_sub_return(u64 i, atomic64_t *v)
330{
331 u64 result;
332 unsigned long tmp;
333
334 smp_mb();
335
336 __asm__ __volatile__("@ atomic64_sub_return\n"
337"1: ldrexd %0, %H0, [%2]\n"
338" subs %0, %0, %3\n"
339" sbc %H0, %H0, %H3\n"
340" strexd %1, %0, %H0, [%2]\n"
341" teq %1, #0\n"
342" bne 1b"
343 : "=&r" (result), "=&r" (tmp)
344 : "r" (&v->counter), "r" (i)
345 : "cc");
346
347 smp_mb();
348
349 return result;
350}
351
352static inline u64 atomic64_cmpxchg(atomic64_t *ptr, u64 old, u64 new)
353{
354 u64 oldval;
355 unsigned long res;
356
357 smp_mb();
358
359 do {
360 __asm__ __volatile__("@ atomic64_cmpxchg\n"
361 "ldrexd %1, %H1, [%2]\n"
362 "mov %0, #0\n"
363 "teq %1, %3\n"
364 "teqeq %H1, %H3\n"
365 "strexdeq %0, %4, %H4, [%2]"
366 : "=&r" (res), "=&r" (oldval)
367 : "r" (&ptr->counter), "r" (old), "r" (new)
368 : "cc");
369 } while (res);
370
371 smp_mb();
372
373 return oldval;
374}
375
376static inline u64 atomic64_xchg(atomic64_t *ptr, u64 new)
377{
378 u64 result;
379 unsigned long tmp;
380
381 smp_mb();
382
383 __asm__ __volatile__("@ atomic64_xchg\n"
384"1: ldrexd %0, %H0, [%2]\n"
385" strexd %1, %3, %H3, [%2]\n"
386" teq %1, #0\n"
387" bne 1b"
388 : "=&r" (result), "=&r" (tmp)
389 : "r" (&ptr->counter), "r" (new)
390 : "cc");
391
392 smp_mb();
393
394 return result;
395}
396
397static inline u64 atomic64_dec_if_positive(atomic64_t *v)
398{
399 u64 result;
400 unsigned long tmp;
401
402 smp_mb();
403
404 __asm__ __volatile__("@ atomic64_dec_if_positive\n"
405"1: ldrexd %0, %H0, [%2]\n"
406" subs %0, %0, #1\n"
407" sbc %H0, %H0, #0\n"
408" teq %H0, #0\n"
409" bmi 2f\n"
410" strexd %1, %0, %H0, [%2]\n"
411" teq %1, #0\n"
412" bne 1b\n"
413"2:"
414 : "=&r" (result), "=&r" (tmp)
415 : "r" (&v->counter)
416 : "cc");
417
418 smp_mb();
419
420 return result;
421}
422
423static inline int atomic64_add_unless(atomic64_t *v, u64 a, u64 u)
424{
425 u64 val;
426 unsigned long tmp;
427 int ret = 1;
428
429 smp_mb();
430
431 __asm__ __volatile__("@ atomic64_add_unless\n"
432"1: ldrexd %0, %H0, [%3]\n"
433" teq %0, %4\n"
434" teqeq %H0, %H4\n"
435" moveq %1, #0\n"
436" beq 2f\n"
437" adds %0, %0, %5\n"
438" adc %H0, %H0, %H5\n"
439" strexd %2, %0, %H0, [%3]\n"
440" teq %2, #0\n"
441" bne 1b\n"
442"2:"
443 : "=&r" (val), "=&r" (ret), "=&r" (tmp)
444 : "r" (&v->counter), "r" (u), "r" (a)
445 : "cc");
446
447 if (ret)
448 smp_mb();
449
450 return ret;
451}
452
453#define atomic64_add_negative(a, v) (atomic64_add_return((a), (v)) < 0)
454#define atomic64_inc(v) atomic64_add(1LL, (v))
455#define atomic64_inc_return(v) atomic64_add_return(1LL, (v))
456#define atomic64_inc_and_test(v) (atomic64_inc_return(v) == 0)
457#define atomic64_sub_and_test(a, v) (atomic64_sub_return((a), (v)) == 0)
458#define atomic64_dec(v) atomic64_sub(1LL, (v))
459#define atomic64_dec_return(v) atomic64_sub_return(1LL, (v))
460#define atomic64_dec_and_test(v) (atomic64_dec_return((v)) == 0)
461#define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1LL, 0LL)
462
463#else /* !CONFIG_GENERIC_ATOMIC64 */
464#include <asm-generic/atomic64.h>
465#endif
238#include <asm-generic/atomic-long.h> 466#include <asm-generic/atomic-long.h>
239#endif 467#endif
240#endif 468#endif
diff --git a/arch/arm/include/asm/cacheflush.h b/arch/arm/include/asm/cacheflush.h
index c77d2fa1f6e5..72da7e045c6b 100644
--- a/arch/arm/include/asm/cacheflush.h
+++ b/arch/arm/include/asm/cacheflush.h
@@ -42,7 +42,8 @@
42#endif 42#endif
43 43
44#if defined(CONFIG_CPU_ARM920T) || defined(CONFIG_CPU_ARM922T) || \ 44#if defined(CONFIG_CPU_ARM920T) || defined(CONFIG_CPU_ARM922T) || \
45 defined(CONFIG_CPU_ARM925T) || defined(CONFIG_CPU_ARM1020) 45 defined(CONFIG_CPU_ARM925T) || defined(CONFIG_CPU_ARM1020) || \
46 defined(CONFIG_CPU_ARM1026)
46# define MULTI_CACHE 1 47# define MULTI_CACHE 1
47#endif 48#endif
48 49
@@ -196,21 +197,6 @@
196 * DMA Cache Coherency 197 * DMA Cache Coherency
197 * =================== 198 * ===================
198 * 199 *
199 * dma_inv_range(start, end)
200 *
201 * Invalidate (discard) the specified virtual address range.
202 * May not write back any entries. If 'start' or 'end'
203 * are not cache line aligned, those lines must be written
204 * back.
205 * - start - virtual start address
206 * - end - virtual end address
207 *
208 * dma_clean_range(start, end)
209 *
210 * Clean (write back) the specified virtual address range.
211 * - start - virtual start address
212 * - end - virtual end address
213 *
214 * dma_flush_range(start, end) 200 * dma_flush_range(start, end)
215 * 201 *
216 * Clean and invalidate the specified virtual address range. 202 * Clean and invalidate the specified virtual address range.
@@ -227,8 +213,9 @@ struct cpu_cache_fns {
227 void (*coherent_user_range)(unsigned long, unsigned long); 213 void (*coherent_user_range)(unsigned long, unsigned long);
228 void (*flush_kern_dcache_area)(void *, size_t); 214 void (*flush_kern_dcache_area)(void *, size_t);
229 215
230 void (*dma_inv_range)(const void *, const void *); 216 void (*dma_map_area)(const void *, size_t, int);
231 void (*dma_clean_range)(const void *, const void *); 217 void (*dma_unmap_area)(const void *, size_t, int);
218
232 void (*dma_flush_range)(const void *, const void *); 219 void (*dma_flush_range)(const void *, const void *);
233}; 220};
234 221
@@ -258,8 +245,8 @@ extern struct cpu_cache_fns cpu_cache;
258 * is visible to DMA, or data written by DMA to system memory is 245 * is visible to DMA, or data written by DMA to system memory is
259 * visible to the CPU. 246 * visible to the CPU.
260 */ 247 */
261#define dmac_inv_range cpu_cache.dma_inv_range 248#define dmac_map_area cpu_cache.dma_map_area
262#define dmac_clean_range cpu_cache.dma_clean_range 249#define dmac_unmap_area cpu_cache.dma_unmap_area
263#define dmac_flush_range cpu_cache.dma_flush_range 250#define dmac_flush_range cpu_cache.dma_flush_range
264 251
265#else 252#else
@@ -284,12 +271,12 @@ extern void __cpuc_flush_dcache_area(void *, size_t);
284 * is visible to DMA, or data written by DMA to system memory is 271 * is visible to DMA, or data written by DMA to system memory is
285 * visible to the CPU. 272 * visible to the CPU.
286 */ 273 */
287#define dmac_inv_range __glue(_CACHE,_dma_inv_range) 274#define dmac_map_area __glue(_CACHE,_dma_map_area)
288#define dmac_clean_range __glue(_CACHE,_dma_clean_range) 275#define dmac_unmap_area __glue(_CACHE,_dma_unmap_area)
289#define dmac_flush_range __glue(_CACHE,_dma_flush_range) 276#define dmac_flush_range __glue(_CACHE,_dma_flush_range)
290 277
291extern void dmac_inv_range(const void *, const void *); 278extern void dmac_map_area(const void *, size_t, int);
292extern void dmac_clean_range(const void *, const void *); 279extern void dmac_unmap_area(const void *, size_t, int);
293extern void dmac_flush_range(const void *, const void *); 280extern void dmac_flush_range(const void *, const void *);
294 281
295#endif 282#endif
@@ -330,12 +317,8 @@ static inline void outer_flush_range(unsigned long start, unsigned long end)
330 * processes address space. Really, we want to allow our "user 317 * processes address space. Really, we want to allow our "user
331 * space" model to handle this. 318 * space" model to handle this.
332 */ 319 */
333#define copy_to_user_page(vma, page, vaddr, dst, src, len) \ 320extern void copy_to_user_page(struct vm_area_struct *, struct page *,
334 do { \ 321 unsigned long, void *, const void *, unsigned long);
335 memcpy(dst, src, len); \
336 flush_ptrace_access(vma, page, vaddr, dst, len, 1);\
337 } while (0)
338
339#define copy_from_user_page(vma, page, vaddr, dst, src, len) \ 322#define copy_from_user_page(vma, page, vaddr, dst, src, len) \
340 do { \ 323 do { \
341 memcpy(dst, src, len); \ 324 memcpy(dst, src, len); \
@@ -369,17 +352,6 @@ vivt_flush_cache_page(struct vm_area_struct *vma, unsigned long user_addr, unsig
369 } 352 }
370} 353}
371 354
372static inline void
373vivt_flush_ptrace_access(struct vm_area_struct *vma, struct page *page,
374 unsigned long uaddr, void *kaddr,
375 unsigned long len, int write)
376{
377 if (cpumask_test_cpu(smp_processor_id(), mm_cpumask(vma->vm_mm))) {
378 unsigned long addr = (unsigned long)kaddr;
379 __cpuc_coherent_kern_range(addr, addr + len);
380 }
381}
382
383#ifndef CONFIG_CPU_CACHE_VIPT 355#ifndef CONFIG_CPU_CACHE_VIPT
384#define flush_cache_mm(mm) \ 356#define flush_cache_mm(mm) \
385 vivt_flush_cache_mm(mm) 357 vivt_flush_cache_mm(mm)
@@ -387,15 +359,10 @@ vivt_flush_ptrace_access(struct vm_area_struct *vma, struct page *page,
387 vivt_flush_cache_range(vma,start,end) 359 vivt_flush_cache_range(vma,start,end)
388#define flush_cache_page(vma,addr,pfn) \ 360#define flush_cache_page(vma,addr,pfn) \
389 vivt_flush_cache_page(vma,addr,pfn) 361 vivt_flush_cache_page(vma,addr,pfn)
390#define flush_ptrace_access(vma,page,ua,ka,len,write) \
391 vivt_flush_ptrace_access(vma,page,ua,ka,len,write)
392#else 362#else
393extern void flush_cache_mm(struct mm_struct *mm); 363extern void flush_cache_mm(struct mm_struct *mm);
394extern void flush_cache_range(struct vm_area_struct *vma, unsigned long start, unsigned long end); 364extern void flush_cache_range(struct vm_area_struct *vma, unsigned long start, unsigned long end);
395extern void flush_cache_page(struct vm_area_struct *vma, unsigned long user_addr, unsigned long pfn); 365extern void flush_cache_page(struct vm_area_struct *vma, unsigned long user_addr, unsigned long pfn);
396extern void flush_ptrace_access(struct vm_area_struct *vma, struct page *page,
397 unsigned long uaddr, void *kaddr,
398 unsigned long len, int write);
399#endif 366#endif
400 367
401#define flush_cache_dup_mm(mm) flush_cache_mm(mm) 368#define flush_cache_dup_mm(mm) flush_cache_mm(mm)
@@ -446,6 +413,16 @@ static inline void __flush_icache_all(void)
446 : "r" (0)); 413 : "r" (0));
447#endif 414#endif
448} 415}
416static inline void flush_kernel_vmap_range(void *addr, int size)
417{
418 if ((cache_is_vivt() || cache_is_vipt_aliasing()))
419 __cpuc_flush_dcache_area(addr, (size_t)size);
420}
421static inline void invalidate_kernel_vmap_range(void *addr, int size)
422{
423 if ((cache_is_vivt() || cache_is_vipt_aliasing()))
424 __cpuc_flush_dcache_area(addr, (size_t)size);
425}
449 426
450#define ARCH_HAS_FLUSH_ANON_PAGE 427#define ARCH_HAS_FLUSH_ANON_PAGE
451static inline void flush_anon_page(struct vm_area_struct *vma, 428static inline void flush_anon_page(struct vm_area_struct *vma,
diff --git a/arch/arm/include/asm/clkdev.h b/arch/arm/include/asm/clkdev.h
index b6ec7c627b39..7a0690da5e63 100644
--- a/arch/arm/include/asm/clkdev.h
+++ b/arch/arm/include/asm/clkdev.h
@@ -27,4 +27,7 @@ struct clk_lookup *clkdev_alloc(struct clk *clk, const char *con_id,
27void clkdev_add(struct clk_lookup *cl); 27void clkdev_add(struct clk_lookup *cl);
28void clkdev_drop(struct clk_lookup *cl); 28void clkdev_drop(struct clk_lookup *cl);
29 29
30void clkdev_add_table(struct clk_lookup *, size_t);
31int clk_add_alias(const char *, const char *, char *, struct device *);
32
30#endif 33#endif
diff --git a/arch/arm/include/asm/dma-mapping.h b/arch/arm/include/asm/dma-mapping.h
index a96300bf83fd..256ee1c9f51a 100644
--- a/arch/arm/include/asm/dma-mapping.h
+++ b/arch/arm/include/asm/dma-mapping.h
@@ -57,18 +57,58 @@ static inline dma_addr_t virt_to_dma(struct device *dev, void *addr)
57#endif 57#endif
58 58
59/* 59/*
60 * DMA-consistent mapping functions. These allocate/free a region of 60 * The DMA API is built upon the notion of "buffer ownership". A buffer
61 * uncached, unwrite-buffered mapped memory space for use with DMA 61 * is either exclusively owned by the CPU (and therefore may be accessed
62 * devices. This is the "generic" version. The PCI specific version 62 * by it) or exclusively owned by the DMA device. These helper functions
63 * is in pci.h 63 * represent the transitions between these two ownership states.
64 * 64 *
65 * Note: Drivers should NOT use this function directly, as it will break 65 * Note, however, that on later ARMs, this notion does not work due to
66 * platforms with CONFIG_DMABOUNCE. 66 * speculative prefetches. We model our approach on the assumption that
67 * Use the driver DMA support - see dma-mapping.h (dma_sync_*) 67 * the CPU does do speculative prefetches, which means we clean caches
68 * before transfers and delay cache invalidation until transfer completion.
69 *
70 * Private support functions: these are not part of the API and are
71 * liable to change. Drivers must not use these.
68 */ 72 */
69extern void dma_cache_maint(const void *kaddr, size_t size, int rw); 73static inline void __dma_single_cpu_to_dev(const void *kaddr, size_t size,
70extern void dma_cache_maint_page(struct page *page, unsigned long offset, 74 enum dma_data_direction dir)
71 size_t size, int rw); 75{
76 extern void ___dma_single_cpu_to_dev(const void *, size_t,
77 enum dma_data_direction);
78
79 if (!arch_is_coherent())
80 ___dma_single_cpu_to_dev(kaddr, size, dir);
81}
82
83static inline void __dma_single_dev_to_cpu(const void *kaddr, size_t size,
84 enum dma_data_direction dir)
85{
86 extern void ___dma_single_dev_to_cpu(const void *, size_t,
87 enum dma_data_direction);
88
89 if (!arch_is_coherent())
90 ___dma_single_dev_to_cpu(kaddr, size, dir);
91}
92
93static inline void __dma_page_cpu_to_dev(struct page *page, unsigned long off,
94 size_t size, enum dma_data_direction dir)
95{
96 extern void ___dma_page_cpu_to_dev(struct page *, unsigned long,
97 size_t, enum dma_data_direction);
98
99 if (!arch_is_coherent())
100 ___dma_page_cpu_to_dev(page, off, size, dir);
101}
102
103static inline void __dma_page_dev_to_cpu(struct page *page, unsigned long off,
104 size_t size, enum dma_data_direction dir)
105{
106 extern void ___dma_page_dev_to_cpu(struct page *, unsigned long,
107 size_t, enum dma_data_direction);
108
109 if (!arch_is_coherent())
110 ___dma_page_dev_to_cpu(page, off, size, dir);
111}
72 112
73/* 113/*
74 * Return whether the given device DMA address mask can be supported 114 * Return whether the given device DMA address mask can be supported
@@ -304,8 +344,7 @@ static inline dma_addr_t dma_map_single(struct device *dev, void *cpu_addr,
304{ 344{
305 BUG_ON(!valid_dma_direction(dir)); 345 BUG_ON(!valid_dma_direction(dir));
306 346
307 if (!arch_is_coherent()) 347 __dma_single_cpu_to_dev(cpu_addr, size, dir);
308 dma_cache_maint(cpu_addr, size, dir);
309 348
310 return virt_to_dma(dev, cpu_addr); 349 return virt_to_dma(dev, cpu_addr);
311} 350}
@@ -329,8 +368,7 @@ static inline dma_addr_t dma_map_page(struct device *dev, struct page *page,
329{ 368{
330 BUG_ON(!valid_dma_direction(dir)); 369 BUG_ON(!valid_dma_direction(dir));
331 370
332 if (!arch_is_coherent()) 371 __dma_page_cpu_to_dev(page, offset, size, dir);
333 dma_cache_maint_page(page, offset, size, dir);
334 372
335 return page_to_dma(dev, page) + offset; 373 return page_to_dma(dev, page) + offset;
336} 374}
@@ -352,7 +390,7 @@ static inline dma_addr_t dma_map_page(struct device *dev, struct page *page,
352static inline void dma_unmap_single(struct device *dev, dma_addr_t handle, 390static inline void dma_unmap_single(struct device *dev, dma_addr_t handle,
353 size_t size, enum dma_data_direction dir) 391 size_t size, enum dma_data_direction dir)
354{ 392{
355 /* nothing to do */ 393 __dma_single_dev_to_cpu(dma_to_virt(dev, handle), size, dir);
356} 394}
357 395
358/** 396/**
@@ -372,7 +410,8 @@ static inline void dma_unmap_single(struct device *dev, dma_addr_t handle,
372static inline void dma_unmap_page(struct device *dev, dma_addr_t handle, 410static inline void dma_unmap_page(struct device *dev, dma_addr_t handle,
373 size_t size, enum dma_data_direction dir) 411 size_t size, enum dma_data_direction dir)
374{ 412{
375 /* nothing to do */ 413 __dma_page_dev_to_cpu(dma_to_page(dev, handle), handle & ~PAGE_MASK,
414 size, dir);
376} 415}
377#endif /* CONFIG_DMABOUNCE */ 416#endif /* CONFIG_DMABOUNCE */
378 417
@@ -400,7 +439,10 @@ static inline void dma_sync_single_range_for_cpu(struct device *dev,
400{ 439{
401 BUG_ON(!valid_dma_direction(dir)); 440 BUG_ON(!valid_dma_direction(dir));
402 441
403 dmabounce_sync_for_cpu(dev, handle, offset, size, dir); 442 if (!dmabounce_sync_for_cpu(dev, handle, offset, size, dir))
443 return;
444
445 __dma_single_dev_to_cpu(dma_to_virt(dev, handle) + offset, size, dir);
404} 446}
405 447
406static inline void dma_sync_single_range_for_device(struct device *dev, 448static inline void dma_sync_single_range_for_device(struct device *dev,
@@ -412,8 +454,7 @@ static inline void dma_sync_single_range_for_device(struct device *dev,
412 if (!dmabounce_sync_for_device(dev, handle, offset, size, dir)) 454 if (!dmabounce_sync_for_device(dev, handle, offset, size, dir))
413 return; 455 return;
414 456
415 if (!arch_is_coherent()) 457 __dma_single_cpu_to_dev(dma_to_virt(dev, handle) + offset, size, dir);
416 dma_cache_maint(dma_to_virt(dev, handle) + offset, size, dir);
417} 458}
418 459
419static inline void dma_sync_single_for_cpu(struct device *dev, 460static inline void dma_sync_single_for_cpu(struct device *dev,
diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h
index d2a59cfc30ce..c980156f3263 100644
--- a/arch/arm/include/asm/io.h
+++ b/arch/arm/include/asm/io.h
@@ -69,9 +69,16 @@ extern void __raw_readsl(const void __iomem *addr, void *data, int longlen);
69/* 69/*
70 * __arm_ioremap takes CPU physical address. 70 * __arm_ioremap takes CPU physical address.
71 * __arm_ioremap_pfn takes a Page Frame Number and an offset into that page 71 * __arm_ioremap_pfn takes a Page Frame Number and an offset into that page
72 * The _caller variety takes a __builtin_return_address(0) value for
73 * /proc/vmalloc to use - and should only be used in non-inline functions.
72 */ 74 */
73extern void __iomem * __arm_ioremap_pfn(unsigned long, unsigned long, size_t, unsigned int); 75extern void __iomem *__arm_ioremap_pfn_caller(unsigned long, unsigned long,
74extern void __iomem * __arm_ioremap(unsigned long, size_t, unsigned int); 76 size_t, unsigned int, void *);
77extern void __iomem *__arm_ioremap_caller(unsigned long, size_t, unsigned int,
78 void *);
79
80extern void __iomem *__arm_ioremap_pfn(unsigned long, unsigned long, size_t, unsigned int);
81extern void __iomem *__arm_ioremap(unsigned long, size_t, unsigned int);
75extern void __iounmap(volatile void __iomem *addr); 82extern void __iounmap(volatile void __iomem *addr);
76 83
77/* 84/*
diff --git a/arch/arm/include/asm/mach/time.h b/arch/arm/include/asm/mach/time.h
index b2cc1fcd0400..8bffc3ff3acf 100644
--- a/arch/arm/include/asm/mach/time.h
+++ b/arch/arm/include/asm/mach/time.h
@@ -46,12 +46,4 @@ struct sys_timer {
46extern struct sys_timer *system_timer; 46extern struct sys_timer *system_timer;
47extern void timer_tick(void); 47extern void timer_tick(void);
48 48
49/*
50 * Kernel time keeping support.
51 */
52struct timespec;
53extern int (*set_rtc)(void);
54extern void save_time_delta(struct timespec *delta, struct timespec *rtc);
55extern void restore_time_delta(struct timespec *delta, struct timespec *rtc);
56
57#endif 49#endif
diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h
index 5421d82a2572..4312ee5e3d0b 100644
--- a/arch/arm/include/asm/memory.h
+++ b/arch/arm/include/asm/memory.h
@@ -76,6 +76,17 @@
76 */ 76 */
77#define IOREMAP_MAX_ORDER 24 77#define IOREMAP_MAX_ORDER 24
78 78
79/*
80 * Size of DMA-consistent memory region. Must be multiple of 2M,
81 * between 2MB and 14MB inclusive.
82 */
83#ifndef CONSISTENT_DMA_SIZE
84#define CONSISTENT_DMA_SIZE SZ_2M
85#endif
86
87#define CONSISTENT_END (0xffe00000UL)
88#define CONSISTENT_BASE (CONSISTENT_END - CONSISTENT_DMA_SIZE)
89
79#else /* CONFIG_MMU */ 90#else /* CONFIG_MMU */
80 91
81/* 92/*
@@ -93,11 +104,11 @@
93#endif 104#endif
94 105
95#ifndef PHYS_OFFSET 106#ifndef PHYS_OFFSET
96#define PHYS_OFFSET (CONFIG_DRAM_BASE) 107#define PHYS_OFFSET UL(CONFIG_DRAM_BASE)
97#endif 108#endif
98 109
99#ifndef END_MEM 110#ifndef END_MEM
100#define END_MEM (CONFIG_DRAM_BASE + CONFIG_DRAM_SIZE) 111#define END_MEM (UL(CONFIG_DRAM_BASE) + CONFIG_DRAM_SIZE)
101#endif 112#endif
102 113
103#ifndef PAGE_OFFSET 114#ifndef PAGE_OFFSET
@@ -113,14 +124,6 @@
113#endif /* !CONFIG_MMU */ 124#endif /* !CONFIG_MMU */
114 125
115/* 126/*
116 * Size of DMA-consistent memory region. Must be multiple of 2M,
117 * between 2MB and 14MB inclusive.
118 */
119#ifndef CONSISTENT_DMA_SIZE
120#define CONSISTENT_DMA_SIZE SZ_2M
121#endif
122
123/*
124 * Physical vs virtual RAM address space conversion. These are 127 * Physical vs virtual RAM address space conversion. These are
125 * private definitions which should NOT be used outside memory.h 128 * private definitions which should NOT be used outside memory.h
126 * files. Use virt_to_phys/phys_to_virt/__pa/__va instead. 129 * files. Use virt_to_phys/phys_to_virt/__pa/__va instead.
diff --git a/arch/arm/include/asm/mmu.h b/arch/arm/include/asm/mmu.h
index b561584d04a1..68870c776671 100644
--- a/arch/arm/include/asm/mmu.h
+++ b/arch/arm/include/asm/mmu.h
@@ -6,6 +6,7 @@
6typedef struct { 6typedef struct {
7#ifdef CONFIG_CPU_HAS_ASID 7#ifdef CONFIG_CPU_HAS_ASID
8 unsigned int id; 8 unsigned int id;
9 spinlock_t id_lock;
9#endif 10#endif
10 unsigned int kvm_seq; 11 unsigned int kvm_seq;
11} mm_context_t; 12} mm_context_t;
diff --git a/arch/arm/include/asm/mmu_context.h b/arch/arm/include/asm/mmu_context.h
index de6cefb329dd..a0b3cac0547c 100644
--- a/arch/arm/include/asm/mmu_context.h
+++ b/arch/arm/include/asm/mmu_context.h
@@ -43,12 +43,23 @@ void __check_kvm_seq(struct mm_struct *mm);
43#define ASID_FIRST_VERSION (1 << ASID_BITS) 43#define ASID_FIRST_VERSION (1 << ASID_BITS)
44 44
45extern unsigned int cpu_last_asid; 45extern unsigned int cpu_last_asid;
46#ifdef CONFIG_SMP
47DECLARE_PER_CPU(struct mm_struct *, current_mm);
48#endif
46 49
47void __init_new_context(struct task_struct *tsk, struct mm_struct *mm); 50void __init_new_context(struct task_struct *tsk, struct mm_struct *mm);
48void __new_context(struct mm_struct *mm); 51void __new_context(struct mm_struct *mm);
49 52
50static inline void check_context(struct mm_struct *mm) 53static inline void check_context(struct mm_struct *mm)
51{ 54{
55 /*
56 * This code is executed with interrupts enabled. Therefore,
57 * mm->context.id cannot be updated to the latest ASID version
58 * on a different CPU (and condition below not triggered)
59 * without first getting an IPI to reset the context. The
60 * alternative is to take a read_lock on mm->context.id_lock
61 * (after changing its type to rwlock_t).
62 */
52 if (unlikely((mm->context.id ^ cpu_last_asid) >> ASID_BITS)) 63 if (unlikely((mm->context.id ^ cpu_last_asid) >> ASID_BITS))
53 __new_context(mm); 64 __new_context(mm);
54 65
@@ -108,6 +119,10 @@ switch_mm(struct mm_struct *prev, struct mm_struct *next,
108 __flush_icache_all(); 119 __flush_icache_all();
109#endif 120#endif
110 if (!cpumask_test_and_set_cpu(cpu, mm_cpumask(next)) || prev != next) { 121 if (!cpumask_test_and_set_cpu(cpu, mm_cpumask(next)) || prev != next) {
122#ifdef CONFIG_SMP
123 struct mm_struct **crt_mm = &per_cpu(current_mm, cpu);
124 *crt_mm = next;
125#endif
111 check_context(next); 126 check_context(next);
112 cpu_switch_mm(next->pgd, next); 127 cpu_switch_mm(next->pgd, next);
113 if (cache_is_vivt()) 128 if (cache_is_vivt())
diff --git a/arch/arm/include/asm/page.h b/arch/arm/include/asm/page.h
index 3a32af4cce30..a485ac3c8696 100644
--- a/arch/arm/include/asm/page.h
+++ b/arch/arm/include/asm/page.h
@@ -117,11 +117,12 @@
117#endif 117#endif
118 118
119struct page; 119struct page;
120struct vm_area_struct;
120 121
121struct cpu_user_fns { 122struct cpu_user_fns {
122 void (*cpu_clear_user_highpage)(struct page *page, unsigned long vaddr); 123 void (*cpu_clear_user_highpage)(struct page *page, unsigned long vaddr);
123 void (*cpu_copy_user_highpage)(struct page *to, struct page *from, 124 void (*cpu_copy_user_highpage)(struct page *to, struct page *from,
124 unsigned long vaddr); 125 unsigned long vaddr, struct vm_area_struct *vma);
125}; 126};
126 127
127#ifdef MULTI_USER 128#ifdef MULTI_USER
@@ -137,7 +138,7 @@ extern struct cpu_user_fns cpu_user;
137 138
138extern void __cpu_clear_user_highpage(struct page *page, unsigned long vaddr); 139extern void __cpu_clear_user_highpage(struct page *page, unsigned long vaddr);
139extern void __cpu_copy_user_highpage(struct page *to, struct page *from, 140extern void __cpu_copy_user_highpage(struct page *to, struct page *from,
140 unsigned long vaddr); 141 unsigned long vaddr, struct vm_area_struct *vma);
141#endif 142#endif
142 143
143#define clear_user_highpage(page,vaddr) \ 144#define clear_user_highpage(page,vaddr) \
@@ -145,7 +146,7 @@ extern void __cpu_copy_user_highpage(struct page *to, struct page *from,
145 146
146#define __HAVE_ARCH_COPY_USER_HIGHPAGE 147#define __HAVE_ARCH_COPY_USER_HIGHPAGE
147#define copy_user_highpage(to,from,vaddr,vma) \ 148#define copy_user_highpage(to,from,vaddr,vma) \
148 __cpu_copy_user_highpage(to, from, vaddr) 149 __cpu_copy_user_highpage(to, from, vaddr, vma)
149 150
150#define clear_page(page) memset((void *)(page), 0, PAGE_SIZE) 151#define clear_page(page) memset((void *)(page), 0, PAGE_SIZE)
151extern void copy_page(void *to, const void *from); 152extern void copy_page(void *to, const void *from);
diff --git a/arch/arm/include/asm/perf_event.h b/arch/arm/include/asm/perf_event.h
new file mode 100644
index 000000000000..49e3049aba32
--- /dev/null
+++ b/arch/arm/include/asm/perf_event.h
@@ -0,0 +1,31 @@
1/*
2 * linux/arch/arm/include/asm/perf_event.h
3 *
4 * Copyright (C) 2009 picoChip Designs Ltd, Jamie Iles
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
12#ifndef __ARM_PERF_EVENT_H__
13#define __ARM_PERF_EVENT_H__
14
15/*
16 * NOP: on *most* (read: all supported) ARM platforms, the performance
17 * counter interrupts are regular interrupts and not an NMI. This
18 * means that when we receive the interrupt we can call
19 * perf_event_do_pending() that handles all of the work with
20 * interrupts enabled.
21 */
22static inline void
23set_perf_event_pending(void)
24{
25}
26
27/* ARM performance counters start from 1 (in the cp15 accesses) so use the
28 * same indexes here for consistency. */
29#define PERF_EVENT_INDEX_OFFSET 1
30
31#endif /* __ARM_PERF_EVENT_H__ */
diff --git a/arch/arm/include/asm/pgtable-nommu.h b/arch/arm/include/asm/pgtable-nommu.h
index b011f2e939aa..013cfcdc4839 100644
--- a/arch/arm/include/asm/pgtable-nommu.h
+++ b/arch/arm/include/asm/pgtable-nommu.h
@@ -86,8 +86,8 @@ extern unsigned int kobjsize(const void *objp);
86 * All 32bit addresses are effectively valid for vmalloc... 86 * All 32bit addresses are effectively valid for vmalloc...
87 * Sort of meaningless for non-VM targets. 87 * Sort of meaningless for non-VM targets.
88 */ 88 */
89#define VMALLOC_START 0 89#define VMALLOC_START 0UL
90#define VMALLOC_END 0xffffffff 90#define VMALLOC_END 0xffffffffUL
91 91
92#define FIRST_USER_ADDRESS (0) 92#define FIRST_USER_ADDRESS (0)
93 93
diff --git a/arch/arm/include/asm/pmu.h b/arch/arm/include/asm/pmu.h
new file mode 100644
index 000000000000..2829b9f981a1
--- /dev/null
+++ b/arch/arm/include/asm/pmu.h
@@ -0,0 +1,75 @@
1/*
2 * linux/arch/arm/include/asm/pmu.h
3 *
4 * Copyright (C) 2009 picoChip Designs Ltd, Jamie Iles
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
12#ifndef __ARM_PMU_H__
13#define __ARM_PMU_H__
14
15#ifdef CONFIG_CPU_HAS_PMU
16
17struct pmu_irqs {
18 const int *irqs;
19 int num_irqs;
20};
21
22/**
23 * reserve_pmu() - reserve the hardware performance counters
24 *
25 * Reserve the hardware performance counters in the system for exclusive use.
26 * The 'struct pmu_irqs' for the system is returned on success, ERR_PTR()
27 * encoded error on failure.
28 */
29extern const struct pmu_irqs *
30reserve_pmu(void);
31
32/**
33 * release_pmu() - Relinquish control of the performance counters
34 *
35 * Release the performance counters and allow someone else to use them.
36 * Callers must have disabled the counters and released IRQs before calling
37 * this. The 'struct pmu_irqs' returned from reserve_pmu() must be passed as
38 * a cookie.
39 */
40extern int
41release_pmu(const struct pmu_irqs *irqs);
42
43/**
44 * init_pmu() - Initialise the PMU.
45 *
46 * Initialise the system ready for PMU enabling. This should typically set the
47 * IRQ affinity and nothing else. The users (oprofile/perf events etc) will do
48 * the actual hardware initialisation.
49 */
50extern int
51init_pmu(void);
52
53#else /* CONFIG_CPU_HAS_PMU */
54
55static inline const struct pmu_irqs *
56reserve_pmu(void)
57{
58 return ERR_PTR(-ENODEV);
59}
60
61static inline int
62release_pmu(const struct pmu_irqs *irqs)
63{
64 return -ENODEV;
65}
66
67static inline int
68init_pmu(void)
69{
70 return -ENODEV;
71}
72
73#endif /* CONFIG_CPU_HAS_PMU */
74
75#endif /* __ARM_PMU_H__ */
diff --git a/arch/arm/include/asm/setup.h b/arch/arm/include/asm/setup.h
index 5ccce0a9b03c..f392fb4437af 100644
--- a/arch/arm/include/asm/setup.h
+++ b/arch/arm/include/asm/setup.h
@@ -223,18 +223,6 @@ extern struct meminfo meminfo;
223#define bank_phys_end(bank) ((bank)->start + (bank)->size) 223#define bank_phys_end(bank) ((bank)->start + (bank)->size)
224#define bank_phys_size(bank) (bank)->size 224#define bank_phys_size(bank) (bank)->size
225 225
226/*
227 * Early command line parameters.
228 */
229struct early_params {
230 const char *arg;
231 void (*fn)(char **p);
232};
233
234#define __early_param(name,fn) \
235static struct early_params __early_##fn __used \
236__attribute__((__section__(".early_param.init"))) = { name, fn }
237
238#endif /* __KERNEL__ */ 226#endif /* __KERNEL__ */
239 227
240#endif 228#endif
diff --git a/arch/arm/include/asm/smp_plat.h b/arch/arm/include/asm/smp_plat.h
index 59303e200845..e6215305544a 100644
--- a/arch/arm/include/asm/smp_plat.h
+++ b/arch/arm/include/asm/smp_plat.h
@@ -13,4 +13,9 @@ static inline int tlb_ops_need_broadcast(void)
13 return ((read_cpuid_ext(CPUID_EXT_MMFR3) >> 12) & 0xf) < 2; 13 return ((read_cpuid_ext(CPUID_EXT_MMFR3) >> 12) & 0xf) < 2;
14} 14}
15 15
16static inline int cache_ops_need_broadcast(void)
17{
18 return ((read_cpuid_ext(CPUID_EXT_MMFR3) >> 12) & 0xf) < 1;
19}
20
16#endif 21#endif
diff --git a/arch/arm/include/asm/spinlock.h b/arch/arm/include/asm/spinlock.h
index c91c64cab922..17eb355707dd 100644
--- a/arch/arm/include/asm/spinlock.h
+++ b/arch/arm/include/asm/spinlock.h
@@ -5,6 +5,22 @@
5#error SMP not supported on pre-ARMv6 CPUs 5#error SMP not supported on pre-ARMv6 CPUs
6#endif 6#endif
7 7
8static inline void dsb_sev(void)
9{
10#if __LINUX_ARM_ARCH__ >= 7
11 __asm__ __volatile__ (
12 "dsb\n"
13 "sev"
14 );
15#elif defined(CONFIG_CPU_32v6K)
16 __asm__ __volatile__ (
17 "mcr p15, 0, %0, c7, c10, 4\n"
18 "sev"
19 : : "r" (0)
20 );
21#endif
22}
23
8/* 24/*
9 * ARMv6 Spin-locking. 25 * ARMv6 Spin-locking.
10 * 26 *
@@ -69,13 +85,11 @@ static inline void arch_spin_unlock(arch_spinlock_t *lock)
69 85
70 __asm__ __volatile__( 86 __asm__ __volatile__(
71" str %1, [%0]\n" 87" str %1, [%0]\n"
72#ifdef CONFIG_CPU_32v6K
73" mcr p15, 0, %1, c7, c10, 4\n" /* DSB */
74" sev"
75#endif
76 : 88 :
77 : "r" (&lock->lock), "r" (0) 89 : "r" (&lock->lock), "r" (0)
78 : "cc"); 90 : "cc");
91
92 dsb_sev();
79} 93}
80 94
81/* 95/*
@@ -132,13 +146,11 @@ static inline void arch_write_unlock(arch_rwlock_t *rw)
132 146
133 __asm__ __volatile__( 147 __asm__ __volatile__(
134 "str %1, [%0]\n" 148 "str %1, [%0]\n"
135#ifdef CONFIG_CPU_32v6K
136" mcr p15, 0, %1, c7, c10, 4\n" /* DSB */
137" sev\n"
138#endif
139 : 149 :
140 : "r" (&rw->lock), "r" (0) 150 : "r" (&rw->lock), "r" (0)
141 : "cc"); 151 : "cc");
152
153 dsb_sev();
142} 154}
143 155
144/* write_can_lock - would write_trylock() succeed? */ 156/* write_can_lock - would write_trylock() succeed? */
@@ -188,14 +200,12 @@ static inline void arch_read_unlock(arch_rwlock_t *rw)
188" strex %1, %0, [%2]\n" 200" strex %1, %0, [%2]\n"
189" teq %1, #0\n" 201" teq %1, #0\n"
190" bne 1b" 202" bne 1b"
191#ifdef CONFIG_CPU_32v6K
192"\n cmp %0, #0\n"
193" mcreq p15, 0, %0, c7, c10, 4\n"
194" seveq"
195#endif
196 : "=&r" (tmp), "=&r" (tmp2) 203 : "=&r" (tmp), "=&r" (tmp2)
197 : "r" (&rw->lock) 204 : "r" (&rw->lock)
198 : "cc"); 205 : "cc");
206
207 if (tmp == 0)
208 dsb_sev();
199} 209}
200 210
201static inline int arch_read_trylock(arch_rwlock_t *rw) 211static inline int arch_read_trylock(arch_rwlock_t *rw)
diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h
index 058e7e90881d..ca88e6a84707 100644
--- a/arch/arm/include/asm/system.h
+++ b/arch/arm/include/asm/system.h
@@ -73,8 +73,7 @@ extern unsigned int mem_fclk_21285;
73 73
74struct pt_regs; 74struct pt_regs;
75 75
76void die(const char *msg, struct pt_regs *regs, int err) 76void die(const char *msg, struct pt_regs *regs, int err);
77 __attribute__((noreturn));
78 77
79struct siginfo; 78struct siginfo;
80void arm_notify_die(const char *str, struct pt_regs *regs, struct siginfo *info, 79void arm_notify_die(const char *str, struct pt_regs *regs, struct siginfo *info,
diff --git a/arch/arm/include/asm/thread_info.h b/arch/arm/include/asm/thread_info.h
index 2dfb7d7a66e9..b74970ec02c4 100644
--- a/arch/arm/include/asm/thread_info.h
+++ b/arch/arm/include/asm/thread_info.h
@@ -115,7 +115,8 @@ extern void iwmmxt_task_restore(struct thread_info *, void *);
115extern void iwmmxt_task_release(struct thread_info *); 115extern void iwmmxt_task_release(struct thread_info *);
116extern void iwmmxt_task_switch(struct thread_info *); 116extern void iwmmxt_task_switch(struct thread_info *);
117 117
118extern void vfp_sync_state(struct thread_info *thread); 118extern void vfp_sync_hwstate(struct thread_info *);
119extern void vfp_flush_hwstate(struct thread_info *);
119 120
120#endif 121#endif
121 122
diff --git a/arch/arm/include/asm/tlbflush.h b/arch/arm/include/asm/tlbflush.h
index c2f1605de359..e085e2c545eb 100644
--- a/arch/arm/include/asm/tlbflush.h
+++ b/arch/arm/include/asm/tlbflush.h
@@ -529,7 +529,8 @@ extern void flush_tlb_kernel_range(unsigned long start, unsigned long end);
529 * cache entries for the kernels virtual memory range are written 529 * cache entries for the kernels virtual memory range are written
530 * back to the page. 530 * back to the page.
531 */ 531 */
532extern void update_mmu_cache(struct vm_area_struct *vma, unsigned long addr, pte_t pte); 532extern void update_mmu_cache(struct vm_area_struct *vma, unsigned long addr,
533 pte_t *ptep);
533 534
534#endif 535#endif
535 536
diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
index dd00f747e2ad..26d302c28e13 100644
--- a/arch/arm/kernel/Makefile
+++ b/arch/arm/kernel/Makefile
@@ -17,6 +17,7 @@ obj-y := compat.o elf.o entry-armv.o entry-common.o irq.o \
17 process.o ptrace.o return_address.o setup.o signal.o \ 17 process.o ptrace.o return_address.o setup.o signal.o \
18 sys_arm.o stacktrace.o time.o traps.o 18 sys_arm.o stacktrace.o time.o traps.o
19 19
20obj-$(CONFIG_LEDS) += leds.o
20obj-$(CONFIG_OC_ETM) += etm.o 21obj-$(CONFIG_OC_ETM) += etm.o
21 22
22obj-$(CONFIG_ISA_DMA_API) += dma.o 23obj-$(CONFIG_ISA_DMA_API) += dma.o
@@ -46,6 +47,8 @@ obj-$(CONFIG_CPU_XSCALE) += xscale-cp0.o
46obj-$(CONFIG_CPU_XSC3) += xscale-cp0.o 47obj-$(CONFIG_CPU_XSC3) += xscale-cp0.o
47obj-$(CONFIG_CPU_MOHAWK) += xscale-cp0.o 48obj-$(CONFIG_CPU_MOHAWK) += xscale-cp0.o
48obj-$(CONFIG_IWMMXT) += iwmmxt.o 49obj-$(CONFIG_IWMMXT) += iwmmxt.o
50obj-$(CONFIG_CPU_HAS_PMU) += pmu.o
51obj-$(CONFIG_HW_PERF_EVENTS) += perf_event.o
49AFLAGS_iwmmxt.o := -Wa,-mcpu=iwmmxt 52AFLAGS_iwmmxt.o := -Wa,-mcpu=iwmmxt
50 53
51ifneq ($(CONFIG_ARCH_EBSA110),y) 54ifneq ($(CONFIG_ARCH_EBSA110),y)
diff --git a/arch/arm/kernel/asm-offsets.c b/arch/arm/kernel/asm-offsets.c
index 4a881258bb17..883511522fca 100644
--- a/arch/arm/kernel/asm-offsets.c
+++ b/arch/arm/kernel/asm-offsets.c
@@ -12,6 +12,7 @@
12 */ 12 */
13#include <linux/sched.h> 13#include <linux/sched.h>
14#include <linux/mm.h> 14#include <linux/mm.h>
15#include <linux/dma-mapping.h>
15#include <asm/mach/arch.h> 16#include <asm/mach/arch.h>
16#include <asm/thread_info.h> 17#include <asm/thread_info.h>
17#include <asm/memory.h> 18#include <asm/memory.h>
@@ -112,5 +113,9 @@ int main(void)
112#ifdef MULTI_PABORT 113#ifdef MULTI_PABORT
113 DEFINE(PROCESSOR_PABT_FUNC, offsetof(struct processor, _prefetch_abort)); 114 DEFINE(PROCESSOR_PABT_FUNC, offsetof(struct processor, _prefetch_abort));
114#endif 115#endif
116 BLANK();
117 DEFINE(DMA_BIDIRECTIONAL, DMA_BIDIRECTIONAL);
118 DEFINE(DMA_TO_DEVICE, DMA_TO_DEVICE);
119 DEFINE(DMA_FROM_DEVICE, DMA_FROM_DEVICE);
115 return 0; 120 return 0;
116} 121}
diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c
index 809681900ec8..bd397e0b663e 100644
--- a/arch/arm/kernel/bios32.c
+++ b/arch/arm/kernel/bios32.c
@@ -616,15 +616,17 @@ char * __init pcibios_setup(char *str)
616 * but we want to try to avoid allocating at 0x2900-0x2bff 616 * but we want to try to avoid allocating at 0x2900-0x2bff
617 * which might be mirrored at 0x0100-0x03ff.. 617 * which might be mirrored at 0x0100-0x03ff..
618 */ 618 */
619void pcibios_align_resource(void *data, struct resource *res, 619resource_size_t pcibios_align_resource(void *data, const struct resource *res,
620 resource_size_t size, resource_size_t align) 620 resource_size_t size, resource_size_t align)
621{ 621{
622 resource_size_t start = res->start; 622 resource_size_t start = res->start;
623 623
624 if (res->flags & IORESOURCE_IO && start & 0x300) 624 if (res->flags & IORESOURCE_IO && start & 0x300)
625 start = (start + 0x3ff) & ~0x3ff; 625 start = (start + 0x3ff) & ~0x3ff;
626 626
627 res->start = (start + align - 1) & ~(align - 1); 627 start = (start + align - 1) & ~(align - 1);
628
629 return start;
628} 630}
629 631
630/** 632/**
diff --git a/arch/arm/kernel/leds.c b/arch/arm/kernel/leds.c
new file mode 100644
index 000000000000..31a316c1777b
--- /dev/null
+++ b/arch/arm/kernel/leds.c
@@ -0,0 +1,115 @@
1/*
2 * LED support code, ripped out of arch/arm/kernel/time.c
3 *
4 * Copyright (C) 1994-2001 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <linux/module.h>
11#include <linux/init.h>
12#include <linux/sysdev.h>
13
14#include <asm/leds.h>
15
16static void dummy_leds_event(led_event_t evt)
17{
18}
19
20void (*leds_event)(led_event_t) = dummy_leds_event;
21
22struct leds_evt_name {
23 const char name[8];
24 int on;
25 int off;
26};
27
28static const struct leds_evt_name evt_names[] = {
29 { "amber", led_amber_on, led_amber_off },
30 { "blue", led_blue_on, led_blue_off },
31 { "green", led_green_on, led_green_off },
32 { "red", led_red_on, led_red_off },
33};
34
35static ssize_t leds_store(struct sys_device *dev,
36 struct sysdev_attribute *attr,
37 const char *buf, size_t size)
38{
39 int ret = -EINVAL, len = strcspn(buf, " ");
40
41 if (len > 0 && buf[len] == '\0')
42 len--;
43
44 if (strncmp(buf, "claim", len) == 0) {
45 leds_event(led_claim);
46 ret = size;
47 } else if (strncmp(buf, "release", len) == 0) {
48 leds_event(led_release);
49 ret = size;
50 } else {
51 int i;
52
53 for (i = 0; i < ARRAY_SIZE(evt_names); i++) {
54 if (strlen(evt_names[i].name) != len ||
55 strncmp(buf, evt_names[i].name, len) != 0)
56 continue;
57 if (strncmp(buf+len, " on", 3) == 0) {
58 leds_event(evt_names[i].on);
59 ret = size;
60 } else if (strncmp(buf+len, " off", 4) == 0) {
61 leds_event(evt_names[i].off);
62 ret = size;
63 }
64 break;
65 }
66 }
67 return ret;
68}
69
70static SYSDEV_ATTR(event, 0200, NULL, leds_store);
71
72static int leds_suspend(struct sys_device *dev, pm_message_t state)
73{
74 leds_event(led_stop);
75 return 0;
76}
77
78static int leds_resume(struct sys_device *dev)
79{
80 leds_event(led_start);
81 return 0;
82}
83
84static int leds_shutdown(struct sys_device *dev)
85{
86 leds_event(led_halted);
87 return 0;
88}
89
90static struct sysdev_class leds_sysclass = {
91 .name = "leds",
92 .shutdown = leds_shutdown,
93 .suspend = leds_suspend,
94 .resume = leds_resume,
95};
96
97static struct sys_device leds_device = {
98 .id = 0,
99 .cls = &leds_sysclass,
100};
101
102static int __init leds_init(void)
103{
104 int ret;
105 ret = sysdev_class_register(&leds_sysclass);
106 if (ret == 0)
107 ret = sysdev_register(&leds_device);
108 if (ret == 0)
109 ret = sysdev_create_file(&leds_device, &attr_event);
110 return ret;
111}
112
113device_initcall(leds_init);
114
115EXPORT_SYMBOL(leds_event);
diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c
new file mode 100644
index 000000000000..c54ceb3d1f97
--- /dev/null
+++ b/arch/arm/kernel/perf_event.c
@@ -0,0 +1,2276 @@
1#undef DEBUG
2
3/*
4 * ARM performance counter support.
5 *
6 * Copyright (C) 2009 picoChip Designs, Ltd., Jamie Iles
7 *
8 * ARMv7 support: Jean Pihet <jpihet@mvista.com>
9 * 2010 (c) MontaVista Software, LLC.
10 *
11 * This code is based on the sparc64 perf event code, which is in turn based
12 * on the x86 code. Callchain code is based on the ARM OProfile backtrace
13 * code.
14 */
15#define pr_fmt(fmt) "hw perfevents: " fmt
16
17#include <linux/interrupt.h>
18#include <linux/kernel.h>
19#include <linux/perf_event.h>
20#include <linux/spinlock.h>
21#include <linux/uaccess.h>
22
23#include <asm/cputype.h>
24#include <asm/irq.h>
25#include <asm/irq_regs.h>
26#include <asm/pmu.h>
27#include <asm/stacktrace.h>
28
29static const struct pmu_irqs *pmu_irqs;
30
31/*
32 * Hardware lock to serialize accesses to PMU registers. Needed for the
33 * read/modify/write sequences.
34 */
35DEFINE_SPINLOCK(pmu_lock);
36
37/*
38 * ARMv6 supports a maximum of 3 events, starting from index 1. If we add
39 * another platform that supports more, we need to increase this to be the
40 * largest of all platforms.
41 *
42 * ARMv7 supports up to 32 events:
43 * cycle counter CCNT + 31 events counters CNT0..30.
44 * Cortex-A8 has 1+4 counters, Cortex-A9 has 1+6 counters.
45 */
46#define ARMPMU_MAX_HWEVENTS 33
47
48/* The events for a given CPU. */
49struct cpu_hw_events {
50 /*
51 * The events that are active on the CPU for the given index. Index 0
52 * is reserved.
53 */
54 struct perf_event *events[ARMPMU_MAX_HWEVENTS];
55
56 /*
57 * A 1 bit for an index indicates that the counter is being used for
58 * an event. A 0 means that the counter can be used.
59 */
60 unsigned long used_mask[BITS_TO_LONGS(ARMPMU_MAX_HWEVENTS)];
61
62 /*
63 * A 1 bit for an index indicates that the counter is actively being
64 * used.
65 */
66 unsigned long active_mask[BITS_TO_LONGS(ARMPMU_MAX_HWEVENTS)];
67};
68DEFINE_PER_CPU(struct cpu_hw_events, cpu_hw_events);
69
70struct arm_pmu {
71 char *name;
72 irqreturn_t (*handle_irq)(int irq_num, void *dev);
73 void (*enable)(struct hw_perf_event *evt, int idx);
74 void (*disable)(struct hw_perf_event *evt, int idx);
75 int (*event_map)(int evt);
76 u64 (*raw_event)(u64);
77 int (*get_event_idx)(struct cpu_hw_events *cpuc,
78 struct hw_perf_event *hwc);
79 u32 (*read_counter)(int idx);
80 void (*write_counter)(int idx, u32 val);
81 void (*start)(void);
82 void (*stop)(void);
83 int num_events;
84 u64 max_period;
85};
86
87/* Set at runtime when we know what CPU type we are. */
88static const struct arm_pmu *armpmu;
89
90#define HW_OP_UNSUPPORTED 0xFFFF
91
92#define C(_x) \
93 PERF_COUNT_HW_CACHE_##_x
94
95#define CACHE_OP_UNSUPPORTED 0xFFFF
96
97static unsigned armpmu_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
98 [PERF_COUNT_HW_CACHE_OP_MAX]
99 [PERF_COUNT_HW_CACHE_RESULT_MAX];
100
101static int
102armpmu_map_cache_event(u64 config)
103{
104 unsigned int cache_type, cache_op, cache_result, ret;
105
106 cache_type = (config >> 0) & 0xff;
107 if (cache_type >= PERF_COUNT_HW_CACHE_MAX)
108 return -EINVAL;
109
110 cache_op = (config >> 8) & 0xff;
111 if (cache_op >= PERF_COUNT_HW_CACHE_OP_MAX)
112 return -EINVAL;
113
114 cache_result = (config >> 16) & 0xff;
115 if (cache_result >= PERF_COUNT_HW_CACHE_RESULT_MAX)
116 return -EINVAL;
117
118 ret = (int)armpmu_perf_cache_map[cache_type][cache_op][cache_result];
119
120 if (ret == CACHE_OP_UNSUPPORTED)
121 return -ENOENT;
122
123 return ret;
124}
125
126static int
127armpmu_event_set_period(struct perf_event *event,
128 struct hw_perf_event *hwc,
129 int idx)
130{
131 s64 left = atomic64_read(&hwc->period_left);
132 s64 period = hwc->sample_period;
133 int ret = 0;
134
135 if (unlikely(left <= -period)) {
136 left = period;
137 atomic64_set(&hwc->period_left, left);
138 hwc->last_period = period;
139 ret = 1;
140 }
141
142 if (unlikely(left <= 0)) {
143 left += period;
144 atomic64_set(&hwc->period_left, left);
145 hwc->last_period = period;
146 ret = 1;
147 }
148
149 if (left > (s64)armpmu->max_period)
150 left = armpmu->max_period;
151
152 atomic64_set(&hwc->prev_count, (u64)-left);
153
154 armpmu->write_counter(idx, (u64)(-left) & 0xffffffff);
155
156 perf_event_update_userpage(event);
157
158 return ret;
159}
160
161static u64
162armpmu_event_update(struct perf_event *event,
163 struct hw_perf_event *hwc,
164 int idx)
165{
166 int shift = 64 - 32;
167 s64 prev_raw_count, new_raw_count;
168 s64 delta;
169
170again:
171 prev_raw_count = atomic64_read(&hwc->prev_count);
172 new_raw_count = armpmu->read_counter(idx);
173
174 if (atomic64_cmpxchg(&hwc->prev_count, prev_raw_count,
175 new_raw_count) != prev_raw_count)
176 goto again;
177
178 delta = (new_raw_count << shift) - (prev_raw_count << shift);
179 delta >>= shift;
180
181 atomic64_add(delta, &event->count);
182 atomic64_sub(delta, &hwc->period_left);
183
184 return new_raw_count;
185}
186
187static void
188armpmu_disable(struct perf_event *event)
189{
190 struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
191 struct hw_perf_event *hwc = &event->hw;
192 int idx = hwc->idx;
193
194 WARN_ON(idx < 0);
195
196 clear_bit(idx, cpuc->active_mask);
197 armpmu->disable(hwc, idx);
198
199 barrier();
200
201 armpmu_event_update(event, hwc, idx);
202 cpuc->events[idx] = NULL;
203 clear_bit(idx, cpuc->used_mask);
204
205 perf_event_update_userpage(event);
206}
207
208static void
209armpmu_read(struct perf_event *event)
210{
211 struct hw_perf_event *hwc = &event->hw;
212
213 /* Don't read disabled counters! */
214 if (hwc->idx < 0)
215 return;
216
217 armpmu_event_update(event, hwc, hwc->idx);
218}
219
220static void
221armpmu_unthrottle(struct perf_event *event)
222{
223 struct hw_perf_event *hwc = &event->hw;
224
225 /*
226 * Set the period again. Some counters can't be stopped, so when we
227 * were throttled we simply disabled the IRQ source and the counter
228 * may have been left counting. If we don't do this step then we may
229 * get an interrupt too soon or *way* too late if the overflow has
230 * happened since disabling.
231 */
232 armpmu_event_set_period(event, hwc, hwc->idx);
233 armpmu->enable(hwc, hwc->idx);
234}
235
236static int
237armpmu_enable(struct perf_event *event)
238{
239 struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
240 struct hw_perf_event *hwc = &event->hw;
241 int idx;
242 int err = 0;
243
244 /* If we don't have a space for the counter then finish early. */
245 idx = armpmu->get_event_idx(cpuc, hwc);
246 if (idx < 0) {
247 err = idx;
248 goto out;
249 }
250
251 /*
252 * If there is an event in the counter we are going to use then make
253 * sure it is disabled.
254 */
255 event->hw.idx = idx;
256 armpmu->disable(hwc, idx);
257 cpuc->events[idx] = event;
258 set_bit(idx, cpuc->active_mask);
259
260 /* Set the period for the event. */
261 armpmu_event_set_period(event, hwc, idx);
262
263 /* Enable the event. */
264 armpmu->enable(hwc, idx);
265
266 /* Propagate our changes to the userspace mapping. */
267 perf_event_update_userpage(event);
268
269out:
270 return err;
271}
272
273static struct pmu pmu = {
274 .enable = armpmu_enable,
275 .disable = armpmu_disable,
276 .unthrottle = armpmu_unthrottle,
277 .read = armpmu_read,
278};
279
280static int
281validate_event(struct cpu_hw_events *cpuc,
282 struct perf_event *event)
283{
284 struct hw_perf_event fake_event = event->hw;
285
286 if (event->pmu && event->pmu != &pmu)
287 return 0;
288
289 return armpmu->get_event_idx(cpuc, &fake_event) >= 0;
290}
291
292static int
293validate_group(struct perf_event *event)
294{
295 struct perf_event *sibling, *leader = event->group_leader;
296 struct cpu_hw_events fake_pmu;
297
298 memset(&fake_pmu, 0, sizeof(fake_pmu));
299
300 if (!validate_event(&fake_pmu, leader))
301 return -ENOSPC;
302
303 list_for_each_entry(sibling, &leader->sibling_list, group_entry) {
304 if (!validate_event(&fake_pmu, sibling))
305 return -ENOSPC;
306 }
307
308 if (!validate_event(&fake_pmu, event))
309 return -ENOSPC;
310
311 return 0;
312}
313
314static int
315armpmu_reserve_hardware(void)
316{
317 int i;
318 int err;
319
320 pmu_irqs = reserve_pmu();
321 if (IS_ERR(pmu_irqs)) {
322 pr_warning("unable to reserve pmu\n");
323 return PTR_ERR(pmu_irqs);
324 }
325
326 init_pmu();
327
328 if (pmu_irqs->num_irqs < 1) {
329 pr_err("no irqs for PMUs defined\n");
330 return -ENODEV;
331 }
332
333 for (i = 0; i < pmu_irqs->num_irqs; ++i) {
334 err = request_irq(pmu_irqs->irqs[i], armpmu->handle_irq,
335 IRQF_DISABLED, "armpmu", NULL);
336 if (err) {
337 pr_warning("unable to request IRQ%d for ARM "
338 "perf counters\n", pmu_irqs->irqs[i]);
339 break;
340 }
341 }
342
343 if (err) {
344 for (i = i - 1; i >= 0; --i)
345 free_irq(pmu_irqs->irqs[i], NULL);
346 release_pmu(pmu_irqs);
347 pmu_irqs = NULL;
348 }
349
350 return err;
351}
352
353static void
354armpmu_release_hardware(void)
355{
356 int i;
357
358 for (i = pmu_irqs->num_irqs - 1; i >= 0; --i)
359 free_irq(pmu_irqs->irqs[i], NULL);
360 armpmu->stop();
361
362 release_pmu(pmu_irqs);
363 pmu_irqs = NULL;
364}
365
366static atomic_t active_events = ATOMIC_INIT(0);
367static DEFINE_MUTEX(pmu_reserve_mutex);
368
369static void
370hw_perf_event_destroy(struct perf_event *event)
371{
372 if (atomic_dec_and_mutex_lock(&active_events, &pmu_reserve_mutex)) {
373 armpmu_release_hardware();
374 mutex_unlock(&pmu_reserve_mutex);
375 }
376}
377
378static int
379__hw_perf_event_init(struct perf_event *event)
380{
381 struct hw_perf_event *hwc = &event->hw;
382 int mapping, err;
383
384 /* Decode the generic type into an ARM event identifier. */
385 if (PERF_TYPE_HARDWARE == event->attr.type) {
386 mapping = armpmu->event_map(event->attr.config);
387 } else if (PERF_TYPE_HW_CACHE == event->attr.type) {
388 mapping = armpmu_map_cache_event(event->attr.config);
389 } else if (PERF_TYPE_RAW == event->attr.type) {
390 mapping = armpmu->raw_event(event->attr.config);
391 } else {
392 pr_debug("event type %x not supported\n", event->attr.type);
393 return -EOPNOTSUPP;
394 }
395
396 if (mapping < 0) {
397 pr_debug("event %x:%llx not supported\n", event->attr.type,
398 event->attr.config);
399 return mapping;
400 }
401
402 /*
403 * Check whether we need to exclude the counter from certain modes.
404 * The ARM performance counters are on all of the time so if someone
405 * has asked us for some excludes then we have to fail.
406 */
407 if (event->attr.exclude_kernel || event->attr.exclude_user ||
408 event->attr.exclude_hv || event->attr.exclude_idle) {
409 pr_debug("ARM performance counters do not support "
410 "mode exclusion\n");
411 return -EPERM;
412 }
413
414 /*
415 * We don't assign an index until we actually place the event onto
416 * hardware. Use -1 to signify that we haven't decided where to put it
417 * yet. For SMP systems, each core has it's own PMU so we can't do any
418 * clever allocation or constraints checking at this point.
419 */
420 hwc->idx = -1;
421
422 /*
423 * Store the event encoding into the config_base field. config and
424 * event_base are unused as the only 2 things we need to know are
425 * the event mapping and the counter to use. The counter to use is
426 * also the indx and the config_base is the event type.
427 */
428 hwc->config_base = (unsigned long)mapping;
429 hwc->config = 0;
430 hwc->event_base = 0;
431
432 if (!hwc->sample_period) {
433 hwc->sample_period = armpmu->max_period;
434 hwc->last_period = hwc->sample_period;
435 atomic64_set(&hwc->period_left, hwc->sample_period);
436 }
437
438 err = 0;
439 if (event->group_leader != event) {
440 err = validate_group(event);
441 if (err)
442 return -EINVAL;
443 }
444
445 return err;
446}
447
448const struct pmu *
449hw_perf_event_init(struct perf_event *event)
450{
451 int err = 0;
452
453 if (!armpmu)
454 return ERR_PTR(-ENODEV);
455
456 event->destroy = hw_perf_event_destroy;
457
458 if (!atomic_inc_not_zero(&active_events)) {
459 if (atomic_read(&active_events) > perf_max_events) {
460 atomic_dec(&active_events);
461 return ERR_PTR(-ENOSPC);
462 }
463
464 mutex_lock(&pmu_reserve_mutex);
465 if (atomic_read(&active_events) == 0) {
466 err = armpmu_reserve_hardware();
467 }
468
469 if (!err)
470 atomic_inc(&active_events);
471 mutex_unlock(&pmu_reserve_mutex);
472 }
473
474 if (err)
475 return ERR_PTR(err);
476
477 err = __hw_perf_event_init(event);
478 if (err)
479 hw_perf_event_destroy(event);
480
481 return err ? ERR_PTR(err) : &pmu;
482}
483
484void
485hw_perf_enable(void)
486{
487 /* Enable all of the perf events on hardware. */
488 int idx;
489 struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
490
491 if (!armpmu)
492 return;
493
494 for (idx = 0; idx <= armpmu->num_events; ++idx) {
495 struct perf_event *event = cpuc->events[idx];
496
497 if (!event)
498 continue;
499
500 armpmu->enable(&event->hw, idx);
501 }
502
503 armpmu->start();
504}
505
506void
507hw_perf_disable(void)
508{
509 if (armpmu)
510 armpmu->stop();
511}
512
513/*
514 * ARMv6 Performance counter handling code.
515 *
516 * ARMv6 has 2 configurable performance counters and a single cycle counter.
517 * They all share a single reset bit but can be written to zero so we can use
518 * that for a reset.
519 *
520 * The counters can't be individually enabled or disabled so when we remove
521 * one event and replace it with another we could get spurious counts from the
522 * wrong event. However, we can take advantage of the fact that the
523 * performance counters can export events to the event bus, and the event bus
524 * itself can be monitored. This requires that we *don't* export the events to
525 * the event bus. The procedure for disabling a configurable counter is:
526 * - change the counter to count the ETMEXTOUT[0] signal (0x20). This
527 * effectively stops the counter from counting.
528 * - disable the counter's interrupt generation (each counter has it's
529 * own interrupt enable bit).
530 * Once stopped, the counter value can be written as 0 to reset.
531 *
532 * To enable a counter:
533 * - enable the counter's interrupt generation.
534 * - set the new event type.
535 *
536 * Note: the dedicated cycle counter only counts cycles and can't be
537 * enabled/disabled independently of the others. When we want to disable the
538 * cycle counter, we have to just disable the interrupt reporting and start
539 * ignoring that counter. When re-enabling, we have to reset the value and
540 * enable the interrupt.
541 */
542
543enum armv6_perf_types {
544 ARMV6_PERFCTR_ICACHE_MISS = 0x0,
545 ARMV6_PERFCTR_IBUF_STALL = 0x1,
546 ARMV6_PERFCTR_DDEP_STALL = 0x2,
547 ARMV6_PERFCTR_ITLB_MISS = 0x3,
548 ARMV6_PERFCTR_DTLB_MISS = 0x4,
549 ARMV6_PERFCTR_BR_EXEC = 0x5,
550 ARMV6_PERFCTR_BR_MISPREDICT = 0x6,
551 ARMV6_PERFCTR_INSTR_EXEC = 0x7,
552 ARMV6_PERFCTR_DCACHE_HIT = 0x9,
553 ARMV6_PERFCTR_DCACHE_ACCESS = 0xA,
554 ARMV6_PERFCTR_DCACHE_MISS = 0xB,
555 ARMV6_PERFCTR_DCACHE_WBACK = 0xC,
556 ARMV6_PERFCTR_SW_PC_CHANGE = 0xD,
557 ARMV6_PERFCTR_MAIN_TLB_MISS = 0xF,
558 ARMV6_PERFCTR_EXPL_D_ACCESS = 0x10,
559 ARMV6_PERFCTR_LSU_FULL_STALL = 0x11,
560 ARMV6_PERFCTR_WBUF_DRAINED = 0x12,
561 ARMV6_PERFCTR_CPU_CYCLES = 0xFF,
562 ARMV6_PERFCTR_NOP = 0x20,
563};
564
565enum armv6_counters {
566 ARMV6_CYCLE_COUNTER = 1,
567 ARMV6_COUNTER0,
568 ARMV6_COUNTER1,
569};
570
571/*
572 * The hardware events that we support. We do support cache operations but
573 * we have harvard caches and no way to combine instruction and data
574 * accesses/misses in hardware.
575 */
576static const unsigned armv6_perf_map[PERF_COUNT_HW_MAX] = {
577 [PERF_COUNT_HW_CPU_CYCLES] = ARMV6_PERFCTR_CPU_CYCLES,
578 [PERF_COUNT_HW_INSTRUCTIONS] = ARMV6_PERFCTR_INSTR_EXEC,
579 [PERF_COUNT_HW_CACHE_REFERENCES] = HW_OP_UNSUPPORTED,
580 [PERF_COUNT_HW_CACHE_MISSES] = HW_OP_UNSUPPORTED,
581 [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = ARMV6_PERFCTR_BR_EXEC,
582 [PERF_COUNT_HW_BRANCH_MISSES] = ARMV6_PERFCTR_BR_MISPREDICT,
583 [PERF_COUNT_HW_BUS_CYCLES] = HW_OP_UNSUPPORTED,
584};
585
586static const unsigned armv6_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
587 [PERF_COUNT_HW_CACHE_OP_MAX]
588 [PERF_COUNT_HW_CACHE_RESULT_MAX] = {
589 [C(L1D)] = {
590 /*
591 * The performance counters don't differentiate between read
592 * and write accesses/misses so this isn't strictly correct,
593 * but it's the best we can do. Writes and reads get
594 * combined.
595 */
596 [C(OP_READ)] = {
597 [C(RESULT_ACCESS)] = ARMV6_PERFCTR_DCACHE_ACCESS,
598 [C(RESULT_MISS)] = ARMV6_PERFCTR_DCACHE_MISS,
599 },
600 [C(OP_WRITE)] = {
601 [C(RESULT_ACCESS)] = ARMV6_PERFCTR_DCACHE_ACCESS,
602 [C(RESULT_MISS)] = ARMV6_PERFCTR_DCACHE_MISS,
603 },
604 [C(OP_PREFETCH)] = {
605 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
606 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
607 },
608 },
609 [C(L1I)] = {
610 [C(OP_READ)] = {
611 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
612 [C(RESULT_MISS)] = ARMV6_PERFCTR_ICACHE_MISS,
613 },
614 [C(OP_WRITE)] = {
615 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
616 [C(RESULT_MISS)] = ARMV6_PERFCTR_ICACHE_MISS,
617 },
618 [C(OP_PREFETCH)] = {
619 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
620 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
621 },
622 },
623 [C(LL)] = {
624 [C(OP_READ)] = {
625 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
626 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
627 },
628 [C(OP_WRITE)] = {
629 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
630 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
631 },
632 [C(OP_PREFETCH)] = {
633 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
634 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
635 },
636 },
637 [C(DTLB)] = {
638 /*
639 * The ARM performance counters can count micro DTLB misses,
640 * micro ITLB misses and main TLB misses. There isn't an event
641 * for TLB misses, so use the micro misses here and if users
642 * want the main TLB misses they can use a raw counter.
643 */
644 [C(OP_READ)] = {
645 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
646 [C(RESULT_MISS)] = ARMV6_PERFCTR_DTLB_MISS,
647 },
648 [C(OP_WRITE)] = {
649 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
650 [C(RESULT_MISS)] = ARMV6_PERFCTR_DTLB_MISS,
651 },
652 [C(OP_PREFETCH)] = {
653 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
654 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
655 },
656 },
657 [C(ITLB)] = {
658 [C(OP_READ)] = {
659 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
660 [C(RESULT_MISS)] = ARMV6_PERFCTR_ITLB_MISS,
661 },
662 [C(OP_WRITE)] = {
663 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
664 [C(RESULT_MISS)] = ARMV6_PERFCTR_ITLB_MISS,
665 },
666 [C(OP_PREFETCH)] = {
667 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
668 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
669 },
670 },
671 [C(BPU)] = {
672 [C(OP_READ)] = {
673 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
674 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
675 },
676 [C(OP_WRITE)] = {
677 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
678 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
679 },
680 [C(OP_PREFETCH)] = {
681 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
682 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
683 },
684 },
685};
686
687enum armv6mpcore_perf_types {
688 ARMV6MPCORE_PERFCTR_ICACHE_MISS = 0x0,
689 ARMV6MPCORE_PERFCTR_IBUF_STALL = 0x1,
690 ARMV6MPCORE_PERFCTR_DDEP_STALL = 0x2,
691 ARMV6MPCORE_PERFCTR_ITLB_MISS = 0x3,
692 ARMV6MPCORE_PERFCTR_DTLB_MISS = 0x4,
693 ARMV6MPCORE_PERFCTR_BR_EXEC = 0x5,
694 ARMV6MPCORE_PERFCTR_BR_NOTPREDICT = 0x6,
695 ARMV6MPCORE_PERFCTR_BR_MISPREDICT = 0x7,
696 ARMV6MPCORE_PERFCTR_INSTR_EXEC = 0x8,
697 ARMV6MPCORE_PERFCTR_DCACHE_RDACCESS = 0xA,
698 ARMV6MPCORE_PERFCTR_DCACHE_RDMISS = 0xB,
699 ARMV6MPCORE_PERFCTR_DCACHE_WRACCESS = 0xC,
700 ARMV6MPCORE_PERFCTR_DCACHE_WRMISS = 0xD,
701 ARMV6MPCORE_PERFCTR_DCACHE_EVICTION = 0xE,
702 ARMV6MPCORE_PERFCTR_SW_PC_CHANGE = 0xF,
703 ARMV6MPCORE_PERFCTR_MAIN_TLB_MISS = 0x10,
704 ARMV6MPCORE_PERFCTR_EXPL_MEM_ACCESS = 0x11,
705 ARMV6MPCORE_PERFCTR_LSU_FULL_STALL = 0x12,
706 ARMV6MPCORE_PERFCTR_WBUF_DRAINED = 0x13,
707 ARMV6MPCORE_PERFCTR_CPU_CYCLES = 0xFF,
708};
709
710/*
711 * The hardware events that we support. We do support cache operations but
712 * we have harvard caches and no way to combine instruction and data
713 * accesses/misses in hardware.
714 */
715static const unsigned armv6mpcore_perf_map[PERF_COUNT_HW_MAX] = {
716 [PERF_COUNT_HW_CPU_CYCLES] = ARMV6MPCORE_PERFCTR_CPU_CYCLES,
717 [PERF_COUNT_HW_INSTRUCTIONS] = ARMV6MPCORE_PERFCTR_INSTR_EXEC,
718 [PERF_COUNT_HW_CACHE_REFERENCES] = HW_OP_UNSUPPORTED,
719 [PERF_COUNT_HW_CACHE_MISSES] = HW_OP_UNSUPPORTED,
720 [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = ARMV6MPCORE_PERFCTR_BR_EXEC,
721 [PERF_COUNT_HW_BRANCH_MISSES] = ARMV6MPCORE_PERFCTR_BR_MISPREDICT,
722 [PERF_COUNT_HW_BUS_CYCLES] = HW_OP_UNSUPPORTED,
723};
724
725static const unsigned armv6mpcore_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
726 [PERF_COUNT_HW_CACHE_OP_MAX]
727 [PERF_COUNT_HW_CACHE_RESULT_MAX] = {
728 [C(L1D)] = {
729 [C(OP_READ)] = {
730 [C(RESULT_ACCESS)] =
731 ARMV6MPCORE_PERFCTR_DCACHE_RDACCESS,
732 [C(RESULT_MISS)] =
733 ARMV6MPCORE_PERFCTR_DCACHE_RDMISS,
734 },
735 [C(OP_WRITE)] = {
736 [C(RESULT_ACCESS)] =
737 ARMV6MPCORE_PERFCTR_DCACHE_WRACCESS,
738 [C(RESULT_MISS)] =
739 ARMV6MPCORE_PERFCTR_DCACHE_WRMISS,
740 },
741 [C(OP_PREFETCH)] = {
742 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
743 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
744 },
745 },
746 [C(L1I)] = {
747 [C(OP_READ)] = {
748 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
749 [C(RESULT_MISS)] = ARMV6MPCORE_PERFCTR_ICACHE_MISS,
750 },
751 [C(OP_WRITE)] = {
752 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
753 [C(RESULT_MISS)] = ARMV6MPCORE_PERFCTR_ICACHE_MISS,
754 },
755 [C(OP_PREFETCH)] = {
756 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
757 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
758 },
759 },
760 [C(LL)] = {
761 [C(OP_READ)] = {
762 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
763 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
764 },
765 [C(OP_WRITE)] = {
766 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
767 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
768 },
769 [C(OP_PREFETCH)] = {
770 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
771 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
772 },
773 },
774 [C(DTLB)] = {
775 /*
776 * The ARM performance counters can count micro DTLB misses,
777 * micro ITLB misses and main TLB misses. There isn't an event
778 * for TLB misses, so use the micro misses here and if users
779 * want the main TLB misses they can use a raw counter.
780 */
781 [C(OP_READ)] = {
782 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
783 [C(RESULT_MISS)] = ARMV6MPCORE_PERFCTR_DTLB_MISS,
784 },
785 [C(OP_WRITE)] = {
786 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
787 [C(RESULT_MISS)] = ARMV6MPCORE_PERFCTR_DTLB_MISS,
788 },
789 [C(OP_PREFETCH)] = {
790 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
791 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
792 },
793 },
794 [C(ITLB)] = {
795 [C(OP_READ)] = {
796 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
797 [C(RESULT_MISS)] = ARMV6MPCORE_PERFCTR_ITLB_MISS,
798 },
799 [C(OP_WRITE)] = {
800 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
801 [C(RESULT_MISS)] = ARMV6MPCORE_PERFCTR_ITLB_MISS,
802 },
803 [C(OP_PREFETCH)] = {
804 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
805 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
806 },
807 },
808 [C(BPU)] = {
809 [C(OP_READ)] = {
810 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
811 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
812 },
813 [C(OP_WRITE)] = {
814 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
815 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
816 },
817 [C(OP_PREFETCH)] = {
818 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
819 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
820 },
821 },
822};
823
824static inline unsigned long
825armv6_pmcr_read(void)
826{
827 u32 val;
828 asm volatile("mrc p15, 0, %0, c15, c12, 0" : "=r"(val));
829 return val;
830}
831
832static inline void
833armv6_pmcr_write(unsigned long val)
834{
835 asm volatile("mcr p15, 0, %0, c15, c12, 0" : : "r"(val));
836}
837
838#define ARMV6_PMCR_ENABLE (1 << 0)
839#define ARMV6_PMCR_CTR01_RESET (1 << 1)
840#define ARMV6_PMCR_CCOUNT_RESET (1 << 2)
841#define ARMV6_PMCR_CCOUNT_DIV (1 << 3)
842#define ARMV6_PMCR_COUNT0_IEN (1 << 4)
843#define ARMV6_PMCR_COUNT1_IEN (1 << 5)
844#define ARMV6_PMCR_CCOUNT_IEN (1 << 6)
845#define ARMV6_PMCR_COUNT0_OVERFLOW (1 << 8)
846#define ARMV6_PMCR_COUNT1_OVERFLOW (1 << 9)
847#define ARMV6_PMCR_CCOUNT_OVERFLOW (1 << 10)
848#define ARMV6_PMCR_EVT_COUNT0_SHIFT 20
849#define ARMV6_PMCR_EVT_COUNT0_MASK (0xFF << ARMV6_PMCR_EVT_COUNT0_SHIFT)
850#define ARMV6_PMCR_EVT_COUNT1_SHIFT 12
851#define ARMV6_PMCR_EVT_COUNT1_MASK (0xFF << ARMV6_PMCR_EVT_COUNT1_SHIFT)
852
853#define ARMV6_PMCR_OVERFLOWED_MASK \
854 (ARMV6_PMCR_COUNT0_OVERFLOW | ARMV6_PMCR_COUNT1_OVERFLOW | \
855 ARMV6_PMCR_CCOUNT_OVERFLOW)
856
857static inline int
858armv6_pmcr_has_overflowed(unsigned long pmcr)
859{
860 return (pmcr & ARMV6_PMCR_OVERFLOWED_MASK);
861}
862
863static inline int
864armv6_pmcr_counter_has_overflowed(unsigned long pmcr,
865 enum armv6_counters counter)
866{
867 int ret = 0;
868
869 if (ARMV6_CYCLE_COUNTER == counter)
870 ret = pmcr & ARMV6_PMCR_CCOUNT_OVERFLOW;
871 else if (ARMV6_COUNTER0 == counter)
872 ret = pmcr & ARMV6_PMCR_COUNT0_OVERFLOW;
873 else if (ARMV6_COUNTER1 == counter)
874 ret = pmcr & ARMV6_PMCR_COUNT1_OVERFLOW;
875 else
876 WARN_ONCE(1, "invalid counter number (%d)\n", counter);
877
878 return ret;
879}
880
881static inline u32
882armv6pmu_read_counter(int counter)
883{
884 unsigned long value = 0;
885
886 if (ARMV6_CYCLE_COUNTER == counter)
887 asm volatile("mrc p15, 0, %0, c15, c12, 1" : "=r"(value));
888 else if (ARMV6_COUNTER0 == counter)
889 asm volatile("mrc p15, 0, %0, c15, c12, 2" : "=r"(value));
890 else if (ARMV6_COUNTER1 == counter)
891 asm volatile("mrc p15, 0, %0, c15, c12, 3" : "=r"(value));
892 else
893 WARN_ONCE(1, "invalid counter number (%d)\n", counter);
894
895 return value;
896}
897
898static inline void
899armv6pmu_write_counter(int counter,
900 u32 value)
901{
902 if (ARMV6_CYCLE_COUNTER == counter)
903 asm volatile("mcr p15, 0, %0, c15, c12, 1" : : "r"(value));
904 else if (ARMV6_COUNTER0 == counter)
905 asm volatile("mcr p15, 0, %0, c15, c12, 2" : : "r"(value));
906 else if (ARMV6_COUNTER1 == counter)
907 asm volatile("mcr p15, 0, %0, c15, c12, 3" : : "r"(value));
908 else
909 WARN_ONCE(1, "invalid counter number (%d)\n", counter);
910}
911
912void
913armv6pmu_enable_event(struct hw_perf_event *hwc,
914 int idx)
915{
916 unsigned long val, mask, evt, flags;
917
918 if (ARMV6_CYCLE_COUNTER == idx) {
919 mask = 0;
920 evt = ARMV6_PMCR_CCOUNT_IEN;
921 } else if (ARMV6_COUNTER0 == idx) {
922 mask = ARMV6_PMCR_EVT_COUNT0_MASK;
923 evt = (hwc->config_base << ARMV6_PMCR_EVT_COUNT0_SHIFT) |
924 ARMV6_PMCR_COUNT0_IEN;
925 } else if (ARMV6_COUNTER1 == idx) {
926 mask = ARMV6_PMCR_EVT_COUNT1_MASK;
927 evt = (hwc->config_base << ARMV6_PMCR_EVT_COUNT1_SHIFT) |
928 ARMV6_PMCR_COUNT1_IEN;
929 } else {
930 WARN_ONCE(1, "invalid counter number (%d)\n", idx);
931 return;
932 }
933
934 /*
935 * Mask out the current event and set the counter to count the event
936 * that we're interested in.
937 */
938 spin_lock_irqsave(&pmu_lock, flags);
939 val = armv6_pmcr_read();
940 val &= ~mask;
941 val |= evt;
942 armv6_pmcr_write(val);
943 spin_unlock_irqrestore(&pmu_lock, flags);
944}
945
946static irqreturn_t
947armv6pmu_handle_irq(int irq_num,
948 void *dev)
949{
950 unsigned long pmcr = armv6_pmcr_read();
951 struct perf_sample_data data;
952 struct cpu_hw_events *cpuc;
953 struct pt_regs *regs;
954 int idx;
955
956 if (!armv6_pmcr_has_overflowed(pmcr))
957 return IRQ_NONE;
958
959 regs = get_irq_regs();
960
961 /*
962 * The interrupts are cleared by writing the overflow flags back to
963 * the control register. All of the other bits don't have any effect
964 * if they are rewritten, so write the whole value back.
965 */
966 armv6_pmcr_write(pmcr);
967
968 data.addr = 0;
969
970 cpuc = &__get_cpu_var(cpu_hw_events);
971 for (idx = 0; idx <= armpmu->num_events; ++idx) {
972 struct perf_event *event = cpuc->events[idx];
973 struct hw_perf_event *hwc;
974
975 if (!test_bit(idx, cpuc->active_mask))
976 continue;
977
978 /*
979 * We have a single interrupt for all counters. Check that
980 * each counter has overflowed before we process it.
981 */
982 if (!armv6_pmcr_counter_has_overflowed(pmcr, idx))
983 continue;
984
985 hwc = &event->hw;
986 armpmu_event_update(event, hwc, idx);
987 data.period = event->hw.last_period;
988 if (!armpmu_event_set_period(event, hwc, idx))
989 continue;
990
991 if (perf_event_overflow(event, 0, &data, regs))
992 armpmu->disable(hwc, idx);
993 }
994
995 /*
996 * Handle the pending perf events.
997 *
998 * Note: this call *must* be run with interrupts enabled. For
999 * platforms that can have the PMU interrupts raised as a PMI, this
1000 * will not work.
1001 */
1002 perf_event_do_pending();
1003
1004 return IRQ_HANDLED;
1005}
1006
1007static void
1008armv6pmu_start(void)
1009{
1010 unsigned long flags, val;
1011
1012 spin_lock_irqsave(&pmu_lock, flags);
1013 val = armv6_pmcr_read();
1014 val |= ARMV6_PMCR_ENABLE;
1015 armv6_pmcr_write(val);
1016 spin_unlock_irqrestore(&pmu_lock, flags);
1017}
1018
1019void
1020armv6pmu_stop(void)
1021{
1022 unsigned long flags, val;
1023
1024 spin_lock_irqsave(&pmu_lock, flags);
1025 val = armv6_pmcr_read();
1026 val &= ~ARMV6_PMCR_ENABLE;
1027 armv6_pmcr_write(val);
1028 spin_unlock_irqrestore(&pmu_lock, flags);
1029}
1030
1031static inline int
1032armv6pmu_event_map(int config)
1033{
1034 int mapping = armv6_perf_map[config];
1035 if (HW_OP_UNSUPPORTED == mapping)
1036 mapping = -EOPNOTSUPP;
1037 return mapping;
1038}
1039
1040static inline int
1041armv6mpcore_pmu_event_map(int config)
1042{
1043 int mapping = armv6mpcore_perf_map[config];
1044 if (HW_OP_UNSUPPORTED == mapping)
1045 mapping = -EOPNOTSUPP;
1046 return mapping;
1047}
1048
1049static u64
1050armv6pmu_raw_event(u64 config)
1051{
1052 return config & 0xff;
1053}
1054
1055static int
1056armv6pmu_get_event_idx(struct cpu_hw_events *cpuc,
1057 struct hw_perf_event *event)
1058{
1059 /* Always place a cycle counter into the cycle counter. */
1060 if (ARMV6_PERFCTR_CPU_CYCLES == event->config_base) {
1061 if (test_and_set_bit(ARMV6_CYCLE_COUNTER, cpuc->used_mask))
1062 return -EAGAIN;
1063
1064 return ARMV6_CYCLE_COUNTER;
1065 } else {
1066 /*
1067 * For anything other than a cycle counter, try and use
1068 * counter0 and counter1.
1069 */
1070 if (!test_and_set_bit(ARMV6_COUNTER1, cpuc->used_mask)) {
1071 return ARMV6_COUNTER1;
1072 }
1073
1074 if (!test_and_set_bit(ARMV6_COUNTER0, cpuc->used_mask)) {
1075 return ARMV6_COUNTER0;
1076 }
1077
1078 /* The counters are all in use. */
1079 return -EAGAIN;
1080 }
1081}
1082
1083static void
1084armv6pmu_disable_event(struct hw_perf_event *hwc,
1085 int idx)
1086{
1087 unsigned long val, mask, evt, flags;
1088
1089 if (ARMV6_CYCLE_COUNTER == idx) {
1090 mask = ARMV6_PMCR_CCOUNT_IEN;
1091 evt = 0;
1092 } else if (ARMV6_COUNTER0 == idx) {
1093 mask = ARMV6_PMCR_COUNT0_IEN | ARMV6_PMCR_EVT_COUNT0_MASK;
1094 evt = ARMV6_PERFCTR_NOP << ARMV6_PMCR_EVT_COUNT0_SHIFT;
1095 } else if (ARMV6_COUNTER1 == idx) {
1096 mask = ARMV6_PMCR_COUNT1_IEN | ARMV6_PMCR_EVT_COUNT1_MASK;
1097 evt = ARMV6_PERFCTR_NOP << ARMV6_PMCR_EVT_COUNT1_SHIFT;
1098 } else {
1099 WARN_ONCE(1, "invalid counter number (%d)\n", idx);
1100 return;
1101 }
1102
1103 /*
1104 * Mask out the current event and set the counter to count the number
1105 * of ETM bus signal assertion cycles. The external reporting should
1106 * be disabled and so this should never increment.
1107 */
1108 spin_lock_irqsave(&pmu_lock, flags);
1109 val = armv6_pmcr_read();
1110 val &= ~mask;
1111 val |= evt;
1112 armv6_pmcr_write(val);
1113 spin_unlock_irqrestore(&pmu_lock, flags);
1114}
1115
1116static void
1117armv6mpcore_pmu_disable_event(struct hw_perf_event *hwc,
1118 int idx)
1119{
1120 unsigned long val, mask, flags, evt = 0;
1121
1122 if (ARMV6_CYCLE_COUNTER == idx) {
1123 mask = ARMV6_PMCR_CCOUNT_IEN;
1124 } else if (ARMV6_COUNTER0 == idx) {
1125 mask = ARMV6_PMCR_COUNT0_IEN;
1126 } else if (ARMV6_COUNTER1 == idx) {
1127 mask = ARMV6_PMCR_COUNT1_IEN;
1128 } else {
1129 WARN_ONCE(1, "invalid counter number (%d)\n", idx);
1130 return;
1131 }
1132
1133 /*
1134 * Unlike UP ARMv6, we don't have a way of stopping the counters. We
1135 * simply disable the interrupt reporting.
1136 */
1137 spin_lock_irqsave(&pmu_lock, flags);
1138 val = armv6_pmcr_read();
1139 val &= ~mask;
1140 val |= evt;
1141 armv6_pmcr_write(val);
1142 spin_unlock_irqrestore(&pmu_lock, flags);
1143}
1144
1145static const struct arm_pmu armv6pmu = {
1146 .name = "v6",
1147 .handle_irq = armv6pmu_handle_irq,
1148 .enable = armv6pmu_enable_event,
1149 .disable = armv6pmu_disable_event,
1150 .event_map = armv6pmu_event_map,
1151 .raw_event = armv6pmu_raw_event,
1152 .read_counter = armv6pmu_read_counter,
1153 .write_counter = armv6pmu_write_counter,
1154 .get_event_idx = armv6pmu_get_event_idx,
1155 .start = armv6pmu_start,
1156 .stop = armv6pmu_stop,
1157 .num_events = 3,
1158 .max_period = (1LLU << 32) - 1,
1159};
1160
1161/*
1162 * ARMv6mpcore is almost identical to single core ARMv6 with the exception
1163 * that some of the events have different enumerations and that there is no
1164 * *hack* to stop the programmable counters. To stop the counters we simply
1165 * disable the interrupt reporting and update the event. When unthrottling we
1166 * reset the period and enable the interrupt reporting.
1167 */
1168static const struct arm_pmu armv6mpcore_pmu = {
1169 .name = "v6mpcore",
1170 .handle_irq = armv6pmu_handle_irq,
1171 .enable = armv6pmu_enable_event,
1172 .disable = armv6mpcore_pmu_disable_event,
1173 .event_map = armv6mpcore_pmu_event_map,
1174 .raw_event = armv6pmu_raw_event,
1175 .read_counter = armv6pmu_read_counter,
1176 .write_counter = armv6pmu_write_counter,
1177 .get_event_idx = armv6pmu_get_event_idx,
1178 .start = armv6pmu_start,
1179 .stop = armv6pmu_stop,
1180 .num_events = 3,
1181 .max_period = (1LLU << 32) - 1,
1182};
1183
1184/*
1185 * ARMv7 Cortex-A8 and Cortex-A9 Performance Events handling code.
1186 *
1187 * Copied from ARMv6 code, with the low level code inspired
1188 * by the ARMv7 Oprofile code.
1189 *
1190 * Cortex-A8 has up to 4 configurable performance counters and
1191 * a single cycle counter.
1192 * Cortex-A9 has up to 31 configurable performance counters and
1193 * a single cycle counter.
1194 *
1195 * All counters can be enabled/disabled and IRQ masked separately. The cycle
1196 * counter and all 4 performance counters together can be reset separately.
1197 */
1198
1199#define ARMV7_PMU_CORTEX_A8_NAME "ARMv7 Cortex-A8"
1200
1201#define ARMV7_PMU_CORTEX_A9_NAME "ARMv7 Cortex-A9"
1202
1203/* Common ARMv7 event types */
1204enum armv7_perf_types {
1205 ARMV7_PERFCTR_PMNC_SW_INCR = 0x00,
1206 ARMV7_PERFCTR_IFETCH_MISS = 0x01,
1207 ARMV7_PERFCTR_ITLB_MISS = 0x02,
1208 ARMV7_PERFCTR_DCACHE_REFILL = 0x03,
1209 ARMV7_PERFCTR_DCACHE_ACCESS = 0x04,
1210 ARMV7_PERFCTR_DTLB_REFILL = 0x05,
1211 ARMV7_PERFCTR_DREAD = 0x06,
1212 ARMV7_PERFCTR_DWRITE = 0x07,
1213
1214 ARMV7_PERFCTR_EXC_TAKEN = 0x09,
1215 ARMV7_PERFCTR_EXC_EXECUTED = 0x0A,
1216 ARMV7_PERFCTR_CID_WRITE = 0x0B,
1217 /* ARMV7_PERFCTR_PC_WRITE is equivalent to HW_BRANCH_INSTRUCTIONS.
1218 * It counts:
1219 * - all branch instructions,
1220 * - instructions that explicitly write the PC,
1221 * - exception generating instructions.
1222 */
1223 ARMV7_PERFCTR_PC_WRITE = 0x0C,
1224 ARMV7_PERFCTR_PC_IMM_BRANCH = 0x0D,
1225 ARMV7_PERFCTR_UNALIGNED_ACCESS = 0x0F,
1226 ARMV7_PERFCTR_PC_BRANCH_MIS_PRED = 0x10,
1227 ARMV7_PERFCTR_CLOCK_CYCLES = 0x11,
1228
1229 ARMV7_PERFCTR_PC_BRANCH_MIS_USED = 0x12,
1230
1231 ARMV7_PERFCTR_CPU_CYCLES = 0xFF
1232};
1233
1234/* ARMv7 Cortex-A8 specific event types */
1235enum armv7_a8_perf_types {
1236 ARMV7_PERFCTR_INSTR_EXECUTED = 0x08,
1237
1238 ARMV7_PERFCTR_PC_PROC_RETURN = 0x0E,
1239
1240 ARMV7_PERFCTR_WRITE_BUFFER_FULL = 0x40,
1241 ARMV7_PERFCTR_L2_STORE_MERGED = 0x41,
1242 ARMV7_PERFCTR_L2_STORE_BUFF = 0x42,
1243 ARMV7_PERFCTR_L2_ACCESS = 0x43,
1244 ARMV7_PERFCTR_L2_CACH_MISS = 0x44,
1245 ARMV7_PERFCTR_AXI_READ_CYCLES = 0x45,
1246 ARMV7_PERFCTR_AXI_WRITE_CYCLES = 0x46,
1247 ARMV7_PERFCTR_MEMORY_REPLAY = 0x47,
1248 ARMV7_PERFCTR_UNALIGNED_ACCESS_REPLAY = 0x48,
1249 ARMV7_PERFCTR_L1_DATA_MISS = 0x49,
1250 ARMV7_PERFCTR_L1_INST_MISS = 0x4A,
1251 ARMV7_PERFCTR_L1_DATA_COLORING = 0x4B,
1252 ARMV7_PERFCTR_L1_NEON_DATA = 0x4C,
1253 ARMV7_PERFCTR_L1_NEON_CACH_DATA = 0x4D,
1254 ARMV7_PERFCTR_L2_NEON = 0x4E,
1255 ARMV7_PERFCTR_L2_NEON_HIT = 0x4F,
1256 ARMV7_PERFCTR_L1_INST = 0x50,
1257 ARMV7_PERFCTR_PC_RETURN_MIS_PRED = 0x51,
1258 ARMV7_PERFCTR_PC_BRANCH_FAILED = 0x52,
1259 ARMV7_PERFCTR_PC_BRANCH_TAKEN = 0x53,
1260 ARMV7_PERFCTR_PC_BRANCH_EXECUTED = 0x54,
1261 ARMV7_PERFCTR_OP_EXECUTED = 0x55,
1262 ARMV7_PERFCTR_CYCLES_INST_STALL = 0x56,
1263 ARMV7_PERFCTR_CYCLES_INST = 0x57,
1264 ARMV7_PERFCTR_CYCLES_NEON_DATA_STALL = 0x58,
1265 ARMV7_PERFCTR_CYCLES_NEON_INST_STALL = 0x59,
1266 ARMV7_PERFCTR_NEON_CYCLES = 0x5A,
1267
1268 ARMV7_PERFCTR_PMU0_EVENTS = 0x70,
1269 ARMV7_PERFCTR_PMU1_EVENTS = 0x71,
1270 ARMV7_PERFCTR_PMU_EVENTS = 0x72,
1271};
1272
1273/* ARMv7 Cortex-A9 specific event types */
1274enum armv7_a9_perf_types {
1275 ARMV7_PERFCTR_JAVA_HW_BYTECODE_EXEC = 0x40,
1276 ARMV7_PERFCTR_JAVA_SW_BYTECODE_EXEC = 0x41,
1277 ARMV7_PERFCTR_JAZELLE_BRANCH_EXEC = 0x42,
1278
1279 ARMV7_PERFCTR_COHERENT_LINE_MISS = 0x50,
1280 ARMV7_PERFCTR_COHERENT_LINE_HIT = 0x51,
1281
1282 ARMV7_PERFCTR_ICACHE_DEP_STALL_CYCLES = 0x60,
1283 ARMV7_PERFCTR_DCACHE_DEP_STALL_CYCLES = 0x61,
1284 ARMV7_PERFCTR_TLB_MISS_DEP_STALL_CYCLES = 0x62,
1285 ARMV7_PERFCTR_STREX_EXECUTED_PASSED = 0x63,
1286 ARMV7_PERFCTR_STREX_EXECUTED_FAILED = 0x64,
1287 ARMV7_PERFCTR_DATA_EVICTION = 0x65,
1288 ARMV7_PERFCTR_ISSUE_STAGE_NO_INST = 0x66,
1289 ARMV7_PERFCTR_ISSUE_STAGE_EMPTY = 0x67,
1290 ARMV7_PERFCTR_INST_OUT_OF_RENAME_STAGE = 0x68,
1291
1292 ARMV7_PERFCTR_PREDICTABLE_FUNCT_RETURNS = 0x6E,
1293
1294 ARMV7_PERFCTR_MAIN_UNIT_EXECUTED_INST = 0x70,
1295 ARMV7_PERFCTR_SECOND_UNIT_EXECUTED_INST = 0x71,
1296 ARMV7_PERFCTR_LD_ST_UNIT_EXECUTED_INST = 0x72,
1297 ARMV7_PERFCTR_FP_EXECUTED_INST = 0x73,
1298 ARMV7_PERFCTR_NEON_EXECUTED_INST = 0x74,
1299
1300 ARMV7_PERFCTR_PLD_FULL_DEP_STALL_CYCLES = 0x80,
1301 ARMV7_PERFCTR_DATA_WR_DEP_STALL_CYCLES = 0x81,
1302 ARMV7_PERFCTR_ITLB_MISS_DEP_STALL_CYCLES = 0x82,
1303 ARMV7_PERFCTR_DTLB_MISS_DEP_STALL_CYCLES = 0x83,
1304 ARMV7_PERFCTR_MICRO_ITLB_MISS_DEP_STALL_CYCLES = 0x84,
1305 ARMV7_PERFCTR_MICRO_DTLB_MISS_DEP_STALL_CYCLES = 0x85,
1306 ARMV7_PERFCTR_DMB_DEP_STALL_CYCLES = 0x86,
1307
1308 ARMV7_PERFCTR_INTGR_CLK_ENABLED_CYCLES = 0x8A,
1309 ARMV7_PERFCTR_DATA_ENGINE_CLK_EN_CYCLES = 0x8B,
1310
1311 ARMV7_PERFCTR_ISB_INST = 0x90,
1312 ARMV7_PERFCTR_DSB_INST = 0x91,
1313 ARMV7_PERFCTR_DMB_INST = 0x92,
1314 ARMV7_PERFCTR_EXT_INTERRUPTS = 0x93,
1315
1316 ARMV7_PERFCTR_PLE_CACHE_LINE_RQST_COMPLETED = 0xA0,
1317 ARMV7_PERFCTR_PLE_CACHE_LINE_RQST_SKIPPED = 0xA1,
1318 ARMV7_PERFCTR_PLE_FIFO_FLUSH = 0xA2,
1319 ARMV7_PERFCTR_PLE_RQST_COMPLETED = 0xA3,
1320 ARMV7_PERFCTR_PLE_FIFO_OVERFLOW = 0xA4,
1321 ARMV7_PERFCTR_PLE_RQST_PROG = 0xA5
1322};
1323
1324/*
1325 * Cortex-A8 HW events mapping
1326 *
1327 * The hardware events that we support. We do support cache operations but
1328 * we have harvard caches and no way to combine instruction and data
1329 * accesses/misses in hardware.
1330 */
1331static const unsigned armv7_a8_perf_map[PERF_COUNT_HW_MAX] = {
1332 [PERF_COUNT_HW_CPU_CYCLES] = ARMV7_PERFCTR_CPU_CYCLES,
1333 [PERF_COUNT_HW_INSTRUCTIONS] = ARMV7_PERFCTR_INSTR_EXECUTED,
1334 [PERF_COUNT_HW_CACHE_REFERENCES] = HW_OP_UNSUPPORTED,
1335 [PERF_COUNT_HW_CACHE_MISSES] = HW_OP_UNSUPPORTED,
1336 [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = ARMV7_PERFCTR_PC_WRITE,
1337 [PERF_COUNT_HW_BRANCH_MISSES] = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
1338 [PERF_COUNT_HW_BUS_CYCLES] = ARMV7_PERFCTR_CLOCK_CYCLES,
1339};
1340
1341static const unsigned armv7_a8_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
1342 [PERF_COUNT_HW_CACHE_OP_MAX]
1343 [PERF_COUNT_HW_CACHE_RESULT_MAX] = {
1344 [C(L1D)] = {
1345 /*
1346 * The performance counters don't differentiate between read
1347 * and write accesses/misses so this isn't strictly correct,
1348 * but it's the best we can do. Writes and reads get
1349 * combined.
1350 */
1351 [C(OP_READ)] = {
1352 [C(RESULT_ACCESS)] = ARMV7_PERFCTR_DCACHE_ACCESS,
1353 [C(RESULT_MISS)] = ARMV7_PERFCTR_DCACHE_REFILL,
1354 },
1355 [C(OP_WRITE)] = {
1356 [C(RESULT_ACCESS)] = ARMV7_PERFCTR_DCACHE_ACCESS,
1357 [C(RESULT_MISS)] = ARMV7_PERFCTR_DCACHE_REFILL,
1358 },
1359 [C(OP_PREFETCH)] = {
1360 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
1361 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
1362 },
1363 },
1364 [C(L1I)] = {
1365 [C(OP_READ)] = {
1366 [C(RESULT_ACCESS)] = ARMV7_PERFCTR_L1_INST,
1367 [C(RESULT_MISS)] = ARMV7_PERFCTR_L1_INST_MISS,
1368 },
1369 [C(OP_WRITE)] = {
1370 [C(RESULT_ACCESS)] = ARMV7_PERFCTR_L1_INST,
1371 [C(RESULT_MISS)] = ARMV7_PERFCTR_L1_INST_MISS,
1372 },
1373 [C(OP_PREFETCH)] = {
1374 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
1375 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
1376 },
1377 },
1378 [C(LL)] = {
1379 [C(OP_READ)] = {
1380 [C(RESULT_ACCESS)] = ARMV7_PERFCTR_L2_ACCESS,
1381 [C(RESULT_MISS)] = ARMV7_PERFCTR_L2_CACH_MISS,
1382 },
1383 [C(OP_WRITE)] = {
1384 [C(RESULT_ACCESS)] = ARMV7_PERFCTR_L2_ACCESS,
1385 [C(RESULT_MISS)] = ARMV7_PERFCTR_L2_CACH_MISS,
1386 },
1387 [C(OP_PREFETCH)] = {
1388 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
1389 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
1390 },
1391 },
1392 [C(DTLB)] = {
1393 /*
1394 * Only ITLB misses and DTLB refills are supported.
1395 * If users want the DTLB refills misses a raw counter
1396 * must be used.
1397 */
1398 [C(OP_READ)] = {
1399 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
1400 [C(RESULT_MISS)] = ARMV7_PERFCTR_DTLB_REFILL,
1401 },
1402 [C(OP_WRITE)] = {
1403 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
1404 [C(RESULT_MISS)] = ARMV7_PERFCTR_DTLB_REFILL,
1405 },
1406 [C(OP_PREFETCH)] = {
1407 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
1408 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
1409 },
1410 },
1411 [C(ITLB)] = {
1412 [C(OP_READ)] = {
1413 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
1414 [C(RESULT_MISS)] = ARMV7_PERFCTR_ITLB_MISS,
1415 },
1416 [C(OP_WRITE)] = {
1417 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
1418 [C(RESULT_MISS)] = ARMV7_PERFCTR_ITLB_MISS,
1419 },
1420 [C(OP_PREFETCH)] = {
1421 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
1422 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
1423 },
1424 },
1425 [C(BPU)] = {
1426 [C(OP_READ)] = {
1427 [C(RESULT_ACCESS)] = ARMV7_PERFCTR_PC_WRITE,
1428 [C(RESULT_MISS)]
1429 = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
1430 },
1431 [C(OP_WRITE)] = {
1432 [C(RESULT_ACCESS)] = ARMV7_PERFCTR_PC_WRITE,
1433 [C(RESULT_MISS)]
1434 = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
1435 },
1436 [C(OP_PREFETCH)] = {
1437 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
1438 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
1439 },
1440 },
1441};
1442
1443/*
1444 * Cortex-A9 HW events mapping
1445 */
1446static const unsigned armv7_a9_perf_map[PERF_COUNT_HW_MAX] = {
1447 [PERF_COUNT_HW_CPU_CYCLES] = ARMV7_PERFCTR_CPU_CYCLES,
1448 [PERF_COUNT_HW_INSTRUCTIONS] =
1449 ARMV7_PERFCTR_INST_OUT_OF_RENAME_STAGE,
1450 [PERF_COUNT_HW_CACHE_REFERENCES] = ARMV7_PERFCTR_COHERENT_LINE_HIT,
1451 [PERF_COUNT_HW_CACHE_MISSES] = ARMV7_PERFCTR_COHERENT_LINE_MISS,
1452 [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = ARMV7_PERFCTR_PC_WRITE,
1453 [PERF_COUNT_HW_BRANCH_MISSES] = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
1454 [PERF_COUNT_HW_BUS_CYCLES] = ARMV7_PERFCTR_CLOCK_CYCLES,
1455};
1456
1457static const unsigned armv7_a9_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
1458 [PERF_COUNT_HW_CACHE_OP_MAX]
1459 [PERF_COUNT_HW_CACHE_RESULT_MAX] = {
1460 [C(L1D)] = {
1461 /*
1462 * The performance counters don't differentiate between read
1463 * and write accesses/misses so this isn't strictly correct,
1464 * but it's the best we can do. Writes and reads get
1465 * combined.
1466 */
1467 [C(OP_READ)] = {
1468 [C(RESULT_ACCESS)] = ARMV7_PERFCTR_DCACHE_ACCESS,
1469 [C(RESULT_MISS)] = ARMV7_PERFCTR_DCACHE_REFILL,
1470 },
1471 [C(OP_WRITE)] = {
1472 [C(RESULT_ACCESS)] = ARMV7_PERFCTR_DCACHE_ACCESS,
1473 [C(RESULT_MISS)] = ARMV7_PERFCTR_DCACHE_REFILL,
1474 },
1475 [C(OP_PREFETCH)] = {
1476 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
1477 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
1478 },
1479 },
1480 [C(L1I)] = {
1481 [C(OP_READ)] = {
1482 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
1483 [C(RESULT_MISS)] = ARMV7_PERFCTR_IFETCH_MISS,
1484 },
1485 [C(OP_WRITE)] = {
1486 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
1487 [C(RESULT_MISS)] = ARMV7_PERFCTR_IFETCH_MISS,
1488 },
1489 [C(OP_PREFETCH)] = {
1490 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
1491 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
1492 },
1493 },
1494 [C(LL)] = {
1495 [C(OP_READ)] = {
1496 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
1497 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
1498 },
1499 [C(OP_WRITE)] = {
1500 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
1501 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
1502 },
1503 [C(OP_PREFETCH)] = {
1504 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
1505 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
1506 },
1507 },
1508 [C(DTLB)] = {
1509 /*
1510 * Only ITLB misses and DTLB refills are supported.
1511 * If users want the DTLB refills misses a raw counter
1512 * must be used.
1513 */
1514 [C(OP_READ)] = {
1515 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
1516 [C(RESULT_MISS)] = ARMV7_PERFCTR_DTLB_REFILL,
1517 },
1518 [C(OP_WRITE)] = {
1519 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
1520 [C(RESULT_MISS)] = ARMV7_PERFCTR_DTLB_REFILL,
1521 },
1522 [C(OP_PREFETCH)] = {
1523 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
1524 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
1525 },
1526 },
1527 [C(ITLB)] = {
1528 [C(OP_READ)] = {
1529 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
1530 [C(RESULT_MISS)] = ARMV7_PERFCTR_ITLB_MISS,
1531 },
1532 [C(OP_WRITE)] = {
1533 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
1534 [C(RESULT_MISS)] = ARMV7_PERFCTR_ITLB_MISS,
1535 },
1536 [C(OP_PREFETCH)] = {
1537 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
1538 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
1539 },
1540 },
1541 [C(BPU)] = {
1542 [C(OP_READ)] = {
1543 [C(RESULT_ACCESS)] = ARMV7_PERFCTR_PC_WRITE,
1544 [C(RESULT_MISS)]
1545 = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
1546 },
1547 [C(OP_WRITE)] = {
1548 [C(RESULT_ACCESS)] = ARMV7_PERFCTR_PC_WRITE,
1549 [C(RESULT_MISS)]
1550 = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
1551 },
1552 [C(OP_PREFETCH)] = {
1553 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
1554 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
1555 },
1556 },
1557};
1558
1559/*
1560 * Perf Events counters
1561 */
1562enum armv7_counters {
1563 ARMV7_CYCLE_COUNTER = 1, /* Cycle counter */
1564 ARMV7_COUNTER0 = 2, /* First event counter */
1565};
1566
1567/*
1568 * The cycle counter is ARMV7_CYCLE_COUNTER.
1569 * The first event counter is ARMV7_COUNTER0.
1570 * The last event counter is (ARMV7_COUNTER0 + armpmu->num_events - 1).
1571 */
1572#define ARMV7_COUNTER_LAST (ARMV7_COUNTER0 + armpmu->num_events - 1)
1573
1574/*
1575 * ARMv7 low level PMNC access
1576 */
1577
1578/*
1579 * Per-CPU PMNC: config reg
1580 */
1581#define ARMV7_PMNC_E (1 << 0) /* Enable all counters */
1582#define ARMV7_PMNC_P (1 << 1) /* Reset all counters */
1583#define ARMV7_PMNC_C (1 << 2) /* Cycle counter reset */
1584#define ARMV7_PMNC_D (1 << 3) /* CCNT counts every 64th cpu cycle */
1585#define ARMV7_PMNC_X (1 << 4) /* Export to ETM */
1586#define ARMV7_PMNC_DP (1 << 5) /* Disable CCNT if non-invasive debug*/
1587#define ARMV7_PMNC_N_SHIFT 11 /* Number of counters supported */
1588#define ARMV7_PMNC_N_MASK 0x1f
1589#define ARMV7_PMNC_MASK 0x3f /* Mask for writable bits */
1590
1591/*
1592 * Available counters
1593 */
1594#define ARMV7_CNT0 0 /* First event counter */
1595#define ARMV7_CCNT 31 /* Cycle counter */
1596
1597/* Perf Event to low level counters mapping */
1598#define ARMV7_EVENT_CNT_TO_CNTx (ARMV7_COUNTER0 - ARMV7_CNT0)
1599
1600/*
1601 * CNTENS: counters enable reg
1602 */
1603#define ARMV7_CNTENS_P(idx) (1 << (idx - ARMV7_EVENT_CNT_TO_CNTx))
1604#define ARMV7_CNTENS_C (1 << ARMV7_CCNT)
1605
1606/*
1607 * CNTENC: counters disable reg
1608 */
1609#define ARMV7_CNTENC_P(idx) (1 << (idx - ARMV7_EVENT_CNT_TO_CNTx))
1610#define ARMV7_CNTENC_C (1 << ARMV7_CCNT)
1611
1612/*
1613 * INTENS: counters overflow interrupt enable reg
1614 */
1615#define ARMV7_INTENS_P(idx) (1 << (idx - ARMV7_EVENT_CNT_TO_CNTx))
1616#define ARMV7_INTENS_C (1 << ARMV7_CCNT)
1617
1618/*
1619 * INTENC: counters overflow interrupt disable reg
1620 */
1621#define ARMV7_INTENC_P(idx) (1 << (idx - ARMV7_EVENT_CNT_TO_CNTx))
1622#define ARMV7_INTENC_C (1 << ARMV7_CCNT)
1623
1624/*
1625 * EVTSEL: Event selection reg
1626 */
1627#define ARMV7_EVTSEL_MASK 0x7f /* Mask for writable bits */
1628
1629/*
1630 * SELECT: Counter selection reg
1631 */
1632#define ARMV7_SELECT_MASK 0x1f /* Mask for writable bits */
1633
1634/*
1635 * FLAG: counters overflow flag status reg
1636 */
1637#define ARMV7_FLAG_P(idx) (1 << (idx - ARMV7_EVENT_CNT_TO_CNTx))
1638#define ARMV7_FLAG_C (1 << ARMV7_CCNT)
1639#define ARMV7_FLAG_MASK 0xffffffff /* Mask for writable bits */
1640#define ARMV7_OVERFLOWED_MASK ARMV7_FLAG_MASK
1641
1642static inline unsigned long armv7_pmnc_read(void)
1643{
1644 u32 val;
1645 asm volatile("mrc p15, 0, %0, c9, c12, 0" : "=r"(val));
1646 return val;
1647}
1648
1649static inline void armv7_pmnc_write(unsigned long val)
1650{
1651 val &= ARMV7_PMNC_MASK;
1652 asm volatile("mcr p15, 0, %0, c9, c12, 0" : : "r"(val));
1653}
1654
1655static inline int armv7_pmnc_has_overflowed(unsigned long pmnc)
1656{
1657 return pmnc & ARMV7_OVERFLOWED_MASK;
1658}
1659
1660static inline int armv7_pmnc_counter_has_overflowed(unsigned long pmnc,
1661 enum armv7_counters counter)
1662{
1663 int ret;
1664
1665 if (counter == ARMV7_CYCLE_COUNTER)
1666 ret = pmnc & ARMV7_FLAG_C;
1667 else if ((counter >= ARMV7_COUNTER0) && (counter <= ARMV7_COUNTER_LAST))
1668 ret = pmnc & ARMV7_FLAG_P(counter);
1669 else
1670 pr_err("CPU%u checking wrong counter %d overflow status\n",
1671 smp_processor_id(), counter);
1672
1673 return ret;
1674}
1675
1676static inline int armv7_pmnc_select_counter(unsigned int idx)
1677{
1678 u32 val;
1679
1680 if ((idx < ARMV7_COUNTER0) || (idx > ARMV7_COUNTER_LAST)) {
1681 pr_err("CPU%u selecting wrong PMNC counter"
1682 " %d\n", smp_processor_id(), idx);
1683 return -1;
1684 }
1685
1686 val = (idx - ARMV7_EVENT_CNT_TO_CNTx) & ARMV7_SELECT_MASK;
1687 asm volatile("mcr p15, 0, %0, c9, c12, 5" : : "r" (val));
1688
1689 return idx;
1690}
1691
1692static inline u32 armv7pmu_read_counter(int idx)
1693{
1694 unsigned long value = 0;
1695
1696 if (idx == ARMV7_CYCLE_COUNTER)
1697 asm volatile("mrc p15, 0, %0, c9, c13, 0" : "=r" (value));
1698 else if ((idx >= ARMV7_COUNTER0) && (idx <= ARMV7_COUNTER_LAST)) {
1699 if (armv7_pmnc_select_counter(idx) == idx)
1700 asm volatile("mrc p15, 0, %0, c9, c13, 2"
1701 : "=r" (value));
1702 } else
1703 pr_err("CPU%u reading wrong counter %d\n",
1704 smp_processor_id(), idx);
1705
1706 return value;
1707}
1708
1709static inline void armv7pmu_write_counter(int idx, u32 value)
1710{
1711 if (idx == ARMV7_CYCLE_COUNTER)
1712 asm volatile("mcr p15, 0, %0, c9, c13, 0" : : "r" (value));
1713 else if ((idx >= ARMV7_COUNTER0) && (idx <= ARMV7_COUNTER_LAST)) {
1714 if (armv7_pmnc_select_counter(idx) == idx)
1715 asm volatile("mcr p15, 0, %0, c9, c13, 2"
1716 : : "r" (value));
1717 } else
1718 pr_err("CPU%u writing wrong counter %d\n",
1719 smp_processor_id(), idx);
1720}
1721
1722static inline void armv7_pmnc_write_evtsel(unsigned int idx, u32 val)
1723{
1724 if (armv7_pmnc_select_counter(idx) == idx) {
1725 val &= ARMV7_EVTSEL_MASK;
1726 asm volatile("mcr p15, 0, %0, c9, c13, 1" : : "r" (val));
1727 }
1728}
1729
1730static inline u32 armv7_pmnc_enable_counter(unsigned int idx)
1731{
1732 u32 val;
1733
1734 if ((idx != ARMV7_CYCLE_COUNTER) &&
1735 ((idx < ARMV7_COUNTER0) || (idx > ARMV7_COUNTER_LAST))) {
1736 pr_err("CPU%u enabling wrong PMNC counter"
1737 " %d\n", smp_processor_id(), idx);
1738 return -1;
1739 }
1740
1741 if (idx == ARMV7_CYCLE_COUNTER)
1742 val = ARMV7_CNTENS_C;
1743 else
1744 val = ARMV7_CNTENS_P(idx);
1745
1746 asm volatile("mcr p15, 0, %0, c9, c12, 1" : : "r" (val));
1747
1748 return idx;
1749}
1750
1751static inline u32 armv7_pmnc_disable_counter(unsigned int idx)
1752{
1753 u32 val;
1754
1755
1756 if ((idx != ARMV7_CYCLE_COUNTER) &&
1757 ((idx < ARMV7_COUNTER0) || (idx > ARMV7_COUNTER_LAST))) {
1758 pr_err("CPU%u disabling wrong PMNC counter"
1759 " %d\n", smp_processor_id(), idx);
1760 return -1;
1761 }
1762
1763 if (idx == ARMV7_CYCLE_COUNTER)
1764 val = ARMV7_CNTENC_C;
1765 else
1766 val = ARMV7_CNTENC_P(idx);
1767
1768 asm volatile("mcr p15, 0, %0, c9, c12, 2" : : "r" (val));
1769
1770 return idx;
1771}
1772
1773static inline u32 armv7_pmnc_enable_intens(unsigned int idx)
1774{
1775 u32 val;
1776
1777 if ((idx != ARMV7_CYCLE_COUNTER) &&
1778 ((idx < ARMV7_COUNTER0) || (idx > ARMV7_COUNTER_LAST))) {
1779 pr_err("CPU%u enabling wrong PMNC counter"
1780 " interrupt enable %d\n", smp_processor_id(), idx);
1781 return -1;
1782 }
1783
1784 if (idx == ARMV7_CYCLE_COUNTER)
1785 val = ARMV7_INTENS_C;
1786 else
1787 val = ARMV7_INTENS_P(idx);
1788
1789 asm volatile("mcr p15, 0, %0, c9, c14, 1" : : "r" (val));
1790
1791 return idx;
1792}
1793
1794static inline u32 armv7_pmnc_disable_intens(unsigned int idx)
1795{
1796 u32 val;
1797
1798 if ((idx != ARMV7_CYCLE_COUNTER) &&
1799 ((idx < ARMV7_COUNTER0) || (idx > ARMV7_COUNTER_LAST))) {
1800 pr_err("CPU%u disabling wrong PMNC counter"
1801 " interrupt enable %d\n", smp_processor_id(), idx);
1802 return -1;
1803 }
1804
1805 if (idx == ARMV7_CYCLE_COUNTER)
1806 val = ARMV7_INTENC_C;
1807 else
1808 val = ARMV7_INTENC_P(idx);
1809
1810 asm volatile("mcr p15, 0, %0, c9, c14, 2" : : "r" (val));
1811
1812 return idx;
1813}
1814
1815static inline u32 armv7_pmnc_getreset_flags(void)
1816{
1817 u32 val;
1818
1819 /* Read */
1820 asm volatile("mrc p15, 0, %0, c9, c12, 3" : "=r" (val));
1821
1822 /* Write to clear flags */
1823 val &= ARMV7_FLAG_MASK;
1824 asm volatile("mcr p15, 0, %0, c9, c12, 3" : : "r" (val));
1825
1826 return val;
1827}
1828
1829#ifdef DEBUG
1830static void armv7_pmnc_dump_regs(void)
1831{
1832 u32 val;
1833 unsigned int cnt;
1834
1835 printk(KERN_INFO "PMNC registers dump:\n");
1836
1837 asm volatile("mrc p15, 0, %0, c9, c12, 0" : "=r" (val));
1838 printk(KERN_INFO "PMNC =0x%08x\n", val);
1839
1840 asm volatile("mrc p15, 0, %0, c9, c12, 1" : "=r" (val));
1841 printk(KERN_INFO "CNTENS=0x%08x\n", val);
1842
1843 asm volatile("mrc p15, 0, %0, c9, c14, 1" : "=r" (val));
1844 printk(KERN_INFO "INTENS=0x%08x\n", val);
1845
1846 asm volatile("mrc p15, 0, %0, c9, c12, 3" : "=r" (val));
1847 printk(KERN_INFO "FLAGS =0x%08x\n", val);
1848
1849 asm volatile("mrc p15, 0, %0, c9, c12, 5" : "=r" (val));
1850 printk(KERN_INFO "SELECT=0x%08x\n", val);
1851
1852 asm volatile("mrc p15, 0, %0, c9, c13, 0" : "=r" (val));
1853 printk(KERN_INFO "CCNT =0x%08x\n", val);
1854
1855 for (cnt = ARMV7_COUNTER0; cnt < ARMV7_COUNTER_LAST; cnt++) {
1856 armv7_pmnc_select_counter(cnt);
1857 asm volatile("mrc p15, 0, %0, c9, c13, 2" : "=r" (val));
1858 printk(KERN_INFO "CNT[%d] count =0x%08x\n",
1859 cnt-ARMV7_EVENT_CNT_TO_CNTx, val);
1860 asm volatile("mrc p15, 0, %0, c9, c13, 1" : "=r" (val));
1861 printk(KERN_INFO "CNT[%d] evtsel=0x%08x\n",
1862 cnt-ARMV7_EVENT_CNT_TO_CNTx, val);
1863 }
1864}
1865#endif
1866
1867void armv7pmu_enable_event(struct hw_perf_event *hwc, int idx)
1868{
1869 unsigned long flags;
1870
1871 /*
1872 * Enable counter and interrupt, and set the counter to count
1873 * the event that we're interested in.
1874 */
1875 spin_lock_irqsave(&pmu_lock, flags);
1876
1877 /*
1878 * Disable counter
1879 */
1880 armv7_pmnc_disable_counter(idx);
1881
1882 /*
1883 * Set event (if destined for PMNx counters)
1884 * We don't need to set the event if it's a cycle count
1885 */
1886 if (idx != ARMV7_CYCLE_COUNTER)
1887 armv7_pmnc_write_evtsel(idx, hwc->config_base);
1888
1889 /*
1890 * Enable interrupt for this counter
1891 */
1892 armv7_pmnc_enable_intens(idx);
1893
1894 /*
1895 * Enable counter
1896 */
1897 armv7_pmnc_enable_counter(idx);
1898
1899 spin_unlock_irqrestore(&pmu_lock, flags);
1900}
1901
1902static void armv7pmu_disable_event(struct hw_perf_event *hwc, int idx)
1903{
1904 unsigned long flags;
1905
1906 /*
1907 * Disable counter and interrupt
1908 */
1909 spin_lock_irqsave(&pmu_lock, flags);
1910
1911 /*
1912 * Disable counter
1913 */
1914 armv7_pmnc_disable_counter(idx);
1915
1916 /*
1917 * Disable interrupt for this counter
1918 */
1919 armv7_pmnc_disable_intens(idx);
1920
1921 spin_unlock_irqrestore(&pmu_lock, flags);
1922}
1923
1924static irqreturn_t armv7pmu_handle_irq(int irq_num, void *dev)
1925{
1926 unsigned long pmnc;
1927 struct perf_sample_data data;
1928 struct cpu_hw_events *cpuc;
1929 struct pt_regs *regs;
1930 int idx;
1931
1932 /*
1933 * Get and reset the IRQ flags
1934 */
1935 pmnc = armv7_pmnc_getreset_flags();
1936
1937 /*
1938 * Did an overflow occur?
1939 */
1940 if (!armv7_pmnc_has_overflowed(pmnc))
1941 return IRQ_NONE;
1942
1943 /*
1944 * Handle the counter(s) overflow(s)
1945 */
1946 regs = get_irq_regs();
1947
1948 data.addr = 0;
1949
1950 cpuc = &__get_cpu_var(cpu_hw_events);
1951 for (idx = 0; idx <= armpmu->num_events; ++idx) {
1952 struct perf_event *event = cpuc->events[idx];
1953 struct hw_perf_event *hwc;
1954
1955 if (!test_bit(idx, cpuc->active_mask))
1956 continue;
1957
1958 /*
1959 * We have a single interrupt for all counters. Check that
1960 * each counter has overflowed before we process it.
1961 */
1962 if (!armv7_pmnc_counter_has_overflowed(pmnc, idx))
1963 continue;
1964
1965 hwc = &event->hw;
1966 armpmu_event_update(event, hwc, idx);
1967 data.period = event->hw.last_period;
1968 if (!armpmu_event_set_period(event, hwc, idx))
1969 continue;
1970
1971 if (perf_event_overflow(event, 0, &data, regs))
1972 armpmu->disable(hwc, idx);
1973 }
1974
1975 /*
1976 * Handle the pending perf events.
1977 *
1978 * Note: this call *must* be run with interrupts enabled. For
1979 * platforms that can have the PMU interrupts raised as a PMI, this
1980 * will not work.
1981 */
1982 perf_event_do_pending();
1983
1984 return IRQ_HANDLED;
1985}
1986
1987static void armv7pmu_start(void)
1988{
1989 unsigned long flags;
1990
1991 spin_lock_irqsave(&pmu_lock, flags);
1992 /* Enable all counters */
1993 armv7_pmnc_write(armv7_pmnc_read() | ARMV7_PMNC_E);
1994 spin_unlock_irqrestore(&pmu_lock, flags);
1995}
1996
1997static void armv7pmu_stop(void)
1998{
1999 unsigned long flags;
2000
2001 spin_lock_irqsave(&pmu_lock, flags);
2002 /* Disable all counters */
2003 armv7_pmnc_write(armv7_pmnc_read() & ~ARMV7_PMNC_E);
2004 spin_unlock_irqrestore(&pmu_lock, flags);
2005}
2006
2007static inline int armv7_a8_pmu_event_map(int config)
2008{
2009 int mapping = armv7_a8_perf_map[config];
2010 if (HW_OP_UNSUPPORTED == mapping)
2011 mapping = -EOPNOTSUPP;
2012 return mapping;
2013}
2014
2015static inline int armv7_a9_pmu_event_map(int config)
2016{
2017 int mapping = armv7_a9_perf_map[config];
2018 if (HW_OP_UNSUPPORTED == mapping)
2019 mapping = -EOPNOTSUPP;
2020 return mapping;
2021}
2022
2023static u64 armv7pmu_raw_event(u64 config)
2024{
2025 return config & 0xff;
2026}
2027
2028static int armv7pmu_get_event_idx(struct cpu_hw_events *cpuc,
2029 struct hw_perf_event *event)
2030{
2031 int idx;
2032
2033 /* Always place a cycle counter into the cycle counter. */
2034 if (event->config_base == ARMV7_PERFCTR_CPU_CYCLES) {
2035 if (test_and_set_bit(ARMV7_CYCLE_COUNTER, cpuc->used_mask))
2036 return -EAGAIN;
2037
2038 return ARMV7_CYCLE_COUNTER;
2039 } else {
2040 /*
2041 * For anything other than a cycle counter, try and use
2042 * the events counters
2043 */
2044 for (idx = ARMV7_COUNTER0; idx <= armpmu->num_events; ++idx) {
2045 if (!test_and_set_bit(idx, cpuc->used_mask))
2046 return idx;
2047 }
2048
2049 /* The counters are all in use. */
2050 return -EAGAIN;
2051 }
2052}
2053
2054static struct arm_pmu armv7pmu = {
2055 .handle_irq = armv7pmu_handle_irq,
2056 .enable = armv7pmu_enable_event,
2057 .disable = armv7pmu_disable_event,
2058 .raw_event = armv7pmu_raw_event,
2059 .read_counter = armv7pmu_read_counter,
2060 .write_counter = armv7pmu_write_counter,
2061 .get_event_idx = armv7pmu_get_event_idx,
2062 .start = armv7pmu_start,
2063 .stop = armv7pmu_stop,
2064 .max_period = (1LLU << 32) - 1,
2065};
2066
2067static u32 __init armv7_reset_read_pmnc(void)
2068{
2069 u32 nb_cnt;
2070
2071 /* Initialize & Reset PMNC: C and P bits */
2072 armv7_pmnc_write(ARMV7_PMNC_P | ARMV7_PMNC_C);
2073
2074 /* Read the nb of CNTx counters supported from PMNC */
2075 nb_cnt = (armv7_pmnc_read() >> ARMV7_PMNC_N_SHIFT) & ARMV7_PMNC_N_MASK;
2076
2077 /* Add the CPU cycles counter and return */
2078 return nb_cnt + 1;
2079}
2080
2081static int __init
2082init_hw_perf_events(void)
2083{
2084 unsigned long cpuid = read_cpuid_id();
2085 unsigned long implementor = (cpuid & 0xFF000000) >> 24;
2086 unsigned long part_number = (cpuid & 0xFFF0);
2087
2088 /* We only support ARM CPUs implemented by ARM at the moment. */
2089 if (0x41 == implementor) {
2090 switch (part_number) {
2091 case 0xB360: /* ARM1136 */
2092 case 0xB560: /* ARM1156 */
2093 case 0xB760: /* ARM1176 */
2094 armpmu = &armv6pmu;
2095 memcpy(armpmu_perf_cache_map, armv6_perf_cache_map,
2096 sizeof(armv6_perf_cache_map));
2097 perf_max_events = armv6pmu.num_events;
2098 break;
2099 case 0xB020: /* ARM11mpcore */
2100 armpmu = &armv6mpcore_pmu;
2101 memcpy(armpmu_perf_cache_map,
2102 armv6mpcore_perf_cache_map,
2103 sizeof(armv6mpcore_perf_cache_map));
2104 perf_max_events = armv6mpcore_pmu.num_events;
2105 break;
2106 case 0xC080: /* Cortex-A8 */
2107 armv7pmu.name = ARMV7_PMU_CORTEX_A8_NAME;
2108 memcpy(armpmu_perf_cache_map, armv7_a8_perf_cache_map,
2109 sizeof(armv7_a8_perf_cache_map));
2110 armv7pmu.event_map = armv7_a8_pmu_event_map;
2111 armpmu = &armv7pmu;
2112
2113 /* Reset PMNC and read the nb of CNTx counters
2114 supported */
2115 armv7pmu.num_events = armv7_reset_read_pmnc();
2116 perf_max_events = armv7pmu.num_events;
2117 break;
2118 case 0xC090: /* Cortex-A9 */
2119 armv7pmu.name = ARMV7_PMU_CORTEX_A9_NAME;
2120 memcpy(armpmu_perf_cache_map, armv7_a9_perf_cache_map,
2121 sizeof(armv7_a9_perf_cache_map));
2122 armv7pmu.event_map = armv7_a9_pmu_event_map;
2123 armpmu = &armv7pmu;
2124
2125 /* Reset PMNC and read the nb of CNTx counters
2126 supported */
2127 armv7pmu.num_events = armv7_reset_read_pmnc();
2128 perf_max_events = armv7pmu.num_events;
2129 break;
2130 default:
2131 pr_info("no hardware support available\n");
2132 perf_max_events = -1;
2133 }
2134 }
2135
2136 if (armpmu)
2137 pr_info("enabled with %s PMU driver, %d counters available\n",
2138 armpmu->name, armpmu->num_events);
2139
2140 return 0;
2141}
2142arch_initcall(init_hw_perf_events);
2143
2144/*
2145 * Callchain handling code.
2146 */
2147static inline void
2148callchain_store(struct perf_callchain_entry *entry,
2149 u64 ip)
2150{
2151 if (entry->nr < PERF_MAX_STACK_DEPTH)
2152 entry->ip[entry->nr++] = ip;
2153}
2154
2155/*
2156 * The registers we're interested in are at the end of the variable
2157 * length saved register structure. The fp points at the end of this
2158 * structure so the address of this struct is:
2159 * (struct frame_tail *)(xxx->fp)-1
2160 *
2161 * This code has been adapted from the ARM OProfile support.
2162 */
2163struct frame_tail {
2164 struct frame_tail *fp;
2165 unsigned long sp;
2166 unsigned long lr;
2167} __attribute__((packed));
2168
2169/*
2170 * Get the return address for a single stackframe and return a pointer to the
2171 * next frame tail.
2172 */
2173static struct frame_tail *
2174user_backtrace(struct frame_tail *tail,
2175 struct perf_callchain_entry *entry)
2176{
2177 struct frame_tail buftail;
2178
2179 /* Also check accessibility of one struct frame_tail beyond */
2180 if (!access_ok(VERIFY_READ, tail, sizeof(buftail)))
2181 return NULL;
2182 if (__copy_from_user_inatomic(&buftail, tail, sizeof(buftail)))
2183 return NULL;
2184
2185 callchain_store(entry, buftail.lr);
2186
2187 /*
2188 * Frame pointers should strictly progress back up the stack
2189 * (towards higher addresses).
2190 */
2191 if (tail >= buftail.fp)
2192 return NULL;
2193
2194 return buftail.fp - 1;
2195}
2196
2197static void
2198perf_callchain_user(struct pt_regs *regs,
2199 struct perf_callchain_entry *entry)
2200{
2201 struct frame_tail *tail;
2202
2203 callchain_store(entry, PERF_CONTEXT_USER);
2204
2205 if (!user_mode(regs))
2206 regs = task_pt_regs(current);
2207
2208 tail = (struct frame_tail *)regs->ARM_fp - 1;
2209
2210 while (tail && !((unsigned long)tail & 0x3))
2211 tail = user_backtrace(tail, entry);
2212}
2213
2214/*
2215 * Gets called by walk_stackframe() for every stackframe. This will be called
2216 * whist unwinding the stackframe and is like a subroutine return so we use
2217 * the PC.
2218 */
2219static int
2220callchain_trace(struct stackframe *fr,
2221 void *data)
2222{
2223 struct perf_callchain_entry *entry = data;
2224 callchain_store(entry, fr->pc);
2225 return 0;
2226}
2227
2228static void
2229perf_callchain_kernel(struct pt_regs *regs,
2230 struct perf_callchain_entry *entry)
2231{
2232 struct stackframe fr;
2233
2234 callchain_store(entry, PERF_CONTEXT_KERNEL);
2235 fr.fp = regs->ARM_fp;
2236 fr.sp = regs->ARM_sp;
2237 fr.lr = regs->ARM_lr;
2238 fr.pc = regs->ARM_pc;
2239 walk_stackframe(&fr, callchain_trace, entry);
2240}
2241
2242static void
2243perf_do_callchain(struct pt_regs *regs,
2244 struct perf_callchain_entry *entry)
2245{
2246 int is_user;
2247
2248 if (!regs)
2249 return;
2250
2251 is_user = user_mode(regs);
2252
2253 if (!current || !current->pid)
2254 return;
2255
2256 if (is_user && current->state != TASK_RUNNING)
2257 return;
2258
2259 if (!is_user)
2260 perf_callchain_kernel(regs, entry);
2261
2262 if (current->mm)
2263 perf_callchain_user(regs, entry);
2264}
2265
2266static DEFINE_PER_CPU(struct perf_callchain_entry, pmc_irq_entry);
2267
2268struct perf_callchain_entry *
2269perf_callchain(struct pt_regs *regs)
2270{
2271 struct perf_callchain_entry *entry = &__get_cpu_var(pmc_irq_entry);
2272
2273 entry->nr = 0;
2274 perf_do_callchain(regs, entry);
2275 return entry;
2276}
diff --git a/arch/arm/kernel/pmu.c b/arch/arm/kernel/pmu.c
new file mode 100644
index 000000000000..a124312e343f
--- /dev/null
+++ b/arch/arm/kernel/pmu.c
@@ -0,0 +1,103 @@
1/*
2 * linux/arch/arm/kernel/pmu.c
3 *
4 * Copyright (C) 2009 picoChip Designs Ltd, Jamie Iles
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
12#include <linux/cpumask.h>
13#include <linux/err.h>
14#include <linux/interrupt.h>
15#include <linux/kernel.h>
16#include <linux/module.h>
17
18#include <asm/pmu.h>
19
20/*
21 * Define the IRQs for the system. We could use something like a platform
22 * device but that seems fairly heavyweight for this. Also, the performance
23 * counters can't be removed or hotplugged.
24 *
25 * Ordering is important: init_pmu() will use the ordering to set the affinity
26 * to the corresponding core. e.g. the first interrupt will go to cpu 0, the
27 * second goes to cpu 1 etc.
28 */
29static const int irqs[] = {
30#if defined(CONFIG_ARCH_OMAP2)
31 3,
32#elif defined(CONFIG_ARCH_BCMRING)
33 IRQ_PMUIRQ,
34#elif defined(CONFIG_MACH_REALVIEW_EB)
35 IRQ_EB11MP_PMU_CPU0,
36 IRQ_EB11MP_PMU_CPU1,
37 IRQ_EB11MP_PMU_CPU2,
38 IRQ_EB11MP_PMU_CPU3,
39#elif defined(CONFIG_ARCH_OMAP3)
40 INT_34XX_BENCH_MPU_EMUL,
41#elif defined(CONFIG_ARCH_IOP32X)
42 IRQ_IOP32X_CORE_PMU,
43#elif defined(CONFIG_ARCH_IOP33X)
44 IRQ_IOP33X_CORE_PMU,
45#elif defined(CONFIG_ARCH_PXA)
46 IRQ_PMU,
47#endif
48};
49
50static const struct pmu_irqs pmu_irqs = {
51 .irqs = irqs,
52 .num_irqs = ARRAY_SIZE(irqs),
53};
54
55static volatile long pmu_lock;
56
57const struct pmu_irqs *
58reserve_pmu(void)
59{
60 return test_and_set_bit_lock(0, &pmu_lock) ? ERR_PTR(-EBUSY) :
61 &pmu_irqs;
62}
63EXPORT_SYMBOL_GPL(reserve_pmu);
64
65int
66release_pmu(const struct pmu_irqs *irqs)
67{
68 if (WARN_ON(irqs != &pmu_irqs))
69 return -EINVAL;
70 clear_bit_unlock(0, &pmu_lock);
71 return 0;
72}
73EXPORT_SYMBOL_GPL(release_pmu);
74
75static int
76set_irq_affinity(int irq,
77 unsigned int cpu)
78{
79#ifdef CONFIG_SMP
80 int err = irq_set_affinity(irq, cpumask_of(cpu));
81 if (err)
82 pr_warning("unable to set irq affinity (irq=%d, cpu=%u)\n",
83 irq, cpu);
84 return err;
85#else
86 return 0;
87#endif
88}
89
90int
91init_pmu(void)
92{
93 int i, err = 0;
94
95 for (i = 0; i < pmu_irqs.num_irqs; ++i) {
96 err = set_irq_affinity(pmu_irqs.irqs[i], i);
97 if (err)
98 break;
99 }
100
101 return err;
102}
103EXPORT_SYMBOL_GPL(init_pmu);
diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c
index a2ea3854cb3c..08f899fb76a6 100644
--- a/arch/arm/kernel/ptrace.c
+++ b/arch/arm/kernel/ptrace.c
@@ -499,10 +499,41 @@ static struct undef_hook thumb_break_hook = {
499 .fn = break_trap, 499 .fn = break_trap,
500}; 500};
501 501
502static int thumb2_break_trap(struct pt_regs *regs, unsigned int instr)
503{
504 unsigned int instr2;
505 void __user *pc;
506
507 /* Check the second half of the instruction. */
508 pc = (void __user *)(instruction_pointer(regs) + 2);
509
510 if (processor_mode(regs) == SVC_MODE) {
511 instr2 = *(u16 *) pc;
512 } else {
513 get_user(instr2, (u16 __user *)pc);
514 }
515
516 if (instr2 == 0xa000) {
517 ptrace_break(current, regs);
518 return 0;
519 } else {
520 return 1;
521 }
522}
523
524static struct undef_hook thumb2_break_hook = {
525 .instr_mask = 0xffff,
526 .instr_val = 0xf7f0,
527 .cpsr_mask = PSR_T_BIT,
528 .cpsr_val = PSR_T_BIT,
529 .fn = thumb2_break_trap,
530};
531
502static int __init ptrace_break_init(void) 532static int __init ptrace_break_init(void)
503{ 533{
504 register_undef_hook(&arm_break_hook); 534 register_undef_hook(&arm_break_hook);
505 register_undef_hook(&thumb_break_hook); 535 register_undef_hook(&thumb_break_hook);
536 register_undef_hook(&thumb2_break_hook);
506 return 0; 537 return 0;
507} 538}
508 539
@@ -669,7 +700,7 @@ static int ptrace_getvfpregs(struct task_struct *tsk, void __user *data)
669 union vfp_state *vfp = &thread->vfpstate; 700 union vfp_state *vfp = &thread->vfpstate;
670 struct user_vfp __user *ufp = data; 701 struct user_vfp __user *ufp = data;
671 702
672 vfp_sync_state(thread); 703 vfp_sync_hwstate(thread);
673 704
674 /* copy the floating point registers */ 705 /* copy the floating point registers */
675 if (copy_to_user(&ufp->fpregs, &vfp->hard.fpregs, 706 if (copy_to_user(&ufp->fpregs, &vfp->hard.fpregs,
@@ -692,7 +723,7 @@ static int ptrace_setvfpregs(struct task_struct *tsk, void __user *data)
692 union vfp_state *vfp = &thread->vfpstate; 723 union vfp_state *vfp = &thread->vfpstate;
693 struct user_vfp __user *ufp = data; 724 struct user_vfp __user *ufp = data;
694 725
695 vfp_sync_state(thread); 726 vfp_sync_hwstate(thread);
696 727
697 /* copy the floating point registers */ 728 /* copy the floating point registers */
698 if (copy_from_user(&vfp->hard.fpregs, &ufp->fpregs, 729 if (copy_from_user(&vfp->hard.fpregs, &ufp->fpregs,
@@ -703,6 +734,8 @@ static int ptrace_setvfpregs(struct task_struct *tsk, void __user *data)
703 if (get_user(vfp->hard.fpscr, &ufp->fpscr)) 734 if (get_user(vfp->hard.fpscr, &ufp->fpscr))
704 return -EFAULT; 735 return -EFAULT;
705 736
737 vfp_flush_hwstate(thread);
738
706 return 0; 739 return 0;
707} 740}
708#endif 741#endif
@@ -712,26 +745,10 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
712 int ret; 745 int ret;
713 746
714 switch (request) { 747 switch (request) {
715 /*
716 * read word at location "addr" in the child process.
717 */
718 case PTRACE_PEEKTEXT:
719 case PTRACE_PEEKDATA:
720 ret = generic_ptrace_peekdata(child, addr, data);
721 break;
722
723 case PTRACE_PEEKUSR: 748 case PTRACE_PEEKUSR:
724 ret = ptrace_read_user(child, addr, (unsigned long __user *)data); 749 ret = ptrace_read_user(child, addr, (unsigned long __user *)data);
725 break; 750 break;
726 751
727 /*
728 * write the word at location addr.
729 */
730 case PTRACE_POKETEXT:
731 case PTRACE_POKEDATA:
732 ret = generic_ptrace_pokedata(child, addr, data);
733 break;
734
735 case PTRACE_POKEUSR: 752 case PTRACE_POKEUSR:
736 ret = ptrace_write_user(child, addr, data); 753 ret = ptrace_write_user(child, addr, data);
737 break; 754 break;
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index c6c57b640b6b..c91c77b54dea 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -24,6 +24,7 @@
24#include <linux/interrupt.h> 24#include <linux/interrupt.h>
25#include <linux/smp.h> 25#include <linux/smp.h>
26#include <linux/fs.h> 26#include <linux/fs.h>
27#include <linux/proc_fs.h>
27 28
28#include <asm/unified.h> 29#include <asm/unified.h>
29#include <asm/cpu.h> 30#include <asm/cpu.h>
@@ -102,6 +103,7 @@ struct cpu_cache_fns cpu_cache;
102#endif 103#endif
103#ifdef CONFIG_OUTER_CACHE 104#ifdef CONFIG_OUTER_CACHE
104struct outer_cache_fns outer_cache; 105struct outer_cache_fns outer_cache;
106EXPORT_SYMBOL(outer_cache);
105#endif 107#endif
106 108
107struct stack { 109struct stack {
@@ -117,7 +119,7 @@ EXPORT_SYMBOL(elf_platform);
117 119
118static const char *cpu_name; 120static const char *cpu_name;
119static const char *machine_name; 121static const char *machine_name;
120static char __initdata command_line[COMMAND_LINE_SIZE]; 122static char __initdata cmd_line[COMMAND_LINE_SIZE];
121 123
122static char default_command_line[COMMAND_LINE_SIZE] __initdata = CONFIG_CMDLINE; 124static char default_command_line[COMMAND_LINE_SIZE] __initdata = CONFIG_CMDLINE;
123static union { char c[4]; unsigned long l; } endian_test __initdata = { { 'l', '?', '?', 'b' } }; 125static union { char c[4]; unsigned long l; } endian_test __initdata = { { 'l', '?', '?', 'b' } };
@@ -417,10 +419,11 @@ static int __init arm_add_memory(unsigned long start, unsigned long size)
417 * Pick out the memory size. We look for mem=size@start, 419 * Pick out the memory size. We look for mem=size@start,
418 * where start and size are "size[KkMm]" 420 * where start and size are "size[KkMm]"
419 */ 421 */
420static void __init early_mem(char **p) 422static int __init early_mem(char *p)
421{ 423{
422 static int usermem __initdata = 0; 424 static int usermem __initdata = 0;
423 unsigned long size, start; 425 unsigned long size, start;
426 char *endp;
424 427
425 /* 428 /*
426 * If the user specifies memory size, we 429 * If the user specifies memory size, we
@@ -433,52 +436,15 @@ static void __init early_mem(char **p)
433 } 436 }
434 437
435 start = PHYS_OFFSET; 438 start = PHYS_OFFSET;
436 size = memparse(*p, p); 439 size = memparse(p, &endp);
437 if (**p == '@') 440 if (*endp == '@')
438 start = memparse(*p + 1, p); 441 start = memparse(endp + 1, NULL);
439 442
440 arm_add_memory(start, size); 443 arm_add_memory(start, size);
441}
442__early_param("mem=", early_mem);
443 444
444/* 445 return 0;
445 * Initial parsing of the command line.
446 */
447static void __init parse_cmdline(char **cmdline_p, char *from)
448{
449 char c = ' ', *to = command_line;
450 int len = 0;
451
452 for (;;) {
453 if (c == ' ') {
454 extern struct early_params __early_begin, __early_end;
455 struct early_params *p;
456
457 for (p = &__early_begin; p < &__early_end; p++) {
458 int arglen = strlen(p->arg);
459
460 if (memcmp(from, p->arg, arglen) == 0) {
461 if (to != command_line)
462 to -= 1;
463 from += arglen;
464 p->fn(&from);
465
466 while (*from != ' ' && *from != '\0')
467 from++;
468 break;
469 }
470 }
471 }
472 c = *from++;
473 if (!c)
474 break;
475 if (COMMAND_LINE_SIZE <= ++len)
476 break;
477 *to++ = c;
478 }
479 *to = '\0';
480 *cmdline_p = command_line;
481} 446}
447early_param("mem", early_mem);
482 448
483static void __init 449static void __init
484setup_ramdisk(int doload, int prompt, int image_start, unsigned int rd_sz) 450setup_ramdisk(int doload, int prompt, int image_start, unsigned int rd_sz)
@@ -739,9 +705,15 @@ void __init setup_arch(char **cmdline_p)
739 init_mm.end_data = (unsigned long) _edata; 705 init_mm.end_data = (unsigned long) _edata;
740 init_mm.brk = (unsigned long) _end; 706 init_mm.brk = (unsigned long) _end;
741 707
742 memcpy(boot_command_line, from, COMMAND_LINE_SIZE); 708 /* parse_early_param needs a boot_command_line */
743 boot_command_line[COMMAND_LINE_SIZE-1] = '\0'; 709 strlcpy(boot_command_line, from, COMMAND_LINE_SIZE);
744 parse_cmdline(cmdline_p, from); 710
711 /* populate cmd_line too for later use, preserving boot_command_line */
712 strlcpy(cmd_line, boot_command_line, COMMAND_LINE_SIZE);
713 *cmdline_p = cmd_line;
714
715 parse_early_param();
716
745 paging_init(mdesc); 717 paging_init(mdesc);
746 request_standard_resources(&meminfo, mdesc); 718 request_standard_resources(&meminfo, mdesc);
747 719
@@ -782,9 +754,21 @@ static int __init topology_init(void)
782 754
783 return 0; 755 return 0;
784} 756}
785
786subsys_initcall(topology_init); 757subsys_initcall(topology_init);
787 758
759#ifdef CONFIG_HAVE_PROC_CPU
760static int __init proc_cpu_init(void)
761{
762 struct proc_dir_entry *res;
763
764 res = proc_mkdir("cpu", NULL);
765 if (!res)
766 return -ENOMEM;
767 return 0;
768}
769fs_initcall(proc_cpu_init);
770#endif
771
788static const char *hwcap_str[] = { 772static const char *hwcap_str[] = {
789 "swp", 773 "swp",
790 "half", 774 "half",
diff --git a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c
index d38cdf2c8276..28753805d2d1 100644
--- a/arch/arm/kernel/time.c
+++ b/arch/arm/kernel/time.c
@@ -10,11 +10,6 @@
10 * 10 *
11 * This file contains the ARM-specific time handling details: 11 * This file contains the ARM-specific time handling details:
12 * reading the RTC at bootup, etc... 12 * reading the RTC at bootup, etc...
13 *
14 * 1994-07-02 Alan Modra
15 * fixed set_rtc_mmss, fixed time.year for >= 2000, new mktime
16 * 1998-12-20 Updated NTP code according to technical memorandum Jan '96
17 * "A Kernel Model for Precision Timekeeping" by Dave Mills
18 */ 13 */
19#include <linux/module.h> 14#include <linux/module.h>
20#include <linux/kernel.h> 15#include <linux/kernel.h>
@@ -77,11 +72,6 @@ unsigned long profile_pc(struct pt_regs *regs)
77EXPORT_SYMBOL(profile_pc); 72EXPORT_SYMBOL(profile_pc);
78#endif 73#endif
79 74
80/*
81 * hook for setting the RTC's idea of the current time.
82 */
83int (*set_rtc)(void);
84
85#ifndef CONFIG_GENERIC_TIME 75#ifndef CONFIG_GENERIC_TIME
86static unsigned long dummy_gettimeoffset(void) 76static unsigned long dummy_gettimeoffset(void)
87{ 77{
@@ -89,140 +79,6 @@ static unsigned long dummy_gettimeoffset(void)
89} 79}
90#endif 80#endif
91 81
92static unsigned long next_rtc_update;
93
94/*
95 * If we have an externally synchronized linux clock, then update
96 * CMOS clock accordingly every ~11 minutes. set_rtc() has to be
97 * called as close as possible to 500 ms before the new second
98 * starts.
99 */
100static inline void do_set_rtc(void)
101{
102 if (!ntp_synced() || set_rtc == NULL)
103 return;
104
105 if (next_rtc_update &&
106 time_before((unsigned long)xtime.tv_sec, next_rtc_update))
107 return;
108
109 if (xtime.tv_nsec < 500000000 - ((unsigned) tick_nsec >> 1) &&
110 xtime.tv_nsec >= 500000000 + ((unsigned) tick_nsec >> 1))
111 return;
112
113 if (set_rtc())
114 /*
115 * rtc update failed. Try again in 60s
116 */
117 next_rtc_update = xtime.tv_sec + 60;
118 else
119 next_rtc_update = xtime.tv_sec + 660;
120}
121
122#ifdef CONFIG_LEDS
123
124static void dummy_leds_event(led_event_t evt)
125{
126}
127
128void (*leds_event)(led_event_t) = dummy_leds_event;
129
130struct leds_evt_name {
131 const char name[8];
132 int on;
133 int off;
134};
135
136static const struct leds_evt_name evt_names[] = {
137 { "amber", led_amber_on, led_amber_off },
138 { "blue", led_blue_on, led_blue_off },
139 { "green", led_green_on, led_green_off },
140 { "red", led_red_on, led_red_off },
141};
142
143static ssize_t leds_store(struct sys_device *dev,
144 struct sysdev_attribute *attr,
145 const char *buf, size_t size)
146{
147 int ret = -EINVAL, len = strcspn(buf, " ");
148
149 if (len > 0 && buf[len] == '\0')
150 len--;
151
152 if (strncmp(buf, "claim", len) == 0) {
153 leds_event(led_claim);
154 ret = size;
155 } else if (strncmp(buf, "release", len) == 0) {
156 leds_event(led_release);
157 ret = size;
158 } else {
159 int i;
160
161 for (i = 0; i < ARRAY_SIZE(evt_names); i++) {
162 if (strlen(evt_names[i].name) != len ||
163 strncmp(buf, evt_names[i].name, len) != 0)
164 continue;
165 if (strncmp(buf+len, " on", 3) == 0) {
166 leds_event(evt_names[i].on);
167 ret = size;
168 } else if (strncmp(buf+len, " off", 4) == 0) {
169 leds_event(evt_names[i].off);
170 ret = size;
171 }
172 break;
173 }
174 }
175 return ret;
176}
177
178static SYSDEV_ATTR(event, 0200, NULL, leds_store);
179
180static int leds_suspend(struct sys_device *dev, pm_message_t state)
181{
182 leds_event(led_stop);
183 return 0;
184}
185
186static int leds_resume(struct sys_device *dev)
187{
188 leds_event(led_start);
189 return 0;
190}
191
192static int leds_shutdown(struct sys_device *dev)
193{
194 leds_event(led_halted);
195 return 0;
196}
197
198static struct sysdev_class leds_sysclass = {
199 .name = "leds",
200 .shutdown = leds_shutdown,
201 .suspend = leds_suspend,
202 .resume = leds_resume,
203};
204
205static struct sys_device leds_device = {
206 .id = 0,
207 .cls = &leds_sysclass,
208};
209
210static int __init leds_init(void)
211{
212 int ret;
213 ret = sysdev_class_register(&leds_sysclass);
214 if (ret == 0)
215 ret = sysdev_register(&leds_device);
216 if (ret == 0)
217 ret = sysdev_create_file(&leds_device, &attr_event);
218 return ret;
219}
220
221device_initcall(leds_init);
222
223EXPORT_SYMBOL(leds_event);
224#endif
225
226#ifdef CONFIG_LEDS_TIMER 82#ifdef CONFIG_LEDS_TIMER
227static inline void do_leds(void) 83static inline void do_leds(void)
228{ 84{
@@ -295,39 +151,6 @@ int do_settimeofday(struct timespec *tv)
295EXPORT_SYMBOL(do_settimeofday); 151EXPORT_SYMBOL(do_settimeofday);
296#endif /* !CONFIG_GENERIC_TIME */ 152#endif /* !CONFIG_GENERIC_TIME */
297 153
298/**
299 * save_time_delta - Save the offset between system time and RTC time
300 * @delta: pointer to timespec to store delta
301 * @rtc: pointer to timespec for current RTC time
302 *
303 * Return a delta between the system time and the RTC time, such
304 * that system time can be restored later with restore_time_delta()
305 */
306void save_time_delta(struct timespec *delta, struct timespec *rtc)
307{
308 set_normalized_timespec(delta,
309 xtime.tv_sec - rtc->tv_sec,
310 xtime.tv_nsec - rtc->tv_nsec);
311}
312EXPORT_SYMBOL(save_time_delta);
313
314/**
315 * restore_time_delta - Restore the current system time
316 * @delta: delta returned by save_time_delta()
317 * @rtc: pointer to timespec for current RTC time
318 */
319void restore_time_delta(struct timespec *delta, struct timespec *rtc)
320{
321 struct timespec ts;
322
323 set_normalized_timespec(&ts,
324 delta->tv_sec + rtc->tv_sec,
325 delta->tv_nsec + rtc->tv_nsec);
326
327 do_settimeofday(&ts);
328}
329EXPORT_SYMBOL(restore_time_delta);
330
331#ifndef CONFIG_GENERIC_CLOCKEVENTS 154#ifndef CONFIG_GENERIC_CLOCKEVENTS
332/* 155/*
333 * Kernel system timer support. 156 * Kernel system timer support.
@@ -336,7 +159,6 @@ void timer_tick(void)
336{ 159{
337 profile_tick(CPU_PROFILING); 160 profile_tick(CPU_PROFILING);
338 do_leds(); 161 do_leds();
339 do_set_rtc();
340 write_seqlock(&xtime_lock); 162 write_seqlock(&xtime_lock);
341 do_timer(1); 163 do_timer(1);
342 write_sequnlock(&xtime_lock); 164 write_sequnlock(&xtime_lock);
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index 3f361a783f43..1621e5327b2a 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -12,15 +12,17 @@
12 * 'linux/arch/arm/lib/traps.S'. Mostly a debugging aid, but will probably 12 * 'linux/arch/arm/lib/traps.S'. Mostly a debugging aid, but will probably
13 * kill the offending process. 13 * kill the offending process.
14 */ 14 */
15#include <linux/module.h>
16#include <linux/signal.h> 15#include <linux/signal.h>
17#include <linux/spinlock.h>
18#include <linux/personality.h> 16#include <linux/personality.h>
19#include <linux/kallsyms.h> 17#include <linux/kallsyms.h>
20#include <linux/delay.h> 18#include <linux/spinlock.h>
19#include <linux/uaccess.h>
21#include <linux/hardirq.h> 20#include <linux/hardirq.h>
21#include <linux/kdebug.h>
22#include <linux/module.h>
23#include <linux/kexec.h>
24#include <linux/delay.h>
22#include <linux/init.h> 25#include <linux/init.h>
23#include <linux/uaccess.h>
24 26
25#include <asm/atomic.h> 27#include <asm/atomic.h>
26#include <asm/cacheflush.h> 28#include <asm/cacheflush.h>
@@ -224,14 +226,21 @@ void show_stack(struct task_struct *tsk, unsigned long *sp)
224#define S_SMP "" 226#define S_SMP ""
225#endif 227#endif
226 228
227static void __die(const char *str, int err, struct thread_info *thread, struct pt_regs *regs) 229static int __die(const char *str, int err, struct thread_info *thread, struct pt_regs *regs)
228{ 230{
229 struct task_struct *tsk = thread->task; 231 struct task_struct *tsk = thread->task;
230 static int die_counter; 232 static int die_counter;
233 int ret;
231 234
232 printk(KERN_EMERG "Internal error: %s: %x [#%d]" S_PREEMPT S_SMP "\n", 235 printk(KERN_EMERG "Internal error: %s: %x [#%d]" S_PREEMPT S_SMP "\n",
233 str, err, ++die_counter); 236 str, err, ++die_counter);
234 sysfs_printk_last_file(); 237 sysfs_printk_last_file();
238
239 /* trap and error numbers are mostly meaningless on ARM */
240 ret = notify_die(DIE_OOPS, str, regs, err, tsk->thread.trap_no, SIGSEGV);
241 if (ret == NOTIFY_STOP)
242 return ret;
243
235 print_modules(); 244 print_modules();
236 __show_regs(regs); 245 __show_regs(regs);
237 printk(KERN_EMERG "Process %.*s (pid: %d, stack limit = 0x%p)\n", 246 printk(KERN_EMERG "Process %.*s (pid: %d, stack limit = 0x%p)\n",
@@ -243,6 +252,8 @@ static void __die(const char *str, int err, struct thread_info *thread, struct p
243 dump_backtrace(regs, tsk); 252 dump_backtrace(regs, tsk);
244 dump_instr(KERN_EMERG, regs); 253 dump_instr(KERN_EMERG, regs);
245 } 254 }
255
256 return ret;
246} 257}
247 258
248DEFINE_SPINLOCK(die_lock); 259DEFINE_SPINLOCK(die_lock);
@@ -250,16 +261,21 @@ DEFINE_SPINLOCK(die_lock);
250/* 261/*
251 * This function is protected against re-entrancy. 262 * This function is protected against re-entrancy.
252 */ 263 */
253NORET_TYPE void die(const char *str, struct pt_regs *regs, int err) 264void die(const char *str, struct pt_regs *regs, int err)
254{ 265{
255 struct thread_info *thread = current_thread_info(); 266 struct thread_info *thread = current_thread_info();
267 int ret;
256 268
257 oops_enter(); 269 oops_enter();
258 270
259 spin_lock_irq(&die_lock); 271 spin_lock_irq(&die_lock);
260 console_verbose(); 272 console_verbose();
261 bust_spinlocks(1); 273 bust_spinlocks(1);
262 __die(str, err, thread, regs); 274 ret = __die(str, err, thread, regs);
275
276 if (regs && kexec_should_crash(thread->task))
277 crash_kexec(regs);
278
263 bust_spinlocks(0); 279 bust_spinlocks(0);
264 add_taint(TAINT_DIE); 280 add_taint(TAINT_DIE);
265 spin_unlock_irq(&die_lock); 281 spin_unlock_irq(&die_lock);
@@ -267,11 +283,10 @@ NORET_TYPE void die(const char *str, struct pt_regs *regs, int err)
267 283
268 if (in_interrupt()) 284 if (in_interrupt())
269 panic("Fatal exception in interrupt"); 285 panic("Fatal exception in interrupt");
270
271 if (panic_on_oops) 286 if (panic_on_oops)
272 panic("Fatal exception"); 287 panic("Fatal exception");
273 288 if (ret != NOTIFY_STOP)
274 do_exit(SIGSEGV); 289 do_exit(SIGSEGV);
275} 290}
276 291
277void arm_notify_die(const char *str, struct pt_regs *regs, 292void arm_notify_die(const char *str, struct pt_regs *regs,
diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S
index 4957e13ef55b..b16c07914b55 100644
--- a/arch/arm/kernel/vmlinux.lds.S
+++ b/arch/arm/kernel/vmlinux.lds.S
@@ -43,10 +43,6 @@ SECTIONS
43 43
44 INIT_SETUP(16) 44 INIT_SETUP(16)
45 45
46 __early_begin = .;
47 *(.early_param.init)
48 __early_end = .;
49
50 INIT_CALLS 46 INIT_CALLS
51 CON_INITCALL 47 CON_INITCALL
52 SECURITY_INITCALL 48 SECURITY_INITCALL
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index 0b2ee953f164..2db43a5ddd9b 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -89,6 +89,12 @@ config ARCH_AT91CAP9
89 select GENERIC_CLOCKEVENTS 89 select GENERIC_CLOCKEVENTS
90 select HAVE_FB_ATMEL 90 select HAVE_FB_ATMEL
91 91
92config ARCH_AT572D940HF
93 bool "AT572D940HF"
94 select CPU_ARM926T
95 select GENERIC_TIME
96 select GENERIC_CLOCKEVENTS
97
92config ARCH_AT91X40 98config ARCH_AT91X40
93 bool "AT91x40" 99 bool "AT91x40"
94 100
@@ -390,6 +396,23 @@ endif
390 396
391# ---------------------------------------------------------- 397# ----------------------------------------------------------
392 398
399if ARCH_AT572D940HF
400
401comment "AT572D940HF Board Type"
402
403config MACH_AT572D940HFEB
404 bool "AT572D940HF-EK"
405 depends on ARCH_AT572D940HF
406 select HAVE_AT91_DATAFLASH_CARD
407 select HAVE_NAND_ATMEL_BUSWIDTH_16
408 help
409 Select this if you are using Atmel's AT572D940HF-EK evaluation kit.
410 <http://www.atmel.com/products/diopsis/default.asp>
411
412endif
413
414# ----------------------------------------------------------
415
393if ARCH_AT91X40 416if ARCH_AT91X40
394 417
395comment "AT91X40 Board Type" 418comment "AT91X40 Board Type"
diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
index 709fbad4a3ee..027dd570dcc3 100644
--- a/arch/arm/mach-at91/Makefile
+++ b/arch/arm/mach-at91/Makefile
@@ -19,6 +19,7 @@ obj-$(CONFIG_ARCH_AT91SAM9RL) += at91sam9rl.o at91sam926x_time.o at91sam9rl_devi
19obj-$(CONFIG_ARCH_AT91SAM9G20) += at91sam9260.o at91sam926x_time.o at91sam9260_devices.o sam9_smc.o 19obj-$(CONFIG_ARCH_AT91SAM9G20) += at91sam9260.o at91sam926x_time.o at91sam9260_devices.o sam9_smc.o
20 obj-$(CONFIG_ARCH_AT91SAM9G45) += at91sam9g45.o at91sam926x_time.o at91sam9g45_devices.o sam9_smc.o 20 obj-$(CONFIG_ARCH_AT91SAM9G45) += at91sam9g45.o at91sam926x_time.o at91sam9g45_devices.o sam9_smc.o
21obj-$(CONFIG_ARCH_AT91CAP9) += at91cap9.o at91sam926x_time.o at91cap9_devices.o sam9_smc.o 21obj-$(CONFIG_ARCH_AT91CAP9) += at91cap9.o at91sam926x_time.o at91cap9_devices.o sam9_smc.o
22obj-$(CONFIG_ARCH_AT572D940HF) += at572d940hf.o at91sam926x_time.o at572d940hf_devices.o sam9_smc.o
22obj-$(CONFIG_ARCH_AT91X40) += at91x40.o at91x40_time.o 23obj-$(CONFIG_ARCH_AT91X40) += at91x40.o at91x40_time.o
23 24
24# AT91RM9200 board-specific support 25# AT91RM9200 board-specific support
@@ -69,6 +70,9 @@ obj-$(CONFIG_MACH_AT91SAM9G45EKES) += board-sam9m10g45ek.o
69# AT91CAP9 board-specific support 70# AT91CAP9 board-specific support
70obj-$(CONFIG_MACH_AT91CAP9ADK) += board-cap9adk.o 71obj-$(CONFIG_MACH_AT91CAP9ADK) += board-cap9adk.o
71 72
73# AT572D940HF board-specific support
74obj-$(CONFIG_MACH_AT572D940HFEB) += board-at572d940hf_ek.o
75
72# AT91X40 board-specific support 76# AT91X40 board-specific support
73obj-$(CONFIG_MACH_AT91EB01) += board-eb01.o 77obj-$(CONFIG_MACH_AT91EB01) += board-eb01.o
74 78
diff --git a/arch/arm/mach-at91/at572d940hf.c b/arch/arm/mach-at91/at572d940hf.c
new file mode 100644
index 000000000000..a6b9c68c003a
--- /dev/null
+++ b/arch/arm/mach-at91/at572d940hf.c
@@ -0,0 +1,377 @@
1/*
2 * arch/arm/mach-at91/at572d940hf.c
3 *
4 * Antonio R. Costa <costa.antonior@gmail.com>
5 * Copyright (C) 2008 Atmel
6 *
7 * Copyright (C) 2005 SAN People
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 *
23 */
24
25#include <linux/module.h>
26
27#include <asm/mach/irq.h>
28#include <asm/mach/arch.h>
29#include <asm/mach/map.h>
30#include <mach/at572d940hf.h>
31#include <mach/at91_pmc.h>
32#include <mach/at91_rstc.h>
33
34#include "generic.h"
35#include "clock.h"
36
37static struct map_desc at572d940hf_io_desc[] __initdata = {
38 {
39 .virtual = AT91_VA_BASE_SYS,
40 .pfn = __phys_to_pfn(AT91_BASE_SYS),
41 .length = SZ_16K,
42 .type = MT_DEVICE,
43 }, {
44 .virtual = AT91_IO_VIRT_BASE - AT572D940HF_SRAM_SIZE,
45 .pfn = __phys_to_pfn(AT572D940HF_SRAM_BASE),
46 .length = AT572D940HF_SRAM_SIZE,
47 .type = MT_DEVICE,
48 },
49};
50
51/* --------------------------------------------------------------------
52 * Clocks
53 * -------------------------------------------------------------------- */
54
55/*
56 * The peripheral clocks.
57 */
58static struct clk pioA_clk = {
59 .name = "pioA_clk",
60 .pmc_mask = 1 << AT572D940HF_ID_PIOA,
61 .type = CLK_TYPE_PERIPHERAL,
62};
63static struct clk pioB_clk = {
64 .name = "pioB_clk",
65 .pmc_mask = 1 << AT572D940HF_ID_PIOB,
66 .type = CLK_TYPE_PERIPHERAL,
67};
68static struct clk pioC_clk = {
69 .name = "pioC_clk",
70 .pmc_mask = 1 << AT572D940HF_ID_PIOC,
71 .type = CLK_TYPE_PERIPHERAL,
72};
73static struct clk macb_clk = {
74 .name = "macb_clk",
75 .pmc_mask = 1 << AT572D940HF_ID_EMAC,
76 .type = CLK_TYPE_PERIPHERAL,
77};
78static struct clk usart0_clk = {
79 .name = "usart0_clk",
80 .pmc_mask = 1 << AT572D940HF_ID_US0,
81 .type = CLK_TYPE_PERIPHERAL,
82};
83static struct clk usart1_clk = {
84 .name = "usart1_clk",
85 .pmc_mask = 1 << AT572D940HF_ID_US1,
86 .type = CLK_TYPE_PERIPHERAL,
87};
88static struct clk usart2_clk = {
89 .name = "usart2_clk",
90 .pmc_mask = 1 << AT572D940HF_ID_US2,
91 .type = CLK_TYPE_PERIPHERAL,
92};
93static struct clk mmc_clk = {
94 .name = "mci_clk",
95 .pmc_mask = 1 << AT572D940HF_ID_MCI,
96 .type = CLK_TYPE_PERIPHERAL,
97};
98static struct clk udc_clk = {
99 .name = "udc_clk",
100 .pmc_mask = 1 << AT572D940HF_ID_UDP,
101 .type = CLK_TYPE_PERIPHERAL,
102};
103static struct clk twi0_clk = {
104 .name = "twi0_clk",
105 .pmc_mask = 1 << AT572D940HF_ID_TWI0,
106 .type = CLK_TYPE_PERIPHERAL,
107};
108static struct clk spi0_clk = {
109 .name = "spi0_clk",
110 .pmc_mask = 1 << AT572D940HF_ID_SPI0,
111 .type = CLK_TYPE_PERIPHERAL,
112};
113static struct clk spi1_clk = {
114 .name = "spi1_clk",
115 .pmc_mask = 1 << AT572D940HF_ID_SPI1,
116 .type = CLK_TYPE_PERIPHERAL,
117};
118static struct clk ssc0_clk = {
119 .name = "ssc0_clk",
120 .pmc_mask = 1 << AT572D940HF_ID_SSC0,
121 .type = CLK_TYPE_PERIPHERAL,
122};
123static struct clk ssc1_clk = {
124 .name = "ssc1_clk",
125 .pmc_mask = 1 << AT572D940HF_ID_SSC1,
126 .type = CLK_TYPE_PERIPHERAL,
127};
128static struct clk ssc2_clk = {
129 .name = "ssc2_clk",
130 .pmc_mask = 1 << AT572D940HF_ID_SSC2,
131 .type = CLK_TYPE_PERIPHERAL,
132};
133static struct clk tc0_clk = {
134 .name = "tc0_clk",
135 .pmc_mask = 1 << AT572D940HF_ID_TC0,
136 .type = CLK_TYPE_PERIPHERAL,
137};
138static struct clk tc1_clk = {
139 .name = "tc1_clk",
140 .pmc_mask = 1 << AT572D940HF_ID_TC1,
141 .type = CLK_TYPE_PERIPHERAL,
142};
143static struct clk tc2_clk = {
144 .name = "tc2_clk",
145 .pmc_mask = 1 << AT572D940HF_ID_TC2,
146 .type = CLK_TYPE_PERIPHERAL,
147};
148static struct clk ohci_clk = {
149 .name = "ohci_clk",
150 .pmc_mask = 1 << AT572D940HF_ID_UHP,
151 .type = CLK_TYPE_PERIPHERAL,
152};
153static struct clk ssc3_clk = {
154 .name = "ssc3_clk",
155 .pmc_mask = 1 << AT572D940HF_ID_SSC3,
156 .type = CLK_TYPE_PERIPHERAL,
157};
158static struct clk twi1_clk = {
159 .name = "twi1_clk",
160 .pmc_mask = 1 << AT572D940HF_ID_TWI1,
161 .type = CLK_TYPE_PERIPHERAL,
162};
163static struct clk can0_clk = {
164 .name = "can0_clk",
165 .pmc_mask = 1 << AT572D940HF_ID_CAN0,
166 .type = CLK_TYPE_PERIPHERAL,
167};
168static struct clk can1_clk = {
169 .name = "can1_clk",
170 .pmc_mask = 1 << AT572D940HF_ID_CAN1,
171 .type = CLK_TYPE_PERIPHERAL,
172};
173static struct clk mAgicV_clk = {
174 .name = "mAgicV_clk",
175 .pmc_mask = 1 << AT572D940HF_ID_MSIRQ0,
176 .type = CLK_TYPE_PERIPHERAL,
177};
178
179
180static struct clk *periph_clocks[] __initdata = {
181 &pioA_clk,
182 &pioB_clk,
183 &pioC_clk,
184 &macb_clk,
185 &usart0_clk,
186 &usart1_clk,
187 &usart2_clk,
188 &mmc_clk,
189 &udc_clk,
190 &twi0_clk,
191 &spi0_clk,
192 &spi1_clk,
193 &ssc0_clk,
194 &ssc1_clk,
195 &ssc2_clk,
196 &tc0_clk,
197 &tc1_clk,
198 &tc2_clk,
199 &ohci_clk,
200 &ssc3_clk,
201 &twi1_clk,
202 &can0_clk,
203 &can1_clk,
204 &mAgicV_clk,
205 /* irq0 .. irq2 */
206};
207
208/*
209 * The five programmable clocks.
210 * You must configure pin multiplexing to bring these signals out.
211 */
212static struct clk pck0 = {
213 .name = "pck0",
214 .pmc_mask = AT91_PMC_PCK0,
215 .type = CLK_TYPE_PROGRAMMABLE,
216 .id = 0,
217};
218static struct clk pck1 = {
219 .name = "pck1",
220 .pmc_mask = AT91_PMC_PCK1,
221 .type = CLK_TYPE_PROGRAMMABLE,
222 .id = 1,
223};
224static struct clk pck2 = {
225 .name = "pck2",
226 .pmc_mask = AT91_PMC_PCK2,
227 .type = CLK_TYPE_PROGRAMMABLE,
228 .id = 2,
229};
230static struct clk pck3 = {
231 .name = "pck3",
232 .pmc_mask = AT91_PMC_PCK3,
233 .type = CLK_TYPE_PROGRAMMABLE,
234 .id = 3,
235};
236
237static struct clk mAgicV_mem_clk = {
238 .name = "mAgicV_mem_clk",
239 .pmc_mask = AT91_PMC_PCK4,
240 .type = CLK_TYPE_PROGRAMMABLE,
241 .id = 4,
242};
243
244/* HClocks */
245static struct clk hck0 = {
246 .name = "hck0",
247 .pmc_mask = AT91_PMC_HCK0,
248 .type = CLK_TYPE_SYSTEM,
249 .id = 0,
250};
251static struct clk hck1 = {
252 .name = "hck1",
253 .pmc_mask = AT91_PMC_HCK1,
254 .type = CLK_TYPE_SYSTEM,
255 .id = 1,
256};
257
258static void __init at572d940hf_register_clocks(void)
259{
260 int i;
261
262 for (i = 0; i < ARRAY_SIZE(periph_clocks); i++)
263 clk_register(periph_clocks[i]);
264
265 clk_register(&pck0);
266 clk_register(&pck1);
267 clk_register(&pck2);
268 clk_register(&pck3);
269 clk_register(&mAgicV_mem_clk);
270
271 clk_register(&hck0);
272 clk_register(&hck1);
273}
274
275/* --------------------------------------------------------------------
276 * GPIO
277 * -------------------------------------------------------------------- */
278
279static struct at91_gpio_bank at572d940hf_gpio[] = {
280 {
281 .id = AT572D940HF_ID_PIOA,
282 .offset = AT91_PIOA,
283 .clock = &pioA_clk,
284 }, {
285 .id = AT572D940HF_ID_PIOB,
286 .offset = AT91_PIOB,
287 .clock = &pioB_clk,
288 }, {
289 .id = AT572D940HF_ID_PIOC,
290 .offset = AT91_PIOC,
291 .clock = &pioC_clk,
292 }
293};
294
295static void at572d940hf_reset(void)
296{
297 at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST);
298}
299
300
301/* --------------------------------------------------------------------
302 * AT572D940HF processor initialization
303 * -------------------------------------------------------------------- */
304
305void __init at572d940hf_initialize(unsigned long main_clock)
306{
307 /* Map peripherals */
308 iotable_init(at572d940hf_io_desc, ARRAY_SIZE(at572d940hf_io_desc));
309
310 at91_arch_reset = at572d940hf_reset;
311 at91_extern_irq = (1 << AT572D940HF_ID_IRQ0) | (1 << AT572D940HF_ID_IRQ1)
312 | (1 << AT572D940HF_ID_IRQ2);
313
314 /* Init clock subsystem */
315 at91_clock_init(main_clock);
316
317 /* Register the processor-specific clocks */
318 at572d940hf_register_clocks();
319
320 /* Register GPIO subsystem */
321 at91_gpio_init(at572d940hf_gpio, 3);
322}
323
324/* --------------------------------------------------------------------
325 * Interrupt initialization
326 * -------------------------------------------------------------------- */
327
328/*
329 * The default interrupt priority levels (0 = lowest, 7 = highest).
330 */
331static unsigned int at572d940hf_default_irq_priority[NR_AIC_IRQS] __initdata = {
332 7, /* Advanced Interrupt Controller */
333 7, /* System Peripherals */
334 0, /* Parallel IO Controller A */
335 0, /* Parallel IO Controller B */
336 0, /* Parallel IO Controller C */
337 3, /* Ethernet */
338 6, /* USART 0 */
339 6, /* USART 1 */
340 6, /* USART 2 */
341 0, /* Multimedia Card Interface */
342 4, /* USB Device Port */
343 0, /* Two-Wire Interface 0 */
344 6, /* Serial Peripheral Interface 0 */
345 6, /* Serial Peripheral Interface 1 */
346 5, /* Serial Synchronous Controller 0 */
347 5, /* Serial Synchronous Controller 1 */
348 5, /* Serial Synchronous Controller 2 */
349 0, /* Timer Counter 0 */
350 0, /* Timer Counter 1 */
351 0, /* Timer Counter 2 */
352 3, /* USB Host port */
353 3, /* Serial Synchronous Controller 3 */
354 0, /* Two-Wire Interface 1 */
355 0, /* CAN Controller 0 */
356 0, /* CAN Controller 1 */
357 0, /* mAgicV HALT line */
358 0, /* mAgicV SIRQ0 line */
359 0, /* mAgicV exception line */
360 0, /* mAgicV end of DMA line */
361 0, /* Advanced Interrupt Controller */
362 0, /* Advanced Interrupt Controller */
363 0, /* Advanced Interrupt Controller */
364};
365
366void __init at572d940hf_init_interrupts(unsigned int priority[NR_AIC_IRQS])
367{
368 if (!priority)
369 priority = at572d940hf_default_irq_priority;
370
371 /* Initialize the AIC interrupt controller */
372 at91_aic_init(priority);
373
374 /* Enable GPIO interrupts */
375 at91_gpio_irq_setup();
376}
377
diff --git a/arch/arm/mach-at91/at572d940hf_devices.c b/arch/arm/mach-at91/at572d940hf_devices.c
new file mode 100644
index 000000000000..0fc20a240782
--- /dev/null
+++ b/arch/arm/mach-at91/at572d940hf_devices.c
@@ -0,0 +1,970 @@
1/*
2 * arch/arm/mach-at91/at572d940hf_devices.c
3 *
4 * Copyright (C) 2008 Atmel Antonio R. Costa <costa.antonior@gmail.com>
5 * Copyright (C) 2005 Thibaut VARENE <varenet@parisc-linux.org>
6 * Copyright (C) 2005 David Brownell
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 *
22 */
23
24#include <asm/mach/arch.h>
25#include <asm/mach/map.h>
26
27#include <linux/dma-mapping.h>
28#include <linux/platform_device.h>
29
30#include <mach/board.h>
31#include <mach/gpio.h>
32#include <mach/at572d940hf.h>
33#include <mach/at572d940hf_matrix.h>
34#include <mach/at91sam9_smc.h>
35
36#include "generic.h"
37#include "sam9_smc.h"
38
39
40/* --------------------------------------------------------------------
41 * USB Host
42 * -------------------------------------------------------------------- */
43
44#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
45static u64 ohci_dmamask = DMA_BIT_MASK(32);
46static struct at91_usbh_data usbh_data;
47
48static struct resource usbh_resources[] = {
49 [0] = {
50 .start = AT572D940HF_UHP_BASE,
51 .end = AT572D940HF_UHP_BASE + SZ_1M - 1,
52 .flags = IORESOURCE_MEM,
53 },
54 [1] = {
55 .start = AT572D940HF_ID_UHP,
56 .end = AT572D940HF_ID_UHP,
57 .flags = IORESOURCE_IRQ,
58 },
59};
60
61static struct platform_device at572d940hf_usbh_device = {
62 .name = "at91_ohci",
63 .id = -1,
64 .dev = {
65 .dma_mask = &ohci_dmamask,
66 .coherent_dma_mask = DMA_BIT_MASK(32),
67 .platform_data = &usbh_data,
68 },
69 .resource = usbh_resources,
70 .num_resources = ARRAY_SIZE(usbh_resources),
71};
72
73void __init at91_add_device_usbh(struct at91_usbh_data *data)
74{
75 if (!data)
76 return;
77
78 usbh_data = *data;
79 platform_device_register(&at572d940hf_usbh_device);
80
81}
82#else
83void __init at91_add_device_usbh(struct at91_usbh_data *data) {}
84#endif
85
86
87/* --------------------------------------------------------------------
88 * USB Device (Gadget)
89 * -------------------------------------------------------------------- */
90
91#ifdef CONFIG_USB_GADGET_AT91
92static struct at91_udc_data udc_data;
93
94static struct resource udc_resources[] = {
95 [0] = {
96 .start = AT572D940HF_BASE_UDP,
97 .end = AT572D940HF_BASE_UDP + SZ_16K - 1,
98 .flags = IORESOURCE_MEM,
99 },
100 [1] = {
101 .start = AT572D940HF_ID_UDP,
102 .end = AT572D940HF_ID_UDP,
103 .flags = IORESOURCE_IRQ,
104 },
105};
106
107static struct platform_device at572d940hf_udc_device = {
108 .name = "at91_udc",
109 .id = -1,
110 .dev = {
111 .platform_data = &udc_data,
112 },
113 .resource = udc_resources,
114 .num_resources = ARRAY_SIZE(udc_resources),
115};
116
117void __init at91_add_device_udc(struct at91_udc_data *data)
118{
119 if (!data)
120 return;
121
122 if (data->vbus_pin) {
123 at91_set_gpio_input(data->vbus_pin, 0);
124 at91_set_deglitch(data->vbus_pin, 1);
125 }
126
127 /* Pullup pin is handled internally */
128
129 udc_data = *data;
130 platform_device_register(&at572d940hf_udc_device);
131}
132#else
133void __init at91_add_device_udc(struct at91_udc_data *data) {}
134#endif
135
136
137/* --------------------------------------------------------------------
138 * Ethernet
139 * -------------------------------------------------------------------- */
140
141#if defined(CONFIG_MACB) || defined(CONFIG_MACB_MODULE)
142static u64 eth_dmamask = DMA_BIT_MASK(32);
143static struct at91_eth_data eth_data;
144
145static struct resource eth_resources[] = {
146 [0] = {
147 .start = AT572D940HF_BASE_EMAC,
148 .end = AT572D940HF_BASE_EMAC + SZ_16K - 1,
149 .flags = IORESOURCE_MEM,
150 },
151 [1] = {
152 .start = AT572D940HF_ID_EMAC,
153 .end = AT572D940HF_ID_EMAC,
154 .flags = IORESOURCE_IRQ,
155 },
156};
157
158static struct platform_device at572d940hf_eth_device = {
159 .name = "macb",
160 .id = -1,
161 .dev = {
162 .dma_mask = &eth_dmamask,
163 .coherent_dma_mask = DMA_BIT_MASK(32),
164 .platform_data = &eth_data,
165 },
166 .resource = eth_resources,
167 .num_resources = ARRAY_SIZE(eth_resources),
168};
169
170void __init at91_add_device_eth(struct at91_eth_data *data)
171{
172 if (!data)
173 return;
174
175 if (data->phy_irq_pin) {
176 at91_set_gpio_input(data->phy_irq_pin, 0);
177 at91_set_deglitch(data->phy_irq_pin, 1);
178 }
179
180 /* Only RMII is supported */
181 data->is_rmii = 1;
182
183 /* Pins used for RMII */
184 at91_set_A_periph(AT91_PIN_PA16, 0); /* ETXCK_EREFCK */
185 at91_set_A_periph(AT91_PIN_PA17, 0); /* ERXDV */
186 at91_set_A_periph(AT91_PIN_PA18, 0); /* ERX0 */
187 at91_set_A_periph(AT91_PIN_PA19, 0); /* ERX1 */
188 at91_set_A_periph(AT91_PIN_PA20, 0); /* ERXER */
189 at91_set_A_periph(AT91_PIN_PA23, 0); /* ETXEN */
190 at91_set_A_periph(AT91_PIN_PA21, 0); /* ETX0 */
191 at91_set_A_periph(AT91_PIN_PA22, 0); /* ETX1 */
192 at91_set_A_periph(AT91_PIN_PA13, 0); /* EMDIO */
193 at91_set_A_periph(AT91_PIN_PA14, 0); /* EMDC */
194
195 eth_data = *data;
196 platform_device_register(&at572d940hf_eth_device);
197}
198#else
199void __init at91_add_device_eth(struct at91_eth_data *data) {}
200#endif
201
202
203/* --------------------------------------------------------------------
204 * MMC / SD
205 * -------------------------------------------------------------------- */
206
207#if defined(CONFIG_MMC_AT91) || defined(CONFIG_MMC_AT91_MODULE)
208static u64 mmc_dmamask = DMA_BIT_MASK(32);
209static struct at91_mmc_data mmc_data;
210
211static struct resource mmc_resources[] = {
212 [0] = {
213 .start = AT572D940HF_BASE_MCI,
214 .end = AT572D940HF_BASE_MCI + SZ_16K - 1,
215 .flags = IORESOURCE_MEM,
216 },
217 [1] = {
218 .start = AT572D940HF_ID_MCI,
219 .end = AT572D940HF_ID_MCI,
220 .flags = IORESOURCE_IRQ,
221 },
222};
223
224static struct platform_device at572d940hf_mmc_device = {
225 .name = "at91_mci",
226 .id = -1,
227 .dev = {
228 .dma_mask = &mmc_dmamask,
229 .coherent_dma_mask = DMA_BIT_MASK(32),
230 .platform_data = &mmc_data,
231 },
232 .resource = mmc_resources,
233 .num_resources = ARRAY_SIZE(mmc_resources),
234};
235
236void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data)
237{
238 if (!data)
239 return;
240
241 /* input/irq */
242 if (data->det_pin) {
243 at91_set_gpio_input(data->det_pin, 1);
244 at91_set_deglitch(data->det_pin, 1);
245 }
246 if (data->wp_pin)
247 at91_set_gpio_input(data->wp_pin, 1);
248 if (data->vcc_pin)
249 at91_set_gpio_output(data->vcc_pin, 0);
250
251 /* CLK */
252 at91_set_A_periph(AT91_PIN_PC22, 0);
253
254 /* CMD */
255 at91_set_A_periph(AT91_PIN_PC23, 1);
256
257 /* DAT0, maybe DAT1..DAT3 */
258 at91_set_A_periph(AT91_PIN_PC24, 1);
259 if (data->wire4) {
260 at91_set_A_periph(AT91_PIN_PC25, 1);
261 at91_set_A_periph(AT91_PIN_PC26, 1);
262 at91_set_A_periph(AT91_PIN_PC27, 1);
263 }
264
265 mmc_data = *data;
266 platform_device_register(&at572d940hf_mmc_device);
267}
268#else
269void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) {}
270#endif
271
272
273/* --------------------------------------------------------------------
274 * NAND / SmartMedia
275 * -------------------------------------------------------------------- */
276
277#if defined(CONFIG_MTD_NAND_ATMEL) || defined(CONFIG_MTD_NAND_ATMEL_MODULE)
278static struct atmel_nand_data nand_data;
279
280#define NAND_BASE AT91_CHIPSELECT_3
281
282static struct resource nand_resources[] = {
283 {
284 .start = NAND_BASE,
285 .end = NAND_BASE + SZ_256M - 1,
286 .flags = IORESOURCE_MEM,
287 }
288};
289
290static struct platform_device at572d940hf_nand_device = {
291 .name = "atmel_nand",
292 .id = -1,
293 .dev = {
294 .platform_data = &nand_data,
295 },
296 .resource = nand_resources,
297 .num_resources = ARRAY_SIZE(nand_resources),
298};
299
300void __init at91_add_device_nand(struct atmel_nand_data *data)
301{
302 unsigned long csa;
303
304 if (!data)
305 return;
306
307 csa = at91_sys_read(AT91_MATRIX_EBICSA);
308 at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_CS3A_SMC_SMARTMEDIA);
309
310 /* enable pin */
311 if (data->enable_pin)
312 at91_set_gpio_output(data->enable_pin, 1);
313
314 /* ready/busy pin */
315 if (data->rdy_pin)
316 at91_set_gpio_input(data->rdy_pin, 1);
317
318 /* card detect pin */
319 if (data->det_pin)
320 at91_set_gpio_input(data->det_pin, 1);
321
322 at91_set_A_periph(AT91_PIN_PB28, 0); /* A[22] */
323 at91_set_B_periph(AT91_PIN_PA28, 0); /* NANDOE */
324 at91_set_B_periph(AT91_PIN_PA29, 0); /* NANDWE */
325
326 nand_data = *data;
327 platform_device_register(&at572d940hf_nand_device);
328}
329
330#else
331void __init at91_add_device_nand(struct atmel_nand_data *data) {}
332#endif
333
334
335/* --------------------------------------------------------------------
336 * TWI (i2c)
337 * -------------------------------------------------------------------- */
338
339/*
340 * Prefer the GPIO code since the TWI controller isn't robust
341 * (gets overruns and underruns under load) and can only issue
342 * repeated STARTs in one scenario (the driver doesn't yet handle them).
343 */
344
345#if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE)
346
347static struct i2c_gpio_platform_data pdata = {
348 .sda_pin = AT91_PIN_PC7,
349 .sda_is_open_drain = 1,
350 .scl_pin = AT91_PIN_PC8,
351 .scl_is_open_drain = 1,
352 .udelay = 2, /* ~100 kHz */
353};
354
355static struct platform_device at572d940hf_twi_device {
356 .name = "i2c-gpio",
357 .id = -1,
358 .dev.platform_data = &pdata,
359};
360
361void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices)
362{
363 at91_set_GPIO_periph(AT91_PIN_PC7, 1); /* TWD (SDA) */
364 at91_set_multi_drive(AT91_PIN_PC7, 1);
365
366 at91_set_GPIO_periph(AT91_PIN_PA8, 1); /* TWCK (SCL) */
367 at91_set_multi_drive(AT91_PIN_PC8, 1);
368
369 i2c_register_board_info(0, devices, nr_devices);
370 platform_device_register(&at572d940hf_twi_device);
371}
372
373#elif defined(CONFIG_I2C_AT91) || defined(CONFIG_I2C_AT91_MODULE)
374
375static struct resource twi0_resources[] = {
376 [0] = {
377 .start = AT572D940HF_BASE_TWI0,
378 .end = AT572D940HF_BASE_TWI0 + SZ_16K - 1,
379 .flags = IORESOURCE_MEM,
380 },
381 [1] = {
382 .start = AT572D940HF_ID_TWI0,
383 .end = AT572D940HF_ID_TWI0,
384 .flags = IORESOURCE_IRQ,
385 },
386};
387
388static struct platform_device at572d940hf_twi0_device = {
389 .name = "at91_i2c",
390 .id = 0,
391 .resource = twi0_resources,
392 .num_resources = ARRAY_SIZE(twi0_resources),
393};
394
395static struct resource twi1_resources[] = {
396 [0] = {
397 .start = AT572D940HF_BASE_TWI1,
398 .end = AT572D940HF_BASE_TWI1 + SZ_16K - 1,
399 .flags = IORESOURCE_MEM,
400 },
401 [1] = {
402 .start = AT572D940HF_ID_TWI1,
403 .end = AT572D940HF_ID_TWI1,
404 .flags = IORESOURCE_IRQ,
405 },
406};
407
408static struct platform_device at572d940hf_twi1_device = {
409 .name = "at91_i2c",
410 .id = 1,
411 .resource = twi1_resources,
412 .num_resources = ARRAY_SIZE(twi1_resources),
413};
414
415void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices)
416{
417 /* pins used for TWI0 interface */
418 at91_set_A_periph(AT91_PIN_PC7, 0); /* TWD */
419 at91_set_multi_drive(AT91_PIN_PC7, 1);
420
421 at91_set_A_periph(AT91_PIN_PC8, 0); /* TWCK */
422 at91_set_multi_drive(AT91_PIN_PC8, 1);
423
424 /* pins used for TWI1 interface */
425 at91_set_A_periph(AT91_PIN_PC20, 0); /* TWD */
426 at91_set_multi_drive(AT91_PIN_PC20, 1);
427
428 at91_set_A_periph(AT91_PIN_PC21, 0); /* TWCK */
429 at91_set_multi_drive(AT91_PIN_PC21, 1);
430
431 i2c_register_board_info(0, devices, nr_devices);
432 platform_device_register(&at572d940hf_twi0_device);
433 platform_device_register(&at572d940hf_twi1_device);
434}
435#else
436void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices) {}
437#endif
438
439
440/* --------------------------------------------------------------------
441 * SPI
442 * -------------------------------------------------------------------- */
443
444#if defined(CONFIG_SPI_ATMEL) || defined(CONFIG_SPI_ATMEL_MODULE)
445static u64 spi_dmamask = DMA_BIT_MASK(32);
446
447static struct resource spi0_resources[] = {
448 [0] = {
449 .start = AT572D940HF_BASE_SPI0,
450 .end = AT572D940HF_BASE_SPI0 + SZ_16K - 1,
451 .flags = IORESOURCE_MEM,
452 },
453 [1] = {
454 .start = AT572D940HF_ID_SPI0,
455 .end = AT572D940HF_ID_SPI0,
456 .flags = IORESOURCE_IRQ,
457 },
458};
459
460static struct platform_device at572d940hf_spi0_device = {
461 .name = "atmel_spi",
462 .id = 0,
463 .dev = {
464 .dma_mask = &spi_dmamask,
465 .coherent_dma_mask = DMA_BIT_MASK(32),
466 },
467 .resource = spi0_resources,
468 .num_resources = ARRAY_SIZE(spi0_resources),
469};
470
471static const unsigned spi0_standard_cs[4] = { AT91_PIN_PA3, AT91_PIN_PA4, AT91_PIN_PA5, AT91_PIN_PA6 };
472
473static struct resource spi1_resources[] = {
474 [0] = {
475 .start = AT572D940HF_BASE_SPI1,
476 .end = AT572D940HF_BASE_SPI1 + SZ_16K - 1,
477 .flags = IORESOURCE_MEM,
478 },
479 [1] = {
480 .start = AT572D940HF_ID_SPI1,
481 .end = AT572D940HF_ID_SPI1,
482 .flags = IORESOURCE_IRQ,
483 },
484};
485
486static struct platform_device at572d940hf_spi1_device = {
487 .name = "atmel_spi",
488 .id = 1,
489 .dev = {
490 .dma_mask = &spi_dmamask,
491 .coherent_dma_mask = DMA_BIT_MASK(32),
492 },
493 .resource = spi1_resources,
494 .num_resources = ARRAY_SIZE(spi1_resources),
495};
496
497static const unsigned spi1_standard_cs[4] = { AT91_PIN_PC3, AT91_PIN_PC4, AT91_PIN_PC5, AT91_PIN_PC6 };
498
499void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices)
500{
501 int i;
502 unsigned long cs_pin;
503 short enable_spi0 = 0;
504 short enable_spi1 = 0;
505
506 /* Choose SPI chip-selects */
507 for (i = 0; i < nr_devices; i++) {
508 if (devices[i].controller_data)
509 cs_pin = (unsigned long) devices[i].controller_data;
510 else if (devices[i].bus_num == 0)
511 cs_pin = spi0_standard_cs[devices[i].chip_select];
512 else
513 cs_pin = spi1_standard_cs[devices[i].chip_select];
514
515 if (devices[i].bus_num == 0)
516 enable_spi0 = 1;
517 else
518 enable_spi1 = 1;
519
520 /* enable chip-select pin */
521 at91_set_gpio_output(cs_pin, 1);
522
523 /* pass chip-select pin to driver */
524 devices[i].controller_data = (void *) cs_pin;
525 }
526
527 spi_register_board_info(devices, nr_devices);
528
529 /* Configure SPI bus(es) */
530 if (enable_spi0) {
531 at91_set_A_periph(AT91_PIN_PA0, 0); /* SPI0_MISO */
532 at91_set_A_periph(AT91_PIN_PA1, 0); /* SPI0_MOSI */
533 at91_set_A_periph(AT91_PIN_PA2, 0); /* SPI0_SPCK */
534
535 at91_clock_associate("spi0_clk", &at572d940hf_spi0_device.dev, "spi_clk");
536 platform_device_register(&at572d940hf_spi0_device);
537 }
538 if (enable_spi1) {
539 at91_set_A_periph(AT91_PIN_PC0, 0); /* SPI1_MISO */
540 at91_set_A_periph(AT91_PIN_PC1, 0); /* SPI1_MOSI */
541 at91_set_A_periph(AT91_PIN_PC2, 0); /* SPI1_SPCK */
542
543 at91_clock_associate("spi1_clk", &at572d940hf_spi1_device.dev, "spi_clk");
544 platform_device_register(&at572d940hf_spi1_device);
545 }
546}
547#else
548void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices) {}
549#endif
550
551
552/* --------------------------------------------------------------------
553 * Timer/Counter blocks
554 * -------------------------------------------------------------------- */
555
556#ifdef CONFIG_ATMEL_TCLIB
557
558static struct resource tcb_resources[] = {
559 [0] = {
560 .start = AT572D940HF_BASE_TCB,
561 .end = AT572D940HF_BASE_TCB + SZ_16K - 1,
562 .flags = IORESOURCE_MEM,
563 },
564 [1] = {
565 .start = AT572D940HF_ID_TC0,
566 .end = AT572D940HF_ID_TC0,
567 .flags = IORESOURCE_IRQ,
568 },
569 [2] = {
570 .start = AT572D940HF_ID_TC1,
571 .end = AT572D940HF_ID_TC1,
572 .flags = IORESOURCE_IRQ,
573 },
574 [3] = {
575 .start = AT572D940HF_ID_TC2,
576 .end = AT572D940HF_ID_TC2,
577 .flags = IORESOURCE_IRQ,
578 },
579};
580
581static struct platform_device at572d940hf_tcb_device = {
582 .name = "atmel_tcb",
583 .id = 0,
584 .resource = tcb_resources,
585 .num_resources = ARRAY_SIZE(tcb_resources),
586};
587
588static void __init at91_add_device_tc(void)
589{
590 /* this chip has a separate clock and irq for each TC channel */
591 at91_clock_associate("tc0_clk", &at572d940hf_tcb_device.dev, "t0_clk");
592 at91_clock_associate("tc1_clk", &at572d940hf_tcb_device.dev, "t1_clk");
593 at91_clock_associate("tc2_clk", &at572d940hf_tcb_device.dev, "t2_clk");
594 platform_device_register(&at572d940hf_tcb_device);
595}
596#else
597static void __init at91_add_device_tc(void) { }
598#endif
599
600
601/* --------------------------------------------------------------------
602 * RTT
603 * -------------------------------------------------------------------- */
604
605static struct resource rtt_resources[] = {
606 {
607 .start = AT91_BASE_SYS + AT91_RTT,
608 .end = AT91_BASE_SYS + AT91_RTT + SZ_16 - 1,
609 .flags = IORESOURCE_MEM,
610 }
611};
612
613static struct platform_device at572d940hf_rtt_device = {
614 .name = "at91_rtt",
615 .id = 0,
616 .resource = rtt_resources,
617 .num_resources = ARRAY_SIZE(rtt_resources),
618};
619
620static void __init at91_add_device_rtt(void)
621{
622 platform_device_register(&at572d940hf_rtt_device);
623}
624
625
626/* --------------------------------------------------------------------
627 * Watchdog
628 * -------------------------------------------------------------------- */
629
630#if defined(CONFIG_AT91SAM9X_WATCHDOG) || defined(CONFIG_AT91SAM9X_WATCHDOG_MODULE)
631static struct platform_device at572d940hf_wdt_device = {
632 .name = "at91_wdt",
633 .id = -1,
634 .num_resources = 0,
635};
636
637static void __init at91_add_device_watchdog(void)
638{
639 platform_device_register(&at572d940hf_wdt_device);
640}
641#else
642static void __init at91_add_device_watchdog(void) {}
643#endif
644
645
646/* --------------------------------------------------------------------
647 * UART
648 * -------------------------------------------------------------------- */
649
650#if defined(CONFIG_SERIAL_ATMEL)
651static struct resource dbgu_resources[] = {
652 [0] = {
653 .start = AT91_VA_BASE_SYS + AT91_DBGU,
654 .end = AT91_VA_BASE_SYS + AT91_DBGU + SZ_512 - 1,
655 .flags = IORESOURCE_MEM,
656 },
657 [1] = {
658 .start = AT91_ID_SYS,
659 .end = AT91_ID_SYS,
660 .flags = IORESOURCE_IRQ,
661 },
662};
663
664static struct atmel_uart_data dbgu_data = {
665 .use_dma_tx = 0,
666 .use_dma_rx = 0, /* DBGU not capable of receive DMA */
667 .regs = (void __iomem *)(AT91_VA_BASE_SYS + AT91_DBGU),
668};
669
670static u64 dbgu_dmamask = DMA_BIT_MASK(32);
671
672static struct platform_device at572d940hf_dbgu_device = {
673 .name = "atmel_usart",
674 .id = 0,
675 .dev = {
676 .dma_mask = &dbgu_dmamask,
677 .coherent_dma_mask = DMA_BIT_MASK(32),
678 .platform_data = &dbgu_data,
679 },
680 .resource = dbgu_resources,
681 .num_resources = ARRAY_SIZE(dbgu_resources),
682};
683
684static inline void configure_dbgu_pins(void)
685{
686 at91_set_A_periph(AT91_PIN_PC31, 1); /* DTXD */
687 at91_set_A_periph(AT91_PIN_PC30, 0); /* DRXD */
688}
689
690static struct resource uart0_resources[] = {
691 [0] = {
692 .start = AT572D940HF_BASE_US0,
693 .end = AT572D940HF_BASE_US0 + SZ_16K - 1,
694 .flags = IORESOURCE_MEM,
695 },
696 [1] = {
697 .start = AT572D940HF_ID_US0,
698 .end = AT572D940HF_ID_US0,
699 .flags = IORESOURCE_IRQ,
700 },
701};
702
703static struct atmel_uart_data uart0_data = {
704 .use_dma_tx = 1,
705 .use_dma_rx = 1,
706};
707
708static u64 uart0_dmamask = DMA_BIT_MASK(32);
709
710static struct platform_device at572d940hf_uart0_device = {
711 .name = "atmel_usart",
712 .id = 1,
713 .dev = {
714 .dma_mask = &uart0_dmamask,
715 .coherent_dma_mask = DMA_BIT_MASK(32),
716 .platform_data = &uart0_data,
717 },
718 .resource = uart0_resources,
719 .num_resources = ARRAY_SIZE(uart0_resources),
720};
721
722static inline void configure_usart0_pins(unsigned pins)
723{
724 at91_set_A_periph(AT91_PIN_PA8, 1); /* TXD0 */
725 at91_set_A_periph(AT91_PIN_PA7, 0); /* RXD0 */
726
727 if (pins & ATMEL_UART_RTS)
728 at91_set_A_periph(AT91_PIN_PA10, 0); /* RTS0 */
729 if (pins & ATMEL_UART_CTS)
730 at91_set_A_periph(AT91_PIN_PA9, 0); /* CTS0 */
731}
732
733static struct resource uart1_resources[] = {
734 [0] = {
735 .start = AT572D940HF_BASE_US1,
736 .end = AT572D940HF_BASE_US1 + SZ_16K - 1,
737 .flags = IORESOURCE_MEM,
738 },
739 [1] = {
740 .start = AT572D940HF_ID_US1,
741 .end = AT572D940HF_ID_US1,
742 .flags = IORESOURCE_IRQ,
743 },
744};
745
746static struct atmel_uart_data uart1_data = {
747 .use_dma_tx = 1,
748 .use_dma_rx = 1,
749};
750
751static u64 uart1_dmamask = DMA_BIT_MASK(32);
752
753static struct platform_device at572d940hf_uart1_device = {
754 .name = "atmel_usart",
755 .id = 2,
756 .dev = {
757 .dma_mask = &uart1_dmamask,
758 .coherent_dma_mask = DMA_BIT_MASK(32),
759 .platform_data = &uart1_data,
760 },
761 .resource = uart1_resources,
762 .num_resources = ARRAY_SIZE(uart1_resources),
763};
764
765static inline void configure_usart1_pins(unsigned pins)
766{
767 at91_set_A_periph(AT91_PIN_PC10, 1); /* TXD1 */
768 at91_set_A_periph(AT91_PIN_PC9 , 0); /* RXD1 */
769
770 if (pins & ATMEL_UART_RTS)
771 at91_set_A_periph(AT91_PIN_PC12, 0); /* RTS1 */
772 if (pins & ATMEL_UART_CTS)
773 at91_set_A_periph(AT91_PIN_PC11, 0); /* CTS1 */
774}
775
776static struct resource uart2_resources[] = {
777 [0] = {
778 .start = AT572D940HF_BASE_US2,
779 .end = AT572D940HF_BASE_US2 + SZ_16K - 1,
780 .flags = IORESOURCE_MEM,
781 },
782 [1] = {
783 .start = AT572D940HF_ID_US2,
784 .end = AT572D940HF_ID_US2,
785 .flags = IORESOURCE_IRQ,
786 },
787};
788
789static struct atmel_uart_data uart2_data = {
790 .use_dma_tx = 1,
791 .use_dma_rx = 1,
792};
793
794static u64 uart2_dmamask = DMA_BIT_MASK(32);
795
796static struct platform_device at572d940hf_uart2_device = {
797 .name = "atmel_usart",
798 .id = 3,
799 .dev = {
800 .dma_mask = &uart2_dmamask,
801 .coherent_dma_mask = DMA_BIT_MASK(32),
802 .platform_data = &uart2_data,
803 },
804 .resource = uart2_resources,
805 .num_resources = ARRAY_SIZE(uart2_resources),
806};
807
808static inline void configure_usart2_pins(unsigned pins)
809{
810 at91_set_A_periph(AT91_PIN_PC15, 1); /* TXD2 */
811 at91_set_A_periph(AT91_PIN_PC14, 0); /* RXD2 */
812
813 if (pins & ATMEL_UART_RTS)
814 at91_set_A_periph(AT91_PIN_PC17, 0); /* RTS2 */
815 if (pins & ATMEL_UART_CTS)
816 at91_set_A_periph(AT91_PIN_PC16, 0); /* CTS2 */
817}
818
819static struct platform_device *__initdata at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */
820struct platform_device *atmel_default_console_device; /* the serial console device */
821
822void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
823{
824 struct platform_device *pdev;
825
826 switch (id) {
827 case 0: /* DBGU */
828 pdev = &at572d940hf_dbgu_device;
829 configure_dbgu_pins();
830 at91_clock_associate("mck", &pdev->dev, "usart");
831 break;
832 case AT572D940HF_ID_US0:
833 pdev = &at572d940hf_uart0_device;
834 configure_usart0_pins(pins);
835 at91_clock_associate("usart0_clk", &pdev->dev, "usart");
836 break;
837 case AT572D940HF_ID_US1:
838 pdev = &at572d940hf_uart1_device;
839 configure_usart1_pins(pins);
840 at91_clock_associate("usart1_clk", &pdev->dev, "usart");
841 break;
842 case AT572D940HF_ID_US2:
843 pdev = &at572d940hf_uart2_device;
844 configure_usart2_pins(pins);
845 at91_clock_associate("usart2_clk", &pdev->dev, "usart");
846 break;
847 default:
848 return;
849 }
850 pdev->id = portnr; /* update to mapped ID */
851
852 if (portnr < ATMEL_MAX_UART)
853 at91_uarts[portnr] = pdev;
854}
855
856void __init at91_set_serial_console(unsigned portnr)
857{
858 if (portnr < ATMEL_MAX_UART)
859 atmel_default_console_device = at91_uarts[portnr];
860}
861
862void __init at91_add_device_serial(void)
863{
864 int i;
865
866 for (i = 0; i < ATMEL_MAX_UART; i++) {
867 if (at91_uarts[i])
868 platform_device_register(at91_uarts[i]);
869 }
870
871 if (!atmel_default_console_device)
872 printk(KERN_INFO "AT91: No default serial console defined.\n");
873}
874
875#else
876void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) {}
877void __init at91_set_serial_console(unsigned portnr) {}
878void __init at91_add_device_serial(void) {}
879#endif
880
881
882/* --------------------------------------------------------------------
883 * mAgic
884 * -------------------------------------------------------------------- */
885
886#ifdef CONFIG_MAGICV
887static struct resource mAgic_resources[] = {
888 {
889 .start = AT91_MAGIC_PM_BASE,
890 .end = AT91_MAGIC_PM_BASE + AT91_MAGIC_PM_SIZE - 1,
891 .flags = IORESOURCE_MEM,
892 },
893 {
894 .start = AT91_MAGIC_DM_I_BASE,
895 .end = AT91_MAGIC_DM_I_BASE + AT91_MAGIC_DM_I_SIZE - 1,
896 .flags = IORESOURCE_MEM,
897 },
898 {
899 .start = AT91_MAGIC_DM_F_BASE,
900 .end = AT91_MAGIC_DM_F_BASE + AT91_MAGIC_DM_F_SIZE - 1,
901 .flags = IORESOURCE_MEM,
902 },
903 {
904 .start = AT91_MAGIC_DM_DB_BASE,
905 .end = AT91_MAGIC_DM_DB_BASE + AT91_MAGIC_DM_DB_SIZE - 1,
906 .flags = IORESOURCE_MEM,
907 },
908 {
909 .start = AT91_MAGIC_REGS_BASE,
910 .end = AT91_MAGIC_REGS_BASE + AT91_MAGIC_REGS_SIZE - 1,
911 .flags = IORESOURCE_MEM,
912 },
913 {
914 .start = AT91_MAGIC_EXTPAGE_BASE,
915 .end = AT91_MAGIC_EXTPAGE_BASE + AT91_MAGIC_EXTPAGE_SIZE - 1,
916 .flags = IORESOURCE_MEM,
917 },
918 {
919 .start = AT572D940HF_ID_MSIRQ0,
920 .end = AT572D940HF_ID_MSIRQ0,
921 .flags = IORESOURCE_IRQ,
922 },
923 {
924 .start = AT572D940HF_ID_MHALT,
925 .end = AT572D940HF_ID_MHALT,
926 .flags = IORESOURCE_IRQ,
927 },
928 {
929 .start = AT572D940HF_ID_MEXC,
930 .end = AT572D940HF_ID_MEXC,
931 .flags = IORESOURCE_IRQ,
932 },
933 {
934 .start = AT572D940HF_ID_MEDMA,
935 .end = AT572D940HF_ID_MEDMA,
936 .flags = IORESOURCE_IRQ,
937 },
938};
939
940static struct platform_device mAgic_device = {
941 .name = "mAgic",
942 .id = -1,
943 .num_resources = ARRAY_SIZE(mAgic_resources),
944 .resource = mAgic_resources,
945};
946
947void __init at91_add_device_mAgic(void)
948{
949 platform_device_register(&mAgic_device);
950}
951#else
952void __init at91_add_device_mAgic(void) {}
953#endif
954
955
956/* -------------------------------------------------------------------- */
957
958/*
959 * These devices are always present and don't need any board-specific
960 * setup.
961 */
962static int __init at91_add_standard_devices(void)
963{
964 at91_add_device_rtt();
965 at91_add_device_watchdog();
966 at91_add_device_tc();
967 return 0;
968}
969
970arch_initcall(at91_add_standard_devices);
diff --git a/arch/arm/mach-at91/board-at572d940hf_ek.c b/arch/arm/mach-at91/board-at572d940hf_ek.c
new file mode 100644
index 000000000000..5daff277f53e
--- /dev/null
+++ b/arch/arm/mach-at91/board-at572d940hf_ek.c
@@ -0,0 +1,328 @@
1/*
2 * linux/arch/arm/mach-at91/board-at572d940hf_ek.c
3 *
4 * Copyright (C) 2008 Atmel Antonio R. Costa <costa.antonior@gmail.com>
5 * Copyright (C) 2005 SAN People
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21
22#include <linux/types.h>
23#include <linux/init.h>
24#include <linux/mm.h>
25#include <linux/module.h>
26#include <linux/platform_device.h>
27#include <linux/spi/spi.h>
28#include <linux/spi/ds1305.h>
29#include <linux/irq.h>
30#include <linux/mtd/physmap.h>
31
32#include <mach/hardware.h>
33#include <asm/setup.h>
34#include <asm/mach-types.h>
35#include <asm/irq.h>
36
37#include <asm/mach/arch.h>
38#include <asm/mach/map.h>
39#include <asm/mach/irq.h>
40
41#include <mach/board.h>
42#include <mach/gpio.h>
43#include <mach/at91sam9_smc.h>
44
45#include "sam9_smc.h"
46#include "generic.h"
47
48
49static void __init eb_map_io(void)
50{
51 /* Initialize processor: 12.500 MHz crystal */
52 at572d940hf_initialize(12000000);
53
54 /* DBGU on ttyS0. (Rx & Tx only) */
55 at91_register_uart(0, 0, 0);
56
57 /* USART0 on ttyS1. (Rx & Tx only) */
58 at91_register_uart(AT572D940HF_ID_US0, 1, 0);
59
60 /* USART1 on ttyS2. (Rx & Tx only) */
61 at91_register_uart(AT572D940HF_ID_US1, 2, 0);
62
63 /* USART2 on ttyS3. (Tx & Rx only */
64 at91_register_uart(AT572D940HF_ID_US2, 3, 0);
65
66 /* set serial console to ttyS0 (ie, DBGU) */
67 at91_set_serial_console(0);
68}
69
70static void __init eb_init_irq(void)
71{
72 at572d940hf_init_interrupts(NULL);
73}
74
75
76/*
77 * USB Host Port
78 */
79static struct at91_usbh_data __initdata eb_usbh_data = {
80 .ports = 2,
81};
82
83
84/*
85 * USB Device Port
86 */
87static struct at91_udc_data __initdata eb_udc_data = {
88 .vbus_pin = 0, /* no VBUS detection,UDC always on */
89 .pullup_pin = 0, /* pull-up driven by UDC */
90};
91
92
93/*
94 * MCI (SD/MMC)
95 */
96static struct at91_mmc_data __initdata eb_mmc_data = {
97 .wire4 = 1,
98/* .det_pin = ... not connected */
99/* .wp_pin = ... not connected */
100/* .vcc_pin = ... not connected */
101};
102
103
104/*
105 * MACB Ethernet device
106 */
107static struct at91_eth_data __initdata eb_eth_data = {
108 .phy_irq_pin = AT91_PIN_PB25,
109 .is_rmii = 1,
110};
111
112/*
113 * NOR flash
114 */
115
116static struct mtd_partition eb_nor_partitions[] = {
117 {
118 .name = "Raw Environment",
119 .offset = 0,
120 .size = SZ_4M,
121 .mask_flags = 0,
122 },
123 {
124 .name = "OS FS",
125 .offset = MTDPART_OFS_APPEND,
126 .size = 3 * SZ_1M,
127 .mask_flags = 0,
128 },
129 {
130 .name = "APP FS",
131 .offset = MTDPART_OFS_APPEND,
132 .size = MTDPART_SIZ_FULL,
133 .mask_flags = 0,
134 },
135};
136
137static void nor_flash_set_vpp(struct map_info* mi, int i) {
138};
139
140static struct physmap_flash_data nor_flash_data = {
141 .width = 4,
142 .parts = eb_nor_partitions,
143 .nr_parts = ARRAY_SIZE(eb_nor_partitions),
144 .set_vpp = nor_flash_set_vpp,
145};
146
147static struct resource nor_flash_resources[] = {
148 {
149 .start = AT91_CHIPSELECT_0,
150 .end = AT91_CHIPSELECT_0 + SZ_16M - 1,
151 .flags = IORESOURCE_MEM,
152 },
153};
154
155static struct platform_device nor_flash = {
156 .name = "physmap-flash",
157 .id = 0,
158 .dev = {
159 .platform_data = &nor_flash_data,
160 },
161 .resource = nor_flash_resources,
162 .num_resources = ARRAY_SIZE(nor_flash_resources),
163};
164
165static struct sam9_smc_config __initdata eb_nor_smc_config = {
166 .ncs_read_setup = 1,
167 .nrd_setup = 1,
168 .ncs_write_setup = 1,
169 .nwe_setup = 1,
170
171 .ncs_read_pulse = 7,
172 .nrd_pulse = 7,
173 .ncs_write_pulse = 7,
174 .nwe_pulse = 7,
175
176 .read_cycle = 9,
177 .write_cycle = 9,
178
179 .mode = AT91_SMC_READMODE | AT91_SMC_WRITEMODE | AT91_SMC_EXNWMODE_DISABLE | AT91_SMC_BAT_WRITE | AT91_SMC_DBW_32,
180 .tdf_cycles = 1,
181};
182
183static void __init eb_add_device_nor(void)
184{
185 /* configure chip-select 0 (NOR) */
186 sam9_smc_configure(0, &eb_nor_smc_config);
187 platform_device_register(&nor_flash);
188}
189
190/*
191 * NAND flash
192 */
193static struct mtd_partition __initdata eb_nand_partition[] = {
194 {
195 .name = "Partition 1",
196 .offset = 0,
197 .size = SZ_16M,
198 },
199 {
200 .name = "Partition 2",
201 .offset = MTDPART_OFS_NXTBLK,
202 .size = MTDPART_SIZ_FULL,
203 }
204};
205
206static struct mtd_partition * __init nand_partitions(int size, int *num_partitions)
207{
208 *num_partitions = ARRAY_SIZE(eb_nand_partition);
209 return eb_nand_partition;
210}
211
212static struct atmel_nand_data __initdata eb_nand_data = {
213 .ale = 22,
214 .cle = 21,
215/* .det_pin = ... not connected */
216/* .rdy_pin = AT91_PIN_PC16, */
217 .enable_pin = AT91_PIN_PA15,
218 .partition_info = nand_partitions,
219#if defined(CONFIG_MTD_NAND_AT91_BUSWIDTH_16)
220 .bus_width_16 = 1,
221#else
222 .bus_width_16 = 0,
223#endif
224};
225
226static struct sam9_smc_config __initdata eb_nand_smc_config = {
227 .ncs_read_setup = 0,
228 .nrd_setup = 0,
229 .ncs_write_setup = 1,
230 .nwe_setup = 1,
231
232 .ncs_read_pulse = 3,
233 .nrd_pulse = 3,
234 .ncs_write_pulse = 3,
235 .nwe_pulse = 3,
236
237 .read_cycle = 5,
238 .write_cycle = 5,
239
240 .mode = AT91_SMC_READMODE | AT91_SMC_WRITEMODE | AT91_SMC_EXNWMODE_DISABLE,
241 .tdf_cycles = 12,
242};
243
244static void __init eb_add_device_nand(void)
245{
246 /* setup bus-width (8 or 16) */
247 if (eb_nand_data.bus_width_16)
248 eb_nand_smc_config.mode |= AT91_SMC_DBW_16;
249 else
250 eb_nand_smc_config.mode |= AT91_SMC_DBW_8;
251
252 /* configure chip-select 3 (NAND) */
253 sam9_smc_configure(3, &eb_nand_smc_config);
254
255 at91_add_device_nand(&eb_nand_data);
256}
257
258
259/*
260 * SPI devices
261 */
262static struct resource rtc_resources[] = {
263 [0] = {
264 .start = AT572D940HF_ID_IRQ1,
265 .end = AT572D940HF_ID_IRQ1,
266 .flags = IORESOURCE_IRQ,
267 },
268};
269
270static struct ds1305_platform_data ds1306_data = {
271 .is_ds1306 = true,
272 .en_1hz = false,
273};
274
275static struct spi_board_info eb_spi_devices[] = {
276 { /* RTC Dallas DS1306 */
277 .modalias = "rtc-ds1305",
278 .chip_select = 3,
279 .mode = SPI_CS_HIGH | SPI_CPOL | SPI_CPHA,
280 .max_speed_hz = 500000,
281 .bus_num = 0,
282 .irq = AT572D940HF_ID_IRQ1,
283 .platform_data = (void *) &ds1306_data,
284 },
285#if defined(CONFIG_MTD_AT91_DATAFLASH_CARD)
286 { /* Dataflash card */
287 .modalias = "mtd_dataflash",
288 .chip_select = 0,
289 .max_speed_hz = 15 * 1000 * 1000,
290 .bus_num = 0,
291 },
292#endif
293};
294
295static void __init eb_board_init(void)
296{
297 /* Serial */
298 at91_add_device_serial();
299 /* USB Host */
300 at91_add_device_usbh(&eb_usbh_data);
301 /* USB Device */
302 at91_add_device_udc(&eb_udc_data);
303 /* I2C */
304 at91_add_device_i2c(NULL, 0);
305 /* NOR */
306 eb_add_device_nor();
307 /* NAND */
308 eb_add_device_nand();
309 /* SPI */
310 at91_add_device_spi(eb_spi_devices, ARRAY_SIZE(eb_spi_devices));
311 /* MMC */
312 at91_add_device_mmc(0, &eb_mmc_data);
313 /* Ethernet */
314 at91_add_device_eth(&eb_eth_data);
315 /* mAgic */
316 at91_add_device_mAgic();
317}
318
319MACHINE_START(AT572D940HFEB, "Atmel AT91D940HF-EB")
320 /* Maintainer: Atmel <costa.antonior@gmail.com> */
321 .phys_io = AT91_BASE_SYS,
322 .io_pg_offst = (AT91_VA_BASE_SYS >> 18) & 0xfffc,
323 .boot_params = AT91_SDRAM_BASE + 0x100,
324 .timer = &at91sam926x_timer,
325 .map_io = eb_map_io,
326 .init_irq = eb_init_irq,
327 .init_machine = eb_board_init,
328MACHINE_END
diff --git a/arch/arm/mach-at91/clock.c b/arch/arm/mach-at91/clock.c
index c042dcf4725f..7f7da439341f 100644
--- a/arch/arm/mach-at91/clock.c
+++ b/arch/arm/mach-at91/clock.c
@@ -29,6 +29,7 @@
29#include <mach/cpu.h> 29#include <mach/cpu.h>
30 30
31#include "clock.h" 31#include "clock.h"
32#include "generic.h"
32 33
33 34
34/* 35/*
@@ -628,7 +629,7 @@ static void __init at91_pllb_usbfs_clock_init(unsigned long main_clock)
628 at91_sys_write(AT91_PMC_SCER, AT91RM9200_PMC_MCKUDP); 629 at91_sys_write(AT91_PMC_SCER, AT91RM9200_PMC_MCKUDP);
629 } else if (cpu_is_at91sam9260() || cpu_is_at91sam9261() || 630 } else if (cpu_is_at91sam9260() || cpu_is_at91sam9261() ||
630 cpu_is_at91sam9263() || cpu_is_at91sam9g20() || 631 cpu_is_at91sam9263() || cpu_is_at91sam9g20() ||
631 cpu_is_at91sam9g10()) { 632 cpu_is_at91sam9g10() || cpu_is_at572d940hf()) {
632 uhpck.pmc_mask = AT91SAM926x_PMC_UHP; 633 uhpck.pmc_mask = AT91SAM926x_PMC_UHP;
633 udpck.pmc_mask = AT91SAM926x_PMC_UDP; 634 udpck.pmc_mask = AT91SAM926x_PMC_UDP;
634 } else if (cpu_is_at91cap9()) { 635 } else if (cpu_is_at91cap9()) {
@@ -711,12 +712,13 @@ int __init at91_clock_init(unsigned long main_clock)
711 /* 712 /*
712 * USB HS clock init 713 * USB HS clock init
713 */ 714 */
714 if (cpu_has_utmi()) 715 if (cpu_has_utmi()) {
715 /* 716 /*
716 * multiplier is hard-wired to 40 717 * multiplier is hard-wired to 40
717 * (obtain the USB High Speed 480 MHz when input is 12 MHz) 718 * (obtain the USB High Speed 480 MHz when input is 12 MHz)
718 */ 719 */
719 utmi_clk.rate_hz = 40 * utmi_clk.parent->rate_hz; 720 utmi_clk.rate_hz = 40 * utmi_clk.parent->rate_hz;
721 }
720 722
721 /* 723 /*
722 * USB FS clock init 724 * USB FS clock init
@@ -746,7 +748,7 @@ int __init at91_clock_init(unsigned long main_clock)
746 mck.rate_hz = (mckr & AT91_PMC_MDIV) == AT91SAM9_PMC_MDIV_3 ? 748 mck.rate_hz = (mckr & AT91_PMC_MDIV) == AT91SAM9_PMC_MDIV_3 ?
747 freq / 3 : freq / (1 << ((mckr & AT91_PMC_MDIV) >> 8)); /* mdiv */ 749 freq / 3 : freq / (1 << ((mckr & AT91_PMC_MDIV) >> 8)); /* mdiv */
748 } else { 750 } else {
749 mck.rate_hz = freq / (1 << ((mckr & AT91_PMC_MDIV) >> 8)); /* mdiv */ 751 mck.rate_hz = freq / (1 << ((mckr & AT91_PMC_MDIV) >> 8)); /* mdiv */
750 } 752 }
751 753
752 /* Register the PMC's standard clocks */ 754 /* Register the PMC's standard clocks */
diff --git a/arch/arm/mach-at91/clock.h b/arch/arm/mach-at91/clock.h
index 1ba3b95ff359..6cf4b78e175d 100644
--- a/arch/arm/mach-at91/clock.h
+++ b/arch/arm/mach-at91/clock.h
@@ -22,7 +22,7 @@ struct clk {
22 struct clk *parent; 22 struct clk *parent;
23 u32 pmc_mask; 23 u32 pmc_mask;
24 void (*mode)(struct clk *, int); 24 void (*mode)(struct clk *, int);
25 unsigned id:2; /* PCK0..3, or 32k/main/a/b */ 25 unsigned id:3; /* PCK0..4, or 32k/main/a/b */
26 unsigned type; /* clock type */ 26 unsigned type; /* clock type */
27 u16 users; 27 u16 users;
28}; 28};
diff --git a/arch/arm/mach-at91/generic.h b/arch/arm/mach-at91/generic.h
index 88e413b38480..65c3dc5ba0d0 100644
--- a/arch/arm/mach-at91/generic.h
+++ b/arch/arm/mach-at91/generic.h
@@ -17,6 +17,7 @@ extern void __init at91sam9rl_initialize(unsigned long main_clock);
17extern void __init at91sam9g45_initialize(unsigned long main_clock); 17extern void __init at91sam9g45_initialize(unsigned long main_clock);
18extern void __init at91x40_initialize(unsigned long main_clock); 18extern void __init at91x40_initialize(unsigned long main_clock);
19extern void __init at91cap9_initialize(unsigned long main_clock); 19extern void __init at91cap9_initialize(unsigned long main_clock);
20extern void __init at572d940hf_initialize(unsigned long main_clock);
20 21
21 /* Interrupts */ 22 /* Interrupts */
22extern void __init at91rm9200_init_interrupts(unsigned int priority[]); 23extern void __init at91rm9200_init_interrupts(unsigned int priority[]);
@@ -27,6 +28,7 @@ extern void __init at91sam9rl_init_interrupts(unsigned int priority[]);
27extern void __init at91sam9g45_init_interrupts(unsigned int priority[]); 28extern void __init at91sam9g45_init_interrupts(unsigned int priority[]);
28extern void __init at91x40_init_interrupts(unsigned int priority[]); 29extern void __init at91x40_init_interrupts(unsigned int priority[]);
29extern void __init at91cap9_init_interrupts(unsigned int priority[]); 30extern void __init at91cap9_init_interrupts(unsigned int priority[]);
31extern void __init at572d940hf_init_interrupts(unsigned int priority[]);
30extern void __init at91_aic_init(unsigned int priority[]); 32extern void __init at91_aic_init(unsigned int priority[]);
31 33
32 /* Timer */ 34 /* Timer */
diff --git a/arch/arm/mach-at91/include/mach/at572d940hf.h b/arch/arm/mach-at91/include/mach/at572d940hf.h
new file mode 100644
index 000000000000..2d9b0af9c4d5
--- /dev/null
+++ b/arch/arm/mach-at91/include/mach/at572d940hf.h
@@ -0,0 +1,123 @@
1/*
2 * include/mach/at572d940hf.h
3 *
4 * Antonio R. Costa <costa.antonior@gmail.com>
5 * Copyright (C) 2008 Atmel
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 *
21 */
22
23#ifndef AT572D940HF_H
24#define AT572D940HF_H
25
26/*
27 * Peripheral identifiers/interrupts.
28 */
29#define AT91_ID_FIQ 0 /* Advanced Interrupt Controller (FIQ) */
30#define AT91_ID_SYS 1 /* System Peripherals */
31#define AT572D940HF_ID_PIOA 2 /* Parallel IO Controller A */
32#define AT572D940HF_ID_PIOB 3 /* Parallel IO Controller B */
33#define AT572D940HF_ID_PIOC 4 /* Parallel IO Controller C */
34#define AT572D940HF_ID_EMAC 5 /* MACB ethernet controller */
35#define AT572D940HF_ID_US0 6 /* USART 0 */
36#define AT572D940HF_ID_US1 7 /* USART 1 */
37#define AT572D940HF_ID_US2 8 /* USART 2 */
38#define AT572D940HF_ID_MCI 9 /* Multimedia Card Interface */
39#define AT572D940HF_ID_UDP 10 /* USB Device Port */
40#define AT572D940HF_ID_TWI0 11 /* Two-Wire Interface 0 */
41#define AT572D940HF_ID_SPI0 12 /* Serial Peripheral Interface 0 */
42#define AT572D940HF_ID_SPI1 13 /* Serial Peripheral Interface 1 */
43#define AT572D940HF_ID_SSC0 14 /* Serial Synchronous Controller 0 */
44#define AT572D940HF_ID_SSC1 15 /* Serial Synchronous Controller 1 */
45#define AT572D940HF_ID_SSC2 16 /* Serial Synchronous Controller 2 */
46#define AT572D940HF_ID_TC0 17 /* Timer Counter 0 */
47#define AT572D940HF_ID_TC1 18 /* Timer Counter 1 */
48#define AT572D940HF_ID_TC2 19 /* Timer Counter 2 */
49#define AT572D940HF_ID_UHP 20 /* USB Host port */
50#define AT572D940HF_ID_SSC3 21 /* Serial Synchronous Controller 3 */
51#define AT572D940HF_ID_TWI1 22 /* Two-Wire Interface 1 */
52#define AT572D940HF_ID_CAN0 23 /* CAN Controller 0 */
53#define AT572D940HF_ID_CAN1 24 /* CAN Controller 1 */
54#define AT572D940HF_ID_MHALT 25 /* mAgicV HALT line */
55#define AT572D940HF_ID_MSIRQ0 26 /* mAgicV SIRQ0 line */
56#define AT572D940HF_ID_MEXC 27 /* mAgicV exception line */
57#define AT572D940HF_ID_MEDMA 28 /* mAgicV end of DMA line */
58#define AT572D940HF_ID_IRQ0 29 /* External Interrupt Source (IRQ0) */
59#define AT572D940HF_ID_IRQ1 30 /* External Interrupt Source (IRQ1) */
60#define AT572D940HF_ID_IRQ2 31 /* External Interrupt Source (IRQ2) */
61
62
63/*
64 * User Peripheral physical base addresses.
65 */
66#define AT572D940HF_BASE_TCB 0xfffa0000
67#define AT572D940HF_BASE_TC0 0xfffa0000
68#define AT572D940HF_BASE_TC1 0xfffa0040
69#define AT572D940HF_BASE_TC2 0xfffa0080
70#define AT572D940HF_BASE_UDP 0xfffa4000
71#define AT572D940HF_BASE_MCI 0xfffa8000
72#define AT572D940HF_BASE_TWI0 0xfffac000
73#define AT572D940HF_BASE_US0 0xfffb0000
74#define AT572D940HF_BASE_US1 0xfffb4000
75#define AT572D940HF_BASE_US2 0xfffb8000
76#define AT572D940HF_BASE_SSC0 0xfffbc000
77#define AT572D940HF_BASE_SSC1 0xfffc0000
78#define AT572D940HF_BASE_SSC2 0xfffc4000
79#define AT572D940HF_BASE_SPI0 0xfffc8000
80#define AT572D940HF_BASE_SPI1 0xfffcc000
81#define AT572D940HF_BASE_SSC3 0xfffd0000
82#define AT572D940HF_BASE_TWI1 0xfffd4000
83#define AT572D940HF_BASE_EMAC 0xfffd8000
84#define AT572D940HF_BASE_CAN0 0xfffdc000
85#define AT572D940HF_BASE_CAN1 0xfffe0000
86#define AT91_BASE_SYS 0xffffea00
87
88
89/*
90 * System Peripherals (offset from AT91_BASE_SYS)
91 */
92#define AT91_SDRAMC (0xffffea00 - AT91_BASE_SYS)
93#define AT91_SMC (0xffffec00 - AT91_BASE_SYS)
94#define AT91_MATRIX (0xffffee00 - AT91_BASE_SYS)
95#define AT91_AIC (0xfffff000 - AT91_BASE_SYS)
96#define AT91_DBGU (0xfffff200 - AT91_BASE_SYS)
97#define AT91_PIOA (0xfffff400 - AT91_BASE_SYS)
98#define AT91_PIOB (0xfffff600 - AT91_BASE_SYS)
99#define AT91_PIOC (0xfffff800 - AT91_BASE_SYS)
100#define AT91_PMC (0xfffffc00 - AT91_BASE_SYS)
101#define AT91_RSTC (0xfffffd00 - AT91_BASE_SYS)
102#define AT91_RTT (0xfffffd20 - AT91_BASE_SYS)
103#define AT91_PIT (0xfffffd30 - AT91_BASE_SYS)
104#define AT91_WDT (0xfffffd40 - AT91_BASE_SYS)
105
106#define AT91_USART0 AT572D940HF_ID_US0
107#define AT91_USART1 AT572D940HF_ID_US1
108#define AT91_USART2 AT572D940HF_ID_US2
109
110
111/*
112 * Internal Memory.
113 */
114#define AT572D940HF_SRAM_BASE 0x00300000 /* Internal SRAM base address */
115#define AT572D940HF_SRAM_SIZE (48 * SZ_1K) /* Internal SRAM size (48Kb) */
116
117#define AT572D940HF_ROM_BASE 0x00400000 /* Internal ROM base address */
118#define AT572D940HF_ROM_SIZE SZ_32K /* Internal ROM size (32Kb) */
119
120#define AT572D940HF_UHP_BASE 0x00500000 /* USB Host controller */
121
122
123#endif
diff --git a/arch/arm/mach-at91/include/mach/at572d940hf_matrix.h b/arch/arm/mach-at91/include/mach/at572d940hf_matrix.h
new file mode 100644
index 000000000000..b6751df09488
--- /dev/null
+++ b/arch/arm/mach-at91/include/mach/at572d940hf_matrix.h
@@ -0,0 +1,123 @@
1/*
2 * include/mach//at572d940hf_matrix.h
3 *
4 * Antonio R. Costa <costa.antonior@gmail.com>
5 * Copyright (C) 2008 Atmel
6 *
7 * Copyright (C) 2005 SAN People
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 */
23
24#ifndef AT572D940HF_MATRIX_H
25#define AT572D940HF_MATRIX_H
26
27#define AT91_MATRIX_MCFG0 (AT91_MATRIX + 0x00) /* Master Configuration Register 0 */
28#define AT91_MATRIX_MCFG1 (AT91_MATRIX + 0x04) /* Master Configuration Register 1 */
29#define AT91_MATRIX_MCFG2 (AT91_MATRIX + 0x08) /* Master Configuration Register 2 */
30#define AT91_MATRIX_MCFG3 (AT91_MATRIX + 0x0C) /* Master Configuration Register 3 */
31#define AT91_MATRIX_MCFG4 (AT91_MATRIX + 0x10) /* Master Configuration Register 4 */
32#define AT91_MATRIX_MCFG5 (AT91_MATRIX + 0x14) /* Master Configuration Register 5 */
33
34#define AT91_MATRIX_ULBT (7 << 0) /* Undefined Length Burst Type */
35#define AT91_MATRIX_ULBT_INFINITE (0 << 0)
36#define AT91_MATRIX_ULBT_SINGLE (1 << 0)
37#define AT91_MATRIX_ULBT_FOUR (2 << 0)
38#define AT91_MATRIX_ULBT_EIGHT (3 << 0)
39#define AT91_MATRIX_ULBT_SIXTEEN (4 << 0)
40
41#define AT91_MATRIX_SCFG0 (AT91_MATRIX + 0x40) /* Slave Configuration Register 0 */
42#define AT91_MATRIX_SCFG1 (AT91_MATRIX + 0x44) /* Slave Configuration Register 1 */
43#define AT91_MATRIX_SCFG2 (AT91_MATRIX + 0x48) /* Slave Configuration Register 2 */
44#define AT91_MATRIX_SCFG3 (AT91_MATRIX + 0x4C) /* Slave Configuration Register 3 */
45#define AT91_MATRIX_SCFG4 (AT91_MATRIX + 0x50) /* Slave Configuration Register 4 */
46#define AT91_MATRIX_SLOT_CYCLE (0xff << 0) /* Maximum Number of Allowed Cycles for a Burst */
47#define AT91_MATRIX_DEFMSTR_TYPE (3 << 16) /* Default Master Type */
48#define AT91_MATRIX_DEFMSTR_TYPE_NONE (0 << 16)
49#define AT91_MATRIX_DEFMSTR_TYPE_LAST (1 << 16)
50#define AT91_MATRIX_DEFMSTR_TYPE_FIXED (2 << 16)
51#define AT91_MATRIX_FIXED_DEFMSTR (0x7 << 18) /* Fixed Index of Default Master */
52#define AT91_MATRIX_ARBT (3 << 24) /* Arbitration Type */
53#define AT91_MATRIX_ARBT_ROUND_ROBIN (0 << 24)
54#define AT91_MATRIX_ARBT_FIXED_PRIORITY (1 << 24)
55
56#define AT91_MATRIX_PRAS0 (AT91_MATRIX + 0x80) /* Priority Register A for Slave 0 */
57#define AT91_MATRIX_PRAS1 (AT91_MATRIX + 0x88) /* Priority Register A for Slave 1 */
58#define AT91_MATRIX_PRAS2 (AT91_MATRIX + 0x90) /* Priority Register A for Slave 2 */
59#define AT91_MATRIX_PRAS3 (AT91_MATRIX + 0x98) /* Priority Register A for Slave 3 */
60#define AT91_MATRIX_PRAS4 (AT91_MATRIX + 0xA0) /* Priority Register A for Slave 4 */
61
62#define AT91_MATRIX_M0PR (3 << 0) /* Master 0 Priority */
63#define AT91_MATRIX_M1PR (3 << 4) /* Master 1 Priority */
64#define AT91_MATRIX_M2PR (3 << 8) /* Master 2 Priority */
65#define AT91_MATRIX_M3PR (3 << 12) /* Master 3 Priority */
66#define AT91_MATRIX_M4PR (3 << 16) /* Master 4 Priority */
67#define AT91_MATRIX_M5PR (3 << 20) /* Master 5 Priority */
68#define AT91_MATRIX_M6PR (3 << 24) /* Master 6 Priority */
69
70#define AT91_MATRIX_MRCR (AT91_MATRIX + 0x100) /* Master Remap Control Register */
71#define AT91_MATRIX_RCB0 (1 << 0) /* Remap Command for AHB Master 0 (ARM926EJ-S Instruction Master) */
72#define AT91_MATRIX_RCB1 (1 << 1) /* Remap Command for AHB Master 1 (ARM926EJ-S Data Master) */
73
74#define AT91_MATRIX_SFR0 (AT91_MATRIX + 0x110) /* Special Function Register 0 */
75#define AT91_MATRIX_SFR1 (AT91_MATRIX + 0x114) /* Special Function Register 1 */
76#define AT91_MATRIX_SFR2 (AT91_MATRIX + 0x118) /* Special Function Register 2 */
77#define AT91_MATRIX_SFR3 (AT91_MATRIX + 0x11C) /* Special Function Register 3 */
78#define AT91_MATRIX_SFR4 (AT91_MATRIX + 0x120) /* Special Function Register 4 */
79#define AT91_MATRIX_SFR5 (AT91_MATRIX + 0x124) /* Special Function Register 5 */
80#define AT91_MATRIX_SFR6 (AT91_MATRIX + 0x128) /* Special Function Register 6 */
81#define AT91_MATRIX_SFR7 (AT91_MATRIX + 0x12C) /* Special Function Register 7 */
82#define AT91_MATRIX_SFR8 (AT91_MATRIX + 0x130) /* Special Function Register 8 */
83#define AT91_MATRIX_SFR9 (AT91_MATRIX + 0x134) /* Special Function Register 9 */
84#define AT91_MATRIX_SFR10 (AT91_MATRIX + 0x138) /* Special Function Register 10 */
85#define AT91_MATRIX_SFR11 (AT91_MATRIX + 0x13C) /* Special Function Register 11 */
86#define AT91_MATRIX_SFR12 (AT91_MATRIX + 0x140) /* Special Function Register 12 */
87#define AT91_MATRIX_SFR13 (AT91_MATRIX + 0x144) /* Special Function Register 13 */
88#define AT91_MATRIX_SFR14 (AT91_MATRIX + 0x148) /* Special Function Register 14 */
89#define AT91_MATRIX_SFR15 (AT91_MATRIX + 0x14C) /* Special Function Register 15 */
90
91
92/*
93 * The following registers / bits are not defined in the Datasheet (Revision A)
94 */
95
96#define AT91_MATRIX_TCR (AT91_MATRIX + 0x100) /* TCM Configuration Register */
97#define AT91_MATRIX_ITCM_SIZE (0xf << 0) /* Size of ITCM enabled memory block */
98#define AT91_MATRIX_ITCM_0 (0 << 0)
99#define AT91_MATRIX_ITCM_16 (5 << 0)
100#define AT91_MATRIX_ITCM_32 (6 << 0)
101#define AT91_MATRIX_ITCM_64 (7 << 0)
102#define AT91_MATRIX_DTCM_SIZE (0xf << 4) /* Size of DTCM enabled memory block */
103#define AT91_MATRIX_DTCM_0 (0 << 4)
104#define AT91_MATRIX_DTCM_16 (5 << 4)
105#define AT91_MATRIX_DTCM_32 (6 << 4)
106#define AT91_MATRIX_DTCM_64 (7 << 4)
107
108#define AT91_MATRIX_EBICSA (AT91_MATRIX + 0x11C) /* EBI Chip Select Assignment Register */
109#define AT91_MATRIX_CS1A (1 << 1) /* Chip Select 1 Assignment */
110#define AT91_MATRIX_CS1A_SMC (0 << 1)
111#define AT91_MATRIX_CS1A_SDRAMC (1 << 1)
112#define AT91_MATRIX_CS3A (1 << 3) /* Chip Select 3 Assignment */
113#define AT91_MATRIX_CS3A_SMC (0 << 3)
114#define AT91_MATRIX_CS3A_SMC_SMARTMEDIA (1 << 3)
115#define AT91_MATRIX_CS4A (1 << 4) /* Chip Select 4 Assignment */
116#define AT91_MATRIX_CS4A_SMC (0 << 4)
117#define AT91_MATRIX_CS4A_SMC_CF1 (1 << 4)
118#define AT91_MATRIX_CS5A (1 << 5) /* Chip Select 5 Assignment */
119#define AT91_MATRIX_CS5A_SMC (0 << 5)
120#define AT91_MATRIX_CS5A_SMC_CF2 (1 << 5)
121#define AT91_MATRIX_DBPUC (1 << 8) /* Data Bus Pull-up Configuration */
122
123#endif
diff --git a/arch/arm/mach-at91/include/mach/at91_pmc.h b/arch/arm/mach-at91/include/mach/at91_pmc.h
index 64589eaaaee8..e46f93e34aab 100644
--- a/arch/arm/mach-at91/include/mach/at91_pmc.h
+++ b/arch/arm/mach-at91/include/mach/at91_pmc.h
@@ -32,6 +32,7 @@
32#define AT91_PMC_PCK1 (1 << 9) /* Programmable Clock 1 */ 32#define AT91_PMC_PCK1 (1 << 9) /* Programmable Clock 1 */
33#define AT91_PMC_PCK2 (1 << 10) /* Programmable Clock 2 */ 33#define AT91_PMC_PCK2 (1 << 10) /* Programmable Clock 2 */
34#define AT91_PMC_PCK3 (1 << 11) /* Programmable Clock 3 */ 34#define AT91_PMC_PCK3 (1 << 11) /* Programmable Clock 3 */
35#define AT91_PMC_PCK4 (1 << 12) /* Programmable Clock 4 [AT572D940HF only] */
35#define AT91_PMC_HCK0 (1 << 16) /* AHB Clock (USB host) [AT91SAM9261 only] */ 36#define AT91_PMC_HCK0 (1 << 16) /* AHB Clock (USB host) [AT91SAM9261 only] */
36#define AT91_PMC_HCK1 (1 << 17) /* AHB Clock (LCD) [AT91SAM9261 only] */ 37#define AT91_PMC_HCK1 (1 << 17) /* AHB Clock (LCD) [AT91SAM9261 only] */
37 38
diff --git a/arch/arm/mach-at91/include/mach/board.h b/arch/arm/mach-at91/include/mach/board.h
index bb6f6a7ba5e0..ceaec6c16eb2 100644
--- a/arch/arm/mach-at91/include/mach/board.h
+++ b/arch/arm/mach-at91/include/mach/board.h
@@ -87,7 +87,7 @@ struct at91_eth_data {
87extern void __init at91_add_device_eth(struct at91_eth_data *data); 87extern void __init at91_add_device_eth(struct at91_eth_data *data);
88 88
89#if defined(CONFIG_ARCH_AT91SAM9260) || defined(CONFIG_ARCH_AT91SAM9263) || defined(CONFIG_ARCH_AT91SAM9G20) || defined(CONFIG_ARCH_AT91CAP9) \ 89#if defined(CONFIG_ARCH_AT91SAM9260) || defined(CONFIG_ARCH_AT91SAM9263) || defined(CONFIG_ARCH_AT91SAM9G20) || defined(CONFIG_ARCH_AT91CAP9) \
90 || defined(CONFIG_ARCH_AT91SAM9G45) 90 || defined(CONFIG_ARCH_AT91SAM9G45) || defined(CONFIG_ARCH_AT572D940HF)
91#define eth_platform_data at91_eth_data 91#define eth_platform_data at91_eth_data
92#endif 92#endif
93 93
@@ -205,6 +205,9 @@ extern void __init at91_init_leds(u8 cpu_led, u8 timer_led);
205extern void __init at91_gpio_leds(struct gpio_led *leds, int nr); 205extern void __init at91_gpio_leds(struct gpio_led *leds, int nr);
206extern void __init at91_pwm_leds(struct gpio_led *leds, int nr); 206extern void __init at91_pwm_leds(struct gpio_led *leds, int nr);
207 207
208 /* AT572D940HF DSP */
209extern void __init at91_add_device_mAgic(void);
210
208/* FIXME: this needs a better location, but gets stuff building again */ 211/* FIXME: this needs a better location, but gets stuff building again */
209extern int at91_suspend_entering_slow_clock(void); 212extern int at91_suspend_entering_slow_clock(void);
210 213
diff --git a/arch/arm/mach-at91/include/mach/cpu.h b/arch/arm/mach-at91/include/mach/cpu.h
index c22df30ed5e5..5a0650101d45 100644
--- a/arch/arm/mach-at91/include/mach/cpu.h
+++ b/arch/arm/mach-at91/include/mach/cpu.h
@@ -33,6 +33,8 @@
33#define ARCH_ID_AT91SAM9XE256 0x329a93a0 33#define ARCH_ID_AT91SAM9XE256 0x329a93a0
34#define ARCH_ID_AT91SAM9XE512 0x329aa3a0 34#define ARCH_ID_AT91SAM9XE512 0x329aa3a0
35 35
36#define ARCH_ID_AT572D940HF 0x0e0303e0
37
36#define ARCH_ID_AT91M40800 0x14080044 38#define ARCH_ID_AT91M40800 0x14080044
37#define ARCH_ID_AT91R40807 0x44080746 39#define ARCH_ID_AT91R40807 0x44080746
38#define ARCH_ID_AT91M40807 0x14080745 40#define ARCH_ID_AT91M40807 0x14080745
@@ -141,6 +143,12 @@ static inline unsigned long at91cap9_rev_identify(void)
141#define cpu_is_at91cap9_revC() (0) 143#define cpu_is_at91cap9_revC() (0)
142#endif 144#endif
143 145
146#ifdef CONFIG_ARCH_AT572D940HF
147#define cpu_is_at572d940hf() (at91_cpu_identify() == ARCH_ID_AT572D940HF)
148#else
149#define cpu_is_at572d940hf() (0)
150#endif
151
144/* 152/*
145 * Since this is ARM, we will never run on any AVR32 CPU. But these 153 * Since this is ARM, we will never run on any AVR32 CPU. But these
146 * definitions may reduce clutter in common drivers. 154 * definitions may reduce clutter in common drivers.
diff --git a/arch/arm/mach-at91/include/mach/hardware.h b/arch/arm/mach-at91/include/mach/hardware.h
index a0df8b022df2..3d64a75e3ed5 100644
--- a/arch/arm/mach-at91/include/mach/hardware.h
+++ b/arch/arm/mach-at91/include/mach/hardware.h
@@ -32,6 +32,8 @@
32#include <mach/at91cap9.h> 32#include <mach/at91cap9.h>
33#elif defined(CONFIG_ARCH_AT91X40) 33#elif defined(CONFIG_ARCH_AT91X40)
34#include <mach/at91x40.h> 34#include <mach/at91x40.h>
35#elif defined(CONFIG_ARCH_AT572D940HF)
36#include <mach/at572d940hf.h>
35#else 37#else
36#error "Unsupported AT91 processor" 38#error "Unsupported AT91 processor"
37#endif 39#endif
diff --git a/arch/arm/mach-at91/include/mach/timex.h b/arch/arm/mach-at91/include/mach/timex.h
index 31ac2d97f14c..05a6e8af80c4 100644
--- a/arch/arm/mach-at91/include/mach/timex.h
+++ b/arch/arm/mach-at91/include/mach/timex.h
@@ -82,6 +82,11 @@
82#define AT91X40_MASTER_CLOCK 40000000 82#define AT91X40_MASTER_CLOCK 40000000
83#define CLOCK_TICK_RATE (AT91X40_MASTER_CLOCK) 83#define CLOCK_TICK_RATE (AT91X40_MASTER_CLOCK)
84 84
85#elif defined(CONFIG_ARCH_AT572D940HF)
86
87#define AT572D940HF_MASTER_CLOCK 80000000
88#define CLOCK_TICK_RATE (AT572D940HF_MASTER_CLOCK/16)
89
85#endif 90#endif
86 91
87#endif 92#endif
diff --git a/arch/arm/mach-bcmring/core.c b/arch/arm/mach-bcmring/core.c
index e590bbe0a7b4..72e405df0fb0 100644
--- a/arch/arm/mach-bcmring/core.c
+++ b/arch/arm/mach-bcmring/core.c
@@ -142,8 +142,7 @@ void __init bcmring_amba_init(void)
142 142
143 chipcHw_busInterfaceClockEnable(bus_clock); 143 chipcHw_busInterfaceClockEnable(bus_clock);
144 144
145 for (i = 0; i < ARRAY_SIZE(lookups); i++) 145 clkdev_add_table(lookups, ARRAY_SIZE(lookups));
146 clkdev_add(&lookups[i]);
147 146
148 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { 147 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
149 struct amba_device *d = amba_devs[i]; 148 struct amba_device *d = amba_devs[i];
diff --git a/arch/arm/mach-davinci/board-dm365-evm.c b/arch/arm/mach-davinci/board-dm365-evm.c
index b476395d2cd4..38e9033d2e86 100644
--- a/arch/arm/mach-davinci/board-dm365-evm.c
+++ b/arch/arm/mach-davinci/board-dm365-evm.c
@@ -37,6 +37,8 @@
37#include <mach/nand.h> 37#include <mach/nand.h>
38#include <mach/keyscan.h> 38#include <mach/keyscan.h>
39 39
40#include <media/tvp514x.h>
41
40static inline int have_imager(void) 42static inline int have_imager(void)
41{ 43{
42 /* REVISIT when it's supported, trigger via Kconfig */ 44 /* REVISIT when it's supported, trigger via Kconfig */
@@ -306,6 +308,73 @@ static void dm365evm_mmc_configure(void)
306 davinci_cfg_reg(DM365_SD1_DATA0); 308 davinci_cfg_reg(DM365_SD1_DATA0);
307} 309}
308 310
311static struct tvp514x_platform_data tvp5146_pdata = {
312 .clk_polarity = 0,
313 .hs_polarity = 1,
314 .vs_polarity = 1
315};
316
317#define TVP514X_STD_ALL (V4L2_STD_NTSC | V4L2_STD_PAL)
318/* Inputs available at the TVP5146 */
319static struct v4l2_input tvp5146_inputs[] = {
320 {
321 .index = 0,
322 .name = "Composite",
323 .type = V4L2_INPUT_TYPE_CAMERA,
324 .std = TVP514X_STD_ALL,
325 },
326 {
327 .index = 1,
328 .name = "S-Video",
329 .type = V4L2_INPUT_TYPE_CAMERA,
330 .std = TVP514X_STD_ALL,
331 },
332};
333
334/*
335 * this is the route info for connecting each input to decoder
336 * ouput that goes to vpfe. There is a one to one correspondence
337 * with tvp5146_inputs
338 */
339static struct vpfe_route tvp5146_routes[] = {
340 {
341 .input = INPUT_CVBS_VI2B,
342 .output = OUTPUT_10BIT_422_EMBEDDED_SYNC,
343 },
344{
345 .input = INPUT_SVIDEO_VI2C_VI1C,
346 .output = OUTPUT_10BIT_422_EMBEDDED_SYNC,
347 },
348};
349
350static struct vpfe_subdev_info vpfe_sub_devs[] = {
351 {
352 .name = "tvp5146",
353 .grp_id = 0,
354 .num_inputs = ARRAY_SIZE(tvp5146_inputs),
355 .inputs = tvp5146_inputs,
356 .routes = tvp5146_routes,
357 .can_route = 1,
358 .ccdc_if_params = {
359 .if_type = VPFE_BT656,
360 .hdpol = VPFE_PINPOL_POSITIVE,
361 .vdpol = VPFE_PINPOL_POSITIVE,
362 },
363 .board_info = {
364 I2C_BOARD_INFO("tvp5146", 0x5d),
365 .platform_data = &tvp5146_pdata,
366 },
367 },
368};
369
370static struct vpfe_config vpfe_cfg = {
371 .num_subdevs = ARRAY_SIZE(vpfe_sub_devs),
372 .sub_devs = vpfe_sub_devs,
373 .i2c_adapter_id = 1,
374 .card_name = "DM365 EVM",
375 .ccdc = "ISIF",
376};
377
309static void __init evm_init_i2c(void) 378static void __init evm_init_i2c(void)
310{ 379{
311 davinci_init_i2c(&i2c_pdata); 380 davinci_init_i2c(&i2c_pdata);
@@ -497,6 +566,8 @@ static struct davinci_uart_config uart_config __initdata = {
497 566
498static void __init dm365_evm_map_io(void) 567static void __init dm365_evm_map_io(void)
499{ 568{
569 /* setup input configuration for VPFE input devices */
570 dm365_set_vpfe_config(&vpfe_cfg);
500 dm365_init(); 571 dm365_init();
501} 572}
502 573
diff --git a/arch/arm/mach-davinci/dm355.c b/arch/arm/mach-davinci/dm355.c
index dedf4d4f3a27..d84e85414d20 100644
--- a/arch/arm/mach-davinci/dm355.c
+++ b/arch/arm/mach-davinci/dm355.c
@@ -125,7 +125,6 @@ static struct clk vpss_slave_clk = {
125 .lpsc = DAVINCI_LPSC_VPSSSLV, 125 .lpsc = DAVINCI_LPSC_VPSSSLV,
126}; 126};
127 127
128
129static struct clk clkout1_clk = { 128static struct clk clkout1_clk = {
130 .name = "clkout1", 129 .name = "clkout1",
131 .parent = &pll1_aux_clk, 130 .parent = &pll1_aux_clk,
@@ -665,6 +664,17 @@ static struct platform_device dm355_asp1_device = {
665 .resource = dm355_asp1_resources, 664 .resource = dm355_asp1_resources,
666}; 665};
667 666
667static void dm355_ccdc_setup_pinmux(void)
668{
669 davinci_cfg_reg(DM355_VIN_PCLK);
670 davinci_cfg_reg(DM355_VIN_CAM_WEN);
671 davinci_cfg_reg(DM355_VIN_CAM_VD);
672 davinci_cfg_reg(DM355_VIN_CAM_HD);
673 davinci_cfg_reg(DM355_VIN_YIN_EN);
674 davinci_cfg_reg(DM355_VIN_CINL_EN);
675 davinci_cfg_reg(DM355_VIN_CINH_EN);
676}
677
668static struct resource dm355_vpss_resources[] = { 678static struct resource dm355_vpss_resources[] = {
669 { 679 {
670 /* VPSS BL Base address */ 680 /* VPSS BL Base address */
@@ -701,6 +711,10 @@ static struct resource vpfe_resources[] = {
701 .end = IRQ_VDINT1, 711 .end = IRQ_VDINT1,
702 .flags = IORESOURCE_IRQ, 712 .flags = IORESOURCE_IRQ,
703 }, 713 },
714};
715
716static u64 vpfe_capture_dma_mask = DMA_BIT_MASK(32);
717static struct resource dm355_ccdc_resource[] = {
704 /* CCDC Base address */ 718 /* CCDC Base address */
705 { 719 {
706 .flags = IORESOURCE_MEM, 720 .flags = IORESOURCE_MEM,
@@ -708,8 +722,18 @@ static struct resource vpfe_resources[] = {
708 .end = 0x01c70600 + 0x1ff, 722 .end = 0x01c70600 + 0x1ff,
709 }, 723 },
710}; 724};
725static struct platform_device dm355_ccdc_dev = {
726 .name = "dm355_ccdc",
727 .id = -1,
728 .num_resources = ARRAY_SIZE(dm355_ccdc_resource),
729 .resource = dm355_ccdc_resource,
730 .dev = {
731 .dma_mask = &vpfe_capture_dma_mask,
732 .coherent_dma_mask = DMA_BIT_MASK(32),
733 .platform_data = dm355_ccdc_setup_pinmux,
734 },
735};
711 736
712static u64 vpfe_capture_dma_mask = DMA_BIT_MASK(32);
713static struct platform_device vpfe_capture_dev = { 737static struct platform_device vpfe_capture_dev = {
714 .name = CAPTURE_DRV_NAME, 738 .name = CAPTURE_DRV_NAME,
715 .id = -1, 739 .id = -1,
@@ -857,20 +881,13 @@ static int __init dm355_init_devices(void)
857 if (!cpu_is_davinci_dm355()) 881 if (!cpu_is_davinci_dm355())
858 return 0; 882 return 0;
859 883
884 /* Add ccdc clock aliases */
885 clk_add_alias("master", dm355_ccdc_dev.name, "vpss_master", NULL);
886 clk_add_alias("slave", dm355_ccdc_dev.name, "vpss_master", NULL);
860 davinci_cfg_reg(DM355_INT_EDMA_CC); 887 davinci_cfg_reg(DM355_INT_EDMA_CC);
861 platform_device_register(&dm355_edma_device); 888 platform_device_register(&dm355_edma_device);
862 platform_device_register(&dm355_vpss_device); 889 platform_device_register(&dm355_vpss_device);
863 /* 890 platform_device_register(&dm355_ccdc_dev);
864 * setup Mux configuration for vpfe input and register
865 * vpfe capture platform device
866 */
867 davinci_cfg_reg(DM355_VIN_PCLK);
868 davinci_cfg_reg(DM355_VIN_CAM_WEN);
869 davinci_cfg_reg(DM355_VIN_CAM_VD);
870 davinci_cfg_reg(DM355_VIN_CAM_HD);
871 davinci_cfg_reg(DM355_VIN_YIN_EN);
872 davinci_cfg_reg(DM355_VIN_CINL_EN);
873 davinci_cfg_reg(DM355_VIN_CINH_EN);
874 platform_device_register(&vpfe_capture_dev); 891 platform_device_register(&vpfe_capture_dev);
875 892
876 return 0; 893 return 0;
diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c
index f53735cb922e..ce9da43a628b 100644
--- a/arch/arm/mach-davinci/dm365.c
+++ b/arch/arm/mach-davinci/dm365.c
@@ -1008,6 +1008,97 @@ void __init dm365_init(void)
1008 davinci_common_init(&davinci_soc_info_dm365); 1008 davinci_common_init(&davinci_soc_info_dm365);
1009} 1009}
1010 1010
1011static struct resource dm365_vpss_resources[] = {
1012 {
1013 /* VPSS ISP5 Base address */
1014 .name = "isp5",
1015 .start = 0x01c70000,
1016 .end = 0x01c70000 + 0xff,
1017 .flags = IORESOURCE_MEM,
1018 },
1019 {
1020 /* VPSS CLK Base address */
1021 .name = "vpss",
1022 .start = 0x01c70200,
1023 .end = 0x01c70200 + 0xff,
1024 .flags = IORESOURCE_MEM,
1025 },
1026};
1027
1028static struct platform_device dm365_vpss_device = {
1029 .name = "vpss",
1030 .id = -1,
1031 .dev.platform_data = "dm365_vpss",
1032 .num_resources = ARRAY_SIZE(dm365_vpss_resources),
1033 .resource = dm365_vpss_resources,
1034};
1035
1036static struct resource vpfe_resources[] = {
1037 {
1038 .start = IRQ_VDINT0,
1039 .end = IRQ_VDINT0,
1040 .flags = IORESOURCE_IRQ,
1041 },
1042 {
1043 .start = IRQ_VDINT1,
1044 .end = IRQ_VDINT1,
1045 .flags = IORESOURCE_IRQ,
1046 },
1047};
1048
1049static u64 vpfe_capture_dma_mask = DMA_BIT_MASK(32);
1050static struct platform_device vpfe_capture_dev = {
1051 .name = CAPTURE_DRV_NAME,
1052 .id = -1,
1053 .num_resources = ARRAY_SIZE(vpfe_resources),
1054 .resource = vpfe_resources,
1055 .dev = {
1056 .dma_mask = &vpfe_capture_dma_mask,
1057 .coherent_dma_mask = DMA_BIT_MASK(32),
1058 },
1059};
1060
1061static void dm365_isif_setup_pinmux(void)
1062{
1063 davinci_cfg_reg(DM365_VIN_CAM_WEN);
1064 davinci_cfg_reg(DM365_VIN_CAM_VD);
1065 davinci_cfg_reg(DM365_VIN_CAM_HD);
1066 davinci_cfg_reg(DM365_VIN_YIN4_7_EN);
1067 davinci_cfg_reg(DM365_VIN_YIN0_3_EN);
1068}
1069
1070static struct resource isif_resource[] = {
1071 /* ISIF Base address */
1072 {
1073 .start = 0x01c71000,
1074 .end = 0x01c71000 + 0x1ff,
1075 .flags = IORESOURCE_MEM,
1076 },
1077 /* ISIF Linearization table 0 */
1078 {
1079 .start = 0x1C7C000,
1080 .end = 0x1C7C000 + 0x2ff,
1081 .flags = IORESOURCE_MEM,
1082 },
1083 /* ISIF Linearization table 1 */
1084 {
1085 .start = 0x1C7C400,
1086 .end = 0x1C7C400 + 0x2ff,
1087 .flags = IORESOURCE_MEM,
1088 },
1089};
1090static struct platform_device dm365_isif_dev = {
1091 .name = "isif",
1092 .id = -1,
1093 .num_resources = ARRAY_SIZE(isif_resource),
1094 .resource = isif_resource,
1095 .dev = {
1096 .dma_mask = &vpfe_capture_dma_mask,
1097 .coherent_dma_mask = DMA_BIT_MASK(32),
1098 .platform_data = dm365_isif_setup_pinmux,
1099 },
1100};
1101
1011static int __init dm365_init_devices(void) 1102static int __init dm365_init_devices(void)
1012{ 1103{
1013 if (!cpu_is_davinci_dm365()) 1104 if (!cpu_is_davinci_dm365())
@@ -1016,7 +1107,16 @@ static int __init dm365_init_devices(void)
1016 davinci_cfg_reg(DM365_INT_EDMA_CC); 1107 davinci_cfg_reg(DM365_INT_EDMA_CC);
1017 platform_device_register(&dm365_edma_device); 1108 platform_device_register(&dm365_edma_device);
1018 platform_device_register(&dm365_emac_device); 1109 platform_device_register(&dm365_emac_device);
1019 1110 /* Add isif clock alias */
1111 clk_add_alias("master", dm365_isif_dev.name, "vpss_master", NULL);
1112 platform_device_register(&dm365_vpss_device);
1113 platform_device_register(&dm365_isif_dev);
1114 platform_device_register(&vpfe_capture_dev);
1020 return 0; 1115 return 0;
1021} 1116}
1022postcore_initcall(dm365_init_devices); 1117postcore_initcall(dm365_init_devices);
1118
1119void dm365_set_vpfe_config(struct vpfe_config *cfg)
1120{
1121 vpfe_capture_dev.dev.platform_data = cfg;
1122}
diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c
index 2cd008156dea..92aeb5600680 100644
--- a/arch/arm/mach-davinci/dm644x.c
+++ b/arch/arm/mach-davinci/dm644x.c
@@ -612,6 +612,11 @@ static struct resource vpfe_resources[] = {
612 .end = IRQ_VDINT1, 612 .end = IRQ_VDINT1,
613 .flags = IORESOURCE_IRQ, 613 .flags = IORESOURCE_IRQ,
614 }, 614 },
615};
616
617static u64 vpfe_capture_dma_mask = DMA_BIT_MASK(32);
618static struct resource dm644x_ccdc_resource[] = {
619 /* CCDC Base address */
615 { 620 {
616 .start = 0x01c70400, 621 .start = 0x01c70400,
617 .end = 0x01c70400 + 0xff, 622 .end = 0x01c70400 + 0xff,
@@ -619,7 +624,17 @@ static struct resource vpfe_resources[] = {
619 }, 624 },
620}; 625};
621 626
622static u64 vpfe_capture_dma_mask = DMA_BIT_MASK(32); 627static struct platform_device dm644x_ccdc_dev = {
628 .name = "dm644x_ccdc",
629 .id = -1,
630 .num_resources = ARRAY_SIZE(dm644x_ccdc_resource),
631 .resource = dm644x_ccdc_resource,
632 .dev = {
633 .dma_mask = &vpfe_capture_dma_mask,
634 .coherent_dma_mask = DMA_BIT_MASK(32),
635 },
636};
637
623static struct platform_device vpfe_capture_dev = { 638static struct platform_device vpfe_capture_dev = {
624 .name = CAPTURE_DRV_NAME, 639 .name = CAPTURE_DRV_NAME,
625 .id = -1, 640 .id = -1,
@@ -769,9 +784,13 @@ static int __init dm644x_init_devices(void)
769 if (!cpu_is_davinci_dm644x()) 784 if (!cpu_is_davinci_dm644x())
770 return 0; 785 return 0;
771 786
787 /* Add ccdc clock aliases */
788 clk_add_alias("master", dm644x_ccdc_dev.name, "vpss_master", NULL);
789 clk_add_alias("slave", dm644x_ccdc_dev.name, "vpss_slave", NULL);
772 platform_device_register(&dm644x_edma_device); 790 platform_device_register(&dm644x_edma_device);
773 platform_device_register(&dm644x_emac_device); 791 platform_device_register(&dm644x_emac_device);
774 platform_device_register(&dm644x_vpss_device); 792 platform_device_register(&dm644x_vpss_device);
793 platform_device_register(&dm644x_ccdc_dev);
775 platform_device_register(&vpfe_capture_dev); 794 platform_device_register(&vpfe_capture_dev);
776 795
777 return 0; 796 return 0;
diff --git a/arch/arm/mach-davinci/include/mach/dm365.h b/arch/arm/mach-davinci/include/mach/dm365.h
index f1710a30e7ba..9fc5a64a5364 100644
--- a/arch/arm/mach-davinci/include/mach/dm365.h
+++ b/arch/arm/mach-davinci/include/mach/dm365.h
@@ -18,6 +18,7 @@
18#include <mach/emac.h> 18#include <mach/emac.h>
19#include <mach/asp.h> 19#include <mach/asp.h>
20#include <mach/keyscan.h> 20#include <mach/keyscan.h>
21#include <media/davinci/vpfe_capture.h>
21 22
22#define DM365_EMAC_BASE (0x01D07000) 23#define DM365_EMAC_BASE (0x01D07000)
23#define DM365_EMAC_CNTRL_OFFSET (0x0000) 24#define DM365_EMAC_CNTRL_OFFSET (0x0000)
@@ -36,4 +37,5 @@ void __init dm365_init_asp(struct snd_platform_data *pdata);
36void __init dm365_init_ks(struct davinci_ks_platform_data *pdata); 37void __init dm365_init_ks(struct davinci_ks_platform_data *pdata);
37void __init dm365_init_rtc(void); 38void __init dm365_init_rtc(void);
38 39
40void dm365_set_vpfe_config(struct vpfe_config *cfg);
39#endif /* __ASM_ARCH_DM365_H */ 41#endif /* __ASM_ARCH_DM365_H */
diff --git a/arch/arm/mach-davinci/include/mach/hardware.h b/arch/arm/mach-davinci/include/mach/hardware.h
index 41c89386e39b..c45ba1f62a11 100644
--- a/arch/arm/mach-davinci/include/mach/hardware.h
+++ b/arch/arm/mach-davinci/include/mach/hardware.h
@@ -27,7 +27,7 @@
27/* 27/*
28 * I/O mapping 28 * I/O mapping
29 */ 29 */
30#define IO_PHYS 0x01c00000 30#define IO_PHYS 0x01c00000UL
31#define IO_OFFSET 0xfd000000 /* Virtual IO = 0xfec00000 */ 31#define IO_OFFSET 0xfd000000 /* Virtual IO = 0xfec00000 */
32#define IO_SIZE 0x00400000 32#define IO_SIZE 0x00400000
33#define IO_VIRT (IO_PHYS + IO_OFFSET) 33#define IO_VIRT (IO_PHYS + IO_OFFSET)
diff --git a/arch/arm/mach-davinci/io.c b/arch/arm/mach-davinci/io.c
index 49912b48b1b0..a1c0b6b99edf 100644
--- a/arch/arm/mach-davinci/io.c
+++ b/arch/arm/mach-davinci/io.c
@@ -24,7 +24,7 @@ void __iomem *davinci_ioremap(unsigned long p, size_t size, unsigned int type)
24 if (BETWEEN(p, IO_PHYS, IO_SIZE)) 24 if (BETWEEN(p, IO_PHYS, IO_SIZE))
25 return XLATE(p, IO_PHYS, IO_VIRT); 25 return XLATE(p, IO_PHYS, IO_VIRT);
26 26
27 return __arm_ioremap(p, size, type); 27 return __arm_ioremap_caller(p, size, type, __builtin_return_address(0));
28} 28}
29EXPORT_SYMBOL(davinci_ioremap); 29EXPORT_SYMBOL(davinci_ioremap);
30 30
diff --git a/arch/arm/mach-dove/include/mach/vmalloc.h b/arch/arm/mach-dove/include/mach/vmalloc.h
index 8b2c974755c6..a28792cf761e 100644
--- a/arch/arm/mach-dove/include/mach/vmalloc.h
+++ b/arch/arm/mach-dove/include/mach/vmalloc.h
@@ -2,4 +2,4 @@
2 * arch/arm/mach-dove/include/mach/vmalloc.h 2 * arch/arm/mach-dove/include/mach/vmalloc.h
3 */ 3 */
4 4
5#define VMALLOC_END 0xfd800000 5#define VMALLOC_END 0xfd800000UL
diff --git a/arch/arm/mach-ep93xx/Kconfig b/arch/arm/mach-ep93xx/Kconfig
index 9167c3d2a5ed..3a08b18f6433 100644
--- a/arch/arm/mach-ep93xx/Kconfig
+++ b/arch/arm/mach-ep93xx/Kconfig
@@ -161,6 +161,20 @@ config MACH_MICRO9S
161 Say 'Y' here if you want your kernel to support the 161 Say 'Y' here if you want your kernel to support the
162 Contec Micro9-Slim board. 162 Contec Micro9-Slim board.
163 163
164config MACH_SIM_ONE
165 bool "Support Simplemachines Sim.One board"
166 depends on EP93XX_SDCE0_PHYS_OFFSET
167 help
168 Say 'Y' here if you want your kernel to support the
169 Simplemachines Sim.One board.
170
171config MACH_SNAPPER_CL15
172 bool "Support Bluewater Systems Snapper CL15 Module"
173 depends on EP93XX_SDCE0_PHYS_OFFSET
174 help
175 Say 'Y' here if you want your kernel to support the Bluewater
176 Systems Snapper CL15 Module.
177
164config MACH_TS72XX 178config MACH_TS72XX
165 bool "Support Technologic Systems TS-72xx SBC" 179 bool "Support Technologic Systems TS-72xx SBC"
166 depends on EP93XX_SDCE3_SYNC_PHYS_OFFSET 180 depends on EP93XX_SDCE3_SYNC_PHYS_OFFSET
diff --git a/arch/arm/mach-ep93xx/Makefile b/arch/arm/mach-ep93xx/Makefile
index eae6199a9891..33ee2c863d18 100644
--- a/arch/arm/mach-ep93xx/Makefile
+++ b/arch/arm/mach-ep93xx/Makefile
@@ -10,4 +10,6 @@ obj-$(CONFIG_MACH_ADSSPHERE) += adssphere.o
10obj-$(CONFIG_MACH_EDB93XX) += edb93xx.o 10obj-$(CONFIG_MACH_EDB93XX) += edb93xx.o
11obj-$(CONFIG_MACH_GESBC9312) += gesbc9312.o 11obj-$(CONFIG_MACH_GESBC9312) += gesbc9312.o
12obj-$(CONFIG_MACH_MICRO9) += micro9.o 12obj-$(CONFIG_MACH_MICRO9) += micro9.o
13obj-$(CONFIG_MACH_SIM_ONE) += simone.o
14obj-$(CONFIG_MACH_SNAPPER_CL15) += snappercl15.o
13obj-$(CONFIG_MACH_TS72XX) += ts72xx.o 15obj-$(CONFIG_MACH_TS72XX) += ts72xx.o
diff --git a/arch/arm/mach-ep93xx/clock.c b/arch/arm/mach-ep93xx/clock.c
index 1d0f9d8aff2e..5f80092b6ace 100644
--- a/arch/arm/mach-ep93xx/clock.c
+++ b/arch/arm/mach-ep93xx/clock.c
@@ -10,6 +10,8 @@
10 * your option) any later version. 10 * your option) any later version.
11 */ 11 */
12 12
13#define pr_fmt(fmt) "ep93xx " KBUILD_MODNAME ": " fmt
14
13#include <linux/kernel.h> 15#include <linux/kernel.h>
14#include <linux/clk.h> 16#include <linux/clk.h>
15#include <linux/err.h> 17#include <linux/err.h>
@@ -445,37 +447,39 @@ static void __init ep93xx_dma_clock_init(void)
445static int __init ep93xx_clock_init(void) 447static int __init ep93xx_clock_init(void)
446{ 448{
447 u32 value; 449 u32 value;
448 int i;
449 450
450 value = __raw_readl(EP93XX_SYSCON_CLOCK_SET1); 451 /* Determine the bootloader configured pll1 rate */
451 if (!(value & 0x00800000)) { /* PLL1 bypassed? */ 452 value = __raw_readl(EP93XX_SYSCON_CLKSET1);
453 if (!(value & EP93XX_SYSCON_CLKSET1_NBYP1))
452 clk_pll1.rate = clk_xtali.rate; 454 clk_pll1.rate = clk_xtali.rate;
453 } else { 455 else
454 clk_pll1.rate = calc_pll_rate(value); 456 clk_pll1.rate = calc_pll_rate(value);
455 } 457
458 /* Initialize the pll1 derived clocks */
456 clk_f.rate = clk_pll1.rate / fclk_divisors[(value >> 25) & 0x7]; 459 clk_f.rate = clk_pll1.rate / fclk_divisors[(value >> 25) & 0x7];
457 clk_h.rate = clk_pll1.rate / hclk_divisors[(value >> 20) & 0x7]; 460 clk_h.rate = clk_pll1.rate / hclk_divisors[(value >> 20) & 0x7];
458 clk_p.rate = clk_h.rate / pclk_divisors[(value >> 18) & 0x3]; 461 clk_p.rate = clk_h.rate / pclk_divisors[(value >> 18) & 0x3];
459 ep93xx_dma_clock_init(); 462 ep93xx_dma_clock_init();
460 463
461 value = __raw_readl(EP93XX_SYSCON_CLOCK_SET2); 464 /* Determine the bootloader configured pll2 rate */
462 if (!(value & 0x00080000)) { /* PLL2 bypassed? */ 465 value = __raw_readl(EP93XX_SYSCON_CLKSET2);
466 if (!(value & EP93XX_SYSCON_CLKSET2_NBYP2))
463 clk_pll2.rate = clk_xtali.rate; 467 clk_pll2.rate = clk_xtali.rate;
464 } else if (value & 0x00040000) { /* PLL2 enabled? */ 468 else if (value & EP93XX_SYSCON_CLKSET2_PLL2_EN)
465 clk_pll2.rate = calc_pll_rate(value); 469 clk_pll2.rate = calc_pll_rate(value);
466 } else { 470 else
467 clk_pll2.rate = 0; 471 clk_pll2.rate = 0;
468 } 472
473 /* Initialize the pll2 derived clocks */
469 clk_usb_host.rate = clk_pll2.rate / (((value >> 28) & 0xf) + 1); 474 clk_usb_host.rate = clk_pll2.rate / (((value >> 28) & 0xf) + 1);
470 475
471 printk(KERN_INFO "ep93xx: PLL1 running at %ld MHz, PLL2 at %ld MHz\n", 476 pr_info("PLL1 running at %ld MHz, PLL2 at %ld MHz\n",
472 clk_pll1.rate / 1000000, clk_pll2.rate / 1000000); 477 clk_pll1.rate / 1000000, clk_pll2.rate / 1000000);
473 printk(KERN_INFO "ep93xx: FCLK %ld MHz, HCLK %ld MHz, PCLK %ld MHz\n", 478 pr_info("FCLK %ld MHz, HCLK %ld MHz, PCLK %ld MHz\n",
474 clk_f.rate / 1000000, clk_h.rate / 1000000, 479 clk_f.rate / 1000000, clk_h.rate / 1000000,
475 clk_p.rate / 1000000); 480 clk_p.rate / 1000000);
476 481
477 for (i = 0; i < ARRAY_SIZE(clocks); i++) 482 clkdev_add_table(clocks, ARRAY_SIZE(clocks));
478 clkdev_add(&clocks[i]);
479 return 0; 483 return 0;
480} 484}
481arch_initcall(ep93xx_clock_init); 485arch_initcall(ep93xx_clock_init);
diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c
index 1f0d66561bbe..90fb591cbffa 100644
--- a/arch/arm/mach-ep93xx/core.c
+++ b/arch/arm/mach-ep93xx/core.c
@@ -14,12 +14,15 @@
14 * your option) any later version. 14 * your option) any later version.
15 */ 15 */
16 16
17#define pr_fmt(fmt) "ep93xx " KBUILD_MODNAME ": " fmt
18
17#include <linux/kernel.h> 19#include <linux/kernel.h>
18#include <linux/init.h> 20#include <linux/init.h>
19#include <linux/platform_device.h> 21#include <linux/platform_device.h>
20#include <linux/interrupt.h> 22#include <linux/interrupt.h>
21#include <linux/dma-mapping.h> 23#include <linux/dma-mapping.h>
22#include <linux/timex.h> 24#include <linux/timex.h>
25#include <linux/irq.h>
23#include <linux/io.h> 26#include <linux/io.h>
24#include <linux/gpio.h> 27#include <linux/gpio.h>
25#include <linux/leds.h> 28#include <linux/leds.h>
@@ -35,7 +38,6 @@
35 38
36#include <asm/mach/map.h> 39#include <asm/mach/map.h>
37#include <asm/mach/time.h> 40#include <asm/mach/time.h>
38#include <asm/mach/irq.h>
39 41
40#include <asm/hardware/vic.h> 42#include <asm/hardware/vic.h>
41 43
@@ -82,13 +84,40 @@ void __init ep93xx_map_io(void)
82 * to use this timer for something else. We also use timer 4 for keeping 84 * to use this timer for something else. We also use timer 4 for keeping
83 * track of lost jiffies. 85 * track of lost jiffies.
84 */ 86 */
85static unsigned int last_jiffy_time; 87#define EP93XX_TIMER_REG(x) (EP93XX_TIMER_BASE + (x))
86 88#define EP93XX_TIMER1_LOAD EP93XX_TIMER_REG(0x00)
89#define EP93XX_TIMER1_VALUE EP93XX_TIMER_REG(0x04)
90#define EP93XX_TIMER1_CONTROL EP93XX_TIMER_REG(0x08)
91#define EP93XX_TIMER123_CONTROL_ENABLE (1 << 7)
92#define EP93XX_TIMER123_CONTROL_MODE (1 << 6)
93#define EP93XX_TIMER123_CONTROL_CLKSEL (1 << 3)
94#define EP93XX_TIMER1_CLEAR EP93XX_TIMER_REG(0x0c)
95#define EP93XX_TIMER2_LOAD EP93XX_TIMER_REG(0x20)
96#define EP93XX_TIMER2_VALUE EP93XX_TIMER_REG(0x24)
97#define EP93XX_TIMER2_CONTROL EP93XX_TIMER_REG(0x28)
98#define EP93XX_TIMER2_CLEAR EP93XX_TIMER_REG(0x2c)
99#define EP93XX_TIMER4_VALUE_LOW EP93XX_TIMER_REG(0x60)
100#define EP93XX_TIMER4_VALUE_HIGH EP93XX_TIMER_REG(0x64)
101#define EP93XX_TIMER4_VALUE_HIGH_ENABLE (1 << 8)
102#define EP93XX_TIMER3_LOAD EP93XX_TIMER_REG(0x80)
103#define EP93XX_TIMER3_VALUE EP93XX_TIMER_REG(0x84)
104#define EP93XX_TIMER3_CONTROL EP93XX_TIMER_REG(0x88)
105#define EP93XX_TIMER3_CLEAR EP93XX_TIMER_REG(0x8c)
106
107#define EP93XX_TIMER123_CLOCK 508469
108#define EP93XX_TIMER4_CLOCK 983040
109
110#define TIMER1_RELOAD ((EP93XX_TIMER123_CLOCK / HZ) - 1)
87#define TIMER4_TICKS_PER_JIFFY DIV_ROUND_CLOSEST(CLOCK_TICK_RATE, HZ) 111#define TIMER4_TICKS_PER_JIFFY DIV_ROUND_CLOSEST(CLOCK_TICK_RATE, HZ)
88 112
113static unsigned int last_jiffy_time;
114
89static irqreturn_t ep93xx_timer_interrupt(int irq, void *dev_id) 115static irqreturn_t ep93xx_timer_interrupt(int irq, void *dev_id)
90{ 116{
117 /* Writing any value clears the timer interrupt */
91 __raw_writel(1, EP93XX_TIMER1_CLEAR); 118 __raw_writel(1, EP93XX_TIMER1_CLEAR);
119
120 /* Recover lost jiffies */
92 while ((signed long) 121 while ((signed long)
93 (__raw_readl(EP93XX_TIMER4_VALUE_LOW) - last_jiffy_time) 122 (__raw_readl(EP93XX_TIMER4_VALUE_LOW) - last_jiffy_time)
94 >= TIMER4_TICKS_PER_JIFFY) { 123 >= TIMER4_TICKS_PER_JIFFY) {
@@ -107,13 +136,18 @@ static struct irqaction ep93xx_timer_irq = {
107 136
108static void __init ep93xx_timer_init(void) 137static void __init ep93xx_timer_init(void)
109{ 138{
139 u32 tmode = EP93XX_TIMER123_CONTROL_MODE |
140 EP93XX_TIMER123_CONTROL_CLKSEL;
141
110 /* Enable periodic HZ timer. */ 142 /* Enable periodic HZ timer. */
111 __raw_writel(0x48, EP93XX_TIMER1_CONTROL); 143 __raw_writel(tmode, EP93XX_TIMER1_CONTROL);
112 __raw_writel((508469 / HZ) - 1, EP93XX_TIMER1_LOAD); 144 __raw_writel(TIMER1_RELOAD, EP93XX_TIMER1_LOAD);
113 __raw_writel(0xc8, EP93XX_TIMER1_CONTROL); 145 __raw_writel(tmode | EP93XX_TIMER123_CONTROL_ENABLE,
146 EP93XX_TIMER1_CONTROL);
114 147
115 /* Enable lost jiffy timer. */ 148 /* Enable lost jiffy timer. */
116 __raw_writel(0x100, EP93XX_TIMER4_VALUE_HIGH); 149 __raw_writel(EP93XX_TIMER4_VALUE_HIGH_ENABLE,
150 EP93XX_TIMER4_VALUE_HIGH);
117 151
118 setup_irq(IRQ_EP93XX_TIMER1, &ep93xx_timer_irq); 152 setup_irq(IRQ_EP93XX_TIMER1, &ep93xx_timer_irq);
119} 153}
@@ -135,237 +169,16 @@ struct sys_timer ep93xx_timer = {
135 169
136 170
137/************************************************************************* 171/*************************************************************************
138 * GPIO handling for EP93xx
139 *************************************************************************/
140static unsigned char gpio_int_unmasked[3];
141static unsigned char gpio_int_enabled[3];
142static unsigned char gpio_int_type1[3];
143static unsigned char gpio_int_type2[3];
144static unsigned char gpio_int_debounce[3];
145
146/* Port ordering is: A B F */
147static const u8 int_type1_register_offset[3] = { 0x90, 0xac, 0x4c };
148static const u8 int_type2_register_offset[3] = { 0x94, 0xb0, 0x50 };
149static const u8 eoi_register_offset[3] = { 0x98, 0xb4, 0x54 };
150static const u8 int_en_register_offset[3] = { 0x9c, 0xb8, 0x58 };
151static const u8 int_debounce_register_offset[3] = { 0xa8, 0xc4, 0x64 };
152
153void ep93xx_gpio_update_int_params(unsigned port)
154{
155 BUG_ON(port > 2);
156
157 __raw_writeb(0, EP93XX_GPIO_REG(int_en_register_offset[port]));
158
159 __raw_writeb(gpio_int_type2[port],
160 EP93XX_GPIO_REG(int_type2_register_offset[port]));
161
162 __raw_writeb(gpio_int_type1[port],
163 EP93XX_GPIO_REG(int_type1_register_offset[port]));
164
165 __raw_writeb(gpio_int_unmasked[port] & gpio_int_enabled[port],
166 EP93XX_GPIO_REG(int_en_register_offset[port]));
167}
168
169void ep93xx_gpio_int_mask(unsigned line)
170{
171 gpio_int_unmasked[line >> 3] &= ~(1 << (line & 7));
172}
173
174void ep93xx_gpio_int_debounce(unsigned int irq, int enable)
175{
176 int line = irq_to_gpio(irq);
177 int port = line >> 3;
178 int port_mask = 1 << (line & 7);
179
180 if (enable)
181 gpio_int_debounce[port] |= port_mask;
182 else
183 gpio_int_debounce[port] &= ~port_mask;
184
185 __raw_writeb(gpio_int_debounce[port],
186 EP93XX_GPIO_REG(int_debounce_register_offset[port]));
187}
188EXPORT_SYMBOL(ep93xx_gpio_int_debounce);
189
190/*************************************************************************
191 * EP93xx IRQ handling 172 * EP93xx IRQ handling
192 *************************************************************************/ 173 *************************************************************************/
193static void ep93xx_gpio_ab_irq_handler(unsigned int irq, struct irq_desc *desc) 174extern void ep93xx_gpio_init_irq(void);
194{
195 unsigned char status;
196 int i;
197
198 status = __raw_readb(EP93XX_GPIO_A_INT_STATUS);
199 for (i = 0; i < 8; i++) {
200 if (status & (1 << i)) {
201 int gpio_irq = gpio_to_irq(EP93XX_GPIO_LINE_A(0)) + i;
202 generic_handle_irq(gpio_irq);
203 }
204 }
205
206 status = __raw_readb(EP93XX_GPIO_B_INT_STATUS);
207 for (i = 0; i < 8; i++) {
208 if (status & (1 << i)) {
209 int gpio_irq = gpio_to_irq(EP93XX_GPIO_LINE_B(0)) + i;
210 generic_handle_irq(gpio_irq);
211 }
212 }
213}
214
215static void ep93xx_gpio_f_irq_handler(unsigned int irq, struct irq_desc *desc)
216{
217 /*
218 * map discontiguous hw irq range to continous sw irq range:
219 *
220 * IRQ_EP93XX_GPIO{0..7}MUX -> gpio_to_irq(EP93XX_GPIO_LINE_F({0..7})
221 */
222 int port_f_idx = ((irq + 1) & 7) ^ 4; /* {19..22,47..50} -> {0..7} */
223 int gpio_irq = gpio_to_irq(EP93XX_GPIO_LINE_F(0)) + port_f_idx;
224
225 generic_handle_irq(gpio_irq);
226}
227
228static void ep93xx_gpio_irq_ack(unsigned int irq)
229{
230 int line = irq_to_gpio(irq);
231 int port = line >> 3;
232 int port_mask = 1 << (line & 7);
233
234 if ((irq_desc[irq].status & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_EDGE_BOTH) {
235 gpio_int_type2[port] ^= port_mask; /* switch edge direction */
236 ep93xx_gpio_update_int_params(port);
237 }
238
239 __raw_writeb(port_mask, EP93XX_GPIO_REG(eoi_register_offset[port]));
240}
241
242static void ep93xx_gpio_irq_mask_ack(unsigned int irq)
243{
244 int line = irq_to_gpio(irq);
245 int port = line >> 3;
246 int port_mask = 1 << (line & 7);
247
248 if ((irq_desc[irq].status & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_EDGE_BOTH)
249 gpio_int_type2[port] ^= port_mask; /* switch edge direction */
250
251 gpio_int_unmasked[port] &= ~port_mask;
252 ep93xx_gpio_update_int_params(port);
253
254 __raw_writeb(port_mask, EP93XX_GPIO_REG(eoi_register_offset[port]));
255}
256
257static void ep93xx_gpio_irq_mask(unsigned int irq)
258{
259 int line = irq_to_gpio(irq);
260 int port = line >> 3;
261
262 gpio_int_unmasked[port] &= ~(1 << (line & 7));
263 ep93xx_gpio_update_int_params(port);
264}
265
266static void ep93xx_gpio_irq_unmask(unsigned int irq)
267{
268 int line = irq_to_gpio(irq);
269 int port = line >> 3;
270
271 gpio_int_unmasked[port] |= 1 << (line & 7);
272 ep93xx_gpio_update_int_params(port);
273}
274
275
276/*
277 * gpio_int_type1 controls whether the interrupt is level (0) or
278 * edge (1) triggered, while gpio_int_type2 controls whether it
279 * triggers on low/falling (0) or high/rising (1).
280 */
281static int ep93xx_gpio_irq_type(unsigned int irq, unsigned int type)
282{
283 struct irq_desc *desc = irq_desc + irq;
284 const int gpio = irq_to_gpio(irq);
285 const int port = gpio >> 3;
286 const int port_mask = 1 << (gpio & 7);
287
288 gpio_direction_input(gpio);
289
290 switch (type) {
291 case IRQ_TYPE_EDGE_RISING:
292 gpio_int_type1[port] |= port_mask;
293 gpio_int_type2[port] |= port_mask;
294 desc->handle_irq = handle_edge_irq;
295 break;
296 case IRQ_TYPE_EDGE_FALLING:
297 gpio_int_type1[port] |= port_mask;
298 gpio_int_type2[port] &= ~port_mask;
299 desc->handle_irq = handle_edge_irq;
300 break;
301 case IRQ_TYPE_LEVEL_HIGH:
302 gpio_int_type1[port] &= ~port_mask;
303 gpio_int_type2[port] |= port_mask;
304 desc->handle_irq = handle_level_irq;
305 break;
306 case IRQ_TYPE_LEVEL_LOW:
307 gpio_int_type1[port] &= ~port_mask;
308 gpio_int_type2[port] &= ~port_mask;
309 desc->handle_irq = handle_level_irq;
310 break;
311 case IRQ_TYPE_EDGE_BOTH:
312 gpio_int_type1[port] |= port_mask;
313 /* set initial polarity based on current input level */
314 if (gpio_get_value(gpio))
315 gpio_int_type2[port] &= ~port_mask; /* falling */
316 else
317 gpio_int_type2[port] |= port_mask; /* rising */
318 desc->handle_irq = handle_edge_irq;
319 break;
320 default:
321 pr_err("ep93xx: failed to set irq type %d for gpio %d\n",
322 type, gpio);
323 return -EINVAL;
324 }
325
326 gpio_int_enabled[port] |= port_mask;
327
328 desc->status &= ~IRQ_TYPE_SENSE_MASK;
329 desc->status |= type & IRQ_TYPE_SENSE_MASK;
330
331 ep93xx_gpio_update_int_params(port);
332
333 return 0;
334}
335
336static struct irq_chip ep93xx_gpio_irq_chip = {
337 .name = "GPIO",
338 .ack = ep93xx_gpio_irq_ack,
339 .mask_ack = ep93xx_gpio_irq_mask_ack,
340 .mask = ep93xx_gpio_irq_mask,
341 .unmask = ep93xx_gpio_irq_unmask,
342 .set_type = ep93xx_gpio_irq_type,
343};
344
345 175
346void __init ep93xx_init_irq(void) 176void __init ep93xx_init_irq(void)
347{ 177{
348 int gpio_irq;
349
350 vic_init(EP93XX_VIC1_BASE, 0, EP93XX_VIC1_VALID_IRQ_MASK, 0); 178 vic_init(EP93XX_VIC1_BASE, 0, EP93XX_VIC1_VALID_IRQ_MASK, 0);
351 vic_init(EP93XX_VIC2_BASE, 32, EP93XX_VIC2_VALID_IRQ_MASK, 0); 179 vic_init(EP93XX_VIC2_BASE, 32, EP93XX_VIC2_VALID_IRQ_MASK, 0);
352 180
353 for (gpio_irq = gpio_to_irq(0); 181 ep93xx_gpio_init_irq();
354 gpio_irq <= gpio_to_irq(EP93XX_GPIO_LINE_MAX_IRQ); ++gpio_irq) {
355 set_irq_chip(gpio_irq, &ep93xx_gpio_irq_chip);
356 set_irq_handler(gpio_irq, handle_level_irq);
357 set_irq_flags(gpio_irq, IRQF_VALID);
358 }
359
360 set_irq_chained_handler(IRQ_EP93XX_GPIO_AB, ep93xx_gpio_ab_irq_handler);
361 set_irq_chained_handler(IRQ_EP93XX_GPIO0MUX, ep93xx_gpio_f_irq_handler);
362 set_irq_chained_handler(IRQ_EP93XX_GPIO1MUX, ep93xx_gpio_f_irq_handler);
363 set_irq_chained_handler(IRQ_EP93XX_GPIO2MUX, ep93xx_gpio_f_irq_handler);
364 set_irq_chained_handler(IRQ_EP93XX_GPIO3MUX, ep93xx_gpio_f_irq_handler);
365 set_irq_chained_handler(IRQ_EP93XX_GPIO4MUX, ep93xx_gpio_f_irq_handler);
366 set_irq_chained_handler(IRQ_EP93XX_GPIO5MUX, ep93xx_gpio_f_irq_handler);
367 set_irq_chained_handler(IRQ_EP93XX_GPIO6MUX, ep93xx_gpio_f_irq_handler);
368 set_irq_chained_handler(IRQ_EP93XX_GPIO7MUX, ep93xx_gpio_f_irq_handler);
369} 182}
370 183
371 184
@@ -572,9 +385,9 @@ void __init ep93xx_register_i2c(struct i2c_gpio_platform_data *data,
572 * CMOS driver. 385 * CMOS driver.
573 */ 386 */
574 if (data->sda_is_open_drain && data->sda_pin != EP93XX_GPIO_LINE_EEDAT) 387 if (data->sda_is_open_drain && data->sda_pin != EP93XX_GPIO_LINE_EEDAT)
575 pr_warning("ep93xx: sda != EEDAT, open drain has no effect\n"); 388 pr_warning("sda != EEDAT, open drain has no effect\n");
576 if (data->scl_is_open_drain && data->scl_pin != EP93XX_GPIO_LINE_EECLK) 389 if (data->scl_is_open_drain && data->scl_pin != EP93XX_GPIO_LINE_EECLK)
577 pr_warning("ep93xx: scl != EECLK, open drain has no effect\n"); 390 pr_warning("scl != EECLK, open drain has no effect\n");
578 391
579 __raw_writel((data->sda_is_open_drain << 1) | 392 __raw_writel((data->sda_is_open_drain << 1) |
580 (data->scl_is_open_drain << 0), 393 (data->scl_is_open_drain << 0),
diff --git a/arch/arm/mach-ep93xx/dma-m2p.c b/arch/arm/mach-ep93xx/dma-m2p.c
index dbcac9c40a28..8904ca4e2e24 100644
--- a/arch/arm/mach-ep93xx/dma-m2p.c
+++ b/arch/arm/mach-ep93xx/dma-m2p.c
@@ -28,6 +28,8 @@
28 * with this implementation. 28 * with this implementation.
29 */ 29 */
30 30
31#define pr_fmt(fmt) "ep93xx " KBUILD_MODNAME ": " fmt
32
31#include <linux/kernel.h> 33#include <linux/kernel.h>
32#include <linux/clk.h> 34#include <linux/clk.h>
33#include <linux/err.h> 35#include <linux/err.h>
@@ -173,7 +175,7 @@ static irqreturn_t m2p_irq(int irq, void *dev_id)
173 175
174 switch (m2p_channel_state(ch)) { 176 switch (m2p_channel_state(ch)) {
175 case STATE_IDLE: 177 case STATE_IDLE:
176 pr_crit("m2p_irq: dma interrupt without a dma buffer\n"); 178 pr_crit("dma interrupt without a dma buffer\n");
177 BUG(); 179 BUG();
178 break; 180 break;
179 181
@@ -197,7 +199,7 @@ static irqreturn_t m2p_irq(int irq, void *dev_id)
197 break; 199 break;
198 200
199 case STATE_NEXT: 201 case STATE_NEXT:
200 pr_crit("m2p_irq: dma interrupt while next\n"); 202 pr_crit("dma interrupt while next\n");
201 BUG(); 203 BUG();
202 break; 204 break;
203 } 205 }
diff --git a/arch/arm/mach-ep93xx/edb93xx.c b/arch/arm/mach-ep93xx/edb93xx.c
index a4a7be308000..d22d67ac8b99 100644
--- a/arch/arm/mach-ep93xx/edb93xx.c
+++ b/arch/arm/mach-ep93xx/edb93xx.c
@@ -118,12 +118,33 @@ static void __init edb93xx_register_i2c(void)
118 } 118 }
119} 119}
120 120
121
122/*************************************************************************
123 * EDB93xx pwm
124 *************************************************************************/
125static void __init edb93xx_register_pwm(void)
126{
127 if (machine_is_edb9301() ||
128 machine_is_edb9302() || machine_is_edb9302a()) {
129 /* EP9301 and EP9302 only have pwm.1 (EGPIO14) */
130 ep93xx_register_pwm(0, 1);
131 } else if (machine_is_edb9307() || machine_is_edb9307a()) {
132 /* EP9307 only has pwm.0 (PWMOUT) */
133 ep93xx_register_pwm(1, 0);
134 } else {
135 /* EP9312 and EP9315 have both */
136 ep93xx_register_pwm(1, 1);
137 }
138}
139
140
121static void __init edb93xx_init_machine(void) 141static void __init edb93xx_init_machine(void)
122{ 142{
123 ep93xx_init_devices(); 143 ep93xx_init_devices();
124 edb93xx_register_flash(); 144 edb93xx_register_flash();
125 ep93xx_register_eth(&edb93xx_eth_data, 1); 145 ep93xx_register_eth(&edb93xx_eth_data, 1);
126 edb93xx_register_i2c(); 146 edb93xx_register_i2c();
147 edb93xx_register_pwm();
127} 148}
128 149
129 150
diff --git a/arch/arm/mach-ep93xx/gpio.c b/arch/arm/mach-ep93xx/gpio.c
index 1ea8871e03a9..cc377ae8c428 100644
--- a/arch/arm/mach-ep93xx/gpio.c
+++ b/arch/arm/mach-ep93xx/gpio.c
@@ -13,6 +13,8 @@
13 * published by the Free Software Foundation. 13 * published by the Free Software Foundation.
14 */ 14 */
15 15
16#define pr_fmt(fmt) "ep93xx " KBUILD_MODNAME ": " fmt
17
16#include <linux/init.h> 18#include <linux/init.h>
17#include <linux/module.h> 19#include <linux/module.h>
18#include <linux/seq_file.h> 20#include <linux/seq_file.h>
@@ -22,6 +24,235 @@
22 24
23#include <mach/hardware.h> 25#include <mach/hardware.h>
24 26
27/*************************************************************************
28 * GPIO handling for EP93xx
29 *************************************************************************/
30static unsigned char gpio_int_unmasked[3];
31static unsigned char gpio_int_enabled[3];
32static unsigned char gpio_int_type1[3];
33static unsigned char gpio_int_type2[3];
34static unsigned char gpio_int_debounce[3];
35
36/* Port ordering is: A B F */
37static const u8 int_type1_register_offset[3] = { 0x90, 0xac, 0x4c };
38static const u8 int_type2_register_offset[3] = { 0x94, 0xb0, 0x50 };
39static const u8 eoi_register_offset[3] = { 0x98, 0xb4, 0x54 };
40static const u8 int_en_register_offset[3] = { 0x9c, 0xb8, 0x58 };
41static const u8 int_debounce_register_offset[3] = { 0xa8, 0xc4, 0x64 };
42
43void ep93xx_gpio_update_int_params(unsigned port)
44{
45 BUG_ON(port > 2);
46
47 __raw_writeb(0, EP93XX_GPIO_REG(int_en_register_offset[port]));
48
49 __raw_writeb(gpio_int_type2[port],
50 EP93XX_GPIO_REG(int_type2_register_offset[port]));
51
52 __raw_writeb(gpio_int_type1[port],
53 EP93XX_GPIO_REG(int_type1_register_offset[port]));
54
55 __raw_writeb(gpio_int_unmasked[port] & gpio_int_enabled[port],
56 EP93XX_GPIO_REG(int_en_register_offset[port]));
57}
58
59void ep93xx_gpio_int_mask(unsigned line)
60{
61 gpio_int_unmasked[line >> 3] &= ~(1 << (line & 7));
62}
63
64void ep93xx_gpio_int_debounce(unsigned int irq, int enable)
65{
66 int line = irq_to_gpio(irq);
67 int port = line >> 3;
68 int port_mask = 1 << (line & 7);
69
70 if (enable)
71 gpio_int_debounce[port] |= port_mask;
72 else
73 gpio_int_debounce[port] &= ~port_mask;
74
75 __raw_writeb(gpio_int_debounce[port],
76 EP93XX_GPIO_REG(int_debounce_register_offset[port]));
77}
78EXPORT_SYMBOL(ep93xx_gpio_int_debounce);
79
80static void ep93xx_gpio_ab_irq_handler(unsigned int irq, struct irq_desc *desc)
81{
82 unsigned char status;
83 int i;
84
85 status = __raw_readb(EP93XX_GPIO_A_INT_STATUS);
86 for (i = 0; i < 8; i++) {
87 if (status & (1 << i)) {
88 int gpio_irq = gpio_to_irq(EP93XX_GPIO_LINE_A(0)) + i;
89 generic_handle_irq(gpio_irq);
90 }
91 }
92
93 status = __raw_readb(EP93XX_GPIO_B_INT_STATUS);
94 for (i = 0; i < 8; i++) {
95 if (status & (1 << i)) {
96 int gpio_irq = gpio_to_irq(EP93XX_GPIO_LINE_B(0)) + i;
97 generic_handle_irq(gpio_irq);
98 }
99 }
100}
101
102static void ep93xx_gpio_f_irq_handler(unsigned int irq, struct irq_desc *desc)
103{
104 /*
105 * map discontiguous hw irq range to continous sw irq range:
106 *
107 * IRQ_EP93XX_GPIO{0..7}MUX -> gpio_to_irq(EP93XX_GPIO_LINE_F({0..7})
108 */
109 int port_f_idx = ((irq + 1) & 7) ^ 4; /* {19..22,47..50} -> {0..7} */
110 int gpio_irq = gpio_to_irq(EP93XX_GPIO_LINE_F(0)) + port_f_idx;
111
112 generic_handle_irq(gpio_irq);
113}
114
115static void ep93xx_gpio_irq_ack(unsigned int irq)
116{
117 int line = irq_to_gpio(irq);
118 int port = line >> 3;
119 int port_mask = 1 << (line & 7);
120
121 if ((irq_desc[irq].status & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_EDGE_BOTH) {
122 gpio_int_type2[port] ^= port_mask; /* switch edge direction */
123 ep93xx_gpio_update_int_params(port);
124 }
125
126 __raw_writeb(port_mask, EP93XX_GPIO_REG(eoi_register_offset[port]));
127}
128
129static void ep93xx_gpio_irq_mask_ack(unsigned int irq)
130{
131 int line = irq_to_gpio(irq);
132 int port = line >> 3;
133 int port_mask = 1 << (line & 7);
134
135 if ((irq_desc[irq].status & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_EDGE_BOTH)
136 gpio_int_type2[port] ^= port_mask; /* switch edge direction */
137
138 gpio_int_unmasked[port] &= ~port_mask;
139 ep93xx_gpio_update_int_params(port);
140
141 __raw_writeb(port_mask, EP93XX_GPIO_REG(eoi_register_offset[port]));
142}
143
144static void ep93xx_gpio_irq_mask(unsigned int irq)
145{
146 int line = irq_to_gpio(irq);
147 int port = line >> 3;
148
149 gpio_int_unmasked[port] &= ~(1 << (line & 7));
150 ep93xx_gpio_update_int_params(port);
151}
152
153static void ep93xx_gpio_irq_unmask(unsigned int irq)
154{
155 int line = irq_to_gpio(irq);
156 int port = line >> 3;
157
158 gpio_int_unmasked[port] |= 1 << (line & 7);
159 ep93xx_gpio_update_int_params(port);
160}
161
162/*
163 * gpio_int_type1 controls whether the interrupt is level (0) or
164 * edge (1) triggered, while gpio_int_type2 controls whether it
165 * triggers on low/falling (0) or high/rising (1).
166 */
167static int ep93xx_gpio_irq_type(unsigned int irq, unsigned int type)
168{
169 struct irq_desc *desc = irq_desc + irq;
170 const int gpio = irq_to_gpio(irq);
171 const int port = gpio >> 3;
172 const int port_mask = 1 << (gpio & 7);
173
174 gpio_direction_input(gpio);
175
176 switch (type) {
177 case IRQ_TYPE_EDGE_RISING:
178 gpio_int_type1[port] |= port_mask;
179 gpio_int_type2[port] |= port_mask;
180 desc->handle_irq = handle_edge_irq;
181 break;
182 case IRQ_TYPE_EDGE_FALLING:
183 gpio_int_type1[port] |= port_mask;
184 gpio_int_type2[port] &= ~port_mask;
185 desc->handle_irq = handle_edge_irq;
186 break;
187 case IRQ_TYPE_LEVEL_HIGH:
188 gpio_int_type1[port] &= ~port_mask;
189 gpio_int_type2[port] |= port_mask;
190 desc->handle_irq = handle_level_irq;
191 break;
192 case IRQ_TYPE_LEVEL_LOW:
193 gpio_int_type1[port] &= ~port_mask;
194 gpio_int_type2[port] &= ~port_mask;
195 desc->handle_irq = handle_level_irq;
196 break;
197 case IRQ_TYPE_EDGE_BOTH:
198 gpio_int_type1[port] |= port_mask;
199 /* set initial polarity based on current input level */
200 if (gpio_get_value(gpio))
201 gpio_int_type2[port] &= ~port_mask; /* falling */
202 else
203 gpio_int_type2[port] |= port_mask; /* rising */
204 desc->handle_irq = handle_edge_irq;
205 break;
206 default:
207 pr_err("failed to set irq type %d for gpio %d\n", type, gpio);
208 return -EINVAL;
209 }
210
211 gpio_int_enabled[port] |= port_mask;
212
213 desc->status &= ~IRQ_TYPE_SENSE_MASK;
214 desc->status |= type & IRQ_TYPE_SENSE_MASK;
215
216 ep93xx_gpio_update_int_params(port);
217
218 return 0;
219}
220
221static struct irq_chip ep93xx_gpio_irq_chip = {
222 .name = "GPIO",
223 .ack = ep93xx_gpio_irq_ack,
224 .mask_ack = ep93xx_gpio_irq_mask_ack,
225 .mask = ep93xx_gpio_irq_mask,
226 .unmask = ep93xx_gpio_irq_unmask,
227 .set_type = ep93xx_gpio_irq_type,
228};
229
230void __init ep93xx_gpio_init_irq(void)
231{
232 int gpio_irq;
233
234 for (gpio_irq = gpio_to_irq(0);
235 gpio_irq <= gpio_to_irq(EP93XX_GPIO_LINE_MAX_IRQ); ++gpio_irq) {
236 set_irq_chip(gpio_irq, &ep93xx_gpio_irq_chip);
237 set_irq_handler(gpio_irq, handle_level_irq);
238 set_irq_flags(gpio_irq, IRQF_VALID);
239 }
240
241 set_irq_chained_handler(IRQ_EP93XX_GPIO_AB, ep93xx_gpio_ab_irq_handler);
242 set_irq_chained_handler(IRQ_EP93XX_GPIO0MUX, ep93xx_gpio_f_irq_handler);
243 set_irq_chained_handler(IRQ_EP93XX_GPIO1MUX, ep93xx_gpio_f_irq_handler);
244 set_irq_chained_handler(IRQ_EP93XX_GPIO2MUX, ep93xx_gpio_f_irq_handler);
245 set_irq_chained_handler(IRQ_EP93XX_GPIO3MUX, ep93xx_gpio_f_irq_handler);
246 set_irq_chained_handler(IRQ_EP93XX_GPIO4MUX, ep93xx_gpio_f_irq_handler);
247 set_irq_chained_handler(IRQ_EP93XX_GPIO5MUX, ep93xx_gpio_f_irq_handler);
248 set_irq_chained_handler(IRQ_EP93XX_GPIO6MUX, ep93xx_gpio_f_irq_handler);
249 set_irq_chained_handler(IRQ_EP93XX_GPIO7MUX, ep93xx_gpio_f_irq_handler);
250}
251
252
253/*************************************************************************
254 * gpiolib interface for EP93xx on-chip GPIOs
255 *************************************************************************/
25struct ep93xx_gpio_chip { 256struct ep93xx_gpio_chip {
26 struct gpio_chip chip; 257 struct gpio_chip chip;
27 258
@@ -31,10 +262,6 @@ struct ep93xx_gpio_chip {
31 262
32#define to_ep93xx_gpio_chip(c) container_of(c, struct ep93xx_gpio_chip, chip) 263#define to_ep93xx_gpio_chip(c) container_of(c, struct ep93xx_gpio_chip, chip)
33 264
34/* From core.c */
35extern void ep93xx_gpio_int_mask(unsigned line);
36extern void ep93xx_gpio_update_int_params(unsigned port);
37
38static int ep93xx_gpio_direction_input(struct gpio_chip *chip, unsigned offset) 265static int ep93xx_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
39{ 266{
40 struct ep93xx_gpio_chip *ep93xx_chip = to_ep93xx_gpio_chip(chip); 267 struct ep93xx_gpio_chip *ep93xx_chip = to_ep93xx_gpio_chip(chip);
diff --git a/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h b/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h
index d55194a4c093..93e2ecc79ceb 100644
--- a/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h
+++ b/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h
@@ -92,21 +92,6 @@
92 92
93/* APB peripherals */ 93/* APB peripherals */
94#define EP93XX_TIMER_BASE EP93XX_APB_IOMEM(0x00010000) 94#define EP93XX_TIMER_BASE EP93XX_APB_IOMEM(0x00010000)
95#define EP93XX_TIMER_REG(x) (EP93XX_TIMER_BASE + (x))
96#define EP93XX_TIMER1_LOAD EP93XX_TIMER_REG(0x00)
97#define EP93XX_TIMER1_VALUE EP93XX_TIMER_REG(0x04)
98#define EP93XX_TIMER1_CONTROL EP93XX_TIMER_REG(0x08)
99#define EP93XX_TIMER1_CLEAR EP93XX_TIMER_REG(0x0c)
100#define EP93XX_TIMER2_LOAD EP93XX_TIMER_REG(0x20)
101#define EP93XX_TIMER2_VALUE EP93XX_TIMER_REG(0x24)
102#define EP93XX_TIMER2_CONTROL EP93XX_TIMER_REG(0x28)
103#define EP93XX_TIMER2_CLEAR EP93XX_TIMER_REG(0x2c)
104#define EP93XX_TIMER4_VALUE_LOW EP93XX_TIMER_REG(0x60)
105#define EP93XX_TIMER4_VALUE_HIGH EP93XX_TIMER_REG(0x64)
106#define EP93XX_TIMER3_LOAD EP93XX_TIMER_REG(0x80)
107#define EP93XX_TIMER3_VALUE EP93XX_TIMER_REG(0x84)
108#define EP93XX_TIMER3_CONTROL EP93XX_TIMER_REG(0x88)
109#define EP93XX_TIMER3_CLEAR EP93XX_TIMER_REG(0x8c)
110 95
111#define EP93XX_I2S_BASE EP93XX_APB_IOMEM(0x00020000) 96#define EP93XX_I2S_BASE EP93XX_APB_IOMEM(0x00020000)
112 97
@@ -167,8 +152,11 @@
167#define EP93XX_SYSCON_PWRCNT_DMA_M2P1 (1<<16) 152#define EP93XX_SYSCON_PWRCNT_DMA_M2P1 (1<<16)
168#define EP93XX_SYSCON_HALT EP93XX_SYSCON_REG(0x08) 153#define EP93XX_SYSCON_HALT EP93XX_SYSCON_REG(0x08)
169#define EP93XX_SYSCON_STANDBY EP93XX_SYSCON_REG(0x0c) 154#define EP93XX_SYSCON_STANDBY EP93XX_SYSCON_REG(0x0c)
170#define EP93XX_SYSCON_CLOCK_SET1 EP93XX_SYSCON_REG(0x20) 155#define EP93XX_SYSCON_CLKSET1 EP93XX_SYSCON_REG(0x20)
171#define EP93XX_SYSCON_CLOCK_SET2 EP93XX_SYSCON_REG(0x24) 156#define EP93XX_SYSCON_CLKSET1_NBYP1 (1<<23)
157#define EP93XX_SYSCON_CLKSET2 EP93XX_SYSCON_REG(0x24)
158#define EP93XX_SYSCON_CLKSET2_NBYP2 (1<<19)
159#define EP93XX_SYSCON_CLKSET2_PLL2_EN (1<<18)
172#define EP93XX_SYSCON_DEVCFG EP93XX_SYSCON_REG(0x80) 160#define EP93XX_SYSCON_DEVCFG EP93XX_SYSCON_REG(0x80)
173#define EP93XX_SYSCON_DEVCFG_SWRST (1<<31) 161#define EP93XX_SYSCON_DEVCFG_SWRST (1<<31)
174#define EP93XX_SYSCON_DEVCFG_D1ONG (1<<30) 162#define EP93XX_SYSCON_DEVCFG_D1ONG (1<<30)
diff --git a/arch/arm/mach-ep93xx/include/mach/vmalloc.h b/arch/arm/mach-ep93xx/include/mach/vmalloc.h
index aed21cd3fe2d..1b3f25d03d39 100644
--- a/arch/arm/mach-ep93xx/include/mach/vmalloc.h
+++ b/arch/arm/mach-ep93xx/include/mach/vmalloc.h
@@ -2,4 +2,4 @@
2 * arch/arm/mach-ep93xx/include/mach/vmalloc.h 2 * arch/arm/mach-ep93xx/include/mach/vmalloc.h
3 */ 3 */
4 4
5#define VMALLOC_END 0xfe800000 5#define VMALLOC_END 0xfe800000UL
diff --git a/arch/arm/mach-ep93xx/simone.c b/arch/arm/mach-ep93xx/simone.c
new file mode 100644
index 000000000000..cd93990f1b99
--- /dev/null
+++ b/arch/arm/mach-ep93xx/simone.c
@@ -0,0 +1,97 @@
1/*
2 * arch/arm/mach-ep93xx/simone.c
3 * Simplemachines Sim.One support.
4 *
5 * Copyright (C) 2010 Ryan Mallon <ryan@bluewatersys.com>
6 *
7 * Based on the 2.6.24.7 support:
8 * Copyright (C) 2009 Simplemachines
9 * MMC support by Peter Ivanov <ivanovp@gmail.com>, 2007
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 as published by
13 * the Free Software Foundation; either version 2 of the License, or (at
14 * your option) any later version.
15 *
16 */
17
18#include <linux/kernel.h>
19#include <linux/init.h>
20#include <linux/platform_device.h>
21#include <linux/mtd/physmap.h>
22#include <linux/gpio.h>
23#include <linux/i2c.h>
24#include <linux/i2c-gpio.h>
25
26#include <mach/hardware.h>
27#include <mach/fb.h>
28
29#include <asm/mach-types.h>
30#include <asm/mach/arch.h>
31
32static struct physmap_flash_data simone_flash_data = {
33 .width = 2,
34};
35
36static struct resource simone_flash_resource = {
37 .start = EP93XX_CS6_PHYS_BASE,
38 .end = EP93XX_CS6_PHYS_BASE + SZ_8M - 1,
39 .flags = IORESOURCE_MEM,
40};
41
42static struct platform_device simone_flash = {
43 .name = "physmap-flash",
44 .id = 0,
45 .num_resources = 1,
46 .resource = &simone_flash_resource,
47 .dev = {
48 .platform_data = &simone_flash_data,
49 },
50};
51
52static struct ep93xx_eth_data simone_eth_data = {
53 .phy_id = 1,
54};
55
56static struct ep93xxfb_mach_info simone_fb_info = {
57 .num_modes = EP93XXFB_USE_MODEDB,
58 .bpp = 16,
59 .flags = EP93XXFB_USE_SDCSN0 | EP93XXFB_PCLK_FALLING,
60};
61
62static struct i2c_gpio_platform_data simone_i2c_gpio_data = {
63 .sda_pin = EP93XX_GPIO_LINE_EEDAT,
64 .sda_is_open_drain = 0,
65 .scl_pin = EP93XX_GPIO_LINE_EECLK,
66 .scl_is_open_drain = 0,
67 .udelay = 0,
68 .timeout = 0,
69};
70
71static struct i2c_board_info __initdata simone_i2c_board_info[] = {
72 {
73 I2C_BOARD_INFO("ds1337", 0x68),
74 },
75};
76
77static void __init simone_init_machine(void)
78{
79 ep93xx_init_devices();
80
81 platform_device_register(&simone_flash);
82 ep93xx_register_eth(&simone_eth_data, 1);
83 ep93xx_register_fb(&simone_fb_info);
84 ep93xx_register_i2c(&simone_i2c_gpio_data, simone_i2c_board_info,
85 ARRAY_SIZE(simone_i2c_board_info));
86}
87
88MACHINE_START(SIM_ONE, "Simplemachines Sim.One Board")
89/* Maintainer: Ryan Mallon <ryan@bluewatersys.com> */
90 .phys_io = EP93XX_APB_PHYS_BASE,
91 .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
92 .boot_params = EP93XX_SDCE0_PHYS_BASE + 0x100,
93 .map_io = ep93xx_map_io,
94 .init_irq = ep93xx_init_irq,
95 .timer = &ep93xx_timer,
96 .init_machine = simone_init_machine,
97MACHINE_END
diff --git a/arch/arm/mach-ep93xx/snappercl15.c b/arch/arm/mach-ep93xx/snappercl15.c
new file mode 100644
index 000000000000..51134b0382ca
--- /dev/null
+++ b/arch/arm/mach-ep93xx/snappercl15.c
@@ -0,0 +1,172 @@
1/*
2 * arch/arm/mach-ep93xx/snappercl15.c
3 * Bluewater Systems Snapper CL15 system module
4 *
5 * Copyright (C) 2009 Bluewater Systems Ltd
6 * Author: Ryan Mallon <ryan@bluewatersys.com>
7 *
8 * NAND code adapted from driver by:
9 * Andre Renaud <andre@bluewatersys.com>
10 * James R. McKaskill
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 (at
15 * your option) any later version.
16 *
17 */
18
19#include <linux/platform_device.h>
20#include <linux/kernel.h>
21#include <linux/init.h>
22#include <linux/io.h>
23#include <linux/gpio.h>
24#include <linux/i2c.h>
25#include <linux/i2c-gpio.h>
26#include <linux/fb.h>
27
28#include <linux/mtd/partitions.h>
29#include <linux/mtd/nand.h>
30
31#include <mach/hardware.h>
32#include <mach/fb.h>
33
34#include <asm/mach-types.h>
35#include <asm/mach/arch.h>
36
37#define SNAPPERCL15_NAND_BASE (EP93XX_CS7_PHYS_BASE + SZ_16M)
38
39#define SNAPPERCL15_NAND_WPN (1 << 8) /* Write protect (active low) */
40#define SNAPPERCL15_NAND_ALE (1 << 9) /* Address latch */
41#define SNAPPERCL15_NAND_CLE (1 << 10) /* Command latch */
42#define SNAPPERCL15_NAND_CEN (1 << 11) /* Chip enable (active low) */
43#define SNAPPERCL15_NAND_RDY (1 << 14) /* Device ready */
44
45#define NAND_CTRL_ADDR(chip) (chip->IO_ADDR_W + 0x40)
46
47static void snappercl15_nand_cmd_ctrl(struct mtd_info *mtd, int cmd,
48 unsigned int ctrl)
49{
50 struct nand_chip *chip = mtd->priv;
51 static u16 nand_state = SNAPPERCL15_NAND_WPN;
52 u16 set;
53
54 if (ctrl & NAND_CTRL_CHANGE) {
55 set = SNAPPERCL15_NAND_CEN | SNAPPERCL15_NAND_WPN;
56
57 if (ctrl & NAND_NCE)
58 set &= ~SNAPPERCL15_NAND_CEN;
59 if (ctrl & NAND_CLE)
60 set |= SNAPPERCL15_NAND_CLE;
61 if (ctrl & NAND_ALE)
62 set |= SNAPPERCL15_NAND_ALE;
63
64 nand_state &= ~(SNAPPERCL15_NAND_CEN |
65 SNAPPERCL15_NAND_CLE |
66 SNAPPERCL15_NAND_ALE);
67 nand_state |= set;
68 __raw_writew(nand_state, NAND_CTRL_ADDR(chip));
69 }
70
71 if (cmd != NAND_CMD_NONE)
72 __raw_writew((cmd & 0xff) | nand_state, chip->IO_ADDR_W);
73}
74
75static int snappercl15_nand_dev_ready(struct mtd_info *mtd)
76{
77 struct nand_chip *chip = mtd->priv;
78
79 return !!(__raw_readw(NAND_CTRL_ADDR(chip)) & SNAPPERCL15_NAND_RDY);
80}
81
82static const char *snappercl15_nand_part_probes[] = {"cmdlinepart", NULL};
83
84static struct mtd_partition snappercl15_nand_parts[] = {
85 {
86 .name = "Kernel",
87 .offset = 0,
88 .size = SZ_2M,
89 },
90 {
91 .name = "Filesystem",
92 .offset = MTDPART_OFS_APPEND,
93 .size = MTDPART_SIZ_FULL,
94 },
95};
96
97static struct platform_nand_data snappercl15_nand_data = {
98 .chip = {
99 .nr_chips = 1,
100 .part_probe_types = snappercl15_nand_part_probes,
101 .partitions = snappercl15_nand_parts,
102 .nr_partitions = ARRAY_SIZE(snappercl15_nand_parts),
103 .options = NAND_NO_AUTOINCR,
104 .chip_delay = 25,
105 },
106 .ctrl = {
107 .dev_ready = snappercl15_nand_dev_ready,
108 .cmd_ctrl = snappercl15_nand_cmd_ctrl,
109 },
110};
111
112static struct resource snappercl15_nand_resource[] = {
113 {
114 .start = SNAPPERCL15_NAND_BASE,
115 .end = SNAPPERCL15_NAND_BASE + SZ_4K - 1,
116 .flags = IORESOURCE_MEM,
117 },
118};
119
120static struct platform_device snappercl15_nand_device = {
121 .name = "gen_nand",
122 .id = -1,
123 .dev.platform_data = &snappercl15_nand_data,
124 .resource = snappercl15_nand_resource,
125 .num_resources = ARRAY_SIZE(snappercl15_nand_resource),
126};
127
128static struct ep93xx_eth_data snappercl15_eth_data = {
129 .phy_id = 1,
130};
131
132static struct i2c_gpio_platform_data snappercl15_i2c_gpio_data = {
133 .sda_pin = EP93XX_GPIO_LINE_EEDAT,
134 .sda_is_open_drain = 0,
135 .scl_pin = EP93XX_GPIO_LINE_EECLK,
136 .scl_is_open_drain = 0,
137 .udelay = 0,
138 .timeout = 0,
139};
140
141static struct i2c_board_info __initdata snappercl15_i2c_data[] = {
142 {
143 /* Audio codec */
144 I2C_BOARD_INFO("tlv320aic23", 0x1a),
145 },
146};
147
148static struct ep93xxfb_mach_info snappercl15_fb_info = {
149 .num_modes = EP93XXFB_USE_MODEDB,
150 .bpp = 16,
151};
152
153static void __init snappercl15_init_machine(void)
154{
155 ep93xx_init_devices();
156 ep93xx_register_eth(&snappercl15_eth_data, 1);
157 ep93xx_register_i2c(&snappercl15_i2c_gpio_data, snappercl15_i2c_data,
158 ARRAY_SIZE(snappercl15_i2c_data));
159 ep93xx_register_fb(&snappercl15_fb_info);
160 platform_device_register(&snappercl15_nand_device);
161}
162
163MACHINE_START(SNAPPER_CL15, "Bluewater Systems Snapper CL15")
164 /* Maintainer: Ryan Mallon <ryan@bluewatersys.com> */
165 .phys_io = EP93XX_APB_PHYS_BASE,
166 .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
167 .boot_params = EP93XX_SDCE0_PHYS_BASE + 0x100,
168 .map_io = ep93xx_map_io,
169 .init_irq = ep93xx_init_irq,
170 .timer = &ep93xx_timer,
171 .init_machine = snappercl15_init_machine,
172MACHINE_END
diff --git a/arch/arm/mach-footbridge/common.c b/arch/arm/mach-footbridge/common.c
index 41febc796b1c..e3bc3f6f6b10 100644
--- a/arch/arm/mach-footbridge/common.c
+++ b/arch/arm/mach-footbridge/common.c
@@ -32,12 +32,13 @@ unsigned int mem_fclk_21285 = 50000000;
32 32
33EXPORT_SYMBOL(mem_fclk_21285); 33EXPORT_SYMBOL(mem_fclk_21285);
34 34
35static void __init early_fclk(char **arg) 35static int __init early_fclk(char *arg)
36{ 36{
37 mem_fclk_21285 = simple_strtoul(*arg, arg, 0); 37 mem_fclk_21285 = simple_strtoul(arg, NULL, 0);
38 return 0;
38} 39}
39 40
40__early_param("mem_fclk_21285=", early_fclk); 41early_param("mem_fclk_21285", early_fclk);
41 42
42static int __init parse_tag_memclk(const struct tag *tag) 43static int __init parse_tag_memclk(const struct tag *tag)
43{ 44{
diff --git a/arch/arm/mach-gemini/gpio.c b/arch/arm/mach-gemini/gpio.c
index e7263854bc7b..fe3bd5ac8b10 100644
--- a/arch/arm/mach-gemini/gpio.c
+++ b/arch/arm/mach-gemini/gpio.c
@@ -86,7 +86,7 @@ static int gpio_set_irq_type(unsigned int irq, unsigned int type)
86 unsigned int reg_both, reg_level, reg_type; 86 unsigned int reg_both, reg_level, reg_type;
87 87
88 reg_type = __raw_readl(base + GPIO_INT_TYPE); 88 reg_type = __raw_readl(base + GPIO_INT_TYPE);
89 reg_level = __raw_readl(base + GPIO_INT_BOTH_EDGE); 89 reg_level = __raw_readl(base + GPIO_INT_LEVEL);
90 reg_both = __raw_readl(base + GPIO_INT_BOTH_EDGE); 90 reg_both = __raw_readl(base + GPIO_INT_BOTH_EDGE);
91 91
92 switch (type) { 92 switch (type) {
@@ -117,7 +117,7 @@ static int gpio_set_irq_type(unsigned int irq, unsigned int type)
117 } 117 }
118 118
119 __raw_writel(reg_type, base + GPIO_INT_TYPE); 119 __raw_writel(reg_type, base + GPIO_INT_TYPE);
120 __raw_writel(reg_level, base + GPIO_INT_BOTH_EDGE); 120 __raw_writel(reg_level, base + GPIO_INT_LEVEL);
121 __raw_writel(reg_both, base + GPIO_INT_BOTH_EDGE); 121 __raw_writel(reg_both, base + GPIO_INT_BOTH_EDGE);
122 122
123 gpio_ack_irq(irq); 123 gpio_ack_irq(irq);
diff --git a/arch/arm/mach-gemini/include/mach/vmalloc.h b/arch/arm/mach-gemini/include/mach/vmalloc.h
index 83e536d9436c..45371eb86fcb 100644
--- a/arch/arm/mach-gemini/include/mach/vmalloc.h
+++ b/arch/arm/mach-gemini/include/mach/vmalloc.h
@@ -7,4 +7,4 @@
7 * (at your option) any later version. 7 * (at your option) any later version.
8 */ 8 */
9 9
10#define VMALLOC_END 0xF0000000 10#define VMALLOC_END 0xf0000000UL
diff --git a/arch/arm/mach-integrator/core.c b/arch/arm/mach-integrator/core.c
index a0f60e55da6a..8b390e36ba69 100644
--- a/arch/arm/mach-integrator/core.c
+++ b/arch/arm/mach-integrator/core.c
@@ -144,8 +144,7 @@ static int __init integrator_init(void)
144{ 144{
145 int i; 145 int i;
146 146
147 for (i = 0; i < ARRAY_SIZE(lookups); i++) 147 clkdev_add_table(lookups, ARRAY_SIZE(lookups));
148 clkdev_add(&lookups[i]);
149 148
150 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { 149 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
151 struct amba_device *d = amba_devs[i]; 150 struct amba_device *d = amba_devs[i];
diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c
index 3f35293d457a..66ef86d6d9e3 100644
--- a/arch/arm/mach-integrator/integrator_cp.c
+++ b/arch/arm/mach-integrator/integrator_cp.c
@@ -558,9 +558,7 @@ static void __init intcp_init(void)
558{ 558{
559 int i; 559 int i;
560 560
561 for (i = 0; i < ARRAY_SIZE(cp_lookups); i++) 561 clkdev_add_table(cp_lookups, ARRAY_SIZE(cp_lookups));
562 clkdev_add(&cp_lookups[i]);
563
564 platform_add_devices(intcp_devs, ARRAY_SIZE(intcp_devs)); 562 platform_add_devices(intcp_devs, ARRAY_SIZE(intcp_devs));
565 563
566 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { 564 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
diff --git a/arch/arm/mach-iop13xx/io.c b/arch/arm/mach-iop13xx/io.c
index 529580997814..48642e66c566 100644
--- a/arch/arm/mach-iop13xx/io.c
+++ b/arch/arm/mach-iop13xx/io.c
@@ -61,9 +61,9 @@ void * __iomem __iop13xx_ioremap(unsigned long cookie, size_t size,
61 (cookie - IOP13XX_PCIE_LOWER_MEM_RA)); 61 (cookie - IOP13XX_PCIE_LOWER_MEM_RA));
62 break; 62 break;
63 case IOP13XX_PBI_LOWER_MEM_RA ... IOP13XX_PBI_UPPER_MEM_RA: 63 case IOP13XX_PBI_LOWER_MEM_RA ... IOP13XX_PBI_UPPER_MEM_RA:
64 retval = __arm_ioremap(IOP13XX_PBI_LOWER_MEM_PA + 64 retval = __arm_ioremap_caller(IOP13XX_PBI_LOWER_MEM_PA +
65 (cookie - IOP13XX_PBI_LOWER_MEM_RA), 65 (cookie - IOP13XX_PBI_LOWER_MEM_RA),
66 size, mtype); 66 size, mtype, __builtin_return_address(0));
67 break; 67 break;
68 case IOP13XX_PCIE_LOWER_IO_PA ... IOP13XX_PCIE_UPPER_IO_PA: 68 case IOP13XX_PCIE_LOWER_IO_PA ... IOP13XX_PCIE_UPPER_IO_PA:
69 retval = (void *) IOP13XX_PCIE_IO_PHYS_TO_VIRT(cookie); 69 retval = (void *) IOP13XX_PCIE_IO_PHYS_TO_VIRT(cookie);
@@ -75,7 +75,8 @@ void * __iomem __iop13xx_ioremap(unsigned long cookie, size_t size,
75 retval = (void *) IOP13XX_PMMR_PHYS_TO_VIRT(cookie); 75 retval = (void *) IOP13XX_PMMR_PHYS_TO_VIRT(cookie);
76 break; 76 break;
77 default: 77 default:
78 retval = __arm_ioremap(cookie, size, mtype); 78 retval = __arm_ioremap_caller(cookie, size, mtype,
79 __builtin_return_address(0));
79 } 80 }
80 81
81 return retval; 82 return retval;
diff --git a/arch/arm/mach-iop32x/include/mach/vmalloc.h b/arch/arm/mach-iop32x/include/mach/vmalloc.h
index 85ceb09d85f0..c4862d48e583 100644
--- a/arch/arm/mach-iop32x/include/mach/vmalloc.h
+++ b/arch/arm/mach-iop32x/include/mach/vmalloc.h
@@ -2,4 +2,4 @@
2 * arch/arm/mach-iop32x/include/mach/vmalloc.h 2 * arch/arm/mach-iop32x/include/mach/vmalloc.h
3 */ 3 */
4 4
5#define VMALLOC_END 0xfe000000 5#define VMALLOC_END 0xfe000000UL
diff --git a/arch/arm/mach-iop33x/include/mach/vmalloc.h b/arch/arm/mach-iop33x/include/mach/vmalloc.h
index f9f99dea9bc4..48331dc23704 100644
--- a/arch/arm/mach-iop33x/include/mach/vmalloc.h
+++ b/arch/arm/mach-iop33x/include/mach/vmalloc.h
@@ -2,4 +2,4 @@
2 * arch/arm/mach-iop33x/include/mach/vmalloc.h 2 * arch/arm/mach-iop33x/include/mach/vmalloc.h
3 */ 3 */
4 4
5#define VMALLOC_END 0xfe000000 5#define VMALLOC_END 0xfe000000UL
diff --git a/arch/arm/mach-ixp2000/include/mach/vmalloc.h b/arch/arm/mach-ixp2000/include/mach/vmalloc.h
index d195e35aed3b..61c8dae24f95 100644
--- a/arch/arm/mach-ixp2000/include/mach/vmalloc.h
+++ b/arch/arm/mach-ixp2000/include/mach/vmalloc.h
@@ -17,4 +17,4 @@
17 * The vmalloc() routines leaves a hole of 4kB between each vmalloced 17 * The vmalloc() routines leaves a hole of 4kB between each vmalloced
18 * area for the same reason. ;) 18 * area for the same reason. ;)
19 */ 19 */
20#define VMALLOC_END 0xfb000000 20#define VMALLOC_END 0xfb000000UL
diff --git a/arch/arm/mach-ixp23xx/include/mach/vmalloc.h b/arch/arm/mach-ixp23xx/include/mach/vmalloc.h
index dd519f678d10..896c56a1c00e 100644
--- a/arch/arm/mach-ixp23xx/include/mach/vmalloc.h
+++ b/arch/arm/mach-ixp23xx/include/mach/vmalloc.h
@@ -7,4 +7,4 @@
7 * specific static I/O. 7 * specific static I/O.
8 */ 8 */
9 9
10#define VMALLOC_END (0xec000000) 10#define VMALLOC_END (0xec000000UL)
diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c
index 3bbf40f6d964..71728d36d501 100644
--- a/arch/arm/mach-ixp4xx/common.c
+++ b/arch/arm/mach-ixp4xx/common.c
@@ -427,6 +427,17 @@ static void __init ixp4xx_clocksource_init(void)
427} 427}
428 428
429/* 429/*
430 * sched_clock()
431 */
432unsigned long long sched_clock(void)
433{
434 cycle_t cyc = ixp4xx_get_cycles(NULL);
435 struct clocksource *cs = &clocksource_ixp4xx;
436
437 return clocksource_cyc2ns(cyc, cs->mult, cs->shift);
438}
439
440/*
430 * clockevents 441 * clockevents
431 */ 442 */
432static int ixp4xx_set_next_event(unsigned long evt, 443static int ixp4xx_set_next_event(unsigned long evt,
diff --git a/arch/arm/mach-ixp4xx/include/mach/vmalloc.h b/arch/arm/mach-ixp4xx/include/mach/vmalloc.h
index 7b3580b53adf..9bcd64d59854 100644
--- a/arch/arm/mach-ixp4xx/include/mach/vmalloc.h
+++ b/arch/arm/mach-ixp4xx/include/mach/vmalloc.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * arch/arm/mach-ixp4xx/include/mach/vmalloc.h 2 * arch/arm/mach-ixp4xx/include/mach/vmalloc.h
3 */ 3 */
4#define VMALLOC_END (0xFF000000) 4#define VMALLOC_END (0xff000000UL)
5 5
diff --git a/arch/arm/mach-kirkwood/include/mach/vmalloc.h b/arch/arm/mach-kirkwood/include/mach/vmalloc.h
index 8f48260dcdad..bf162ca3d2c1 100644
--- a/arch/arm/mach-kirkwood/include/mach/vmalloc.h
+++ b/arch/arm/mach-kirkwood/include/mach/vmalloc.h
@@ -2,4 +2,4 @@
2 * arch/arm/mach-kirkwood/include/mach/vmalloc.h 2 * arch/arm/mach-kirkwood/include/mach/vmalloc.h
3 */ 3 */
4 4
5#define VMALLOC_END 0xfe800000 5#define VMALLOC_END 0xfe800000UL
diff --git a/arch/arm/mach-lh7a40x/include/mach/vmalloc.h b/arch/arm/mach-lh7a40x/include/mach/vmalloc.h
index 3fbd49490bb9..d62da7358b16 100644
--- a/arch/arm/mach-lh7a40x/include/mach/vmalloc.h
+++ b/arch/arm/mach-lh7a40x/include/mach/vmalloc.h
@@ -7,4 +7,4 @@
7 * version 2 as published by the Free Software Foundation. 7 * version 2 as published by the Free Software Foundation.
8 * 8 *
9 */ 9 */
10#define VMALLOC_END (0xe8000000) 10#define VMALLOC_END (0xe8000000UL)
diff --git a/arch/arm/mach-loki/include/mach/vmalloc.h b/arch/arm/mach-loki/include/mach/vmalloc.h
index 8dc3bfcbf9f0..5dcbd865443f 100644
--- a/arch/arm/mach-loki/include/mach/vmalloc.h
+++ b/arch/arm/mach-loki/include/mach/vmalloc.h
@@ -2,4 +2,4 @@
2 * arch/arm/mach-loki/include/mach/vmalloc.h 2 * arch/arm/mach-loki/include/mach/vmalloc.h
3 */ 3 */
4 4
5#define VMALLOC_END 0xfe800000 5#define VMALLOC_END 0xfe800000UL
diff --git a/arch/arm/mach-mmp/clock.c b/arch/arm/mach-mmp/clock.c
index 2a46ed5cc2a2..886e05648f08 100644
--- a/arch/arm/mach-mmp/clock.c
+++ b/arch/arm/mach-mmp/clock.c
@@ -88,11 +88,3 @@ unsigned long clk_get_rate(struct clk *clk)
88 return rate; 88 return rate;
89} 89}
90EXPORT_SYMBOL(clk_get_rate); 90EXPORT_SYMBOL(clk_get_rate);
91
92void clks_register(struct clk_lookup *clks, size_t num)
93{
94 int i;
95
96 for (i = 0; i < num; i++)
97 clkdev_add(&clks[i]);
98}
diff --git a/arch/arm/mach-mmp/clock.h b/arch/arm/mach-mmp/clock.h
index eefffbe683b0..016ae94691c0 100644
--- a/arch/arm/mach-mmp/clock.h
+++ b/arch/arm/mach-mmp/clock.h
@@ -68,5 +68,3 @@ struct clk clk_##_name = { \
68 68
69extern struct clk clk_pxa168_gpio; 69extern struct clk clk_pxa168_gpio;
70extern struct clk clk_pxa168_timers; 70extern struct clk clk_pxa168_timers;
71
72extern void clks_register(struct clk_lookup *, size_t);
diff --git a/arch/arm/mach-mmp/include/mach/vmalloc.h b/arch/arm/mach-mmp/include/mach/vmalloc.h
index b60ccaf9fee7..1d0bac003ad0 100644
--- a/arch/arm/mach-mmp/include/mach/vmalloc.h
+++ b/arch/arm/mach-mmp/include/mach/vmalloc.h
@@ -2,4 +2,4 @@
2 * linux/arch/arm/mach-mmp/include/mach/vmalloc.h 2 * linux/arch/arm/mach-mmp/include/mach/vmalloc.h
3 */ 3 */
4 4
5#define VMALLOC_END 0xfe000000 5#define VMALLOC_END 0xfe000000UL
diff --git a/arch/arm/mach-mmp/pxa168.c b/arch/arm/mach-mmp/pxa168.c
index 37dbdde17fac..1873c821df90 100644
--- a/arch/arm/mach-mmp/pxa168.c
+++ b/arch/arm/mach-mmp/pxa168.c
@@ -94,7 +94,7 @@ static int __init pxa168_init(void)
94 mfp_init_base(MFPR_VIRT_BASE); 94 mfp_init_base(MFPR_VIRT_BASE);
95 mfp_init_addr(pxa168_mfp_addr_map); 95 mfp_init_addr(pxa168_mfp_addr_map);
96 pxa_init_dma(IRQ_PXA168_DMA_INT0, 32); 96 pxa_init_dma(IRQ_PXA168_DMA_INT0, 32);
97 clks_register(ARRAY_AND_SIZE(pxa168_clkregs)); 97 clkdev_add_table(ARRAY_AND_SIZE(pxa168_clkregs));
98 } 98 }
99 99
100 return 0; 100 return 0;
diff --git a/arch/arm/mach-mmp/pxa910.c b/arch/arm/mach-mmp/pxa910.c
index d4049508a4df..46f2d69bef3c 100644
--- a/arch/arm/mach-mmp/pxa910.c
+++ b/arch/arm/mach-mmp/pxa910.c
@@ -131,7 +131,7 @@ static int __init pxa910_init(void)
131 mfp_init_base(MFPR_VIRT_BASE); 131 mfp_init_base(MFPR_VIRT_BASE);
132 mfp_init_addr(pxa910_mfp_addr_map); 132 mfp_init_addr(pxa910_mfp_addr_map);
133 pxa_init_dma(IRQ_PXA910_DMA_INT0, 32); 133 pxa_init_dma(IRQ_PXA910_DMA_INT0, 32);
134 clks_register(ARRAY_AND_SIZE(pxa910_clkregs)); 134 clkdev_add_table(ARRAY_AND_SIZE(pxa910_clkregs));
135 } 135 }
136 136
137 return 0; 137 return 0;
diff --git a/arch/arm/mach-msm/io.c b/arch/arm/mach-msm/io.c
index 1c5e7dac086f..05f96b780aa6 100644
--- a/arch/arm/mach-msm/io.c
+++ b/arch/arm/mach-msm/io.c
@@ -76,5 +76,6 @@ __msm_ioremap(unsigned long phys_addr, size_t size, unsigned int mtype)
76 mtype = MT_DEVICE_NONSHARED; 76 mtype = MT_DEVICE_NONSHARED;
77 } 77 }
78 78
79 return __arm_ioremap(phys_addr, size, mtype); 79 return __arm_ioremap_caller(phys_addr, size, mtype,
80 __builtin_return_address(0));
80} 81}
diff --git a/arch/arm/mach-mv78xx0/include/mach/vmalloc.h b/arch/arm/mach-mv78xx0/include/mach/vmalloc.h
index 1c4954386a84..ba26fe98e640 100644
--- a/arch/arm/mach-mv78xx0/include/mach/vmalloc.h
+++ b/arch/arm/mach-mv78xx0/include/mach/vmalloc.h
@@ -2,4 +2,4 @@
2 * arch/arm/mach-mv78xx0/include/mach/vmalloc.h 2 * arch/arm/mach-mv78xx0/include/mach/vmalloc.h
3 */ 3 */
4 4
5#define VMALLOC_END 0xfe000000 5#define VMALLOC_END 0xfe000000UL
diff --git a/arch/arm/mach-mx1/clock.c b/arch/arm/mach-mx1/clock.c
index d1b588519ad2..6cf2d4a7511d 100644
--- a/arch/arm/mach-mx1/clock.c
+++ b/arch/arm/mach-mx1/clock.c
@@ -570,7 +570,6 @@ static struct clk_lookup lookups[] __initdata = {
570int __init mx1_clocks_init(unsigned long fref) 570int __init mx1_clocks_init(unsigned long fref)
571{ 571{
572 unsigned int reg; 572 unsigned int reg;
573 int i;
574 573
575 /* disable clocks we are able to */ 574 /* disable clocks we are able to */
576 __raw_writel(0, SCM_GCCR); 575 __raw_writel(0, SCM_GCCR);
@@ -592,8 +591,7 @@ int __init mx1_clocks_init(unsigned long fref)
592 reg = (reg & CCM_CSCR_CLKO_MASK) >> CCM_CSCR_CLKO_OFFSET; 591 reg = (reg & CCM_CSCR_CLKO_MASK) >> CCM_CSCR_CLKO_OFFSET;
593 clko_clk.parent = (struct clk *)clko_clocks[reg]; 592 clko_clk.parent = (struct clk *)clko_clocks[reg];
594 593
595 for (i = 0; i < ARRAY_SIZE(lookups); i++) 594 clkdev_add_table(lookups, ARRAY_SIZE(lookups));
596 clkdev_add(&lookups[i]);
597 595
598 clk_enable(&hclk); 596 clk_enable(&hclk);
599 clk_enable(&fclk); 597 clk_enable(&fclk);
diff --git a/arch/arm/mach-mx2/clock_imx21.c b/arch/arm/mach-mx2/clock_imx21.c
index 91901b5d56c2..e82b489d1215 100644
--- a/arch/arm/mach-mx2/clock_imx21.c
+++ b/arch/arm/mach-mx2/clock_imx21.c
@@ -968,7 +968,6 @@ static struct clk_lookup lookups[] = {
968 */ 968 */
969int __init mx21_clocks_init(unsigned long lref, unsigned long href) 969int __init mx21_clocks_init(unsigned long lref, unsigned long href)
970{ 970{
971 int i;
972 u32 cscr; 971 u32 cscr;
973 972
974 external_low_reference = lref; 973 external_low_reference = lref;
@@ -986,8 +985,7 @@ int __init mx21_clocks_init(unsigned long lref, unsigned long href)
986 else 985 else
987 spll_clk.parent = &fpm_clk; 986 spll_clk.parent = &fpm_clk;
988 987
989 for (i = 0; i < ARRAY_SIZE(lookups); i++) 988 clkdev_add_table(lookups, ARRAY_SIZE(lookups));
990 clkdev_add(&lookups[i]);
991 989
992 /* Turn off all clock gates */ 990 /* Turn off all clock gates */
993 __raw_writel(0, CCM_PCCR0); 991 __raw_writel(0, CCM_PCCR0);
diff --git a/arch/arm/mach-mx2/clock_imx27.c b/arch/arm/mach-mx2/clock_imx27.c
index b010bf9ceaab..18c53a6487fa 100644
--- a/arch/arm/mach-mx2/clock_imx27.c
+++ b/arch/arm/mach-mx2/clock_imx27.c
@@ -719,7 +719,6 @@ static void __init to2_adjust_clocks(void)
719int __init mx27_clocks_init(unsigned long fref) 719int __init mx27_clocks_init(unsigned long fref)
720{ 720{
721 u32 cscr = __raw_readl(CCM_CSCR); 721 u32 cscr = __raw_readl(CCM_CSCR);
722 int i;
723 722
724 external_high_reference = fref; 723 external_high_reference = fref;
725 724
@@ -736,8 +735,7 @@ int __init mx27_clocks_init(unsigned long fref)
736 735
737 to2_adjust_clocks(); 736 to2_adjust_clocks();
738 737
739 for (i = 0; i < ARRAY_SIZE(lookups); i++) 738 clkdev_add_table(lookups, ARRAY_SIZE(lookups));
740 clkdev_add(&lookups[i]);
741 739
742 /* Turn off all clocks we do not need */ 740 /* Turn off all clocks we do not need */
743 __raw_writel(0, CCM_PCCR0); 741 __raw_writel(0, CCM_PCCR0);
diff --git a/arch/arm/mach-mx25/clock.c b/arch/arm/mach-mx25/clock.c
index 6acc88bcdc40..37e1359ad0c0 100644
--- a/arch/arm/mach-mx25/clock.c
+++ b/arch/arm/mach-mx25/clock.c
@@ -218,10 +218,7 @@ static struct clk_lookup lookups[] = {
218 218
219int __init mx25_clocks_init(void) 219int __init mx25_clocks_init(void)
220{ 220{
221 int i; 221 clkdev_add_table(lookups, ARRAY_SIZE(lookups));
222
223 for (i = 0; i < ARRAY_SIZE(lookups); i++)
224 clkdev_add(&lookups[i]);
225 222
226 /* Turn off all clocks except the ones we need to survive, namely: 223 /* Turn off all clocks except the ones we need to survive, namely:
227 * EMI, GPIO1-3 (CCM_CGCR1[18:16]), GPT1, IOMUXC (CCM_CGCR1[27]), IIM, 224 * EMI, GPIO1-3 (CCM_CGCR1[18:16]), GPT1, IOMUXC (CCM_CGCR1[27]), IIM,
diff --git a/arch/arm/mach-mx3/clock-imx35.c b/arch/arm/mach-mx3/clock-imx35.c
index 7584b4c6c556..f3f41fa4f21b 100644
--- a/arch/arm/mach-mx3/clock-imx35.c
+++ b/arch/arm/mach-mx3/clock-imx35.c
@@ -485,15 +485,13 @@ static struct clk_lookup lookups[] = {
485 485
486int __init mx35_clocks_init() 486int __init mx35_clocks_init()
487{ 487{
488 int i;
489 unsigned int ll = 0; 488 unsigned int ll = 0;
490 489
491#if defined(CONFIG_DEBUG_LL) && !defined(CONFIG_DEBUG_ICEDCC) 490#if defined(CONFIG_DEBUG_LL) && !defined(CONFIG_DEBUG_ICEDCC)
492 ll = (3 << 16); 491 ll = (3 << 16);
493#endif 492#endif
494 493
495 for (i = 0; i < ARRAY_SIZE(lookups); i++) 494 clkdev_add_table(lookups, ARRAY_SIZE(lookups));
496 clkdev_add(&lookups[i]);
497 495
498 /* Turn off all clocks except the ones we need to survive, namely: 496 /* Turn off all clocks except the ones we need to survive, namely:
499 * EMI, GPIO1/2/3, GPT, IOMUX, MAX and eventually uart 497 * EMI, GPIO1/2/3, GPT, IOMUX, MAX and eventually uart
diff --git a/arch/arm/mach-mx3/clock.c b/arch/arm/mach-mx3/clock.c
index 27a318af0d20..b5c39a016db7 100644
--- a/arch/arm/mach-mx3/clock.c
+++ b/arch/arm/mach-mx3/clock.c
@@ -578,12 +578,10 @@ static struct clk_lookup lookups[] = {
578int __init mx31_clocks_init(unsigned long fref) 578int __init mx31_clocks_init(unsigned long fref)
579{ 579{
580 u32 reg; 580 u32 reg;
581 int i;
582 581
583 ckih_rate = fref; 582 ckih_rate = fref;
584 583
585 for (i = 0; i < ARRAY_SIZE(lookups); i++) 584 clkdev_add_table(lookups, ARRAY_SIZE(lookups));
586 clkdev_add(&lookups[i]);
587 585
588 /* change the csi_clk parent if necessary */ 586 /* change the csi_clk parent if necessary */
589 reg = __raw_readl(MXC_CCM_CCMR); 587 reg = __raw_readl(MXC_CCM_CCMR);
diff --git a/arch/arm/mach-mxc91231/clock.c b/arch/arm/mach-mxc91231/clock.c
index ecfa37fef8ad..5c85075d8a56 100644
--- a/arch/arm/mach-mxc91231/clock.c
+++ b/arch/arm/mach-mxc91231/clock.c
@@ -624,7 +624,6 @@ static struct clk_lookup lookups[] = {
624int __init mxc91231_clocks_init(unsigned long fref) 624int __init mxc91231_clocks_init(unsigned long fref)
625{ 625{
626 void __iomem *gpt_base; 626 void __iomem *gpt_base;
627 int i;
628 627
629 ckih_rate = fref; 628 ckih_rate = fref;
630 629
@@ -632,8 +631,7 @@ int __init mxc91231_clocks_init(unsigned long fref)
632 sdhc_clk[0].parent = clk_sdhc_parent(&sdhc_clk[0]); 631 sdhc_clk[0].parent = clk_sdhc_parent(&sdhc_clk[0]);
633 sdhc_clk[1].parent = clk_sdhc_parent(&sdhc_clk[1]); 632 sdhc_clk[1].parent = clk_sdhc_parent(&sdhc_clk[1]);
634 633
635 for (i = 0; i < ARRAY_SIZE(lookups); i++) 634 clkdev_add_table(lookups, ARRAY_SIZE(lookups));
636 clkdev_add(&lookups[i]);
637 635
638 gpt_base = MXC91231_IO_ADDRESS(MXC91231_GPT1_BASE_ADDR); 636 gpt_base = MXC91231_IO_ADDRESS(MXC91231_GPT1_BASE_ADDR);
639 mxc_timer_init(&gpt_clk, gpt_base, MXC91231_INT_GPT); 637 mxc_timer_init(&gpt_clk, gpt_base, MXC91231_INT_GPT);
diff --git a/arch/arm/mach-nomadik/cpu-8815.c b/arch/arm/mach-nomadik/cpu-8815.c
index f93c59634191..9bf33b30a025 100644
--- a/arch/arm/mach-nomadik/cpu-8815.c
+++ b/arch/arm/mach-nomadik/cpu-8815.c
@@ -86,11 +86,19 @@ static struct amba_device cpu8815_amba_gpio[] = {
86 }, 86 },
87}; 87};
88 88
89static struct amba_device cpu8815_amba_rng = {
90 .dev = {
91 .init_name = "rng",
92 },
93 __MEM_4K_RESOURCE(NOMADIK_RNG_BASE),
94};
95
89static struct amba_device *amba_devs[] __initdata = { 96static struct amba_device *amba_devs[] __initdata = {
90 cpu8815_amba_gpio + 0, 97 cpu8815_amba_gpio + 0,
91 cpu8815_amba_gpio + 1, 98 cpu8815_amba_gpio + 1,
92 cpu8815_amba_gpio + 2, 99 cpu8815_amba_gpio + 2,
93 cpu8815_amba_gpio + 3, 100 cpu8815_amba_gpio + 3,
101 &cpu8815_amba_rng
94}; 102};
95 103
96static int __init cpu8815_init(void) 104static int __init cpu8815_init(void)
diff --git a/arch/arm/mach-nomadik/include/mach/vmalloc.h b/arch/arm/mach-nomadik/include/mach/vmalloc.h
index be12e31ea528..f83d574d9445 100644
--- a/arch/arm/mach-nomadik/include/mach/vmalloc.h
+++ b/arch/arm/mach-nomadik/include/mach/vmalloc.h
@@ -1,2 +1,2 @@
1 1
2#define VMALLOC_END 0xe8000000 2#define VMALLOC_END 0xe8000000UL
diff --git a/arch/arm/mach-ns9xxx/include/mach/vmalloc.h b/arch/arm/mach-ns9xxx/include/mach/vmalloc.h
index fe964d3bcc47..c8651974c4b0 100644
--- a/arch/arm/mach-ns9xxx/include/mach/vmalloc.h
+++ b/arch/arm/mach-ns9xxx/include/mach/vmalloc.h
@@ -11,6 +11,6 @@
11#ifndef __ASM_ARCH_VMALLOC_H 11#ifndef __ASM_ARCH_VMALLOC_H
12#define __ASM_ARCH_VMALLOC_H 12#define __ASM_ARCH_VMALLOC_H
13 13
14#define VMALLOC_END (0xf0000000) 14#define VMALLOC_END (0xf0000000UL)
15 15
16#endif /* ifndef __ASM_ARCH_VMALLOC_H */ 16#endif /* ifndef __ASM_ARCH_VMALLOC_H */
diff --git a/arch/arm/mach-nuc93x/Kconfig b/arch/arm/mach-nuc93x/Kconfig
new file mode 100644
index 000000000000..2bc40a280fad
--- /dev/null
+++ b/arch/arm/mach-nuc93x/Kconfig
@@ -0,0 +1,19 @@
1if ARCH_NUC93X
2
3config CPU_NUC932
4 bool
5 help
6 Support for NUC932 of Nuvoton NUC93X CPUs.
7
8menu "NUC932 Machines"
9
10config MACH_NUC932EVB
11 bool "Nuvoton NUC932 Evaluation Board"
12 default y
13 select CPU_NUC932
14 help
15 Say Y here if you are using the Nuvoton NUC932EVB
16
17endmenu
18
19endif
diff --git a/arch/arm/mach-nuc93x/Makefile b/arch/arm/mach-nuc93x/Makefile
new file mode 100644
index 000000000000..440e2dec6c8a
--- /dev/null
+++ b/arch/arm/mach-nuc93x/Makefile
@@ -0,0 +1,14 @@
1#
2# Makefile for the linux kernel.
3#
4
5# Object file lists.
6
7obj-y := irq.o time.o dev.o cpu.o clock.o
8# NUC932 CPU support files
9
10obj-$(CONFIG_CPU_NUC932) += nuc932.o
11
12# machine support
13
14obj-$(CONFIG_MACH_NUC932EVB) += mach-nuc932evb.o
diff --git a/arch/arm/mach-nuc93x/Makefile.boot b/arch/arm/mach-nuc93x/Makefile.boot
new file mode 100644
index 000000000000..a057b546b6e5
--- /dev/null
+++ b/arch/arm/mach-nuc93x/Makefile.boot
@@ -0,0 +1,3 @@
1zreladdr-y := 0x00008000
2params_phys-y := 0x00000100
3
diff --git a/arch/arm/mach-nuc93x/clock.c b/arch/arm/mach-nuc93x/clock.c
new file mode 100644
index 000000000000..0521efbc48c9
--- /dev/null
+++ b/arch/arm/mach-nuc93x/clock.c
@@ -0,0 +1,83 @@
1/*
2 * linux/arch/arm/mach-nuc93x/clock.c
3 *
4 * Copyright (c) 2008 Nuvoton technology corporation
5 *
6 * Wan ZongShun <mcuos.com@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 as published by
10 * the Free Software Foundation; either version 2 of the License.
11 */
12
13#include <linux/module.h>
14#include <linux/kernel.h>
15#include <linux/list.h>
16#include <linux/errno.h>
17#include <linux/err.h>
18#include <linux/string.h>
19#include <linux/clk.h>
20#include <linux/spinlock.h>
21#include <linux/platform_device.h>
22#include <linux/io.h>
23
24#include <mach/hardware.h>
25
26#include "clock.h"
27
28static DEFINE_SPINLOCK(clocks_lock);
29
30int clk_enable(struct clk *clk)
31{
32 unsigned long flags;
33
34 spin_lock_irqsave(&clocks_lock, flags);
35 if (clk->enabled++ == 0)
36 (clk->enable)(clk, 1);
37 spin_unlock_irqrestore(&clocks_lock, flags);
38
39 return 0;
40}
41EXPORT_SYMBOL(clk_enable);
42
43void clk_disable(struct clk *clk)
44{
45 unsigned long flags;
46
47 WARN_ON(clk->enabled == 0);
48
49 spin_lock_irqsave(&clocks_lock, flags);
50 if (--clk->enabled == 0)
51 (clk->enable)(clk, 0);
52 spin_unlock_irqrestore(&clocks_lock, flags);
53}
54EXPORT_SYMBOL(clk_disable);
55
56unsigned long clk_get_rate(struct clk *clk)
57{
58 return 27000000;
59}
60EXPORT_SYMBOL(clk_get_rate);
61
62void nuc93x_clk_enable(struct clk *clk, int enable)
63{
64 unsigned int clocks = clk->cken;
65 unsigned long clken;
66
67 clken = __raw_readl(NUC93X_VA_CLKPWR);
68
69 if (enable)
70 clken |= clocks;
71 else
72 clken &= ~clocks;
73
74 __raw_writel(clken, NUC93X_VA_CLKPWR);
75}
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-nuc93x/clock.h b/arch/arm/mach-nuc93x/clock.h
new file mode 100644
index 000000000000..18e51be4816f
--- /dev/null
+++ b/arch/arm/mach-nuc93x/clock.h
@@ -0,0 +1,36 @@
1/*
2 * linux/arch/arm/mach-nuc93x/clock.h
3 *
4 * Copyright (c) 2008 Nuvoton technology corporation
5 *
6 * Wan ZongShun <mcuos.com@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 as published by
10 * the Free Software Foundation; either version 2 of the License.
11 */
12
13#include <asm/clkdev.h>
14
15void nuc93x_clk_enable(struct clk *clk, int enable);
16void clks_register(struct clk_lookup *clks, size_t num);
17
18struct clk {
19 unsigned long cken;
20 unsigned int enabled;
21 void (*enable)(struct clk *, int enable);
22};
23
24#define DEFINE_CLK(_name, _ctrlbit) \
25struct clk clk_##_name = { \
26 .enable = nuc93x_clk_enable, \
27 .cken = (1 << _ctrlbit), \
28 }
29
30#define DEF_CLKLOOK(_clk, _devname, _conname) \
31 { \
32 .clk = _clk, \
33 .dev_id = _devname, \
34 .con_id = _conname, \
35 }
36
diff --git a/arch/arm/mach-nuc93x/cpu.c b/arch/arm/mach-nuc93x/cpu.c
new file mode 100644
index 000000000000..f6ff5d87354c
--- /dev/null
+++ b/arch/arm/mach-nuc93x/cpu.c
@@ -0,0 +1,135 @@
1/*
2 * linux/arch/arm/mach-nuc93x/cpu.c
3 *
4 * Copyright (c) 2009 Nuvoton corporation.
5 *
6 * Wan ZongShun <mcuos.com@gmail.com>
7 *
8 * NUC93x series cpu common 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 as published by
12 * the Free Software Foundation;version 2 of the License.
13 *
14 */
15
16#include <linux/kernel.h>
17#include <linux/types.h>
18#include <linux/interrupt.h>
19#include <linux/list.h>
20#include <linux/timer.h>
21#include <linux/init.h>
22#include <linux/platform_device.h>
23#include <linux/io.h>
24#include <linux/serial_8250.h>
25#include <linux/delay.h>
26
27#include <asm/mach/arch.h>
28#include <asm/mach/map.h>
29#include <asm/mach/irq.h>
30#include <asm/irq.h>
31
32#include <mach/hardware.h>
33#include <mach/regs-serial.h>
34#include <mach/regs-clock.h>
35#include <mach/regs-ebi.h>
36
37#include "cpu.h"
38#include "clock.h"
39
40/* Initial IO mappings */
41
42static struct map_desc nuc93x_iodesc[] __initdata = {
43 IODESC_ENT(IRQ),
44 IODESC_ENT(GCR),
45 IODESC_ENT(UART),
46 IODESC_ENT(TIMER),
47 IODESC_ENT(EBI),
48};
49
50/* Initial nuc932 clock declarations. */
51static DEFINE_CLK(audio, 2);
52static DEFINE_CLK(sd, 3);
53static DEFINE_CLK(jpg, 4);
54static DEFINE_CLK(video, 5);
55static DEFINE_CLK(vpost, 6);
56static DEFINE_CLK(2d, 7);
57static DEFINE_CLK(gpu, 8);
58static DEFINE_CLK(gdma, 9);
59static DEFINE_CLK(adc, 10);
60static DEFINE_CLK(uart, 11);
61static DEFINE_CLK(spi, 12);
62static DEFINE_CLK(pwm, 13);
63static DEFINE_CLK(timer, 14);
64static DEFINE_CLK(wdt, 15);
65static DEFINE_CLK(ac97, 16);
66static DEFINE_CLK(i2s, 16);
67static DEFINE_CLK(usbck, 17);
68static DEFINE_CLK(usb48, 18);
69static DEFINE_CLK(usbh, 19);
70static DEFINE_CLK(i2c, 20);
71static DEFINE_CLK(ext, 0);
72
73static struct clk_lookup nuc932_clkregs[] = {
74 DEF_CLKLOOK(&clk_audio, "nuc932-audio", NULL),
75 DEF_CLKLOOK(&clk_sd, "nuc932-sd", NULL),
76 DEF_CLKLOOK(&clk_jpg, "nuc932-jpg", "NULL"),
77 DEF_CLKLOOK(&clk_video, "nuc932-video", "NULL"),
78 DEF_CLKLOOK(&clk_vpost, "nuc932-vpost", NULL),
79 DEF_CLKLOOK(&clk_2d, "nuc932-2d", NULL),
80 DEF_CLKLOOK(&clk_gpu, "nuc932-gpu", NULL),
81 DEF_CLKLOOK(&clk_gdma, "nuc932-gdma", "NULL"),
82 DEF_CLKLOOK(&clk_adc, "nuc932-adc", NULL),
83 DEF_CLKLOOK(&clk_uart, NULL, "uart"),
84 DEF_CLKLOOK(&clk_spi, "nuc932-spi", NULL),
85 DEF_CLKLOOK(&clk_pwm, "nuc932-pwm", NULL),
86 DEF_CLKLOOK(&clk_timer, NULL, "timer"),
87 DEF_CLKLOOK(&clk_wdt, "nuc932-wdt", NULL),
88 DEF_CLKLOOK(&clk_ac97, "nuc932-ac97", NULL),
89 DEF_CLKLOOK(&clk_i2s, "nuc932-i2s", NULL),
90 DEF_CLKLOOK(&clk_usbck, "nuc932-usbck", NULL),
91 DEF_CLKLOOK(&clk_usb48, "nuc932-usb48", NULL),
92 DEF_CLKLOOK(&clk_usbh, "nuc932-usbh", NULL),
93 DEF_CLKLOOK(&clk_i2c, "nuc932-i2c", NULL),
94 DEF_CLKLOOK(&clk_ext, NULL, "ext"),
95};
96
97/* Initial serial platform data */
98
99struct plat_serial8250_port nuc93x_uart_data[] = {
100 NUC93X_8250PORT(UART0),
101 {},
102};
103
104struct platform_device nuc93x_serial_device = {
105 .name = "serial8250",
106 .id = PLAT8250_DEV_PLATFORM,
107 .dev = {
108 .platform_data = nuc93x_uart_data,
109 },
110};
111
112/*Init NUC93x evb io*/
113
114void __init nuc93x_map_io(struct map_desc *mach_desc, int mach_size)
115{
116 unsigned long idcode = 0x0;
117
118 iotable_init(mach_desc, mach_size);
119 iotable_init(nuc93x_iodesc, ARRAY_SIZE(nuc93x_iodesc));
120
121 idcode = __raw_readl(NUC93XPDID);
122 if (idcode == NUC932_CPUID)
123 printk(KERN_INFO "CPU type 0x%08lx is NUC910\n", idcode);
124 else
125 printk(KERN_ERR "CPU type detect error!\n");
126
127}
128
129/*Init NUC93x clock*/
130
131void __init nuc93x_init_clocks(void)
132{
133 clks_register(nuc932_clkregs, ARRAY_SIZE(nuc932_clkregs));
134}
135
diff --git a/arch/arm/mach-nuc93x/cpu.h b/arch/arm/mach-nuc93x/cpu.h
new file mode 100644
index 000000000000..9def28197bc9
--- /dev/null
+++ b/arch/arm/mach-nuc93x/cpu.h
@@ -0,0 +1,48 @@
1/*
2 * arch/arm/mach-nuc93x/cpu.h
3 *
4 * Copyright (c) 2008 Nuvoton technology corporation
5 * All rights reserved.
6 *
7 * Header file for NUC93X CPU support
8 *
9 * Wan ZongShun <mcuos.com@gmail.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 */
16
17#define IODESC_ENT(y) \
18{ \
19 .virtual = (unsigned long)NUC93X_VA_##y, \
20 .pfn = __phys_to_pfn(NUC93X_PA_##y), \
21 .length = NUC93X_SZ_##y, \
22 .type = MT_DEVICE, \
23}
24
25#define NUC93X_8250PORT(name) \
26{ \
27 .membase = name##_BA, \
28 .mapbase = name##_PA, \
29 .irq = IRQ_##name, \
30 .uartclk = 57139200, \
31 .regshift = 2, \
32 .iotype = UPIO_MEM, \
33 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, \
34}
35
36/*Cpu identifier register*/
37
38#define NUC93XPDID NUC93X_VA_GCR
39#define NUC932_CPUID 0x29550091
40
41/* extern file from cpu.c */
42
43extern void nuc93x_clock_source(struct device *dev, unsigned char *src);
44extern void nuc93x_init_clocks(void);
45extern void nuc93x_map_io(struct map_desc *mach_desc, int mach_size);
46extern void nuc93x_board_init(struct platform_device **device, int size);
47extern struct platform_device nuc93x_serial_device;
48
diff --git a/arch/arm/mach-nuc93x/dev.c b/arch/arm/mach-nuc93x/dev.c
new file mode 100644
index 000000000000..a962ae9578d6
--- /dev/null
+++ b/arch/arm/mach-nuc93x/dev.c
@@ -0,0 +1,42 @@
1/*
2 * linux/arch/arm/mach-nuc93x/dev.c
3 *
4 * Copyright (C) 2009 Nuvoton corporation.
5 *
6 * Wan ZongShun <mcuos.com@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 as
10 * published by the Free Software Foundation;version 2 of the License.
11 *
12 */
13
14#include <linux/kernel.h>
15#include <linux/types.h>
16#include <linux/interrupt.h>
17#include <linux/list.h>
18#include <linux/timer.h>
19#include <linux/init.h>
20#include <linux/platform_device.h>
21
22#include <asm/mach/arch.h>
23#include <asm/mach/map.h>
24#include <asm/mach/irq.h>
25#include <asm/mach-types.h>
26
27#include "cpu.h"
28
29/*Here should be your evb resourse,such as LCD*/
30
31static struct platform_device *nuc93x_public_dev[] __initdata = {
32 &nuc93x_serial_device,
33};
34
35/* Provide adding specific CPU platform devices API */
36
37void __init nuc93x_board_init(struct platform_device **device, int size)
38{
39 platform_add_devices(device, size);
40 platform_add_devices(nuc93x_public_dev, ARRAY_SIZE(nuc93x_public_dev));
41}
42
diff --git a/arch/arm/mach-nuc93x/include/mach/clkdev.h b/arch/arm/mach-nuc93x/include/mach/clkdev.h
new file mode 100644
index 000000000000..04b37a89801c
--- /dev/null
+++ b/arch/arm/mach-nuc93x/include/mach/clkdev.h
@@ -0,0 +1,7 @@
1#ifndef __ASM_MACH_CLKDEV_H
2#define __ASM_MACH_CLKDEV_H
3
4#define __clk_get(clk) ({ 1; })
5#define __clk_put(clk) do { } while (0)
6
7#endif
diff --git a/arch/arm/mach-nuc93x/include/mach/entry-macro.S b/arch/arm/mach-nuc93x/include/mach/entry-macro.S
new file mode 100644
index 000000000000..1352cbda3797
--- /dev/null
+++ b/arch/arm/mach-nuc93x/include/mach/entry-macro.S
@@ -0,0 +1,32 @@
1/*
2 * arch/arm/mach-nuc93x/include/mach/entry-macro.S
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
10#include <mach/hardware.h>
11#include <mach/regs-irq.h>
12
13 .macro get_irqnr_preamble, base, tmp
14 .endm
15
16 .macro arch_ret_to_user, tmp1, tmp2
17 .endm
18
19 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
20
21 mov \base, #AIC_BA
22
23 ldr \irqnr, [ \base, #AIC_IPER]
24 ldr \irqnr, [ \base, #AIC_ISNR]
25 cmp \irqnr, #0
26
27 .endm
28
29 /* currently don't need an disable_fiq macro */
30
31 .macro disable_fiq
32 .endm
diff --git a/arch/arm/mach-nuc93x/include/mach/hardware.h b/arch/arm/mach-nuc93x/include/mach/hardware.h
new file mode 100644
index 000000000000..fb5c6fcb142e
--- /dev/null
+++ b/arch/arm/mach-nuc93x/include/mach/hardware.h
@@ -0,0 +1,22 @@
1/*
2 * arch/arm/mach-nuc93x/include/mach/hardware.h
3 *
4 * Copyright (c) 2008 Nuvoton technology corporation
5 * All rights reserved.
6 *
7 * Wan ZongShun <mcuos.com@gmail.com>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 */
15
16#ifndef __ASM_ARCH_HARDWARE_H
17#define __ASM_ARCH_HARDWARE_H
18
19#include <asm/sizes.h>
20#include <mach/map.h>
21
22#endif /* __ASM_ARCH_HARDWARE_H */
diff --git a/arch/arm/mach-nuc93x/include/mach/io.h b/arch/arm/mach-nuc93x/include/mach/io.h
new file mode 100644
index 000000000000..72e5051c7534
--- /dev/null
+++ b/arch/arm/mach-nuc93x/include/mach/io.h
@@ -0,0 +1,28 @@
1/*
2 * arch/arm/mach-nuc93x/include/mach/io.h
3 *
4 * Copyright (c) 2008 Nuvoton technology corporation
5 * All rights reserved.
6 *
7 * Wan ZongShun <mcuos.com@gmail.com>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 */
15
16#ifndef __ASM_ARM_ARCH_IO_H
17#define __ASM_ARM_ARCH_IO_H
18
19#define IO_SPACE_LIMIT 0xffffffff
20
21/*
22 * 1:1 mapping for ioremapped regions.
23 */
24
25#define __mem_pci(a) (a)
26#define __io(a) __typesafe_io(a)
27
28#endif
diff --git a/arch/arm/mach-nuc93x/include/mach/irqs.h b/arch/arm/mach-nuc93x/include/mach/irqs.h
new file mode 100644
index 000000000000..7c4aa71edb44
--- /dev/null
+++ b/arch/arm/mach-nuc93x/include/mach/irqs.h
@@ -0,0 +1,59 @@
1/*
2 * arch/arm/mach-nuc93x/include/mach/irqs.h
3 *
4 * Copyright (c) 2008 Nuvoton technology corporation.
5 *
6 * Wan ZongShun <mcuos.com@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 as published by
10 * the Free Software Foundation;version 2 of the License.
11 *
12 */
13
14#ifndef __ASM_ARCH_IRQS_H
15#define __ASM_ARCH_IRQS_H
16
17#define NUC93X_IRQ(x) (x)
18
19/* Main cpu interrupts */
20
21#define IRQ_WDT NUC93X_IRQ(1)
22#define IRQ_IRQ0 NUC93X_IRQ(2)
23#define IRQ_IRQ1 NUC93X_IRQ(3)
24#define IRQ_IRQ2 NUC93X_IRQ(4)
25#define IRQ_IRQ3 NUC93X_IRQ(5)
26#define IRQ_USBH NUC93X_IRQ(6)
27#define IRQ_APU NUC93X_IRQ(7)
28#define IRQ_VPOST NUC93X_IRQ(8)
29#define IRQ_ADC NUC93X_IRQ(9)
30#define IRQ_UART0 NUC93X_IRQ(10)
31#define IRQ_TIMER0 NUC93X_IRQ(11)
32#define IRQ_GPU0 NUC93X_IRQ(12)
33#define IRQ_GPU1 NUC93X_IRQ(13)
34#define IRQ_GPU2 NUC93X_IRQ(14)
35#define IRQ_GPU3 NUC93X_IRQ(15)
36#define IRQ_GPU4 NUC93X_IRQ(16)
37#define IRQ_VIN NUC93X_IRQ(17)
38#define IRQ_USBD NUC93X_IRQ(18)
39#define IRQ_VRAMLD NUC93X_IRQ(19)
40#define IRQ_GDMA0 NUC93X_IRQ(20)
41#define IRQ_GDMA1 NUC93X_IRQ(21)
42#define IRQ_SDIO NUC93X_IRQ(22)
43#define IRQ_FMI NUC93X_IRQ(22)
44#define IRQ_JPEG NUC93X_IRQ(23)
45#define IRQ_SPI0 NUC93X_IRQ(24)
46#define IRQ_SPI1 NUC93X_IRQ(25)
47#define IRQ_RTC NUC93X_IRQ(26)
48#define IRQ_PWM0 NUC93X_IRQ(27)
49#define IRQ_PWM1 NUC93X_IRQ(28)
50#define IRQ_PWM2 NUC93X_IRQ(29)
51#define IRQ_PWM3 NUC93X_IRQ(30)
52#define IRQ_I2SAC97 NUC93X_IRQ(31)
53#define IRQ_CAP0 IRQ_PWM0
54#define IRQ_CAP1 IRQ_PWM1
55#define IRQ_CAP2 IRQ_PWM2
56#define IRQ_CAP3 IRQ_PWM3
57#define NR_IRQS (IRQ_I2SAC97 + 1)
58
59#endif /* __ASM_ARCH_IRQ_H */
diff --git a/arch/arm/mach-nuc93x/include/mach/map.h b/arch/arm/mach-nuc93x/include/mach/map.h
new file mode 100644
index 000000000000..fd0b5e89f0e7
--- /dev/null
+++ b/arch/arm/mach-nuc93x/include/mach/map.h
@@ -0,0 +1,139 @@
1/*
2 * arch/arm/mach-nuc93x/include/mach/map.h
3 *
4 * Copyright (c) 2008 Nuvoton technology corporation.
5 *
6 * Wan ZongShun <mcuos.com@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 as published by
10 * the Free Software Foundation;version 2 of the License.
11 *
12 */
13
14#ifndef __ASM_ARCH_MAP_H
15#define __ASM_ARCH_MAP_H
16
17#define MAP_OFFSET (0xfff00000)
18#define CLK_OFFSET (0x10)
19
20#ifndef __ASSEMBLY__
21#define NUC93X_ADDR(x) ((void __iomem *)(0xF0000000 + ((x)&(~MAP_OFFSET))))
22#else
23#define NUC93X_ADDR(x) (0xF0000000 + ((x)&(~MAP_OFFSET)))
24#endif
25
26 /*
27 * nuc932 hardware register definition
28 */
29
30#define NUC93X_PA_IRQ (0xFFF83000)
31#define NUC93X_PA_GCR (0xFFF00000)
32#define NUC93X_PA_EBI (0xFFF01000)
33#define NUC93X_PA_UART (0xFFF80000)
34#define NUC93X_PA_TIMER (0xFFF81000)
35#define NUC93X_PA_GPIO (0xFFF84000)
36#define NUC93X_PA_GDMA (0xFFF03000)
37#define NUC93X_PA_USBHOST (0xFFF0d000)
38#define NUC93X_PA_I2C (0xFFF89000)
39#define NUC93X_PA_LCD (0xFFF06000)
40#define NUC93X_PA_GE (0xFFF05000)
41#define NUC93X_PA_ADC (0xFFF85000)
42#define NUC93X_PA_RTC (0xFFF87000)
43#define NUC93X_PA_PWM (0xFFF82000)
44#define NUC93X_PA_ACTL (0xFFF0a000)
45#define NUC93X_PA_USBDEV (0xFFF0C000)
46#define NUC93X_PA_JEPEG (0xFFF0e000)
47#define NUC93X_PA_CACHE_T (0xFFF60000)
48#define NUC93X_PA_VRAM (0xFFF0b000)
49#define NUC93X_PA_DMAC (0xFFF09000)
50#define NUC93X_PA_I2SM (0xFFF08000)
51#define NUC93X_PA_CACHE (0xFFF02000)
52#define NUC93X_PA_GPU (0xFFF04000)
53#define NUC93X_PA_VIDEOIN (0xFFF07000)
54#define NUC93X_PA_SPI0 (0xFFF86000)
55#define NUC93X_PA_SPI1 (0xFFF88000)
56
57 /*
58 * nuc932 virtual address mapping.
59 * interrupt controller is the first thing we put in, to make
60 * the assembly code for the irq detection easier
61 */
62
63#define NUC93X_VA_IRQ NUC93X_ADDR(0x00000000)
64#define NUC93X_SZ_IRQ SZ_4K
65
66#define NUC93X_VA_GCR NUC93X_ADDR(NUC93X_PA_IRQ)
67#define NUC93X_VA_CLKPWR (NUC93X_VA_GCR+CLK_OFFSET)
68#define NUC93X_SZ_GCR SZ_4K
69
70/* EBI management */
71
72#define NUC93X_VA_EBI NUC93X_ADDR(NUC93X_PA_EBI)
73#define NUC93X_SZ_EBI SZ_4K
74
75/* UARTs */
76
77#define NUC93X_VA_UART NUC93X_ADDR(NUC93X_PA_UART)
78#define NUC93X_SZ_UART SZ_4K
79
80/* Timers */
81
82#define NUC93X_VA_TIMER NUC93X_ADDR(NUC93X_PA_TIMER)
83#define NUC93X_SZ_TIMER SZ_4K
84
85/* GPIO ports */
86
87#define NUC93X_VA_GPIO NUC93X_ADDR(NUC93X_PA_GPIO)
88#define NUC93X_SZ_GPIO SZ_4K
89
90/* GDMA control */
91
92#define NUC93X_VA_GDMA NUC93X_ADDR(NUC93X_PA_GDMA)
93#define NUC93X_SZ_GDMA SZ_4K
94
95/* I2C hardware controller */
96
97#define NUC93X_VA_I2C NUC93X_ADDR(NUC93X_PA_I2C)
98#define NUC93X_SZ_I2C SZ_4K
99
100/* LCD controller*/
101
102#define NUC93X_VA_LCD NUC93X_ADDR(NUC93X_PA_LCD)
103#define NUC93X_SZ_LCD SZ_4K
104
105/* 2D controller*/
106
107#define NUC93X_VA_GE NUC93X_ADDR(NUC93X_PA_GE)
108#define NUC93X_SZ_GE SZ_4K
109
110/* ADC */
111
112#define NUC93X_VA_ADC NUC93X_ADDR(NUC93X_PA_ADC)
113#define NUC93X_SZ_ADC SZ_4K
114
115/* RTC */
116
117#define NUC93X_VA_RTC NUC93X_ADDR(NUC93X_PA_RTC)
118#define NUC93X_SZ_RTC SZ_4K
119
120/* Pulse Width Modulation(PWM) Registers */
121
122#define NUC93X_VA_PWM NUC93X_ADDR(NUC93X_PA_PWM)
123#define NUC93X_SZ_PWM SZ_4K
124
125/* Audio Controller controller */
126
127#define NUC93X_VA_ACTL NUC93X_ADDR(NUC93X_PA_ACTL)
128#define NUC93X_SZ_ACTL SZ_4K
129
130/* USB Device port */
131
132#define NUC93X_VA_USBDEV NUC93X_ADDR(NUC93X_PA_USBDEV)
133#define NUC93X_SZ_USBDEV SZ_4K
134
135/* USB host controller*/
136#define NUC93X_VA_USBHOST NUC93X_ADDR(NUC93X_PA_USBHOST)
137#define NUC93X_SZ_USBHOST SZ_4K
138
139#endif /* __ASM_ARCH_MAP_H */
diff --git a/arch/arm/mach-nuc93x/include/mach/memory.h b/arch/arm/mach-nuc93x/include/mach/memory.h
new file mode 100644
index 000000000000..323ab0db3f7d
--- /dev/null
+++ b/arch/arm/mach-nuc93x/include/mach/memory.h
@@ -0,0 +1,21 @@
1/*
2 * arch/arm/mach-nuc93x/include/mach/memory.h
3 *
4 * Copyright (c) 2008 Nuvoton technology corporation
5 * All rights reserved.
6 *
7 * Wan ZongShun <mcuos.com@gmail.com>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 */
15
16#ifndef __ASM_ARCH_MEMORY_H
17#define __ASM_ARCH_MEMORY_H
18
19#define PHYS_OFFSET UL(0x00000000)
20
21#endif
diff --git a/arch/arm/mach-nuc93x/include/mach/regs-clock.h b/arch/arm/mach-nuc93x/include/mach/regs-clock.h
new file mode 100644
index 000000000000..5cb2954fbec2
--- /dev/null
+++ b/arch/arm/mach-nuc93x/include/mach/regs-clock.h
@@ -0,0 +1,53 @@
1/*
2 * arch/arm/mach-nuc93x/include/mach/regs-clock.h
3 *
4 * Copyright (c) 2008 Nuvoton technology corporation.
5 *
6 * Wan ZongShun <mcuos.com@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 as published by
10 * the Free Software Foundation;version 2 of the License.
11 *
12 */
13
14#ifndef __ASM_ARCH_REGS_CLOCK_H
15#define __ASM_ARCH_REGS_CLOCK_H
16
17/* Clock Control Registers */
18#define CLK_BA NUC93X_VA_CLKPWR
19#define REG_CLKEN (CLK_BA + 0x00)
20#define REG_CLKSEL (CLK_BA + 0x04)
21#define REG_CLKDIV (CLK_BA + 0x08)
22#define REG_PLLCON0 (CLK_BA + 0x0C)
23#define REG_PLLCON1 (CLK_BA + 0x10)
24#define REG_PMCON (CLK_BA + 0x14)
25#define REG_IRQWAKECON (CLK_BA + 0x18)
26#define REG_IRQWAKEFLAG (CLK_BA + 0x1C)
27#define REG_IPSRST (CLK_BA + 0x20)
28#define REG_CLKEN1 (CLK_BA + 0x24)
29#define REG_CLKDIV1 (CLK_BA + 0x28)
30
31/* Define PLL freq setting */
32#define PLL_DISABLE 0x12B63
33#define PLL_66MHZ 0x2B63
34#define PLL_100MHZ 0x4F64
35#define PLL_120MHZ 0x4F63
36#define PLL_166MHZ 0x4124
37#define PLL_200MHZ 0x4F24
38
39/* Define AHB:CPUFREQ ratio */
40#define AHB_CPUCLK_1_1 0x00
41#define AHB_CPUCLK_1_2 0x01
42#define AHB_CPUCLK_1_4 0x02
43#define AHB_CPUCLK_1_8 0x03
44
45/* Define APB:AHB ratio */
46#define APB_AHB_1_2 0x01
47#define APB_AHB_1_4 0x02
48#define APB_AHB_1_8 0x03
49
50/* Define clock skew */
51#define DEFAULTSKEW 0x48
52
53#endif /* __ASM_ARCH_REGS_CLOCK_H */
diff --git a/arch/arm/mach-nuc93x/include/mach/regs-ebi.h b/arch/arm/mach-nuc93x/include/mach/regs-ebi.h
new file mode 100644
index 000000000000..3c72550e28e4
--- /dev/null
+++ b/arch/arm/mach-nuc93x/include/mach/regs-ebi.h
@@ -0,0 +1,33 @@
1/*
2 * arch/arm/mach-nuc93x/include/mach/regs-ebi.h
3 *
4 * Copyright (c) 2009 Nuvoton technology corporation.
5 *
6 * Wan ZongShun <mcuos.com@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 as published by
10 * the Free Software Foundation;version 2 of the License.
11 *
12 */
13
14#ifndef __ASM_ARCH_REGS_EBI_H
15#define __ASM_ARCH_REGS_EBI_H
16
17/* EBI Control Registers */
18
19#define EBI_BA NUC93X_VA_EBI
20#define REG_EBICON (EBI_BA + 0x00)
21#define REG_ROMCON (EBI_BA + 0x04)
22#define REG_SDCONF0 (EBI_BA + 0x08)
23#define REG_SDCONF1 (EBI_BA + 0x0C)
24#define REG_SDTIME0 (EBI_BA + 0x10)
25#define REG_SDTIME1 (EBI_BA + 0x14)
26#define REG_EXT0CON (EBI_BA + 0x18)
27#define REG_EXT1CON (EBI_BA + 0x1C)
28#define REG_EXT2CON (EBI_BA + 0x20)
29#define REG_EXT3CON (EBI_BA + 0x24)
30#define REG_EXT4CON (EBI_BA + 0x28)
31#define REG_CKSKEW (EBI_BA + 0x2C)
32
33#endif /* __ASM_ARCH_REGS_EBI_H */
diff --git a/arch/arm/mach-nuc93x/include/mach/regs-irq.h b/arch/arm/mach-nuc93x/include/mach/regs-irq.h
new file mode 100644
index 000000000000..23021592de51
--- /dev/null
+++ b/arch/arm/mach-nuc93x/include/mach/regs-irq.h
@@ -0,0 +1,42 @@
1/*
2 * arch/arm/mach-nuc93x/include/mach/regs-irq.h
3 *
4 * Copyright (c) 2008 Nuvoton technology corporation
5 * All rights reserved.
6 *
7 * Wan ZongShun <mcuos.com@gmail.com>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 */
15
16#ifndef ___ASM_ARCH_REGS_IRQ_H
17#define ___ASM_ARCH_REGS_IRQ_H
18
19/* Advance Interrupt Controller (AIC) Registers */
20
21#define AIC_BA NUC93X_VA_IRQ
22
23#define REG_AIC_IRQSC (AIC_BA+0x80)
24#define REG_AIC_GEN (AIC_BA+0x84)
25#define REG_AIC_GASR (AIC_BA+0x88)
26#define REG_AIC_GSCR (AIC_BA+0x8C)
27#define REG_AIC_IRSR (AIC_BA+0x100)
28#define REG_AIC_IASR (AIC_BA+0x104)
29#define REG_AIC_ISR (AIC_BA+0x108)
30#define REG_AIC_IPER (AIC_BA+0x10C)
31#define REG_AIC_ISNR (AIC_BA+0x110)
32#define REG_AIC_IMR (AIC_BA+0x114)
33#define REG_AIC_OISR (AIC_BA+0x118)
34#define REG_AIC_MECR (AIC_BA+0x120)
35#define REG_AIC_MDCR (AIC_BA+0x124)
36#define REG_AIC_SSCR (AIC_BA+0x128)
37#define REG_AIC_SCCR (AIC_BA+0x12C)
38#define REG_AIC_EOSCR (AIC_BA+0x130)
39#define AIC_IPER (0x10C)
40#define AIC_ISNR (0x110)
41
42#endif /* ___ASM_ARCH_REGS_IRQ_H */
diff --git a/arch/arm/mach-nuc93x/include/mach/regs-serial.h b/arch/arm/mach-nuc93x/include/mach/regs-serial.h
new file mode 100644
index 000000000000..767a047a8bc2
--- /dev/null
+++ b/arch/arm/mach-nuc93x/include/mach/regs-serial.h
@@ -0,0 +1,52 @@
1/*
2 * arch/arm/mach-nuc93x/include/mach/regs-serial.h
3 *
4 * Copyright (c) 2008 Nuvoton technology corporation
5 * All rights reserved.
6 *
7 * Wan ZongShun <mcuos.com@gmail.com>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 */
15
16#ifndef __ASM_ARM_REGS_SERIAL_H
17#define __ASM_ARM_REGS_SERIAL_H
18
19#define UART0_BA NUC93X_VA_UART
20#define UART1_BA (NUC93X_VA_UART+0x100)
21
22#define UART0_PA NUC93X_PA_UART
23#define UART1_PA (NUC93X_PA_UART+0x100)
24
25
26#ifndef __ASSEMBLY__
27
28struct nuc93x_uart_clksrc {
29 const char *name;
30 unsigned int divisor;
31 unsigned int min_baud;
32 unsigned int max_baud;
33};
34
35struct nuc93x_uartcfg {
36 unsigned char hwport;
37 unsigned char unused;
38 unsigned short flags;
39 unsigned long uart_flags;
40
41 unsigned long ucon;
42 unsigned long ulcon;
43 unsigned long ufcon;
44
45 struct nuc93x_uart_clksrc *clocks;
46 unsigned int clocks_size;
47};
48
49#endif /* __ASSEMBLY__ */
50
51#endif /* __ASM_ARM_REGS_SERIAL_H */
52
diff --git a/arch/arm/mach-nuc93x/include/mach/regs-timer.h b/arch/arm/mach-nuc93x/include/mach/regs-timer.h
new file mode 100644
index 000000000000..394be9614d36
--- /dev/null
+++ b/arch/arm/mach-nuc93x/include/mach/regs-timer.h
@@ -0,0 +1,28 @@
1/*
2 * arch/arm/mach-nuc93x/include/mach/regs-timer.h
3 *
4 * Copyright (c) 2008 Nuvoton technology corporation
5 * All rights reserved.
6 *
7 * Wan ZongShun <mcuos.com@gmail.com>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 */
15
16#ifndef __ASM_ARCH_REGS_TIMER_H
17#define __ASM_ARCH_REGS_TIMER_H
18
19/* Timer Registers */
20
21#define TMR_BA NUC93X_VA_TIMER
22#define REG_TCSR0 (TMR_BA+0x00)
23#define REG_TICR0 (TMR_BA+0x08)
24#define REG_TDR0 (TMR_BA+0x10)
25#define REG_TISR (TMR_BA+0x18)
26#define REG_WTCR (TMR_BA+0x1C)
27
28#endif /* __ASM_ARCH_REGS_TIMER_H */
diff --git a/arch/arm/mach-nuc93x/include/mach/system.h b/arch/arm/mach-nuc93x/include/mach/system.h
new file mode 100644
index 000000000000..d26bd9a52844
--- /dev/null
+++ b/arch/arm/mach-nuc93x/include/mach/system.h
@@ -0,0 +1,28 @@
1/*
2 * arch/arm/machnuc93x/include/mach/system.h
3 *
4 * Copyright (c) 2008 Nuvoton technology corporation
5 * All rights reserved.
6 *
7 * Wan ZongShun <mcuos.com@gmail.com>
8 *
9 * Based on arch/arm/mach-s3c2410/include/mach/system.h
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 as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 */
17
18#include <asm/proc-fns.h>
19
20static void arch_idle(void)
21{
22}
23
24static void arch_reset(char mode, const char *cmd)
25{
26 cpu_reset(0);
27}
28
diff --git a/arch/arm/mach-nuc93x/include/mach/timex.h b/arch/arm/mach-nuc93x/include/mach/timex.h
new file mode 100644
index 000000000000..0c719cc91aa9
--- /dev/null
+++ b/arch/arm/mach-nuc93x/include/mach/timex.h
@@ -0,0 +1,25 @@
1/*
2 * arch/arm/mach-nuc93x/include/mach/timex.h
3 *
4 * Copyright (c) 2008 Nuvoton technology corporation
5 * All rights reserved.
6 *
7 * Wan ZongShun <mcuos.com@gmail.com>
8 *
9 * Based on arch/arm/mach-s3c2410/include/mach/timex.h
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 as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 */
17
18#ifndef __ASM_ARCH_TIMEX_H
19#define __ASM_ARCH_TIMEX_H
20
21/* CLOCK_TICK_RATE Now, I don't use it. */
22
23#define CLOCK_TICK_RATE 27000000
24
25#endif /* __ASM_ARCH_TIMEX_H */
diff --git a/arch/arm/mach-nuc93x/include/mach/uncompress.h b/arch/arm/mach-nuc93x/include/mach/uncompress.h
new file mode 100644
index 000000000000..73082cd61e84
--- /dev/null
+++ b/arch/arm/mach-nuc93x/include/mach/uncompress.h
@@ -0,0 +1,50 @@
1/*
2 * arch/arm/mach-nuc93x/include/mach/uncompress.h
3 *
4 * Copyright (c) 2008 Nuvoton technology corporation
5 * All rights reserved.
6 *
7 * Wan ZongShun <mcuos.com@gmail.com>
8 *
9 * Based on arch/arm/mach-s3c2410/include/mach/uncompress.h
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 as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 */
17
18#ifndef __ASM_ARCH_UNCOMPRESS_H
19#define __ASM_ARCH_UNCOMPRESS_H
20
21/* Defines for UART registers */
22
23#include <mach/regs-serial.h>
24#include <mach/map.h>
25#include <linux/serial_reg.h>
26
27#define arch_decomp_wdog()
28
29#define TX_DONE (UART_LSR_TEMT | UART_LSR_THRE)
30static u32 * uart_base = (u32 *)UART0_PA;
31
32static void putc(int ch)
33{
34 /* Check THRE and TEMT bits before we transmit the character.
35 */
36 while ((uart_base[UART_LSR] & TX_DONE) != TX_DONE)
37 barrier();
38
39 *uart_base = ch;
40}
41
42static inline void flush(void)
43{
44}
45
46static void arch_decomp_setup(void)
47{
48}
49
50#endif/* __ASM_NUC93X_UNCOMPRESS_H */
diff --git a/arch/arm/mach-nuc93x/include/mach/vmalloc.h b/arch/arm/mach-nuc93x/include/mach/vmalloc.h
new file mode 100644
index 000000000000..98a21b81dec0
--- /dev/null
+++ b/arch/arm/mach-nuc93x/include/mach/vmalloc.h
@@ -0,0 +1,23 @@
1/*
2 * arch/arm/mach-nuc93x/include/mach/vmalloc.h
3 *
4 * Copyright (c) 2008 Nuvoton technology corporation
5 * All rights reserved.
6 *
7 * Wan ZongShun <mcuos.com@gmail.com>
8 *
9 * Based on arch/arm/mach-s3c2410/include/mach/vmalloc.h
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 as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 */
17
18#ifndef __ASM_ARCH_VMALLOC_H
19#define __ASM_ARCH_VMALLOC_H
20
21#define VMALLOC_END (0xE0000000)
22
23#endif /* __ASM_ARCH_VMALLOC_H */
diff --git a/arch/arm/mach-nuc93x/irq.c b/arch/arm/mach-nuc93x/irq.c
new file mode 100644
index 000000000000..a7a88ea4ec31
--- /dev/null
+++ b/arch/arm/mach-nuc93x/irq.c
@@ -0,0 +1,66 @@
1/*
2 * linux/arch/arm/mach-nuc93x/irq.c
3 *
4 * Copyright (c) 2008 Nuvoton technology corporation.
5 *
6 * Wan ZongShun <mcuos.com@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 as published by
10 * the Free Software Foundation;version 2 of the License.
11 *
12 */
13
14#include <linux/init.h>
15#include <linux/module.h>
16#include <linux/interrupt.h>
17#include <linux/ioport.h>
18#include <linux/ptrace.h>
19#include <linux/sysdev.h>
20#include <linux/io.h>
21
22#include <asm/irq.h>
23#include <asm/mach/irq.h>
24
25#include <mach/hardware.h>
26#include <mach/regs-irq.h>
27
28static void nuc93x_irq_mask(unsigned int irq)
29{
30 __raw_writel(1 << irq, REG_AIC_MDCR);
31}
32
33/*
34 * By the w90p910 spec,any irq,only write 1
35 * to REG_AIC_EOSCR for ACK
36 */
37
38static void nuc93x_irq_ack(unsigned int irq)
39{
40 __raw_writel(0x01, REG_AIC_EOSCR);
41}
42
43static void nuc93x_irq_unmask(unsigned int irq)
44{
45 __raw_writel(1 << irq, REG_AIC_MECR);
46
47}
48
49static struct irq_chip nuc93x_irq_chip = {
50 .ack = nuc93x_irq_ack,
51 .mask = nuc93x_irq_mask,
52 .unmask = nuc93x_irq_unmask,
53};
54
55void __init nuc93x_init_irq(void)
56{
57 int irqno;
58
59 __raw_writel(0xFFFFFFFE, REG_AIC_MDCR);
60
61 for (irqno = IRQ_WDT; irqno <= NR_IRQS; irqno++) {
62 set_irq_chip(irqno, &nuc93x_irq_chip);
63 set_irq_handler(irqno, handle_level_irq);
64 set_irq_flags(irqno, IRQF_VALID);
65 }
66}
diff --git a/arch/arm/mach-nuc93x/mach-nuc932evb.c b/arch/arm/mach-nuc93x/mach-nuc932evb.c
new file mode 100644
index 000000000000..9f79266f08e2
--- /dev/null
+++ b/arch/arm/mach-nuc93x/mach-nuc932evb.c
@@ -0,0 +1,45 @@
1/*
2 * linux/arch/arm/mach-w90x900/mach-nuc910evb.c
3 *
4 * Based on mach-s3c2410/mach-smdk2410.c by Jonas Dietsche
5 *
6 * Copyright (C) 2008 Nuvoton technology corporation.
7 *
8 * Wan ZongShun <mcuos.com@gmail.com>
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License as
12 * published by the Free Software Foundation;version 2 of the License.
13 *
14 */
15
16#include <linux/platform_device.h>
17#include <asm/mach/arch.h>
18#include <asm/mach/map.h>
19#include <asm/mach-types.h>
20#include <mach/map.h>
21
22#include "nuc932.h"
23
24static void __init nuc932evb_map_io(void)
25{
26 nuc932_map_io();
27 nuc932_init_clocks();
28 nuc932_init_uartclk();
29}
30
31static void __init nuc932evb_init(void)
32{
33 nuc932_board_init();
34}
35
36MACHINE_START(NUC932EVB, "NUC932EVB")
37 /* Maintainer: Wan ZongShun */
38 .phys_io = NUC93X_PA_UART,
39 .io_pg_offst = (((u32)NUC93X_VA_UART) >> 18) & 0xfffc,
40 .boot_params = 0,
41 .map_io = nuc932evb_map_io,
42 .init_irq = nuc93x_init_irq,
43 .init_machine = nuc932evb_init,
44 .timer = &nuc93x_timer,
45MACHINE_END
diff --git a/arch/arm/mach-nuc93x/nuc932.c b/arch/arm/mach-nuc93x/nuc932.c
new file mode 100644
index 000000000000..3966ead686fc
--- /dev/null
+++ b/arch/arm/mach-nuc93x/nuc932.c
@@ -0,0 +1,65 @@
1/*
2 * linux/arch/arm/mach-nuc93x/nuc932.c
3 *
4 * Copyright (c) 2009 Nuvoton corporation.
5 *
6 * Wan ZongShun <mcuos.com@gmail.com>
7 *
8 * NUC932 cpu 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 as published by
12 * the Free Software Foundation;version 2 of the License.
13 *
14 */
15
16#include <linux/platform_device.h>
17#include <linux/clk.h>
18#include <linux/err.h>
19
20#include <asm/mach/map.h>
21#include <mach/hardware.h>
22
23#include "cpu.h"
24#include "clock.h"
25
26/* define specific CPU platform device */
27
28static struct platform_device *nuc932_dev[] __initdata = {
29};
30
31/* define specific CPU platform io map */
32
33static struct map_desc nuc932evb_iodesc[] __initdata = {
34};
35
36/*Init NUC932 evb io*/
37
38void __init nuc932_map_io(void)
39{
40 nuc93x_map_io(nuc932evb_iodesc, ARRAY_SIZE(nuc932evb_iodesc));
41}
42
43/*Init NUC932 clock*/
44
45void __init nuc932_init_clocks(void)
46{
47 nuc93x_init_clocks();
48}
49
50/*enable NUC932 uart clock*/
51
52void __init nuc932_init_uartclk(void)
53{
54 struct clk *ck_uart = clk_get(NULL, "uart");
55 BUG_ON(IS_ERR(ck_uart));
56
57 clk_enable(ck_uart);
58}
59
60/*Init NUC932 board info*/
61
62void __init nuc932_board_init(void)
63{
64 nuc93x_board_init(nuc932_dev, ARRAY_SIZE(nuc932_dev));
65}
diff --git a/arch/arm/mach-nuc93x/nuc932.h b/arch/arm/mach-nuc93x/nuc932.h
new file mode 100644
index 000000000000..9a66edd5338f
--- /dev/null
+++ b/arch/arm/mach-nuc93x/nuc932.h
@@ -0,0 +1,29 @@
1/*
2 * arch/arm/mach-nuc93x/nuc932.h
3 *
4 * Copyright (c) 2008 Nuvoton corporation
5 *
6 * Header file for NUC93x CPU support
7 *
8 * Wan ZongShun <mcuos.com@gmail.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
16struct map_desc;
17struct sys_timer;
18
19/* core initialisation functions */
20
21extern void nuc93x_init_irq(void);
22extern struct sys_timer nuc93x_timer;
23
24/* extern file from nuc932.c */
25
26extern void nuc932_board_init(void);
27extern void nuc932_init_clocks(void);
28extern void nuc932_map_io(void);
29extern void nuc932_init_uartclk(void);
diff --git a/arch/arm/mach-nuc93x/time.c b/arch/arm/mach-nuc93x/time.c
new file mode 100644
index 000000000000..2f90f9dc6e30
--- /dev/null
+++ b/arch/arm/mach-nuc93x/time.c
@@ -0,0 +1,100 @@
1/*
2 * linux/arch/arm/mach-nuc93x/time.c
3 *
4 * Copyright (c) 2009 Nuvoton technology corporation.
5 *
6 * Wan ZongShun <mcuos.com@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 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
15#include <linux/kernel.h>
16#include <linux/sched.h>
17#include <linux/init.h>
18#include <linux/interrupt.h>
19#include <linux/err.h>
20#include <linux/clk.h>
21#include <linux/io.h>
22#include <linux/leds.h>
23
24#include <asm/mach-types.h>
25#include <asm/mach/irq.h>
26#include <asm/mach/time.h>
27
28#include <mach/system.h>
29#include <mach/map.h>
30#include <mach/regs-timer.h>
31
32#define RESETINT 0x01
33#define PERIOD (0x01 << 27)
34#define ONESHOT (0x00 << 27)
35#define COUNTEN (0x01 << 30)
36#define INTEN (0x01 << 29)
37
38#define TICKS_PER_SEC 100
39#define PRESCALE 0x63 /* Divider = prescale + 1 */
40
41unsigned int timer0_load;
42
43static unsigned long nuc93x_gettimeoffset(void)
44{
45 return 0;
46}
47
48/*IRQ handler for the timer*/
49
50static irqreturn_t nuc93x_timer_interrupt(int irq, void *dev_id)
51{
52 timer_tick();
53 __raw_writel(0x01, REG_TISR); /* clear TIF0 */
54 return IRQ_HANDLED;
55}
56
57static struct irqaction nuc93x_timer_irq = {
58 .name = "nuc93x Timer Tick",
59 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
60 .handler = nuc93x_timer_interrupt,
61};
62
63/*Set up timer reg.*/
64
65static void nuc93x_timer_setup(void)
66{
67 struct clk *ck_ext = clk_get(NULL, "ext");
68 struct clk *ck_timer = clk_get(NULL, "timer");
69 unsigned int rate, val = 0;
70
71 BUG_ON(IS_ERR(ck_ext) || IS_ERR(ck_timer));
72
73 clk_enable(ck_timer);
74 rate = clk_get_rate(ck_ext);
75 clk_put(ck_ext);
76 rate = rate / (PRESCALE + 0x01);
77
78 /* set a known state */
79 __raw_writel(0x00, REG_TCSR0);
80 __raw_writel(RESETINT, REG_TISR);
81
82 timer0_load = (rate / TICKS_PER_SEC);
83 __raw_writel(timer0_load, REG_TICR0);
84
85 val |= (PERIOD | COUNTEN | INTEN | PRESCALE);;
86 __raw_writel(val, REG_TCSR0);
87
88}
89
90static void __init nuc93x_timer_init(void)
91{
92 nuc93x_timer_setup();
93 setup_irq(IRQ_TIMER0, &nuc93x_timer_irq);
94}
95
96struct sys_timer nuc93x_timer = {
97 .init = nuc93x_timer_init,
98 .offset = nuc93x_gettimeoffset,
99 .resume = nuc93x_timer_setup
100};
diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c
index 029c6c9b3a6d..180ac112e527 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -30,6 +30,7 @@
30#include <plat/timer-gp.h> 30#include <plat/timer-gp.h>
31#include <plat/usb.h> 31#include <plat/usb.h>
32#include <asm/hardware/gic.h> 32#include <asm/hardware/gic.h>
33#include <asm/hardware/cache-l2x0.h>
33 34
34static struct platform_device sdp4430_lcd_device = { 35static struct platform_device sdp4430_lcd_device = {
35 .name = "sdp4430_lcd", 36 .name = "sdp4430_lcd",
@@ -48,6 +49,59 @@ static struct omap_board_config_kernel sdp4430_config[] __initdata = {
48 { OMAP_TAG_LCD, &sdp4430_lcd_config }, 49 { OMAP_TAG_LCD, &sdp4430_lcd_config },
49}; 50};
50 51
52#ifdef CONFIG_CACHE_L2X0
53noinline void omap_smc1(u32 fn, u32 arg)
54{
55 register u32 r12 asm("r12") = fn;
56 register u32 r0 asm("r0") = arg;
57
58 /* This is common routine cache secure monitor API used to
59 * modify the PL310 secure registers.
60 * r0 contains the value to be modified and "r12" contains
61 * the monitor API number. It uses few CPU registers
62 * internally and hence they need be backed up including
63 * link register "lr".
64 * Explicitly save r11 and r12 the compiler generated code
65 * won't save it.
66 */
67 asm volatile(
68 "stmfd r13!, {r11,r12}\n"
69 "dsb\n"
70 "smc\n"
71 "ldmfd r13!, {r11,r12}\n"
72 : "+r" (r0), "+r" (r12)
73 :
74 : "r4", "r5", "r10", "lr", "cc");
75}
76EXPORT_SYMBOL(omap_smc1);
77
78static int __init omap_l2_cache_init(void)
79{
80 void __iomem *l2cache_base;
81
82 /* To avoid code running on other OMAPs in
83 * multi-omap builds
84 */
85 if (!cpu_is_omap44xx())
86 return -ENODEV;
87
88 /* Static mapping, never released */
89 l2cache_base = ioremap(OMAP44XX_L2CACHE_BASE, SZ_4K);
90 BUG_ON(!l2cache_base);
91
92 /* Enable PL310 L2 Cache controller */
93 omap_smc1(0x102, 0x1);
94
95 /* 32KB way size, 16-way associativity,
96 * parity disabled
97 */
98 l2x0_init(l2cache_base, 0x0e050000, 0xc0000fff);
99
100 return 0;
101}
102early_initcall(omap_l2_cache_init);
103#endif
104
51static void __init gic_init_irq(void) 105static void __init gic_init_irq(void)
52{ 106{
53 void __iomem *base; 107 void __iomem *base;
diff --git a/arch/arm/mach-orion5x/include/mach/vmalloc.h b/arch/arm/mach-orion5x/include/mach/vmalloc.h
index 7147a297e97f..06b50aeff7b9 100644
--- a/arch/arm/mach-orion5x/include/mach/vmalloc.h
+++ b/arch/arm/mach-orion5x/include/mach/vmalloc.h
@@ -2,4 +2,4 @@
2 * arch/arm/mach-orion5x/include/mach/vmalloc.h 2 * arch/arm/mach-orion5x/include/mach/vmalloc.h
3 */ 3 */
4 4
5#define VMALLOC_END 0xfd800000 5#define VMALLOC_END 0xfd800000UL
diff --git a/arch/arm/mach-pnx4008/clock.c b/arch/arm/mach-pnx4008/clock.c
index 898c0e88acbc..9d1975fa4d9f 100644
--- a/arch/arm/mach-pnx4008/clock.c
+++ b/arch/arm/mach-pnx4008/clock.c
@@ -22,8 +22,9 @@
22#include <linux/delay.h> 22#include <linux/delay.h>
23#include <linux/io.h> 23#include <linux/io.h>
24 24
25#include <mach/hardware.h> 25#include <asm/clkdev.h>
26 26
27#include <mach/hardware.h>
27#include <mach/clock.h> 28#include <mach/clock.h>
28#include "clock.h" 29#include "clock.h"
29 30
@@ -56,18 +57,19 @@ static void propagate_rate(struct clk *clk)
56 } 57 }
57} 58}
58 59
59static inline void clk_reg_disable(struct clk *clk) 60static void clk_reg_disable(struct clk *clk)
60{ 61{
61 if (clk->enable_reg) 62 if (clk->enable_reg)
62 __raw_writel(__raw_readl(clk->enable_reg) & 63 __raw_writel(__raw_readl(clk->enable_reg) &
63 ~(1 << clk->enable_shift), clk->enable_reg); 64 ~(1 << clk->enable_shift), clk->enable_reg);
64} 65}
65 66
66static inline void clk_reg_enable(struct clk *clk) 67static int clk_reg_enable(struct clk *clk)
67{ 68{
68 if (clk->enable_reg) 69 if (clk->enable_reg)
69 __raw_writel(__raw_readl(clk->enable_reg) | 70 __raw_writel(__raw_readl(clk->enable_reg) |
70 (1 << clk->enable_shift), clk->enable_reg); 71 (1 << clk->enable_shift), clk->enable_reg);
72 return 0;
71} 73}
72 74
73static inline void clk_reg_disable1(struct clk *clk) 75static inline void clk_reg_disable1(struct clk *clk)
@@ -636,31 +638,34 @@ static struct clk flash_ck = {
636static struct clk i2c0_ck = { 638static struct clk i2c0_ck = {
637 .name = "i2c0_ck", 639 .name = "i2c0_ck",
638 .parent = &per_ck, 640 .parent = &per_ck,
639 .flags = NEEDS_INITIALIZATION, 641 .flags = NEEDS_INITIALIZATION | FIXED_RATE,
640 .round_rate = &on_off_round_rate,
641 .set_rate = &on_off_set_rate,
642 .enable_shift = 0, 642 .enable_shift = 0,
643 .enable_reg = I2CCLKCTRL_REG, 643 .enable_reg = I2CCLKCTRL_REG,
644 .rate = 13000000,
645 .enable = clk_reg_enable,
646 .disable = clk_reg_disable,
644}; 647};
645 648
646static struct clk i2c1_ck = { 649static struct clk i2c1_ck = {
647 .name = "i2c1_ck", 650 .name = "i2c1_ck",
648 .parent = &per_ck, 651 .parent = &per_ck,
649 .flags = NEEDS_INITIALIZATION, 652 .flags = NEEDS_INITIALIZATION | FIXED_RATE,
650 .round_rate = &on_off_round_rate,
651 .set_rate = &on_off_set_rate,
652 .enable_shift = 1, 653 .enable_shift = 1,
653 .enable_reg = I2CCLKCTRL_REG, 654 .enable_reg = I2CCLKCTRL_REG,
655 .rate = 13000000,
656 .enable = clk_reg_enable,
657 .disable = clk_reg_disable,
654}; 658};
655 659
656static struct clk i2c2_ck = { 660static struct clk i2c2_ck = {
657 .name = "i2c2_ck", 661 .name = "i2c2_ck",
658 .parent = &per_ck, 662 .parent = &per_ck,
659 .flags = NEEDS_INITIALIZATION, 663 .flags = NEEDS_INITIALIZATION | FIXED_RATE,
660 .round_rate = &on_off_round_rate,
661 .set_rate = &on_off_set_rate,
662 .enable_shift = 2, 664 .enable_shift = 2,
663 .enable_reg = USB_OTG_CLKCTRL_REG, 665 .enable_reg = USB_OTG_CLKCTRL_REG,
666 .rate = 13000000,
667 .enable = clk_reg_enable,
668 .disable = clk_reg_disable,
664}; 669};
665 670
666static struct clk spi0_ck = { 671static struct clk spi0_ck = {
@@ -738,16 +743,16 @@ static struct clk wdt_ck = {
738 .name = "wdt_ck", 743 .name = "wdt_ck",
739 .parent = &per_ck, 744 .parent = &per_ck,
740 .flags = NEEDS_INITIALIZATION, 745 .flags = NEEDS_INITIALIZATION,
741 .round_rate = &on_off_round_rate,
742 .set_rate = &on_off_set_rate,
743 .enable_shift = 0, 746 .enable_shift = 0,
744 .enable_reg = TIMCLKCTRL_REG, 747 .enable_reg = TIMCLKCTRL_REG,
748 .enable = clk_reg_enable,
749 .disable = clk_reg_disable,
745}; 750};
746 751
747/* These clocks are visible outside this module 752/* These clocks are visible outside this module
748 * and can be initialized 753 * and can be initialized
749 */ 754 */
750static struct clk *onchip_clks[] = { 755static struct clk *onchip_clks[] __initdata = {
751 &ck_13MHz, 756 &ck_13MHz,
752 &ck_pll1, 757 &ck_pll1,
753 &ck_pll4, 758 &ck_pll4,
@@ -777,49 +782,74 @@ static struct clk *onchip_clks[] = {
777 &wdt_ck, 782 &wdt_ck,
778}; 783};
779 784
780static int local_clk_enable(struct clk *clk) 785static struct clk_lookup onchip_clkreg[] = {
781{ 786 { .clk = &ck_13MHz, .con_id = "ck_13MHz" },
782 int ret = 0; 787 { .clk = &ck_pll1, .con_id = "ck_pll1" },
783 788 { .clk = &ck_pll4, .con_id = "ck_pll4" },
784 if (!(clk->flags & FIXED_RATE) && !clk->rate && clk->set_rate 789 { .clk = &ck_pll5, .con_id = "ck_pll5" },
785 && clk->user_rate) 790 { .clk = &ck_pll3, .con_id = "ck_pll3" },
786 ret = clk->set_rate(clk, clk->user_rate); 791 { .clk = &vfp9_ck, .con_id = "vfp9_ck" },
787 return ret; 792 { .clk = &m2hclk_ck, .con_id = "m2hclk_ck" },
788} 793 { .clk = &hclk_ck, .con_id = "hclk_ck" },
794 { .clk = &dma_ck, .con_id = "dma_ck" },
795 { .clk = &flash_ck, .con_id = "flash_ck" },
796 { .clk = &dum_ck, .con_id = "dum_ck" },
797 { .clk = &keyscan_ck, .con_id = "keyscan_ck" },
798 { .clk = &pwm1_ck, .con_id = "pwm1_ck" },
799 { .clk = &pwm2_ck, .con_id = "pwm2_ck" },
800 { .clk = &jpeg_ck, .con_id = "jpeg_ck" },
801 { .clk = &ms_ck, .con_id = "ms_ck" },
802 { .clk = &touch_ck, .con_id = "touch_ck" },
803 { .clk = &i2c0_ck, .dev_id = "pnx-i2c.0" },
804 { .clk = &i2c1_ck, .dev_id = "pnx-i2c.1" },
805 { .clk = &i2c2_ck, .dev_id = "pnx-i2c.2" },
806 { .clk = &spi0_ck, .con_id = "spi0_ck" },
807 { .clk = &spi1_ck, .con_id = "spi1_ck" },
808 { .clk = &uart3_ck, .con_id = "uart3_ck" },
809 { .clk = &uart4_ck, .con_id = "uart4_ck" },
810 { .clk = &uart5_ck, .con_id = "uart5_ck" },
811 { .clk = &uart6_ck, .con_id = "uart6_ck" },
812 { .clk = &wdt_ck, .dev_id = "pnx4008-watchdog" },
813};
789 814
790static void local_clk_disable(struct clk *clk) 815static void local_clk_disable(struct clk *clk)
791{ 816{
792 if (!(clk->flags & FIXED_RATE) && clk->rate && clk->set_rate) 817 if (WARN_ON(clk->usecount == 0))
793 clk->set_rate(clk, 0); 818 return;
794}
795 819
796static void local_clk_unuse(struct clk *clk) 820 if (!(--clk->usecount)) {
797{ 821 if (clk->disable)
798 if (clk->usecount > 0 && !(--clk->usecount)) { 822 clk->disable(clk);
799 local_clk_disable(clk); 823 else if (!(clk->flags & FIXED_RATE) && clk->rate && clk->set_rate)
824 clk->set_rate(clk, 0);
800 if (clk->parent) 825 if (clk->parent)
801 local_clk_unuse(clk->parent); 826 local_clk_disable(clk->parent);
802 } 827 }
803} 828}
804 829
805static int local_clk_use(struct clk *clk) 830static int local_clk_enable(struct clk *clk)
806{ 831{
807 int ret = 0; 832 int ret = 0;
808 if (clk->usecount++ == 0) {
809 if (clk->parent)
810 ret = local_clk_use(clk->parent);
811 833
812 if (ret != 0) { 834 if (clk->usecount == 0) {
813 clk->usecount--; 835 if (clk->parent) {
814 goto out; 836 ret = local_clk_enable(clk->parent);
837 if (ret != 0)
838 goto out;
815 } 839 }
816 840
817 ret = local_clk_enable(clk); 841 if (clk->enable)
842 ret = clk->enable(clk);
843 else if (!(clk->flags & FIXED_RATE) && !clk->rate && clk->set_rate
844 && clk->user_rate)
845 ret = clk->set_rate(clk, clk->user_rate);
818 846
819 if (ret != 0 && clk->parent) { 847 if (ret != 0 && clk->parent) {
820 local_clk_unuse(clk->parent); 848 local_clk_disable(clk->parent);
821 clk->usecount--; 849 goto out;
822 } 850 }
851
852 clk->usecount++;
823 } 853 }
824out: 854out:
825 return ret; 855 return ret;
@@ -866,35 +896,6 @@ out:
866 896
867EXPORT_SYMBOL(clk_set_rate); 897EXPORT_SYMBOL(clk_set_rate);
868 898
869struct clk *clk_get(struct device *dev, const char *id)
870{
871 struct clk *clk = ERR_PTR(-ENOENT);
872 struct clk **clkp;
873
874 clock_lock();
875 for (clkp = onchip_clks; clkp < onchip_clks + ARRAY_SIZE(onchip_clks);
876 clkp++) {
877 if (strcmp(id, (*clkp)->name) == 0
878 && try_module_get((*clkp)->owner)) {
879 clk = (*clkp);
880 break;
881 }
882 }
883 clock_unlock();
884
885 return clk;
886}
887EXPORT_SYMBOL(clk_get);
888
889void clk_put(struct clk *clk)
890{
891 clock_lock();
892 if (clk && !IS_ERR(clk))
893 module_put(clk->owner);
894 clock_unlock();
895}
896EXPORT_SYMBOL(clk_put);
897
898unsigned long clk_get_rate(struct clk *clk) 899unsigned long clk_get_rate(struct clk *clk)
899{ 900{
900 unsigned long ret; 901 unsigned long ret;
@@ -907,10 +908,10 @@ EXPORT_SYMBOL(clk_get_rate);
907 908
908int clk_enable(struct clk *clk) 909int clk_enable(struct clk *clk)
909{ 910{
910 int ret = 0; 911 int ret;
911 912
912 clock_lock(); 913 clock_lock();
913 ret = local_clk_use(clk); 914 ret = local_clk_enable(clk);
914 clock_unlock(); 915 clock_unlock();
915 return ret; 916 return ret;
916} 917}
@@ -920,7 +921,7 @@ EXPORT_SYMBOL(clk_enable);
920void clk_disable(struct clk *clk) 921void clk_disable(struct clk *clk)
921{ 922{
922 clock_lock(); 923 clock_lock();
923 local_clk_unuse(clk); 924 local_clk_disable(clk);
924 clock_unlock(); 925 clock_unlock();
925} 926}
926 927
@@ -967,18 +968,24 @@ static int __init clk_init(void)
967 968
968 for (clkp = onchip_clks; clkp < onchip_clks + ARRAY_SIZE(onchip_clks); 969 for (clkp = onchip_clks; clkp < onchip_clks + ARRAY_SIZE(onchip_clks);
969 clkp++) { 970 clkp++) {
970 if (((*clkp)->flags & NEEDS_INITIALIZATION) 971 struct clk *clk = *clkp;
971 && ((*clkp)->set_rate)) { 972 if (clk->flags & NEEDS_INITIALIZATION) {
972 (*clkp)->user_rate = (*clkp)->rate; 973 if (clk->set_rate) {
973 local_set_rate((*clkp), (*clkp)->user_rate); 974 clk->user_rate = clk->rate;
974 if ((*clkp)->set_parent) 975 local_set_rate(clk, clk->user_rate);
975 (*clkp)->set_parent((*clkp), (*clkp)->parent); 976 if (clk->set_parent)
977 clk->set_parent(clk, clk->parent);
978 }
979 if (clk->enable && clk->usecount)
980 clk->enable(clk);
981 if (clk->disable && !clk->usecount)
982 clk->disable(clk);
976 } 983 }
977 pr_debug("%s: clock %s, rate %ld\n", 984 pr_debug("%s: clock %s, rate %ld\n",
978 __func__, (*clkp)->name, (*clkp)->rate); 985 __func__, clk->name, clk->rate);
979 } 986 }
980 987
981 local_clk_use(&ck_pll4); 988 local_clk_enable(&ck_pll4);
982 989
983 /* if ck_13MHz is not used, disable it. */ 990 /* if ck_13MHz is not used, disable it. */
984 if (ck_13MHz.usecount == 0) 991 if (ck_13MHz.usecount == 0)
@@ -987,6 +994,8 @@ static int __init clk_init(void)
987 /* Disable autoclocking */ 994 /* Disable autoclocking */
988 __raw_writeb(0xff, AUTOCLK_CTRL); 995 __raw_writeb(0xff, AUTOCLK_CTRL);
989 996
997 clkdev_add_table(onchip_clkreg, ARRAY_SIZE(onchip_clkreg));
998
990 return 0; 999 return 0;
991} 1000}
992 1001
diff --git a/arch/arm/mach-pnx4008/clock.h b/arch/arm/mach-pnx4008/clock.h
index cd58f372cfd0..39720d6c0d01 100644
--- a/arch/arm/mach-pnx4008/clock.h
+++ b/arch/arm/mach-pnx4008/clock.h
@@ -14,8 +14,6 @@
14#define __ARCH_ARM_PNX4008_CLOCK_H__ 14#define __ARCH_ARM_PNX4008_CLOCK_H__
15 15
16struct clk { 16struct clk {
17 struct list_head node;
18 struct module *owner;
19 const char *name; 17 const char *name;
20 struct clk *parent; 18 struct clk *parent;
21 struct clk *propagate_next; 19 struct clk *propagate_next;
@@ -29,9 +27,11 @@ struct clk {
29 u8 enable_shift1; 27 u8 enable_shift1;
30 u32 enable_reg1; 28 u32 enable_reg1;
31 u32 parent_switch_reg; 29 u32 parent_switch_reg;
32 u32(*round_rate) (struct clk *, u32); 30 u32(*round_rate) (struct clk *, u32);
33 int (*set_rate) (struct clk *, u32); 31 int (*set_rate) (struct clk *, u32);
34 int (*set_parent) (struct clk * clk, struct clk * parent); 32 int (*set_parent) (struct clk * clk, struct clk * parent);
33 int (*enable)(struct clk *);
34 void (*disable)(struct clk *);
35}; 35};
36 36
37/* Flags */ 37/* Flags */
diff --git a/arch/arm/mach-pnx4008/i2c.c b/arch/arm/mach-pnx4008/i2c.c
index f3fea29c00d3..8103f9644e2d 100644
--- a/arch/arm/mach-pnx4008/i2c.c
+++ b/arch/arm/mach-pnx4008/i2c.c
@@ -18,120 +18,24 @@
18#include <mach/irqs.h> 18#include <mach/irqs.h>
19#include <mach/i2c.h> 19#include <mach/i2c.h>
20 20
21static int set_clock_run(struct platform_device *pdev) 21static struct i2c_pnx_data i2c0_data = {
22{ 22 .name = I2C_CHIP_NAME "0",
23 struct clk *clk;
24 char name[10];
25 int retval = 0;
26
27 snprintf(name, 10, "i2c%d_ck", pdev->id);
28 clk = clk_get(&pdev->dev, name);
29 if (!IS_ERR(clk)) {
30 clk_set_rate(clk, 1);
31 clk_put(clk);
32 } else
33 retval = -ENOENT;
34
35 return retval;
36}
37
38static int set_clock_stop(struct platform_device *pdev)
39{
40 struct clk *clk;
41 char name[10];
42 int retval = 0;
43
44 snprintf(name, 10, "i2c%d_ck", pdev->id);
45 clk = clk_get(&pdev->dev, name);
46 if (!IS_ERR(clk)) {
47 clk_set_rate(clk, 0);
48 clk_put(clk);
49 } else
50 retval = -ENOENT;
51
52 return retval;
53}
54
55static int i2c_pnx_suspend(struct platform_device *pdev, pm_message_t state)
56{
57 int retval = 0;
58#ifdef CONFIG_PM
59 retval = set_clock_run(pdev);
60#endif
61 return retval;
62}
63
64static int i2c_pnx_resume(struct platform_device *pdev)
65{
66 int retval = 0;
67#ifdef CONFIG_PM
68 retval = set_clock_run(pdev);
69#endif
70 return retval;
71}
72
73static u32 calculate_input_freq(struct platform_device *pdev)
74{
75 return HCLK_MHZ;
76}
77
78
79static struct i2c_pnx_algo_data pnx_algo_data0 = {
80 .base = PNX4008_I2C1_BASE, 23 .base = PNX4008_I2C1_BASE,
81 .irq = I2C_1_INT, 24 .irq = I2C_1_INT,
82}; 25};
83 26
84static struct i2c_pnx_algo_data pnx_algo_data1 = { 27static struct i2c_pnx_data i2c1_data = {
28 .name = I2C_CHIP_NAME "1",
85 .base = PNX4008_I2C2_BASE, 29 .base = PNX4008_I2C2_BASE,
86 .irq = I2C_2_INT, 30 .irq = I2C_2_INT,
87}; 31};
88 32
89static struct i2c_pnx_algo_data pnx_algo_data2 = { 33static struct i2c_pnx_data i2c2_data = {
34 .name = "USB-I2C",
90 .base = (PNX4008_USB_CONFIG_BASE + 0x300), 35 .base = (PNX4008_USB_CONFIG_BASE + 0x300),
91 .irq = USB_I2C_INT, 36 .irq = USB_I2C_INT,
92}; 37};
93 38
94static struct i2c_adapter pnx_adapter0 = {
95 .name = I2C_CHIP_NAME "0",
96 .algo_data = &pnx_algo_data0,
97};
98static struct i2c_adapter pnx_adapter1 = {
99 .name = I2C_CHIP_NAME "1",
100 .algo_data = &pnx_algo_data1,
101};
102
103static struct i2c_adapter pnx_adapter2 = {
104 .name = "USB-I2C",
105 .algo_data = &pnx_algo_data2,
106};
107
108static struct i2c_pnx_data i2c0_data = {
109 .suspend = i2c_pnx_suspend,
110 .resume = i2c_pnx_resume,
111 .calculate_input_freq = calculate_input_freq,
112 .set_clock_run = set_clock_run,
113 .set_clock_stop = set_clock_stop,
114 .adapter = &pnx_adapter0,
115};
116
117static struct i2c_pnx_data i2c1_data = {
118 .suspend = i2c_pnx_suspend,
119 .resume = i2c_pnx_resume,
120 .calculate_input_freq = calculate_input_freq,
121 .set_clock_run = set_clock_run,
122 .set_clock_stop = set_clock_stop,
123 .adapter = &pnx_adapter1,
124};
125
126static struct i2c_pnx_data i2c2_data = {
127 .suspend = i2c_pnx_suspend,
128 .resume = i2c_pnx_resume,
129 .calculate_input_freq = calculate_input_freq,
130 .set_clock_run = set_clock_run,
131 .set_clock_stop = set_clock_stop,
132 .adapter = &pnx_adapter2,
133};
134
135static struct platform_device i2c0_device = { 39static struct platform_device i2c0_device = {
136 .name = "pnx-i2c", 40 .name = "pnx-i2c",
137 .id = 0, 41 .id = 0,
diff --git a/arch/arm/mach-pnx4008/include/mach/clkdev.h b/arch/arm/mach-pnx4008/include/mach/clkdev.h
new file mode 100644
index 000000000000..04b37a89801c
--- /dev/null
+++ b/arch/arm/mach-pnx4008/include/mach/clkdev.h
@@ -0,0 +1,7 @@
1#ifndef __ASM_MACH_CLKDEV_H
2#define __ASM_MACH_CLKDEV_H
3
4#define __clk_get(clk) ({ 1; })
5#define __clk_put(clk) do { } while (0)
6
7#endif
diff --git a/arch/arm/mach-pnx4008/include/mach/timex.h b/arch/arm/mach-pnx4008/include/mach/timex.h
index 5ff0196c0f16..b383c7de7ab4 100644
--- a/arch/arm/mach-pnx4008/include/mach/timex.h
+++ b/arch/arm/mach-pnx4008/include/mach/timex.h
@@ -14,60 +14,6 @@
14#ifndef __PNX4008_TIMEX_H 14#ifndef __PNX4008_TIMEX_H
15#define __PNX4008_TIMEX_H 15#define __PNX4008_TIMEX_H
16 16
17#include <linux/io.h>
18#include <mach/hardware.h>
19
20#define CLOCK_TICK_RATE 1000000 17#define CLOCK_TICK_RATE 1000000
21 18
22#define TICKS2USECS(x) (x)
23
24/* MilliSecond Timer - Chapter 21 Page 202 */
25
26#define MSTIM_INT IO_ADDRESS((PNX4008_MSTIMER_BASE + 0x0))
27#define MSTIM_CTRL IO_ADDRESS((PNX4008_MSTIMER_BASE + 0x4))
28#define MSTIM_COUNTER IO_ADDRESS((PNX4008_MSTIMER_BASE + 0x8))
29#define MSTIM_MCTRL IO_ADDRESS((PNX4008_MSTIMER_BASE + 0x14))
30#define MSTIM_MATCH0 IO_ADDRESS((PNX4008_MSTIMER_BASE + 0x18))
31#define MSTIM_MATCH1 IO_ADDRESS((PNX4008_MSTIMER_BASE + 0x1c))
32
33/* High Speed Timer - Chpater 22, Page 205 */
34
35#define HSTIM_INT IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x0))
36#define HSTIM_CTRL IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x4))
37#define HSTIM_COUNTER IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x8))
38#define HSTIM_PMATCH IO_ADDRESS((PNX4008_HSTIMER_BASE + 0xC))
39#define HSTIM_PCOUNT IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x10))
40#define HSTIM_MCTRL IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x14))
41#define HSTIM_MATCH0 IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x18))
42#define HSTIM_MATCH1 IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x1c))
43#define HSTIM_MATCH2 IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x20))
44#define HSTIM_CCR IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x28))
45#define HSTIM_CR0 IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x2C))
46#define HSTIM_CR1 IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x30))
47
48/* IMPORTANT: both timers are UPCOUNTING */
49
50/* xSTIM_MCTRL bit definitions */
51#define MR0_INT 1
52#define RESET_COUNT0 (1<<1)
53#define STOP_COUNT0 (1<<2)
54#define MR1_INT (1<<3)
55#define RESET_COUNT1 (1<<4)
56#define STOP_COUNT1 (1<<5)
57#define MR2_INT (1<<6)
58#define RESET_COUNT2 (1<<7)
59#define STOP_COUNT2 (1<<8)
60
61/* xSTIM_CTRL bit definitions */
62#define COUNT_ENAB 1
63#define RESET_COUNT (1<<1)
64#define DEBUG_EN (1<<2)
65
66/* xSTIM_INT bit definitions */
67#define MATCH0_INT 1
68#define MATCH1_INT (1<<1)
69#define MATCH2_INT (1<<2)
70#define RTC_TICK0 (1<<4)
71#define RTC_TICK1 (1<<5)
72
73#endif 19#endif
diff --git a/arch/arm/mach-pnx4008/pm.c b/arch/arm/mach-pnx4008/pm.c
index b3d8d53e32ef..1f0585329be4 100644
--- a/arch/arm/mach-pnx4008/pm.c
+++ b/arch/arm/mach-pnx4008/pm.c
@@ -21,6 +21,8 @@
21#include <linux/io.h> 21#include <linux/io.h>
22 22
23#include <asm/cacheflush.h> 23#include <asm/cacheflush.h>
24
25#include <mach/hardware.h>
24#include <mach/pm.h> 26#include <mach/pm.h>
25#include <mach/clock.h> 27#include <mach/clock.h>
26 28
diff --git a/arch/arm/mach-pnx4008/time.c b/arch/arm/mach-pnx4008/time.c
index fc0ba183fe12..0c8aad4bb0dc 100644
--- a/arch/arm/mach-pnx4008/time.c
+++ b/arch/arm/mach-pnx4008/time.c
@@ -30,6 +30,8 @@
30#include <asm/mach/time.h> 30#include <asm/mach/time.h>
31#include <asm/errno.h> 31#include <asm/errno.h>
32 32
33#include "time.h"
34
33/*! Note: all timers are UPCOUNTING */ 35/*! Note: all timers are UPCOUNTING */
34 36
35/*! 37/*!
diff --git a/arch/arm/mach-pnx4008/time.h b/arch/arm/mach-pnx4008/time.h
new file mode 100644
index 000000000000..75e88c570aa7
--- /dev/null
+++ b/arch/arm/mach-pnx4008/time.h
@@ -0,0 +1,70 @@
1/*
2 * arch/arm/mach-pnx4008/include/mach/timex.h
3 *
4 * PNX4008 timers header file
5 *
6 * Author: Dmitry Chigirev <source@mvista.com>
7 *
8 * 2005 (c) MontaVista Software, Inc. This file is licensed under
9 * the terms of the GNU General Public License version 2. This program
10 * is licensed "as is" without any warranty of any kind, whether express
11 * or implied.
12 */
13#ifndef PNX_TIME_H
14#define PNX_TIME_H
15
16#include <linux/io.h>
17#include <mach/hardware.h>
18
19#define TICKS2USECS(x) (x)
20
21/* MilliSecond Timer - Chapter 21 Page 202 */
22
23#define MSTIM_INT IO_ADDRESS((PNX4008_MSTIMER_BASE + 0x0))
24#define MSTIM_CTRL IO_ADDRESS((PNX4008_MSTIMER_BASE + 0x4))
25#define MSTIM_COUNTER IO_ADDRESS((PNX4008_MSTIMER_BASE + 0x8))
26#define MSTIM_MCTRL IO_ADDRESS((PNX4008_MSTIMER_BASE + 0x14))
27#define MSTIM_MATCH0 IO_ADDRESS((PNX4008_MSTIMER_BASE + 0x18))
28#define MSTIM_MATCH1 IO_ADDRESS((PNX4008_MSTIMER_BASE + 0x1c))
29
30/* High Speed Timer - Chpater 22, Page 205 */
31
32#define HSTIM_INT IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x0))
33#define HSTIM_CTRL IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x4))
34#define HSTIM_COUNTER IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x8))
35#define HSTIM_PMATCH IO_ADDRESS((PNX4008_HSTIMER_BASE + 0xC))
36#define HSTIM_PCOUNT IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x10))
37#define HSTIM_MCTRL IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x14))
38#define HSTIM_MATCH0 IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x18))
39#define HSTIM_MATCH1 IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x1c))
40#define HSTIM_MATCH2 IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x20))
41#define HSTIM_CCR IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x28))
42#define HSTIM_CR0 IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x2C))
43#define HSTIM_CR1 IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x30))
44
45/* IMPORTANT: both timers are UPCOUNTING */
46
47/* xSTIM_MCTRL bit definitions */
48#define MR0_INT 1
49#define RESET_COUNT0 (1<<1)
50#define STOP_COUNT0 (1<<2)
51#define MR1_INT (1<<3)
52#define RESET_COUNT1 (1<<4)
53#define STOP_COUNT1 (1<<5)
54#define MR2_INT (1<<6)
55#define RESET_COUNT2 (1<<7)
56#define STOP_COUNT2 (1<<8)
57
58/* xSTIM_CTRL bit definitions */
59#define COUNT_ENAB 1
60#define RESET_COUNT (1<<1)
61#define DEBUG_EN (1<<2)
62
63/* xSTIM_INT bit definitions */
64#define MATCH0_INT 1
65#define MATCH1_INT (1<<1)
66#define MATCH2_INT (1<<2)
67#define RTC_TICK0 (1<<4)
68#define RTC_TICK1 (1<<5)
69
70#endif
diff --git a/arch/arm/mach-pxa/clock.c b/arch/arm/mach-pxa/clock.c
index 49ae38292310..abba0089a2ae 100644
--- a/arch/arm/mach-pxa/clock.c
+++ b/arch/arm/mach-pxa/clock.c
@@ -78,11 +78,3 @@ const struct clkops clk_cken_ops = {
78 .enable = clk_cken_enable, 78 .enable = clk_cken_enable,
79 .disable = clk_cken_disable, 79 .disable = clk_cken_disable,
80}; 80};
81
82void clks_register(struct clk_lookup *clks, size_t num)
83{
84 int i;
85
86 for (i = 0; i < num; i++)
87 clkdev_add(&clks[i]);
88}
diff --git a/arch/arm/mach-pxa/clock.h b/arch/arm/mach-pxa/clock.h
index 978a3667e90d..d8488742b807 100644
--- a/arch/arm/mach-pxa/clock.h
+++ b/arch/arm/mach-pxa/clock.h
@@ -67,7 +67,3 @@ extern void clk_pxa3xx_cken_enable(struct clk *);
67extern void clk_pxa3xx_cken_disable(struct clk *); 67extern void clk_pxa3xx_cken_disable(struct clk *);
68#endif 68#endif
69 69
70void clks_register(struct clk_lookup *clks, size_t num);
71int clk_add_alias(const char *alias, const char *alias_name, char *id,
72 struct device *dev);
73
diff --git a/arch/arm/mach-pxa/eseries.c b/arch/arm/mach-pxa/eseries.c
index 91417f035069..96ed13081639 100644
--- a/arch/arm/mach-pxa/eseries.c
+++ b/arch/arm/mach-pxa/eseries.c
@@ -128,6 +128,6 @@ static struct clk_lookup eseries_clkregs[] = {
128 128
129void eseries_register_clks(void) 129void eseries_register_clks(void)
130{ 130{
131 clks_register(eseries_clkregs, ARRAY_SIZE(eseries_clkregs)); 131 clkdev_add_table(eseries_clkregs, ARRAY_SIZE(eseries_clkregs));
132} 132}
133 133
diff --git a/arch/arm/mach-pxa/include/mach/camera.h b/arch/arm/mach-pxa/include/mach/camera.h
index 31abe6d514b8..6709b1cd7c77 100644
--- a/arch/arm/mach-pxa/include/mach/camera.h
+++ b/arch/arm/mach-pxa/include/mach/camera.h
@@ -35,8 +35,6 @@
35#define PXA_CAMERA_VSP 0x400 35#define PXA_CAMERA_VSP 0x400
36 36
37struct pxacamera_platform_data { 37struct pxacamera_platform_data {
38 int (*init)(struct device *);
39
40 unsigned long flags; 38 unsigned long flags;
41 unsigned long mclk_10khz; 39 unsigned long mclk_10khz;
42}; 40};
diff --git a/arch/arm/mach-pxa/include/mach/vmalloc.h b/arch/arm/mach-pxa/include/mach/vmalloc.h
index e90c5eeb81dd..bfecfbf5f460 100644
--- a/arch/arm/mach-pxa/include/mach/vmalloc.h
+++ b/arch/arm/mach-pxa/include/mach/vmalloc.h
@@ -8,4 +8,4 @@
8 * it under the terms of the GNU General Public License version 2 as 8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation. 9 * published by the Free Software Foundation.
10 */ 10 */
11#define VMALLOC_END (0xe8000000) 11#define VMALLOC_END (0xe8000000UL)
diff --git a/arch/arm/mach-pxa/pxa25x.c b/arch/arm/mach-pxa/pxa25x.c
index 2c1b0b70d01d..0b9ad30bfd51 100644
--- a/arch/arm/mach-pxa/pxa25x.c
+++ b/arch/arm/mach-pxa/pxa25x.c
@@ -349,7 +349,7 @@ static int __init pxa25x_init(void)
349 349
350 reset_status = RCSR; 350 reset_status = RCSR;
351 351
352 clks_register(pxa25x_clkregs, ARRAY_SIZE(pxa25x_clkregs)); 352 clkdev_add_table(pxa25x_clkregs, ARRAY_SIZE(pxa25x_clkregs));
353 353
354 if ((ret = pxa_init_dma(IRQ_DMA, 16))) 354 if ((ret = pxa_init_dma(IRQ_DMA, 16)))
355 return ret; 355 return ret;
@@ -370,7 +370,7 @@ static int __init pxa25x_init(void)
370 370
371 /* Only add HWUART for PXA255/26x; PXA210/250 do not have it. */ 371 /* Only add HWUART for PXA255/26x; PXA210/250 do not have it. */
372 if (cpu_is_pxa255()) 372 if (cpu_is_pxa255())
373 clks_register(&pxa25x_hwuart_clkreg, 1); 373 clkdev_add(&pxa25x_hwuart_clkreg);
374 374
375 return ret; 375 return ret;
376} 376}
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c
index 6a0b73167e03..d783123e2d48 100644
--- a/arch/arm/mach-pxa/pxa27x.c
+++ b/arch/arm/mach-pxa/pxa27x.c
@@ -392,7 +392,7 @@ static int __init pxa27x_init(void)
392 392
393 reset_status = RCSR; 393 reset_status = RCSR;
394 394
395 clks_register(pxa27x_clkregs, ARRAY_SIZE(pxa27x_clkregs)); 395 clkdev_add_table(pxa27x_clkregs, ARRAY_SIZE(pxa27x_clkregs));
396 396
397 if ((ret = pxa_init_dma(IRQ_DMA, 32))) 397 if ((ret = pxa_init_dma(IRQ_DMA, 32)))
398 return ret; 398 return ret;
diff --git a/arch/arm/mach-pxa/pxa300.c b/arch/arm/mach-pxa/pxa300.c
index f4af6e2bef89..40bb16501d86 100644
--- a/arch/arm/mach-pxa/pxa300.c
+++ b/arch/arm/mach-pxa/pxa300.c
@@ -102,12 +102,12 @@ static int __init pxa300_init(void)
102 if (cpu_is_pxa300() || cpu_is_pxa310()) { 102 if (cpu_is_pxa300() || cpu_is_pxa310()) {
103 mfp_init_base(io_p2v(MFPR_BASE)); 103 mfp_init_base(io_p2v(MFPR_BASE));
104 mfp_init_addr(pxa300_mfp_addr_map); 104 mfp_init_addr(pxa300_mfp_addr_map);
105 clks_register(ARRAY_AND_SIZE(common_clkregs)); 105 clkdev_add_table(ARRAY_AND_SIZE(common_clkregs));
106 } 106 }
107 107
108 if (cpu_is_pxa310()) { 108 if (cpu_is_pxa310()) {
109 mfp_init_addr(pxa310_mfp_addr_map); 109 mfp_init_addr(pxa310_mfp_addr_map);
110 clks_register(ARRAY_AND_SIZE(pxa310_clkregs)); 110 clkdev_add_table(ARRAY_AND_SIZE(pxa310_clkregs));
111 } 111 }
112 112
113 return 0; 113 return 0;
diff --git a/arch/arm/mach-pxa/pxa320.c b/arch/arm/mach-pxa/pxa320.c
index c7373e74a109..8d614ecd8e99 100644
--- a/arch/arm/mach-pxa/pxa320.c
+++ b/arch/arm/mach-pxa/pxa320.c
@@ -90,7 +90,7 @@ static int __init pxa320_init(void)
90 if (cpu_is_pxa320()) { 90 if (cpu_is_pxa320()) {
91 mfp_init_base(io_p2v(MFPR_BASE)); 91 mfp_init_base(io_p2v(MFPR_BASE));
92 mfp_init_addr(pxa320_mfp_addr_map); 92 mfp_init_addr(pxa320_mfp_addr_map);
93 clks_register(ARRAY_AND_SIZE(pxa320_clkregs)); 93 clkdev_add_table(ARRAY_AND_SIZE(pxa320_clkregs));
94 } 94 }
95 95
96 return 0; 96 return 0;
diff --git a/arch/arm/mach-pxa/pxa3xx.c b/arch/arm/mach-pxa/pxa3xx.c
index fcb0721f4669..4d7c03e72504 100644
--- a/arch/arm/mach-pxa/pxa3xx.c
+++ b/arch/arm/mach-pxa/pxa3xx.c
@@ -634,7 +634,7 @@ static int __init pxa3xx_init(void)
634 */ 634 */
635 ASCR &= ~(ASCR_RDH | ASCR_D1S | ASCR_D2S | ASCR_D3S); 635 ASCR &= ~(ASCR_RDH | ASCR_D1S | ASCR_D2S | ASCR_D3S);
636 636
637 clks_register(pxa3xx_clkregs, ARRAY_SIZE(pxa3xx_clkregs)); 637 clkdev_add_table(pxa3xx_clkregs, ARRAY_SIZE(pxa3xx_clkregs));
638 638
639 if ((ret = pxa_init_dma(IRQ_DMA, 32))) 639 if ((ret = pxa_init_dma(IRQ_DMA, 32)))
640 return ret; 640 return ret;
diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c
index 9f293438e020..90bd4ef71b2c 100644
--- a/arch/arm/mach-realview/core.c
+++ b/arch/arm/mach-realview/core.c
@@ -346,10 +346,7 @@ static struct clk_lookup lookups[] = {
346 346
347static int __init clk_init(void) 347static int __init clk_init(void)
348{ 348{
349 int i; 349 clkdev_add_table(lookups, ARRAY_SIZE(lookups));
350
351 for (i = 0; i < ARRAY_SIZE(lookups); i++)
352 clkdev_add(&lookups[i]);
353 return 0; 350 return 0;
354} 351}
355arch_initcall(clk_init); 352arch_initcall(clk_init);
diff --git a/arch/arm/mach-realview/include/mach/vmalloc.h b/arch/arm/mach-realview/include/mach/vmalloc.h
index fe0de1b507ac..a2a4c6861407 100644
--- a/arch/arm/mach-realview/include/mach/vmalloc.h
+++ b/arch/arm/mach-realview/include/mach/vmalloc.h
@@ -18,4 +18,4 @@
18 * along with this program; if not, write to the Free Software 18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */ 20 */
21#define VMALLOC_END 0xf8000000 21#define VMALLOC_END 0xf8000000UL
diff --git a/arch/arm/mach-s3c24a0/include/mach/vmalloc.h b/arch/arm/mach-s3c24a0/include/mach/vmalloc.h
index 4d4fe4849589..914656820794 100644
--- a/arch/arm/mach-s3c24a0/include/mach/vmalloc.h
+++ b/arch/arm/mach-s3c24a0/include/mach/vmalloc.h
@@ -12,6 +12,6 @@
12#ifndef __ASM_ARCH_VMALLOC_H 12#ifndef __ASM_ARCH_VMALLOC_H
13#define __ASM_ARCH_VMALLOC_H 13#define __ASM_ARCH_VMALLOC_H
14 14
15#define VMALLOC_END (0xE0000000) 15#define VMALLOC_END (0xe0000000UL)
16 16
17#endif /* __ASM_ARCH_VMALLOC_H */ 17#endif /* __ASM_ARCH_VMALLOC_H */
diff --git a/arch/arm/mach-sa1100/include/mach/vmalloc.h b/arch/arm/mach-sa1100/include/mach/vmalloc.h
index ec8fdc5a3606..b3d002398480 100644
--- a/arch/arm/mach-sa1100/include/mach/vmalloc.h
+++ b/arch/arm/mach-sa1100/include/mach/vmalloc.h
@@ -1,4 +1,4 @@
1/* 1/*
2 * arch/arm/mach-sa1100/include/mach/vmalloc.h 2 * arch/arm/mach-sa1100/include/mach/vmalloc.h
3 */ 3 */
4#define VMALLOC_END (0xe8000000) 4#define VMALLOC_END (0xe8000000UL)
diff --git a/arch/arm/mach-u300/clock.c b/arch/arm/mach-u300/clock.c
index 111f7ea32b38..5af71d5ba665 100644
--- a/arch/arm/mach-u300/clock.c
+++ b/arch/arm/mach-u300/clock.c
@@ -610,34 +610,34 @@ EXPORT_SYMBOL(clk_get_rate);
610 610
611static unsigned long clk_round_rate_mclk(struct clk *clk, unsigned long rate) 611static unsigned long clk_round_rate_mclk(struct clk *clk, unsigned long rate)
612{ 612{
613 if (rate >= 18900000) 613 if (rate <= 18900000)
614 return 18900000; 614 return 18900000;
615 if (rate >= 20800000) 615 if (rate <= 20800000)
616 return 20800000; 616 return 20800000;
617 if (rate >= 23100000) 617 if (rate <= 23100000)
618 return 23100000; 618 return 23100000;
619 if (rate >= 26000000) 619 if (rate <= 26000000)
620 return 26000000; 620 return 26000000;
621 if (rate >= 29700000) 621 if (rate <= 29700000)
622 return 29700000; 622 return 29700000;
623 if (rate >= 34700000) 623 if (rate <= 34700000)
624 return 34700000; 624 return 34700000;
625 if (rate >= 41600000) 625 if (rate <= 41600000)
626 return 41600000; 626 return 41600000;
627 if (rate >= 52000000) 627 if (rate <= 52000000)
628 return 52000000; 628 return 52000000;
629 return -EINVAL; 629 return -EINVAL;
630} 630}
631 631
632static unsigned long clk_round_rate_cpuclk(struct clk *clk, unsigned long rate) 632static unsigned long clk_round_rate_cpuclk(struct clk *clk, unsigned long rate)
633{ 633{
634 if (rate >= 13000000) 634 if (rate <= 13000000)
635 return 13000000; 635 return 13000000;
636 if (rate >= 52000000) 636 if (rate <= 52000000)
637 return 52000000; 637 return 52000000;
638 if (rate >= 104000000) 638 if (rate <= 104000000)
639 return 104000000; 639 return 104000000;
640 if (rate >= 208000000) 640 if (rate <= 208000000)
641 return 208000000; 641 return 208000000;
642 return -EINVAL; 642 return -EINVAL;
643} 643}
@@ -1276,11 +1276,8 @@ static struct clk_lookup lookups[] = {
1276 1276
1277static void __init clk_register(void) 1277static void __init clk_register(void)
1278{ 1278{
1279 int i;
1280
1281 /* Register the lookups */ 1279 /* Register the lookups */
1282 for (i = 0; i < ARRAY_SIZE(lookups); i++) 1280 clkdev_add_table(lookups, ARRAY_SIZE(lookups));
1283 clkdev_add(&lookups[i]);
1284} 1281}
1285 1282
1286/* 1283/*
diff --git a/arch/arm/mach-u300/core.c b/arch/arm/mach-u300/core.c
index 653e25be3dd8..01b50313914c 100644
--- a/arch/arm/mach-u300/core.c
+++ b/arch/arm/mach-u300/core.c
@@ -3,7 +3,7 @@
3 * arch/arm/mach-u300/core.c 3 * arch/arm/mach-u300/core.c
4 * 4 *
5 * 5 *
6 * Copyright (C) 2007-2009 ST-Ericsson AB 6 * Copyright (C) 2007-2010 ST-Ericsson AB
7 * License terms: GNU General Public License (GPL) version 2 7 * License terms: GNU General Public License (GPL) version 2
8 * Core platform support, IRQ handling and device definitions. 8 * Core platform support, IRQ handling and device definitions.
9 * Author: Linus Walleij <linus.walleij@stericsson.com> 9 * Author: Linus Walleij <linus.walleij@stericsson.com>
@@ -19,6 +19,7 @@
19#include <linux/amba/bus.h> 19#include <linux/amba/bus.h>
20#include <linux/platform_device.h> 20#include <linux/platform_device.h>
21#include <linux/gpio.h> 21#include <linux/gpio.h>
22#include <mach/coh901318.h>
22 23
23#include <asm/types.h> 24#include <asm/types.h>
24#include <asm/setup.h> 25#include <asm/setup.h>
@@ -29,6 +30,7 @@
29 30
30#include <mach/hardware.h> 31#include <mach/hardware.h>
31#include <mach/syscon.h> 32#include <mach/syscon.h>
33#include <mach/dma_channels.h>
32 34
33#include "clock.h" 35#include "clock.h"
34#include "mmc.h" 36#include "mmc.h"
@@ -372,8 +374,1019 @@ static struct resource ave_resources[] = {
372 }, 374 },
373}; 375};
374 376
377static struct resource dma_resource[] = {
378 {
379 .start = U300_DMAC_BASE,
380 .end = U300_DMAC_BASE + PAGE_SIZE - 1,
381 .flags = IORESOURCE_MEM,
382 },
383 {
384 .start = IRQ_U300_DMA,
385 .end = IRQ_U300_DMA,
386 .flags = IORESOURCE_IRQ,
387 }
388};
389
390#ifdef CONFIG_MACH_U300_BS335
391/* points out all dma slave channels.
392 * Syntax is [A1, B1, A2, B2, .... ,-1,-1]
393 * Select all channels from A to B, end of list is marked with -1,-1
394 */
395static int dma_slave_channels[] = {
396 U300_DMA_MSL_TX_0, U300_DMA_SPI_RX,
397 U300_DMA_UART1_TX, U300_DMA_UART1_RX, -1, -1};
398
399/* points out all dma memcpy channels. */
400static int dma_memcpy_channels[] = {
401 U300_DMA_GENERAL_PURPOSE_0, U300_DMA_GENERAL_PURPOSE_8, -1, -1};
402
403#else /* CONFIG_MACH_U300_BS335 */
404
405static int dma_slave_channels[] = {U300_DMA_MSL_TX_0, U300_DMA_SPI_RX, -1, -1};
406static int dma_memcpy_channels[] = {
407 U300_DMA_GENERAL_PURPOSE_0, U300_DMA_GENERAL_PURPOSE_10, -1, -1};
408
409#endif
410
411/** register dma for memory access
412 *
413 * active 1 means dma intends to access memory
414 * 0 means dma wont access memory
415 */
416static void coh901318_access_memory_state(struct device *dev, bool active)
417{
418}
419
420#define flags_memcpy_config (COH901318_CX_CFG_CH_DISABLE | \
421 COH901318_CX_CFG_RM_MEMORY_TO_MEMORY | \
422 COH901318_CX_CFG_LCR_DISABLE | \
423 COH901318_CX_CFG_TC_IRQ_ENABLE | \
424 COH901318_CX_CFG_BE_IRQ_ENABLE)
425#define flags_memcpy_lli_chained (COH901318_CX_CTRL_TC_ENABLE | \
426 COH901318_CX_CTRL_BURST_COUNT_32_BYTES | \
427 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS | \
428 COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE | \
429 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS | \
430 COH901318_CX_CTRL_DST_ADDR_INC_ENABLE | \
431 COH901318_CX_CTRL_MASTER_MODE_M1RW | \
432 COH901318_CX_CTRL_TCP_DISABLE | \
433 COH901318_CX_CTRL_TC_IRQ_DISABLE | \
434 COH901318_CX_CTRL_HSP_DISABLE | \
435 COH901318_CX_CTRL_HSS_DISABLE | \
436 COH901318_CX_CTRL_DDMA_LEGACY | \
437 COH901318_CX_CTRL_PRDD_SOURCE)
438#define flags_memcpy_lli (COH901318_CX_CTRL_TC_ENABLE | \
439 COH901318_CX_CTRL_BURST_COUNT_32_BYTES | \
440 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS | \
441 COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE | \
442 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS | \
443 COH901318_CX_CTRL_DST_ADDR_INC_ENABLE | \
444 COH901318_CX_CTRL_MASTER_MODE_M1RW | \
445 COH901318_CX_CTRL_TCP_DISABLE | \
446 COH901318_CX_CTRL_TC_IRQ_DISABLE | \
447 COH901318_CX_CTRL_HSP_DISABLE | \
448 COH901318_CX_CTRL_HSS_DISABLE | \
449 COH901318_CX_CTRL_DDMA_LEGACY | \
450 COH901318_CX_CTRL_PRDD_SOURCE)
451#define flags_memcpy_lli_last (COH901318_CX_CTRL_TC_ENABLE | \
452 COH901318_CX_CTRL_BURST_COUNT_32_BYTES | \
453 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS | \
454 COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE | \
455 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS | \
456 COH901318_CX_CTRL_DST_ADDR_INC_ENABLE | \
457 COH901318_CX_CTRL_MASTER_MODE_M1RW | \
458 COH901318_CX_CTRL_TCP_DISABLE | \
459 COH901318_CX_CTRL_TC_IRQ_ENABLE | \
460 COH901318_CX_CTRL_HSP_DISABLE | \
461 COH901318_CX_CTRL_HSS_DISABLE | \
462 COH901318_CX_CTRL_DDMA_LEGACY | \
463 COH901318_CX_CTRL_PRDD_SOURCE)
464
465const struct coh_dma_channel chan_config[U300_DMA_CHANNELS] = {
466 {
467 .number = U300_DMA_MSL_TX_0,
468 .name = "MSL TX 0",
469 .priority_high = 0,
470 .dev_addr = U300_MSL_BASE + 0 * 0x40 + 0x20,
471 },
472 {
473 .number = U300_DMA_MSL_TX_1,
474 .name = "MSL TX 1",
475 .priority_high = 0,
476 .dev_addr = U300_MSL_BASE + 1 * 0x40 + 0x20,
477 .param.config = COH901318_CX_CFG_CH_DISABLE |
478 COH901318_CX_CFG_LCR_DISABLE |
479 COH901318_CX_CFG_TC_IRQ_ENABLE |
480 COH901318_CX_CFG_BE_IRQ_ENABLE,
481 .param.ctrl_lli_chained = 0 |
482 COH901318_CX_CTRL_TC_ENABLE |
483 COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
484 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
485 COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE |
486 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
487 COH901318_CX_CTRL_DST_ADDR_INC_DISABLE |
488 COH901318_CX_CTRL_MASTER_MODE_M1R_M2W |
489 COH901318_CX_CTRL_TCP_DISABLE |
490 COH901318_CX_CTRL_TC_IRQ_DISABLE |
491 COH901318_CX_CTRL_HSP_ENABLE |
492 COH901318_CX_CTRL_HSS_DISABLE |
493 COH901318_CX_CTRL_DDMA_LEGACY |
494 COH901318_CX_CTRL_PRDD_SOURCE,
495 .param.ctrl_lli = 0 |
496 COH901318_CX_CTRL_TC_ENABLE |
497 COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
498 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
499 COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE |
500 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
501 COH901318_CX_CTRL_DST_ADDR_INC_DISABLE |
502 COH901318_CX_CTRL_MASTER_MODE_M1R_M2W |
503 COH901318_CX_CTRL_TCP_ENABLE |
504 COH901318_CX_CTRL_TC_IRQ_DISABLE |
505 COH901318_CX_CTRL_HSP_ENABLE |
506 COH901318_CX_CTRL_HSS_DISABLE |
507 COH901318_CX_CTRL_DDMA_LEGACY |
508 COH901318_CX_CTRL_PRDD_SOURCE,
509 .param.ctrl_lli_last = 0 |
510 COH901318_CX_CTRL_TC_ENABLE |
511 COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
512 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
513 COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE |
514 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
515 COH901318_CX_CTRL_DST_ADDR_INC_DISABLE |
516 COH901318_CX_CTRL_MASTER_MODE_M1R_M2W |
517 COH901318_CX_CTRL_TCP_ENABLE |
518 COH901318_CX_CTRL_TC_IRQ_ENABLE |
519 COH901318_CX_CTRL_HSP_ENABLE |
520 COH901318_CX_CTRL_HSS_DISABLE |
521 COH901318_CX_CTRL_DDMA_LEGACY |
522 COH901318_CX_CTRL_PRDD_SOURCE,
523 },
524 {
525 .number = U300_DMA_MSL_TX_2,
526 .name = "MSL TX 2",
527 .priority_high = 0,
528 .dev_addr = U300_MSL_BASE + 2 * 0x40 + 0x20,
529 .param.config = COH901318_CX_CFG_CH_DISABLE |
530 COH901318_CX_CFG_LCR_DISABLE |
531 COH901318_CX_CFG_TC_IRQ_ENABLE |
532 COH901318_CX_CFG_BE_IRQ_ENABLE,
533 .param.ctrl_lli_chained = 0 |
534 COH901318_CX_CTRL_TC_ENABLE |
535 COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
536 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
537 COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE |
538 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
539 COH901318_CX_CTRL_DST_ADDR_INC_DISABLE |
540 COH901318_CX_CTRL_MASTER_MODE_M1R_M2W |
541 COH901318_CX_CTRL_TCP_DISABLE |
542 COH901318_CX_CTRL_TC_IRQ_DISABLE |
543 COH901318_CX_CTRL_HSP_ENABLE |
544 COH901318_CX_CTRL_HSS_DISABLE |
545 COH901318_CX_CTRL_DDMA_LEGACY |
546 COH901318_CX_CTRL_PRDD_SOURCE,
547 .param.ctrl_lli = 0 |
548 COH901318_CX_CTRL_TC_ENABLE |
549 COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
550 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
551 COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE |
552 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
553 COH901318_CX_CTRL_DST_ADDR_INC_DISABLE |
554 COH901318_CX_CTRL_MASTER_MODE_M1R_M2W |
555 COH901318_CX_CTRL_TCP_ENABLE |
556 COH901318_CX_CTRL_TC_IRQ_DISABLE |
557 COH901318_CX_CTRL_HSP_ENABLE |
558 COH901318_CX_CTRL_HSS_DISABLE |
559 COH901318_CX_CTRL_DDMA_LEGACY |
560 COH901318_CX_CTRL_PRDD_SOURCE,
561 .param.ctrl_lli_last = 0 |
562 COH901318_CX_CTRL_TC_ENABLE |
563 COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
564 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
565 COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE |
566 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
567 COH901318_CX_CTRL_DST_ADDR_INC_DISABLE |
568 COH901318_CX_CTRL_MASTER_MODE_M1R_M2W |
569 COH901318_CX_CTRL_TCP_ENABLE |
570 COH901318_CX_CTRL_TC_IRQ_ENABLE |
571 COH901318_CX_CTRL_HSP_ENABLE |
572 COH901318_CX_CTRL_HSS_DISABLE |
573 COH901318_CX_CTRL_DDMA_LEGACY |
574 COH901318_CX_CTRL_PRDD_SOURCE,
575 .desc_nbr_max = 10,
576 },
577 {
578 .number = U300_DMA_MSL_TX_3,
579 .name = "MSL TX 3",
580 .priority_high = 0,
581 .dev_addr = U300_MSL_BASE + 3 * 0x40 + 0x20,
582 .param.config = COH901318_CX_CFG_CH_DISABLE |
583 COH901318_CX_CFG_LCR_DISABLE |
584 COH901318_CX_CFG_TC_IRQ_ENABLE |
585 COH901318_CX_CFG_BE_IRQ_ENABLE,
586 .param.ctrl_lli_chained = 0 |
587 COH901318_CX_CTRL_TC_ENABLE |
588 COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
589 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
590 COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE |
591 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
592 COH901318_CX_CTRL_DST_ADDR_INC_DISABLE |
593 COH901318_CX_CTRL_MASTER_MODE_M1R_M2W |
594 COH901318_CX_CTRL_TCP_DISABLE |
595 COH901318_CX_CTRL_TC_IRQ_DISABLE |
596 COH901318_CX_CTRL_HSP_ENABLE |
597 COH901318_CX_CTRL_HSS_DISABLE |
598 COH901318_CX_CTRL_DDMA_LEGACY |
599 COH901318_CX_CTRL_PRDD_SOURCE,
600 .param.ctrl_lli = 0 |
601 COH901318_CX_CTRL_TC_ENABLE |
602 COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
603 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
604 COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE |
605 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
606 COH901318_CX_CTRL_DST_ADDR_INC_DISABLE |
607 COH901318_CX_CTRL_MASTER_MODE_M1R_M2W |
608 COH901318_CX_CTRL_TCP_ENABLE |
609 COH901318_CX_CTRL_TC_IRQ_DISABLE |
610 COH901318_CX_CTRL_HSP_ENABLE |
611 COH901318_CX_CTRL_HSS_DISABLE |
612 COH901318_CX_CTRL_DDMA_LEGACY |
613 COH901318_CX_CTRL_PRDD_SOURCE,
614 .param.ctrl_lli_last = 0 |
615 COH901318_CX_CTRL_TC_ENABLE |
616 COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
617 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
618 COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE |
619 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
620 COH901318_CX_CTRL_DST_ADDR_INC_DISABLE |
621 COH901318_CX_CTRL_MASTER_MODE_M1R_M2W |
622 COH901318_CX_CTRL_TCP_ENABLE |
623 COH901318_CX_CTRL_TC_IRQ_ENABLE |
624 COH901318_CX_CTRL_HSP_ENABLE |
625 COH901318_CX_CTRL_HSS_DISABLE |
626 COH901318_CX_CTRL_DDMA_LEGACY |
627 COH901318_CX_CTRL_PRDD_SOURCE,
628 },
629 {
630 .number = U300_DMA_MSL_TX_4,
631 .name = "MSL TX 4",
632 .priority_high = 0,
633 .dev_addr = U300_MSL_BASE + 4 * 0x40 + 0x20,
634 .param.config = COH901318_CX_CFG_CH_DISABLE |
635 COH901318_CX_CFG_LCR_DISABLE |
636 COH901318_CX_CFG_TC_IRQ_ENABLE |
637 COH901318_CX_CFG_BE_IRQ_ENABLE,
638 .param.ctrl_lli_chained = 0 |
639 COH901318_CX_CTRL_TC_ENABLE |
640 COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
641 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
642 COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE |
643 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
644 COH901318_CX_CTRL_DST_ADDR_INC_DISABLE |
645 COH901318_CX_CTRL_MASTER_MODE_M1R_M2W |
646 COH901318_CX_CTRL_TCP_DISABLE |
647 COH901318_CX_CTRL_TC_IRQ_DISABLE |
648 COH901318_CX_CTRL_HSP_ENABLE |
649 COH901318_CX_CTRL_HSS_DISABLE |
650 COH901318_CX_CTRL_DDMA_LEGACY |
651 COH901318_CX_CTRL_PRDD_SOURCE,
652 .param.ctrl_lli = 0 |
653 COH901318_CX_CTRL_TC_ENABLE |
654 COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
655 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
656 COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE |
657 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
658 COH901318_CX_CTRL_DST_ADDR_INC_DISABLE |
659 COH901318_CX_CTRL_MASTER_MODE_M1R_M2W |
660 COH901318_CX_CTRL_TCP_ENABLE |
661 COH901318_CX_CTRL_TC_IRQ_DISABLE |
662 COH901318_CX_CTRL_HSP_ENABLE |
663 COH901318_CX_CTRL_HSS_DISABLE |
664 COH901318_CX_CTRL_DDMA_LEGACY |
665 COH901318_CX_CTRL_PRDD_SOURCE,
666 .param.ctrl_lli_last = 0 |
667 COH901318_CX_CTRL_TC_ENABLE |
668 COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
669 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
670 COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE |
671 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
672 COH901318_CX_CTRL_DST_ADDR_INC_DISABLE |
673 COH901318_CX_CTRL_MASTER_MODE_M1R_M2W |
674 COH901318_CX_CTRL_TCP_ENABLE |
675 COH901318_CX_CTRL_TC_IRQ_ENABLE |
676 COH901318_CX_CTRL_HSP_ENABLE |
677 COH901318_CX_CTRL_HSS_DISABLE |
678 COH901318_CX_CTRL_DDMA_LEGACY |
679 COH901318_CX_CTRL_PRDD_SOURCE,
680 },
681 {
682 .number = U300_DMA_MSL_TX_5,
683 .name = "MSL TX 5",
684 .priority_high = 0,
685 .dev_addr = U300_MSL_BASE + 5 * 0x40 + 0x20,
686 },
687 {
688 .number = U300_DMA_MSL_TX_6,
689 .name = "MSL TX 6",
690 .priority_high = 0,
691 .dev_addr = U300_MSL_BASE + 6 * 0x40 + 0x20,
692 },
693 {
694 .number = U300_DMA_MSL_RX_0,
695 .name = "MSL RX 0",
696 .priority_high = 0,
697 .dev_addr = U300_MSL_BASE + 0 * 0x40 + 0x220,
698 },
699 {
700 .number = U300_DMA_MSL_RX_1,
701 .name = "MSL RX 1",
702 .priority_high = 0,
703 .dev_addr = U300_MSL_BASE + 1 * 0x40 + 0x220,
704 .param.config = COH901318_CX_CFG_CH_DISABLE |
705 COH901318_CX_CFG_LCR_DISABLE |
706 COH901318_CX_CFG_TC_IRQ_ENABLE |
707 COH901318_CX_CFG_BE_IRQ_ENABLE,
708 .param.ctrl_lli_chained = 0 |
709 COH901318_CX_CTRL_TC_ENABLE |
710 COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
711 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
712 COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE |
713 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
714 COH901318_CX_CTRL_DST_ADDR_INC_ENABLE |
715 COH901318_CX_CTRL_MASTER_MODE_M2R_M1W |
716 COH901318_CX_CTRL_TCP_DISABLE |
717 COH901318_CX_CTRL_TC_IRQ_DISABLE |
718 COH901318_CX_CTRL_HSP_ENABLE |
719 COH901318_CX_CTRL_HSS_DISABLE |
720 COH901318_CX_CTRL_DDMA_DEMAND_DMA1 |
721 COH901318_CX_CTRL_PRDD_DEST,
722 .param.ctrl_lli = 0,
723 .param.ctrl_lli_last = 0 |
724 COH901318_CX_CTRL_TC_ENABLE |
725 COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
726 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
727 COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE |
728 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
729 COH901318_CX_CTRL_DST_ADDR_INC_ENABLE |
730 COH901318_CX_CTRL_MASTER_MODE_M2R_M1W |
731 COH901318_CX_CTRL_TCP_DISABLE |
732 COH901318_CX_CTRL_TC_IRQ_ENABLE |
733 COH901318_CX_CTRL_HSP_ENABLE |
734 COH901318_CX_CTRL_HSS_DISABLE |
735 COH901318_CX_CTRL_DDMA_DEMAND_DMA1 |
736 COH901318_CX_CTRL_PRDD_DEST,
737 },
738 {
739 .number = U300_DMA_MSL_RX_2,
740 .name = "MSL RX 2",
741 .priority_high = 0,
742 .dev_addr = U300_MSL_BASE + 2 * 0x40 + 0x220,
743 .param.config = COH901318_CX_CFG_CH_DISABLE |
744 COH901318_CX_CFG_LCR_DISABLE |
745 COH901318_CX_CFG_TC_IRQ_ENABLE |
746 COH901318_CX_CFG_BE_IRQ_ENABLE,
747 .param.ctrl_lli_chained = 0 |
748 COH901318_CX_CTRL_TC_ENABLE |
749 COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
750 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
751 COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE |
752 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
753 COH901318_CX_CTRL_DST_ADDR_INC_ENABLE |
754 COH901318_CX_CTRL_MASTER_MODE_M2R_M1W |
755 COH901318_CX_CTRL_TCP_DISABLE |
756 COH901318_CX_CTRL_TC_IRQ_DISABLE |
757 COH901318_CX_CTRL_HSP_ENABLE |
758 COH901318_CX_CTRL_HSS_DISABLE |
759 COH901318_CX_CTRL_DDMA_DEMAND_DMA1 |
760 COH901318_CX_CTRL_PRDD_DEST,
761 .param.ctrl_lli = 0 |
762 COH901318_CX_CTRL_TC_ENABLE |
763 COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
764 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
765 COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE |
766 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
767 COH901318_CX_CTRL_DST_ADDR_INC_ENABLE |
768 COH901318_CX_CTRL_MASTER_MODE_M2R_M1W |
769 COH901318_CX_CTRL_TCP_DISABLE |
770 COH901318_CX_CTRL_TC_IRQ_ENABLE |
771 COH901318_CX_CTRL_HSP_ENABLE |
772 COH901318_CX_CTRL_HSS_DISABLE |
773 COH901318_CX_CTRL_DDMA_DEMAND_DMA1 |
774 COH901318_CX_CTRL_PRDD_DEST,
775 .param.ctrl_lli_last = 0 |
776 COH901318_CX_CTRL_TC_ENABLE |
777 COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
778 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
779 COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE |
780 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
781 COH901318_CX_CTRL_DST_ADDR_INC_ENABLE |
782 COH901318_CX_CTRL_MASTER_MODE_M2R_M1W |
783 COH901318_CX_CTRL_TCP_DISABLE |
784 COH901318_CX_CTRL_TC_IRQ_ENABLE |
785 COH901318_CX_CTRL_HSP_ENABLE |
786 COH901318_CX_CTRL_HSS_DISABLE |
787 COH901318_CX_CTRL_DDMA_DEMAND_DMA1 |
788 COH901318_CX_CTRL_PRDD_DEST,
789 },
790 {
791 .number = U300_DMA_MSL_RX_3,
792 .name = "MSL RX 3",
793 .priority_high = 0,
794 .dev_addr = U300_MSL_BASE + 3 * 0x40 + 0x220,
795 .param.config = COH901318_CX_CFG_CH_DISABLE |
796 COH901318_CX_CFG_LCR_DISABLE |
797 COH901318_CX_CFG_TC_IRQ_ENABLE |
798 COH901318_CX_CFG_BE_IRQ_ENABLE,
799 .param.ctrl_lli_chained = 0 |
800 COH901318_CX_CTRL_TC_ENABLE |
801 COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
802 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
803 COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE |
804 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
805 COH901318_CX_CTRL_DST_ADDR_INC_ENABLE |
806 COH901318_CX_CTRL_MASTER_MODE_M2R_M1W |
807 COH901318_CX_CTRL_TCP_DISABLE |
808 COH901318_CX_CTRL_TC_IRQ_DISABLE |
809 COH901318_CX_CTRL_HSP_ENABLE |
810 COH901318_CX_CTRL_HSS_DISABLE |
811 COH901318_CX_CTRL_DDMA_DEMAND_DMA1 |
812 COH901318_CX_CTRL_PRDD_DEST,
813 .param.ctrl_lli = 0 |
814 COH901318_CX_CTRL_TC_ENABLE |
815 COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
816 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
817 COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE |
818 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
819 COH901318_CX_CTRL_DST_ADDR_INC_ENABLE |
820 COH901318_CX_CTRL_MASTER_MODE_M2R_M1W |
821 COH901318_CX_CTRL_TCP_DISABLE |
822 COH901318_CX_CTRL_TC_IRQ_ENABLE |
823 COH901318_CX_CTRL_HSP_ENABLE |
824 COH901318_CX_CTRL_HSS_DISABLE |
825 COH901318_CX_CTRL_DDMA_DEMAND_DMA1 |
826 COH901318_CX_CTRL_PRDD_DEST,
827 .param.ctrl_lli_last = 0 |
828 COH901318_CX_CTRL_TC_ENABLE |
829 COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
830 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
831 COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE |
832 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
833 COH901318_CX_CTRL_DST_ADDR_INC_ENABLE |
834 COH901318_CX_CTRL_MASTER_MODE_M2R_M1W |
835 COH901318_CX_CTRL_TCP_DISABLE |
836 COH901318_CX_CTRL_TC_IRQ_ENABLE |
837 COH901318_CX_CTRL_HSP_ENABLE |
838 COH901318_CX_CTRL_HSS_DISABLE |
839 COH901318_CX_CTRL_DDMA_DEMAND_DMA1 |
840 COH901318_CX_CTRL_PRDD_DEST,
841 },
842 {
843 .number = U300_DMA_MSL_RX_4,
844 .name = "MSL RX 4",
845 .priority_high = 0,
846 .dev_addr = U300_MSL_BASE + 4 * 0x40 + 0x220,
847 .param.config = COH901318_CX_CFG_CH_DISABLE |
848 COH901318_CX_CFG_LCR_DISABLE |
849 COH901318_CX_CFG_TC_IRQ_ENABLE |
850 COH901318_CX_CFG_BE_IRQ_ENABLE,
851 .param.ctrl_lli_chained = 0 |
852 COH901318_CX_CTRL_TC_ENABLE |
853 COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
854 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
855 COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE |
856 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
857 COH901318_CX_CTRL_DST_ADDR_INC_ENABLE |
858 COH901318_CX_CTRL_MASTER_MODE_M2R_M1W |
859 COH901318_CX_CTRL_TCP_DISABLE |
860 COH901318_CX_CTRL_TC_IRQ_DISABLE |
861 COH901318_CX_CTRL_HSP_ENABLE |
862 COH901318_CX_CTRL_HSS_DISABLE |
863 COH901318_CX_CTRL_DDMA_DEMAND_DMA1 |
864 COH901318_CX_CTRL_PRDD_DEST,
865 .param.ctrl_lli = 0 |
866 COH901318_CX_CTRL_TC_ENABLE |
867 COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
868 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
869 COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE |
870 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
871 COH901318_CX_CTRL_DST_ADDR_INC_ENABLE |
872 COH901318_CX_CTRL_MASTER_MODE_M2R_M1W |
873 COH901318_CX_CTRL_TCP_DISABLE |
874 COH901318_CX_CTRL_TC_IRQ_ENABLE |
875 COH901318_CX_CTRL_HSP_ENABLE |
876 COH901318_CX_CTRL_HSS_DISABLE |
877 COH901318_CX_CTRL_DDMA_DEMAND_DMA1 |
878 COH901318_CX_CTRL_PRDD_DEST,
879 .param.ctrl_lli_last = 0 |
880 COH901318_CX_CTRL_TC_ENABLE |
881 COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
882 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
883 COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE |
884 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
885 COH901318_CX_CTRL_DST_ADDR_INC_ENABLE |
886 COH901318_CX_CTRL_MASTER_MODE_M2R_M1W |
887 COH901318_CX_CTRL_TCP_DISABLE |
888 COH901318_CX_CTRL_TC_IRQ_ENABLE |
889 COH901318_CX_CTRL_HSP_ENABLE |
890 COH901318_CX_CTRL_HSS_DISABLE |
891 COH901318_CX_CTRL_DDMA_DEMAND_DMA1 |
892 COH901318_CX_CTRL_PRDD_DEST,
893 },
894 {
895 .number = U300_DMA_MSL_RX_5,
896 .name = "MSL RX 5",
897 .priority_high = 0,
898 .dev_addr = U300_MSL_BASE + 5 * 0x40 + 0x220,
899 .param.config = COH901318_CX_CFG_CH_DISABLE |
900 COH901318_CX_CFG_LCR_DISABLE |
901 COH901318_CX_CFG_TC_IRQ_ENABLE |
902 COH901318_CX_CFG_BE_IRQ_ENABLE,
903 .param.ctrl_lli_chained = 0 |
904 COH901318_CX_CTRL_TC_ENABLE |
905 COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
906 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
907 COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE |
908 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
909 COH901318_CX_CTRL_DST_ADDR_INC_ENABLE |
910 COH901318_CX_CTRL_MASTER_MODE_M2R_M1W |
911 COH901318_CX_CTRL_TCP_DISABLE |
912 COH901318_CX_CTRL_TC_IRQ_DISABLE |
913 COH901318_CX_CTRL_HSP_ENABLE |
914 COH901318_CX_CTRL_HSS_DISABLE |
915 COH901318_CX_CTRL_DDMA_DEMAND_DMA1 |
916 COH901318_CX_CTRL_PRDD_DEST,
917 .param.ctrl_lli = 0 |
918 COH901318_CX_CTRL_TC_ENABLE |
919 COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
920 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
921 COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE |
922 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
923 COH901318_CX_CTRL_DST_ADDR_INC_ENABLE |
924 COH901318_CX_CTRL_MASTER_MODE_M2R_M1W |
925 COH901318_CX_CTRL_TCP_DISABLE |
926 COH901318_CX_CTRL_TC_IRQ_ENABLE |
927 COH901318_CX_CTRL_HSP_ENABLE |
928 COH901318_CX_CTRL_HSS_DISABLE |
929 COH901318_CX_CTRL_DDMA_DEMAND_DMA1 |
930 COH901318_CX_CTRL_PRDD_DEST,
931 .param.ctrl_lli_last = 0 |
932 COH901318_CX_CTRL_TC_ENABLE |
933 COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
934 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
935 COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE |
936 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
937 COH901318_CX_CTRL_DST_ADDR_INC_ENABLE |
938 COH901318_CX_CTRL_MASTER_MODE_M2R_M1W |
939 COH901318_CX_CTRL_TCP_DISABLE |
940 COH901318_CX_CTRL_TC_IRQ_ENABLE |
941 COH901318_CX_CTRL_HSP_ENABLE |
942 COH901318_CX_CTRL_HSS_DISABLE |
943 COH901318_CX_CTRL_DDMA_DEMAND_DMA1 |
944 COH901318_CX_CTRL_PRDD_DEST,
945 },
946 {
947 .number = U300_DMA_MSL_RX_6,
948 .name = "MSL RX 6",
949 .priority_high = 0,
950 .dev_addr = U300_MSL_BASE + 6 * 0x40 + 0x220,
951 },
952 {
953 .number = U300_DMA_MMCSD_RX_TX,
954 .name = "MMCSD RX TX",
955 .priority_high = 0,
956 .dev_addr = U300_MMCSD_BASE + 0x080,
957 .param.config = COH901318_CX_CFG_CH_DISABLE |
958 COH901318_CX_CFG_LCR_DISABLE |
959 COH901318_CX_CFG_TC_IRQ_ENABLE |
960 COH901318_CX_CFG_BE_IRQ_ENABLE,
961 .param.ctrl_lli_chained = 0 |
962 COH901318_CX_CTRL_TC_ENABLE |
963 COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
964 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
965 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
966 COH901318_CX_CTRL_MASTER_MODE_M1RW |
967 COH901318_CX_CTRL_TCP_ENABLE |
968 COH901318_CX_CTRL_TC_IRQ_ENABLE |
969 COH901318_CX_CTRL_HSP_ENABLE |
970 COH901318_CX_CTRL_HSS_DISABLE |
971 COH901318_CX_CTRL_DDMA_LEGACY,
972 .param.ctrl_lli = 0 |
973 COH901318_CX_CTRL_TC_ENABLE |
974 COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
975 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
976 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
977 COH901318_CX_CTRL_MASTER_MODE_M1RW |
978 COH901318_CX_CTRL_TCP_ENABLE |
979 COH901318_CX_CTRL_TC_IRQ_ENABLE |
980 COH901318_CX_CTRL_HSP_ENABLE |
981 COH901318_CX_CTRL_HSS_DISABLE |
982 COH901318_CX_CTRL_DDMA_LEGACY,
983 .param.ctrl_lli_last = 0 |
984 COH901318_CX_CTRL_TC_ENABLE |
985 COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
986 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
987 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
988 COH901318_CX_CTRL_MASTER_MODE_M1RW |
989 COH901318_CX_CTRL_TCP_DISABLE |
990 COH901318_CX_CTRL_TC_IRQ_ENABLE |
991 COH901318_CX_CTRL_HSP_ENABLE |
992 COH901318_CX_CTRL_HSS_DISABLE |
993 COH901318_CX_CTRL_DDMA_LEGACY,
994
995 },
996 {
997 .number = U300_DMA_MSPRO_TX,
998 .name = "MSPRO TX",
999 .priority_high = 0,
1000 },
1001 {
1002 .number = U300_DMA_MSPRO_RX,
1003 .name = "MSPRO RX",
1004 .priority_high = 0,
1005 },
1006 {
1007 .number = U300_DMA_UART0_TX,
1008 .name = "UART0 TX",
1009 .priority_high = 0,
1010 },
1011 {
1012 .number = U300_DMA_UART0_RX,
1013 .name = "UART0 RX",
1014 .priority_high = 0,
1015 },
1016 {
1017 .number = U300_DMA_APEX_TX,
1018 .name = "APEX TX",
1019 .priority_high = 0,
1020 },
1021 {
1022 .number = U300_DMA_APEX_RX,
1023 .name = "APEX RX",
1024 .priority_high = 0,
1025 },
1026 {
1027 .number = U300_DMA_PCM_I2S0_TX,
1028 .name = "PCM I2S0 TX",
1029 .priority_high = 1,
1030 .dev_addr = U300_PCM_I2S0_BASE + 0x14,
1031 .param.config = COH901318_CX_CFG_CH_DISABLE |
1032 COH901318_CX_CFG_LCR_DISABLE |
1033 COH901318_CX_CFG_TC_IRQ_ENABLE |
1034 COH901318_CX_CFG_BE_IRQ_ENABLE,
1035 .param.ctrl_lli_chained = 0 |
1036 COH901318_CX_CTRL_TC_ENABLE |
1037 COH901318_CX_CTRL_BURST_COUNT_16_BYTES |
1038 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
1039 COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE |
1040 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
1041 COH901318_CX_CTRL_DST_ADDR_INC_DISABLE |
1042 COH901318_CX_CTRL_MASTER_MODE_M1RW |
1043 COH901318_CX_CTRL_TCP_DISABLE |
1044 COH901318_CX_CTRL_TC_IRQ_DISABLE |
1045 COH901318_CX_CTRL_HSP_ENABLE |
1046 COH901318_CX_CTRL_HSS_DISABLE |
1047 COH901318_CX_CTRL_DDMA_LEGACY |
1048 COH901318_CX_CTRL_PRDD_SOURCE,
1049 .param.ctrl_lli = 0 |
1050 COH901318_CX_CTRL_TC_ENABLE |
1051 COH901318_CX_CTRL_BURST_COUNT_16_BYTES |
1052 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
1053 COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE |
1054 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
1055 COH901318_CX_CTRL_DST_ADDR_INC_DISABLE |
1056 COH901318_CX_CTRL_MASTER_MODE_M1RW |
1057 COH901318_CX_CTRL_TCP_ENABLE |
1058 COH901318_CX_CTRL_TC_IRQ_DISABLE |
1059 COH901318_CX_CTRL_HSP_ENABLE |
1060 COH901318_CX_CTRL_HSS_DISABLE |
1061 COH901318_CX_CTRL_DDMA_LEGACY |
1062 COH901318_CX_CTRL_PRDD_SOURCE,
1063 .param.ctrl_lli_last = 0 |
1064 COH901318_CX_CTRL_TC_ENABLE |
1065 COH901318_CX_CTRL_BURST_COUNT_16_BYTES |
1066 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
1067 COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE |
1068 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
1069 COH901318_CX_CTRL_DST_ADDR_INC_DISABLE |
1070 COH901318_CX_CTRL_MASTER_MODE_M1RW |
1071 COH901318_CX_CTRL_TCP_ENABLE |
1072 COH901318_CX_CTRL_TC_IRQ_ENABLE |
1073 COH901318_CX_CTRL_HSP_ENABLE |
1074 COH901318_CX_CTRL_HSS_DISABLE |
1075 COH901318_CX_CTRL_DDMA_LEGACY |
1076 COH901318_CX_CTRL_PRDD_SOURCE,
1077 },
1078 {
1079 .number = U300_DMA_PCM_I2S0_RX,
1080 .name = "PCM I2S0 RX",
1081 .priority_high = 1,
1082 .dev_addr = U300_PCM_I2S0_BASE + 0x10,
1083 .param.config = COH901318_CX_CFG_CH_DISABLE |
1084 COH901318_CX_CFG_LCR_DISABLE |
1085 COH901318_CX_CFG_TC_IRQ_ENABLE |
1086 COH901318_CX_CFG_BE_IRQ_ENABLE,
1087 .param.ctrl_lli_chained = 0 |
1088 COH901318_CX_CTRL_TC_ENABLE |
1089 COH901318_CX_CTRL_BURST_COUNT_16_BYTES |
1090 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
1091 COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE |
1092 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
1093 COH901318_CX_CTRL_DST_ADDR_INC_ENABLE |
1094 COH901318_CX_CTRL_MASTER_MODE_M1RW |
1095 COH901318_CX_CTRL_TCP_DISABLE |
1096 COH901318_CX_CTRL_TC_IRQ_DISABLE |
1097 COH901318_CX_CTRL_HSP_ENABLE |
1098 COH901318_CX_CTRL_HSS_DISABLE |
1099 COH901318_CX_CTRL_DDMA_LEGACY |
1100 COH901318_CX_CTRL_PRDD_DEST,
1101 .param.ctrl_lli = 0 |
1102 COH901318_CX_CTRL_TC_ENABLE |
1103 COH901318_CX_CTRL_BURST_COUNT_16_BYTES |
1104 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
1105 COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE |
1106 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
1107 COH901318_CX_CTRL_DST_ADDR_INC_ENABLE |
1108 COH901318_CX_CTRL_MASTER_MODE_M1RW |
1109 COH901318_CX_CTRL_TCP_ENABLE |
1110 COH901318_CX_CTRL_TC_IRQ_DISABLE |
1111 COH901318_CX_CTRL_HSP_ENABLE |
1112 COH901318_CX_CTRL_HSS_DISABLE |
1113 COH901318_CX_CTRL_DDMA_LEGACY |
1114 COH901318_CX_CTRL_PRDD_DEST,
1115 .param.ctrl_lli_last = 0 |
1116 COH901318_CX_CTRL_TC_ENABLE |
1117 COH901318_CX_CTRL_BURST_COUNT_16_BYTES |
1118 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
1119 COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE |
1120 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
1121 COH901318_CX_CTRL_DST_ADDR_INC_ENABLE |
1122 COH901318_CX_CTRL_MASTER_MODE_M1RW |
1123 COH901318_CX_CTRL_TCP_ENABLE |
1124 COH901318_CX_CTRL_TC_IRQ_ENABLE |
1125 COH901318_CX_CTRL_HSP_ENABLE |
1126 COH901318_CX_CTRL_HSS_DISABLE |
1127 COH901318_CX_CTRL_DDMA_LEGACY |
1128 COH901318_CX_CTRL_PRDD_DEST,
1129 },
1130 {
1131 .number = U300_DMA_PCM_I2S1_TX,
1132 .name = "PCM I2S1 TX",
1133 .priority_high = 1,
1134 .dev_addr = U300_PCM_I2S1_BASE + 0x14,
1135 .param.config = COH901318_CX_CFG_CH_DISABLE |
1136 COH901318_CX_CFG_LCR_DISABLE |
1137 COH901318_CX_CFG_TC_IRQ_ENABLE |
1138 COH901318_CX_CFG_BE_IRQ_ENABLE,
1139 .param.ctrl_lli_chained = 0 |
1140 COH901318_CX_CTRL_TC_ENABLE |
1141 COH901318_CX_CTRL_BURST_COUNT_16_BYTES |
1142 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
1143 COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE |
1144 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
1145 COH901318_CX_CTRL_DST_ADDR_INC_DISABLE |
1146 COH901318_CX_CTRL_MASTER_MODE_M1RW |
1147 COH901318_CX_CTRL_TCP_DISABLE |
1148 COH901318_CX_CTRL_TC_IRQ_DISABLE |
1149 COH901318_CX_CTRL_HSP_ENABLE |
1150 COH901318_CX_CTRL_HSS_DISABLE |
1151 COH901318_CX_CTRL_DDMA_LEGACY |
1152 COH901318_CX_CTRL_PRDD_SOURCE,
1153 .param.ctrl_lli = 0 |
1154 COH901318_CX_CTRL_TC_ENABLE |
1155 COH901318_CX_CTRL_BURST_COUNT_16_BYTES |
1156 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
1157 COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE |
1158 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
1159 COH901318_CX_CTRL_DST_ADDR_INC_DISABLE |
1160 COH901318_CX_CTRL_MASTER_MODE_M1RW |
1161 COH901318_CX_CTRL_TCP_ENABLE |
1162 COH901318_CX_CTRL_TC_IRQ_DISABLE |
1163 COH901318_CX_CTRL_HSP_ENABLE |
1164 COH901318_CX_CTRL_HSS_DISABLE |
1165 COH901318_CX_CTRL_DDMA_LEGACY |
1166 COH901318_CX_CTRL_PRDD_SOURCE,
1167 .param.ctrl_lli_last = 0 |
1168 COH901318_CX_CTRL_TC_ENABLE |
1169 COH901318_CX_CTRL_BURST_COUNT_16_BYTES |
1170 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
1171 COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE |
1172 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
1173 COH901318_CX_CTRL_DST_ADDR_INC_DISABLE |
1174 COH901318_CX_CTRL_MASTER_MODE_M1RW |
1175 COH901318_CX_CTRL_TCP_ENABLE |
1176 COH901318_CX_CTRL_TC_IRQ_ENABLE |
1177 COH901318_CX_CTRL_HSP_ENABLE |
1178 COH901318_CX_CTRL_HSS_DISABLE |
1179 COH901318_CX_CTRL_DDMA_LEGACY |
1180 COH901318_CX_CTRL_PRDD_SOURCE,
1181 },
1182 {
1183 .number = U300_DMA_PCM_I2S1_RX,
1184 .name = "PCM I2S1 RX",
1185 .priority_high = 1,
1186 .dev_addr = U300_PCM_I2S1_BASE + 0x10,
1187 .param.config = COH901318_CX_CFG_CH_DISABLE |
1188 COH901318_CX_CFG_LCR_DISABLE |
1189 COH901318_CX_CFG_TC_IRQ_ENABLE |
1190 COH901318_CX_CFG_BE_IRQ_ENABLE,
1191 .param.ctrl_lli_chained = 0 |
1192 COH901318_CX_CTRL_TC_ENABLE |
1193 COH901318_CX_CTRL_BURST_COUNT_16_BYTES |
1194 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
1195 COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE |
1196 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
1197 COH901318_CX_CTRL_DST_ADDR_INC_ENABLE |
1198 COH901318_CX_CTRL_MASTER_MODE_M1RW |
1199 COH901318_CX_CTRL_TCP_DISABLE |
1200 COH901318_CX_CTRL_TC_IRQ_DISABLE |
1201 COH901318_CX_CTRL_HSP_ENABLE |
1202 COH901318_CX_CTRL_HSS_DISABLE |
1203 COH901318_CX_CTRL_DDMA_LEGACY |
1204 COH901318_CX_CTRL_PRDD_DEST,
1205 .param.ctrl_lli = 0 |
1206 COH901318_CX_CTRL_TC_ENABLE |
1207 COH901318_CX_CTRL_BURST_COUNT_16_BYTES |
1208 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
1209 COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE |
1210 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
1211 COH901318_CX_CTRL_DST_ADDR_INC_ENABLE |
1212 COH901318_CX_CTRL_MASTER_MODE_M1RW |
1213 COH901318_CX_CTRL_TCP_ENABLE |
1214 COH901318_CX_CTRL_TC_IRQ_DISABLE |
1215 COH901318_CX_CTRL_HSP_ENABLE |
1216 COH901318_CX_CTRL_HSS_DISABLE |
1217 COH901318_CX_CTRL_DDMA_LEGACY |
1218 COH901318_CX_CTRL_PRDD_DEST,
1219 .param.ctrl_lli_last = 0 |
1220 COH901318_CX_CTRL_TC_ENABLE |
1221 COH901318_CX_CTRL_BURST_COUNT_16_BYTES |
1222 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
1223 COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE |
1224 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
1225 COH901318_CX_CTRL_DST_ADDR_INC_ENABLE |
1226 COH901318_CX_CTRL_MASTER_MODE_M1RW |
1227 COH901318_CX_CTRL_TCP_ENABLE |
1228 COH901318_CX_CTRL_TC_IRQ_ENABLE |
1229 COH901318_CX_CTRL_HSP_ENABLE |
1230 COH901318_CX_CTRL_HSS_DISABLE |
1231 COH901318_CX_CTRL_DDMA_LEGACY |
1232 COH901318_CX_CTRL_PRDD_DEST,
1233 },
1234 {
1235 .number = U300_DMA_XGAM_CDI,
1236 .name = "XGAM CDI",
1237 .priority_high = 0,
1238 },
1239 {
1240 .number = U300_DMA_XGAM_PDI,
1241 .name = "XGAM PDI",
1242 .priority_high = 0,
1243 },
1244 {
1245 .number = U300_DMA_SPI_TX,
1246 .name = "SPI TX",
1247 .priority_high = 0,
1248 },
1249 {
1250 .number = U300_DMA_SPI_RX,
1251 .name = "SPI RX",
1252 .priority_high = 0,
1253 },
1254 {
1255 .number = U300_DMA_GENERAL_PURPOSE_0,
1256 .name = "GENERAL 00",
1257 .priority_high = 0,
1258
1259 .param.config = flags_memcpy_config,
1260 .param.ctrl_lli_chained = flags_memcpy_lli_chained,
1261 .param.ctrl_lli = flags_memcpy_lli,
1262 .param.ctrl_lli_last = flags_memcpy_lli_last,
1263 },
1264 {
1265 .number = U300_DMA_GENERAL_PURPOSE_1,
1266 .name = "GENERAL 01",
1267 .priority_high = 0,
1268
1269 .param.config = flags_memcpy_config,
1270 .param.ctrl_lli_chained = flags_memcpy_lli_chained,
1271 .param.ctrl_lli = flags_memcpy_lli,
1272 .param.ctrl_lli_last = flags_memcpy_lli_last,
1273 },
1274 {
1275 .number = U300_DMA_GENERAL_PURPOSE_2,
1276 .name = "GENERAL 02",
1277 .priority_high = 0,
1278
1279 .param.config = flags_memcpy_config,
1280 .param.ctrl_lli_chained = flags_memcpy_lli_chained,
1281 .param.ctrl_lli = flags_memcpy_lli,
1282 .param.ctrl_lli_last = flags_memcpy_lli_last,
1283 },
1284 {
1285 .number = U300_DMA_GENERAL_PURPOSE_3,
1286 .name = "GENERAL 03",
1287 .priority_high = 0,
1288
1289 .param.config = flags_memcpy_config,
1290 .param.ctrl_lli_chained = flags_memcpy_lli_chained,
1291 .param.ctrl_lli = flags_memcpy_lli,
1292 .param.ctrl_lli_last = flags_memcpy_lli_last,
1293 },
1294 {
1295 .number = U300_DMA_GENERAL_PURPOSE_4,
1296 .name = "GENERAL 04",
1297 .priority_high = 0,
1298
1299 .param.config = flags_memcpy_config,
1300 .param.ctrl_lli_chained = flags_memcpy_lli_chained,
1301 .param.ctrl_lli = flags_memcpy_lli,
1302 .param.ctrl_lli_last = flags_memcpy_lli_last,
1303 },
1304 {
1305 .number = U300_DMA_GENERAL_PURPOSE_5,
1306 .name = "GENERAL 05",
1307 .priority_high = 0,
1308
1309 .param.config = flags_memcpy_config,
1310 .param.ctrl_lli_chained = flags_memcpy_lli_chained,
1311 .param.ctrl_lli = flags_memcpy_lli,
1312 .param.ctrl_lli_last = flags_memcpy_lli_last,
1313 },
1314 {
1315 .number = U300_DMA_GENERAL_PURPOSE_6,
1316 .name = "GENERAL 06",
1317 .priority_high = 0,
1318
1319 .param.config = flags_memcpy_config,
1320 .param.ctrl_lli_chained = flags_memcpy_lli_chained,
1321 .param.ctrl_lli = flags_memcpy_lli,
1322 .param.ctrl_lli_last = flags_memcpy_lli_last,
1323 },
1324 {
1325 .number = U300_DMA_GENERAL_PURPOSE_7,
1326 .name = "GENERAL 07",
1327 .priority_high = 0,
1328
1329 .param.config = flags_memcpy_config,
1330 .param.ctrl_lli_chained = flags_memcpy_lli_chained,
1331 .param.ctrl_lli = flags_memcpy_lli,
1332 .param.ctrl_lli_last = flags_memcpy_lli_last,
1333 },
1334 {
1335 .number = U300_DMA_GENERAL_PURPOSE_8,
1336 .name = "GENERAL 08",
1337 .priority_high = 0,
1338
1339 .param.config = flags_memcpy_config,
1340 .param.ctrl_lli_chained = flags_memcpy_lli_chained,
1341 .param.ctrl_lli = flags_memcpy_lli,
1342 .param.ctrl_lli_last = flags_memcpy_lli_last,
1343 },
1344#ifdef CONFIG_MACH_U300_BS335
1345 {
1346 .number = U300_DMA_UART1_TX,
1347 .name = "UART1 TX",
1348 .priority_high = 0,
1349 },
1350 {
1351 .number = U300_DMA_UART1_RX,
1352 .name = "UART1 RX",
1353 .priority_high = 0,
1354 }
1355#else
1356 {
1357 .number = U300_DMA_GENERAL_PURPOSE_9,
1358 .name = "GENERAL 09",
1359 .priority_high = 0,
1360
1361 .param.config = flags_memcpy_config,
1362 .param.ctrl_lli_chained = flags_memcpy_lli_chained,
1363 .param.ctrl_lli = flags_memcpy_lli,
1364 .param.ctrl_lli_last = flags_memcpy_lli_last,
1365 },
1366 {
1367 .number = U300_DMA_GENERAL_PURPOSE_10,
1368 .name = "GENERAL 10",
1369 .priority_high = 0,
1370
1371 .param.config = flags_memcpy_config,
1372 .param.ctrl_lli_chained = flags_memcpy_lli_chained,
1373 .param.ctrl_lli = flags_memcpy_lli,
1374 .param.ctrl_lli_last = flags_memcpy_lli_last,
1375 }
1376#endif
1377};
1378
1379
1380static struct coh901318_platform coh901318_platform = {
1381 .chans_slave = dma_slave_channels,
1382 .chans_memcpy = dma_memcpy_channels,
1383 .access_memory_state = coh901318_access_memory_state,
1384 .chan_conf = chan_config,
1385 .max_channels = U300_DMA_CHANNELS,
1386};
1387
375static struct platform_device wdog_device = { 1388static struct platform_device wdog_device = {
376 .name = "wdog", 1389 .name = "coh901327_wdog",
377 .id = -1, 1390 .id = -1,
378 .num_resources = ARRAY_SIZE(wdog_resources), 1391 .num_resources = ARRAY_SIZE(wdog_resources),
379 .resource = wdog_resources, 1392 .resource = wdog_resources,
@@ -428,11 +1441,23 @@ static struct platform_device ave_device = {
428 .resource = ave_resources, 1441 .resource = ave_resources,
429}; 1442};
430 1443
1444static struct platform_device dma_device = {
1445 .name = "coh901318",
1446 .id = -1,
1447 .resource = dma_resource,
1448 .num_resources = ARRAY_SIZE(dma_resource),
1449 .dev = {
1450 .platform_data = &coh901318_platform,
1451 .coherent_dma_mask = ~0,
1452 },
1453};
1454
431/* 1455/*
432 * Notice that AMBA devices are initialized before platform devices. 1456 * Notice that AMBA devices are initialized before platform devices.
433 * 1457 *
434 */ 1458 */
435static struct platform_device *platform_devs[] __initdata = { 1459static struct platform_device *platform_devs[] __initdata = {
1460 &dma_device,
436 &i2c0_device, 1461 &i2c0_device,
437 &i2c1_device, 1462 &i2c1_device,
438 &keypad_device, 1463 &keypad_device,
diff --git a/arch/arm/mach-u300/gpio.c b/arch/arm/mach-u300/gpio.c
index 0b35826b7d1d..5f61fd45a0c8 100644
--- a/arch/arm/mach-u300/gpio.c
+++ b/arch/arm/mach-u300/gpio.c
@@ -546,7 +546,7 @@ static void gpio_set_initial_values(void)
546 for (i = 0; i < U300_GPIO_MAX; i++) { 546 for (i = 0; i < U300_GPIO_MAX; i++) {
547 val = 0; 547 val = 0;
548 for (j = 0; j < 8; j++) 548 for (j = 0; j < 8; j++)
549 val |= (u32)((u300_gpio_config[i][j].pull_up == DISABLE_PULL_UP)) << j; 549 val |= (u32)((u300_gpio_config[i][j].pull_up == DISABLE_PULL_UP) << j);
550 local_irq_save(flags); 550 local_irq_save(flags);
551 writel(val, virtbase + U300_GPIO_PXPER + i * U300_GPIO_PORTX_SPACING); 551 writel(val, virtbase + U300_GPIO_PXPER + i * U300_GPIO_PORTX_SPACING);
552 local_irq_restore(flags); 552 local_irq_restore(flags);
diff --git a/arch/arm/mach-u300/include/mach/dma_channels.h b/arch/arm/mach-u300/include/mach/dma_channels.h
new file mode 100644
index 000000000000..b239149ba0d0
--- /dev/null
+++ b/arch/arm/mach-u300/include/mach/dma_channels.h
@@ -0,0 +1,69 @@
1/*
2 *
3 * arch/arm/mach-u300/include/mach/dma_channels.h
4 *
5 *
6 * Copyright (C) 2007-2009 ST-Ericsson
7 * License terms: GNU General Public License (GPL) version 2
8 * Map file for the U300 dma driver.
9 * Author: Per Friden <per.friden@stericsson.com>
10 */
11
12#ifndef DMA_CHANNELS_H
13#define DMA_CHANNELS_H
14
15#define U300_DMA_MSL_TX_0 0
16#define U300_DMA_MSL_TX_1 1
17#define U300_DMA_MSL_TX_2 2
18#define U300_DMA_MSL_TX_3 3
19#define U300_DMA_MSL_TX_4 4
20#define U300_DMA_MSL_TX_5 5
21#define U300_DMA_MSL_TX_6 6
22#define U300_DMA_MSL_RX_0 7
23#define U300_DMA_MSL_RX_1 8
24#define U300_DMA_MSL_RX_2 9
25#define U300_DMA_MSL_RX_3 10
26#define U300_DMA_MSL_RX_4 11
27#define U300_DMA_MSL_RX_5 12
28#define U300_DMA_MSL_RX_6 13
29#define U300_DMA_MMCSD_RX_TX 14
30#define U300_DMA_MSPRO_TX 15
31#define U300_DMA_MSPRO_RX 16
32#define U300_DMA_UART0_TX 17
33#define U300_DMA_UART0_RX 18
34#define U300_DMA_APEX_TX 19
35#define U300_DMA_APEX_RX 20
36#define U300_DMA_PCM_I2S0_TX 21
37#define U300_DMA_PCM_I2S0_RX 22
38#define U300_DMA_PCM_I2S1_TX 23
39#define U300_DMA_PCM_I2S1_RX 24
40#define U300_DMA_XGAM_CDI 25
41#define U300_DMA_XGAM_PDI 26
42#define U300_DMA_SPI_TX 27
43#define U300_DMA_SPI_RX 28
44#define U300_DMA_GENERAL_PURPOSE_0 29
45#define U300_DMA_GENERAL_PURPOSE_1 30
46#define U300_DMA_GENERAL_PURPOSE_2 31
47#define U300_DMA_GENERAL_PURPOSE_3 32
48#define U300_DMA_GENERAL_PURPOSE_4 33
49#define U300_DMA_GENERAL_PURPOSE_5 34
50#define U300_DMA_GENERAL_PURPOSE_6 35
51#define U300_DMA_GENERAL_PURPOSE_7 36
52#define U300_DMA_GENERAL_PURPOSE_8 37
53#ifdef CONFIG_MACH_U300_BS335
54#define U300_DMA_UART1_TX 38
55#define U300_DMA_UART1_RX 39
56#else
57#define U300_DMA_GENERAL_PURPOSE_9 38
58#define U300_DMA_GENERAL_PURPOSE_10 39
59#endif
60
61#ifdef CONFIG_MACH_U300_BS335
62#define U300_DMA_DEVICE_CHANNELS 32
63#else
64#define U300_DMA_DEVICE_CHANNELS 30
65#endif
66#define U300_DMA_CHANNELS 40
67
68
69#endif /* DMA_CHANNELS_H */
diff --git a/arch/arm/mach-u300/include/mach/vmalloc.h b/arch/arm/mach-u300/include/mach/vmalloc.h
index b00c51a66fbe..ec423b92b81d 100644
--- a/arch/arm/mach-u300/include/mach/vmalloc.h
+++ b/arch/arm/mach-u300/include/mach/vmalloc.h
@@ -9,4 +9,4 @@
9 * End must be above the I/O registers and on an even 2MiB boundary. 9 * End must be above the I/O registers and on an even 2MiB boundary.
10 * Author: Linus Walleij <linus.walleij@stericsson.com> 10 * Author: Linus Walleij <linus.walleij@stericsson.com>
11 */ 11 */
12#define VMALLOC_END 0xfe800000 12#define VMALLOC_END 0xfe800000UL
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c
index aa5afbcc90f9..803aec1d6728 100644
--- a/arch/arm/mach-ux500/board-mop500.c
+++ b/arch/arm/mach-ux500/board-mop500.c
@@ -22,6 +22,7 @@
22#include <asm/mach/arch.h> 22#include <asm/mach/arch.h>
23 23
24#include <plat/mtu.h> 24#include <plat/mtu.h>
25#include <plat/i2c.h>
25 26
26#include <mach/hardware.h> 27#include <mach/hardware.h>
27#include <mach/setup.h> 28#include <mach/setup.h>
@@ -108,11 +109,96 @@ static struct amba_device pl022_device = {
108 .periphid = SSP_PER_ID, 109 .periphid = SSP_PER_ID,
109}; 110};
110 111
112static struct amba_device pl031_device = {
113 .dev = {
114 .init_name = "pl031",
115 },
116 .res = {
117 .start = U8500_RTC_BASE,
118 .end = U8500_RTC_BASE + SZ_4K - 1,
119 .flags = IORESOURCE_MEM,
120 },
121 .irq = {IRQ_RTC_RTT, NO_IRQ},
122};
123
124#define U8500_I2C_RESOURCES(id, size) \
125static struct resource u8500_i2c_resources_##id[] = { \
126 [0] = { \
127 .start = U8500_I2C##id##_BASE, \
128 .end = U8500_I2C##id##_BASE + size - 1, \
129 .flags = IORESOURCE_MEM, \
130 }, \
131 [1] = { \
132 .start = IRQ_I2C##id, \
133 .end = IRQ_I2C##id, \
134 .flags = IORESOURCE_IRQ \
135 } \
136}
137
138U8500_I2C_RESOURCES(0, SZ_4K);
139U8500_I2C_RESOURCES(1, SZ_4K);
140U8500_I2C_RESOURCES(2, SZ_4K);
141U8500_I2C_RESOURCES(3, SZ_4K);
142
143#define U8500_I2C_CONTROLLER(id, _slsu, _tft, _rft, clk, _sm) \
144static struct nmk_i2c_controller u8500_i2c_##id = { \
145 /* \
146 * slave data setup time, which is \
147 * 250 ns,100ns,10ns which is 14,6,2 \
148 * respectively for a 48 Mhz \
149 * i2c clock \
150 */ \
151 .slsu = _slsu, \
152 /* Tx FIFO threshold */ \
153 .tft = _tft, \
154 /* Rx FIFO threshold */ \
155 .rft = _rft, \
156 /* std. mode operation */ \
157 .clk_freq = clk, \
158 .sm = _sm, \
159}
160
161/*
162 * The board uses 4 i2c controllers, initialize all of
163 * them with slave data setup time of 250 ns,
164 * Tx & Rx FIFO threshold values as 1 and standard
165 * mode of operation
166 */
167U8500_I2C_CONTROLLER(0, 0xe, 1, 1, 100000, I2C_FREQ_MODE_STANDARD);
168U8500_I2C_CONTROLLER(1, 0xe, 1, 1, 100000, I2C_FREQ_MODE_STANDARD);
169U8500_I2C_CONTROLLER(2, 0xe, 1, 1, 100000, I2C_FREQ_MODE_STANDARD);
170U8500_I2C_CONTROLLER(3, 0xe, 1, 1, 100000, I2C_FREQ_MODE_STANDARD);
171
172#define U8500_I2C_PDEVICE(cid) \
173static struct platform_device i2c_controller##cid = { \
174 .name = "nmk-i2c", \
175 .id = cid, \
176 .num_resources = 2, \
177 .resource = u8500_i2c_resources_##cid, \
178 .dev = { \
179 .platform_data = &u8500_i2c_##cid \
180 } \
181}
182
183U8500_I2C_PDEVICE(0);
184U8500_I2C_PDEVICE(1);
185U8500_I2C_PDEVICE(2);
186U8500_I2C_PDEVICE(3);
187
111static struct amba_device *amba_devs[] __initdata = { 188static struct amba_device *amba_devs[] __initdata = {
112 &uart0_device, 189 &uart0_device,
113 &uart1_device, 190 &uart1_device,
114 &uart2_device, 191 &uart2_device,
115 &pl022_device, 192 &pl022_device,
193 &pl031_device,
194};
195
196/* add any platform devices here - TODO */
197static struct platform_device *platform_devs[] __initdata = {
198 &i2c_controller0,
199 &i2c_controller1,
200 &i2c_controller2,
201 &i2c_controller3,
116}; 202};
117 203
118static void __init u8500_timer_init(void) 204static void __init u8500_timer_init(void)
@@ -139,6 +225,8 @@ static void __init u8500_init_machine(void)
139 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) 225 for (i = 0; i < ARRAY_SIZE(amba_devs); i++)
140 amba_device_register(amba_devs[i], &iomem_resource); 226 amba_device_register(amba_devs[i], &iomem_resource);
141 227
228 platform_add_devices(platform_devs, ARRAY_SIZE(platform_devs));
229
142 spi_register_board_info(u8500_spi_devices, 230 spi_register_board_info(u8500_spi_devices,
143 ARRAY_SIZE(u8500_spi_devices)); 231 ARRAY_SIZE(u8500_spi_devices));
144 232
diff --git a/arch/arm/mach-ux500/clock.c b/arch/arm/mach-ux500/clock.c
index 20b6ebb6783a..8359a73d0041 100644
--- a/arch/arm/mach-ux500/clock.c
+++ b/arch/arm/mach-ux500/clock.c
@@ -85,11 +85,8 @@ static struct clk_lookup lookups[] = {
85 85
86static int __init clk_init(void) 86static int __init clk_init(void)
87{ 87{
88 int i;
89
90 /* register the clock lookups */ 88 /* register the clock lookups */
91 for (i = 0; i < ARRAY_SIZE(lookups); i++) 89 clkdev_add_table(lookups, ARRAY_SIZE(lookups));
92 clkdev_add(&lookups[i]);
93 return 0; 90 return 0;
94} 91}
95arch_initcall(clk_init); 92arch_initcall(clk_init);
diff --git a/arch/arm/mach-ux500/cpu-u8500.c b/arch/arm/mach-ux500/cpu-u8500.c
index 5f05e5850f71..397bc1f9ed94 100644
--- a/arch/arm/mach-ux500/cpu-u8500.c
+++ b/arch/arm/mach-ux500/cpu-u8500.c
@@ -33,6 +33,7 @@ static struct platform_device *platform_devs[] __initdata = {
33 33
34/* minimum static i/o mapping required to boot U8500 platforms */ 34/* minimum static i/o mapping required to boot U8500 platforms */
35static struct map_desc u8500_io_desc[] __initdata = { 35static struct map_desc u8500_io_desc[] __initdata = {
36 __IO_DEV_DESC(U8500_UART2_BASE, SZ_4K),
36 __IO_DEV_DESC(U8500_GIC_CPU_BASE, SZ_4K), 37 __IO_DEV_DESC(U8500_GIC_CPU_BASE, SZ_4K),
37 __IO_DEV_DESC(U8500_GIC_DIST_BASE, SZ_4K), 38 __IO_DEV_DESC(U8500_GIC_DIST_BASE, SZ_4K),
38 __IO_DEV_DESC(U8500_MTU0_BASE, SZ_4K), 39 __IO_DEV_DESC(U8500_MTU0_BASE, SZ_4K),
diff --git a/arch/arm/mach-ux500/include/mach/debug-macro.S b/arch/arm/mach-ux500/include/mach/debug-macro.S
index 494408b96785..09cbfda8aee5 100644
--- a/arch/arm/mach-ux500/include/mach/debug-macro.S
+++ b/arch/arm/mach-ux500/include/mach/debug-macro.S
@@ -8,12 +8,13 @@
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 * 9 *
10 */ 10 */
11#include <mach/hardware.h>
12
11 .macro addruart, rx, tmp 13 .macro addruart, rx, tmp
12 mrc p15, 0, \rx, c1, c0 14 mrc p15, 0, \rx, c1, c0
13 tst \rx, #1 @MMU enabled? 15 tst \rx, #1 @ MMU enabled?
14 moveq \rx, #0x80000000 @MMU off, Physical address 16 ldreq \rx, =U8500_UART2_BASE @ no, physical address
15 movne \rx, #0xF0000000 @MMU on, Virtual address 17 ldrne \rx, =IO_ADDRESS(U8500_UART2_BASE) @ yes, virtual address
16 orr \rx, \rx, #0x7000
17 .endm 18 .endm
18 19
19#include <asm/hardware/debug-pl01x.S> 20#include <asm/hardware/debug-pl01x.S>
diff --git a/arch/arm/mach-ux500/include/mach/vmalloc.h b/arch/arm/mach-ux500/include/mach/vmalloc.h
index 86cdbbce1842..a4945cb41172 100644
--- a/arch/arm/mach-ux500/include/mach/vmalloc.h
+++ b/arch/arm/mach-ux500/include/mach/vmalloc.h
@@ -15,4 +15,4 @@
15 * along with this program; if not, write to the Free Software 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 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */ 17 */
18#define VMALLOC_END 0xf0000000 18#define VMALLOC_END 0xf0000000UL
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c
index e13be7c444ca..9ddb49b1cb71 100644
--- a/arch/arm/mach-versatile/core.c
+++ b/arch/arm/mach-versatile/core.c
@@ -851,8 +851,7 @@ void __init versatile_init(void)
851{ 851{
852 int i; 852 int i;
853 853
854 for (i = 0; i < ARRAY_SIZE(lookups); i++) 854 clkdev_add_table(lookups, ARRAY_SIZE(lookups));
855 clkdev_add(&lookups[i]);
856 855
857 platform_device_register(&versatile_flash_device); 856 platform_device_register(&versatile_flash_device);
858 platform_device_register(&versatile_i2c_device); 857 platform_device_register(&versatile_i2c_device);
diff --git a/arch/arm/mach-w90x900/clock.c b/arch/arm/mach-w90x900/clock.c
index b785994bab0a..2c371ff22e51 100644
--- a/arch/arm/mach-w90x900/clock.c
+++ b/arch/arm/mach-w90x900/clock.c
@@ -90,12 +90,3 @@ void nuc900_subclk_enable(struct clk *clk, int enable)
90 90
91 __raw_writel(clken, W90X900_VA_CLKPWR + SUBCLK); 91 __raw_writel(clken, W90X900_VA_CLKPWR + SUBCLK);
92} 92}
93
94
95void clks_register(struct clk_lookup *clks, size_t num)
96{
97 int i;
98
99 for (i = 0; i < num; i++)
100 clkdev_add(&clks[i]);
101}
diff --git a/arch/arm/mach-w90x900/clock.h b/arch/arm/mach-w90x900/clock.h
index f5816a06eed6..c56ddab3d912 100644
--- a/arch/arm/mach-w90x900/clock.h
+++ b/arch/arm/mach-w90x900/clock.h
@@ -14,7 +14,6 @@
14 14
15void nuc900_clk_enable(struct clk *clk, int enable); 15void nuc900_clk_enable(struct clk *clk, int enable);
16void nuc900_subclk_enable(struct clk *clk, int enable); 16void nuc900_subclk_enable(struct clk *clk, int enable);
17void clks_register(struct clk_lookup *clks, size_t num);
18 17
19struct clk { 18struct clk {
20 unsigned long cken; 19 unsigned long cken;
diff --git a/arch/arm/mach-w90x900/cpu.c b/arch/arm/mach-w90x900/cpu.c
index 20dc0c96214d..642207e18198 100644
--- a/arch/arm/mach-w90x900/cpu.c
+++ b/arch/arm/mach-w90x900/cpu.c
@@ -45,6 +45,7 @@ static struct map_desc nuc900_iodesc[] __initdata = {
45 IODESC_ENT(UART), 45 IODESC_ENT(UART),
46 IODESC_ENT(TIMER), 46 IODESC_ENT(TIMER),
47 IODESC_ENT(EBI), 47 IODESC_ENT(EBI),
48 IODESC_ENT(GPIO),
48}; 49};
49 50
50/* Initial clock declarations. */ 51/* Initial clock declarations. */
@@ -68,6 +69,11 @@ static DEFINE_CLK(gdma, 27);
68static DEFINE_CLK(adc, 28); 69static DEFINE_CLK(adc, 28);
69static DEFINE_CLK(usi, 29); 70static DEFINE_CLK(usi, 29);
70static DEFINE_CLK(ext, 0); 71static DEFINE_CLK(ext, 0);
72static DEFINE_CLK(timer0, 19);
73static DEFINE_CLK(timer1, 20);
74static DEFINE_CLK(timer2, 21);
75static DEFINE_CLK(timer3, 22);
76static DEFINE_CLK(timer4, 23);
71 77
72static struct clk_lookup nuc900_clkregs[] = { 78static struct clk_lookup nuc900_clkregs[] = {
73 DEF_CLKLOOK(&clk_lcd, "nuc900-lcd", NULL), 79 DEF_CLKLOOK(&clk_lcd, "nuc900-lcd", NULL),
@@ -90,6 +96,11 @@ static struct clk_lookup nuc900_clkregs[] = {
90 DEF_CLKLOOK(&clk_adc, "nuc900-adc", NULL), 96 DEF_CLKLOOK(&clk_adc, "nuc900-adc", NULL),
91 DEF_CLKLOOK(&clk_usi, "nuc900-spi", NULL), 97 DEF_CLKLOOK(&clk_usi, "nuc900-spi", NULL),
92 DEF_CLKLOOK(&clk_ext, NULL, "ext"), 98 DEF_CLKLOOK(&clk_ext, NULL, "ext"),
99 DEF_CLKLOOK(&clk_timer0, NULL, "timer0"),
100 DEF_CLKLOOK(&clk_timer1, NULL, "timer1"),
101 DEF_CLKLOOK(&clk_timer2, NULL, "timer2"),
102 DEF_CLKLOOK(&clk_timer3, NULL, "timer3"),
103 DEF_CLKLOOK(&clk_timer4, NULL, "timer4"),
93}; 104};
94 105
95/* Initial serial platform data */ 106/* Initial serial platform data */
@@ -208,6 +219,6 @@ void __init nuc900_map_io(struct map_desc *mach_desc, int mach_size)
208 219
209void __init nuc900_init_clocks(void) 220void __init nuc900_init_clocks(void)
210{ 221{
211 clks_register(nuc900_clkregs, ARRAY_SIZE(nuc900_clkregs)); 222 clkdev_add_table(nuc900_clkregs, ARRAY_SIZE(nuc900_clkregs));
212} 223}
213 224
diff --git a/arch/arm/mach-w90x900/include/mach/vmalloc.h b/arch/arm/mach-w90x900/include/mach/vmalloc.h
index 2f9dfb928533..b067e44500a4 100644
--- a/arch/arm/mach-w90x900/include/mach/vmalloc.h
+++ b/arch/arm/mach-w90x900/include/mach/vmalloc.h
@@ -18,6 +18,6 @@
18#ifndef __ASM_ARCH_VMALLOC_H 18#ifndef __ASM_ARCH_VMALLOC_H
19#define __ASM_ARCH_VMALLOC_H 19#define __ASM_ARCH_VMALLOC_H
20 20
21#define VMALLOC_END (0xE0000000) 21#define VMALLOC_END (0xe0000000UL)
22 22
23#endif /* __ASM_ARCH_VMALLOC_H */ 23#endif /* __ASM_ARCH_VMALLOC_H */
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
index baf638487a2d..c4ed9f93f646 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -399,7 +399,7 @@ config CPU_V6
399config CPU_32v6K 399config CPU_32v6K
400 bool "Support ARM V6K processor extensions" if !SMP 400 bool "Support ARM V6K processor extensions" if !SMP
401 depends on CPU_V6 401 depends on CPU_V6
402 default y if SMP && !ARCH_MX3 402 default y if SMP && !(ARCH_MX3 || ARCH_OMAP2)
403 help 403 help
404 Say Y here if your ARMv6 processor supports the 'K' extension. 404 Say Y here if your ARMv6 processor supports the 'K' extension.
405 This enables the kernel to use some instructions not present 405 This enables the kernel to use some instructions not present
@@ -410,7 +410,7 @@ config CPU_32v6K
410# ARMv7 410# ARMv7
411config CPU_V7 411config CPU_V7
412 bool "Support ARM V7 processor" if ARCH_INTEGRATOR || MACH_REALVIEW_EB || MACH_REALVIEW_PBX 412 bool "Support ARM V7 processor" if ARCH_INTEGRATOR || MACH_REALVIEW_EB || MACH_REALVIEW_PBX
413 select CPU_32v6K 413 select CPU_32v6K if !ARCH_OMAP2
414 select CPU_32v7 414 select CPU_32v7
415 select CPU_ABRT_EV7 415 select CPU_ABRT_EV7
416 select CPU_PABRT_V7 416 select CPU_PABRT_V7
@@ -754,7 +754,7 @@ config CACHE_FEROCEON_L2_WRITETHROUGH
754config CACHE_L2X0 754config CACHE_L2X0
755 bool "Enable the L2x0 outer cache controller" 755 bool "Enable the L2x0 outer cache controller"
756 depends on REALVIEW_EB_ARM11MP || MACH_REALVIEW_PB11MP || MACH_REALVIEW_PB1176 || \ 756 depends on REALVIEW_EB_ARM11MP || MACH_REALVIEW_PB11MP || MACH_REALVIEW_PB1176 || \
757 REALVIEW_EB_A9MP || ARCH_MX35 || ARCH_MX31 || MACH_REALVIEW_PBX || ARCH_NOMADIK 757 REALVIEW_EB_A9MP || ARCH_MX35 || ARCH_MX31 || MACH_REALVIEW_PBX || ARCH_NOMADIK || ARCH_OMAP4
758 default y 758 default y
759 select OUTER_CACHE 759 select OUTER_CACHE
760 help 760 help
@@ -779,5 +779,5 @@ config CACHE_XSC3L2
779 779
780config ARM_L1_CACHE_SHIFT 780config ARM_L1_CACHE_SHIFT
781 int 781 int
782 default 6 if ARCH_OMAP3 || ARCH_S5PC1XX 782 default 6 if ARM_L1_CACHE_SHIFT_6
783 default 5 783 default 5
diff --git a/arch/arm/mm/alignment.c b/arch/arm/mm/alignment.c
index b270d6228fe2..edddd66faac6 100644
--- a/arch/arm/mm/alignment.c
+++ b/arch/arm/mm/alignment.c
@@ -11,6 +11,7 @@
11 * it under the terms of the GNU General Public License version 2 as 11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation. 12 * published by the Free Software Foundation.
13 */ 13 */
14#include <linux/moduleparam.h>
14#include <linux/compiler.h> 15#include <linux/compiler.h>
15#include <linux/kernel.h> 16#include <linux/kernel.h>
16#include <linux/errno.h> 17#include <linux/errno.h>
@@ -77,6 +78,8 @@ static unsigned long ai_dword;
77static unsigned long ai_multi; 78static unsigned long ai_multi;
78static int ai_usermode; 79static int ai_usermode;
79 80
81core_param(alignment, ai_usermode, int, 0600);
82
80#define UM_WARN (1 << 0) 83#define UM_WARN (1 << 0)
81#define UM_FIXUP (1 << 1) 84#define UM_FIXUP (1 << 1)
82#define UM_SIGNAL (1 << 2) 85#define UM_SIGNAL (1 << 2)
@@ -898,11 +901,7 @@ static int __init alignment_init(void)
898#ifdef CONFIG_PROC_FS 901#ifdef CONFIG_PROC_FS
899 struct proc_dir_entry *res; 902 struct proc_dir_entry *res;
900 903
901 res = proc_mkdir("cpu", NULL); 904 res = create_proc_entry("cpu/alignment", S_IWUSR | S_IRUGO, NULL);
902 if (!res)
903 return -ENOMEM;
904
905 res = create_proc_entry("alignment", S_IWUSR | S_IRUGO, res);
906 if (!res) 905 if (!res)
907 return -ENOMEM; 906 return -ENOMEM;
908 907
diff --git a/arch/arm/mm/cache-fa.S b/arch/arm/mm/cache-fa.S
index a89444a3c016..7148e53e6078 100644
--- a/arch/arm/mm/cache-fa.S
+++ b/arch/arm/mm/cache-fa.S
@@ -157,7 +157,7 @@ ENTRY(fa_flush_kern_dcache_area)
157 * - start - virtual start address 157 * - start - virtual start address
158 * - end - virtual end address 158 * - end - virtual end address
159 */ 159 */
160ENTRY(fa_dma_inv_range) 160fa_dma_inv_range:
161 tst r0, #CACHE_DLINESIZE - 1 161 tst r0, #CACHE_DLINESIZE - 1
162 bic r0, r0, #CACHE_DLINESIZE - 1 162 bic r0, r0, #CACHE_DLINESIZE - 1
163 mcrne p15, 0, r0, c7, c14, 1 @ clean & invalidate D entry 163 mcrne p15, 0, r0, c7, c14, 1 @ clean & invalidate D entry
@@ -180,7 +180,7 @@ ENTRY(fa_dma_inv_range)
180 * - start - virtual start address 180 * - start - virtual start address
181 * - end - virtual end address 181 * - end - virtual end address
182 */ 182 */
183ENTRY(fa_dma_clean_range) 183fa_dma_clean_range:
184 bic r0, r0, #CACHE_DLINESIZE - 1 184 bic r0, r0, #CACHE_DLINESIZE - 1
1851: mcr p15, 0, r0, c7, c10, 1 @ clean D entry 1851: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
186 add r0, r0, #CACHE_DLINESIZE 186 add r0, r0, #CACHE_DLINESIZE
@@ -205,6 +205,30 @@ ENTRY(fa_dma_flush_range)
205 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer 205 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer
206 mov pc, lr 206 mov pc, lr
207 207
208/*
209 * dma_map_area(start, size, dir)
210 * - start - kernel virtual start address
211 * - size - size of region
212 * - dir - DMA direction
213 */
214ENTRY(fa_dma_map_area)
215 add r1, r1, r0
216 cmp r2, #DMA_TO_DEVICE
217 beq fa_dma_clean_range
218 bcs fa_dma_inv_range
219 b fa_dma_flush_range
220ENDPROC(fa_dma_map_area)
221
222/*
223 * dma_unmap_area(start, size, dir)
224 * - start - kernel virtual start address
225 * - size - size of region
226 * - dir - DMA direction
227 */
228ENTRY(fa_dma_unmap_area)
229 mov pc, lr
230ENDPROC(fa_dma_unmap_area)
231
208 __INITDATA 232 __INITDATA
209 233
210 .type fa_cache_fns, #object 234 .type fa_cache_fns, #object
@@ -215,7 +239,7 @@ ENTRY(fa_cache_fns)
215 .long fa_coherent_kern_range 239 .long fa_coherent_kern_range
216 .long fa_coherent_user_range 240 .long fa_coherent_user_range
217 .long fa_flush_kern_dcache_area 241 .long fa_flush_kern_dcache_area
218 .long fa_dma_inv_range 242 .long fa_dma_map_area
219 .long fa_dma_clean_range 243 .long fa_dma_unmap_area
220 .long fa_dma_flush_range 244 .long fa_dma_flush_range
221 .size fa_cache_fns, . - fa_cache_fns 245 .size fa_cache_fns, . - fa_cache_fns
diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
index cb8fc6573b1b..07334632d3e2 100644
--- a/arch/arm/mm/cache-l2x0.c
+++ b/arch/arm/mm/cache-l2x0.c
@@ -42,6 +42,57 @@ static inline void cache_sync(void)
42 cache_wait(base + L2X0_CACHE_SYNC, 1); 42 cache_wait(base + L2X0_CACHE_SYNC, 1);
43} 43}
44 44
45static inline void l2x0_clean_line(unsigned long addr)
46{
47 void __iomem *base = l2x0_base;
48 cache_wait(base + L2X0_CLEAN_LINE_PA, 1);
49 writel(addr, base + L2X0_CLEAN_LINE_PA);
50}
51
52static inline void l2x0_inv_line(unsigned long addr)
53{
54 void __iomem *base = l2x0_base;
55 cache_wait(base + L2X0_INV_LINE_PA, 1);
56 writel(addr, base + L2X0_INV_LINE_PA);
57}
58
59#ifdef CONFIG_PL310_ERRATA_588369
60static void debug_writel(unsigned long val)
61{
62 extern void omap_smc1(u32 fn, u32 arg);
63
64 /*
65 * Texas Instrument secure monitor api to modify the
66 * PL310 Debug Control Register.
67 */
68 omap_smc1(0x100, val);
69}
70
71static inline void l2x0_flush_line(unsigned long addr)
72{
73 void __iomem *base = l2x0_base;
74
75 /* Clean by PA followed by Invalidate by PA */
76 cache_wait(base + L2X0_CLEAN_LINE_PA, 1);
77 writel(addr, base + L2X0_CLEAN_LINE_PA);
78 cache_wait(base + L2X0_INV_LINE_PA, 1);
79 writel(addr, base + L2X0_INV_LINE_PA);
80}
81#else
82
83/* Optimised out for non-errata case */
84static inline void debug_writel(unsigned long val)
85{
86}
87
88static inline void l2x0_flush_line(unsigned long addr)
89{
90 void __iomem *base = l2x0_base;
91 cache_wait(base + L2X0_CLEAN_INV_LINE_PA, 1);
92 writel(addr, base + L2X0_CLEAN_INV_LINE_PA);
93}
94#endif
95
45static inline void l2x0_inv_all(void) 96static inline void l2x0_inv_all(void)
46{ 97{
47 unsigned long flags; 98 unsigned long flags;
@@ -62,23 +113,24 @@ static void l2x0_inv_range(unsigned long start, unsigned long end)
62 spin_lock_irqsave(&l2x0_lock, flags); 113 spin_lock_irqsave(&l2x0_lock, flags);
63 if (start & (CACHE_LINE_SIZE - 1)) { 114 if (start & (CACHE_LINE_SIZE - 1)) {
64 start &= ~(CACHE_LINE_SIZE - 1); 115 start &= ~(CACHE_LINE_SIZE - 1);
65 cache_wait(base + L2X0_CLEAN_INV_LINE_PA, 1); 116 debug_writel(0x03);
66 writel(start, base + L2X0_CLEAN_INV_LINE_PA); 117 l2x0_flush_line(start);
118 debug_writel(0x00);
67 start += CACHE_LINE_SIZE; 119 start += CACHE_LINE_SIZE;
68 } 120 }
69 121
70 if (end & (CACHE_LINE_SIZE - 1)) { 122 if (end & (CACHE_LINE_SIZE - 1)) {
71 end &= ~(CACHE_LINE_SIZE - 1); 123 end &= ~(CACHE_LINE_SIZE - 1);
72 cache_wait(base + L2X0_CLEAN_INV_LINE_PA, 1); 124 debug_writel(0x03);
73 writel(end, base + L2X0_CLEAN_INV_LINE_PA); 125 l2x0_flush_line(end);
126 debug_writel(0x00);
74 } 127 }
75 128
76 while (start < end) { 129 while (start < end) {
77 unsigned long blk_end = start + min(end - start, 4096UL); 130 unsigned long blk_end = start + min(end - start, 4096UL);
78 131
79 while (start < blk_end) { 132 while (start < blk_end) {
80 cache_wait(base + L2X0_INV_LINE_PA, 1); 133 l2x0_inv_line(start);
81 writel(start, base + L2X0_INV_LINE_PA);
82 start += CACHE_LINE_SIZE; 134 start += CACHE_LINE_SIZE;
83 } 135 }
84 136
@@ -103,8 +155,7 @@ static void l2x0_clean_range(unsigned long start, unsigned long end)
103 unsigned long blk_end = start + min(end - start, 4096UL); 155 unsigned long blk_end = start + min(end - start, 4096UL);
104 156
105 while (start < blk_end) { 157 while (start < blk_end) {
106 cache_wait(base + L2X0_CLEAN_LINE_PA, 1); 158 l2x0_clean_line(start);
107 writel(start, base + L2X0_CLEAN_LINE_PA);
108 start += CACHE_LINE_SIZE; 159 start += CACHE_LINE_SIZE;
109 } 160 }
110 161
@@ -128,11 +179,12 @@ static void l2x0_flush_range(unsigned long start, unsigned long end)
128 while (start < end) { 179 while (start < end) {
129 unsigned long blk_end = start + min(end - start, 4096UL); 180 unsigned long blk_end = start + min(end - start, 4096UL);
130 181
182 debug_writel(0x03);
131 while (start < blk_end) { 183 while (start < blk_end) {
132 cache_wait(base + L2X0_CLEAN_INV_LINE_PA, 1); 184 l2x0_flush_line(start);
133 writel(start, base + L2X0_CLEAN_INV_LINE_PA);
134 start += CACHE_LINE_SIZE; 185 start += CACHE_LINE_SIZE;
135 } 186 }
187 debug_writel(0x00);
136 188
137 if (blk_end < end) { 189 if (blk_end < end) {
138 spin_unlock_irqrestore(&l2x0_lock, flags); 190 spin_unlock_irqrestore(&l2x0_lock, flags);
diff --git a/arch/arm/mm/cache-v3.S b/arch/arm/mm/cache-v3.S
index 2a482731ea36..c2ff3c599fee 100644
--- a/arch/arm/mm/cache-v3.S
+++ b/arch/arm/mm/cache-v3.S
@@ -84,20 +84,6 @@ ENTRY(v3_flush_kern_dcache_area)
84 /* FALLTHROUGH */ 84 /* FALLTHROUGH */
85 85
86/* 86/*
87 * dma_inv_range(start, end)
88 *
89 * Invalidate (discard) the specified virtual address range.
90 * May not write back any entries. If 'start' or 'end'
91 * are not cache line aligned, those lines must be written
92 * back.
93 *
94 * - start - virtual start address
95 * - end - virtual end address
96 */
97ENTRY(v3_dma_inv_range)
98 /* FALLTHROUGH */
99
100/*
101 * dma_flush_range(start, end) 87 * dma_flush_range(start, end)
102 * 88 *
103 * Clean and invalidate the specified virtual address range. 89 * Clean and invalidate the specified virtual address range.
@@ -108,18 +94,29 @@ ENTRY(v3_dma_inv_range)
108ENTRY(v3_dma_flush_range) 94ENTRY(v3_dma_flush_range)
109 mov r0, #0 95 mov r0, #0
110 mcr p15, 0, r0, c7, c0, 0 @ flush ID cache 96 mcr p15, 0, r0, c7, c0, 0 @ flush ID cache
97 mov pc, lr
98
99/*
100 * dma_unmap_area(start, size, dir)
101 * - start - kernel virtual start address
102 * - size - size of region
103 * - dir - DMA direction
104 */
105ENTRY(v3_dma_unmap_area)
106 teq r2, #DMA_TO_DEVICE
107 bne v3_dma_flush_range
111 /* FALLTHROUGH */ 108 /* FALLTHROUGH */
112 109
113/* 110/*
114 * dma_clean_range(start, end) 111 * dma_map_area(start, size, dir)
115 * 112 * - start - kernel virtual start address
116 * Clean (write back) the specified virtual address range. 113 * - size - size of region
117 * 114 * - dir - DMA direction
118 * - start - virtual start address
119 * - end - virtual end address
120 */ 115 */
121ENTRY(v3_dma_clean_range) 116ENTRY(v3_dma_map_area)
122 mov pc, lr 117 mov pc, lr
118ENDPROC(v3_dma_unmap_area)
119ENDPROC(v3_dma_map_area)
123 120
124 __INITDATA 121 __INITDATA
125 122
@@ -131,7 +128,7 @@ ENTRY(v3_cache_fns)
131 .long v3_coherent_kern_range 128 .long v3_coherent_kern_range
132 .long v3_coherent_user_range 129 .long v3_coherent_user_range
133 .long v3_flush_kern_dcache_area 130 .long v3_flush_kern_dcache_area
134 .long v3_dma_inv_range 131 .long v3_dma_map_area
135 .long v3_dma_clean_range 132 .long v3_dma_unmap_area
136 .long v3_dma_flush_range 133 .long v3_dma_flush_range
137 .size v3_cache_fns, . - v3_cache_fns 134 .size v3_cache_fns, . - v3_cache_fns
diff --git a/arch/arm/mm/cache-v4.S b/arch/arm/mm/cache-v4.S
index 5c7da3e372e9..4810f7e3e813 100644
--- a/arch/arm/mm/cache-v4.S
+++ b/arch/arm/mm/cache-v4.S
@@ -94,20 +94,6 @@ ENTRY(v4_flush_kern_dcache_area)
94 /* FALLTHROUGH */ 94 /* FALLTHROUGH */
95 95
96/* 96/*
97 * dma_inv_range(start, end)
98 *
99 * Invalidate (discard) the specified virtual address range.
100 * May not write back any entries. If 'start' or 'end'
101 * are not cache line aligned, those lines must be written
102 * back.
103 *
104 * - start - virtual start address
105 * - end - virtual end address
106 */
107ENTRY(v4_dma_inv_range)
108 /* FALLTHROUGH */
109
110/*
111 * dma_flush_range(start, end) 97 * dma_flush_range(start, end)
112 * 98 *
113 * Clean and invalidate the specified virtual address range. 99 * Clean and invalidate the specified virtual address range.
@@ -120,18 +106,29 @@ ENTRY(v4_dma_flush_range)
120 mov r0, #0 106 mov r0, #0
121 mcr p15, 0, r0, c7, c7, 0 @ flush ID cache 107 mcr p15, 0, r0, c7, c7, 0 @ flush ID cache
122#endif 108#endif
109 mov pc, lr
110
111/*
112 * dma_unmap_area(start, size, dir)
113 * - start - kernel virtual start address
114 * - size - size of region
115 * - dir - DMA direction
116 */
117ENTRY(v4_dma_unmap_area)
118 teq r2, #DMA_TO_DEVICE
119 bne v4_dma_flush_range
123 /* FALLTHROUGH */ 120 /* FALLTHROUGH */
124 121
125/* 122/*
126 * dma_clean_range(start, end) 123 * dma_map_area(start, size, dir)
127 * 124 * - start - kernel virtual start address
128 * Clean (write back) the specified virtual address range. 125 * - size - size of region
129 * 126 * - dir - DMA direction
130 * - start - virtual start address
131 * - end - virtual end address
132 */ 127 */
133ENTRY(v4_dma_clean_range) 128ENTRY(v4_dma_map_area)
134 mov pc, lr 129 mov pc, lr
130ENDPROC(v4_dma_unmap_area)
131ENDPROC(v4_dma_map_area)
135 132
136 __INITDATA 133 __INITDATA
137 134
@@ -143,7 +140,7 @@ ENTRY(v4_cache_fns)
143 .long v4_coherent_kern_range 140 .long v4_coherent_kern_range
144 .long v4_coherent_user_range 141 .long v4_coherent_user_range
145 .long v4_flush_kern_dcache_area 142 .long v4_flush_kern_dcache_area
146 .long v4_dma_inv_range 143 .long v4_dma_map_area
147 .long v4_dma_clean_range 144 .long v4_dma_unmap_area
148 .long v4_dma_flush_range 145 .long v4_dma_flush_range
149 .size v4_cache_fns, . - v4_cache_fns 146 .size v4_cache_fns, . - v4_cache_fns
diff --git a/arch/arm/mm/cache-v4wb.S b/arch/arm/mm/cache-v4wb.S
index 3dbedf1ec0e7..df8368afa102 100644
--- a/arch/arm/mm/cache-v4wb.S
+++ b/arch/arm/mm/cache-v4wb.S
@@ -173,7 +173,7 @@ ENTRY(v4wb_coherent_user_range)
173 * - start - virtual start address 173 * - start - virtual start address
174 * - end - virtual end address 174 * - end - virtual end address
175 */ 175 */
176ENTRY(v4wb_dma_inv_range) 176v4wb_dma_inv_range:
177 tst r0, #CACHE_DLINESIZE - 1 177 tst r0, #CACHE_DLINESIZE - 1
178 bic r0, r0, #CACHE_DLINESIZE - 1 178 bic r0, r0, #CACHE_DLINESIZE - 1
179 mcrne p15, 0, r0, c7, c10, 1 @ clean D entry 179 mcrne p15, 0, r0, c7, c10, 1 @ clean D entry
@@ -194,7 +194,7 @@ ENTRY(v4wb_dma_inv_range)
194 * - start - virtual start address 194 * - start - virtual start address
195 * - end - virtual end address 195 * - end - virtual end address
196 */ 196 */
197ENTRY(v4wb_dma_clean_range) 197v4wb_dma_clean_range:
198 bic r0, r0, #CACHE_DLINESIZE - 1 198 bic r0, r0, #CACHE_DLINESIZE - 1
1991: mcr p15, 0, r0, c7, c10, 1 @ clean D entry 1991: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
200 add r0, r0, #CACHE_DLINESIZE 200 add r0, r0, #CACHE_DLINESIZE
@@ -216,6 +216,30 @@ ENTRY(v4wb_dma_clean_range)
216 .globl v4wb_dma_flush_range 216 .globl v4wb_dma_flush_range
217 .set v4wb_dma_flush_range, v4wb_coherent_kern_range 217 .set v4wb_dma_flush_range, v4wb_coherent_kern_range
218 218
219/*
220 * dma_map_area(start, size, dir)
221 * - start - kernel virtual start address
222 * - size - size of region
223 * - dir - DMA direction
224 */
225ENTRY(v4wb_dma_map_area)
226 add r1, r1, r0
227 cmp r2, #DMA_TO_DEVICE
228 beq v4wb_dma_clean_range
229 bcs v4wb_dma_inv_range
230 b v4wb_dma_flush_range
231ENDPROC(v4wb_dma_map_area)
232
233/*
234 * dma_unmap_area(start, size, dir)
235 * - start - kernel virtual start address
236 * - size - size of region
237 * - dir - DMA direction
238 */
239ENTRY(v4wb_dma_unmap_area)
240 mov pc, lr
241ENDPROC(v4wb_dma_unmap_area)
242
219 __INITDATA 243 __INITDATA
220 244
221 .type v4wb_cache_fns, #object 245 .type v4wb_cache_fns, #object
@@ -226,7 +250,7 @@ ENTRY(v4wb_cache_fns)
226 .long v4wb_coherent_kern_range 250 .long v4wb_coherent_kern_range
227 .long v4wb_coherent_user_range 251 .long v4wb_coherent_user_range
228 .long v4wb_flush_kern_dcache_area 252 .long v4wb_flush_kern_dcache_area
229 .long v4wb_dma_inv_range 253 .long v4wb_dma_map_area
230 .long v4wb_dma_clean_range 254 .long v4wb_dma_unmap_area
231 .long v4wb_dma_flush_range 255 .long v4wb_dma_flush_range
232 .size v4wb_cache_fns, . - v4wb_cache_fns 256 .size v4wb_cache_fns, . - v4wb_cache_fns
diff --git a/arch/arm/mm/cache-v4wt.S b/arch/arm/mm/cache-v4wt.S
index b3b7410270b4..45c70312f43b 100644
--- a/arch/arm/mm/cache-v4wt.S
+++ b/arch/arm/mm/cache-v4wt.S
@@ -142,23 +142,12 @@ ENTRY(v4wt_flush_kern_dcache_area)
142 * - start - virtual start address 142 * - start - virtual start address
143 * - end - virtual end address 143 * - end - virtual end address
144 */ 144 */
145ENTRY(v4wt_dma_inv_range) 145v4wt_dma_inv_range:
146 bic r0, r0, #CACHE_DLINESIZE - 1 146 bic r0, r0, #CACHE_DLINESIZE - 1
1471: mcr p15, 0, r0, c7, c6, 1 @ invalidate D entry 1471: mcr p15, 0, r0, c7, c6, 1 @ invalidate D entry
148 add r0, r0, #CACHE_DLINESIZE 148 add r0, r0, #CACHE_DLINESIZE
149 cmp r0, r1 149 cmp r0, r1
150 blo 1b 150 blo 1b
151 /* FALLTHROUGH */
152
153/*
154 * dma_clean_range(start, end)
155 *
156 * Clean the specified virtual address range.
157 *
158 * - start - virtual start address
159 * - end - virtual end address
160 */
161ENTRY(v4wt_dma_clean_range)
162 mov pc, lr 151 mov pc, lr
163 152
164/* 153/*
@@ -172,6 +161,29 @@ ENTRY(v4wt_dma_clean_range)
172 .globl v4wt_dma_flush_range 161 .globl v4wt_dma_flush_range
173 .equ v4wt_dma_flush_range, v4wt_dma_inv_range 162 .equ v4wt_dma_flush_range, v4wt_dma_inv_range
174 163
164/*
165 * dma_unmap_area(start, size, dir)
166 * - start - kernel virtual start address
167 * - size - size of region
168 * - dir - DMA direction
169 */
170ENTRY(v4wt_dma_unmap_area)
171 add r1, r1, r0
172 teq r2, #DMA_TO_DEVICE
173 bne v4wt_dma_inv_range
174 /* FALLTHROUGH */
175
176/*
177 * dma_map_area(start, size, dir)
178 * - start - kernel virtual start address
179 * - size - size of region
180 * - dir - DMA direction
181 */
182ENTRY(v4wt_dma_map_area)
183 mov pc, lr
184ENDPROC(v4wt_dma_unmap_area)
185ENDPROC(v4wt_dma_map_area)
186
175 __INITDATA 187 __INITDATA
176 188
177 .type v4wt_cache_fns, #object 189 .type v4wt_cache_fns, #object
@@ -182,7 +194,7 @@ ENTRY(v4wt_cache_fns)
182 .long v4wt_coherent_kern_range 194 .long v4wt_coherent_kern_range
183 .long v4wt_coherent_user_range 195 .long v4wt_coherent_user_range
184 .long v4wt_flush_kern_dcache_area 196 .long v4wt_flush_kern_dcache_area
185 .long v4wt_dma_inv_range 197 .long v4wt_dma_map_area
186 .long v4wt_dma_clean_range 198 .long v4wt_dma_unmap_area
187 .long v4wt_dma_flush_range 199 .long v4wt_dma_flush_range
188 .size v4wt_cache_fns, . - v4wt_cache_fns 200 .size v4wt_cache_fns, . - v4wt_cache_fns
diff --git a/arch/arm/mm/cache-v6.S b/arch/arm/mm/cache-v6.S
index 4ba0a24ce6f5..9d89c67a1cc3 100644
--- a/arch/arm/mm/cache-v6.S
+++ b/arch/arm/mm/cache-v6.S
@@ -195,7 +195,7 @@ ENTRY(v6_flush_kern_dcache_area)
195 * - start - virtual start address of region 195 * - start - virtual start address of region
196 * - end - virtual end address of region 196 * - end - virtual end address of region
197 */ 197 */
198ENTRY(v6_dma_inv_range) 198v6_dma_inv_range:
199 tst r0, #D_CACHE_LINE_SIZE - 1 199 tst r0, #D_CACHE_LINE_SIZE - 1
200 bic r0, r0, #D_CACHE_LINE_SIZE - 1 200 bic r0, r0, #D_CACHE_LINE_SIZE - 1
201#ifdef HARVARD_CACHE 201#ifdef HARVARD_CACHE
@@ -228,7 +228,7 @@ ENTRY(v6_dma_inv_range)
228 * - start - virtual start address of region 228 * - start - virtual start address of region
229 * - end - virtual end address of region 229 * - end - virtual end address of region
230 */ 230 */
231ENTRY(v6_dma_clean_range) 231v6_dma_clean_range:
232 bic r0, r0, #D_CACHE_LINE_SIZE - 1 232 bic r0, r0, #D_CACHE_LINE_SIZE - 1
2331: 2331:
234#ifdef HARVARD_CACHE 234#ifdef HARVARD_CACHE
@@ -263,6 +263,32 @@ ENTRY(v6_dma_flush_range)
263 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer 263 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer
264 mov pc, lr 264 mov pc, lr
265 265
266/*
267 * dma_map_area(start, size, dir)
268 * - start - kernel virtual start address
269 * - size - size of region
270 * - dir - DMA direction
271 */
272ENTRY(v6_dma_map_area)
273 add r1, r1, r0
274 teq r2, #DMA_FROM_DEVICE
275 beq v6_dma_inv_range
276 b v6_dma_clean_range
277ENDPROC(v6_dma_map_area)
278
279/*
280 * dma_unmap_area(start, size, dir)
281 * - start - kernel virtual start address
282 * - size - size of region
283 * - dir - DMA direction
284 */
285ENTRY(v6_dma_unmap_area)
286 add r1, r1, r0
287 teq r2, #DMA_TO_DEVICE
288 bne v6_dma_inv_range
289 mov pc, lr
290ENDPROC(v6_dma_unmap_area)
291
266 __INITDATA 292 __INITDATA
267 293
268 .type v6_cache_fns, #object 294 .type v6_cache_fns, #object
@@ -273,7 +299,7 @@ ENTRY(v6_cache_fns)
273 .long v6_coherent_kern_range 299 .long v6_coherent_kern_range
274 .long v6_coherent_user_range 300 .long v6_coherent_user_range
275 .long v6_flush_kern_dcache_area 301 .long v6_flush_kern_dcache_area
276 .long v6_dma_inv_range 302 .long v6_dma_map_area
277 .long v6_dma_clean_range 303 .long v6_dma_unmap_area
278 .long v6_dma_flush_range 304 .long v6_dma_flush_range
279 .size v6_cache_fns, . - v6_cache_fns 305 .size v6_cache_fns, . - v6_cache_fns
diff --git a/arch/arm/mm/cache-v7.S b/arch/arm/mm/cache-v7.S
index 9073db849fb4..bcd64f265870 100644
--- a/arch/arm/mm/cache-v7.S
+++ b/arch/arm/mm/cache-v7.S
@@ -216,7 +216,7 @@ ENDPROC(v7_flush_kern_dcache_area)
216 * - start - virtual start address of region 216 * - start - virtual start address of region
217 * - end - virtual end address of region 217 * - end - virtual end address of region
218 */ 218 */
219ENTRY(v7_dma_inv_range) 219v7_dma_inv_range:
220 dcache_line_size r2, r3 220 dcache_line_size r2, r3
221 sub r3, r2, #1 221 sub r3, r2, #1
222 tst r0, r3 222 tst r0, r3
@@ -240,7 +240,7 @@ ENDPROC(v7_dma_inv_range)
240 * - start - virtual start address of region 240 * - start - virtual start address of region
241 * - end - virtual end address of region 241 * - end - virtual end address of region
242 */ 242 */
243ENTRY(v7_dma_clean_range) 243v7_dma_clean_range:
244 dcache_line_size r2, r3 244 dcache_line_size r2, r3
245 sub r3, r2, #1 245 sub r3, r2, #1
246 bic r0, r0, r3 246 bic r0, r0, r3
@@ -271,6 +271,32 @@ ENTRY(v7_dma_flush_range)
271 mov pc, lr 271 mov pc, lr
272ENDPROC(v7_dma_flush_range) 272ENDPROC(v7_dma_flush_range)
273 273
274/*
275 * dma_map_area(start, size, dir)
276 * - start - kernel virtual start address
277 * - size - size of region
278 * - dir - DMA direction
279 */
280ENTRY(v7_dma_map_area)
281 add r1, r1, r0
282 teq r2, #DMA_FROM_DEVICE
283 beq v7_dma_inv_range
284 b v7_dma_clean_range
285ENDPROC(v7_dma_map_area)
286
287/*
288 * dma_unmap_area(start, size, dir)
289 * - start - kernel virtual start address
290 * - size - size of region
291 * - dir - DMA direction
292 */
293ENTRY(v7_dma_unmap_area)
294 add r1, r1, r0
295 teq r2, #DMA_TO_DEVICE
296 bne v7_dma_inv_range
297 mov pc, lr
298ENDPROC(v7_dma_unmap_area)
299
274 __INITDATA 300 __INITDATA
275 301
276 .type v7_cache_fns, #object 302 .type v7_cache_fns, #object
@@ -281,7 +307,7 @@ ENTRY(v7_cache_fns)
281 .long v7_coherent_kern_range 307 .long v7_coherent_kern_range
282 .long v7_coherent_user_range 308 .long v7_coherent_user_range
283 .long v7_flush_kern_dcache_area 309 .long v7_flush_kern_dcache_area
284 .long v7_dma_inv_range 310 .long v7_dma_map_area
285 .long v7_dma_clean_range 311 .long v7_dma_unmap_area
286 .long v7_dma_flush_range 312 .long v7_dma_flush_range
287 .size v7_cache_fns, . - v7_cache_fns 313 .size v7_cache_fns, . - v7_cache_fns
diff --git a/arch/arm/mm/context.c b/arch/arm/mm/context.c
index a9e22e31eaa1..b0ee9ba3cfab 100644
--- a/arch/arm/mm/context.c
+++ b/arch/arm/mm/context.c
@@ -10,12 +10,17 @@
10#include <linux/init.h> 10#include <linux/init.h>
11#include <linux/sched.h> 11#include <linux/sched.h>
12#include <linux/mm.h> 12#include <linux/mm.h>
13#include <linux/smp.h>
14#include <linux/percpu.h>
13 15
14#include <asm/mmu_context.h> 16#include <asm/mmu_context.h>
15#include <asm/tlbflush.h> 17#include <asm/tlbflush.h>
16 18
17static DEFINE_SPINLOCK(cpu_asid_lock); 19static DEFINE_SPINLOCK(cpu_asid_lock);
18unsigned int cpu_last_asid = ASID_FIRST_VERSION; 20unsigned int cpu_last_asid = ASID_FIRST_VERSION;
21#ifdef CONFIG_SMP
22DEFINE_PER_CPU(struct mm_struct *, current_mm);
23#endif
19 24
20/* 25/*
21 * We fork()ed a process, and we need a new context for the child 26 * We fork()ed a process, and we need a new context for the child
@@ -26,13 +31,109 @@ unsigned int cpu_last_asid = ASID_FIRST_VERSION;
26void __init_new_context(struct task_struct *tsk, struct mm_struct *mm) 31void __init_new_context(struct task_struct *tsk, struct mm_struct *mm)
27{ 32{
28 mm->context.id = 0; 33 mm->context.id = 0;
34 spin_lock_init(&mm->context.id_lock);
29} 35}
30 36
37static void flush_context(void)
38{
39 /* set the reserved ASID before flushing the TLB */
40 asm("mcr p15, 0, %0, c13, c0, 1\n" : : "r" (0));
41 isb();
42 local_flush_tlb_all();
43 if (icache_is_vivt_asid_tagged()) {
44 __flush_icache_all();
45 dsb();
46 }
47}
48
49#ifdef CONFIG_SMP
50
51static void set_mm_context(struct mm_struct *mm, unsigned int asid)
52{
53 unsigned long flags;
54
55 /*
56 * Locking needed for multi-threaded applications where the
57 * same mm->context.id could be set from different CPUs during
58 * the broadcast. This function is also called via IPI so the
59 * mm->context.id_lock has to be IRQ-safe.
60 */
61 spin_lock_irqsave(&mm->context.id_lock, flags);
62 if (likely((mm->context.id ^ cpu_last_asid) >> ASID_BITS)) {
63 /*
64 * Old version of ASID found. Set the new one and
65 * reset mm_cpumask(mm).
66 */
67 mm->context.id = asid;
68 cpumask_clear(mm_cpumask(mm));
69 }
70 spin_unlock_irqrestore(&mm->context.id_lock, flags);
71
72 /*
73 * Set the mm_cpumask(mm) bit for the current CPU.
74 */
75 cpumask_set_cpu(smp_processor_id(), mm_cpumask(mm));
76}
77
78/*
79 * Reset the ASID on the current CPU. This function call is broadcast
80 * from the CPU handling the ASID rollover and holding cpu_asid_lock.
81 */
82static void reset_context(void *info)
83{
84 unsigned int asid;
85 unsigned int cpu = smp_processor_id();
86 struct mm_struct *mm = per_cpu(current_mm, cpu);
87
88 /*
89 * Check if a current_mm was set on this CPU as it might still
90 * be in the early booting stages and using the reserved ASID.
91 */
92 if (!mm)
93 return;
94
95 smp_rmb();
96 asid = cpu_last_asid + cpu + 1;
97
98 flush_context();
99 set_mm_context(mm, asid);
100
101 /* set the new ASID */
102 asm("mcr p15, 0, %0, c13, c0, 1\n" : : "r" (mm->context.id));
103 isb();
104}
105
106#else
107
108static inline void set_mm_context(struct mm_struct *mm, unsigned int asid)
109{
110 mm->context.id = asid;
111 cpumask_copy(mm_cpumask(mm), cpumask_of(smp_processor_id()));
112}
113
114#endif
115
31void __new_context(struct mm_struct *mm) 116void __new_context(struct mm_struct *mm)
32{ 117{
33 unsigned int asid; 118 unsigned int asid;
34 119
35 spin_lock(&cpu_asid_lock); 120 spin_lock(&cpu_asid_lock);
121#ifdef CONFIG_SMP
122 /*
123 * Check the ASID again, in case the change was broadcast from
124 * another CPU before we acquired the lock.
125 */
126 if (unlikely(((mm->context.id ^ cpu_last_asid) >> ASID_BITS) == 0)) {
127 cpumask_set_cpu(smp_processor_id(), mm_cpumask(mm));
128 spin_unlock(&cpu_asid_lock);
129 return;
130 }
131#endif
132 /*
133 * At this point, it is guaranteed that the current mm (with
134 * an old ASID) isn't active on any other CPU since the ASIDs
135 * are changed simultaneously via IPI.
136 */
36 asid = ++cpu_last_asid; 137 asid = ++cpu_last_asid;
37 if (asid == 0) 138 if (asid == 0)
38 asid = cpu_last_asid = ASID_FIRST_VERSION; 139 asid = cpu_last_asid = ASID_FIRST_VERSION;
@@ -42,20 +143,15 @@ void __new_context(struct mm_struct *mm)
42 * to start a new version and flush the TLB. 143 * to start a new version and flush the TLB.
43 */ 144 */
44 if (unlikely((asid & ~ASID_MASK) == 0)) { 145 if (unlikely((asid & ~ASID_MASK) == 0)) {
45 asid = ++cpu_last_asid; 146 asid = cpu_last_asid + smp_processor_id() + 1;
46 /* set the reserved ASID before flushing the TLB */ 147 flush_context();
47 asm("mcr p15, 0, %0, c13, c0, 1 @ set reserved context ID\n" 148#ifdef CONFIG_SMP
48 : 149 smp_wmb();
49 : "r" (0)); 150 smp_call_function(reset_context, NULL, 1);
50 isb(); 151#endif
51 flush_tlb_all(); 152 cpu_last_asid += NR_CPUS;
52 if (icache_is_vivt_asid_tagged()) {
53 __flush_icache_all();
54 dsb();
55 }
56 } 153 }
57 spin_unlock(&cpu_asid_lock);
58 154
59 cpumask_copy(mm_cpumask(mm), cpumask_of(smp_processor_id())); 155 set_mm_context(mm, asid);
60 mm->context.id = asid; 156 spin_unlock(&cpu_asid_lock);
61} 157}
diff --git a/arch/arm/mm/copypage-feroceon.c b/arch/arm/mm/copypage-feroceon.c
index 70997d5bee2d..5eb4fd93893d 100644
--- a/arch/arm/mm/copypage-feroceon.c
+++ b/arch/arm/mm/copypage-feroceon.c
@@ -68,12 +68,13 @@ feroceon_copy_user_page(void *kto, const void *kfrom)
68} 68}
69 69
70void feroceon_copy_user_highpage(struct page *to, struct page *from, 70void feroceon_copy_user_highpage(struct page *to, struct page *from,
71 unsigned long vaddr) 71 unsigned long vaddr, struct vm_area_struct *vma)
72{ 72{
73 void *kto, *kfrom; 73 void *kto, *kfrom;
74 74
75 kto = kmap_atomic(to, KM_USER0); 75 kto = kmap_atomic(to, KM_USER0);
76 kfrom = kmap_atomic(from, KM_USER1); 76 kfrom = kmap_atomic(from, KM_USER1);
77 flush_cache_page(vma, vaddr, page_to_pfn(from));
77 feroceon_copy_user_page(kto, kfrom); 78 feroceon_copy_user_page(kto, kfrom);
78 kunmap_atomic(kfrom, KM_USER1); 79 kunmap_atomic(kfrom, KM_USER1);
79 kunmap_atomic(kto, KM_USER0); 80 kunmap_atomic(kto, KM_USER0);
diff --git a/arch/arm/mm/copypage-v3.c b/arch/arm/mm/copypage-v3.c
index de9c06854ad7..f72303e1d804 100644
--- a/arch/arm/mm/copypage-v3.c
+++ b/arch/arm/mm/copypage-v3.c
@@ -38,7 +38,7 @@ v3_copy_user_page(void *kto, const void *kfrom)
38} 38}
39 39
40void v3_copy_user_highpage(struct page *to, struct page *from, 40void v3_copy_user_highpage(struct page *to, struct page *from,
41 unsigned long vaddr) 41 unsigned long vaddr, struct vm_area_struct *vma)
42{ 42{
43 void *kto, *kfrom; 43 void *kto, *kfrom;
44 44
diff --git a/arch/arm/mm/copypage-v4mc.c b/arch/arm/mm/copypage-v4mc.c
index 7370a7142b04..598c51ad5071 100644
--- a/arch/arm/mm/copypage-v4mc.c
+++ b/arch/arm/mm/copypage-v4mc.c
@@ -69,7 +69,7 @@ mc_copy_user_page(void *from, void *to)
69} 69}
70 70
71void v4_mc_copy_user_highpage(struct page *to, struct page *from, 71void v4_mc_copy_user_highpage(struct page *to, struct page *from,
72 unsigned long vaddr) 72 unsigned long vaddr, struct vm_area_struct *vma)
73{ 73{
74 void *kto = kmap_atomic(to, KM_USER1); 74 void *kto = kmap_atomic(to, KM_USER1);
75 75
diff --git a/arch/arm/mm/copypage-v4wb.c b/arch/arm/mm/copypage-v4wb.c
index 9ab098414227..7c2eb55cd4a9 100644
--- a/arch/arm/mm/copypage-v4wb.c
+++ b/arch/arm/mm/copypage-v4wb.c
@@ -48,12 +48,13 @@ v4wb_copy_user_page(void *kto, const void *kfrom)
48} 48}
49 49
50void v4wb_copy_user_highpage(struct page *to, struct page *from, 50void v4wb_copy_user_highpage(struct page *to, struct page *from,
51 unsigned long vaddr) 51 unsigned long vaddr, struct vm_area_struct *vma)
52{ 52{
53 void *kto, *kfrom; 53 void *kto, *kfrom;
54 54
55 kto = kmap_atomic(to, KM_USER0); 55 kto = kmap_atomic(to, KM_USER0);
56 kfrom = kmap_atomic(from, KM_USER1); 56 kfrom = kmap_atomic(from, KM_USER1);
57 flush_cache_page(vma, vaddr, page_to_pfn(from));
57 v4wb_copy_user_page(kto, kfrom); 58 v4wb_copy_user_page(kto, kfrom);
58 kunmap_atomic(kfrom, KM_USER1); 59 kunmap_atomic(kfrom, KM_USER1);
59 kunmap_atomic(kto, KM_USER0); 60 kunmap_atomic(kto, KM_USER0);
diff --git a/arch/arm/mm/copypage-v4wt.c b/arch/arm/mm/copypage-v4wt.c
index 300efafd6643..172e6a55458e 100644
--- a/arch/arm/mm/copypage-v4wt.c
+++ b/arch/arm/mm/copypage-v4wt.c
@@ -44,7 +44,7 @@ v4wt_copy_user_page(void *kto, const void *kfrom)
44} 44}
45 45
46void v4wt_copy_user_highpage(struct page *to, struct page *from, 46void v4wt_copy_user_highpage(struct page *to, struct page *from,
47 unsigned long vaddr) 47 unsigned long vaddr, struct vm_area_struct *vma)
48{ 48{
49 void *kto, *kfrom; 49 void *kto, *kfrom;
50 50
diff --git a/arch/arm/mm/copypage-v6.c b/arch/arm/mm/copypage-v6.c
index 0fa1319273de..8bca4dea6dfa 100644
--- a/arch/arm/mm/copypage-v6.c
+++ b/arch/arm/mm/copypage-v6.c
@@ -34,7 +34,7 @@ static DEFINE_SPINLOCK(v6_lock);
34 * attack the kernel's existing mapping of these pages. 34 * attack the kernel's existing mapping of these pages.
35 */ 35 */
36static void v6_copy_user_highpage_nonaliasing(struct page *to, 36static void v6_copy_user_highpage_nonaliasing(struct page *to,
37 struct page *from, unsigned long vaddr) 37 struct page *from, unsigned long vaddr, struct vm_area_struct *vma)
38{ 38{
39 void *kto, *kfrom; 39 void *kto, *kfrom;
40 40
@@ -81,7 +81,7 @@ static void discard_old_kernel_data(void *kto)
81 * Copy the page, taking account of the cache colour. 81 * Copy the page, taking account of the cache colour.
82 */ 82 */
83static void v6_copy_user_highpage_aliasing(struct page *to, 83static void v6_copy_user_highpage_aliasing(struct page *to,
84 struct page *from, unsigned long vaddr) 84 struct page *from, unsigned long vaddr, struct vm_area_struct *vma)
85{ 85{
86 unsigned int offset = CACHE_COLOUR(vaddr); 86 unsigned int offset = CACHE_COLOUR(vaddr);
87 unsigned long kfrom, kto; 87 unsigned long kfrom, kto;
diff --git a/arch/arm/mm/copypage-xsc3.c b/arch/arm/mm/copypage-xsc3.c
index bc4525f5ab23..747ad4140fc7 100644
--- a/arch/arm/mm/copypage-xsc3.c
+++ b/arch/arm/mm/copypage-xsc3.c
@@ -71,12 +71,13 @@ xsc3_mc_copy_user_page(void *kto, const void *kfrom)
71} 71}
72 72
73void xsc3_mc_copy_user_highpage(struct page *to, struct page *from, 73void xsc3_mc_copy_user_highpage(struct page *to, struct page *from,
74 unsigned long vaddr) 74 unsigned long vaddr, struct vm_area_struct *vma)
75{ 75{
76 void *kto, *kfrom; 76 void *kto, *kfrom;
77 77
78 kto = kmap_atomic(to, KM_USER0); 78 kto = kmap_atomic(to, KM_USER0);
79 kfrom = kmap_atomic(from, KM_USER1); 79 kfrom = kmap_atomic(from, KM_USER1);
80 flush_cache_page(vma, vaddr, page_to_pfn(from));
80 xsc3_mc_copy_user_page(kto, kfrom); 81 xsc3_mc_copy_user_page(kto, kfrom);
81 kunmap_atomic(kfrom, KM_USER1); 82 kunmap_atomic(kfrom, KM_USER1);
82 kunmap_atomic(kto, KM_USER0); 83 kunmap_atomic(kto, KM_USER0);
diff --git a/arch/arm/mm/copypage-xscale.c b/arch/arm/mm/copypage-xscale.c
index 76824d3e966a..9920c0ae2096 100644
--- a/arch/arm/mm/copypage-xscale.c
+++ b/arch/arm/mm/copypage-xscale.c
@@ -91,7 +91,7 @@ mc_copy_user_page(void *from, void *to)
91} 91}
92 92
93void xscale_mc_copy_user_highpage(struct page *to, struct page *from, 93void xscale_mc_copy_user_highpage(struct page *to, struct page *from,
94 unsigned long vaddr) 94 unsigned long vaddr, struct vm_area_struct *vma)
95{ 95{
96 void *kto = kmap_atomic(to, KM_USER1); 96 void *kto = kmap_atomic(to, KM_USER1);
97 97
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index 26325cb5d368..0da7eccf7749 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -29,9 +29,6 @@
29#error "CONSISTENT_DMA_SIZE must be multiple of 2MiB" 29#error "CONSISTENT_DMA_SIZE must be multiple of 2MiB"
30#endif 30#endif
31 31
32#define CONSISTENT_END (0xffe00000)
33#define CONSISTENT_BASE (CONSISTENT_END - CONSISTENT_DMA_SIZE)
34
35#define CONSISTENT_OFFSET(x) (((unsigned long)(x) - CONSISTENT_BASE) >> PAGE_SHIFT) 32#define CONSISTENT_OFFSET(x) (((unsigned long)(x) - CONSISTENT_BASE) >> PAGE_SHIFT)
36#define CONSISTENT_PTE_INDEX(x) (((unsigned long)(x) - CONSISTENT_BASE) >> PGDIR_SHIFT) 33#define CONSISTENT_PTE_INDEX(x) (((unsigned long)(x) - CONSISTENT_BASE) >> PGDIR_SHIFT)
37#define NUM_CONSISTENT_PTES (CONSISTENT_DMA_SIZE >> PGDIR_SHIFT) 34#define NUM_CONSISTENT_PTES (CONSISTENT_DMA_SIZE >> PGDIR_SHIFT)
@@ -404,78 +401,44 @@ EXPORT_SYMBOL(dma_free_coherent);
404 * platforms with CONFIG_DMABOUNCE. 401 * platforms with CONFIG_DMABOUNCE.
405 * Use the driver DMA support - see dma-mapping.h (dma_sync_*) 402 * Use the driver DMA support - see dma-mapping.h (dma_sync_*)
406 */ 403 */
407void dma_cache_maint(const void *start, size_t size, int direction) 404void ___dma_single_cpu_to_dev(const void *kaddr, size_t size,
405 enum dma_data_direction dir)
408{ 406{
409 void (*inner_op)(const void *, const void *); 407 unsigned long paddr;
410 void (*outer_op)(unsigned long, unsigned long); 408
411 409 BUG_ON(!virt_addr_valid(kaddr) || !virt_addr_valid(kaddr + size - 1));
412 BUG_ON(!virt_addr_valid(start) || !virt_addr_valid(start + size - 1));
413
414 switch (direction) {
415 case DMA_FROM_DEVICE: /* invalidate only */
416 inner_op = dmac_inv_range;
417 outer_op = outer_inv_range;
418 break;
419 case DMA_TO_DEVICE: /* writeback only */
420 inner_op = dmac_clean_range;
421 outer_op = outer_clean_range;
422 break;
423 case DMA_BIDIRECTIONAL: /* writeback and invalidate */
424 inner_op = dmac_flush_range;
425 outer_op = outer_flush_range;
426 break;
427 default:
428 BUG();
429 }
430 410
431 inner_op(start, start + size); 411 dmac_map_area(kaddr, size, dir);
432 outer_op(__pa(start), __pa(start) + size); 412
413 paddr = __pa(kaddr);
414 if (dir == DMA_FROM_DEVICE) {
415 outer_inv_range(paddr, paddr + size);
416 } else {
417 outer_clean_range(paddr, paddr + size);
418 }
419 /* FIXME: non-speculating: flush on bidirectional mappings? */
433} 420}
434EXPORT_SYMBOL(dma_cache_maint); 421EXPORT_SYMBOL(___dma_single_cpu_to_dev);
435 422
436static void dma_cache_maint_contiguous(struct page *page, unsigned long offset, 423void ___dma_single_dev_to_cpu(const void *kaddr, size_t size,
437 size_t size, int direction) 424 enum dma_data_direction dir)
438{ 425{
439 void *vaddr; 426 BUG_ON(!virt_addr_valid(kaddr) || !virt_addr_valid(kaddr + size - 1));
440 unsigned long paddr;
441 void (*inner_op)(const void *, const void *);
442 void (*outer_op)(unsigned long, unsigned long);
443
444 switch (direction) {
445 case DMA_FROM_DEVICE: /* invalidate only */
446 inner_op = dmac_inv_range;
447 outer_op = outer_inv_range;
448 break;
449 case DMA_TO_DEVICE: /* writeback only */
450 inner_op = dmac_clean_range;
451 outer_op = outer_clean_range;
452 break;
453 case DMA_BIDIRECTIONAL: /* writeback and invalidate */
454 inner_op = dmac_flush_range;
455 outer_op = outer_flush_range;
456 break;
457 default:
458 BUG();
459 }
460 427
461 if (!PageHighMem(page)) { 428 /* FIXME: non-speculating: not required */
462 vaddr = page_address(page) + offset; 429 /* don't bother invalidating if DMA to device */
463 inner_op(vaddr, vaddr + size); 430 if (dir != DMA_TO_DEVICE) {
464 } else { 431 unsigned long paddr = __pa(kaddr);
465 vaddr = kmap_high_get(page); 432 outer_inv_range(paddr, paddr + size);
466 if (vaddr) {
467 vaddr += offset;
468 inner_op(vaddr, vaddr + size);
469 kunmap_high(page);
470 }
471 } 433 }
472 434
473 paddr = page_to_phys(page) + offset; 435 dmac_unmap_area(kaddr, size, dir);
474 outer_op(paddr, paddr + size);
475} 436}
437EXPORT_SYMBOL(___dma_single_dev_to_cpu);
476 438
477void dma_cache_maint_page(struct page *page, unsigned long offset, 439static void dma_cache_maint_page(struct page *page, unsigned long offset,
478 size_t size, int dir) 440 size_t size, enum dma_data_direction dir,
441 void (*op)(const void *, size_t, int))
479{ 442{
480 /* 443 /*
481 * A single sg entry may refer to multiple physically contiguous 444 * A single sg entry may refer to multiple physically contiguous
@@ -486,20 +449,62 @@ void dma_cache_maint_page(struct page *page, unsigned long offset,
486 size_t left = size; 449 size_t left = size;
487 do { 450 do {
488 size_t len = left; 451 size_t len = left;
489 if (PageHighMem(page) && len + offset > PAGE_SIZE) { 452 void *vaddr;
490 if (offset >= PAGE_SIZE) { 453
491 page += offset / PAGE_SIZE; 454 if (PageHighMem(page)) {
492 offset %= PAGE_SIZE; 455 if (len + offset > PAGE_SIZE) {
456 if (offset >= PAGE_SIZE) {
457 page += offset / PAGE_SIZE;
458 offset %= PAGE_SIZE;
459 }
460 len = PAGE_SIZE - offset;
493 } 461 }
494 len = PAGE_SIZE - offset; 462 vaddr = kmap_high_get(page);
463 if (vaddr) {
464 vaddr += offset;
465 op(vaddr, len, dir);
466 kunmap_high(page);
467 }
468 } else {
469 vaddr = page_address(page) + offset;
470 op(vaddr, len, dir);
495 } 471 }
496 dma_cache_maint_contiguous(page, offset, len, dir);
497 offset = 0; 472 offset = 0;
498 page++; 473 page++;
499 left -= len; 474 left -= len;
500 } while (left); 475 } while (left);
501} 476}
502EXPORT_SYMBOL(dma_cache_maint_page); 477
478void ___dma_page_cpu_to_dev(struct page *page, unsigned long off,
479 size_t size, enum dma_data_direction dir)
480{
481 unsigned long paddr;
482
483 dma_cache_maint_page(page, off, size, dir, dmac_map_area);
484
485 paddr = page_to_phys(page) + off;
486 if (dir == DMA_FROM_DEVICE) {
487 outer_inv_range(paddr, paddr + size);
488 } else {
489 outer_clean_range(paddr, paddr + size);
490 }
491 /* FIXME: non-speculating: flush on bidirectional mappings? */
492}
493EXPORT_SYMBOL(___dma_page_cpu_to_dev);
494
495void ___dma_page_dev_to_cpu(struct page *page, unsigned long off,
496 size_t size, enum dma_data_direction dir)
497{
498 unsigned long paddr = page_to_phys(page) + off;
499
500 /* FIXME: non-speculating: not required */
501 /* don't bother invalidating if DMA to device */
502 if (dir != DMA_TO_DEVICE)
503 outer_inv_range(paddr, paddr + size);
504
505 dma_cache_maint_page(page, off, size, dir, dmac_unmap_area);
506}
507EXPORT_SYMBOL(___dma_page_dev_to_cpu);
503 508
504/** 509/**
505 * dma_map_sg - map a set of SG buffers for streaming mode DMA 510 * dma_map_sg - map a set of SG buffers for streaming mode DMA
@@ -573,8 +578,12 @@ void dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg,
573 int i; 578 int i;
574 579
575 for_each_sg(sg, s, nents, i) { 580 for_each_sg(sg, s, nents, i) {
576 dmabounce_sync_for_cpu(dev, sg_dma_address(s), 0, 581 if (!dmabounce_sync_for_cpu(dev, sg_dma_address(s), 0,
577 sg_dma_len(s), dir); 582 sg_dma_len(s), dir))
583 continue;
584
585 __dma_page_dev_to_cpu(sg_page(s), s->offset,
586 s->length, dir);
578 } 587 }
579} 588}
580EXPORT_SYMBOL(dma_sync_sg_for_cpu); 589EXPORT_SYMBOL(dma_sync_sg_for_cpu);
@@ -597,9 +606,8 @@ void dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg,
597 sg_dma_len(s), dir)) 606 sg_dma_len(s), dir))
598 continue; 607 continue;
599 608
600 if (!arch_is_coherent()) 609 __dma_page_cpu_to_dev(sg_page(s), s->offset,
601 dma_cache_maint_page(sg_page(s), s->offset, 610 s->length, dir);
602 s->length, dir);
603 } 611 }
604} 612}
605EXPORT_SYMBOL(dma_sync_sg_for_device); 613EXPORT_SYMBOL(dma_sync_sg_for_device);
diff --git a/arch/arm/mm/fault-armv.c b/arch/arm/mm/fault-armv.c
index 56ee15321b00..c9b97e9836a2 100644
--- a/arch/arm/mm/fault-armv.c
+++ b/arch/arm/mm/fault-armv.c
@@ -36,28 +36,12 @@ static unsigned long shared_pte_mask = L_PTE_MT_BUFFERABLE;
36 * Therefore those configurations which might call adjust_pte (those 36 * Therefore those configurations which might call adjust_pte (those
37 * without CONFIG_CPU_CACHE_VIPT) cannot support split page_table_lock. 37 * without CONFIG_CPU_CACHE_VIPT) cannot support split page_table_lock.
38 */ 38 */
39static int adjust_pte(struct vm_area_struct *vma, unsigned long address) 39static int do_adjust_pte(struct vm_area_struct *vma, unsigned long address,
40 unsigned long pfn, pte_t *ptep)
40{ 41{
41 pgd_t *pgd; 42 pte_t entry = *ptep;
42 pmd_t *pmd;
43 pte_t *pte, entry;
44 int ret; 43 int ret;
45 44
46 pgd = pgd_offset(vma->vm_mm, address);
47 if (pgd_none(*pgd))
48 goto no_pgd;
49 if (pgd_bad(*pgd))
50 goto bad_pgd;
51
52 pmd = pmd_offset(pgd, address);
53 if (pmd_none(*pmd))
54 goto no_pmd;
55 if (pmd_bad(*pmd))
56 goto bad_pmd;
57
58 pte = pte_offset_map(pmd, address);
59 entry = *pte;
60
61 /* 45 /*
62 * If this page is present, it's actually being shared. 46 * If this page is present, it's actually being shared.
63 */ 47 */
@@ -68,33 +52,55 @@ static int adjust_pte(struct vm_area_struct *vma, unsigned long address)
68 * fault (ie, is old), we can safely ignore any issues. 52 * fault (ie, is old), we can safely ignore any issues.
69 */ 53 */
70 if (ret && (pte_val(entry) & L_PTE_MT_MASK) != shared_pte_mask) { 54 if (ret && (pte_val(entry) & L_PTE_MT_MASK) != shared_pte_mask) {
71 unsigned long pfn = pte_pfn(entry);
72 flush_cache_page(vma, address, pfn); 55 flush_cache_page(vma, address, pfn);
73 outer_flush_range((pfn << PAGE_SHIFT), 56 outer_flush_range((pfn << PAGE_SHIFT),
74 (pfn << PAGE_SHIFT) + PAGE_SIZE); 57 (pfn << PAGE_SHIFT) + PAGE_SIZE);
75 pte_val(entry) &= ~L_PTE_MT_MASK; 58 pte_val(entry) &= ~L_PTE_MT_MASK;
76 pte_val(entry) |= shared_pte_mask; 59 pte_val(entry) |= shared_pte_mask;
77 set_pte_at(vma->vm_mm, address, pte, entry); 60 set_pte_at(vma->vm_mm, address, ptep, entry);
78 flush_tlb_page(vma, address); 61 flush_tlb_page(vma, address);
79 } 62 }
80 pte_unmap(pte); 63
81 return ret; 64 return ret;
65}
66
67static int adjust_pte(struct vm_area_struct *vma, unsigned long address,
68 unsigned long pfn)
69{
70 spinlock_t *ptl;
71 pgd_t *pgd;
72 pmd_t *pmd;
73 pte_t *pte;
74 int ret;
75
76 pgd = pgd_offset(vma->vm_mm, address);
77 if (pgd_none_or_clear_bad(pgd))
78 return 0;
79
80 pmd = pmd_offset(pgd, address);
81 if (pmd_none_or_clear_bad(pmd))
82 return 0;
82 83
83bad_pgd: 84 /*
84 pgd_ERROR(*pgd); 85 * This is called while another page table is mapped, so we
85 pgd_clear(pgd); 86 * must use the nested version. This also means we need to
86no_pgd: 87 * open-code the spin-locking.
87 return 0; 88 */
88 89 ptl = pte_lockptr(vma->vm_mm, pmd);
89bad_pmd: 90 pte = pte_offset_map_nested(pmd, address);
90 pmd_ERROR(*pmd); 91 spin_lock(ptl);
91 pmd_clear(pmd); 92
92no_pmd: 93 ret = do_adjust_pte(vma, address, pfn, pte);
93 return 0; 94
95 spin_unlock(ptl);
96 pte_unmap_nested(pte);
97
98 return ret;
94} 99}
95 100
96static void 101static void
97make_coherent(struct address_space *mapping, struct vm_area_struct *vma, unsigned long addr, unsigned long pfn) 102make_coherent(struct address_space *mapping, struct vm_area_struct *vma,
103 unsigned long addr, pte_t *ptep, unsigned long pfn)
98{ 104{
99 struct mm_struct *mm = vma->vm_mm; 105 struct mm_struct *mm = vma->vm_mm;
100 struct vm_area_struct *mpnt; 106 struct vm_area_struct *mpnt;
@@ -122,11 +128,11 @@ make_coherent(struct address_space *mapping, struct vm_area_struct *vma, unsigne
122 if (!(mpnt->vm_flags & VM_MAYSHARE)) 128 if (!(mpnt->vm_flags & VM_MAYSHARE))
123 continue; 129 continue;
124 offset = (pgoff - mpnt->vm_pgoff) << PAGE_SHIFT; 130 offset = (pgoff - mpnt->vm_pgoff) << PAGE_SHIFT;
125 aliases += adjust_pte(mpnt, mpnt->vm_start + offset); 131 aliases += adjust_pte(mpnt, mpnt->vm_start + offset, pfn);
126 } 132 }
127 flush_dcache_mmap_unlock(mapping); 133 flush_dcache_mmap_unlock(mapping);
128 if (aliases) 134 if (aliases)
129 adjust_pte(vma, addr); 135 do_adjust_pte(vma, addr, pfn, ptep);
130 else 136 else
131 flush_cache_page(vma, addr, pfn); 137 flush_cache_page(vma, addr, pfn);
132} 138}
@@ -144,9 +150,10 @@ make_coherent(struct address_space *mapping, struct vm_area_struct *vma, unsigne
144 * 150 *
145 * Note that the pte lock will be held. 151 * Note that the pte lock will be held.
146 */ 152 */
147void update_mmu_cache(struct vm_area_struct *vma, unsigned long addr, pte_t pte) 153void update_mmu_cache(struct vm_area_struct *vma, unsigned long addr,
154 pte_t *ptep)
148{ 155{
149 unsigned long pfn = pte_pfn(pte); 156 unsigned long pfn = pte_pfn(*ptep);
150 struct address_space *mapping; 157 struct address_space *mapping;
151 struct page *page; 158 struct page *page;
152 159
@@ -168,7 +175,7 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long addr, pte_t pte)
168#endif 175#endif
169 if (mapping) { 176 if (mapping) {
170 if (cache_is_vivt()) 177 if (cache_is_vivt())
171 make_coherent(mapping, vma, addr, pfn); 178 make_coherent(mapping, vma, addr, ptep, pfn);
172 else if (vma->vm_flags & VM_EXEC) 179 else if (vma->vm_flags & VM_EXEC)
173 __flush_icache_all(); 180 __flush_icache_all();
174 } 181 }
diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c
index 10e06801afb3..9d40c341e07e 100644
--- a/arch/arm/mm/fault.c
+++ b/arch/arm/mm/fault.c
@@ -18,6 +18,7 @@
18#include <linux/page-flags.h> 18#include <linux/page-flags.h>
19#include <linux/sched.h> 19#include <linux/sched.h>
20#include <linux/highmem.h> 20#include <linux/highmem.h>
21#include <linux/perf_event.h>
21 22
22#include <asm/system.h> 23#include <asm/system.h>
23#include <asm/pgtable.h> 24#include <asm/pgtable.h>
@@ -302,6 +303,12 @@ do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
302 fault = __do_page_fault(mm, addr, fsr, tsk); 303 fault = __do_page_fault(mm, addr, fsr, tsk);
303 up_read(&mm->mmap_sem); 304 up_read(&mm->mmap_sem);
304 305
306 perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, 0, regs, addr);
307 if (fault & VM_FAULT_MAJOR)
308 perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1, 0, regs, addr);
309 else if (fault & VM_FAULT_MINOR)
310 perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1, 0, regs, addr);
311
305 /* 312 /*
306 * Handle the "normal" case first - VM_FAULT_MAJOR / VM_FAULT_MINOR 313 * Handle the "normal" case first - VM_FAULT_MAJOR / VM_FAULT_MINOR
307 */ 314 */
diff --git a/arch/arm/mm/flush.c b/arch/arm/mm/flush.c
index 6f3a4b7a3b82..e34f095e2090 100644
--- a/arch/arm/mm/flush.c
+++ b/arch/arm/mm/flush.c
@@ -13,6 +13,7 @@
13 13
14#include <asm/cacheflush.h> 14#include <asm/cacheflush.h>
15#include <asm/cachetype.h> 15#include <asm/cachetype.h>
16#include <asm/smp_plat.h>
16#include <asm/system.h> 17#include <asm/system.h>
17#include <asm/tlbflush.h> 18#include <asm/tlbflush.h>
18 19
@@ -87,13 +88,26 @@ void flush_cache_page(struct vm_area_struct *vma, unsigned long user_addr, unsig
87 if (vma->vm_flags & VM_EXEC && icache_is_vivt_asid_tagged()) 88 if (vma->vm_flags & VM_EXEC && icache_is_vivt_asid_tagged())
88 __flush_icache_all(); 89 __flush_icache_all();
89} 90}
91#else
92#define flush_pfn_alias(pfn,vaddr) do { } while (0)
93#endif
90 94
95#ifdef CONFIG_SMP
96static void flush_ptrace_access_other(void *args)
97{
98 __flush_icache_all();
99}
100#endif
101
102static
91void flush_ptrace_access(struct vm_area_struct *vma, struct page *page, 103void flush_ptrace_access(struct vm_area_struct *vma, struct page *page,
92 unsigned long uaddr, void *kaddr, 104 unsigned long uaddr, void *kaddr, unsigned long len)
93 unsigned long len, int write)
94{ 105{
95 if (cache_is_vivt()) { 106 if (cache_is_vivt()) {
96 vivt_flush_ptrace_access(vma, page, uaddr, kaddr, len, write); 107 if (cpumask_test_cpu(smp_processor_id(), mm_cpumask(vma->vm_mm))) {
108 unsigned long addr = (unsigned long)kaddr;
109 __cpuc_coherent_kern_range(addr, addr + len);
110 }
97 return; 111 return;
98 } 112 }
99 113
@@ -104,16 +118,37 @@ void flush_ptrace_access(struct vm_area_struct *vma, struct page *page,
104 } 118 }
105 119
106 /* VIPT non-aliasing cache */ 120 /* VIPT non-aliasing cache */
107 if (cpumask_test_cpu(smp_processor_id(), mm_cpumask(vma->vm_mm)) && 121 if (vma->vm_flags & VM_EXEC) {
108 vma->vm_flags & VM_EXEC) {
109 unsigned long addr = (unsigned long)kaddr; 122 unsigned long addr = (unsigned long)kaddr;
110 /* only flushing the kernel mapping on non-aliasing VIPT */
111 __cpuc_coherent_kern_range(addr, addr + len); 123 __cpuc_coherent_kern_range(addr, addr + len);
124#ifdef CONFIG_SMP
125 if (cache_ops_need_broadcast())
126 smp_call_function(flush_ptrace_access_other,
127 NULL, 1);
128#endif
112 } 129 }
113} 130}
114#else 131
115#define flush_pfn_alias(pfn,vaddr) do { } while (0) 132/*
133 * Copy user data from/to a page which is mapped into a different
134 * processes address space. Really, we want to allow our "user
135 * space" model to handle this.
136 *
137 * Note that this code needs to run on the current CPU.
138 */
139void copy_to_user_page(struct vm_area_struct *vma, struct page *page,
140 unsigned long uaddr, void *dst, const void *src,
141 unsigned long len)
142{
143#ifdef CONFIG_SMP
144 preempt_disable();
116#endif 145#endif
146 memcpy(dst, src, len);
147 flush_ptrace_access(vma, page, uaddr, dst, len);
148#ifdef CONFIG_SMP
149 preempt_enable();
150#endif
151}
117 152
118void __flush_dcache_page(struct address_space *mapping, struct page *page) 153void __flush_dcache_page(struct address_space *mapping, struct page *page)
119{ 154{
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index a04ffbbbe253..7829cb5425f5 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -23,6 +23,7 @@
23#include <asm/setup.h> 23#include <asm/setup.h>
24#include <asm/sizes.h> 24#include <asm/sizes.h>
25#include <asm/tlb.h> 25#include <asm/tlb.h>
26#include <asm/fixmap.h>
26 27
27#include <asm/mach/arch.h> 28#include <asm/mach/arch.h>
28#include <asm/mach/map.h> 29#include <asm/mach/map.h>
@@ -32,19 +33,21 @@
32static unsigned long phys_initrd_start __initdata = 0; 33static unsigned long phys_initrd_start __initdata = 0;
33static unsigned long phys_initrd_size __initdata = 0; 34static unsigned long phys_initrd_size __initdata = 0;
34 35
35static void __init early_initrd(char **p) 36static int __init early_initrd(char *p)
36{ 37{
37 unsigned long start, size; 38 unsigned long start, size;
39 char *endp;
38 40
39 start = memparse(*p, p); 41 start = memparse(p, &endp);
40 if (**p == ',') { 42 if (*endp == ',') {
41 size = memparse((*p) + 1, p); 43 size = memparse(endp + 1, NULL);
42 44
43 phys_initrd_start = start; 45 phys_initrd_start = start;
44 phys_initrd_size = size; 46 phys_initrd_size = size;
45 } 47 }
48 return 0;
46} 49}
47__early_param("initrd=", early_initrd); 50early_param("initrd", early_initrd);
48 51
49static int __init parse_tag_initrd(const struct tag *tag) 52static int __init parse_tag_initrd(const struct tag *tag)
50{ 53{
@@ -560,7 +563,7 @@ static void __init free_unused_memmap_node(int node, struct meminfo *mi)
560 */ 563 */
561void __init mem_init(void) 564void __init mem_init(void)
562{ 565{
563 unsigned int codesize, datasize, initsize; 566 unsigned long reserved_pages, free_pages;
564 int i, node; 567 int i, node;
565 568
566#ifndef CONFIG_DISCONTIGMEM 569#ifndef CONFIG_DISCONTIGMEM
@@ -596,6 +599,33 @@ void __init mem_init(void)
596 totalram_pages += totalhigh_pages; 599 totalram_pages += totalhigh_pages;
597#endif 600#endif
598 601
602 reserved_pages = free_pages = 0;
603
604 for_each_online_node(node) {
605 pg_data_t *n = NODE_DATA(node);
606 struct page *map = pgdat_page_nr(n, 0) - n->node_start_pfn;
607
608 for_each_nodebank(i, &meminfo, node) {
609 struct membank *bank = &meminfo.bank[i];
610 unsigned int pfn1, pfn2;
611 struct page *page, *end;
612
613 pfn1 = bank_pfn_start(bank);
614 pfn2 = bank_pfn_end(bank);
615
616 page = map + pfn1;
617 end = map + pfn2;
618
619 do {
620 if (PageReserved(page))
621 reserved_pages++;
622 else if (!page_count(page))
623 free_pages++;
624 page++;
625 } while (page < end);
626 }
627 }
628
599 /* 629 /*
600 * Since our memory may not be contiguous, calculate the 630 * Since our memory may not be contiguous, calculate the
601 * real number of pages we have in this system 631 * real number of pages we have in this system
@@ -608,16 +638,71 @@ void __init mem_init(void)
608 } 638 }
609 printk(" = %luMB total\n", num_physpages >> (20 - PAGE_SHIFT)); 639 printk(" = %luMB total\n", num_physpages >> (20 - PAGE_SHIFT));
610 640
611 codesize = _etext - _text; 641 printk(KERN_NOTICE "Memory: %luk/%luk available, %luk reserved, %luK highmem\n",
612 datasize = _end - _data; 642 nr_free_pages() << (PAGE_SHIFT-10),
613 initsize = __init_end - __init_begin; 643 free_pages << (PAGE_SHIFT-10),
614 644 reserved_pages << (PAGE_SHIFT-10),
615 printk(KERN_NOTICE "Memory: %luKB available (%dK code, "
616 "%dK data, %dK init, %luK highmem)\n",
617 nr_free_pages() << (PAGE_SHIFT-10), codesize >> 10,
618 datasize >> 10, initsize >> 10,
619 totalhigh_pages << (PAGE_SHIFT-10)); 645 totalhigh_pages << (PAGE_SHIFT-10));
620 646
647#define MLK(b, t) b, t, ((t) - (b)) >> 10
648#define MLM(b, t) b, t, ((t) - (b)) >> 20
649#define MLK_ROUNDUP(b, t) b, t, DIV_ROUND_UP(((t) - (b)), SZ_1K)
650
651 printk(KERN_NOTICE "Virtual kernel memory layout:\n"
652 " vector : 0x%08lx - 0x%08lx (%4ld kB)\n"
653 " fixmap : 0x%08lx - 0x%08lx (%4ld kB)\n"
654#ifdef CONFIG_MMU
655 " DMA : 0x%08lx - 0x%08lx (%4ld MB)\n"
656#endif
657 " vmalloc : 0x%08lx - 0x%08lx (%4ld MB)\n"
658 " lowmem : 0x%08lx - 0x%08lx (%4ld MB)\n"
659#ifdef CONFIG_HIGHMEM
660 " pkmap : 0x%08lx - 0x%08lx (%4ld MB)\n"
661#endif
662 " modules : 0x%08lx - 0x%08lx (%4ld MB)\n"
663 " .init : 0x%p" " - 0x%p" " (%4d kB)\n"
664 " .text : 0x%p" " - 0x%p" " (%4d kB)\n"
665 " .data : 0x%p" " - 0x%p" " (%4d kB)\n",
666
667 MLK(UL(CONFIG_VECTORS_BASE), UL(CONFIG_VECTORS_BASE) +
668 (PAGE_SIZE)),
669 MLK(FIXADDR_START, FIXADDR_TOP),
670#ifdef CONFIG_MMU
671 MLM(CONSISTENT_BASE, CONSISTENT_END),
672#endif
673 MLM(VMALLOC_START, VMALLOC_END),
674 MLM(PAGE_OFFSET, (unsigned long)high_memory),
675#ifdef CONFIG_HIGHMEM
676 MLM(PKMAP_BASE, (PKMAP_BASE) + (LAST_PKMAP) *
677 (PAGE_SIZE)),
678#endif
679 MLM(MODULES_VADDR, MODULES_END),
680
681 MLK_ROUNDUP(__init_begin, __init_end),
682 MLK_ROUNDUP(_text, _etext),
683 MLK_ROUNDUP(_data, _edata));
684
685#undef MLK
686#undef MLM
687#undef MLK_ROUNDUP
688
689 /*
690 * Check boundaries twice: Some fundamental inconsistencies can
691 * be detected at build time already.
692 */
693#ifdef CONFIG_MMU
694 BUILD_BUG_ON(VMALLOC_END > CONSISTENT_BASE);
695 BUG_ON(VMALLOC_END > CONSISTENT_BASE);
696
697 BUILD_BUG_ON(TASK_SIZE > MODULES_VADDR);
698 BUG_ON(TASK_SIZE > MODULES_VADDR);
699#endif
700
701#ifdef CONFIG_HIGHMEM
702 BUILD_BUG_ON(PKMAP_BASE + LAST_PKMAP * PAGE_SIZE > PAGE_OFFSET);
703 BUG_ON(PKMAP_BASE + LAST_PKMAP * PAGE_SIZE > PAGE_OFFSET);
704#endif
705
621 if (PAGE_SIZE >= 16384 && num_physpages <= 128) { 706 if (PAGE_SIZE >= 16384 && num_physpages <= 128) {
622 extern int sysctl_overcommit_memory; 707 extern int sysctl_overcommit_memory;
623 /* 708 /*
diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c
index 0ab75c60f7cf..28c8b950ef04 100644
--- a/arch/arm/mm/ioremap.c
+++ b/arch/arm/mm/ioremap.c
@@ -139,8 +139,8 @@ void __check_kvm_seq(struct mm_struct *mm)
139 * which requires the new ioremap'd region to be referenced, the CPU will 139 * which requires the new ioremap'd region to be referenced, the CPU will
140 * reference the _old_ region. 140 * reference the _old_ region.
141 * 141 *
142 * Note that get_vm_area() allocates a guard 4K page, so we need to mask 142 * Note that get_vm_area_caller() allocates a guard 4K page, so we need to
143 * the size back to 1MB aligned or we will overflow in the loop below. 143 * mask the size back to 1MB aligned or we will overflow in the loop below.
144 */ 144 */
145static void unmap_area_sections(unsigned long virt, unsigned long size) 145static void unmap_area_sections(unsigned long virt, unsigned long size)
146{ 146{
@@ -254,22 +254,8 @@ remap_area_supersections(unsigned long virt, unsigned long pfn,
254} 254}
255#endif 255#endif
256 256
257 257void __iomem * __arm_ioremap_pfn_caller(unsigned long pfn,
258/* 258 unsigned long offset, size_t size, unsigned int mtype, void *caller)
259 * Remap an arbitrary physical address space into the kernel virtual
260 * address space. Needed when the kernel wants to access high addresses
261 * directly.
262 *
263 * NOTE! We need to allow non-page-aligned mappings too: we will obviously
264 * have to convert them into an offset in a page-aligned mapping, but the
265 * caller shouldn't need to know that small detail.
266 *
267 * 'flags' are the extra L_PTE_ flags that you want to specify for this
268 * mapping. See <asm/pgtable.h> for more information.
269 */
270void __iomem *
271__arm_ioremap_pfn(unsigned long pfn, unsigned long offset, size_t size,
272 unsigned int mtype)
273{ 259{
274 const struct mem_type *type; 260 const struct mem_type *type;
275 int err; 261 int err;
@@ -291,7 +277,7 @@ __arm_ioremap_pfn(unsigned long pfn, unsigned long offset, size_t size,
291 */ 277 */
292 size = PAGE_ALIGN(offset + size); 278 size = PAGE_ALIGN(offset + size);
293 279
294 area = get_vm_area(size, VM_IOREMAP); 280 area = get_vm_area_caller(size, VM_IOREMAP, caller);
295 if (!area) 281 if (!area)
296 return NULL; 282 return NULL;
297 addr = (unsigned long)area->addr; 283 addr = (unsigned long)area->addr;
@@ -318,10 +304,9 @@ __arm_ioremap_pfn(unsigned long pfn, unsigned long offset, size_t size,
318 flush_cache_vmap(addr, addr + size); 304 flush_cache_vmap(addr, addr + size);
319 return (void __iomem *) (offset + addr); 305 return (void __iomem *) (offset + addr);
320} 306}
321EXPORT_SYMBOL(__arm_ioremap_pfn);
322 307
323void __iomem * 308void __iomem *__arm_ioremap_caller(unsigned long phys_addr, size_t size,
324__arm_ioremap(unsigned long phys_addr, size_t size, unsigned int mtype) 309 unsigned int mtype, void *caller)
325{ 310{
326 unsigned long last_addr; 311 unsigned long last_addr;
327 unsigned long offset = phys_addr & ~PAGE_MASK; 312 unsigned long offset = phys_addr & ~PAGE_MASK;
@@ -334,7 +319,33 @@ __arm_ioremap(unsigned long phys_addr, size_t size, unsigned int mtype)
334 if (!size || last_addr < phys_addr) 319 if (!size || last_addr < phys_addr)
335 return NULL; 320 return NULL;
336 321
337 return __arm_ioremap_pfn(pfn, offset, size, mtype); 322 return __arm_ioremap_pfn_caller(pfn, offset, size, mtype,
323 caller);
324}
325
326/*
327 * Remap an arbitrary physical address space into the kernel virtual
328 * address space. Needed when the kernel wants to access high addresses
329 * directly.
330 *
331 * NOTE! We need to allow non-page-aligned mappings too: we will obviously
332 * have to convert them into an offset in a page-aligned mapping, but the
333 * caller shouldn't need to know that small detail.
334 */
335void __iomem *
336__arm_ioremap_pfn(unsigned long pfn, unsigned long offset, size_t size,
337 unsigned int mtype)
338{
339 return __arm_ioremap_pfn_caller(pfn, offset, size, mtype,
340 __builtin_return_address(0));
341}
342EXPORT_SYMBOL(__arm_ioremap_pfn);
343
344void __iomem *
345__arm_ioremap(unsigned long phys_addr, size_t size, unsigned int mtype)
346{
347 return __arm_ioremap_caller(phys_addr, size, mtype,
348 __builtin_return_address(0));
338} 349}
339EXPORT_SYMBOL(__arm_ioremap); 350EXPORT_SYMBOL(__arm_ioremap);
340 351
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index 761ffede6a23..9d4da6ac28eb 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -100,18 +100,17 @@ static struct cachepolicy cache_policies[] __initdata = {
100 * writebuffer to be turned off. (Note: the write 100 * writebuffer to be turned off. (Note: the write
101 * buffer should not be on and the cache off). 101 * buffer should not be on and the cache off).
102 */ 102 */
103static void __init early_cachepolicy(char **p) 103static int __init early_cachepolicy(char *p)
104{ 104{
105 int i; 105 int i;
106 106
107 for (i = 0; i < ARRAY_SIZE(cache_policies); i++) { 107 for (i = 0; i < ARRAY_SIZE(cache_policies); i++) {
108 int len = strlen(cache_policies[i].policy); 108 int len = strlen(cache_policies[i].policy);
109 109
110 if (memcmp(*p, cache_policies[i].policy, len) == 0) { 110 if (memcmp(p, cache_policies[i].policy, len) == 0) {
111 cachepolicy = i; 111 cachepolicy = i;
112 cr_alignment &= ~cache_policies[i].cr_mask; 112 cr_alignment &= ~cache_policies[i].cr_mask;
113 cr_no_alignment &= ~cache_policies[i].cr_mask; 113 cr_no_alignment &= ~cache_policies[i].cr_mask;
114 *p += len;
115 break; 114 break;
116 } 115 }
117 } 116 }
@@ -130,36 +129,37 @@ static void __init early_cachepolicy(char **p)
130 } 129 }
131 flush_cache_all(); 130 flush_cache_all();
132 set_cr(cr_alignment); 131 set_cr(cr_alignment);
132 return 0;
133} 133}
134__early_param("cachepolicy=", early_cachepolicy); 134early_param("cachepolicy", early_cachepolicy);
135 135
136static void __init early_nocache(char **__unused) 136static int __init early_nocache(char *__unused)
137{ 137{
138 char *p = "buffered"; 138 char *p = "buffered";
139 printk(KERN_WARNING "nocache is deprecated; use cachepolicy=%s\n", p); 139 printk(KERN_WARNING "nocache is deprecated; use cachepolicy=%s\n", p);
140 early_cachepolicy(&p); 140 early_cachepolicy(p);
141 return 0;
141} 142}
142__early_param("nocache", early_nocache); 143early_param("nocache", early_nocache);
143 144
144static void __init early_nowrite(char **__unused) 145static int __init early_nowrite(char *__unused)
145{ 146{
146 char *p = "uncached"; 147 char *p = "uncached";
147 printk(KERN_WARNING "nowb is deprecated; use cachepolicy=%s\n", p); 148 printk(KERN_WARNING "nowb is deprecated; use cachepolicy=%s\n", p);
148 early_cachepolicy(&p); 149 early_cachepolicy(p);
150 return 0;
149} 151}
150__early_param("nowb", early_nowrite); 152early_param("nowb", early_nowrite);
151 153
152static void __init early_ecc(char **p) 154static int __init early_ecc(char *p)
153{ 155{
154 if (memcmp(*p, "on", 2) == 0) { 156 if (memcmp(p, "on", 2) == 0)
155 ecc_mask = PMD_PROTECTION; 157 ecc_mask = PMD_PROTECTION;
156 *p += 2; 158 else if (memcmp(p, "off", 3) == 0)
157 } else if (memcmp(*p, "off", 3) == 0) {
158 ecc_mask = 0; 159 ecc_mask = 0;
159 *p += 3; 160 return 0;
160 }
161} 161}
162__early_param("ecc=", early_ecc); 162early_param("ecc", early_ecc);
163 163
164static int __init noalign_setup(char *__unused) 164static int __init noalign_setup(char *__unused)
165{ 165{
@@ -670,9 +670,9 @@ static unsigned long __initdata vmalloc_reserve = SZ_128M;
670 * bytes. This can be used to increase (or decrease) the vmalloc 670 * bytes. This can be used to increase (or decrease) the vmalloc
671 * area - the default is 128m. 671 * area - the default is 128m.
672 */ 672 */
673static void __init early_vmalloc(char **arg) 673static int __init early_vmalloc(char *arg)
674{ 674{
675 vmalloc_reserve = memparse(*arg, arg); 675 vmalloc_reserve = memparse(arg, NULL);
676 676
677 if (vmalloc_reserve < SZ_16M) { 677 if (vmalloc_reserve < SZ_16M) {
678 vmalloc_reserve = SZ_16M; 678 vmalloc_reserve = SZ_16M;
@@ -687,8 +687,9 @@ static void __init early_vmalloc(char **arg)
687 "vmalloc area is too big, limiting to %luMB\n", 687 "vmalloc area is too big, limiting to %luMB\n",
688 vmalloc_reserve >> 20); 688 vmalloc_reserve >> 20);
689 } 689 }
690 return 0;
690} 691}
691__early_param("vmalloc=", early_vmalloc); 692early_param("vmalloc", early_vmalloc);
692 693
693#define VMALLOC_MIN (void *)(VMALLOC_END - vmalloc_reserve) 694#define VMALLOC_MIN (void *)(VMALLOC_END - vmalloc_reserve)
694 695
diff --git a/arch/arm/mm/nommu.c b/arch/arm/mm/nommu.c
index 374a8311bc84..9bfeb6b9509a 100644
--- a/arch/arm/mm/nommu.c
+++ b/arch/arm/mm/nommu.c
@@ -74,6 +74,12 @@ void __iomem *__arm_ioremap_pfn(unsigned long pfn, unsigned long offset,
74} 74}
75EXPORT_SYMBOL(__arm_ioremap_pfn); 75EXPORT_SYMBOL(__arm_ioremap_pfn);
76 76
77void __iomem *__arm_ioremap_pfn_caller(unsigned long pfn, unsigned long offset,
78 size_t size, unsigned int mtype, void *caller)
79{
80 return __arm_ioremap_pfn(pfn, offset, size, mtype);
81}
82
77void __iomem *__arm_ioremap(unsigned long phys_addr, size_t size, 83void __iomem *__arm_ioremap(unsigned long phys_addr, size_t size,
78 unsigned int mtype) 84 unsigned int mtype)
79{ 85{
@@ -81,6 +87,12 @@ void __iomem *__arm_ioremap(unsigned long phys_addr, size_t size,
81} 87}
82EXPORT_SYMBOL(__arm_ioremap); 88EXPORT_SYMBOL(__arm_ioremap);
83 89
90void __iomem *__arm_ioremap(unsigned long phys_addr, size_t size,
91 unsigned int mtype, void *caller)
92{
93 return __arm_ioremap(phys_addr, size, mtype);
94}
95
84void __iounmap(volatile void __iomem *addr) 96void __iounmap(volatile void __iomem *addr)
85{ 97{
86} 98}
diff --git a/arch/arm/mm/proc-arm1020.S b/arch/arm/mm/proc-arm1020.S
index 8012e24282b2..72507c630ceb 100644
--- a/arch/arm/mm/proc-arm1020.S
+++ b/arch/arm/mm/proc-arm1020.S
@@ -265,7 +265,7 @@ ENTRY(arm1020_flush_kern_dcache_area)
265 * 265 *
266 * (same as v4wb) 266 * (same as v4wb)
267 */ 267 */
268ENTRY(arm1020_dma_inv_range) 268arm1020_dma_inv_range:
269 mov ip, #0 269 mov ip, #0
270#ifndef CONFIG_CPU_DCACHE_DISABLE 270#ifndef CONFIG_CPU_DCACHE_DISABLE
271 tst r0, #CACHE_DLINESIZE - 1 271 tst r0, #CACHE_DLINESIZE - 1
@@ -295,7 +295,7 @@ ENTRY(arm1020_dma_inv_range)
295 * 295 *
296 * (same as v4wb) 296 * (same as v4wb)
297 */ 297 */
298ENTRY(arm1020_dma_clean_range) 298arm1020_dma_clean_range:
299 mov ip, #0 299 mov ip, #0
300#ifndef CONFIG_CPU_DCACHE_DISABLE 300#ifndef CONFIG_CPU_DCACHE_DISABLE
301 bic r0, r0, #CACHE_DLINESIZE - 1 301 bic r0, r0, #CACHE_DLINESIZE - 1
@@ -330,6 +330,30 @@ ENTRY(arm1020_dma_flush_range)
330 mcr p15, 0, ip, c7, c10, 4 @ drain WB 330 mcr p15, 0, ip, c7, c10, 4 @ drain WB
331 mov pc, lr 331 mov pc, lr
332 332
333/*
334 * dma_map_area(start, size, dir)
335 * - start - kernel virtual start address
336 * - size - size of region
337 * - dir - DMA direction
338 */
339ENTRY(arm1020_dma_map_area)
340 add r1, r1, r0
341 cmp r2, #DMA_TO_DEVICE
342 beq arm1020_dma_clean_range
343 bcs arm1020_dma_inv_range
344 b arm1020_dma_flush_range
345ENDPROC(arm1020_dma_map_area)
346
347/*
348 * dma_unmap_area(start, size, dir)
349 * - start - kernel virtual start address
350 * - size - size of region
351 * - dir - DMA direction
352 */
353ENTRY(arm1020_dma_unmap_area)
354 mov pc, lr
355ENDPROC(arm1020_dma_unmap_area)
356
333ENTRY(arm1020_cache_fns) 357ENTRY(arm1020_cache_fns)
334 .long arm1020_flush_kern_cache_all 358 .long arm1020_flush_kern_cache_all
335 .long arm1020_flush_user_cache_all 359 .long arm1020_flush_user_cache_all
@@ -337,8 +361,8 @@ ENTRY(arm1020_cache_fns)
337 .long arm1020_coherent_kern_range 361 .long arm1020_coherent_kern_range
338 .long arm1020_coherent_user_range 362 .long arm1020_coherent_user_range
339 .long arm1020_flush_kern_dcache_area 363 .long arm1020_flush_kern_dcache_area
340 .long arm1020_dma_inv_range 364 .long arm1020_dma_map_area
341 .long arm1020_dma_clean_range 365 .long arm1020_dma_unmap_area
342 .long arm1020_dma_flush_range 366 .long arm1020_dma_flush_range
343 367
344 .align 5 368 .align 5
diff --git a/arch/arm/mm/proc-arm1020e.S b/arch/arm/mm/proc-arm1020e.S
index 41fe25d234f5..d27829805609 100644
--- a/arch/arm/mm/proc-arm1020e.S
+++ b/arch/arm/mm/proc-arm1020e.S
@@ -258,7 +258,7 @@ ENTRY(arm1020e_flush_kern_dcache_area)
258 * 258 *
259 * (same as v4wb) 259 * (same as v4wb)
260 */ 260 */
261ENTRY(arm1020e_dma_inv_range) 261arm1020e_dma_inv_range:
262 mov ip, #0 262 mov ip, #0
263#ifndef CONFIG_CPU_DCACHE_DISABLE 263#ifndef CONFIG_CPU_DCACHE_DISABLE
264 tst r0, #CACHE_DLINESIZE - 1 264 tst r0, #CACHE_DLINESIZE - 1
@@ -284,7 +284,7 @@ ENTRY(arm1020e_dma_inv_range)
284 * 284 *
285 * (same as v4wb) 285 * (same as v4wb)
286 */ 286 */
287ENTRY(arm1020e_dma_clean_range) 287arm1020e_dma_clean_range:
288 mov ip, #0 288 mov ip, #0
289#ifndef CONFIG_CPU_DCACHE_DISABLE 289#ifndef CONFIG_CPU_DCACHE_DISABLE
290 bic r0, r0, #CACHE_DLINESIZE - 1 290 bic r0, r0, #CACHE_DLINESIZE - 1
@@ -316,6 +316,30 @@ ENTRY(arm1020e_dma_flush_range)
316 mcr p15, 0, ip, c7, c10, 4 @ drain WB 316 mcr p15, 0, ip, c7, c10, 4 @ drain WB
317 mov pc, lr 317 mov pc, lr
318 318
319/*
320 * dma_map_area(start, size, dir)
321 * - start - kernel virtual start address
322 * - size - size of region
323 * - dir - DMA direction
324 */
325ENTRY(arm1020e_dma_map_area)
326 add r1, r1, r0
327 cmp r2, #DMA_TO_DEVICE
328 beq arm1020e_dma_clean_range
329 bcs arm1020e_dma_inv_range
330 b arm1020e_dma_flush_range
331ENDPROC(arm1020e_dma_map_area)
332
333/*
334 * dma_unmap_area(start, size, dir)
335 * - start - kernel virtual start address
336 * - size - size of region
337 * - dir - DMA direction
338 */
339ENTRY(arm1020e_dma_unmap_area)
340 mov pc, lr
341ENDPROC(arm1020e_dma_unmap_area)
342
319ENTRY(arm1020e_cache_fns) 343ENTRY(arm1020e_cache_fns)
320 .long arm1020e_flush_kern_cache_all 344 .long arm1020e_flush_kern_cache_all
321 .long arm1020e_flush_user_cache_all 345 .long arm1020e_flush_user_cache_all
@@ -323,8 +347,8 @@ ENTRY(arm1020e_cache_fns)
323 .long arm1020e_coherent_kern_range 347 .long arm1020e_coherent_kern_range
324 .long arm1020e_coherent_user_range 348 .long arm1020e_coherent_user_range
325 .long arm1020e_flush_kern_dcache_area 349 .long arm1020e_flush_kern_dcache_area
326 .long arm1020e_dma_inv_range 350 .long arm1020e_dma_map_area
327 .long arm1020e_dma_clean_range 351 .long arm1020e_dma_unmap_area
328 .long arm1020e_dma_flush_range 352 .long arm1020e_dma_flush_range
329 353
330 .align 5 354 .align 5
diff --git a/arch/arm/mm/proc-arm1022.S b/arch/arm/mm/proc-arm1022.S
index 20a5b1b31a70..ce13e4a827de 100644
--- a/arch/arm/mm/proc-arm1022.S
+++ b/arch/arm/mm/proc-arm1022.S
@@ -247,7 +247,7 @@ ENTRY(arm1022_flush_kern_dcache_area)
247 * 247 *
248 * (same as v4wb) 248 * (same as v4wb)
249 */ 249 */
250ENTRY(arm1022_dma_inv_range) 250arm1022_dma_inv_range:
251 mov ip, #0 251 mov ip, #0
252#ifndef CONFIG_CPU_DCACHE_DISABLE 252#ifndef CONFIG_CPU_DCACHE_DISABLE
253 tst r0, #CACHE_DLINESIZE - 1 253 tst r0, #CACHE_DLINESIZE - 1
@@ -273,7 +273,7 @@ ENTRY(arm1022_dma_inv_range)
273 * 273 *
274 * (same as v4wb) 274 * (same as v4wb)
275 */ 275 */
276ENTRY(arm1022_dma_clean_range) 276arm1022_dma_clean_range:
277 mov ip, #0 277 mov ip, #0
278#ifndef CONFIG_CPU_DCACHE_DISABLE 278#ifndef CONFIG_CPU_DCACHE_DISABLE
279 bic r0, r0, #CACHE_DLINESIZE - 1 279 bic r0, r0, #CACHE_DLINESIZE - 1
@@ -305,6 +305,30 @@ ENTRY(arm1022_dma_flush_range)
305 mcr p15, 0, ip, c7, c10, 4 @ drain WB 305 mcr p15, 0, ip, c7, c10, 4 @ drain WB
306 mov pc, lr 306 mov pc, lr
307 307
308/*
309 * dma_map_area(start, size, dir)
310 * - start - kernel virtual start address
311 * - size - size of region
312 * - dir - DMA direction
313 */
314ENTRY(arm1022_dma_map_area)
315 add r1, r1, r0
316 cmp r2, #DMA_TO_DEVICE
317 beq arm1022_dma_clean_range
318 bcs arm1022_dma_inv_range
319 b arm1022_dma_flush_range
320ENDPROC(arm1022_dma_map_area)
321
322/*
323 * dma_unmap_area(start, size, dir)
324 * - start - kernel virtual start address
325 * - size - size of region
326 * - dir - DMA direction
327 */
328ENTRY(arm1022_dma_unmap_area)
329 mov pc, lr
330ENDPROC(arm1022_dma_unmap_area)
331
308ENTRY(arm1022_cache_fns) 332ENTRY(arm1022_cache_fns)
309 .long arm1022_flush_kern_cache_all 333 .long arm1022_flush_kern_cache_all
310 .long arm1022_flush_user_cache_all 334 .long arm1022_flush_user_cache_all
@@ -312,8 +336,8 @@ ENTRY(arm1022_cache_fns)
312 .long arm1022_coherent_kern_range 336 .long arm1022_coherent_kern_range
313 .long arm1022_coherent_user_range 337 .long arm1022_coherent_user_range
314 .long arm1022_flush_kern_dcache_area 338 .long arm1022_flush_kern_dcache_area
315 .long arm1022_dma_inv_range 339 .long arm1022_dma_map_area
316 .long arm1022_dma_clean_range 340 .long arm1022_dma_unmap_area
317 .long arm1022_dma_flush_range 341 .long arm1022_dma_flush_range
318 342
319 .align 5 343 .align 5
diff --git a/arch/arm/mm/proc-arm1026.S b/arch/arm/mm/proc-arm1026.S
index 96aedb10fcc4..636672a29c6d 100644
--- a/arch/arm/mm/proc-arm1026.S
+++ b/arch/arm/mm/proc-arm1026.S
@@ -241,7 +241,7 @@ ENTRY(arm1026_flush_kern_dcache_area)
241 * 241 *
242 * (same as v4wb) 242 * (same as v4wb)
243 */ 243 */
244ENTRY(arm1026_dma_inv_range) 244arm1026_dma_inv_range:
245 mov ip, #0 245 mov ip, #0
246#ifndef CONFIG_CPU_DCACHE_DISABLE 246#ifndef CONFIG_CPU_DCACHE_DISABLE
247 tst r0, #CACHE_DLINESIZE - 1 247 tst r0, #CACHE_DLINESIZE - 1
@@ -267,7 +267,7 @@ ENTRY(arm1026_dma_inv_range)
267 * 267 *
268 * (same as v4wb) 268 * (same as v4wb)
269 */ 269 */
270ENTRY(arm1026_dma_clean_range) 270arm1026_dma_clean_range:
271 mov ip, #0 271 mov ip, #0
272#ifndef CONFIG_CPU_DCACHE_DISABLE 272#ifndef CONFIG_CPU_DCACHE_DISABLE
273 bic r0, r0, #CACHE_DLINESIZE - 1 273 bic r0, r0, #CACHE_DLINESIZE - 1
@@ -299,6 +299,30 @@ ENTRY(arm1026_dma_flush_range)
299 mcr p15, 0, ip, c7, c10, 4 @ drain WB 299 mcr p15, 0, ip, c7, c10, 4 @ drain WB
300 mov pc, lr 300 mov pc, lr
301 301
302/*
303 * dma_map_area(start, size, dir)
304 * - start - kernel virtual start address
305 * - size - size of region
306 * - dir - DMA direction
307 */
308ENTRY(arm1026_dma_map_area)
309 add r1, r1, r0
310 cmp r2, #DMA_TO_DEVICE
311 beq arm1026_dma_clean_range
312 bcs arm1026_dma_inv_range
313 b arm1026_dma_flush_range
314ENDPROC(arm1026_dma_map_area)
315
316/*
317 * dma_unmap_area(start, size, dir)
318 * - start - kernel virtual start address
319 * - size - size of region
320 * - dir - DMA direction
321 */
322ENTRY(arm1026_dma_unmap_area)
323 mov pc, lr
324ENDPROC(arm1026_dma_unmap_area)
325
302ENTRY(arm1026_cache_fns) 326ENTRY(arm1026_cache_fns)
303 .long arm1026_flush_kern_cache_all 327 .long arm1026_flush_kern_cache_all
304 .long arm1026_flush_user_cache_all 328 .long arm1026_flush_user_cache_all
@@ -306,8 +330,8 @@ ENTRY(arm1026_cache_fns)
306 .long arm1026_coherent_kern_range 330 .long arm1026_coherent_kern_range
307 .long arm1026_coherent_user_range 331 .long arm1026_coherent_user_range
308 .long arm1026_flush_kern_dcache_area 332 .long arm1026_flush_kern_dcache_area
309 .long arm1026_dma_inv_range 333 .long arm1026_dma_map_area
310 .long arm1026_dma_clean_range 334 .long arm1026_dma_unmap_area
311 .long arm1026_dma_flush_range 335 .long arm1026_dma_flush_range
312 336
313 .align 5 337 .align 5
diff --git a/arch/arm/mm/proc-arm920.S b/arch/arm/mm/proc-arm920.S
index 471669e2d7cb..8be81992645d 100644
--- a/arch/arm/mm/proc-arm920.S
+++ b/arch/arm/mm/proc-arm920.S
@@ -239,7 +239,7 @@ ENTRY(arm920_flush_kern_dcache_area)
239 * 239 *
240 * (same as v4wb) 240 * (same as v4wb)
241 */ 241 */
242ENTRY(arm920_dma_inv_range) 242arm920_dma_inv_range:
243 tst r0, #CACHE_DLINESIZE - 1 243 tst r0, #CACHE_DLINESIZE - 1
244 bic r0, r0, #CACHE_DLINESIZE - 1 244 bic r0, r0, #CACHE_DLINESIZE - 1
245 mcrne p15, 0, r0, c7, c10, 1 @ clean D entry 245 mcrne p15, 0, r0, c7, c10, 1 @ clean D entry
@@ -262,7 +262,7 @@ ENTRY(arm920_dma_inv_range)
262 * 262 *
263 * (same as v4wb) 263 * (same as v4wb)
264 */ 264 */
265ENTRY(arm920_dma_clean_range) 265arm920_dma_clean_range:
266 bic r0, r0, #CACHE_DLINESIZE - 1 266 bic r0, r0, #CACHE_DLINESIZE - 1
2671: mcr p15, 0, r0, c7, c10, 1 @ clean D entry 2671: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
268 add r0, r0, #CACHE_DLINESIZE 268 add r0, r0, #CACHE_DLINESIZE
@@ -288,6 +288,30 @@ ENTRY(arm920_dma_flush_range)
288 mcr p15, 0, r0, c7, c10, 4 @ drain WB 288 mcr p15, 0, r0, c7, c10, 4 @ drain WB
289 mov pc, lr 289 mov pc, lr
290 290
291/*
292 * dma_map_area(start, size, dir)
293 * - start - kernel virtual start address
294 * - size - size of region
295 * - dir - DMA direction
296 */
297ENTRY(arm920_dma_map_area)
298 add r1, r1, r0
299 cmp r2, #DMA_TO_DEVICE
300 beq arm920_dma_clean_range
301 bcs arm920_dma_inv_range
302 b arm920_dma_flush_range
303ENDPROC(arm920_dma_map_area)
304
305/*
306 * dma_unmap_area(start, size, dir)
307 * - start - kernel virtual start address
308 * - size - size of region
309 * - dir - DMA direction
310 */
311ENTRY(arm920_dma_unmap_area)
312 mov pc, lr
313ENDPROC(arm920_dma_unmap_area)
314
291ENTRY(arm920_cache_fns) 315ENTRY(arm920_cache_fns)
292 .long arm920_flush_kern_cache_all 316 .long arm920_flush_kern_cache_all
293 .long arm920_flush_user_cache_all 317 .long arm920_flush_user_cache_all
@@ -295,8 +319,8 @@ ENTRY(arm920_cache_fns)
295 .long arm920_coherent_kern_range 319 .long arm920_coherent_kern_range
296 .long arm920_coherent_user_range 320 .long arm920_coherent_user_range
297 .long arm920_flush_kern_dcache_area 321 .long arm920_flush_kern_dcache_area
298 .long arm920_dma_inv_range 322 .long arm920_dma_map_area
299 .long arm920_dma_clean_range 323 .long arm920_dma_unmap_area
300 .long arm920_dma_flush_range 324 .long arm920_dma_flush_range
301 325
302#endif 326#endif
diff --git a/arch/arm/mm/proc-arm922.S b/arch/arm/mm/proc-arm922.S
index ee111b00fa41..c0ff8e4b1074 100644
--- a/arch/arm/mm/proc-arm922.S
+++ b/arch/arm/mm/proc-arm922.S
@@ -241,7 +241,7 @@ ENTRY(arm922_flush_kern_dcache_area)
241 * 241 *
242 * (same as v4wb) 242 * (same as v4wb)
243 */ 243 */
244ENTRY(arm922_dma_inv_range) 244arm922_dma_inv_range:
245 tst r0, #CACHE_DLINESIZE - 1 245 tst r0, #CACHE_DLINESIZE - 1
246 bic r0, r0, #CACHE_DLINESIZE - 1 246 bic r0, r0, #CACHE_DLINESIZE - 1
247 mcrne p15, 0, r0, c7, c10, 1 @ clean D entry 247 mcrne p15, 0, r0, c7, c10, 1 @ clean D entry
@@ -264,7 +264,7 @@ ENTRY(arm922_dma_inv_range)
264 * 264 *
265 * (same as v4wb) 265 * (same as v4wb)
266 */ 266 */
267ENTRY(arm922_dma_clean_range) 267arm922_dma_clean_range:
268 bic r0, r0, #CACHE_DLINESIZE - 1 268 bic r0, r0, #CACHE_DLINESIZE - 1
2691: mcr p15, 0, r0, c7, c10, 1 @ clean D entry 2691: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
270 add r0, r0, #CACHE_DLINESIZE 270 add r0, r0, #CACHE_DLINESIZE
@@ -290,6 +290,30 @@ ENTRY(arm922_dma_flush_range)
290 mcr p15, 0, r0, c7, c10, 4 @ drain WB 290 mcr p15, 0, r0, c7, c10, 4 @ drain WB
291 mov pc, lr 291 mov pc, lr
292 292
293/*
294 * dma_map_area(start, size, dir)
295 * - start - kernel virtual start address
296 * - size - size of region
297 * - dir - DMA direction
298 */
299ENTRY(arm922_dma_map_area)
300 add r1, r1, r0
301 cmp r2, #DMA_TO_DEVICE
302 beq arm922_dma_clean_range
303 bcs arm922_dma_inv_range
304 b arm922_dma_flush_range
305ENDPROC(arm922_dma_map_area)
306
307/*
308 * dma_unmap_area(start, size, dir)
309 * - start - kernel virtual start address
310 * - size - size of region
311 * - dir - DMA direction
312 */
313ENTRY(arm922_dma_unmap_area)
314 mov pc, lr
315ENDPROC(arm922_dma_unmap_area)
316
293ENTRY(arm922_cache_fns) 317ENTRY(arm922_cache_fns)
294 .long arm922_flush_kern_cache_all 318 .long arm922_flush_kern_cache_all
295 .long arm922_flush_user_cache_all 319 .long arm922_flush_user_cache_all
@@ -297,8 +321,8 @@ ENTRY(arm922_cache_fns)
297 .long arm922_coherent_kern_range 321 .long arm922_coherent_kern_range
298 .long arm922_coherent_user_range 322 .long arm922_coherent_user_range
299 .long arm922_flush_kern_dcache_area 323 .long arm922_flush_kern_dcache_area
300 .long arm922_dma_inv_range 324 .long arm922_dma_map_area
301 .long arm922_dma_clean_range 325 .long arm922_dma_unmap_area
302 .long arm922_dma_flush_range 326 .long arm922_dma_flush_range
303 327
304#endif 328#endif
diff --git a/arch/arm/mm/proc-arm925.S b/arch/arm/mm/proc-arm925.S
index 8deb5bde58e4..3c6cffe400f6 100644
--- a/arch/arm/mm/proc-arm925.S
+++ b/arch/arm/mm/proc-arm925.S
@@ -283,7 +283,7 @@ ENTRY(arm925_flush_kern_dcache_area)
283 * 283 *
284 * (same as v4wb) 284 * (same as v4wb)
285 */ 285 */
286ENTRY(arm925_dma_inv_range) 286arm925_dma_inv_range:
287#ifndef CONFIG_CPU_DCACHE_WRITETHROUGH 287#ifndef CONFIG_CPU_DCACHE_WRITETHROUGH
288 tst r0, #CACHE_DLINESIZE - 1 288 tst r0, #CACHE_DLINESIZE - 1
289 mcrne p15, 0, r0, c7, c10, 1 @ clean D entry 289 mcrne p15, 0, r0, c7, c10, 1 @ clean D entry
@@ -308,7 +308,7 @@ ENTRY(arm925_dma_inv_range)
308 * 308 *
309 * (same as v4wb) 309 * (same as v4wb)
310 */ 310 */
311ENTRY(arm925_dma_clean_range) 311arm925_dma_clean_range:
312#ifndef CONFIG_CPU_DCACHE_WRITETHROUGH 312#ifndef CONFIG_CPU_DCACHE_WRITETHROUGH
313 bic r0, r0, #CACHE_DLINESIZE - 1 313 bic r0, r0, #CACHE_DLINESIZE - 1
3141: mcr p15, 0, r0, c7, c10, 1 @ clean D entry 3141: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
@@ -341,6 +341,30 @@ ENTRY(arm925_dma_flush_range)
341 mcr p15, 0, r0, c7, c10, 4 @ drain WB 341 mcr p15, 0, r0, c7, c10, 4 @ drain WB
342 mov pc, lr 342 mov pc, lr
343 343
344/*
345 * dma_map_area(start, size, dir)
346 * - start - kernel virtual start address
347 * - size - size of region
348 * - dir - DMA direction
349 */
350ENTRY(arm925_dma_map_area)
351 add r1, r1, r0
352 cmp r2, #DMA_TO_DEVICE
353 beq arm925_dma_clean_range
354 bcs arm925_dma_inv_range
355 b arm925_dma_flush_range
356ENDPROC(arm925_dma_map_area)
357
358/*
359 * dma_unmap_area(start, size, dir)
360 * - start - kernel virtual start address
361 * - size - size of region
362 * - dir - DMA direction
363 */
364ENTRY(arm925_dma_unmap_area)
365 mov pc, lr
366ENDPROC(arm925_dma_unmap_area)
367
344ENTRY(arm925_cache_fns) 368ENTRY(arm925_cache_fns)
345 .long arm925_flush_kern_cache_all 369 .long arm925_flush_kern_cache_all
346 .long arm925_flush_user_cache_all 370 .long arm925_flush_user_cache_all
@@ -348,8 +372,8 @@ ENTRY(arm925_cache_fns)
348 .long arm925_coherent_kern_range 372 .long arm925_coherent_kern_range
349 .long arm925_coherent_user_range 373 .long arm925_coherent_user_range
350 .long arm925_flush_kern_dcache_area 374 .long arm925_flush_kern_dcache_area
351 .long arm925_dma_inv_range 375 .long arm925_dma_map_area
352 .long arm925_dma_clean_range 376 .long arm925_dma_unmap_area
353 .long arm925_dma_flush_range 377 .long arm925_dma_flush_range
354 378
355ENTRY(cpu_arm925_dcache_clean_area) 379ENTRY(cpu_arm925_dcache_clean_area)
diff --git a/arch/arm/mm/proc-arm926.S b/arch/arm/mm/proc-arm926.S
index 64db6e275a44..75b707c9cce1 100644
--- a/arch/arm/mm/proc-arm926.S
+++ b/arch/arm/mm/proc-arm926.S
@@ -246,7 +246,7 @@ ENTRY(arm926_flush_kern_dcache_area)
246 * 246 *
247 * (same as v4wb) 247 * (same as v4wb)
248 */ 248 */
249ENTRY(arm926_dma_inv_range) 249arm926_dma_inv_range:
250#ifndef CONFIG_CPU_DCACHE_WRITETHROUGH 250#ifndef CONFIG_CPU_DCACHE_WRITETHROUGH
251 tst r0, #CACHE_DLINESIZE - 1 251 tst r0, #CACHE_DLINESIZE - 1
252 mcrne p15, 0, r0, c7, c10, 1 @ clean D entry 252 mcrne p15, 0, r0, c7, c10, 1 @ clean D entry
@@ -271,7 +271,7 @@ ENTRY(arm926_dma_inv_range)
271 * 271 *
272 * (same as v4wb) 272 * (same as v4wb)
273 */ 273 */
274ENTRY(arm926_dma_clean_range) 274arm926_dma_clean_range:
275#ifndef CONFIG_CPU_DCACHE_WRITETHROUGH 275#ifndef CONFIG_CPU_DCACHE_WRITETHROUGH
276 bic r0, r0, #CACHE_DLINESIZE - 1 276 bic r0, r0, #CACHE_DLINESIZE - 1
2771: mcr p15, 0, r0, c7, c10, 1 @ clean D entry 2771: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
@@ -304,6 +304,30 @@ ENTRY(arm926_dma_flush_range)
304 mcr p15, 0, r0, c7, c10, 4 @ drain WB 304 mcr p15, 0, r0, c7, c10, 4 @ drain WB
305 mov pc, lr 305 mov pc, lr
306 306
307/*
308 * dma_map_area(start, size, dir)
309 * - start - kernel virtual start address
310 * - size - size of region
311 * - dir - DMA direction
312 */
313ENTRY(arm926_dma_map_area)
314 add r1, r1, r0
315 cmp r2, #DMA_TO_DEVICE
316 beq arm926_dma_clean_range
317 bcs arm926_dma_inv_range
318 b arm926_dma_flush_range
319ENDPROC(arm926_dma_map_area)
320
321/*
322 * dma_unmap_area(start, size, dir)
323 * - start - kernel virtual start address
324 * - size - size of region
325 * - dir - DMA direction
326 */
327ENTRY(arm926_dma_unmap_area)
328 mov pc, lr
329ENDPROC(arm926_dma_unmap_area)
330
307ENTRY(arm926_cache_fns) 331ENTRY(arm926_cache_fns)
308 .long arm926_flush_kern_cache_all 332 .long arm926_flush_kern_cache_all
309 .long arm926_flush_user_cache_all 333 .long arm926_flush_user_cache_all
@@ -311,8 +335,8 @@ ENTRY(arm926_cache_fns)
311 .long arm926_coherent_kern_range 335 .long arm926_coherent_kern_range
312 .long arm926_coherent_user_range 336 .long arm926_coherent_user_range
313 .long arm926_flush_kern_dcache_area 337 .long arm926_flush_kern_dcache_area
314 .long arm926_dma_inv_range 338 .long arm926_dma_map_area
315 .long arm926_dma_clean_range 339 .long arm926_dma_unmap_area
316 .long arm926_dma_flush_range 340 .long arm926_dma_flush_range
317 341
318ENTRY(cpu_arm926_dcache_clean_area) 342ENTRY(cpu_arm926_dcache_clean_area)
diff --git a/arch/arm/mm/proc-arm940.S b/arch/arm/mm/proc-arm940.S
index 8196b9f401fb..1af1657819eb 100644
--- a/arch/arm/mm/proc-arm940.S
+++ b/arch/arm/mm/proc-arm940.S
@@ -171,7 +171,7 @@ ENTRY(arm940_flush_kern_dcache_area)
171 * - start - virtual start address 171 * - start - virtual start address
172 * - end - virtual end address 172 * - end - virtual end address
173 */ 173 */
174ENTRY(arm940_dma_inv_range) 174arm940_dma_inv_range:
175 mov ip, #0 175 mov ip, #0
176 mov r1, #(CACHE_DSEGMENTS - 1) << 4 @ 4 segments 176 mov r1, #(CACHE_DSEGMENTS - 1) << 4 @ 4 segments
1771: orr r3, r1, #(CACHE_DENTRIES - 1) << 26 @ 64 entries 1771: orr r3, r1, #(CACHE_DENTRIES - 1) << 26 @ 64 entries
@@ -192,7 +192,7 @@ ENTRY(arm940_dma_inv_range)
192 * - start - virtual start address 192 * - start - virtual start address
193 * - end - virtual end address 193 * - end - virtual end address
194 */ 194 */
195ENTRY(arm940_dma_clean_range) 195arm940_dma_clean_range:
196ENTRY(cpu_arm940_dcache_clean_area) 196ENTRY(cpu_arm940_dcache_clean_area)
197 mov ip, #0 197 mov ip, #0
198#ifndef CONFIG_CPU_DCACHE_WRITETHROUGH 198#ifndef CONFIG_CPU_DCACHE_WRITETHROUGH
@@ -233,6 +233,30 @@ ENTRY(arm940_dma_flush_range)
233 mcr p15, 0, ip, c7, c10, 4 @ drain WB 233 mcr p15, 0, ip, c7, c10, 4 @ drain WB
234 mov pc, lr 234 mov pc, lr
235 235
236/*
237 * dma_map_area(start, size, dir)
238 * - start - kernel virtual start address
239 * - size - size of region
240 * - dir - DMA direction
241 */
242ENTRY(arm940_dma_map_area)
243 add r1, r1, r0
244 cmp r2, #DMA_TO_DEVICE
245 beq arm940_dma_clean_range
246 bcs arm940_dma_inv_range
247 b arm940_dma_flush_range
248ENDPROC(arm940_dma_map_area)
249
250/*
251 * dma_unmap_area(start, size, dir)
252 * - start - kernel virtual start address
253 * - size - size of region
254 * - dir - DMA direction
255 */
256ENTRY(arm940_dma_unmap_area)
257 mov pc, lr
258ENDPROC(arm940_dma_unmap_area)
259
236ENTRY(arm940_cache_fns) 260ENTRY(arm940_cache_fns)
237 .long arm940_flush_kern_cache_all 261 .long arm940_flush_kern_cache_all
238 .long arm940_flush_user_cache_all 262 .long arm940_flush_user_cache_all
@@ -240,8 +264,8 @@ ENTRY(arm940_cache_fns)
240 .long arm940_coherent_kern_range 264 .long arm940_coherent_kern_range
241 .long arm940_coherent_user_range 265 .long arm940_coherent_user_range
242 .long arm940_flush_kern_dcache_area 266 .long arm940_flush_kern_dcache_area
243 .long arm940_dma_inv_range 267 .long arm940_dma_map_area
244 .long arm940_dma_clean_range 268 .long arm940_dma_unmap_area
245 .long arm940_dma_flush_range 269 .long arm940_dma_flush_range
246 270
247 __INIT 271 __INIT
diff --git a/arch/arm/mm/proc-arm946.S b/arch/arm/mm/proc-arm946.S
index 9a951239c86c..1664b6aaff79 100644
--- a/arch/arm/mm/proc-arm946.S
+++ b/arch/arm/mm/proc-arm946.S
@@ -215,7 +215,7 @@ ENTRY(arm946_flush_kern_dcache_area)
215 * - end - virtual end address 215 * - end - virtual end address
216 * (same as arm926) 216 * (same as arm926)
217 */ 217 */
218ENTRY(arm946_dma_inv_range) 218arm946_dma_inv_range:
219#ifndef CONFIG_CPU_DCACHE_WRITETHROUGH 219#ifndef CONFIG_CPU_DCACHE_WRITETHROUGH
220 tst r0, #CACHE_DLINESIZE - 1 220 tst r0, #CACHE_DLINESIZE - 1
221 mcrne p15, 0, r0, c7, c10, 1 @ clean D entry 221 mcrne p15, 0, r0, c7, c10, 1 @ clean D entry
@@ -240,7 +240,7 @@ ENTRY(arm946_dma_inv_range)
240 * 240 *
241 * (same as arm926) 241 * (same as arm926)
242 */ 242 */
243ENTRY(arm946_dma_clean_range) 243arm946_dma_clean_range:
244#ifndef CONFIG_CPU_DCACHE_WRITETHROUGH 244#ifndef CONFIG_CPU_DCACHE_WRITETHROUGH
245 bic r0, r0, #CACHE_DLINESIZE - 1 245 bic r0, r0, #CACHE_DLINESIZE - 1
2461: mcr p15, 0, r0, c7, c10, 1 @ clean D entry 2461: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
@@ -275,6 +275,30 @@ ENTRY(arm946_dma_flush_range)
275 mcr p15, 0, r0, c7, c10, 4 @ drain WB 275 mcr p15, 0, r0, c7, c10, 4 @ drain WB
276 mov pc, lr 276 mov pc, lr
277 277
278/*
279 * dma_map_area(start, size, dir)
280 * - start - kernel virtual start address
281 * - size - size of region
282 * - dir - DMA direction
283 */
284ENTRY(arm946_dma_map_area)
285 add r1, r1, r0
286 cmp r2, #DMA_TO_DEVICE
287 beq arm946_dma_clean_range
288 bcs arm946_dma_inv_range
289 b arm946_dma_flush_range
290ENDPROC(arm946_dma_map_area)
291
292/*
293 * dma_unmap_area(start, size, dir)
294 * - start - kernel virtual start address
295 * - size - size of region
296 * - dir - DMA direction
297 */
298ENTRY(arm946_dma_unmap_area)
299 mov pc, lr
300ENDPROC(arm946_dma_unmap_area)
301
278ENTRY(arm946_cache_fns) 302ENTRY(arm946_cache_fns)
279 .long arm946_flush_kern_cache_all 303 .long arm946_flush_kern_cache_all
280 .long arm946_flush_user_cache_all 304 .long arm946_flush_user_cache_all
@@ -282,8 +306,8 @@ ENTRY(arm946_cache_fns)
282 .long arm946_coherent_kern_range 306 .long arm946_coherent_kern_range
283 .long arm946_coherent_user_range 307 .long arm946_coherent_user_range
284 .long arm946_flush_kern_dcache_area 308 .long arm946_flush_kern_dcache_area
285 .long arm946_dma_inv_range 309 .long arm946_dma_map_area
286 .long arm946_dma_clean_range 310 .long arm946_dma_unmap_area
287 .long arm946_dma_flush_range 311 .long arm946_dma_flush_range
288 312
289 313
diff --git a/arch/arm/mm/proc-feroceon.S b/arch/arm/mm/proc-feroceon.S
index dbc39383e66a..53e632343849 100644
--- a/arch/arm/mm/proc-feroceon.S
+++ b/arch/arm/mm/proc-feroceon.S
@@ -274,7 +274,7 @@ ENTRY(feroceon_range_flush_kern_dcache_area)
274 * (same as v4wb) 274 * (same as v4wb)
275 */ 275 */
276 .align 5 276 .align 5
277ENTRY(feroceon_dma_inv_range) 277feroceon_dma_inv_range:
278 tst r0, #CACHE_DLINESIZE - 1 278 tst r0, #CACHE_DLINESIZE - 1
279 bic r0, r0, #CACHE_DLINESIZE - 1 279 bic r0, r0, #CACHE_DLINESIZE - 1
280 mcrne p15, 0, r0, c7, c10, 1 @ clean D entry 280 mcrne p15, 0, r0, c7, c10, 1 @ clean D entry
@@ -288,7 +288,7 @@ ENTRY(feroceon_dma_inv_range)
288 mov pc, lr 288 mov pc, lr
289 289
290 .align 5 290 .align 5
291ENTRY(feroceon_range_dma_inv_range) 291feroceon_range_dma_inv_range:
292 mrs r2, cpsr 292 mrs r2, cpsr
293 tst r0, #CACHE_DLINESIZE - 1 293 tst r0, #CACHE_DLINESIZE - 1
294 mcrne p15, 0, r0, c7, c10, 1 @ clean D entry 294 mcrne p15, 0, r0, c7, c10, 1 @ clean D entry
@@ -314,7 +314,7 @@ ENTRY(feroceon_range_dma_inv_range)
314 * (same as v4wb) 314 * (same as v4wb)
315 */ 315 */
316 .align 5 316 .align 5
317ENTRY(feroceon_dma_clean_range) 317feroceon_dma_clean_range:
318 bic r0, r0, #CACHE_DLINESIZE - 1 318 bic r0, r0, #CACHE_DLINESIZE - 1
3191: mcr p15, 0, r0, c7, c10, 1 @ clean D entry 3191: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
320 add r0, r0, #CACHE_DLINESIZE 320 add r0, r0, #CACHE_DLINESIZE
@@ -324,7 +324,7 @@ ENTRY(feroceon_dma_clean_range)
324 mov pc, lr 324 mov pc, lr
325 325
326 .align 5 326 .align 5
327ENTRY(feroceon_range_dma_clean_range) 327feroceon_range_dma_clean_range:
328 mrs r2, cpsr 328 mrs r2, cpsr
329 cmp r1, r0 329 cmp r1, r0
330 subne r1, r1, #1 @ top address is inclusive 330 subne r1, r1, #1 @ top address is inclusive
@@ -367,6 +367,44 @@ ENTRY(feroceon_range_dma_flush_range)
367 mcr p15, 0, r0, c7, c10, 4 @ drain WB 367 mcr p15, 0, r0, c7, c10, 4 @ drain WB
368 mov pc, lr 368 mov pc, lr
369 369
370/*
371 * dma_map_area(start, size, dir)
372 * - start - kernel virtual start address
373 * - size - size of region
374 * - dir - DMA direction
375 */
376ENTRY(feroceon_dma_map_area)
377 add r1, r1, r0
378 cmp r2, #DMA_TO_DEVICE
379 beq feroceon_dma_clean_range
380 bcs feroceon_dma_inv_range
381 b feroceon_dma_flush_range
382ENDPROC(feroceon_dma_map_area)
383
384/*
385 * dma_map_area(start, size, dir)
386 * - start - kernel virtual start address
387 * - size - size of region
388 * - dir - DMA direction
389 */
390ENTRY(feroceon_range_dma_map_area)
391 add r1, r1, r0
392 cmp r2, #DMA_TO_DEVICE
393 beq feroceon_range_dma_clean_range
394 bcs feroceon_range_dma_inv_range
395 b feroceon_range_dma_flush_range
396ENDPROC(feroceon_range_dma_map_area)
397
398/*
399 * dma_unmap_area(start, size, dir)
400 * - start - kernel virtual start address
401 * - size - size of region
402 * - dir - DMA direction
403 */
404ENTRY(feroceon_dma_unmap_area)
405 mov pc, lr
406ENDPROC(feroceon_dma_unmap_area)
407
370ENTRY(feroceon_cache_fns) 408ENTRY(feroceon_cache_fns)
371 .long feroceon_flush_kern_cache_all 409 .long feroceon_flush_kern_cache_all
372 .long feroceon_flush_user_cache_all 410 .long feroceon_flush_user_cache_all
@@ -374,8 +412,8 @@ ENTRY(feroceon_cache_fns)
374 .long feroceon_coherent_kern_range 412 .long feroceon_coherent_kern_range
375 .long feroceon_coherent_user_range 413 .long feroceon_coherent_user_range
376 .long feroceon_flush_kern_dcache_area 414 .long feroceon_flush_kern_dcache_area
377 .long feroceon_dma_inv_range 415 .long feroceon_dma_map_area
378 .long feroceon_dma_clean_range 416 .long feroceon_dma_unmap_area
379 .long feroceon_dma_flush_range 417 .long feroceon_dma_flush_range
380 418
381ENTRY(feroceon_range_cache_fns) 419ENTRY(feroceon_range_cache_fns)
@@ -385,8 +423,8 @@ ENTRY(feroceon_range_cache_fns)
385 .long feroceon_coherent_kern_range 423 .long feroceon_coherent_kern_range
386 .long feroceon_coherent_user_range 424 .long feroceon_coherent_user_range
387 .long feroceon_range_flush_kern_dcache_area 425 .long feroceon_range_flush_kern_dcache_area
388 .long feroceon_range_dma_inv_range 426 .long feroceon_range_dma_map_area
389 .long feroceon_range_dma_clean_range 427 .long feroceon_dma_unmap_area
390 .long feroceon_range_dma_flush_range 428 .long feroceon_range_dma_flush_range
391 429
392 .align 5 430 .align 5
diff --git a/arch/arm/mm/proc-mohawk.S b/arch/arm/mm/proc-mohawk.S
index 9674d36cc97d..caa31154e7db 100644
--- a/arch/arm/mm/proc-mohawk.S
+++ b/arch/arm/mm/proc-mohawk.S
@@ -218,7 +218,7 @@ ENTRY(mohawk_flush_kern_dcache_area)
218 * 218 *
219 * (same as v4wb) 219 * (same as v4wb)
220 */ 220 */
221ENTRY(mohawk_dma_inv_range) 221mohawk_dma_inv_range:
222 tst r0, #CACHE_DLINESIZE - 1 222 tst r0, #CACHE_DLINESIZE - 1
223 mcrne p15, 0, r0, c7, c10, 1 @ clean D entry 223 mcrne p15, 0, r0, c7, c10, 1 @ clean D entry
224 tst r1, #CACHE_DLINESIZE - 1 224 tst r1, #CACHE_DLINESIZE - 1
@@ -241,7 +241,7 @@ ENTRY(mohawk_dma_inv_range)
241 * 241 *
242 * (same as v4wb) 242 * (same as v4wb)
243 */ 243 */
244ENTRY(mohawk_dma_clean_range) 244mohawk_dma_clean_range:
245 bic r0, r0, #CACHE_DLINESIZE - 1 245 bic r0, r0, #CACHE_DLINESIZE - 1
2461: mcr p15, 0, r0, c7, c10, 1 @ clean D entry 2461: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
247 add r0, r0, #CACHE_DLINESIZE 247 add r0, r0, #CACHE_DLINESIZE
@@ -268,6 +268,30 @@ ENTRY(mohawk_dma_flush_range)
268 mcr p15, 0, r0, c7, c10, 4 @ drain WB 268 mcr p15, 0, r0, c7, c10, 4 @ drain WB
269 mov pc, lr 269 mov pc, lr
270 270
271/*
272 * dma_map_area(start, size, dir)
273 * - start - kernel virtual start address
274 * - size - size of region
275 * - dir - DMA direction
276 */
277ENTRY(mohawk_dma_map_area)
278 add r1, r1, r0
279 cmp r2, #DMA_TO_DEVICE
280 beq mohawk_dma_clean_range
281 bcs mohawk_dma_inv_range
282 b mohawk_dma_flush_range
283ENDPROC(mohawk_dma_map_area)
284
285/*
286 * dma_unmap_area(start, size, dir)
287 * - start - kernel virtual start address
288 * - size - size of region
289 * - dir - DMA direction
290 */
291ENTRY(mohawk_dma_unmap_area)
292 mov pc, lr
293ENDPROC(mohawk_dma_unmap_area)
294
271ENTRY(mohawk_cache_fns) 295ENTRY(mohawk_cache_fns)
272 .long mohawk_flush_kern_cache_all 296 .long mohawk_flush_kern_cache_all
273 .long mohawk_flush_user_cache_all 297 .long mohawk_flush_user_cache_all
@@ -275,8 +299,8 @@ ENTRY(mohawk_cache_fns)
275 .long mohawk_coherent_kern_range 299 .long mohawk_coherent_kern_range
276 .long mohawk_coherent_user_range 300 .long mohawk_coherent_user_range
277 .long mohawk_flush_kern_dcache_area 301 .long mohawk_flush_kern_dcache_area
278 .long mohawk_dma_inv_range 302 .long mohawk_dma_map_area
279 .long mohawk_dma_clean_range 303 .long mohawk_dma_unmap_area
280 .long mohawk_dma_flush_range 304 .long mohawk_dma_flush_range
281 305
282ENTRY(cpu_mohawk_dcache_clean_area) 306ENTRY(cpu_mohawk_dcache_clean_area)
diff --git a/arch/arm/mm/proc-xsc3.S b/arch/arm/mm/proc-xsc3.S
index 8e4f6dca8997..e5797f1c1db7 100644
--- a/arch/arm/mm/proc-xsc3.S
+++ b/arch/arm/mm/proc-xsc3.S
@@ -257,7 +257,7 @@ ENTRY(xsc3_flush_kern_dcache_area)
257 * - start - virtual start address 257 * - start - virtual start address
258 * - end - virtual end address 258 * - end - virtual end address
259 */ 259 */
260ENTRY(xsc3_dma_inv_range) 260xsc3_dma_inv_range:
261 tst r0, #CACHELINESIZE - 1 261 tst r0, #CACHELINESIZE - 1
262 bic r0, r0, #CACHELINESIZE - 1 262 bic r0, r0, #CACHELINESIZE - 1
263 mcrne p15, 0, r0, c7, c10, 1 @ clean L1 D line 263 mcrne p15, 0, r0, c7, c10, 1 @ clean L1 D line
@@ -278,7 +278,7 @@ ENTRY(xsc3_dma_inv_range)
278 * - start - virtual start address 278 * - start - virtual start address
279 * - end - virtual end address 279 * - end - virtual end address
280 */ 280 */
281ENTRY(xsc3_dma_clean_range) 281xsc3_dma_clean_range:
282 bic r0, r0, #CACHELINESIZE - 1 282 bic r0, r0, #CACHELINESIZE - 1
2831: mcr p15, 0, r0, c7, c10, 1 @ clean L1 D line 2831: mcr p15, 0, r0, c7, c10, 1 @ clean L1 D line
284 add r0, r0, #CACHELINESIZE 284 add r0, r0, #CACHELINESIZE
@@ -304,6 +304,30 @@ ENTRY(xsc3_dma_flush_range)
304 mcr p15, 0, r0, c7, c10, 4 @ data write barrier 304 mcr p15, 0, r0, c7, c10, 4 @ data write barrier
305 mov pc, lr 305 mov pc, lr
306 306
307/*
308 * dma_map_area(start, size, dir)
309 * - start - kernel virtual start address
310 * - size - size of region
311 * - dir - DMA direction
312 */
313ENTRY(xsc3_dma_map_area)
314 add r1, r1, r0
315 cmp r2, #DMA_TO_DEVICE
316 beq xsc3_dma_clean_range
317 bcs xsc3_dma_inv_range
318 b xsc3_dma_flush_range
319ENDPROC(xsc3_dma_map_area)
320
321/*
322 * dma_unmap_area(start, size, dir)
323 * - start - kernel virtual start address
324 * - size - size of region
325 * - dir - DMA direction
326 */
327ENTRY(xsc3_dma_unmap_area)
328 mov pc, lr
329ENDPROC(xsc3_dma_unmap_area)
330
307ENTRY(xsc3_cache_fns) 331ENTRY(xsc3_cache_fns)
308 .long xsc3_flush_kern_cache_all 332 .long xsc3_flush_kern_cache_all
309 .long xsc3_flush_user_cache_all 333 .long xsc3_flush_user_cache_all
@@ -311,8 +335,8 @@ ENTRY(xsc3_cache_fns)
311 .long xsc3_coherent_kern_range 335 .long xsc3_coherent_kern_range
312 .long xsc3_coherent_user_range 336 .long xsc3_coherent_user_range
313 .long xsc3_flush_kern_dcache_area 337 .long xsc3_flush_kern_dcache_area
314 .long xsc3_dma_inv_range 338 .long xsc3_dma_map_area
315 .long xsc3_dma_clean_range 339 .long xsc3_dma_unmap_area
316 .long xsc3_dma_flush_range 340 .long xsc3_dma_flush_range
317 341
318ENTRY(cpu_xsc3_dcache_clean_area) 342ENTRY(cpu_xsc3_dcache_clean_area)
diff --git a/arch/arm/mm/proc-xscale.S b/arch/arm/mm/proc-xscale.S
index 93df47265f2d..63037e2162f2 100644
--- a/arch/arm/mm/proc-xscale.S
+++ b/arch/arm/mm/proc-xscale.S
@@ -315,7 +315,7 @@ ENTRY(xscale_flush_kern_dcache_area)
315 * - start - virtual start address 315 * - start - virtual start address
316 * - end - virtual end address 316 * - end - virtual end address
317 */ 317 */
318ENTRY(xscale_dma_inv_range) 318xscale_dma_inv_range:
319 tst r0, #CACHELINESIZE - 1 319 tst r0, #CACHELINESIZE - 1
320 bic r0, r0, #CACHELINESIZE - 1 320 bic r0, r0, #CACHELINESIZE - 1
321 mcrne p15, 0, r0, c7, c10, 1 @ clean D entry 321 mcrne p15, 0, r0, c7, c10, 1 @ clean D entry
@@ -336,7 +336,7 @@ ENTRY(xscale_dma_inv_range)
336 * - start - virtual start address 336 * - start - virtual start address
337 * - end - virtual end address 337 * - end - virtual end address
338 */ 338 */
339ENTRY(xscale_dma_clean_range) 339xscale_dma_clean_range:
340 bic r0, r0, #CACHELINESIZE - 1 340 bic r0, r0, #CACHELINESIZE - 1
3411: mcr p15, 0, r0, c7, c10, 1 @ clean D entry 3411: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
342 add r0, r0, #CACHELINESIZE 342 add r0, r0, #CACHELINESIZE
@@ -363,6 +363,43 @@ ENTRY(xscale_dma_flush_range)
363 mcr p15, 0, r0, c7, c10, 4 @ Drain Write (& Fill) Buffer 363 mcr p15, 0, r0, c7, c10, 4 @ Drain Write (& Fill) Buffer
364 mov pc, lr 364 mov pc, lr
365 365
366/*
367 * dma_map_area(start, size, dir)
368 * - start - kernel virtual start address
369 * - size - size of region
370 * - dir - DMA direction
371 */
372ENTRY(xscale_dma_map_area)
373 add r1, r1, r0
374 cmp r2, #DMA_TO_DEVICE
375 beq xscale_dma_clean_range
376 bcs xscale_dma_inv_range
377 b xscale_dma_flush_range
378ENDPROC(xscale_dma_map_area)
379
380/*
381 * dma_map_area(start, size, dir)
382 * - start - kernel virtual start address
383 * - size - size of region
384 * - dir - DMA direction
385 */
386ENTRY(xscale_dma_a0_map_area)
387 add r1, r1, r0
388 teq r2, #DMA_TO_DEVICE
389 beq xscale_dma_clean_range
390 b xscale_dma_flush_range
391ENDPROC(xscsale_dma_a0_map_area)
392
393/*
394 * dma_unmap_area(start, size, dir)
395 * - start - kernel virtual start address
396 * - size - size of region
397 * - dir - DMA direction
398 */
399ENTRY(xscale_dma_unmap_area)
400 mov pc, lr
401ENDPROC(xscale_dma_unmap_area)
402
366ENTRY(xscale_cache_fns) 403ENTRY(xscale_cache_fns)
367 .long xscale_flush_kern_cache_all 404 .long xscale_flush_kern_cache_all
368 .long xscale_flush_user_cache_all 405 .long xscale_flush_user_cache_all
@@ -370,8 +407,8 @@ ENTRY(xscale_cache_fns)
370 .long xscale_coherent_kern_range 407 .long xscale_coherent_kern_range
371 .long xscale_coherent_user_range 408 .long xscale_coherent_user_range
372 .long xscale_flush_kern_dcache_area 409 .long xscale_flush_kern_dcache_area
373 .long xscale_dma_inv_range 410 .long xscale_dma_map_area
374 .long xscale_dma_clean_range 411 .long xscale_dma_unmap_area
375 .long xscale_dma_flush_range 412 .long xscale_dma_flush_range
376 413
377/* 414/*
@@ -394,8 +431,8 @@ ENTRY(xscale_80200_A0_A1_cache_fns)
394 .long xscale_coherent_kern_range 431 .long xscale_coherent_kern_range
395 .long xscale_coherent_user_range 432 .long xscale_coherent_user_range
396 .long xscale_flush_kern_dcache_area 433 .long xscale_flush_kern_dcache_area
397 .long xscale_dma_flush_range 434 .long xscale_dma_a0_map_area
398 .long xscale_dma_clean_range 435 .long xscale_dma_unmap_area
399 .long xscale_dma_flush_range 436 .long xscale_dma_flush_range
400 437
401ENTRY(cpu_xscale_dcache_clean_area) 438ENTRY(cpu_xscale_dcache_clean_area)
diff --git a/arch/arm/oprofile/op_model_arm11_core.c b/arch/arm/oprofile/op_model_arm11_core.c
index ad80752cb9fb..ef3e2653b90c 100644
--- a/arch/arm/oprofile/op_model_arm11_core.c
+++ b/arch/arm/oprofile/op_model_arm11_core.c
@@ -132,7 +132,7 @@ static irqreturn_t arm11_pmu_interrupt(int irq, void *arg)
132 return IRQ_HANDLED; 132 return IRQ_HANDLED;
133} 133}
134 134
135int arm11_request_interrupts(int *irqs, int nr) 135int arm11_request_interrupts(const int *irqs, int nr)
136{ 136{
137 unsigned int i; 137 unsigned int i;
138 int ret = 0; 138 int ret = 0;
@@ -153,7 +153,7 @@ int arm11_request_interrupts(int *irqs, int nr)
153 return ret; 153 return ret;
154} 154}
155 155
156void arm11_release_interrupts(int *irqs, int nr) 156void arm11_release_interrupts(const int *irqs, int nr)
157{ 157{
158 unsigned int i; 158 unsigned int i;
159 159
diff --git a/arch/arm/oprofile/op_model_arm11_core.h b/arch/arm/oprofile/op_model_arm11_core.h
index 6f8538e5a960..1902b99d9dfd 100644
--- a/arch/arm/oprofile/op_model_arm11_core.h
+++ b/arch/arm/oprofile/op_model_arm11_core.h
@@ -39,7 +39,7 @@
39int arm11_setup_pmu(void); 39int arm11_setup_pmu(void);
40int arm11_start_pmu(void); 40int arm11_start_pmu(void);
41int arm11_stop_pmu(void); 41int arm11_stop_pmu(void);
42int arm11_request_interrupts(int *, int); 42int arm11_request_interrupts(const int *, int);
43void arm11_release_interrupts(int *, int); 43void arm11_release_interrupts(const int *, int);
44 44
45#endif 45#endif
diff --git a/arch/arm/oprofile/op_model_mpcore.c b/arch/arm/oprofile/op_model_mpcore.c
index 4ce0f9801e2e..f73ce875a395 100644
--- a/arch/arm/oprofile/op_model_mpcore.c
+++ b/arch/arm/oprofile/op_model_mpcore.c
@@ -32,6 +32,7 @@
32/* #define DEBUG */ 32/* #define DEBUG */
33#include <linux/types.h> 33#include <linux/types.h>
34#include <linux/errno.h> 34#include <linux/errno.h>
35#include <linux/err.h>
35#include <linux/sched.h> 36#include <linux/sched.h>
36#include <linux/oprofile.h> 37#include <linux/oprofile.h>
37#include <linux/interrupt.h> 38#include <linux/interrupt.h>
@@ -43,6 +44,7 @@
43#include <mach/hardware.h> 44#include <mach/hardware.h>
44#include <mach/board-eb.h> 45#include <mach/board-eb.h>
45#include <asm/system.h> 46#include <asm/system.h>
47#include <asm/pmu.h>
46 48
47#include "op_counter.h" 49#include "op_counter.h"
48#include "op_arm_model.h" 50#include "op_arm_model.h"
@@ -58,6 +60,7 @@
58 * Bitmask of used SCU counters 60 * Bitmask of used SCU counters
59 */ 61 */
60static unsigned int scu_em_used; 62static unsigned int scu_em_used;
63static const struct pmu_irqs *pmu_irqs;
61 64
62/* 65/*
63 * 2 helper fns take a counter number from 0-7 (not the userspace-visible counter number) 66 * 2 helper fns take a counter number from 0-7 (not the userspace-visible counter number)
@@ -225,33 +228,40 @@ static int em_setup_ctrs(void)
225 return 0; 228 return 0;
226} 229}
227 230
228static int arm11_irqs[] = {
229 [0] = IRQ_EB11MP_PMU_CPU0,
230 [1] = IRQ_EB11MP_PMU_CPU1,
231 [2] = IRQ_EB11MP_PMU_CPU2,
232 [3] = IRQ_EB11MP_PMU_CPU3
233};
234
235static int em_start(void) 231static int em_start(void)
236{ 232{
237 int ret; 233 int ret;
238 234
239 ret = arm11_request_interrupts(arm11_irqs, ARRAY_SIZE(arm11_irqs)); 235 pmu_irqs = reserve_pmu();
236 if (IS_ERR(pmu_irqs)) {
237 ret = PTR_ERR(pmu_irqs);
238 goto out;
239 }
240
241 ret = arm11_request_interrupts(pmu_irqs->irqs, pmu_irqs->num_irqs);
240 if (ret == 0) { 242 if (ret == 0) {
241 em_call_function(arm11_start_pmu); 243 em_call_function(arm11_start_pmu);
242 244
243 ret = scu_start(); 245 ret = scu_start();
244 if (ret) 246 if (ret) {
245 arm11_release_interrupts(arm11_irqs, ARRAY_SIZE(arm11_irqs)); 247 arm11_release_interrupts(pmu_irqs->irqs,
248 pmu_irqs->num_irqs);
249 } else {
250 release_pmu(pmu_irqs);
251 pmu_irqs = NULL;
252 }
246 } 253 }
254
255out:
247 return ret; 256 return ret;
248} 257}
249 258
250static void em_stop(void) 259static void em_stop(void)
251{ 260{
252 em_call_function(arm11_stop_pmu); 261 em_call_function(arm11_stop_pmu);
253 arm11_release_interrupts(arm11_irqs, ARRAY_SIZE(arm11_irqs)); 262 arm11_release_interrupts(pmu_irqs->irqs, pmu_irqs->num_irqs);
254 scu_stop(); 263 scu_stop();
264 release_pmu(pmu_irqs);
255} 265}
256 266
257/* 267/*
@@ -283,15 +293,7 @@ static int em_setup(void)
283 em_route_irq(IRQ_EB11MP_PMU_SCU6, 3); 293 em_route_irq(IRQ_EB11MP_PMU_SCU6, 3);
284 em_route_irq(IRQ_EB11MP_PMU_SCU7, 3); 294 em_route_irq(IRQ_EB11MP_PMU_SCU7, 3);
285 295
286 /* 296 return init_pmu();
287 * Send CP15 PMU interrupts to the owner CPU.
288 */
289 em_route_irq(IRQ_EB11MP_PMU_CPU0, 0);
290 em_route_irq(IRQ_EB11MP_PMU_CPU1, 1);
291 em_route_irq(IRQ_EB11MP_PMU_CPU2, 2);
292 em_route_irq(IRQ_EB11MP_PMU_CPU3, 3);
293
294 return 0;
295} 297}
296 298
297struct op_arm_model_spec op_mpcore_spec = { 299struct op_arm_model_spec op_mpcore_spec = {
diff --git a/arch/arm/oprofile/op_model_v6.c b/arch/arm/oprofile/op_model_v6.c
index f7d2ec5ee9a1..a22357a2fd08 100644
--- a/arch/arm/oprofile/op_model_v6.c
+++ b/arch/arm/oprofile/op_model_v6.c
@@ -19,39 +19,47 @@
19/* #define DEBUG */ 19/* #define DEBUG */
20#include <linux/types.h> 20#include <linux/types.h>
21#include <linux/errno.h> 21#include <linux/errno.h>
22#include <linux/err.h>
22#include <linux/sched.h> 23#include <linux/sched.h>
23#include <linux/oprofile.h> 24#include <linux/oprofile.h>
24#include <linux/interrupt.h> 25#include <linux/interrupt.h>
25#include <asm/irq.h> 26#include <asm/irq.h>
26#include <asm/system.h> 27#include <asm/system.h>
28#include <asm/pmu.h>
27 29
28#include "op_counter.h" 30#include "op_counter.h"
29#include "op_arm_model.h" 31#include "op_arm_model.h"
30#include "op_model_arm11_core.h" 32#include "op_model_arm11_core.h"
31 33
32static int irqs[] = { 34static const struct pmu_irqs *pmu_irqs;
33#ifdef CONFIG_ARCH_OMAP2
34 3,
35#endif
36#ifdef CONFIG_ARCH_BCMRING
37 IRQ_PMUIRQ, /* for BCMRING, ARM PMU interrupt is 43 */
38#endif
39};
40 35
41static void armv6_pmu_stop(void) 36static void armv6_pmu_stop(void)
42{ 37{
43 arm11_stop_pmu(); 38 arm11_stop_pmu();
44 arm11_release_interrupts(irqs, ARRAY_SIZE(irqs)); 39 arm11_release_interrupts(pmu_irqs->irqs, pmu_irqs->num_irqs);
40 release_pmu(pmu_irqs);
41 pmu_irqs = NULL;
45} 42}
46 43
47static int armv6_pmu_start(void) 44static int armv6_pmu_start(void)
48{ 45{
49 int ret; 46 int ret;
50 47
51 ret = arm11_request_interrupts(irqs, ARRAY_SIZE(irqs)); 48 pmu_irqs = reserve_pmu();
52 if (ret >= 0) 49 if (IS_ERR(pmu_irqs)) {
50 ret = PTR_ERR(pmu_irqs);
51 goto out;
52 }
53
54 ret = arm11_request_interrupts(pmu_irqs->irqs, pmu_irqs->num_irqs);
55 if (ret >= 0) {
53 ret = arm11_start_pmu(); 56 ret = arm11_start_pmu();
57 } else {
58 release_pmu(pmu_irqs);
59 pmu_irqs = NULL;
60 }
54 61
62out:
55 return ret; 63 return ret;
56} 64}
57 65
diff --git a/arch/arm/oprofile/op_model_v7.c b/arch/arm/oprofile/op_model_v7.c
index 2088a6c0cc0e..8642d0891ae1 100644
--- a/arch/arm/oprofile/op_model_v7.c
+++ b/arch/arm/oprofile/op_model_v7.c
@@ -11,11 +11,14 @@
11 */ 11 */
12#include <linux/types.h> 12#include <linux/types.h>
13#include <linux/errno.h> 13#include <linux/errno.h>
14#include <linux/err.h>
14#include <linux/oprofile.h> 15#include <linux/oprofile.h>
15#include <linux/interrupt.h> 16#include <linux/interrupt.h>
16#include <linux/irq.h> 17#include <linux/irq.h>
17#include <linux/smp.h> 18#include <linux/smp.h>
18 19
20#include <asm/pmu.h>
21
19#include "op_counter.h" 22#include "op_counter.h"
20#include "op_arm_model.h" 23#include "op_arm_model.h"
21#include "op_model_v7.h" 24#include "op_model_v7.h"
@@ -295,7 +298,7 @@ static irqreturn_t armv7_pmnc_interrupt(int irq, void *arg)
295 return IRQ_HANDLED; 298 return IRQ_HANDLED;
296} 299}
297 300
298int armv7_request_interrupts(int *irqs, int nr) 301int armv7_request_interrupts(const int *irqs, int nr)
299{ 302{
300 unsigned int i; 303 unsigned int i;
301 int ret = 0; 304 int ret = 0;
@@ -318,7 +321,7 @@ int armv7_request_interrupts(int *irqs, int nr)
318 return ret; 321 return ret;
319} 322}
320 323
321void armv7_release_interrupts(int *irqs, int nr) 324void armv7_release_interrupts(const int *irqs, int nr)
322{ 325{
323 unsigned int i; 326 unsigned int i;
324 327
@@ -362,12 +365,7 @@ static void armv7_pmnc_dump_regs(void)
362} 365}
363#endif 366#endif
364 367
365 368static const struct pmu_irqs *pmu_irqs;
366static int irqs[] = {
367#ifdef CONFIG_ARCH_OMAP3
368 INT_34XX_BENCH_MPU_EMUL,
369#endif
370};
371 369
372static void armv7_pmnc_stop(void) 370static void armv7_pmnc_stop(void)
373{ 371{
@@ -375,19 +373,29 @@ static void armv7_pmnc_stop(void)
375 armv7_pmnc_dump_regs(); 373 armv7_pmnc_dump_regs();
376#endif 374#endif
377 armv7_stop_pmnc(); 375 armv7_stop_pmnc();
378 armv7_release_interrupts(irqs, ARRAY_SIZE(irqs)); 376 armv7_release_interrupts(pmu_irqs->irqs, pmu_irqs->num_irqs);
377 release_pmu(pmu_irqs);
378 pmu_irqs = NULL;
379} 379}
380 380
381static int armv7_pmnc_start(void) 381static int armv7_pmnc_start(void)
382{ 382{
383 int ret; 383 int ret;
384 384
385 pmu_irqs = reserve_pmu();
386 if (IS_ERR(pmu_irqs))
387 return PTR_ERR(pmu_irqs);
388
385#ifdef DEBUG 389#ifdef DEBUG
386 armv7_pmnc_dump_regs(); 390 armv7_pmnc_dump_regs();
387#endif 391#endif
388 ret = armv7_request_interrupts(irqs, ARRAY_SIZE(irqs)); 392 ret = armv7_request_interrupts(pmu_irqs->irqs, pmu_irqs->num_irqs);
389 if (ret >= 0) 393 if (ret >= 0) {
390 armv7_start_pmnc(); 394 armv7_start_pmnc();
395 } else {
396 release_pmu(pmu_irqs);
397 pmu_irqs = NULL;
398 }
391 399
392 return ret; 400 return ret;
393} 401}
diff --git a/arch/arm/oprofile/op_model_v7.h b/arch/arm/oprofile/op_model_v7.h
index 0e19bcc2e100..9ca334b39c75 100644
--- a/arch/arm/oprofile/op_model_v7.h
+++ b/arch/arm/oprofile/op_model_v7.h
@@ -97,7 +97,7 @@
97int armv7_setup_pmu(void); 97int armv7_setup_pmu(void);
98int armv7_start_pmu(void); 98int armv7_start_pmu(void);
99int armv7_stop_pmu(void); 99int armv7_stop_pmu(void);
100int armv7_request_interrupts(int *, int); 100int armv7_request_interrupts(const int *, int);
101void armv7_release_interrupts(int *, int); 101void armv7_release_interrupts(const int *, int);
102 102
103#endif 103#endif
diff --git a/arch/arm/oprofile/op_model_xscale.c b/arch/arm/oprofile/op_model_xscale.c
index 724ab9ce2526..1d34a02048bd 100644
--- a/arch/arm/oprofile/op_model_xscale.c
+++ b/arch/arm/oprofile/op_model_xscale.c
@@ -17,12 +17,14 @@
17/* #define DEBUG */ 17/* #define DEBUG */
18#include <linux/types.h> 18#include <linux/types.h>
19#include <linux/errno.h> 19#include <linux/errno.h>
20#include <linux/err.h>
20#include <linux/sched.h> 21#include <linux/sched.h>
21#include <linux/oprofile.h> 22#include <linux/oprofile.h>
22#include <linux/interrupt.h> 23#include <linux/interrupt.h>
23#include <linux/irq.h> 24#include <linux/irq.h>
24 25
25#include <asm/cputype.h> 26#include <asm/cputype.h>
27#include <asm/pmu.h>
26 28
27#include "op_counter.h" 29#include "op_counter.h"
28#include "op_arm_model.h" 30#include "op_arm_model.h"
@@ -33,17 +35,6 @@
33#define PMU_RESET (CCNT_RESET | PMN_RESET) 35#define PMU_RESET (CCNT_RESET | PMN_RESET)
34#define PMU_CNT64 0x008 /* Make CCNT count every 64th cycle */ 36#define PMU_CNT64 0x008 /* Make CCNT count every 64th cycle */
35 37
36/* TODO do runtime detection */
37#ifdef CONFIG_ARCH_IOP32X
38#define XSCALE_PMU_IRQ IRQ_IOP32X_CORE_PMU
39#endif
40#ifdef CONFIG_ARCH_IOP33X
41#define XSCALE_PMU_IRQ IRQ_IOP33X_CORE_PMU
42#endif
43#ifdef CONFIG_ARCH_PXA
44#define XSCALE_PMU_IRQ IRQ_PMU
45#endif
46
47/* 38/*
48 * Different types of events that can be counted by the XScale PMU 39 * Different types of events that can be counted by the XScale PMU
49 * as used by Oprofile userspace. Here primarily for documentation 40 * as used by Oprofile userspace. Here primarily for documentation
@@ -367,6 +358,8 @@ static irqreturn_t xscale_pmu_interrupt(int irq, void *arg)
367 return IRQ_HANDLED; 358 return IRQ_HANDLED;
368} 359}
369 360
361static const struct pmu_irqs *pmu_irqs;
362
370static void xscale_pmu_stop(void) 363static void xscale_pmu_stop(void)
371{ 364{
372 u32 pmnc = read_pmnc(); 365 u32 pmnc = read_pmnc();
@@ -374,20 +367,30 @@ static void xscale_pmu_stop(void)
374 pmnc &= ~PMU_ENABLE; 367 pmnc &= ~PMU_ENABLE;
375 write_pmnc(pmnc); 368 write_pmnc(pmnc);
376 369
377 free_irq(XSCALE_PMU_IRQ, results); 370 free_irq(pmu_irqs->irqs[0], results);
371 release_pmu(pmu_irqs);
372 pmu_irqs = NULL;
378} 373}
379 374
380static int xscale_pmu_start(void) 375static int xscale_pmu_start(void)
381{ 376{
382 int ret; 377 int ret;
383 u32 pmnc = read_pmnc(); 378 u32 pmnc;
379
380 pmu_irqs = reserve_pmu();
381 if (IS_ERR(pmu_irqs))
382 return PTR_ERR(pmu_irqs);
383
384 pmnc = read_pmnc();
384 385
385 ret = request_irq(XSCALE_PMU_IRQ, xscale_pmu_interrupt, IRQF_DISABLED, 386 ret = request_irq(pmu_irqs->irqs[0], xscale_pmu_interrupt,
386 "XScale PMU", (void *)results); 387 IRQF_DISABLED, "XScale PMU", (void *)results);
387 388
388 if (ret < 0) { 389 if (ret < 0) {
389 printk(KERN_ERR "oprofile: unable to request IRQ%d for XScale PMU\n", 390 printk(KERN_ERR "oprofile: unable to request IRQ%d for XScale PMU\n",
390 XSCALE_PMU_IRQ); 391 pmu_irqs->irqs[0]);
392 release_pmu(pmu_irqs);
393 pmu_irqs = NULL;
391 return ret; 394 return ret;
392 } 395 }
393 396
diff --git a/arch/arm/plat-iop/io.c b/arch/arm/plat-iop/io.c
index ed0bbece0d61..e15bc17db90b 100644
--- a/arch/arm/plat-iop/io.c
+++ b/arch/arm/plat-iop/io.c
@@ -34,7 +34,8 @@ void * __iomem __iop3xx_ioremap(unsigned long cookie, size_t size,
34 retval = (void *) IOP3XX_PMMR_PHYS_TO_VIRT(cookie); 34 retval = (void *) IOP3XX_PMMR_PHYS_TO_VIRT(cookie);
35 break; 35 break;
36 default: 36 default:
37 retval = __arm_ioremap(cookie, size, mtype); 37 retval = __arm_ioremap_caller(cookie, size, mtype,
38 __builtin_return_address(0));
38 } 39 }
39 40
40 return retval; 41 return retval;
diff --git a/arch/arm/plat-mxc/Makefile b/arch/arm/plat-mxc/Makefile
index 996cbac6932c..6cee38df58b2 100644
--- a/arch/arm/plat-mxc/Makefile
+++ b/arch/arm/plat-mxc/Makefile
@@ -13,3 +13,7 @@ obj-$(CONFIG_USB_EHCI_MXC) += ehci.o
13obj-$(CONFIG_MXC_ULPI) += ulpi.o 13obj-$(CONFIG_MXC_ULPI) += ulpi.o
14obj-$(CONFIG_ARCH_MXC_AUDMUX_V1) += audmux-v1.o 14obj-$(CONFIG_ARCH_MXC_AUDMUX_V1) += audmux-v1.o
15obj-$(CONFIG_ARCH_MXC_AUDMUX_V2) += audmux-v2.o 15obj-$(CONFIG_ARCH_MXC_AUDMUX_V2) += audmux-v2.o
16ifdef CONFIG_SND_IMX_SOC
17obj-y += ssi-fiq.o
18obj-y += ssi-fiq-ksym.o
19endif
diff --git a/arch/arm/plat-mxc/include/mach/vmalloc.h b/arch/arm/plat-mxc/include/mach/vmalloc.h
index 62d97623412f..44243a278434 100644
--- a/arch/arm/plat-mxc/include/mach/vmalloc.h
+++ b/arch/arm/plat-mxc/include/mach/vmalloc.h
@@ -21,6 +21,6 @@
21#define __ASM_ARCH_MXC_VMALLOC_H__ 21#define __ASM_ARCH_MXC_VMALLOC_H__
22 22
23/* vmalloc ending address */ 23/* vmalloc ending address */
24#define VMALLOC_END 0xF4000000 24#define VMALLOC_END 0xf4000000UL
25 25
26#endif /* __ASM_ARCH_MXC_VMALLOC_H__ */ 26#endif /* __ASM_ARCH_MXC_VMALLOC_H__ */
diff --git a/arch/arm/plat-mxc/ssi-fiq-ksym.c b/arch/arm/plat-mxc/ssi-fiq-ksym.c
new file mode 100644
index 000000000000..b5fad454da78
--- /dev/null
+++ b/arch/arm/plat-mxc/ssi-fiq-ksym.c
@@ -0,0 +1,20 @@
1/*
2 * Exported ksyms for the SSI FIQ handler
3 *
4 * Copyright (C) 2009, Sascha Hauer <s.hauer@pengutronix.de>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#include <linux/module.h>
12
13#include <mach/ssi.h>
14
15EXPORT_SYMBOL(imx_ssi_fiq_tx_buffer);
16EXPORT_SYMBOL(imx_ssi_fiq_rx_buffer);
17EXPORT_SYMBOL(imx_ssi_fiq_start);
18EXPORT_SYMBOL(imx_ssi_fiq_end);
19EXPORT_SYMBOL(imx_ssi_fiq_base);
20
diff --git a/arch/arm/plat-mxc/ssi-fiq.S b/arch/arm/plat-mxc/ssi-fiq.S
new file mode 100644
index 000000000000..4ddce565b353
--- /dev/null
+++ b/arch/arm/plat-mxc/ssi-fiq.S
@@ -0,0 +1,134 @@
1/*
2 * Copyright (C) 2009 Sascha Hauer <s.hauer@pengutronix.de>
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/linkage.h>
10#include <asm/assembler.h>
11
12/*
13 * r8 = bit 0-15: tx offset, bit 16-31: tx buffer size
14 * r9 = bit 0-15: rx offset, bit 16-31: rx buffer size
15 */
16
17#define SSI_STX0 0x00
18#define SSI_SRX0 0x08
19#define SSI_SISR 0x14
20#define SSI_SIER 0x18
21#define SSI_SACNT 0x38
22
23#define SSI_SACNT_AC97EN (1 << 0)
24
25#define SSI_SIER_TFE0_EN (1 << 0)
26#define SSI_SISR_TFE0 (1 << 0)
27#define SSI_SISR_RFF0 (1 << 2)
28#define SSI_SIER_RFF0_EN (1 << 2)
29
30 .text
31 .global imx_ssi_fiq_start
32 .global imx_ssi_fiq_end
33 .global imx_ssi_fiq_base
34 .global imx_ssi_fiq_rx_buffer
35 .global imx_ssi_fiq_tx_buffer
36
37imx_ssi_fiq_start:
38 ldr r12, imx_ssi_fiq_base
39
40 /* TX */
41 ldr r11, imx_ssi_fiq_tx_buffer
42
43 /* shall we send? */
44 ldr r13, [r12, #SSI_SIER]
45 tst r13, #SSI_SIER_TFE0_EN
46 beq 1f
47
48 /* TX FIFO empty? */
49 ldr r13, [r12, #SSI_SISR]
50 tst r13, #SSI_SISR_TFE0
51 beq 1f
52
53 mov r10, #0x10000
54 sub r10, #1
55 and r10, r10, r8 /* r10: current buffer offset */
56
57 add r11, r11, r10
58
59 ldrh r13, [r11]
60 strh r13, [r12, #SSI_STX0]
61
62 ldrh r13, [r11, #2]
63 strh r13, [r12, #SSI_STX0]
64
65 ldrh r13, [r11, #4]
66 strh r13, [r12, #SSI_STX0]
67
68 ldrh r13, [r11, #6]
69 strh r13, [r12, #SSI_STX0]
70
71 add r10, #8
72 lsr r13, r8, #16 /* r13: buffer size */
73 cmp r10, r13
74 lslgt r8, r13, #16
75 addle r8, #8
761:
77 /* RX */
78
79 /* shall we receive? */
80 ldr r13, [r12, #SSI_SIER]
81 tst r13, #SSI_SIER_RFF0_EN
82 beq 1f
83
84 /* RX FIFO full? */
85 ldr r13, [r12, #SSI_SISR]
86 tst r13, #SSI_SISR_RFF0
87 beq 1f
88
89 ldr r11, imx_ssi_fiq_rx_buffer
90
91 mov r10, #0x10000
92 sub r10, #1
93 and r10, r10, r9 /* r10: current buffer offset */
94
95 add r11, r11, r10
96
97 ldr r13, [r12, #SSI_SACNT]
98 tst r13, #SSI_SACNT_AC97EN
99
100 ldr r13, [r12, #SSI_SRX0]
101 strh r13, [r11]
102
103 ldr r13, [r12, #SSI_SRX0]
104 strh r13, [r11, #2]
105
106 /* dummy read to skip slot 12 */
107 ldrne r13, [r12, #SSI_SRX0]
108
109 ldr r13, [r12, #SSI_SRX0]
110 strh r13, [r11, #4]
111
112 ldr r13, [r12, #SSI_SRX0]
113 strh r13, [r11, #6]
114
115 /* dummy read to skip slot 12 */
116 ldrne r13, [r12, #SSI_SRX0]
117
118 add r10, #8
119 lsr r13, r9, #16 /* r13: buffer size */
120 cmp r10, r13
121 lslgt r9, r13, #16
122 addle r9, #8
123
1241:
125 @ return from FIQ
126 subs pc, lr, #4
127imx_ssi_fiq_base:
128 .word 0x0
129imx_ssi_fiq_rx_buffer:
130 .word 0x0
131imx_ssi_fiq_tx_buffer:
132 .word 0x0
133imx_ssi_fiq_end:
134
diff --git a/arch/arm/plat-nomadik/include/plat/i2c.h b/arch/arm/plat-nomadik/include/plat/i2c.h
new file mode 100644
index 000000000000..1621db67a53d
--- /dev/null
+++ b/arch/arm/plat-nomadik/include/plat/i2c.h
@@ -0,0 +1,37 @@
1/*
2 * Copyright (C) 2009 ST-Ericsson
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2, as
6 * published by the Free Software Foundation.
7 */
8#ifndef __PLAT_I2C_H
9#define __PLAT_I2C_H
10
11enum i2c_freq_mode {
12 I2C_FREQ_MODE_STANDARD, /* up to 100 Kb/s */
13 I2C_FREQ_MODE_FAST, /* up to 400 Kb/s */
14 I2C_FREQ_MODE_FAST_PLUS, /* up to 1 Mb/s */
15 I2C_FREQ_MODE_HIGH_SPEED /* up to 3.4 Mb/s */
16};
17
18/**
19 * struct nmk_i2c_controller - client specific controller configuration
20 * @clk_freq: clock frequency for the operation mode
21 * @slsu: Slave data setup time in ns.
22 * The needed setup time for three modes of operation
23 * are 250ns, 100ns and 10ns respectively thus leading
24 * to the values of 14, 6, 2 for a 48 MHz i2c clk
25 * @tft: Tx FIFO Threshold in bytes
26 * @rft: Rx FIFO Threshold in bytes
27 * @sm: speed mode
28 */
29struct nmk_i2c_controller {
30 unsigned long clk_freq;
31 unsigned short slsu;
32 unsigned char tft;
33 unsigned char rft;
34 enum i2c_freq_mode sm;
35};
36
37#endif /* __PLAT_I2C_H */
diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig
index be9484a28b12..6da796ef82bd 100644
--- a/arch/arm/plat-omap/Kconfig
+++ b/arch/arm/plat-omap/Kconfig
@@ -31,6 +31,7 @@ config ARCH_OMAP3
31 depends on ARCH_OMAP2PLUS 31 depends on ARCH_OMAP2PLUS
32 select CPU_V7 32 select CPU_V7
33 select USB_ARCH_HAS_EHCI 33 select USB_ARCH_HAS_EHCI
34 select ARM_L1_CACHE_SHIFT_6
34 35
35config ARCH_OMAP4 36config ARCH_OMAP4
36 bool "TI OMAP4" 37 bool "TI OMAP4"
diff --git a/arch/arm/plat-omap/include/plat/omap44xx.h b/arch/arm/plat-omap/include/plat/omap44xx.h
index 8fc15d33089a..2302474a3748 100644
--- a/arch/arm/plat-omap/include/plat/omap44xx.h
+++ b/arch/arm/plat-omap/include/plat/omap44xx.h
@@ -40,6 +40,7 @@
40#define OMAP44XX_GIC_CPU_BASE 0x48240100 40#define OMAP44XX_GIC_CPU_BASE 0x48240100
41#define OMAP44XX_SCU_BASE 0x48240000 41#define OMAP44XX_SCU_BASE 0x48240000
42#define OMAP44XX_LOCAL_TWD_BASE 0x48240600 42#define OMAP44XX_LOCAL_TWD_BASE 0x48240600
43#define OMAP44XX_L2CACHE_BASE 0x48242000
43#define OMAP44XX_WKUPGEN_BASE 0x48281000 44#define OMAP44XX_WKUPGEN_BASE 0x48281000
44#define OMAP44XX_MCPDM_BASE 0x40132000 45#define OMAP44XX_MCPDM_BASE 0x40132000
45#define OMAP44XX_MCPDM_L3_BASE 0x49032000 46#define OMAP44XX_MCPDM_L3_BASE 0x49032000
diff --git a/arch/arm/plat-omap/io.c b/arch/arm/plat-omap/io.c
index 2c494cf8e378..b0078cf96281 100644
--- a/arch/arm/plat-omap/io.c
+++ b/arch/arm/plat-omap/io.c
@@ -124,7 +124,7 @@ void __iomem *omap_ioremap(unsigned long p, size_t size, unsigned int type)
124 return XLATE(p, L4_EMU_44XX_PHYS, L4_EMU_44XX_VIRT); 124 return XLATE(p, L4_EMU_44XX_PHYS, L4_EMU_44XX_VIRT);
125 } 125 }
126#endif 126#endif
127 return __arm_ioremap(p, size, type); 127 return __arm_ioremap_caller(p, size, type, __builtin_return_address(0));
128} 128}
129EXPORT_SYMBOL(omap_ioremap); 129EXPORT_SYMBOL(omap_ioremap);
130 130
diff --git a/arch/arm/plat-s3c/include/mach/vmalloc.h b/arch/arm/plat-s3c/include/mach/vmalloc.h
index bfd2ca6e3074..299d95f365c9 100644
--- a/arch/arm/plat-s3c/include/mach/vmalloc.h
+++ b/arch/arm/plat-s3c/include/mach/vmalloc.h
@@ -15,6 +15,6 @@
15#ifndef __ASM_ARCH_VMALLOC_H 15#ifndef __ASM_ARCH_VMALLOC_H
16#define __ASM_ARCH_VMALLOC_H 16#define __ASM_ARCH_VMALLOC_H
17 17
18#define VMALLOC_END (0xE0000000) 18#define VMALLOC_END (0xe0000000UL)
19 19
20#endif /* __ASM_ARCH_VMALLOC_H */ 20#endif /* __ASM_ARCH_VMALLOC_H */
diff --git a/arch/arm/plat-stmp3xxx/clock.c b/arch/arm/plat-stmp3xxx/clock.c
index 5d2f19a09e44..e593a2a801c6 100644
--- a/arch/arm/plat-stmp3xxx/clock.c
+++ b/arch/arm/plat-stmp3xxx/clock.c
@@ -1126,9 +1126,8 @@ static int __init clk_init(void)
1126 if (ops && ops->set_parent) 1126 if (ops && ops->set_parent)
1127 ops->set_parent(cl->clk, cl->clk->parent); 1127 ops->set_parent(cl->clk, cl->clk->parent);
1128 } 1128 }
1129
1130 clkdev_add(cl);
1131 } 1129 }
1130 clkdev_add_table(onchip_clks, ARRAY_SIZE(onchip_clks));
1132 return 0; 1131 return 0;
1133} 1132}
1134 1133
diff --git a/arch/arm/plat-stmp3xxx/include/mach/vmalloc.h b/arch/arm/plat-stmp3xxx/include/mach/vmalloc.h
index 541b880c1863..943c1a29d641 100644
--- a/arch/arm/plat-stmp3xxx/include/mach/vmalloc.h
+++ b/arch/arm/plat-stmp3xxx/include/mach/vmalloc.h
@@ -9,4 +9,4 @@
9 * http://www.opensource.org/licenses/gpl-license.html 9 * http://www.opensource.org/licenses/gpl-license.html
10 * http://www.gnu.org/copyleft/gpl.html 10 * http://www.gnu.org/copyleft/gpl.html
11 */ 11 */
12#define VMALLOC_END (0xF0000000) 12#define VMALLOC_END 0xf0000000UL
diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types
index 5a79fc6ee818..31c2f4c30a95 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 Jan 28 22:15:54 2010 15# Last update: Sat Feb 20 14:16:15 2010
16# 16#
17# machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number 17# machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number
18# 18#
@@ -2257,7 +2257,7 @@ oratisalog MACH_ORATISALOG ORATISALOG 2268
2257oratismadi MACH_ORATISMADI ORATISMADI 2269 2257oratismadi MACH_ORATISMADI ORATISMADI 2269
2258oratisot16 MACH_ORATISOT16 ORATISOT16 2270 2258oratisot16 MACH_ORATISOT16 ORATISOT16 2270
2259oratisdesk MACH_ORATISDESK ORATISDESK 2271 2259oratisdesk MACH_ORATISDESK ORATISDESK 2271
2260v2_ca9 MACH_V2P_CA9 V2P_CA9 2272 2260vexpress MACH_VEXPRESS VEXPRESS 2272
2261sintexo MACH_SINTEXO SINTEXO 2273 2261sintexo MACH_SINTEXO SINTEXO 2273
2262cm3389 MACH_CM3389 CM3389 2274 2262cm3389 MACH_CM3389 CM3389 2274
2263omap3_cio MACH_OMAP3_CIO OMAP3_CIO 2275 2263omap3_cio MACH_OMAP3_CIO OMAP3_CIO 2275
@@ -2636,3 +2636,45 @@ hw90240 MACH_HW90240 HW90240 2648
2636dm365_leopard MACH_DM365_LEOPARD DM365_LEOPARD 2649 2636dm365_leopard MACH_DM365_LEOPARD DM365_LEOPARD 2649
2637mityomapl138 MACH_MITYOMAPL138 MITYOMAPL138 2650 2637mityomapl138 MACH_MITYOMAPL138 MITYOMAPL138 2650
2638scat110 MACH_SCAT110 SCAT110 2651 2638scat110 MACH_SCAT110 SCAT110 2651
2639acer_a1 MACH_ACER_A1 ACER_A1 2652
2640cmcontrol MACH_CMCONTROL CMCONTROL 2653
2641pelco_lamar MACH_PELCO_LAMAR PELCO_LAMAR 2654
2642rfp43 MACH_RFP43 RFP43 2655
2643sk86r0301 MACH_SK86R0301 SK86R0301 2656
2644ctpxa MACH_CTPXA CTPXA 2657
2645epb_arm9_a MACH_EPB_ARM9_A EPB_ARM9_A 2658
2646guruplug MACH_GURUPLUG GURUPLUG 2659
2647spear310 MACH_SPEAR310 SPEAR310 2660
2648spear320 MACH_SPEAR320 SPEAR320 2661
2649robotx MACH_ROBOTX ROBOTX 2662
2650lsxhl MACH_LSXHL LSXHL 2663
2651smartlite MACH_SMARTLITE SMARTLITE 2664
2652cws2 MACH_CWS2 CWS2 2665
2653m619 MACH_M619 M619 2666
2654smartview MACH_SMARTVIEW SMARTVIEW 2667
2655lsa_salsa MACH_LSA_SALSA LSA_SALSA 2668
2656kizbox MACH_KIZBOX KIZBOX 2669
2657htccharmer MACH_HTCCHARMER HTCCHARMER 2670
2658guf_neso_lt MACH_GUF_NESO_LT GUF_NESO_LT 2671
2659pm9g45 MACH_PM9G45 PM9G45 2672
2660htcpanther MACH_HTCPANTHER HTCPANTHER 2673
2661htcpanther_cdma MACH_HTCPANTHER_CDMA HTCPANTHER_CDMA 2674
2662reb01 MACH_REB01 REB01 2675
2663aquila MACH_AQUILA AQUILA 2676
2664spark_sls_hw2 MACH_SPARK_SLS_HW2 SPARK_SLS_HW2 2677
2665sheeva_esata MACH_ESATA_SHEEVAPLUG ESATA_SHEEVAPLUG 2678
2666surf7x30 MACH_SURF7X30 SURF7X30 2679
2667micro2440 MACH_MICRO2440 MICRO2440 2680
2668am2440 MACH_AM2440 AM2440 2681
2669tq2440 MACH_TQ2440 TQ2440 2682
2670lpc2478oem MACH_LPC2478OEM LPC2478OEM 2683
2671ak880x MACH_AK880X AK880X 2684
2672cobra3530 MACH_COBRA3530 COBRA3530 2685
2673pmppb MACH_PMPPB PMPPB 2686
2674u6715 MACH_U6715 U6715 2687
2675axar1500_sender MACH_AXAR1500_SENDER AXAR1500_SENDER 2688
2676g30_dvb MACH_G30_DVB G30_DVB 2689
2677vc088x MACH_VC088X VC088X 2690
2678mioa702 MACH_MIOA702 MIOA702 2691
2679hpmin MACH_HPMIN HPMIN 2692
2680ak880xak MACH_AK880XAK AK880XAK 2693
diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
index a63c4be99b36..7f3f59fcaa21 100644
--- a/arch/arm/vfp/vfpmodule.c
+++ b/arch/arm/vfp/vfpmodule.c
@@ -433,7 +433,11 @@ static inline void vfp_pm_init(void) { }
433 * saved one. This function is used by the ptrace mechanism. 433 * saved one. This function is used by the ptrace mechanism.
434 */ 434 */
435#ifdef CONFIG_SMP 435#ifdef CONFIG_SMP
436void vfp_sync_state(struct thread_info *thread) 436void vfp_sync_hwstate(struct thread_info *thread)
437{
438}
439
440void vfp_flush_hwstate(struct thread_info *thread)
437{ 441{
438 /* 442 /*
439 * On SMP systems, the VFP state is automatically saved at every 443 * On SMP systems, the VFP state is automatically saved at every
@@ -444,35 +448,48 @@ void vfp_sync_state(struct thread_info *thread)
444 thread->vfpstate.hard.cpu = NR_CPUS; 448 thread->vfpstate.hard.cpu = NR_CPUS;
445} 449}
446#else 450#else
447void vfp_sync_state(struct thread_info *thread) 451void vfp_sync_hwstate(struct thread_info *thread)
448{ 452{
449 unsigned int cpu = get_cpu(); 453 unsigned int cpu = get_cpu();
450 u32 fpexc = fmrx(FPEXC);
451 454
452 /* 455 /*
453 * If VFP is enabled, the previous state was already saved and 456 * If the thread we're interested in is the current owner of the
454 * last_VFP_context updated. 457 * hardware VFP state, then we need to save its state.
455 */ 458 */
456 if (fpexc & FPEXC_EN) 459 if (last_VFP_context[cpu] == &thread->vfpstate) {
457 goto out; 460 u32 fpexc = fmrx(FPEXC);
458 461
459 if (!last_VFP_context[cpu]) 462 /*
460 goto out; 463 * Save the last VFP state on this CPU.
464 */
465 fmxr(FPEXC, fpexc | FPEXC_EN);
466 vfp_save_state(&thread->vfpstate, fpexc | FPEXC_EN);
467 fmxr(FPEXC, fpexc);
468 }
461 469
462 /* 470 put_cpu();
463 * Save the last VFP state on this CPU. 471}
464 */ 472
465 fmxr(FPEXC, fpexc | FPEXC_EN); 473void vfp_flush_hwstate(struct thread_info *thread)
466 vfp_save_state(last_VFP_context[cpu], fpexc); 474{
467 fmxr(FPEXC, fpexc); 475 unsigned int cpu = get_cpu();
468 476
469 /* 477 /*
470 * Set the context to NULL to force a reload the next time the thread 478 * If the thread we're interested in is the current owner of the
471 * uses the VFP. 479 * hardware VFP state, then we need to save its state.
472 */ 480 */
473 last_VFP_context[cpu] = NULL; 481 if (last_VFP_context[cpu] == &thread->vfpstate) {
482 u32 fpexc = fmrx(FPEXC);
483
484 fmxr(FPEXC, fpexc & ~FPEXC_EN);
485
486 /*
487 * Set the context to NULL to force a reload the next time
488 * the thread uses the VFP.
489 */
490 last_VFP_context[cpu] = NULL;
491 }
474 492
475out:
476 put_cpu(); 493 put_cpu();
477} 494}
478#endif 495#endif
diff --git a/arch/avr32/include/asm/pgtable.h b/arch/avr32/include/asm/pgtable.h
index fecdda16f444..a9ae30c41e74 100644
--- a/arch/avr32/include/asm/pgtable.h
+++ b/arch/avr32/include/asm/pgtable.h
@@ -325,7 +325,7 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
325 325
326struct vm_area_struct; 326struct vm_area_struct;
327extern void update_mmu_cache(struct vm_area_struct * vma, 327extern void update_mmu_cache(struct vm_area_struct * vma,
328 unsigned long address, pte_t pte); 328 unsigned long address, pte_t *ptep);
329 329
330/* 330/*
331 * Encode and decode a swap entry 331 * Encode and decode a swap entry
diff --git a/arch/avr32/mm/tlb.c b/arch/avr32/mm/tlb.c
index 06677be98ffb..0da23109f817 100644
--- a/arch/avr32/mm/tlb.c
+++ b/arch/avr32/mm/tlb.c
@@ -101,7 +101,7 @@ static void update_dtlb(unsigned long address, pte_t pte)
101} 101}
102 102
103void update_mmu_cache(struct vm_area_struct *vma, 103void update_mmu_cache(struct vm_area_struct *vma,
104 unsigned long address, pte_t pte) 104 unsigned long address, pte_t *ptep)
105{ 105{
106 unsigned long flags; 106 unsigned long flags;
107 107
@@ -110,7 +110,7 @@ void update_mmu_cache(struct vm_area_struct *vma,
110 return; 110 return;
111 111
112 local_irq_save(flags); 112 local_irq_save(flags);
113 update_dtlb(address, pte); 113 update_dtlb(address, *ptep);
114 local_irq_restore(flags); 114 local_irq_restore(flags);
115} 115}
116 116
diff --git a/arch/cris/arch-v32/drivers/pci/bios.c b/arch/cris/arch-v32/drivers/pci/bios.c
index 77ee319193c3..d4b9c36ddc0f 100644
--- a/arch/cris/arch-v32/drivers/pci/bios.c
+++ b/arch/cris/arch-v32/drivers/pci/bios.c
@@ -41,18 +41,16 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
41 return 0; 41 return 0;
42} 42}
43 43
44void 44resource_size_t
45pcibios_align_resource(void *data, struct resource *res, 45pcibios_align_resource(void *data, const struct resource *res,
46 resource_size_t size, resource_size_t align) 46 resource_size_t size, resource_size_t align)
47{ 47{
48 if (res->flags & IORESOURCE_IO) { 48 resource_size_t start = res->start;
49 resource_size_t start = res->start;
50 49
51 if (start & 0x300) { 50 if ((res->flags & IORESOURCE_IO) && (start & 0x300))
52 start = (start + 0x3ff) & ~0x3ff; 51 start = (start + 0x3ff) & ~0x3ff;
53 res->start = start; 52
54 } 53 return start
55 }
56} 54}
57 55
58int pcibios_enable_resources(struct pci_dev *dev, int mask) 56int pcibios_enable_resources(struct pci_dev *dev, int mask)
diff --git a/arch/cris/include/asm/pgtable.h b/arch/cris/include/asm/pgtable.h
index 1fcce00f01f4..99ea6cd1b143 100644
--- a/arch/cris/include/asm/pgtable.h
+++ b/arch/cris/include/asm/pgtable.h
@@ -270,7 +270,7 @@ extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; /* defined in head.S */
270 * Actually I am not sure on what this could be used for. 270 * Actually I am not sure on what this could be used for.
271 */ 271 */
272static inline void update_mmu_cache(struct vm_area_struct * vma, 272static inline void update_mmu_cache(struct vm_area_struct * vma,
273 unsigned long address, pte_t pte) 273 unsigned long address, pte_t *ptep)
274{ 274{
275} 275}
276 276
diff --git a/arch/frv/include/asm/pgtable.h b/arch/frv/include/asm/pgtable.h
index 22c60692b551..c18b0d32e636 100644
--- a/arch/frv/include/asm/pgtable.h
+++ b/arch/frv/include/asm/pgtable.h
@@ -505,7 +505,7 @@ static inline int pte_file(pte_t pte)
505/* 505/*
506 * preload information about a newly instantiated PTE into the SCR0/SCR1 PGE cache 506 * preload information about a newly instantiated PTE into the SCR0/SCR1 PGE cache
507 */ 507 */
508static inline void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t pte) 508static inline void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t *ptep)
509{ 509{
510 struct mm_struct *mm; 510 struct mm_struct *mm;
511 unsigned long ampr; 511 unsigned long ampr;
diff --git a/arch/frv/mb93090-mb00/pci-frv.c b/arch/frv/mb93090-mb00/pci-frv.c
index 566bdeb499d1..1ed15d7fea20 100644
--- a/arch/frv/mb93090-mb00/pci-frv.c
+++ b/arch/frv/mb93090-mb00/pci-frv.c
@@ -32,18 +32,16 @@
32 * but we want to try to avoid allocating at 0x2900-0x2bff 32 * but we want to try to avoid allocating at 0x2900-0x2bff
33 * which might have be mirrored at 0x0100-0x03ff.. 33 * which might have be mirrored at 0x0100-0x03ff..
34 */ 34 */
35void 35resource_size_t
36pcibios_align_resource(void *data, struct resource *res, 36pcibios_align_resource(void *data, const struct resource *res,
37 resource_size_t size, resource_size_t align) 37 resource_size_t size, resource_size_t align)
38{ 38{
39 if (res->flags & IORESOURCE_IO) { 39 resource_size_t start = res->start;
40 resource_size_t start = res->start;
41 40
42 if (start & 0x300) { 41 if ((res->flags & IORESOURCE_IO) && (start & 0x300))
43 start = (start + 0x3ff) & ~0x3ff; 42 start = (start + 0x3ff) & ~0x3ff;
44 res->start = start; 43
45 } 44 return start
46 }
47} 45}
48 46
49 47
diff --git a/arch/h8300/mm/memory.c b/arch/h8300/mm/memory.c
index ccd6ade816dd..40d8aa811e4e 100644
--- a/arch/h8300/mm/memory.c
+++ b/arch/h8300/mm/memory.c
@@ -44,8 +44,8 @@ void cache_push_v (unsigned long vaddr, int len)
44{ 44{
45} 45}
46 46
47/* Map some physical address range into the kernel address space. The 47/*
48 * code is copied and adapted from map_chunk(). 48 * Map some physical address range into the kernel address space.
49 */ 49 */
50 50
51unsigned long kernel_map(unsigned long paddr, unsigned long size, 51unsigned long kernel_map(unsigned long paddr, unsigned long size,
diff --git a/arch/ia64/include/asm/acpi.h b/arch/ia64/include/asm/acpi.h
index 7ae58892ba8d..93997bd5edc3 100644
--- a/arch/ia64/include/asm/acpi.h
+++ b/arch/ia64/include/asm/acpi.h
@@ -94,9 +94,11 @@ ia64_acpi_release_global_lock (unsigned int *lock)
94#define acpi_noirq 0 /* ACPI always enabled on IA64 */ 94#define acpi_noirq 0 /* ACPI always enabled on IA64 */
95#define acpi_pci_disabled 0 /* ACPI PCI always enabled on IA64 */ 95#define acpi_pci_disabled 0 /* ACPI PCI always enabled on IA64 */
96#define acpi_strict 1 /* no ACPI spec workarounds on IA64 */ 96#define acpi_strict 1 /* no ACPI spec workarounds on IA64 */
97#define acpi_ht 0 /* no HT-only mode on IA64 */
97#endif 98#endif
98#define acpi_processor_cstate_check(x) (x) /* no idle limits on IA64 :) */ 99#define acpi_processor_cstate_check(x) (x) /* no idle limits on IA64 :) */
99static inline void disable_acpi(void) { } 100static inline void disable_acpi(void) { }
101static inline void pci_acpi_crs_quirks(void) { }
100 102
101const char *acpi_get_sysname (void); 103const char *acpi_get_sysname (void);
102int acpi_request_vector (u32 int_type); 104int acpi_request_vector (u32 int_type);
diff --git a/arch/ia64/include/asm/elf.h b/arch/ia64/include/asm/elf.h
index e14108b19c09..4c41656ede87 100644
--- a/arch/ia64/include/asm/elf.h
+++ b/arch/ia64/include/asm/elf.h
@@ -201,7 +201,9 @@ extern void ia64_elf_core_copy_regs (struct pt_regs *src, elf_gregset_t dst);
201 relevant until we have real hardware to play with... */ 201 relevant until we have real hardware to play with... */
202#define ELF_PLATFORM NULL 202#define ELF_PLATFORM NULL
203 203
204#define SET_PERSONALITY(ex) set_personality(PER_LINUX) 204#define SET_PERSONALITY(ex) \
205 set_personality((current->personality & ~PER_MASK) | PER_LINUX)
206
205#define elf_read_implies_exec(ex, executable_stack) \ 207#define elf_read_implies_exec(ex, executable_stack) \
206 ((executable_stack!=EXSTACK_DISABLE_X) && ((ex).e_flags & EF_IA_64_LINUX_EXECUTABLE_STACK) != 0) 208 ((executable_stack!=EXSTACK_DISABLE_X) && ((ex).e_flags & EF_IA_64_LINUX_EXECUTABLE_STACK) != 0)
207 209
diff --git a/arch/ia64/include/asm/pgtable.h b/arch/ia64/include/asm/pgtable.h
index 69bf13857a9f..c3286f42e501 100644
--- a/arch/ia64/include/asm/pgtable.h
+++ b/arch/ia64/include/asm/pgtable.h
@@ -462,7 +462,7 @@ pte_same (pte_t a, pte_t b)
462 return pte_val(a) == pte_val(b); 462 return pte_val(a) == pte_val(b);
463} 463}
464 464
465#define update_mmu_cache(vma, address, pte) do { } while (0) 465#define update_mmu_cache(vma, address, ptep) do { } while (0)
466 466
467extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; 467extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
468extern void paging_init (void); 468extern void paging_init (void);
diff --git a/arch/ia64/kernel/kprobes.c b/arch/ia64/kernel/kprobes.c
index 9adac441ac9b..7026b29e277a 100644
--- a/arch/ia64/kernel/kprobes.c
+++ b/arch/ia64/kernel/kprobes.c
@@ -870,7 +870,7 @@ static int __kprobes pre_kprobes_handler(struct die_args *args)
870 return 1; 870 return 1;
871 871
872ss_probe: 872ss_probe:
873#if !defined(CONFIG_PREEMPT) || defined(CONFIG_FREEZER) 873#if !defined(CONFIG_PREEMPT)
874 if (p->ainsn.inst_flag == INST_FLAG_BOOSTABLE && !p->post_handler) { 874 if (p->ainsn.inst_flag == INST_FLAG_BOOSTABLE && !p->post_handler) {
875 /* Boost up -- we can execute copied instructions directly */ 875 /* Boost up -- we can execute copied instructions directly */
876 ia64_psr(regs)->ri = p->ainsn.slot; 876 ia64_psr(regs)->ri = p->ainsn.slot;
diff --git a/arch/ia64/kernel/time.c b/arch/ia64/kernel/time.c
index a35c661e5e89..47a192781b0a 100644
--- a/arch/ia64/kernel/time.c
+++ b/arch/ia64/kernel/time.c
@@ -61,7 +61,7 @@ unsigned long long sched_clock(void)
61 61
62#ifdef CONFIG_PARAVIRT 62#ifdef CONFIG_PARAVIRT
63static void 63static void
64paravirt_clocksource_resume(void) 64paravirt_clocksource_resume(struct clocksource *cs)
65{ 65{
66 if (pv_time_ops.clocksource_resume) 66 if (pv_time_ops.clocksource_resume)
67 pv_time_ops.clocksource_resume(); 67 pv_time_ops.clocksource_resume();
diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c
index df639db779f9..64aff520b899 100644
--- a/arch/ia64/pci/pci.c
+++ b/arch/ia64/pci/pci.c
@@ -320,9 +320,9 @@ static __devinit acpi_status add_window(struct acpi_resource *res, void *data)
320static void __devinit 320static void __devinit
321pcibios_setup_root_windows(struct pci_bus *bus, struct pci_controller *ctrl) 321pcibios_setup_root_windows(struct pci_bus *bus, struct pci_controller *ctrl)
322{ 322{
323 int i, j; 323 int i;
324 324
325 j = 0; 325 pci_bus_remove_resources(bus);
326 for (i = 0; i < ctrl->windows; i++) { 326 for (i = 0; i < ctrl->windows; i++) {
327 struct resource *res = &ctrl->window[i].resource; 327 struct resource *res = &ctrl->window[i].resource;
328 /* HP's firmware has a hack to work around a Windows bug. 328 /* HP's firmware has a hack to work around a Windows bug.
@@ -330,13 +330,7 @@ pcibios_setup_root_windows(struct pci_bus *bus, struct pci_controller *ctrl)
330 if ((res->flags & IORESOURCE_MEM) && 330 if ((res->flags & IORESOURCE_MEM) &&
331 (res->end - res->start < 16)) 331 (res->end - res->start < 16))
332 continue; 332 continue;
333 if (j >= PCI_BUS_NUM_RESOURCES) { 333 pci_bus_add_resource(bus, res, 0);
334 dev_warn(&bus->dev,
335 "ignoring host bridge window %pR (no space)\n",
336 res);
337 continue;
338 }
339 bus->resource[j++] = res;
340 } 334 }
341} 335}
342 336
@@ -452,13 +446,12 @@ EXPORT_SYMBOL(pcibios_bus_to_resource);
452static int __devinit is_valid_resource(struct pci_dev *dev, int idx) 446static int __devinit is_valid_resource(struct pci_dev *dev, int idx)
453{ 447{
454 unsigned int i, type_mask = IORESOURCE_IO | IORESOURCE_MEM; 448 unsigned int i, type_mask = IORESOURCE_IO | IORESOURCE_MEM;
455 struct resource *devr = &dev->resource[idx]; 449 struct resource *devr = &dev->resource[idx], *busr;
456 450
457 if (!dev->bus) 451 if (!dev->bus)
458 return 0; 452 return 0;
459 for (i=0; i<PCI_BUS_NUM_RESOURCES; i++) {
460 struct resource *busr = dev->bus->resource[i];
461 453
454 pci_bus_for_each_resource(dev->bus, busr, i) {
462 if (!busr || ((busr->flags ^ devr->flags) & type_mask)) 455 if (!busr || ((busr->flags ^ devr->flags) & type_mask))
463 continue; 456 continue;
464 if ((devr->start) && (devr->start >= busr->start) && 457 if ((devr->start) && (devr->start >= busr->start) &&
@@ -547,10 +540,11 @@ pcibios_disable_device (struct pci_dev *dev)
547 acpi_pci_irq_disable(dev); 540 acpi_pci_irq_disable(dev);
548} 541}
549 542
550void 543resource_size_t
551pcibios_align_resource (void *data, struct resource *res, 544pcibios_align_resource (void *data, const struct resource *res,
552 resource_size_t size, resource_size_t align) 545 resource_size_t size, resource_size_t align)
553{ 546{
547 return res->start;
554} 548}
555 549
556/* 550/*
diff --git a/arch/ia64/sn/kernel/setup.c b/arch/ia64/sn/kernel/setup.c
index ece1bf994499..e456f062f241 100644
--- a/arch/ia64/sn/kernel/setup.c
+++ b/arch/ia64/sn/kernel/setup.c
@@ -71,7 +71,7 @@ EXPORT_SYMBOL(sn_rtc_cycles_per_second);
71DEFINE_PER_CPU(struct sn_hub_info_s, __sn_hub_info); 71DEFINE_PER_CPU(struct sn_hub_info_s, __sn_hub_info);
72EXPORT_PER_CPU_SYMBOL(__sn_hub_info); 72EXPORT_PER_CPU_SYMBOL(__sn_hub_info);
73 73
74DEFINE_PER_CPU(short [MAX_COMPACT_NODES], __sn_cnodeid_to_nasid); 74DEFINE_PER_CPU(short, __sn_cnodeid_to_nasid[MAX_COMPACT_NODES]);
75EXPORT_PER_CPU_SYMBOL(__sn_cnodeid_to_nasid); 75EXPORT_PER_CPU_SYMBOL(__sn_cnodeid_to_nasid);
76 76
77DEFINE_PER_CPU(struct nodepda_s *, __sn_nodepda); 77DEFINE_PER_CPU(struct nodepda_s *, __sn_nodepda);
diff --git a/arch/m32r/include/asm/tlbflush.h b/arch/m32r/include/asm/tlbflush.h
index 0ef95307784e..92614b0ccf17 100644
--- a/arch/m32r/include/asm/tlbflush.h
+++ b/arch/m32r/include/asm/tlbflush.h
@@ -92,6 +92,6 @@ static __inline__ void __flush_tlb_all(void)
92 ); 92 );
93} 93}
94 94
95extern void update_mmu_cache(struct vm_area_struct *, unsigned long, pte_t); 95extern void update_mmu_cache(struct vm_area_struct *, unsigned long, pte_t *);
96 96
97#endif /* _ASM_M32R_TLBFLUSH_H */ 97#endif /* _ASM_M32R_TLBFLUSH_H */
diff --git a/arch/m32r/mm/fault-nommu.c b/arch/m32r/mm/fault-nommu.c
index 88469178ea6b..888aab1157ed 100644
--- a/arch/m32r/mm/fault-nommu.c
+++ b/arch/m32r/mm/fault-nommu.c
@@ -95,7 +95,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code,
95 * update_mmu_cache() 95 * update_mmu_cache()
96 *======================================================================*/ 96 *======================================================================*/
97void update_mmu_cache(struct vm_area_struct *vma, unsigned long addr, 97void update_mmu_cache(struct vm_area_struct *vma, unsigned long addr,
98 pte_t pte) 98 pte_t *ptep)
99{ 99{
100 BUG(); 100 BUG();
101} 101}
diff --git a/arch/m32r/mm/fault.c b/arch/m32r/mm/fault.c
index 7274b47f4c22..28ee389e5f5a 100644
--- a/arch/m32r/mm/fault.c
+++ b/arch/m32r/mm/fault.c
@@ -336,7 +336,7 @@ vmalloc_fault:
336 336
337 addr = (address & PAGE_MASK); 337 addr = (address & PAGE_MASK);
338 set_thread_fault_code(error_code); 338 set_thread_fault_code(error_code);
339 update_mmu_cache(NULL, addr, *pte_k); 339 update_mmu_cache(NULL, addr, pte_k);
340 set_thread_fault_code(0); 340 set_thread_fault_code(0);
341 return; 341 return;
342 } 342 }
@@ -349,7 +349,7 @@ vmalloc_fault:
349#define ITLB_END (unsigned long *)(ITLB_BASE + (NR_TLB_ENTRIES * 8)) 349#define ITLB_END (unsigned long *)(ITLB_BASE + (NR_TLB_ENTRIES * 8))
350#define DTLB_END (unsigned long *)(DTLB_BASE + (NR_TLB_ENTRIES * 8)) 350#define DTLB_END (unsigned long *)(DTLB_BASE + (NR_TLB_ENTRIES * 8))
351void update_mmu_cache(struct vm_area_struct *vma, unsigned long vaddr, 351void update_mmu_cache(struct vm_area_struct *vma, unsigned long vaddr,
352 pte_t pte) 352 pte_t *ptep)
353{ 353{
354 volatile unsigned long *entry1, *entry2; 354 volatile unsigned long *entry1, *entry2;
355 unsigned long pte_data, flags; 355 unsigned long pte_data, flags;
@@ -365,7 +365,7 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long vaddr,
365 365
366 vaddr = (vaddr & PAGE_MASK) | get_asid(); 366 vaddr = (vaddr & PAGE_MASK) | get_asid();
367 367
368 pte_data = pte_val(pte); 368 pte_data = pte_val(*ptep);
369 369
370#ifdef CONFIG_CHIP_OPSP 370#ifdef CONFIG_CHIP_OPSP
371 entry1 = (unsigned long *)ITLB_BASE; 371 entry1 = (unsigned long *)ITLB_BASE;
diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig
index ecdc19a299b2..b5da298ba61d 100644
--- a/arch/m68k/Kconfig
+++ b/arch/m68k/Kconfig
@@ -536,10 +536,6 @@ config GVPIOEXT_PLIP
536 Say Y to enable doing IP over the parallel port on your GVP 536 Say Y to enable doing IP over the parallel port on your GVP
537 IO-Extender card, N otherwise. 537 IO-Extender card, N otherwise.
538 538
539config MAC_SCC
540 tristate "Macintosh serial support"
541 depends on MAC
542
543config MAC_HID 539config MAC_HID
544 bool 540 bool
545 depends on INPUT_ADBHID 541 depends on INPUT_ADBHID
@@ -595,7 +591,7 @@ config DN_SERIAL
595 591
596config SERIAL_CONSOLE 592config SERIAL_CONSOLE
597 bool "Support for serial port console" 593 bool "Support for serial port console"
598 depends on (AMIGA || ATARI || MAC || SUN3 || SUN3X || VME || APOLLO) && (ATARI_MFPSER=y || ATARI_MIDI=y || MAC_SCC=y || AMIGA_BUILTIN_SERIAL=y || GVPIOEXT=y || MULTIFACE_III_TTY=y || SERIAL=y || MVME147_SCC || SERIAL167 || MVME162_SCC || BVME6000_SCC || DN_SERIAL) 594 depends on (AMIGA || ATARI || SUN3 || SUN3X || VME || APOLLO) && (ATARI_MFPSER=y || ATARI_MIDI=y || AMIGA_BUILTIN_SERIAL=y || GVPIOEXT=y || MULTIFACE_III_TTY=y || SERIAL=y || MVME147_SCC || SERIAL167 || MVME162_SCC || BVME6000_SCC || DN_SERIAL)
599 ---help--- 595 ---help---
600 If you say Y here, it will be possible to use a serial port as the 596 If you say Y here, it will be possible to use a serial port as the
601 system console (the system console is the device which receives all 597 system console (the system console is the device which receives all
diff --git a/arch/m68k/amiga/config.c b/arch/m68k/amiga/config.c
index 6c74751c7b82..d2cc35d98532 100644
--- a/arch/m68k/amiga/config.c
+++ b/arch/m68k/amiga/config.c
@@ -480,7 +480,7 @@ static void __init amiga_sched_init(irq_handler_t timer_routine)
480 static struct resource sched_res = { 480 static struct resource sched_res = {
481 .name = "timer", .start = 0x00bfd400, .end = 0x00bfd5ff, 481 .name = "timer", .start = 0x00bfd400, .end = 0x00bfd5ff,
482 }; 482 };
483 jiffy_ticks = (amiga_eclock+HZ/2)/HZ; 483 jiffy_ticks = DIV_ROUND_CLOSEST(amiga_eclock, HZ);
484 484
485 if (request_resource(&mb_resources._ciab, &sched_res)) 485 if (request_resource(&mb_resources._ciab, &sched_res))
486 printk("Cannot allocate ciab.ta{lo,hi}\n"); 486 printk("Cannot allocate ciab.ta{lo,hi}\n");
diff --git a/arch/m68k/configs/mac_defconfig b/arch/m68k/configs/mac_defconfig
index 9991b64fea57..c5f3232ff916 100644
--- a/arch/m68k/configs/mac_defconfig
+++ b/arch/m68k/configs/mac_defconfig
@@ -701,6 +701,11 @@ CONFIG_VT_HW_CONSOLE_BINDING=y
701# 701#
702# Non-8250 serial port support 702# Non-8250 serial port support
703# 703#
704CONFIG_SERIAL_CORE=y
705CONFIG_SERIAL_CORE_CONSOLE=y
706CONFIG_SERIAL_PMACZILOG=y
707CONFIG_SERIAL_PMACZILOG_TTYS=y
708CONFIG_SERIAL_PMACZILOG_CONSOLE=y
704CONFIG_UNIX98_PTYS=y 709CONFIG_UNIX98_PTYS=y
705# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set 710# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
706CONFIG_LEGACY_PTYS=y 711CONFIG_LEGACY_PTYS=y
@@ -834,9 +839,7 @@ CONFIG_HIDRAW=y
834# 839#
835# Character devices 840# Character devices
836# 841#
837CONFIG_MAC_SCC=y
838CONFIG_MAC_HID=y 842CONFIG_MAC_HID=y
839CONFIG_SERIAL_CONSOLE=y
840 843
841# 844#
842# File systems 845# File systems
diff --git a/arch/m68k/configs/multi_defconfig b/arch/m68k/configs/multi_defconfig
index 69c43e2d8b45..a8bfa3fa71cf 100644
--- a/arch/m68k/configs/multi_defconfig
+++ b/arch/m68k/configs/multi_defconfig
@@ -822,6 +822,11 @@ CONFIG_A2232=y
822# 822#
823# Non-8250 serial port support 823# Non-8250 serial port support
824# 824#
825CONFIG_SERIAL_CORE=y
826CONFIG_SERIAL_CORE_CONSOLE=y
827CONFIG_SERIAL_PMACZILOG=y
828CONFIG_SERIAL_PMACZILOG_TTYS=y
829CONFIG_SERIAL_PMACZILOG_CONSOLE=y
825CONFIG_UNIX98_PTYS=y 830CONFIG_UNIX98_PTYS=y
826# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set 831# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
827CONFIG_LEGACY_PTYS=y 832CONFIG_LEGACY_PTYS=y
@@ -982,7 +987,6 @@ CONFIG_ATARI_MIDI=y
982CONFIG_ATARI_DSP56K=m 987CONFIG_ATARI_DSP56K=m
983CONFIG_AMIGA_BUILTIN_SERIAL=y 988CONFIG_AMIGA_BUILTIN_SERIAL=y
984CONFIG_MULTIFACE_III_TTY=m 989CONFIG_MULTIFACE_III_TTY=m
985CONFIG_MAC_SCC=y
986CONFIG_MAC_HID=y 990CONFIG_MAC_HID=y
987CONFIG_MVME147_SCC=y 991CONFIG_MVME147_SCC=y
988CONFIG_SERIAL167=y 992CONFIG_SERIAL167=y
diff --git a/arch/m68k/include/asm/machw.h b/arch/m68k/include/asm/machw.h
index 2b4de0c2ce4a..a22095164927 100644
--- a/arch/m68k/include/asm/machw.h
+++ b/arch/m68k/include/asm/machw.h
@@ -21,29 +21,4 @@
21#define VIDEOMEMSIZE (4096*1024) 21#define VIDEOMEMSIZE (4096*1024)
22#define VIDEOMEMMASK (-4096*1024) 22#define VIDEOMEMMASK (-4096*1024)
23 23
24#ifndef __ASSEMBLY__
25
26#include <linux/types.h>
27
28#if 0
29/*
30** SCC Z8530
31*/
32
33#define MAC_SCC_BAS (0x50F04000)
34struct MAC_SCC
35 {
36 u_char cha_a_ctrl;
37 u_char char_dummy1;
38 u_char cha_a_data;
39 u_char char_dummy2;
40 u_char cha_b_ctrl;
41 u_char char_dummy3;
42 u_char cha_b_data;
43 };
44# define mac_scc ((*(volatile struct SCC*)MAC_SCC_BAS))
45#endif
46
47#endif /* __ASSEMBLY__ */
48
49#endif /* linux/machw.h */ 24#endif /* linux/machw.h */
diff --git a/arch/m68k/include/asm/macints.h b/arch/m68k/include/asm/macints.h
index 679c48ab4407..ebe1b70fe90c 100644
--- a/arch/m68k/include/asm/macints.h
+++ b/arch/m68k/include/asm/macints.h
@@ -37,7 +37,6 @@
37 37
38#define VIA1_SOURCE_BASE 8 38#define VIA1_SOURCE_BASE 8
39#define VIA2_SOURCE_BASE 16 39#define VIA2_SOURCE_BASE 16
40#define MAC_SCC_SOURCE_BASE 24
41#define PSC3_SOURCE_BASE 24 40#define PSC3_SOURCE_BASE 24
42#define PSC4_SOURCE_BASE 32 41#define PSC4_SOURCE_BASE 32
43#define PSC5_SOURCE_BASE 40 42#define PSC5_SOURCE_BASE 40
@@ -96,26 +95,12 @@
96#define IRQ_PSC3_2 (26) 95#define IRQ_PSC3_2 (26)
97#define IRQ_PSC3_3 (27) 96#define IRQ_PSC3_3 (27)
98 97
99/* Level 4 (SCC) interrupts */
100#define IRQ_SCC (32)
101#define IRQ_SCCA (33)
102#define IRQ_SCCB (34)
103#if 0 /* FIXME: are there multiple interrupt conditions on the SCC ?? */
104/* SCC interrupts */
105#define IRQ_SCCB_TX (32)
106#define IRQ_SCCB_STAT (33)
107#define IRQ_SCCB_RX (34)
108#define IRQ_SCCB_SPCOND (35)
109#define IRQ_SCCA_TX (36)
110#define IRQ_SCCA_STAT (37)
111#define IRQ_SCCA_RX (38)
112#define IRQ_SCCA_SPCOND (39)
113#endif
114
115/* Level 4 (PSC, AV Macs only) interrupts */ 98/* Level 4 (PSC, AV Macs only) interrupts */
116#define IRQ_PSC4_0 (32) 99#define IRQ_PSC4_0 (32)
117#define IRQ_PSC4_1 (33) 100#define IRQ_PSC4_1 (33)
101#define IRQ_MAC_SCC_A IRQ_PSC4_1
118#define IRQ_PSC4_2 (34) 102#define IRQ_PSC4_2 (34)
103#define IRQ_MAC_SCC_B IRQ_PSC4_2
119#define IRQ_PSC4_3 (35) 104#define IRQ_PSC4_3 (35)
120#define IRQ_MAC_MACE_DMA IRQ_PSC4_3 105#define IRQ_MAC_MACE_DMA IRQ_PSC4_3
121 106
@@ -146,6 +131,9 @@
146#define IRQ_BABOON_2 (66) 131#define IRQ_BABOON_2 (66)
147#define IRQ_BABOON_3 (67) 132#define IRQ_BABOON_3 (67)
148 133
134/* On non-PSC machines, the serial ports share an IRQ */
135#define IRQ_MAC_SCC IRQ_AUTO_4
136
149#define SLOT2IRQ(x) (x + 47) 137#define SLOT2IRQ(x) (x + 47)
150#define IRQ2SLOT(x) (x - 47) 138#define IRQ2SLOT(x) (x - 47)
151 139
diff --git a/arch/m68k/include/asm/pgtable_mm.h b/arch/m68k/include/asm/pgtable_mm.h
index aca0e28581c7..87174c904d2b 100644
--- a/arch/m68k/include/asm/pgtable_mm.h
+++ b/arch/m68k/include/asm/pgtable_mm.h
@@ -115,7 +115,7 @@ extern void kernel_set_cachemode(void *addr, unsigned long size, int cmode);
115 * they are updated on demand. 115 * they are updated on demand.
116 */ 116 */
117static inline void update_mmu_cache(struct vm_area_struct *vma, 117static inline void update_mmu_cache(struct vm_area_struct *vma,
118 unsigned long address, pte_t pte) 118 unsigned long address, pte_t *ptep)
119{ 119{
120} 120}
121 121
diff --git a/arch/m68k/include/asm/ptrace.h b/arch/m68k/include/asm/ptrace.h
index ee4011c23281..21605c736f69 100644
--- a/arch/m68k/include/asm/ptrace.h
+++ b/arch/m68k/include/asm/ptrace.h
@@ -71,6 +71,8 @@ struct switch_stack {
71#define PTRACE_GETFPREGS 14 71#define PTRACE_GETFPREGS 14
72#define PTRACE_SETFPREGS 15 72#define PTRACE_SETFPREGS 15
73 73
74#define PTRACE_GET_THREAD_AREA 25
75
74#define PTRACE_SINGLEBLOCK 33 /* resume execution until next branch */ 76#define PTRACE_SINGLEBLOCK 33 /* resume execution until next branch */
75 77
76#ifdef __KERNEL__ 78#ifdef __KERNEL__
diff --git a/arch/m68k/include/asm/sigcontext.h b/arch/m68k/include/asm/sigcontext.h
index 523db2a51cf3..1320eaa4cc2a 100644
--- a/arch/m68k/include/asm/sigcontext.h
+++ b/arch/m68k/include/asm/sigcontext.h
@@ -15,9 +15,15 @@ struct sigcontext {
15 unsigned long sc_pc; 15 unsigned long sc_pc;
16 unsigned short sc_formatvec; 16 unsigned short sc_formatvec;
17#ifndef __uClinux__ 17#ifndef __uClinux__
18# ifdef __mcoldfire__
19 unsigned long sc_fpregs[2][2]; /* room for two fp registers */
20 unsigned long sc_fpcntl[3];
21 unsigned char sc_fpstate[16+6*8];
22# else
18 unsigned long sc_fpregs[2*3]; /* room for two fp registers */ 23 unsigned long sc_fpregs[2*3]; /* room for two fp registers */
19 unsigned long sc_fpcntl[3]; 24 unsigned long sc_fpcntl[3];
20 unsigned char sc_fpstate[216]; 25 unsigned char sc_fpstate[216];
26# endif
21#endif 27#endif
22}; 28};
23 29
diff --git a/arch/m68k/include/asm/siginfo.h b/arch/m68k/include/asm/siginfo.h
index ca7dde8fd223..851d3d784b53 100644
--- a/arch/m68k/include/asm/siginfo.h
+++ b/arch/m68k/include/asm/siginfo.h
@@ -1,97 +1,6 @@
1#ifndef _M68K_SIGINFO_H 1#ifndef _M68K_SIGINFO_H
2#define _M68K_SIGINFO_H 2#define _M68K_SIGINFO_H
3 3
4#ifndef __uClinux__
5#define HAVE_ARCH_SIGINFO_T
6#define HAVE_ARCH_COPY_SIGINFO
7#endif
8
9#include <asm-generic/siginfo.h> 4#include <asm-generic/siginfo.h>
10 5
11#ifndef __uClinux__
12
13typedef struct siginfo {
14 int si_signo;
15 int si_errno;
16 int si_code;
17
18 union {
19 int _pad[SI_PAD_SIZE];
20
21 /* kill() */
22 struct {
23 __kernel_pid_t _pid; /* sender's pid */
24 __kernel_uid_t _uid; /* backwards compatibility */
25 __kernel_uid32_t _uid32; /* sender's uid */
26 } _kill;
27
28 /* POSIX.1b timers */
29 struct {
30 timer_t _tid; /* timer id */
31 int _overrun; /* overrun count */
32 char _pad[sizeof( __ARCH_SI_UID_T) - sizeof(int)];
33 sigval_t _sigval; /* same as below */
34 int _sys_private; /* not to be passed to user */
35 } _timer;
36
37 /* POSIX.1b signals */
38 struct {
39 __kernel_pid_t _pid; /* sender's pid */
40 __kernel_uid_t _uid; /* backwards compatibility */
41 sigval_t _sigval;
42 __kernel_uid32_t _uid32; /* sender's uid */
43 } _rt;
44
45 /* SIGCHLD */
46 struct {
47 __kernel_pid_t _pid; /* which child */
48 __kernel_uid_t _uid; /* backwards compatibility */
49 int _status; /* exit code */
50 clock_t _utime;
51 clock_t _stime;
52 __kernel_uid32_t _uid32; /* sender's uid */
53 } _sigchld;
54
55 /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
56 struct {
57 void *_addr; /* faulting insn/memory ref. */
58 } _sigfault;
59
60 /* SIGPOLL */
61 struct {
62 int _band; /* POLL_IN, POLL_OUT, POLL_MSG */
63 int _fd;
64 } _sigpoll;
65 } _sifields;
66} siginfo_t;
67
68#define UID16_SIGINFO_COMPAT_NEEDED
69
70/*
71 * How these fields are to be accessed.
72 */
73#undef si_uid
74#ifdef __KERNEL__
75#define si_uid _sifields._kill._uid32
76#define si_uid16 _sifields._kill._uid
77#else
78#define si_uid _sifields._kill._uid
79#endif
80
81#ifdef __KERNEL__
82
83#include <linux/string.h>
84
85static inline void copy_siginfo(struct siginfo *to, struct siginfo *from)
86{
87 if (from->si_code < 0)
88 memcpy(to, from, sizeof(*to));
89 else
90 /* _sigchld is currently the largest know union member */
91 memcpy(to, from, 3*sizeof(int) + sizeof(from->_sifields._sigchld));
92}
93
94#endif /* __KERNEL__ */
95#endif /* !__uClinux__ */
96
97#endif 6#endif
diff --git a/arch/m68k/include/asm/swab.h b/arch/m68k/include/asm/swab.h
index 5b754aace744..b7b37a40defc 100644
--- a/arch/m68k/include/asm/swab.h
+++ b/arch/m68k/include/asm/swab.h
@@ -14,7 +14,7 @@ static inline __attribute_const__ __u32 __arch_swab32(__u32 val)
14} 14}
15 15
16#define __arch_swab32 __arch_swab32 16#define __arch_swab32 __arch_swab32
17#elif !defined(__uClinux__) 17#elif !defined(__mcoldfire__)
18 18
19static inline __attribute_const__ __u32 __arch_swab32(__u32 val) 19static inline __attribute_const__ __u32 __arch_swab32(__u32 val)
20{ 20{
diff --git a/arch/m68k/include/asm/thread_info_mm.h b/arch/m68k/include/asm/thread_info_mm.h
index 167e518db41b..67266c683453 100644
--- a/arch/m68k/include/asm/thread_info_mm.h
+++ b/arch/m68k/include/asm/thread_info_mm.h
@@ -16,6 +16,7 @@ struct thread_info {
16 struct exec_domain *exec_domain; /* execution domain */ 16 struct exec_domain *exec_domain; /* execution domain */
17 int preempt_count; /* 0 => preemptable, <0 => BUG */ 17 int preempt_count; /* 0 => preemptable, <0 => BUG */
18 __u32 cpu; /* should always be 0 on m68k */ 18 __u32 cpu; /* should always be 0 on m68k */
19 unsigned long tp_value; /* thread pointer */
19 struct restart_block restart_block; 20 struct restart_block restart_block;
20}; 21};
21#endif /* __ASSEMBLY__ */ 22#endif /* __ASSEMBLY__ */
diff --git a/arch/m68k/include/asm/thread_info_no.h b/arch/m68k/include/asm/thread_info_no.h
index a6512bfdd01d..884776f686ca 100644
--- a/arch/m68k/include/asm/thread_info_no.h
+++ b/arch/m68k/include/asm/thread_info_no.h
@@ -37,6 +37,7 @@ struct thread_info {
37 unsigned long flags; /* low level flags */ 37 unsigned long flags; /* low level flags */
38 int cpu; /* cpu we're on */ 38 int cpu; /* cpu we're on */
39 int preempt_count; /* 0 => preemptable, <0 => BUG */ 39 int preempt_count; /* 0 => preemptable, <0 => BUG */
40 unsigned long tp_value; /* thread pointer */
40 struct restart_block restart_block; 41 struct restart_block restart_block;
41}; 42};
42 43
diff --git a/arch/m68k/include/asm/ucontext.h b/arch/m68k/include/asm/ucontext.h
index e4e22669edc0..00dcc5176c57 100644
--- a/arch/m68k/include/asm/ucontext.h
+++ b/arch/m68k/include/asm/ucontext.h
@@ -7,7 +7,11 @@ typedef greg_t gregset_t[NGREG];
7 7
8typedef struct fpregset { 8typedef struct fpregset {
9 int f_fpcntl[3]; 9 int f_fpcntl[3];
10#ifdef __mcoldfire__
11 int f_fpregs[8][2];
12#else
10 int f_fpregs[8*3]; 13 int f_fpregs[8*3];
14#endif
11} fpregset_t; 15} fpregset_t;
12 16
13struct mcontext { 17struct mcontext {
diff --git a/arch/m68k/include/asm/unistd.h b/arch/m68k/include/asm/unistd.h
index 48b87f5ced50..d72a71dabecb 100644
--- a/arch/m68k/include/asm/unistd.h
+++ b/arch/m68k/include/asm/unistd.h
@@ -336,10 +336,14 @@
336#define __NR_pwritev 330 336#define __NR_pwritev 330
337#define __NR_rt_tgsigqueueinfo 331 337#define __NR_rt_tgsigqueueinfo 331
338#define __NR_perf_event_open 332 338#define __NR_perf_event_open 332
339#define __NR_get_thread_area 333
340#define __NR_set_thread_area 334
341#define __NR_atomic_cmpxchg_32 335
342#define __NR_atomic_barrier 336
339 343
340#ifdef __KERNEL__ 344#ifdef __KERNEL__
341 345
342#define NR_syscalls 333 346#define NR_syscalls 337
343 347
344#define __ARCH_WANT_IPC_PARSE_VERSION 348#define __ARCH_WANT_IPC_PARSE_VERSION
345#define __ARCH_WANT_OLD_READDIR 349#define __ARCH_WANT_OLD_READDIR
diff --git a/arch/m68k/include/asm/virtconvert.h b/arch/m68k/include/asm/virtconvert.h
index 3f834b3ab5bd..f35229b8651d 100644
--- a/arch/m68k/include/asm/virtconvert.h
+++ b/arch/m68k/include/asm/virtconvert.h
@@ -31,12 +31,7 @@ static inline void *phys_to_virt(unsigned long address)
31#define page_to_phys(page) \ 31#define page_to_phys(page) \
32 __pa(PAGE_OFFSET + (((page) - pg_data_map[0].node_mem_map) << PAGE_SHIFT)) 32 __pa(PAGE_OFFSET + (((page) - pg_data_map[0].node_mem_map) << PAGE_SHIFT))
33#else 33#else
34#define page_to_phys(_page) ({ \ 34#define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT)
35 struct page *__page = _page; \
36 struct pglist_data *pgdat; \
37 pgdat = pg_data_table[page_to_nid(__page)]; \
38 page_to_pfn(__page) << PAGE_SHIFT; \
39})
40#endif 35#endif
41#else 36#else
42#define page_to_phys(page) (((page) - mem_map) << PAGE_SHIFT) 37#define page_to_phys(page) (((page) - mem_map) << PAGE_SHIFT)
diff --git a/arch/m68k/kernel/entry.S b/arch/m68k/kernel/entry.S
index 77fc7c16bf48..e136b8cbe9b9 100644
--- a/arch/m68k/kernel/entry.S
+++ b/arch/m68k/kernel/entry.S
@@ -761,4 +761,8 @@ sys_call_table:
761 .long sys_pwritev /* 330 */ 761 .long sys_pwritev /* 330 */
762 .long sys_rt_tgsigqueueinfo 762 .long sys_rt_tgsigqueueinfo
763 .long sys_perf_event_open 763 .long sys_perf_event_open
764 .long sys_get_thread_area
765 .long sys_set_thread_area
766 .long sys_atomic_cmpxchg_32 /* 335 */
767 .long sys_atomic_barrier
764 768
diff --git a/arch/m68k/kernel/process.c b/arch/m68k/kernel/process.c
index 05296593e718..17c3f325255d 100644
--- a/arch/m68k/kernel/process.c
+++ b/arch/m68k/kernel/process.c
@@ -251,6 +251,10 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
251 251
252 p->thread.usp = usp; 252 p->thread.usp = usp;
253 p->thread.ksp = (unsigned long)childstack; 253 p->thread.ksp = (unsigned long)childstack;
254
255 if (clone_flags & CLONE_SETTLS)
256 task_thread_info(p)->tp_value = regs->d5;
257
254 /* 258 /*
255 * Must save the current SFC/DFC value, NOT the value when 259 * Must save the current SFC/DFC value, NOT the value when
256 * the parent was last descheduled - RGH 10-08-96 260 * the parent was last descheduled - RGH 10-08-96
diff --git a/arch/m68k/kernel/ptrace.c b/arch/m68k/kernel/ptrace.c
index 1fc217e5f06b..616e59752c29 100644
--- a/arch/m68k/kernel/ptrace.c
+++ b/arch/m68k/kernel/ptrace.c
@@ -245,6 +245,11 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
245 ret = -EFAULT; 245 ret = -EFAULT;
246 break; 246 break;
247 247
248 case PTRACE_GET_THREAD_AREA:
249 ret = put_user(task_thread_info(child)->tp_value,
250 (unsigned long __user *)data);
251 break;
252
248 default: 253 default:
249 ret = ptrace_request(child, request, addr, data); 254 ret = ptrace_request(child, request, addr, data);
250 break; 255 break;
diff --git a/arch/m68k/kernel/signal.c b/arch/m68k/kernel/signal.c
index de2d05ddd86d..4b387538706f 100644
--- a/arch/m68k/kernel/signal.c
+++ b/arch/m68k/kernel/signal.c
@@ -897,10 +897,17 @@ static void setup_rt_frame (int sig, struct k_sigaction *ka, siginfo_t *info,
897 897
898 /* Set up to return from userspace. */ 898 /* Set up to return from userspace. */
899 err |= __put_user(frame->retcode, &frame->pretcode); 899 err |= __put_user(frame->retcode, &frame->pretcode);
900#ifdef __mcoldfire__
901 /* movel #__NR_rt_sigreturn,d0; trap #0 */
902 err |= __put_user(0x203c0000, (long __user *)(frame->retcode + 0));
903 err |= __put_user(0x00004e40 + (__NR_rt_sigreturn << 16),
904 (long __user *)(frame->retcode + 4));
905#else
900 /* moveq #,d0; notb d0; trap #0 */ 906 /* moveq #,d0; notb d0; trap #0 */
901 err |= __put_user(0x70004600 + ((__NR_rt_sigreturn ^ 0xff) << 16), 907 err |= __put_user(0x70004600 + ((__NR_rt_sigreturn ^ 0xff) << 16),
902 (long __user *)(frame->retcode + 0)); 908 (long __user *)(frame->retcode + 0));
903 err |= __put_user(0x4e40, (short __user *)(frame->retcode + 4)); 909 err |= __put_user(0x4e40, (short __user *)(frame->retcode + 4));
910#endif
904 911
905 if (err) 912 if (err)
906 goto give_sigsegv; 913 goto give_sigsegv;
diff --git a/arch/m68k/kernel/sys_m68k.c b/arch/m68k/kernel/sys_m68k.c
index 218f441de667..e3ad2d671973 100644
--- a/arch/m68k/kernel/sys_m68k.c
+++ b/arch/m68k/kernel/sys_m68k.c
@@ -28,6 +28,11 @@
28#include <asm/traps.h> 28#include <asm/traps.h>
29#include <asm/page.h> 29#include <asm/page.h>
30#include <asm/unistd.h> 30#include <asm/unistd.h>
31#include <linux/elf.h>
32#include <asm/tlb.h>
33
34asmlinkage int do_page_fault(struct pt_regs *regs, unsigned long address,
35 unsigned long error_code);
31 36
32asmlinkage long sys_mmap2(unsigned long addr, unsigned long len, 37asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
33 unsigned long prot, unsigned long flags, 38 unsigned long prot, unsigned long flags,
@@ -595,3 +600,79 @@ int kernel_execve(const char *filename, char *const argv[], char *const envp[])
595 : "d" (__a), "d" (__b), "d" (__c)); 600 : "d" (__a), "d" (__b), "d" (__c));
596 return __res; 601 return __res;
597} 602}
603
604asmlinkage unsigned long sys_get_thread_area(void)
605{
606 return current_thread_info()->tp_value;
607}
608
609asmlinkage int sys_set_thread_area(unsigned long tp)
610{
611 current_thread_info()->tp_value = tp;
612 return 0;
613}
614
615/* This syscall gets its arguments in A0 (mem), D2 (oldval) and
616 D1 (newval). */
617asmlinkage int
618sys_atomic_cmpxchg_32(unsigned long newval, int oldval, int d3, int d4, int d5,
619 unsigned long __user * mem)
620{
621 /* This was borrowed from ARM's implementation. */
622 for (;;) {
623 struct mm_struct *mm = current->mm;
624 pgd_t *pgd;
625 pmd_t *pmd;
626 pte_t *pte;
627 spinlock_t *ptl;
628 unsigned long mem_value;
629
630 down_read(&mm->mmap_sem);
631 pgd = pgd_offset(mm, (unsigned long)mem);
632 if (!pgd_present(*pgd))
633 goto bad_access;
634 pmd = pmd_offset(pgd, (unsigned long)mem);
635 if (!pmd_present(*pmd))
636 goto bad_access;
637 pte = pte_offset_map_lock(mm, pmd, (unsigned long)mem, &ptl);
638 if (!pte_present(*pte) || !pte_dirty(*pte)
639 || !pte_write(*pte)) {
640 pte_unmap_unlock(pte, ptl);
641 goto bad_access;
642 }
643
644 mem_value = *mem;
645 if (mem_value == oldval)
646 *mem = newval;
647
648 pte_unmap_unlock(pte, ptl);
649 up_read(&mm->mmap_sem);
650 return mem_value;
651
652 bad_access:
653 up_read(&mm->mmap_sem);
654 /* This is not necessarily a bad access, we can get here if
655 a memory we're trying to write to should be copied-on-write.
656 Make the kernel do the necessary page stuff, then re-iterate.
657 Simulate a write access fault to do that. */
658 {
659 /* The first argument of the function corresponds to
660 D1, which is the first field of struct pt_regs. */
661 struct pt_regs *fp = (struct pt_regs *)&newval;
662
663 /* '3' is an RMW flag. */
664 if (do_page_fault(fp, (unsigned long)mem, 3))
665 /* If the do_page_fault() failed, we don't
666 have anything meaningful to return.
667 There should be a SIGSEGV pending for
668 the process. */
669 return 0xdeadbeef;
670 }
671 }
672}
673
674asmlinkage int sys_atomic_barrier(void)
675{
676 /* no code needed for uniprocs */
677 return 0;
678}
diff --git a/arch/m68k/mac/Makefile b/arch/m68k/mac/Makefile
index daebd80bdef0..b8d4c835f9a2 100644
--- a/arch/m68k/mac/Makefile
+++ b/arch/m68k/mac/Makefile
@@ -3,4 +3,4 @@
3# 3#
4 4
5obj-y := config.o macints.o iop.o via.o oss.o psc.o \ 5obj-y := config.o macints.o iop.o via.o oss.o psc.o \
6 baboon.o macboing.o debug.o misc.o 6 baboon.o macboing.o misc.o
diff --git a/arch/m68k/mac/config.c b/arch/m68k/mac/config.c
index be017984a456..0356da9bf763 100644
--- a/arch/m68k/mac/config.c
+++ b/arch/m68k/mac/config.c
@@ -23,6 +23,8 @@
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#include <linux/platform_device.h>
26#include <linux/adb.h>
27#include <linux/cuda.h>
26 28
27#define BOOTINFO_COMPAT_1_0 29#define BOOTINFO_COMPAT_1_0
28#include <asm/setup.h> 30#include <asm/setup.h>
@@ -44,12 +46,7 @@
44#include <asm/mac_oss.h> 46#include <asm/mac_oss.h>
45#include <asm/mac_psc.h> 47#include <asm/mac_psc.h>
46 48
47/* platform device info */
48
49#define SWIM_IO_SIZE 0x2000 /* SWIM IO resource size */
50
51/* Mac bootinfo struct */ 49/* Mac bootinfo struct */
52
53struct mac_booter_data mac_bi_data; 50struct mac_booter_data mac_bi_data;
54 51
55/* The phys. video addr. - might be bogus on some machines */ 52/* The phys. video addr. - might be bogus on some machines */
@@ -70,8 +67,6 @@ extern void baboon_init(void);
70 67
71extern void mac_mksound(unsigned int, unsigned int); 68extern void mac_mksound(unsigned int, unsigned int);
72 69
73extern void nubus_sweep_video(void);
74
75static void mac_get_model(char *str); 70static void mac_get_model(char *str);
76static void mac_identify(void); 71static void mac_identify(void);
77static void mac_report_hardware(void); 72static void mac_report_hardware(void);
@@ -168,12 +163,6 @@ void __init config_mac(void)
168#if defined(CONFIG_INPUT_M68K_BEEP) || defined(CONFIG_INPUT_M68K_BEEP_MODULE) 163#if defined(CONFIG_INPUT_M68K_BEEP) || defined(CONFIG_INPUT_M68K_BEEP_MODULE)
169 mach_beep = mac_mksound; 164 mach_beep = mac_mksound;
170#endif 165#endif
171#ifdef CONFIG_HEARTBEAT
172#if 0
173 mach_heartbeat = mac_heartbeat;
174 mach_heartbeat_irq = IRQ_MAC_TIMER;
175#endif
176#endif
177 166
178 /* 167 /*
179 * Determine hardware present 168 * Determine hardware present
@@ -191,27 +180,19 @@ void __init config_mac(void)
191 if (macintosh_config->ident == MAC_MODEL_IICI 180 if (macintosh_config->ident == MAC_MODEL_IICI
192 || macintosh_config->ident == MAC_MODEL_IIFX) 181 || macintosh_config->ident == MAC_MODEL_IIFX)
193 mach_l2_flush = mac_cache_card_flush; 182 mach_l2_flush = mac_cache_card_flush;
194
195 /*
196 * Check for machine specific fixups.
197 */
198
199#ifdef OLD_NUBUS_CODE
200 nubus_sweep_video();
201#endif
202} 183}
203 184
204 185
205/* 186/*
206 * Macintosh Table: hardcoded model configuration data. 187 * Macintosh Table: hardcoded model configuration data.
207 * 188 *
208 * Much of this was defined by Alan, based on who knows what docs. 189 * Much of this was defined by Alan, based on who knows what docs.
209 * I've added a lot more, and some of that was pure guesswork based 190 * I've added a lot more, and some of that was pure guesswork based
210 * on hardware pages present on the Mac web site. Possibly wildly 191 * on hardware pages present on the Mac web site. Possibly wildly
211 * inaccurate, so look here if a new Mac model won't run. Example: if 192 * inaccurate, so look here if a new Mac model won't run. Example: if
212 * a Mac crashes immediately after the VIA1 registers have been dumped 193 * a Mac crashes immediately after the VIA1 registers have been dumped
213 * to the screen, it probably died attempting to read DirB on a RBV. 194 * to the screen, it probably died attempting to read DirB on a RBV.
214 * Meaning it should have MAC_VIA_IIci here :-) 195 * Meaning it should have MAC_VIA_IIci here :-)
215 */ 196 */
216 197
217struct mac_model *macintosh_config; 198struct mac_model *macintosh_config;
@@ -219,7 +200,7 @@ EXPORT_SYMBOL(macintosh_config);
219 200
220static struct mac_model mac_data_table[] = { 201static struct mac_model mac_data_table[] = {
221 /* 202 /*
222 * We'll pretend to be a Macintosh II, that's pretty safe. 203 * We'll pretend to be a Macintosh II, that's pretty safe.
223 */ 204 */
224 205
225 { 206 {
@@ -230,12 +211,11 @@ static struct mac_model mac_data_table[] = {
230 .scsi_type = MAC_SCSI_OLD, 211 .scsi_type = MAC_SCSI_OLD,
231 .scc_type = MAC_SCC_II, 212 .scc_type = MAC_SCC_II,
232 .nubus_type = MAC_NUBUS, 213 .nubus_type = MAC_NUBUS,
233 .floppy_type = MAC_FLOPPY_IWM 214 .floppy_type = MAC_FLOPPY_IWM,
234 }, 215 },
235 216
236 /* 217 /*
237 * Original MacII hardware 218 * Original Mac II hardware
238 *
239 */ 219 */
240 220
241 { 221 {
@@ -246,7 +226,7 @@ static struct mac_model mac_data_table[] = {
246 .scsi_type = MAC_SCSI_OLD, 226 .scsi_type = MAC_SCSI_OLD,
247 .scc_type = MAC_SCC_II, 227 .scc_type = MAC_SCC_II,
248 .nubus_type = MAC_NUBUS, 228 .nubus_type = MAC_NUBUS,
249 .floppy_type = MAC_FLOPPY_IWM 229 .floppy_type = MAC_FLOPPY_IWM,
250 }, { 230 }, {
251 .ident = MAC_MODEL_IIX, 231 .ident = MAC_MODEL_IIX,
252 .name = "IIx", 232 .name = "IIx",
@@ -255,7 +235,7 @@ static struct mac_model mac_data_table[] = {
255 .scsi_type = MAC_SCSI_OLD, 235 .scsi_type = MAC_SCSI_OLD,
256 .scc_type = MAC_SCC_II, 236 .scc_type = MAC_SCC_II,
257 .nubus_type = MAC_NUBUS, 237 .nubus_type = MAC_NUBUS,
258 .floppy_type = MAC_FLOPPY_SWIM_ADDR2 238 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
259 }, { 239 }, {
260 .ident = MAC_MODEL_IICX, 240 .ident = MAC_MODEL_IICX,
261 .name = "IIcx", 241 .name = "IIcx",
@@ -264,7 +244,7 @@ static struct mac_model mac_data_table[] = {
264 .scsi_type = MAC_SCSI_OLD, 244 .scsi_type = MAC_SCSI_OLD,
265 .scc_type = MAC_SCC_II, 245 .scc_type = MAC_SCC_II,
266 .nubus_type = MAC_NUBUS, 246 .nubus_type = MAC_NUBUS,
267 .floppy_type = MAC_FLOPPY_SWIM_ADDR2 247 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
268 }, { 248 }, {
269 .ident = MAC_MODEL_SE30, 249 .ident = MAC_MODEL_SE30,
270 .name = "SE/30", 250 .name = "SE/30",
@@ -273,13 +253,13 @@ static struct mac_model mac_data_table[] = {
273 .scsi_type = MAC_SCSI_OLD, 253 .scsi_type = MAC_SCSI_OLD,
274 .scc_type = MAC_SCC_II, 254 .scc_type = MAC_SCC_II,
275 .nubus_type = MAC_NUBUS, 255 .nubus_type = MAC_NUBUS,
276 .floppy_type = MAC_FLOPPY_SWIM_ADDR2 256 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
277 }, 257 },
278 258
279 /* 259 /*
280 * Weirdified MacII hardware - all subtly different. Gee thanks 260 * Weirdified Mac II hardware - all subtly different. Gee thanks
281 * Apple. All these boxes seem to have VIA2 in a different place to 261 * Apple. All these boxes seem to have VIA2 in a different place to
282 * the MacII (+1A000 rather than +4000) 262 * the Mac II (+1A000 rather than +4000)
283 * CSA: see http://developer.apple.com/technotes/hw/hw_09.html 263 * CSA: see http://developer.apple.com/technotes/hw/hw_09.html
284 */ 264 */
285 265
@@ -291,7 +271,7 @@ static struct mac_model mac_data_table[] = {
291 .scsi_type = MAC_SCSI_OLD, 271 .scsi_type = MAC_SCSI_OLD,
292 .scc_type = MAC_SCC_II, 272 .scc_type = MAC_SCC_II,
293 .nubus_type = MAC_NUBUS, 273 .nubus_type = MAC_NUBUS,
294 .floppy_type = MAC_FLOPPY_SWIM_ADDR2 274 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
295 }, { 275 }, {
296 .ident = MAC_MODEL_IIFX, 276 .ident = MAC_MODEL_IIFX,
297 .name = "IIfx", 277 .name = "IIfx",
@@ -300,7 +280,7 @@ static struct mac_model mac_data_table[] = {
300 .scsi_type = MAC_SCSI_OLD, 280 .scsi_type = MAC_SCSI_OLD,
301 .scc_type = MAC_SCC_IOP, 281 .scc_type = MAC_SCC_IOP,
302 .nubus_type = MAC_NUBUS, 282 .nubus_type = MAC_NUBUS,
303 .floppy_type = MAC_FLOPPY_SWIM_IOP 283 .floppy_type = MAC_FLOPPY_SWIM_IOP,
304 }, { 284 }, {
305 .ident = MAC_MODEL_IISI, 285 .ident = MAC_MODEL_IISI,
306 .name = "IIsi", 286 .name = "IIsi",
@@ -309,7 +289,7 @@ static struct mac_model mac_data_table[] = {
309 .scsi_type = MAC_SCSI_OLD, 289 .scsi_type = MAC_SCSI_OLD,
310 .scc_type = MAC_SCC_II, 290 .scc_type = MAC_SCC_II,
311 .nubus_type = MAC_NUBUS, 291 .nubus_type = MAC_NUBUS,
312 .floppy_type = MAC_FLOPPY_SWIM_ADDR2 292 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
313 }, { 293 }, {
314 .ident = MAC_MODEL_IIVI, 294 .ident = MAC_MODEL_IIVI,
315 .name = "IIvi", 295 .name = "IIvi",
@@ -318,7 +298,7 @@ static struct mac_model mac_data_table[] = {
318 .scsi_type = MAC_SCSI_OLD, 298 .scsi_type = MAC_SCSI_OLD,
319 .scc_type = MAC_SCC_II, 299 .scc_type = MAC_SCC_II,
320 .nubus_type = MAC_NUBUS, 300 .nubus_type = MAC_NUBUS,
321 .floppy_type = MAC_FLOPPY_SWIM_ADDR2 301 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
322 }, { 302 }, {
323 .ident = MAC_MODEL_IIVX, 303 .ident = MAC_MODEL_IIVX,
324 .name = "IIvx", 304 .name = "IIvx",
@@ -327,11 +307,11 @@ static struct mac_model mac_data_table[] = {
327 .scsi_type = MAC_SCSI_OLD, 307 .scsi_type = MAC_SCSI_OLD,
328 .scc_type = MAC_SCC_II, 308 .scc_type = MAC_SCC_II,
329 .nubus_type = MAC_NUBUS, 309 .nubus_type = MAC_NUBUS,
330 .floppy_type = MAC_FLOPPY_SWIM_ADDR2 310 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
331 }, 311 },
332 312
333 /* 313 /*
334 * Classic models (guessing: similar to SE/30 ?? Nope, similar to LC ...) 314 * Classic models (guessing: similar to SE/30? Nope, similar to LC...)
335 */ 315 */
336 316
337 { 317 {
@@ -342,7 +322,7 @@ static struct mac_model mac_data_table[] = {
342 .scsi_type = MAC_SCSI_OLD, 322 .scsi_type = MAC_SCSI_OLD,
343 .scc_type = MAC_SCC_II, 323 .scc_type = MAC_SCC_II,
344 .nubus_type = MAC_NUBUS, 324 .nubus_type = MAC_NUBUS,
345 .floppy_type = MAC_FLOPPY_SWIM_ADDR2 325 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
346 }, { 326 }, {
347 .ident = MAC_MODEL_CCL, 327 .ident = MAC_MODEL_CCL,
348 .name = "Color Classic", 328 .name = "Color Classic",
@@ -351,11 +331,11 @@ static struct mac_model mac_data_table[] = {
351 .scsi_type = MAC_SCSI_OLD, 331 .scsi_type = MAC_SCSI_OLD,
352 .scc_type = MAC_SCC_II, 332 .scc_type = MAC_SCC_II,
353 .nubus_type = MAC_NUBUS, 333 .nubus_type = MAC_NUBUS,
354 .floppy_type = MAC_FLOPPY_SWIM_ADDR2 334 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
355 }, 335 },
356 336
357 /* 337 /*
358 * Some Mac LC machines. Basically the same as the IIci, ADB like IIsi 338 * Some Mac LC machines. Basically the same as the IIci, ADB like IIsi
359 */ 339 */
360 340
361 { 341 {
@@ -366,7 +346,7 @@ static struct mac_model mac_data_table[] = {
366 .scsi_type = MAC_SCSI_OLD, 346 .scsi_type = MAC_SCSI_OLD,
367 .scc_type = MAC_SCC_II, 347 .scc_type = MAC_SCC_II,
368 .nubus_type = MAC_NUBUS, 348 .nubus_type = MAC_NUBUS,
369 .floppy_type = MAC_FLOPPY_SWIM_ADDR2 349 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
370 }, { 350 }, {
371 .ident = MAC_MODEL_LCII, 351 .ident = MAC_MODEL_LCII,
372 .name = "LC II", 352 .name = "LC II",
@@ -375,7 +355,7 @@ static struct mac_model mac_data_table[] = {
375 .scsi_type = MAC_SCSI_OLD, 355 .scsi_type = MAC_SCSI_OLD,
376 .scc_type = MAC_SCC_II, 356 .scc_type = MAC_SCC_II,
377 .nubus_type = MAC_NUBUS, 357 .nubus_type = MAC_NUBUS,
378 .floppy_type = MAC_FLOPPY_SWIM_ADDR2 358 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
379 }, { 359 }, {
380 .ident = MAC_MODEL_LCIII, 360 .ident = MAC_MODEL_LCIII,
381 .name = "LC III", 361 .name = "LC III",
@@ -384,17 +364,17 @@ static struct mac_model mac_data_table[] = {
384 .scsi_type = MAC_SCSI_OLD, 364 .scsi_type = MAC_SCSI_OLD,
385 .scc_type = MAC_SCC_II, 365 .scc_type = MAC_SCC_II,
386 .nubus_type = MAC_NUBUS, 366 .nubus_type = MAC_NUBUS,
387 .floppy_type = MAC_FLOPPY_SWIM_ADDR2 367 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
388 }, 368 },
389 369
390 /* 370 /*
391 * Quadra. Video is at 0xF9000000, via is like a MacII. We label it differently 371 * Quadra. Video is at 0xF9000000, via is like a MacII. We label it
392 * as some of the stuff connected to VIA2 seems different. Better SCSI chip and 372 * differently as some of the stuff connected to VIA2 seems different.
393 * onboard ethernet using a NatSemi SONIC except the 660AV and 840AV which use an 373 * Better SCSI chip and onboard ethernet using a NatSemi SONIC except
394 * AMD 79C940 (MACE). 374 * the 660AV and 840AV which use an AMD 79C940 (MACE).
395 * The 700, 900 and 950 have some I/O chips in the wrong place to 375 * The 700, 900 and 950 have some I/O chips in the wrong place to
396 * confuse us. The 840AV has a SCSI location of its own (same as 376 * confuse us. The 840AV has a SCSI location of its own (same as
397 * the 660AV). 377 * the 660AV).
398 */ 378 */
399 379
400 { 380 {
@@ -405,7 +385,7 @@ static struct mac_model mac_data_table[] = {
405 .scsi_type = MAC_SCSI_QUADRA, 385 .scsi_type = MAC_SCSI_QUADRA,
406 .scc_type = MAC_SCC_QUADRA, 386 .scc_type = MAC_SCC_QUADRA,
407 .nubus_type = MAC_NUBUS, 387 .nubus_type = MAC_NUBUS,
408 .floppy_type = MAC_FLOPPY_SWIM_ADDR1 388 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
409 }, { 389 }, {
410 .ident = MAC_MODEL_Q605_ACC, 390 .ident = MAC_MODEL_Q605_ACC,
411 .name = "Quadra 605", 391 .name = "Quadra 605",
@@ -414,7 +394,7 @@ static struct mac_model mac_data_table[] = {
414 .scsi_type = MAC_SCSI_QUADRA, 394 .scsi_type = MAC_SCSI_QUADRA,
415 .scc_type = MAC_SCC_QUADRA, 395 .scc_type = MAC_SCC_QUADRA,
416 .nubus_type = MAC_NUBUS, 396 .nubus_type = MAC_NUBUS,
417 .floppy_type = MAC_FLOPPY_SWIM_ADDR1 397 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
418 }, { 398 }, {
419 .ident = MAC_MODEL_Q610, 399 .ident = MAC_MODEL_Q610,
420 .name = "Quadra 610", 400 .name = "Quadra 610",
@@ -424,7 +404,7 @@ static struct mac_model mac_data_table[] = {
424 .scc_type = MAC_SCC_QUADRA, 404 .scc_type = MAC_SCC_QUADRA,
425 .ether_type = MAC_ETHER_SONIC, 405 .ether_type = MAC_ETHER_SONIC,
426 .nubus_type = MAC_NUBUS, 406 .nubus_type = MAC_NUBUS,
427 .floppy_type = MAC_FLOPPY_SWIM_ADDR1 407 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
428 }, { 408 }, {
429 .ident = MAC_MODEL_Q630, 409 .ident = MAC_MODEL_Q630,
430 .name = "Quadra 630", 410 .name = "Quadra 630",
@@ -435,7 +415,7 @@ static struct mac_model mac_data_table[] = {
435 .scc_type = MAC_SCC_QUADRA, 415 .scc_type = MAC_SCC_QUADRA,
436 .ether_type = MAC_ETHER_SONIC, 416 .ether_type = MAC_ETHER_SONIC,
437 .nubus_type = MAC_NUBUS, 417 .nubus_type = MAC_NUBUS,
438 .floppy_type = MAC_FLOPPY_SWIM_ADDR1 418 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
439 }, { 419 }, {
440 .ident = MAC_MODEL_Q650, 420 .ident = MAC_MODEL_Q650,
441 .name = "Quadra 650", 421 .name = "Quadra 650",
@@ -445,9 +425,9 @@ static struct mac_model mac_data_table[] = {
445 .scc_type = MAC_SCC_QUADRA, 425 .scc_type = MAC_SCC_QUADRA,
446 .ether_type = MAC_ETHER_SONIC, 426 .ether_type = MAC_ETHER_SONIC,
447 .nubus_type = MAC_NUBUS, 427 .nubus_type = MAC_NUBUS,
448 .floppy_type = MAC_FLOPPY_SWIM_ADDR1 428 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
449 }, 429 },
450 /* The Q700 does have a NS Sonic */ 430 /* The Q700 does have a NS Sonic */
451 { 431 {
452 .ident = MAC_MODEL_Q700, 432 .ident = MAC_MODEL_Q700,
453 .name = "Quadra 700", 433 .name = "Quadra 700",
@@ -457,7 +437,7 @@ static struct mac_model mac_data_table[] = {
457 .scc_type = MAC_SCC_QUADRA, 437 .scc_type = MAC_SCC_QUADRA,
458 .ether_type = MAC_ETHER_SONIC, 438 .ether_type = MAC_ETHER_SONIC,
459 .nubus_type = MAC_NUBUS, 439 .nubus_type = MAC_NUBUS,
460 .floppy_type = MAC_FLOPPY_SWIM_ADDR1 440 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
461 }, { 441 }, {
462 .ident = MAC_MODEL_Q800, 442 .ident = MAC_MODEL_Q800,
463 .name = "Quadra 800", 443 .name = "Quadra 800",
@@ -467,7 +447,7 @@ static struct mac_model mac_data_table[] = {
467 .scc_type = MAC_SCC_QUADRA, 447 .scc_type = MAC_SCC_QUADRA,
468 .ether_type = MAC_ETHER_SONIC, 448 .ether_type = MAC_ETHER_SONIC,
469 .nubus_type = MAC_NUBUS, 449 .nubus_type = MAC_NUBUS,
470 .floppy_type = MAC_FLOPPY_SWIM_ADDR1 450 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
471 }, { 451 }, {
472 .ident = MAC_MODEL_Q840, 452 .ident = MAC_MODEL_Q840,
473 .name = "Quadra 840AV", 453 .name = "Quadra 840AV",
@@ -477,7 +457,7 @@ static struct mac_model mac_data_table[] = {
477 .scc_type = MAC_SCC_PSC, 457 .scc_type = MAC_SCC_PSC,
478 .ether_type = MAC_ETHER_MACE, 458 .ether_type = MAC_ETHER_MACE,
479 .nubus_type = MAC_NUBUS, 459 .nubus_type = MAC_NUBUS,
480 .floppy_type = MAC_FLOPPY_AV 460 .floppy_type = MAC_FLOPPY_AV,
481 }, { 461 }, {
482 .ident = MAC_MODEL_Q900, 462 .ident = MAC_MODEL_Q900,
483 .name = "Quadra 900", 463 .name = "Quadra 900",
@@ -487,7 +467,7 @@ static struct mac_model mac_data_table[] = {
487 .scc_type = MAC_SCC_IOP, 467 .scc_type = MAC_SCC_IOP,
488 .ether_type = MAC_ETHER_SONIC, 468 .ether_type = MAC_ETHER_SONIC,
489 .nubus_type = MAC_NUBUS, 469 .nubus_type = MAC_NUBUS,
490 .floppy_type = MAC_FLOPPY_SWIM_IOP 470 .floppy_type = MAC_FLOPPY_SWIM_IOP,
491 }, { 471 }, {
492 .ident = MAC_MODEL_Q950, 472 .ident = MAC_MODEL_Q950,
493 .name = "Quadra 950", 473 .name = "Quadra 950",
@@ -497,60 +477,60 @@ static struct mac_model mac_data_table[] = {
497 .scc_type = MAC_SCC_IOP, 477 .scc_type = MAC_SCC_IOP,
498 .ether_type = MAC_ETHER_SONIC, 478 .ether_type = MAC_ETHER_SONIC,
499 .nubus_type = MAC_NUBUS, 479 .nubus_type = MAC_NUBUS,
500 .floppy_type = MAC_FLOPPY_SWIM_IOP 480 .floppy_type = MAC_FLOPPY_SWIM_IOP,
501 }, 481 },
502 482
503 /* 483 /*
504 * Performa - more LC type machines 484 * Performa - more LC type machines
505 */ 485 */
506 486
507 { 487 {
508 .ident = MAC_MODEL_P460, 488 .ident = MAC_MODEL_P460,
509 .name = "Performa 460", 489 .name = "Performa 460",
510 .adb_type = MAC_ADB_IISI, 490 .adb_type = MAC_ADB_IISI,
511 .via_type = MAC_VIA_IIci, 491 .via_type = MAC_VIA_IIci,
512 .scsi_type = MAC_SCSI_OLD, 492 .scsi_type = MAC_SCSI_OLD,
513 .scc_type = MAC_SCC_II, 493 .scc_type = MAC_SCC_II,
514 .nubus_type = MAC_NUBUS, 494 .nubus_type = MAC_NUBUS,
515 .floppy_type = MAC_FLOPPY_SWIM_ADDR2 495 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
516 }, { 496 }, {
517 .ident = MAC_MODEL_P475, 497 .ident = MAC_MODEL_P475,
518 .name = "Performa 475", 498 .name = "Performa 475",
519 .adb_type = MAC_ADB_CUDA, 499 .adb_type = MAC_ADB_CUDA,
520 .via_type = MAC_VIA_QUADRA, 500 .via_type = MAC_VIA_QUADRA,
521 .scsi_type = MAC_SCSI_QUADRA, 501 .scsi_type = MAC_SCSI_QUADRA,
522 .scc_type = MAC_SCC_II, 502 .scc_type = MAC_SCC_II,
523 .nubus_type = MAC_NUBUS, 503 .nubus_type = MAC_NUBUS,
524 .floppy_type = MAC_FLOPPY_SWIM_ADDR1 504 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
525 }, { 505 }, {
526 .ident = MAC_MODEL_P475F, 506 .ident = MAC_MODEL_P475F,
527 .name = "Performa 475", 507 .name = "Performa 475",
528 .adb_type = MAC_ADB_CUDA, 508 .adb_type = MAC_ADB_CUDA,
529 .via_type = MAC_VIA_QUADRA, 509 .via_type = MAC_VIA_QUADRA,
530 .scsi_type = MAC_SCSI_QUADRA, 510 .scsi_type = MAC_SCSI_QUADRA,
531 .scc_type = MAC_SCC_II, 511 .scc_type = MAC_SCC_II,
532 .nubus_type = MAC_NUBUS, 512 .nubus_type = MAC_NUBUS,
533 .floppy_type = MAC_FLOPPY_SWIM_ADDR1 513 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
534 }, { 514 }, {
535 .ident = MAC_MODEL_P520, 515 .ident = MAC_MODEL_P520,
536 .name = "Performa 520", 516 .name = "Performa 520",
537 .adb_type = MAC_ADB_CUDA, 517 .adb_type = MAC_ADB_CUDA,
538 .via_type = MAC_VIA_IIci, 518 .via_type = MAC_VIA_IIci,
539 .scsi_type = MAC_SCSI_OLD, 519 .scsi_type = MAC_SCSI_OLD,
540 .scc_type = MAC_SCC_II, 520 .scc_type = MAC_SCC_II,
541 .nubus_type = MAC_NUBUS, 521 .nubus_type = MAC_NUBUS,
542 .floppy_type = MAC_FLOPPY_SWIM_ADDR2 522 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
543 }, { 523 }, {
544 .ident = MAC_MODEL_P550, 524 .ident = MAC_MODEL_P550,
545 .name = "Performa 550", 525 .name = "Performa 550",
546 .adb_type = MAC_ADB_CUDA, 526 .adb_type = MAC_ADB_CUDA,
547 .via_type = MAC_VIA_IIci, 527 .via_type = MAC_VIA_IIci,
548 .scsi_type = MAC_SCSI_OLD, 528 .scsi_type = MAC_SCSI_OLD,
549 .scc_type = MAC_SCC_II, 529 .scc_type = MAC_SCC_II,
550 .nubus_type = MAC_NUBUS, 530 .nubus_type = MAC_NUBUS,
551 .floppy_type = MAC_FLOPPY_SWIM_ADDR2 531 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
552 }, 532 },
553 /* These have the comm slot, and therefore the possibility of SONIC ethernet */ 533 /* These have the comm slot, and therefore possibly SONIC ethernet */
554 { 534 {
555 .ident = MAC_MODEL_P575, 535 .ident = MAC_MODEL_P575,
556 .name = "Performa 575", 536 .name = "Performa 575",
@@ -560,7 +540,7 @@ static struct mac_model mac_data_table[] = {
560 .scc_type = MAC_SCC_II, 540 .scc_type = MAC_SCC_II,
561 .ether_type = MAC_ETHER_SONIC, 541 .ether_type = MAC_ETHER_SONIC,
562 .nubus_type = MAC_NUBUS, 542 .nubus_type = MAC_NUBUS,
563 .floppy_type = MAC_FLOPPY_SWIM_ADDR1 543 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
564 }, { 544 }, {
565 .ident = MAC_MODEL_P588, 545 .ident = MAC_MODEL_P588,
566 .name = "Performa 588", 546 .name = "Performa 588",
@@ -571,7 +551,7 @@ static struct mac_model mac_data_table[] = {
571 .scc_type = MAC_SCC_II, 551 .scc_type = MAC_SCC_II,
572 .ether_type = MAC_ETHER_SONIC, 552 .ether_type = MAC_ETHER_SONIC,
573 .nubus_type = MAC_NUBUS, 553 .nubus_type = MAC_NUBUS,
574 .floppy_type = MAC_FLOPPY_SWIM_ADDR1 554 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
575 }, { 555 }, {
576 .ident = MAC_MODEL_TV, 556 .ident = MAC_MODEL_TV,
577 .name = "TV", 557 .name = "TV",
@@ -580,7 +560,7 @@ static struct mac_model mac_data_table[] = {
580 .scsi_type = MAC_SCSI_OLD, 560 .scsi_type = MAC_SCSI_OLD,
581 .scc_type = MAC_SCC_II, 561 .scc_type = MAC_SCC_II,
582 .nubus_type = MAC_NUBUS, 562 .nubus_type = MAC_NUBUS,
583 .floppy_type = MAC_FLOPPY_SWIM_ADDR2 563 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
584 }, { 564 }, {
585 .ident = MAC_MODEL_P600, 565 .ident = MAC_MODEL_P600,
586 .name = "Performa 600", 566 .name = "Performa 600",
@@ -589,14 +569,14 @@ static struct mac_model mac_data_table[] = {
589 .scsi_type = MAC_SCSI_OLD, 569 .scsi_type = MAC_SCSI_OLD,
590 .scc_type = MAC_SCC_II, 570 .scc_type = MAC_SCC_II,
591 .nubus_type = MAC_NUBUS, 571 .nubus_type = MAC_NUBUS,
592 .floppy_type = MAC_FLOPPY_SWIM_ADDR2 572 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
593 }, 573 },
594 574
595 /* 575 /*
596 * Centris - just guessing again; maybe like Quadra 576 * Centris - just guessing again; maybe like Quadra.
577 * The C610 may or may not have SONIC. We probe to make sure.
597 */ 578 */
598 579
599 /* The C610 may or may not have SONIC. We probe to make sure */
600 { 580 {
601 .ident = MAC_MODEL_C610, 581 .ident = MAC_MODEL_C610,
602 .name = "Centris 610", 582 .name = "Centris 610",
@@ -606,7 +586,7 @@ static struct mac_model mac_data_table[] = {
606 .scc_type = MAC_SCC_QUADRA, 586 .scc_type = MAC_SCC_QUADRA,
607 .ether_type = MAC_ETHER_SONIC, 587 .ether_type = MAC_ETHER_SONIC,
608 .nubus_type = MAC_NUBUS, 588 .nubus_type = MAC_NUBUS,
609 .floppy_type = MAC_FLOPPY_SWIM_ADDR1 589 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
610 }, { 590 }, {
611 .ident = MAC_MODEL_C650, 591 .ident = MAC_MODEL_C650,
612 .name = "Centris 650", 592 .name = "Centris 650",
@@ -616,7 +596,7 @@ static struct mac_model mac_data_table[] = {
616 .scc_type = MAC_SCC_QUADRA, 596 .scc_type = MAC_SCC_QUADRA,
617 .ether_type = MAC_ETHER_SONIC, 597 .ether_type = MAC_ETHER_SONIC,
618 .nubus_type = MAC_NUBUS, 598 .nubus_type = MAC_NUBUS,
619 .floppy_type = MAC_FLOPPY_SWIM_ADDR1 599 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
620 }, { 600 }, {
621 .ident = MAC_MODEL_C660, 601 .ident = MAC_MODEL_C660,
622 .name = "Centris 660AV", 602 .name = "Centris 660AV",
@@ -626,7 +606,7 @@ static struct mac_model mac_data_table[] = {
626 .scc_type = MAC_SCC_PSC, 606 .scc_type = MAC_SCC_PSC,
627 .ether_type = MAC_ETHER_MACE, 607 .ether_type = MAC_ETHER_MACE,
628 .nubus_type = MAC_NUBUS, 608 .nubus_type = MAC_NUBUS,
629 .floppy_type = MAC_FLOPPY_AV 609 .floppy_type = MAC_FLOPPY_AV,
630 }, 610 },
631 611
632 /* 612 /*
@@ -643,7 +623,7 @@ static struct mac_model mac_data_table[] = {
643 .scsi_type = MAC_SCSI_OLD, 623 .scsi_type = MAC_SCSI_OLD,
644 .scc_type = MAC_SCC_QUADRA, 624 .scc_type = MAC_SCC_QUADRA,
645 .nubus_type = MAC_NUBUS, 625 .nubus_type = MAC_NUBUS,
646 .floppy_type = MAC_FLOPPY_SWIM_ADDR2 626 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
647 }, { 627 }, {
648 .ident = MAC_MODEL_PB145, 628 .ident = MAC_MODEL_PB145,
649 .name = "PowerBook 145", 629 .name = "PowerBook 145",
@@ -652,7 +632,7 @@ static struct mac_model mac_data_table[] = {
652 .scsi_type = MAC_SCSI_OLD, 632 .scsi_type = MAC_SCSI_OLD,
653 .scc_type = MAC_SCC_QUADRA, 633 .scc_type = MAC_SCC_QUADRA,
654 .nubus_type = MAC_NUBUS, 634 .nubus_type = MAC_NUBUS,
655 .floppy_type = MAC_FLOPPY_SWIM_ADDR2 635 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
656 }, { 636 }, {
657 .ident = MAC_MODEL_PB150, 637 .ident = MAC_MODEL_PB150,
658 .name = "PowerBook 150", 638 .name = "PowerBook 150",
@@ -662,7 +642,7 @@ static struct mac_model mac_data_table[] = {
662 .ide_type = MAC_IDE_PB, 642 .ide_type = MAC_IDE_PB,
663 .scc_type = MAC_SCC_QUADRA, 643 .scc_type = MAC_SCC_QUADRA,
664 .nubus_type = MAC_NUBUS, 644 .nubus_type = MAC_NUBUS,
665 .floppy_type = MAC_FLOPPY_SWIM_ADDR2 645 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
666 }, { 646 }, {
667 .ident = MAC_MODEL_PB160, 647 .ident = MAC_MODEL_PB160,
668 .name = "PowerBook 160", 648 .name = "PowerBook 160",
@@ -671,7 +651,7 @@ static struct mac_model mac_data_table[] = {
671 .scsi_type = MAC_SCSI_OLD, 651 .scsi_type = MAC_SCSI_OLD,
672 .scc_type = MAC_SCC_QUADRA, 652 .scc_type = MAC_SCC_QUADRA,
673 .nubus_type = MAC_NUBUS, 653 .nubus_type = MAC_NUBUS,
674 .floppy_type = MAC_FLOPPY_SWIM_ADDR2 654 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
675 }, { 655 }, {
676 .ident = MAC_MODEL_PB165, 656 .ident = MAC_MODEL_PB165,
677 .name = "PowerBook 165", 657 .name = "PowerBook 165",
@@ -680,7 +660,7 @@ static struct mac_model mac_data_table[] = {
680 .scsi_type = MAC_SCSI_OLD, 660 .scsi_type = MAC_SCSI_OLD,
681 .scc_type = MAC_SCC_QUADRA, 661 .scc_type = MAC_SCC_QUADRA,
682 .nubus_type = MAC_NUBUS, 662 .nubus_type = MAC_NUBUS,
683 .floppy_type = MAC_FLOPPY_SWIM_ADDR2 663 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
684 }, { 664 }, {
685 .ident = MAC_MODEL_PB165C, 665 .ident = MAC_MODEL_PB165C,
686 .name = "PowerBook 165c", 666 .name = "PowerBook 165c",
@@ -689,7 +669,7 @@ static struct mac_model mac_data_table[] = {
689 .scsi_type = MAC_SCSI_OLD, 669 .scsi_type = MAC_SCSI_OLD,
690 .scc_type = MAC_SCC_QUADRA, 670 .scc_type = MAC_SCC_QUADRA,
691 .nubus_type = MAC_NUBUS, 671 .nubus_type = MAC_NUBUS,
692 .floppy_type = MAC_FLOPPY_SWIM_ADDR2 672 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
693 }, { 673 }, {
694 .ident = MAC_MODEL_PB170, 674 .ident = MAC_MODEL_PB170,
695 .name = "PowerBook 170", 675 .name = "PowerBook 170",
@@ -698,7 +678,7 @@ static struct mac_model mac_data_table[] = {
698 .scsi_type = MAC_SCSI_OLD, 678 .scsi_type = MAC_SCSI_OLD,
699 .scc_type = MAC_SCC_QUADRA, 679 .scc_type = MAC_SCC_QUADRA,
700 .nubus_type = MAC_NUBUS, 680 .nubus_type = MAC_NUBUS,
701 .floppy_type = MAC_FLOPPY_SWIM_ADDR2 681 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
702 }, { 682 }, {
703 .ident = MAC_MODEL_PB180, 683 .ident = MAC_MODEL_PB180,
704 .name = "PowerBook 180", 684 .name = "PowerBook 180",
@@ -707,7 +687,7 @@ static struct mac_model mac_data_table[] = {
707 .scsi_type = MAC_SCSI_OLD, 687 .scsi_type = MAC_SCSI_OLD,
708 .scc_type = MAC_SCC_QUADRA, 688 .scc_type = MAC_SCC_QUADRA,
709 .nubus_type = MAC_NUBUS, 689 .nubus_type = MAC_NUBUS,
710 .floppy_type = MAC_FLOPPY_SWIM_ADDR2 690 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
711 }, { 691 }, {
712 .ident = MAC_MODEL_PB180C, 692 .ident = MAC_MODEL_PB180C,
713 .name = "PowerBook 180c", 693 .name = "PowerBook 180c",
@@ -716,7 +696,7 @@ static struct mac_model mac_data_table[] = {
716 .scsi_type = MAC_SCSI_OLD, 696 .scsi_type = MAC_SCSI_OLD,
717 .scc_type = MAC_SCC_QUADRA, 697 .scc_type = MAC_SCC_QUADRA,
718 .nubus_type = MAC_NUBUS, 698 .nubus_type = MAC_NUBUS,
719 .floppy_type = MAC_FLOPPY_SWIM_ADDR2 699 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
720 }, { 700 }, {
721 .ident = MAC_MODEL_PB190, 701 .ident = MAC_MODEL_PB190,
722 .name = "PowerBook 190", 702 .name = "PowerBook 190",
@@ -726,7 +706,7 @@ static struct mac_model mac_data_table[] = {
726 .ide_type = MAC_IDE_BABOON, 706 .ide_type = MAC_IDE_BABOON,
727 .scc_type = MAC_SCC_QUADRA, 707 .scc_type = MAC_SCC_QUADRA,
728 .nubus_type = MAC_NUBUS, 708 .nubus_type = MAC_NUBUS,
729 .floppy_type = MAC_FLOPPY_SWIM_ADDR2 709 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
730 }, { 710 }, {
731 .ident = MAC_MODEL_PB520, 711 .ident = MAC_MODEL_PB520,
732 .name = "PowerBook 520", 712 .name = "PowerBook 520",
@@ -736,7 +716,7 @@ static struct mac_model mac_data_table[] = {
736 .scc_type = MAC_SCC_QUADRA, 716 .scc_type = MAC_SCC_QUADRA,
737 .ether_type = MAC_ETHER_SONIC, 717 .ether_type = MAC_ETHER_SONIC,
738 .nubus_type = MAC_NUBUS, 718 .nubus_type = MAC_NUBUS,
739 .floppy_type = MAC_FLOPPY_SWIM_ADDR2 719 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
740 }, 720 },
741 721
742 /* 722 /*
@@ -757,7 +737,7 @@ static struct mac_model mac_data_table[] = {
757 .scsi_type = MAC_SCSI_OLD, 737 .scsi_type = MAC_SCSI_OLD,
758 .scc_type = MAC_SCC_QUADRA, 738 .scc_type = MAC_SCC_QUADRA,
759 .nubus_type = MAC_NUBUS, 739 .nubus_type = MAC_NUBUS,
760 .floppy_type = MAC_FLOPPY_SWIM_ADDR2 740 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
761 }, { 741 }, {
762 .ident = MAC_MODEL_PB230, 742 .ident = MAC_MODEL_PB230,
763 .name = "PowerBook Duo 230", 743 .name = "PowerBook Duo 230",
@@ -766,7 +746,7 @@ static struct mac_model mac_data_table[] = {
766 .scsi_type = MAC_SCSI_OLD, 746 .scsi_type = MAC_SCSI_OLD,
767 .scc_type = MAC_SCC_QUADRA, 747 .scc_type = MAC_SCC_QUADRA,
768 .nubus_type = MAC_NUBUS, 748 .nubus_type = MAC_NUBUS,
769 .floppy_type = MAC_FLOPPY_SWIM_ADDR2 749 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
770 }, { 750 }, {
771 .ident = MAC_MODEL_PB250, 751 .ident = MAC_MODEL_PB250,
772 .name = "PowerBook Duo 250", 752 .name = "PowerBook Duo 250",
@@ -775,7 +755,7 @@ static struct mac_model mac_data_table[] = {
775 .scsi_type = MAC_SCSI_OLD, 755 .scsi_type = MAC_SCSI_OLD,
776 .scc_type = MAC_SCC_QUADRA, 756 .scc_type = MAC_SCC_QUADRA,
777 .nubus_type = MAC_NUBUS, 757 .nubus_type = MAC_NUBUS,
778 .floppy_type = MAC_FLOPPY_SWIM_ADDR2 758 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
779 }, { 759 }, {
780 .ident = MAC_MODEL_PB270C, 760 .ident = MAC_MODEL_PB270C,
781 .name = "PowerBook Duo 270c", 761 .name = "PowerBook Duo 270c",
@@ -784,7 +764,7 @@ static struct mac_model mac_data_table[] = {
784 .scsi_type = MAC_SCSI_OLD, 764 .scsi_type = MAC_SCSI_OLD,
785 .scc_type = MAC_SCC_QUADRA, 765 .scc_type = MAC_SCC_QUADRA,
786 .nubus_type = MAC_NUBUS, 766 .nubus_type = MAC_NUBUS,
787 .floppy_type = MAC_FLOPPY_SWIM_ADDR2 767 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
788 }, { 768 }, {
789 .ident = MAC_MODEL_PB280, 769 .ident = MAC_MODEL_PB280,
790 .name = "PowerBook Duo 280", 770 .name = "PowerBook Duo 280",
@@ -793,7 +773,7 @@ static struct mac_model mac_data_table[] = {
793 .scsi_type = MAC_SCSI_OLD, 773 .scsi_type = MAC_SCSI_OLD,
794 .scc_type = MAC_SCC_QUADRA, 774 .scc_type = MAC_SCC_QUADRA,
795 .nubus_type = MAC_NUBUS, 775 .nubus_type = MAC_NUBUS,
796 .floppy_type = MAC_FLOPPY_SWIM_ADDR2 776 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
797 }, { 777 }, {
798 .ident = MAC_MODEL_PB280C, 778 .ident = MAC_MODEL_PB280C,
799 .name = "PowerBook Duo 280c", 779 .name = "PowerBook Duo 280c",
@@ -802,17 +782,44 @@ static struct mac_model mac_data_table[] = {
802 .scsi_type = MAC_SCSI_OLD, 782 .scsi_type = MAC_SCSI_OLD,
803 .scc_type = MAC_SCC_QUADRA, 783 .scc_type = MAC_SCC_QUADRA,
804 .nubus_type = MAC_NUBUS, 784 .nubus_type = MAC_NUBUS,
805 .floppy_type = MAC_FLOPPY_SWIM_ADDR2 785 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
806 }, 786 },
807 787
808 /* 788 /*
809 * Other stuff ?? 789 * Other stuff?
810 */ 790 */
791
811 { 792 {
812 .ident = -1 793 .ident = -1
813 } 794 }
814}; 795};
815 796
797static struct resource scc_a_rsrcs[] = {
798 { .flags = IORESOURCE_MEM },
799 { .flags = IORESOURCE_IRQ },
800};
801
802static struct resource scc_b_rsrcs[] = {
803 { .flags = IORESOURCE_MEM },
804 { .flags = IORESOURCE_IRQ },
805};
806
807struct platform_device scc_a_pdev = {
808 .name = "scc",
809 .id = 0,
810 .num_resources = ARRAY_SIZE(scc_a_rsrcs),
811 .resource = scc_a_rsrcs,
812};
813EXPORT_SYMBOL(scc_a_pdev);
814
815struct platform_device scc_b_pdev = {
816 .name = "scc",
817 .id = 1,
818 .num_resources = ARRAY_SIZE(scc_b_rsrcs),
819 .resource = scc_b_rsrcs,
820};
821EXPORT_SYMBOL(scc_b_pdev);
822
816static void __init mac_identify(void) 823static void __init mac_identify(void)
817{ 824{
818 struct mac_model *m; 825 struct mac_model *m;
@@ -823,7 +830,8 @@ static void __init mac_identify(void)
823 /* no bootinfo model id -> NetBSD booter was used! */ 830 /* no bootinfo model id -> NetBSD booter was used! */
824 /* XXX FIXME: breaks for model > 31 */ 831 /* XXX FIXME: breaks for model > 31 */
825 model = (mac_bi_data.cpuid >> 2) & 63; 832 model = (mac_bi_data.cpuid >> 2) & 63;
826 printk(KERN_WARNING "No bootinfo model ID, using cpuid instead (hey, use Penguin!)\n"); 833 printk(KERN_WARNING "No bootinfo model ID, using cpuid instead "
834 "(obsolete bootloader?)\n");
827 } 835 }
828 836
829 macintosh_config = mac_data_table; 837 macintosh_config = mac_data_table;
@@ -834,10 +842,29 @@ static void __init mac_identify(void)
834 } 842 }
835 } 843 }
836 844
837 /* We need to pre-init the IOPs, if any. Otherwise */ 845 /* Set up serial port resources for the console initcall. */
838 /* the serial console won't work if the user had */ 846
839 /* the serial ports set to "Faster" mode in MacOS. */ 847 scc_a_rsrcs[0].start = (resource_size_t) mac_bi_data.sccbase + 2;
848 scc_a_rsrcs[0].end = scc_a_rsrcs[0].start;
849 scc_b_rsrcs[0].start = (resource_size_t) mac_bi_data.sccbase;
850 scc_b_rsrcs[0].end = scc_b_rsrcs[0].start;
840 851
852 switch (macintosh_config->scc_type) {
853 case MAC_SCC_PSC:
854 scc_a_rsrcs[1].start = scc_a_rsrcs[1].end = IRQ_MAC_SCC_A;
855 scc_b_rsrcs[1].start = scc_b_rsrcs[1].end = IRQ_MAC_SCC_B;
856 break;
857 default:
858 scc_a_rsrcs[1].start = scc_a_rsrcs[1].end = IRQ_MAC_SCC;
859 scc_b_rsrcs[1].start = scc_b_rsrcs[1].end = IRQ_MAC_SCC;
860 break;
861 }
862
863 /*
864 * We need to pre-init the IOPs, if any. Otherwise
865 * the serial console won't work if the user had
866 * the serial ports set to "Faster" mode in MacOS.
867 */
841 iop_preinit(); 868 iop_preinit();
842 869
843 printk(KERN_INFO "Detected Macintosh model: %d \n", model); 870 printk(KERN_INFO "Detected Macintosh model: %d \n", model);
@@ -846,7 +873,8 @@ static void __init mac_identify(void)
846 * Report booter data: 873 * Report booter data:
847 */ 874 */
848 printk(KERN_DEBUG " Penguin bootinfo data:\n"); 875 printk(KERN_DEBUG " Penguin bootinfo data:\n");
849 printk(KERN_DEBUG " Video: addr 0x%lx row 0x%lx depth %lx dimensions %ld x %ld\n", 876 printk(KERN_DEBUG " Video: addr 0x%lx "
877 "row 0x%lx depth %lx dimensions %ld x %ld\n",
850 mac_bi_data.videoaddr, mac_bi_data.videorow, 878 mac_bi_data.videoaddr, mac_bi_data.videorow,
851 mac_bi_data.videodepth, mac_bi_data.dimensions & 0xFFFF, 879 mac_bi_data.videodepth, mac_bi_data.dimensions & 0xFFFF,
852 mac_bi_data.dimensions >> 16); 880 mac_bi_data.dimensions >> 16);
@@ -863,6 +891,10 @@ static void __init mac_identify(void)
863 oss_init(); 891 oss_init();
864 psc_init(); 892 psc_init();
865 baboon_init(); 893 baboon_init();
894
895#ifdef CONFIG_ADB_CUDA
896 find_via_cuda();
897#endif
866} 898}
867 899
868static void __init mac_report_hardware(void) 900static void __init mac_report_hardware(void)
@@ -876,23 +908,50 @@ static void mac_get_model(char *str)
876 strcat(str, macintosh_config->name); 908 strcat(str, macintosh_config->name);
877} 909}
878 910
879static struct resource swim_resources[1]; 911static struct resource swim_rsrc = { .flags = IORESOURCE_MEM };
880 912
881static struct platform_device swim_device = { 913static struct platform_device swim_pdev = {
882 .name = "swim", 914 .name = "swim",
883 .id = -1, 915 .id = -1,
884 .num_resources = ARRAY_SIZE(swim_resources), 916 .num_resources = 1,
885 .resource = swim_resources, 917 .resource = &swim_rsrc,
886}; 918};
887 919
888static struct platform_device *mac_platform_devices[] __initdata = { 920static struct platform_device esp_0_pdev = {
889 &swim_device 921 .name = "mac_esp",
922 .id = 0,
923};
924
925static struct platform_device esp_1_pdev = {
926 .name = "mac_esp",
927 .id = 1,
928};
929
930static struct platform_device sonic_pdev = {
931 .name = "macsonic",
932 .id = -1,
933};
934
935static struct platform_device mace_pdev = {
936 .name = "macmace",
937 .id = -1,
890}; 938};
891 939
892int __init mac_platform_init(void) 940int __init mac_platform_init(void)
893{ 941{
894 u8 *swim_base; 942 u8 *swim_base;
895 943
944 /*
945 * Serial devices
946 */
947
948 platform_device_register(&scc_a_pdev);
949 platform_device_register(&scc_b_pdev);
950
951 /*
952 * Floppy device
953 */
954
896 switch (macintosh_config->floppy_type) { 955 switch (macintosh_config->floppy_type) {
897 case MAC_FLOPPY_SWIM_ADDR1: 956 case MAC_FLOPPY_SWIM_ADDR1:
898 swim_base = (u8 *)(VIA1_BASE + 0x1E000); 957 swim_base = (u8 *)(VIA1_BASE + 0x1E000);
@@ -901,16 +960,47 @@ int __init mac_platform_init(void)
901 swim_base = (u8 *)(VIA1_BASE + 0x16000); 960 swim_base = (u8 *)(VIA1_BASE + 0x16000);
902 break; 961 break;
903 default: 962 default:
904 return 0; 963 swim_base = NULL;
964 break;
905 } 965 }
906 966
907 swim_resources[0].name = "swim-regs"; 967 if (swim_base) {
908 swim_resources[0].start = (resource_size_t)swim_base; 968 swim_rsrc.start = (resource_size_t) swim_base,
909 swim_resources[0].end = (resource_size_t)(swim_base + SWIM_IO_SIZE); 969 swim_rsrc.end = (resource_size_t) swim_base + 0x2000,
910 swim_resources[0].flags = IORESOURCE_MEM; 970 platform_device_register(&swim_pdev);
971 }
972
973 /*
974 * SCSI device(s)
975 */
976
977 switch (macintosh_config->scsi_type) {
978 case MAC_SCSI_QUADRA:
979 case MAC_SCSI_QUADRA3:
980 platform_device_register(&esp_0_pdev);
981 break;
982 case MAC_SCSI_QUADRA2:
983 platform_device_register(&esp_0_pdev);
984 if ((macintosh_config->ident == MAC_MODEL_Q900) ||
985 (macintosh_config->ident == MAC_MODEL_Q950))
986 platform_device_register(&esp_1_pdev);
987 break;
988 }
989
990 /*
991 * Ethernet device
992 */
993
994 switch (macintosh_config->ether_type) {
995 case MAC_ETHER_SONIC:
996 platform_device_register(&sonic_pdev);
997 break;
998 case MAC_ETHER_MACE:
999 platform_device_register(&mace_pdev);
1000 break;
1001 }
911 1002
912 return platform_add_devices(mac_platform_devices, 1003 return 0;
913 ARRAY_SIZE(mac_platform_devices));
914} 1004}
915 1005
916arch_initcall(mac_platform_init); 1006arch_initcall(mac_platform_init);
diff --git a/arch/m68k/mac/debug.c b/arch/m68k/mac/debug.c
deleted file mode 100644
index bce074ceb768..000000000000
--- a/arch/m68k/mac/debug.c
+++ /dev/null
@@ -1,365 +0,0 @@
1/*
2 * linux/arch/m68k/mac/debug.c
3 *
4 * Shamelessly stolen (SCC code and general framework) from:
5 *
6 * linux/arch/m68k/atari/debug.c
7 *
8 * Atari debugging and serial console stuff
9 *
10 * Assembled of parts of former atari/config.c 97-12-18 by Roman Hodek
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
17#include <linux/types.h>
18#include <linux/sched.h>
19#include <linux/tty.h>
20#include <linux/console.h>
21#include <linux/init.h>
22#include <linux/delay.h>
23
24#define BOOTINFO_COMPAT_1_0
25#include <asm/setup.h>
26#include <asm/bootinfo.h>
27#include <asm/macints.h>
28
29extern unsigned long mac_videobase;
30extern unsigned long mac_rowbytes;
31
32extern void mac_serial_print(const char *);
33
34#define DEBUG_HEADS
35#undef DEBUG_SCREEN
36#define DEBUG_SERIAL
37
38/*
39 * These two auxiliary debug functions should go away ASAP. Only usage:
40 * before the console output is up (after head.S come some other crucial
41 * setup routines :-) it permits writing 'data' to the screen as bit patterns
42 * (good luck reading those). Helped to figure that the bootinfo contained
43 * garbage data on the amount and size of memory chunks ...
44 *
45 * The 'pos' argument now simply means 'linefeed after print' ...
46 */
47
48#ifdef DEBUG_SCREEN
49static int peng, line;
50#endif
51
52#if 0
53
54void mac_debugging_short(int pos, short num)
55{
56#ifdef DEBUG_SCREEN
57 unsigned char *pengoffset;
58 unsigned char *pptr;
59 int i;
60#endif
61
62#ifdef DEBUG_SERIAL
63 printk("debug: %d !\n", num);
64#endif
65
66#ifdef DEBUG_SCREEN
67 if (!MACH_IS_MAC) {
68 /* printk("debug: %d !\n", num); */
69 return;
70 }
71
72 /* calculate current offset */
73 pengoffset = (unsigned char *)mac_videobase +
74 (150+line*2) * mac_rowbytes + 80 * peng;
75
76 pptr = pengoffset;
77
78 for (i = 0; i < 8 * sizeof(short); i++) { /* # of bits */
79 /* value mask for bit i, reverse order */
80 *pptr++ = (num & (1 << (8*sizeof(short)-i-1)) ? 0xFF : 0x00);
81 }
82
83 peng++;
84
85 if (pos) {
86 line++;
87 peng = 0;
88 }
89#endif
90}
91
92void mac_debugging_long(int pos, long addr)
93{
94#ifdef DEBUG_SCREEN
95 unsigned char *pengoffset;
96 unsigned char *pptr;
97 int i;
98#endif
99
100#ifdef DEBUG_SERIAL
101 printk("debug: #%ld !\n", addr);
102#endif
103
104#ifdef DEBUG_SCREEN
105 if (!MACH_IS_MAC) {
106 /* printk("debug: #%ld !\n", addr); */
107 return;
108 }
109
110 pengoffset=(unsigned char *)(mac_videobase+(150+line*2)*mac_rowbytes)
111 +80*peng;
112
113 pptr = pengoffset;
114
115 for (i = 0; i < 8 * sizeof(long); i++) { /* # of bits */
116 *pptr++ = (addr & (1 << (8*sizeof(long)-i-1)) ? 0xFF : 0x00);
117 }
118
119 peng++;
120
121 if (pos) {
122 line++;
123 peng = 0;
124 }
125#endif
126}
127
128#endif /* 0 */
129
130#ifdef DEBUG_SERIAL
131/*
132 * TODO: serial debug code
133 */
134
135struct mac_SCC {
136 u_char cha_b_ctrl;
137 u_char char_dummy1;
138 u_char cha_a_ctrl;
139 u_char char_dummy2;
140 u_char cha_b_data;
141 u_char char_dummy3;
142 u_char cha_a_data;
143};
144
145# define scc (*((volatile struct mac_SCC*)mac_bi_data.sccbase))
146
147static int scc_port = -1;
148
149static struct console mac_console_driver = {
150 .name = "debug",
151 .flags = CON_PRINTBUFFER,
152 .index = -1,
153};
154
155/*
156 * Crude hack to get console output to the screen before the framebuffer
157 * is initialized (happens a lot later in 2.1!).
158 * We just use the console routines declared in head.S, this will interfere
159 * with regular framebuffer console output and should be used exclusively
160 * to debug kernel problems manifesting before framebuffer init (aka WSOD)
161 *
162 * To keep this hack from interfering with the regular console driver, either
163 * deregister this driver before/on framebuffer console init, or silence this
164 * function after the fbcon driver is running (will lose console messages!?).
165 * To debug real early bugs, need to write a 'mac_register_console_hack()'
166 * that is called from start_kernel() before setup_arch() and just registers
167 * this driver if Mac.
168 */
169
170static void mac_debug_console_write(struct console *co, const char *str,
171 unsigned int count)
172{
173 mac_serial_print(str);
174}
175
176
177
178/* Mac: loops_per_jiffy min. 19000 ^= .5 us; MFPDELAY was 0.6 us*/
179
180#define uSEC 1
181
182static inline void mac_sccb_out(char c)
183{
184 int i;
185
186 do {
187 for (i = uSEC; i > 0; --i)
188 barrier();
189 } while (!(scc.cha_b_ctrl & 0x04)); /* wait for tx buf empty */
190 for (i = uSEC; i > 0; --i)
191 barrier();
192 scc.cha_b_data = c;
193}
194
195static inline void mac_scca_out(char c)
196{
197 int i;
198
199 do {
200 for (i = uSEC; i > 0; --i)
201 barrier();
202 } while (!(scc.cha_a_ctrl & 0x04)); /* wait for tx buf empty */
203 for (i = uSEC; i > 0; --i)
204 barrier();
205 scc.cha_a_data = c;
206}
207
208static void mac_sccb_console_write(struct console *co, const char *str,
209 unsigned int count)
210{
211 while (count--) {
212 if (*str == '\n')
213 mac_sccb_out('\r');
214 mac_sccb_out(*str++);
215 }
216}
217
218static void mac_scca_console_write(struct console *co, const char *str,
219 unsigned int count)
220{
221 while (count--) {
222 if (*str == '\n')
223 mac_scca_out('\r');
224 mac_scca_out(*str++);
225 }
226}
227
228
229/* The following two functions do a quick'n'dirty initialization of the MFP or
230 * SCC serial ports. They're used by the debugging interface, kgdb, and the
231 * serial console code. */
232#define SCCB_WRITE(reg,val) \
233 do { \
234 int i; \
235 scc.cha_b_ctrl = (reg); \
236 for (i = uSEC; i > 0; --i) \
237 barrier(); \
238 scc.cha_b_ctrl = (val); \
239 for (i = uSEC; i > 0; --i) \
240 barrier(); \
241 } while(0)
242
243#define SCCA_WRITE(reg,val) \
244 do { \
245 int i; \
246 scc.cha_a_ctrl = (reg); \
247 for (i = uSEC; i > 0; --i) \
248 barrier(); \
249 scc.cha_a_ctrl = (val); \
250 for (i = uSEC; i > 0; --i) \
251 barrier(); \
252 } while(0)
253
254/* loops_per_jiffy isn't initialized yet, so we can't use udelay(). This does a
255 * delay of ~ 60us. */
256/* Mac: loops_per_jiffy min. 19000 ^= .5 us; MFPDELAY was 0.6 us*/
257#define LONG_DELAY() \
258 do { \
259 int i; \
260 for (i = 60*uSEC; i > 0; --i) \
261 barrier(); \
262 } while(0)
263
264static void __init mac_init_scc_port(int cflag, int port)
265{
266 /*
267 * baud rates: 1200, 1800, 2400, 4800, 9600, 19.2k, 38.4k, 57.6k, 115.2k
268 */
269
270 static int clksrc_table[9] =
271 /* reg 11: 0x50 = BRG, 0x00 = RTxC, 0x28 = TRxC */
272 { 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x00, 0x00 };
273 static int clkmode_table[9] =
274 /* reg 4: 0x40 = x16, 0x80 = x32, 0xc0 = x64 */
275 { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0xc0, 0x80 };
276 static int div_table[9] =
277 /* reg12 (BRG low) */
278 { 94, 62, 46, 22, 10, 4, 1, 0, 0 };
279
280 int baud = cflag & CBAUD;
281 int clksrc, clkmode, div, reg3, reg5;
282
283 if (cflag & CBAUDEX)
284 baud += B38400;
285 if (baud < B1200 || baud > B38400+2)
286 baud = B9600; /* use default 9600bps for non-implemented rates */
287 baud -= B1200; /* tables starts at 1200bps */
288
289 clksrc = clksrc_table[baud];
290 clkmode = clkmode_table[baud];
291 div = div_table[baud];
292
293 reg3 = (((cflag & CSIZE) == CS8) ? 0xc0 : 0x40);
294 reg5 = (((cflag & CSIZE) == CS8) ? 0x60 : 0x20) | 0x82 /* assert DTR/RTS */;
295
296 if (port == 1) {
297 (void)scc.cha_b_ctrl; /* reset reg pointer */
298 SCCB_WRITE(9, 0xc0); /* reset */
299 LONG_DELAY(); /* extra delay after WR9 access */
300 SCCB_WRITE(4, (cflag & PARENB) ? ((cflag & PARODD) ? 0x01 : 0x03) : 0 |
301 0x04 /* 1 stopbit */ |
302 clkmode);
303 SCCB_WRITE(3, reg3);
304 SCCB_WRITE(5, reg5);
305 SCCB_WRITE(9, 0); /* no interrupts */
306 LONG_DELAY(); /* extra delay after WR9 access */
307 SCCB_WRITE(10, 0); /* NRZ mode */
308 SCCB_WRITE(11, clksrc); /* main clock source */
309 SCCB_WRITE(12, div); /* BRG value */
310 SCCB_WRITE(13, 0); /* BRG high byte */
311 SCCB_WRITE(14, 1);
312 SCCB_WRITE(3, reg3 | 1);
313 SCCB_WRITE(5, reg5 | 8);
314 } else if (port == 0) {
315 (void)scc.cha_a_ctrl; /* reset reg pointer */
316 SCCA_WRITE(9, 0xc0); /* reset */
317 LONG_DELAY(); /* extra delay after WR9 access */
318 SCCA_WRITE(4, (cflag & PARENB) ? ((cflag & PARODD) ? 0x01 : 0x03) : 0 |
319 0x04 /* 1 stopbit */ |
320 clkmode);
321 SCCA_WRITE(3, reg3);
322 SCCA_WRITE(5, reg5);
323 SCCA_WRITE(9, 0); /* no interrupts */
324 LONG_DELAY(); /* extra delay after WR9 access */
325 SCCA_WRITE(10, 0); /* NRZ mode */
326 SCCA_WRITE(11, clksrc); /* main clock source */
327 SCCA_WRITE(12, div); /* BRG value */
328 SCCA_WRITE(13, 0); /* BRG high byte */
329 SCCA_WRITE(14, 1);
330 SCCA_WRITE(3, reg3 | 1);
331 SCCA_WRITE(5, reg5 | 8);
332 }
333}
334#endif /* DEBUG_SERIAL */
335
336static int __init mac_debug_setup(char *arg)
337{
338 if (!MACH_IS_MAC)
339 return 0;
340
341#ifdef DEBUG_SERIAL
342 if (!strcmp(arg, "ser") || !strcmp(arg, "ser1")) {
343 /* Mac modem port */
344 mac_init_scc_port(B9600|CS8, 0);
345 mac_console_driver.write = mac_scca_console_write;
346 scc_port = 0;
347 } else if (!strcmp(arg, "ser2")) {
348 /* Mac printer port */
349 mac_init_scc_port(B9600|CS8, 1);
350 mac_console_driver.write = mac_sccb_console_write;
351 scc_port = 1;
352 }
353#endif
354#ifdef DEBUG_HEADS
355 if (!strcmp(arg, "scn") || !strcmp(arg, "con")) {
356 /* display, using head.S console routines */
357 mac_console_driver.write = mac_debug_console_write;
358 }
359#endif
360 if (mac_console_driver.write)
361 register_console(&mac_console_driver);
362 return 0;
363}
364
365early_param("debug", mac_debug_setup);
diff --git a/arch/m68k/mac/macints.c b/arch/m68k/mac/macints.c
index 23711074e0e2..900d899f3323 100644
--- a/arch/m68k/mac/macints.c
+++ b/arch/m68k/mac/macints.c
@@ -34,9 +34,7 @@
34 * 34 *
35 * 3 - unused (?) 35 * 3 - unused (?)
36 * 36 *
37 * 4 - SCC (slot number determined by reading RR3 on the SSC itself) 37 * 4 - SCC
38 * - slot 1: SCC channel A
39 * - slot 2: SCC channel B
40 * 38 *
41 * 5 - unused (?) 39 * 5 - unused (?)
42 * [serial errors or special conditions seem to raise level 6 40 * [serial errors or special conditions seem to raise level 6
@@ -55,8 +53,6 @@
55 * - slot 5: Slot $E 53 * - slot 5: Slot $E
56 * 54 *
57 * 4 - SCC IOP 55 * 4 - SCC IOP
58 * - slot 1: SCC channel A
59 * - slot 2: SCC channel B
60 * 56 *
61 * 5 - ISM IOP (ADB?) 57 * 5 - ISM IOP (ADB?)
62 * 58 *
@@ -136,13 +132,8 @@
136#include <asm/irq_regs.h> 132#include <asm/irq_regs.h>
137#include <asm/mac_oss.h> 133#include <asm/mac_oss.h>
138 134
139#define DEBUG_SPURIOUS
140#define SHUTUP_SONIC 135#define SHUTUP_SONIC
141 136
142/* SCC interrupt mask */
143
144static int scc_mask;
145
146/* 137/*
147 * VIA/RBV hooks 138 * VIA/RBV hooks
148 */ 139 */
@@ -191,13 +182,6 @@ extern void baboon_irq_disable(int);
191extern void baboon_irq_clear(int); 182extern void baboon_irq_clear(int);
192 183
193/* 184/*
194 * SCC interrupt routines
195 */
196
197static void scc_irq_enable(unsigned int);
198static void scc_irq_disable(unsigned int);
199
200/*
201 * console_loglevel determines NMI handler function 185 * console_loglevel determines NMI handler function
202 */ 186 */
203 187
@@ -221,8 +205,6 @@ void __init mac_init_IRQ(void)
221#ifdef DEBUG_MACINTS 205#ifdef DEBUG_MACINTS
222 printk("mac_init_IRQ(): Setting things up...\n"); 206 printk("mac_init_IRQ(): Setting things up...\n");
223#endif 207#endif
224 scc_mask = 0;
225
226 m68k_setup_irq_controller(&mac_irq_controller, IRQ_USER, 208 m68k_setup_irq_controller(&mac_irq_controller, IRQ_USER,
227 NUM_MAC_SOURCES - IRQ_USER); 209 NUM_MAC_SOURCES - IRQ_USER);
228 /* Make sure the SONIC interrupt is cleared or things get ugly */ 210 /* Make sure the SONIC interrupt is cleared or things get ugly */
@@ -283,15 +265,16 @@ void mac_enable_irq(unsigned int irq)
283 via_irq_enable(irq); 265 via_irq_enable(irq);
284 break; 266 break;
285 case 3: 267 case 3:
286 case 4:
287 case 5: 268 case 5:
288 case 6: 269 case 6:
289 if (psc_present) 270 if (psc_present)
290 psc_irq_enable(irq); 271 psc_irq_enable(irq);
291 else if (oss_present) 272 else if (oss_present)
292 oss_irq_enable(irq); 273 oss_irq_enable(irq);
293 else if (irq_src == 4) 274 break;
294 scc_irq_enable(irq); 275 case 4:
276 if (psc_present)
277 psc_irq_enable(irq);
295 break; 278 break;
296 case 8: 279 case 8:
297 if (baboon_present) 280 if (baboon_present)
@@ -316,15 +299,16 @@ void mac_disable_irq(unsigned int irq)
316 via_irq_disable(irq); 299 via_irq_disable(irq);
317 break; 300 break;
318 case 3: 301 case 3:
319 case 4:
320 case 5: 302 case 5:
321 case 6: 303 case 6:
322 if (psc_present) 304 if (psc_present)
323 psc_irq_disable(irq); 305 psc_irq_disable(irq);
324 else if (oss_present) 306 else if (oss_present)
325 oss_irq_disable(irq); 307 oss_irq_disable(irq);
326 else if (irq_src == 4) 308 break;
327 scc_irq_disable(irq); 309 case 4:
310 if (psc_present)
311 psc_irq_disable(irq);
328 break; 312 break;
329 case 8: 313 case 8:
330 if (baboon_present) 314 if (baboon_present)
@@ -347,7 +331,6 @@ void mac_clear_irq(unsigned int irq)
347 via_irq_clear(irq); 331 via_irq_clear(irq);
348 break; 332 break;
349 case 3: 333 case 3:
350 case 4:
351 case 5: 334 case 5:
352 case 6: 335 case 6:
353 if (psc_present) 336 if (psc_present)
@@ -355,6 +338,10 @@ void mac_clear_irq(unsigned int irq)
355 else if (oss_present) 338 else if (oss_present)
356 oss_irq_clear(irq); 339 oss_irq_clear(irq);
357 break; 340 break;
341 case 4:
342 if (psc_present)
343 psc_irq_clear(irq);
344 break;
358 case 8: 345 case 8:
359 if (baboon_present) 346 if (baboon_present)
360 baboon_irq_clear(irq); 347 baboon_irq_clear(irq);
@@ -374,13 +361,17 @@ int mac_irq_pending(unsigned int irq)
374 else 361 else
375 return via_irq_pending(irq); 362 return via_irq_pending(irq);
376 case 3: 363 case 3:
377 case 4:
378 case 5: 364 case 5:
379 case 6: 365 case 6:
380 if (psc_present) 366 if (psc_present)
381 return psc_irq_pending(irq); 367 return psc_irq_pending(irq);
382 else if (oss_present) 368 else if (oss_present)
383 return oss_irq_pending(irq); 369 return oss_irq_pending(irq);
370 break;
371 case 4:
372 if (psc_present)
373 psc_irq_pending(irq);
374 break;
384 } 375 }
385 return 0; 376 return 0;
386} 377}
@@ -448,59 +439,3 @@ irqreturn_t mac_nmi_handler(int irq, void *dev_id)
448 in_nmi--; 439 in_nmi--;
449 return IRQ_HANDLED; 440 return IRQ_HANDLED;
450} 441}
451
452/*
453 * Simple routines for masking and unmasking
454 * SCC interrupts in cases where this can't be
455 * done in hardware (only the PSC can do that.)
456 */
457
458static void scc_irq_enable(unsigned int irq)
459{
460 int irq_idx = IRQ_IDX(irq);
461
462 scc_mask |= (1 << irq_idx);
463}
464
465static void scc_irq_disable(unsigned int irq)
466{
467 int irq_idx = IRQ_IDX(irq);
468
469 scc_mask &= ~(1 << irq_idx);
470}
471
472/*
473 * SCC master interrupt handler. We have to do a bit of magic here
474 * to figure out what channel gave us the interrupt; putting this
475 * here is cleaner than hacking it into drivers/char/macserial.c.
476 */
477
478void mac_scc_dispatch(int irq, void *dev_id)
479{
480 volatile unsigned char *scc = (unsigned char *) mac_bi_data.sccbase + 2;
481 unsigned char reg;
482 unsigned long flags;
483
484 /* Read RR3 from the chip. Always do this on channel A */
485 /* This must be an atomic operation so disable irqs. */
486
487 local_irq_save(flags);
488 *scc = 3;
489 reg = *scc;
490 local_irq_restore(flags);
491
492 /* Now dispatch. Bits 0-2 are for channel B and */
493 /* bits 3-5 are for channel A. We can safely */
494 /* ignore the remaining bits here. */
495 /* */
496 /* Note that we're ignoring scc_mask for now. */
497 /* If we actually mask the ints then we tend to */
498 /* get hammered by very persistent SCC irqs, */
499 /* and since they're autovector interrupts they */
500 /* pretty much kill the system. */
501
502 if (reg & 0x38)
503 m68k_handle_int(IRQ_SCCA);
504 if (reg & 0x07)
505 m68k_handle_int(IRQ_SCCB);
506}
diff --git a/arch/m68k/mac/oss.c b/arch/m68k/mac/oss.c
index f3d23d6ebcf8..a9c0f5ab4cc0 100644
--- a/arch/m68k/mac/oss.c
+++ b/arch/m68k/mac/oss.c
@@ -33,7 +33,6 @@ static irqreturn_t oss_irq(int, void *);
33static irqreturn_t oss_nubus_irq(int, void *); 33static irqreturn_t oss_nubus_irq(int, void *);
34 34
35extern irqreturn_t via1_irq(int, void *); 35extern irqreturn_t via1_irq(int, void *);
36extern irqreturn_t mac_scc_dispatch(int, void *);
37 36
38/* 37/*
39 * Initialize the OSS 38 * Initialize the OSS
@@ -69,9 +68,6 @@ void __init oss_register_interrupts(void)
69 if (request_irq(OSS_IRQLEV_SCSI, oss_irq, IRQ_FLG_LOCK, 68 if (request_irq(OSS_IRQLEV_SCSI, oss_irq, IRQ_FLG_LOCK,
70 "scsi", (void *) oss)) 69 "scsi", (void *) oss))
71 pr_err("Couldn't register %s interrupt\n", "scsi"); 70 pr_err("Couldn't register %s interrupt\n", "scsi");
72 if (request_irq(OSS_IRQLEV_IOPSCC, mac_scc_dispatch, IRQ_FLG_LOCK,
73 "scc", mac_scc_dispatch))
74 pr_err("Couldn't register %s interrupt\n", "scc");
75 if (request_irq(OSS_IRQLEV_NUBUS, oss_nubus_irq, IRQ_FLG_LOCK, 71 if (request_irq(OSS_IRQLEV_NUBUS, oss_nubus_irq, IRQ_FLG_LOCK,
76 "nubus", (void *) oss)) 72 "nubus", (void *) oss))
77 pr_err("Couldn't register %s interrupt\n", "nubus"); 73 pr_err("Couldn't register %s interrupt\n", "nubus");
@@ -172,9 +168,7 @@ void oss_irq_enable(int irq) {
172 printk("oss_irq_enable(%d)\n", irq); 168 printk("oss_irq_enable(%d)\n", irq);
173#endif 169#endif
174 switch(irq) { 170 switch(irq) {
175 case IRQ_SCC: 171 case IRQ_MAC_SCC:
176 case IRQ_SCCA:
177 case IRQ_SCCB:
178 oss->irq_level[OSS_IOPSCC] = OSS_IRQLEV_IOPSCC; 172 oss->irq_level[OSS_IOPSCC] = OSS_IRQLEV_IOPSCC;
179 break; 173 break;
180 case IRQ_MAC_ADB: 174 case IRQ_MAC_ADB:
@@ -212,9 +206,7 @@ void oss_irq_disable(int irq) {
212 printk("oss_irq_disable(%d)\n", irq); 206 printk("oss_irq_disable(%d)\n", irq);
213#endif 207#endif
214 switch(irq) { 208 switch(irq) {
215 case IRQ_SCC: 209 case IRQ_MAC_SCC:
216 case IRQ_SCCA:
217 case IRQ_SCCB:
218 oss->irq_level[OSS_IOPSCC] = OSS_IRQLEV_DISABLED; 210 oss->irq_level[OSS_IOPSCC] = OSS_IRQLEV_DISABLED;
219 break; 211 break;
220 case IRQ_MAC_ADB: 212 case IRQ_MAC_ADB:
@@ -250,9 +242,7 @@ void oss_irq_disable(int irq) {
250void oss_irq_clear(int irq) { 242void oss_irq_clear(int irq) {
251 /* FIXME: how to do this on OSS? */ 243 /* FIXME: how to do this on OSS? */
252 switch(irq) { 244 switch(irq) {
253 case IRQ_SCC: 245 case IRQ_MAC_SCC:
254 case IRQ_SCCA:
255 case IRQ_SCCB:
256 oss->irq_pending &= ~OSS_IP_IOPSCC; 246 oss->irq_pending &= ~OSS_IP_IOPSCC;
257 break; 247 break;
258 case IRQ_MAC_ADB: 248 case IRQ_MAC_ADB:
@@ -280,9 +270,7 @@ void oss_irq_clear(int irq) {
280int oss_irq_pending(int irq) 270int oss_irq_pending(int irq)
281{ 271{
282 switch(irq) { 272 switch(irq) {
283 case IRQ_SCC: 273 case IRQ_MAC_SCC:
284 case IRQ_SCCA:
285 case IRQ_SCCB:
286 return oss->irq_pending & OSS_IP_IOPSCC; 274 return oss->irq_pending & OSS_IP_IOPSCC;
287 break; 275 break;
288 case IRQ_MAC_ADB: 276 case IRQ_MAC_ADB:
diff --git a/arch/m68k/mac/via.c b/arch/m68k/mac/via.c
index 11bce3cb6482..e71166daec6a 100644
--- a/arch/m68k/mac/via.c
+++ b/arch/m68k/mac/via.c
@@ -84,8 +84,6 @@ void via_irq_enable(int irq);
84void via_irq_disable(int irq); 84void via_irq_disable(int irq);
85void via_irq_clear(int irq); 85void via_irq_clear(int irq);
86 86
87extern irqreturn_t mac_scc_dispatch(int, void *);
88
89/* 87/*
90 * Initialize the VIAs 88 * Initialize the VIAs
91 * 89 *
@@ -311,11 +309,6 @@ void __init via_register_interrupts(void)
311 if (request_irq(IRQ_AUTO_2, via2_irq, IRQ_FLG_LOCK|IRQ_FLG_FAST, 309 if (request_irq(IRQ_AUTO_2, via2_irq, IRQ_FLG_LOCK|IRQ_FLG_FAST,
312 "via2", (void *) via2)) 310 "via2", (void *) via2))
313 pr_err("Couldn't register %s interrupt\n", "via2"); 311 pr_err("Couldn't register %s interrupt\n", "via2");
314 if (!psc_present) {
315 if (request_irq(IRQ_AUTO_4, mac_scc_dispatch, IRQ_FLG_LOCK,
316 "scc", mac_scc_dispatch))
317 pr_err("Couldn't register %s interrupt\n", "scc");
318 }
319 if (request_irq(IRQ_MAC_NUBUS, via_nubus_irq, 312 if (request_irq(IRQ_MAC_NUBUS, via_nubus_irq,
320 IRQ_FLG_LOCK|IRQ_FLG_FAST, "nubus", (void *) via2)) 313 IRQ_FLG_LOCK|IRQ_FLG_FAST, "nubus", (void *) via2))
321 pr_err("Couldn't register %s interrupt\n", "nubus"); 314 pr_err("Couldn't register %s interrupt\n", "nubus");
diff --git a/arch/m68k/mm/kmap.c b/arch/m68k/mm/kmap.c
index df620ac2a296..69345849454b 100644
--- a/arch/m68k/mm/kmap.c
+++ b/arch/m68k/mm/kmap.c
@@ -99,8 +99,7 @@ static inline void free_io_area(void *addr)
99#endif 99#endif
100 100
101/* 101/*
102 * Map some physical address range into the kernel address space. The 102 * Map some physical address range into the kernel address space.
103 * code is copied and adapted from map_chunk().
104 */ 103 */
105/* Rewritten by Andreas Schwab to remove all races. */ 104/* Rewritten by Andreas Schwab to remove all races. */
106 105
@@ -116,7 +115,7 @@ void __iomem *__ioremap(unsigned long physaddr, unsigned long size, int cachefla
116 /* 115 /*
117 * Don't allow mappings that wrap.. 116 * Don't allow mappings that wrap..
118 */ 117 */
119 if (!size || size > physaddr + size) 118 if (!size || physaddr > (unsigned long)(-size))
120 return NULL; 119 return NULL;
121 120
122#ifdef CONFIG_AMIGA 121#ifdef CONFIG_AMIGA
diff --git a/arch/m68knommu/kernel/process.c b/arch/m68knommu/kernel/process.c
index 5c9ecd427090..959cb249c759 100644
--- a/arch/m68knommu/kernel/process.c
+++ b/arch/m68knommu/kernel/process.c
@@ -221,6 +221,10 @@ int copy_thread(unsigned long clone_flags,
221 221
222 p->thread.usp = usp; 222 p->thread.usp = usp;
223 p->thread.ksp = (unsigned long)childstack; 223 p->thread.ksp = (unsigned long)childstack;
224
225 if (clone_flags & CLONE_SETTLS)
226 task_thread_info(p)->tp_value = regs->d5;
227
224 /* 228 /*
225 * Must save the current SFC/DFC value, NOT the value when 229 * Must save the current SFC/DFC value, NOT the value when
226 * the parent was last descheduled - RGH 10-08-96 230 * the parent was last descheduled - RGH 10-08-96
diff --git a/arch/m68knommu/kernel/ptrace.c b/arch/m68knommu/kernel/ptrace.c
index 4d3828959fb0..85ed2f988f98 100644
--- a/arch/m68knommu/kernel/ptrace.c
+++ b/arch/m68knommu/kernel/ptrace.c
@@ -319,6 +319,11 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
319 } 319 }
320#endif 320#endif
321 321
322 case PTRACE_GET_THREAD_AREA:
323 ret = put_user(task_thread_info(child)->tp_value,
324 (unsigned long __user *)data);
325 break;
326
322 default: 327 default:
323 ret = -EIO; 328 ret = -EIO;
324 break; 329 break;
diff --git a/arch/m68knommu/kernel/sys_m68k.c b/arch/m68knommu/kernel/sys_m68k.c
index b67cbc735a9b..923dd4aab875 100644
--- a/arch/m68knommu/kernel/sys_m68k.c
+++ b/arch/m68knommu/kernel/sys_m68k.c
@@ -190,3 +190,39 @@ int kernel_execve(const char *filename, char *const argv[], char *const envp[])
190 : "d" (__a), "d" (__b), "d" (__c)); 190 : "d" (__a), "d" (__b), "d" (__c));
191 return __res; 191 return __res;
192} 192}
193
194asmlinkage unsigned long sys_get_thread_area(void)
195{
196 return current_thread_info()->tp_value;
197}
198
199asmlinkage int sys_set_thread_area(unsigned long tp)
200{
201 current_thread_info()->tp_value = tp;
202 return 0;
203}
204
205/* This syscall gets its arguments in A0 (mem), D2 (oldval) and
206 D1 (newval). */
207asmlinkage int
208sys_atomic_cmpxchg_32(unsigned long newval, int oldval, int d3, int d4, int d5,
209 unsigned long __user * mem)
210{
211 struct mm_struct *mm = current->mm;
212 unsigned long mem_value;
213
214 down_read(&mm->mmap_sem);
215
216 mem_value = *mem;
217 if (mem_value == oldval)
218 *mem = newval;
219
220 up_read(&mm->mmap_sem);
221 return mem_value;
222}
223
224asmlinkage int sys_atomic_barrier(void)
225{
226 /* no code needed for uniprocs */
227 return 0;
228}
diff --git a/arch/m68knommu/kernel/syscalltable.S b/arch/m68knommu/kernel/syscalltable.S
index 486837efa3d7..56dd01ded148 100644
--- a/arch/m68knommu/kernel/syscalltable.S
+++ b/arch/m68knommu/kernel/syscalltable.S
@@ -351,6 +351,10 @@ ENTRY(sys_call_table)
351 .long sys_pwritev /* 330 */ 351 .long sys_pwritev /* 330 */
352 .long sys_rt_tgsigqueueinfo 352 .long sys_rt_tgsigqueueinfo
353 .long sys_perf_event_open 353 .long sys_perf_event_open
354 .long sys_get_thread_area
355 .long sys_set_thread_area
356 .long sys_atomic_cmpxchg_32 /* 335 */
357 .long sys_atomic_barrier
354 358
355 .rept NR_syscalls-(.-sys_call_table)/4 359 .rept NR_syscalls-(.-sys_call_table)/4
356 .long sys_ni_syscall 360 .long sys_ni_syscall
diff --git a/arch/m68knommu/mm/memory.c b/arch/m68knommu/mm/memory.c
index f93b88b51f9f..d5b9e1357808 100644
--- a/arch/m68knommu/mm/memory.c
+++ b/arch/m68knommu/mm/memory.c
@@ -24,7 +24,6 @@
24 24
25/* 25/*
26 * Map some physical address range into the kernel address space. 26 * Map some physical address range into the kernel address space.
27 * The code is copied and adapted from map_chunk().
28 */ 27 */
29 28
30unsigned long kernel_map(unsigned long paddr, unsigned long size, 29unsigned long kernel_map(unsigned long paddr, unsigned long size,
diff --git a/arch/microblaze/Kconfig b/arch/microblaze/Kconfig
index cd5837e298b2..b008168ae946 100644
--- a/arch/microblaze/Kconfig
+++ b/arch/microblaze/Kconfig
@@ -130,6 +130,7 @@ config CMDLINE_FORCE
130 130
131config OF 131config OF
132 def_bool y 132 def_bool y
133 select OF_FLATTREE
133 134
134config PROC_DEVICETREE 135config PROC_DEVICETREE
135 bool "Support for device tree in /proc" 136 bool "Support for device tree in /proc"
diff --git a/arch/microblaze/include/asm/io.h b/arch/microblaze/include/asm/io.h
index fc9997b73c09..267c7c779e53 100644
--- a/arch/microblaze/include/asm/io.h
+++ b/arch/microblaze/include/asm/io.h
@@ -217,7 +217,7 @@ static inline void __iomem *__ioremap(phys_addr_t address, unsigned long size,
217 * Little endian 217 * Little endian
218 */ 218 */
219 219
220#define out_le32(a, v) __raw_writel(__cpu_to_le32(v), (a)); 220#define out_le32(a, v) __raw_writel(__cpu_to_le32(v), (a))
221#define out_le16(a, v) __raw_writew(__cpu_to_le16(v), (a)) 221#define out_le16(a, v) __raw_writew(__cpu_to_le16(v), (a))
222 222
223#define in_le32(a) __le32_to_cpu(__raw_readl(a)) 223#define in_le32(a) __le32_to_cpu(__raw_readl(a))
diff --git a/arch/microblaze/include/asm/prom.h b/arch/microblaze/include/asm/prom.h
index ef3ec1d6ceb3..03f45a963204 100644
--- a/arch/microblaze/include/asm/prom.h
+++ b/arch/microblaze/include/asm/prom.h
@@ -26,31 +26,11 @@
26#include <asm/irq.h> 26#include <asm/irq.h>
27#include <asm/atomic.h> 27#include <asm/atomic.h>
28 28
29#define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 1
30#define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1
31
32#define of_compat_cmp(s1, s2, l) strncasecmp((s1), (s2), (l))
33#define of_prop_cmp(s1, s2) strcmp((s1), (s2))
34#define of_node_cmp(s1, s2) strcasecmp((s1), (s2))
35
36extern struct device_node *of_chosen;
37
38#define HAVE_ARCH_DEVTREE_FIXUPS 29#define HAVE_ARCH_DEVTREE_FIXUPS
39 30
40extern struct device_node *allnodes; /* temporary while merging */
41extern rwlock_t devtree_lock; /* temporary while merging */
42
43/* For updating the device tree at runtime */
44extern void of_attach_node(struct device_node *);
45extern void of_detach_node(struct device_node *);
46
47/* Other Prototypes */ 31/* Other Prototypes */
48extern int early_uartlite_console(void); 32extern int early_uartlite_console(void);
49 33
50extern struct resource *request_OF_resource(struct device_node *node,
51 int index, const char *name_postfix);
52extern int release_OF_resource(struct device_node *node, int index);
53
54/* 34/*
55 * OF address retreival & translation 35 * OF address retreival & translation
56 */ 36 */
diff --git a/arch/microblaze/include/asm/tlbflush.h b/arch/microblaze/include/asm/tlbflush.h
index eb31a0e8a772..10ec70cd8735 100644
--- a/arch/microblaze/include/asm/tlbflush.h
+++ b/arch/microblaze/include/asm/tlbflush.h
@@ -38,7 +38,7 @@ static inline void local_flush_tlb_range(struct vm_area_struct *vma,
38 38
39#define flush_tlb_kernel_range(start, end) do { } while (0) 39#define flush_tlb_kernel_range(start, end) do { } while (0)
40 40
41#define update_mmu_cache(vma, addr, pte) do { } while (0) 41#define update_mmu_cache(vma, addr, ptep) do { } while (0)
42 42
43#define flush_tlb_all local_flush_tlb_all 43#define flush_tlb_all local_flush_tlb_all
44#define flush_tlb_mm local_flush_tlb_mm 44#define flush_tlb_mm local_flush_tlb_mm
diff --git a/arch/microblaze/kernel/cpu/cache.c b/arch/microblaze/kernel/cpu/cache.c
index d9d63831cc2f..2a56bccce4e0 100644
--- a/arch/microblaze/kernel/cpu/cache.c
+++ b/arch/microblaze/kernel/cpu/cache.c
@@ -172,16 +172,15 @@ do { \
172/* It is used only first parameter for OP - for wic, wdc */ 172/* It is used only first parameter for OP - for wic, wdc */
173#define CACHE_RANGE_LOOP_1(start, end, line_length, op) \ 173#define CACHE_RANGE_LOOP_1(start, end, line_length, op) \
174do { \ 174do { \
175 int step = -line_length; \ 175 int volatile temp; \
176 int count = end - start; \ 176 BUG_ON(end - start <= 0); \
177 BUG_ON(count <= 0); \
178 \ 177 \
179 __asm__ __volatile__ (" 1: addk %0, %0, %1; \ 178 __asm__ __volatile__ (" 1: " #op " %1, r0; \
180 " #op " %0, r0; \ 179 cmpu %0, %1, %2; \
181 bgtid %1, 1b; \ 180 bgtid %0, 1b; \
182 addk %1, %1, %2; \ 181 addk %1, %1, %3; \
183 " : : "r" (start), "r" (count), \ 182 " : : "r" (temp), "r" (start), "r" (end),\
184 "r" (step) : "memory"); \ 183 "r" (line_length) : "memory"); \
185} while (0); 184} while (0);
186 185
187static void __flush_icache_range_msr_irq(unsigned long start, unsigned long end) 186static void __flush_icache_range_msr_irq(unsigned long start, unsigned long end)
@@ -313,16 +312,6 @@ static void __invalidate_dcache_all_wb(void)
313 pr_debug("%s\n", __func__); 312 pr_debug("%s\n", __func__);
314 CACHE_ALL_LOOP2(cpuinfo.dcache_size, cpuinfo.dcache_line_length, 313 CACHE_ALL_LOOP2(cpuinfo.dcache_size, cpuinfo.dcache_line_length,
315 wdc.clear) 314 wdc.clear)
316
317#if 0
318 unsigned int i;
319
320 pr_debug("%s\n", __func__);
321
322 /* Just loop through cache size and invalidate it */
323 for (i = 0; i < cpuinfo.dcache_size; i += cpuinfo.dcache_line_length)
324 __invalidate_dcache(0, i);
325#endif
326} 315}
327 316
328static void __invalidate_dcache_range_wb(unsigned long start, 317static void __invalidate_dcache_range_wb(unsigned long start,
diff --git a/arch/microblaze/kernel/of_platform.c b/arch/microblaze/kernel/of_platform.c
index acf4574d0f18..1c6d684996d7 100644
--- a/arch/microblaze/kernel/of_platform.c
+++ b/arch/microblaze/kernel/of_platform.c
@@ -185,7 +185,7 @@ EXPORT_SYMBOL(of_find_device_by_node);
185static int of_dev_phandle_match(struct device *dev, void *data) 185static int of_dev_phandle_match(struct device *dev, void *data)
186{ 186{
187 phandle *ph = data; 187 phandle *ph = data;
188 return to_of_device(dev)->node->linux_phandle == *ph; 188 return to_of_device(dev)->node->phandle == *ph;
189} 189}
190 190
191struct of_device *of_find_device_by_phandle(phandle ph) 191struct of_device *of_find_device_by_phandle(phandle ph)
diff --git a/arch/microblaze/kernel/prom.c b/arch/microblaze/kernel/prom.c
index b817df172aa9..a15ef6d67ca9 100644
--- a/arch/microblaze/kernel/prom.c
+++ b/arch/microblaze/kernel/prom.c
@@ -42,698 +42,21 @@
42#include <asm/sections.h> 42#include <asm/sections.h>
43#include <asm/pci-bridge.h> 43#include <asm/pci-bridge.h>
44 44
45static int __initdata dt_root_addr_cells; 45void __init early_init_dt_scan_chosen_arch(unsigned long node)
46static int __initdata dt_root_size_cells;
47
48typedef u32 cell_t;
49
50static struct boot_param_header *initial_boot_params;
51
52/* export that to outside world */
53struct device_node *of_chosen;
54
55static inline char *find_flat_dt_string(u32 offset)
56{
57 return ((char *)initial_boot_params) +
58 initial_boot_params->off_dt_strings + offset;
59}
60
61/**
62 * This function is used to scan the flattened device-tree, it is
63 * used to extract the memory informations at boot before we can
64 * unflatten the tree
65 */
66int __init of_scan_flat_dt(int (*it)(unsigned long node,
67 const char *uname, int depth,
68 void *data),
69 void *data)
70{
71 unsigned long p = ((unsigned long)initial_boot_params) +
72 initial_boot_params->off_dt_struct;
73 int rc = 0;
74 int depth = -1;
75
76 do {
77 u32 tag = *((u32 *)p);
78 char *pathp;
79
80 p += 4;
81 if (tag == OF_DT_END_NODE) {
82 depth--;
83 continue;
84 }
85 if (tag == OF_DT_NOP)
86 continue;
87 if (tag == OF_DT_END)
88 break;
89 if (tag == OF_DT_PROP) {
90 u32 sz = *((u32 *)p);
91 p += 8;
92 if (initial_boot_params->version < 0x10)
93 p = _ALIGN(p, sz >= 8 ? 8 : 4);
94 p += sz;
95 p = _ALIGN(p, 4);
96 continue;
97 }
98 if (tag != OF_DT_BEGIN_NODE) {
99 printk(KERN_WARNING "Invalid tag %x scanning flattened"
100 " device tree !\n", tag);
101 return -EINVAL;
102 }
103 depth++;
104 pathp = (char *)p;
105 p = _ALIGN(p + strlen(pathp) + 1, 4);
106 if ((*pathp) == '/') {
107 char *lp, *np;
108 for (lp = NULL, np = pathp; *np; np++)
109 if ((*np) == '/')
110 lp = np+1;
111 if (lp != NULL)
112 pathp = lp;
113 }
114 rc = it(p, pathp, depth, data);
115 if (rc != 0)
116 break;
117 } while (1);
118
119 return rc;
120}
121
122unsigned long __init of_get_flat_dt_root(void)
123{
124 unsigned long p = ((unsigned long)initial_boot_params) +
125 initial_boot_params->off_dt_struct;
126
127 while (*((u32 *)p) == OF_DT_NOP)
128 p += 4;
129 BUG_ON(*((u32 *)p) != OF_DT_BEGIN_NODE);
130 p += 4;
131 return _ALIGN(p + strlen((char *)p) + 1, 4);
132}
133
134/**
135 * This function can be used within scan_flattened_dt callback to get
136 * access to properties
137 */
138void *__init of_get_flat_dt_prop(unsigned long node, const char *name,
139 unsigned long *size)
140{
141 unsigned long p = node;
142
143 do {
144 u32 tag = *((u32 *)p);
145 u32 sz, noff;
146 const char *nstr;
147
148 p += 4;
149 if (tag == OF_DT_NOP)
150 continue;
151 if (tag != OF_DT_PROP)
152 return NULL;
153
154 sz = *((u32 *)p);
155 noff = *((u32 *)(p + 4));
156 p += 8;
157 if (initial_boot_params->version < 0x10)
158 p = _ALIGN(p, sz >= 8 ? 8 : 4);
159
160 nstr = find_flat_dt_string(noff);
161 if (nstr == NULL) {
162 printk(KERN_WARNING "Can't find property index"
163 " name !\n");
164 return NULL;
165 }
166 if (strcmp(name, nstr) == 0) {
167 if (size)
168 *size = sz;
169 return (void *)p;
170 }
171 p += sz;
172 p = _ALIGN(p, 4);
173 } while (1);
174}
175
176int __init of_flat_dt_is_compatible(unsigned long node, const char *compat)
177{
178 const char *cp;
179 unsigned long cplen, l;
180
181 cp = of_get_flat_dt_prop(node, "compatible", &cplen);
182 if (cp == NULL)
183 return 0;
184 while (cplen > 0) {
185 if (strncasecmp(cp, compat, strlen(compat)) == 0)
186 return 1;
187 l = strlen(cp) + 1;
188 cp += l;
189 cplen -= l;
190 }
191
192 return 0;
193}
194
195static void *__init unflatten_dt_alloc(unsigned long *mem, unsigned long size,
196 unsigned long align)
197{
198 void *res;
199
200 *mem = _ALIGN(*mem, align);
201 res = (void *)*mem;
202 *mem += size;
203
204 return res;
205}
206
207static unsigned long __init unflatten_dt_node(unsigned long mem,
208 unsigned long *p,
209 struct device_node *dad,
210 struct device_node ***allnextpp,
211 unsigned long fpsize)
212{
213 struct device_node *np;
214 struct property *pp, **prev_pp = NULL;
215 char *pathp;
216 u32 tag;
217 unsigned int l, allocl;
218 int has_name = 0;
219 int new_format = 0;
220
221 tag = *((u32 *)(*p));
222 if (tag != OF_DT_BEGIN_NODE) {
223 printk("Weird tag at start of node: %x\n", tag);
224 return mem;
225 }
226 *p += 4;
227 pathp = (char *)*p;
228 l = allocl = strlen(pathp) + 1;
229 *p = _ALIGN(*p + l, 4);
230
231 /* version 0x10 has a more compact unit name here instead of the full
232 * path. we accumulate the full path size using "fpsize", we'll rebuild
233 * it later. We detect this because the first character of the name is
234 * not '/'.
235 */
236 if ((*pathp) != '/') {
237 new_format = 1;
238 if (fpsize == 0) {
239 /* root node: special case. fpsize accounts for path
240 * plus terminating zero. root node only has '/', so
241 * fpsize should be 2, but we want to avoid the first
242 * level nodes to have two '/' so we use fpsize 1 here
243 */
244 fpsize = 1;
245 allocl = 2;
246 } else {
247 /* account for '/' and path size minus terminal 0
248 * already in 'l'
249 */
250 fpsize += l;
251 allocl = fpsize;
252 }
253 }
254
255 np = unflatten_dt_alloc(&mem, sizeof(struct device_node) + allocl,
256 __alignof__(struct device_node));
257 if (allnextpp) {
258 memset(np, 0, sizeof(*np));
259 np->full_name = ((char *)np) + sizeof(struct device_node);
260 if (new_format) {
261 char *p2 = np->full_name;
262 /* rebuild full path for new format */
263 if (dad && dad->parent) {
264 strcpy(p2, dad->full_name);
265#ifdef DEBUG
266 if ((strlen(p2) + l + 1) != allocl) {
267 pr_debug("%s: p: %d, l: %d, a: %d\n",
268 pathp, (int)strlen(p2),
269 l, allocl);
270 }
271#endif
272 p2 += strlen(p2);
273 }
274 *(p2++) = '/';
275 memcpy(p2, pathp, l);
276 } else
277 memcpy(np->full_name, pathp, l);
278 prev_pp = &np->properties;
279 **allnextpp = np;
280 *allnextpp = &np->allnext;
281 if (dad != NULL) {
282 np->parent = dad;
283 /* we temporarily use the next field as `last_child'*/
284 if (dad->next == NULL)
285 dad->child = np;
286 else
287 dad->next->sibling = np;
288 dad->next = np;
289 }
290 kref_init(&np->kref);
291 }
292 while (1) {
293 u32 sz, noff;
294 char *pname;
295
296 tag = *((u32 *)(*p));
297 if (tag == OF_DT_NOP) {
298 *p += 4;
299 continue;
300 }
301 if (tag != OF_DT_PROP)
302 break;
303 *p += 4;
304 sz = *((u32 *)(*p));
305 noff = *((u32 *)((*p) + 4));
306 *p += 8;
307 if (initial_boot_params->version < 0x10)
308 *p = _ALIGN(*p, sz >= 8 ? 8 : 4);
309
310 pname = find_flat_dt_string(noff);
311 if (pname == NULL) {
312 printk(KERN_INFO
313 "Can't find property name in list !\n");
314 break;
315 }
316 if (strcmp(pname, "name") == 0)
317 has_name = 1;
318 l = strlen(pname) + 1;
319 pp = unflatten_dt_alloc(&mem, sizeof(struct property),
320 __alignof__(struct property));
321 if (allnextpp) {
322 if (strcmp(pname, "linux,phandle") == 0) {
323 np->node = *((u32 *)*p);
324 if (np->linux_phandle == 0)
325 np->linux_phandle = np->node;
326 }
327 if (strcmp(pname, "ibm,phandle") == 0)
328 np->linux_phandle = *((u32 *)*p);
329 pp->name = pname;
330 pp->length = sz;
331 pp->value = (void *)*p;
332 *prev_pp = pp;
333 prev_pp = &pp->next;
334 }
335 *p = _ALIGN((*p) + sz, 4);
336 }
337 /* with version 0x10 we may not have the name property, recreate
338 * it here from the unit name if absent
339 */
340 if (!has_name) {
341 char *p1 = pathp, *ps = pathp, *pa = NULL;
342 int sz;
343
344 while (*p1) {
345 if ((*p1) == '@')
346 pa = p1;
347 if ((*p1) == '/')
348 ps = p1 + 1;
349 p1++;
350 }
351 if (pa < ps)
352 pa = p1;
353 sz = (pa - ps) + 1;
354 pp = unflatten_dt_alloc(&mem, sizeof(struct property) + sz,
355 __alignof__(struct property));
356 if (allnextpp) {
357 pp->name = "name";
358 pp->length = sz;
359 pp->value = pp + 1;
360 *prev_pp = pp;
361 prev_pp = &pp->next;
362 memcpy(pp->value, ps, sz - 1);
363 ((char *)pp->value)[sz - 1] = 0;
364 pr_debug("fixed up name for %s -> %s\n", pathp,
365 (char *)pp->value);
366 }
367 }
368 if (allnextpp) {
369 *prev_pp = NULL;
370 np->name = of_get_property(np, "name", NULL);
371 np->type = of_get_property(np, "device_type", NULL);
372
373 if (!np->name)
374 np->name = "<NULL>";
375 if (!np->type)
376 np->type = "<NULL>";
377 }
378 while (tag == OF_DT_BEGIN_NODE) {
379 mem = unflatten_dt_node(mem, p, np, allnextpp, fpsize);
380 tag = *((u32 *)(*p));
381 }
382 if (tag != OF_DT_END_NODE) {
383 printk(KERN_INFO "Weird tag at end of node: %x\n", tag);
384 return mem;
385 }
386 *p += 4;
387 return mem;
388}
389
390/**
391 * unflattens the device-tree passed by the firmware, creating the
392 * tree of struct device_node. It also fills the "name" and "type"
393 * pointers of the nodes so the normal device-tree walking functions
394 * can be used (this used to be done by finish_device_tree)
395 */
396void __init unflatten_device_tree(void)
397{
398 unsigned long start, mem, size;
399 struct device_node **allnextp = &allnodes;
400
401 pr_debug(" -> unflatten_device_tree()\n");
402
403 /* First pass, scan for size */
404 start = ((unsigned long)initial_boot_params) +
405 initial_boot_params->off_dt_struct;
406 size = unflatten_dt_node(0, &start, NULL, NULL, 0);
407 size = (size | 3) + 1;
408
409 pr_debug(" size is %lx, allocating...\n", size);
410
411 /* Allocate memory for the expanded device tree */
412 mem = lmb_alloc(size + 4, __alignof__(struct device_node));
413 mem = (unsigned long) __va(mem);
414
415 ((u32 *)mem)[size / 4] = 0xdeadbeef;
416
417 pr_debug(" unflattening %lx...\n", mem);
418
419 /* Second pass, do actual unflattening */
420 start = ((unsigned long)initial_boot_params) +
421 initial_boot_params->off_dt_struct;
422 unflatten_dt_node(mem, &start, NULL, &allnextp, 0);
423 if (*((u32 *)start) != OF_DT_END)
424 printk(KERN_WARNING "Weird tag at end of tree: %08x\n",
425 *((u32 *)start));
426 if (((u32 *)mem)[size / 4] != 0xdeadbeef)
427 printk(KERN_WARNING "End of tree marker overwritten: %08x\n",
428 ((u32 *)mem)[size / 4]);
429 *allnextp = NULL;
430
431 /* Get pointer to OF "/chosen" node for use everywhere */
432 of_chosen = of_find_node_by_path("/chosen");
433 if (of_chosen == NULL)
434 of_chosen = of_find_node_by_path("/chosen@0");
435
436 pr_debug(" <- unflatten_device_tree()\n");
437}
438
439#define early_init_dt_scan_drconf_memory(node) 0
440
441static int __init early_init_dt_scan_cpus(unsigned long node,
442 const char *uname, int depth,
443 void *data)
444{
445 static int logical_cpuid;
446 char *type = of_get_flat_dt_prop(node, "device_type", NULL);
447 const u32 *intserv;
448 int i, nthreads;
449 int found = 0;
450
451 /* We are scanning "cpu" nodes only */
452 if (type == NULL || strcmp(type, "cpu") != 0)
453 return 0;
454
455 /* Get physical cpuid */
456 intserv = of_get_flat_dt_prop(node, "reg", NULL);
457 nthreads = 1;
458
459 /*
460 * Now see if any of these threads match our boot cpu.
461 * NOTE: This must match the parsing done in smp_setup_cpu_maps.
462 */
463 for (i = 0; i < nthreads; i++) {
464 /*
465 * version 2 of the kexec param format adds the phys cpuid of
466 * booted proc.
467 */
468 if (initial_boot_params && initial_boot_params->version >= 2) {
469 if (intserv[i] ==
470 initial_boot_params->boot_cpuid_phys) {
471 found = 1;
472 break;
473 }
474 } else {
475 /*
476 * Check if it's the boot-cpu, set it's hw index now,
477 * unfortunately this format did not support booting
478 * off secondary threads.
479 */
480 if (of_get_flat_dt_prop(node,
481 "linux,boot-cpu", NULL) != NULL) {
482 found = 1;
483 break;
484 }
485 }
486
487#ifdef CONFIG_SMP
488 /* logical cpu id is always 0 on UP kernels */
489 logical_cpuid++;
490#endif
491 }
492
493 if (found) {
494 pr_debug("boot cpu: logical %d physical %d\n", logical_cpuid,
495 intserv[i]);
496 boot_cpuid = logical_cpuid;
497 }
498
499 return 0;
500}
501
502#ifdef CONFIG_BLK_DEV_INITRD
503static void __init early_init_dt_check_for_initrd(unsigned long node)
504{
505 unsigned long l;
506 u32 *prop;
507
508 pr_debug("Looking for initrd properties... ");
509
510 prop = of_get_flat_dt_prop(node, "linux,initrd-start", &l);
511 if (prop) {
512 initrd_start = (unsigned long)
513 __va((u32)of_read_ulong(prop, l/4));
514
515 prop = of_get_flat_dt_prop(node, "linux,initrd-end", &l);
516 if (prop) {
517 initrd_end = (unsigned long)
518 __va((u32)of_read_ulong(prop, 1/4));
519 initrd_below_start_ok = 1;
520 } else {
521 initrd_start = 0;
522 }
523 }
524
525 pr_debug("initrd_start=0x%lx initrd_end=0x%lx\n",
526 initrd_start, initrd_end);
527}
528#else
529static inline void early_init_dt_check_for_initrd(unsigned long node)
530{
531}
532#endif /* CONFIG_BLK_DEV_INITRD */
533
534static int __init early_init_dt_scan_chosen(unsigned long node,
535 const char *uname, int depth, void *data)
536{
537 unsigned long l;
538 char *p;
539
540 pr_debug("search \"chosen\", depth: %d, uname: %s\n", depth, uname);
541
542 if (depth != 1 ||
543 (strcmp(uname, "chosen") != 0 &&
544 strcmp(uname, "chosen@0") != 0))
545 return 0;
546
547#ifdef CONFIG_KEXEC
548 lprop = (u64 *)of_get_flat_dt_prop(node,
549 "linux,crashkernel-base", NULL);
550 if (lprop)
551 crashk_res.start = *lprop;
552
553 lprop = (u64 *)of_get_flat_dt_prop(node,
554 "linux,crashkernel-size", NULL);
555 if (lprop)
556 crashk_res.end = crashk_res.start + *lprop - 1;
557#endif
558
559 early_init_dt_check_for_initrd(node);
560
561 /* Retreive command line */
562 p = of_get_flat_dt_prop(node, "bootargs", &l);
563 if (p != NULL && l > 0)
564 strlcpy(cmd_line, p, min((int)l, COMMAND_LINE_SIZE));
565
566#ifdef CONFIG_CMDLINE
567#ifndef CONFIG_CMDLINE_FORCE
568 if (p == NULL || l == 0 || (l == 1 && (*p) == 0))
569#endif
570 strlcpy(cmd_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
571#endif /* CONFIG_CMDLINE */
572
573 pr_debug("Command line is: %s\n", cmd_line);
574
575 /* break now */
576 return 1;
577}
578
579static int __init early_init_dt_scan_root(unsigned long node,
580 const char *uname, int depth, void *data)
581{
582 u32 *prop;
583
584 if (depth != 0)
585 return 0;
586
587 prop = of_get_flat_dt_prop(node, "#size-cells", NULL);
588 dt_root_size_cells = (prop == NULL) ? 1 : *prop;
589 pr_debug("dt_root_size_cells = %x\n", dt_root_size_cells);
590
591 prop = of_get_flat_dt_prop(node, "#address-cells", NULL);
592 dt_root_addr_cells = (prop == NULL) ? 2 : *prop;
593 pr_debug("dt_root_addr_cells = %x\n", dt_root_addr_cells);
594
595 /* break now */
596 return 1;
597}
598
599static u64 __init dt_mem_next_cell(int s, cell_t **cellp)
600{ 46{
601 cell_t *p = *cellp; 47 /* No Microblaze specific code here */
602
603 *cellp = p + s;
604 return of_read_number(p, s);
605} 48}
606 49
607static int __init early_init_dt_scan_memory(unsigned long node, 50void __init early_init_dt_add_memory_arch(u64 base, u64 size)
608 const char *uname, int depth, void *data)
609{ 51{
610 char *type = of_get_flat_dt_prop(node, "device_type", NULL); 52 lmb_add(base, size);
611 cell_t *reg, *endp;
612 unsigned long l;
613
614 /* Look for the ibm,dynamic-reconfiguration-memory node */
615/* if (depth == 1 &&
616 strcmp(uname, "ibm,dynamic-reconfiguration-memory") == 0)
617 return early_init_dt_scan_drconf_memory(node);
618*/
619 /* We are scanning "memory" nodes only */
620 if (type == NULL) {
621 /*
622 * The longtrail doesn't have a device_type on the
623 * /memory node, so look for the node called /memory@0.
624 */
625 if (depth != 1 || strcmp(uname, "memory@0") != 0)
626 return 0;
627 } else if (strcmp(type, "memory") != 0)
628 return 0;
629
630 reg = (cell_t *)of_get_flat_dt_prop(node, "linux,usable-memory", &l);
631 if (reg == NULL)
632 reg = (cell_t *)of_get_flat_dt_prop(node, "reg", &l);
633 if (reg == NULL)
634 return 0;
635
636 endp = reg + (l / sizeof(cell_t));
637
638 pr_debug("memory scan node %s, reg size %ld, data: %x %x %x %x,\n",
639 uname, l, reg[0], reg[1], reg[2], reg[3]);
640
641 while ((endp - reg) >= (dt_root_addr_cells + dt_root_size_cells)) {
642 u64 base, size;
643
644 base = dt_mem_next_cell(dt_root_addr_cells, &reg);
645 size = dt_mem_next_cell(dt_root_size_cells, &reg);
646
647 if (size == 0)
648 continue;
649 pr_debug(" - %llx , %llx\n", (unsigned long long)base,
650 (unsigned long long)size);
651
652 lmb_add(base, size);
653 }
654 return 0;
655} 53}
656 54
657#ifdef CONFIG_PHYP_DUMP 55u64 __init early_init_dt_alloc_memory_arch(u64 size, u64 align)
658/**
659 * phyp_dump_calculate_reserve_size() - reserve variable boot area 5% or arg
660 *
661 * Function to find the largest size we need to reserve
662 * during early boot process.
663 *
664 * It either looks for boot param and returns that OR
665 * returns larger of 256 or 5% rounded down to multiples of 256MB.
666 *
667 */
668static inline unsigned long phyp_dump_calculate_reserve_size(void)
669{ 56{
670 unsigned long tmp; 57 return lmb_alloc(size, align);
671
672 if (phyp_dump_info->reserve_bootvar)
673 return phyp_dump_info->reserve_bootvar;
674
675 /* divide by 20 to get 5% of value */
676 tmp = lmb_end_of_DRAM();
677 do_div(tmp, 20);
678
679 /* round it down in multiples of 256 */
680 tmp = tmp & ~0x0FFFFFFFUL;
681
682 return (tmp > PHYP_DUMP_RMR_END ? tmp : PHYP_DUMP_RMR_END);
683} 58}
684 59
685/**
686 * phyp_dump_reserve_mem() - reserve all not-yet-dumped mmemory
687 *
688 * This routine may reserve memory regions in the kernel only
689 * if the system is supported and a dump was taken in last
690 * boot instance or if the hardware is supported and the
691 * scratch area needs to be setup. In other instances it returns
692 * without reserving anything. The memory in case of dump being
693 * active is freed when the dump is collected (by userland tools).
694 */
695static void __init phyp_dump_reserve_mem(void)
696{
697 unsigned long base, size;
698 unsigned long variable_reserve_size;
699
700 if (!phyp_dump_info->phyp_dump_configured) {
701 printk(KERN_ERR "Phyp-dump not supported on this hardware\n");
702 return;
703 }
704
705 if (!phyp_dump_info->phyp_dump_at_boot) {
706 printk(KERN_INFO "Phyp-dump disabled at boot time\n");
707 return;
708 }
709
710 variable_reserve_size = phyp_dump_calculate_reserve_size();
711
712 if (phyp_dump_info->phyp_dump_is_active) {
713 /* Reserve *everything* above RMR.Area freed by userland tools*/
714 base = variable_reserve_size;
715 size = lmb_end_of_DRAM() - base;
716
717 /* XXX crashed_ram_end is wrong, since it may be beyond
718 * the memory_limit, it will need to be adjusted. */
719 lmb_reserve(base, size);
720
721 phyp_dump_info->init_reserve_start = base;
722 phyp_dump_info->init_reserve_size = size;
723 } else {
724 size = phyp_dump_info->cpu_state_size +
725 phyp_dump_info->hpte_region_size +
726 variable_reserve_size;
727 base = lmb_end_of_DRAM() - size;
728 lmb_reserve(base, size);
729 phyp_dump_info->init_reserve_start = base;
730 phyp_dump_info->init_reserve_size = size;
731 }
732}
733#else
734static inline void __init phyp_dump_reserve_mem(void) {}
735#endif /* CONFIG_PHYP_DUMP && CONFIG_PPC_RTAS */
736
737#ifdef CONFIG_EARLY_PRINTK 60#ifdef CONFIG_EARLY_PRINTK
738/* MS this is Microblaze specifig function */ 61/* MS this is Microblaze specifig function */
739static int __init early_init_dt_scan_serial(unsigned long node, 62static int __init early_init_dt_scan_serial(unsigned long node,
@@ -775,11 +98,6 @@ void __init early_init_devtree(void *params)
775 /* Setup flat device-tree pointer */ 98 /* Setup flat device-tree pointer */
776 initial_boot_params = params; 99 initial_boot_params = params;
777 100
778#ifdef CONFIG_PHYP_DUMP
779 /* scan tree to see if dump occured during last boot */
780 of_scan_flat_dt(early_init_dt_scan_phyp_dump, NULL);
781#endif
782
783 /* Retrieve various informations from the /chosen node of the 101 /* Retrieve various informations from the /chosen node of the
784 * device-tree, including the platform type, initrd location and 102 * device-tree, including the platform type, initrd location and
785 * size, TCE reserve, and more ... 103 * size, TCE reserve, and more ...
@@ -799,33 +117,18 @@ void __init early_init_devtree(void *params)
799 117
800 pr_debug("Phys. mem: %lx\n", (unsigned long) lmb_phys_mem_size()); 118 pr_debug("Phys. mem: %lx\n", (unsigned long) lmb_phys_mem_size());
801 119
802 pr_debug("Scanning CPUs ...\n");
803
804 /* Retreive CPU related informations from the flat tree
805 * (altivec support, boot CPU ID, ...)
806 */
807 of_scan_flat_dt(early_init_dt_scan_cpus, NULL);
808
809 pr_debug(" <- early_init_devtree()\n"); 120 pr_debug(" <- early_init_devtree()\n");
810} 121}
811 122
812/** 123#ifdef CONFIG_BLK_DEV_INITRD
813 * Indicates whether the root node has a given value in its 124void __init early_init_dt_setup_initrd_arch(unsigned long start,
814 * compatible property. 125 unsigned long end)
815 */
816int machine_is_compatible(const char *compat)
817{ 126{
818 struct device_node *root; 127 initrd_start = (unsigned long)__va(start);
819 int rc = 0; 128 initrd_end = (unsigned long)__va(end);
820 129 initrd_below_start_ok = 1;
821 root = of_find_node_by_path("/");
822 if (root) {
823 rc = of_device_is_compatible(root, compat);
824 of_node_put(root);
825 }
826 return rc;
827} 130}
828EXPORT_SYMBOL(machine_is_compatible); 131#endif
829 132
830/******* 133/*******
831 * 134 *
@@ -838,273 +141,6 @@ EXPORT_SYMBOL(machine_is_compatible);
838 * 141 *
839 *******/ 142 *******/
840 143
841/**
842 * of_find_node_by_phandle - Find a node given a phandle
843 * @handle: phandle of the node to find
844 *
845 * Returns a node pointer with refcount incremented, use
846 * of_node_put() on it when done.
847 */
848struct device_node *of_find_node_by_phandle(phandle handle)
849{
850 struct device_node *np;
851
852 read_lock(&devtree_lock);
853 for (np = allnodes; np != NULL; np = np->allnext)
854 if (np->linux_phandle == handle)
855 break;
856 of_node_get(np);
857 read_unlock(&devtree_lock);
858 return np;
859}
860EXPORT_SYMBOL(of_find_node_by_phandle);
861
862/**
863 * of_node_get - Increment refcount of a node
864 * @node: Node to inc refcount, NULL is supported to
865 * simplify writing of callers
866 *
867 * Returns node.
868 */
869struct device_node *of_node_get(struct device_node *node)
870{
871 if (node)
872 kref_get(&node->kref);
873 return node;
874}
875EXPORT_SYMBOL(of_node_get);
876
877static inline struct device_node *kref_to_device_node(struct kref *kref)
878{
879 return container_of(kref, struct device_node, kref);
880}
881
882/**
883 * of_node_release - release a dynamically allocated node
884 * @kref: kref element of the node to be released
885 *
886 * In of_node_put() this function is passed to kref_put()
887 * as the destructor.
888 */
889static void of_node_release(struct kref *kref)
890{
891 struct device_node *node = kref_to_device_node(kref);
892 struct property *prop = node->properties;
893
894 /* We should never be releasing nodes that haven't been detached. */
895 if (!of_node_check_flag(node, OF_DETACHED)) {
896 printk(KERN_INFO "WARNING: Bad of_node_put() on %s\n",
897 node->full_name);
898 dump_stack();
899 kref_init(&node->kref);
900 return;
901 }
902
903 if (!of_node_check_flag(node, OF_DYNAMIC))
904 return;
905
906 while (prop) {
907 struct property *next = prop->next;
908 kfree(prop->name);
909 kfree(prop->value);
910 kfree(prop);
911 prop = next;
912
913 if (!prop) {
914 prop = node->deadprops;
915 node->deadprops = NULL;
916 }
917 }
918 kfree(node->full_name);
919 kfree(node->data);
920 kfree(node);
921}
922
923/**
924 * of_node_put - Decrement refcount of a node
925 * @node: Node to dec refcount, NULL is supported to
926 * simplify writing of callers
927 *
928 */
929void of_node_put(struct device_node *node)
930{
931 if (node)
932 kref_put(&node->kref, of_node_release);
933}
934EXPORT_SYMBOL(of_node_put);
935
936/*
937 * Plug a device node into the tree and global list.
938 */
939void of_attach_node(struct device_node *np)
940{
941 unsigned long flags;
942
943 write_lock_irqsave(&devtree_lock, flags);
944 np->sibling = np->parent->child;
945 np->allnext = allnodes;
946 np->parent->child = np;
947 allnodes = np;
948 write_unlock_irqrestore(&devtree_lock, flags);
949}
950
951/*
952 * "Unplug" a node from the device tree. The caller must hold
953 * a reference to the node. The memory associated with the node
954 * is not freed until its refcount goes to zero.
955 */
956void of_detach_node(struct device_node *np)
957{
958 struct device_node *parent;
959 unsigned long flags;
960
961 write_lock_irqsave(&devtree_lock, flags);
962
963 parent = np->parent;
964 if (!parent)
965 goto out_unlock;
966
967 if (allnodes == np)
968 allnodes = np->allnext;
969 else {
970 struct device_node *prev;
971 for (prev = allnodes;
972 prev->allnext != np;
973 prev = prev->allnext)
974 ;
975 prev->allnext = np->allnext;
976 }
977
978 if (parent->child == np)
979 parent->child = np->sibling;
980 else {
981 struct device_node *prevsib;
982 for (prevsib = np->parent->child;
983 prevsib->sibling != np;
984 prevsib = prevsib->sibling)
985 ;
986 prevsib->sibling = np->sibling;
987 }
988
989 of_node_set_flag(np, OF_DETACHED);
990
991out_unlock:
992 write_unlock_irqrestore(&devtree_lock, flags);
993}
994
995/*
996 * Add a property to a node
997 */
998int prom_add_property(struct device_node *np, struct property *prop)
999{
1000 struct property **next;
1001 unsigned long flags;
1002
1003 prop->next = NULL;
1004 write_lock_irqsave(&devtree_lock, flags);
1005 next = &np->properties;
1006 while (*next) {
1007 if (strcmp(prop->name, (*next)->name) == 0) {
1008 /* duplicate ! don't insert it */
1009 write_unlock_irqrestore(&devtree_lock, flags);
1010 return -1;
1011 }
1012 next = &(*next)->next;
1013 }
1014 *next = prop;
1015 write_unlock_irqrestore(&devtree_lock, flags);
1016
1017#ifdef CONFIG_PROC_DEVICETREE
1018 /* try to add to proc as well if it was initialized */
1019 if (np->pde)
1020 proc_device_tree_add_prop(np->pde, prop);
1021#endif /* CONFIG_PROC_DEVICETREE */
1022
1023 return 0;
1024}
1025
1026/*
1027 * Remove a property from a node. Note that we don't actually
1028 * remove it, since we have given out who-knows-how-many pointers
1029 * to the data using get-property. Instead we just move the property
1030 * to the "dead properties" list, so it won't be found any more.
1031 */
1032int prom_remove_property(struct device_node *np, struct property *prop)
1033{
1034 struct property **next;
1035 unsigned long flags;
1036 int found = 0;
1037
1038 write_lock_irqsave(&devtree_lock, flags);
1039 next = &np->properties;
1040 while (*next) {
1041 if (*next == prop) {
1042 /* found the node */
1043 *next = prop->next;
1044 prop->next = np->deadprops;
1045 np->deadprops = prop;
1046 found = 1;
1047 break;
1048 }
1049 next = &(*next)->next;
1050 }
1051 write_unlock_irqrestore(&devtree_lock, flags);
1052
1053 if (!found)
1054 return -ENODEV;
1055
1056#ifdef CONFIG_PROC_DEVICETREE
1057 /* try to remove the proc node as well */
1058 if (np->pde)
1059 proc_device_tree_remove_prop(np->pde, prop);
1060#endif /* CONFIG_PROC_DEVICETREE */
1061
1062 return 0;
1063}
1064
1065/*
1066 * Update a property in a node. Note that we don't actually
1067 * remove it, since we have given out who-knows-how-many pointers
1068 * to the data using get-property. Instead we just move the property
1069 * to the "dead properties" list, and add the new property to the
1070 * property list
1071 */
1072int prom_update_property(struct device_node *np,
1073 struct property *newprop,
1074 struct property *oldprop)
1075{
1076 struct property **next;
1077 unsigned long flags;
1078 int found = 0;
1079
1080 write_lock_irqsave(&devtree_lock, flags);
1081 next = &np->properties;
1082 while (*next) {
1083 if (*next == oldprop) {
1084 /* found the node */
1085 newprop->next = oldprop->next;
1086 *next = newprop;
1087 oldprop->next = np->deadprops;
1088 np->deadprops = oldprop;
1089 found = 1;
1090 break;
1091 }
1092 next = &(*next)->next;
1093 }
1094 write_unlock_irqrestore(&devtree_lock, flags);
1095
1096 if (!found)
1097 return -ENODEV;
1098
1099#ifdef CONFIG_PROC_DEVICETREE
1100 /* try to add to proc as well if it was initialized */
1101 if (np->pde)
1102 proc_device_tree_update_prop(np->pde, newprop, oldprop);
1103#endif /* CONFIG_PROC_DEVICETREE */
1104
1105 return 0;
1106}
1107
1108#if defined(CONFIG_DEBUG_FS) && defined(DEBUG) 144#if defined(CONFIG_DEBUG_FS) && defined(DEBUG)
1109static struct debugfs_blob_wrapper flat_dt_blob; 145static struct debugfs_blob_wrapper flat_dt_blob;
1110 146
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 8b5d174685f0..591ca0cd4c24 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -41,7 +41,7 @@ config AR7
41 select SYS_SUPPORTS_32BIT_KERNEL 41 select SYS_SUPPORTS_32BIT_KERNEL
42 select SYS_SUPPORTS_LITTLE_ENDIAN 42 select SYS_SUPPORTS_LITTLE_ENDIAN
43 select SYS_SUPPORTS_ZBOOT_UART16550 43 select SYS_SUPPORTS_ZBOOT_UART16550
44 select GENERIC_GPIO 44 select ARCH_REQUIRE_GPIOLIB
45 select GCD 45 select GCD
46 select VLYNQ 46 select VLYNQ
47 help 47 help
@@ -180,7 +180,7 @@ config LASAT
180 180
181config MACH_LOONGSON 181config MACH_LOONGSON
182 bool "Loongson family of machines" 182 bool "Loongson family of machines"
183 select SYS_SUPPORTS_ZBOOT_UART16550 183 select SYS_SUPPORTS_ZBOOT
184 help 184 help
185 This enables the support of Loongson family of machines. 185 This enables the support of Loongson family of machines.
186 186
@@ -1295,7 +1295,6 @@ config CPU_CAVIUM_OCTEON
1295 select SYS_SUPPORTS_SMP 1295 select SYS_SUPPORTS_SMP
1296 select NR_CPUS_DEFAULT_16 1296 select NR_CPUS_DEFAULT_16
1297 select WEAK_ORDERING 1297 select WEAK_ORDERING
1298 select WEAK_REORDERING_BEYOND_LLSC
1299 select CPU_SUPPORTS_HIGHMEM 1298 select CPU_SUPPORTS_HIGHMEM
1300 select CPU_SUPPORTS_HUGEPAGES 1299 select CPU_SUPPORTS_HUGEPAGES
1301 help 1300 help
@@ -1726,6 +1725,9 @@ config SB1_PASS_2_1_WORKAROUNDS
1726config 64BIT_PHYS_ADDR 1725config 64BIT_PHYS_ADDR
1727 bool 1726 bool
1728 1727
1728config ARCH_PHYS_ADDR_T_64BIT
1729 def_bool 64BIT_PHYS_ADDR
1730
1729config CPU_HAS_SMARTMIPS 1731config CPU_HAS_SMARTMIPS
1730 depends on SYS_SUPPORTS_SMARTMIPS 1732 depends on SYS_SUPPORTS_SMARTMIPS
1731 bool "Support for the SmartMIPS ASE" 1733 bool "Support for the SmartMIPS ASE"
diff --git a/arch/mips/Kconfig.debug b/arch/mips/Kconfig.debug
index d2b88a0be519..43dc27997730 100644
--- a/arch/mips/Kconfig.debug
+++ b/arch/mips/Kconfig.debug
@@ -102,4 +102,30 @@ config RUNTIME_DEBUG
102 arch/mips/include/asm/debug.h for debugging macros. 102 arch/mips/include/asm/debug.h for debugging macros.
103 If unsure, say N. 103 If unsure, say N.
104 104
105config DEBUG_ZBOOT
106 bool "Enable compressed kernel support debugging"
107 depends on DEBUG_KERNEL && SYS_SUPPORTS_ZBOOT
108 default n
109 help
110 If you want to add compressed kernel support to a new board, and the
111 board supports uart16550 compatible serial port, please select
112 SYS_SUPPORTS_ZBOOT_UART16550 for your board and enable this option to
113 debug it.
114
115 If your board doesn't support uart16550 compatible serial port, you
116 can try to select SYS_SUPPORTS_ZBOOT and use the other methods to
117 debug it. for example, add a new serial port support just as
118 arch/mips/boot/compressed/uart-16550.c does.
119
120 After the compressed kernel support works, please disable this option
121 to reduce the kernel image size and speed up the booting procedure a
122 little.
123
124config SPINLOCK_TEST
125 bool "Enable spinlock timing tests in debugfs"
126 depends on DEBUG_FS
127 default n
128 help
129 Add several files to the debugfs to test spinlock speed.
130
105endmenu 131endmenu
diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index 1893efd43fca..2f2eac233322 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -185,6 +185,15 @@ libs-$(CONFIG_SNIPROM) += arch/mips/fw/sni/
185libs-y += arch/mips/fw/lib/ 185libs-y += arch/mips/fw/lib/
186 186
187# 187#
188# Kernel compression
189#
190ifdef SYS_SUPPORTS_ZBOOT
191COMPRESSION_FNAME = vmlinuz
192else
193COMPRESSION_FNAME = vmlinux
194endif
195
196#
188# Board-dependent options and extra files 197# Board-dependent options and extra files
189# 198#
190 199
@@ -332,11 +341,11 @@ load-$(CONFIG_WR_PPMC) += 0xffffffff80100000
332# 341#
333# Loongson family 342# Loongson family
334# 343#
335core-$(CONFIG_MACH_LOONGSON) +=arch/mips/loongson/ 344core-$(CONFIG_MACH_LOONGSON) += arch/mips/loongson/
336cflags-$(CONFIG_MACH_LOONGSON) += -I$(srctree)/arch/mips/include/asm/mach-loongson \ 345cflags-$(CONFIG_MACH_LOONGSON) += -I$(srctree)/arch/mips/include/asm/mach-loongson \
337 -mno-branch-likely 346 -mno-branch-likely
338load-$(CONFIG_LEMOTE_FULOONG2E) +=0xffffffff80100000 347load-$(CONFIG_LEMOTE_FULOONG2E) += 0xffffffff80100000
339load-$(CONFIG_LEMOTE_MACH2F) +=0xffffffff80200000 348load-$(CONFIG_LEMOTE_MACH2F) += 0xffffffff80200000
340 349
341# 350#
342# MIPS Malta board 351# MIPS Malta board
@@ -344,7 +353,7 @@ load-$(CONFIG_LEMOTE_MACH2F) +=0xffffffff80200000
344core-$(CONFIG_MIPS_MALTA) += arch/mips/mti-malta/ 353core-$(CONFIG_MIPS_MALTA) += arch/mips/mti-malta/
345cflags-$(CONFIG_MIPS_MALTA) += -I$(srctree)/arch/mips/include/asm/mach-malta 354cflags-$(CONFIG_MIPS_MALTA) += -I$(srctree)/arch/mips/include/asm/mach-malta
346load-$(CONFIG_MIPS_MALTA) += 0xffffffff80100000 355load-$(CONFIG_MIPS_MALTA) += 0xffffffff80100000
347all-$(CONFIG_MIPS_MALTA) := vmlinuz.bin 356all-$(CONFIG_MIPS_MALTA) := $(COMPRESSION_FNAME).bin
348 357
349# 358#
350# MIPS SIM 359# MIPS SIM
@@ -594,7 +603,7 @@ load-$(CONFIG_SNI_RM) += 0xffffffff80600000
594else 603else
595load-$(CONFIG_SNI_RM) += 0xffffffff80030000 604load-$(CONFIG_SNI_RM) += 0xffffffff80030000
596endif 605endif
597all-$(CONFIG_SNI_RM) := vmlinuz.ecoff 606all-$(CONFIG_SNI_RM) := $(COMPRESSION_FNAME).ecoff
598 607
599# 608#
600# Common TXx9 609# Common TXx9
diff --git a/arch/mips/alchemy/Kconfig b/arch/mips/alchemy/Kconfig
index 00b498e97c83..df3b1a7eb15d 100644
--- a/arch/mips/alchemy/Kconfig
+++ b/arch/mips/alchemy/Kconfig
@@ -1,5 +1,5 @@
1# au1000-style gpio 1# au1000-style gpio and interrupt controllers
2config ALCHEMY_GPIO_AU1000 2config ALCHEMY_GPIOINT_AU1000
3 bool 3 bool
4 4
5# select this in your board config if you don't want to use the gpio 5# select this in your board config if you don't want to use the gpio
@@ -20,12 +20,14 @@ config MIPS_MTX1
20 select HW_HAS_PCI 20 select HW_HAS_PCI
21 select SOC_AU1500 21 select SOC_AU1500
22 select SYS_SUPPORTS_LITTLE_ENDIAN 22 select SYS_SUPPORTS_LITTLE_ENDIAN
23 select SYS_HAS_EARLY_PRINTK
23 24
24config MIPS_BOSPORUS 25config MIPS_BOSPORUS
25 bool "Alchemy Bosporus board" 26 bool "Alchemy Bosporus board"
26 select SOC_AU1500 27 select SOC_AU1500
27 select DMA_NONCOHERENT 28 select DMA_NONCOHERENT
28 select SYS_SUPPORTS_LITTLE_ENDIAN 29 select SYS_SUPPORTS_LITTLE_ENDIAN
30 select SYS_HAS_EARLY_PRINTK
29 31
30config MIPS_DB1000 32config MIPS_DB1000
31 bool "Alchemy DB1000 board" 33 bool "Alchemy DB1000 board"
@@ -33,12 +35,14 @@ config MIPS_DB1000
33 select DMA_NONCOHERENT 35 select DMA_NONCOHERENT
34 select HW_HAS_PCI 36 select HW_HAS_PCI
35 select SYS_SUPPORTS_LITTLE_ENDIAN 37 select SYS_SUPPORTS_LITTLE_ENDIAN
38 select SYS_HAS_EARLY_PRINTK
36 39
37config MIPS_DB1100 40config MIPS_DB1100
38 bool "Alchemy DB1100 board" 41 bool "Alchemy DB1100 board"
39 select SOC_AU1100 42 select SOC_AU1100
40 select DMA_NONCOHERENT 43 select DMA_NONCOHERENT
41 select SYS_SUPPORTS_LITTLE_ENDIAN 44 select SYS_SUPPORTS_LITTLE_ENDIAN
45 select SYS_HAS_EARLY_PRINTK
42 46
43config MIPS_DB1200 47config MIPS_DB1200
44 bool "Alchemy DB1200 board" 48 bool "Alchemy DB1200 board"
@@ -46,6 +50,7 @@ config MIPS_DB1200
46 select DMA_COHERENT 50 select DMA_COHERENT
47 select MIPS_DISABLE_OBSOLETE_IDE 51 select MIPS_DISABLE_OBSOLETE_IDE
48 select SYS_SUPPORTS_LITTLE_ENDIAN 52 select SYS_SUPPORTS_LITTLE_ENDIAN
53 select SYS_HAS_EARLY_PRINTK
49 54
50config MIPS_DB1500 55config MIPS_DB1500
51 bool "Alchemy DB1500 board" 56 bool "Alchemy DB1500 board"
@@ -55,6 +60,7 @@ config MIPS_DB1500
55 select MIPS_DISABLE_OBSOLETE_IDE 60 select MIPS_DISABLE_OBSOLETE_IDE
56 select SYS_SUPPORTS_BIG_ENDIAN 61 select SYS_SUPPORTS_BIG_ENDIAN
57 select SYS_SUPPORTS_LITTLE_ENDIAN 62 select SYS_SUPPORTS_LITTLE_ENDIAN
63 select SYS_HAS_EARLY_PRINTK
58 64
59config MIPS_DB1550 65config MIPS_DB1550
60 bool "Alchemy DB1550 board" 66 bool "Alchemy DB1550 board"
@@ -63,12 +69,14 @@ config MIPS_DB1550
63 select DMA_NONCOHERENT 69 select DMA_NONCOHERENT
64 select MIPS_DISABLE_OBSOLETE_IDE 70 select MIPS_DISABLE_OBSOLETE_IDE
65 select SYS_SUPPORTS_LITTLE_ENDIAN 71 select SYS_SUPPORTS_LITTLE_ENDIAN
72 select SYS_HAS_EARLY_PRINTK
66 73
67config MIPS_MIRAGE 74config MIPS_MIRAGE
68 bool "Alchemy Mirage board" 75 bool "Alchemy Mirage board"
69 select DMA_NONCOHERENT 76 select DMA_NONCOHERENT
70 select SOC_AU1500 77 select SOC_AU1500
71 select SYS_SUPPORTS_LITTLE_ENDIAN 78 select SYS_SUPPORTS_LITTLE_ENDIAN
79 select SYS_HAS_EARLY_PRINTK
72 80
73config MIPS_PB1000 81config MIPS_PB1000
74 bool "Alchemy PB1000 board" 82 bool "Alchemy PB1000 board"
@@ -77,6 +85,7 @@ config MIPS_PB1000
77 select HW_HAS_PCI 85 select HW_HAS_PCI
78 select SWAP_IO_SPACE 86 select SWAP_IO_SPACE
79 select SYS_SUPPORTS_LITTLE_ENDIAN 87 select SYS_SUPPORTS_LITTLE_ENDIAN
88 select SYS_HAS_EARLY_PRINTK
80 89
81config MIPS_PB1100 90config MIPS_PB1100
82 bool "Alchemy PB1100 board" 91 bool "Alchemy PB1100 board"
@@ -85,6 +94,7 @@ config MIPS_PB1100
85 select HW_HAS_PCI 94 select HW_HAS_PCI
86 select SWAP_IO_SPACE 95 select SWAP_IO_SPACE
87 select SYS_SUPPORTS_LITTLE_ENDIAN 96 select SYS_SUPPORTS_LITTLE_ENDIAN
97 select SYS_HAS_EARLY_PRINTK
88 98
89config MIPS_PB1200 99config MIPS_PB1200
90 bool "Alchemy PB1200 board" 100 bool "Alchemy PB1200 board"
@@ -92,6 +102,7 @@ config MIPS_PB1200
92 select DMA_NONCOHERENT 102 select DMA_NONCOHERENT
93 select MIPS_DISABLE_OBSOLETE_IDE 103 select MIPS_DISABLE_OBSOLETE_IDE
94 select SYS_SUPPORTS_LITTLE_ENDIAN 104 select SYS_SUPPORTS_LITTLE_ENDIAN
105 select SYS_HAS_EARLY_PRINTK
95 106
96config MIPS_PB1500 107config MIPS_PB1500
97 bool "Alchemy PB1500 board" 108 bool "Alchemy PB1500 board"
@@ -99,6 +110,7 @@ config MIPS_PB1500
99 select DMA_NONCOHERENT 110 select DMA_NONCOHERENT
100 select HW_HAS_PCI 111 select HW_HAS_PCI
101 select SYS_SUPPORTS_LITTLE_ENDIAN 112 select SYS_SUPPORTS_LITTLE_ENDIAN
113 select SYS_HAS_EARLY_PRINTK
102 114
103config MIPS_PB1550 115config MIPS_PB1550
104 bool "Alchemy PB1550 board" 116 bool "Alchemy PB1550 board"
@@ -107,39 +119,41 @@ config MIPS_PB1550
107 select HW_HAS_PCI 119 select HW_HAS_PCI
108 select MIPS_DISABLE_OBSOLETE_IDE 120 select MIPS_DISABLE_OBSOLETE_IDE
109 select SYS_SUPPORTS_LITTLE_ENDIAN 121 select SYS_SUPPORTS_LITTLE_ENDIAN
122 select SYS_HAS_EARLY_PRINTK
110 123
111config MIPS_XXS1500 124config MIPS_XXS1500
112 bool "MyCable XXS1500 board" 125 bool "MyCable XXS1500 board"
113 select DMA_NONCOHERENT 126 select DMA_NONCOHERENT
114 select SOC_AU1500 127 select SOC_AU1500
115 select SYS_SUPPORTS_LITTLE_ENDIAN 128 select SYS_SUPPORTS_LITTLE_ENDIAN
129 select SYS_HAS_EARLY_PRINTK
116 130
117endchoice 131endchoice
118 132
119config SOC_AU1000 133config SOC_AU1000
120 bool 134 bool
121 select SOC_AU1X00 135 select SOC_AU1X00
122 select ALCHEMY_GPIO_AU1000 136 select ALCHEMY_GPIOINT_AU1000
123 137
124config SOC_AU1100 138config SOC_AU1100
125 bool 139 bool
126 select SOC_AU1X00 140 select SOC_AU1X00
127 select ALCHEMY_GPIO_AU1000 141 select ALCHEMY_GPIOINT_AU1000
128 142
129config SOC_AU1500 143config SOC_AU1500
130 bool 144 bool
131 select SOC_AU1X00 145 select SOC_AU1X00
132 select ALCHEMY_GPIO_AU1000 146 select ALCHEMY_GPIOINT_AU1000
133 147
134config SOC_AU1550 148config SOC_AU1550
135 bool 149 bool
136 select SOC_AU1X00 150 select SOC_AU1X00
137 select ALCHEMY_GPIO_AU1000 151 select ALCHEMY_GPIOINT_AU1000
138 152
139config SOC_AU1200 153config SOC_AU1200
140 bool 154 bool
141 select SOC_AU1X00 155 select SOC_AU1X00
142 select ALCHEMY_GPIO_AU1000 156 select ALCHEMY_GPIOINT_AU1000
143 157
144config SOC_AU1X00 158config SOC_AU1X00
145 bool 159 bool
diff --git a/arch/mips/alchemy/common/Makefile b/arch/mips/alchemy/common/Makefile
index b67fb512529d..06c0e65a54b5 100644
--- a/arch/mips/alchemy/common/Makefile
+++ b/arch/mips/alchemy/common/Makefile
@@ -5,14 +5,15 @@
5# Makefile for the Alchemy Au1xx0 CPUs, generic files. 5# Makefile for the Alchemy Au1xx0 CPUs, generic files.
6# 6#
7 7
8obj-y += prom.o irq.o puts.o time.o reset.o \ 8obj-y += prom.o time.o clocks.o platform.o power.o setup.o \
9 clocks.o platform.o power.o setup.o \
10 sleeper.o dma.o dbdma.o 9 sleeper.o dma.o dbdma.o
11 10
11obj-$(CONFIG_ALCHEMY_GPIOINT_AU1000) += irq.o
12
12# optional gpiolib support 13# optional gpiolib support
13ifeq ($(CONFIG_ALCHEMY_GPIO_INDIRECT),) 14ifeq ($(CONFIG_ALCHEMY_GPIO_INDIRECT),)
14 ifeq ($(CONFIG_GPIOLIB),y) 15 ifeq ($(CONFIG_GPIOLIB),y)
15 obj-$(CONFIG_ALCHEMY_GPIO_AU1000) += gpiolib-au1000.o 16 obj-$(CONFIG_ALCHEMY_GPIOINT_AU1000) += gpiolib-au1000.o
16 endif 17 endif
17endif 18endif
18 19
diff --git a/arch/mips/alchemy/common/clocks.c b/arch/mips/alchemy/common/clocks.c
index d8991854530e..460c6285c1bb 100644
--- a/arch/mips/alchemy/common/clocks.c
+++ b/arch/mips/alchemy/common/clocks.c
@@ -40,8 +40,6 @@
40static unsigned int au1x00_clock; /* Hz */ 40static unsigned int au1x00_clock; /* Hz */
41static unsigned long uart_baud_base; 41static unsigned long uart_baud_base;
42 42
43static DEFINE_SPINLOCK(time_lock);
44
45/* 43/*
46 * Set the au1000_clock 44 * Set the au1000_clock
47 */ 45 */
@@ -84,9 +82,6 @@ void set_au1x00_uart_baud_base(unsigned long new_baud_base)
84unsigned long au1xxx_calc_clock(void) 82unsigned long au1xxx_calc_clock(void)
85{ 83{
86 unsigned long cpu_speed; 84 unsigned long cpu_speed;
87 unsigned long flags;
88
89 spin_lock_irqsave(&time_lock, flags);
90 85
91 /* 86 /*
92 * On early Au1000, sys_cpupll was write-only. Since these 87 * On early Au1000, sys_cpupll was write-only. Since these
@@ -108,8 +103,6 @@ unsigned long au1xxx_calc_clock(void)
108 set_au1x00_uart_baud_base(cpu_speed / (2 * ((int)(au_readl(SYS_POWERCTRL) 103 set_au1x00_uart_baud_base(cpu_speed / (2 * ((int)(au_readl(SYS_POWERCTRL)
109 & 0x03) + 2) * 16)); 104 & 0x03) + 2) * 16));
110 105
111 spin_unlock_irqrestore(&time_lock, flags);
112
113 set_au1x00_speed(cpu_speed); 106 set_au1x00_speed(cpu_speed);
114 107
115 return cpu_speed; 108 return cpu_speed;
diff --git a/arch/mips/alchemy/common/dbdma.c b/arch/mips/alchemy/common/dbdma.c
index f9201ca2295b..99ae84ce5af3 100644
--- a/arch/mips/alchemy/common/dbdma.c
+++ b/arch/mips/alchemy/common/dbdma.c
@@ -30,6 +30,7 @@
30 * 30 *
31 */ 31 */
32 32
33#include <linux/init.h>
33#include <linux/kernel.h> 34#include <linux/kernel.h>
34#include <linux/slab.h> 35#include <linux/slab.h>
35#include <linux/spinlock.h> 36#include <linux/spinlock.h>
@@ -58,7 +59,6 @@ static DEFINE_SPINLOCK(au1xxx_dbdma_spin_lock);
58 59
59static dbdma_global_t *dbdma_gptr = (dbdma_global_t *)DDMA_GLOBAL_BASE; 60static dbdma_global_t *dbdma_gptr = (dbdma_global_t *)DDMA_GLOBAL_BASE;
60static int dbdma_initialized; 61static int dbdma_initialized;
61static void au1xxx_dbdma_init(void);
62 62
63static dbdev_tab_t dbdev_tab[] = { 63static dbdev_tab_t dbdev_tab[] = {
64#ifdef CONFIG_SOC_AU1550 64#ifdef CONFIG_SOC_AU1550
@@ -237,7 +237,7 @@ u32 au1xxx_dbdma_chan_alloc(u32 srcid, u32 destid,
237 void (*callback)(int, void *), void *callparam) 237 void (*callback)(int, void *), void *callparam)
238{ 238{
239 unsigned long flags; 239 unsigned long flags;
240 u32 used, chan, rv; 240 u32 used, chan;
241 u32 dcp; 241 u32 dcp;
242 int i; 242 int i;
243 dbdev_tab_t *stp, *dtp; 243 dbdev_tab_t *stp, *dtp;
@@ -250,8 +250,7 @@ u32 au1xxx_dbdma_chan_alloc(u32 srcid, u32 destid,
250 * which can't be done successfully during board set up. 250 * which can't be done successfully during board set up.
251 */ 251 */
252 if (!dbdma_initialized) 252 if (!dbdma_initialized)
253 au1xxx_dbdma_init(); 253 return 0;
254 dbdma_initialized = 1;
255 254
256 stp = find_dbdev_id(srcid); 255 stp = find_dbdev_id(srcid);
257 if (stp == NULL) 256 if (stp == NULL)
@@ -261,7 +260,6 @@ u32 au1xxx_dbdma_chan_alloc(u32 srcid, u32 destid,
261 return 0; 260 return 0;
262 261
263 used = 0; 262 used = 0;
264 rv = 0;
265 263
266 /* Check to see if we can get both channels. */ 264 /* Check to see if we can get both channels. */
267 spin_lock_irqsave(&au1xxx_dbdma_spin_lock, flags); 265 spin_lock_irqsave(&au1xxx_dbdma_spin_lock, flags);
@@ -282,63 +280,65 @@ u32 au1xxx_dbdma_chan_alloc(u32 srcid, u32 destid,
282 used++; 280 used++;
283 spin_unlock_irqrestore(&au1xxx_dbdma_spin_lock, flags); 281 spin_unlock_irqrestore(&au1xxx_dbdma_spin_lock, flags);
284 282
285 if (!used) { 283 if (used)
286 /* Let's see if we can allocate a channel for it. */ 284 return 0;
287 ctp = NULL;
288 chan = 0;
289 spin_lock_irqsave(&au1xxx_dbdma_spin_lock, flags);
290 for (i = 0; i < NUM_DBDMA_CHANS; i++)
291 if (chan_tab_ptr[i] == NULL) {
292 /*
293 * If kmalloc fails, it is caught below same
294 * as a channel not available.
295 */
296 ctp = kmalloc(sizeof(chan_tab_t), GFP_ATOMIC);
297 chan_tab_ptr[i] = ctp;
298 break;
299 }
300 spin_unlock_irqrestore(&au1xxx_dbdma_spin_lock, flags);
301
302 if (ctp != NULL) {
303 memset(ctp, 0, sizeof(chan_tab_t));
304 ctp->chan_index = chan = i;
305 dcp = DDMA_CHANNEL_BASE;
306 dcp += (0x0100 * chan);
307 ctp->chan_ptr = (au1x_dma_chan_t *)dcp;
308 cp = (au1x_dma_chan_t *)dcp;
309 ctp->chan_src = stp;
310 ctp->chan_dest = dtp;
311 ctp->chan_callback = callback;
312 ctp->chan_callparam = callparam;
313
314 /* Initialize channel configuration. */
315 i = 0;
316 if (stp->dev_intlevel)
317 i |= DDMA_CFG_SED;
318 if (stp->dev_intpolarity)
319 i |= DDMA_CFG_SP;
320 if (dtp->dev_intlevel)
321 i |= DDMA_CFG_DED;
322 if (dtp->dev_intpolarity)
323 i |= DDMA_CFG_DP;
324 if ((stp->dev_flags & DEV_FLAGS_SYNC) ||
325 (dtp->dev_flags & DEV_FLAGS_SYNC))
326 i |= DDMA_CFG_SYNC;
327 cp->ddma_cfg = i;
328 au_sync();
329 285
330 /* Return a non-zero value that can be used to 286 /* Let's see if we can allocate a channel for it. */
331 * find the channel information in subsequent 287 ctp = NULL;
332 * operations. 288 chan = 0;
289 spin_lock_irqsave(&au1xxx_dbdma_spin_lock, flags);
290 for (i = 0; i < NUM_DBDMA_CHANS; i++)
291 if (chan_tab_ptr[i] == NULL) {
292 /*
293 * If kmalloc fails, it is caught below same
294 * as a channel not available.
333 */ 295 */
334 rv = (u32)(&chan_tab_ptr[chan]); 296 ctp = kmalloc(sizeof(chan_tab_t), GFP_ATOMIC);
335 } else { 297 chan_tab_ptr[i] = ctp;
336 /* Release devices */ 298 break;
337 stp->dev_flags &= ~DEV_FLAGS_INUSE;
338 dtp->dev_flags &= ~DEV_FLAGS_INUSE;
339 } 299 }
300 spin_unlock_irqrestore(&au1xxx_dbdma_spin_lock, flags);
301
302 if (ctp != NULL) {
303 memset(ctp, 0, sizeof(chan_tab_t));
304 ctp->chan_index = chan = i;
305 dcp = DDMA_CHANNEL_BASE;
306 dcp += (0x0100 * chan);
307 ctp->chan_ptr = (au1x_dma_chan_t *)dcp;
308 cp = (au1x_dma_chan_t *)dcp;
309 ctp->chan_src = stp;
310 ctp->chan_dest = dtp;
311 ctp->chan_callback = callback;
312 ctp->chan_callparam = callparam;
313
314 /* Initialize channel configuration. */
315 i = 0;
316 if (stp->dev_intlevel)
317 i |= DDMA_CFG_SED;
318 if (stp->dev_intpolarity)
319 i |= DDMA_CFG_SP;
320 if (dtp->dev_intlevel)
321 i |= DDMA_CFG_DED;
322 if (dtp->dev_intpolarity)
323 i |= DDMA_CFG_DP;
324 if ((stp->dev_flags & DEV_FLAGS_SYNC) ||
325 (dtp->dev_flags & DEV_FLAGS_SYNC))
326 i |= DDMA_CFG_SYNC;
327 cp->ddma_cfg = i;
328 au_sync();
329
330 /*
331 * Return a non-zero value that can be used to find the channel
332 * information in subsequent operations.
333 */
334 return (u32)(&chan_tab_ptr[chan]);
340 } 335 }
341 return rv; 336
337 /* Release devices */
338 stp->dev_flags &= ~DEV_FLAGS_INUSE;
339 dtp->dev_flags &= ~DEV_FLAGS_INUSE;
340
341 return 0;
342} 342}
343EXPORT_SYMBOL(au1xxx_dbdma_chan_alloc); 343EXPORT_SYMBOL(au1xxx_dbdma_chan_alloc);
344 344
@@ -572,7 +572,7 @@ EXPORT_SYMBOL(au1xxx_dbdma_ring_alloc);
572 * This updates the source pointer and byte count. Normally used 572 * This updates the source pointer and byte count. Normally used
573 * for memory to fifo transfers. 573 * for memory to fifo transfers.
574 */ 574 */
575u32 _au1xxx_dbdma_put_source(u32 chanid, void *buf, int nbytes, u32 flags) 575u32 au1xxx_dbdma_put_source(u32 chanid, dma_addr_t buf, int nbytes, u32 flags)
576{ 576{
577 chan_tab_t *ctp; 577 chan_tab_t *ctp;
578 au1x_ddma_desc_t *dp; 578 au1x_ddma_desc_t *dp;
@@ -598,7 +598,7 @@ u32 _au1xxx_dbdma_put_source(u32 chanid, void *buf, int nbytes, u32 flags)
598 return 0; 598 return 0;
599 599
600 /* Load up buffer address and byte count. */ 600 /* Load up buffer address and byte count. */
601 dp->dscr_source0 = virt_to_phys(buf); 601 dp->dscr_source0 = buf & ~0UL;
602 dp->dscr_cmd1 = nbytes; 602 dp->dscr_cmd1 = nbytes;
603 /* Check flags */ 603 /* Check flags */
604 if (flags & DDMA_FLAGS_IE) 604 if (flags & DDMA_FLAGS_IE)
@@ -625,14 +625,13 @@ u32 _au1xxx_dbdma_put_source(u32 chanid, void *buf, int nbytes, u32 flags)
625 /* Return something non-zero. */ 625 /* Return something non-zero. */
626 return nbytes; 626 return nbytes;
627} 627}
628EXPORT_SYMBOL(_au1xxx_dbdma_put_source); 628EXPORT_SYMBOL(au1xxx_dbdma_put_source);
629 629
630/* Put a destination buffer into the DMA ring. 630/* Put a destination buffer into the DMA ring.
631 * This updates the destination pointer and byte count. Normally used 631 * This updates the destination pointer and byte count. Normally used
632 * to place an empty buffer into the ring for fifo to memory transfers. 632 * to place an empty buffer into the ring for fifo to memory transfers.
633 */ 633 */
634u32 634u32 au1xxx_dbdma_put_dest(u32 chanid, dma_addr_t buf, int nbytes, u32 flags)
635_au1xxx_dbdma_put_dest(u32 chanid, void *buf, int nbytes, u32 flags)
636{ 635{
637 chan_tab_t *ctp; 636 chan_tab_t *ctp;
638 au1x_ddma_desc_t *dp; 637 au1x_ddma_desc_t *dp;
@@ -662,7 +661,7 @@ _au1xxx_dbdma_put_dest(u32 chanid, void *buf, int nbytes, u32 flags)
662 if (flags & DDMA_FLAGS_NOIE) 661 if (flags & DDMA_FLAGS_NOIE)
663 dp->dscr_cmd0 &= ~DSCR_CMD0_IE; 662 dp->dscr_cmd0 &= ~DSCR_CMD0_IE;
664 663
665 dp->dscr_dest0 = virt_to_phys(buf); 664 dp->dscr_dest0 = buf & ~0UL;
666 dp->dscr_cmd1 = nbytes; 665 dp->dscr_cmd1 = nbytes;
667#if 0 666#if 0
668 printk(KERN_DEBUG "cmd0:%x cmd1:%x source0:%x source1:%x dest0:%x dest1:%x\n", 667 printk(KERN_DEBUG "cmd0:%x cmd1:%x source0:%x source1:%x dest0:%x dest1:%x\n",
@@ -688,7 +687,7 @@ _au1xxx_dbdma_put_dest(u32 chanid, void *buf, int nbytes, u32 flags)
688 /* Return something non-zero. */ 687 /* Return something non-zero. */
689 return nbytes; 688 return nbytes;
690} 689}
691EXPORT_SYMBOL(_au1xxx_dbdma_put_dest); 690EXPORT_SYMBOL(au1xxx_dbdma_put_dest);
692 691
693/* 692/*
694 * Get a destination buffer into the DMA ring. 693 * Get a destination buffer into the DMA ring.
@@ -871,28 +870,6 @@ static irqreturn_t dbdma_interrupt(int irq, void *dev_id)
871 return IRQ_RETVAL(1); 870 return IRQ_RETVAL(1);
872} 871}
873 872
874static void au1xxx_dbdma_init(void)
875{
876 int irq_nr;
877
878 dbdma_gptr->ddma_config = 0;
879 dbdma_gptr->ddma_throttle = 0;
880 dbdma_gptr->ddma_inten = 0xffff;
881 au_sync();
882
883#if defined(CONFIG_SOC_AU1550)
884 irq_nr = AU1550_DDMA_INT;
885#elif defined(CONFIG_SOC_AU1200)
886 irq_nr = AU1200_DDMA_INT;
887#else
888 #error Unknown Au1x00 SOC
889#endif
890
891 if (request_irq(irq_nr, dbdma_interrupt, IRQF_DISABLED,
892 "Au1xxx dbdma", (void *)dbdma_gptr))
893 printk(KERN_ERR "Can't get 1550 dbdma irq");
894}
895
896void au1xxx_dbdma_dump(u32 chanid) 873void au1xxx_dbdma_dump(u32 chanid)
897{ 874{
898 chan_tab_t *ctp; 875 chan_tab_t *ctp;
@@ -906,7 +883,7 @@ void au1xxx_dbdma_dump(u32 chanid)
906 dtp = ctp->chan_dest; 883 dtp = ctp->chan_dest;
907 cp = ctp->chan_ptr; 884 cp = ctp->chan_ptr;
908 885
909 printk(KERN_DEBUG "Chan %x, stp %x (dev %d) dtp %x (dev %d) \n", 886 printk(KERN_DEBUG "Chan %x, stp %x (dev %d) dtp %x (dev %d)\n",
910 (u32)ctp, (u32)stp, stp - dbdev_tab, (u32)dtp, 887 (u32)ctp, (u32)stp, stp - dbdev_tab, (u32)dtp,
911 dtp - dbdev_tab); 888 dtp - dbdev_tab);
912 printk(KERN_DEBUG "desc base %x, get %x, put %x, cur %x\n", 889 printk(KERN_DEBUG "desc base %x, get %x, put %x, cur %x\n",
@@ -1041,4 +1018,38 @@ void au1xxx_dbdma_resume(void)
1041 } 1018 }
1042} 1019}
1043#endif /* CONFIG_PM */ 1020#endif /* CONFIG_PM */
1021
1022static int __init au1xxx_dbdma_init(void)
1023{
1024 int irq_nr, ret;
1025
1026 dbdma_gptr->ddma_config = 0;
1027 dbdma_gptr->ddma_throttle = 0;
1028 dbdma_gptr->ddma_inten = 0xffff;
1029 au_sync();
1030
1031 switch (alchemy_get_cputype()) {
1032 case ALCHEMY_CPU_AU1550:
1033 irq_nr = AU1550_DDMA_INT;
1034 break;
1035 case ALCHEMY_CPU_AU1200:
1036 irq_nr = AU1200_DDMA_INT;
1037 break;
1038 default:
1039 return -ENODEV;
1040 }
1041
1042 ret = request_irq(irq_nr, dbdma_interrupt, IRQF_DISABLED,
1043 "Au1xxx dbdma", (void *)dbdma_gptr);
1044 if (ret)
1045 printk(KERN_ERR "Cannot grab DBDMA interrupt!\n");
1046 else {
1047 dbdma_initialized = 1;
1048 printk(KERN_INFO "Alchemy DBDMA initialized\n");
1049 }
1050
1051 return ret;
1052}
1053subsys_initcall(au1xxx_dbdma_init);
1054
1044#endif /* defined(CONFIG_SOC_AU1550) || defined(CONFIG_SOC_AU1200) */ 1055#endif /* defined(CONFIG_SOC_AU1550) || defined(CONFIG_SOC_AU1200) */
diff --git a/arch/mips/alchemy/common/dma.c b/arch/mips/alchemy/common/dma.c
index d6fbda232e6a..d5278877891d 100644
--- a/arch/mips/alchemy/common/dma.c
+++ b/arch/mips/alchemy/common/dma.c
@@ -29,6 +29,8 @@
29 * 675 Mass Ave, Cambridge, MA 02139, USA. 29 * 675 Mass Ave, Cambridge, MA 02139, USA.
30 * 30 *
31 */ 31 */
32
33#include <linux/init.h>
32#include <linux/module.h> 34#include <linux/module.h>
33#include <linux/kernel.h> 35#include <linux/kernel.h>
34#include <linux/errno.h> 36#include <linux/errno.h>
@@ -188,17 +190,14 @@ int request_au1000_dma(int dev_id, const char *dev_str,
188 dev = &dma_dev_table[dev_id]; 190 dev = &dma_dev_table[dev_id];
189 191
190 if (irqhandler) { 192 if (irqhandler) {
191 chan->irq = AU1000_DMA_INT_BASE + i;
192 chan->irq_dev = irq_dev_id; 193 chan->irq_dev = irq_dev_id;
193 ret = request_irq(chan->irq, irqhandler, irqflags, dev_str, 194 ret = request_irq(chan->irq, irqhandler, irqflags, dev_str,
194 chan->irq_dev); 195 chan->irq_dev);
195 if (ret) { 196 if (ret) {
196 chan->irq = 0;
197 chan->irq_dev = NULL; 197 chan->irq_dev = NULL;
198 return ret; 198 return ret;
199 } 199 }
200 } else { 200 } else {
201 chan->irq = 0;
202 chan->irq_dev = NULL; 201 chan->irq_dev = NULL;
203 } 202 }
204 203
@@ -226,13 +225,40 @@ void free_au1000_dma(unsigned int dmanr)
226 } 225 }
227 226
228 disable_dma(dmanr); 227 disable_dma(dmanr);
229 if (chan->irq) 228 if (chan->irq_dev)
230 free_irq(chan->irq, chan->irq_dev); 229 free_irq(chan->irq, chan->irq_dev);
231 230
232 chan->irq = 0;
233 chan->irq_dev = NULL; 231 chan->irq_dev = NULL;
234 chan->dev_id = -1; 232 chan->dev_id = -1;
235} 233}
236EXPORT_SYMBOL(free_au1000_dma); 234EXPORT_SYMBOL(free_au1000_dma);
237 235
236static int __init au1000_dma_init(void)
237{
238 int base, i;
239
240 switch (alchemy_get_cputype()) {
241 case ALCHEMY_CPU_AU1000:
242 base = AU1000_DMA_INT_BASE;
243 break;
244 case ALCHEMY_CPU_AU1500:
245 base = AU1500_DMA_INT_BASE;
246 break;
247 case ALCHEMY_CPU_AU1100:
248 base = AU1100_DMA_INT_BASE;
249 break;
250 default:
251 goto out;
252 }
253
254 for (i = 0; i < NUM_AU1000_DMA_CHANNELS; i++)
255 au1000_dma_table[i].irq = base + i;
256
257 printk(KERN_INFO "Alchemy DMA initialized\n");
258
259out:
260 return 0;
261}
262arch_initcall(au1000_dma_init);
263
238#endif /* AU1000 AU1500 AU1100 */ 264#endif /* AU1000 AU1500 AU1100 */
diff --git a/arch/mips/alchemy/common/gpiolib-au1000.c b/arch/mips/alchemy/common/gpiolib-au1000.c
index 1bfa91f939f4..c8e1a94d4a95 100644
--- a/arch/mips/alchemy/common/gpiolib-au1000.c
+++ b/arch/mips/alchemy/common/gpiolib-au1000.c
@@ -36,7 +36,6 @@
36#include <asm/mach-au1x00/au1000.h> 36#include <asm/mach-au1x00/au1000.h>
37#include <asm/mach-au1x00/gpio.h> 37#include <asm/mach-au1x00/gpio.h>
38 38
39#if !defined(CONFIG_SOC_AU1000)
40static int gpio2_get(struct gpio_chip *chip, unsigned offset) 39static int gpio2_get(struct gpio_chip *chip, unsigned offset)
41{ 40{
42 return alchemy_gpio2_get_value(offset + ALCHEMY_GPIO2_BASE); 41 return alchemy_gpio2_get_value(offset + ALCHEMY_GPIO2_BASE);
@@ -63,7 +62,7 @@ static int gpio2_to_irq(struct gpio_chip *chip, unsigned offset)
63{ 62{
64 return alchemy_gpio2_to_irq(offset + ALCHEMY_GPIO2_BASE); 63 return alchemy_gpio2_to_irq(offset + ALCHEMY_GPIO2_BASE);
65} 64}
66#endif /* !defined(CONFIG_SOC_AU1000) */ 65
67 66
68static int gpio1_get(struct gpio_chip *chip, unsigned offset) 67static int gpio1_get(struct gpio_chip *chip, unsigned offset)
69{ 68{
@@ -104,7 +103,6 @@ struct gpio_chip alchemy_gpio_chip[] = {
104 .base = ALCHEMY_GPIO1_BASE, 103 .base = ALCHEMY_GPIO1_BASE,
105 .ngpio = ALCHEMY_GPIO1_NUM, 104 .ngpio = ALCHEMY_GPIO1_NUM,
106 }, 105 },
107#if !defined(CONFIG_SOC_AU1000)
108 [1] = { 106 [1] = {
109 .label = "alchemy-gpio2", 107 .label = "alchemy-gpio2",
110 .direction_input = gpio2_direction_input, 108 .direction_input = gpio2_direction_input,
@@ -115,15 +113,13 @@ struct gpio_chip alchemy_gpio_chip[] = {
115 .base = ALCHEMY_GPIO2_BASE, 113 .base = ALCHEMY_GPIO2_BASE,
116 .ngpio = ALCHEMY_GPIO2_NUM, 114 .ngpio = ALCHEMY_GPIO2_NUM,
117 }, 115 },
118#endif
119}; 116};
120 117
121static int __init alchemy_gpiolib_init(void) 118static int __init alchemy_gpiolib_init(void)
122{ 119{
123 gpiochip_add(&alchemy_gpio_chip[0]); 120 gpiochip_add(&alchemy_gpio_chip[0]);
124#if !defined(CONFIG_SOC_AU1000) 121 if (alchemy_get_cputype() != ALCHEMY_CPU_AU1000)
125 gpiochip_add(&alchemy_gpio_chip[1]); 122 gpiochip_add(&alchemy_gpio_chip[1]);
126#endif
127 123
128 return 0; 124 return 0;
129} 125}
diff --git a/arch/mips/alchemy/common/irq.c b/arch/mips/alchemy/common/irq.c
index d670928afcfd..b2821ace4d00 100644
--- a/arch/mips/alchemy/common/irq.c
+++ b/arch/mips/alchemy/common/irq.c
@@ -39,168 +39,180 @@
39 39
40static int au1x_ic_settype(unsigned int irq, unsigned int flow_type); 40static int au1x_ic_settype(unsigned int irq, unsigned int flow_type);
41 41
42/* NOTE on interrupt priorities: The original writers of this code said:
43 *
44 * Because of the tight timing of SETUP token to reply transactions,
45 * the USB devices-side packet complete interrupt (USB_DEV_REQ_INT)
46 * needs the highest priority.
47 */
48
42/* per-processor fixed function irqs */ 49/* per-processor fixed function irqs */
43struct au1xxx_irqmap au1xxx_ic0_map[] __initdata = { 50struct au1xxx_irqmap {
44 51 int im_irq;
45#if defined(CONFIG_SOC_AU1000) 52 int im_type;
46 { AU1000_UART0_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, 53 int im_request; /* set 1 to get higher priority */
47 { AU1000_UART1_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, 54};
48 { AU1000_UART2_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, 55
49 { AU1000_UART3_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, 56struct au1xxx_irqmap au1000_irqmap[] __initdata = {
50 { AU1000_SSI0_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, 57 { AU1000_UART0_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
51 { AU1000_SSI1_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, 58 { AU1000_UART1_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
52 { AU1000_DMA_INT_BASE, IRQ_TYPE_LEVEL_HIGH, 0 }, 59 { AU1000_UART2_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
53 { AU1000_DMA_INT_BASE+1, IRQ_TYPE_LEVEL_HIGH, 0 }, 60 { AU1000_UART3_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
54 { AU1000_DMA_INT_BASE+2, IRQ_TYPE_LEVEL_HIGH, 0 }, 61 { AU1000_SSI0_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
55 { AU1000_DMA_INT_BASE+3, IRQ_TYPE_LEVEL_HIGH, 0 }, 62 { AU1000_SSI1_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
56 { AU1000_DMA_INT_BASE+4, IRQ_TYPE_LEVEL_HIGH, 0 }, 63 { AU1000_DMA_INT_BASE, IRQ_TYPE_LEVEL_HIGH, 0 },
57 { AU1000_DMA_INT_BASE+5, IRQ_TYPE_LEVEL_HIGH, 0 }, 64 { AU1000_DMA_INT_BASE+1, IRQ_TYPE_LEVEL_HIGH, 0 },
58 { AU1000_DMA_INT_BASE+6, IRQ_TYPE_LEVEL_HIGH, 0 }, 65 { AU1000_DMA_INT_BASE+2, IRQ_TYPE_LEVEL_HIGH, 0 },
59 { AU1000_DMA_INT_BASE+7, IRQ_TYPE_LEVEL_HIGH, 0 }, 66 { AU1000_DMA_INT_BASE+3, IRQ_TYPE_LEVEL_HIGH, 0 },
60 { AU1000_TOY_INT, IRQ_TYPE_EDGE_RISING, 0 }, 67 { AU1000_DMA_INT_BASE+4, IRQ_TYPE_LEVEL_HIGH, 0 },
61 { AU1000_TOY_MATCH0_INT, IRQ_TYPE_EDGE_RISING, 0 }, 68 { AU1000_DMA_INT_BASE+5, IRQ_TYPE_LEVEL_HIGH, 0 },
62 { AU1000_TOY_MATCH1_INT, IRQ_TYPE_EDGE_RISING, 0 }, 69 { AU1000_DMA_INT_BASE+6, IRQ_TYPE_LEVEL_HIGH, 0 },
63 { AU1000_TOY_MATCH2_INT, IRQ_TYPE_EDGE_RISING, 1 }, 70 { AU1000_DMA_INT_BASE+7, IRQ_TYPE_LEVEL_HIGH, 0 },
64 { AU1000_RTC_INT, IRQ_TYPE_EDGE_RISING, 0 }, 71 { AU1000_TOY_INT, IRQ_TYPE_EDGE_RISING, 0 },
65 { AU1000_RTC_MATCH0_INT, IRQ_TYPE_EDGE_RISING, 0 }, 72 { AU1000_TOY_MATCH0_INT, IRQ_TYPE_EDGE_RISING, 0 },
66 { AU1000_RTC_MATCH1_INT, IRQ_TYPE_EDGE_RISING, 0 }, 73 { AU1000_TOY_MATCH1_INT, IRQ_TYPE_EDGE_RISING, 0 },
67 { AU1000_RTC_MATCH2_INT, IRQ_TYPE_EDGE_RISING, 0 }, 74 { AU1000_TOY_MATCH2_INT, IRQ_TYPE_EDGE_RISING, 0 },
68 { AU1000_IRDA_TX_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, 75 { AU1000_RTC_INT, IRQ_TYPE_EDGE_RISING, 0 },
69 { AU1000_IRDA_RX_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, 76 { AU1000_RTC_MATCH0_INT, IRQ_TYPE_EDGE_RISING, 0 },
70 { AU1000_USB_DEV_REQ_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, 77 { AU1000_RTC_MATCH1_INT, IRQ_TYPE_EDGE_RISING, 0 },
71 { AU1000_USB_DEV_SUS_INT, IRQ_TYPE_EDGE_RISING, 0 }, 78 { AU1000_RTC_MATCH2_INT, IRQ_TYPE_EDGE_RISING, 1 },
72 { AU1000_USB_HOST_INT, IRQ_TYPE_LEVEL_LOW, 0 }, 79 { AU1000_IRDA_TX_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
73 { AU1000_ACSYNC_INT, IRQ_TYPE_EDGE_RISING, 0 }, 80 { AU1000_IRDA_RX_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
74 { AU1000_MAC0_DMA_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, 81 { AU1000_USB_DEV_REQ_INT, IRQ_TYPE_LEVEL_HIGH, 1 },
75 { AU1000_MAC1_DMA_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
76 { AU1000_AC97C_INT, IRQ_TYPE_EDGE_RISING, 0 },
77
78#elif defined(CONFIG_SOC_AU1500)
79
80 { AU1500_UART0_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
81 { AU1000_PCI_INTA, IRQ_TYPE_LEVEL_LOW, 0 },
82 { AU1000_PCI_INTB, IRQ_TYPE_LEVEL_LOW, 0 },
83 { AU1500_UART3_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
84 { AU1000_PCI_INTC, IRQ_TYPE_LEVEL_LOW, 0 },
85 { AU1000_PCI_INTD, IRQ_TYPE_LEVEL_LOW, 0 },
86 { AU1000_DMA_INT_BASE, IRQ_TYPE_LEVEL_HIGH, 0 },
87 { AU1000_DMA_INT_BASE+1, IRQ_TYPE_LEVEL_HIGH, 0 },
88 { AU1000_DMA_INT_BASE+2, IRQ_TYPE_LEVEL_HIGH, 0 },
89 { AU1000_DMA_INT_BASE+3, IRQ_TYPE_LEVEL_HIGH, 0 },
90 { AU1000_DMA_INT_BASE+4, IRQ_TYPE_LEVEL_HIGH, 0 },
91 { AU1000_DMA_INT_BASE+5, IRQ_TYPE_LEVEL_HIGH, 0 },
92 { AU1000_DMA_INT_BASE+6, IRQ_TYPE_LEVEL_HIGH, 0 },
93 { AU1000_DMA_INT_BASE+7, IRQ_TYPE_LEVEL_HIGH, 0 },
94 { AU1000_TOY_INT, IRQ_TYPE_EDGE_RISING, 0 },
95 { AU1000_TOY_MATCH0_INT, IRQ_TYPE_EDGE_RISING, 0 },
96 { AU1000_TOY_MATCH1_INT, IRQ_TYPE_EDGE_RISING, 0 },
97 { AU1000_TOY_MATCH2_INT, IRQ_TYPE_EDGE_RISING, 1 },
98 { AU1000_RTC_INT, IRQ_TYPE_EDGE_RISING, 0 },
99 { AU1000_RTC_MATCH0_INT, IRQ_TYPE_EDGE_RISING, 0 },
100 { AU1000_RTC_MATCH1_INT, IRQ_TYPE_EDGE_RISING, 0 },
101 { AU1000_RTC_MATCH2_INT, IRQ_TYPE_EDGE_RISING, 0 },
102 { AU1000_USB_DEV_REQ_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
103 { AU1000_USB_DEV_SUS_INT, IRQ_TYPE_EDGE_RISING, 0 },
104 { AU1000_USB_HOST_INT, IRQ_TYPE_LEVEL_LOW, 0 },
105 { AU1000_ACSYNC_INT, IRQ_TYPE_EDGE_RISING, 0 },
106 { AU1500_MAC0_DMA_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
107 { AU1500_MAC1_DMA_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
108 { AU1000_AC97C_INT, IRQ_TYPE_EDGE_RISING, 0 },
109
110#elif defined(CONFIG_SOC_AU1100)
111
112 { AU1100_UART0_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
113 { AU1100_UART1_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
114 { AU1100_SD_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
115 { AU1100_UART3_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
116 { AU1000_SSI0_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
117 { AU1000_SSI1_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
118 { AU1000_DMA_INT_BASE, IRQ_TYPE_LEVEL_HIGH, 0 },
119 { AU1000_DMA_INT_BASE+1, IRQ_TYPE_LEVEL_HIGH, 0 },
120 { AU1000_DMA_INT_BASE+2, IRQ_TYPE_LEVEL_HIGH, 0 },
121 { AU1000_DMA_INT_BASE+3, IRQ_TYPE_LEVEL_HIGH, 0 },
122 { AU1000_DMA_INT_BASE+4, IRQ_TYPE_LEVEL_HIGH, 0 },
123 { AU1000_DMA_INT_BASE+5, IRQ_TYPE_LEVEL_HIGH, 0 },
124 { AU1000_DMA_INT_BASE+6, IRQ_TYPE_LEVEL_HIGH, 0 },
125 { AU1000_DMA_INT_BASE+7, IRQ_TYPE_LEVEL_HIGH, 0 },
126 { AU1000_TOY_INT, IRQ_TYPE_EDGE_RISING, 0 },
127 { AU1000_TOY_MATCH0_INT, IRQ_TYPE_EDGE_RISING, 0 },
128 { AU1000_TOY_MATCH1_INT, IRQ_TYPE_EDGE_RISING, 0 },
129 { AU1000_TOY_MATCH2_INT, IRQ_TYPE_EDGE_RISING, 1 },
130 { AU1000_RTC_INT, IRQ_TYPE_EDGE_RISING, 0 },
131 { AU1000_RTC_MATCH0_INT, IRQ_TYPE_EDGE_RISING, 0 },
132 { AU1000_RTC_MATCH1_INT, IRQ_TYPE_EDGE_RISING, 0 },
133 { AU1000_RTC_MATCH2_INT, IRQ_TYPE_EDGE_RISING, 0 },
134 { AU1000_IRDA_TX_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
135 { AU1000_IRDA_RX_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
136 { AU1000_USB_DEV_REQ_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
137 { AU1000_USB_DEV_SUS_INT, IRQ_TYPE_EDGE_RISING, 0 }, 82 { AU1000_USB_DEV_SUS_INT, IRQ_TYPE_EDGE_RISING, 0 },
138 { AU1000_USB_HOST_INT, IRQ_TYPE_LEVEL_LOW, 0 }, 83 { AU1000_USB_HOST_INT, IRQ_TYPE_LEVEL_LOW, 0 },
139 { AU1000_ACSYNC_INT, IRQ_TYPE_EDGE_RISING, 0 }, 84 { AU1000_ACSYNC_INT, IRQ_TYPE_EDGE_RISING, 0 },
140 { AU1100_MAC0_DMA_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, 85 { AU1000_MAC0_DMA_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
141 { AU1100_LCD_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, 86 { AU1000_MAC1_DMA_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
142 { AU1000_AC97C_INT, IRQ_TYPE_EDGE_RISING, 0 }, 87 { AU1000_AC97C_INT, IRQ_TYPE_EDGE_RISING, 0 },
143 88 { -1, },
144#elif defined(CONFIG_SOC_AU1550) 89};
145 90
146 { AU1550_UART0_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, 91struct au1xxx_irqmap au1500_irqmap[] __initdata = {
147 { AU1550_PCI_INTA, IRQ_TYPE_LEVEL_LOW, 0 }, 92 { AU1500_UART0_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
148 { AU1550_PCI_INTB, IRQ_TYPE_LEVEL_LOW, 0 }, 93 { AU1500_PCI_INTA, IRQ_TYPE_LEVEL_LOW, 0 },
149 { AU1550_DDMA_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, 94 { AU1500_PCI_INTB, IRQ_TYPE_LEVEL_LOW, 0 },
150 { AU1550_CRYPTO_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, 95 { AU1500_UART3_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
151 { AU1550_PCI_INTC, IRQ_TYPE_LEVEL_LOW, 0 }, 96 { AU1500_PCI_INTC, IRQ_TYPE_LEVEL_LOW, 0 },
152 { AU1550_PCI_INTD, IRQ_TYPE_LEVEL_LOW, 0 }, 97 { AU1500_PCI_INTD, IRQ_TYPE_LEVEL_LOW, 0 },
153 { AU1550_PCI_RST_INT, IRQ_TYPE_LEVEL_LOW, 0 }, 98 { AU1500_DMA_INT_BASE, IRQ_TYPE_LEVEL_HIGH, 0 },
154 { AU1550_UART1_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, 99 { AU1500_DMA_INT_BASE+1, IRQ_TYPE_LEVEL_HIGH, 0 },
155 { AU1550_UART3_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, 100 { AU1500_DMA_INT_BASE+2, IRQ_TYPE_LEVEL_HIGH, 0 },
156 { AU1550_PSC0_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, 101 { AU1500_DMA_INT_BASE+3, IRQ_TYPE_LEVEL_HIGH, 0 },
157 { AU1550_PSC1_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, 102 { AU1500_DMA_INT_BASE+4, IRQ_TYPE_LEVEL_HIGH, 0 },
158 { AU1550_PSC2_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, 103 { AU1500_DMA_INT_BASE+5, IRQ_TYPE_LEVEL_HIGH, 0 },
159 { AU1550_PSC3_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, 104 { AU1500_DMA_INT_BASE+6, IRQ_TYPE_LEVEL_HIGH, 0 },
160 { AU1000_TOY_INT, IRQ_TYPE_EDGE_RISING, 0 }, 105 { AU1500_DMA_INT_BASE+7, IRQ_TYPE_LEVEL_HIGH, 0 },
161 { AU1000_TOY_MATCH0_INT, IRQ_TYPE_EDGE_RISING, 0 }, 106 { AU1500_TOY_INT, IRQ_TYPE_EDGE_RISING, 0 },
162 { AU1000_TOY_MATCH1_INT, IRQ_TYPE_EDGE_RISING, 0 }, 107 { AU1500_TOY_MATCH0_INT, IRQ_TYPE_EDGE_RISING, 0 },
163 { AU1000_TOY_MATCH2_INT, IRQ_TYPE_EDGE_RISING, 1 }, 108 { AU1500_TOY_MATCH1_INT, IRQ_TYPE_EDGE_RISING, 0 },
164 { AU1000_RTC_INT, IRQ_TYPE_EDGE_RISING, 0 }, 109 { AU1500_TOY_MATCH2_INT, IRQ_TYPE_EDGE_RISING, 0 },
165 { AU1000_RTC_MATCH0_INT, IRQ_TYPE_EDGE_RISING, 0 }, 110 { AU1500_RTC_INT, IRQ_TYPE_EDGE_RISING, 0 },
166 { AU1000_RTC_MATCH1_INT, IRQ_TYPE_EDGE_RISING, 0 }, 111 { AU1500_RTC_MATCH0_INT, IRQ_TYPE_EDGE_RISING, 0 },
167 { AU1000_RTC_MATCH2_INT, IRQ_TYPE_EDGE_RISING, 0 }, 112 { AU1500_RTC_MATCH1_INT, IRQ_TYPE_EDGE_RISING, 0 },
168 { AU1550_NAND_INT, IRQ_TYPE_EDGE_RISING, 0 }, 113 { AU1500_RTC_MATCH2_INT, IRQ_TYPE_EDGE_RISING, 1 },
169 { AU1550_USB_DEV_REQ_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, 114 { AU1500_USB_DEV_REQ_INT, IRQ_TYPE_LEVEL_HIGH, 1 },
115 { AU1500_USB_DEV_SUS_INT, IRQ_TYPE_EDGE_RISING, 0 },
116 { AU1500_USB_HOST_INT, IRQ_TYPE_LEVEL_LOW, 0 },
117 { AU1500_ACSYNC_INT, IRQ_TYPE_EDGE_RISING, 0 },
118 { AU1500_MAC0_DMA_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
119 { AU1500_MAC1_DMA_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
120 { AU1500_AC97C_INT, IRQ_TYPE_EDGE_RISING, 0 },
121 { -1, },
122};
123
124struct au1xxx_irqmap au1100_irqmap[] __initdata = {
125 { AU1100_UART0_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
126 { AU1100_UART1_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
127 { AU1100_SD_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
128 { AU1100_UART3_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
129 { AU1100_SSI0_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
130 { AU1100_SSI1_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
131 { AU1100_DMA_INT_BASE, IRQ_TYPE_LEVEL_HIGH, 0 },
132 { AU1100_DMA_INT_BASE+1, IRQ_TYPE_LEVEL_HIGH, 0 },
133 { AU1100_DMA_INT_BASE+2, IRQ_TYPE_LEVEL_HIGH, 0 },
134 { AU1100_DMA_INT_BASE+3, IRQ_TYPE_LEVEL_HIGH, 0 },
135 { AU1100_DMA_INT_BASE+4, IRQ_TYPE_LEVEL_HIGH, 0 },
136 { AU1100_DMA_INT_BASE+5, IRQ_TYPE_LEVEL_HIGH, 0 },
137 { AU1100_DMA_INT_BASE+6, IRQ_TYPE_LEVEL_HIGH, 0 },
138 { AU1100_DMA_INT_BASE+7, IRQ_TYPE_LEVEL_HIGH, 0 },
139 { AU1100_TOY_INT, IRQ_TYPE_EDGE_RISING, 0 },
140 { AU1100_TOY_MATCH0_INT, IRQ_TYPE_EDGE_RISING, 0 },
141 { AU1100_TOY_MATCH1_INT, IRQ_TYPE_EDGE_RISING, 0 },
142 { AU1100_TOY_MATCH2_INT, IRQ_TYPE_EDGE_RISING, 0 },
143 { AU1100_RTC_INT, IRQ_TYPE_EDGE_RISING, 0 },
144 { AU1100_RTC_MATCH0_INT, IRQ_TYPE_EDGE_RISING, 0 },
145 { AU1100_RTC_MATCH1_INT, IRQ_TYPE_EDGE_RISING, 0 },
146 { AU1100_RTC_MATCH2_INT, IRQ_TYPE_EDGE_RISING, 1 },
147 { AU1100_IRDA_TX_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
148 { AU1100_IRDA_RX_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
149 { AU1100_USB_DEV_REQ_INT, IRQ_TYPE_LEVEL_HIGH, 1 },
150 { AU1100_USB_DEV_SUS_INT, IRQ_TYPE_EDGE_RISING, 0 },
151 { AU1100_USB_HOST_INT, IRQ_TYPE_LEVEL_LOW, 0 },
152 { AU1100_ACSYNC_INT, IRQ_TYPE_EDGE_RISING, 0 },
153 { AU1100_MAC0_DMA_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
154 { AU1100_LCD_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
155 { AU1100_AC97C_INT, IRQ_TYPE_EDGE_RISING, 0 },
156 { -1, },
157};
158
159struct au1xxx_irqmap au1550_irqmap[] __initdata = {
160 { AU1550_UART0_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
161 { AU1550_PCI_INTA, IRQ_TYPE_LEVEL_LOW, 0 },
162 { AU1550_PCI_INTB, IRQ_TYPE_LEVEL_LOW, 0 },
163 { AU1550_DDMA_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
164 { AU1550_CRYPTO_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
165 { AU1550_PCI_INTC, IRQ_TYPE_LEVEL_LOW, 0 },
166 { AU1550_PCI_INTD, IRQ_TYPE_LEVEL_LOW, 0 },
167 { AU1550_PCI_RST_INT, IRQ_TYPE_LEVEL_LOW, 0 },
168 { AU1550_UART1_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
169 { AU1550_UART3_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
170 { AU1550_PSC0_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
171 { AU1550_PSC1_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
172 { AU1550_PSC2_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
173 { AU1550_PSC3_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
174 { AU1550_TOY_INT, IRQ_TYPE_EDGE_RISING, 0 },
175 { AU1550_TOY_MATCH0_INT, IRQ_TYPE_EDGE_RISING, 0 },
176 { AU1550_TOY_MATCH1_INT, IRQ_TYPE_EDGE_RISING, 0 },
177 { AU1550_TOY_MATCH2_INT, IRQ_TYPE_EDGE_RISING, 0 },
178 { AU1550_RTC_INT, IRQ_TYPE_EDGE_RISING, 0 },
179 { AU1550_RTC_MATCH0_INT, IRQ_TYPE_EDGE_RISING, 0 },
180 { AU1550_RTC_MATCH1_INT, IRQ_TYPE_EDGE_RISING, 0 },
181 { AU1550_RTC_MATCH2_INT, IRQ_TYPE_EDGE_RISING, 1 },
182 { AU1550_NAND_INT, IRQ_TYPE_EDGE_RISING, 0 },
183 { AU1550_USB_DEV_REQ_INT, IRQ_TYPE_LEVEL_HIGH, 1 },
170 { AU1550_USB_DEV_SUS_INT, IRQ_TYPE_EDGE_RISING, 0 }, 184 { AU1550_USB_DEV_SUS_INT, IRQ_TYPE_EDGE_RISING, 0 },
171 { AU1550_USB_HOST_INT, IRQ_TYPE_LEVEL_LOW, 0 }, 185 { AU1550_USB_HOST_INT, IRQ_TYPE_LEVEL_LOW, 0 },
172 { AU1550_MAC0_DMA_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, 186 { AU1550_MAC0_DMA_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
173 { AU1550_MAC1_DMA_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, 187 { AU1550_MAC1_DMA_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
174 188 { -1, },
175#elif defined(CONFIG_SOC_AU1200) 189};
176 190
177 { AU1200_UART0_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, 191struct au1xxx_irqmap au1200_irqmap[] __initdata = {
178 { AU1200_SWT_INT, IRQ_TYPE_EDGE_RISING, 0 }, 192 { AU1200_UART0_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
179 { AU1200_SD_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, 193 { AU1200_SWT_INT, IRQ_TYPE_EDGE_RISING, 0 },
180 { AU1200_DDMA_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, 194 { AU1200_SD_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
181 { AU1200_MAE_BE_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, 195 { AU1200_DDMA_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
182 { AU1200_UART1_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, 196 { AU1200_MAE_BE_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
183 { AU1200_MAE_FE_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, 197 { AU1200_UART1_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
184 { AU1200_PSC0_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, 198 { AU1200_MAE_FE_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
185 { AU1200_PSC1_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, 199 { AU1200_PSC0_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
186 { AU1200_AES_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, 200 { AU1200_PSC1_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
187 { AU1200_CAMERA_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, 201 { AU1200_AES_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
188 { AU1000_TOY_INT, IRQ_TYPE_EDGE_RISING, 0 }, 202 { AU1200_CAMERA_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
189 { AU1000_TOY_MATCH0_INT, IRQ_TYPE_EDGE_RISING, 0 }, 203 { AU1200_TOY_INT, IRQ_TYPE_EDGE_RISING, 0 },
190 { AU1000_TOY_MATCH1_INT, IRQ_TYPE_EDGE_RISING, 0 }, 204 { AU1200_TOY_MATCH0_INT, IRQ_TYPE_EDGE_RISING, 0 },
191 { AU1000_TOY_MATCH2_INT, IRQ_TYPE_EDGE_RISING, 1 }, 205 { AU1200_TOY_MATCH1_INT, IRQ_TYPE_EDGE_RISING, 0 },
192 { AU1000_RTC_INT, IRQ_TYPE_EDGE_RISING, 0 }, 206 { AU1200_TOY_MATCH2_INT, IRQ_TYPE_EDGE_RISING, 0 },
193 { AU1000_RTC_MATCH0_INT, IRQ_TYPE_EDGE_RISING, 0 }, 207 { AU1200_RTC_INT, IRQ_TYPE_EDGE_RISING, 0 },
194 { AU1000_RTC_MATCH1_INT, IRQ_TYPE_EDGE_RISING, 0 }, 208 { AU1200_RTC_MATCH0_INT, IRQ_TYPE_EDGE_RISING, 0 },
195 { AU1000_RTC_MATCH2_INT, IRQ_TYPE_EDGE_RISING, 0 }, 209 { AU1200_RTC_MATCH1_INT, IRQ_TYPE_EDGE_RISING, 0 },
196 { AU1200_NAND_INT, IRQ_TYPE_EDGE_RISING, 0 }, 210 { AU1200_RTC_MATCH2_INT, IRQ_TYPE_EDGE_RISING, 1 },
197 { AU1200_USB_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, 211 { AU1200_NAND_INT, IRQ_TYPE_EDGE_RISING, 0 },
198 { AU1200_LCD_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, 212 { AU1200_USB_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
199 { AU1200_MAE_BOTH_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, 213 { AU1200_LCD_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
200 214 { AU1200_MAE_BOTH_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
201#else 215 { -1, },
202#error "Error: Unknown Alchemy SOC"
203#endif
204}; 216};
205 217
206 218
@@ -306,7 +318,7 @@ static void au1x_ic1_unmask(unsigned int irq_nr)
306 * nowhere in the current kernel sources is it disabled. --mlau 318 * nowhere in the current kernel sources is it disabled. --mlau
307 */ 319 */
308#if defined(CONFIG_MIPS_PB1000) 320#if defined(CONFIG_MIPS_PB1000)
309 if (irq_nr == AU1000_GPIO_15) 321 if (irq_nr == AU1000_GPIO15_INT)
310 au_writel(0x4000, PB1000_MDR); /* enable int */ 322 au_writel(0x4000, PB1000_MDR); /* enable int */
311#endif 323#endif
312 au_sync(); 324 au_sync();
@@ -378,11 +390,13 @@ static void au1x_ic1_maskack(unsigned int irq_nr)
378 390
379static int au1x_ic1_setwake(unsigned int irq, unsigned int on) 391static int au1x_ic1_setwake(unsigned int irq, unsigned int on)
380{ 392{
381 unsigned int bit = irq - AU1000_INTC1_INT_BASE; 393 int bit = irq - AU1000_INTC1_INT_BASE;
382 unsigned long wakemsk, flags; 394 unsigned long wakemsk, flags;
383 395
384 /* only GPIO 0-7 can act as wakeup source: */ 396 /* only GPIO 0-7 can act as wakeup source. Fortunately these
385 if ((irq < AU1000_GPIO_0) || (irq > AU1000_GPIO_7)) 397 * are wired up identically on all supported variants.
398 */
399 if ((bit < 0) || (bit > 7))
386 return -EINVAL; 400 return -EINVAL;
387 401
388 local_irq_save(flags); 402 local_irq_save(flags);
@@ -504,11 +518,11 @@ static int au1x_ic_settype(unsigned int irq, unsigned int flow_type)
504asmlinkage void plat_irq_dispatch(void) 518asmlinkage void plat_irq_dispatch(void)
505{ 519{
506 unsigned int pending = read_c0_status() & read_c0_cause(); 520 unsigned int pending = read_c0_status() & read_c0_cause();
507 unsigned long s, off, bit; 521 unsigned long s, off;
508 522
509 if (pending & CAUSEF_IP7) { 523 if (pending & CAUSEF_IP7) {
510 do_IRQ(MIPS_CPU_IRQ_BASE + 7); 524 off = MIPS_CPU_IRQ_BASE + 7;
511 return; 525 goto handle;
512 } else if (pending & CAUSEF_IP2) { 526 } else if (pending & CAUSEF_IP2) {
513 s = IC0_REQ0INT; 527 s = IC0_REQ0INT;
514 off = AU1000_INTC0_INT_BASE; 528 off = AU1000_INTC0_INT_BASE;
@@ -524,58 +538,20 @@ asmlinkage void plat_irq_dispatch(void)
524 } else 538 } else
525 goto spurious; 539 goto spurious;
526 540
527 bit = 0;
528 s = au_readl(s); 541 s = au_readl(s);
529 if (unlikely(!s)) { 542 if (unlikely(!s)) {
530spurious: 543spurious:
531 spurious_interrupt(); 544 spurious_interrupt();
532 return; 545 return;
533 } 546 }
534#ifdef AU1000_USB_DEV_REQ_INT 547 off += __ffs(s);
535 /* 548handle:
536 * Because of the tight timing of SETUP token to reply 549 do_IRQ(off);
537 * transactions, the USB devices-side packet complete
538 * interrupt needs the highest priority.
539 */
540 bit = 1 << (AU1000_USB_DEV_REQ_INT - AU1000_INTC0_INT_BASE);
541 if ((pending & CAUSEF_IP2) && (s & bit)) {
542 do_IRQ(AU1000_USB_DEV_REQ_INT);
543 return;
544 }
545#endif
546 do_IRQ(__ffs(s) + off);
547} 550}
548 551
549/* setup edge/level and assign request 0/1 */ 552static void __init au1000_init_irq(struct au1xxx_irqmap *map)
550void __init au1xxx_setup_irqmap(struct au1xxx_irqmap *map, int count)
551{ 553{
552 unsigned int bit, irq_nr; 554 unsigned int bit, irq_nr;
553
554 while (count--) {
555 irq_nr = map[count].im_irq;
556
557 if (((irq_nr < AU1000_INTC0_INT_BASE) ||
558 (irq_nr >= AU1000_INTC0_INT_BASE + 32)) &&
559 ((irq_nr < AU1000_INTC1_INT_BASE) ||
560 (irq_nr >= AU1000_INTC1_INT_BASE + 32)))
561 continue;
562
563 if (irq_nr >= AU1000_INTC1_INT_BASE) {
564 bit = irq_nr - AU1000_INTC1_INT_BASE;
565 if (map[count].im_request)
566 au_writel(1 << bit, IC1_ASSIGNCLR);
567 } else {
568 bit = irq_nr - AU1000_INTC0_INT_BASE;
569 if (map[count].im_request)
570 au_writel(1 << bit, IC0_ASSIGNCLR);
571 }
572
573 au1x_ic_settype(irq_nr, map[count].im_type);
574 }
575}
576
577void __init arch_init_irq(void)
578{
579 int i; 555 int i;
580 556
581 /* 557 /*
@@ -585,7 +561,7 @@ void __init arch_init_irq(void)
585 au_writel(0xffffffff, IC0_CFG1CLR); 561 au_writel(0xffffffff, IC0_CFG1CLR);
586 au_writel(0xffffffff, IC0_CFG2CLR); 562 au_writel(0xffffffff, IC0_CFG2CLR);
587 au_writel(0xffffffff, IC0_MASKCLR); 563 au_writel(0xffffffff, IC0_MASKCLR);
588 au_writel(0xffffffff, IC0_ASSIGNSET); 564 au_writel(0xffffffff, IC0_ASSIGNCLR);
589 au_writel(0xffffffff, IC0_WAKECLR); 565 au_writel(0xffffffff, IC0_WAKECLR);
590 au_writel(0xffffffff, IC0_SRCSET); 566 au_writel(0xffffffff, IC0_SRCSET);
591 au_writel(0xffffffff, IC0_FALLINGCLR); 567 au_writel(0xffffffff, IC0_FALLINGCLR);
@@ -596,7 +572,7 @@ void __init arch_init_irq(void)
596 au_writel(0xffffffff, IC1_CFG1CLR); 572 au_writel(0xffffffff, IC1_CFG1CLR);
597 au_writel(0xffffffff, IC1_CFG2CLR); 573 au_writel(0xffffffff, IC1_CFG2CLR);
598 au_writel(0xffffffff, IC1_MASKCLR); 574 au_writel(0xffffffff, IC1_MASKCLR);
599 au_writel(0xffffffff, IC1_ASSIGNSET); 575 au_writel(0xffffffff, IC1_ASSIGNCLR);
600 au_writel(0xffffffff, IC1_WAKECLR); 576 au_writel(0xffffffff, IC1_WAKECLR);
601 au_writel(0xffffffff, IC1_SRCSET); 577 au_writel(0xffffffff, IC1_SRCSET);
602 au_writel(0xffffffff, IC1_FALLINGCLR); 578 au_writel(0xffffffff, IC1_FALLINGCLR);
@@ -619,11 +595,43 @@ void __init arch_init_irq(void)
619 /* 595 /*
620 * Initialize IC0, which is fixed per processor. 596 * Initialize IC0, which is fixed per processor.
621 */ 597 */
622 au1xxx_setup_irqmap(au1xxx_ic0_map, ARRAY_SIZE(au1xxx_ic0_map)); 598 while (map->im_irq != -1) {
599 irq_nr = map->im_irq;
623 600
624 /* Boards can register additional (GPIO-based) IRQs. 601 if (irq_nr >= AU1000_INTC1_INT_BASE) {
625 */ 602 bit = irq_nr - AU1000_INTC1_INT_BASE;
626 board_init_irq(); 603 if (map->im_request)
604 au_writel(1 << bit, IC1_ASSIGNSET);
605 } else {
606 bit = irq_nr - AU1000_INTC0_INT_BASE;
607 if (map->im_request)
608 au_writel(1 << bit, IC0_ASSIGNSET);
609 }
610
611 au1x_ic_settype(irq_nr, map->im_type);
612 ++map;
613 }
627 614
628 set_c0_status(IE_IRQ0 | IE_IRQ1 | IE_IRQ2 | IE_IRQ3); 615 set_c0_status(IE_IRQ0 | IE_IRQ1 | IE_IRQ2 | IE_IRQ3);
629} 616}
617
618void __init arch_init_irq(void)
619{
620 switch (alchemy_get_cputype()) {
621 case ALCHEMY_CPU_AU1000:
622 au1000_init_irq(au1000_irqmap);
623 break;
624 case ALCHEMY_CPU_AU1500:
625 au1000_init_irq(au1500_irqmap);
626 break;
627 case ALCHEMY_CPU_AU1100:
628 au1000_init_irq(au1100_irqmap);
629 break;
630 case ALCHEMY_CPU_AU1550:
631 au1000_init_irq(au1550_irqmap);
632 break;
633 case ALCHEMY_CPU_AU1200:
634 au1000_init_irq(au1200_irqmap);
635 break;
636 }
637}
diff --git a/arch/mips/alchemy/common/platform.c b/arch/mips/alchemy/common/platform.c
index 117f99f70649..2580e77624d2 100644
--- a/arch/mips/alchemy/common/platform.c
+++ b/arch/mips/alchemy/common/platform.c
@@ -19,39 +19,40 @@
19#include <asm/mach-au1x00/au1xxx.h> 19#include <asm/mach-au1x00/au1xxx.h>
20#include <asm/mach-au1x00/au1xxx_dbdma.h> 20#include <asm/mach-au1x00/au1xxx_dbdma.h>
21#include <asm/mach-au1x00/au1100_mmc.h> 21#include <asm/mach-au1x00/au1100_mmc.h>
22 22#include <asm/mach-au1x00/au1xxx_eth.h>
23#define PORT(_base, _irq) \ 23
24 { \ 24#define PORT(_base, _irq) \
25 .iobase = _base, \ 25 { \
26 .membase = (void __iomem *)_base,\ 26 .mapbase = _base, \
27 .mapbase = CPHYSADDR(_base), \ 27 .irq = _irq, \
28 .irq = _irq, \ 28 .regshift = 2, \
29 .regshift = 2, \ 29 .iotype = UPIO_AU, \
30 .iotype = UPIO_AU, \ 30 .flags = UPF_SKIP_TEST | UPF_IOREMAP | \
31 .flags = UPF_SKIP_TEST \ 31 UPF_FIXED_TYPE, \
32 .type = PORT_16550A, \
32 } 33 }
33 34
34static struct plat_serial8250_port au1x00_uart_data[] = { 35static struct plat_serial8250_port au1x00_uart_data[] = {
35#if defined(CONFIG_SERIAL_8250_AU1X00) 36#if defined(CONFIG_SERIAL_8250_AU1X00)
36#if defined(CONFIG_SOC_AU1000) 37#if defined(CONFIG_SOC_AU1000)
37 PORT(UART0_ADDR, AU1000_UART0_INT), 38 PORT(UART0_PHYS_ADDR, AU1000_UART0_INT),
38 PORT(UART1_ADDR, AU1000_UART1_INT), 39 PORT(UART1_PHYS_ADDR, AU1000_UART1_INT),
39 PORT(UART2_ADDR, AU1000_UART2_INT), 40 PORT(UART2_PHYS_ADDR, AU1000_UART2_INT),
40 PORT(UART3_ADDR, AU1000_UART3_INT), 41 PORT(UART3_PHYS_ADDR, AU1000_UART3_INT),
41#elif defined(CONFIG_SOC_AU1500) 42#elif defined(CONFIG_SOC_AU1500)
42 PORT(UART0_ADDR, AU1500_UART0_INT), 43 PORT(UART0_PHYS_ADDR, AU1500_UART0_INT),
43 PORT(UART3_ADDR, AU1500_UART3_INT), 44 PORT(UART3_PHYS_ADDR, AU1500_UART3_INT),
44#elif defined(CONFIG_SOC_AU1100) 45#elif defined(CONFIG_SOC_AU1100)
45 PORT(UART0_ADDR, AU1100_UART0_INT), 46 PORT(UART0_PHYS_ADDR, AU1100_UART0_INT),
46 PORT(UART1_ADDR, AU1100_UART1_INT), 47 PORT(UART1_PHYS_ADDR, AU1100_UART1_INT),
47 PORT(UART3_ADDR, AU1100_UART3_INT), 48 PORT(UART3_PHYS_ADDR, AU1100_UART3_INT),
48#elif defined(CONFIG_SOC_AU1550) 49#elif defined(CONFIG_SOC_AU1550)
49 PORT(UART0_ADDR, AU1550_UART0_INT), 50 PORT(UART0_PHYS_ADDR, AU1550_UART0_INT),
50 PORT(UART1_ADDR, AU1550_UART1_INT), 51 PORT(UART1_PHYS_ADDR, AU1550_UART1_INT),
51 PORT(UART3_ADDR, AU1550_UART3_INT), 52 PORT(UART3_PHYS_ADDR, AU1550_UART3_INT),
52#elif defined(CONFIG_SOC_AU1200) 53#elif defined(CONFIG_SOC_AU1200)
53 PORT(UART0_ADDR, AU1200_UART0_INT), 54 PORT(UART0_PHYS_ADDR, AU1200_UART0_INT),
54 PORT(UART1_ADDR, AU1200_UART1_INT), 55 PORT(UART1_PHYS_ADDR, AU1200_UART1_INT),
55#endif 56#endif
56#endif /* CONFIG_SERIAL_8250_AU1X00 */ 57#endif /* CONFIG_SERIAL_8250_AU1X00 */
57 { }, 58 { },
@@ -73,8 +74,8 @@ static struct resource au1xxx_usb_ohci_resources[] = {
73 .flags = IORESOURCE_MEM, 74 .flags = IORESOURCE_MEM,
74 }, 75 },
75 [1] = { 76 [1] = {
76 .start = AU1000_USB_HOST_INT, 77 .start = FOR_PLATFORM_C_USB_HOST_INT,
77 .end = AU1000_USB_HOST_INT, 78 .end = FOR_PLATFORM_C_USB_HOST_INT,
78 .flags = IORESOURCE_IRQ, 79 .flags = IORESOURCE_IRQ,
79 }, 80 },
80}; 81};
@@ -132,8 +133,8 @@ static struct resource au1xxx_usb_ehci_resources[] = {
132 .flags = IORESOURCE_MEM, 133 .flags = IORESOURCE_MEM,
133 }, 134 },
134 [1] = { 135 [1] = {
135 .start = AU1000_USB_HOST_INT, 136 .start = AU1200_USB_INT,
136 .end = AU1000_USB_HOST_INT, 137 .end = AU1200_USB_INT,
137 .flags = IORESOURCE_IRQ, 138 .flags = IORESOURCE_IRQ,
138 }, 139 },
139}; 140};
@@ -308,11 +309,6 @@ static struct platform_device au1200_mmc1_device = {
308#endif /* #ifndef CONFIG_MIPS_DB1200 */ 309#endif /* #ifndef CONFIG_MIPS_DB1200 */
309#endif /* #ifdef CONFIG_SOC_AU1200 */ 310#endif /* #ifdef CONFIG_SOC_AU1200 */
310 311
311static struct platform_device au1x00_pcmcia_device = {
312 .name = "au1x00-pcmcia",
313 .id = 0,
314};
315
316/* All Alchemy demoboards with I2C have this #define in their headers */ 312/* All Alchemy demoboards with I2C have this #define in their headers */
317#ifdef SMBUS_PSC_BASE 313#ifdef SMBUS_PSC_BASE
318static struct resource pbdb_smbus_resources[] = { 314static struct resource pbdb_smbus_resources[] = {
@@ -331,10 +327,92 @@ static struct platform_device pbdb_smbus_device = {
331}; 327};
332#endif 328#endif
333 329
330/* Macro to help defining the Ethernet MAC resources */
331#define MAC_RES(_base, _enable, _irq) \
332 { \
333 .start = CPHYSADDR(_base), \
334 .end = CPHYSADDR(_base + 0xffff), \
335 .flags = IORESOURCE_MEM, \
336 }, \
337 { \
338 .start = CPHYSADDR(_enable), \
339 .end = CPHYSADDR(_enable + 0x3), \
340 .flags = IORESOURCE_MEM, \
341 }, \
342 { \
343 .start = _irq, \
344 .end = _irq, \
345 .flags = IORESOURCE_IRQ \
346 }
347
348static struct resource au1xxx_eth0_resources[] = {
349#if defined(CONFIG_SOC_AU1000)
350 MAC_RES(AU1000_ETH0_BASE, AU1000_MAC0_ENABLE, AU1000_MAC0_DMA_INT),
351#elif defined(CONFIG_SOC_AU1100)
352 MAC_RES(AU1100_ETH0_BASE, AU1100_MAC0_ENABLE, AU1100_MAC0_DMA_INT),
353#elif defined(CONFIG_SOC_AU1550)
354 MAC_RES(AU1550_ETH0_BASE, AU1550_MAC0_ENABLE, AU1550_MAC0_DMA_INT),
355#elif defined(CONFIG_SOC_AU1500)
356 MAC_RES(AU1500_ETH0_BASE, AU1500_MAC0_ENABLE, AU1500_MAC0_DMA_INT),
357#endif
358};
359
360
361static struct au1000_eth_platform_data au1xxx_eth0_platform_data = {
362 .phy1_search_mac0 = 1,
363};
364
365static struct platform_device au1xxx_eth0_device = {
366 .name = "au1000-eth",
367 .id = 0,
368 .num_resources = ARRAY_SIZE(au1xxx_eth0_resources),
369 .resource = au1xxx_eth0_resources,
370 .dev.platform_data = &au1xxx_eth0_platform_data,
371};
372
373#ifndef CONFIG_SOC_AU1100
374static struct resource au1xxx_eth1_resources[] = {
375#if defined(CONFIG_SOC_AU1000)
376 MAC_RES(AU1000_ETH1_BASE, AU1000_MAC1_ENABLE, AU1000_MAC1_DMA_INT),
377#elif defined(CONFIG_SOC_AU1550)
378 MAC_RES(AU1550_ETH1_BASE, AU1550_MAC1_ENABLE, AU1550_MAC1_DMA_INT),
379#elif defined(CONFIG_SOC_AU1500)
380 MAC_RES(AU1500_ETH1_BASE, AU1500_MAC1_ENABLE, AU1500_MAC1_DMA_INT),
381#endif
382};
383
384static struct au1000_eth_platform_data au1xxx_eth1_platform_data = {
385 .phy1_search_mac0 = 1,
386};
387
388static struct platform_device au1xxx_eth1_device = {
389 .name = "au1000-eth",
390 .id = 1,
391 .num_resources = ARRAY_SIZE(au1xxx_eth1_resources),
392 .resource = au1xxx_eth1_resources,
393 .dev.platform_data = &au1xxx_eth1_platform_data,
394};
395#endif
396
397void __init au1xxx_override_eth_cfg(unsigned int port,
398 struct au1000_eth_platform_data *eth_data)
399{
400 if (!eth_data || port > 1)
401 return;
402
403 if (port == 0)
404 memcpy(&au1xxx_eth0_platform_data, eth_data,
405 sizeof(struct au1000_eth_platform_data));
406#ifndef CONFIG_SOC_AU1100
407 else
408 memcpy(&au1xxx_eth1_platform_data, eth_data,
409 sizeof(struct au1000_eth_platform_data));
410#endif
411}
412
334static struct platform_device *au1xxx_platform_devices[] __initdata = { 413static struct platform_device *au1xxx_platform_devices[] __initdata = {
335 &au1xx0_uart_device, 414 &au1xx0_uart_device,
336 &au1xxx_usb_ohci_device, 415 &au1xxx_usb_ohci_device,
337 &au1x00_pcmcia_device,
338#ifdef CONFIG_FB_AU1100 416#ifdef CONFIG_FB_AU1100
339 &au1100_lcd_device, 417 &au1100_lcd_device,
340#endif 418#endif
@@ -351,6 +429,7 @@ static struct platform_device *au1xxx_platform_devices[] __initdata = {
351#ifdef SMBUS_PSC_BASE 429#ifdef SMBUS_PSC_BASE
352 &pbdb_smbus_device, 430 &pbdb_smbus_device,
353#endif 431#endif
432 &au1xxx_eth0_device,
354}; 433};
355 434
356static int __init au1xxx_platform_init(void) 435static int __init au1xxx_platform_init(void)
@@ -362,6 +441,12 @@ static int __init au1xxx_platform_init(void)
362 for (i = 0; au1x00_uart_data[i].flags; i++) 441 for (i = 0; au1x00_uart_data[i].flags; i++)
363 au1x00_uart_data[i].uartclk = uartclk; 442 au1x00_uart_data[i].uartclk = uartclk;
364 443
444#ifndef CONFIG_SOC_AU1100
445 /* Register second MAC if enabled in pinfunc */
446 if (!(au_readl(SYS_PINFUNC) & (u32)SYS_PF_NI2))
447 platform_device_register(&au1xxx_eth1_device);
448#endif
449
365 return platform_add_devices(au1xxx_platform_devices, 450 return platform_add_devices(au1xxx_platform_devices,
366 ARRAY_SIZE(au1xxx_platform_devices)); 451 ARRAY_SIZE(au1xxx_platform_devices));
367} 452}
diff --git a/arch/mips/alchemy/common/prom.c b/arch/mips/alchemy/common/prom.c
index 18b310b475ca..c29511b11d44 100644
--- a/arch/mips/alchemy/common/prom.c
+++ b/arch/mips/alchemy/common/prom.c
@@ -43,29 +43,15 @@ int prom_argc;
43char **prom_argv; 43char **prom_argv;
44char **prom_envp; 44char **prom_envp;
45 45
46char * __init_or_module prom_getcmdline(void)
47{
48 return &(arcs_cmdline[0]);
49}
50
51void prom_init_cmdline(void) 46void prom_init_cmdline(void)
52{ 47{
53 char *cp; 48 int i;
54 int actr;
55
56 actr = 1; /* Always ignore argv[0] */
57 49
58 cp = &(arcs_cmdline[0]); 50 for (i = 1; i < prom_argc; i++) {
59 while (actr < prom_argc) { 51 strlcat(arcs_cmdline, prom_argv[i], COMMAND_LINE_SIZE);
60 strcpy(cp, prom_argv[actr]); 52 if (i < (prom_argc - 1))
61 cp += strlen(prom_argv[actr]); 53 strlcat(arcs_cmdline, " ", COMMAND_LINE_SIZE);
62 *cp++ = ' ';
63 actr++;
64 } 54 }
65 if (cp != &(arcs_cmdline[0])) /* get rid of trailing space */
66 --cp;
67 if (prom_argc > 1)
68 *cp = '\0';
69} 55}
70 56
71char *prom_getenv(char *envname) 57char *prom_getenv(char *envname)
@@ -121,14 +107,12 @@ static inline void str2eaddr(unsigned char *ea, unsigned char *str)
121int prom_get_ethernet_addr(char *ethernet_addr) 107int prom_get_ethernet_addr(char *ethernet_addr)
122{ 108{
123 char *ethaddr_str; 109 char *ethaddr_str;
124 char *argptr;
125 110
126 /* Check the environment variables first */ 111 /* Check the environment variables first */
127 ethaddr_str = prom_getenv("ethaddr"); 112 ethaddr_str = prom_getenv("ethaddr");
128 if (!ethaddr_str) { 113 if (!ethaddr_str) {
129 /* Check command line */ 114 /* Check command line */
130 argptr = prom_getcmdline(); 115 ethaddr_str = strstr(arcs_cmdline, "ethaddr=");
131 ethaddr_str = strstr(argptr, "ethaddr=");
132 if (!ethaddr_str) 116 if (!ethaddr_str)
133 return -1; 117 return -1;
134 118
diff --git a/arch/mips/alchemy/common/puts.c b/arch/mips/alchemy/common/puts.c
deleted file mode 100644
index 55bbe24d45b6..000000000000
--- a/arch/mips/alchemy/common/puts.c
+++ /dev/null
@@ -1,68 +0,0 @@
1/*
2 *
3 * BRIEF MODULE DESCRIPTION
4 * Low level UART routines to directly access Alchemy UART.
5 *
6 * Copyright 2001, 2008 MontaVista Software Inc.
7 * Author: MontaVista Software, Inc. <source@mvista.com>
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
13 *
14 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
15 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
16 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
17 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
20 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
21 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 *
25 * You should have received a copy of the GNU General Public License along
26 * with this program; if not, write to the Free Software Foundation, Inc.,
27 * 675 Mass Ave, Cambridge, MA 02139, USA.
28 */
29
30#include <asm/mach-au1x00/au1000.h>
31
32#define SERIAL_BASE UART_BASE
33#define SER_CMD 0x7
34#define SER_DATA 0x1
35#define TX_BUSY 0x20
36
37#define TIMEOUT 0xffffff
38#define SLOW_DOWN
39
40static volatile unsigned long * const com1 = (unsigned long *)SERIAL_BASE;
41
42#ifdef SLOW_DOWN
43static inline void slow_down(void)
44{
45 int k;
46
47 for (k = 0; k < 10000; k++);
48}
49#else
50#define slow_down()
51#endif
52
53void
54prom_putchar(const unsigned char c)
55{
56 unsigned char ch;
57 int i = 0;
58
59 do {
60 ch = com1[SER_CMD];
61 slow_down();
62 i++;
63 if (i > TIMEOUT)
64 break;
65 } while (0 == (ch & TX_BUSY));
66
67 com1[SER_DATA] = c;
68}
diff --git a/arch/mips/alchemy/common/reset.c b/arch/mips/alchemy/common/reset.c
deleted file mode 100644
index 4791011e8f92..000000000000
--- a/arch/mips/alchemy/common/reset.c
+++ /dev/null
@@ -1,188 +0,0 @@
1/*
2 *
3 * BRIEF MODULE DESCRIPTION
4 * Au1xx0 reset routines.
5 *
6 * Copyright 2001, 2006, 2008 MontaVista Software Inc.
7 * Author: MontaVista Software, Inc. <source@mvista.com>
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
13 *
14 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
15 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
16 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
17 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
20 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
21 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 *
25 * You should have received a copy of the GNU General Public License along
26 * with this program; if not, write to the Free Software Foundation, Inc.,
27 * 675 Mass Ave, Cambridge, MA 02139, USA.
28 */
29
30#include <linux/gpio.h>
31
32#include <asm/cacheflush.h>
33#include <asm/mach-au1x00/au1000.h>
34
35void au1000_restart(char *command)
36{
37 /* Set all integrated peripherals to disabled states */
38 extern void board_reset(void);
39 u32 prid = read_c0_prid();
40
41 printk(KERN_NOTICE "\n** Resetting Integrated Peripherals\n");
42
43 switch (prid & 0xFF000000) {
44 case 0x00000000: /* Au1000 */
45 au_writel(0x02, 0xb0000010); /* ac97_enable */
46 au_writel(0x08, 0xb017fffc); /* usbh_enable - early errata */
47 asm("sync");
48 au_writel(0x00, 0xb017fffc); /* usbh_enable */
49 au_writel(0x00, 0xb0200058); /* usbd_enable */
50 au_writel(0x00, 0xb0300040); /* ir_enable */
51 au_writel(0x00, 0xb4004104); /* mac dma */
52 au_writel(0x00, 0xb4004114); /* mac dma */
53 au_writel(0x00, 0xb4004124); /* mac dma */
54 au_writel(0x00, 0xb4004134); /* mac dma */
55 au_writel(0x00, 0xb0520000); /* macen0 */
56 au_writel(0x00, 0xb0520004); /* macen1 */
57 au_writel(0x00, 0xb1000008); /* i2s_enable */
58 au_writel(0x00, 0xb1100100); /* uart0_enable */
59 au_writel(0x00, 0xb1200100); /* uart1_enable */
60 au_writel(0x00, 0xb1300100); /* uart2_enable */
61 au_writel(0x00, 0xb1400100); /* uart3_enable */
62 au_writel(0x02, 0xb1600100); /* ssi0_enable */
63 au_writel(0x02, 0xb1680100); /* ssi1_enable */
64 au_writel(0x00, 0xb1900020); /* sys_freqctrl0 */
65 au_writel(0x00, 0xb1900024); /* sys_freqctrl1 */
66 au_writel(0x00, 0xb1900028); /* sys_clksrc */
67 au_writel(0x10, 0xb1900060); /* sys_cpupll */
68 au_writel(0x00, 0xb1900064); /* sys_auxpll */
69 au_writel(0x00, 0xb1900100); /* sys_pininputen */
70 break;
71 case 0x01000000: /* Au1500 */
72 au_writel(0x02, 0xb0000010); /* ac97_enable */
73 au_writel(0x08, 0xb017fffc); /* usbh_enable - early errata */
74 asm("sync");
75 au_writel(0x00, 0xb017fffc); /* usbh_enable */
76 au_writel(0x00, 0xb0200058); /* usbd_enable */
77 au_writel(0x00, 0xb4004104); /* mac dma */
78 au_writel(0x00, 0xb4004114); /* mac dma */
79 au_writel(0x00, 0xb4004124); /* mac dma */
80 au_writel(0x00, 0xb4004134); /* mac dma */
81 au_writel(0x00, 0xb1520000); /* macen0 */
82 au_writel(0x00, 0xb1520004); /* macen1 */
83 au_writel(0x00, 0xb1100100); /* uart0_enable */
84 au_writel(0x00, 0xb1400100); /* uart3_enable */
85 au_writel(0x00, 0xb1900020); /* sys_freqctrl0 */
86 au_writel(0x00, 0xb1900024); /* sys_freqctrl1 */
87 au_writel(0x00, 0xb1900028); /* sys_clksrc */
88 au_writel(0x10, 0xb1900060); /* sys_cpupll */
89 au_writel(0x00, 0xb1900064); /* sys_auxpll */
90 au_writel(0x00, 0xb1900100); /* sys_pininputen */
91 break;
92 case 0x02000000: /* Au1100 */
93 au_writel(0x02, 0xb0000010); /* ac97_enable */
94 au_writel(0x08, 0xb017fffc); /* usbh_enable - early errata */
95 asm("sync");
96 au_writel(0x00, 0xb017fffc); /* usbh_enable */
97 au_writel(0x00, 0xb0200058); /* usbd_enable */
98 au_writel(0x00, 0xb0300040); /* ir_enable */
99 au_writel(0x00, 0xb4004104); /* mac dma */
100 au_writel(0x00, 0xb4004114); /* mac dma */
101 au_writel(0x00, 0xb4004124); /* mac dma */
102 au_writel(0x00, 0xb4004134); /* mac dma */
103 au_writel(0x00, 0xb0520000); /* macen0 */
104 au_writel(0x00, 0xb1000008); /* i2s_enable */
105 au_writel(0x00, 0xb1100100); /* uart0_enable */
106 au_writel(0x00, 0xb1200100); /* uart1_enable */
107 au_writel(0x00, 0xb1400100); /* uart3_enable */
108 au_writel(0x02, 0xb1600100); /* ssi0_enable */
109 au_writel(0x02, 0xb1680100); /* ssi1_enable */
110 au_writel(0x00, 0xb1900020); /* sys_freqctrl0 */
111 au_writel(0x00, 0xb1900024); /* sys_freqctrl1 */
112 au_writel(0x00, 0xb1900028); /* sys_clksrc */
113 au_writel(0x10, 0xb1900060); /* sys_cpupll */
114 au_writel(0x00, 0xb1900064); /* sys_auxpll */
115 au_writel(0x00, 0xb1900100); /* sys_pininputen */
116 break;
117 case 0x03000000: /* Au1550 */
118 au_writel(0x00, 0xb1a00004); /* psc 0 */
119 au_writel(0x00, 0xb1b00004); /* psc 1 */
120 au_writel(0x00, 0xb0a00004); /* psc 2 */
121 au_writel(0x00, 0xb0b00004); /* psc 3 */
122 au_writel(0x00, 0xb017fffc); /* usbh_enable */
123 au_writel(0x00, 0xb0200058); /* usbd_enable */
124 au_writel(0x00, 0xb4004104); /* mac dma */
125 au_writel(0x00, 0xb4004114); /* mac dma */
126 au_writel(0x00, 0xb4004124); /* mac dma */
127 au_writel(0x00, 0xb4004134); /* mac dma */
128 au_writel(0x00, 0xb1520000); /* macen0 */
129 au_writel(0x00, 0xb1520004); /* macen1 */
130 au_writel(0x00, 0xb1100100); /* uart0_enable */
131 au_writel(0x00, 0xb1200100); /* uart1_enable */
132 au_writel(0x00, 0xb1400100); /* uart3_enable */
133 au_writel(0x00, 0xb1900020); /* sys_freqctrl0 */
134 au_writel(0x00, 0xb1900024); /* sys_freqctrl1 */
135 au_writel(0x00, 0xb1900028); /* sys_clksrc */
136 au_writel(0x10, 0xb1900060); /* sys_cpupll */
137 au_writel(0x00, 0xb1900064); /* sys_auxpll */
138 au_writel(0x00, 0xb1900100); /* sys_pininputen */
139 break;
140 }
141
142 set_c0_status(ST0_BEV | ST0_ERL);
143 change_c0_config(CONF_CM_CMASK, CONF_CM_UNCACHED);
144 flush_cache_all();
145 write_c0_wired(0);
146
147 /* Give board a chance to do a hardware reset */
148 board_reset();
149
150 /* Jump to the beggining in case board_reset() is empty */
151 __asm__ __volatile__("jr\t%0"::"r"(0xbfc00000));
152}
153
154void au1000_halt(void)
155{
156#if defined(CONFIG_MIPS_PB1550) || defined(CONFIG_MIPS_DB1550)
157 /* Power off system */
158 printk(KERN_NOTICE "\n** Powering off...\n");
159 au_writew(au_readw(0xAF00001C) | (3 << 14), 0xAF00001C);
160 au_sync();
161 while (1); /* should not get here */
162#else
163 printk(KERN_NOTICE "\n** You can safely turn off the power\n");
164#ifdef CONFIG_MIPS_MIRAGE
165 gpio_direction_output(210, 1);
166#endif
167#ifdef CONFIG_MIPS_DB1200
168 au_writew(au_readw(0xB980001C) | (1 << 14), 0xB980001C);
169#endif
170#ifdef CONFIG_PM
171 au_sleep();
172
173 /* Should not get here */
174 printk(KERN_ERR "Unable to put CPU in sleep mode\n");
175 while (1);
176#else
177 while (1)
178 __asm__(".set\tmips3\n\t"
179 "wait\n\t"
180 ".set\tmips0");
181#endif
182#endif /* defined(CONFIG_MIPS_PB1550) || defined(CONFIG_MIPS_DB1550) */
183}
184
185void au1000_power_off(void)
186{
187 au1000_halt();
188}
diff --git a/arch/mips/alchemy/common/setup.c b/arch/mips/alchemy/common/setup.c
index 6184baa56786..561e5da2658b 100644
--- a/arch/mips/alchemy/common/setup.c
+++ b/arch/mips/alchemy/common/setup.c
@@ -29,18 +29,13 @@
29#include <linux/ioport.h> 29#include <linux/ioport.h>
30#include <linux/jiffies.h> 30#include <linux/jiffies.h>
31#include <linux/module.h> 31#include <linux/module.h>
32#include <linux/pm.h>
33 32
34#include <asm/mipsregs.h> 33#include <asm/mipsregs.h>
35#include <asm/reboot.h>
36#include <asm/time.h> 34#include <asm/time.h>
37 35
38#include <au1000.h> 36#include <au1000.h>
39 37
40extern void __init board_setup(void); 38extern void __init board_setup(void);
41extern void au1000_restart(char *);
42extern void au1000_halt(void);
43extern void au1000_power_off(void);
44extern void set_cpuspec(void); 39extern void set_cpuspec(void);
45 40
46void __init plat_mem_setup(void) 41void __init plat_mem_setup(void)
@@ -57,10 +52,6 @@ void __init plat_mem_setup(void)
57 /* this is faster than wasting cycles trying to approximate it */ 52 /* this is faster than wasting cycles trying to approximate it */
58 preset_lpj = (est_freq >> 1) / HZ; 53 preset_lpj = (est_freq >> 1) / HZ;
59 54
60 _machine_restart = au1000_restart;
61 _machine_halt = au1000_halt;
62 pm_power_off = au1000_power_off;
63
64 board_setup(); /* board specific setup */ 55 board_setup(); /* board specific setup */
65 56
66 if (au1xxx_cpu_needs_config_od()) 57 if (au1xxx_cpu_needs_config_od())
@@ -78,37 +69,20 @@ void __init plat_mem_setup(void)
78 iomem_resource.end = IOMEM_RESOURCE_END; 69 iomem_resource.end = IOMEM_RESOURCE_END;
79} 70}
80 71
81#if defined(CONFIG_64BIT_PHYS_ADDR) 72#if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_PCI)
82/* This routine should be valid for all Au1x based boards */ 73/* This routine should be valid for all Au1x based boards */
83phys_t __fixup_bigphys_addr(phys_t phys_addr, phys_t size) 74phys_t __fixup_bigphys_addr(phys_t phys_addr, phys_t size)
84{ 75{
76 u32 start = (u32)Au1500_PCI_MEM_START;
77 u32 end = (u32)Au1500_PCI_MEM_END;
78
85 /* Don't fixup 36-bit addresses */ 79 /* Don't fixup 36-bit addresses */
86 if ((phys_addr >> 32) != 0) 80 if ((phys_addr >> 32) != 0)
87 return phys_addr; 81 return phys_addr;
88 82
89#ifdef CONFIG_PCI 83 /* Check for PCI memory window */
90 { 84 if (phys_addr >= start && (phys_addr + size - 1) <= end)
91 u32 start = (u32)Au1500_PCI_MEM_START; 85 return (phys_t)((phys_addr - start) + Au1500_PCI_MEM_START);
92 u32 end = (u32)Au1500_PCI_MEM_END;
93
94 /* Check for PCI memory window */
95 if (phys_addr >= start && (phys_addr + size - 1) <= end)
96 return (phys_t)
97 ((phys_addr - start) + Au1500_PCI_MEM_START);
98 }
99#endif
100
101 /*
102 * All Au1xx0 SOCs have a PCMCIA controller.
103 * We setup our 32-bit pseudo addresses to be equal to the
104 * 36-bit addr >> 4, to make it easier to check the address
105 * and fix it.
106 * The PCMCIA socket 0 physical attribute address is 0xF 4000 0000.
107 * The pseudo address we use is 0xF400 0000. Any address over
108 * 0xF400 0000 is a PCMCIA pseudo address.
109 */
110 if ((phys_addr >= 0xF4000000) && (phys_addr < 0xFFFFFFFF))
111 return (phys_t)(phys_addr << 4);
112 86
113 /* default nop */ 87 /* default nop */
114 return phys_addr; 88 return phys_addr;
diff --git a/arch/mips/alchemy/common/time.c b/arch/mips/alchemy/common/time.c
index 379a664809b0..2aecb2fdf982 100644
--- a/arch/mips/alchemy/common/time.c
+++ b/arch/mips/alchemy/common/time.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2008 Manuel Lauss <mano@roarinelk.homelinux.net> 2 * Copyright (C) 2008-2009 Manuel Lauss <manuel.lauss@gmail.com>
3 * 3 *
4 * Previous incarnations were: 4 * Previous incarnations were:
5 * Copyright (C) 2001, 2006, 2008 MontaVista Software, <source@mvista.com> 5 * Copyright (C) 2001, 2006, 2008 MontaVista Software, <source@mvista.com>
@@ -85,7 +85,6 @@ static struct clock_event_device au1x_rtcmatch2_clockdev = {
85 .name = "rtcmatch2", 85 .name = "rtcmatch2",
86 .features = CLOCK_EVT_FEAT_ONESHOT, 86 .features = CLOCK_EVT_FEAT_ONESHOT,
87 .rating = 100, 87 .rating = 100,
88 .irq = AU1000_RTC_MATCH2_INT,
89 .set_next_event = au1x_rtcmatch2_set_next_event, 88 .set_next_event = au1x_rtcmatch2_set_next_event,
90 .set_mode = au1x_rtcmatch2_set_mode, 89 .set_mode = au1x_rtcmatch2_set_mode,
91 .cpumask = cpu_all_mask, 90 .cpumask = cpu_all_mask,
@@ -98,11 +97,13 @@ static struct irqaction au1x_rtcmatch2_irqaction = {
98 .dev_id = &au1x_rtcmatch2_clockdev, 97 .dev_id = &au1x_rtcmatch2_clockdev,
99}; 98};
100 99
101void __init plat_time_init(void) 100static int __init alchemy_time_init(unsigned int m2int)
102{ 101{
103 struct clock_event_device *cd = &au1x_rtcmatch2_clockdev; 102 struct clock_event_device *cd = &au1x_rtcmatch2_clockdev;
104 unsigned long t; 103 unsigned long t;
105 104
105 au1x_rtcmatch2_clockdev.irq = m2int;
106
106 /* Check if firmware (YAMON, ...) has enabled 32kHz and clock 107 /* Check if firmware (YAMON, ...) has enabled 32kHz and clock
107 * has been detected. If so install the rtcmatch2 clocksource, 108 * has been detected. If so install the rtcmatch2 clocksource,
108 * otherwise don't bother. Note that both bits being set is by 109 * otherwise don't bother. Note that both bits being set is by
@@ -148,13 +149,18 @@ void __init plat_time_init(void)
148 cd->max_delta_ns = clockevent_delta2ns(0xffffffff, cd); 149 cd->max_delta_ns = clockevent_delta2ns(0xffffffff, cd);
149 cd->min_delta_ns = clockevent_delta2ns(8, cd); /* ~0.25ms */ 150 cd->min_delta_ns = clockevent_delta2ns(8, cd); /* ~0.25ms */
150 clockevents_register_device(cd); 151 clockevents_register_device(cd);
151 setup_irq(AU1000_RTC_MATCH2_INT, &au1x_rtcmatch2_irqaction); 152 setup_irq(m2int, &au1x_rtcmatch2_irqaction);
152 153
153 printk(KERN_INFO "Alchemy clocksource installed\n"); 154 printk(KERN_INFO "Alchemy clocksource installed\n");
154 155
155 return; 156 return 0;
156 157
157cntr_err: 158cntr_err:
159 return -1;
160}
161
162static void __init alchemy_setup_c0timer(void)
163{
158 /* 164 /*
159 * MIPS kernel assigns 'au1k_wait' to 'cpu_wait' before this 165 * MIPS kernel assigns 'au1k_wait' to 'cpu_wait' before this
160 * function is called. Because the Alchemy counters are unusable 166 * function is called. Because the Alchemy counters are unusable
@@ -166,3 +172,22 @@ cntr_err:
166 r4k_clockevent_init(); 172 r4k_clockevent_init();
167 init_r4k_clocksource(); 173 init_r4k_clocksource();
168} 174}
175
176static int alchemy_m2inttab[] __initdata = {
177 AU1000_RTC_MATCH2_INT,
178 AU1500_RTC_MATCH2_INT,
179 AU1100_RTC_MATCH2_INT,
180 AU1550_RTC_MATCH2_INT,
181 AU1200_RTC_MATCH2_INT,
182};
183
184void __init plat_time_init(void)
185{
186 int t;
187
188 t = alchemy_get_cputype();
189 if (t == ALCHEMY_CPU_UNKNOWN)
190 alchemy_setup_c0timer();
191 else if (alchemy_time_init(alchemy_m2inttab[t]))
192 alchemy_setup_c0timer();
193}
diff --git a/arch/mips/alchemy/devboards/Makefile b/arch/mips/alchemy/devboards/Makefile
index 730f9f2b30e8..ecbd37f9ee87 100644
--- a/arch/mips/alchemy/devboards/Makefile
+++ b/arch/mips/alchemy/devboards/Makefile
@@ -2,7 +2,7 @@
2# Alchemy Develboards 2# Alchemy Develboards
3# 3#
4 4
5obj-y += prom.o 5obj-y += prom.o bcsr.o platform.o
6obj-$(CONFIG_PM) += pm.o 6obj-$(CONFIG_PM) += pm.o
7obj-$(CONFIG_MIPS_PB1000) += pb1000/ 7obj-$(CONFIG_MIPS_PB1000) += pb1000/
8obj-$(CONFIG_MIPS_PB1100) += pb1100/ 8obj-$(CONFIG_MIPS_PB1100) += pb1100/
@@ -11,8 +11,10 @@ obj-$(CONFIG_MIPS_PB1500) += pb1500/
11obj-$(CONFIG_MIPS_PB1550) += pb1550/ 11obj-$(CONFIG_MIPS_PB1550) += pb1550/
12obj-$(CONFIG_MIPS_DB1000) += db1x00/ 12obj-$(CONFIG_MIPS_DB1000) += db1x00/
13obj-$(CONFIG_MIPS_DB1100) += db1x00/ 13obj-$(CONFIG_MIPS_DB1100) += db1x00/
14obj-$(CONFIG_MIPS_DB1200) += pb1200/ 14obj-$(CONFIG_MIPS_DB1200) += db1200/
15obj-$(CONFIG_MIPS_DB1500) += db1x00/ 15obj-$(CONFIG_MIPS_DB1500) += db1x00/
16obj-$(CONFIG_MIPS_DB1550) += db1x00/ 16obj-$(CONFIG_MIPS_DB1550) += db1x00/
17obj-$(CONFIG_MIPS_BOSPORUS) += db1x00/ 17obj-$(CONFIG_MIPS_BOSPORUS) += db1x00/
18obj-$(CONFIG_MIPS_MIRAGE) += db1x00/ 18obj-$(CONFIG_MIPS_MIRAGE) += db1x00/
19
20EXTRA_CFLAGS += -Werror
diff --git a/arch/mips/alchemy/devboards/bcsr.c b/arch/mips/alchemy/devboards/bcsr.c
new file mode 100644
index 000000000000..3bc4fd2155d7
--- /dev/null
+++ b/arch/mips/alchemy/devboards/bcsr.c
@@ -0,0 +1,148 @@
1/*
2 * bcsr.h -- Db1xxx/Pb1xxx Devboard CPLD registers ("BCSR") abstraction.
3 *
4 * All Alchemy development boards (except, of course, the weird PB1000)
5 * have a few registers in a CPLD with standardised layout; they mostly
6 * only differ in base address.
7 * All registers are 16bits wide with 32bit spacing.
8 */
9
10#include <linux/interrupt.h>
11#include <linux/module.h>
12#include <linux/spinlock.h>
13#include <asm/addrspace.h>
14#include <asm/io.h>
15#include <asm/mach-db1x00/bcsr.h>
16
17static struct bcsr_reg {
18 void __iomem *raddr;
19 spinlock_t lock;
20} bcsr_regs[BCSR_CNT];
21
22static void __iomem *bcsr_virt; /* KSEG1 addr of BCSR base */
23static int bcsr_csc_base; /* linux-irq of first cascaded irq */
24
25void __init bcsr_init(unsigned long bcsr1_phys, unsigned long bcsr2_phys)
26{
27 int i;
28
29 bcsr1_phys = KSEG1ADDR(CPHYSADDR(bcsr1_phys));
30 bcsr2_phys = KSEG1ADDR(CPHYSADDR(bcsr2_phys));
31
32 bcsr_virt = (void __iomem *)bcsr1_phys;
33
34 for (i = 0; i < BCSR_CNT; i++) {
35 if (i >= BCSR_HEXLEDS)
36 bcsr_regs[i].raddr = (void __iomem *)bcsr2_phys +
37 (0x04 * (i - BCSR_HEXLEDS));
38 else
39 bcsr_regs[i].raddr = (void __iomem *)bcsr1_phys +
40 (0x04 * i);
41
42 spin_lock_init(&bcsr_regs[i].lock);
43 }
44}
45
46unsigned short bcsr_read(enum bcsr_id reg)
47{
48 unsigned short r;
49 unsigned long flags;
50
51 spin_lock_irqsave(&bcsr_regs[reg].lock, flags);
52 r = __raw_readw(bcsr_regs[reg].raddr);
53 spin_unlock_irqrestore(&bcsr_regs[reg].lock, flags);
54 return r;
55}
56EXPORT_SYMBOL_GPL(bcsr_read);
57
58void bcsr_write(enum bcsr_id reg, unsigned short val)
59{
60 unsigned long flags;
61
62 spin_lock_irqsave(&bcsr_regs[reg].lock, flags);
63 __raw_writew(val, bcsr_regs[reg].raddr);
64 wmb();
65 spin_unlock_irqrestore(&bcsr_regs[reg].lock, flags);
66}
67EXPORT_SYMBOL_GPL(bcsr_write);
68
69void bcsr_mod(enum bcsr_id reg, unsigned short clr, unsigned short set)
70{
71 unsigned short r;
72 unsigned long flags;
73
74 spin_lock_irqsave(&bcsr_regs[reg].lock, flags);
75 r = __raw_readw(bcsr_regs[reg].raddr);
76 r &= ~clr;
77 r |= set;
78 __raw_writew(r, bcsr_regs[reg].raddr);
79 wmb();
80 spin_unlock_irqrestore(&bcsr_regs[reg].lock, flags);
81}
82EXPORT_SYMBOL_GPL(bcsr_mod);
83
84/*
85 * DB1200/PB1200 CPLD IRQ muxer
86 */
87static void bcsr_csc_handler(unsigned int irq, struct irq_desc *d)
88{
89 unsigned short bisr = __raw_readw(bcsr_virt + BCSR_REG_INTSTAT);
90
91 for ( ; bisr; bisr &= bisr - 1)
92 generic_handle_irq(bcsr_csc_base + __ffs(bisr));
93}
94
95/* NOTE: both the enable and mask bits must be cleared, otherwise the
96 * CPLD generates tons of spurious interrupts (at least on my DB1200).
97 * -- mlau
98 */
99static void bcsr_irq_mask(unsigned int irq_nr)
100{
101 unsigned short v = 1 << (irq_nr - bcsr_csc_base);
102 __raw_writew(v, bcsr_virt + BCSR_REG_INTCLR);
103 __raw_writew(v, bcsr_virt + BCSR_REG_MASKCLR);
104 wmb();
105}
106
107static void bcsr_irq_maskack(unsigned int irq_nr)
108{
109 unsigned short v = 1 << (irq_nr - bcsr_csc_base);
110 __raw_writew(v, bcsr_virt + BCSR_REG_INTCLR);
111 __raw_writew(v, bcsr_virt + BCSR_REG_MASKCLR);
112 __raw_writew(v, bcsr_virt + BCSR_REG_INTSTAT); /* ack */
113 wmb();
114}
115
116static void bcsr_irq_unmask(unsigned int irq_nr)
117{
118 unsigned short v = 1 << (irq_nr - bcsr_csc_base);
119 __raw_writew(v, bcsr_virt + BCSR_REG_INTSET);
120 __raw_writew(v, bcsr_virt + BCSR_REG_MASKSET);
121 wmb();
122}
123
124static struct irq_chip bcsr_irq_type = {
125 .name = "CPLD",
126 .mask = bcsr_irq_mask,
127 .mask_ack = bcsr_irq_maskack,
128 .unmask = bcsr_irq_unmask,
129};
130
131void __init bcsr_init_irq(int csc_start, int csc_end, int hook_irq)
132{
133 unsigned int irq;
134
135 /* mask & disable & ack all */
136 __raw_writew(0xffff, bcsr_virt + BCSR_REG_INTCLR);
137 __raw_writew(0xffff, bcsr_virt + BCSR_REG_MASKCLR);
138 __raw_writew(0xffff, bcsr_virt + BCSR_REG_INTSTAT);
139 wmb();
140
141 bcsr_csc_base = csc_start;
142
143 for (irq = csc_start; irq <= csc_end; irq++)
144 set_irq_chip_and_handler_name(irq, &bcsr_irq_type,
145 handle_level_irq, "level");
146
147 set_irq_chained_handler(hook_irq, bcsr_csc_handler);
148}
diff --git a/arch/mips/alchemy/devboards/db1200/Makefile b/arch/mips/alchemy/devboards/db1200/Makefile
new file mode 100644
index 000000000000..17840a5e2738
--- /dev/null
+++ b/arch/mips/alchemy/devboards/db1200/Makefile
@@ -0,0 +1 @@
obj-y += setup.o platform.o
diff --git a/arch/mips/alchemy/devboards/db1200/platform.c b/arch/mips/alchemy/devboards/db1200/platform.c
new file mode 100644
index 000000000000..3cb95a98ab31
--- /dev/null
+++ b/arch/mips/alchemy/devboards/db1200/platform.c
@@ -0,0 +1,561 @@
1/*
2 * DBAu1200 board platform device registration
3 *
4 * Copyright (C) 2008-2009 Manuel Lauss
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21#include <linux/dma-mapping.h>
22#include <linux/gpio.h>
23#include <linux/i2c.h>
24#include <linux/init.h>
25#include <linux/io.h>
26#include <linux/leds.h>
27#include <linux/mmc/host.h>
28#include <linux/mtd/mtd.h>
29#include <linux/mtd/nand.h>
30#include <linux/mtd/partitions.h>
31#include <linux/platform_device.h>
32#include <linux/serial_8250.h>
33#include <linux/spi/spi.h>
34#include <linux/spi/flash.h>
35#include <linux/smc91x.h>
36
37#include <asm/mach-au1x00/au1100_mmc.h>
38#include <asm/mach-au1x00/au1xxx_dbdma.h>
39#include <asm/mach-au1x00/au1550_spi.h>
40#include <asm/mach-db1x00/bcsr.h>
41#include <asm/mach-db1x00/db1200.h>
42
43#include "../platform.h"
44
45static struct mtd_partition db1200_spiflash_parts[] = {
46 {
47 .name = "DB1200 SPI flash",
48 .offset = 0,
49 .size = MTDPART_SIZ_FULL,
50 },
51};
52
53static struct flash_platform_data db1200_spiflash_data = {
54 .name = "s25fl001",
55 .parts = db1200_spiflash_parts,
56 .nr_parts = ARRAY_SIZE(db1200_spiflash_parts),
57 .type = "m25p10",
58};
59
60static struct spi_board_info db1200_spi_devs[] __initdata = {
61 {
62 /* TI TMP121AIDBVR temp sensor */
63 .modalias = "tmp121",
64 .max_speed_hz = 2000000,
65 .bus_num = 0,
66 .chip_select = 0,
67 .mode = 0,
68 },
69 {
70 /* Spansion S25FL001D0FMA SPI flash */
71 .modalias = "m25p80",
72 .max_speed_hz = 50000000,
73 .bus_num = 0,
74 .chip_select = 1,
75 .mode = 0,
76 .platform_data = &db1200_spiflash_data,
77 },
78};
79
80static struct i2c_board_info db1200_i2c_devs[] __initdata = {
81 {
82 /* AT24C04-10 I2C eeprom */
83 I2C_BOARD_INFO("24c04", 0x52),
84 },
85 {
86 /* Philips NE1619 temp/voltage sensor (adm1025 drv) */
87 I2C_BOARD_INFO("ne1619", 0x2d),
88 },
89 {
90 /* I2S audio codec WM8731 */
91 I2C_BOARD_INFO("wm8731", 0x1b),
92 },
93};
94
95/**********************************************************************/
96
97static void au1200_nand_cmd_ctrl(struct mtd_info *mtd, int cmd,
98 unsigned int ctrl)
99{
100 struct nand_chip *this = mtd->priv;
101 unsigned long ioaddr = (unsigned long)this->IO_ADDR_W;
102
103 ioaddr &= 0xffffff00;
104
105 if (ctrl & NAND_CLE) {
106 ioaddr += MEM_STNAND_CMD;
107 } else if (ctrl & NAND_ALE) {
108 ioaddr += MEM_STNAND_ADDR;
109 } else {
110 /* assume we want to r/w real data by default */
111 ioaddr += MEM_STNAND_DATA;
112 }
113 this->IO_ADDR_R = this->IO_ADDR_W = (void __iomem *)ioaddr;
114 if (cmd != NAND_CMD_NONE) {
115 __raw_writeb(cmd, this->IO_ADDR_W);
116 wmb();
117 }
118}
119
120static int au1200_nand_device_ready(struct mtd_info *mtd)
121{
122 return __raw_readl((void __iomem *)MEM_STSTAT) & 1;
123}
124
125static const char *db1200_part_probes[] = { "cmdlinepart", NULL };
126
127static struct mtd_partition db1200_nand_parts[] = {
128 {
129 .name = "NAND FS 0",
130 .offset = 0,
131 .size = 8 * 1024 * 1024,
132 },
133 {
134 .name = "NAND FS 1",
135 .offset = MTDPART_OFS_APPEND,
136 .size = MTDPART_SIZ_FULL
137 },
138};
139
140struct platform_nand_data db1200_nand_platdata = {
141 .chip = {
142 .nr_chips = 1,
143 .chip_offset = 0,
144 .nr_partitions = ARRAY_SIZE(db1200_nand_parts),
145 .partitions = db1200_nand_parts,
146 .chip_delay = 20,
147 .part_probe_types = db1200_part_probes,
148 },
149 .ctrl = {
150 .dev_ready = au1200_nand_device_ready,
151 .cmd_ctrl = au1200_nand_cmd_ctrl,
152 },
153};
154
155static struct resource db1200_nand_res[] = {
156 [0] = {
157 .start = DB1200_NAND_PHYS_ADDR,
158 .end = DB1200_NAND_PHYS_ADDR + 0xff,
159 .flags = IORESOURCE_MEM,
160 },
161};
162
163static struct platform_device db1200_nand_dev = {
164 .name = "gen_nand",
165 .num_resources = ARRAY_SIZE(db1200_nand_res),
166 .resource = db1200_nand_res,
167 .id = -1,
168 .dev = {
169 .platform_data = &db1200_nand_platdata,
170 }
171};
172
173/**********************************************************************/
174
175static struct smc91x_platdata db1200_eth_data = {
176 .flags = SMC91X_NOWAIT | SMC91X_USE_16BIT,
177 .leda = RPC_LED_100_10,
178 .ledb = RPC_LED_TX_RX,
179};
180
181static struct resource db1200_eth_res[] = {
182 [0] = {
183 .start = DB1200_ETH_PHYS_ADDR,
184 .end = DB1200_ETH_PHYS_ADDR + 0xf,
185 .flags = IORESOURCE_MEM,
186 },
187 [1] = {
188 .start = DB1200_ETH_INT,
189 .end = DB1200_ETH_INT,
190 .flags = IORESOURCE_IRQ,
191 },
192};
193
194static struct platform_device db1200_eth_dev = {
195 .dev = {
196 .platform_data = &db1200_eth_data,
197 },
198 .name = "smc91x",
199 .id = -1,
200 .num_resources = ARRAY_SIZE(db1200_eth_res),
201 .resource = db1200_eth_res,
202};
203
204/**********************************************************************/
205
206static struct resource db1200_ide_res[] = {
207 [0] = {
208 .start = DB1200_IDE_PHYS_ADDR,
209 .end = DB1200_IDE_PHYS_ADDR + DB1200_IDE_PHYS_LEN - 1,
210 .flags = IORESOURCE_MEM,
211 },
212 [1] = {
213 .start = DB1200_IDE_INT,
214 .end = DB1200_IDE_INT,
215 .flags = IORESOURCE_IRQ,
216 }
217};
218
219static u64 ide_dmamask = DMA_32BIT_MASK;
220
221static struct platform_device db1200_ide_dev = {
222 .name = "au1200-ide",
223 .id = 0,
224 .dev = {
225 .dma_mask = &ide_dmamask,
226 .coherent_dma_mask = DMA_32BIT_MASK,
227 },
228 .num_resources = ARRAY_SIZE(db1200_ide_res),
229 .resource = db1200_ide_res,
230};
231
232/**********************************************************************/
233
234static struct platform_device db1200_rtc_dev = {
235 .name = "rtc-au1xxx",
236 .id = -1,
237};
238
239/**********************************************************************/
240
241/* SD carddetects: they're supposed to be edge-triggered, but ack
242 * doesn't seem to work (CPLD Rev 2). Instead, the screaming one
243 * is disabled and its counterpart enabled. The 500ms timeout is
244 * because the carddetect isn't debounced in hardware.
245 */
246static irqreturn_t db1200_mmc_cd(int irq, void *ptr)
247{
248 void(*mmc_cd)(struct mmc_host *, unsigned long);
249
250 if (irq == DB1200_SD0_INSERT_INT) {
251 disable_irq_nosync(DB1200_SD0_INSERT_INT);
252 enable_irq(DB1200_SD0_EJECT_INT);
253 } else {
254 disable_irq_nosync(DB1200_SD0_EJECT_INT);
255 enable_irq(DB1200_SD0_INSERT_INT);
256 }
257
258 /* link against CONFIG_MMC=m */
259 mmc_cd = symbol_get(mmc_detect_change);
260 if (mmc_cd) {
261 mmc_cd(ptr, msecs_to_jiffies(500));
262 symbol_put(mmc_detect_change);
263 }
264
265 return IRQ_HANDLED;
266}
267
268static int db1200_mmc_cd_setup(void *mmc_host, int en)
269{
270 int ret;
271
272 if (en) {
273 ret = request_irq(DB1200_SD0_INSERT_INT, db1200_mmc_cd,
274 IRQF_DISABLED, "sd_insert", mmc_host);
275 if (ret)
276 goto out;
277
278 ret = request_irq(DB1200_SD0_EJECT_INT, db1200_mmc_cd,
279 IRQF_DISABLED, "sd_eject", mmc_host);
280 if (ret) {
281 free_irq(DB1200_SD0_INSERT_INT, mmc_host);
282 goto out;
283 }
284
285 if (bcsr_read(BCSR_SIGSTAT) & BCSR_INT_SD0INSERT)
286 enable_irq(DB1200_SD0_EJECT_INT);
287 else
288 enable_irq(DB1200_SD0_INSERT_INT);
289
290 } else {
291 free_irq(DB1200_SD0_INSERT_INT, mmc_host);
292 free_irq(DB1200_SD0_EJECT_INT, mmc_host);
293 }
294 ret = 0;
295out:
296 return ret;
297}
298
299static void db1200_mmc_set_power(void *mmc_host, int state)
300{
301 if (state) {
302 bcsr_mod(BCSR_BOARD, 0, BCSR_BOARD_SD0PWR);
303 msleep(400); /* stabilization time */
304 } else
305 bcsr_mod(BCSR_BOARD, BCSR_BOARD_SD0PWR, 0);
306}
307
308static int db1200_mmc_card_readonly(void *mmc_host)
309{
310 return (bcsr_read(BCSR_STATUS) & BCSR_STATUS_SD0WP) ? 1 : 0;
311}
312
313static int db1200_mmc_card_inserted(void *mmc_host)
314{
315 return (bcsr_read(BCSR_SIGSTAT) & BCSR_INT_SD0INSERT) ? 1 : 0;
316}
317
318static void db1200_mmcled_set(struct led_classdev *led,
319 enum led_brightness brightness)
320{
321 if (brightness != LED_OFF)
322 bcsr_mod(BCSR_LEDS, BCSR_LEDS_LED0, 0);
323 else
324 bcsr_mod(BCSR_LEDS, 0, BCSR_LEDS_LED0);
325}
326
327static struct led_classdev db1200_mmc_led = {
328 .brightness_set = db1200_mmcled_set,
329};
330
331/* needed by arch/mips/alchemy/common/platform.c */
332struct au1xmmc_platform_data au1xmmc_platdata[] = {
333 [0] = {
334 .cd_setup = db1200_mmc_cd_setup,
335 .set_power = db1200_mmc_set_power,
336 .card_inserted = db1200_mmc_card_inserted,
337 .card_readonly = db1200_mmc_card_readonly,
338 .led = &db1200_mmc_led,
339 },
340};
341
342/**********************************************************************/
343
344static struct resource au1200_psc0_res[] = {
345 [0] = {
346 .start = PSC0_PHYS_ADDR,
347 .end = PSC0_PHYS_ADDR + 0x000fffff,
348 .flags = IORESOURCE_MEM,
349 },
350 [1] = {
351 .start = AU1200_PSC0_INT,
352 .end = AU1200_PSC0_INT,
353 .flags = IORESOURCE_IRQ,
354 },
355 [2] = {
356 .start = DSCR_CMD0_PSC0_TX,
357 .end = DSCR_CMD0_PSC0_TX,
358 .flags = IORESOURCE_DMA,
359 },
360 [3] = {
361 .start = DSCR_CMD0_PSC0_RX,
362 .end = DSCR_CMD0_PSC0_RX,
363 .flags = IORESOURCE_DMA,
364 },
365};
366
367static struct platform_device db1200_i2c_dev = {
368 .name = "au1xpsc_smbus",
369 .id = 0, /* bus number */
370 .num_resources = ARRAY_SIZE(au1200_psc0_res),
371 .resource = au1200_psc0_res,
372};
373
374static void db1200_spi_cs_en(struct au1550_spi_info *spi, int cs, int pol)
375{
376 if (cs)
377 bcsr_mod(BCSR_RESETS, 0, BCSR_RESETS_SPISEL);
378 else
379 bcsr_mod(BCSR_RESETS, BCSR_RESETS_SPISEL, 0);
380}
381
382static struct au1550_spi_info db1200_spi_platdata = {
383 .mainclk_hz = 50000000, /* PSC0 clock */
384 .num_chipselect = 2,
385 .activate_cs = db1200_spi_cs_en,
386};
387
388static u64 spi_dmamask = DMA_32BIT_MASK;
389
390static struct platform_device db1200_spi_dev = {
391 .dev = {
392 .dma_mask = &spi_dmamask,
393 .coherent_dma_mask = DMA_32BIT_MASK,
394 .platform_data = &db1200_spi_platdata,
395 },
396 .name = "au1550-spi",
397 .id = 0, /* bus number */
398 .num_resources = ARRAY_SIZE(au1200_psc0_res),
399 .resource = au1200_psc0_res,
400};
401
402static struct resource au1200_psc1_res[] = {
403 [0] = {
404 .start = PSC1_PHYS_ADDR,
405 .end = PSC1_PHYS_ADDR + 0x000fffff,
406 .flags = IORESOURCE_MEM,
407 },
408 [1] = {
409 .start = AU1200_PSC1_INT,
410 .end = AU1200_PSC1_INT,
411 .flags = IORESOURCE_IRQ,
412 },
413 [2] = {
414 .start = DSCR_CMD0_PSC1_TX,
415 .end = DSCR_CMD0_PSC1_TX,
416 .flags = IORESOURCE_DMA,
417 },
418 [3] = {
419 .start = DSCR_CMD0_PSC1_RX,
420 .end = DSCR_CMD0_PSC1_RX,
421 .flags = IORESOURCE_DMA,
422 },
423};
424
425static struct platform_device db1200_audio_dev = {
426 /* name assigned later based on switch setting */
427 .id = 1, /* PSC ID */
428 .num_resources = ARRAY_SIZE(au1200_psc1_res),
429 .resource = au1200_psc1_res,
430};
431
432static struct platform_device *db1200_devs[] __initdata = {
433 NULL, /* PSC0, selected by S6.8 */
434 &db1200_ide_dev,
435 &db1200_eth_dev,
436 &db1200_rtc_dev,
437 &db1200_nand_dev,
438 &db1200_audio_dev,
439};
440
441static int __init db1200_dev_init(void)
442{
443 unsigned long pfc;
444 unsigned short sw;
445 int swapped;
446
447 i2c_register_board_info(0, db1200_i2c_devs,
448 ARRAY_SIZE(db1200_i2c_devs));
449 spi_register_board_info(db1200_spi_devs,
450 ARRAY_SIZE(db1200_i2c_devs));
451
452 /* SWITCHES: S6.8 I2C/SPI selector (OFF=I2C ON=SPI)
453 * S6.7 AC97/I2S selector (OFF=AC97 ON=I2S)
454 */
455
456 /* NOTE: GPIO215 controls OTG VBUS supply. In SPI mode however
457 * this pin is claimed by PSC0 (unused though, but pinmux doesn't
458 * allow to free it without crippling the SPI interface).
459 * As a result, in SPI mode, OTG simply won't work (PSC0 uses
460 * it as an input pin which is pulled high on the boards).
461 */
462 pfc = __raw_readl((void __iomem *)SYS_PINFUNC) & ~SYS_PINFUNC_P0A;
463
464 /* switch off OTG VBUS supply */
465 gpio_request(215, "otg-vbus");
466 gpio_direction_output(215, 1);
467
468 printk(KERN_INFO "DB1200 device configuration:\n");
469
470 sw = bcsr_read(BCSR_SWITCHES);
471 if (sw & BCSR_SWITCHES_DIP_8) {
472 db1200_devs[0] = &db1200_i2c_dev;
473 bcsr_mod(BCSR_RESETS, BCSR_RESETS_PSC0MUX, 0);
474
475 pfc |= (2 << 17); /* GPIO2 block owns GPIO215 */
476
477 printk(KERN_INFO " S6.8 OFF: PSC0 mode I2C\n");
478 printk(KERN_INFO " OTG port VBUS supply available!\n");
479 } else {
480 db1200_devs[0] = &db1200_spi_dev;
481 bcsr_mod(BCSR_RESETS, 0, BCSR_RESETS_PSC0MUX);
482
483 pfc |= (1 << 17); /* PSC0 owns GPIO215 */
484
485 printk(KERN_INFO " S6.8 ON : PSC0 mode SPI\n");
486 printk(KERN_INFO " OTG port VBUS supply disabled\n");
487 }
488 __raw_writel(pfc, (void __iomem *)SYS_PINFUNC);
489 wmb();
490
491 /* Audio: DIP7 selects I2S(0)/AC97(1), but need I2C for I2S!
492 * so: DIP7=1 || DIP8=0 => AC97, DIP7=0 && DIP8=1 => I2S
493 */
494 sw &= BCSR_SWITCHES_DIP_8 | BCSR_SWITCHES_DIP_7;
495 if (sw == BCSR_SWITCHES_DIP_8) {
496 bcsr_mod(BCSR_RESETS, 0, BCSR_RESETS_PSC1MUX);
497 db1200_audio_dev.name = "au1xpsc_i2s";
498 printk(KERN_INFO " S6.7 ON : PSC1 mode I2S\n");
499 } else {
500 bcsr_mod(BCSR_RESETS, BCSR_RESETS_PSC1MUX, 0);
501 db1200_audio_dev.name = "au1xpsc_ac97";
502 printk(KERN_INFO " S6.7 OFF: PSC1 mode AC97\n");
503 }
504
505 /* Audio PSC clock is supplied externally. (FIXME: platdata!!) */
506 __raw_writel(PSC_SEL_CLK_SERCLK,
507 (void __iomem *)KSEG1ADDR(PSC1_PHYS_ADDR) + PSC_SEL_OFFSET);
508 wmb();
509
510 db1x_register_pcmcia_socket(PCMCIA_ATTR_PHYS_ADDR,
511 PCMCIA_ATTR_PHYS_ADDR + 0x000400000 - 1,
512 PCMCIA_MEM_PHYS_ADDR,
513 PCMCIA_MEM_PHYS_ADDR + 0x000400000 - 1,
514 PCMCIA_IO_PHYS_ADDR,
515 PCMCIA_IO_PHYS_ADDR + 0x000010000 - 1,
516 DB1200_PC0_INT,
517 DB1200_PC0_INSERT_INT,
518 /*DB1200_PC0_STSCHG_INT*/0,
519 DB1200_PC0_EJECT_INT,
520 0);
521
522 db1x_register_pcmcia_socket(PCMCIA_ATTR_PHYS_ADDR + 0x004000000,
523 PCMCIA_ATTR_PHYS_ADDR + 0x004400000 - 1,
524 PCMCIA_MEM_PHYS_ADDR + 0x004000000,
525 PCMCIA_MEM_PHYS_ADDR + 0x004400000 - 1,
526 PCMCIA_IO_PHYS_ADDR + 0x004000000,
527 PCMCIA_IO_PHYS_ADDR + 0x004010000 - 1,
528 DB1200_PC1_INT,
529 DB1200_PC1_INSERT_INT,
530 /*DB1200_PC1_STSCHG_INT*/0,
531 DB1200_PC1_EJECT_INT,
532 1);
533
534 swapped = bcsr_read(BCSR_STATUS) & BCSR_STATUS_DB1200_SWAPBOOT;
535 db1x_register_norflash(64 << 20, 2, swapped);
536
537 return platform_add_devices(db1200_devs, ARRAY_SIZE(db1200_devs));
538}
539device_initcall(db1200_dev_init);
540
541/* au1200fb calls these: STERBT EINEN TRAGISCHEN TOD!!! */
542int board_au1200fb_panel(void)
543{
544 return (bcsr_read(BCSR_SWITCHES) >> 8) & 0x0f;
545}
546
547int board_au1200fb_panel_init(void)
548{
549 /* Apply power */
550 bcsr_mod(BCSR_BOARD, 0, BCSR_BOARD_LCDVEE | BCSR_BOARD_LCDVDD |
551 BCSR_BOARD_LCDBL);
552 return 0;
553}
554
555int board_au1200fb_panel_shutdown(void)
556{
557 /* Remove power */
558 bcsr_mod(BCSR_BOARD, BCSR_BOARD_LCDVEE | BCSR_BOARD_LCDVDD |
559 BCSR_BOARD_LCDBL, 0);
560 return 0;
561}
diff --git a/arch/mips/alchemy/devboards/db1200/setup.c b/arch/mips/alchemy/devboards/db1200/setup.c
new file mode 100644
index 000000000000..379536e3abd1
--- /dev/null
+++ b/arch/mips/alchemy/devboards/db1200/setup.c
@@ -0,0 +1,118 @@
1/*
2 * Alchemy/AMD/RMI DB1200 board setup.
3 *
4 * Licensed under the terms outlined in the file COPYING in the root of
5 * this source archive.
6 */
7
8#include <linux/init.h>
9#include <linux/interrupt.h>
10#include <linux/io.h>
11#include <linux/kernel.h>
12#include <asm/mach-au1x00/au1000.h>
13#include <asm/mach-db1x00/bcsr.h>
14#include <asm/mach-db1x00/db1200.h>
15
16const char *get_system_type(void)
17{
18 return "Alchemy Db1200";
19}
20
21void __init board_setup(void)
22{
23 unsigned long freq0, clksrc, div, pfc;
24 unsigned short whoami;
25
26 bcsr_init(DB1200_BCSR_PHYS_ADDR,
27 DB1200_BCSR_PHYS_ADDR + DB1200_BCSR_HEXLED_OFS);
28
29 whoami = bcsr_read(BCSR_WHOAMI);
30 printk(KERN_INFO "Alchemy/AMD/RMI DB1200 Board, CPLD Rev %d"
31 " Board-ID %d Daughtercard ID %d\n",
32 (whoami >> 4) & 0xf, (whoami >> 8) & 0xf, whoami & 0xf);
33
34 /* SMBus/SPI on PSC0, Audio on PSC1 */
35 pfc = __raw_readl((void __iomem *)SYS_PINFUNC);
36 pfc &= ~(SYS_PINFUNC_P0A | SYS_PINFUNC_P0B);
37 pfc &= ~(SYS_PINFUNC_P1A | SYS_PINFUNC_P1B | SYS_PINFUNC_FS3);
38 pfc |= SYS_PINFUNC_P1C; /* SPI is configured later */
39 __raw_writel(pfc, (void __iomem *)SYS_PINFUNC);
40 wmb();
41
42 /* Clock configurations: PSC0: ~50MHz via Clkgen0, derived from
43 * CPU clock; all other clock generators off/unused.
44 */
45 div = (get_au1x00_speed() + 25000000) / 50000000;
46 if (div & 1)
47 div++;
48 div = ((div >> 1) - 1) & 0xff;
49
50 freq0 = div << SYS_FC_FRDIV0_BIT;
51 __raw_writel(freq0, (void __iomem *)SYS_FREQCTRL0);
52 wmb();
53 freq0 |= SYS_FC_FE0; /* enable F0 */
54 __raw_writel(freq0, (void __iomem *)SYS_FREQCTRL0);
55 wmb();
56
57 /* psc0_intclk comes 1:1 from F0 */
58 clksrc = SYS_CS_MUX_FQ0 << SYS_CS_ME0_BIT;
59 __raw_writel(clksrc, (void __iomem *)SYS_CLKSRC);
60 wmb();
61}
62
63/* use the hexleds to count the number of times the cpu has entered
64 * wait, the dots to indicate whether the CPU is currently idle or
65 * active (dots off = sleeping, dots on = working) for cases where
66 * the number doesn't change for a long(er) period of time.
67 */
68static void db1200_wait(void)
69{
70 __asm__(" .set push \n"
71 " .set mips3 \n"
72 " .set noreorder \n"
73 " cache 0x14, 0(%0) \n"
74 " cache 0x14, 32(%0) \n"
75 " cache 0x14, 64(%0) \n"
76 /* dots off: we're about to call wait */
77 " lui $26, 0xb980 \n"
78 " ori $27, $0, 3 \n"
79 " sb $27, 0x18($26) \n"
80 " sync \n"
81 " nop \n"
82 " wait \n"
83 " nop \n"
84 " nop \n"
85 " nop \n"
86 " nop \n"
87 " nop \n"
88 /* dots on: there's work to do, increment cntr */
89 " lui $26, 0xb980 \n"
90 " sb $0, 0x18($26) \n"
91 " lui $26, 0xb9c0 \n"
92 " lb $27, 0($26) \n"
93 " addiu $27, $27, 1 \n"
94 " sb $27, 0($26) \n"
95 " sync \n"
96 " .set pop \n"
97 : : "r" (db1200_wait));
98}
99
100static int __init db1200_arch_init(void)
101{
102 /* GPIO7 is low-level triggered CPLD cascade */
103 set_irq_type(AU1200_GPIO7_INT, IRQF_TRIGGER_LOW);
104 bcsr_init_irq(DB1200_INT_BEGIN, DB1200_INT_END, AU1200_GPIO7_INT);
105
106 /* do not autoenable these: CPLD has broken edge int handling,
107 * and the CD handler setup requires manual enabling to work
108 * around that.
109 */
110 irq_to_desc(DB1200_SD0_INSERT_INT)->status |= IRQ_NOAUTOEN;
111 irq_to_desc(DB1200_SD0_EJECT_INT)->status |= IRQ_NOAUTOEN;
112
113 if (cpu_wait)
114 cpu_wait = db1200_wait;
115
116 return 0;
117}
118arch_initcall(db1200_arch_init);
diff --git a/arch/mips/alchemy/devboards/db1x00/Makefile b/arch/mips/alchemy/devboards/db1x00/Makefile
index 432241ab8677..613c0c0c8be9 100644
--- a/arch/mips/alchemy/devboards/db1x00/Makefile
+++ b/arch/mips/alchemy/devboards/db1x00/Makefile
@@ -5,4 +5,4 @@
5# Makefile for the Alchemy Semiconductor DBAu1xx0 boards. 5# Makefile for the Alchemy Semiconductor DBAu1xx0 boards.
6# 6#
7 7
8obj-y := board_setup.o irqmap.o 8obj-y := board_setup.o platform.o
diff --git a/arch/mips/alchemy/devboards/db1x00/board_setup.c b/arch/mips/alchemy/devboards/db1x00/board_setup.c
index de30d8ea7176..50c9bef99daa 100644
--- a/arch/mips/alchemy/devboards/db1x00/board_setup.c
+++ b/arch/mips/alchemy/devboards/db1x00/board_setup.c
@@ -29,59 +29,139 @@
29 29
30#include <linux/gpio.h> 30#include <linux/gpio.h>
31#include <linux/init.h> 31#include <linux/init.h>
32#include <linux/interrupt.h>
33#include <linux/pm.h>
32 34
33#include <asm/mach-au1x00/au1000.h> 35#include <asm/mach-au1x00/au1000.h>
36#include <asm/mach-au1x00/au1xxx_eth.h>
34#include <asm/mach-db1x00/db1x00.h> 37#include <asm/mach-db1x00/db1x00.h>
38#include <asm/mach-db1x00/bcsr.h>
39#include <asm/reboot.h>
35 40
36#include <prom.h> 41#include <prom.h>
37 42
43#ifdef CONFIG_MIPS_DB1500
44char irq_tab_alchemy[][5] __initdata = {
45 [12] = { -1, AU1500_PCI_INTA, 0xff, 0xff, 0xff }, /* IDSEL 12 - HPT371 */
46 [13] = { -1, AU1500_PCI_INTA, AU1500_PCI_INTB, AU1500_PCI_INTC, AU1500_PCI_INTD }, /* IDSEL 13 - PCI slot */
47};
48
49#endif
38 50
39static BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR; 51
52#ifdef CONFIG_MIPS_DB1550
53char irq_tab_alchemy[][5] __initdata = {
54 [11] = { -1, AU1550_PCI_INTC, 0xff, 0xff, 0xff }, /* IDSEL 11 - on-board HPT371 */
55 [12] = { -1, AU1550_PCI_INTB, AU1550_PCI_INTC, AU1550_PCI_INTD, AU1550_PCI_INTA }, /* IDSEL 12 - PCI slot 2 (left) */
56 [13] = { -1, AU1550_PCI_INTA, AU1550_PCI_INTB, AU1550_PCI_INTC, AU1550_PCI_INTD }, /* IDSEL 13 - PCI slot 1 (right) */
57};
58#endif
59
60
61#ifdef CONFIG_MIPS_BOSPORUS
62char irq_tab_alchemy[][5] __initdata = {
63 [11] = { -1, AU1500_PCI_INTA, AU1500_PCI_INTB, 0xff, 0xff }, /* IDSEL 11 - miniPCI */
64 [12] = { -1, AU1500_PCI_INTA, 0xff, 0xff, 0xff }, /* IDSEL 12 - SN1741 */
65 [13] = { -1, AU1500_PCI_INTA, AU1500_PCI_INTB, AU1500_PCI_INTC, AU1500_PCI_INTD }, /* IDSEL 13 - PCI slot */
66};
67
68/*
69 * Micrel/Kendin 5 port switch attached to MAC0,
70 * MAC0 is associated with PHY address 5 (== WAN port)
71 * MAC1 is not associated with any PHY, since it's connected directly
72 * to the switch.
73 * no interrupts are used
74 */
75static struct au1000_eth_platform_data eth0_pdata = {
76 .phy_static_config = 1,
77 .phy_addr = 5,
78};
79
80static void bosporus_power_off(void)
81{
82 printk(KERN_INFO "It's now safe to turn off power\n");
83 while (1)
84 asm volatile (".set mips3 ; wait ; .set mips0");
85}
40 86
41const char *get_system_type(void) 87const char *get_system_type(void)
42{ 88{
43#ifdef CONFIG_MIPS_BOSPORUS
44 return "Alchemy Bosporus Gateway Reference"; 89 return "Alchemy Bosporus Gateway Reference";
45#else 90}
46 return "Alchemy Db1x00";
47#endif 91#endif
92
93
94#ifdef CONFIG_MIPS_MIRAGE
95char irq_tab_alchemy[][5] __initdata = {
96 [11] = { -1, AU1500_PCI_INTD, 0xff, 0xff, 0xff }, /* IDSEL 11 - SMI VGX */
97 [12] = { -1, 0xff, 0xff, AU1500_PCI_INTC, 0xff }, /* IDSEL 12 - PNX1300 */
98 [13] = { -1, AU1500_PCI_INTA, AU1500_PCI_INTB, 0xff, 0xff }, /* IDSEL 13 - miniPCI */
99};
100
101static void mirage_power_off(void)
102{
103 alchemy_gpio_direction_output(210, 1);
104}
105
106const char *get_system_type(void)
107{
108 return "Alchemy Mirage";
109}
110#endif
111
112
113#if defined(CONFIG_MIPS_BOSPORUS) || defined(CONFIG_MIPS_MIRAGE)
114static void mips_softreset(void)
115{
116 asm volatile ("jr\t%0" : : "r"(0xbfc00000));
48} 117}
49 118
50void board_reset(void) 119#else
120
121const char *get_system_type(void)
51{ 122{
52 /* Hit BCSR.SW_RESET[RESET] */ 123 return "Alchemy Db1x00";
53 bcsr->swreset = 0x0000;
54} 124}
125#endif
126
55 127
56void __init board_setup(void) 128void __init board_setup(void)
57{ 129{
58 u32 pin_func = 0; 130 unsigned long bcsr1, bcsr2;
59 char *argptr; 131 u32 pin_func;
60 132
61 argptr = prom_getcmdline(); 133 bcsr1 = DB1000_BCSR_PHYS_ADDR;
62#ifdef CONFIG_SERIAL_8250_CONSOLE 134 bcsr2 = DB1000_BCSR_PHYS_ADDR + DB1000_BCSR_HEXLED_OFS;
63 argptr = strstr(argptr, "console="); 135
64 if (argptr == NULL) { 136 pin_func = 0;
65 argptr = prom_getcmdline(); 137
66 strcat(argptr, " console=ttyS0,115200"); 138#ifdef CONFIG_MIPS_DB1000
67 } 139 printk(KERN_INFO "AMD Alchemy Au1000/Db1000 Board\n");
140#endif
141#ifdef CONFIG_MIPS_DB1500
142 printk(KERN_INFO "AMD Alchemy Au1500/Db1500 Board\n");
68#endif 143#endif
144#ifdef CONFIG_MIPS_DB1100
145 printk(KERN_INFO "AMD Alchemy Au1100/Db1100 Board\n");
146#endif
147#ifdef CONFIG_MIPS_BOSPORUS
148 au1xxx_override_eth_cfg(0, &eth0_pdata);
69 149
70#ifdef CONFIG_FB_AU1100 150 printk(KERN_INFO "AMD Alchemy Bosporus Board\n");
71 argptr = strstr(argptr, "video=");
72 if (argptr == NULL) {
73 argptr = prom_getcmdline();
74 /* default panel */
75 /*strcat(argptr, " video=au1100fb:panel:Sharp_320x240_16");*/
76 }
77#endif 151#endif
152#ifdef CONFIG_MIPS_MIRAGE
153 printk(KERN_INFO "AMD Alchemy Mirage Board\n");
154#endif
155#ifdef CONFIG_MIPS_DB1550
156 printk(KERN_INFO "AMD Alchemy Au1550/Db1550 Board\n");
78 157
79#if defined(CONFIG_SOUND_AU1X00) && !defined(CONFIG_SOC_AU1000) 158 bcsr1 = DB1550_BCSR_PHYS_ADDR;
80 /* au1000 does not support vra, au1500 and au1100 do */ 159 bcsr2 = DB1550_BCSR_PHYS_ADDR + DB1550_BCSR_HEXLED_OFS;
81 strcat(argptr, " au1000_audio=vra");
82 argptr = prom_getcmdline();
83#endif 160#endif
84 161
162 /* initialize board register space */
163 bcsr_init(bcsr1, bcsr2);
164
85 /* Not valid for Au1550 */ 165 /* Not valid for Au1550 */
86#if defined(CONFIG_IRDA) && \ 166#if defined(CONFIG_IRDA) && \
87 (defined(CONFIG_SOC_AU1000) || defined(CONFIG_SOC_AU1100)) 167 (defined(CONFIG_SOC_AU1000) || defined(CONFIG_SOC_AU1100))
@@ -89,11 +169,10 @@ void __init board_setup(void)
89 pin_func = au_readl(SYS_PINFUNC) | SYS_PF_IRF; 169 pin_func = au_readl(SYS_PINFUNC) | SYS_PF_IRF;
90 au_writel(pin_func, SYS_PINFUNC); 170 au_writel(pin_func, SYS_PINFUNC);
91 /* Power off until the driver is in use */ 171 /* Power off until the driver is in use */
92 bcsr->resets &= ~BCSR_RESETS_IRDA_MODE_MASK; 172 bcsr_mod(BCSR_RESETS, BCSR_RESETS_IRDA_MODE_MASK,
93 bcsr->resets |= BCSR_RESETS_IRDA_MODE_OFF; 173 BCSR_RESETS_IRDA_MODE_OFF);
94 au_sync();
95#endif 174#endif
96 bcsr->pcmcia = 0x0000; /* turn off PCMCIA power */ 175 bcsr_write(BCSR_PCMCIA, 0); /* turn off PCMCIA power */
97 176
98 /* Enable GPIO[31:0] inputs */ 177 /* Enable GPIO[31:0] inputs */
99 alchemy_gpio1_input_enable(); 178 alchemy_gpio1_input_enable();
@@ -120,26 +199,53 @@ void __init board_setup(void)
120 * be part of the audio driver. 199 * be part of the audio driver.
121 */ 200 */
122 alchemy_gpio_direction_output(209, 1); 201 alchemy_gpio_direction_output(209, 1);
123#endif
124
125 au_sync();
126 202
127#ifdef CONFIG_MIPS_DB1000 203 pm_power_off = mirage_power_off;
128 printk(KERN_INFO "AMD Alchemy Au1000/Db1000 Board\n"); 204 _machine_halt = mirage_power_off;
129#endif 205 _machine_restart = (void(*)(char *))mips_softreset;
130#ifdef CONFIG_MIPS_DB1500
131 printk(KERN_INFO "AMD Alchemy Au1500/Db1500 Board\n");
132#endif
133#ifdef CONFIG_MIPS_DB1100
134 printk(KERN_INFO "AMD Alchemy Au1100/Db1100 Board\n");
135#endif 206#endif
207
136#ifdef CONFIG_MIPS_BOSPORUS 208#ifdef CONFIG_MIPS_BOSPORUS
137 printk(KERN_INFO "AMD Alchemy Bosporus Board\n"); 209 pm_power_off = bosporus_power_off;
210 _machine_halt = bosporus_power_off;
211 _machine_restart = (void(*)(char *))mips_softreset;
138#endif 212#endif
139#ifdef CONFIG_MIPS_MIRAGE 213 au_sync();
140 printk(KERN_INFO "AMD Alchemy Mirage Board\n"); 214}
141#endif 215
142#ifdef CONFIG_MIPS_DB1550 216static int __init db1x00_init_irq(void)
143 printk(KERN_INFO "AMD Alchemy Au1550/Db1550 Board\n"); 217{
218#if defined(CONFIG_MIPS_MIRAGE)
219 set_irq_type(AU1500_GPIO7_INT, IRQF_TRIGGER_RISING); /* TS pendown */
220#elif defined(CONFIG_MIPS_DB1550)
221 set_irq_type(AU1550_GPIO0_INT, IRQF_TRIGGER_LOW); /* CD0# */
222 set_irq_type(AU1550_GPIO1_INT, IRQF_TRIGGER_LOW); /* CD1# */
223 set_irq_type(AU1550_GPIO3_INT, IRQF_TRIGGER_LOW); /* CARD0# */
224 set_irq_type(AU1550_GPIO5_INT, IRQF_TRIGGER_LOW); /* CARD1# */
225 set_irq_type(AU1550_GPIO21_INT, IRQF_TRIGGER_LOW); /* STSCHG0# */
226 set_irq_type(AU1550_GPIO22_INT, IRQF_TRIGGER_LOW); /* STSCHG1# */
227#elif defined(CONFIG_MIPS_DB1500)
228 set_irq_type(AU1500_GPIO0_INT, IRQF_TRIGGER_LOW); /* CD0# */
229 set_irq_type(AU1500_GPIO3_INT, IRQF_TRIGGER_LOW); /* CD1# */
230 set_irq_type(AU1500_GPIO2_INT, IRQF_TRIGGER_LOW); /* CARD0# */
231 set_irq_type(AU1500_GPIO5_INT, IRQF_TRIGGER_LOW); /* CARD1# */
232 set_irq_type(AU1500_GPIO1_INT, IRQF_TRIGGER_LOW); /* STSCHG0# */
233 set_irq_type(AU1500_GPIO4_INT, IRQF_TRIGGER_LOW); /* STSCHG1# */
234#elif defined(CONFIG_MIPS_DB1100)
235 set_irq_type(AU1100_GPIO0_INT, IRQF_TRIGGER_LOW); /* CD0# */
236 set_irq_type(AU1100_GPIO3_INT, IRQF_TRIGGER_LOW); /* CD1# */
237 set_irq_type(AU1100_GPIO2_INT, IRQF_TRIGGER_LOW); /* CARD0# */
238 set_irq_type(AU1100_GPIO5_INT, IRQF_TRIGGER_LOW); /* CARD1# */
239 set_irq_type(AU1100_GPIO1_INT, IRQF_TRIGGER_LOW); /* STSCHG0# */
240 set_irq_type(AU1100_GPIO4_INT, IRQF_TRIGGER_LOW); /* STSCHG1# */
241#elif defined(CONFIG_MIPS_DB1000)
242 set_irq_type(AU1000_GPIO0_INT, IRQF_TRIGGER_LOW); /* CD0# */
243 set_irq_type(AU1000_GPIO3_INT, IRQF_TRIGGER_LOW); /* CD1# */
244 set_irq_type(AU1000_GPIO2_INT, IRQF_TRIGGER_LOW); /* CARD0# */
245 set_irq_type(AU1000_GPIO5_INT, IRQF_TRIGGER_LOW); /* CARD1# */
246 set_irq_type(AU1000_GPIO1_INT, IRQF_TRIGGER_LOW); /* STSCHG0# */
247 set_irq_type(AU1000_GPIO4_INT, IRQF_TRIGGER_LOW); /* STSCHG1# */
144#endif 248#endif
249 return 0;
145} 250}
251arch_initcall(db1x00_init_irq);
diff --git a/arch/mips/alchemy/devboards/db1x00/irqmap.c b/arch/mips/alchemy/devboards/db1x00/irqmap.c
deleted file mode 100644
index 0b09025087c6..000000000000
--- a/arch/mips/alchemy/devboards/db1x00/irqmap.c
+++ /dev/null
@@ -1,90 +0,0 @@
1/*
2 * BRIEF MODULE DESCRIPTION
3 * Au1xxx irq map table
4 *
5 * Copyright 2003 Embedded Edge, LLC
6 * dan@embeddededge.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#include <linux/init.h>
30#include <linux/interrupt.h>
31
32#include <asm/mach-au1x00/au1000.h>
33
34#ifdef CONFIG_MIPS_DB1500
35char irq_tab_alchemy[][5] __initdata = {
36 [12] = { -1, INTA, INTX, INTX, INTX }, /* IDSEL 12 - HPT371 */
37 [13] = { -1, INTA, INTB, INTC, INTD }, /* IDSEL 13 - PCI slot */
38};
39#endif
40
41#ifdef CONFIG_MIPS_BOSPORUS
42char irq_tab_alchemy[][5] __initdata = {
43 [11] = { -1, INTA, INTB, INTX, INTX }, /* IDSEL 11 - miniPCI */
44 [12] = { -1, INTA, INTX, INTX, INTX }, /* IDSEL 12 - SN1741 */
45 [13] = { -1, INTA, INTB, INTC, INTD }, /* IDSEL 13 - PCI slot */
46};
47#endif
48
49#ifdef CONFIG_MIPS_MIRAGE
50char irq_tab_alchemy[][5] __initdata = {
51 [11] = { -1, INTD, INTX, INTX, INTX }, /* IDSEL 11 - SMI VGX */
52 [12] = { -1, INTX, INTX, INTC, INTX }, /* IDSEL 12 - PNX1300 */
53 [13] = { -1, INTA, INTB, INTX, INTX }, /* IDSEL 13 - miniPCI */
54};
55#endif
56
57#ifdef CONFIG_MIPS_DB1550
58char irq_tab_alchemy[][5] __initdata = {
59 [11] = { -1, INTC, INTX, INTX, INTX }, /* IDSEL 11 - on-board HPT371 */
60 [12] = { -1, INTB, INTC, INTD, INTA }, /* IDSEL 12 - PCI slot 2 (left) */
61 [13] = { -1, INTA, INTB, INTC, INTD }, /* IDSEL 13 - PCI slot 1 (right) */
62};
63#endif
64
65
66struct au1xxx_irqmap __initdata au1xxx_irq_map[] = {
67
68#ifndef CONFIG_MIPS_MIRAGE
69#ifdef CONFIG_MIPS_DB1550
70 { AU1000_GPIO_3, IRQF_TRIGGER_LOW, 0 }, /* PCMCIA Card 0 IRQ# */
71 { AU1000_GPIO_5, IRQF_TRIGGER_LOW, 0 }, /* PCMCIA Card 1 IRQ# */
72#else
73 { AU1000_GPIO_0, IRQF_TRIGGER_LOW, 0 }, /* PCMCIA Card 0 Fully_Interted# */
74 { AU1000_GPIO_1, IRQF_TRIGGER_LOW, 0 }, /* PCMCIA Card 0 STSCHG# */
75 { AU1000_GPIO_2, IRQF_TRIGGER_LOW, 0 }, /* PCMCIA Card 0 IRQ# */
76
77 { AU1000_GPIO_3, IRQF_TRIGGER_LOW, 0 }, /* PCMCIA Card 1 Fully_Interted# */
78 { AU1000_GPIO_4, IRQF_TRIGGER_LOW, 0 }, /* PCMCIA Card 1 STSCHG# */
79 { AU1000_GPIO_5, IRQF_TRIGGER_LOW, 0 }, /* PCMCIA Card 1 IRQ# */
80#endif
81#else
82 { AU1000_GPIO_7, IRQF_TRIGGER_RISING, 0 }, /* touchscreen pen down */
83#endif
84
85};
86
87void __init board_init_irq(void)
88{
89 au1xxx_setup_irqmap(au1xxx_irq_map, ARRAY_SIZE(au1xxx_irq_map));
90}
diff --git a/arch/mips/alchemy/devboards/db1x00/platform.c b/arch/mips/alchemy/devboards/db1x00/platform.c
new file mode 100644
index 000000000000..978d5ab3d678
--- /dev/null
+++ b/arch/mips/alchemy/devboards/db1x00/platform.c
@@ -0,0 +1,118 @@
1/*
2 * DBAu1xxx board platform device registration
3 *
4 * Copyright (C) 2009 Manuel Lauss
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21#include <linux/init.h>
22#include <linux/platform_device.h>
23
24#include <asm/mach-au1x00/au1xxx.h>
25#include <asm/mach-db1x00/bcsr.h>
26#include "../platform.h"
27
28/* DB1xxx PCMCIA interrupt sources:
29 * CD0/1 GPIO0/3
30 * STSCHG0/1 GPIO1/4
31 * CARD0/1 GPIO2/5
32 * Db1550: 0/1, 21/22, 3/5
33 */
34
35#define DB1XXX_HAS_PCMCIA
36#define F_SWAPPED (bcsr_read(BCSR_STATUS) & BCSR_STATUS_DB1000_SWAPBOOT)
37
38#if defined(CONFIG_MIPS_DB1000)
39#define DB1XXX_PCMCIA_CD0 AU1000_GPIO0_INT
40#define DB1XXX_PCMCIA_STSCHG0 AU1000_GPIO1_INT
41#define DB1XXX_PCMCIA_CARD0 AU1000_GPIO2_INT
42#define DB1XXX_PCMCIA_CD1 AU1000_GPIO3_INT
43#define DB1XXX_PCMCIA_STSCHG1 AU1000_GPIO4_INT
44#define DB1XXX_PCMCIA_CARD1 AU1000_GPIO5_INT
45#define BOARD_FLASH_SIZE 0x02000000 /* 32MB */
46#define BOARD_FLASH_WIDTH 4 /* 32-bits */
47#elif defined(CONFIG_MIPS_DB1100)
48#define DB1XXX_PCMCIA_CD0 AU1100_GPIO0_INT
49#define DB1XXX_PCMCIA_STSCHG0 AU1100_GPIO1_INT
50#define DB1XXX_PCMCIA_CARD0 AU1100_GPIO2_INT
51#define DB1XXX_PCMCIA_CD1 AU1100_GPIO3_INT
52#define DB1XXX_PCMCIA_STSCHG1 AU1100_GPIO4_INT
53#define DB1XXX_PCMCIA_CARD1 AU1100_GPIO5_INT
54#define BOARD_FLASH_SIZE 0x02000000 /* 32MB */
55#define BOARD_FLASH_WIDTH 4 /* 32-bits */
56#elif defined(CONFIG_MIPS_DB1500)
57#define DB1XXX_PCMCIA_CD0 AU1500_GPIO0_INT
58#define DB1XXX_PCMCIA_STSCHG0 AU1500_GPIO1_INT
59#define DB1XXX_PCMCIA_CARD0 AU1500_GPIO2_INT
60#define DB1XXX_PCMCIA_CD1 AU1500_GPIO3_INT
61#define DB1XXX_PCMCIA_STSCHG1 AU1500_GPIO4_INT
62#define DB1XXX_PCMCIA_CARD1 AU1500_GPIO5_INT
63#define BOARD_FLASH_SIZE 0x02000000 /* 32MB */
64#define BOARD_FLASH_WIDTH 4 /* 32-bits */
65#elif defined(CONFIG_MIPS_DB1550)
66#define DB1XXX_PCMCIA_CD0 AU1550_GPIO0_INT
67#define DB1XXX_PCMCIA_STSCHG0 AU1550_GPIO21_INT
68#define DB1XXX_PCMCIA_CARD0 AU1550_GPIO3_INT
69#define DB1XXX_PCMCIA_CD1 AU1550_GPIO1_INT
70#define DB1XXX_PCMCIA_STSCHG1 AU1550_GPIO22_INT
71#define DB1XXX_PCMCIA_CARD1 AU1550_GPIO5_INT
72#define BOARD_FLASH_SIZE 0x08000000 /* 128MB */
73#define BOARD_FLASH_WIDTH 4 /* 32-bits */
74#else
75/* other board: no PCMCIA */
76#undef DB1XXX_HAS_PCMCIA
77#undef F_SWAPPED
78#define F_SWAPPED 0
79#if defined(CONFIG_MIPS_BOSPORUS)
80#define BOARD_FLASH_SIZE 0x01000000 /* 16MB */
81#define BOARD_FLASH_WIDTH 2 /* 16-bits */
82#elif defined(CONFIG_MIPS_MIRAGE)
83#define BOARD_FLASH_SIZE 0x04000000 /* 64MB */
84#define BOARD_FLASH_WIDTH 4 /* 32-bits */
85#endif
86#endif
87
88static int __init db1xxx_dev_init(void)
89{
90#ifdef DB1XXX_HAS_PCMCIA
91 db1x_register_pcmcia_socket(PCMCIA_ATTR_PHYS_ADDR,
92 PCMCIA_ATTR_PHYS_ADDR + 0x000400000 - 1,
93 PCMCIA_MEM_PHYS_ADDR,
94 PCMCIA_MEM_PHYS_ADDR + 0x000400000 - 1,
95 PCMCIA_IO_PHYS_ADDR,
96 PCMCIA_IO_PHYS_ADDR + 0x000010000 - 1,
97 DB1XXX_PCMCIA_CARD0,
98 DB1XXX_PCMCIA_CD0,
99 /*DB1XXX_PCMCIA_STSCHG0*/0,
100 0,
101 0);
102
103 db1x_register_pcmcia_socket(PCMCIA_ATTR_PHYS_ADDR + 0x004000000,
104 PCMCIA_ATTR_PHYS_ADDR + 0x004400000 - 1,
105 PCMCIA_MEM_PHYS_ADDR + 0x004000000,
106 PCMCIA_MEM_PHYS_ADDR + 0x004400000 - 1,
107 PCMCIA_IO_PHYS_ADDR + 0x004000000,
108 PCMCIA_IO_PHYS_ADDR + 0x004010000 - 1,
109 DB1XXX_PCMCIA_CARD1,
110 DB1XXX_PCMCIA_CD1,
111 /*DB1XXX_PCMCIA_STSCHG1*/0,
112 0,
113 1);
114#endif
115 db1x_register_norflash(BOARD_FLASH_SIZE, BOARD_FLASH_WIDTH, F_SWAPPED);
116 return 0;
117}
118device_initcall(db1xxx_dev_init);
diff --git a/arch/mips/alchemy/devboards/pb1000/board_setup.c b/arch/mips/alchemy/devboards/pb1000/board_setup.c
index cd273545e810..b5311d8a29ab 100644
--- a/arch/mips/alchemy/devboards/pb1000/board_setup.c
+++ b/arch/mips/alchemy/devboards/pb1000/board_setup.c
@@ -31,11 +31,7 @@
31#include <asm/mach-pb1x00/pb1000.h> 31#include <asm/mach-pb1x00/pb1000.h>
32#include <prom.h> 32#include <prom.h>
33 33
34 34#include "../platform.h"
35struct au1xxx_irqmap __initdata au1xxx_irq_map[] = {
36 { AU1000_GPIO_15, IRQF_TRIGGER_LOW, 0 },
37};
38
39 35
40const char *get_system_type(void) 36const char *get_system_type(void)
41{ 37{
@@ -46,25 +42,14 @@ void board_reset(void)
46{ 42{
47} 43}
48 44
49void __init board_init_irq(void)
50{
51 au1xxx_setup_irqmap(au1xxx_irq_map, ARRAY_SIZE(au1xxx_irq_map));
52}
53
54void __init board_setup(void) 45void __init board_setup(void)
55{ 46{
56 u32 pin_func, static_cfg0; 47 u32 pin_func, static_cfg0;
57 u32 sys_freqctrl, sys_clksrc; 48 u32 sys_freqctrl, sys_clksrc;
58 u32 prid = read_c0_prid(); 49 u32 prid = read_c0_prid();
59 50
60#ifdef CONFIG_SERIAL_8250_CONSOLE 51 sys_freqctrl = 0;
61 char *argptr = prom_getcmdline(); 52 sys_clksrc = 0;
62 argptr = strstr(argptr, "console=");
63 if (argptr == NULL) {
64 argptr = prom_getcmdline();
65 strcat(argptr, " console=ttyS0,115200");
66 }
67#endif
68 53
69 /* Set AUX clock to 12 MHz * 8 = 96 MHz */ 54 /* Set AUX clock to 12 MHz * 8 = 96 MHz */
70 au_writel(8, SYS_AUXPLL); 55 au_writel(8, SYS_AUXPLL);
@@ -193,3 +178,16 @@ void __init board_setup(void)
193 break; 178 break;
194 } 179 }
195} 180}
181
182static int __init pb1000_init_irq(void)
183{
184 set_irq_type(AU1000_GPIO15_INT, IRQF_TRIGGER_LOW);
185 return 0;
186}
187arch_initcall(pb1000_init_irq);
188
189static int __init pb1000_device_init(void)
190{
191 return db1x_register_norflash(8 * 1024 * 1024, 4, 0);
192}
193device_initcall(pb1000_device_init);
diff --git a/arch/mips/alchemy/devboards/pb1100/Makefile b/arch/mips/alchemy/devboards/pb1100/Makefile
index c586dd7e91dc..7e3756c83fe5 100644
--- a/arch/mips/alchemy/devboards/pb1100/Makefile
+++ b/arch/mips/alchemy/devboards/pb1100/Makefile
@@ -5,4 +5,4 @@
5# Makefile for the Alchemy Semiconductor Pb1100 board. 5# Makefile for the Alchemy Semiconductor Pb1100 board.
6# 6#
7 7
8obj-y := board_setup.o 8obj-y := board_setup.o platform.o
diff --git a/arch/mips/alchemy/devboards/pb1100/board_setup.c b/arch/mips/alchemy/devboards/pb1100/board_setup.c
index 61263081ef58..c7b4caa81a35 100644
--- a/arch/mips/alchemy/devboards/pb1100/board_setup.c
+++ b/arch/mips/alchemy/devboards/pb1100/board_setup.c
@@ -29,19 +29,11 @@
29#include <linux/interrupt.h> 29#include <linux/interrupt.h>
30 30
31#include <asm/mach-au1x00/au1000.h> 31#include <asm/mach-au1x00/au1000.h>
32#include <asm/mach-pb1x00/pb1100.h> 32#include <asm/mach-db1x00/bcsr.h>
33 33
34#include <prom.h> 34#include <prom.h>
35 35
36 36
37struct au1xxx_irqmap __initdata au1xxx_irq_map[] = {
38 { AU1000_GPIO_9, IRQF_TRIGGER_LOW, 0 }, /* PCMCIA Card Fully_Inserted# */
39 { AU1000_GPIO_10, IRQF_TRIGGER_LOW, 0 }, /* PCMCIA Card STSCHG# */
40 { AU1000_GPIO_11, IRQF_TRIGGER_LOW, 0 }, /* PCMCIA Card IRQ# */
41 { AU1000_GPIO_13, IRQF_TRIGGER_LOW, 0 }, /* DC_IRQ# */
42};
43
44
45const char *get_system_type(void) 37const char *get_system_type(void)
46{ 38{
47 return "Alchemy Pb1100"; 39 return "Alchemy Pb1100";
@@ -49,43 +41,15 @@ const char *get_system_type(void)
49 41
50void board_reset(void) 42void board_reset(void)
51{ 43{
52 /* Hit BCSR.RST_VDDI[SOFT_RESET] */ 44 bcsr_write(BCSR_SYSTEM, 0);
53 au_writel(0x00000000, PB1100_RST_VDDI);
54}
55
56void __init board_init_irq(void)
57{
58 au1xxx_setup_irqmap(au1xxx_irq_map, ARRAY_SIZE(au1xxx_irq_map));
59} 45}
60 46
61void __init board_setup(void) 47void __init board_setup(void)
62{ 48{
63 volatile void __iomem *base = (volatile void __iomem *)0xac000000UL; 49 volatile void __iomem *base = (volatile void __iomem *)0xac000000UL;
64 char *argptr;
65
66 argptr = prom_getcmdline();
67#ifdef CONFIG_SERIAL_8250_CONSOLE
68 argptr = strstr(argptr, "console=");
69 if (argptr == NULL) {
70 argptr = prom_getcmdline();
71 strcat(argptr, " console=ttyS0,115200");
72 }
73#endif
74
75#ifdef CONFIG_FB_AU1100
76 argptr = strstr(argptr, "video=");
77 if (argptr == NULL) {
78 argptr = prom_getcmdline();
79 /* default panel */
80 /*strcat(argptr, " video=au1100fb:panel:Sharp_320x240_16");*/
81 }
82#endif
83 50
84#if defined(CONFIG_SOUND_AU1X00) && !defined(CONFIG_SOC_AU1000) 51 bcsr_init(DB1000_BCSR_PHYS_ADDR,
85 /* au1000 does not support vra, au1500 and au1100 do */ 52 DB1000_BCSR_PHYS_ADDR + DB1000_BCSR_HEXLED_OFS);
86 strcat(argptr, " au1000_audio=vra");
87 argptr = prom_getcmdline();
88#endif
89 53
90 /* Set AUX clock to 12 MHz * 8 = 96 MHz */ 54 /* Set AUX clock to 12 MHz * 8 = 96 MHz */
91 au_writel(8, SYS_AUXPLL); 55 au_writel(8, SYS_AUXPLL);
@@ -155,3 +119,14 @@ void __init board_setup(void)
155 au_sync(); 119 au_sync();
156 } 120 }
157} 121}
122
123static int __init pb1100_init_irq(void)
124{
125 set_irq_type(AU1100_GPIO9_INT, IRQF_TRIGGER_LOW); /* PCCD# */
126 set_irq_type(AU1100_GPIO10_INT, IRQF_TRIGGER_LOW); /* PCSTSCHG# */
127 set_irq_type(AU1100_GPIO11_INT, IRQF_TRIGGER_LOW); /* PCCard# */
128 set_irq_type(AU1100_GPIO13_INT, IRQF_TRIGGER_LOW); /* DC_IRQ# */
129
130 return 0;
131}
132arch_initcall(pb1100_init_irq);
diff --git a/arch/mips/alchemy/devboards/pb1100/platform.c b/arch/mips/alchemy/devboards/pb1100/platform.c
new file mode 100644
index 000000000000..2c8dc29759fd
--- /dev/null
+++ b/arch/mips/alchemy/devboards/pb1100/platform.c
@@ -0,0 +1,50 @@
1/*
2 * Pb1100 board platform device registration
3 *
4 * Copyright (C) 2009 Manuel Lauss
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21#include <linux/init.h>
22
23#include <asm/mach-au1x00/au1000.h>
24#include <asm/mach-db1x00/bcsr.h>
25
26#include "../platform.h"
27
28static int __init pb1100_dev_init(void)
29{
30 int swapped;
31
32 /* PCMCIA. single socket, identical to Pb1500 */
33 db1x_register_pcmcia_socket(PCMCIA_ATTR_PHYS_ADDR,
34 PCMCIA_ATTR_PHYS_ADDR + 0x000400000 - 1,
35 PCMCIA_MEM_PHYS_ADDR,
36 PCMCIA_MEM_PHYS_ADDR + 0x000400000 - 1,
37 PCMCIA_IO_PHYS_ADDR,
38 PCMCIA_IO_PHYS_ADDR + 0x000010000 - 1,
39 AU1100_GPIO11_INT, /* card */
40 AU1100_GPIO9_INT, /* insert */
41 /*AU1100_GPIO10_INT*/0, /* stschg */
42 0, /* eject */
43 0); /* id */
44
45 swapped = bcsr_read(BCSR_STATUS) & BCSR_STATUS_DB1000_SWAPBOOT;
46 db1x_register_norflash(64 * 1024 * 1024, 4, swapped);
47
48 return 0;
49}
50device_initcall(pb1100_dev_init);
diff --git a/arch/mips/alchemy/devboards/pb1200/Makefile b/arch/mips/alchemy/devboards/pb1200/Makefile
index c8c3a99fb68a..2ea9b02ef09f 100644
--- a/arch/mips/alchemy/devboards/pb1200/Makefile
+++ b/arch/mips/alchemy/devboards/pb1200/Makefile
@@ -2,6 +2,6 @@
2# Makefile for the Alchemy Semiconductor Pb1200/DBAu1200 boards. 2# Makefile for the Alchemy Semiconductor Pb1200/DBAu1200 boards.
3# 3#
4 4
5obj-y := board_setup.o irqmap.o platform.o 5obj-y := board_setup.o platform.o
6 6
7EXTRA_CFLAGS += -Werror 7EXTRA_CFLAGS += -Werror
diff --git a/arch/mips/alchemy/devboards/pb1200/board_setup.c b/arch/mips/alchemy/devboards/pb1200/board_setup.c
index 94e6b7e7753d..3184063f8042 100644
--- a/arch/mips/alchemy/devboards/pb1200/board_setup.c
+++ b/arch/mips/alchemy/devboards/pb1200/board_setup.c
@@ -25,11 +25,23 @@
25 */ 25 */
26 26
27#include <linux/init.h> 27#include <linux/init.h>
28#include <linux/interrupt.h>
28#include <linux/sched.h> 29#include <linux/sched.h>
29 30
30#include <prom.h> 31#include <asm/mach-au1x00/au1000.h>
31#include <au1xxx.h> 32#include <asm/mach-db1x00/bcsr.h>
33
34#ifdef CONFIG_MIPS_PB1200
35#include <asm/mach-pb1x00/pb1200.h>
36#endif
37
38#ifdef CONFIG_MIPS_DB1200
39#include <asm/mach-db1x00/db1200.h>
40#define PB1200_INT_BEGIN DB1200_INT_BEGIN
41#define PB1200_INT_END DB1200_INT_END
42#endif
32 43
44#include <prom.h>
33 45
34const char *get_system_type(void) 46const char *get_system_type(void)
35{ 47{
@@ -38,25 +50,15 @@ const char *get_system_type(void)
38 50
39void board_reset(void) 51void board_reset(void)
40{ 52{
41 bcsr->resets = 0; 53 bcsr_write(BCSR_RESETS, 0);
42 bcsr->system = 0; 54 bcsr_write(BCSR_SYSTEM, 0);
43} 55}
44 56
45void __init board_setup(void) 57void __init board_setup(void)
46{ 58{
47 char *argptr; 59 printk(KERN_INFO "AMD Alchemy Pb1200 Board\n");
48 60 bcsr_init(PB1200_BCSR_PHYS_ADDR,
49 argptr = prom_getcmdline(); 61 PB1200_BCSR_PHYS_ADDR + PB1200_BCSR_HEXLED_OFS);
50#ifdef CONFIG_SERIAL_8250_CONSOLE
51 argptr = strstr(argptr, "console=");
52 if (argptr == NULL) {
53 argptr = prom_getcmdline();
54 strcat(argptr, " console=ttyS0,115200");
55 }
56#endif
57#ifdef CONFIG_FB_AU1200
58 strcat(argptr, " video=au1200fb:panel:bs");
59#endif
60 62
61#if 0 63#if 0
62 { 64 {
@@ -82,7 +84,7 @@ void __init board_setup(void)
82 u32 pin_func; 84 u32 pin_func;
83 85
84 /* Select SMBus in CPLD */ 86 /* Select SMBus in CPLD */
85 bcsr->resets &= ~BCSR_RESETS_PCS0MUX; 87 bcsr_mod(BCSR_RESETS, BCSR_RESETS_PSC0MUX, 0);
86 88
87 pin_func = au_readl(SYS_PINFUNC); 89 pin_func = au_readl(SYS_PINFUNC);
88 au_sync(); 90 au_sync();
@@ -116,38 +118,54 @@ void __init board_setup(void)
116 118
117 /* 119 /*
118 * The Pb1200 development board uses external MUX for PSC0 to 120 * The Pb1200 development board uses external MUX for PSC0 to
119 * support SMB/SPI. bcsr->resets bit 12: 0=SMB 1=SPI 121 * support SMB/SPI. bcsr_resets bit 12: 0=SMB 1=SPI
120 */ 122 */
121#ifdef CONFIG_I2C_AU1550 123#ifdef CONFIG_I2C_AU1550
122 bcsr->resets &= ~BCSR_RESETS_PCS0MUX; 124 bcsr_mod(BCSR_RESETS, BCSR_RESETS_PSC0MUX, 0);
123#endif 125#endif
124 au_sync(); 126 au_sync();
127}
125 128
126#ifdef CONFIG_MIPS_PB1200 129static int __init pb1200_init_irq(void)
127 printk(KERN_INFO "AMD Alchemy Pb1200 Board\n"); 130{
128#endif 131 /* We have a problem with CPLD rev 3. */
129#ifdef CONFIG_MIPS_DB1200 132 if (BCSR_WHOAMI_CPLD(bcsr_read(BCSR_WHOAMI)) <= 3) {
130 printk(KERN_INFO "AMD Alchemy Db1200 Board\n"); 133 printk(KERN_ERR "WARNING!!!\n");
131#endif 134 printk(KERN_ERR "WARNING!!!\n");
135 printk(KERN_ERR "WARNING!!!\n");
136 printk(KERN_ERR "WARNING!!!\n");
137 printk(KERN_ERR "WARNING!!!\n");
138 printk(KERN_ERR "WARNING!!!\n");
139 printk(KERN_ERR "Pb1200 must be at CPLD rev 4. Please have Pb1200\n");
140 printk(KERN_ERR "updated to latest revision. This software will\n");
141 printk(KERN_ERR "not work on anything less than CPLD rev 4.\n");
142 printk(KERN_ERR "WARNING!!!\n");
143 printk(KERN_ERR "WARNING!!!\n");
144 printk(KERN_ERR "WARNING!!!\n");
145 printk(KERN_ERR "WARNING!!!\n");
146 printk(KERN_ERR "WARNING!!!\n");
147 printk(KERN_ERR "WARNING!!!\n");
148 panic("Game over. Your score is 0.");
149 }
150
151 set_irq_type(AU1200_GPIO7_INT, IRQF_TRIGGER_LOW);
152 bcsr_init_irq(PB1200_INT_BEGIN, PB1200_INT_END, AU1200_GPIO7_INT);
153
154 return 0;
132} 155}
156arch_initcall(pb1200_init_irq);
157
133 158
134int board_au1200fb_panel(void) 159int board_au1200fb_panel(void)
135{ 160{
136 BCSR *bcsr = (BCSR *)BCSR_KSEG1_ADDR; 161 return (bcsr_read(BCSR_SWITCHES) >> 8) & 0x0f;
137 int p;
138
139 p = bcsr->switches;
140 p >>= 8;
141 p &= 0x0F;
142 return p;
143} 162}
144 163
145int board_au1200fb_panel_init(void) 164int board_au1200fb_panel_init(void)
146{ 165{
147 /* Apply power */ 166 /* Apply power */
148 BCSR *bcsr = (BCSR *)BCSR_KSEG1_ADDR; 167 bcsr_mod(BCSR_BOARD, 0, BCSR_BOARD_LCDVEE | BCSR_BOARD_LCDVDD |
149 168 BCSR_BOARD_LCDBL);
150 bcsr->board |= BCSR_BOARD_LCDVEE | BCSR_BOARD_LCDVDD | BCSR_BOARD_LCDBL;
151 /* printk(KERN_DEBUG "board_au1200fb_panel_init()\n"); */ 169 /* printk(KERN_DEBUG "board_au1200fb_panel_init()\n"); */
152 return 0; 170 return 0;
153} 171}
@@ -155,10 +173,8 @@ int board_au1200fb_panel_init(void)
155int board_au1200fb_panel_shutdown(void) 173int board_au1200fb_panel_shutdown(void)
156{ 174{
157 /* Remove power */ 175 /* Remove power */
158 BCSR *bcsr = (BCSR *)BCSR_KSEG1_ADDR; 176 bcsr_mod(BCSR_BOARD, BCSR_BOARD_LCDVEE | BCSR_BOARD_LCDVDD |
159 177 BCSR_BOARD_LCDBL, 0);
160 bcsr->board &= ~(BCSR_BOARD_LCDVEE | BCSR_BOARD_LCDVDD |
161 BCSR_BOARD_LCDBL);
162 /* printk(KERN_DEBUG "board_au1200fb_panel_shutdown()\n"); */ 178 /* printk(KERN_DEBUG "board_au1200fb_panel_shutdown()\n"); */
163 return 0; 179 return 0;
164} 180}
diff --git a/arch/mips/alchemy/devboards/pb1200/irqmap.c b/arch/mips/alchemy/devboards/pb1200/irqmap.c
deleted file mode 100644
index fe47498da280..000000000000
--- a/arch/mips/alchemy/devboards/pb1200/irqmap.c
+++ /dev/null
@@ -1,134 +0,0 @@
1/*
2 * BRIEF MODULE DESCRIPTION
3 * Au1xxx irq map table
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 *
10 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
11 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
13 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
14 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
15 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
16 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
17 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
18 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
19 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
20 *
21 * You should have received a copy of the GNU General Public License along
22 * with this program; if not, write to the Free Software Foundation, Inc.,
23 * 675 Mass Ave, Cambridge, MA 02139, USA.
24 */
25
26#include <linux/init.h>
27#include <linux/interrupt.h>
28
29#include <asm/mach-au1x00/au1000.h>
30
31#ifdef CONFIG_MIPS_PB1200
32#include <asm/mach-pb1x00/pb1200.h>
33#endif
34
35#ifdef CONFIG_MIPS_DB1200
36#include <asm/mach-db1x00/db1200.h>
37#define PB1200_INT_BEGIN DB1200_INT_BEGIN
38#define PB1200_INT_END DB1200_INT_END
39#endif
40
41struct au1xxx_irqmap __initdata au1xxx_irq_map[] = {
42 /* This is external interrupt cascade */
43 { AU1000_GPIO_7, IRQF_TRIGGER_LOW, 0 },
44};
45
46
47/*
48 * Support for External interrupts on the Pb1200 Development platform.
49 */
50
51static void pb1200_cascade_handler(unsigned int irq, struct irq_desc *d)
52{
53 unsigned short bisr = bcsr->int_status;
54
55 for ( ; bisr; bisr &= bisr - 1)
56 generic_handle_irq(PB1200_INT_BEGIN + __ffs(bisr));
57}
58
59/* NOTE: both the enable and mask bits must be cleared, otherwise the
60 * CPLD generates tons of spurious interrupts (at least on the DB1200).
61 */
62static void pb1200_mask_irq(unsigned int irq_nr)
63{
64 bcsr->intclr_mask = 1 << (irq_nr - PB1200_INT_BEGIN);
65 bcsr->intclr = 1 << (irq_nr - PB1200_INT_BEGIN);
66 au_sync();
67}
68
69static void pb1200_maskack_irq(unsigned int irq_nr)
70{
71 bcsr->intclr_mask = 1 << (irq_nr - PB1200_INT_BEGIN);
72 bcsr->intclr = 1 << (irq_nr - PB1200_INT_BEGIN);
73 bcsr->int_status = 1 << (irq_nr - PB1200_INT_BEGIN); /* ack */
74 au_sync();
75}
76
77static void pb1200_unmask_irq(unsigned int irq_nr)
78{
79 bcsr->intset = 1 << (irq_nr - PB1200_INT_BEGIN);
80 bcsr->intset_mask = 1 << (irq_nr - PB1200_INT_BEGIN);
81 au_sync();
82}
83
84static struct irq_chip pb1200_cpld_irq_type = {
85#ifdef CONFIG_MIPS_PB1200
86 .name = "Pb1200 Ext",
87#endif
88#ifdef CONFIG_MIPS_DB1200
89 .name = "Db1200 Ext",
90#endif
91 .mask = pb1200_mask_irq,
92 .mask_ack = pb1200_maskack_irq,
93 .unmask = pb1200_unmask_irq,
94};
95
96void __init board_init_irq(void)
97{
98 unsigned int irq;
99
100 au1xxx_setup_irqmap(au1xxx_irq_map, ARRAY_SIZE(au1xxx_irq_map));
101
102#ifdef CONFIG_MIPS_PB1200
103 /* We have a problem with CPLD rev 3. */
104 if (((bcsr->whoami & BCSR_WHOAMI_CPLD) >> 4) <= 3) {
105 printk(KERN_ERR "WARNING!!!\n");
106 printk(KERN_ERR "WARNING!!!\n");
107 printk(KERN_ERR "WARNING!!!\n");
108 printk(KERN_ERR "WARNING!!!\n");
109 printk(KERN_ERR "WARNING!!!\n");
110 printk(KERN_ERR "WARNING!!!\n");
111 printk(KERN_ERR "Pb1200 must be at CPLD rev 4. Please have Pb1200\n");
112 printk(KERN_ERR "updated to latest revision. This software will\n");
113 printk(KERN_ERR "not work on anything less than CPLD rev 4.\n");
114 printk(KERN_ERR "WARNING!!!\n");
115 printk(KERN_ERR "WARNING!!!\n");
116 printk(KERN_ERR "WARNING!!!\n");
117 printk(KERN_ERR "WARNING!!!\n");
118 printk(KERN_ERR "WARNING!!!\n");
119 printk(KERN_ERR "WARNING!!!\n");
120 panic("Game over. Your score is 0.");
121 }
122#endif
123 /* mask & disable & ack all */
124 bcsr->intclr_mask = 0xffff;
125 bcsr->intclr = 0xffff;
126 bcsr->int_status = 0xffff;
127 au_sync();
128
129 for (irq = PB1200_INT_BEGIN; irq <= PB1200_INT_END; irq++)
130 set_irq_chip_and_handler_name(irq, &pb1200_cpld_irq_type,
131 handle_level_irq, "level");
132
133 set_irq_chained_handler(AU1000_GPIO_7, pb1200_cascade_handler);
134}
diff --git a/arch/mips/alchemy/devboards/pb1200/platform.c b/arch/mips/alchemy/devboards/pb1200/platform.c
index b93dff4a6789..3ef2dceeb796 100644
--- a/arch/mips/alchemy/devboards/pb1200/platform.c
+++ b/arch/mips/alchemy/devboards/pb1200/platform.c
@@ -26,27 +26,30 @@
26 26
27#include <asm/mach-au1x00/au1xxx.h> 27#include <asm/mach-au1x00/au1xxx.h>
28#include <asm/mach-au1x00/au1100_mmc.h> 28#include <asm/mach-au1x00/au1100_mmc.h>
29#include <asm/mach-db1x00/bcsr.h>
30
31#include "../platform.h"
29 32
30static int mmc_activity; 33static int mmc_activity;
31 34
32static void pb1200mmc0_set_power(void *mmc_host, int state) 35static void pb1200mmc0_set_power(void *mmc_host, int state)
33{ 36{
34 if (state) 37 if (state)
35 bcsr->board |= BCSR_BOARD_SD0PWR; 38 bcsr_mod(BCSR_BOARD, 0, BCSR_BOARD_SD0PWR);
36 else 39 else
37 bcsr->board &= ~BCSR_BOARD_SD0PWR; 40 bcsr_mod(BCSR_BOARD, BCSR_BOARD_SD0PWR, 0);
38 41
39 au_sync_delay(1); 42 msleep(1);
40} 43}
41 44
42static int pb1200mmc0_card_readonly(void *mmc_host) 45static int pb1200mmc0_card_readonly(void *mmc_host)
43{ 46{
44 return (bcsr->status & BCSR_STATUS_SD0WP) ? 1 : 0; 47 return (bcsr_read(BCSR_STATUS) & BCSR_STATUS_SD0WP) ? 1 : 0;
45} 48}
46 49
47static int pb1200mmc0_card_inserted(void *mmc_host) 50static int pb1200mmc0_card_inserted(void *mmc_host)
48{ 51{
49 return (bcsr->sig_status & BCSR_INT_SD0INSERT) ? 1 : 0; 52 return (bcsr_read(BCSR_SIGSTAT) & BCSR_INT_SD0INSERT) ? 1 : 0;
50} 53}
51 54
52static void pb1200_mmcled_set(struct led_classdev *led, 55static void pb1200_mmcled_set(struct led_classdev *led,
@@ -54,10 +57,10 @@ static void pb1200_mmcled_set(struct led_classdev *led,
54{ 57{
55 if (brightness != LED_OFF) { 58 if (brightness != LED_OFF) {
56 if (++mmc_activity == 1) 59 if (++mmc_activity == 1)
57 bcsr->disk_leds &= ~(1 << 8); 60 bcsr_mod(BCSR_LEDS, BCSR_LEDS_LED0, 0);
58 } else { 61 } else {
59 if (--mmc_activity == 0) 62 if (--mmc_activity == 0)
60 bcsr->disk_leds |= (1 << 8); 63 bcsr_mod(BCSR_LEDS, 0, BCSR_LEDS_LED0);
61 } 64 }
62} 65}
63 66
@@ -65,27 +68,25 @@ static struct led_classdev pb1200mmc_led = {
65 .brightness_set = pb1200_mmcled_set, 68 .brightness_set = pb1200_mmcled_set,
66}; 69};
67 70
68#ifndef CONFIG_MIPS_DB1200
69static void pb1200mmc1_set_power(void *mmc_host, int state) 71static void pb1200mmc1_set_power(void *mmc_host, int state)
70{ 72{
71 if (state) 73 if (state)
72 bcsr->board |= BCSR_BOARD_SD1PWR; 74 bcsr_mod(BCSR_BOARD, 0, BCSR_BOARD_SD1PWR);
73 else 75 else
74 bcsr->board &= ~BCSR_BOARD_SD1PWR; 76 bcsr_mod(BCSR_BOARD, BCSR_BOARD_SD1PWR, 0);
75 77
76 au_sync_delay(1); 78 msleep(1);
77} 79}
78 80
79static int pb1200mmc1_card_readonly(void *mmc_host) 81static int pb1200mmc1_card_readonly(void *mmc_host)
80{ 82{
81 return (bcsr->status & BCSR_STATUS_SD1WP) ? 1 : 0; 83 return (bcsr_read(BCSR_STATUS) & BCSR_STATUS_SD1WP) ? 1 : 0;
82} 84}
83 85
84static int pb1200mmc1_card_inserted(void *mmc_host) 86static int pb1200mmc1_card_inserted(void *mmc_host)
85{ 87{
86 return (bcsr->sig_status & BCSR_INT_SD1INSERT) ? 1 : 0; 88 return (bcsr_read(BCSR_SIGSTAT) & BCSR_INT_SD1INSERT) ? 1 : 0;
87} 89}
88#endif
89 90
90const struct au1xmmc_platform_data au1xmmc_platdata[2] = { 91const struct au1xmmc_platform_data au1xmmc_platdata[2] = {
91 [0] = { 92 [0] = {
@@ -95,7 +96,6 @@ const struct au1xmmc_platform_data au1xmmc_platdata[2] = {
95 .cd_setup = NULL, /* use poll-timer in driver */ 96 .cd_setup = NULL, /* use poll-timer in driver */
96 .led = &pb1200mmc_led, 97 .led = &pb1200mmc_led,
97 }, 98 },
98#ifndef CONFIG_MIPS_DB1200
99 [1] = { 99 [1] = {
100 .set_power = pb1200mmc1_set_power, 100 .set_power = pb1200mmc1_set_power,
101 .card_inserted = pb1200mmc1_card_inserted, 101 .card_inserted = pb1200mmc1_card_inserted,
@@ -103,7 +103,6 @@ const struct au1xmmc_platform_data au1xmmc_platdata[2] = {
103 .cd_setup = NULL, /* use poll-timer in driver */ 103 .cd_setup = NULL, /* use poll-timer in driver */
104 .led = &pb1200mmc_led, 104 .led = &pb1200mmc_led,
105 }, 105 },
106#endif
107}; 106};
108 107
109static struct resource ide_resources[] = { 108static struct resource ide_resources[] = {
@@ -169,8 +168,36 @@ static struct platform_device *board_platform_devices[] __initdata = {
169 168
170static int __init board_register_devices(void) 169static int __init board_register_devices(void)
171{ 170{
171 int swapped;
172
173 db1x_register_pcmcia_socket(PCMCIA_ATTR_PHYS_ADDR,
174 PCMCIA_ATTR_PHYS_ADDR + 0x000400000 - 1,
175 PCMCIA_MEM_PHYS_ADDR,
176 PCMCIA_MEM_PHYS_ADDR + 0x000400000 - 1,
177 PCMCIA_IO_PHYS_ADDR,
178 PCMCIA_IO_PHYS_ADDR + 0x000010000 - 1,
179 PB1200_PC0_INT,
180 PB1200_PC0_INSERT_INT,
181 /*PB1200_PC0_STSCHG_INT*/0,
182 PB1200_PC0_EJECT_INT,
183 0);
184
185 db1x_register_pcmcia_socket(PCMCIA_ATTR_PHYS_ADDR + 0x008000000,
186 PCMCIA_ATTR_PHYS_ADDR + 0x008400000 - 1,
187 PCMCIA_MEM_PHYS_ADDR + 0x008000000,
188 PCMCIA_MEM_PHYS_ADDR + 0x008400000 - 1,
189 PCMCIA_IO_PHYS_ADDR + 0x008000000,
190 PCMCIA_IO_PHYS_ADDR + 0x008010000 - 1,
191 PB1200_PC1_INT,
192 PB1200_PC1_INSERT_INT,
193 /*PB1200_PC1_STSCHG_INT*/0,
194 PB1200_PC1_EJECT_INT,
195 1);
196
197 swapped = bcsr_read(BCSR_STATUS) & BCSR_STATUS_DB1200_SWAPBOOT;
198 db1x_register_norflash(128 * 1024 * 1024, 2, swapped);
199
172 return platform_add_devices(board_platform_devices, 200 return platform_add_devices(board_platform_devices,
173 ARRAY_SIZE(board_platform_devices)); 201 ARRAY_SIZE(board_platform_devices));
174} 202}
175 203device_initcall(board_register_devices);
176arch_initcall(board_register_devices);
diff --git a/arch/mips/alchemy/devboards/pb1500/Makefile b/arch/mips/alchemy/devboards/pb1500/Makefile
index 173b419a7479..e83b151b5b63 100644
--- a/arch/mips/alchemy/devboards/pb1500/Makefile
+++ b/arch/mips/alchemy/devboards/pb1500/Makefile
@@ -5,4 +5,4 @@
5# Makefile for the Alchemy Semiconductor Pb1500 board. 5# Makefile for the Alchemy Semiconductor Pb1500 board.
6# 6#
7 7
8obj-y := board_setup.o 8obj-y := board_setup.o platform.o
diff --git a/arch/mips/alchemy/devboards/pb1500/board_setup.c b/arch/mips/alchemy/devboards/pb1500/board_setup.c
index d7a56569e7ed..fa9770ac358a 100644
--- a/arch/mips/alchemy/devboards/pb1500/board_setup.c
+++ b/arch/mips/alchemy/devboards/pb1500/board_setup.c
@@ -29,22 +29,14 @@
29#include <linux/interrupt.h> 29#include <linux/interrupt.h>
30 30
31#include <asm/mach-au1x00/au1000.h> 31#include <asm/mach-au1x00/au1000.h>
32#include <asm/mach-pb1x00/pb1500.h> 32#include <asm/mach-db1x00/bcsr.h>
33 33
34#include <prom.h> 34#include <prom.h>
35 35
36 36
37char irq_tab_alchemy[][5] __initdata = { 37char irq_tab_alchemy[][5] __initdata = {
38 [12] = { -1, INTA, INTX, INTX, INTX }, /* IDSEL 12 - HPT370 */ 38 [12] = { -1, AU1500_PCI_INTA, 0xff, 0xff, 0xff }, /* IDSEL 12 - HPT370 */
39 [13] = { -1, INTA, INTB, INTC, INTD }, /* IDSEL 13 - PCI slot */ 39 [13] = { -1, AU1500_PCI_INTA, AU1500_PCI_INTB, AU1500_PCI_INTC, AU1500_PCI_INTD }, /* IDSEL 13 - PCI slot */
40};
41
42struct au1xxx_irqmap __initdata au1xxx_irq_map[] = {
43 { AU1500_GPIO_204, IRQF_TRIGGER_HIGH, 0 },
44 { AU1500_GPIO_201, IRQF_TRIGGER_LOW, 0 },
45 { AU1500_GPIO_202, IRQF_TRIGGER_LOW, 0 },
46 { AU1500_GPIO_203, IRQF_TRIGGER_LOW, 0 },
47 { AU1500_GPIO_205, IRQF_TRIGGER_LOW, 0 },
48}; 40};
49 41
50 42
@@ -55,35 +47,16 @@ const char *get_system_type(void)
55 47
56void board_reset(void) 48void board_reset(void)
57{ 49{
58 /* Hit BCSR.RST_VDDI[SOFT_RESET] */ 50 bcsr_write(BCSR_SYSTEM, 0);
59 au_writel(0x00000000, PB1500_RST_VDDI);
60}
61
62void __init board_init_irq(void)
63{
64 au1xxx_setup_irqmap(au1xxx_irq_map, ARRAY_SIZE(au1xxx_irq_map));
65} 51}
66 52
67void __init board_setup(void) 53void __init board_setup(void)
68{ 54{
69 u32 pin_func; 55 u32 pin_func;
70 u32 sys_freqctrl, sys_clksrc; 56 u32 sys_freqctrl, sys_clksrc;
71 char *argptr;
72
73 argptr = prom_getcmdline();
74#ifdef CONFIG_SERIAL_8250_CONSOLE
75 argptr = strstr(argptr, "console=");
76 if (argptr == NULL) {
77 argptr = prom_getcmdline();
78 strcat(argptr, " console=ttyS0,115200");
79 }
80#endif
81 57
82#if defined(CONFIG_SOUND_AU1X00) && !defined(CONFIG_SOC_AU1000) 58 bcsr_init(DB1000_BCSR_PHYS_ADDR,
83 /* au1000 does not support vra, au1500 and au1100 do */ 59 DB1000_BCSR_PHYS_ADDR + DB1000_BCSR_HEXLED_OFS);
84 strcat(argptr, " au1000_audio=vra");
85 argptr = prom_getcmdline();
86#endif
87 60
88 sys_clksrc = sys_freqctrl = pin_func = 0; 61 sys_clksrc = sys_freqctrl = pin_func = 0;
89 /* Set AUX clock to 12 MHz * 8 = 96 MHz */ 62 /* Set AUX clock to 12 MHz * 8 = 96 MHz */
@@ -163,3 +136,18 @@ void __init board_setup(void)
163 au_sync(); 136 au_sync();
164 } 137 }
165} 138}
139
140static int __init pb1500_init_irq(void)
141{
142 set_irq_type(AU1500_GPIO9_INT, IRQF_TRIGGER_LOW); /* CD0# */
143 set_irq_type(AU1500_GPIO10_INT, IRQF_TRIGGER_LOW); /* CARD0 */
144 set_irq_type(AU1500_GPIO11_INT, IRQF_TRIGGER_LOW); /* STSCHG0# */
145 set_irq_type(AU1500_GPIO204_INT, IRQF_TRIGGER_HIGH);
146 set_irq_type(AU1500_GPIO201_INT, IRQF_TRIGGER_LOW);
147 set_irq_type(AU1500_GPIO202_INT, IRQF_TRIGGER_LOW);
148 set_irq_type(AU1500_GPIO203_INT, IRQF_TRIGGER_LOW);
149 set_irq_type(AU1500_GPIO205_INT, IRQF_TRIGGER_LOW);
150
151 return 0;
152}
153arch_initcall(pb1500_init_irq);
diff --git a/arch/mips/alchemy/devboards/pb1500/platform.c b/arch/mips/alchemy/devboards/pb1500/platform.c
new file mode 100644
index 000000000000..d443bc7aa76e
--- /dev/null
+++ b/arch/mips/alchemy/devboards/pb1500/platform.c
@@ -0,0 +1,49 @@
1/*
2 * Pb1500 board platform device registration
3 *
4 * Copyright (C) 2009 Manuel Lauss
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21#include <linux/init.h>
22#include <asm/mach-au1x00/au1000.h>
23#include <asm/mach-db1x00/bcsr.h>
24
25#include "../platform.h"
26
27static int __init pb1500_dev_init(void)
28{
29 int swapped;
30
31 /* PCMCIA. single socket, identical to Pb1500 */
32 db1x_register_pcmcia_socket(PCMCIA_ATTR_PHYS_ADDR,
33 PCMCIA_ATTR_PHYS_ADDR + 0x000400000 - 1,
34 PCMCIA_MEM_PHYS_ADDR,
35 PCMCIA_MEM_PHYS_ADDR + 0x000400000 - 1,
36 PCMCIA_IO_PHYS_ADDR,
37 PCMCIA_IO_PHYS_ADDR + 0x000010000 - 1,
38 AU1500_GPIO11_INT, /* card */
39 AU1500_GPIO9_INT, /* insert */
40 /*AU1500_GPIO10_INT*/0, /* stschg */
41 0, /* eject */
42 0); /* id */
43
44 swapped = bcsr_read(BCSR_STATUS) & BCSR_STATUS_DB1000_SWAPBOOT;
45 db1x_register_norflash(64 * 1024 * 1024, 4, swapped);
46
47 return 0;
48}
49device_initcall(pb1500_dev_init);
diff --git a/arch/mips/alchemy/devboards/pb1550/Makefile b/arch/mips/alchemy/devboards/pb1550/Makefile
index cff95bcdb2ca..9661b6ec5dd3 100644
--- a/arch/mips/alchemy/devboards/pb1550/Makefile
+++ b/arch/mips/alchemy/devboards/pb1550/Makefile
@@ -5,4 +5,4 @@
5# Makefile for the Alchemy Semiconductor Pb1550 board. 5# Makefile for the Alchemy Semiconductor Pb1550 board.
6# 6#
7 7
8obj-y := board_setup.o 8obj-y := board_setup.o platform.o
diff --git a/arch/mips/alchemy/devboards/pb1550/board_setup.c b/arch/mips/alchemy/devboards/pb1550/board_setup.c
index b6e9e7d247a3..1e8fb3ddd726 100644
--- a/arch/mips/alchemy/devboards/pb1550/board_setup.c
+++ b/arch/mips/alchemy/devboards/pb1550/board_setup.c
@@ -32,18 +32,15 @@
32 32
33#include <asm/mach-au1x00/au1000.h> 33#include <asm/mach-au1x00/au1000.h>
34#include <asm/mach-pb1x00/pb1550.h> 34#include <asm/mach-pb1x00/pb1550.h>
35#include <asm/mach-db1x00/bcsr.h>
36#include <asm/mach-au1x00/gpio.h>
35 37
36#include <prom.h> 38#include <prom.h>
37 39
38 40
39char irq_tab_alchemy[][5] __initdata = { 41char irq_tab_alchemy[][5] __initdata = {
40 [12] = { -1, INTB, INTC, INTD, INTA }, /* IDSEL 12 - PCI slot 2 (left) */ 42 [12] = { -1, AU1550_PCI_INTB, AU1550_PCI_INTC, AU1550_PCI_INTD, AU1550_PCI_INTA }, /* IDSEL 12 - PCI slot 2 (left) */
41 [13] = { -1, INTA, INTB, INTC, INTD }, /* IDSEL 13 - PCI slot 1 (right) */ 43 [13] = { -1, AU1550_PCI_INTA, AU1550_PCI_INTB, AU1550_PCI_INTC, AU1550_PCI_INTD }, /* IDSEL 13 - PCI slot 1 (right) */
42};
43
44struct au1xxx_irqmap __initdata au1xxx_irq_map[] = {
45 { AU1000_GPIO_0, IRQF_TRIGGER_LOW, 0 },
46 { AU1000_GPIO_1, IRQF_TRIGGER_LOW, 0 },
47}; 44};
48 45
49const char *get_system_type(void) 46const char *get_system_type(void)
@@ -53,28 +50,17 @@ const char *get_system_type(void)
53 50
54void board_reset(void) 51void board_reset(void)
55{ 52{
56 /* Hit BCSR.SYSTEM[RESET] */ 53 bcsr_write(BCSR_SYSTEM, 0);
57 au_writew(au_readw(0xAF00001C) & ~BCSR_SYSTEM_RESET, 0xAF00001C);
58}
59
60void __init board_init_irq(void)
61{
62 au1xxx_setup_irqmap(au1xxx_irq_map, ARRAY_SIZE(au1xxx_irq_map));
63} 54}
64 55
65void __init board_setup(void) 56void __init board_setup(void)
66{ 57{
67 u32 pin_func; 58 u32 pin_func;
68 59
69#ifdef CONFIG_SERIAL_8250_CONSOLE 60 bcsr_init(PB1550_BCSR_PHYS_ADDR,
70 char *argptr; 61 PB1550_BCSR_PHYS_ADDR + PB1550_BCSR_HEXLED_OFS);
71 argptr = prom_getcmdline(); 62
72 argptr = strstr(argptr, "console="); 63 alchemy_gpio2_enable();
73 if (argptr == NULL) {
74 argptr = prom_getcmdline();
75 strcat(argptr, " console=ttyS0,115200");
76 }
77#endif
78 64
79 /* 65 /*
80 * Enable PSC1 SYNC for AC'97. Normaly done in audio driver, 66 * Enable PSC1 SYNC for AC'97. Normaly done in audio driver,
@@ -85,8 +71,21 @@ void __init board_setup(void)
85 pin_func |= SYS_PF_MUST_BE_SET | SYS_PF_PSC1_S1; 71 pin_func |= SYS_PF_MUST_BE_SET | SYS_PF_PSC1_S1;
86 au_writel(pin_func, SYS_PINFUNC); 72 au_writel(pin_func, SYS_PINFUNC);
87 73
88 au_writel(0, (u32)bcsr | 0x10); /* turn off PCMCIA power */ 74 bcsr_write(BCSR_PCMCIA, 0); /* turn off PCMCIA power */
89 au_sync();
90 75
91 printk(KERN_INFO "AMD Alchemy Pb1550 Board\n"); 76 printk(KERN_INFO "AMD Alchemy Pb1550 Board\n");
92} 77}
78
79static int __init pb1550_init_irq(void)
80{
81 set_irq_type(AU1550_GPIO0_INT, IRQF_TRIGGER_LOW);
82 set_irq_type(AU1550_GPIO1_INT, IRQF_TRIGGER_LOW);
83 set_irq_type(AU1550_GPIO201_205_INT, IRQF_TRIGGER_HIGH);
84
85 /* enable both PCMCIA card irqs in the shared line */
86 alchemy_gpio2_enable_int(201);
87 alchemy_gpio2_enable_int(202);
88
89 return 0;
90}
91arch_initcall(pb1550_init_irq);
diff --git a/arch/mips/alchemy/devboards/pb1550/platform.c b/arch/mips/alchemy/devboards/pb1550/platform.c
new file mode 100644
index 000000000000..d7150d0f49c0
--- /dev/null
+++ b/arch/mips/alchemy/devboards/pb1550/platform.c
@@ -0,0 +1,69 @@
1/*
2 * Pb1550 board platform device registration
3 *
4 * Copyright (C) 2009 Manuel Lauss
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21#include <linux/init.h>
22
23#include <asm/mach-au1x00/au1000.h>
24#include <asm/mach-pb1x00/pb1550.h>
25#include <asm/mach-db1x00/bcsr.h>
26
27#include "../platform.h"
28
29static int __init pb1550_dev_init(void)
30{
31 int swapped;
32
33 /* Pb1550, like all others, also has statuschange irqs; however they're
34 * wired up on one of the Au1550's shared GPIO201_205 line, which also
35 * services the PCMCIA card interrupts. So we ignore statuschange and
36 * use the GPIO201_205 exclusively for card interrupts, since a) pcmcia
37 * drivers are used to shared irqs and b) statuschange isn't really use-
38 * ful anyway.
39 */
40 db1x_register_pcmcia_socket(PCMCIA_ATTR_PHYS_ADDR,
41 PCMCIA_ATTR_PHYS_ADDR + 0x000400000 - 1,
42 PCMCIA_MEM_PHYS_ADDR,
43 PCMCIA_MEM_PHYS_ADDR + 0x000400000 - 1,
44 PCMCIA_IO_PHYS_ADDR,
45 PCMCIA_IO_PHYS_ADDR + 0x000010000 - 1,
46 AU1550_GPIO201_205_INT,
47 AU1550_GPIO0_INT,
48 0,
49 0,
50 0);
51
52 db1x_register_pcmcia_socket(PCMCIA_ATTR_PHYS_ADDR + 0x008000000,
53 PCMCIA_ATTR_PHYS_ADDR + 0x008400000 - 1,
54 PCMCIA_MEM_PHYS_ADDR + 0x008000000,
55 PCMCIA_MEM_PHYS_ADDR + 0x008400000 - 1,
56 PCMCIA_IO_PHYS_ADDR + 0x008000000,
57 PCMCIA_IO_PHYS_ADDR + 0x008010000 - 1,
58 AU1550_GPIO201_205_INT,
59 AU1550_GPIO1_INT,
60 0,
61 0,
62 1);
63
64 swapped = bcsr_read(BCSR_STATUS) & BCSR_STATUS_PB1550_SWAPBOOT;
65 db1x_register_norflash(128 * 1024 * 1024, 4, swapped);
66
67 return 0;
68}
69device_initcall(pb1550_dev_init);
diff --git a/arch/mips/alchemy/devboards/platform.c b/arch/mips/alchemy/devboards/platform.c
new file mode 100644
index 000000000000..49a4b3244d8e
--- /dev/null
+++ b/arch/mips/alchemy/devboards/platform.c
@@ -0,0 +1,222 @@
1/*
2 * devoard misc stuff.
3 */
4
5#include <linux/init.h>
6#include <linux/mtd/mtd.h>
7#include <linux/mtd/map.h>
8#include <linux/mtd/physmap.h>
9#include <linux/slab.h>
10#include <linux/platform_device.h>
11#include <linux/pm.h>
12
13#include <asm/reboot.h>
14#include <asm/mach-db1x00/bcsr.h>
15
16static void db1x_power_off(void)
17{
18 bcsr_write(BCSR_RESETS, 0);
19 bcsr_write(BCSR_SYSTEM, BCSR_SYSTEM_PWROFF | BCSR_SYSTEM_RESET);
20}
21
22static void db1x_reset(char *c)
23{
24 bcsr_write(BCSR_RESETS, 0);
25 bcsr_write(BCSR_SYSTEM, 0);
26}
27
28static int __init db1x_poweroff_setup(void)
29{
30 if (!pm_power_off)
31 pm_power_off = db1x_power_off;
32 if (!_machine_halt)
33 _machine_halt = db1x_power_off;
34 if (!_machine_restart)
35 _machine_restart = db1x_reset;
36
37 return 0;
38}
39late_initcall(db1x_poweroff_setup);
40
41/* register a pcmcia socket */
42int __init db1x_register_pcmcia_socket(phys_addr_t pcmcia_attr_start,
43 phys_addr_t pcmcia_attr_end,
44 phys_addr_t pcmcia_mem_start,
45 phys_addr_t pcmcia_mem_end,
46 phys_addr_t pcmcia_io_start,
47 phys_addr_t pcmcia_io_end,
48 int card_irq,
49 int cd_irq,
50 int stschg_irq,
51 int eject_irq,
52 int id)
53{
54 int cnt, i, ret;
55 struct resource *sr;
56 struct platform_device *pd;
57
58 cnt = 5;
59 if (eject_irq)
60 cnt++;
61 if (stschg_irq)
62 cnt++;
63
64 sr = kzalloc(sizeof(struct resource) * cnt, GFP_KERNEL);
65 if (!sr)
66 return -ENOMEM;
67
68 pd = platform_device_alloc("db1xxx_pcmcia", id);
69 if (!pd) {
70 ret = -ENOMEM;
71 goto out;
72 }
73
74 sr[0].name = "pcmcia-attr";
75 sr[0].flags = IORESOURCE_MEM;
76 sr[0].start = pcmcia_attr_start;
77 sr[0].end = pcmcia_attr_end;
78
79 sr[1].name = "pcmcia-mem";
80 sr[1].flags = IORESOURCE_MEM;
81 sr[1].start = pcmcia_mem_start;
82 sr[1].end = pcmcia_mem_end;
83
84 sr[2].name = "pcmcia-io";
85 sr[2].flags = IORESOURCE_MEM;
86 sr[2].start = pcmcia_io_start;
87 sr[2].end = pcmcia_io_end;
88
89 sr[3].name = "insert";
90 sr[3].flags = IORESOURCE_IRQ;
91 sr[3].start = sr[3].end = cd_irq;
92
93 sr[4].name = "card";
94 sr[4].flags = IORESOURCE_IRQ;
95 sr[4].start = sr[4].end = card_irq;
96
97 i = 5;
98 if (stschg_irq) {
99 sr[i].name = "stschg";
100 sr[i].flags = IORESOURCE_IRQ;
101 sr[i].start = sr[i].end = stschg_irq;
102 i++;
103 }
104 if (eject_irq) {
105 sr[i].name = "eject";
106 sr[i].flags = IORESOURCE_IRQ;
107 sr[i].start = sr[i].end = eject_irq;
108 }
109
110 pd->resource = sr;
111 pd->num_resources = cnt;
112
113 ret = platform_device_add(pd);
114 if (!ret)
115 return 0;
116
117 platform_device_put(pd);
118out:
119 kfree(sr);
120 return ret;
121}
122
123#define YAMON_SIZE 0x00100000
124#define YAMON_ENV_SIZE 0x00040000
125
126int __init db1x_register_norflash(unsigned long size, int width,
127 int swapped)
128{
129 struct physmap_flash_data *pfd;
130 struct platform_device *pd;
131 struct mtd_partition *parts;
132 struct resource *res;
133 int ret, i;
134
135 if (size < (8 * 1024 * 1024))
136 return -EINVAL;
137
138 ret = -ENOMEM;
139 parts = kzalloc(sizeof(struct mtd_partition) * 5, GFP_KERNEL);
140 if (!parts)
141 goto out;
142
143 res = kzalloc(sizeof(struct resource), GFP_KERNEL);
144 if (!res)
145 goto out1;
146
147 pfd = kzalloc(sizeof(struct physmap_flash_data), GFP_KERNEL);
148 if (!pfd)
149 goto out2;
150
151 pd = platform_device_alloc("physmap-flash", 0);
152 if (!pd)
153 goto out3;
154
155 /* NOR flash ends at 0x20000000, regardless of size */
156 res->start = 0x20000000 - size;
157 res->end = 0x20000000 - 1;
158 res->flags = IORESOURCE_MEM;
159
160 /* partition setup. Most Develboards have a switch which allows
161 * to swap the physical locations of the 2 NOR flash banks.
162 */
163 i = 0;
164 if (!swapped) {
165 /* first NOR chip */
166 parts[i].offset = 0;
167 parts[i].name = "User FS";
168 parts[i].size = size / 2;
169 i++;
170 }
171
172 parts[i].offset = MTDPART_OFS_APPEND;
173 parts[i].name = "User FS 2";
174 parts[i].size = (size / 2) - (0x20000000 - 0x1fc00000);
175 i++;
176
177 parts[i].offset = MTDPART_OFS_APPEND;
178 parts[i].name = "YAMON";
179 parts[i].size = YAMON_SIZE;
180 parts[i].mask_flags = MTD_WRITEABLE;
181 i++;
182
183 parts[i].offset = MTDPART_OFS_APPEND;
184 parts[i].name = "raw kernel";
185 parts[i].size = 0x00400000 - YAMON_SIZE - YAMON_ENV_SIZE;
186 i++;
187
188 parts[i].offset = MTDPART_OFS_APPEND;
189 parts[i].name = "YAMON Env";
190 parts[i].size = YAMON_ENV_SIZE;
191 parts[i].mask_flags = MTD_WRITEABLE;
192 i++;
193
194 if (swapped) {
195 parts[i].offset = MTDPART_OFS_APPEND;
196 parts[i].name = "User FS";
197 parts[i].size = size / 2;
198 i++;
199 }
200
201 pfd->width = width;
202 pfd->parts = parts;
203 pfd->nr_parts = 5;
204
205 pd->dev.platform_data = pfd;
206 pd->resource = res;
207 pd->num_resources = 1;
208
209 ret = platform_device_add(pd);
210 if (!ret)
211 return ret;
212
213 platform_device_put(pd);
214out3:
215 kfree(pfd);
216out2:
217 kfree(res);
218out1:
219 kfree(parts);
220out:
221 return ret;
222}
diff --git a/arch/mips/alchemy/devboards/platform.h b/arch/mips/alchemy/devboards/platform.h
new file mode 100644
index 000000000000..5ac055d2cda9
--- /dev/null
+++ b/arch/mips/alchemy/devboards/platform.h
@@ -0,0 +1,21 @@
1#ifndef _DEVBOARD_PLATFORM_H_
2#define _DEVBOARD_PLATFORM_H_
3
4#include <linux/init.h>
5
6int __init db1x_register_pcmcia_socket(phys_addr_t pcmcia_attr_start,
7 phys_addr_t pcmcia_attr_len,
8 phys_addr_t pcmcia_mem_start,
9 phys_addr_t pcmcia_mem_end,
10 phys_addr_t pcmcia_io_start,
11 phys_addr_t pcmcia_io_end,
12 int card_irq,
13 int cd_irq,
14 int stschg_irq,
15 int eject_irq,
16 int id);
17
18int __init db1x_register_norflash(unsigned long size, int width,
19 int swapped);
20
21#endif
diff --git a/arch/mips/alchemy/devboards/pm.c b/arch/mips/alchemy/devboards/pm.c
index 632f9862a0fb..4bbd3133e451 100644
--- a/arch/mips/alchemy/devboards/pm.c
+++ b/arch/mips/alchemy/devboards/pm.c
@@ -10,6 +10,7 @@
10#include <linux/sysfs.h> 10#include <linux/sysfs.h>
11#include <asm/mach-au1x00/au1000.h> 11#include <asm/mach-au1x00/au1000.h>
12#include <asm/mach-au1x00/gpio.h> 12#include <asm/mach-au1x00/gpio.h>
13#include <asm/mach-db1x00/bcsr.h>
13 14
14/* 15/*
15 * Generic suspend userspace interface for Alchemy development boards. 16 * Generic suspend userspace interface for Alchemy development boards.
@@ -26,6 +27,20 @@ static unsigned long db1x_pm_last_wakesrc;
26 27
27static int db1x_pm_enter(suspend_state_t state) 28static int db1x_pm_enter(suspend_state_t state)
28{ 29{
30 unsigned short bcsrs[16];
31 int i, j, hasint;
32
33 /* save CPLD regs */
34 hasint = bcsr_read(BCSR_WHOAMI);
35 hasint = BCSR_WHOAMI_BOARD(hasint) >= BCSR_WHOAMI_DB1200;
36 j = (hasint) ? BCSR_MASKSET : BCSR_SYSTEM;
37
38 for (i = BCSR_STATUS; i <= j; i++)
39 bcsrs[i] = bcsr_read(i);
40
41 /* shut off hexleds */
42 bcsr_write(BCSR_HEXCLEAR, 3);
43
29 /* enable GPIO based wakeup */ 44 /* enable GPIO based wakeup */
30 alchemy_gpio1_input_enable(); 45 alchemy_gpio1_input_enable();
31 46
@@ -52,6 +67,23 @@ static int db1x_pm_enter(suspend_state_t state)
52 /* ...and now the sandman can come! */ 67 /* ...and now the sandman can come! */
53 au_sleep(); 68 au_sleep();
54 69
70
71 /* restore CPLD regs */
72 for (i = BCSR_STATUS; i <= BCSR_SYSTEM; i++)
73 bcsr_write(i, bcsrs[i]);
74
75 /* restore CPLD int registers */
76 if (hasint) {
77 bcsr_write(BCSR_INTCLR, 0xffff);
78 bcsr_write(BCSR_MASKCLR, 0xffff);
79 bcsr_write(BCSR_INTSTAT, 0xffff);
80 bcsr_write(BCSR_INTSET, bcsrs[BCSR_INTSET]);
81 bcsr_write(BCSR_MASKSET, bcsrs[BCSR_MASKSET]);
82 }
83
84 /* light up hexleds */
85 bcsr_write(BCSR_HEXCLEAR, 0);
86
55 return 0; 87 return 0;
56} 88}
57 89
diff --git a/arch/mips/alchemy/devboards/prom.c b/arch/mips/alchemy/devboards/prom.c
index 0042bd6b1d7d..b30df5c97ad3 100644
--- a/arch/mips/alchemy/devboards/prom.c
+++ b/arch/mips/alchemy/devboards/prom.c
@@ -60,3 +60,8 @@ void __init prom_init(void)
60 strict_strtoul(memsize_str, 0, &memsize); 60 strict_strtoul(memsize_str, 0, &memsize);
61 add_memory_region(0, memsize, BOOT_MEM_RAM); 61 add_memory_region(0, memsize, BOOT_MEM_RAM);
62} 62}
63
64void prom_putchar(unsigned char c)
65{
66 alchemy_uart_putchar(UART0_PHYS_ADDR, c);
67}
diff --git a/arch/mips/alchemy/mtx-1/Makefile b/arch/mips/alchemy/mtx-1/Makefile
index 7c67b3d33bec..4a53815b3c6c 100644
--- a/arch/mips/alchemy/mtx-1/Makefile
+++ b/arch/mips/alchemy/mtx-1/Makefile
@@ -6,7 +6,7 @@
6# Makefile for 4G Systems MTX-1 board. 6# Makefile for 4G Systems MTX-1 board.
7# 7#
8 8
9lib-y := init.o board_setup.o irqmap.o 9lib-y := init.o board_setup.o
10obj-y := platform.o 10obj-y := platform.o
11 11
12EXTRA_CFLAGS += -Werror 12EXTRA_CFLAGS += -Werror
diff --git a/arch/mips/alchemy/mtx-1/board_setup.c b/arch/mips/alchemy/mtx-1/board_setup.c
index 45b61c9b82b9..a9f0336e1f1f 100644
--- a/arch/mips/alchemy/mtx-1/board_setup.c
+++ b/arch/mips/alchemy/mtx-1/board_setup.c
@@ -30,32 +30,43 @@
30 30
31#include <linux/gpio.h> 31#include <linux/gpio.h>
32#include <linux/init.h> 32#include <linux/init.h>
33#include <linux/interrupt.h>
34#include <linux/pm.h>
33 35
36#include <asm/reboot.h>
34#include <asm/mach-au1x00/au1000.h> 37#include <asm/mach-au1x00/au1000.h>
35 38
36#include <prom.h> 39#include <prom.h>
37 40
41char irq_tab_alchemy[][5] __initdata = {
42 [0] = { -1, AU1500_PCI_INTA, AU1500_PCI_INTA, 0xff, 0xff }, /* IDSEL 00 - AdapterA-Slot0 (top) */
43 [1] = { -1, AU1500_PCI_INTB, AU1500_PCI_INTA, 0xff, 0xff }, /* IDSEL 01 - AdapterA-Slot1 (bottom) */
44 [2] = { -1, AU1500_PCI_INTC, AU1500_PCI_INTD, 0xff, 0xff }, /* IDSEL 02 - AdapterB-Slot0 (top) */
45 [3] = { -1, AU1500_PCI_INTD, AU1500_PCI_INTC, 0xff, 0xff }, /* IDSEL 03 - AdapterB-Slot1 (bottom) */
46 [4] = { -1, AU1500_PCI_INTA, AU1500_PCI_INTB, 0xff, 0xff }, /* IDSEL 04 - AdapterC-Slot0 (top) */
47 [5] = { -1, AU1500_PCI_INTB, AU1500_PCI_INTA, 0xff, 0xff }, /* IDSEL 05 - AdapterC-Slot1 (bottom) */
48 [6] = { -1, AU1500_PCI_INTC, AU1500_PCI_INTD, 0xff, 0xff }, /* IDSEL 06 - AdapterD-Slot0 (top) */
49 [7] = { -1, AU1500_PCI_INTD, AU1500_PCI_INTC, 0xff, 0xff }, /* IDSEL 07 - AdapterD-Slot1 (bottom) */
50};
51
38extern int (*board_pci_idsel)(unsigned int devsel, int assert); 52extern int (*board_pci_idsel)(unsigned int devsel, int assert);
39int mtx1_pci_idsel(unsigned int devsel, int assert); 53int mtx1_pci_idsel(unsigned int devsel, int assert);
40 54
41void board_reset(void) 55static void mtx1_reset(char *c)
42{ 56{
43 /* Hit BCSR.SYSTEM_CONTROL[SW_RST] */ 57 /* Hit BCSR.SYSTEM_CONTROL[SW_RST] */
44 au_writel(0x00000000, 0xAE00001C); 58 au_writel(0x00000000, 0xAE00001C);
45} 59}
46 60
47void __init board_setup(void) 61static void mtx1_power_off(void)
48{ 62{
49#ifdef CONFIG_SERIAL_8250_CONSOLE 63 printk(KERN_ALERT "It's now safe to remove power\n");
50 char *argptr; 64 while (1)
51 argptr = prom_getcmdline(); 65 asm volatile (".set mips3 ; wait ; .set mips1");
52 argptr = strstr(argptr, "console="); 66}
53 if (argptr == NULL) {
54 argptr = prom_getcmdline();
55 strcat(argptr, " console=ttyS0,115200");
56 }
57#endif
58 67
68void __init board_setup(void)
69{
59 alchemy_gpio2_enable(); 70 alchemy_gpio2_enable();
60 71
61#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) 72#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
@@ -86,6 +97,10 @@ void __init board_setup(void)
86 alchemy_gpio_direction_output(211, 1); /* green on */ 97 alchemy_gpio_direction_output(211, 1); /* green on */
87 alchemy_gpio_direction_output(212, 0); /* red off */ 98 alchemy_gpio_direction_output(212, 0); /* red off */
88 99
100 pm_power_off = mtx1_power_off;
101 _machine_halt = mtx1_power_off;
102 _machine_restart = mtx1_reset;
103
89 printk(KERN_INFO "4G Systems MTX-1 Board\n"); 104 printk(KERN_INFO "4G Systems MTX-1 Board\n");
90} 105}
91 106
@@ -109,3 +124,15 @@ mtx1_pci_idsel(unsigned int devsel, int assert)
109 au_sync_udelay(1); 124 au_sync_udelay(1);
110 return 1; 125 return 1;
111} 126}
127
128static int __init mtx1_init_irq(void)
129{
130 set_irq_type(AU1500_GPIO204_INT, IRQF_TRIGGER_HIGH);
131 set_irq_type(AU1500_GPIO201_INT, IRQF_TRIGGER_LOW);
132 set_irq_type(AU1500_GPIO202_INT, IRQF_TRIGGER_LOW);
133 set_irq_type(AU1500_GPIO203_INT, IRQF_TRIGGER_LOW);
134 set_irq_type(AU1500_GPIO205_INT, IRQF_TRIGGER_LOW);
135
136 return 0;
137}
138arch_initcall(mtx1_init_irq);
diff --git a/arch/mips/alchemy/mtx-1/init.c b/arch/mips/alchemy/mtx-1/init.c
index 5e871c8d9e96..f8d25575fa05 100644
--- a/arch/mips/alchemy/mtx-1/init.c
+++ b/arch/mips/alchemy/mtx-1/init.c
@@ -32,6 +32,7 @@
32#include <linux/init.h> 32#include <linux/init.h>
33 33
34#include <asm/bootinfo.h> 34#include <asm/bootinfo.h>
35#include <asm/mach-au1x00/au1000.h>
35 36
36#include <prom.h> 37#include <prom.h>
37 38
@@ -58,3 +59,8 @@ void __init prom_init(void)
58 strict_strtoul(memsize_str, 0, &memsize); 59 strict_strtoul(memsize_str, 0, &memsize);
59 add_memory_region(0, memsize, BOOT_MEM_RAM); 60 add_memory_region(0, memsize, BOOT_MEM_RAM);
60} 61}
62
63void prom_putchar(unsigned char c)
64{
65 alchemy_uart_putchar(UART0_PHYS_ADDR, c);
66}
diff --git a/arch/mips/alchemy/mtx-1/irqmap.c b/arch/mips/alchemy/mtx-1/irqmap.c
deleted file mode 100644
index f1ab12ab3433..000000000000
--- a/arch/mips/alchemy/mtx-1/irqmap.c
+++ /dev/null
@@ -1,56 +0,0 @@
1/*
2 * BRIEF MODULE DESCRIPTION
3 * Au1xxx irq map table
4 *
5 * Copyright 2003 Embedded Edge, LLC
6 * dan@embeddededge.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#include <linux/init.h>
30#include <linux/interrupt.h>
31#include <asm/mach-au1x00/au1000.h>
32
33char irq_tab_alchemy[][5] __initdata = {
34 [0] = { -1, INTA, INTA, INTX, INTX }, /* IDSEL 00 - AdapterA-Slot0 (top) */
35 [1] = { -1, INTB, INTA, INTX, INTX }, /* IDSEL 01 - AdapterA-Slot1 (bottom) */
36 [2] = { -1, INTC, INTD, INTX, INTX }, /* IDSEL 02 - AdapterB-Slot0 (top) */
37 [3] = { -1, INTD, INTC, INTX, INTX }, /* IDSEL 03 - AdapterB-Slot1 (bottom) */
38 [4] = { -1, INTA, INTB, INTX, INTX }, /* IDSEL 04 - AdapterC-Slot0 (top) */
39 [5] = { -1, INTB, INTA, INTX, INTX }, /* IDSEL 05 - AdapterC-Slot1 (bottom) */
40 [6] = { -1, INTC, INTD, INTX, INTX }, /* IDSEL 06 - AdapterD-Slot0 (top) */
41 [7] = { -1, INTD, INTC, INTX, INTX }, /* IDSEL 07 - AdapterD-Slot1 (bottom) */
42};
43
44struct au1xxx_irqmap __initdata au1xxx_irq_map[] = {
45 { AU1500_GPIO_204, IRQF_TRIGGER_HIGH, 0 },
46 { AU1500_GPIO_201, IRQF_TRIGGER_LOW, 0 },
47 { AU1500_GPIO_202, IRQF_TRIGGER_LOW, 0 },
48 { AU1500_GPIO_203, IRQF_TRIGGER_LOW, 0 },
49 { AU1500_GPIO_205, IRQF_TRIGGER_LOW, 0 },
50};
51
52
53void __init board_init_irq(void)
54{
55 au1xxx_setup_irqmap(au1xxx_irq_map, ARRAY_SIZE(au1xxx_irq_map));
56}
diff --git a/arch/mips/alchemy/xxs1500/Makefile b/arch/mips/alchemy/xxs1500/Makefile
index db3c526f64d8..4dc81d794cb8 100644
--- a/arch/mips/alchemy/xxs1500/Makefile
+++ b/arch/mips/alchemy/xxs1500/Makefile
@@ -5,4 +5,6 @@
5# Makefile for MyCable XXS1500 board. 5# Makefile for MyCable XXS1500 board.
6# 6#
7 7
8lib-y := init.o board_setup.o irqmap.o 8lib-y := init.o board_setup.o platform.o
9
10EXTRA_CFLAGS += -Werror
diff --git a/arch/mips/alchemy/xxs1500/board_setup.c b/arch/mips/alchemy/xxs1500/board_setup.c
index 4de2d48caed8..47b42927607b 100644
--- a/arch/mips/alchemy/xxs1500/board_setup.c
+++ b/arch/mips/alchemy/xxs1500/board_setup.c
@@ -25,31 +25,35 @@
25 25
26#include <linux/gpio.h> 26#include <linux/gpio.h>
27#include <linux/init.h> 27#include <linux/init.h>
28#include <linux/interrupt.h>
28#include <linux/delay.h> 29#include <linux/delay.h>
30#include <linux/pm.h>
29 31
32#include <asm/reboot.h>
30#include <asm/mach-au1x00/au1000.h> 33#include <asm/mach-au1x00/au1000.h>
31 34
32#include <prom.h> 35#include <prom.h>
33 36
34void board_reset(void) 37static void xxs1500_reset(char *c)
35{ 38{
36 /* Hit BCSR.SYSTEM_CONTROL[SW_RST] */ 39 /* Hit BCSR.SYSTEM_CONTROL[SW_RST] */
37 au_writel(0x00000000, 0xAE00001C); 40 au_writel(0x00000000, 0xAE00001C);
38} 41}
39 42
43static void xxs1500_power_off(void)
44{
45 printk(KERN_ALERT "It's now safe to remove power\n");
46 while (1)
47 asm volatile (".set mips3 ; wait ; .set mips1");
48}
49
40void __init board_setup(void) 50void __init board_setup(void)
41{ 51{
42 u32 pin_func; 52 u32 pin_func;
43 53
44#ifdef CONFIG_SERIAL_8250_CONSOLE 54 pm_power_off = xxs1500_power_off;
45 char *argptr; 55 _machine_halt = xxs1500_power_off;
46 argptr = prom_getcmdline(); 56 _machine_restart = xxs1500_reset;
47 argptr = strstr(argptr, "console=");
48 if (argptr == NULL) {
49 argptr = prom_getcmdline();
50 strcat(argptr, " console=ttyS0,115200");
51 }
52#endif
53 57
54 alchemy_gpio1_input_enable(); 58 alchemy_gpio1_input_enable();
55 alchemy_gpio2_enable(); 59 alchemy_gpio2_enable();
@@ -68,22 +72,6 @@ void __init board_setup(void)
68 /* Enable DTR = USB power up */ 72 /* Enable DTR = USB power up */
69 au_writel(0x01, UART3_ADDR + UART_MCR); /* UART_MCR_DTR is 0x01??? */ 73 au_writel(0x01, UART3_ADDR + UART_MCR); /* UART_MCR_DTR is 0x01??? */
70 74
71#ifdef CONFIG_PCMCIA_XXS1500
72 /* GPIO 0, 1, and 4 are inputs */
73 alchemy_gpio_direction_input(0);
74 alchemy_gpio_direction_input(1);
75 alchemy_gpio_direction_input(4);
76
77 /* GPIO2 208/9/10/11 are inputs */
78 alchemy_gpio_direction_input(208);
79 alchemy_gpio_direction_input(209);
80 alchemy_gpio_direction_input(210);
81 alchemy_gpio_direction_input(211);
82
83 /* Turn off power */
84 alchemy_gpio_direction_output(214, 0);
85#endif
86
87#ifdef CONFIG_PCI 75#ifdef CONFIG_PCI
88#if defined(__MIPSEB__) 76#if defined(__MIPSEB__)
89 au_writel(0xf | (2 << 6) | (1 << 4), Au1500_PCI_CFG); 77 au_writel(0xf | (2 << 6) | (1 << 4), Au1500_PCI_CFG);
@@ -92,3 +80,23 @@ void __init board_setup(void)
92#endif 80#endif
93#endif 81#endif
94} 82}
83
84static int __init xxs1500_init_irq(void)
85{
86 set_irq_type(AU1500_GPIO204_INT, IRQF_TRIGGER_HIGH);
87 set_irq_type(AU1500_GPIO201_INT, IRQF_TRIGGER_LOW);
88 set_irq_type(AU1500_GPIO202_INT, IRQF_TRIGGER_LOW);
89 set_irq_type(AU1500_GPIO203_INT, IRQF_TRIGGER_LOW);
90 set_irq_type(AU1500_GPIO205_INT, IRQF_TRIGGER_LOW);
91 set_irq_type(AU1500_GPIO207_INT, IRQF_TRIGGER_LOW);
92
93 set_irq_type(AU1500_GPIO0_INT, IRQF_TRIGGER_LOW);
94 set_irq_type(AU1500_GPIO1_INT, IRQF_TRIGGER_LOW);
95 set_irq_type(AU1500_GPIO2_INT, IRQF_TRIGGER_LOW);
96 set_irq_type(AU1500_GPIO3_INT, IRQF_TRIGGER_LOW);
97 set_irq_type(AU1500_GPIO4_INT, IRQF_TRIGGER_LOW); /* CF irq */
98 set_irq_type(AU1500_GPIO5_INT, IRQF_TRIGGER_LOW);
99
100 return 0;
101}
102arch_initcall(xxs1500_init_irq);
diff --git a/arch/mips/alchemy/xxs1500/init.c b/arch/mips/alchemy/xxs1500/init.c
index 456fa142c093..15125c2fda7d 100644
--- a/arch/mips/alchemy/xxs1500/init.c
+++ b/arch/mips/alchemy/xxs1500/init.c
@@ -30,6 +30,7 @@
30#include <linux/kernel.h> 30#include <linux/kernel.h>
31 31
32#include <asm/bootinfo.h> 32#include <asm/bootinfo.h>
33#include <asm/mach-au1x00/au1000.h>
33 34
34#include <prom.h> 35#include <prom.h>
35 36
@@ -56,3 +57,8 @@ void __init prom_init(void)
56 strict_strtoul(memsize_str, 0, &memsize); 57 strict_strtoul(memsize_str, 0, &memsize);
57 add_memory_region(0, memsize, BOOT_MEM_RAM); 58 add_memory_region(0, memsize, BOOT_MEM_RAM);
58} 59}
60
61void prom_putchar(unsigned char c)
62{
63 alchemy_uart_putchar(UART0_PHYS_ADDR, c);
64}
diff --git a/arch/mips/alchemy/xxs1500/irqmap.c b/arch/mips/alchemy/xxs1500/irqmap.c
deleted file mode 100644
index 0f0f3012e5fd..000000000000
--- a/arch/mips/alchemy/xxs1500/irqmap.c
+++ /dev/null
@@ -1,52 +0,0 @@
1/*
2 * BRIEF MODULE DESCRIPTION
3 * Au1xxx irq map table
4 *
5 * Copyright 2003 Embedded Edge, LLC
6 * dan@embeddededge.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#include <linux/init.h>
30#include <linux/interrupt.h>
31#include <asm/mach-au1x00/au1000.h>
32
33struct au1xxx_irqmap __initdata au1xxx_irq_map[] = {
34 { AU1500_GPIO_204, IRQF_TRIGGER_HIGH, 0 },
35 { AU1500_GPIO_201, IRQF_TRIGGER_LOW, 0 },
36 { AU1500_GPIO_202, IRQF_TRIGGER_LOW, 0 },
37 { AU1500_GPIO_203, IRQF_TRIGGER_LOW, 0 },
38 { AU1500_GPIO_205, IRQF_TRIGGER_LOW, 0 },
39 { AU1500_GPIO_207, IRQF_TRIGGER_LOW, 0 },
40
41 { AU1000_GPIO_0, IRQF_TRIGGER_LOW, 0 },
42 { AU1000_GPIO_1, IRQF_TRIGGER_LOW, 0 },
43 { AU1000_GPIO_2, IRQF_TRIGGER_LOW, 0 },
44 { AU1000_GPIO_3, IRQF_TRIGGER_LOW, 0 },
45 { AU1000_GPIO_4, IRQF_TRIGGER_LOW, 0 }, /* CF interrupt */
46 { AU1000_GPIO_5, IRQF_TRIGGER_LOW, 0 },
47};
48
49void __init board_init_irq(void)
50{
51 au1xxx_setup_irqmap(au1xxx_irq_map, ARRAY_SIZE(au1xxx_irq_map));
52}
diff --git a/arch/mips/alchemy/xxs1500/platform.c b/arch/mips/alchemy/xxs1500/platform.c
new file mode 100644
index 000000000000..e87c45cde61b
--- /dev/null
+++ b/arch/mips/alchemy/xxs1500/platform.c
@@ -0,0 +1,63 @@
1/*
2 * XXS1500 board platform device registration
3 *
4 * Copyright (C) 2009 Manuel Lauss
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21#include <linux/init.h>
22#include <linux/platform_device.h>
23
24#include <asm/mach-au1x00/au1000.h>
25
26static struct resource xxs1500_pcmcia_res[] = {
27 {
28 .name = "pcmcia-io",
29 .flags = IORESOURCE_MEM,
30 .start = PCMCIA_IO_PHYS_ADDR,
31 .end = PCMCIA_IO_PHYS_ADDR + 0x000400000 - 1,
32 },
33 {
34 .name = "pcmcia-attr",
35 .flags = IORESOURCE_MEM,
36 .start = PCMCIA_ATTR_PHYS_ADDR,
37 .end = PCMCIA_ATTR_PHYS_ADDR + 0x000400000 - 1,
38 },
39 {
40 .name = "pcmcia-mem",
41 .flags = IORESOURCE_MEM,
42 .start = PCMCIA_MEM_PHYS_ADDR,
43 .end = PCMCIA_MEM_PHYS_ADDR + 0x000400000 - 1,
44 },
45};
46
47static struct platform_device xxs1500_pcmcia_dev = {
48 .name = "xxs1500_pcmcia",
49 .id = -1,
50 .num_resources = ARRAY_SIZE(xxs1500_pcmcia_res),
51 .resource = xxs1500_pcmcia_res,
52};
53
54static struct platform_device *xxs1500_devs[] __initdata = {
55 &xxs1500_pcmcia_dev,
56};
57
58static int __init xxs1500_dev_init(void)
59{
60 return platform_add_devices(xxs1500_devs,
61 ARRAY_SIZE(xxs1500_devs));
62}
63device_initcall(xxs1500_dev_init);
diff --git a/arch/mips/ar7/clock.c b/arch/mips/ar7/clock.c
index cc65c8eb391b..fc0e7154e8d6 100644
--- a/arch/mips/ar7/clock.c
+++ b/arch/mips/ar7/clock.c
@@ -1,6 +1,7 @@
1/* 1/*
2 * Copyright (C) 2007 Felix Fietkau <nbd@openwrt.org> 2 * Copyright (C) 2007 Felix Fietkau <nbd@openwrt.org>
3 * Copyright (C) 2007 Eugene Konev <ejka@openwrt.org> 3 * Copyright (C) 2007 Eugene Konev <ejka@openwrt.org>
4 * Copyright (C) 2009 Florian Fainelli <florian@openwrt.org>
4 * 5 *
5 * 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
6 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
@@ -24,6 +25,8 @@
24#include <linux/delay.h> 25#include <linux/delay.h>
25#include <linux/gcd.h> 26#include <linux/gcd.h>
26#include <linux/io.h> 27#include <linux/io.h>
28#include <linux/err.h>
29#include <linux/clk.h>
27 30
28#include <asm/addrspace.h> 31#include <asm/addrspace.h>
29#include <asm/mach-ar7/ar7.h> 32#include <asm/mach-ar7/ar7.h>
@@ -94,12 +97,16 @@ struct tnetd7200_clocks {
94 struct tnetd7200_clock usb; 97 struct tnetd7200_clock usb;
95}; 98};
96 99
97int ar7_cpu_clock = 150000000; 100static struct clk bus_clk = {
98EXPORT_SYMBOL(ar7_cpu_clock); 101 .rate = 125000000,
99int ar7_bus_clock = 125000000; 102};
100EXPORT_SYMBOL(ar7_bus_clock); 103
101int ar7_dsp_clock; 104static struct clk cpu_clk = {
102EXPORT_SYMBOL(ar7_dsp_clock); 105 .rate = 150000000,
106};
107
108static struct clk dsp_clk;
109static struct clk vbus_clk;
103 110
104static void approximate(int base, int target, int *prediv, 111static void approximate(int base, int target, int *prediv,
105 int *postdiv, int *mul) 112 int *postdiv, int *mul)
@@ -185,7 +192,7 @@ static int tnetd7300_get_clock(u32 shift, struct tnetd7300_clock *clock,
185 base_clock = AR7_XTAL_CLOCK; 192 base_clock = AR7_XTAL_CLOCK;
186 break; 193 break;
187 case BOOT_PLL_SOURCE_CPU: 194 case BOOT_PLL_SOURCE_CPU:
188 base_clock = ar7_cpu_clock; 195 base_clock = cpu_clk.rate;
189 break; 196 break;
190 } 197 }
191 198
@@ -212,11 +219,11 @@ static void tnetd7300_set_clock(u32 shift, struct tnetd7300_clock *clock,
212 u32 *bootcr, u32 frequency) 219 u32 *bootcr, u32 frequency)
213{ 220{
214 int prediv, postdiv, mul; 221 int prediv, postdiv, mul;
215 int base_clock = ar7_bus_clock; 222 int base_clock = bus_clk.rate;
216 223
217 switch ((*bootcr & (BOOT_PLL_SOURCE_MASK << shift)) >> shift) { 224 switch ((*bootcr & (BOOT_PLL_SOURCE_MASK << shift)) >> shift) {
218 case BOOT_PLL_SOURCE_BUS: 225 case BOOT_PLL_SOURCE_BUS:
219 base_clock = ar7_bus_clock; 226 base_clock = bus_clk.rate;
220 break; 227 break;
221 case BOOT_PLL_SOURCE_REF: 228 case BOOT_PLL_SOURCE_REF:
222 base_clock = AR7_REF_CLOCK; 229 base_clock = AR7_REF_CLOCK;
@@ -225,7 +232,7 @@ static void tnetd7300_set_clock(u32 shift, struct tnetd7300_clock *clock,
225 base_clock = AR7_XTAL_CLOCK; 232 base_clock = AR7_XTAL_CLOCK;
226 break; 233 break;
227 case BOOT_PLL_SOURCE_CPU: 234 case BOOT_PLL_SOURCE_CPU:
228 base_clock = ar7_cpu_clock; 235 base_clock = cpu_clk.rate;
229 break; 236 break;
230 } 237 }
231 238
@@ -247,18 +254,18 @@ static void __init tnetd7300_init_clocks(void)
247 ioremap_nocache(UR8_REGS_CLOCKS, 254 ioremap_nocache(UR8_REGS_CLOCKS,
248 sizeof(struct tnetd7300_clocks)); 255 sizeof(struct tnetd7300_clocks));
249 256
250 ar7_bus_clock = tnetd7300_get_clock(BUS_PLL_SOURCE_SHIFT, 257 bus_clk.rate = tnetd7300_get_clock(BUS_PLL_SOURCE_SHIFT,
251 &clocks->bus, bootcr, AR7_AFE_CLOCK); 258 &clocks->bus, bootcr, AR7_AFE_CLOCK);
252 259
253 if (*bootcr & BOOT_PLL_ASYNC_MODE) 260 if (*bootcr & BOOT_PLL_ASYNC_MODE)
254 ar7_cpu_clock = tnetd7300_get_clock(CPU_PLL_SOURCE_SHIFT, 261 cpu_clk.rate = tnetd7300_get_clock(CPU_PLL_SOURCE_SHIFT,
255 &clocks->cpu, bootcr, AR7_AFE_CLOCK); 262 &clocks->cpu, bootcr, AR7_AFE_CLOCK);
256 else 263 else
257 ar7_cpu_clock = ar7_bus_clock; 264 cpu_clk.rate = bus_clk.rate;
258 265
259 if (ar7_dsp_clock == 250000000) 266 if (dsp_clk.rate == 250000000)
260 tnetd7300_set_clock(DSP_PLL_SOURCE_SHIFT, &clocks->dsp, 267 tnetd7300_set_clock(DSP_PLL_SOURCE_SHIFT, &clocks->dsp,
261 bootcr, ar7_dsp_clock); 268 bootcr, dsp_clk.rate);
262 269
263 iounmap(clocks); 270 iounmap(clocks);
264 iounmap(bootcr); 271 iounmap(bootcr);
@@ -343,20 +350,20 @@ static void __init tnetd7200_init_clocks(void)
343 printk(KERN_INFO "Clocks: Setting DSP clock\n"); 350 printk(KERN_INFO "Clocks: Setting DSP clock\n");
344 calculate(dsp_base, TNETD7200_DEF_DSP_CLK, 351 calculate(dsp_base, TNETD7200_DEF_DSP_CLK,
345 &dsp_prediv, &dsp_postdiv, &dsp_mul); 352 &dsp_prediv, &dsp_postdiv, &dsp_mul);
346 ar7_bus_clock = 353 bus_clk.rate =
347 ((dsp_base / dsp_prediv) * dsp_mul) / dsp_postdiv; 354 ((dsp_base / dsp_prediv) * dsp_mul) / dsp_postdiv;
348 tnetd7200_set_clock(dsp_base, &clocks->dsp, 355 tnetd7200_set_clock(dsp_base, &clocks->dsp,
349 dsp_prediv, dsp_postdiv * 2, dsp_postdiv, dsp_mul * 2, 356 dsp_prediv, dsp_postdiv * 2, dsp_postdiv, dsp_mul * 2,
350 ar7_bus_clock); 357 bus_clk.rate);
351 358
352 printk(KERN_INFO "Clocks: Setting CPU clock\n"); 359 printk(KERN_INFO "Clocks: Setting CPU clock\n");
353 calculate(cpu_base, TNETD7200_DEF_CPU_CLK, &cpu_prediv, 360 calculate(cpu_base, TNETD7200_DEF_CPU_CLK, &cpu_prediv,
354 &cpu_postdiv, &cpu_mul); 361 &cpu_postdiv, &cpu_mul);
355 ar7_cpu_clock = 362 cpu_clk.rate =
356 ((cpu_base / cpu_prediv) * cpu_mul) / cpu_postdiv; 363 ((cpu_base / cpu_prediv) * cpu_mul) / cpu_postdiv;
357 tnetd7200_set_clock(cpu_base, &clocks->cpu, 364 tnetd7200_set_clock(cpu_base, &clocks->cpu,
358 cpu_prediv, cpu_postdiv, -1, cpu_mul, 365 cpu_prediv, cpu_postdiv, -1, cpu_mul,
359 ar7_cpu_clock); 366 cpu_clk.rate);
360 367
361 } else 368 } else
362 if (*bootcr & BOOT_PLL_2TO1_MODE) { 369 if (*bootcr & BOOT_PLL_2TO1_MODE) {
@@ -365,48 +372,90 @@ static void __init tnetd7200_init_clocks(void)
365 printk(KERN_INFO "Clocks: Setting CPU clock\n"); 372 printk(KERN_INFO "Clocks: Setting CPU clock\n");
366 calculate(cpu_base, TNETD7200_DEF_CPU_CLK, &cpu_prediv, 373 calculate(cpu_base, TNETD7200_DEF_CPU_CLK, &cpu_prediv,
367 &cpu_postdiv, &cpu_mul); 374 &cpu_postdiv, &cpu_mul);
368 ar7_cpu_clock = ((cpu_base / cpu_prediv) * cpu_mul) 375 cpu_clk.rate = ((cpu_base / cpu_prediv) * cpu_mul)
369 / cpu_postdiv; 376 / cpu_postdiv;
370 tnetd7200_set_clock(cpu_base, &clocks->cpu, 377 tnetd7200_set_clock(cpu_base, &clocks->cpu,
371 cpu_prediv, cpu_postdiv, -1, cpu_mul, 378 cpu_prediv, cpu_postdiv, -1, cpu_mul,
372 ar7_cpu_clock); 379 cpu_clk.rate);
373 380
374 printk(KERN_INFO "Clocks: Setting DSP clock\n"); 381 printk(KERN_INFO "Clocks: Setting DSP clock\n");
375 calculate(dsp_base, TNETD7200_DEF_DSP_CLK, &dsp_prediv, 382 calculate(dsp_base, TNETD7200_DEF_DSP_CLK, &dsp_prediv,
376 &dsp_postdiv, &dsp_mul); 383 &dsp_postdiv, &dsp_mul);
377 ar7_bus_clock = ar7_cpu_clock / 2; 384 bus_clk.rate = cpu_clk.rate / 2;
378 tnetd7200_set_clock(dsp_base, &clocks->dsp, 385 tnetd7200_set_clock(dsp_base, &clocks->dsp,
379 dsp_prediv, dsp_postdiv * 2, dsp_postdiv, 386 dsp_prediv, dsp_postdiv * 2, dsp_postdiv,
380 dsp_mul * 2, ar7_bus_clock); 387 dsp_mul * 2, bus_clk.rate);
381 } else { 388 } else {
382 printk(KERN_INFO "Clocks: Sync 1:1 mode\n"); 389 printk(KERN_INFO "Clocks: Sync 1:1 mode\n");
383 390
384 printk(KERN_INFO "Clocks: Setting DSP clock\n"); 391 printk(KERN_INFO "Clocks: Setting DSP clock\n");
385 calculate(dsp_base, TNETD7200_DEF_DSP_CLK, &dsp_prediv, 392 calculate(dsp_base, TNETD7200_DEF_DSP_CLK, &dsp_prediv,
386 &dsp_postdiv, &dsp_mul); 393 &dsp_postdiv, &dsp_mul);
387 ar7_bus_clock = ((dsp_base / dsp_prediv) * dsp_mul) 394 bus_clk.rate = ((dsp_base / dsp_prediv) * dsp_mul)
388 / dsp_postdiv; 395 / dsp_postdiv;
389 tnetd7200_set_clock(dsp_base, &clocks->dsp, 396 tnetd7200_set_clock(dsp_base, &clocks->dsp,
390 dsp_prediv, dsp_postdiv * 2, dsp_postdiv, 397 dsp_prediv, dsp_postdiv * 2, dsp_postdiv,
391 dsp_mul * 2, ar7_bus_clock); 398 dsp_mul * 2, bus_clk.rate);
392 399
393 ar7_cpu_clock = ar7_bus_clock; 400 cpu_clk.rate = bus_clk.rate;
394 } 401 }
395 402
396 printk(KERN_INFO "Clocks: Setting USB clock\n"); 403 printk(KERN_INFO "Clocks: Setting USB clock\n");
397 usb_base = ar7_bus_clock; 404 usb_base = bus_clk.rate;
398 calculate(usb_base, TNETD7200_DEF_USB_CLK, &usb_prediv, 405 calculate(usb_base, TNETD7200_DEF_USB_CLK, &usb_prediv,
399 &usb_postdiv, &usb_mul); 406 &usb_postdiv, &usb_mul);
400 tnetd7200_set_clock(usb_base, &clocks->usb, 407 tnetd7200_set_clock(usb_base, &clocks->usb,
401 usb_prediv, usb_postdiv, -1, usb_mul, 408 usb_prediv, usb_postdiv, -1, usb_mul,
402 TNETD7200_DEF_USB_CLK); 409 TNETD7200_DEF_USB_CLK);
403 410
404 ar7_dsp_clock = ar7_cpu_clock; 411 dsp_clk.rate = cpu_clk.rate;
405 412
406 iounmap(clocks); 413 iounmap(clocks);
407 iounmap(bootcr); 414 iounmap(bootcr);
408} 415}
409 416
417/*
418 * Linux clock API
419 */
420int clk_enable(struct clk *clk)
421{
422 return 0;
423}
424EXPORT_SYMBOL(clk_enable);
425
426void clk_disable(struct clk *clk)
427{
428}
429EXPORT_SYMBOL(clk_disable);
430
431unsigned long clk_get_rate(struct clk *clk)
432{
433 return clk->rate;
434}
435EXPORT_SYMBOL(clk_get_rate);
436
437struct clk *clk_get(struct device *dev, const char *id)
438{
439 if (!strcmp(id, "bus"))
440 return &bus_clk;
441 /* cpmac and vbus share the same rate */
442 if (!strcmp(id, "cpmac"))
443 return &vbus_clk;
444 if (!strcmp(id, "cpu"))
445 return &cpu_clk;
446 if (!strcmp(id, "dsp"));
447 return &dsp_clk;
448 if (!strcmp(id, "vbus"))
449 return &vbus_clk;
450 return ERR_PTR(-ENOENT);
451}
452EXPORT_SYMBOL(clk_get);
453
454void clk_put(struct clk *clk)
455{
456}
457EXPORT_SYMBOL(clk_put);
458
410int __init ar7_init_clocks(void) 459int __init ar7_init_clocks(void)
411{ 460{
412 switch (ar7_chip_id()) { 461 switch (ar7_chip_id()) {
@@ -415,12 +464,14 @@ int __init ar7_init_clocks(void)
415 tnetd7200_init_clocks(); 464 tnetd7200_init_clocks();
416 break; 465 break;
417 case AR7_CHIP_7300: 466 case AR7_CHIP_7300:
418 ar7_dsp_clock = tnetd7300_dsp_clock(); 467 dsp_clk.rate = tnetd7300_dsp_clock();
419 tnetd7300_init_clocks(); 468 tnetd7300_init_clocks();
420 break; 469 break;
421 default: 470 default:
422 break; 471 break;
423 } 472 }
473 /* adjust vbus clock rate */
474 vbus_clk.rate = bus_clk.rate / 2;
424 475
425 return 0; 476 return 0;
426} 477}
diff --git a/arch/mips/ar7/gpio.c b/arch/mips/ar7/gpio.c
index 74e14a3dbf4a..c32fbb57441a 100644
--- a/arch/mips/ar7/gpio.c
+++ b/arch/mips/ar7/gpio.c
@@ -1,6 +1,7 @@
1/* 1/*
2 * Copyright (C) 2007 Felix Fietkau <nbd@openwrt.org> 2 * Copyright (C) 2007 Felix Fietkau <nbd@openwrt.org>
3 * Copyright (C) 2007 Eugene Konev <ejka@openwrt.org> 3 * Copyright (C) 2007 Eugene Konev <ejka@openwrt.org>
4 * Copyright (C) 2009 Florian Fainelli <florian@openwrt.org>
4 * 5 *
5 * 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
6 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
@@ -18,31 +19,113 @@
18 */ 19 */
19 20
20#include <linux/module.h> 21#include <linux/module.h>
22#include <linux/gpio.h>
21 23
22#include <asm/mach-ar7/gpio.h> 24#include <asm/mach-ar7/gpio.h>
23 25
24static const char *ar7_gpio_list[AR7_GPIO_MAX]; 26struct ar7_gpio_chip {
27 void __iomem *regs;
28 struct gpio_chip chip;
29};
25 30
26int gpio_request(unsigned gpio, const char *label) 31static int ar7_gpio_get_value(struct gpio_chip *chip, unsigned gpio)
27{ 32{
28 if (gpio >= AR7_GPIO_MAX) 33 struct ar7_gpio_chip *gpch =
29 return -EINVAL; 34 container_of(chip, struct ar7_gpio_chip, chip);
35 void __iomem *gpio_in = gpch->regs + AR7_GPIO_INPUT;
30 36
31 if (ar7_gpio_list[gpio]) 37 return readl(gpio_in) & (1 << gpio);
32 return -EBUSY; 38}
39
40static void ar7_gpio_set_value(struct gpio_chip *chip,
41 unsigned gpio, int value)
42{
43 struct ar7_gpio_chip *gpch =
44 container_of(chip, struct ar7_gpio_chip, chip);
45 void __iomem *gpio_out = gpch->regs + AR7_GPIO_OUTPUT;
46 unsigned tmp;
47
48 tmp = readl(gpio_out) & ~(1 << gpio);
49 if (value)
50 tmp |= 1 << gpio;
51 writel(tmp, gpio_out);
52}
53
54static int ar7_gpio_direction_input(struct gpio_chip *chip, unsigned gpio)
55{
56 struct ar7_gpio_chip *gpch =
57 container_of(chip, struct ar7_gpio_chip, chip);
58 void __iomem *gpio_dir = gpch->regs + AR7_GPIO_DIR;
33 59
34 if (label) 60 writel(readl(gpio_dir) | (1 << gpio), gpio_dir);
35 ar7_gpio_list[gpio] = label;
36 else
37 ar7_gpio_list[gpio] = "busy";
38 61
39 return 0; 62 return 0;
40} 63}
41EXPORT_SYMBOL(gpio_request);
42 64
43void gpio_free(unsigned gpio) 65static int ar7_gpio_direction_output(struct gpio_chip *chip,
66 unsigned gpio, int value)
44{ 67{
45 BUG_ON(!ar7_gpio_list[gpio]); 68 struct ar7_gpio_chip *gpch =
46 ar7_gpio_list[gpio] = NULL; 69 container_of(chip, struct ar7_gpio_chip, chip);
70 void __iomem *gpio_dir = gpch->regs + AR7_GPIO_DIR;
71
72 ar7_gpio_set_value(chip, gpio, value);
73 writel(readl(gpio_dir) & ~(1 << gpio), gpio_dir);
74
75 return 0;
76}
77
78static struct ar7_gpio_chip ar7_gpio_chip = {
79 .chip = {
80 .label = "ar7-gpio",
81 .direction_input = ar7_gpio_direction_input,
82 .direction_output = ar7_gpio_direction_output,
83 .set = ar7_gpio_set_value,
84 .get = ar7_gpio_get_value,
85 .base = 0,
86 .ngpio = AR7_GPIO_MAX,
87 }
88};
89
90int ar7_gpio_enable(unsigned gpio)
91{
92 void __iomem *gpio_en = ar7_gpio_chip.regs + AR7_GPIO_ENABLE;
93
94 writel(readl(gpio_en) | (1 << gpio), gpio_en);
95
96 return 0;
97}
98EXPORT_SYMBOL(ar7_gpio_enable);
99
100int ar7_gpio_disable(unsigned gpio)
101{
102 void __iomem *gpio_en = ar7_gpio_chip.regs + AR7_GPIO_ENABLE;
103
104 writel(readl(gpio_en) & ~(1 << gpio), gpio_en);
105
106 return 0;
107}
108EXPORT_SYMBOL(ar7_gpio_disable);
109
110static int __init ar7_gpio_init(void)
111{
112 int ret;
113
114 ar7_gpio_chip.regs = ioremap_nocache(AR7_REGS_GPIO,
115 AR7_REGS_GPIO + 0x10);
116
117 if (!ar7_gpio_chip.regs) {
118 printk(KERN_ERR "ar7-gpio: failed to ioremap regs\n");
119 return -ENOMEM;
120 }
121
122 ret = gpiochip_add(&ar7_gpio_chip.chip);
123 if (ret) {
124 printk(KERN_ERR "ar7-gpio: failed to add gpiochip\n");
125 return ret;
126 }
127 printk(KERN_INFO "ar7-gpio: registered %d GPIOs\n",
128 ar7_gpio_chip.chip.ngpio);
129 return ret;
47} 130}
48EXPORT_SYMBOL(gpio_free); 131arch_initcall(ar7_gpio_init);
diff --git a/arch/mips/ar7/memory.c b/arch/mips/ar7/memory.c
index 696c723dc6d4..28abfeef09d6 100644
--- a/arch/mips/ar7/memory.c
+++ b/arch/mips/ar7/memory.c
@@ -62,8 +62,7 @@ void __init prom_meminit(void)
62 unsigned long pages; 62 unsigned long pages;
63 63
64 pages = memsize() >> PAGE_SHIFT; 64 pages = memsize() >> PAGE_SHIFT;
65 add_memory_region(PHYS_OFFSET, pages << PAGE_SHIFT, 65 add_memory_region(PHYS_OFFSET, pages << PAGE_SHIFT, BOOT_MEM_RAM);
66 BOOT_MEM_RAM);
67} 66}
68 67
69void __init prom_free_prom_memory(void) 68void __init prom_free_prom_memory(void)
diff --git a/arch/mips/ar7/platform.c b/arch/mips/ar7/platform.c
index f70a10a8cc96..246df7aca2e7 100644
--- a/arch/mips/ar7/platform.c
+++ b/arch/mips/ar7/platform.c
@@ -34,45 +34,50 @@
34#include <linux/etherdevice.h> 34#include <linux/etherdevice.h>
35#include <linux/phy.h> 35#include <linux/phy.h>
36#include <linux/phy_fixed.h> 36#include <linux/phy_fixed.h>
37#include <linux/gpio.h>
38#include <linux/clk.h>
37 39
38#include <asm/addrspace.h> 40#include <asm/addrspace.h>
39#include <asm/mach-ar7/ar7.h> 41#include <asm/mach-ar7/ar7.h>
40#include <asm/mach-ar7/gpio.h> 42#include <asm/mach-ar7/gpio.h>
41#include <asm/mach-ar7/prom.h> 43#include <asm/mach-ar7/prom.h>
42 44
45/*****************************************************************************
46 * VLYNQ Bus
47 ****************************************************************************/
43struct plat_vlynq_data { 48struct plat_vlynq_data {
44 struct plat_vlynq_ops ops; 49 struct plat_vlynq_ops ops;
45 int gpio_bit; 50 int gpio_bit;
46 int reset_bit; 51 int reset_bit;
47}; 52};
48 53
49
50static int vlynq_on(struct vlynq_device *dev) 54static int vlynq_on(struct vlynq_device *dev)
51{ 55{
52 int result; 56 int ret;
53 struct plat_vlynq_data *pdata = dev->dev.platform_data; 57 struct plat_vlynq_data *pdata = dev->dev.platform_data;
54 58
55 result = gpio_request(pdata->gpio_bit, "vlynq"); 59 ret = gpio_request(pdata->gpio_bit, "vlynq");
56 if (result) 60 if (ret)
57 goto out; 61 goto out;
58 62
59 ar7_device_reset(pdata->reset_bit); 63 ar7_device_reset(pdata->reset_bit);
60 64
61 result = ar7_gpio_disable(pdata->gpio_bit); 65 ret = ar7_gpio_disable(pdata->gpio_bit);
62 if (result) 66 if (ret)
63 goto out_enabled; 67 goto out_enabled;
64 68
65 result = ar7_gpio_enable(pdata->gpio_bit); 69 ret = ar7_gpio_enable(pdata->gpio_bit);
66 if (result) 70 if (ret)
67 goto out_enabled; 71 goto out_enabled;
68 72
69 result = gpio_direction_output(pdata->gpio_bit, 0); 73 ret = gpio_direction_output(pdata->gpio_bit, 0);
70 if (result) 74 if (ret)
71 goto out_gpio_enabled; 75 goto out_gpio_enabled;
72 76
73 msleep(50); 77 msleep(50);
74 78
75 gpio_set_value(pdata->gpio_bit, 1); 79 gpio_set_value(pdata->gpio_bit, 1);
80
76 msleep(50); 81 msleep(50);
77 82
78 return 0; 83 return 0;
@@ -83,320 +88,384 @@ out_enabled:
83 ar7_device_disable(pdata->reset_bit); 88 ar7_device_disable(pdata->reset_bit);
84 gpio_free(pdata->gpio_bit); 89 gpio_free(pdata->gpio_bit);
85out: 90out:
86 return result; 91 return ret;
87} 92}
88 93
89static void vlynq_off(struct vlynq_device *dev) 94static void vlynq_off(struct vlynq_device *dev)
90{ 95{
91 struct plat_vlynq_data *pdata = dev->dev.platform_data; 96 struct plat_vlynq_data *pdata = dev->dev.platform_data;
97
92 ar7_gpio_disable(pdata->gpio_bit); 98 ar7_gpio_disable(pdata->gpio_bit);
93 gpio_free(pdata->gpio_bit); 99 gpio_free(pdata->gpio_bit);
94 ar7_device_disable(pdata->reset_bit); 100 ar7_device_disable(pdata->reset_bit);
95} 101}
96 102
97static struct resource physmap_flash_resource = { 103static struct resource vlynq_low_res[] = {
98 .name = "mem",
99 .flags = IORESOURCE_MEM,
100 .start = 0x10000000,
101 .end = 0x107fffff,
102};
103
104static struct resource cpmac_low_res[] = {
105 { 104 {
106 .name = "regs", 105 .name = "regs",
107 .flags = IORESOURCE_MEM, 106 .flags = IORESOURCE_MEM,
108 .start = AR7_REGS_MAC0, 107 .start = AR7_REGS_VLYNQ0,
109 .end = AR7_REGS_MAC0 + 0x7ff, 108 .end = AR7_REGS_VLYNQ0 + 0xff,
110 }, 109 },
111 { 110 {
112 .name = "irq", 111 .name = "irq",
113 .flags = IORESOURCE_IRQ, 112 .flags = IORESOURCE_IRQ,
114 .start = 27, 113 .start = 29,
115 .end = 27, 114 .end = 29,
116 }, 115 },
117};
118
119static struct resource cpmac_high_res[] = {
120 { 116 {
121 .name = "regs", 117 .name = "mem",
122 .flags = IORESOURCE_MEM, 118 .flags = IORESOURCE_MEM,
123 .start = AR7_REGS_MAC1, 119 .start = 0x04000000,
124 .end = AR7_REGS_MAC1 + 0x7ff, 120 .end = 0x04ffffff,
125 }, 121 },
126 { 122 {
127 .name = "irq", 123 .name = "devirq",
128 .flags = IORESOURCE_IRQ, 124 .flags = IORESOURCE_IRQ,
129 .start = 41, 125 .start = 80,
130 .end = 41, 126 .end = 111,
131 }, 127 },
132}; 128};
133 129
134static struct resource vlynq_low_res[] = { 130static struct resource vlynq_high_res[] = {
135 { 131 {
136 .name = "regs", 132 .name = "regs",
137 .flags = IORESOURCE_MEM, 133 .flags = IORESOURCE_MEM,
138 .start = AR7_REGS_VLYNQ0, 134 .start = AR7_REGS_VLYNQ1,
139 .end = AR7_REGS_VLYNQ0 + 0xff, 135 .end = AR7_REGS_VLYNQ1 + 0xff,
140 }, 136 },
141 { 137 {
142 .name = "irq", 138 .name = "irq",
143 .flags = IORESOURCE_IRQ, 139 .flags = IORESOURCE_IRQ,
144 .start = 29, 140 .start = 33,
145 .end = 29, 141 .end = 33,
146 }, 142 },
147 { 143 {
148 .name = "mem", 144 .name = "mem",
149 .flags = IORESOURCE_MEM, 145 .flags = IORESOURCE_MEM,
150 .start = 0x04000000, 146 .start = 0x0c000000,
151 .end = 0x04ffffff, 147 .end = 0x0cffffff,
152 }, 148 },
153 { 149 {
154 .name = "devirq", 150 .name = "devirq",
155 .flags = IORESOURCE_IRQ, 151 .flags = IORESOURCE_IRQ,
156 .start = 80, 152 .start = 112,
157 .end = 111, 153 .end = 143,
158 }, 154 },
159}; 155};
160 156
161static struct resource vlynq_high_res[] = { 157static struct plat_vlynq_data vlynq_low_data = {
162 { 158 .ops = {
163 .name = "regs", 159 .on = vlynq_on,
164 .flags = IORESOURCE_MEM, 160 .off = vlynq_off,
165 .start = AR7_REGS_VLYNQ1,
166 .end = AR7_REGS_VLYNQ1 + 0xff,
167 }, 161 },
168 { 162 .reset_bit = 20,
169 .name = "irq", 163 .gpio_bit = 18,
170 .flags = IORESOURCE_IRQ, 164};
171 .start = 33, 165
172 .end = 33, 166static struct plat_vlynq_data vlynq_high_data = {
167 .ops = {
168 .on = vlynq_on,
169 .off = vlynq_off,
173 }, 170 },
174 { 171 .reset_bit = 26,
175 .name = "mem", 172 .gpio_bit = 19,
176 .flags = IORESOURCE_MEM, 173};
177 .start = 0x0c000000, 174
178 .end = 0x0cffffff, 175static struct platform_device vlynq_low = {
176 .id = 0,
177 .name = "vlynq",
178 .dev = {
179 .platform_data = &vlynq_low_data,
179 }, 180 },
180 { 181 .resource = vlynq_low_res,
181 .name = "devirq", 182 .num_resources = ARRAY_SIZE(vlynq_low_res),
182 .flags = IORESOURCE_IRQ, 183};
183 .start = 112, 184
184 .end = 143, 185static struct platform_device vlynq_high = {
186 .id = 1,
187 .name = "vlynq",
188 .dev = {
189 .platform_data = &vlynq_high_data,
185 }, 190 },
191 .resource = vlynq_high_res,
192 .num_resources = ARRAY_SIZE(vlynq_high_res),
186}; 193};
187 194
188static struct resource usb_res[] = { 195/*****************************************************************************
189 { 196 * Flash
190 .name = "regs", 197 ****************************************************************************/
191 .flags = IORESOURCE_MEM, 198static struct resource physmap_flash_resource = {
192 .start = AR7_REGS_USB, 199 .name = "mem",
193 .end = AR7_REGS_USB + 0xff, 200 .flags = IORESOURCE_MEM,
201 .start = 0x10000000,
202 .end = 0x107fffff,
203};
204
205static struct physmap_flash_data physmap_flash_data = {
206 .width = 2,
207};
208
209static struct platform_device physmap_flash = {
210 .name = "physmap-flash",
211 .dev = {
212 .platform_data = &physmap_flash_data,
194 }, 213 },
214 .resource = &physmap_flash_resource,
215 .num_resources = 1,
216};
217
218/*****************************************************************************
219 * Ethernet
220 ****************************************************************************/
221static struct resource cpmac_low_res[] = {
195 { 222 {
196 .name = "irq", 223 .name = "regs",
197 .flags = IORESOURCE_IRQ, 224 .flags = IORESOURCE_MEM,
198 .start = 32, 225 .start = AR7_REGS_MAC0,
199 .end = 32, 226 .end = AR7_REGS_MAC0 + 0x7ff,
200 }, 227 },
201 { 228 {
202 .name = "mem", 229 .name = "irq",
203 .flags = IORESOURCE_MEM, 230 .flags = IORESOURCE_IRQ,
204 .start = 0x03400000, 231 .start = 27,
205 .end = 0x03401fff, 232 .end = 27,
206 }, 233 },
207}; 234};
208 235
209static struct physmap_flash_data physmap_flash_data = { 236static struct resource cpmac_high_res[] = {
210 .width = 2, 237 {
238 .name = "regs",
239 .flags = IORESOURCE_MEM,
240 .start = AR7_REGS_MAC1,
241 .end = AR7_REGS_MAC1 + 0x7ff,
242 },
243 {
244 .name = "irq",
245 .flags = IORESOURCE_IRQ,
246 .start = 41,
247 .end = 41,
248 },
211}; 249};
212 250
213static struct fixed_phy_status fixed_phy_status __initdata = { 251static struct fixed_phy_status fixed_phy_status __initdata = {
214 .link = 1, 252 .link = 1,
215 .speed = 100, 253 .speed = 100,
216 .duplex = 1, 254 .duplex = 1,
217}; 255};
218 256
219static struct plat_cpmac_data cpmac_low_data = { 257static struct plat_cpmac_data cpmac_low_data = {
220 .reset_bit = 17, 258 .reset_bit = 17,
221 .power_bit = 20, 259 .power_bit = 20,
222 .phy_mask = 0x80000000, 260 .phy_mask = 0x80000000,
223}; 261};
224 262
225static struct plat_cpmac_data cpmac_high_data = { 263static struct plat_cpmac_data cpmac_high_data = {
226 .reset_bit = 21, 264 .reset_bit = 21,
227 .power_bit = 22, 265 .power_bit = 22,
228 .phy_mask = 0x7fffffff, 266 .phy_mask = 0x7fffffff,
229};
230
231static struct plat_vlynq_data vlynq_low_data = {
232 .ops.on = vlynq_on,
233 .ops.off = vlynq_off,
234 .reset_bit = 20,
235 .gpio_bit = 18,
236};
237
238static struct plat_vlynq_data vlynq_high_data = {
239 .ops.on = vlynq_on,
240 .ops.off = vlynq_off,
241 .reset_bit = 16,
242 .gpio_bit = 19,
243};
244
245static struct platform_device physmap_flash = {
246 .id = 0,
247 .name = "physmap-flash",
248 .dev.platform_data = &physmap_flash_data,
249 .resource = &physmap_flash_resource,
250 .num_resources = 1,
251}; 267};
252 268
253static u64 cpmac_dma_mask = DMA_BIT_MASK(32); 269static u64 cpmac_dma_mask = DMA_BIT_MASK(32);
270
254static struct platform_device cpmac_low = { 271static struct platform_device cpmac_low = {
255 .id = 0, 272 .id = 0,
256 .name = "cpmac", 273 .name = "cpmac",
257 .dev = { 274 .dev = {
258 .dma_mask = &cpmac_dma_mask, 275 .dma_mask = &cpmac_dma_mask,
259 .coherent_dma_mask = DMA_BIT_MASK(32), 276 .coherent_dma_mask = DMA_BIT_MASK(32),
260 .platform_data = &cpmac_low_data, 277 .platform_data = &cpmac_low_data,
261 }, 278 },
262 .resource = cpmac_low_res, 279 .resource = cpmac_low_res,
263 .num_resources = ARRAY_SIZE(cpmac_low_res), 280 .num_resources = ARRAY_SIZE(cpmac_low_res),
264}; 281};
265 282
266static struct platform_device cpmac_high = { 283static struct platform_device cpmac_high = {
267 .id = 1, 284 .id = 1,
268 .name = "cpmac", 285 .name = "cpmac",
269 .dev = { 286 .dev = {
270 .dma_mask = &cpmac_dma_mask, 287 .dma_mask = &cpmac_dma_mask,
271 .coherent_dma_mask = DMA_BIT_MASK(32), 288 .coherent_dma_mask = DMA_BIT_MASK(32),
272 .platform_data = &cpmac_high_data, 289 .platform_data = &cpmac_high_data,
273 }, 290 },
274 .resource = cpmac_high_res, 291 .resource = cpmac_high_res,
275 .num_resources = ARRAY_SIZE(cpmac_high_res), 292 .num_resources = ARRAY_SIZE(cpmac_high_res),
276}; 293};
277 294
278static struct platform_device vlynq_low = { 295static inline unsigned char char2hex(char h)
279 .id = 0, 296{
280 .name = "vlynq", 297 switch (h) {
281 .dev.platform_data = &vlynq_low_data, 298 case '0': case '1': case '2': case '3': case '4':
282 .resource = vlynq_low_res, 299 case '5': case '6': case '7': case '8': case '9':
283 .num_resources = ARRAY_SIZE(vlynq_low_res), 300 return h - '0';
284}; 301 case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
302 return h - 'A' + 10;
303 case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
304 return h - 'a' + 10;
305 default:
306 return 0;
307 }
308}
285 309
286static struct platform_device vlynq_high = { 310static void cpmac_get_mac(int instance, unsigned char *dev_addr)
287 .id = 1, 311{
288 .name = "vlynq", 312 int i;
289 .dev.platform_data = &vlynq_high_data, 313 char name[5], default_mac[ETH_ALEN], *mac;
290 .resource = vlynq_high_res, 314
291 .num_resources = ARRAY_SIZE(vlynq_high_res), 315 mac = NULL;
316 sprintf(name, "mac%c", 'a' + instance);
317 mac = prom_getenv(name);
318 if (!mac) {
319 sprintf(name, "mac%c", 'a');
320 mac = prom_getenv(name);
321 }
322 if (!mac) {
323 random_ether_addr(default_mac);
324 mac = default_mac;
325 }
326 for (i = 0; i < 6; i++)
327 dev_addr[i] = (char2hex(mac[i * 3]) << 4) +
328 char2hex(mac[i * 3 + 1]);
329}
330
331/*****************************************************************************
332 * USB
333 ****************************************************************************/
334static struct resource usb_res[] = {
335 {
336 .name = "regs",
337 .flags = IORESOURCE_MEM,
338 .start = AR7_REGS_USB,
339 .end = AR7_REGS_USB + 0xff,
340 },
341 {
342 .name = "irq",
343 .flags = IORESOURCE_IRQ,
344 .start = 32,
345 .end = 32,
346 },
347 {
348 .name = "mem",
349 .flags = IORESOURCE_MEM,
350 .start = 0x03400000,
351 .end = 0x03401fff,
352 },
292}; 353};
293 354
355static struct platform_device ar7_udc = {
356 .name = "ar7_udc",
357 .resource = usb_res,
358 .num_resources = ARRAY_SIZE(usb_res),
359};
294 360
361/*****************************************************************************
362 * LEDs
363 ****************************************************************************/
295static struct gpio_led default_leds[] = { 364static struct gpio_led default_leds[] = {
296 { 365 {
297 .name = "status", 366 .name = "status",
298 .gpio = 8, 367 .gpio = 8,
299 .active_low = 1, 368 .active_low = 1,
300 }, 369 },
301}; 370};
302 371
303static struct gpio_led dsl502t_leds[] = { 372static struct gpio_led dsl502t_leds[] = {
304 { 373 {
305 .name = "status", 374 .name = "status",
306 .gpio = 9, 375 .gpio = 9,
307 .active_low = 1, 376 .active_low = 1,
308 }, 377 },
309 { 378 {
310 .name = "ethernet", 379 .name = "ethernet",
311 .gpio = 7, 380 .gpio = 7,
312 .active_low = 1, 381 .active_low = 1,
313 }, 382 },
314 { 383 {
315 .name = "usb", 384 .name = "usb",
316 .gpio = 12, 385 .gpio = 12,
317 .active_low = 1, 386 .active_low = 1,
318 }, 387 },
319}; 388};
320 389
321static struct gpio_led dg834g_leds[] = { 390static struct gpio_led dg834g_leds[] = {
322 { 391 {
323 .name = "ppp", 392 .name = "ppp",
324 .gpio = 6, 393 .gpio = 6,
325 .active_low = 1, 394 .active_low = 1,
326 }, 395 },
327 { 396 {
328 .name = "status", 397 .name = "status",
329 .gpio = 7, 398 .gpio = 7,
330 .active_low = 1, 399 .active_low = 1,
331 }, 400 },
332 { 401 {
333 .name = "adsl", 402 .name = "adsl",
334 .gpio = 8, 403 .gpio = 8,
335 .active_low = 1, 404 .active_low = 1,
336 }, 405 },
337 { 406 {
338 .name = "wifi", 407 .name = "wifi",
339 .gpio = 12, 408 .gpio = 12,
340 .active_low = 1, 409 .active_low = 1,
341 }, 410 },
342 { 411 {
343 .name = "power", 412 .name = "power",
344 .gpio = 14, 413 .gpio = 14,
345 .active_low = 1, 414 .active_low = 1,
346 .default_trigger = "default-on", 415 .default_trigger = "default-on",
347 }, 416 },
348}; 417};
349 418
350static struct gpio_led fb_sl_leds[] = { 419static struct gpio_led fb_sl_leds[] = {
351 { 420 {
352 .name = "1", 421 .name = "1",
353 .gpio = 7, 422 .gpio = 7,
354 }, 423 },
355 { 424 {
356 .name = "2", 425 .name = "2",
357 .gpio = 13, 426 .gpio = 13,
358 .active_low = 1, 427 .active_low = 1,
359 }, 428 },
360 { 429 {
361 .name = "3", 430 .name = "3",
362 .gpio = 10, 431 .gpio = 10,
363 .active_low = 1, 432 .active_low = 1,
364 }, 433 },
365 { 434 {
366 .name = "4", 435 .name = "4",
367 .gpio = 12, 436 .gpio = 12,
368 .active_low = 1, 437 .active_low = 1,
369 }, 438 },
370 { 439 {
371 .name = "5", 440 .name = "5",
372 .gpio = 9, 441 .gpio = 9,
373 .active_low = 1, 442 .active_low = 1,
374 }, 443 },
375}; 444};
376 445
377static struct gpio_led fb_fon_leds[] = { 446static struct gpio_led fb_fon_leds[] = {
378 { 447 {
379 .name = "1", 448 .name = "1",
380 .gpio = 8, 449 .gpio = 8,
381 }, 450 },
382 { 451 {
383 .name = "2", 452 .name = "2",
384 .gpio = 3, 453 .gpio = 3,
385 .active_low = 1, 454 .active_low = 1,
386 }, 455 },
387 { 456 {
388 .name = "3", 457 .name = "3",
389 .gpio = 5, 458 .gpio = 5,
390 }, 459 },
391 { 460 {
392 .name = "4", 461 .name = "4",
393 .gpio = 4, 462 .gpio = 4,
394 .active_low = 1, 463 .active_low = 1,
395 }, 464 },
396 { 465 {
397 .name = "5", 466 .name = "5",
398 .gpio = 11, 467 .gpio = 11,
399 .active_low = 1, 468 .active_low = 1,
400 }, 469 },
401}; 470};
402 471
@@ -404,69 +473,11 @@ static struct gpio_led_platform_data ar7_led_data;
404 473
405static struct platform_device ar7_gpio_leds = { 474static struct platform_device ar7_gpio_leds = {
406 .name = "leds-gpio", 475 .name = "leds-gpio",
407 .id = -1,
408 .dev = { 476 .dev = {
409 .platform_data = &ar7_led_data, 477 .platform_data = &ar7_led_data,
410 } 478 }
411}; 479};
412 480
413static struct platform_device ar7_udc = {
414 .id = -1,
415 .name = "ar7_udc",
416 .resource = usb_res,
417 .num_resources = ARRAY_SIZE(usb_res),
418};
419
420static struct resource ar7_wdt_res = {
421 .name = "regs",
422 .start = -1, /* Filled at runtime */
423 .end = -1, /* Filled at runtime */
424 .flags = IORESOURCE_MEM,
425};
426
427static struct platform_device ar7_wdt = {
428 .id = -1,
429 .name = "ar7_wdt",
430 .resource = &ar7_wdt_res,
431 .num_resources = 1,
432};
433
434static inline unsigned char char2hex(char h)
435{
436 switch (h) {
437 case '0': case '1': case '2': case '3': case '4':
438 case '5': case '6': case '7': case '8': case '9':
439 return h - '0';
440 case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
441 return h - 'A' + 10;
442 case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
443 return h - 'a' + 10;
444 default:
445 return 0;
446 }
447}
448
449static void cpmac_get_mac(int instance, unsigned char *dev_addr)
450{
451 int i;
452 char name[5], default_mac[ETH_ALEN], *mac;
453
454 mac = NULL;
455 sprintf(name, "mac%c", 'a' + instance);
456 mac = prom_getenv(name);
457 if (!mac) {
458 sprintf(name, "mac%c", 'a');
459 mac = prom_getenv(name);
460 }
461 if (!mac) {
462 random_ether_addr(default_mac);
463 mac = default_mac;
464 }
465 for (i = 0; i < 6; i++)
466 dev_addr[i] = (char2hex(mac[i * 3]) << 4) +
467 char2hex(mac[i * 3 + 1]);
468}
469
470static void __init detect_leds(void) 481static void __init detect_leds(void)
471{ 482{
472 char *prid, *usb_prod; 483 char *prid, *usb_prod;
@@ -499,111 +510,149 @@ static void __init detect_leds(void)
499 } 510 }
500} 511}
501 512
502static int __init ar7_register_devices(void) 513/*****************************************************************************
514 * Watchdog
515 ****************************************************************************/
516static struct resource ar7_wdt_res = {
517 .name = "regs",
518 .flags = IORESOURCE_MEM,
519 .start = -1, /* Filled at runtime */
520 .end = -1, /* Filled at runtime */
521};
522
523static struct platform_device ar7_wdt = {
524 .name = "ar7_wdt",
525 .resource = &ar7_wdt_res,
526 .num_resources = 1,
527};
528
529/*****************************************************************************
530 * Init
531 ****************************************************************************/
532static int __init ar7_register_uarts(void)
503{ 533{
504 u16 chip_id;
505 int res;
506 u32 *bootcr, val;
507#ifdef CONFIG_SERIAL_8250 534#ifdef CONFIG_SERIAL_8250
508 static struct uart_port uart_port[2] __initdata; 535 static struct uart_port uart_port __initdata;
509 536 struct clk *bus_clk;
510 memset(uart_port, 0, sizeof(struct uart_port) * 2); 537 int res;
511 538
512 uart_port[0].type = PORT_16550A; 539 memset(&uart_port, 0, sizeof(struct uart_port));
513 uart_port[0].line = 0; 540
514 uart_port[0].irq = AR7_IRQ_UART0; 541 bus_clk = clk_get(NULL, "bus");
515 uart_port[0].uartclk = ar7_bus_freq() / 2; 542 if (IS_ERR(bus_clk))
516 uart_port[0].iotype = UPIO_MEM32; 543 panic("unable to get bus clk\n");
517 uart_port[0].mapbase = AR7_REGS_UART0; 544
518 uart_port[0].membase = ioremap(uart_port[0].mapbase, 256); 545 uart_port.type = PORT_16550A;
519 uart_port[0].regshift = 2; 546 uart_port.uartclk = clk_get_rate(bus_clk) / 2;
520 res = early_serial_setup(&uart_port[0]); 547 uart_port.iotype = UPIO_MEM32;
548 uart_port.regshift = 2;
549
550 uart_port.line = 0;
551 uart_port.irq = AR7_IRQ_UART0;
552 uart_port.mapbase = AR7_REGS_UART0;
553 uart_port.membase = ioremap(uart_port.mapbase, 256);
554
555 res = early_serial_setup(&uart_port);
521 if (res) 556 if (res)
522 return res; 557 return res;
523 558
524
525 /* Only TNETD73xx have a second serial port */ 559 /* Only TNETD73xx have a second serial port */
526 if (ar7_has_second_uart()) { 560 if (ar7_has_second_uart()) {
527 uart_port[1].type = PORT_16550A; 561 uart_port.line = 1;
528 uart_port[1].line = 1; 562 uart_port.irq = AR7_IRQ_UART1;
529 uart_port[1].irq = AR7_IRQ_UART1; 563 uart_port.mapbase = UR8_REGS_UART1;
530 uart_port[1].uartclk = ar7_bus_freq() / 2; 564 uart_port.membase = ioremap(uart_port.mapbase, 256);
531 uart_port[1].iotype = UPIO_MEM32; 565
532 uart_port[1].mapbase = UR8_REGS_UART1; 566 res = early_serial_setup(&uart_port);
533 uart_port[1].membase = ioremap(uart_port[1].mapbase, 256);
534 uart_port[1].regshift = 2;
535 res = early_serial_setup(&uart_port[1]);
536 if (res) 567 if (res)
537 return res; 568 return res;
538 } 569 }
539#endif /* CONFIG_SERIAL_8250 */ 570#endif
571
572 return 0;
573}
574
575static int __init ar7_register_devices(void)
576{
577 void __iomem *bootcr;
578 u32 val;
579 u16 chip_id;
580 int res;
581
582 res = ar7_register_uarts();
583 if (res)
584 pr_err("unable to setup uart(s): %d\n", res);
585
540 res = platform_device_register(&physmap_flash); 586 res = platform_device_register(&physmap_flash);
541 if (res) 587 if (res)
542 return res; 588 pr_warning("unable to register physmap-flash: %d\n", res);
543 589
544 ar7_device_disable(vlynq_low_data.reset_bit); 590 ar7_device_disable(vlynq_low_data.reset_bit);
545 res = platform_device_register(&vlynq_low); 591 res = platform_device_register(&vlynq_low);
546 if (res) 592 if (res)
547 return res; 593 pr_warning("unable to register vlynq-low: %d\n", res);
548 594
549 if (ar7_has_high_vlynq()) { 595 if (ar7_has_high_vlynq()) {
550 ar7_device_disable(vlynq_high_data.reset_bit); 596 ar7_device_disable(vlynq_high_data.reset_bit);
551 res = platform_device_register(&vlynq_high); 597 res = platform_device_register(&vlynq_high);
552 if (res) 598 if (res)
553 return res; 599 pr_warning("unable to register vlynq-high: %d\n", res);
554 } 600 }
555 601
556 if (ar7_has_high_cpmac()) { 602 if (ar7_has_high_cpmac()) {
557 res = fixed_phy_add(PHY_POLL, cpmac_high.id, &fixed_phy_status); 603 if (!res) {
558 if (res && res != -ENODEV) 604 cpmac_get_mac(1, cpmac_high_data.dev_addr);
559 return res; 605
560 cpmac_get_mac(1, cpmac_high_data.dev_addr); 606 res = platform_device_register(&cpmac_high);
561 res = platform_device_register(&cpmac_high); 607 if (res)
562 if (res) 608 pr_warning("unable to register cpmac-high: %d\n", res);
563 return res; 609 } else
564 } else { 610 pr_warning("unable to add cpmac-high phy: %d\n", res);
611 } else
565 cpmac_low_data.phy_mask = 0xffffffff; 612 cpmac_low_data.phy_mask = 0xffffffff;
566 }
567 613
568 res = fixed_phy_add(PHY_POLL, cpmac_low.id, &fixed_phy_status); 614 res = fixed_phy_add(PHY_POLL, cpmac_low.id, &fixed_phy_status);
569 if (res && res != -ENODEV) 615 if (!res) {
570 return res; 616 cpmac_get_mac(0, cpmac_low_data.dev_addr);
571 617 res = platform_device_register(&cpmac_low);
572 cpmac_get_mac(0, cpmac_low_data.dev_addr); 618 if (res)
573 res = platform_device_register(&cpmac_low); 619 pr_warning("unable to register cpmac-low: %d\n", res);
574 if (res) 620 } else
575 return res; 621 pr_warning("unable to add cpmac-low phy: %d\n", res);
576 622
577 detect_leds(); 623 detect_leds();
578 res = platform_device_register(&ar7_gpio_leds); 624 res = platform_device_register(&ar7_gpio_leds);
579 if (res) 625 if (res)
580 return res; 626 pr_warning("unable to register leds: %d\n", res);
581 627
582 res = platform_device_register(&ar7_udc); 628 res = platform_device_register(&ar7_udc);
583 629 if (res)
584 chip_id = ar7_chip_id(); 630 pr_warning("unable to register usb slave: %d\n", res);
585 switch (chip_id) {
586 case AR7_CHIP_7100:
587 case AR7_CHIP_7200:
588 ar7_wdt_res.start = AR7_REGS_WDT;
589 break;
590 case AR7_CHIP_7300:
591 ar7_wdt_res.start = UR8_REGS_WDT;
592 break;
593 default:
594 break;
595 }
596
597 ar7_wdt_res.end = ar7_wdt_res.start + 0x20;
598
599 bootcr = (u32 *)ioremap_nocache(AR7_REGS_DCL, 4);
600 val = *bootcr;
601 iounmap(bootcr);
602 631
603 /* Register watchdog only if enabled in hardware */ 632 /* Register watchdog only if enabled in hardware */
604 if (val & AR7_WDT_HW_ENA) 633 bootcr = ioremap_nocache(AR7_REGS_DCL, 4);
634 val = readl(bootcr);
635 iounmap(bootcr);
636 if (val & AR7_WDT_HW_ENA) {
637 chip_id = ar7_chip_id();
638 switch (chip_id) {
639 case AR7_CHIP_7100:
640 case AR7_CHIP_7200:
641 ar7_wdt_res.start = AR7_REGS_WDT;
642 break;
643 case AR7_CHIP_7300:
644 ar7_wdt_res.start = UR8_REGS_WDT;
645 break;
646 default:
647 break;
648 }
649
650 ar7_wdt_res.end = ar7_wdt_res.start + 0x20;
605 res = platform_device_register(&ar7_wdt); 651 res = platform_device_register(&ar7_wdt);
652 if (res)
653 pr_warning("unable to register watchdog: %d\n", res);
654 }
606 655
607 return res; 656 return 0;
608} 657}
609arch_initcall(ar7_register_devices); 658arch_initcall(ar7_register_devices);
diff --git a/arch/mips/ar7/prom.c b/arch/mips/ar7/prom.c
index c1fdd3682812..52385790e5c1 100644
--- a/arch/mips/ar7/prom.c
+++ b/arch/mips/ar7/prom.c
@@ -32,8 +32,8 @@
32#define MAX_ENTRY 80 32#define MAX_ENTRY 80
33 33
34struct env_var { 34struct env_var {
35 char *name; 35 char *name;
36 char *value; 36 char *value;
37}; 37};
38 38
39static struct env_var adam2_env[MAX_ENTRY]; 39static struct env_var adam2_env[MAX_ENTRY];
@@ -41,6 +41,7 @@ static struct env_var adam2_env[MAX_ENTRY];
41char *prom_getenv(const char *name) 41char *prom_getenv(const char *name)
42{ 42{
43 int i; 43 int i;
44
44 for (i = 0; (i < MAX_ENTRY) && adam2_env[i].name; i++) 45 for (i = 0; (i < MAX_ENTRY) && adam2_env[i].name; i++)
45 if (!strcmp(name, adam2_env[i].name)) 46 if (!strcmp(name, adam2_env[i].name))
46 return adam2_env[i].value; 47 return adam2_env[i].value;
@@ -49,65 +50,50 @@ char *prom_getenv(const char *name)
49} 50}
50EXPORT_SYMBOL(prom_getenv); 51EXPORT_SYMBOL(prom_getenv);
51 52
52char * __init prom_getcmdline(void)
53{
54 return &(arcs_cmdline[0]);
55}
56
57static void __init ar7_init_cmdline(int argc, char *argv[]) 53static void __init ar7_init_cmdline(int argc, char *argv[])
58{ 54{
59 char *cp; 55 int i;
60 int actr;
61
62 actr = 1; /* Always ignore argv[0] */
63 56
64 cp = &(arcs_cmdline[0]); 57 for (i = 1; i < argc; i++) {
65 while (actr < argc) { 58 strlcat(arcs_cmdline, argv[i], COMMAND_LINE_SIZE);
66 strcpy(cp, argv[actr]); 59 if (i < (argc - 1))
67 cp += strlen(argv[actr]); 60 strlcat(arcs_cmdline, " ", COMMAND_LINE_SIZE);
68 *cp++ = ' ';
69 actr++;
70 }
71 if (cp != &(arcs_cmdline[0])) {
72 /* get rid of trailing space */
73 --cp;
74 *cp = '\0';
75 } 61 }
76} 62}
77 63
78struct psbl_rec { 64struct psbl_rec {
79 u32 psbl_size; 65 u32 psbl_size;
80 u32 env_base; 66 u32 env_base;
81 u32 env_size; 67 u32 env_size;
82 u32 ffs_base; 68 u32 ffs_base;
83 u32 ffs_size; 69 u32 ffs_size;
84}; 70};
85 71
86static __initdata char psp_env_version[] = "TIENV0.8"; 72static __initdata char psp_env_version[] = "TIENV0.8";
87 73
88struct psp_env_chunk { 74struct psp_env_chunk {
89 u8 num; 75 u8 num;
90 u8 ctrl; 76 u8 ctrl;
91 u16 csum; 77 u16 csum;
92 u8 len; 78 u8 len;
93 char data[11]; 79 char data[11];
94} __attribute__ ((packed)); 80} __attribute__ ((packed));
95 81
96struct psp_var_map_entry { 82struct psp_var_map_entry {
97 u8 num; 83 u8 num;
98 char *value; 84 char *value;
99}; 85};
100 86
101static struct psp_var_map_entry psp_var_map[] = { 87static struct psp_var_map_entry psp_var_map[] = {
102 { 1, "cpufrequency" }, 88 { 1, "cpufrequency" },
103 { 2, "memsize" }, 89 { 2, "memsize" },
104 { 3, "flashsize" }, 90 { 3, "flashsize" },
105 { 4, "modetty0" }, 91 { 4, "modetty0" },
106 { 5, "modetty1" }, 92 { 5, "modetty1" },
107 { 8, "maca" }, 93 { 8, "maca" },
108 { 9, "macb" }, 94 { 9, "macb" },
109 { 28, "sysfrequency" }, 95 { 28, "sysfrequency" },
110 { 38, "mipsfrequency" }, 96 { 38, "mipsfrequency" },
111}; 97};
112 98
113/* 99/*
@@ -154,6 +140,7 @@ static char * __init lookup_psp_var_map(u8 num)
154static void __init add_adam2_var(char *name, char *value) 140static void __init add_adam2_var(char *name, char *value)
155{ 141{
156 int i; 142 int i;
143
157 for (i = 0; i < MAX_ENTRY; i++) { 144 for (i = 0; i < MAX_ENTRY; i++) {
158 if (!adam2_env[i].name) { 145 if (!adam2_env[i].name) {
159 adam2_env[i].name = name; 146 adam2_env[i].name = name;
@@ -216,7 +203,7 @@ static void __init console_config(void)
216 char parity = '\0', bits = '\0', flow = '\0'; 203 char parity = '\0', bits = '\0', flow = '\0';
217 char *s, *p; 204 char *s, *p;
218 205
219 if (strstr(prom_getcmdline(), "console=")) 206 if (strstr(arcs_cmdline, "console="))
220 return; 207 return;
221 208
222 s = prom_getenv("modetty0"); 209 s = prom_getenv("modetty0");
@@ -250,7 +237,7 @@ static void __init console_config(void)
250 else 237 else
251 sprintf(console_string, " console=ttyS0,%d%c%c", baud, parity, 238 sprintf(console_string, " console=ttyS0,%d%c%c", baud, parity,
252 bits); 239 bits);
253 strcat(prom_getcmdline(), console_string); 240 strlcat(arcs_cmdline, console_string, COMMAND_LINE_SIZE);
254#endif 241#endif
255} 242}
256 243
@@ -279,4 +266,3 @@ int prom_putchar(char c)
279 serial_out(UART_TX, c); 266 serial_out(UART_TX, c);
280 return 1; 267 return 1;
281} 268}
282
diff --git a/arch/mips/ar7/setup.c b/arch/mips/ar7/setup.c
index 39f6b5b96463..3a801d2cb6e5 100644
--- a/arch/mips/ar7/setup.c
+++ b/arch/mips/ar7/setup.c
@@ -26,8 +26,8 @@
26 26
27static void ar7_machine_restart(char *command) 27static void ar7_machine_restart(char *command)
28{ 28{
29 u32 *softres_reg = ioremap(AR7_REGS_RESET + 29 u32 *softres_reg = ioremap(AR7_REGS_RESET + AR7_RESET_SOFTWARE, 1);
30 AR7_RESET_SOFTWARE, 1); 30
31 writel(1, softres_reg); 31 writel(1, softres_reg);
32} 32}
33 33
@@ -41,6 +41,7 @@ static void ar7_machine_power_off(void)
41{ 41{
42 u32 *power_reg = (u32 *)ioremap(AR7_REGS_POWER, 1); 42 u32 *power_reg = (u32 *)ioremap(AR7_REGS_POWER, 1);
43 u32 power_state = readl(power_reg) | (3 << 30); 43 u32 power_state = readl(power_reg) | (3 << 30);
44
44 writel(power_state, power_reg); 45 writel(power_state, power_reg);
45 ar7_machine_halt(); 46 ar7_machine_halt();
46} 47}
@@ -49,14 +50,14 @@ const char *get_system_type(void)
49{ 50{
50 u16 chip_id = ar7_chip_id(); 51 u16 chip_id = ar7_chip_id();
51 switch (chip_id) { 52 switch (chip_id) {
52 case AR7_CHIP_7300:
53 return "TI AR7 (TNETD7300)";
54 case AR7_CHIP_7100: 53 case AR7_CHIP_7100:
55 return "TI AR7 (TNETD7100)"; 54 return "TI AR7 (TNETD7100)";
56 case AR7_CHIP_7200: 55 case AR7_CHIP_7200:
57 return "TI AR7 (TNETD7200)"; 56 return "TI AR7 (TNETD7200)";
57 case AR7_CHIP_7300:
58 return "TI AR7 (TNETD7300)";
58 default: 59 default:
59 return "TI AR7 (Unknown)"; 60 return "TI AR7 (unknown)";
60 } 61 }
61} 62}
62 63
@@ -70,7 +71,6 @@ console_initcall(ar7_init_console);
70 * Initializes basic routines and structures pointers, memory size (as 71 * Initializes basic routines and structures pointers, memory size (as
71 * given by the bios and saves the command line. 72 * given by the bios and saves the command line.
72 */ 73 */
73
74void __init plat_mem_setup(void) 74void __init plat_mem_setup(void)
75{ 75{
76 unsigned long io_base; 76 unsigned long io_base;
@@ -88,6 +88,5 @@ void __init plat_mem_setup(void)
88 prom_meminit(); 88 prom_meminit();
89 89
90 printk(KERN_INFO "%s, ID: 0x%04x, Revision: 0x%02x\n", 90 printk(KERN_INFO "%s, ID: 0x%04x, Revision: 0x%02x\n",
91 get_system_type(), 91 get_system_type(), ar7_chip_id(), ar7_chip_rev());
92 ar7_chip_id(), ar7_chip_rev());
93} 92}
diff --git a/arch/mips/ar7/time.c b/arch/mips/ar7/time.c
index a1fba894daa2..5fb8a0134085 100644
--- a/arch/mips/ar7/time.c
+++ b/arch/mips/ar7/time.c
@@ -20,11 +20,21 @@
20 20
21#include <linux/init.h> 21#include <linux/init.h>
22#include <linux/time.h> 22#include <linux/time.h>
23#include <linux/err.h>
24#include <linux/clk.h>
23 25
24#include <asm/time.h> 26#include <asm/time.h>
25#include <asm/mach-ar7/ar7.h> 27#include <asm/mach-ar7/ar7.h>
26 28
27void __init plat_time_init(void) 29void __init plat_time_init(void)
28{ 30{
29 mips_hpt_frequency = ar7_cpu_freq() / 2; 31 struct clk *cpu_clk;
32
33 cpu_clk = clk_get(NULL, "cpu");
34 if (IS_ERR(cpu_clk)) {
35 printk(KERN_ERR "unable to get cpu clock\n");
36 return;
37 }
38
39 mips_hpt_frequency = clk_get_rate(cpu_clk) / 2;
30} 40}
diff --git a/arch/mips/bcm47xx/gpio.c b/arch/mips/bcm47xx/gpio.c
index 9b798800258c..e4a5ee9c9721 100644
--- a/arch/mips/bcm47xx/gpio.c
+++ b/arch/mips/bcm47xx/gpio.c
@@ -59,4 +59,3 @@ int gpio_to_irq(unsigned gpio)
59 return -EINVAL; 59 return -EINVAL;
60} 60}
61EXPORT_SYMBOL_GPL(gpio_to_irq); 61EXPORT_SYMBOL_GPL(gpio_to_irq);
62
diff --git a/arch/mips/bcm47xx/prom.c b/arch/mips/bcm47xx/prom.c
index c51405e57921..0fa646c5a844 100644
--- a/arch/mips/bcm47xx/prom.c
+++ b/arch/mips/bcm47xx/prom.c
@@ -141,6 +141,14 @@ static __init void prom_init_mem(void)
141 break; 141 break;
142 } 142 }
143 143
144 /* Ignoring the last page when ddr size is 128M. Cached
145 * accesses to last page is causing the processor to prefetch
146 * using address above 128M stepping out of the ddr address
147 * space.
148 */
149 if (mem == 0x8000000)
150 mem -= 0x1000;
151
144 add_memory_region(0, mem, BOOT_MEM_RAM); 152 add_memory_region(0, mem, BOOT_MEM_RAM);
145} 153}
146 154
@@ -155,4 +163,3 @@ void __init prom_init(void)
155void __init prom_free_prom_memory(void) 163void __init prom_free_prom_memory(void)
156{ 164{
157} 165}
158
diff --git a/arch/mips/bcm47xx/setup.c b/arch/mips/bcm47xx/setup.c
index 2f580fa160c9..d442e11625fa 100644
--- a/arch/mips/bcm47xx/setup.c
+++ b/arch/mips/bcm47xx/setup.c
@@ -121,4 +121,3 @@ void __init plat_mem_setup(void)
121 _machine_halt = bcm47xx_machine_halt; 121 _machine_halt = bcm47xx_machine_halt;
122 pm_power_off = bcm47xx_machine_halt; 122 pm_power_off = bcm47xx_machine_halt;
123} 123}
124
diff --git a/arch/mips/bcm47xx/wgt634u.c b/arch/mips/bcm47xx/wgt634u.c
index ef00e7f58c24..74d06965326f 100644
--- a/arch/mips/bcm47xx/wgt634u.c
+++ b/arch/mips/bcm47xx/wgt634u.c
@@ -164,4 +164,3 @@ static int __init wgt634u_init(void)
164} 164}
165 165
166module_init(wgt634u_init); 166module_init(wgt634u_init);
167
diff --git a/arch/mips/bcm63xx/boards/board_bcm963xx.c b/arch/mips/bcm63xx/boards/board_bcm963xx.c
index 1fe412c43171..ea17941168ca 100644
--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
+++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
@@ -836,4 +836,3 @@ int __init board_register_devices(void)
836 836
837 return 0; 837 return 0;
838} 838}
839
diff --git a/arch/mips/bcm63xx/timer.c b/arch/mips/bcm63xx/timer.c
index ba522bdcde4b..5f1135981568 100644
--- a/arch/mips/bcm63xx/timer.c
+++ b/arch/mips/bcm63xx/timer.c
@@ -17,8 +17,8 @@
17#include <bcm63xx_timer.h> 17#include <bcm63xx_timer.h>
18#include <bcm63xx_regs.h> 18#include <bcm63xx_regs.h>
19 19
20static DEFINE_SPINLOCK(timer_reg_lock); 20static DEFINE_RAW_SPINLOCK(timer_reg_lock);
21static DEFINE_SPINLOCK(timer_data_lock); 21static DEFINE_RAW_SPINLOCK(timer_data_lock);
22static struct clk *periph_clk; 22static struct clk *periph_clk;
23 23
24static struct timer_data { 24static struct timer_data {
@@ -31,23 +31,23 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id)
31 u32 stat; 31 u32 stat;
32 int i; 32 int i;
33 33
34 spin_lock(&timer_reg_lock); 34 raw_spin_lock(&timer_reg_lock);
35 stat = bcm_timer_readl(TIMER_IRQSTAT_REG); 35 stat = bcm_timer_readl(TIMER_IRQSTAT_REG);
36 bcm_timer_writel(stat, TIMER_IRQSTAT_REG); 36 bcm_timer_writel(stat, TIMER_IRQSTAT_REG);
37 spin_unlock(&timer_reg_lock); 37 raw_spin_unlock(&timer_reg_lock);
38 38
39 for (i = 0; i < BCM63XX_TIMER_COUNT; i++) { 39 for (i = 0; i < BCM63XX_TIMER_COUNT; i++) {
40 if (!(stat & TIMER_IRQSTAT_TIMER_CAUSE(i))) 40 if (!(stat & TIMER_IRQSTAT_TIMER_CAUSE(i)))
41 continue; 41 continue;
42 42
43 spin_lock(&timer_data_lock); 43 raw_spin_lock(&timer_data_lock);
44 if (!timer_data[i].cb) { 44 if (!timer_data[i].cb) {
45 spin_unlock(&timer_data_lock); 45 raw_spin_unlock(&timer_data_lock);
46 continue; 46 continue;
47 } 47 }
48 48
49 timer_data[i].cb(timer_data[i].data); 49 timer_data[i].cb(timer_data[i].data);
50 spin_unlock(&timer_data_lock); 50 raw_spin_unlock(&timer_data_lock);
51 } 51 }
52 52
53 return IRQ_HANDLED; 53 return IRQ_HANDLED;
@@ -61,7 +61,7 @@ int bcm63xx_timer_enable(int id)
61 if (id >= BCM63XX_TIMER_COUNT) 61 if (id >= BCM63XX_TIMER_COUNT)
62 return -EINVAL; 62 return -EINVAL;
63 63
64 spin_lock_irqsave(&timer_reg_lock, flags); 64 raw_spin_lock_irqsave(&timer_reg_lock, flags);
65 65
66 reg = bcm_timer_readl(TIMER_CTLx_REG(id)); 66 reg = bcm_timer_readl(TIMER_CTLx_REG(id));
67 reg |= TIMER_CTL_ENABLE_MASK; 67 reg |= TIMER_CTL_ENABLE_MASK;
@@ -71,7 +71,7 @@ int bcm63xx_timer_enable(int id)
71 reg |= TIMER_IRQSTAT_TIMER_IR_EN(id); 71 reg |= TIMER_IRQSTAT_TIMER_IR_EN(id);
72 bcm_timer_writel(reg, TIMER_IRQSTAT_REG); 72 bcm_timer_writel(reg, TIMER_IRQSTAT_REG);
73 73
74 spin_unlock_irqrestore(&timer_reg_lock, flags); 74 raw_spin_unlock_irqrestore(&timer_reg_lock, flags);
75 return 0; 75 return 0;
76} 76}
77 77
@@ -85,7 +85,7 @@ int bcm63xx_timer_disable(int id)
85 if (id >= BCM63XX_TIMER_COUNT) 85 if (id >= BCM63XX_TIMER_COUNT)
86 return -EINVAL; 86 return -EINVAL;
87 87
88 spin_lock_irqsave(&timer_reg_lock, flags); 88 raw_spin_lock_irqsave(&timer_reg_lock, flags);
89 89
90 reg = bcm_timer_readl(TIMER_CTLx_REG(id)); 90 reg = bcm_timer_readl(TIMER_CTLx_REG(id));
91 reg &= ~TIMER_CTL_ENABLE_MASK; 91 reg &= ~TIMER_CTL_ENABLE_MASK;
@@ -95,7 +95,7 @@ int bcm63xx_timer_disable(int id)
95 reg &= ~TIMER_IRQSTAT_TIMER_IR_EN(id); 95 reg &= ~TIMER_IRQSTAT_TIMER_IR_EN(id);
96 bcm_timer_writel(reg, TIMER_IRQSTAT_REG); 96 bcm_timer_writel(reg, TIMER_IRQSTAT_REG);
97 97
98 spin_unlock_irqrestore(&timer_reg_lock, flags); 98 raw_spin_unlock_irqrestore(&timer_reg_lock, flags);
99 return 0; 99 return 0;
100} 100}
101 101
@@ -110,7 +110,7 @@ int bcm63xx_timer_register(int id, void (*callback)(void *data), void *data)
110 return -EINVAL; 110 return -EINVAL;
111 111
112 ret = 0; 112 ret = 0;
113 spin_lock_irqsave(&timer_data_lock, flags); 113 raw_spin_lock_irqsave(&timer_data_lock, flags);
114 if (timer_data[id].cb) { 114 if (timer_data[id].cb) {
115 ret = -EBUSY; 115 ret = -EBUSY;
116 goto out; 116 goto out;
@@ -120,7 +120,7 @@ int bcm63xx_timer_register(int id, void (*callback)(void *data), void *data)
120 timer_data[id].data = data; 120 timer_data[id].data = data;
121 121
122out: 122out:
123 spin_unlock_irqrestore(&timer_data_lock, flags); 123 raw_spin_unlock_irqrestore(&timer_data_lock, flags);
124 return ret; 124 return ret;
125} 125}
126 126
@@ -133,9 +133,9 @@ void bcm63xx_timer_unregister(int id)
133 if (id >= BCM63XX_TIMER_COUNT) 133 if (id >= BCM63XX_TIMER_COUNT)
134 return; 134 return;
135 135
136 spin_lock_irqsave(&timer_data_lock, flags); 136 raw_spin_lock_irqsave(&timer_data_lock, flags);
137 timer_data[id].cb = NULL; 137 timer_data[id].cb = NULL;
138 spin_unlock_irqrestore(&timer_data_lock, flags); 138 raw_spin_unlock_irqrestore(&timer_data_lock, flags);
139} 139}
140 140
141EXPORT_SYMBOL(bcm63xx_timer_unregister); 141EXPORT_SYMBOL(bcm63xx_timer_unregister);
@@ -159,7 +159,7 @@ int bcm63xx_timer_set(int id, int monotonic, unsigned int countdown_us)
159 if (countdown & ~TIMER_CTL_COUNTDOWN_MASK) 159 if (countdown & ~TIMER_CTL_COUNTDOWN_MASK)
160 return -EINVAL; 160 return -EINVAL;
161 161
162 spin_lock_irqsave(&timer_reg_lock, flags); 162 raw_spin_lock_irqsave(&timer_reg_lock, flags);
163 reg = bcm_timer_readl(TIMER_CTLx_REG(id)); 163 reg = bcm_timer_readl(TIMER_CTLx_REG(id));
164 164
165 if (monotonic) 165 if (monotonic)
@@ -171,7 +171,7 @@ int bcm63xx_timer_set(int id, int monotonic, unsigned int countdown_us)
171 reg |= countdown; 171 reg |= countdown;
172 bcm_timer_writel(reg, TIMER_CTLx_REG(id)); 172 bcm_timer_writel(reg, TIMER_CTLx_REG(id));
173 173
174 spin_unlock_irqrestore(&timer_reg_lock, flags); 174 raw_spin_unlock_irqrestore(&timer_reg_lock, flags);
175 return 0; 175 return 0;
176} 176}
177 177
diff --git a/arch/mips/boot/compressed/Makefile b/arch/mips/boot/compressed/Makefile
index 9df903d714d7..790ddd397620 100644
--- a/arch/mips/boot/compressed/Makefile
+++ b/arch/mips/boot/compressed/Makefile
@@ -9,7 +9,7 @@
9# modified by Cort (cort@cs.nmt.edu) 9# modified by Cort (cort@cs.nmt.edu)
10# 10#
11# Copyright (C) 2009 Lemote Inc. & DSLab, Lanzhou University 11# Copyright (C) 2009 Lemote Inc. & DSLab, Lanzhou University
12# Author: Wu Zhangjin <wuzj@lemote.com> 12# Author: Wu Zhangjin <wuzhangjin@gmail.com>
13# 13#
14 14
15# compressed kernel load addr: VMLINUZ_LOAD_ADDRESS > VMLINUX_LOAD_ADDRESS + VMLINUX_SIZE 15# compressed kernel load addr: VMLINUZ_LOAD_ADDRESS > VMLINUX_LOAD_ADDRESS + VMLINUX_SIZE
@@ -27,15 +27,18 @@ BOOT_HEAP_SIZE := 0x400000
27KBUILD_CFLAGS := $(shell echo $(KBUILD_CFLAGS) | sed -e "s/-pg//") 27KBUILD_CFLAGS := $(shell echo $(KBUILD_CFLAGS) | sed -e "s/-pg//")
28 28
29KBUILD_CFLAGS := $(LINUXINCLUDE) $(KBUILD_CFLAGS) -D__KERNEL__ \ 29KBUILD_CFLAGS := $(LINUXINCLUDE) $(KBUILD_CFLAGS) -D__KERNEL__ \
30 -DBOOT_HEAP_SIZE=$(BOOT_HEAP_SIZE) -D"VMLINUX_LOAD_ADDRESS_ULL=$(VMLINUX_LOAD_ADDRESS)ull" \ 30 -DBOOT_HEAP_SIZE=$(BOOT_HEAP_SIZE) -D"VMLINUX_LOAD_ADDRESS_ULL=$(VMLINUX_LOAD_ADDRESS)ull"
31 31
32KBUILD_AFLAGS := $(LINUXINCLUDE) $(KBUILD_AFLAGS) -D__ASSEMBLY__ \ 32KBUILD_AFLAGS := $(LINUXINCLUDE) $(KBUILD_AFLAGS) -D__ASSEMBLY__ \
33 -DKERNEL_ENTRY=0x$(shell $(NM) $(objtree)/$(KBUILD_IMAGE) 2>/dev/null | grep " kernel_entry" | cut -f1 -d \ ) \ 33 -DBOOT_HEAP_SIZE=$(BOOT_HEAP_SIZE) \
34 -DBOOT_HEAP_SIZE=$(BOOT_HEAP_SIZE) 34 -DKERNEL_ENTRY=0x$(shell $(NM) $(objtree)/$(KBUILD_IMAGE) 2>/dev/null | grep " kernel_entry" | cut -f1 -d \ )
35 35
36obj-y := $(obj)/head.o $(obj)/decompress.o $(obj)/dbg.o 36obj-y := $(obj)/head.o $(obj)/decompress.o $(obj)/dbg.o
37 37
38ifdef CONFIG_DEBUG_ZBOOT
38obj-$(CONFIG_SYS_SUPPORTS_ZBOOT_UART16550) += $(obj)/uart-16550.o 39obj-$(CONFIG_SYS_SUPPORTS_ZBOOT_UART16550) += $(obj)/uart-16550.o
40obj-$(CONFIG_MACH_ALCHEMY) += $(obj)/uart-alchemy.o
41endif
39 42
40OBJCOPYFLAGS_vmlinux.bin := $(OBJCOPYFLAGS) -O binary -R .comment -S 43OBJCOPYFLAGS_vmlinux.bin := $(OBJCOPYFLAGS) -O binary -R .comment -S
41$(obj)/vmlinux.bin: $(KBUILD_IMAGE) 44$(obj)/vmlinux.bin: $(KBUILD_IMAGE)
diff --git a/arch/mips/boot/compressed/dbg.c b/arch/mips/boot/compressed/dbg.c
index ff4dc7a33a9f..134a6162e394 100644
--- a/arch/mips/boot/compressed/dbg.c
+++ b/arch/mips/boot/compressed/dbg.c
@@ -5,11 +5,11 @@
5 * please select SYS_SUPPORTS_ZBOOT_UART16550 for your machine. othewise, you 5 * please select SYS_SUPPORTS_ZBOOT_UART16550 for your machine. othewise, you
6 * need to implement your own putc(). 6 * need to implement your own putc().
7 */ 7 */
8 8#include <linux/compiler.h>
9#include <linux/init.h> 9#include <linux/init.h>
10#include <linux/types.h> 10#include <linux/types.h>
11 11
12void __attribute__ ((weak)) putc(char c) 12void __weak putc(char c)
13{ 13{
14} 14}
15 15
diff --git a/arch/mips/boot/compressed/decompress.c b/arch/mips/boot/compressed/decompress.c
index 55d02b3a6712..5db43c58b1bf 100644
--- a/arch/mips/boot/compressed/decompress.c
+++ b/arch/mips/boot/compressed/decompress.c
@@ -5,8 +5,8 @@
5 * Author: Matt Porter <mporter@mvista.com> Derived from 5 * Author: Matt Porter <mporter@mvista.com> Derived from
6 * arch/ppc/boot/prep/misc.c 6 * arch/ppc/boot/prep/misc.c
7 * 7 *
8 * Copyright (C) 2009 Lemote, Inc. & Institute of Computing Technology 8 * Copyright (C) 2009 Lemote, Inc.
9 * Author: Wu Zhangjin <wuzj@lemote.com> 9 * Author: Wu Zhangjin <wuzhangjin@gmail.com>
10 * 10 *
11 * This program is free software; you can redistribute it and/or modify it 11 * This program is free software; you can redistribute it and/or modify it
12 * under the terms of the GNU General Public License as published by the 12 * under the terms of the GNU General Public License as published by the
diff --git a/arch/mips/boot/compressed/uart-alchemy.c b/arch/mips/boot/compressed/uart-alchemy.c
new file mode 100644
index 000000000000..1bff22fa089b
--- /dev/null
+++ b/arch/mips/boot/compressed/uart-alchemy.c
@@ -0,0 +1,7 @@
1#include <asm/mach-au1x00/au1000.h>
2
3void putc(char c)
4{
5 /* all current (Jan. 2010) in-kernel boards */
6 alchemy_uart_putchar(UART0_PHYS_ADDR, c);
7}
diff --git a/arch/mips/cavium-octeon/dma-octeon.c b/arch/mips/cavium-octeon/dma-octeon.c
index 4b92bfc662db..be531ec1f206 100644
--- a/arch/mips/cavium-octeon/dma-octeon.c
+++ b/arch/mips/cavium-octeon/dma-octeon.c
@@ -41,7 +41,7 @@ struct bar1_index_state {
41}; 41};
42 42
43#ifdef CONFIG_PCI 43#ifdef CONFIG_PCI
44static DEFINE_SPINLOCK(bar1_lock); 44static DEFINE_RAW_SPINLOCK(bar1_lock);
45static struct bar1_index_state bar1_state[32]; 45static struct bar1_index_state bar1_state[32];
46#endif 46#endif
47 47
@@ -198,7 +198,7 @@ dma_addr_t octeon_map_dma_mem(struct device *dev, void *ptr, size_t size)
198 start_index = 31; 198 start_index = 31;
199 199
200 /* Only one processor can access the Bar register at once */ 200 /* Only one processor can access the Bar register at once */
201 spin_lock_irqsave(&bar1_lock, flags); 201 raw_spin_lock_irqsave(&bar1_lock, flags);
202 202
203 /* Look through Bar1 for existing mapping that will work */ 203 /* Look through Bar1 for existing mapping that will work */
204 for (index = start_index; index >= 0; index--) { 204 for (index = start_index; index >= 0; index--) {
@@ -250,7 +250,7 @@ dma_addr_t octeon_map_dma_mem(struct device *dev, void *ptr, size_t size)
250 (unsigned long long) physical); 250 (unsigned long long) physical);
251 251
252done_unlock: 252done_unlock:
253 spin_unlock_irqrestore(&bar1_lock, flags); 253 raw_spin_unlock_irqrestore(&bar1_lock, flags);
254done: 254done:
255 pr_debug("dma_map_single 0x%llx->0x%llx\n", physical, result); 255 pr_debug("dma_map_single 0x%llx->0x%llx\n", physical, result);
256 return result; 256 return result;
@@ -324,14 +324,14 @@ void octeon_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr)
324 "Attempt to unmap an invalid address (0x%llx)\n", 324 "Attempt to unmap an invalid address (0x%llx)\n",
325 dma_addr); 325 dma_addr);
326 326
327 spin_lock_irqsave(&bar1_lock, flags); 327 raw_spin_lock_irqsave(&bar1_lock, flags);
328 bar1_state[index].ref_count--; 328 bar1_state[index].ref_count--;
329 if (bar1_state[index].ref_count == 0) 329 if (bar1_state[index].ref_count == 0)
330 octeon_npi_write32(CVMX_NPI_PCI_BAR1_INDEXX(index), 0); 330 octeon_npi_write32(CVMX_NPI_PCI_BAR1_INDEXX(index), 0);
331 else if (unlikely(bar1_state[index].ref_count < 0)) 331 else if (unlikely(bar1_state[index].ref_count < 0))
332 panic("dma_unmap_single: Bar1[%u] reference count < 0\n", 332 panic("dma_unmap_single: Bar1[%u] reference count < 0\n",
333 (int) index); 333 (int) index);
334 spin_unlock_irqrestore(&bar1_lock, flags); 334 raw_spin_unlock_irqrestore(&bar1_lock, flags);
335done: 335done:
336 pr_debug("dma_unmap_single 0x%llx\n", dma_addr); 336 pr_debug("dma_unmap_single 0x%llx\n", dma_addr);
337 return; 337 return;
diff --git a/arch/mips/cavium-octeon/executive/cvmx-bootmem.c b/arch/mips/cavium-octeon/executive/cvmx-bootmem.c
index 25666da17b22..fdf5f19bfdb0 100644
--- a/arch/mips/cavium-octeon/executive/cvmx-bootmem.c
+++ b/arch/mips/cavium-octeon/executive/cvmx-bootmem.c
@@ -253,7 +253,7 @@ int64_t cvmx_bootmem_phy_alloc(uint64_t req_size, uint64_t address_min,
253 * impossible requests up front. (NOP for address_min == 0) 253 * impossible requests up front. (NOP for address_min == 0)
254 */ 254 */
255 if (alignment) 255 if (alignment)
256 address_min = __ALIGN_MASK(address_min, (alignment - 1)); 256 address_min = ALIGN(address_min, alignment);
257 257
258 /* 258 /*
259 * Reject inconsistent args. We have adjusted these, so this 259 * Reject inconsistent args. We have adjusted these, so this
@@ -291,7 +291,7 @@ int64_t cvmx_bootmem_phy_alloc(uint64_t req_size, uint64_t address_min,
291 * satisfy request. 291 * satisfy request.
292 */ 292 */
293 usable_base = 293 usable_base =
294 __ALIGN_MASK(max(address_min, ent_addr), alignment - 1); 294 ALIGN(max(address_min, ent_addr), alignment);
295 usable_max = min(address_max, ent_addr + ent_size); 295 usable_max = min(address_max, ent_addr + ent_size);
296 /* 296 /*
297 * We should be able to allocate block at address 297 * We should be able to allocate block at address
@@ -671,7 +671,7 @@ int64_t cvmx_bootmem_phy_named_block_alloc(uint64_t size, uint64_t min_addr,
671 * coallesced when they are freed. The alloc routine does the 671 * coallesced when they are freed. The alloc routine does the
672 * same rounding up on all allocations. 672 * same rounding up on all allocations.
673 */ 673 */
674 size = __ALIGN_MASK(size, (CVMX_BOOTMEM_ALIGNMENT_SIZE - 1)); 674 size = ALIGN(size, CVMX_BOOTMEM_ALIGNMENT_SIZE);
675 675
676 addr_allocated = cvmx_bootmem_phy_alloc(size, min_addr, max_addr, 676 addr_allocated = cvmx_bootmem_phy_alloc(size, min_addr, max_addr,
677 alignment, 677 alignment,
diff --git a/arch/mips/cavium-octeon/executive/cvmx-sysinfo.c b/arch/mips/cavium-octeon/executive/cvmx-sysinfo.c
index e5838890cba5..8b18a20cc7b3 100644
--- a/arch/mips/cavium-octeon/executive/cvmx-sysinfo.c
+++ b/arch/mips/cavium-octeon/executive/cvmx-sysinfo.c
@@ -115,4 +115,3 @@ int cvmx_sysinfo_minimal_initialize(void *phy_mem_desc_ptr,
115 115
116 return 1; 116 return 1;
117} 117}
118
diff --git a/arch/mips/cavium-octeon/octeon-irq.c b/arch/mips/cavium-octeon/octeon-irq.c
index 6f2acf09328d..c424cd158dc6 100644
--- a/arch/mips/cavium-octeon/octeon-irq.c
+++ b/arch/mips/cavium-octeon/octeon-irq.c
@@ -13,9 +13,8 @@
13#include <asm/octeon/cvmx-pexp-defs.h> 13#include <asm/octeon/cvmx-pexp-defs.h>
14#include <asm/octeon/cvmx-npi-defs.h> 14#include <asm/octeon/cvmx-npi-defs.h>
15 15
16DEFINE_RWLOCK(octeon_irq_ciu0_rwlock); 16static DEFINE_RAW_SPINLOCK(octeon_irq_ciu0_lock);
17DEFINE_RWLOCK(octeon_irq_ciu1_rwlock); 17static DEFINE_RAW_SPINLOCK(octeon_irq_ciu1_lock);
18DEFINE_SPINLOCK(octeon_irq_msi_lock);
19 18
20static int octeon_coreid_for_cpu(int cpu) 19static int octeon_coreid_for_cpu(int cpu)
21{ 20{
@@ -51,9 +50,6 @@ static void octeon_irq_core_eoi(unsigned int irq)
51 */ 50 */
52 if (desc->status & IRQ_DISABLED) 51 if (desc->status & IRQ_DISABLED)
53 return; 52 return;
54
55 /* There is a race here. We should fix it. */
56
57 /* 53 /*
58 * We don't need to disable IRQs to make these atomic since 54 * We don't need to disable IRQs to make these atomic since
59 * they are already disabled earlier in the low level 55 * they are already disabled earlier in the low level
@@ -141,19 +137,12 @@ static void octeon_irq_ciu0_enable(unsigned int irq)
141 uint64_t en0; 137 uint64_t en0;
142 int bit = irq - OCTEON_IRQ_WORKQ0; /* Bit 0-63 of EN0 */ 138 int bit = irq - OCTEON_IRQ_WORKQ0; /* Bit 0-63 of EN0 */
143 139
144 /* 140 raw_spin_lock_irqsave(&octeon_irq_ciu0_lock, flags);
145 * A read lock is used here to make sure only one core is ever
146 * updating the CIU enable bits at a time. During an enable
147 * the cores don't interfere with each other. During a disable
148 * the write lock stops any enables that might cause a
149 * problem.
150 */
151 read_lock_irqsave(&octeon_irq_ciu0_rwlock, flags);
152 en0 = cvmx_read_csr(CVMX_CIU_INTX_EN0(coreid * 2)); 141 en0 = cvmx_read_csr(CVMX_CIU_INTX_EN0(coreid * 2));
153 en0 |= 1ull << bit; 142 en0 |= 1ull << bit;
154 cvmx_write_csr(CVMX_CIU_INTX_EN0(coreid * 2), en0); 143 cvmx_write_csr(CVMX_CIU_INTX_EN0(coreid * 2), en0);
155 cvmx_read_csr(CVMX_CIU_INTX_EN0(coreid * 2)); 144 cvmx_read_csr(CVMX_CIU_INTX_EN0(coreid * 2));
156 read_unlock_irqrestore(&octeon_irq_ciu0_rwlock, flags); 145 raw_spin_unlock_irqrestore(&octeon_irq_ciu0_lock, flags);
157} 146}
158 147
159static void octeon_irq_ciu0_disable(unsigned int irq) 148static void octeon_irq_ciu0_disable(unsigned int irq)
@@ -162,7 +151,7 @@ static void octeon_irq_ciu0_disable(unsigned int irq)
162 unsigned long flags; 151 unsigned long flags;
163 uint64_t en0; 152 uint64_t en0;
164 int cpu; 153 int cpu;
165 write_lock_irqsave(&octeon_irq_ciu0_rwlock, flags); 154 raw_spin_lock_irqsave(&octeon_irq_ciu0_lock, flags);
166 for_each_online_cpu(cpu) { 155 for_each_online_cpu(cpu) {
167 int coreid = octeon_coreid_for_cpu(cpu); 156 int coreid = octeon_coreid_for_cpu(cpu);
168 en0 = cvmx_read_csr(CVMX_CIU_INTX_EN0(coreid * 2)); 157 en0 = cvmx_read_csr(CVMX_CIU_INTX_EN0(coreid * 2));
@@ -174,7 +163,7 @@ static void octeon_irq_ciu0_disable(unsigned int irq)
174 * of them are done. 163 * of them are done.
175 */ 164 */
176 cvmx_read_csr(CVMX_CIU_INTX_EN0(cvmx_get_core_num() * 2)); 165 cvmx_read_csr(CVMX_CIU_INTX_EN0(cvmx_get_core_num() * 2));
177 write_unlock_irqrestore(&octeon_irq_ciu0_rwlock, flags); 166 raw_spin_unlock_irqrestore(&octeon_irq_ciu0_lock, flags);
178} 167}
179 168
180/* 169/*
@@ -193,7 +182,7 @@ static void octeon_irq_ciu0_enable_v2(unsigned int irq)
193 * Disable the irq on the current core for chips that have the EN*_W1{S,C} 182 * Disable the irq on the current core for chips that have the EN*_W1{S,C}
194 * registers. 183 * registers.
195 */ 184 */
196static void octeon_irq_ciu0_disable_v2(unsigned int irq) 185static void octeon_irq_ciu0_ack_v2(unsigned int irq)
197{ 186{
198 int index = cvmx_get_core_num() * 2; 187 int index = cvmx_get_core_num() * 2;
199 u64 mask = 1ull << (irq - OCTEON_IRQ_WORKQ0); 188 u64 mask = 1ull << (irq - OCTEON_IRQ_WORKQ0);
@@ -202,6 +191,43 @@ static void octeon_irq_ciu0_disable_v2(unsigned int irq)
202} 191}
203 192
204/* 193/*
194 * CIU timer type interrupts must be acknoleged by writing a '1' bit
195 * to their sum0 bit.
196 */
197static void octeon_irq_ciu0_timer_ack(unsigned int irq)
198{
199 int index = cvmx_get_core_num() * 2;
200 uint64_t mask = 1ull << (irq - OCTEON_IRQ_WORKQ0);
201 cvmx_write_csr(CVMX_CIU_INTX_SUM0(index), mask);
202}
203
204static void octeon_irq_ciu0_timer_ack_v1(unsigned int irq)
205{
206 octeon_irq_ciu0_timer_ack(irq);
207 octeon_irq_ciu0_ack(irq);
208}
209
210static void octeon_irq_ciu0_timer_ack_v2(unsigned int irq)
211{
212 octeon_irq_ciu0_timer_ack(irq);
213 octeon_irq_ciu0_ack_v2(irq);
214}
215
216/*
217 * Enable the irq on the current core for chips that have the EN*_W1{S,C}
218 * registers.
219 */
220static void octeon_irq_ciu0_eoi_v2(unsigned int irq)
221{
222 struct irq_desc *desc = irq_desc + irq;
223 int index = cvmx_get_core_num() * 2;
224 u64 mask = 1ull << (irq - OCTEON_IRQ_WORKQ0);
225
226 if ((desc->status & IRQ_DISABLED) == 0)
227 cvmx_write_csr(CVMX_CIU_INTX_EN0_W1S(index), mask);
228}
229
230/*
205 * Disable the irq on the all cores for chips that have the EN*_W1{S,C} 231 * Disable the irq on the all cores for chips that have the EN*_W1{S,C}
206 * registers. 232 * registers.
207 */ 233 */
@@ -223,7 +249,7 @@ static int octeon_irq_ciu0_set_affinity(unsigned int irq, const struct cpumask *
223 unsigned long flags; 249 unsigned long flags;
224 int bit = irq - OCTEON_IRQ_WORKQ0; /* Bit 0-63 of EN0 */ 250 int bit = irq - OCTEON_IRQ_WORKQ0; /* Bit 0-63 of EN0 */
225 251
226 write_lock_irqsave(&octeon_irq_ciu0_rwlock, flags); 252 raw_spin_lock_irqsave(&octeon_irq_ciu0_lock, flags);
227 for_each_online_cpu(cpu) { 253 for_each_online_cpu(cpu) {
228 int coreid = octeon_coreid_for_cpu(cpu); 254 int coreid = octeon_coreid_for_cpu(cpu);
229 uint64_t en0 = 255 uint64_t en0 =
@@ -239,7 +265,7 @@ static int octeon_irq_ciu0_set_affinity(unsigned int irq, const struct cpumask *
239 * of them are done. 265 * of them are done.
240 */ 266 */
241 cvmx_read_csr(CVMX_CIU_INTX_EN0(cvmx_get_core_num() * 2)); 267 cvmx_read_csr(CVMX_CIU_INTX_EN0(cvmx_get_core_num() * 2));
242 write_unlock_irqrestore(&octeon_irq_ciu0_rwlock, flags); 268 raw_spin_unlock_irqrestore(&octeon_irq_ciu0_lock, flags);
243 269
244 return 0; 270 return 0;
245} 271}
@@ -272,8 +298,8 @@ static struct irq_chip octeon_irq_chip_ciu0_v2 = {
272 .name = "CIU0", 298 .name = "CIU0",
273 .enable = octeon_irq_ciu0_enable_v2, 299 .enable = octeon_irq_ciu0_enable_v2,
274 .disable = octeon_irq_ciu0_disable_all_v2, 300 .disable = octeon_irq_ciu0_disable_all_v2,
275 .ack = octeon_irq_ciu0_disable_v2, 301 .ack = octeon_irq_ciu0_ack_v2,
276 .eoi = octeon_irq_ciu0_enable_v2, 302 .eoi = octeon_irq_ciu0_eoi_v2,
277#ifdef CONFIG_SMP 303#ifdef CONFIG_SMP
278 .set_affinity = octeon_irq_ciu0_set_affinity_v2, 304 .set_affinity = octeon_irq_ciu0_set_affinity_v2,
279#endif 305#endif
@@ -290,6 +316,28 @@ static struct irq_chip octeon_irq_chip_ciu0 = {
290#endif 316#endif
291}; 317};
292 318
319static struct irq_chip octeon_irq_chip_ciu0_timer_v2 = {
320 .name = "CIU0-T",
321 .enable = octeon_irq_ciu0_enable_v2,
322 .disable = octeon_irq_ciu0_disable_all_v2,
323 .ack = octeon_irq_ciu0_timer_ack_v2,
324 .eoi = octeon_irq_ciu0_eoi_v2,
325#ifdef CONFIG_SMP
326 .set_affinity = octeon_irq_ciu0_set_affinity_v2,
327#endif
328};
329
330static struct irq_chip octeon_irq_chip_ciu0_timer = {
331 .name = "CIU0-T",
332 .enable = octeon_irq_ciu0_enable,
333 .disable = octeon_irq_ciu0_disable,
334 .ack = octeon_irq_ciu0_timer_ack_v1,
335 .eoi = octeon_irq_ciu0_eoi,
336#ifdef CONFIG_SMP
337 .set_affinity = octeon_irq_ciu0_set_affinity,
338#endif
339};
340
293 341
294static void octeon_irq_ciu1_ack(unsigned int irq) 342static void octeon_irq_ciu1_ack(unsigned int irq)
295{ 343{
@@ -322,19 +370,12 @@ static void octeon_irq_ciu1_enable(unsigned int irq)
322 uint64_t en1; 370 uint64_t en1;
323 int bit = irq - OCTEON_IRQ_WDOG0; /* Bit 0-63 of EN1 */ 371 int bit = irq - OCTEON_IRQ_WDOG0; /* Bit 0-63 of EN1 */
324 372
325 /* 373 raw_spin_lock_irqsave(&octeon_irq_ciu1_lock, flags);
326 * A read lock is used here to make sure only one core is ever
327 * updating the CIU enable bits at a time. During an enable
328 * the cores don't interfere with each other. During a disable
329 * the write lock stops any enables that might cause a
330 * problem.
331 */
332 read_lock_irqsave(&octeon_irq_ciu1_rwlock, flags);
333 en1 = cvmx_read_csr(CVMX_CIU_INTX_EN1(coreid * 2 + 1)); 374 en1 = cvmx_read_csr(CVMX_CIU_INTX_EN1(coreid * 2 + 1));
334 en1 |= 1ull << bit; 375 en1 |= 1ull << bit;
335 cvmx_write_csr(CVMX_CIU_INTX_EN1(coreid * 2 + 1), en1); 376 cvmx_write_csr(CVMX_CIU_INTX_EN1(coreid * 2 + 1), en1);
336 cvmx_read_csr(CVMX_CIU_INTX_EN1(coreid * 2 + 1)); 377 cvmx_read_csr(CVMX_CIU_INTX_EN1(coreid * 2 + 1));
337 read_unlock_irqrestore(&octeon_irq_ciu1_rwlock, flags); 378 raw_spin_unlock_irqrestore(&octeon_irq_ciu1_lock, flags);
338} 379}
339 380
340static void octeon_irq_ciu1_disable(unsigned int irq) 381static void octeon_irq_ciu1_disable(unsigned int irq)
@@ -343,7 +384,7 @@ static void octeon_irq_ciu1_disable(unsigned int irq)
343 unsigned long flags; 384 unsigned long flags;
344 uint64_t en1; 385 uint64_t en1;
345 int cpu; 386 int cpu;
346 write_lock_irqsave(&octeon_irq_ciu1_rwlock, flags); 387 raw_spin_lock_irqsave(&octeon_irq_ciu1_lock, flags);
347 for_each_online_cpu(cpu) { 388 for_each_online_cpu(cpu) {
348 int coreid = octeon_coreid_for_cpu(cpu); 389 int coreid = octeon_coreid_for_cpu(cpu);
349 en1 = cvmx_read_csr(CVMX_CIU_INTX_EN1(coreid * 2 + 1)); 390 en1 = cvmx_read_csr(CVMX_CIU_INTX_EN1(coreid * 2 + 1));
@@ -355,7 +396,7 @@ static void octeon_irq_ciu1_disable(unsigned int irq)
355 * of them are done. 396 * of them are done.
356 */ 397 */
357 cvmx_read_csr(CVMX_CIU_INTX_EN1(cvmx_get_core_num() * 2 + 1)); 398 cvmx_read_csr(CVMX_CIU_INTX_EN1(cvmx_get_core_num() * 2 + 1));
358 write_unlock_irqrestore(&octeon_irq_ciu1_rwlock, flags); 399 raw_spin_unlock_irqrestore(&octeon_irq_ciu1_lock, flags);
359} 400}
360 401
361/* 402/*
@@ -374,7 +415,7 @@ static void octeon_irq_ciu1_enable_v2(unsigned int irq)
374 * Disable the irq on the current core for chips that have the EN*_W1{S,C} 415 * Disable the irq on the current core for chips that have the EN*_W1{S,C}
375 * registers. 416 * registers.
376 */ 417 */
377static void octeon_irq_ciu1_disable_v2(unsigned int irq) 418static void octeon_irq_ciu1_ack_v2(unsigned int irq)
378{ 419{
379 int index = cvmx_get_core_num() * 2 + 1; 420 int index = cvmx_get_core_num() * 2 + 1;
380 u64 mask = 1ull << (irq - OCTEON_IRQ_WDOG0); 421 u64 mask = 1ull << (irq - OCTEON_IRQ_WDOG0);
@@ -383,6 +424,20 @@ static void octeon_irq_ciu1_disable_v2(unsigned int irq)
383} 424}
384 425
385/* 426/*
427 * Enable the irq on the current core for chips that have the EN*_W1{S,C}
428 * registers.
429 */
430static void octeon_irq_ciu1_eoi_v2(unsigned int irq)
431{
432 struct irq_desc *desc = irq_desc + irq;
433 int index = cvmx_get_core_num() * 2 + 1;
434 u64 mask = 1ull << (irq - OCTEON_IRQ_WDOG0);
435
436 if ((desc->status & IRQ_DISABLED) == 0)
437 cvmx_write_csr(CVMX_CIU_INTX_EN1_W1S(index), mask);
438}
439
440/*
386 * Disable the irq on the all cores for chips that have the EN*_W1{S,C} 441 * Disable the irq on the all cores for chips that have the EN*_W1{S,C}
387 * registers. 442 * registers.
388 */ 443 */
@@ -405,7 +460,7 @@ static int octeon_irq_ciu1_set_affinity(unsigned int irq,
405 unsigned long flags; 460 unsigned long flags;
406 int bit = irq - OCTEON_IRQ_WDOG0; /* Bit 0-63 of EN1 */ 461 int bit = irq - OCTEON_IRQ_WDOG0; /* Bit 0-63 of EN1 */
407 462
408 write_lock_irqsave(&octeon_irq_ciu1_rwlock, flags); 463 raw_spin_lock_irqsave(&octeon_irq_ciu1_lock, flags);
409 for_each_online_cpu(cpu) { 464 for_each_online_cpu(cpu) {
410 int coreid = octeon_coreid_for_cpu(cpu); 465 int coreid = octeon_coreid_for_cpu(cpu);
411 uint64_t en1 = 466 uint64_t en1 =
@@ -422,7 +477,7 @@ static int octeon_irq_ciu1_set_affinity(unsigned int irq,
422 * of them are done. 477 * of them are done.
423 */ 478 */
424 cvmx_read_csr(CVMX_CIU_INTX_EN1(cvmx_get_core_num() * 2 + 1)); 479 cvmx_read_csr(CVMX_CIU_INTX_EN1(cvmx_get_core_num() * 2 + 1));
425 write_unlock_irqrestore(&octeon_irq_ciu1_rwlock, flags); 480 raw_spin_unlock_irqrestore(&octeon_irq_ciu1_lock, flags);
426 481
427 return 0; 482 return 0;
428} 483}
@@ -455,8 +510,8 @@ static struct irq_chip octeon_irq_chip_ciu1_v2 = {
455 .name = "CIU0", 510 .name = "CIU0",
456 .enable = octeon_irq_ciu1_enable_v2, 511 .enable = octeon_irq_ciu1_enable_v2,
457 .disable = octeon_irq_ciu1_disable_all_v2, 512 .disable = octeon_irq_ciu1_disable_all_v2,
458 .ack = octeon_irq_ciu1_disable_v2, 513 .ack = octeon_irq_ciu1_ack_v2,
459 .eoi = octeon_irq_ciu1_enable_v2, 514 .eoi = octeon_irq_ciu1_eoi_v2,
460#ifdef CONFIG_SMP 515#ifdef CONFIG_SMP
461 .set_affinity = octeon_irq_ciu1_set_affinity_v2, 516 .set_affinity = octeon_irq_ciu1_set_affinity_v2,
462#endif 517#endif
@@ -475,6 +530,8 @@ static struct irq_chip octeon_irq_chip_ciu1 = {
475 530
476#ifdef CONFIG_PCI_MSI 531#ifdef CONFIG_PCI_MSI
477 532
533static DEFINE_RAW_SPINLOCK(octeon_irq_msi_lock);
534
478static void octeon_irq_msi_ack(unsigned int irq) 535static void octeon_irq_msi_ack(unsigned int irq)
479{ 536{
480 if (!octeon_has_feature(OCTEON_FEATURE_PCIE)) { 537 if (!octeon_has_feature(OCTEON_FEATURE_PCIE)) {
@@ -515,12 +572,12 @@ static void octeon_irq_msi_enable(unsigned int irq)
515 */ 572 */
516 uint64_t en; 573 uint64_t en;
517 unsigned long flags; 574 unsigned long flags;
518 spin_lock_irqsave(&octeon_irq_msi_lock, flags); 575 raw_spin_lock_irqsave(&octeon_irq_msi_lock, flags);
519 en = cvmx_read_csr(CVMX_PEXP_NPEI_MSI_ENB0); 576 en = cvmx_read_csr(CVMX_PEXP_NPEI_MSI_ENB0);
520 en |= 1ull << (irq - OCTEON_IRQ_MSI_BIT0); 577 en |= 1ull << (irq - OCTEON_IRQ_MSI_BIT0);
521 cvmx_write_csr(CVMX_PEXP_NPEI_MSI_ENB0, en); 578 cvmx_write_csr(CVMX_PEXP_NPEI_MSI_ENB0, en);
522 cvmx_read_csr(CVMX_PEXP_NPEI_MSI_ENB0); 579 cvmx_read_csr(CVMX_PEXP_NPEI_MSI_ENB0);
523 spin_unlock_irqrestore(&octeon_irq_msi_lock, flags); 580 raw_spin_unlock_irqrestore(&octeon_irq_msi_lock, flags);
524 } 581 }
525} 582}
526 583
@@ -537,12 +594,12 @@ static void octeon_irq_msi_disable(unsigned int irq)
537 */ 594 */
538 uint64_t en; 595 uint64_t en;
539 unsigned long flags; 596 unsigned long flags;
540 spin_lock_irqsave(&octeon_irq_msi_lock, flags); 597 raw_spin_lock_irqsave(&octeon_irq_msi_lock, flags);
541 en = cvmx_read_csr(CVMX_PEXP_NPEI_MSI_ENB0); 598 en = cvmx_read_csr(CVMX_PEXP_NPEI_MSI_ENB0);
542 en &= ~(1ull << (irq - OCTEON_IRQ_MSI_BIT0)); 599 en &= ~(1ull << (irq - OCTEON_IRQ_MSI_BIT0));
543 cvmx_write_csr(CVMX_PEXP_NPEI_MSI_ENB0, en); 600 cvmx_write_csr(CVMX_PEXP_NPEI_MSI_ENB0, en);
544 cvmx_read_csr(CVMX_PEXP_NPEI_MSI_ENB0); 601 cvmx_read_csr(CVMX_PEXP_NPEI_MSI_ENB0);
545 spin_unlock_irqrestore(&octeon_irq_msi_lock, flags); 602 raw_spin_unlock_irqrestore(&octeon_irq_msi_lock, flags);
546 } 603 }
547} 604}
548 605
@@ -559,6 +616,7 @@ void __init arch_init_irq(void)
559{ 616{
560 int irq; 617 int irq;
561 struct irq_chip *chip0; 618 struct irq_chip *chip0;
619 struct irq_chip *chip0_timer;
562 struct irq_chip *chip1; 620 struct irq_chip *chip1;
563 621
564#ifdef CONFIG_SMP 622#ifdef CONFIG_SMP
@@ -574,9 +632,11 @@ void __init arch_init_irq(void)
574 OCTEON_IS_MODEL(OCTEON_CN56XX_PASS2_X) || 632 OCTEON_IS_MODEL(OCTEON_CN56XX_PASS2_X) ||
575 OCTEON_IS_MODEL(OCTEON_CN52XX_PASS2_X)) { 633 OCTEON_IS_MODEL(OCTEON_CN52XX_PASS2_X)) {
576 chip0 = &octeon_irq_chip_ciu0_v2; 634 chip0 = &octeon_irq_chip_ciu0_v2;
635 chip0_timer = &octeon_irq_chip_ciu0_timer_v2;
577 chip1 = &octeon_irq_chip_ciu1_v2; 636 chip1 = &octeon_irq_chip_ciu1_v2;
578 } else { 637 } else {
579 chip0 = &octeon_irq_chip_ciu0; 638 chip0 = &octeon_irq_chip_ciu0;
639 chip0_timer = &octeon_irq_chip_ciu0_timer;
580 chip1 = &octeon_irq_chip_ciu1; 640 chip1 = &octeon_irq_chip_ciu1;
581 } 641 }
582 642
@@ -590,7 +650,21 @@ void __init arch_init_irq(void)
590 650
591 /* 24 - 87 CIU_INT_SUM0 */ 651 /* 24 - 87 CIU_INT_SUM0 */
592 for (irq = OCTEON_IRQ_WORKQ0; irq <= OCTEON_IRQ_BOOTDMA; irq++) { 652 for (irq = OCTEON_IRQ_WORKQ0; irq <= OCTEON_IRQ_BOOTDMA; irq++) {
593 set_irq_chip_and_handler(irq, chip0, handle_percpu_irq); 653 switch (irq) {
654 case OCTEON_IRQ_GMX_DRP0:
655 case OCTEON_IRQ_GMX_DRP1:
656 case OCTEON_IRQ_IPD_DRP:
657 case OCTEON_IRQ_KEY_ZERO:
658 case OCTEON_IRQ_TIMER0:
659 case OCTEON_IRQ_TIMER1:
660 case OCTEON_IRQ_TIMER2:
661 case OCTEON_IRQ_TIMER3:
662 set_irq_chip_and_handler(irq, chip0_timer, handle_percpu_irq);
663 break;
664 default:
665 set_irq_chip_and_handler(irq, chip0, handle_percpu_irq);
666 break;
667 }
594 } 668 }
595 669
596 /* 88 - 151 CIU_INT_SUM1 */ 670 /* 88 - 151 CIU_INT_SUM1 */
diff --git a/arch/mips/cavium-octeon/octeon-platform.c b/arch/mips/cavium-octeon/octeon-platform.c
index cfdb4c2ac5c3..62ac30eef5e8 100644
--- a/arch/mips/cavium-octeon/octeon-platform.c
+++ b/arch/mips/cavium-octeon/octeon-platform.c
@@ -9,6 +9,7 @@
9 9
10#include <linux/init.h> 10#include <linux/init.h>
11#include <linux/irq.h> 11#include <linux/irq.h>
12#include <linux/i2c.h>
12#include <linux/module.h> 13#include <linux/module.h>
13#include <linux/platform_device.h> 14#include <linux/platform_device.h>
14 15
@@ -159,6 +160,90 @@ out:
159} 160}
160device_initcall(octeon_rng_device_init); 161device_initcall(octeon_rng_device_init);
161 162
163static struct i2c_board_info __initdata octeon_i2c_devices[] = {
164 {
165 I2C_BOARD_INFO("ds1337", 0x68),
166 },
167};
168
169static int __init octeon_i2c_devices_init(void)
170{
171 return i2c_register_board_info(0, octeon_i2c_devices,
172 ARRAY_SIZE(octeon_i2c_devices));
173}
174arch_initcall(octeon_i2c_devices_init);
175
176#define OCTEON_I2C_IO_BASE 0x1180000001000ull
177#define OCTEON_I2C_IO_UNIT_OFFSET 0x200
178
179static struct octeon_i2c_data octeon_i2c_data[2];
180
181static int __init octeon_i2c_device_init(void)
182{
183 struct platform_device *pd;
184 int ret = 0;
185 int port, num_ports;
186
187 struct resource i2c_resources[] = {
188 {
189 .flags = IORESOURCE_MEM,
190 }, {
191 .flags = IORESOURCE_IRQ,
192 }
193 };
194
195 if (OCTEON_IS_MODEL(OCTEON_CN56XX) || OCTEON_IS_MODEL(OCTEON_CN52XX))
196 num_ports = 2;
197 else
198 num_ports = 1;
199
200 for (port = 0; port < num_ports; port++) {
201 octeon_i2c_data[port].sys_freq = octeon_get_clock_rate();
202 /*FIXME: should be examined. At the moment is set for 100Khz */
203 octeon_i2c_data[port].i2c_freq = 100000;
204
205 pd = platform_device_alloc("i2c-octeon", port);
206 if (!pd) {
207 ret = -ENOMEM;
208 goto out;
209 }
210
211 pd->dev.platform_data = octeon_i2c_data + port;
212
213 i2c_resources[0].start =
214 OCTEON_I2C_IO_BASE + (port * OCTEON_I2C_IO_UNIT_OFFSET);
215 i2c_resources[0].end = i2c_resources[0].start + 0x1f;
216 switch (port) {
217 case 0:
218 i2c_resources[1].start = OCTEON_IRQ_TWSI;
219 i2c_resources[1].end = OCTEON_IRQ_TWSI;
220 break;
221 case 1:
222 i2c_resources[1].start = OCTEON_IRQ_TWSI2;
223 i2c_resources[1].end = OCTEON_IRQ_TWSI2;
224 break;
225 default:
226 BUG();
227 }
228
229 ret = platform_device_add_resources(pd,
230 i2c_resources,
231 ARRAY_SIZE(i2c_resources));
232 if (ret)
233 goto fail;
234
235 ret = platform_device_add(pd);
236 if (ret)
237 goto fail;
238 }
239 return ret;
240fail:
241 platform_device_put(pd);
242out:
243 return ret;
244}
245device_initcall(octeon_i2c_device_init);
246
162/* Octeon SMI/MDIO interface. */ 247/* Octeon SMI/MDIO interface. */
163static int __init octeon_mdiobus_device_init(void) 248static int __init octeon_mdiobus_device_init(void)
164{ 249{
diff --git a/arch/mips/cavium-octeon/smp.c b/arch/mips/cavium-octeon/smp.c
index c198efdf583e..51e980290ce1 100644
--- a/arch/mips/cavium-octeon/smp.c
+++ b/arch/mips/cavium-octeon/smp.c
@@ -327,7 +327,7 @@ static void octeon_cpu_die(unsigned int cpu)
327 avail_coremask); 327 avail_coremask);
328 } 328 }
329 329
330 pr_info("Reset core %d. Available Coremask = %x \n", coreid, 330 pr_info("Reset core %d. Available Coremask = %x\n", coreid,
331 avail_coremask); 331 avail_coremask);
332 cvmx_write_csr(CVMX_CIU_PP_RST, 1 << coreid); 332 cvmx_write_csr(CVMX_CIU_PP_RST, 1 << coreid);
333 cvmx_write_csr(CVMX_CIU_PP_RST, 0); 333 cvmx_write_csr(CVMX_CIU_PP_RST, 0);
diff --git a/arch/mips/cobalt/pci.c b/arch/mips/cobalt/pci.c
index cfce7af1bca9..85ec9cc31d66 100644
--- a/arch/mips/cobalt/pci.c
+++ b/arch/mips/cobalt/pci.c
@@ -25,7 +25,7 @@ static struct resource cobalt_mem_resource = {
25 25
26static struct resource cobalt_io_resource = { 26static struct resource cobalt_io_resource = {
27 .start = 0x1000, 27 .start = 0x1000,
28 .end = GT_DEF_PCI0_IO_SIZE - 1, 28 .end = 0xffffffUL,
29 .name = "PCI I/O", 29 .name = "PCI I/O",
30 .flags = IORESOURCE_IO, 30 .flags = IORESOURCE_IO,
31}; 31};
diff --git a/arch/mips/configs/db1000_defconfig b/arch/mips/configs/db1000_defconfig
index 68e90cd6b2d4..f66d406aadce 100644
--- a/arch/mips/configs/db1000_defconfig
+++ b/arch/mips/configs/db1000_defconfig
@@ -1,78 +1,102 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.20 3# Linux kernel version: 2.6.33
4# Tue Feb 20 21:47:24 2007 4# Fri Feb 26 08:46:14 2010
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
8# 8#
9# Machine selection 9# Machine selection
10# 10#
11CONFIG_ZONE_DMA=y
12CONFIG_MACH_ALCHEMY=y 11CONFIG_MACH_ALCHEMY=y
13# CONFIG_MIPS_MTX1 is not set 12# CONFIG_AR7 is not set
14# CONFIG_MIPS_BOSPORUS is not set 13# CONFIG_BCM47XX is not set
15# CONFIG_MIPS_PB1000 is not set 14# CONFIG_BCM63XX is not set
16# CONFIG_MIPS_PB1100 is not set
17# CONFIG_MIPS_PB1500 is not set
18# CONFIG_MIPS_PB1550 is not set
19# CONFIG_MIPS_PB1200 is not set
20CONFIG_MIPS_DB1000=y
21# CONFIG_MIPS_DB1100 is not set
22# CONFIG_MIPS_DB1500 is not set
23# CONFIG_MIPS_DB1550 is not set
24# CONFIG_MIPS_DB1200 is not set
25# CONFIG_MIPS_MIRAGE is not set
26# CONFIG_MIPS_COBALT is not set 15# CONFIG_MIPS_COBALT is not set
27# CONFIG_MACH_DECSTATION is not set 16# CONFIG_MACH_DECSTATION is not set
28# CONFIG_MACH_JAZZ is not set 17# CONFIG_MACH_JAZZ is not set
18# CONFIG_LASAT is not set
19# CONFIG_MACH_LOONGSON is not set
29# CONFIG_MIPS_MALTA is not set 20# CONFIG_MIPS_MALTA is not set
30# CONFIG_WR_PPMC is not set
31# CONFIG_MIPS_SIM is not set 21# CONFIG_MIPS_SIM is not set
32# CONFIG_MOMENCO_JAGUAR_ATX is not set 22# CONFIG_NEC_MARKEINS is not set
33# CONFIG_MIPS_XXS1500 is not set 23# CONFIG_MACH_VR41XX is not set
24# CONFIG_NXP_STB220 is not set
25# CONFIG_NXP_STB225 is not set
34# CONFIG_PNX8550_JBS is not set 26# CONFIG_PNX8550_JBS is not set
35# CONFIG_PNX8550_STB810 is not set 27# CONFIG_PNX8550_STB810 is not set
36# CONFIG_MACH_VR41XX is not set 28# CONFIG_PMC_MSP is not set
37# CONFIG_PMC_YOSEMITE is not set 29# CONFIG_PMC_YOSEMITE is not set
38# CONFIG_MARKEINS is not set 30# CONFIG_POWERTV is not set
39# CONFIG_SGI_IP22 is not set 31# CONFIG_SGI_IP22 is not set
40# CONFIG_SGI_IP27 is not set 32# CONFIG_SGI_IP27 is not set
33# CONFIG_SGI_IP28 is not set
41# CONFIG_SGI_IP32 is not set 34# CONFIG_SGI_IP32 is not set
42# CONFIG_SIBYTE_BIGSUR is not set
43# CONFIG_SIBYTE_SWARM is not set
44# CONFIG_SIBYTE_SENTOSA is not set
45# CONFIG_SIBYTE_RHONE is not set
46# CONFIG_SIBYTE_CARMEL is not set
47# CONFIG_SIBYTE_LITTLESUR is not set
48# CONFIG_SIBYTE_CRHINE is not set 35# CONFIG_SIBYTE_CRHINE is not set
36# CONFIG_SIBYTE_CARMEL is not set
49# CONFIG_SIBYTE_CRHONE is not set 37# CONFIG_SIBYTE_CRHONE is not set
38# CONFIG_SIBYTE_RHONE is not set
39# CONFIG_SIBYTE_SWARM is not set
40# CONFIG_SIBYTE_LITTLESUR is not set
41# CONFIG_SIBYTE_SENTOSA is not set
42# CONFIG_SIBYTE_BIGSUR is not set
50# CONFIG_SNI_RM is not set 43# CONFIG_SNI_RM is not set
51# CONFIG_TOSHIBA_JMR3927 is not set 44# CONFIG_MACH_TX39XX is not set
52# CONFIG_TOSHIBA_RBTX4927 is not set 45# CONFIG_MACH_TX49XX is not set
53# CONFIG_TOSHIBA_RBTX4938 is not set 46# CONFIG_MIKROTIK_RB532 is not set
47# CONFIG_WR_PPMC is not set
48# CONFIG_CAVIUM_OCTEON_SIMULATOR is not set
49# CONFIG_CAVIUM_OCTEON_REFERENCE_BOARD is not set
50CONFIG_ALCHEMY_GPIOINT_AU1000=y
51# CONFIG_ALCHEMY_GPIO_INDIRECT is not set
52# CONFIG_MIPS_MTX1 is not set
53# CONFIG_MIPS_BOSPORUS is not set
54CONFIG_MIPS_DB1000=y
55# CONFIG_MIPS_DB1100 is not set
56# CONFIG_MIPS_DB1200 is not set
57# CONFIG_MIPS_DB1500 is not set
58# CONFIG_MIPS_DB1550 is not set
59# CONFIG_MIPS_MIRAGE is not set
60# CONFIG_MIPS_PB1000 is not set
61# CONFIG_MIPS_PB1100 is not set
62# CONFIG_MIPS_PB1200 is not set
63# CONFIG_MIPS_PB1500 is not set
64# CONFIG_MIPS_PB1550 is not set
65# CONFIG_MIPS_XXS1500 is not set
66CONFIG_SOC_AU1000=y
67CONFIG_SOC_AU1X00=y
68CONFIG_LOONGSON_UART_BASE=y
54CONFIG_RWSEM_GENERIC_SPINLOCK=y 69CONFIG_RWSEM_GENERIC_SPINLOCK=y
55# CONFIG_ARCH_HAS_ILOG2_U32 is not set 70# CONFIG_ARCH_HAS_ILOG2_U32 is not set
56# CONFIG_ARCH_HAS_ILOG2_U64 is not set 71# CONFIG_ARCH_HAS_ILOG2_U64 is not set
72CONFIG_ARCH_SUPPORTS_OPROFILE=y
57CONFIG_GENERIC_FIND_NEXT_BIT=y 73CONFIG_GENERIC_FIND_NEXT_BIT=y
58CONFIG_GENERIC_HWEIGHT=y 74CONFIG_GENERIC_HWEIGHT=y
59CONFIG_GENERIC_CALIBRATE_DELAY=y 75CONFIG_GENERIC_CALIBRATE_DELAY=y
76CONFIG_GENERIC_CLOCKEVENTS=y
60CONFIG_GENERIC_TIME=y 77CONFIG_GENERIC_TIME=y
61CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y 78CONFIG_GENERIC_CMOS_UPDATE=y
62# CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ is not set 79CONFIG_SCHED_OMIT_FRAME_POINTER=y
80CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
81CONFIG_CEVT_R4K_LIB=y
82CONFIG_CSRC_R4K_LIB=y
63CONFIG_DMA_NONCOHERENT=y 83CONFIG_DMA_NONCOHERENT=y
64CONFIG_DMA_NEED_PCI_MAP_STATE=y 84CONFIG_DMA_NEED_PCI_MAP_STATE=y
85CONFIG_SYS_HAS_EARLY_PRINTK=y
86# CONFIG_NO_IOPORT is not set
87CONFIG_GENERIC_GPIO=y
65# CONFIG_CPU_BIG_ENDIAN is not set 88# CONFIG_CPU_BIG_ENDIAN is not set
66CONFIG_CPU_LITTLE_ENDIAN=y 89CONFIG_CPU_LITTLE_ENDIAN=y
67CONFIG_SYS_SUPPORTS_APM_EMULATION=y 90CONFIG_SYS_SUPPORTS_APM_EMULATION=y
68CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y 91CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
69CONFIG_SOC_AU1000=y 92CONFIG_IRQ_CPU=y
70CONFIG_SOC_AU1X00=y
71CONFIG_MIPS_L1_CACHE_SHIFT=5 93CONFIG_MIPS_L1_CACHE_SHIFT=5
72 94
73# 95#
74# CPU selection 96# CPU selection
75# 97#
98# CONFIG_CPU_LOONGSON2E is not set
99# CONFIG_CPU_LOONGSON2F is not set
76CONFIG_CPU_MIPS32_R1=y 100CONFIG_CPU_MIPS32_R1=y
77# CONFIG_CPU_MIPS32_R2 is not set 101# CONFIG_CPU_MIPS32_R2 is not set
78# CONFIG_CPU_MIPS64_R1 is not set 102# CONFIG_CPU_MIPS64_R1 is not set
@@ -85,6 +109,7 @@ CONFIG_CPU_MIPS32_R1=y
85# CONFIG_CPU_TX49XX is not set 109# CONFIG_CPU_TX49XX is not set
86# CONFIG_CPU_R5000 is not set 110# CONFIG_CPU_R5000 is not set
87# CONFIG_CPU_R5432 is not set 111# CONFIG_CPU_R5432 is not set
112# CONFIG_CPU_R5500 is not set
88# CONFIG_CPU_R6000 is not set 113# CONFIG_CPU_R6000 is not set
89# CONFIG_CPU_NEVADA is not set 114# CONFIG_CPU_NEVADA is not set
90# CONFIG_CPU_R8000 is not set 115# CONFIG_CPU_R8000 is not set
@@ -92,11 +117,14 @@ CONFIG_CPU_MIPS32_R1=y
92# CONFIG_CPU_RM7000 is not set 117# CONFIG_CPU_RM7000 is not set
93# CONFIG_CPU_RM9000 is not set 118# CONFIG_CPU_RM9000 is not set
94# CONFIG_CPU_SB1 is not set 119# CONFIG_CPU_SB1 is not set
120# CONFIG_CPU_CAVIUM_OCTEON is not set
121CONFIG_SYS_SUPPORTS_ZBOOT=y
95CONFIG_SYS_HAS_CPU_MIPS32_R1=y 122CONFIG_SYS_HAS_CPU_MIPS32_R1=y
96CONFIG_CPU_MIPS32=y 123CONFIG_CPU_MIPS32=y
97CONFIG_CPU_MIPSR1=y 124CONFIG_CPU_MIPSR1=y
98CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y 125CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
99CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y 126CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
127CONFIG_HARDWARE_WATCHPOINTS=y
100 128
101# 129#
102# Kernel type 130# Kernel type
@@ -106,184 +134,244 @@ CONFIG_32BIT=y
106CONFIG_PAGE_SIZE_4KB=y 134CONFIG_PAGE_SIZE_4KB=y
107# CONFIG_PAGE_SIZE_8KB is not set 135# CONFIG_PAGE_SIZE_8KB is not set
108# CONFIG_PAGE_SIZE_16KB is not set 136# CONFIG_PAGE_SIZE_16KB is not set
137# CONFIG_PAGE_SIZE_32KB is not set
109# CONFIG_PAGE_SIZE_64KB is not set 138# CONFIG_PAGE_SIZE_64KB is not set
110CONFIG_CPU_HAS_PREFETCH=y 139CONFIG_CPU_HAS_PREFETCH=y
111CONFIG_MIPS_MT_DISABLED=y 140CONFIG_MIPS_MT_DISABLED=y
112# CONFIG_MIPS_MT_SMP is not set 141# CONFIG_MIPS_MT_SMP is not set
113# CONFIG_MIPS_MT_SMTC is not set 142# CONFIG_MIPS_MT_SMTC is not set
114# CONFIG_MIPS_VPE_LOADER is not set
115CONFIG_64BIT_PHYS_ADDR=y 143CONFIG_64BIT_PHYS_ADDR=y
144CONFIG_ARCH_PHYS_ADDR_T_64BIT=y
116CONFIG_CPU_HAS_SYNC=y 145CONFIG_CPU_HAS_SYNC=y
117CONFIG_GENERIC_HARDIRQS=y 146CONFIG_GENERIC_HARDIRQS=y
118CONFIG_GENERIC_IRQ_PROBE=y 147CONFIG_GENERIC_IRQ_PROBE=y
119CONFIG_CPU_SUPPORTS_HIGHMEM=y 148CONFIG_CPU_SUPPORTS_HIGHMEM=y
120CONFIG_ARCH_FLATMEM_ENABLE=y 149CONFIG_ARCH_FLATMEM_ENABLE=y
150CONFIG_ARCH_POPULATES_NODE_MAP=y
121CONFIG_SELECT_MEMORY_MODEL=y 151CONFIG_SELECT_MEMORY_MODEL=y
122CONFIG_FLATMEM_MANUAL=y 152CONFIG_FLATMEM_MANUAL=y
123# CONFIG_DISCONTIGMEM_MANUAL is not set 153# CONFIG_DISCONTIGMEM_MANUAL is not set
124# CONFIG_SPARSEMEM_MANUAL is not set 154# CONFIG_SPARSEMEM_MANUAL is not set
125CONFIG_FLATMEM=y 155CONFIG_FLATMEM=y
126CONFIG_FLAT_NODE_MEM_MAP=y 156CONFIG_FLAT_NODE_MEM_MAP=y
127# CONFIG_SPARSEMEM_STATIC is not set 157CONFIG_PAGEFLAGS_EXTENDED=y
128CONFIG_SPLIT_PTLOCK_CPUS=4 158CONFIG_SPLIT_PTLOCK_CPUS=4
129# CONFIG_RESOURCES_64BIT is not set 159CONFIG_PHYS_ADDR_T_64BIT=y
130CONFIG_ZONE_DMA_FLAG=1 160CONFIG_ZONE_DMA_FLAG=0
161CONFIG_VIRT_TO_BUS=y
162# CONFIG_KSM is not set
163CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
164CONFIG_TICK_ONESHOT=y
165CONFIG_NO_HZ=y
166CONFIG_HIGH_RES_TIMERS=y
167CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
131# CONFIG_HZ_48 is not set 168# CONFIG_HZ_48 is not set
132# CONFIG_HZ_100 is not set 169CONFIG_HZ_100=y
133# CONFIG_HZ_128 is not set 170# CONFIG_HZ_128 is not set
134# CONFIG_HZ_250 is not set 171# CONFIG_HZ_250 is not set
135# CONFIG_HZ_256 is not set 172# CONFIG_HZ_256 is not set
136CONFIG_HZ_1000=y 173# CONFIG_HZ_1000 is not set
137# CONFIG_HZ_1024 is not set 174# CONFIG_HZ_1024 is not set
138CONFIG_SYS_SUPPORTS_ARBIT_HZ=y 175CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
139CONFIG_HZ=1000 176CONFIG_HZ=100
140CONFIG_PREEMPT_NONE=y 177CONFIG_PREEMPT_NONE=y
141# CONFIG_PREEMPT_VOLUNTARY is not set 178# CONFIG_PREEMPT_VOLUNTARY is not set
142# CONFIG_PREEMPT is not set 179# CONFIG_PREEMPT is not set
143# CONFIG_KEXEC is not set 180# CONFIG_KEXEC is not set
181# CONFIG_SECCOMP is not set
144CONFIG_LOCKDEP_SUPPORT=y 182CONFIG_LOCKDEP_SUPPORT=y
145CONFIG_STACKTRACE_SUPPORT=y 183CONFIG_STACKTRACE_SUPPORT=y
146CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 184CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
185CONFIG_CONSTRUCTORS=y
147 186
148# 187#
149# Code maturity level options 188# General setup
150# 189#
151CONFIG_EXPERIMENTAL=y 190CONFIG_EXPERIMENTAL=y
152CONFIG_BROKEN_ON_SMP=y 191CONFIG_BROKEN_ON_SMP=y
153CONFIG_INIT_ENV_ARG_LIMIT=32 192CONFIG_INIT_ENV_ARG_LIMIT=32
154 193CONFIG_LOCALVERSION="-db1000"
155#
156# General setup
157#
158CONFIG_LOCALVERSION=""
159CONFIG_LOCALVERSION_AUTO=y 194CONFIG_LOCALVERSION_AUTO=y
195CONFIG_HAVE_KERNEL_GZIP=y
196CONFIG_HAVE_KERNEL_BZIP2=y
197CONFIG_HAVE_KERNEL_LZMA=y
198CONFIG_HAVE_KERNEL_LZO=y
199# CONFIG_KERNEL_GZIP is not set
200# CONFIG_KERNEL_BZIP2 is not set
201CONFIG_KERNEL_LZMA=y
202# CONFIG_KERNEL_LZO is not set
160CONFIG_SWAP=y 203CONFIG_SWAP=y
161CONFIG_SYSVIPC=y 204CONFIG_SYSVIPC=y
162# CONFIG_IPC_NS is not set
163CONFIG_SYSVIPC_SYSCTL=y 205CONFIG_SYSVIPC_SYSCTL=y
164# CONFIG_POSIX_MQUEUE is not set 206CONFIG_POSIX_MQUEUE=y
207CONFIG_POSIX_MQUEUE_SYSCTL=y
165# CONFIG_BSD_PROCESS_ACCT is not set 208# CONFIG_BSD_PROCESS_ACCT is not set
166# CONFIG_TASKSTATS is not set 209# CONFIG_TASKSTATS is not set
167# CONFIG_UTS_NS is not set
168# CONFIG_AUDIT is not set 210# CONFIG_AUDIT is not set
211
212#
213# RCU Subsystem
214#
215# CONFIG_TREE_RCU is not set
216# CONFIG_TREE_PREEMPT_RCU is not set
217CONFIG_TINY_RCU=y
218# CONFIG_TREE_RCU_TRACE is not set
169# CONFIG_IKCONFIG is not set 219# CONFIG_IKCONFIG is not set
170CONFIG_SYSFS_DEPRECATED=y 220CONFIG_LOG_BUF_SHIFT=14
171CONFIG_RELAY=y 221# CONFIG_GROUP_SCHED is not set
222# CONFIG_CGROUPS is not set
223# CONFIG_SYSFS_DEPRECATED_V2 is not set
224# CONFIG_RELAY is not set
225# CONFIG_NAMESPACES is not set
226# CONFIG_BLK_DEV_INITRD is not set
172# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 227# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
173CONFIG_SYSCTL=y 228CONFIG_SYSCTL=y
229CONFIG_ANON_INODES=y
174CONFIG_EMBEDDED=y 230CONFIG_EMBEDDED=y
175CONFIG_SYSCTL_SYSCALL=y 231CONFIG_SYSCTL_SYSCALL=y
176CONFIG_KALLSYMS=y 232# CONFIG_KALLSYMS is not set
177# CONFIG_KALLSYMS_EXTRA_PASS is not set
178CONFIG_HOTPLUG=y 233CONFIG_HOTPLUG=y
179CONFIG_PRINTK=y 234CONFIG_PRINTK=y
180CONFIG_BUG=y 235CONFIG_BUG=y
181CONFIG_ELF_CORE=y 236CONFIG_ELF_CORE=y
237# CONFIG_PCSPKR_PLATFORM is not set
182CONFIG_BASE_FULL=y 238CONFIG_BASE_FULL=y
183CONFIG_FUTEX=y 239CONFIG_FUTEX=y
184CONFIG_EPOLL=y 240CONFIG_EPOLL=y
241CONFIG_SIGNALFD=y
242CONFIG_TIMERFD=y
243CONFIG_EVENTFD=y
185CONFIG_SHMEM=y 244CONFIG_SHMEM=y
245CONFIG_AIO=y
246
247#
248# Kernel Performance Events And Counters
249#
250# CONFIG_VM_EVENT_COUNTERS is not set
251# CONFIG_COMPAT_BRK is not set
186CONFIG_SLAB=y 252CONFIG_SLAB=y
187CONFIG_VM_EVENT_COUNTERS=y 253# CONFIG_SLUB is not set
188CONFIG_RT_MUTEXES=y
189# CONFIG_TINY_SHMEM is not set
190CONFIG_BASE_SMALL=0
191# CONFIG_SLOB is not set 254# CONFIG_SLOB is not set
255# CONFIG_PROFILING is not set
256CONFIG_HAVE_OPROFILE=y
192 257
193# 258#
194# Loadable module support 259# GCOV-based kernel profiling
195# 260#
261# CONFIG_SLOW_WORK is not set
262CONFIG_HAVE_GENERIC_DMA_COHERENT=y
263CONFIG_SLABINFO=y
264CONFIG_RT_MUTEXES=y
265CONFIG_BASE_SMALL=0
196CONFIG_MODULES=y 266CONFIG_MODULES=y
267# CONFIG_MODULE_FORCE_LOAD is not set
197CONFIG_MODULE_UNLOAD=y 268CONFIG_MODULE_UNLOAD=y
198# CONFIG_MODULE_FORCE_UNLOAD is not set 269# CONFIG_MODULE_FORCE_UNLOAD is not set
199CONFIG_MODVERSIONS=y 270# CONFIG_MODVERSIONS is not set
200CONFIG_MODULE_SRCVERSION_ALL=y 271# CONFIG_MODULE_SRCVERSION_ALL is not set
201CONFIG_KMOD=y
202
203#
204# Block layer
205#
206CONFIG_BLOCK=y 272CONFIG_BLOCK=y
207# CONFIG_LBD is not set 273# CONFIG_LBDAF is not set
208# CONFIG_BLK_DEV_IO_TRACE is not set 274# CONFIG_BLK_DEV_BSG is not set
209# CONFIG_LSF is not set 275# CONFIG_BLK_DEV_INTEGRITY is not set
210 276
211# 277#
212# IO Schedulers 278# IO Schedulers
213# 279#
214CONFIG_IOSCHED_NOOP=y 280CONFIG_IOSCHED_NOOP=y
215CONFIG_IOSCHED_AS=y 281# CONFIG_IOSCHED_DEADLINE is not set
216CONFIG_IOSCHED_DEADLINE=y 282# CONFIG_IOSCHED_CFQ is not set
217CONFIG_IOSCHED_CFQ=y
218CONFIG_DEFAULT_AS=y
219# CONFIG_DEFAULT_DEADLINE is not set 283# CONFIG_DEFAULT_DEADLINE is not set
220# CONFIG_DEFAULT_CFQ is not set 284# CONFIG_DEFAULT_CFQ is not set
221# CONFIG_DEFAULT_NOOP is not set 285CONFIG_DEFAULT_NOOP=y
222CONFIG_DEFAULT_IOSCHED="anticipatory" 286CONFIG_DEFAULT_IOSCHED="noop"
287# CONFIG_INLINE_SPIN_TRYLOCK is not set
288# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set
289# CONFIG_INLINE_SPIN_LOCK is not set
290# CONFIG_INLINE_SPIN_LOCK_BH is not set
291# CONFIG_INLINE_SPIN_LOCK_IRQ is not set
292# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set
293CONFIG_INLINE_SPIN_UNLOCK=y
294# CONFIG_INLINE_SPIN_UNLOCK_BH is not set
295CONFIG_INLINE_SPIN_UNLOCK_IRQ=y
296# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set
297# CONFIG_INLINE_READ_TRYLOCK is not set
298# CONFIG_INLINE_READ_LOCK is not set
299# CONFIG_INLINE_READ_LOCK_BH is not set
300# CONFIG_INLINE_READ_LOCK_IRQ is not set
301# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set
302CONFIG_INLINE_READ_UNLOCK=y
303# CONFIG_INLINE_READ_UNLOCK_BH is not set
304CONFIG_INLINE_READ_UNLOCK_IRQ=y
305# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set
306# CONFIG_INLINE_WRITE_TRYLOCK is not set
307# CONFIG_INLINE_WRITE_LOCK is not set
308# CONFIG_INLINE_WRITE_LOCK_BH is not set
309# CONFIG_INLINE_WRITE_LOCK_IRQ is not set
310# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set
311CONFIG_INLINE_WRITE_UNLOCK=y
312# CONFIG_INLINE_WRITE_UNLOCK_BH is not set
313CONFIG_INLINE_WRITE_UNLOCK_IRQ=y
314# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set
315# CONFIG_MUTEX_SPIN_ON_OWNER is not set
316CONFIG_FREEZER=y
223 317
224# 318#
225# Bus options (PCI, PCMCIA, EISA, ISA, TC) 319# Bus options (PCI, PCMCIA, EISA, ISA, TC)
226# 320#
227CONFIG_HW_HAS_PCI=y 321CONFIG_HW_HAS_PCI=y
228# CONFIG_PCI is not set 322# CONFIG_PCI is not set
323# CONFIG_ARCH_SUPPORTS_MSI is not set
229CONFIG_MMU=y 324CONFIG_MMU=y
230 325CONFIG_PCCARD=y
231# 326CONFIG_PCMCIA=y
232# PCCARD (PCMCIA/CardBus) support
233#
234CONFIG_PCCARD=m
235# CONFIG_PCMCIA_DEBUG is not set
236CONFIG_PCMCIA=m
237CONFIG_PCMCIA_LOAD_CIS=y 327CONFIG_PCMCIA_LOAD_CIS=y
238CONFIG_PCMCIA_IOCTL=y 328# CONFIG_PCMCIA_IOCTL is not set
239 329
240# 330#
241# PC-card bridges 331# PC-card bridges
242# 332#
243# CONFIG_PCMCIA_AU1X00 is not set 333# CONFIG_PCMCIA_AU1X00 is not set
244 334CONFIG_PCMCIA_ALCHEMY_DEVBOARD=y
245#
246# PCI Hotplug Support
247#
248 335
249# 336#
250# Executable file formats 337# Executable file formats
251# 338#
252CONFIG_BINFMT_ELF=y 339CONFIG_BINFMT_ELF=y
340# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
341# CONFIG_HAVE_AOUT is not set
253# CONFIG_BINFMT_MISC is not set 342# CONFIG_BINFMT_MISC is not set
254CONFIG_TRAD_SIGNALS=y 343CONFIG_TRAD_SIGNALS=y
255 344
256# 345#
257# Power management options 346# Power management options
258# 347#
259# CONFIG_PM is not set 348CONFIG_ARCH_HIBERNATION_POSSIBLE=y
260 349CONFIG_ARCH_SUSPEND_POSSIBLE=y
261# 350CONFIG_PM=y
262# Networking 351# CONFIG_PM_DEBUG is not set
263# 352CONFIG_PM_SLEEP=y
353CONFIG_SUSPEND=y
354CONFIG_SUSPEND_FREEZER=y
355# CONFIG_HIBERNATION is not set
356# CONFIG_APM_EMULATION is not set
357CONFIG_PM_RUNTIME=y
264CONFIG_NET=y 358CONFIG_NET=y
265 359
266# 360#
267# Networking options 361# Networking options
268# 362#
269# CONFIG_NETDEBUG is not set
270CONFIG_PACKET=y 363CONFIG_PACKET=y
271# CONFIG_PACKET_MMAP is not set 364CONFIG_PACKET_MMAP=y
272CONFIG_UNIX=y 365CONFIG_UNIX=y
273CONFIG_XFRM=y 366# CONFIG_NET_KEY is not set
274CONFIG_XFRM_USER=m
275# CONFIG_XFRM_SUB_POLICY is not set
276CONFIG_XFRM_MIGRATE=y
277CONFIG_NET_KEY=y
278CONFIG_NET_KEY_MIGRATE=y
279CONFIG_INET=y 367CONFIG_INET=y
280CONFIG_IP_MULTICAST=y 368CONFIG_IP_MULTICAST=y
281# CONFIG_IP_ADVANCED_ROUTER is not set 369# CONFIG_IP_ADVANCED_ROUTER is not set
282CONFIG_IP_FIB_HASH=y 370CONFIG_IP_FIB_HASH=y
283CONFIG_IP_PNP=y 371CONFIG_IP_PNP=y
284# CONFIG_IP_PNP_DHCP is not set 372CONFIG_IP_PNP_DHCP=y
285CONFIG_IP_PNP_BOOTP=y 373CONFIG_IP_PNP_BOOTP=y
286# CONFIG_IP_PNP_RARP is not set 374CONFIG_IP_PNP_RARP=y
287# CONFIG_NET_IPIP is not set 375# CONFIG_NET_IPIP is not set
288# CONFIG_NET_IPGRE is not set 376# CONFIG_NET_IPGRE is not set
289# CONFIG_IP_MROUTE is not set 377# CONFIG_IP_MROUTE is not set
@@ -294,110 +382,25 @@ CONFIG_IP_PNP_BOOTP=y
294# CONFIG_INET_IPCOMP is not set 382# CONFIG_INET_IPCOMP is not set
295# CONFIG_INET_XFRM_TUNNEL is not set 383# CONFIG_INET_XFRM_TUNNEL is not set
296# CONFIG_INET_TUNNEL is not set 384# CONFIG_INET_TUNNEL is not set
297CONFIG_INET_XFRM_MODE_TRANSPORT=m 385# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
298CONFIG_INET_XFRM_MODE_TUNNEL=m 386# CONFIG_INET_XFRM_MODE_TUNNEL is not set
299CONFIG_INET_XFRM_MODE_BEET=m 387# CONFIG_INET_XFRM_MODE_BEET is not set
300CONFIG_INET_DIAG=y 388CONFIG_INET_LRO=y
301CONFIG_INET_TCP_DIAG=y 389# CONFIG_INET_DIAG is not set
302# CONFIG_TCP_CONG_ADVANCED is not set 390# CONFIG_TCP_CONG_ADVANCED is not set
303CONFIG_TCP_CONG_CUBIC=y 391CONFIG_TCP_CONG_CUBIC=y
304CONFIG_DEFAULT_TCP_CONG="cubic" 392CONFIG_DEFAULT_TCP_CONG="cubic"
305CONFIG_TCP_MD5SIG=y 393# CONFIG_TCP_MD5SIG is not set
306
307#
308# IP: Virtual Server Configuration
309#
310# CONFIG_IP_VS is not set
311# CONFIG_IPV6 is not set 394# CONFIG_IPV6 is not set
312# CONFIG_INET6_XFRM_TUNNEL is not set 395# CONFIG_NETWORK_SECMARK is not set
313# CONFIG_INET6_TUNNEL is not set 396# CONFIG_NETFILTER is not set
314CONFIG_NETWORK_SECMARK=y
315CONFIG_NETFILTER=y
316# CONFIG_NETFILTER_DEBUG is not set
317
318#
319# Core Netfilter Configuration
320#
321CONFIG_NETFILTER_NETLINK=m
322CONFIG_NETFILTER_NETLINK_QUEUE=m
323CONFIG_NETFILTER_NETLINK_LOG=m
324CONFIG_NF_CONNTRACK_ENABLED=m
325CONFIG_NF_CONNTRACK_SUPPORT=y
326# CONFIG_IP_NF_CONNTRACK_SUPPORT is not set
327CONFIG_NF_CONNTRACK=m
328CONFIG_NF_CT_ACCT=y
329CONFIG_NF_CONNTRACK_MARK=y
330CONFIG_NF_CONNTRACK_SECMARK=y
331CONFIG_NF_CONNTRACK_EVENTS=y
332CONFIG_NF_CT_PROTO_GRE=m
333CONFIG_NF_CT_PROTO_SCTP=m
334CONFIG_NF_CONNTRACK_AMANDA=m
335CONFIG_NF_CONNTRACK_FTP=m
336CONFIG_NF_CONNTRACK_H323=m
337CONFIG_NF_CONNTRACK_IRC=m
338# CONFIG_NF_CONNTRACK_NETBIOS_NS is not set
339CONFIG_NF_CONNTRACK_PPTP=m
340CONFIG_NF_CONNTRACK_SANE=m
341CONFIG_NF_CONNTRACK_SIP=m
342CONFIG_NF_CONNTRACK_TFTP=m
343CONFIG_NF_CT_NETLINK=m
344CONFIG_NETFILTER_XTABLES=m
345CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
346CONFIG_NETFILTER_XT_TARGET_MARK=m
347CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
348CONFIG_NETFILTER_XT_TARGET_NFLOG=m
349CONFIG_NETFILTER_XT_TARGET_SECMARK=m
350CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=m
351CONFIG_NETFILTER_XT_TARGET_TCPMSS=m
352CONFIG_NETFILTER_XT_MATCH_COMMENT=m
353CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
354CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
355CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
356CONFIG_NETFILTER_XT_MATCH_DCCP=m
357CONFIG_NETFILTER_XT_MATCH_DSCP=m
358CONFIG_NETFILTER_XT_MATCH_ESP=m
359CONFIG_NETFILTER_XT_MATCH_HELPER=m
360CONFIG_NETFILTER_XT_MATCH_LENGTH=m
361CONFIG_NETFILTER_XT_MATCH_LIMIT=m
362CONFIG_NETFILTER_XT_MATCH_MAC=m
363CONFIG_NETFILTER_XT_MATCH_MARK=m
364CONFIG_NETFILTER_XT_MATCH_POLICY=m
365CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
366CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
367CONFIG_NETFILTER_XT_MATCH_QUOTA=m
368CONFIG_NETFILTER_XT_MATCH_REALM=m
369CONFIG_NETFILTER_XT_MATCH_SCTP=m
370CONFIG_NETFILTER_XT_MATCH_STATE=m
371CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
372CONFIG_NETFILTER_XT_MATCH_STRING=m
373CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
374CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
375
376#
377# IP: Netfilter Configuration
378#
379CONFIG_NF_CONNTRACK_IPV4=m
380CONFIG_NF_CONNTRACK_PROC_COMPAT=y
381# CONFIG_IP_NF_QUEUE is not set
382# CONFIG_IP_NF_IPTABLES is not set
383# CONFIG_IP_NF_ARPTABLES is not set
384
385#
386# DCCP Configuration (EXPERIMENTAL)
387#
388# CONFIG_IP_DCCP is not set 397# CONFIG_IP_DCCP is not set
389
390#
391# SCTP Configuration (EXPERIMENTAL)
392#
393# CONFIG_IP_SCTP is not set 398# CONFIG_IP_SCTP is not set
394 399# CONFIG_RDS is not set
395#
396# TIPC Configuration (EXPERIMENTAL)
397#
398# CONFIG_TIPC is not set 400# CONFIG_TIPC is not set
399# CONFIG_ATM is not set 401# CONFIG_ATM is not set
400# CONFIG_BRIDGE is not set 402# CONFIG_BRIDGE is not set
403# CONFIG_NET_DSA is not set
401# CONFIG_VLAN_8021Q is not set 404# CONFIG_VLAN_8021Q is not set
402# CONFIG_DECNET is not set 405# CONFIG_DECNET is not set
403# CONFIG_LLC2 is not set 406# CONFIG_LLC2 is not set
@@ -407,27 +410,24 @@ CONFIG_NF_CONNTRACK_PROC_COMPAT=y
407# CONFIG_LAPB is not set 410# CONFIG_LAPB is not set
408# CONFIG_ECONET is not set 411# CONFIG_ECONET is not set
409# CONFIG_WAN_ROUTER is not set 412# CONFIG_WAN_ROUTER is not set
410 413# CONFIG_PHONET is not set
411# 414# CONFIG_IEEE802154 is not set
412# QoS and/or fair queueing
413#
414# CONFIG_NET_SCHED is not set 415# CONFIG_NET_SCHED is not set
415CONFIG_NET_CLS_ROUTE=y 416# CONFIG_DCB is not set
416 417
417# 418#
418# Network testing 419# Network testing
419# 420#
420# CONFIG_NET_PKTGEN is not set 421# CONFIG_NET_PKTGEN is not set
421# CONFIG_HAMRADIO is not set 422# CONFIG_HAMRADIO is not set
423# CONFIG_CAN is not set
422# CONFIG_IRDA is not set 424# CONFIG_IRDA is not set
423# CONFIG_BT is not set 425# CONFIG_BT is not set
424CONFIG_IEEE80211=m 426# CONFIG_AF_RXRPC is not set
425# CONFIG_IEEE80211_DEBUG is not set 427# CONFIG_WIRELESS is not set
426CONFIG_IEEE80211_CRYPT_WEP=m 428# CONFIG_WIMAX is not set
427CONFIG_IEEE80211_CRYPT_CCMP=m 429# CONFIG_RFKILL is not set
428CONFIG_IEEE80211_SOFTMAC=m 430# CONFIG_NET_9P is not set
429# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set
430CONFIG_WIRELESS_EXT=y
431 431
432# 432#
433# Device Drivers 433# Device Drivers
@@ -436,25 +436,25 @@ CONFIG_WIRELESS_EXT=y
436# 436#
437# Generic Driver Options 437# Generic Driver Options
438# 438#
439CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
440# CONFIG_DEVTMPFS is not set
439CONFIG_STANDALONE=y 441CONFIG_STANDALONE=y
440CONFIG_PREVENT_FIRMWARE_BUILD=y 442CONFIG_PREVENT_FIRMWARE_BUILD=y
441CONFIG_FW_LOADER=m 443CONFIG_FW_LOADER=y
444CONFIG_FIRMWARE_IN_KERNEL=y
445CONFIG_EXTRA_FIRMWARE=""
446# CONFIG_DEBUG_DRIVER is not set
447# CONFIG_DEBUG_DEVRES is not set
442# CONFIG_SYS_HYPERVISOR is not set 448# CONFIG_SYS_HYPERVISOR is not set
443 449# CONFIG_CONNECTOR is not set
444#
445# Connector - unified userspace <-> kernelspace linker
446#
447CONFIG_CONNECTOR=m
448
449#
450# Memory Technology Devices (MTD)
451#
452CONFIG_MTD=y 450CONFIG_MTD=y
453# CONFIG_MTD_DEBUG is not set 451# CONFIG_MTD_DEBUG is not set
452# CONFIG_MTD_TESTS is not set
454# CONFIG_MTD_CONCAT is not set 453# CONFIG_MTD_CONCAT is not set
455CONFIG_MTD_PARTITIONS=y 454CONFIG_MTD_PARTITIONS=y
456# CONFIG_MTD_REDBOOT_PARTS is not set 455# CONFIG_MTD_REDBOOT_PARTS is not set
457# CONFIG_MTD_CMDLINE_PARTS is not set 456CONFIG_MTD_CMDLINE_PARTS=y
457# CONFIG_MTD_AR7_PARTS is not set
458 458
459# 459#
460# User Modules And Translation Layers 460# User Modules And Translation Layers
@@ -467,6 +467,7 @@ CONFIG_MTD_BLOCK=y
467# CONFIG_INFTL is not set 467# CONFIG_INFTL is not set
468# CONFIG_RFD_FTL is not set 468# CONFIG_RFD_FTL is not set
469# CONFIG_SSFDC is not set 469# CONFIG_SSFDC is not set
470# CONFIG_MTD_OOPS is not set
470 471
471# 472#
472# RAM/ROM/Flash chip drivers 473# RAM/ROM/Flash chip drivers
@@ -492,14 +493,13 @@ CONFIG_MTD_CFI_UTIL=y
492# CONFIG_MTD_RAM is not set 493# CONFIG_MTD_RAM is not set
493# CONFIG_MTD_ROM is not set 494# CONFIG_MTD_ROM is not set
494# CONFIG_MTD_ABSENT is not set 495# CONFIG_MTD_ABSENT is not set
495# CONFIG_MTD_OBSOLETE_CHIPS is not set
496 496
497# 497#
498# Mapping drivers for chip access 498# Mapping drivers for chip access
499# 499#
500# CONFIG_MTD_COMPLEX_MAPPINGS is not set 500# CONFIG_MTD_COMPLEX_MAPPINGS is not set
501# CONFIG_MTD_PHYSMAP is not set 501CONFIG_MTD_PHYSMAP=y
502CONFIG_MTD_ALCHEMY=y 502# CONFIG_MTD_PHYSMAP_COMPAT is not set
503# CONFIG_MTD_PLATRAM is not set 503# CONFIG_MTD_PLATRAM is not set
504 504
505# 505#
@@ -516,174 +516,115 @@ CONFIG_MTD_ALCHEMY=y
516# CONFIG_MTD_DOC2000 is not set 516# CONFIG_MTD_DOC2000 is not set
517# CONFIG_MTD_DOC2001 is not set 517# CONFIG_MTD_DOC2001 is not set
518# CONFIG_MTD_DOC2001PLUS is not set 518# CONFIG_MTD_DOC2001PLUS is not set
519
520#
521# NAND Flash Device Drivers
522#
523# CONFIG_MTD_NAND is not set 519# CONFIG_MTD_NAND is not set
524
525#
526# OneNAND Flash Device Drivers
527#
528# CONFIG_MTD_ONENAND is not set 520# CONFIG_MTD_ONENAND is not set
529 521
530# 522#
531# Parallel port support 523# LPDDR flash memory drivers
532# 524#
533# CONFIG_PARPORT is not set 525# CONFIG_MTD_LPDDR is not set
534 526
535# 527#
536# Plug and Play support 528# UBI - Unsorted block images
537# 529#
538# CONFIG_PNPACPI is not set 530# CONFIG_MTD_UBI is not set
531# CONFIG_PARPORT is not set
532CONFIG_BLK_DEV=y
533# CONFIG_BLK_DEV_COW_COMMON is not set
534# CONFIG_BLK_DEV_LOOP is not set
539 535
540# 536#
541# Block devices 537# DRBD disabled because PROC_FS, INET or CONNECTOR not selected
542# 538#
543# CONFIG_BLK_DEV_COW_COMMON is not set
544CONFIG_BLK_DEV_LOOP=y
545# CONFIG_BLK_DEV_CRYPTOLOOP is not set
546# CONFIG_BLK_DEV_NBD is not set 539# CONFIG_BLK_DEV_NBD is not set
540# CONFIG_BLK_DEV_UB is not set
547# CONFIG_BLK_DEV_RAM is not set 541# CONFIG_BLK_DEV_RAM is not set
548# CONFIG_BLK_DEV_INITRD is not set 542# CONFIG_CDROM_PKTCDVD is not set
549CONFIG_CDROM_PKTCDVD=m 543# CONFIG_ATA_OVER_ETH is not set
550CONFIG_CDROM_PKTCDVD_BUFFERS=8 544# CONFIG_BLK_DEV_HD is not set
551# CONFIG_CDROM_PKTCDVD_WCACHE is not set 545# CONFIG_MISC_DEVICES is not set
552CONFIG_ATA_OVER_ETH=m 546CONFIG_HAVE_IDE=y
553
554#
555# Misc devices
556#
557
558#
559# ATA/ATAPI/MFM/RLL support
560#
561# CONFIG_IDE is not set 547# CONFIG_IDE is not set
562 548
563# 549#
564# SCSI device support 550# SCSI device support
565# 551#
566CONFIG_RAID_ATTRS=m 552# CONFIG_RAID_ATTRS is not set
567# CONFIG_SCSI is not set 553# CONFIG_SCSI is not set
554# CONFIG_SCSI_DMA is not set
568# CONFIG_SCSI_NETLINK is not set 555# CONFIG_SCSI_NETLINK is not set
569
570#
571# Serial ATA (prod) and Parallel ATA (experimental) drivers
572#
573# CONFIG_ATA is not set 556# CONFIG_ATA is not set
574
575#
576# Multi-device support (RAID and LVM)
577#
578# CONFIG_MD is not set 557# CONFIG_MD is not set
579
580#
581# Fusion MPT device support
582#
583# CONFIG_FUSION is not set
584
585#
586# IEEE 1394 (FireWire) support
587#
588
589#
590# I2O device support
591#
592
593#
594# Network device support
595#
596CONFIG_NETDEVICES=y 558CONFIG_NETDEVICES=y
597# CONFIG_DUMMY is not set 559# CONFIG_DUMMY is not set
598# CONFIG_BONDING is not set 560# CONFIG_BONDING is not set
561# CONFIG_MACVLAN is not set
599# CONFIG_EQUALIZER is not set 562# CONFIG_EQUALIZER is not set
600# CONFIG_TUN is not set 563# CONFIG_TUN is not set
601 564# CONFIG_VETH is not set
602#
603# PHY device support
604#
605CONFIG_PHYLIB=y 565CONFIG_PHYLIB=y
606 566
607# 567#
608# MII PHY device drivers 568# MII PHY device drivers
609# 569#
610CONFIG_MARVELL_PHY=m 570CONFIG_MARVELL_PHY=y
611CONFIG_DAVICOM_PHY=m 571CONFIG_DAVICOM_PHY=y
612CONFIG_QSEMI_PHY=m 572CONFIG_QSEMI_PHY=y
613CONFIG_LXT_PHY=m 573CONFIG_LXT_PHY=y
614CONFIG_CICADA_PHY=m 574CONFIG_CICADA_PHY=y
615CONFIG_VITESSE_PHY=m 575CONFIG_VITESSE_PHY=y
616CONFIG_SMSC_PHY=m 576CONFIG_SMSC_PHY=y
617# CONFIG_BROADCOM_PHY is not set 577CONFIG_BROADCOM_PHY=y
578CONFIG_ICPLUS_PHY=y
579CONFIG_REALTEK_PHY=y
580CONFIG_NATIONAL_PHY=y
581CONFIG_STE10XP=y
582CONFIG_LSI_ET1011C_PHY=y
618# CONFIG_FIXED_PHY is not set 583# CONFIG_FIXED_PHY is not set
619 584# CONFIG_MDIO_BITBANG is not set
620#
621# Ethernet (10 or 100Mbit)
622#
623CONFIG_NET_ETHERNET=y 585CONFIG_NET_ETHERNET=y
624CONFIG_MII=m 586CONFIG_MII=y
587# CONFIG_AX88796 is not set
625CONFIG_MIPS_AU1X00_ENET=y 588CONFIG_MIPS_AU1X00_ENET=y
626# CONFIG_SMC91X is not set 589# CONFIG_SMC91X is not set
627# CONFIG_DM9000 is not set 590# CONFIG_DM9000 is not set
628 591# CONFIG_ETHOC is not set
629# 592# CONFIG_SMSC911X is not set
630# Ethernet (1000 Mbit) 593# CONFIG_DNET is not set
631# 594# CONFIG_IBM_NEW_EMAC_ZMII is not set
632 595# CONFIG_IBM_NEW_EMAC_RGMII is not set
633# 596# CONFIG_IBM_NEW_EMAC_TAH is not set
634# Ethernet (10000 Mbit) 597# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
635# 598# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
636 599# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
637# 600# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
638# Token Ring devices 601# CONFIG_B44 is not set
639# 602# CONFIG_KS8842 is not set
640 603# CONFIG_KS8851_MLL is not set
641# 604# CONFIG_NETDEV_1000 is not set
642# Wireless LAN (non-hamradio) 605# CONFIG_NETDEV_10000 is not set
643# 606# CONFIG_WLAN is not set
644# CONFIG_NET_RADIO is not set 607
645 608#
646# 609# Enable WiMAX (Networking options) to see the WiMAX drivers
647# PCMCIA network device support 610#
648# 611
649CONFIG_NET_PCMCIA=y 612#
650CONFIG_PCMCIA_3C589=m 613# USB Network Adapters
651CONFIG_PCMCIA_3C574=m 614#
652CONFIG_PCMCIA_FMVJ18X=m 615# CONFIG_USB_CATC is not set
653CONFIG_PCMCIA_PCNET=m 616# CONFIG_USB_KAWETH is not set
654CONFIG_PCMCIA_NMCLAN=m 617# CONFIG_USB_PEGASUS is not set
655CONFIG_PCMCIA_SMC91C92=m 618# CONFIG_USB_RTL8150 is not set
656CONFIG_PCMCIA_XIRC2PS=m 619# CONFIG_USB_USBNET is not set
657CONFIG_PCMCIA_AXNET=m 620# CONFIG_NET_PCMCIA is not set
658
659#
660# Wan interfaces
661#
662# CONFIG_WAN is not set 621# CONFIG_WAN is not set
663CONFIG_PPP=m 622# CONFIG_PPP is not set
664CONFIG_PPP_MULTILINK=y
665# CONFIG_PPP_FILTER is not set
666CONFIG_PPP_ASYNC=m
667# CONFIG_PPP_SYNC_TTY is not set
668CONFIG_PPP_DEFLATE=m
669# CONFIG_PPP_BSDCOMP is not set
670CONFIG_PPP_MPPE=m
671CONFIG_PPPOE=m
672# CONFIG_SLIP is not set 623# CONFIG_SLIP is not set
673CONFIG_SLHC=m
674# CONFIG_SHAPER is not set
675# CONFIG_NETCONSOLE is not set 624# CONFIG_NETCONSOLE is not set
676# CONFIG_NETPOLL is not set 625# CONFIG_NETPOLL is not set
677# CONFIG_NET_POLL_CONTROLLER is not set 626# CONFIG_NET_POLL_CONTROLLER is not set
678
679#
680# ISDN subsystem
681#
682# CONFIG_ISDN is not set 627# CONFIG_ISDN is not set
683
684#
685# Telephony Support
686#
687# CONFIG_PHONE is not set 628# CONFIG_PHONE is not set
688 629
689# 630#
@@ -691,16 +632,14 @@ CONFIG_SLHC=m
691# 632#
692CONFIG_INPUT=y 633CONFIG_INPUT=y
693# CONFIG_INPUT_FF_MEMLESS is not set 634# CONFIG_INPUT_FF_MEMLESS is not set
635# CONFIG_INPUT_POLLDEV is not set
636# CONFIG_INPUT_SPARSEKMAP is not set
694 637
695# 638#
696# Userland interfaces 639# Userland interfaces
697# 640#
698CONFIG_INPUT_MOUSEDEV=y 641# CONFIG_INPUT_MOUSEDEV is not set
699CONFIG_INPUT_MOUSEDEV_PSAUX=y
700CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
701CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
702# CONFIG_INPUT_JOYDEV is not set 642# CONFIG_INPUT_JOYDEV is not set
703# CONFIG_INPUT_TSDEV is not set
704CONFIG_INPUT_EVDEV=y 643CONFIG_INPUT_EVDEV=y
705# CONFIG_INPUT_EVBUG is not set 644# CONFIG_INPUT_EVBUG is not set
706 645
@@ -710,35 +649,33 @@ CONFIG_INPUT_EVDEV=y
710# CONFIG_INPUT_KEYBOARD is not set 649# CONFIG_INPUT_KEYBOARD is not set
711# CONFIG_INPUT_MOUSE is not set 650# CONFIG_INPUT_MOUSE is not set
712# CONFIG_INPUT_JOYSTICK is not set 651# CONFIG_INPUT_JOYSTICK is not set
652# CONFIG_INPUT_TABLET is not set
713# CONFIG_INPUT_TOUCHSCREEN is not set 653# CONFIG_INPUT_TOUCHSCREEN is not set
714# CONFIG_INPUT_MISC is not set 654# CONFIG_INPUT_MISC is not set
715 655
716# 656#
717# Hardware I/O ports 657# Hardware I/O ports
718# 658#
719CONFIG_SERIO=y 659# CONFIG_SERIO is not set
720# CONFIG_SERIO_I8042 is not set
721CONFIG_SERIO_SERPORT=y
722# CONFIG_SERIO_LIBPS2 is not set
723CONFIG_SERIO_RAW=m
724# CONFIG_GAMEPORT is not set 660# CONFIG_GAMEPORT is not set
725 661
726# 662#
727# Character devices 663# Character devices
728# 664#
729CONFIG_VT=y 665CONFIG_VT=y
666CONFIG_CONSOLE_TRANSLATIONS=y
730CONFIG_VT_CONSOLE=y 667CONFIG_VT_CONSOLE=y
731CONFIG_HW_CONSOLE=y 668CONFIG_HW_CONSOLE=y
732CONFIG_VT_HW_CONSOLE_BINDING=y 669# CONFIG_VT_HW_CONSOLE_BINDING is not set
670CONFIG_DEVKMEM=y
733# CONFIG_SERIAL_NONSTANDARD is not set 671# CONFIG_SERIAL_NONSTANDARD is not set
734# CONFIG_AU1X00_GPIO is not set
735 672
736# 673#
737# Serial drivers 674# Serial drivers
738# 675#
739CONFIG_SERIAL_8250=y 676CONFIG_SERIAL_8250=y
740CONFIG_SERIAL_8250_CONSOLE=y 677CONFIG_SERIAL_8250_CONSOLE=y
741CONFIG_SERIAL_8250_CS=m 678# CONFIG_SERIAL_8250_CS is not set
742CONFIG_SERIAL_8250_NR_UARTS=4 679CONFIG_SERIAL_8250_NR_UARTS=4
743CONFIG_SERIAL_8250_RUNTIME_UARTS=4 680CONFIG_SERIAL_8250_RUNTIME_UARTS=4
744# CONFIG_SERIAL_8250_EXTENDED is not set 681# CONFIG_SERIAL_8250_EXTENDED is not set
@@ -750,198 +687,291 @@ CONFIG_SERIAL_8250_AU1X00=y
750CONFIG_SERIAL_CORE=y 687CONFIG_SERIAL_CORE=y
751CONFIG_SERIAL_CORE_CONSOLE=y 688CONFIG_SERIAL_CORE_CONSOLE=y
752CONFIG_UNIX98_PTYS=y 689CONFIG_UNIX98_PTYS=y
753CONFIG_LEGACY_PTYS=y 690# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
754CONFIG_LEGACY_PTY_COUNT=256 691# CONFIG_LEGACY_PTYS is not set
755
756#
757# IPMI
758#
759# CONFIG_IPMI_HANDLER is not set 692# CONFIG_IPMI_HANDLER is not set
760
761#
762# Watchdog Cards
763#
764# CONFIG_WATCHDOG is not set
765# CONFIG_HW_RANDOM is not set 693# CONFIG_HW_RANDOM is not set
766# CONFIG_RTC is not set
767# CONFIG_GEN_RTC is not set
768# CONFIG_DTLK is not set
769# CONFIG_R3964 is not set 694# CONFIG_R3964 is not set
770 695
771# 696#
772# PCMCIA character devices 697# PCMCIA character devices
773# 698#
774CONFIG_SYNCLINK_CS=m 699# CONFIG_SYNCLINK_CS is not set
775# CONFIG_CARDMAN_4000 is not set 700# CONFIG_CARDMAN_4000 is not set
776# CONFIG_CARDMAN_4040 is not set 701# CONFIG_CARDMAN_4040 is not set
702# CONFIG_IPWIRELESS is not set
777# CONFIG_RAW_DRIVER is not set 703# CONFIG_RAW_DRIVER is not set
778
779#
780# TPM devices
781#
782# CONFIG_TCG_TPM is not set 704# CONFIG_TCG_TPM is not set
783
784#
785# I2C support
786#
787# CONFIG_I2C is not set 705# CONFIG_I2C is not set
788
789#
790# SPI support
791#
792# CONFIG_SPI is not set 706# CONFIG_SPI is not set
793# CONFIG_SPI_MASTER is not set
794 707
795# 708#
796# Dallas's 1-wire bus 709# PPS support
797# 710#
711# CONFIG_PPS is not set
712CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
713# CONFIG_GPIOLIB is not set
798# CONFIG_W1 is not set 714# CONFIG_W1 is not set
799 715# CONFIG_POWER_SUPPLY is not set
800#
801# Hardware Monitoring support
802#
803# CONFIG_HWMON is not set 716# CONFIG_HWMON is not set
804# CONFIG_HWMON_VID is not set 717# CONFIG_THERMAL is not set
718# CONFIG_WATCHDOG is not set
719CONFIG_SSB_POSSIBLE=y
805 720
806# 721#
807# Multimedia devices 722# Sonics Silicon Backplane
808# 723#
809# CONFIG_VIDEO_DEV is not set 724# CONFIG_SSB is not set
810 725
811# 726#
812# Digital Video Broadcasting Devices 727# Multifunction device drivers
813# 728#
814# CONFIG_DVB is not set 729# CONFIG_MFD_CORE is not set
730# CONFIG_MFD_SM501 is not set
731# CONFIG_HTC_PASIC3 is not set
732# CONFIG_MFD_TMIO is not set
733# CONFIG_REGULATOR is not set
734# CONFIG_MEDIA_SUPPORT is not set
815 735
816# 736#
817# Graphics support 737# Graphics support
818# 738#
819# CONFIG_FIRMWARE_EDID is not set 739# CONFIG_VGASTATE is not set
740# CONFIG_VIDEO_OUTPUT_CONTROL is not set
820# CONFIG_FB is not set 741# CONFIG_FB is not set
821
822#
823# Console display driver support
824#
825# CONFIG_VGA_CONSOLE is not set
826CONFIG_DUMMY_CONSOLE=y
827# CONFIG_BACKLIGHT_LCD_SUPPORT is not set 742# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
828 743
829# 744#
830# Sound 745# Display device support
831# 746#
832# CONFIG_SOUND is not set 747# CONFIG_DISPLAY_SUPPORT is not set
833 748
834# 749#
835# HID Devices 750# Console display driver support
836#
837# CONFIG_HID is not set
838
839#
840# USB support
841# 751#
752# CONFIG_VGA_CONSOLE is not set
753CONFIG_DUMMY_CONSOLE=y
754# CONFIG_SOUND is not set
755CONFIG_HID_SUPPORT=y
756CONFIG_HID=y
757# CONFIG_HIDRAW is not set
758
759#
760# USB Input Devices
761#
762CONFIG_USB_HID=y
763# CONFIG_HID_PID is not set
764# CONFIG_USB_HIDDEV is not set
765
766#
767# Special HID drivers
768#
769# CONFIG_HID_A4TECH is not set
770# CONFIG_HID_APPLE is not set
771# CONFIG_HID_BELKIN is not set
772# CONFIG_HID_CHERRY is not set
773# CONFIG_HID_CHICONY is not set
774# CONFIG_HID_CYPRESS is not set
775# CONFIG_HID_DRAGONRISE is not set
776# CONFIG_HID_EZKEY is not set
777# CONFIG_HID_KYE is not set
778# CONFIG_HID_GYRATION is not set
779# CONFIG_HID_TWINHAN is not set
780# CONFIG_HID_KENSINGTON is not set
781# CONFIG_HID_LOGITECH is not set
782# CONFIG_HID_MICROSOFT is not set
783# CONFIG_HID_MONTEREY is not set
784# CONFIG_HID_NTRIG is not set
785# CONFIG_HID_PANTHERLORD is not set
786# CONFIG_HID_PETALYNX is not set
787# CONFIG_HID_SAMSUNG is not set
788# CONFIG_HID_SONY is not set
789# CONFIG_HID_SUNPLUS is not set
790# CONFIG_HID_GREENASIA is not set
791# CONFIG_HID_SMARTJOYPLUS is not set
792# CONFIG_HID_TOPSEED is not set
793# CONFIG_HID_THRUSTMASTER is not set
794# CONFIG_HID_ZEROPLUS is not set
795CONFIG_USB_SUPPORT=y
842CONFIG_USB_ARCH_HAS_HCD=y 796CONFIG_USB_ARCH_HAS_HCD=y
843CONFIG_USB_ARCH_HAS_OHCI=y 797CONFIG_USB_ARCH_HAS_OHCI=y
844# CONFIG_USB_ARCH_HAS_EHCI is not set 798# CONFIG_USB_ARCH_HAS_EHCI is not set
845# CONFIG_USB is not set 799CONFIG_USB=y
800# CONFIG_USB_DEBUG is not set
801# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
846 802
847# 803#
848# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' 804# Miscellaneous USB options
849# 805#
806# CONFIG_USB_DEVICEFS is not set
807# CONFIG_USB_DEVICE_CLASS is not set
808CONFIG_USB_DYNAMIC_MINORS=y
809CONFIG_USB_SUSPEND=y
810# CONFIG_USB_OTG is not set
811# CONFIG_USB_OTG_WHITELIST is not set
812# CONFIG_USB_OTG_BLACKLIST_HUB is not set
813# CONFIG_USB_MON is not set
814# CONFIG_USB_WUSB is not set
815# CONFIG_USB_WUSB_CBAF is not set
850 816
851# 817#
852# USB Gadget Support 818# USB Host Controller Drivers
853# 819#
854# CONFIG_USB_GADGET is not set 820# CONFIG_USB_C67X00_HCD is not set
821# CONFIG_USB_OXU210HP_HCD is not set
822# CONFIG_USB_ISP116X_HCD is not set
823# CONFIG_USB_ISP1760_HCD is not set
824# CONFIG_USB_ISP1362_HCD is not set
825CONFIG_USB_OHCI_HCD=y
826# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
827# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
828CONFIG_USB_OHCI_LITTLE_ENDIAN=y
829# CONFIG_USB_SL811_HCD is not set
830# CONFIG_USB_R8A66597_HCD is not set
831# CONFIG_USB_HWA_HCD is not set
855 832
856# 833#
857# MMC/SD Card support 834# USB Device Class drivers
858# 835#
859# CONFIG_MMC is not set 836# CONFIG_USB_ACM is not set
837# CONFIG_USB_PRINTER is not set
838# CONFIG_USB_WDM is not set
839# CONFIG_USB_TMC is not set
860 840
861# 841#
862# LED devices 842# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
863# 843#
864# CONFIG_NEW_LEDS is not set
865 844
866# 845#
867# LED drivers 846# also be needed; see USB_STORAGE Help for more info
868# 847#
848# CONFIG_USB_LIBUSUAL is not set
869 849
870# 850#
871# LED Triggers 851# USB Imaging devices
872# 852#
853# CONFIG_USB_MDC800 is not set
873 854
874# 855#
875# InfiniBand support 856# USB port drivers
876# 857#
858# CONFIG_USB_SERIAL is not set
877 859
878# 860#
879# EDAC - error detection and reporting (RAS) (EXPERIMENTAL) 861# USB Miscellaneous drivers
880# 862#
863# CONFIG_USB_EMI62 is not set
864# CONFIG_USB_EMI26 is not set
865# CONFIG_USB_ADUTUX is not set
866# CONFIG_USB_SEVSEG is not set
867# CONFIG_USB_RIO500 is not set
868# CONFIG_USB_LEGOTOWER is not set
869# CONFIG_USB_LCD is not set
870# CONFIG_USB_BERRY_CHARGE is not set
871# CONFIG_USB_LED is not set
872# CONFIG_USB_CYPRESS_CY7C63 is not set
873# CONFIG_USB_CYTHERM is not set
874# CONFIG_USB_IDMOUSE is not set
875# CONFIG_USB_FTDI_ELAN is not set
876# CONFIG_USB_APPLEDISPLAY is not set
877# CONFIG_USB_LD is not set
878# CONFIG_USB_TRANCEVIBRATOR is not set
879# CONFIG_USB_IOWARRIOR is not set
880# CONFIG_USB_TEST is not set
881# CONFIG_USB_ISIGHTFW is not set
882# CONFIG_USB_VST is not set
883# CONFIG_USB_GADGET is not set
881 884
882# 885#
883# Real Time Clock 886# OTG and related infrastructure
884# 887#
885# CONFIG_RTC_CLASS is not set 888# CONFIG_USB_GPIO_VBUS is not set
889# CONFIG_NOP_USB_XCEIV is not set
890# CONFIG_MMC is not set
891# CONFIG_MEMSTICK is not set
892# CONFIG_NEW_LEDS is not set
893# CONFIG_ACCESSIBILITY is not set
894CONFIG_RTC_LIB=y
895CONFIG_RTC_CLASS=y
896CONFIG_RTC_HCTOSYS=y
897CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
898# CONFIG_RTC_DEBUG is not set
886 899
887# 900#
888# DMA Engine support 901# RTC interfaces
889# 902#
890# CONFIG_DMA_ENGINE is not set 903CONFIG_RTC_INTF_SYSFS=y
904CONFIG_RTC_INTF_PROC=y
905CONFIG_RTC_INTF_DEV=y
906# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
907# CONFIG_RTC_DRV_TEST is not set
891 908
892# 909#
893# DMA Clients 910# SPI RTC drivers
894# 911#
895 912
896# 913#
897# DMA Devices 914# Platform RTC drivers
898# 915#
916# CONFIG_RTC_DRV_CMOS is not set
917# CONFIG_RTC_DRV_DS1286 is not set
918# CONFIG_RTC_DRV_DS1511 is not set
919# CONFIG_RTC_DRV_DS1553 is not set
920# CONFIG_RTC_DRV_DS1742 is not set
921# CONFIG_RTC_DRV_STK17TA8 is not set
922# CONFIG_RTC_DRV_M48T86 is not set
923# CONFIG_RTC_DRV_M48T35 is not set
924# CONFIG_RTC_DRV_M48T59 is not set
925# CONFIG_RTC_DRV_MSM6242 is not set
926# CONFIG_RTC_DRV_BQ4802 is not set
927# CONFIG_RTC_DRV_RP5C01 is not set
928# CONFIG_RTC_DRV_V3020 is not set
899 929
900# 930#
901# Auxiliary Display support 931# on-CPU RTC drivers
902# 932#
933CONFIG_RTC_DRV_AU1XXX=y
934# CONFIG_DMADEVICES is not set
935# CONFIG_AUXDISPLAY is not set
936# CONFIG_UIO is not set
903 937
904# 938#
905# Virtualization 939# TI VLYNQ
906# 940#
941# CONFIG_STAGING is not set
907 942
908# 943#
909# File systems 944# File systems
910# 945#
911CONFIG_EXT2_FS=y 946CONFIG_EXT2_FS=y
912CONFIG_EXT2_FS_XATTR=y 947# CONFIG_EXT2_FS_XATTR is not set
913CONFIG_EXT2_FS_POSIX_ACL=y
914# CONFIG_EXT2_FS_SECURITY is not set
915# CONFIG_EXT2_FS_XIP is not set 948# CONFIG_EXT2_FS_XIP is not set
916CONFIG_EXT3_FS=y 949CONFIG_EXT3_FS=y
917CONFIG_EXT3_FS_XATTR=y 950# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
918CONFIG_EXT3_FS_POSIX_ACL=y 951# CONFIG_EXT3_FS_XATTR is not set
919CONFIG_EXT3_FS_SECURITY=y 952# CONFIG_EXT4_FS is not set
920# CONFIG_EXT4DEV_FS is not set
921CONFIG_JBD=y 953CONFIG_JBD=y
922# CONFIG_JBD_DEBUG is not set 954# CONFIG_REISERFS_FS is not set
923CONFIG_FS_MBCACHE=y
924CONFIG_REISERFS_FS=m
925# CONFIG_REISERFS_CHECK is not set
926# CONFIG_REISERFS_PROC_INFO is not set
927CONFIG_REISERFS_FS_XATTR=y
928CONFIG_REISERFS_FS_POSIX_ACL=y
929CONFIG_REISERFS_FS_SECURITY=y
930# CONFIG_JFS_FS is not set 955# CONFIG_JFS_FS is not set
931CONFIG_FS_POSIX_ACL=y 956# CONFIG_FS_POSIX_ACL is not set
932# CONFIG_XFS_FS is not set 957# CONFIG_XFS_FS is not set
933# CONFIG_GFS2_FS is not set
934# CONFIG_OCFS2_FS is not set 958# CONFIG_OCFS2_FS is not set
935# CONFIG_MINIX_FS is not set 959# CONFIG_BTRFS_FS is not set
936# CONFIG_ROMFS_FS is not set 960# CONFIG_NILFS2_FS is not set
961CONFIG_FILE_LOCKING=y
962CONFIG_FSNOTIFY=y
963CONFIG_DNOTIFY=y
937CONFIG_INOTIFY=y 964CONFIG_INOTIFY=y
938CONFIG_INOTIFY_USER=y 965CONFIG_INOTIFY_USER=y
939# CONFIG_QUOTA is not set 966# CONFIG_QUOTA is not set
940CONFIG_DNOTIFY=y 967# CONFIG_AUTOFS_FS is not set
941CONFIG_AUTOFS_FS=m 968# CONFIG_AUTOFS4_FS is not set
942CONFIG_AUTOFS4_FS=m 969# CONFIG_FUSE_FS is not set
943CONFIG_FUSE_FS=m 970
944CONFIG_GENERIC_ACL=y 971#
972# Caches
973#
974# CONFIG_FSCACHE is not set
945 975
946# 976#
947# CD-ROM/DVD Filesystems 977# CD-ROM/DVD Filesystems
@@ -960,74 +990,65 @@ CONFIG_GENERIC_ACL=y
960# Pseudo filesystems 990# Pseudo filesystems
961# 991#
962CONFIG_PROC_FS=y 992CONFIG_PROC_FS=y
963CONFIG_PROC_KCORE=y 993# CONFIG_PROC_KCORE is not set
964CONFIG_PROC_SYSCTL=y 994CONFIG_PROC_SYSCTL=y
995# CONFIG_PROC_PAGE_MONITOR is not set
965CONFIG_SYSFS=y 996CONFIG_SYSFS=y
966CONFIG_TMPFS=y 997CONFIG_TMPFS=y
967CONFIG_TMPFS_POSIX_ACL=y 998# CONFIG_TMPFS_POSIX_ACL is not set
968# CONFIG_HUGETLB_PAGE is not set 999# CONFIG_HUGETLB_PAGE is not set
969CONFIG_RAMFS=y 1000# CONFIG_CONFIGFS_FS is not set
970CONFIG_CONFIGFS_FS=m 1001CONFIG_MISC_FILESYSTEMS=y
971
972#
973# Miscellaneous filesystems
974#
975# CONFIG_ADFS_FS is not set 1002# CONFIG_ADFS_FS is not set
976# CONFIG_AFFS_FS is not set 1003# CONFIG_AFFS_FS is not set
977# CONFIG_ECRYPT_FS is not set
978# CONFIG_HFS_FS is not set 1004# CONFIG_HFS_FS is not set
979# CONFIG_HFSPLUS_FS is not set 1005# CONFIG_HFSPLUS_FS is not set
980# CONFIG_BEFS_FS is not set 1006# CONFIG_BEFS_FS is not set
981# CONFIG_BFS_FS is not set 1007# CONFIG_BFS_FS is not set
982# CONFIG_EFS_FS is not set 1008# CONFIG_EFS_FS is not set
983# CONFIG_JFFS2_FS is not set 1009# CONFIG_JFFS2_FS is not set
984CONFIG_CRAMFS=m 1010CONFIG_CRAMFS=y
1011CONFIG_SQUASHFS=y
1012# CONFIG_SQUASHFS_EMBEDDED is not set
1013CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
985# CONFIG_VXFS_FS is not set 1014# CONFIG_VXFS_FS is not set
1015# CONFIG_MINIX_FS is not set
1016# CONFIG_OMFS_FS is not set
986# CONFIG_HPFS_FS is not set 1017# CONFIG_HPFS_FS is not set
987# CONFIG_QNX4FS_FS is not set 1018# CONFIG_QNX4FS_FS is not set
1019# CONFIG_ROMFS_FS is not set
988# CONFIG_SYSV_FS is not set 1020# CONFIG_SYSV_FS is not set
989# CONFIG_UFS_FS is not set 1021# CONFIG_UFS_FS is not set
990 1022CONFIG_NETWORK_FILESYSTEMS=y
991#
992# Network File Systems
993#
994CONFIG_NFS_FS=y 1023CONFIG_NFS_FS=y
995# CONFIG_NFS_V3 is not set 1024CONFIG_NFS_V3=y
1025# CONFIG_NFS_V3_ACL is not set
996# CONFIG_NFS_V4 is not set 1026# CONFIG_NFS_V4 is not set
997# CONFIG_NFS_DIRECTIO is not set
998CONFIG_NFSD=m
999# CONFIG_NFSD_V3 is not set
1000# CONFIG_NFSD_TCP is not set
1001CONFIG_ROOT_NFS=y 1027CONFIG_ROOT_NFS=y
1028# CONFIG_NFSD is not set
1002CONFIG_LOCKD=y 1029CONFIG_LOCKD=y
1003CONFIG_EXPORTFS=m 1030CONFIG_LOCKD_V4=y
1004CONFIG_NFS_COMMON=y 1031CONFIG_NFS_COMMON=y
1005CONFIG_SUNRPC=y 1032CONFIG_SUNRPC=y
1006# CONFIG_RPCSEC_GSS_KRB5 is not set 1033# CONFIG_RPCSEC_GSS_KRB5 is not set
1007# CONFIG_RPCSEC_GSS_SPKM3 is not set 1034# CONFIG_RPCSEC_GSS_SPKM3 is not set
1008CONFIG_SMB_FS=m 1035# CONFIG_SMB_FS is not set
1009# CONFIG_SMB_NLS_DEFAULT is not set
1010# CONFIG_CIFS is not set 1036# CONFIG_CIFS is not set
1011# CONFIG_NCP_FS is not set 1037# CONFIG_NCP_FS is not set
1012# CONFIG_CODA_FS is not set 1038# CONFIG_CODA_FS is not set
1013# CONFIG_AFS_FS is not set 1039# CONFIG_AFS_FS is not set
1014# CONFIG_9P_FS is not set
1015 1040
1016# 1041#
1017# Partition Types 1042# Partition Types
1018# 1043#
1019# CONFIG_PARTITION_ADVANCED is not set 1044# CONFIG_PARTITION_ADVANCED is not set
1020CONFIG_MSDOS_PARTITION=y 1045CONFIG_MSDOS_PARTITION=y
1021 1046CONFIG_NLS=y
1022#
1023# Native Language Support
1024#
1025CONFIG_NLS=m
1026CONFIG_NLS_DEFAULT="iso8859-1" 1047CONFIG_NLS_DEFAULT="iso8859-1"
1027# CONFIG_NLS_CODEPAGE_437 is not set 1048CONFIG_NLS_CODEPAGE_437=y
1028# CONFIG_NLS_CODEPAGE_737 is not set 1049# CONFIG_NLS_CODEPAGE_737 is not set
1029# CONFIG_NLS_CODEPAGE_775 is not set 1050# CONFIG_NLS_CODEPAGE_775 is not set
1030# CONFIG_NLS_CODEPAGE_850 is not set 1051CONFIG_NLS_CODEPAGE_850=y
1031# CONFIG_NLS_CODEPAGE_852 is not set 1052# CONFIG_NLS_CODEPAGE_852 is not set
1032# CONFIG_NLS_CODEPAGE_855 is not set 1053# CONFIG_NLS_CODEPAGE_855 is not set
1033# CONFIG_NLS_CODEPAGE_857 is not set 1054# CONFIG_NLS_CODEPAGE_857 is not set
@@ -1045,10 +1066,10 @@ CONFIG_NLS_DEFAULT="iso8859-1"
1045# CONFIG_NLS_CODEPAGE_949 is not set 1066# CONFIG_NLS_CODEPAGE_949 is not set
1046# CONFIG_NLS_CODEPAGE_874 is not set 1067# CONFIG_NLS_CODEPAGE_874 is not set
1047# CONFIG_NLS_ISO8859_8 is not set 1068# CONFIG_NLS_ISO8859_8 is not set
1048# CONFIG_NLS_CODEPAGE_1250 is not set 1069CONFIG_NLS_CODEPAGE_1250=y
1049# CONFIG_NLS_CODEPAGE_1251 is not set 1070# CONFIG_NLS_CODEPAGE_1251 is not set
1050# CONFIG_NLS_ASCII is not set 1071# CONFIG_NLS_ASCII is not set
1051# CONFIG_NLS_ISO8859_1 is not set 1072CONFIG_NLS_ISO8859_1=y
1052# CONFIG_NLS_ISO8859_2 is not set 1073# CONFIG_NLS_ISO8859_2 is not set
1053# CONFIG_NLS_ISO8859_3 is not set 1074# CONFIG_NLS_ISO8859_3 is not set
1054# CONFIG_NLS_ISO8859_4 is not set 1075# CONFIG_NLS_ISO8859_4 is not set
@@ -1058,38 +1079,75 @@ CONFIG_NLS_DEFAULT="iso8859-1"
1058# CONFIG_NLS_ISO8859_9 is not set 1079# CONFIG_NLS_ISO8859_9 is not set
1059# CONFIG_NLS_ISO8859_13 is not set 1080# CONFIG_NLS_ISO8859_13 is not set
1060# CONFIG_NLS_ISO8859_14 is not set 1081# CONFIG_NLS_ISO8859_14 is not set
1061# CONFIG_NLS_ISO8859_15 is not set 1082CONFIG_NLS_ISO8859_15=y
1062# CONFIG_NLS_KOI8_R is not set 1083# CONFIG_NLS_KOI8_R is not set
1063# CONFIG_NLS_KOI8_U is not set 1084# CONFIG_NLS_KOI8_U is not set
1064# CONFIG_NLS_UTF8 is not set 1085CONFIG_NLS_UTF8=y
1065 1086# CONFIG_DLM is not set
1066#
1067# Distributed Lock Manager
1068#
1069CONFIG_DLM=m
1070CONFIG_DLM_TCP=y
1071# CONFIG_DLM_SCTP is not set
1072# CONFIG_DLM_DEBUG is not set
1073
1074#
1075# Profiling support
1076#
1077# CONFIG_PROFILING is not set
1078 1087
1079# 1088#
1080# Kernel hacking 1089# Kernel hacking
1081# 1090#
1082CONFIG_TRACE_IRQFLAGS_SUPPORT=y 1091CONFIG_TRACE_IRQFLAGS_SUPPORT=y
1083# CONFIG_PRINTK_TIME is not set 1092# CONFIG_PRINTK_TIME is not set
1084CONFIG_ENABLE_MUST_CHECK=y 1093# CONFIG_ENABLE_WARN_DEPRECATED is not set
1094# CONFIG_ENABLE_MUST_CHECK is not set
1095CONFIG_FRAME_WARN=1024
1085# CONFIG_MAGIC_SYSRQ is not set 1096# CONFIG_MAGIC_SYSRQ is not set
1097CONFIG_STRIP_ASM_SYMS=y
1086# CONFIG_UNUSED_SYMBOLS is not set 1098# CONFIG_UNUSED_SYMBOLS is not set
1087# CONFIG_DEBUG_FS is not set 1099# CONFIG_DEBUG_FS is not set
1088# CONFIG_HEADERS_CHECK is not set 1100# CONFIG_HEADERS_CHECK is not set
1089# CONFIG_DEBUG_KERNEL is not set 1101CONFIG_DEBUG_KERNEL=y
1090CONFIG_LOG_BUF_SHIFT=14 1102# CONFIG_DEBUG_SHIRQ is not set
1091CONFIG_CROSSCOMPILE=y 1103# CONFIG_DETECT_SOFTLOCKUP is not set
1104# CONFIG_DETECT_HUNG_TASK is not set
1105# CONFIG_SCHED_DEBUG is not set
1106# CONFIG_SCHEDSTATS is not set
1107# CONFIG_TIMER_STATS is not set
1108# CONFIG_DEBUG_OBJECTS is not set
1109# CONFIG_DEBUG_SLAB is not set
1110# CONFIG_DEBUG_RT_MUTEXES is not set
1111# CONFIG_RT_MUTEX_TESTER is not set
1112# CONFIG_DEBUG_SPINLOCK is not set
1113# CONFIG_DEBUG_MUTEXES is not set
1114# CONFIG_DEBUG_LOCK_ALLOC is not set
1115# CONFIG_PROVE_LOCKING is not set
1116# CONFIG_LOCK_STAT is not set
1117# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1118# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1119# CONFIG_DEBUG_KOBJECT is not set
1120# CONFIG_DEBUG_INFO is not set
1121# CONFIG_DEBUG_VM is not set
1122# CONFIG_DEBUG_WRITECOUNT is not set
1123# CONFIG_DEBUG_MEMORY_INIT is not set
1124# CONFIG_DEBUG_LIST is not set
1125# CONFIG_DEBUG_SG is not set
1126# CONFIG_DEBUG_NOTIFIERS is not set
1127# CONFIG_DEBUG_CREDENTIALS is not set
1128# CONFIG_BOOT_PRINTK_DELAY is not set
1129# CONFIG_RCU_TORTURE_TEST is not set
1130# CONFIG_BACKTRACE_SELF_TEST is not set
1131# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1132# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
1133# CONFIG_FAULT_INJECTION is not set
1134# CONFIG_SYSCTL_SYSCALL_CHECK is not set
1135# CONFIG_PAGE_POISONING is not set
1136CONFIG_HAVE_FUNCTION_TRACER=y
1137CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1138CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y
1139CONFIG_HAVE_DYNAMIC_FTRACE=y
1140CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1141CONFIG_TRACING_SUPPORT=y
1142# CONFIG_FTRACE is not set
1143# CONFIG_SAMPLES is not set
1144CONFIG_HAVE_ARCH_KGDB=y
1145# CONFIG_KGDB is not set
1146CONFIG_EARLY_PRINTK=y
1092# CONFIG_CMDLINE_BOOL is not set 1147# CONFIG_CMDLINE_BOOL is not set
1148# CONFIG_DEBUG_STACK_USAGE is not set
1149# CONFIG_RUNTIME_DEBUG is not set
1150CONFIG_DEBUG_ZBOOT=y
1093 1151
1094# 1152#
1095# Security options 1153# Security options
@@ -1097,67 +1155,29 @@ CONFIG_CROSSCOMPILE=y
1097CONFIG_KEYS=y 1155CONFIG_KEYS=y
1098CONFIG_KEYS_DEBUG_PROC_KEYS=y 1156CONFIG_KEYS_DEBUG_PROC_KEYS=y
1099# CONFIG_SECURITY is not set 1157# CONFIG_SECURITY is not set
1100 1158# CONFIG_SECURITYFS is not set
1101# 1159# CONFIG_DEFAULT_SECURITY_SELINUX is not set
1102# Cryptographic options 1160# CONFIG_DEFAULT_SECURITY_SMACK is not set
1103# 1161# CONFIG_DEFAULT_SECURITY_TOMOYO is not set
1104CONFIG_CRYPTO=y 1162CONFIG_DEFAULT_SECURITY_DAC=y
1105CONFIG_CRYPTO_ALGAPI=y 1163CONFIG_DEFAULT_SECURITY=""
1106CONFIG_CRYPTO_BLKCIPHER=m 1164# CONFIG_CRYPTO is not set
1107CONFIG_CRYPTO_HASH=y 1165# CONFIG_BINARY_PRINTF is not set
1108CONFIG_CRYPTO_MANAGER=y
1109CONFIG_CRYPTO_HMAC=y
1110CONFIG_CRYPTO_XCBC=m
1111CONFIG_CRYPTO_NULL=m
1112CONFIG_CRYPTO_MD4=m
1113CONFIG_CRYPTO_MD5=y
1114CONFIG_CRYPTO_SHA1=m
1115CONFIG_CRYPTO_SHA256=m
1116CONFIG_CRYPTO_SHA512=m
1117CONFIG_CRYPTO_WP512=m
1118CONFIG_CRYPTO_TGR192=m
1119CONFIG_CRYPTO_GF128MUL=m
1120CONFIG_CRYPTO_ECB=m
1121CONFIG_CRYPTO_CBC=m
1122CONFIG_CRYPTO_PCBC=m
1123CONFIG_CRYPTO_LRW=m
1124CONFIG_CRYPTO_DES=m
1125CONFIG_CRYPTO_FCRYPT=m
1126CONFIG_CRYPTO_BLOWFISH=m
1127CONFIG_CRYPTO_TWOFISH=m
1128CONFIG_CRYPTO_TWOFISH_COMMON=m
1129CONFIG_CRYPTO_SERPENT=m
1130CONFIG_CRYPTO_AES=m
1131CONFIG_CRYPTO_CAST5=m
1132CONFIG_CRYPTO_CAST6=m
1133CONFIG_CRYPTO_TEA=m
1134CONFIG_CRYPTO_ARC4=m
1135CONFIG_CRYPTO_KHAZAD=m
1136CONFIG_CRYPTO_ANUBIS=m
1137CONFIG_CRYPTO_DEFLATE=m
1138CONFIG_CRYPTO_MICHAEL_MIC=m
1139CONFIG_CRYPTO_CRC32C=m
1140CONFIG_CRYPTO_CAMELLIA=m
1141# CONFIG_CRYPTO_TEST is not set
1142
1143#
1144# Hardware crypto devices
1145#
1146 1166
1147# 1167#
1148# Library routines 1168# Library routines
1149# 1169#
1150CONFIG_BITREVERSE=y 1170CONFIG_BITREVERSE=y
1151CONFIG_CRC_CCITT=m 1171CONFIG_GENERIC_FIND_LAST_BIT=y
1152CONFIG_CRC16=m 1172# CONFIG_CRC_CCITT is not set
1173# CONFIG_CRC16 is not set
1174# CONFIG_CRC_T10DIF is not set
1175# CONFIG_CRC_ITU_T is not set
1153CONFIG_CRC32=y 1176CONFIG_CRC32=y
1154CONFIG_LIBCRC32C=m 1177# CONFIG_CRC7 is not set
1155CONFIG_ZLIB_INFLATE=m 1178# CONFIG_LIBCRC32C is not set
1156CONFIG_ZLIB_DEFLATE=m 1179CONFIG_ZLIB_INFLATE=y
1157CONFIG_TEXTSEARCH=y
1158CONFIG_TEXTSEARCH_KMP=m
1159CONFIG_TEXTSEARCH_BM=m
1160CONFIG_TEXTSEARCH_FSM=m
1161CONFIG_PLIST=y
1162CONFIG_HAS_IOMEM=y 1180CONFIG_HAS_IOMEM=y
1163CONFIG_HAS_IOPORT=y 1181CONFIG_HAS_IOPORT=y
1182CONFIG_HAS_DMA=y
1183CONFIG_NLATTR=y
diff --git a/arch/mips/configs/db1100_defconfig b/arch/mips/configs/db1100_defconfig
index 90812830e940..abb9a5805adc 100644
--- a/arch/mips/configs/db1100_defconfig
+++ b/arch/mips/configs/db1100_defconfig
@@ -1,78 +1,102 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.20 3# Linux kernel version: 2.6.33
4# Tue Feb 20 21:47:24 2007 4# Fri Feb 26 08:50:15 2010
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
8# 8#
9# Machine selection 9# Machine selection
10# 10#
11CONFIG_ZONE_DMA=y
12CONFIG_MACH_ALCHEMY=y 11CONFIG_MACH_ALCHEMY=y
13# CONFIG_MIPS_MTX1 is not set 12# CONFIG_AR7 is not set
14# CONFIG_MIPS_BOSPORUS is not set 13# CONFIG_BCM47XX is not set
15# CONFIG_MIPS_PB1000 is not set 14# CONFIG_BCM63XX is not set
16# CONFIG_MIPS_PB1100 is not set
17# CONFIG_MIPS_PB1500 is not set
18# CONFIG_MIPS_PB1550 is not set
19# CONFIG_MIPS_PB1200 is not set
20# CONFIG_MIPS_DB1000 is not set
21CONFIG_MIPS_DB1100=y
22# CONFIG_MIPS_DB1500 is not set
23# CONFIG_MIPS_DB1550 is not set
24# CONFIG_MIPS_DB1200 is not set
25# CONFIG_MIPS_MIRAGE is not set
26# CONFIG_MIPS_COBALT is not set 15# CONFIG_MIPS_COBALT is not set
27# CONFIG_MACH_DECSTATION is not set 16# CONFIG_MACH_DECSTATION is not set
28# CONFIG_MACH_JAZZ is not set 17# CONFIG_MACH_JAZZ is not set
18# CONFIG_LASAT is not set
19# CONFIG_MACH_LOONGSON is not set
29# CONFIG_MIPS_MALTA is not set 20# CONFIG_MIPS_MALTA is not set
30# CONFIG_WR_PPMC is not set
31# CONFIG_MIPS_SIM is not set 21# CONFIG_MIPS_SIM is not set
32# CONFIG_MOMENCO_JAGUAR_ATX is not set 22# CONFIG_NEC_MARKEINS is not set
33# CONFIG_MIPS_XXS1500 is not set 23# CONFIG_MACH_VR41XX is not set
24# CONFIG_NXP_STB220 is not set
25# CONFIG_NXP_STB225 is not set
34# CONFIG_PNX8550_JBS is not set 26# CONFIG_PNX8550_JBS is not set
35# CONFIG_PNX8550_STB810 is not set 27# CONFIG_PNX8550_STB810 is not set
36# CONFIG_MACH_VR41XX is not set 28# CONFIG_PMC_MSP is not set
37# CONFIG_PMC_YOSEMITE is not set 29# CONFIG_PMC_YOSEMITE is not set
38# CONFIG_MARKEINS is not set 30# CONFIG_POWERTV is not set
39# CONFIG_SGI_IP22 is not set 31# CONFIG_SGI_IP22 is not set
40# CONFIG_SGI_IP27 is not set 32# CONFIG_SGI_IP27 is not set
33# CONFIG_SGI_IP28 is not set
41# CONFIG_SGI_IP32 is not set 34# CONFIG_SGI_IP32 is not set
42# CONFIG_SIBYTE_BIGSUR is not set
43# CONFIG_SIBYTE_SWARM is not set
44# CONFIG_SIBYTE_SENTOSA is not set
45# CONFIG_SIBYTE_RHONE is not set
46# CONFIG_SIBYTE_CARMEL is not set
47# CONFIG_SIBYTE_LITTLESUR is not set
48# CONFIG_SIBYTE_CRHINE is not set 35# CONFIG_SIBYTE_CRHINE is not set
36# CONFIG_SIBYTE_CARMEL is not set
49# CONFIG_SIBYTE_CRHONE is not set 37# CONFIG_SIBYTE_CRHONE is not set
38# CONFIG_SIBYTE_RHONE is not set
39# CONFIG_SIBYTE_SWARM is not set
40# CONFIG_SIBYTE_LITTLESUR is not set
41# CONFIG_SIBYTE_SENTOSA is not set
42# CONFIG_SIBYTE_BIGSUR is not set
50# CONFIG_SNI_RM is not set 43# CONFIG_SNI_RM is not set
51# CONFIG_TOSHIBA_JMR3927 is not set 44# CONFIG_MACH_TX39XX is not set
52# CONFIG_TOSHIBA_RBTX4927 is not set 45# CONFIG_MACH_TX49XX is not set
53# CONFIG_TOSHIBA_RBTX4938 is not set 46# CONFIG_MIKROTIK_RB532 is not set
47# CONFIG_WR_PPMC is not set
48# CONFIG_CAVIUM_OCTEON_SIMULATOR is not set
49# CONFIG_CAVIUM_OCTEON_REFERENCE_BOARD is not set
50CONFIG_ALCHEMY_GPIOINT_AU1000=y
51# CONFIG_ALCHEMY_GPIO_INDIRECT is not set
52# CONFIG_MIPS_MTX1 is not set
53# CONFIG_MIPS_BOSPORUS is not set
54# CONFIG_MIPS_DB1000 is not set
55CONFIG_MIPS_DB1100=y
56# CONFIG_MIPS_DB1200 is not set
57# CONFIG_MIPS_DB1500 is not set
58# CONFIG_MIPS_DB1550 is not set
59# CONFIG_MIPS_MIRAGE is not set
60# CONFIG_MIPS_PB1000 is not set
61# CONFIG_MIPS_PB1100 is not set
62# CONFIG_MIPS_PB1200 is not set
63# CONFIG_MIPS_PB1500 is not set
64# CONFIG_MIPS_PB1550 is not set
65# CONFIG_MIPS_XXS1500 is not set
66CONFIG_SOC_AU1100=y
67CONFIG_SOC_AU1X00=y
68CONFIG_LOONGSON_UART_BASE=y
54CONFIG_RWSEM_GENERIC_SPINLOCK=y 69CONFIG_RWSEM_GENERIC_SPINLOCK=y
55# CONFIG_ARCH_HAS_ILOG2_U32 is not set 70# CONFIG_ARCH_HAS_ILOG2_U32 is not set
56# CONFIG_ARCH_HAS_ILOG2_U64 is not set 71# CONFIG_ARCH_HAS_ILOG2_U64 is not set
72CONFIG_ARCH_SUPPORTS_OPROFILE=y
57CONFIG_GENERIC_FIND_NEXT_BIT=y 73CONFIG_GENERIC_FIND_NEXT_BIT=y
58CONFIG_GENERIC_HWEIGHT=y 74CONFIG_GENERIC_HWEIGHT=y
59CONFIG_GENERIC_CALIBRATE_DELAY=y 75CONFIG_GENERIC_CALIBRATE_DELAY=y
76CONFIG_GENERIC_CLOCKEVENTS=y
60CONFIG_GENERIC_TIME=y 77CONFIG_GENERIC_TIME=y
61CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y 78CONFIG_GENERIC_CMOS_UPDATE=y
62# CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ is not set 79CONFIG_SCHED_OMIT_FRAME_POINTER=y
80CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
81CONFIG_CEVT_R4K_LIB=y
82CONFIG_CSRC_R4K_LIB=y
63CONFIG_DMA_NONCOHERENT=y 83CONFIG_DMA_NONCOHERENT=y
64CONFIG_DMA_NEED_PCI_MAP_STATE=y 84CONFIG_DMA_NEED_PCI_MAP_STATE=y
85CONFIG_SYS_HAS_EARLY_PRINTK=y
86# CONFIG_NO_IOPORT is not set
87CONFIG_GENERIC_GPIO=y
65# CONFIG_CPU_BIG_ENDIAN is not set 88# CONFIG_CPU_BIG_ENDIAN is not set
66CONFIG_CPU_LITTLE_ENDIAN=y 89CONFIG_CPU_LITTLE_ENDIAN=y
67CONFIG_SYS_SUPPORTS_APM_EMULATION=y 90CONFIG_SYS_SUPPORTS_APM_EMULATION=y
68CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y 91CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
69CONFIG_SOC_AU1100=y 92CONFIG_IRQ_CPU=y
70CONFIG_SOC_AU1X00=y
71CONFIG_MIPS_L1_CACHE_SHIFT=5 93CONFIG_MIPS_L1_CACHE_SHIFT=5
72 94
73# 95#
74# CPU selection 96# CPU selection
75# 97#
98# CONFIG_CPU_LOONGSON2E is not set
99# CONFIG_CPU_LOONGSON2F is not set
76CONFIG_CPU_MIPS32_R1=y 100CONFIG_CPU_MIPS32_R1=y
77# CONFIG_CPU_MIPS32_R2 is not set 101# CONFIG_CPU_MIPS32_R2 is not set
78# CONFIG_CPU_MIPS64_R1 is not set 102# CONFIG_CPU_MIPS64_R1 is not set
@@ -85,6 +109,7 @@ CONFIG_CPU_MIPS32_R1=y
85# CONFIG_CPU_TX49XX is not set 109# CONFIG_CPU_TX49XX is not set
86# CONFIG_CPU_R5000 is not set 110# CONFIG_CPU_R5000 is not set
87# CONFIG_CPU_R5432 is not set 111# CONFIG_CPU_R5432 is not set
112# CONFIG_CPU_R5500 is not set
88# CONFIG_CPU_R6000 is not set 113# CONFIG_CPU_R6000 is not set
89# CONFIG_CPU_NEVADA is not set 114# CONFIG_CPU_NEVADA is not set
90# CONFIG_CPU_R8000 is not set 115# CONFIG_CPU_R8000 is not set
@@ -92,11 +117,14 @@ CONFIG_CPU_MIPS32_R1=y
92# CONFIG_CPU_RM7000 is not set 117# CONFIG_CPU_RM7000 is not set
93# CONFIG_CPU_RM9000 is not set 118# CONFIG_CPU_RM9000 is not set
94# CONFIG_CPU_SB1 is not set 119# CONFIG_CPU_SB1 is not set
120# CONFIG_CPU_CAVIUM_OCTEON is not set
121CONFIG_SYS_SUPPORTS_ZBOOT=y
95CONFIG_SYS_HAS_CPU_MIPS32_R1=y 122CONFIG_SYS_HAS_CPU_MIPS32_R1=y
96CONFIG_CPU_MIPS32=y 123CONFIG_CPU_MIPS32=y
97CONFIG_CPU_MIPSR1=y 124CONFIG_CPU_MIPSR1=y
98CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y 125CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
99CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y 126CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
127CONFIG_HARDWARE_WATCHPOINTS=y
100 128
101# 129#
102# Kernel type 130# Kernel type
@@ -106,173 +134,242 @@ CONFIG_32BIT=y
106CONFIG_PAGE_SIZE_4KB=y 134CONFIG_PAGE_SIZE_4KB=y
107# CONFIG_PAGE_SIZE_8KB is not set 135# CONFIG_PAGE_SIZE_8KB is not set
108# CONFIG_PAGE_SIZE_16KB is not set 136# CONFIG_PAGE_SIZE_16KB is not set
137# CONFIG_PAGE_SIZE_32KB is not set
109# CONFIG_PAGE_SIZE_64KB is not set 138# CONFIG_PAGE_SIZE_64KB is not set
110CONFIG_CPU_HAS_PREFETCH=y 139CONFIG_CPU_HAS_PREFETCH=y
111CONFIG_MIPS_MT_DISABLED=y 140CONFIG_MIPS_MT_DISABLED=y
112# CONFIG_MIPS_MT_SMP is not set 141# CONFIG_MIPS_MT_SMP is not set
113# CONFIG_MIPS_MT_SMTC is not set 142# CONFIG_MIPS_MT_SMTC is not set
114# CONFIG_MIPS_VPE_LOADER is not set
115CONFIG_64BIT_PHYS_ADDR=y 143CONFIG_64BIT_PHYS_ADDR=y
144CONFIG_ARCH_PHYS_ADDR_T_64BIT=y
116CONFIG_CPU_HAS_SYNC=y 145CONFIG_CPU_HAS_SYNC=y
117CONFIG_GENERIC_HARDIRQS=y 146CONFIG_GENERIC_HARDIRQS=y
118CONFIG_GENERIC_IRQ_PROBE=y 147CONFIG_GENERIC_IRQ_PROBE=y
119CONFIG_CPU_SUPPORTS_HIGHMEM=y 148CONFIG_CPU_SUPPORTS_HIGHMEM=y
120CONFIG_ARCH_FLATMEM_ENABLE=y 149CONFIG_ARCH_FLATMEM_ENABLE=y
150CONFIG_ARCH_POPULATES_NODE_MAP=y
121CONFIG_SELECT_MEMORY_MODEL=y 151CONFIG_SELECT_MEMORY_MODEL=y
122CONFIG_FLATMEM_MANUAL=y 152CONFIG_FLATMEM_MANUAL=y
123# CONFIG_DISCONTIGMEM_MANUAL is not set 153# CONFIG_DISCONTIGMEM_MANUAL is not set
124# CONFIG_SPARSEMEM_MANUAL is not set 154# CONFIG_SPARSEMEM_MANUAL is not set
125CONFIG_FLATMEM=y 155CONFIG_FLATMEM=y
126CONFIG_FLAT_NODE_MEM_MAP=y 156CONFIG_FLAT_NODE_MEM_MAP=y
127# CONFIG_SPARSEMEM_STATIC is not set 157CONFIG_PAGEFLAGS_EXTENDED=y
128CONFIG_SPLIT_PTLOCK_CPUS=4 158CONFIG_SPLIT_PTLOCK_CPUS=4
129# CONFIG_RESOURCES_64BIT is not set 159CONFIG_PHYS_ADDR_T_64BIT=y
130CONFIG_ZONE_DMA_FLAG=1 160CONFIG_ZONE_DMA_FLAG=0
161CONFIG_VIRT_TO_BUS=y
162# CONFIG_KSM is not set
163CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
164CONFIG_TICK_ONESHOT=y
165CONFIG_NO_HZ=y
166CONFIG_HIGH_RES_TIMERS=y
167CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
131# CONFIG_HZ_48 is not set 168# CONFIG_HZ_48 is not set
132# CONFIG_HZ_100 is not set 169CONFIG_HZ_100=y
133# CONFIG_HZ_128 is not set 170# CONFIG_HZ_128 is not set
134# CONFIG_HZ_250 is not set 171# CONFIG_HZ_250 is not set
135# CONFIG_HZ_256 is not set 172# CONFIG_HZ_256 is not set
136CONFIG_HZ_1000=y 173# CONFIG_HZ_1000 is not set
137# CONFIG_HZ_1024 is not set 174# CONFIG_HZ_1024 is not set
138CONFIG_SYS_SUPPORTS_ARBIT_HZ=y 175CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
139CONFIG_HZ=1000 176CONFIG_HZ=100
140CONFIG_PREEMPT_NONE=y 177CONFIG_PREEMPT_NONE=y
141# CONFIG_PREEMPT_VOLUNTARY is not set 178# CONFIG_PREEMPT_VOLUNTARY is not set
142# CONFIG_PREEMPT is not set 179# CONFIG_PREEMPT is not set
143# CONFIG_KEXEC is not set 180# CONFIG_KEXEC is not set
181# CONFIG_SECCOMP is not set
144CONFIG_LOCKDEP_SUPPORT=y 182CONFIG_LOCKDEP_SUPPORT=y
145CONFIG_STACKTRACE_SUPPORT=y 183CONFIG_STACKTRACE_SUPPORT=y
146CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 184CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
185CONFIG_CONSTRUCTORS=y
147 186
148# 187#
149# Code maturity level options 188# General setup
150# 189#
151CONFIG_EXPERIMENTAL=y 190CONFIG_EXPERIMENTAL=y
152CONFIG_BROKEN_ON_SMP=y 191CONFIG_BROKEN_ON_SMP=y
153CONFIG_INIT_ENV_ARG_LIMIT=32 192CONFIG_INIT_ENV_ARG_LIMIT=32
154 193CONFIG_LOCALVERSION="-db1100"
155#
156# General setup
157#
158CONFIG_LOCALVERSION=""
159CONFIG_LOCALVERSION_AUTO=y 194CONFIG_LOCALVERSION_AUTO=y
195CONFIG_HAVE_KERNEL_GZIP=y
196CONFIG_HAVE_KERNEL_BZIP2=y
197CONFIG_HAVE_KERNEL_LZMA=y
198CONFIG_HAVE_KERNEL_LZO=y
199# CONFIG_KERNEL_GZIP is not set
200# CONFIG_KERNEL_BZIP2 is not set
201CONFIG_KERNEL_LZMA=y
202# CONFIG_KERNEL_LZO is not set
160CONFIG_SWAP=y 203CONFIG_SWAP=y
161CONFIG_SYSVIPC=y 204CONFIG_SYSVIPC=y
162# CONFIG_IPC_NS is not set
163CONFIG_SYSVIPC_SYSCTL=y 205CONFIG_SYSVIPC_SYSCTL=y
164# CONFIG_POSIX_MQUEUE is not set 206CONFIG_POSIX_MQUEUE=y
207CONFIG_POSIX_MQUEUE_SYSCTL=y
165# CONFIG_BSD_PROCESS_ACCT is not set 208# CONFIG_BSD_PROCESS_ACCT is not set
166# CONFIG_TASKSTATS is not set 209# CONFIG_TASKSTATS is not set
167# CONFIG_UTS_NS is not set
168# CONFIG_AUDIT is not set 210# CONFIG_AUDIT is not set
211
212#
213# RCU Subsystem
214#
215# CONFIG_TREE_RCU is not set
216# CONFIG_TREE_PREEMPT_RCU is not set
217CONFIG_TINY_RCU=y
218# CONFIG_TREE_RCU_TRACE is not set
169# CONFIG_IKCONFIG is not set 219# CONFIG_IKCONFIG is not set
170CONFIG_SYSFS_DEPRECATED=y 220CONFIG_LOG_BUF_SHIFT=14
171CONFIG_RELAY=y 221# CONFIG_GROUP_SCHED is not set
172# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 222# CONFIG_CGROUPS is not set
223# CONFIG_SYSFS_DEPRECATED_V2 is not set
224# CONFIG_RELAY is not set
225# CONFIG_NAMESPACES is not set
226# CONFIG_BLK_DEV_INITRD is not set
227CONFIG_CC_OPTIMIZE_FOR_SIZE=y
173CONFIG_SYSCTL=y 228CONFIG_SYSCTL=y
229CONFIG_ANON_INODES=y
174CONFIG_EMBEDDED=y 230CONFIG_EMBEDDED=y
175CONFIG_SYSCTL_SYSCALL=y 231# CONFIG_SYSCTL_SYSCALL is not set
176CONFIG_KALLSYMS=y 232# CONFIG_KALLSYMS is not set
177# CONFIG_KALLSYMS_EXTRA_PASS is not set
178CONFIG_HOTPLUG=y 233CONFIG_HOTPLUG=y
179CONFIG_PRINTK=y 234CONFIG_PRINTK=y
180CONFIG_BUG=y 235CONFIG_BUG=y
181CONFIG_ELF_CORE=y 236CONFIG_ELF_CORE=y
237# CONFIG_PCSPKR_PLATFORM is not set
182CONFIG_BASE_FULL=y 238CONFIG_BASE_FULL=y
183CONFIG_FUTEX=y 239CONFIG_FUTEX=y
184CONFIG_EPOLL=y 240CONFIG_EPOLL=y
241CONFIG_SIGNALFD=y
242CONFIG_TIMERFD=y
243CONFIG_EVENTFD=y
185CONFIG_SHMEM=y 244CONFIG_SHMEM=y
186CONFIG_SLAB=y 245CONFIG_AIO=y
246
247#
248# Kernel Performance Events And Counters
249#
187CONFIG_VM_EVENT_COUNTERS=y 250CONFIG_VM_EVENT_COUNTERS=y
188CONFIG_RT_MUTEXES=y 251# CONFIG_COMPAT_BRK is not set
189# CONFIG_TINY_SHMEM is not set 252CONFIG_SLAB=y
190CONFIG_BASE_SMALL=0 253# CONFIG_SLUB is not set
191# CONFIG_SLOB is not set 254# CONFIG_SLOB is not set
255# CONFIG_PROFILING is not set
256CONFIG_HAVE_OPROFILE=y
192 257
193# 258#
194# Loadable module support 259# GCOV-based kernel profiling
195# 260#
261# CONFIG_SLOW_WORK is not set
262CONFIG_HAVE_GENERIC_DMA_COHERENT=y
263CONFIG_SLABINFO=y
264CONFIG_RT_MUTEXES=y
265CONFIG_BASE_SMALL=0
196CONFIG_MODULES=y 266CONFIG_MODULES=y
267# CONFIG_MODULE_FORCE_LOAD is not set
197CONFIG_MODULE_UNLOAD=y 268CONFIG_MODULE_UNLOAD=y
198# CONFIG_MODULE_FORCE_UNLOAD is not set 269# CONFIG_MODULE_FORCE_UNLOAD is not set
199CONFIG_MODVERSIONS=y 270# CONFIG_MODVERSIONS is not set
200CONFIG_MODULE_SRCVERSION_ALL=y 271# CONFIG_MODULE_SRCVERSION_ALL is not set
201CONFIG_KMOD=y
202
203#
204# Block layer
205#
206CONFIG_BLOCK=y 272CONFIG_BLOCK=y
207# CONFIG_LBD is not set 273# CONFIG_LBDAF is not set
208# CONFIG_BLK_DEV_IO_TRACE is not set 274# CONFIG_BLK_DEV_BSG is not set
209# CONFIG_LSF is not set 275# CONFIG_BLK_DEV_INTEGRITY is not set
210 276
211# 277#
212# IO Schedulers 278# IO Schedulers
213# 279#
214CONFIG_IOSCHED_NOOP=y 280CONFIG_IOSCHED_NOOP=y
215CONFIG_IOSCHED_AS=y 281# CONFIG_IOSCHED_DEADLINE is not set
216CONFIG_IOSCHED_DEADLINE=y 282# CONFIG_IOSCHED_CFQ is not set
217CONFIG_IOSCHED_CFQ=y
218CONFIG_DEFAULT_AS=y
219# CONFIG_DEFAULT_DEADLINE is not set 283# CONFIG_DEFAULT_DEADLINE is not set
220# CONFIG_DEFAULT_CFQ is not set 284# CONFIG_DEFAULT_CFQ is not set
221# CONFIG_DEFAULT_NOOP is not set 285CONFIG_DEFAULT_NOOP=y
222CONFIG_DEFAULT_IOSCHED="anticipatory" 286CONFIG_DEFAULT_IOSCHED="noop"
287# CONFIG_INLINE_SPIN_TRYLOCK is not set
288# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set
289# CONFIG_INLINE_SPIN_LOCK is not set
290# CONFIG_INLINE_SPIN_LOCK_BH is not set
291# CONFIG_INLINE_SPIN_LOCK_IRQ is not set
292# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set
293CONFIG_INLINE_SPIN_UNLOCK=y
294# CONFIG_INLINE_SPIN_UNLOCK_BH is not set
295CONFIG_INLINE_SPIN_UNLOCK_IRQ=y
296# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set
297# CONFIG_INLINE_READ_TRYLOCK is not set
298# CONFIG_INLINE_READ_LOCK is not set
299# CONFIG_INLINE_READ_LOCK_BH is not set
300# CONFIG_INLINE_READ_LOCK_IRQ is not set
301# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set
302CONFIG_INLINE_READ_UNLOCK=y
303# CONFIG_INLINE_READ_UNLOCK_BH is not set
304CONFIG_INLINE_READ_UNLOCK_IRQ=y
305# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set
306# CONFIG_INLINE_WRITE_TRYLOCK is not set
307# CONFIG_INLINE_WRITE_LOCK is not set
308# CONFIG_INLINE_WRITE_LOCK_BH is not set
309# CONFIG_INLINE_WRITE_LOCK_IRQ is not set
310# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set
311CONFIG_INLINE_WRITE_UNLOCK=y
312# CONFIG_INLINE_WRITE_UNLOCK_BH is not set
313CONFIG_INLINE_WRITE_UNLOCK_IRQ=y
314# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set
315# CONFIG_MUTEX_SPIN_ON_OWNER is not set
316CONFIG_FREEZER=y
223 317
224# 318#
225# Bus options (PCI, PCMCIA, EISA, ISA, TC) 319# Bus options (PCI, PCMCIA, EISA, ISA, TC)
226# 320#
321# CONFIG_ARCH_SUPPORTS_MSI is not set
227CONFIG_MMU=y 322CONFIG_MMU=y
323CONFIG_PCCARD=y
324CONFIG_PCMCIA=y
325CONFIG_PCMCIA_LOAD_CIS=y
326# CONFIG_PCMCIA_IOCTL is not set
228 327
229# 328#
230# PCCARD (PCMCIA/CardBus) support 329# PC-card bridges
231#
232# CONFIG_PCCARD is not set
233
234#
235# PCI Hotplug Support
236# 330#
331# CONFIG_PCMCIA_AU1X00 is not set
332CONFIG_PCMCIA_ALCHEMY_DEVBOARD=y
237 333
238# 334#
239# Executable file formats 335# Executable file formats
240# 336#
241CONFIG_BINFMT_ELF=y 337CONFIG_BINFMT_ELF=y
338# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
339# CONFIG_HAVE_AOUT is not set
242# CONFIG_BINFMT_MISC is not set 340# CONFIG_BINFMT_MISC is not set
243CONFIG_TRAD_SIGNALS=y 341CONFIG_TRAD_SIGNALS=y
244 342
245# 343#
246# Power management options 344# Power management options
247# 345#
248# CONFIG_PM is not set 346CONFIG_ARCH_HIBERNATION_POSSIBLE=y
249 347CONFIG_ARCH_SUSPEND_POSSIBLE=y
250# 348CONFIG_PM=y
251# Networking 349# CONFIG_PM_DEBUG is not set
252# 350CONFIG_PM_SLEEP=y
351CONFIG_SUSPEND=y
352CONFIG_SUSPEND_FREEZER=y
353# CONFIG_HIBERNATION is not set
354# CONFIG_APM_EMULATION is not set
355CONFIG_PM_RUNTIME=y
253CONFIG_NET=y 356CONFIG_NET=y
254 357
255# 358#
256# Networking options 359# Networking options
257# 360#
258# CONFIG_NETDEBUG is not set
259CONFIG_PACKET=y 361CONFIG_PACKET=y
260# CONFIG_PACKET_MMAP is not set 362CONFIG_PACKET_MMAP=y
261CONFIG_UNIX=y 363CONFIG_UNIX=y
262CONFIG_XFRM=y 364# CONFIG_NET_KEY is not set
263CONFIG_XFRM_USER=m
264# CONFIG_XFRM_SUB_POLICY is not set
265CONFIG_XFRM_MIGRATE=y
266CONFIG_NET_KEY=y
267CONFIG_NET_KEY_MIGRATE=y
268CONFIG_INET=y 365CONFIG_INET=y
269CONFIG_IP_MULTICAST=y 366CONFIG_IP_MULTICAST=y
270# CONFIG_IP_ADVANCED_ROUTER is not set 367# CONFIG_IP_ADVANCED_ROUTER is not set
271CONFIG_IP_FIB_HASH=y 368CONFIG_IP_FIB_HASH=y
272CONFIG_IP_PNP=y 369CONFIG_IP_PNP=y
273# CONFIG_IP_PNP_DHCP is not set 370CONFIG_IP_PNP_DHCP=y
274CONFIG_IP_PNP_BOOTP=y 371CONFIG_IP_PNP_BOOTP=y
275# CONFIG_IP_PNP_RARP is not set 372CONFIG_IP_PNP_RARP=y
276# CONFIG_NET_IPIP is not set 373# CONFIG_NET_IPIP is not set
277# CONFIG_NET_IPGRE is not set 374# CONFIG_NET_IPGRE is not set
278# CONFIG_IP_MROUTE is not set 375# CONFIG_IP_MROUTE is not set
@@ -283,110 +380,25 @@ CONFIG_IP_PNP_BOOTP=y
283# CONFIG_INET_IPCOMP is not set 380# CONFIG_INET_IPCOMP is not set
284# CONFIG_INET_XFRM_TUNNEL is not set 381# CONFIG_INET_XFRM_TUNNEL is not set
285# CONFIG_INET_TUNNEL is not set 382# CONFIG_INET_TUNNEL is not set
286CONFIG_INET_XFRM_MODE_TRANSPORT=m 383# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
287CONFIG_INET_XFRM_MODE_TUNNEL=m 384# CONFIG_INET_XFRM_MODE_TUNNEL is not set
288CONFIG_INET_XFRM_MODE_BEET=m 385# CONFIG_INET_XFRM_MODE_BEET is not set
289CONFIG_INET_DIAG=y 386CONFIG_INET_LRO=y
290CONFIG_INET_TCP_DIAG=y 387# CONFIG_INET_DIAG is not set
291# CONFIG_TCP_CONG_ADVANCED is not set 388# CONFIG_TCP_CONG_ADVANCED is not set
292CONFIG_TCP_CONG_CUBIC=y 389CONFIG_TCP_CONG_CUBIC=y
293CONFIG_DEFAULT_TCP_CONG="cubic" 390CONFIG_DEFAULT_TCP_CONG="cubic"
294CONFIG_TCP_MD5SIG=y 391# CONFIG_TCP_MD5SIG is not set
295
296#
297# IP: Virtual Server Configuration
298#
299# CONFIG_IP_VS is not set
300# CONFIG_IPV6 is not set 392# CONFIG_IPV6 is not set
301# CONFIG_INET6_XFRM_TUNNEL is not set 393# CONFIG_NETWORK_SECMARK is not set
302# CONFIG_INET6_TUNNEL is not set 394# CONFIG_NETFILTER is not set
303CONFIG_NETWORK_SECMARK=y
304CONFIG_NETFILTER=y
305# CONFIG_NETFILTER_DEBUG is not set
306
307#
308# Core Netfilter Configuration
309#
310CONFIG_NETFILTER_NETLINK=m
311CONFIG_NETFILTER_NETLINK_QUEUE=m
312CONFIG_NETFILTER_NETLINK_LOG=m
313CONFIG_NF_CONNTRACK_ENABLED=m
314CONFIG_NF_CONNTRACK_SUPPORT=y
315# CONFIG_IP_NF_CONNTRACK_SUPPORT is not set
316CONFIG_NF_CONNTRACK=m
317CONFIG_NF_CT_ACCT=y
318CONFIG_NF_CONNTRACK_MARK=y
319CONFIG_NF_CONNTRACK_SECMARK=y
320CONFIG_NF_CONNTRACK_EVENTS=y
321CONFIG_NF_CT_PROTO_GRE=m
322CONFIG_NF_CT_PROTO_SCTP=m
323CONFIG_NF_CONNTRACK_AMANDA=m
324CONFIG_NF_CONNTRACK_FTP=m
325CONFIG_NF_CONNTRACK_H323=m
326CONFIG_NF_CONNTRACK_IRC=m
327# CONFIG_NF_CONNTRACK_NETBIOS_NS is not set
328CONFIG_NF_CONNTRACK_PPTP=m
329CONFIG_NF_CONNTRACK_SANE=m
330CONFIG_NF_CONNTRACK_SIP=m
331CONFIG_NF_CONNTRACK_TFTP=m
332CONFIG_NF_CT_NETLINK=m
333CONFIG_NETFILTER_XTABLES=m
334CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
335CONFIG_NETFILTER_XT_TARGET_MARK=m
336CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
337CONFIG_NETFILTER_XT_TARGET_NFLOG=m
338CONFIG_NETFILTER_XT_TARGET_SECMARK=m
339CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=m
340CONFIG_NETFILTER_XT_TARGET_TCPMSS=m
341CONFIG_NETFILTER_XT_MATCH_COMMENT=m
342CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
343CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
344CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
345CONFIG_NETFILTER_XT_MATCH_DCCP=m
346CONFIG_NETFILTER_XT_MATCH_DSCP=m
347CONFIG_NETFILTER_XT_MATCH_ESP=m
348CONFIG_NETFILTER_XT_MATCH_HELPER=m
349CONFIG_NETFILTER_XT_MATCH_LENGTH=m
350CONFIG_NETFILTER_XT_MATCH_LIMIT=m
351CONFIG_NETFILTER_XT_MATCH_MAC=m
352CONFIG_NETFILTER_XT_MATCH_MARK=m
353CONFIG_NETFILTER_XT_MATCH_POLICY=m
354CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
355CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
356CONFIG_NETFILTER_XT_MATCH_QUOTA=m
357CONFIG_NETFILTER_XT_MATCH_REALM=m
358CONFIG_NETFILTER_XT_MATCH_SCTP=m
359CONFIG_NETFILTER_XT_MATCH_STATE=m
360CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
361CONFIG_NETFILTER_XT_MATCH_STRING=m
362CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
363CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
364
365#
366# IP: Netfilter Configuration
367#
368CONFIG_NF_CONNTRACK_IPV4=m
369CONFIG_NF_CONNTRACK_PROC_COMPAT=y
370# CONFIG_IP_NF_QUEUE is not set
371# CONFIG_IP_NF_IPTABLES is not set
372# CONFIG_IP_NF_ARPTABLES is not set
373
374#
375# DCCP Configuration (EXPERIMENTAL)
376#
377# CONFIG_IP_DCCP is not set 395# CONFIG_IP_DCCP is not set
378
379#
380# SCTP Configuration (EXPERIMENTAL)
381#
382# CONFIG_IP_SCTP is not set 396# CONFIG_IP_SCTP is not set
383 397# CONFIG_RDS is not set
384#
385# TIPC Configuration (EXPERIMENTAL)
386#
387# CONFIG_TIPC is not set 398# CONFIG_TIPC is not set
388# CONFIG_ATM is not set 399# CONFIG_ATM is not set
389# CONFIG_BRIDGE is not set 400# CONFIG_BRIDGE is not set
401# CONFIG_NET_DSA is not set
390# CONFIG_VLAN_8021Q is not set 402# CONFIG_VLAN_8021Q is not set
391# CONFIG_DECNET is not set 403# CONFIG_DECNET is not set
392# CONFIG_LLC2 is not set 404# CONFIG_LLC2 is not set
@@ -396,27 +408,24 @@ CONFIG_NF_CONNTRACK_PROC_COMPAT=y
396# CONFIG_LAPB is not set 408# CONFIG_LAPB is not set
397# CONFIG_ECONET is not set 409# CONFIG_ECONET is not set
398# CONFIG_WAN_ROUTER is not set 410# CONFIG_WAN_ROUTER is not set
399 411# CONFIG_PHONET is not set
400# 412# CONFIG_IEEE802154 is not set
401# QoS and/or fair queueing
402#
403# CONFIG_NET_SCHED is not set 413# CONFIG_NET_SCHED is not set
404CONFIG_NET_CLS_ROUTE=y 414# CONFIG_DCB is not set
405 415
406# 416#
407# Network testing 417# Network testing
408# 418#
409# CONFIG_NET_PKTGEN is not set 419# CONFIG_NET_PKTGEN is not set
410# CONFIG_HAMRADIO is not set 420# CONFIG_HAMRADIO is not set
421# CONFIG_CAN is not set
411# CONFIG_IRDA is not set 422# CONFIG_IRDA is not set
412# CONFIG_BT is not set 423# CONFIG_BT is not set
413CONFIG_IEEE80211=m 424# CONFIG_AF_RXRPC is not set
414# CONFIG_IEEE80211_DEBUG is not set 425# CONFIG_WIRELESS is not set
415CONFIG_IEEE80211_CRYPT_WEP=m 426# CONFIG_WIMAX is not set
416CONFIG_IEEE80211_CRYPT_CCMP=m 427# CONFIG_RFKILL is not set
417CONFIG_IEEE80211_SOFTMAC=m 428# CONFIG_NET_9P is not set
418# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set
419CONFIG_WIRELESS_EXT=y
420 429
421# 430#
422# Device Drivers 431# Device Drivers
@@ -425,25 +434,25 @@ CONFIG_WIRELESS_EXT=y
425# 434#
426# Generic Driver Options 435# Generic Driver Options
427# 436#
437CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
438# CONFIG_DEVTMPFS is not set
428CONFIG_STANDALONE=y 439CONFIG_STANDALONE=y
429CONFIG_PREVENT_FIRMWARE_BUILD=y 440CONFIG_PREVENT_FIRMWARE_BUILD=y
430# CONFIG_FW_LOADER is not set 441CONFIG_FW_LOADER=y
442CONFIG_FIRMWARE_IN_KERNEL=y
443CONFIG_EXTRA_FIRMWARE=""
444# CONFIG_DEBUG_DRIVER is not set
445# CONFIG_DEBUG_DEVRES is not set
431# CONFIG_SYS_HYPERVISOR is not set 446# CONFIG_SYS_HYPERVISOR is not set
432 447# CONFIG_CONNECTOR is not set
433#
434# Connector - unified userspace <-> kernelspace linker
435#
436CONFIG_CONNECTOR=m
437
438#
439# Memory Technology Devices (MTD)
440#
441CONFIG_MTD=y 448CONFIG_MTD=y
442# CONFIG_MTD_DEBUG is not set 449# CONFIG_MTD_DEBUG is not set
450# CONFIG_MTD_TESTS is not set
443# CONFIG_MTD_CONCAT is not set 451# CONFIG_MTD_CONCAT is not set
444CONFIG_MTD_PARTITIONS=y 452CONFIG_MTD_PARTITIONS=y
445# CONFIG_MTD_REDBOOT_PARTS is not set 453# CONFIG_MTD_REDBOOT_PARTS is not set
446# CONFIG_MTD_CMDLINE_PARTS is not set 454# CONFIG_MTD_CMDLINE_PARTS is not set
455# CONFIG_MTD_AR7_PARTS is not set
447 456
448# 457#
449# User Modules And Translation Layers 458# User Modules And Translation Layers
@@ -456,6 +465,7 @@ CONFIG_MTD_BLOCK=y
456# CONFIG_INFTL is not set 465# CONFIG_INFTL is not set
457# CONFIG_RFD_FTL is not set 466# CONFIG_RFD_FTL is not set
458# CONFIG_SSFDC is not set 467# CONFIG_SSFDC is not set
468# CONFIG_MTD_OOPS is not set
459 469
460# 470#
461# RAM/ROM/Flash chip drivers 471# RAM/ROM/Flash chip drivers
@@ -481,14 +491,13 @@ CONFIG_MTD_CFI_UTIL=y
481# CONFIG_MTD_RAM is not set 491# CONFIG_MTD_RAM is not set
482# CONFIG_MTD_ROM is not set 492# CONFIG_MTD_ROM is not set
483# CONFIG_MTD_ABSENT is not set 493# CONFIG_MTD_ABSENT is not set
484# CONFIG_MTD_OBSOLETE_CHIPS is not set
485 494
486# 495#
487# Mapping drivers for chip access 496# Mapping drivers for chip access
488# 497#
489# CONFIG_MTD_COMPLEX_MAPPINGS is not set 498# CONFIG_MTD_COMPLEX_MAPPINGS is not set
490# CONFIG_MTD_PHYSMAP is not set 499CONFIG_MTD_PHYSMAP=y
491CONFIG_MTD_ALCHEMY=y 500# CONFIG_MTD_PHYSMAP_COMPAT is not set
492# CONFIG_MTD_PLATRAM is not set 501# CONFIG_MTD_PLATRAM is not set
493 502
494# 503#
@@ -505,161 +514,123 @@ CONFIG_MTD_ALCHEMY=y
505# CONFIG_MTD_DOC2000 is not set 514# CONFIG_MTD_DOC2000 is not set
506# CONFIG_MTD_DOC2001 is not set 515# CONFIG_MTD_DOC2001 is not set
507# CONFIG_MTD_DOC2001PLUS is not set 516# CONFIG_MTD_DOC2001PLUS is not set
508
509#
510# NAND Flash Device Drivers
511#
512# CONFIG_MTD_NAND is not set 517# CONFIG_MTD_NAND is not set
513
514#
515# OneNAND Flash Device Drivers
516#
517# CONFIG_MTD_ONENAND is not set 518# CONFIG_MTD_ONENAND is not set
518 519
519# 520#
520# Parallel port support 521# LPDDR flash memory drivers
521# 522#
522# CONFIG_PARPORT is not set 523# CONFIG_MTD_LPDDR is not set
523 524
524# 525#
525# Plug and Play support 526# UBI - Unsorted block images
526#
527# CONFIG_PNPACPI is not set
528
529# 527#
530# Block devices 528# CONFIG_MTD_UBI is not set
531# 529# CONFIG_PARPORT is not set
532# CONFIG_BLK_DEV_COW_COMMON is not set 530# CONFIG_BLK_DEV is not set
533CONFIG_BLK_DEV_LOOP=y 531# CONFIG_MISC_DEVICES is not set
534# CONFIG_BLK_DEV_CRYPTOLOOP is not set 532CONFIG_HAVE_IDE=y
535# CONFIG_BLK_DEV_NBD is not set 533CONFIG_IDE=y
536# CONFIG_BLK_DEV_RAM is not set
537# CONFIG_BLK_DEV_INITRD is not set
538CONFIG_CDROM_PKTCDVD=m
539CONFIG_CDROM_PKTCDVD_BUFFERS=8
540# CONFIG_CDROM_PKTCDVD_WCACHE is not set
541CONFIG_ATA_OVER_ETH=m
542 534
543# 535#
544# Misc devices 536# Please see Documentation/ide/ide.txt for help/info on IDE drives
545# 537#
538# CONFIG_BLK_DEV_IDE_SATA is not set
539CONFIG_IDE_GD=y
540CONFIG_IDE_GD_ATA=y
541# CONFIG_IDE_GD_ATAPI is not set
542# CONFIG_BLK_DEV_IDECS is not set
543# CONFIG_BLK_DEV_IDECD is not set
544# CONFIG_BLK_DEV_IDETAPE is not set
545CONFIG_IDE_TASK_IOCTL=y
546CONFIG_IDE_PROC_FS=y
546 547
547# 548#
548# ATA/ATAPI/MFM/RLL support 549# IDE chipset support/bugfixes
549# 550#
550# CONFIG_IDE is not set 551# CONFIG_IDE_GENERIC is not set
552# CONFIG_BLK_DEV_PLATFORM is not set
553# CONFIG_BLK_DEV_IDEDMA is not set
551 554
552# 555#
553# SCSI device support 556# SCSI device support
554# 557#
555CONFIG_RAID_ATTRS=m 558# CONFIG_RAID_ATTRS is not set
556# CONFIG_SCSI is not set 559# CONFIG_SCSI is not set
560# CONFIG_SCSI_DMA is not set
557# CONFIG_SCSI_NETLINK is not set 561# CONFIG_SCSI_NETLINK is not set
558
559#
560# Serial ATA (prod) and Parallel ATA (experimental) drivers
561#
562# CONFIG_ATA is not set 562# CONFIG_ATA is not set
563
564#
565# Multi-device support (RAID and LVM)
566#
567# CONFIG_MD is not set 563# CONFIG_MD is not set
568
569#
570# Fusion MPT device support
571#
572# CONFIG_FUSION is not set
573
574#
575# IEEE 1394 (FireWire) support
576#
577
578#
579# I2O device support
580#
581
582#
583# Network device support
584#
585CONFIG_NETDEVICES=y 564CONFIG_NETDEVICES=y
586# CONFIG_DUMMY is not set 565# CONFIG_DUMMY is not set
587# CONFIG_BONDING is not set 566# CONFIG_BONDING is not set
567# CONFIG_MACVLAN is not set
588# CONFIG_EQUALIZER is not set 568# CONFIG_EQUALIZER is not set
589# CONFIG_TUN is not set 569# CONFIG_TUN is not set
590 570# CONFIG_VETH is not set
591#
592# PHY device support
593#
594CONFIG_PHYLIB=y 571CONFIG_PHYLIB=y
595 572
596# 573#
597# MII PHY device drivers 574# MII PHY device drivers
598# 575#
599CONFIG_MARVELL_PHY=m 576CONFIG_MARVELL_PHY=y
600CONFIG_DAVICOM_PHY=m 577CONFIG_DAVICOM_PHY=y
601CONFIG_QSEMI_PHY=m 578CONFIG_QSEMI_PHY=y
602CONFIG_LXT_PHY=m 579CONFIG_LXT_PHY=y
603CONFIG_CICADA_PHY=m 580CONFIG_CICADA_PHY=y
604CONFIG_VITESSE_PHY=m 581CONFIG_VITESSE_PHY=y
605CONFIG_SMSC_PHY=m 582CONFIG_SMSC_PHY=y
606# CONFIG_BROADCOM_PHY is not set 583CONFIG_BROADCOM_PHY=y
584CONFIG_ICPLUS_PHY=y
585CONFIG_REALTEK_PHY=y
586CONFIG_NATIONAL_PHY=y
587CONFIG_STE10XP=y
588CONFIG_LSI_ET1011C_PHY=y
607# CONFIG_FIXED_PHY is not set 589# CONFIG_FIXED_PHY is not set
608 590# CONFIG_MDIO_BITBANG is not set
609#
610# Ethernet (10 or 100Mbit)
611#
612CONFIG_NET_ETHERNET=y 591CONFIG_NET_ETHERNET=y
613CONFIG_MII=m 592CONFIG_MII=y
593# CONFIG_AX88796 is not set
614CONFIG_MIPS_AU1X00_ENET=y 594CONFIG_MIPS_AU1X00_ENET=y
615# CONFIG_SMC91X is not set 595# CONFIG_SMC91X is not set
616# CONFIG_DM9000 is not set 596# CONFIG_DM9000 is not set
617 597# CONFIG_ETHOC is not set
618# 598# CONFIG_SMSC911X is not set
619# Ethernet (1000 Mbit) 599# CONFIG_DNET is not set
620# 600# CONFIG_IBM_NEW_EMAC_ZMII is not set
621 601# CONFIG_IBM_NEW_EMAC_RGMII is not set
622# 602# CONFIG_IBM_NEW_EMAC_TAH is not set
623# Ethernet (10000 Mbit) 603# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
624# 604# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
625 605# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
626# 606# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
627# Token Ring devices 607# CONFIG_B44 is not set
628# 608# CONFIG_KS8842 is not set
629 609# CONFIG_KS8851_MLL is not set
630# 610# CONFIG_NETDEV_1000 is not set
631# Wireless LAN (non-hamradio) 611# CONFIG_NETDEV_10000 is not set
632# 612# CONFIG_WLAN is not set
633# CONFIG_NET_RADIO is not set 613
634 614#
635# 615# Enable WiMAX (Networking options) to see the WiMAX drivers
636# Wan interfaces 616#
637# 617
618#
619# USB Network Adapters
620#
621# CONFIG_USB_CATC is not set
622# CONFIG_USB_KAWETH is not set
623# CONFIG_USB_PEGASUS is not set
624# CONFIG_USB_RTL8150 is not set
625# CONFIG_USB_USBNET is not set
626# CONFIG_NET_PCMCIA is not set
638# CONFIG_WAN is not set 627# CONFIG_WAN is not set
639CONFIG_PPP=m 628# CONFIG_PPP is not set
640CONFIG_PPP_MULTILINK=y
641# CONFIG_PPP_FILTER is not set
642CONFIG_PPP_ASYNC=m
643# CONFIG_PPP_SYNC_TTY is not set
644CONFIG_PPP_DEFLATE=m
645# CONFIG_PPP_BSDCOMP is not set
646CONFIG_PPP_MPPE=m
647CONFIG_PPPOE=m
648# CONFIG_SLIP is not set 629# CONFIG_SLIP is not set
649CONFIG_SLHC=m
650# CONFIG_SHAPER is not set
651# CONFIG_NETCONSOLE is not set 630# CONFIG_NETCONSOLE is not set
652# CONFIG_NETPOLL is not set 631# CONFIG_NETPOLL is not set
653# CONFIG_NET_POLL_CONTROLLER is not set 632# CONFIG_NET_POLL_CONTROLLER is not set
654
655#
656# ISDN subsystem
657#
658# CONFIG_ISDN is not set 633# CONFIG_ISDN is not set
659
660#
661# Telephony Support
662#
663# CONFIG_PHONE is not set 634# CONFIG_PHONE is not set
664 635
665# 636#
@@ -667,16 +638,14 @@ CONFIG_SLHC=m
667# 638#
668CONFIG_INPUT=y 639CONFIG_INPUT=y
669# CONFIG_INPUT_FF_MEMLESS is not set 640# CONFIG_INPUT_FF_MEMLESS is not set
641# CONFIG_INPUT_POLLDEV is not set
642# CONFIG_INPUT_SPARSEKMAP is not set
670 643
671# 644#
672# Userland interfaces 645# Userland interfaces
673# 646#
674CONFIG_INPUT_MOUSEDEV=y 647# CONFIG_INPUT_MOUSEDEV is not set
675CONFIG_INPUT_MOUSEDEV_PSAUX=y
676CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
677CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
678# CONFIG_INPUT_JOYDEV is not set 648# CONFIG_INPUT_JOYDEV is not set
679# CONFIG_INPUT_TSDEV is not set
680CONFIG_INPUT_EVDEV=y 649CONFIG_INPUT_EVDEV=y
681# CONFIG_INPUT_EVBUG is not set 650# CONFIG_INPUT_EVBUG is not set
682 651
@@ -686,34 +655,33 @@ CONFIG_INPUT_EVDEV=y
686# CONFIG_INPUT_KEYBOARD is not set 655# CONFIG_INPUT_KEYBOARD is not set
687# CONFIG_INPUT_MOUSE is not set 656# CONFIG_INPUT_MOUSE is not set
688# CONFIG_INPUT_JOYSTICK is not set 657# CONFIG_INPUT_JOYSTICK is not set
658# CONFIG_INPUT_TABLET is not set
689# CONFIG_INPUT_TOUCHSCREEN is not set 659# CONFIG_INPUT_TOUCHSCREEN is not set
690# CONFIG_INPUT_MISC is not set 660# CONFIG_INPUT_MISC is not set
691 661
692# 662#
693# Hardware I/O ports 663# Hardware I/O ports
694# 664#
695CONFIG_SERIO=y 665# CONFIG_SERIO is not set
696# CONFIG_SERIO_I8042 is not set
697CONFIG_SERIO_SERPORT=y
698CONFIG_SERIO_LIBPS2=m
699CONFIG_SERIO_RAW=m
700# CONFIG_GAMEPORT is not set 666# CONFIG_GAMEPORT is not set
701 667
702# 668#
703# Character devices 669# Character devices
704# 670#
705CONFIG_VT=y 671CONFIG_VT=y
672CONFIG_CONSOLE_TRANSLATIONS=y
706CONFIG_VT_CONSOLE=y 673CONFIG_VT_CONSOLE=y
707CONFIG_HW_CONSOLE=y 674CONFIG_HW_CONSOLE=y
708CONFIG_VT_HW_CONSOLE_BINDING=y 675CONFIG_VT_HW_CONSOLE_BINDING=y
676CONFIG_DEVKMEM=y
709# CONFIG_SERIAL_NONSTANDARD is not set 677# CONFIG_SERIAL_NONSTANDARD is not set
710# CONFIG_AU1X00_GPIO is not set
711 678
712# 679#
713# Serial drivers 680# Serial drivers
714# 681#
715CONFIG_SERIAL_8250=y 682CONFIG_SERIAL_8250=y
716CONFIG_SERIAL_8250_CONSOLE=y 683CONFIG_SERIAL_8250_CONSOLE=y
684# CONFIG_SERIAL_8250_CS is not set
717CONFIG_SERIAL_8250_NR_UARTS=4 685CONFIG_SERIAL_8250_NR_UARTS=4
718CONFIG_SERIAL_8250_RUNTIME_UARTS=4 686CONFIG_SERIAL_8250_RUNTIME_UARTS=4
719# CONFIG_SERIAL_8250_EXTENDED is not set 687# CONFIG_SERIAL_8250_EXTENDED is not set
@@ -725,78 +693,91 @@ CONFIG_SERIAL_8250_AU1X00=y
725CONFIG_SERIAL_CORE=y 693CONFIG_SERIAL_CORE=y
726CONFIG_SERIAL_CORE_CONSOLE=y 694CONFIG_SERIAL_CORE_CONSOLE=y
727CONFIG_UNIX98_PTYS=y 695CONFIG_UNIX98_PTYS=y
728CONFIG_LEGACY_PTYS=y 696# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
729CONFIG_LEGACY_PTY_COUNT=256 697# CONFIG_LEGACY_PTYS is not set
730
731#
732# IPMI
733#
734# CONFIG_IPMI_HANDLER is not set 698# CONFIG_IPMI_HANDLER is not set
735
736#
737# Watchdog Cards
738#
739# CONFIG_WATCHDOG is not set
740# CONFIG_HW_RANDOM is not set 699# CONFIG_HW_RANDOM is not set
741# CONFIG_RTC is not set
742# CONFIG_GEN_RTC is not set
743# CONFIG_DTLK is not set
744# CONFIG_R3964 is not set 700# CONFIG_R3964 is not set
745# CONFIG_RAW_DRIVER is not set
746 701
747# 702#
748# TPM devices 703# PCMCIA character devices
749# 704#
705# CONFIG_SYNCLINK_CS is not set
706# CONFIG_CARDMAN_4000 is not set
707# CONFIG_CARDMAN_4040 is not set
708# CONFIG_IPWIRELESS is not set
709# CONFIG_RAW_DRIVER is not set
750# CONFIG_TCG_TPM is not set 710# CONFIG_TCG_TPM is not set
751
752#
753# I2C support
754#
755# CONFIG_I2C is not set 711# CONFIG_I2C is not set
756
757#
758# SPI support
759#
760# CONFIG_SPI is not set 712# CONFIG_SPI is not set
761# CONFIG_SPI_MASTER is not set
762 713
763# 714#
764# Dallas's 1-wire bus 715# PPS support
765# 716#
717# CONFIG_PPS is not set
718CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
719# CONFIG_GPIOLIB is not set
766# CONFIG_W1 is not set 720# CONFIG_W1 is not set
767 721# CONFIG_POWER_SUPPLY is not set
768#
769# Hardware Monitoring support
770#
771# CONFIG_HWMON is not set 722# CONFIG_HWMON is not set
772# CONFIG_HWMON_VID is not set 723# CONFIG_THERMAL is not set
724# CONFIG_WATCHDOG is not set
725CONFIG_SSB_POSSIBLE=y
773 726
774# 727#
775# Multimedia devices 728# Sonics Silicon Backplane
776# 729#
777# CONFIG_VIDEO_DEV is not set 730# CONFIG_SSB is not set
778 731
779# 732#
780# Digital Video Broadcasting Devices 733# Multifunction device drivers
781# 734#
782# CONFIG_DVB is not set 735# CONFIG_MFD_CORE is not set
736# CONFIG_MFD_SM501 is not set
737# CONFIG_HTC_PASIC3 is not set
738# CONFIG_MFD_TMIO is not set
739# CONFIG_REGULATOR is not set
740# CONFIG_MEDIA_SUPPORT is not set
783 741
784# 742#
785# Graphics support 743# Graphics support
786# 744#
787# CONFIG_FIRMWARE_EDID is not set 745# CONFIG_VGASTATE is not set
746# CONFIG_VIDEO_OUTPUT_CONTROL is not set
788CONFIG_FB=y 747CONFIG_FB=y
748# CONFIG_FIRMWARE_EDID is not set
749# CONFIG_FB_DDC is not set
750# CONFIG_FB_BOOT_VESA_SUPPORT is not set
789CONFIG_FB_CFB_FILLRECT=y 751CONFIG_FB_CFB_FILLRECT=y
790CONFIG_FB_CFB_COPYAREA=y 752CONFIG_FB_CFB_COPYAREA=y
791CONFIG_FB_CFB_IMAGEBLIT=y 753CONFIG_FB_CFB_IMAGEBLIT=y
754# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
755# CONFIG_FB_SYS_FILLRECT is not set
756# CONFIG_FB_SYS_COPYAREA is not set
757# CONFIG_FB_SYS_IMAGEBLIT is not set
758# CONFIG_FB_FOREIGN_ENDIAN is not set
759# CONFIG_FB_SYS_FOPS is not set
792# CONFIG_FB_SVGALIB is not set 760# CONFIG_FB_SVGALIB is not set
793# CONFIG_FB_MACMODES is not set 761# CONFIG_FB_MACMODES is not set
794# CONFIG_FB_BACKLIGHT is not set 762# CONFIG_FB_BACKLIGHT is not set
795# CONFIG_FB_MODE_HELPERS is not set 763# CONFIG_FB_MODE_HELPERS is not set
796# CONFIG_FB_TILEBLITTING is not set 764# CONFIG_FB_TILEBLITTING is not set
765
766#
767# Frame buffer hardware drivers
768#
797# CONFIG_FB_S1D13XXX is not set 769# CONFIG_FB_S1D13XXX is not set
798CONFIG_FB_AU1100=y 770CONFIG_FB_AU1100=y
799# CONFIG_FB_VIRTUAL is not set 771# CONFIG_FB_VIRTUAL is not set
772# CONFIG_FB_METRONOME is not set
773# CONFIG_FB_MB862XX is not set
774# CONFIG_FB_BROADSHEET is not set
775# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
776
777#
778# Display device support
779#
780# CONFIG_DISPLAY_SUPPORT is not set
800 781
801# 782#
802# Console display driver support 783# Console display driver support
@@ -804,9 +785,10 @@ CONFIG_FB_AU1100=y
804# CONFIG_VGA_CONSOLE is not set 785# CONFIG_VGA_CONSOLE is not set
805CONFIG_DUMMY_CONSOLE=y 786CONFIG_DUMMY_CONSOLE=y
806CONFIG_FRAMEBUFFER_CONSOLE=y 787CONFIG_FRAMEBUFFER_CONSOLE=y
788# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
807# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set 789# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
808CONFIG_FONTS=y 790CONFIG_FONTS=y
809CONFIG_FONT_8x8=y 791# CONFIG_FONT_8x8 is not set
810CONFIG_FONT_8x16=y 792CONFIG_FONT_8x16=y
811# CONFIG_FONT_6x11 is not set 793# CONFIG_FONT_6x11 is not set
812# CONFIG_FONT_7x14 is not set 794# CONFIG_FONT_7x14 is not set
@@ -816,132 +798,186 @@ CONFIG_FONT_8x16=y
816# CONFIG_FONT_SUN8x16 is not set 798# CONFIG_FONT_SUN8x16 is not set
817# CONFIG_FONT_SUN12x22 is not set 799# CONFIG_FONT_SUN12x22 is not set
818# CONFIG_FONT_10x18 is not set 800# CONFIG_FONT_10x18 is not set
819 801# CONFIG_LOGO is not set
820#
821# Logo configuration
822#
823CONFIG_LOGO=y
824CONFIG_LOGO_LINUX_MONO=y
825CONFIG_LOGO_LINUX_VGA16=y
826CONFIG_LOGO_LINUX_CLUT224=y
827# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
828
829#
830# Sound
831#
832# CONFIG_SOUND is not set 802# CONFIG_SOUND is not set
833 803# CONFIG_HID_SUPPORT is not set
834# 804CONFIG_USB_SUPPORT=y
835# HID Devices
836#
837# CONFIG_HID is not set
838
839#
840# USB support
841#
842CONFIG_USB_ARCH_HAS_HCD=y 805CONFIG_USB_ARCH_HAS_HCD=y
843CONFIG_USB_ARCH_HAS_OHCI=y 806CONFIG_USB_ARCH_HAS_OHCI=y
844# CONFIG_USB_ARCH_HAS_EHCI is not set 807# CONFIG_USB_ARCH_HAS_EHCI is not set
845# CONFIG_USB is not set 808CONFIG_USB=y
809# CONFIG_USB_DEBUG is not set
810# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
846 811
847# 812#
848# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' 813# Miscellaneous USB options
849# 814#
815# CONFIG_USB_DEVICEFS is not set
816# CONFIG_USB_DEVICE_CLASS is not set
817CONFIG_USB_DYNAMIC_MINORS=y
818CONFIG_USB_SUSPEND=y
819# CONFIG_USB_OTG is not set
820# CONFIG_USB_OTG_WHITELIST is not set
821# CONFIG_USB_OTG_BLACKLIST_HUB is not set
822# CONFIG_USB_MON is not set
823# CONFIG_USB_WUSB is not set
824# CONFIG_USB_WUSB_CBAF is not set
850 825
851# 826#
852# USB Gadget Support 827# USB Host Controller Drivers
853# 828#
854# CONFIG_USB_GADGET is not set 829# CONFIG_USB_C67X00_HCD is not set
830# CONFIG_USB_OXU210HP_HCD is not set
831# CONFIG_USB_ISP116X_HCD is not set
832# CONFIG_USB_ISP1760_HCD is not set
833# CONFIG_USB_ISP1362_HCD is not set
834CONFIG_USB_OHCI_HCD=y
835# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
836# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
837CONFIG_USB_OHCI_LITTLE_ENDIAN=y
838# CONFIG_USB_SL811_HCD is not set
839# CONFIG_USB_R8A66597_HCD is not set
840# CONFIG_USB_HWA_HCD is not set
855 841
856# 842#
857# MMC/SD Card support 843# USB Device Class drivers
858# 844#
859# CONFIG_MMC is not set 845# CONFIG_USB_ACM is not set
846# CONFIG_USB_PRINTER is not set
847# CONFIG_USB_WDM is not set
848# CONFIG_USB_TMC is not set
860 849
861# 850#
862# LED devices 851# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
863# 852#
864# CONFIG_NEW_LEDS is not set
865 853
866# 854#
867# LED drivers 855# also be needed; see USB_STORAGE Help for more info
868# 856#
857# CONFIG_USB_LIBUSUAL is not set
869 858
870# 859#
871# LED Triggers 860# USB Imaging devices
872# 861#
862# CONFIG_USB_MDC800 is not set
873 863
874# 864#
875# InfiniBand support 865# USB port drivers
876# 866#
867# CONFIG_USB_SERIAL is not set
877 868
878# 869#
879# EDAC - error detection and reporting (RAS) (EXPERIMENTAL) 870# USB Miscellaneous drivers
880# 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_IDMOUSE is not set
884# CONFIG_USB_FTDI_ELAN is not set
885# CONFIG_USB_APPLEDISPLAY is not set
886# CONFIG_USB_LD is not set
887# CONFIG_USB_TRANCEVIBRATOR is not set
888# CONFIG_USB_IOWARRIOR is not set
889# CONFIG_USB_TEST is not set
890# CONFIG_USB_ISIGHTFW is not set
891# CONFIG_USB_VST is not set
892# CONFIG_USB_GADGET is not set
881 893
882# 894#
883# Real Time Clock 895# OTG and related infrastructure
884# 896#
885# CONFIG_RTC_CLASS is not set 897# CONFIG_USB_GPIO_VBUS is not set
898# CONFIG_NOP_USB_XCEIV is not set
899# CONFIG_MMC is not set
900# CONFIG_MEMSTICK is not set
901# CONFIG_NEW_LEDS is not set
902# CONFIG_ACCESSIBILITY 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
886 908
887# 909#
888# DMA Engine support 910# RTC interfaces
889# 911#
890# CONFIG_DMA_ENGINE is not set 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
891 917
892# 918#
893# DMA Clients 919# SPI RTC drivers
894# 920#
895 921
896# 922#
897# DMA Devices 923# Platform RTC drivers
898# 924#
925# CONFIG_RTC_DRV_CMOS is not set
926# CONFIG_RTC_DRV_DS1286 is not set
927# CONFIG_RTC_DRV_DS1511 is not set
928# CONFIG_RTC_DRV_DS1553 is not set
929# CONFIG_RTC_DRV_DS1742 is not set
930# CONFIG_RTC_DRV_STK17TA8 is not set
931# CONFIG_RTC_DRV_M48T86 is not set
932# CONFIG_RTC_DRV_M48T35 is not set
933# CONFIG_RTC_DRV_M48T59 is not set
934# CONFIG_RTC_DRV_MSM6242 is not set
935# CONFIG_RTC_DRV_BQ4802 is not set
936# CONFIG_RTC_DRV_RP5C01 is not set
937# CONFIG_RTC_DRV_V3020 is not set
899 938
900# 939#
901# Auxiliary Display support 940# on-CPU RTC drivers
902# 941#
942CONFIG_RTC_DRV_AU1XXX=y
943# CONFIG_DMADEVICES is not set
944# CONFIG_AUXDISPLAY is not set
945# CONFIG_UIO is not set
903 946
904# 947#
905# Virtualization 948# TI VLYNQ
906# 949#
950# CONFIG_STAGING is not set
907 951
908# 952#
909# File systems 953# File systems
910# 954#
911CONFIG_EXT2_FS=y 955CONFIG_EXT2_FS=y
912CONFIG_EXT2_FS_XATTR=y 956# CONFIG_EXT2_FS_XATTR is not set
913CONFIG_EXT2_FS_POSIX_ACL=y
914# CONFIG_EXT2_FS_SECURITY is not set
915# CONFIG_EXT2_FS_XIP is not set 957# CONFIG_EXT2_FS_XIP is not set
916CONFIG_EXT3_FS=y 958# CONFIG_EXT3_FS is not set
917CONFIG_EXT3_FS_XATTR=y 959# CONFIG_EXT4_FS is not set
918CONFIG_EXT3_FS_POSIX_ACL=y 960# CONFIG_REISERFS_FS is not set
919CONFIG_EXT3_FS_SECURITY=y
920# CONFIG_EXT4DEV_FS is not set
921CONFIG_JBD=y
922# CONFIG_JBD_DEBUG is not set
923CONFIG_FS_MBCACHE=y
924CONFIG_REISERFS_FS=m
925# CONFIG_REISERFS_CHECK is not set
926# CONFIG_REISERFS_PROC_INFO is not set
927CONFIG_REISERFS_FS_XATTR=y
928CONFIG_REISERFS_FS_POSIX_ACL=y
929CONFIG_REISERFS_FS_SECURITY=y
930# CONFIG_JFS_FS is not set 961# CONFIG_JFS_FS is not set
931CONFIG_FS_POSIX_ACL=y 962CONFIG_FS_POSIX_ACL=y
932# CONFIG_XFS_FS is not set 963# CONFIG_XFS_FS is not set
933# CONFIG_GFS2_FS is not set
934# CONFIG_OCFS2_FS is not set 964# CONFIG_OCFS2_FS is not set
935# CONFIG_MINIX_FS is not set 965# CONFIG_BTRFS_FS is not set
936# CONFIG_ROMFS_FS is not set 966# CONFIG_NILFS2_FS is not set
967CONFIG_FILE_LOCKING=y
968CONFIG_FSNOTIFY=y
969CONFIG_DNOTIFY=y
937CONFIG_INOTIFY=y 970CONFIG_INOTIFY=y
938CONFIG_INOTIFY_USER=y 971CONFIG_INOTIFY_USER=y
939# CONFIG_QUOTA is not set 972# CONFIG_QUOTA is not set
940CONFIG_DNOTIFY=y 973# CONFIG_AUTOFS_FS is not set
941CONFIG_AUTOFS_FS=m 974# CONFIG_AUTOFS4_FS is not set
942CONFIG_AUTOFS4_FS=m 975# CONFIG_FUSE_FS is not set
943CONFIG_FUSE_FS=m 976
944CONFIG_GENERIC_ACL=y 977#
978# Caches
979#
980# CONFIG_FSCACHE is not set
945 981
946# 982#
947# CD-ROM/DVD Filesystems 983# CD-ROM/DVD Filesystems
@@ -960,69 +996,76 @@ CONFIG_GENERIC_ACL=y
960# Pseudo filesystems 996# Pseudo filesystems
961# 997#
962CONFIG_PROC_FS=y 998CONFIG_PROC_FS=y
963CONFIG_PROC_KCORE=y 999# CONFIG_PROC_KCORE is not set
964CONFIG_PROC_SYSCTL=y 1000CONFIG_PROC_SYSCTL=y
1001# CONFIG_PROC_PAGE_MONITOR is not set
965CONFIG_SYSFS=y 1002CONFIG_SYSFS=y
966CONFIG_TMPFS=y 1003CONFIG_TMPFS=y
967CONFIG_TMPFS_POSIX_ACL=y 1004# CONFIG_TMPFS_POSIX_ACL is not set
968# CONFIG_HUGETLB_PAGE is not set 1005# CONFIG_HUGETLB_PAGE is not set
969CONFIG_RAMFS=y 1006# CONFIG_CONFIGFS_FS is not set
970CONFIG_CONFIGFS_FS=m 1007CONFIG_MISC_FILESYSTEMS=y
971
972#
973# Miscellaneous filesystems
974#
975# CONFIG_ADFS_FS is not set 1008# CONFIG_ADFS_FS is not set
976# CONFIG_AFFS_FS is not set 1009# CONFIG_AFFS_FS is not set
977# CONFIG_ECRYPT_FS is not set
978# CONFIG_HFS_FS is not set 1010# CONFIG_HFS_FS is not set
979# CONFIG_HFSPLUS_FS is not set 1011# CONFIG_HFSPLUS_FS is not set
980# CONFIG_BEFS_FS is not set 1012# CONFIG_BEFS_FS is not set
981# CONFIG_BFS_FS is not set 1013# CONFIG_BFS_FS is not set
982# CONFIG_EFS_FS is not set 1014# CONFIG_EFS_FS is not set
983# CONFIG_JFFS2_FS is not set 1015CONFIG_JFFS2_FS=y
984CONFIG_CRAMFS=m 1016CONFIG_JFFS2_FS_DEBUG=0
1017CONFIG_JFFS2_FS_WRITEBUFFER=y
1018# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
1019CONFIG_JFFS2_SUMMARY=y
1020CONFIG_JFFS2_FS_XATTR=y
1021CONFIG_JFFS2_FS_POSIX_ACL=y
1022CONFIG_JFFS2_FS_SECURITY=y
1023CONFIG_JFFS2_COMPRESSION_OPTIONS=y
1024CONFIG_JFFS2_ZLIB=y
1025CONFIG_JFFS2_LZO=y
1026CONFIG_JFFS2_RTIME=y
1027CONFIG_JFFS2_RUBIN=y
1028# CONFIG_JFFS2_CMODE_NONE is not set
1029CONFIG_JFFS2_CMODE_PRIORITY=y
1030# CONFIG_JFFS2_CMODE_SIZE is not set
1031# CONFIG_JFFS2_CMODE_FAVOURLZO is not set
1032# CONFIG_CRAMFS is not set
1033CONFIG_SQUASHFS=y
1034# CONFIG_SQUASHFS_EMBEDDED is not set
1035CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
985# CONFIG_VXFS_FS is not set 1036# CONFIG_VXFS_FS is not set
1037# CONFIG_MINIX_FS is not set
1038# CONFIG_OMFS_FS is not set
986# CONFIG_HPFS_FS is not set 1039# CONFIG_HPFS_FS is not set
987# CONFIG_QNX4FS_FS is not set 1040# CONFIG_QNX4FS_FS is not set
1041# CONFIG_ROMFS_FS is not set
988# CONFIG_SYSV_FS is not set 1042# CONFIG_SYSV_FS is not set
989# CONFIG_UFS_FS is not set 1043# CONFIG_UFS_FS is not set
990 1044CONFIG_NETWORK_FILESYSTEMS=y
991#
992# Network File Systems
993#
994CONFIG_NFS_FS=y 1045CONFIG_NFS_FS=y
995# CONFIG_NFS_V3 is not set 1046CONFIG_NFS_V3=y
1047# CONFIG_NFS_V3_ACL is not set
996# CONFIG_NFS_V4 is not set 1048# CONFIG_NFS_V4 is not set
997# CONFIG_NFS_DIRECTIO is not set
998CONFIG_NFSD=m
999# CONFIG_NFSD_V3 is not set
1000# CONFIG_NFSD_TCP is not set
1001CONFIG_ROOT_NFS=y 1049CONFIG_ROOT_NFS=y
1050# CONFIG_NFSD is not set
1002CONFIG_LOCKD=y 1051CONFIG_LOCKD=y
1003CONFIG_EXPORTFS=m 1052CONFIG_LOCKD_V4=y
1004CONFIG_NFS_COMMON=y 1053CONFIG_NFS_COMMON=y
1005CONFIG_SUNRPC=y 1054CONFIG_SUNRPC=y
1006# CONFIG_RPCSEC_GSS_KRB5 is not set 1055# CONFIG_RPCSEC_GSS_KRB5 is not set
1007# CONFIG_RPCSEC_GSS_SPKM3 is not set 1056# CONFIG_RPCSEC_GSS_SPKM3 is not set
1008CONFIG_SMB_FS=m 1057# CONFIG_SMB_FS is not set
1009# CONFIG_SMB_NLS_DEFAULT is not set
1010# CONFIG_CIFS is not set 1058# CONFIG_CIFS is not set
1011# CONFIG_NCP_FS is not set 1059# CONFIG_NCP_FS is not set
1012# CONFIG_CODA_FS is not set 1060# CONFIG_CODA_FS is not set
1013# CONFIG_AFS_FS is not set 1061# CONFIG_AFS_FS is not set
1014# CONFIG_9P_FS is not set
1015 1062
1016# 1063#
1017# Partition Types 1064# Partition Types
1018# 1065#
1019# CONFIG_PARTITION_ADVANCED is not set 1066# CONFIG_PARTITION_ADVANCED is not set
1020CONFIG_MSDOS_PARTITION=y 1067CONFIG_MSDOS_PARTITION=y
1021 1068CONFIG_NLS=y
1022#
1023# Native Language Support
1024#
1025CONFIG_NLS=m
1026CONFIG_NLS_DEFAULT="iso8859-1" 1069CONFIG_NLS_DEFAULT="iso8859-1"
1027# CONFIG_NLS_CODEPAGE_437 is not set 1070# CONFIG_NLS_CODEPAGE_437 is not set
1028# CONFIG_NLS_CODEPAGE_737 is not set 1071# CONFIG_NLS_CODEPAGE_737 is not set
@@ -1062,34 +1105,71 @@ CONFIG_NLS_DEFAULT="iso8859-1"
1062# CONFIG_NLS_KOI8_R is not set 1105# CONFIG_NLS_KOI8_R is not set
1063# CONFIG_NLS_KOI8_U is not set 1106# CONFIG_NLS_KOI8_U is not set
1064# CONFIG_NLS_UTF8 is not set 1107# CONFIG_NLS_UTF8 is not set
1065 1108# CONFIG_DLM is not set
1066#
1067# Distributed Lock Manager
1068#
1069CONFIG_DLM=m
1070CONFIG_DLM_TCP=y
1071# CONFIG_DLM_SCTP is not set
1072# CONFIG_DLM_DEBUG is not set
1073
1074#
1075# Profiling support
1076#
1077# CONFIG_PROFILING is not set
1078 1109
1079# 1110#
1080# Kernel hacking 1111# Kernel hacking
1081# 1112#
1082CONFIG_TRACE_IRQFLAGS_SUPPORT=y 1113CONFIG_TRACE_IRQFLAGS_SUPPORT=y
1083# CONFIG_PRINTK_TIME is not set 1114# CONFIG_PRINTK_TIME is not set
1115CONFIG_ENABLE_WARN_DEPRECATED=y
1084CONFIG_ENABLE_MUST_CHECK=y 1116CONFIG_ENABLE_MUST_CHECK=y
1117CONFIG_FRAME_WARN=1024
1085# CONFIG_MAGIC_SYSRQ is not set 1118# CONFIG_MAGIC_SYSRQ is not set
1119CONFIG_STRIP_ASM_SYMS=y
1086# CONFIG_UNUSED_SYMBOLS is not set 1120# CONFIG_UNUSED_SYMBOLS is not set
1087# CONFIG_DEBUG_FS is not set 1121# CONFIG_DEBUG_FS is not set
1088# CONFIG_HEADERS_CHECK is not set 1122# CONFIG_HEADERS_CHECK is not set
1089# CONFIG_DEBUG_KERNEL is not set 1123CONFIG_DEBUG_KERNEL=y
1090CONFIG_LOG_BUF_SHIFT=14 1124# CONFIG_DEBUG_SHIRQ is not set
1091CONFIG_CROSSCOMPILE=y 1125# CONFIG_DETECT_SOFTLOCKUP is not set
1126# CONFIG_DETECT_HUNG_TASK is not set
1127# CONFIG_SCHED_DEBUG is not set
1128# CONFIG_SCHEDSTATS is not set
1129# CONFIG_TIMER_STATS is not set
1130# CONFIG_DEBUG_OBJECTS is not set
1131# CONFIG_DEBUG_SLAB is not set
1132# CONFIG_DEBUG_RT_MUTEXES is not set
1133# CONFIG_RT_MUTEX_TESTER is not set
1134# CONFIG_DEBUG_SPINLOCK is not set
1135# CONFIG_DEBUG_MUTEXES is not set
1136# CONFIG_DEBUG_LOCK_ALLOC is not set
1137# CONFIG_PROVE_LOCKING is not set
1138# CONFIG_LOCK_STAT is not set
1139# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1140# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1141# CONFIG_DEBUG_KOBJECT is not set
1142# CONFIG_DEBUG_INFO is not set
1143# CONFIG_DEBUG_VM is not set
1144# CONFIG_DEBUG_WRITECOUNT is not set
1145# CONFIG_DEBUG_MEMORY_INIT is not set
1146# CONFIG_DEBUG_LIST is not set
1147# CONFIG_DEBUG_SG is not set
1148# CONFIG_DEBUG_NOTIFIERS is not set
1149# CONFIG_DEBUG_CREDENTIALS is not set
1150# CONFIG_BOOT_PRINTK_DELAY is not set
1151# CONFIG_RCU_TORTURE_TEST is not set
1152# CONFIG_BACKTRACE_SELF_TEST is not set
1153# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1154# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
1155# CONFIG_FAULT_INJECTION is not set
1156# CONFIG_SYSCTL_SYSCALL_CHECK is not set
1157# CONFIG_PAGE_POISONING is not set
1158CONFIG_HAVE_FUNCTION_TRACER=y
1159CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1160CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y
1161CONFIG_HAVE_DYNAMIC_FTRACE=y
1162CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1163CONFIG_TRACING_SUPPORT=y
1164# CONFIG_FTRACE is not set
1165# CONFIG_SAMPLES is not set
1166CONFIG_HAVE_ARCH_KGDB=y
1167# CONFIG_KGDB is not set
1168CONFIG_EARLY_PRINTK=y
1092# CONFIG_CMDLINE_BOOL is not set 1169# CONFIG_CMDLINE_BOOL is not set
1170# CONFIG_DEBUG_STACK_USAGE is not set
1171# CONFIG_RUNTIME_DEBUG is not set
1172CONFIG_DEBUG_ZBOOT=y
1093 1173
1094# 1174#
1095# Security options 1175# Security options
@@ -1097,67 +1177,32 @@ CONFIG_CROSSCOMPILE=y
1097CONFIG_KEYS=y 1177CONFIG_KEYS=y
1098CONFIG_KEYS_DEBUG_PROC_KEYS=y 1178CONFIG_KEYS_DEBUG_PROC_KEYS=y
1099# CONFIG_SECURITY is not set 1179# CONFIG_SECURITY is not set
1100 1180CONFIG_SECURITYFS=y
1101# 1181# CONFIG_DEFAULT_SECURITY_SELINUX is not set
1102# Cryptographic options 1182# CONFIG_DEFAULT_SECURITY_SMACK is not set
1103# 1183# CONFIG_DEFAULT_SECURITY_TOMOYO is not set
1104CONFIG_CRYPTO=y 1184CONFIG_DEFAULT_SECURITY_DAC=y
1105CONFIG_CRYPTO_ALGAPI=y 1185CONFIG_DEFAULT_SECURITY=""
1106CONFIG_CRYPTO_BLKCIPHER=m 1186# CONFIG_CRYPTO is not set
1107CONFIG_CRYPTO_HASH=y 1187# CONFIG_BINARY_PRINTF is not set
1108CONFIG_CRYPTO_MANAGER=y
1109CONFIG_CRYPTO_HMAC=y
1110CONFIG_CRYPTO_XCBC=m
1111CONFIG_CRYPTO_NULL=m
1112CONFIG_CRYPTO_MD4=m
1113CONFIG_CRYPTO_MD5=y
1114CONFIG_CRYPTO_SHA1=m
1115CONFIG_CRYPTO_SHA256=m
1116CONFIG_CRYPTO_SHA512=m
1117CONFIG_CRYPTO_WP512=m
1118CONFIG_CRYPTO_TGR192=m
1119CONFIG_CRYPTO_GF128MUL=m
1120CONFIG_CRYPTO_ECB=m
1121CONFIG_CRYPTO_CBC=m
1122CONFIG_CRYPTO_PCBC=m
1123CONFIG_CRYPTO_LRW=m
1124CONFIG_CRYPTO_DES=m
1125CONFIG_CRYPTO_FCRYPT=m
1126CONFIG_CRYPTO_BLOWFISH=m
1127CONFIG_CRYPTO_TWOFISH=m
1128CONFIG_CRYPTO_TWOFISH_COMMON=m
1129CONFIG_CRYPTO_SERPENT=m
1130CONFIG_CRYPTO_AES=m
1131CONFIG_CRYPTO_CAST5=m
1132CONFIG_CRYPTO_CAST6=m
1133CONFIG_CRYPTO_TEA=m
1134CONFIG_CRYPTO_ARC4=m
1135CONFIG_CRYPTO_KHAZAD=m
1136CONFIG_CRYPTO_ANUBIS=m
1137CONFIG_CRYPTO_DEFLATE=m
1138CONFIG_CRYPTO_MICHAEL_MIC=m
1139CONFIG_CRYPTO_CRC32C=m
1140CONFIG_CRYPTO_CAMELLIA=m
1141# CONFIG_CRYPTO_TEST is not set
1142
1143#
1144# Hardware crypto devices
1145#
1146 1188
1147# 1189#
1148# Library routines 1190# Library routines
1149# 1191#
1150CONFIG_BITREVERSE=y 1192CONFIG_BITREVERSE=y
1151CONFIG_CRC_CCITT=m 1193CONFIG_GENERIC_FIND_LAST_BIT=y
1152CONFIG_CRC16=m 1194# CONFIG_CRC_CCITT is not set
1195# CONFIG_CRC16 is not set
1196# CONFIG_CRC_T10DIF is not set
1197# CONFIG_CRC_ITU_T is not set
1153CONFIG_CRC32=y 1198CONFIG_CRC32=y
1154CONFIG_LIBCRC32C=m 1199# CONFIG_CRC7 is not set
1155CONFIG_ZLIB_INFLATE=m 1200# CONFIG_LIBCRC32C is not set
1156CONFIG_ZLIB_DEFLATE=m 1201CONFIG_ZLIB_INFLATE=y
1157CONFIG_TEXTSEARCH=y 1202CONFIG_ZLIB_DEFLATE=y
1158CONFIG_TEXTSEARCH_KMP=m 1203CONFIG_LZO_COMPRESS=y
1159CONFIG_TEXTSEARCH_BM=m 1204CONFIG_LZO_DECOMPRESS=y
1160CONFIG_TEXTSEARCH_FSM=m
1161CONFIG_PLIST=y
1162CONFIG_HAS_IOMEM=y 1205CONFIG_HAS_IOMEM=y
1163CONFIG_HAS_IOPORT=y 1206CONFIG_HAS_IOPORT=y
1207CONFIG_HAS_DMA=y
1208CONFIG_NLATTR=y
diff --git a/arch/mips/configs/db1200_defconfig b/arch/mips/configs/db1200_defconfig
index dabf03032e06..991c20adf471 100644
--- a/arch/mips/configs/db1200_defconfig
+++ b/arch/mips/configs/db1200_defconfig
@@ -1,78 +1,102 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.20 3# Linux kernel version: 2.6.33
4# Tue Feb 20 21:47:25 2007 4# Fri Feb 26 10:18:09 2010
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
8# 8#
9# Machine selection 9# Machine selection
10# 10#
11CONFIG_ZONE_DMA=y
12CONFIG_MACH_ALCHEMY=y 11CONFIG_MACH_ALCHEMY=y
13# CONFIG_MIPS_MTX1 is not set 12# CONFIG_AR7 is not set
14# CONFIG_MIPS_BOSPORUS is not set 13# CONFIG_BCM47XX is not set
15# CONFIG_MIPS_PB1000 is not set 14# CONFIG_BCM63XX is not set
16# CONFIG_MIPS_PB1100 is not set
17# CONFIG_MIPS_PB1500 is not set
18# CONFIG_MIPS_PB1550 is not set
19# CONFIG_MIPS_PB1200 is not set
20# CONFIG_MIPS_DB1000 is not set
21# CONFIG_MIPS_DB1100 is not set
22# CONFIG_MIPS_DB1500 is not set
23# CONFIG_MIPS_DB1550 is not set
24CONFIG_MIPS_DB1200=y
25# CONFIG_MIPS_MIRAGE is not set
26# CONFIG_MIPS_COBALT is not set 15# CONFIG_MIPS_COBALT is not set
27# CONFIG_MACH_DECSTATION is not set 16# CONFIG_MACH_DECSTATION is not set
28# CONFIG_MACH_JAZZ is not set 17# CONFIG_MACH_JAZZ is not set
18# CONFIG_LASAT is not set
19# CONFIG_MACH_LOONGSON is not set
29# CONFIG_MIPS_MALTA is not set 20# CONFIG_MIPS_MALTA is not set
30# CONFIG_WR_PPMC is not set
31# CONFIG_MIPS_SIM is not set 21# CONFIG_MIPS_SIM is not set
32# CONFIG_MOMENCO_JAGUAR_ATX is not set 22# CONFIG_NEC_MARKEINS is not set
33# CONFIG_MIPS_XXS1500 is not set 23# CONFIG_MACH_VR41XX is not set
24# CONFIG_NXP_STB220 is not set
25# CONFIG_NXP_STB225 is not set
34# CONFIG_PNX8550_JBS is not set 26# CONFIG_PNX8550_JBS is not set
35# CONFIG_PNX8550_STB810 is not set 27# CONFIG_PNX8550_STB810 is not set
36# CONFIG_MACH_VR41XX is not set 28# CONFIG_PMC_MSP is not set
37# CONFIG_PMC_YOSEMITE is not set 29# CONFIG_PMC_YOSEMITE is not set
38# CONFIG_MARKEINS is not set 30# CONFIG_POWERTV is not set
39# CONFIG_SGI_IP22 is not set 31# CONFIG_SGI_IP22 is not set
40# CONFIG_SGI_IP27 is not set 32# CONFIG_SGI_IP27 is not set
33# CONFIG_SGI_IP28 is not set
41# CONFIG_SGI_IP32 is not set 34# CONFIG_SGI_IP32 is not set
42# CONFIG_SIBYTE_BIGSUR is not set
43# CONFIG_SIBYTE_SWARM is not set
44# CONFIG_SIBYTE_SENTOSA is not set
45# CONFIG_SIBYTE_RHONE is not set
46# CONFIG_SIBYTE_CARMEL is not set
47# CONFIG_SIBYTE_LITTLESUR is not set
48# CONFIG_SIBYTE_CRHINE is not set 35# CONFIG_SIBYTE_CRHINE is not set
36# CONFIG_SIBYTE_CARMEL is not set
49# CONFIG_SIBYTE_CRHONE is not set 37# CONFIG_SIBYTE_CRHONE is not set
38# CONFIG_SIBYTE_RHONE is not set
39# CONFIG_SIBYTE_SWARM is not set
40# CONFIG_SIBYTE_LITTLESUR is not set
41# CONFIG_SIBYTE_SENTOSA is not set
42# CONFIG_SIBYTE_BIGSUR is not set
50# CONFIG_SNI_RM is not set 43# CONFIG_SNI_RM is not set
51# CONFIG_TOSHIBA_JMR3927 is not set 44# CONFIG_MACH_TX39XX is not set
52# CONFIG_TOSHIBA_RBTX4927 is not set 45# CONFIG_MACH_TX49XX is not set
53# CONFIG_TOSHIBA_RBTX4938 is not set 46# CONFIG_MIKROTIK_RB532 is not set
47# CONFIG_WR_PPMC is not set
48# CONFIG_CAVIUM_OCTEON_SIMULATOR is not set
49# CONFIG_CAVIUM_OCTEON_REFERENCE_BOARD is not set
50CONFIG_ALCHEMY_GPIOINT_AU1000=y
51# CONFIG_ALCHEMY_GPIO_INDIRECT is not set
52# CONFIG_MIPS_MTX1 is not set
53# CONFIG_MIPS_BOSPORUS is not set
54# CONFIG_MIPS_DB1000 is not set
55# CONFIG_MIPS_DB1100 is not set
56CONFIG_MIPS_DB1200=y
57# CONFIG_MIPS_DB1500 is not set
58# CONFIG_MIPS_DB1550 is not set
59# CONFIG_MIPS_MIRAGE is not set
60# CONFIG_MIPS_PB1000 is not set
61# CONFIG_MIPS_PB1100 is not set
62# CONFIG_MIPS_PB1200 is not set
63# CONFIG_MIPS_PB1500 is not set
64# CONFIG_MIPS_PB1550 is not set
65# CONFIG_MIPS_XXS1500 is not set
66CONFIG_SOC_AU1200=y
67CONFIG_SOC_AU1X00=y
68CONFIG_LOONGSON_UART_BASE=y
54CONFIG_RWSEM_GENERIC_SPINLOCK=y 69CONFIG_RWSEM_GENERIC_SPINLOCK=y
55# CONFIG_ARCH_HAS_ILOG2_U32 is not set 70# CONFIG_ARCH_HAS_ILOG2_U32 is not set
56# CONFIG_ARCH_HAS_ILOG2_U64 is not set 71# CONFIG_ARCH_HAS_ILOG2_U64 is not set
72CONFIG_ARCH_SUPPORTS_OPROFILE=y
57CONFIG_GENERIC_FIND_NEXT_BIT=y 73CONFIG_GENERIC_FIND_NEXT_BIT=y
58CONFIG_GENERIC_HWEIGHT=y 74CONFIG_GENERIC_HWEIGHT=y
59CONFIG_GENERIC_CALIBRATE_DELAY=y 75CONFIG_GENERIC_CALIBRATE_DELAY=y
76CONFIG_GENERIC_CLOCKEVENTS=y
60CONFIG_GENERIC_TIME=y 77CONFIG_GENERIC_TIME=y
61CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y 78CONFIG_GENERIC_CMOS_UPDATE=y
62# CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ is not set 79CONFIG_SCHED_OMIT_FRAME_POINTER=y
80CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
81CONFIG_CEVT_R4K_LIB=y
82CONFIG_CSRC_R4K_LIB=y
63CONFIG_DMA_COHERENT=y 83CONFIG_DMA_COHERENT=y
84CONFIG_SYS_HAS_EARLY_PRINTK=y
64CONFIG_MIPS_DISABLE_OBSOLETE_IDE=y 85CONFIG_MIPS_DISABLE_OBSOLETE_IDE=y
86# CONFIG_NO_IOPORT is not set
87CONFIG_GENERIC_GPIO=y
65# CONFIG_CPU_BIG_ENDIAN is not set 88# CONFIG_CPU_BIG_ENDIAN is not set
66CONFIG_CPU_LITTLE_ENDIAN=y 89CONFIG_CPU_LITTLE_ENDIAN=y
67CONFIG_SYS_SUPPORTS_APM_EMULATION=y 90CONFIG_SYS_SUPPORTS_APM_EMULATION=y
68CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y 91CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
69CONFIG_SOC_AU1200=y 92CONFIG_IRQ_CPU=y
70CONFIG_SOC_AU1X00=y
71CONFIG_MIPS_L1_CACHE_SHIFT=5 93CONFIG_MIPS_L1_CACHE_SHIFT=5
72 94
73# 95#
74# CPU selection 96# CPU selection
75# 97#
98# CONFIG_CPU_LOONGSON2E is not set
99# CONFIG_CPU_LOONGSON2F is not set
76CONFIG_CPU_MIPS32_R1=y 100CONFIG_CPU_MIPS32_R1=y
77# CONFIG_CPU_MIPS32_R2 is not set 101# CONFIG_CPU_MIPS32_R2 is not set
78# CONFIG_CPU_MIPS64_R1 is not set 102# CONFIG_CPU_MIPS64_R1 is not set
@@ -85,6 +109,7 @@ CONFIG_CPU_MIPS32_R1=y
85# CONFIG_CPU_TX49XX is not set 109# CONFIG_CPU_TX49XX is not set
86# CONFIG_CPU_R5000 is not set 110# CONFIG_CPU_R5000 is not set
87# CONFIG_CPU_R5432 is not set 111# CONFIG_CPU_R5432 is not set
112# CONFIG_CPU_R5500 is not set
88# CONFIG_CPU_R6000 is not set 113# CONFIG_CPU_R6000 is not set
89# CONFIG_CPU_NEVADA is not set 114# CONFIG_CPU_NEVADA is not set
90# CONFIG_CPU_R8000 is not set 115# CONFIG_CPU_R8000 is not set
@@ -92,11 +117,14 @@ CONFIG_CPU_MIPS32_R1=y
92# CONFIG_CPU_RM7000 is not set 117# CONFIG_CPU_RM7000 is not set
93# CONFIG_CPU_RM9000 is not set 118# CONFIG_CPU_RM9000 is not set
94# CONFIG_CPU_SB1 is not set 119# CONFIG_CPU_SB1 is not set
120# CONFIG_CPU_CAVIUM_OCTEON is not set
121CONFIG_SYS_SUPPORTS_ZBOOT=y
95CONFIG_SYS_HAS_CPU_MIPS32_R1=y 122CONFIG_SYS_HAS_CPU_MIPS32_R1=y
96CONFIG_CPU_MIPS32=y 123CONFIG_CPU_MIPS32=y
97CONFIG_CPU_MIPSR1=y 124CONFIG_CPU_MIPSR1=y
98CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y 125CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
99CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y 126CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
127CONFIG_HARDWARE_WATCHPOINTS=y
100 128
101# 129#
102# Kernel type 130# Kernel type
@@ -106,180 +134,235 @@ CONFIG_32BIT=y
106CONFIG_PAGE_SIZE_4KB=y 134CONFIG_PAGE_SIZE_4KB=y
107# CONFIG_PAGE_SIZE_8KB is not set 135# CONFIG_PAGE_SIZE_8KB is not set
108# CONFIG_PAGE_SIZE_16KB is not set 136# CONFIG_PAGE_SIZE_16KB is not set
137# CONFIG_PAGE_SIZE_32KB is not set
109# CONFIG_PAGE_SIZE_64KB is not set 138# CONFIG_PAGE_SIZE_64KB is not set
110CONFIG_CPU_HAS_PREFETCH=y 139CONFIG_CPU_HAS_PREFETCH=y
111CONFIG_MIPS_MT_DISABLED=y 140CONFIG_MIPS_MT_DISABLED=y
112# CONFIG_MIPS_MT_SMP is not set 141# CONFIG_MIPS_MT_SMP is not set
113# CONFIG_MIPS_MT_SMTC is not set 142# CONFIG_MIPS_MT_SMTC is not set
114# CONFIG_MIPS_VPE_LOADER is not set
115CONFIG_64BIT_PHYS_ADDR=y 143CONFIG_64BIT_PHYS_ADDR=y
144CONFIG_ARCH_PHYS_ADDR_T_64BIT=y
116CONFIG_CPU_HAS_SYNC=y 145CONFIG_CPU_HAS_SYNC=y
117CONFIG_GENERIC_HARDIRQS=y 146CONFIG_GENERIC_HARDIRQS=y
118CONFIG_GENERIC_IRQ_PROBE=y 147CONFIG_GENERIC_IRQ_PROBE=y
119CONFIG_CPU_SUPPORTS_HIGHMEM=y 148CONFIG_CPU_SUPPORTS_HIGHMEM=y
120CONFIG_ARCH_FLATMEM_ENABLE=y 149CONFIG_ARCH_FLATMEM_ENABLE=y
150CONFIG_ARCH_POPULATES_NODE_MAP=y
121CONFIG_SELECT_MEMORY_MODEL=y 151CONFIG_SELECT_MEMORY_MODEL=y
122CONFIG_FLATMEM_MANUAL=y 152CONFIG_FLATMEM_MANUAL=y
123# CONFIG_DISCONTIGMEM_MANUAL is not set 153# CONFIG_DISCONTIGMEM_MANUAL is not set
124# CONFIG_SPARSEMEM_MANUAL is not set 154# CONFIG_SPARSEMEM_MANUAL is not set
125CONFIG_FLATMEM=y 155CONFIG_FLATMEM=y
126CONFIG_FLAT_NODE_MEM_MAP=y 156CONFIG_FLAT_NODE_MEM_MAP=y
127# CONFIG_SPARSEMEM_STATIC is not set 157CONFIG_PAGEFLAGS_EXTENDED=y
128CONFIG_SPLIT_PTLOCK_CPUS=4 158CONFIG_SPLIT_PTLOCK_CPUS=4
129# CONFIG_RESOURCES_64BIT is not set 159CONFIG_PHYS_ADDR_T_64BIT=y
130CONFIG_ZONE_DMA_FLAG=1 160CONFIG_ZONE_DMA_FLAG=0
161CONFIG_VIRT_TO_BUS=y
162CONFIG_KSM=y
163CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
164CONFIG_TICK_ONESHOT=y
165CONFIG_NO_HZ=y
166CONFIG_HIGH_RES_TIMERS=y
167CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
131# CONFIG_HZ_48 is not set 168# CONFIG_HZ_48 is not set
132# CONFIG_HZ_100 is not set 169CONFIG_HZ_100=y
133# CONFIG_HZ_128 is not set 170# CONFIG_HZ_128 is not set
134# CONFIG_HZ_250 is not set 171# CONFIG_HZ_250 is not set
135# CONFIG_HZ_256 is not set 172# CONFIG_HZ_256 is not set
136CONFIG_HZ_1000=y 173# CONFIG_HZ_1000 is not set
137# CONFIG_HZ_1024 is not set 174# CONFIG_HZ_1024 is not set
138CONFIG_SYS_SUPPORTS_ARBIT_HZ=y 175CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
139CONFIG_HZ=1000 176CONFIG_HZ=100
140CONFIG_PREEMPT_NONE=y 177CONFIG_PREEMPT_NONE=y
141# CONFIG_PREEMPT_VOLUNTARY is not set 178# CONFIG_PREEMPT_VOLUNTARY is not set
142# CONFIG_PREEMPT is not set 179# CONFIG_PREEMPT is not set
143# CONFIG_KEXEC is not set 180# CONFIG_KEXEC is not set
181# CONFIG_SECCOMP is not set
144CONFIG_LOCKDEP_SUPPORT=y 182CONFIG_LOCKDEP_SUPPORT=y
145CONFIG_STACKTRACE_SUPPORT=y 183CONFIG_STACKTRACE_SUPPORT=y
146CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 184CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
185CONFIG_CONSTRUCTORS=y
147 186
148# 187#
149# Code maturity level options 188# General setup
150# 189#
151CONFIG_EXPERIMENTAL=y 190CONFIG_EXPERIMENTAL=y
152CONFIG_BROKEN_ON_SMP=y 191CONFIG_BROKEN_ON_SMP=y
153CONFIG_INIT_ENV_ARG_LIMIT=32 192CONFIG_INIT_ENV_ARG_LIMIT=32
154 193CONFIG_LOCALVERSION="-db1200"
155#
156# General setup
157#
158CONFIG_LOCALVERSION=""
159CONFIG_LOCALVERSION_AUTO=y 194CONFIG_LOCALVERSION_AUTO=y
195CONFIG_HAVE_KERNEL_GZIP=y
196CONFIG_HAVE_KERNEL_BZIP2=y
197CONFIG_HAVE_KERNEL_LZMA=y
198CONFIG_HAVE_KERNEL_LZO=y
199# CONFIG_KERNEL_GZIP is not set
200# CONFIG_KERNEL_BZIP2 is not set
201CONFIG_KERNEL_LZMA=y
202# CONFIG_KERNEL_LZO is not set
160CONFIG_SWAP=y 203CONFIG_SWAP=y
161CONFIG_SYSVIPC=y 204CONFIG_SYSVIPC=y
162# CONFIG_IPC_NS is not set
163CONFIG_SYSVIPC_SYSCTL=y 205CONFIG_SYSVIPC_SYSCTL=y
164# CONFIG_POSIX_MQUEUE is not set 206CONFIG_POSIX_MQUEUE=y
207CONFIG_POSIX_MQUEUE_SYSCTL=y
165# CONFIG_BSD_PROCESS_ACCT is not set 208# CONFIG_BSD_PROCESS_ACCT is not set
166# CONFIG_TASKSTATS is not set 209# CONFIG_TASKSTATS is not set
167# CONFIG_UTS_NS is not set
168# CONFIG_AUDIT is not set 210# CONFIG_AUDIT is not set
169CONFIG_IKCONFIG=y 211
170CONFIG_IKCONFIG_PROC=y 212#
171CONFIG_SYSFS_DEPRECATED=y 213# RCU Subsystem
214#
215# CONFIG_TREE_RCU is not set
216# CONFIG_TREE_PREEMPT_RCU is not set
217CONFIG_TINY_RCU=y
218# CONFIG_TREE_RCU_TRACE is not set
219# CONFIG_IKCONFIG is not set
220CONFIG_LOG_BUF_SHIFT=14
221# CONFIG_GROUP_SCHED is not set
222# CONFIG_CGROUPS is not set
223# CONFIG_SYSFS_DEPRECATED_V2 is not set
172# CONFIG_RELAY is not set 224# CONFIG_RELAY is not set
173# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 225# CONFIG_NAMESPACES is not set
226# CONFIG_BLK_DEV_INITRD is not set
227CONFIG_CC_OPTIMIZE_FOR_SIZE=y
174CONFIG_SYSCTL=y 228CONFIG_SYSCTL=y
229CONFIG_ANON_INODES=y
175CONFIG_EMBEDDED=y 230CONFIG_EMBEDDED=y
176CONFIG_SYSCTL_SYSCALL=y 231# CONFIG_SYSCTL_SYSCALL is not set
177CONFIG_KALLSYMS=y 232# CONFIG_KALLSYMS is not set
178# CONFIG_KALLSYMS_EXTRA_PASS is not set
179CONFIG_HOTPLUG=y 233CONFIG_HOTPLUG=y
180CONFIG_PRINTK=y 234CONFIG_PRINTK=y
181CONFIG_BUG=y 235CONFIG_BUG=y
182CONFIG_ELF_CORE=y 236CONFIG_ELF_CORE=y
237# CONFIG_PCSPKR_PLATFORM is not set
183CONFIG_BASE_FULL=y 238CONFIG_BASE_FULL=y
184CONFIG_FUTEX=y 239CONFIG_FUTEX=y
185CONFIG_EPOLL=y 240CONFIG_EPOLL=y
241CONFIG_SIGNALFD=y
242CONFIG_TIMERFD=y
243CONFIG_EVENTFD=y
186CONFIG_SHMEM=y 244CONFIG_SHMEM=y
245CONFIG_AIO=y
246
247#
248# Kernel Performance Events And Counters
249#
250# CONFIG_VM_EVENT_COUNTERS is not set
251# CONFIG_COMPAT_BRK is not set
187CONFIG_SLAB=y 252CONFIG_SLAB=y
188CONFIG_VM_EVENT_COUNTERS=y 253# CONFIG_SLUB is not set
189CONFIG_RT_MUTEXES=y
190# CONFIG_TINY_SHMEM is not set
191CONFIG_BASE_SMALL=0
192# CONFIG_SLOB is not set 254# CONFIG_SLOB is not set
255# CONFIG_PROFILING is not set
256CONFIG_HAVE_OPROFILE=y
193 257
194# 258#
195# Loadable module support 259# GCOV-based kernel profiling
196# 260#
261# CONFIG_SLOW_WORK is not set
262CONFIG_HAVE_GENERIC_DMA_COHERENT=y
263CONFIG_SLABINFO=y
264CONFIG_RT_MUTEXES=y
265CONFIG_BASE_SMALL=0
197CONFIG_MODULES=y 266CONFIG_MODULES=y
267# CONFIG_MODULE_FORCE_LOAD is not set
198CONFIG_MODULE_UNLOAD=y 268CONFIG_MODULE_UNLOAD=y
199# CONFIG_MODULE_FORCE_UNLOAD is not set 269# CONFIG_MODULE_FORCE_UNLOAD is not set
200CONFIG_MODVERSIONS=y 270# CONFIG_MODVERSIONS is not set
201CONFIG_MODULE_SRCVERSION_ALL=y 271# CONFIG_MODULE_SRCVERSION_ALL is not set
202CONFIG_KMOD=y
203
204#
205# Block layer
206#
207CONFIG_BLOCK=y 272CONFIG_BLOCK=y
208# CONFIG_LBD is not set 273# CONFIG_LBDAF is not set
209# CONFIG_BLK_DEV_IO_TRACE is not set 274# CONFIG_BLK_DEV_BSG is not set
210# CONFIG_LSF is not set 275# CONFIG_BLK_DEV_INTEGRITY is not set
211 276
212# 277#
213# IO Schedulers 278# IO Schedulers
214# 279#
215CONFIG_IOSCHED_NOOP=y 280CONFIG_IOSCHED_NOOP=y
216CONFIG_IOSCHED_AS=y 281# CONFIG_IOSCHED_DEADLINE is not set
217CONFIG_IOSCHED_DEADLINE=y 282# CONFIG_IOSCHED_CFQ is not set
218CONFIG_IOSCHED_CFQ=y
219CONFIG_DEFAULT_AS=y
220# CONFIG_DEFAULT_DEADLINE is not set 283# CONFIG_DEFAULT_DEADLINE is not set
221# CONFIG_DEFAULT_CFQ is not set 284# CONFIG_DEFAULT_CFQ is not set
222# CONFIG_DEFAULT_NOOP is not set 285CONFIG_DEFAULT_NOOP=y
223CONFIG_DEFAULT_IOSCHED="anticipatory" 286CONFIG_DEFAULT_IOSCHED="noop"
287# CONFIG_INLINE_SPIN_TRYLOCK is not set
288# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set
289# CONFIG_INLINE_SPIN_LOCK is not set
290# CONFIG_INLINE_SPIN_LOCK_BH is not set
291# CONFIG_INLINE_SPIN_LOCK_IRQ is not set
292# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set
293CONFIG_INLINE_SPIN_UNLOCK=y
294# CONFIG_INLINE_SPIN_UNLOCK_BH is not set
295CONFIG_INLINE_SPIN_UNLOCK_IRQ=y
296# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set
297# CONFIG_INLINE_READ_TRYLOCK is not set
298# CONFIG_INLINE_READ_LOCK is not set
299# CONFIG_INLINE_READ_LOCK_BH is not set
300# CONFIG_INLINE_READ_LOCK_IRQ is not set
301# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set
302CONFIG_INLINE_READ_UNLOCK=y
303# CONFIG_INLINE_READ_UNLOCK_BH is not set
304CONFIG_INLINE_READ_UNLOCK_IRQ=y
305# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set
306# CONFIG_INLINE_WRITE_TRYLOCK is not set
307# CONFIG_INLINE_WRITE_LOCK is not set
308# CONFIG_INLINE_WRITE_LOCK_BH is not set
309# CONFIG_INLINE_WRITE_LOCK_IRQ is not set
310# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set
311CONFIG_INLINE_WRITE_UNLOCK=y
312# CONFIG_INLINE_WRITE_UNLOCK_BH is not set
313CONFIG_INLINE_WRITE_UNLOCK_IRQ=y
314# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set
315# CONFIG_MUTEX_SPIN_ON_OWNER is not set
316# CONFIG_FREEZER is not set
224 317
225# 318#
226# Bus options (PCI, PCMCIA, EISA, ISA, TC) 319# Bus options (PCI, PCMCIA, EISA, ISA, TC)
227# 320#
321# CONFIG_ARCH_SUPPORTS_MSI is not set
228CONFIG_MMU=y 322CONFIG_MMU=y
229 323CONFIG_PCCARD=y
230# 324CONFIG_PCMCIA=y
231# PCCARD (PCMCIA/CardBus) support
232#
233CONFIG_PCCARD=m
234# CONFIG_PCMCIA_DEBUG is not set
235CONFIG_PCMCIA=m
236CONFIG_PCMCIA_LOAD_CIS=y 325CONFIG_PCMCIA_LOAD_CIS=y
237CONFIG_PCMCIA_IOCTL=y 326# CONFIG_PCMCIA_IOCTL is not set
238 327
239# 328#
240# PC-card bridges 329# PC-card bridges
241# 330#
242CONFIG_PCMCIA_AU1X00=m 331# CONFIG_PCMCIA_AU1X00 is not set
243 332CONFIG_PCMCIA_ALCHEMY_DEVBOARD=y
244#
245# PCI Hotplug Support
246#
247 333
248# 334#
249# Executable file formats 335# Executable file formats
250# 336#
251CONFIG_BINFMT_ELF=y 337CONFIG_BINFMT_ELF=y
252# CONFIG_BINFMT_MISC is not set 338CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
339# CONFIG_HAVE_AOUT is not set
340CONFIG_BINFMT_MISC=y
253CONFIG_TRAD_SIGNALS=y 341CONFIG_TRAD_SIGNALS=y
254 342
255# 343#
256# Power management options 344# Power management options
257# 345#
346CONFIG_ARCH_HIBERNATION_POSSIBLE=y
347CONFIG_ARCH_SUSPEND_POSSIBLE=y
258# CONFIG_PM is not set 348# CONFIG_PM is not set
259
260#
261# Networking
262#
263CONFIG_NET=y 349CONFIG_NET=y
264 350
265# 351#
266# Networking options 352# Networking options
267# 353#
268# CONFIG_NETDEBUG is not set
269CONFIG_PACKET=y 354CONFIG_PACKET=y
270# CONFIG_PACKET_MMAP is not set 355CONFIG_PACKET_MMAP=y
271CONFIG_UNIX=y 356CONFIG_UNIX=y
272CONFIG_XFRM=y 357# CONFIG_NET_KEY is not set
273CONFIG_XFRM_USER=m
274# CONFIG_XFRM_SUB_POLICY is not set
275CONFIG_XFRM_MIGRATE=y
276CONFIG_NET_KEY=y
277CONFIG_NET_KEY_MIGRATE=y
278CONFIG_INET=y 358CONFIG_INET=y
279CONFIG_IP_MULTICAST=y 359CONFIG_IP_MULTICAST=y
280# CONFIG_IP_ADVANCED_ROUTER is not set 360# CONFIG_IP_ADVANCED_ROUTER is not set
281CONFIG_IP_FIB_HASH=y 361CONFIG_IP_FIB_HASH=y
282# CONFIG_IP_PNP is not set 362CONFIG_IP_PNP=y
363# CONFIG_IP_PNP_DHCP is not set
364# CONFIG_IP_PNP_BOOTP is not set
365# CONFIG_IP_PNP_RARP is not set
283# CONFIG_NET_IPIP is not set 366# CONFIG_NET_IPIP is not set
284# CONFIG_NET_IPGRE is not set 367# CONFIG_NET_IPGRE is not set
285# CONFIG_IP_MROUTE is not set 368# CONFIG_IP_MROUTE is not set
@@ -290,107 +373,25 @@ CONFIG_IP_FIB_HASH=y
290# CONFIG_INET_IPCOMP is not set 373# CONFIG_INET_IPCOMP is not set
291# CONFIG_INET_XFRM_TUNNEL is not set 374# CONFIG_INET_XFRM_TUNNEL is not set
292# CONFIG_INET_TUNNEL is not set 375# CONFIG_INET_TUNNEL is not set
293CONFIG_INET_XFRM_MODE_TRANSPORT=m 376# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
294CONFIG_INET_XFRM_MODE_TUNNEL=m 377# CONFIG_INET_XFRM_MODE_TUNNEL is not set
295CONFIG_INET_XFRM_MODE_BEET=m 378# CONFIG_INET_XFRM_MODE_BEET is not set
296CONFIG_INET_DIAG=y 379CONFIG_INET_LRO=y
297CONFIG_INET_TCP_DIAG=y 380# CONFIG_INET_DIAG is not set
298# CONFIG_TCP_CONG_ADVANCED is not set 381# CONFIG_TCP_CONG_ADVANCED is not set
299CONFIG_TCP_CONG_CUBIC=y 382CONFIG_TCP_CONG_CUBIC=y
300CONFIG_DEFAULT_TCP_CONG="cubic" 383CONFIG_DEFAULT_TCP_CONG="cubic"
301CONFIG_TCP_MD5SIG=y 384# CONFIG_TCP_MD5SIG is not set
302
303#
304# IP: Virtual Server Configuration
305#
306# CONFIG_IP_VS is not set
307# CONFIG_IPV6 is not set 385# CONFIG_IPV6 is not set
308# CONFIG_INET6_XFRM_TUNNEL is not set 386# CONFIG_NETWORK_SECMARK is not set
309# CONFIG_INET6_TUNNEL is not set 387# CONFIG_NETFILTER is not set
310CONFIG_NETWORK_SECMARK=y
311CONFIG_NETFILTER=y
312# CONFIG_NETFILTER_DEBUG is not set
313
314#
315# Core Netfilter Configuration
316#
317# CONFIG_NETFILTER_NETLINK is not set
318CONFIG_NF_CONNTRACK_ENABLED=m
319CONFIG_NF_CONNTRACK_SUPPORT=y
320# CONFIG_IP_NF_CONNTRACK_SUPPORT is not set
321CONFIG_NF_CONNTRACK=m
322CONFIG_NF_CT_ACCT=y
323CONFIG_NF_CONNTRACK_MARK=y
324CONFIG_NF_CONNTRACK_SECMARK=y
325CONFIG_NF_CONNTRACK_EVENTS=y
326CONFIG_NF_CT_PROTO_GRE=m
327CONFIG_NF_CT_PROTO_SCTP=m
328CONFIG_NF_CONNTRACK_AMANDA=m
329CONFIG_NF_CONNTRACK_FTP=m
330CONFIG_NF_CONNTRACK_H323=m
331CONFIG_NF_CONNTRACK_IRC=m
332# CONFIG_NF_CONNTRACK_NETBIOS_NS is not set
333CONFIG_NF_CONNTRACK_PPTP=m
334CONFIG_NF_CONNTRACK_SANE=m
335CONFIG_NF_CONNTRACK_SIP=m
336CONFIG_NF_CONNTRACK_TFTP=m
337CONFIG_NETFILTER_XTABLES=m
338CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
339CONFIG_NETFILTER_XT_TARGET_MARK=m
340CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
341CONFIG_NETFILTER_XT_TARGET_NFLOG=m
342CONFIG_NETFILTER_XT_TARGET_SECMARK=m
343CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=m
344CONFIG_NETFILTER_XT_TARGET_TCPMSS=m
345CONFIG_NETFILTER_XT_MATCH_COMMENT=m
346CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
347CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
348CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
349CONFIG_NETFILTER_XT_MATCH_DCCP=m
350CONFIG_NETFILTER_XT_MATCH_DSCP=m
351CONFIG_NETFILTER_XT_MATCH_ESP=m
352CONFIG_NETFILTER_XT_MATCH_HELPER=m
353CONFIG_NETFILTER_XT_MATCH_LENGTH=m
354CONFIG_NETFILTER_XT_MATCH_LIMIT=m
355CONFIG_NETFILTER_XT_MATCH_MAC=m
356CONFIG_NETFILTER_XT_MATCH_MARK=m
357CONFIG_NETFILTER_XT_MATCH_POLICY=m
358CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
359CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
360CONFIG_NETFILTER_XT_MATCH_QUOTA=m
361CONFIG_NETFILTER_XT_MATCH_REALM=m
362CONFIG_NETFILTER_XT_MATCH_SCTP=m
363CONFIG_NETFILTER_XT_MATCH_STATE=m
364CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
365CONFIG_NETFILTER_XT_MATCH_STRING=m
366CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
367CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
368
369#
370# IP: Netfilter Configuration
371#
372CONFIG_NF_CONNTRACK_IPV4=m
373CONFIG_NF_CONNTRACK_PROC_COMPAT=y
374# CONFIG_IP_NF_QUEUE is not set
375# CONFIG_IP_NF_IPTABLES is not set
376# CONFIG_IP_NF_ARPTABLES is not set
377
378#
379# DCCP Configuration (EXPERIMENTAL)
380#
381# CONFIG_IP_DCCP is not set 388# CONFIG_IP_DCCP is not set
382
383#
384# SCTP Configuration (EXPERIMENTAL)
385#
386# CONFIG_IP_SCTP is not set 389# CONFIG_IP_SCTP is not set
387 390# CONFIG_RDS is not set
388#
389# TIPC Configuration (EXPERIMENTAL)
390#
391# CONFIG_TIPC is not set 391# CONFIG_TIPC is not set
392# CONFIG_ATM is not set 392# CONFIG_ATM is not set
393# CONFIG_BRIDGE is not set 393# CONFIG_BRIDGE is not set
394# CONFIG_NET_DSA is not set
394# CONFIG_VLAN_8021Q is not set 395# CONFIG_VLAN_8021Q is not set
395# CONFIG_DECNET is not set 396# CONFIG_DECNET is not set
396# CONFIG_LLC2 is not set 397# CONFIG_LLC2 is not set
@@ -400,21 +401,24 @@ CONFIG_NF_CONNTRACK_PROC_COMPAT=y
400# CONFIG_LAPB is not set 401# CONFIG_LAPB is not set
401# CONFIG_ECONET is not set 402# CONFIG_ECONET is not set
402# CONFIG_WAN_ROUTER is not set 403# CONFIG_WAN_ROUTER is not set
403 404# CONFIG_PHONET is not set
404# 405# CONFIG_IEEE802154 is not set
405# QoS and/or fair queueing
406#
407# CONFIG_NET_SCHED is not set 406# CONFIG_NET_SCHED is not set
408CONFIG_NET_CLS_ROUTE=y 407# CONFIG_DCB is not set
409 408
410# 409#
411# Network testing 410# Network testing
412# 411#
413# CONFIG_NET_PKTGEN is not set 412# CONFIG_NET_PKTGEN is not set
414# CONFIG_HAMRADIO is not set 413# CONFIG_HAMRADIO is not set
414# CONFIG_CAN is not set
415# CONFIG_IRDA is not set 415# CONFIG_IRDA is not set
416# CONFIG_BT is not set 416# CONFIG_BT is not set
417# CONFIG_IEEE80211 is not set 417# CONFIG_AF_RXRPC is not set
418# CONFIG_WIRELESS is not set
419# CONFIG_WIMAX is not set
420# CONFIG_RFKILL is not set
421# CONFIG_NET_9P is not set
418 422
419# 423#
420# Device Drivers 424# Device Drivers
@@ -423,25 +427,25 @@ CONFIG_NET_CLS_ROUTE=y
423# 427#
424# Generic Driver Options 428# Generic Driver Options
425# 429#
430CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
431# CONFIG_DEVTMPFS is not set
426CONFIG_STANDALONE=y 432CONFIG_STANDALONE=y
427CONFIG_PREVENT_FIRMWARE_BUILD=y 433CONFIG_PREVENT_FIRMWARE_BUILD=y
428CONFIG_FW_LOADER=y 434CONFIG_FW_LOADER=y
435CONFIG_FIRMWARE_IN_KERNEL=y
436CONFIG_EXTRA_FIRMWARE=""
437# CONFIG_DEBUG_DRIVER is not set
438# CONFIG_DEBUG_DEVRES is not set
429# CONFIG_SYS_HYPERVISOR is not set 439# CONFIG_SYS_HYPERVISOR is not set
430
431#
432# Connector - unified userspace <-> kernelspace linker
433#
434# CONFIG_CONNECTOR is not set 440# CONFIG_CONNECTOR is not set
435
436#
437# Memory Technology Devices (MTD)
438#
439CONFIG_MTD=y 441CONFIG_MTD=y
440# CONFIG_MTD_DEBUG is not set 442# CONFIG_MTD_DEBUG is not set
443# CONFIG_MTD_TESTS is not set
441# CONFIG_MTD_CONCAT is not set 444# CONFIG_MTD_CONCAT is not set
442CONFIG_MTD_PARTITIONS=y 445CONFIG_MTD_PARTITIONS=y
443# CONFIG_MTD_REDBOOT_PARTS is not set 446# CONFIG_MTD_REDBOOT_PARTS is not set
444# CONFIG_MTD_CMDLINE_PARTS is not set 447CONFIG_MTD_CMDLINE_PARTS=y
448# CONFIG_MTD_AR7_PARTS is not set
445 449
446# 450#
447# User Modules And Translation Layers 451# User Modules And Translation Layers
@@ -454,6 +458,7 @@ CONFIG_MTD_BLOCK=y
454# CONFIG_INFTL is not set 458# CONFIG_INFTL is not set
455# CONFIG_RFD_FTL is not set 459# CONFIG_RFD_FTL is not set
456# CONFIG_SSFDC is not set 460# CONFIG_SSFDC is not set
461# CONFIG_MTD_OOPS is not set
457 462
458# 463#
459# RAM/ROM/Flash chip drivers 464# RAM/ROM/Flash chip drivers
@@ -479,19 +484,21 @@ CONFIG_MTD_CFI_UTIL=y
479# CONFIG_MTD_RAM is not set 484# CONFIG_MTD_RAM is not set
480# CONFIG_MTD_ROM is not set 485# CONFIG_MTD_ROM is not set
481# CONFIG_MTD_ABSENT is not set 486# CONFIG_MTD_ABSENT is not set
482# CONFIG_MTD_OBSOLETE_CHIPS is not set
483 487
484# 488#
485# Mapping drivers for chip access 489# Mapping drivers for chip access
486# 490#
487# CONFIG_MTD_COMPLEX_MAPPINGS is not set 491# CONFIG_MTD_COMPLEX_MAPPINGS is not set
488# CONFIG_MTD_PHYSMAP is not set 492CONFIG_MTD_PHYSMAP=y
489CONFIG_MTD_ALCHEMY=y 493# CONFIG_MTD_PHYSMAP_COMPAT is not set
490# CONFIG_MTD_PLATRAM is not set 494# CONFIG_MTD_PLATRAM is not set
491 495
492# 496#
493# Self-contained MTD device drivers 497# Self-contained MTD device drivers
494# 498#
499# CONFIG_MTD_DATAFLASH is not set
500# CONFIG_MTD_M25P80 is not set
501# CONFIG_MTD_SST25L is not set
495# CONFIG_MTD_SLRAM is not set 502# CONFIG_MTD_SLRAM is not set
496# CONFIG_MTD_PHRAM is not set 503# CONFIG_MTD_PHRAM is not set
497# CONFIG_MTD_MTDRAM is not set 504# CONFIG_MTD_MTDRAM is not set
@@ -503,224 +510,134 @@ CONFIG_MTD_ALCHEMY=y
503# CONFIG_MTD_DOC2000 is not set 510# CONFIG_MTD_DOC2000 is not set
504# CONFIG_MTD_DOC2001 is not set 511# CONFIG_MTD_DOC2001 is not set
505# CONFIG_MTD_DOC2001PLUS is not set 512# CONFIG_MTD_DOC2001PLUS is not set
506
507#
508# NAND Flash Device Drivers
509#
510CONFIG_MTD_NAND=y 513CONFIG_MTD_NAND=y
511# CONFIG_MTD_NAND_VERIFY_WRITE is not set 514# CONFIG_MTD_NAND_VERIFY_WRITE is not set
512# CONFIG_MTD_NAND_ECC_SMC is not set 515# CONFIG_MTD_NAND_ECC_SMC is not set
516# CONFIG_MTD_NAND_MUSEUM_IDS is not set
513CONFIG_MTD_NAND_IDS=y 517CONFIG_MTD_NAND_IDS=y
514# CONFIG_MTD_NAND_AU1550 is not set 518# CONFIG_MTD_NAND_AU1550 is not set
515# CONFIG_MTD_NAND_DISKONCHIP is not set 519# CONFIG_MTD_NAND_DISKONCHIP is not set
516# CONFIG_MTD_NAND_NANDSIM is not set 520# CONFIG_MTD_NAND_NANDSIM is not set
517 521CONFIG_MTD_NAND_PLATFORM=y
518# 522# CONFIG_MTD_ALAUDA is not set
519# OneNAND Flash Device Drivers
520#
521# CONFIG_MTD_ONENAND is not set 523# CONFIG_MTD_ONENAND is not set
522 524
523# 525#
524# Parallel port support 526# LPDDR flash memory drivers
525# 527#
526# CONFIG_PARPORT is not set 528# CONFIG_MTD_LPDDR is not set
527 529
528# 530#
529# Plug and Play support 531# UBI - Unsorted block images
530#
531# CONFIG_PNPACPI is not set
532
533#
534# Block devices
535# 532#
533# CONFIG_MTD_UBI is not set
534# CONFIG_PARPORT is not set
535CONFIG_BLK_DEV=y
536# CONFIG_BLK_DEV_COW_COMMON is not set 536# CONFIG_BLK_DEV_COW_COMMON is not set
537CONFIG_BLK_DEV_LOOP=y 537CONFIG_BLK_DEV_LOOP=y
538# CONFIG_BLK_DEV_CRYPTOLOOP is not set 538# CONFIG_BLK_DEV_CRYPTOLOOP is not set
539# CONFIG_BLK_DEV_NBD is not set
540CONFIG_BLK_DEV_RAM=y
541CONFIG_BLK_DEV_RAM_COUNT=16
542CONFIG_BLK_DEV_RAM_SIZE=4096
543CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
544# CONFIG_BLK_DEV_INITRD is not set
545# CONFIG_CDROM_PKTCDVD is not set
546# CONFIG_ATA_OVER_ETH is not set
547 539
548# 540#
549# Misc devices 541# DRBD disabled because PROC_FS, INET or CONNECTOR not selected
550#
551
552#
553# ATA/ATAPI/MFM/RLL support
554# 542#
543# CONFIG_BLK_DEV_NBD is not set
544CONFIG_BLK_DEV_UB=y
545# CONFIG_BLK_DEV_RAM is not set
546# CONFIG_CDROM_PKTCDVD is not set
547# CONFIG_ATA_OVER_ETH is not set
548# CONFIG_BLK_DEV_HD is not set
549# CONFIG_MISC_DEVICES is not set
550CONFIG_HAVE_IDE=y
555CONFIG_IDE=y 551CONFIG_IDE=y
556CONFIG_IDE_MAX_HWIFS=4
557CONFIG_BLK_DEV_IDE=y
558 552
559# 553#
560# Please see Documentation/ide.txt for help/info on IDE drives 554# Please see Documentation/ide/ide.txt for help/info on IDE drives
561# 555#
556CONFIG_IDE_XFER_MODE=y
557CONFIG_IDE_ATAPI=y
562# CONFIG_BLK_DEV_IDE_SATA is not set 558# CONFIG_BLK_DEV_IDE_SATA is not set
563CONFIG_BLK_DEV_IDEDISK=y 559CONFIG_IDE_GD=y
564CONFIG_IDEDISK_MULTI_MODE=y 560CONFIG_IDE_GD_ATA=y
565CONFIG_BLK_DEV_IDECS=m 561# CONFIG_IDE_GD_ATAPI is not set
566# CONFIG_BLK_DEV_IDECD is not set 562CONFIG_BLK_DEV_IDECS=y
563CONFIG_BLK_DEV_IDECD=y
564CONFIG_BLK_DEV_IDECD_VERBOSE_ERRORS=y
567# CONFIG_BLK_DEV_IDETAPE is not set 565# CONFIG_BLK_DEV_IDETAPE is not set
568# CONFIG_BLK_DEV_IDEFLOPPY is not set 566CONFIG_IDE_TASK_IOCTL=y
569# CONFIG_BLK_DEV_IDESCSI is not set 567# CONFIG_IDE_PROC_FS is not set
570# CONFIG_IDE_TASK_IOCTL is not set
571 568
572# 569#
573# IDE chipset support/bugfixes 570# IDE chipset support/bugfixes
574# 571#
575CONFIG_IDE_GENERIC=y 572# CONFIG_IDE_GENERIC is not set
573# CONFIG_BLK_DEV_PLATFORM is not set
576CONFIG_BLK_DEV_IDE_AU1XXX=y 574CONFIG_BLK_DEV_IDE_AU1XXX=y
577CONFIG_BLK_DEV_IDE_AU1XXX_PIO_DBDMA=y 575CONFIG_BLK_DEV_IDE_AU1XXX_PIO_DBDMA=y
578# CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA is not set 576# CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA is not set
579CONFIG_BLK_DEV_IDE_AU1XXX_SEQTS_PER_RQ=128
580# CONFIG_IDE_ARM is not set
581# CONFIG_BLK_DEV_IDEDMA is not set 577# CONFIG_BLK_DEV_IDEDMA is not set
582# CONFIG_IDEDMA_AUTO is not set
583# CONFIG_BLK_DEV_HD is not set
584 578
585# 579#
586# SCSI device support 580# SCSI device support
587# 581#
588# CONFIG_RAID_ATTRS is not set 582# CONFIG_RAID_ATTRS is not set
589CONFIG_SCSI=y 583# CONFIG_SCSI is not set
590CONFIG_SCSI_TGT=m 584# CONFIG_SCSI_DMA is not set
591# CONFIG_SCSI_NETLINK is not set 585# CONFIG_SCSI_NETLINK is not set
592CONFIG_SCSI_PROC_FS=y
593
594#
595# SCSI support type (disk, tape, CD-ROM)
596#
597CONFIG_BLK_DEV_SD=y
598# CONFIG_CHR_DEV_ST is not set
599# CONFIG_CHR_DEV_OSST is not set
600CONFIG_BLK_DEV_SR=y
601# CONFIG_BLK_DEV_SR_VENDOR is not set
602CONFIG_CHR_DEV_SG=y
603# CONFIG_CHR_DEV_SCH is not set
604
605#
606# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
607#
608CONFIG_SCSI_MULTI_LUN=y
609# CONFIG_SCSI_CONSTANTS is not set
610# CONFIG_SCSI_LOGGING is not set
611CONFIG_SCSI_SCAN_ASYNC=y
612
613#
614# SCSI Transports
615#
616# CONFIG_SCSI_SPI_ATTRS is not set
617# CONFIG_SCSI_FC_ATTRS is not set
618# CONFIG_SCSI_ISCSI_ATTRS is not set
619# CONFIG_SCSI_SAS_ATTRS is not set
620# CONFIG_SCSI_SAS_LIBSAS is not set
621
622#
623# SCSI low-level drivers
624#
625# CONFIG_ISCSI_TCP is not set
626# CONFIG_SCSI_DEBUG is not set
627
628#
629# PCMCIA SCSI adapter support
630#
631# CONFIG_PCMCIA_AHA152X is not set
632# CONFIG_PCMCIA_FDOMAIN is not set
633# CONFIG_PCMCIA_NINJA_SCSI is not set
634# CONFIG_PCMCIA_QLOGIC is not set
635# CONFIG_PCMCIA_SYM53C500 is not set
636
637#
638# Serial ATA (prod) and Parallel ATA (experimental) drivers
639#
640# CONFIG_ATA is not set 586# CONFIG_ATA is not set
641
642#
643# Multi-device support (RAID and LVM)
644#
645# CONFIG_MD is not set 587# CONFIG_MD is not set
646
647#
648# Fusion MPT device support
649#
650# CONFIG_FUSION is not set
651
652#
653# IEEE 1394 (FireWire) support
654#
655
656#
657# I2O device support
658#
659
660#
661# Network device support
662#
663CONFIG_NETDEVICES=y 588CONFIG_NETDEVICES=y
664# CONFIG_DUMMY is not set 589# CONFIG_DUMMY is not set
665# CONFIG_BONDING is not set 590# CONFIG_BONDING is not set
591# CONFIG_MACVLAN is not set
666# CONFIG_EQUALIZER is not set 592# CONFIG_EQUALIZER is not set
667# CONFIG_TUN is not set 593# CONFIG_TUN is not set
668 594# CONFIG_VETH is not set
669#
670# PHY device support
671#
672# CONFIG_PHYLIB is not set 595# CONFIG_PHYLIB is not set
673
674#
675# Ethernet (10 or 100Mbit)
676#
677CONFIG_NET_ETHERNET=y 596CONFIG_NET_ETHERNET=y
678CONFIG_MII=m 597CONFIG_MII=y
598# CONFIG_AX88796 is not set
679# CONFIG_MIPS_AU1X00_ENET is not set 599# CONFIG_MIPS_AU1X00_ENET is not set
680# CONFIG_SMC91X is not set 600CONFIG_SMC91X=y
681# CONFIG_DM9000 is not set 601# CONFIG_DM9000 is not set
682 602# CONFIG_ENC28J60 is not set
683# 603# CONFIG_ETHOC is not set
684# Ethernet (1000 Mbit) 604# CONFIG_SMSC911X is not set
685# 605# CONFIG_DNET is not set
686 606# CONFIG_IBM_NEW_EMAC_ZMII is not set
687# 607# CONFIG_IBM_NEW_EMAC_RGMII is not set
688# Ethernet (10000 Mbit) 608# CONFIG_IBM_NEW_EMAC_TAH is not set
689# 609# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
690 610# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
691# 611# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
692# Token Ring devices 612# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
693# 613# CONFIG_B44 is not set
694 614# CONFIG_KS8842 is not set
695# 615# CONFIG_KS8851 is not set
696# Wireless LAN (non-hamradio) 616# CONFIG_KS8851_MLL is not set
697# 617# CONFIG_NETDEV_1000 is not set
698# CONFIG_NET_RADIO is not set 618# CONFIG_NETDEV_10000 is not set
699 619# CONFIG_WLAN is not set
700# 620
701# PCMCIA network device support 621#
702# 622# Enable WiMAX (Networking options) to see the WiMAX drivers
623#
624
625#
626# USB Network Adapters
627#
628# CONFIG_USB_CATC is not set
629# CONFIG_USB_KAWETH is not set
630# CONFIG_USB_PEGASUS is not set
631# CONFIG_USB_RTL8150 is not set
632# CONFIG_USB_USBNET is not set
703# CONFIG_NET_PCMCIA is not set 633# CONFIG_NET_PCMCIA is not set
704
705#
706# Wan interfaces
707#
708# CONFIG_WAN is not set 634# CONFIG_WAN is not set
709# CONFIG_PPP is not set 635# CONFIG_PPP is not set
710# CONFIG_SLIP is not set 636# CONFIG_SLIP is not set
711# CONFIG_SHAPER is not set
712# CONFIG_NETCONSOLE is not set 637# CONFIG_NETCONSOLE is not set
713# CONFIG_NETPOLL is not set 638# CONFIG_NETPOLL is not set
714# CONFIG_NET_POLL_CONTROLLER is not set 639# CONFIG_NET_POLL_CONTROLLER is not set
715
716#
717# ISDN subsystem
718#
719# CONFIG_ISDN is not set 640# CONFIG_ISDN is not set
720
721#
722# Telephony Support
723#
724# CONFIG_PHONE is not set 641# CONFIG_PHONE is not set
725 642
726# 643#
@@ -728,16 +645,14 @@ CONFIG_MII=m
728# 645#
729CONFIG_INPUT=y 646CONFIG_INPUT=y
730# CONFIG_INPUT_FF_MEMLESS is not set 647# CONFIG_INPUT_FF_MEMLESS is not set
648# CONFIG_INPUT_POLLDEV is not set
649# CONFIG_INPUT_SPARSEKMAP is not set
731 650
732# 651#
733# Userland interfaces 652# Userland interfaces
734# 653#
735CONFIG_INPUT_MOUSEDEV=y 654# CONFIG_INPUT_MOUSEDEV is not set
736CONFIG_INPUT_MOUSEDEV_PSAUX=y
737CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
738CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
739# CONFIG_INPUT_JOYDEV is not set 655# CONFIG_INPUT_JOYDEV is not set
740# CONFIG_INPUT_TSDEV is not set
741CONFIG_INPUT_EVDEV=y 656CONFIG_INPUT_EVDEV=y
742# CONFIG_INPUT_EVBUG is not set 657# CONFIG_INPUT_EVBUG is not set
743 658
@@ -747,28 +662,26 @@ CONFIG_INPUT_EVDEV=y
747# CONFIG_INPUT_KEYBOARD is not set 662# CONFIG_INPUT_KEYBOARD is not set
748# CONFIG_INPUT_MOUSE is not set 663# CONFIG_INPUT_MOUSE is not set
749# CONFIG_INPUT_JOYSTICK is not set 664# CONFIG_INPUT_JOYSTICK is not set
665# CONFIG_INPUT_TABLET is not set
750# CONFIG_INPUT_TOUCHSCREEN is not set 666# CONFIG_INPUT_TOUCHSCREEN is not set
751# CONFIG_INPUT_MISC is not set 667# CONFIG_INPUT_MISC is not set
752 668
753# 669#
754# Hardware I/O ports 670# Hardware I/O ports
755# 671#
756CONFIG_SERIO=y 672# CONFIG_SERIO is not set
757# CONFIG_SERIO_I8042 is not set
758CONFIG_SERIO_SERPORT=y
759# CONFIG_SERIO_LIBPS2 is not set
760CONFIG_SERIO_RAW=y
761# CONFIG_GAMEPORT is not set 673# CONFIG_GAMEPORT is not set
762 674
763# 675#
764# Character devices 676# Character devices
765# 677#
766CONFIG_VT=y 678CONFIG_VT=y
679CONFIG_CONSOLE_TRANSLATIONS=y
767CONFIG_VT_CONSOLE=y 680CONFIG_VT_CONSOLE=y
768CONFIG_HW_CONSOLE=y 681CONFIG_HW_CONSOLE=y
769CONFIG_VT_HW_CONSOLE_BINDING=y 682CONFIG_VT_HW_CONSOLE_BINDING=y
683CONFIG_DEVKMEM=y
770# CONFIG_SERIAL_NONSTANDARD is not set 684# CONFIG_SERIAL_NONSTANDARD is not set
771# CONFIG_AU1X00_GPIO is not set
772 685
773# 686#
774# Serial drivers 687# Serial drivers
@@ -776,33 +689,22 @@ CONFIG_VT_HW_CONSOLE_BINDING=y
776CONFIG_SERIAL_8250=y 689CONFIG_SERIAL_8250=y
777CONFIG_SERIAL_8250_CONSOLE=y 690CONFIG_SERIAL_8250_CONSOLE=y
778# CONFIG_SERIAL_8250_CS is not set 691# CONFIG_SERIAL_8250_CS is not set
779CONFIG_SERIAL_8250_NR_UARTS=4 692CONFIG_SERIAL_8250_NR_UARTS=2
780CONFIG_SERIAL_8250_RUNTIME_UARTS=4 693CONFIG_SERIAL_8250_RUNTIME_UARTS=2
781# CONFIG_SERIAL_8250_EXTENDED is not set 694# CONFIG_SERIAL_8250_EXTENDED is not set
782CONFIG_SERIAL_8250_AU1X00=y 695CONFIG_SERIAL_8250_AU1X00=y
783 696
784# 697#
785# Non-8250 serial port support 698# Non-8250 serial port support
786# 699#
700# CONFIG_SERIAL_MAX3100 is not set
787CONFIG_SERIAL_CORE=y 701CONFIG_SERIAL_CORE=y
788CONFIG_SERIAL_CORE_CONSOLE=y 702CONFIG_SERIAL_CORE_CONSOLE=y
789CONFIG_UNIX98_PTYS=y 703CONFIG_UNIX98_PTYS=y
790CONFIG_LEGACY_PTYS=y 704# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
791CONFIG_LEGACY_PTY_COUNT=256 705# CONFIG_LEGACY_PTYS is not set
792
793#
794# IPMI
795#
796# CONFIG_IPMI_HANDLER is not set 706# CONFIG_IPMI_HANDLER is not set
797
798#
799# Watchdog Cards
800#
801# CONFIG_WATCHDOG is not set
802# CONFIG_HW_RANDOM is not set 707# CONFIG_HW_RANDOM is not set
803# CONFIG_RTC is not set
804# CONFIG_GEN_RTC is not set
805# CONFIG_DTLK is not set
806# CONFIG_R3964 is not set 708# CONFIG_R3964 is not set
807 709
808# 710#
@@ -811,223 +713,624 @@ CONFIG_LEGACY_PTY_COUNT=256
811# CONFIG_SYNCLINK_CS is not set 713# CONFIG_SYNCLINK_CS is not set
812# CONFIG_CARDMAN_4000 is not set 714# CONFIG_CARDMAN_4000 is not set
813# CONFIG_CARDMAN_4040 is not set 715# CONFIG_CARDMAN_4040 is not set
716# CONFIG_IPWIRELESS is not set
814# CONFIG_RAW_DRIVER is not set 717# CONFIG_RAW_DRIVER is not set
718# CONFIG_TCG_TPM is not set
719CONFIG_I2C=y
720CONFIG_I2C_BOARDINFO=y
721# CONFIG_I2C_COMPAT is not set
722CONFIG_I2C_CHARDEV=y
723# CONFIG_I2C_HELPER_AUTO is not set
815 724
816# 725#
817# TPM devices 726# I2C Algorithms
818# 727#
819# CONFIG_TCG_TPM is not set 728# CONFIG_I2C_ALGOBIT is not set
729# CONFIG_I2C_ALGOPCF is not set
730# CONFIG_I2C_ALGOPCA is not set
820 731
821# 732#
822# I2C support 733# I2C Hardware Bus support
823# 734#
824# CONFIG_I2C is not set
825 735
826# 736#
827# SPI support 737# I2C system bus drivers (mostly embedded / system-on-chip)
828# 738#
829# CONFIG_SPI is not set 739CONFIG_I2C_AU1550=y
830# CONFIG_SPI_MASTER is not set 740# CONFIG_I2C_GPIO is not set
741# CONFIG_I2C_OCORES is not set
742# CONFIG_I2C_SIMTEC is not set
831 743
832# 744#
833# Dallas's 1-wire bus 745# External I2C/SMBus adapter drivers
834# 746#
835# CONFIG_W1 is not set 747# CONFIG_I2C_PARPORT_LIGHT is not set
748# CONFIG_I2C_TAOS_EVM is not set
749# CONFIG_I2C_TINY_USB is not set
836 750
837# 751#
838# Hardware Monitoring support 752# Other I2C/SMBus bus drivers
839# 753#
840# CONFIG_HWMON is not set 754# CONFIG_I2C_PCA_PLATFORM is not set
841# CONFIG_HWMON_VID is not set 755# CONFIG_I2C_STUB is not set
842 756
843# 757#
844# Multimedia devices 758# Miscellaneous I2C Chip support
845# 759#
846# CONFIG_VIDEO_DEV is not set 760# CONFIG_SENSORS_TSL2550 is not set
761# CONFIG_I2C_DEBUG_CORE is not set
762# CONFIG_I2C_DEBUG_ALGO is not set
763# CONFIG_I2C_DEBUG_BUS is not set
764# CONFIG_I2C_DEBUG_CHIP is not set
765CONFIG_SPI=y
766# CONFIG_SPI_DEBUG is not set
767CONFIG_SPI_MASTER=y
847 768
848# 769#
849# Digital Video Broadcasting Devices 770# SPI Master Controller Drivers
850# 771#
851# CONFIG_DVB is not set 772CONFIG_SPI_AU1550=y
773CONFIG_SPI_BITBANG=y
774# CONFIG_SPI_GPIO is not set
775# CONFIG_SPI_XILINX is not set
776# CONFIG_SPI_DESIGNWARE is not set
777
778#
779# SPI Protocol Masters
780#
781# CONFIG_SPI_SPIDEV is not set
782# CONFIG_SPI_TLE62X0 is not set
783
784#
785# PPS support
786#
787# CONFIG_PPS is not set
788CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
789CONFIG_GPIOLIB=y
790# CONFIG_DEBUG_GPIO is not set
791CONFIG_GPIO_SYSFS=y
792
793#
794# Memory mapped GPIO expanders:
795#
796
797#
798# I2C GPIO expanders:
799#
800# CONFIG_GPIO_MAX732X is not set
801# CONFIG_GPIO_PCA953X is not set
802# CONFIG_GPIO_PCF857X is not set
803# CONFIG_GPIO_ADP5588 is not set
804
805#
806# PCI GPIO expanders:
807#
808
809#
810# SPI GPIO expanders:
811#
812# CONFIG_GPIO_MAX7301 is not set
813# CONFIG_GPIO_MCP23S08 is not set
814# CONFIG_GPIO_MC33880 is not set
815
816#
817# AC97 GPIO expanders:
818#
819# CONFIG_W1 is not set
820# CONFIG_POWER_SUPPLY is not set
821CONFIG_HWMON=y
822CONFIG_HWMON_VID=y
823# CONFIG_HWMON_DEBUG_CHIP is not set
824
825#
826# Native drivers
827#
828# CONFIG_SENSORS_AD7414 is not set
829# CONFIG_SENSORS_AD7418 is not set
830# CONFIG_SENSORS_ADCXX is not set
831# CONFIG_SENSORS_ADM1021 is not set
832CONFIG_SENSORS_ADM1025=y
833# CONFIG_SENSORS_ADM1026 is not set
834# CONFIG_SENSORS_ADM1029 is not set
835# CONFIG_SENSORS_ADM1031 is not set
836# CONFIG_SENSORS_ADM9240 is not set
837# CONFIG_SENSORS_ADT7462 is not set
838# CONFIG_SENSORS_ADT7470 is not set
839# CONFIG_SENSORS_ADT7473 is not set
840# CONFIG_SENSORS_ADT7475 is not set
841# CONFIG_SENSORS_ATXP1 is not set
842# CONFIG_SENSORS_DS1621 is not set
843# CONFIG_SENSORS_F71805F is not set
844# CONFIG_SENSORS_F71882FG is not set
845# CONFIG_SENSORS_F75375S is not set
846# CONFIG_SENSORS_G760A is not set
847# CONFIG_SENSORS_GL518SM is not set
848# CONFIG_SENSORS_GL520SM is not set
849# CONFIG_SENSORS_IT87 is not set
850# CONFIG_SENSORS_LM63 is not set
851CONFIG_SENSORS_LM70=y
852# CONFIG_SENSORS_LM73 is not set
853# CONFIG_SENSORS_LM75 is not set
854# CONFIG_SENSORS_LM77 is not set
855# CONFIG_SENSORS_LM78 is not set
856# CONFIG_SENSORS_LM80 is not set
857# CONFIG_SENSORS_LM83 is not set
858# CONFIG_SENSORS_LM85 is not set
859# CONFIG_SENSORS_LM87 is not set
860# CONFIG_SENSORS_LM90 is not set
861# CONFIG_SENSORS_LM92 is not set
862# CONFIG_SENSORS_LM93 is not set
863# CONFIG_SENSORS_LTC4215 is not set
864# CONFIG_SENSORS_LTC4245 is not set
865# CONFIG_SENSORS_LM95241 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_PCF8591 is not set
872# CONFIG_SENSORS_SHT15 is not set
873# CONFIG_SENSORS_DME1737 is not set
874# CONFIG_SENSORS_SMSC47M1 is not set
875# CONFIG_SENSORS_SMSC47M192 is not set
876# CONFIG_SENSORS_SMSC47B397 is not set
877# CONFIG_SENSORS_ADS7828 is not set
878# CONFIG_SENSORS_AMC6821 is not set
879# CONFIG_SENSORS_THMC50 is not set
880# CONFIG_SENSORS_TMP401 is not set
881# CONFIG_SENSORS_TMP421 is not set
882# CONFIG_SENSORS_VT1211 is not set
883# CONFIG_SENSORS_W83781D is not set
884# CONFIG_SENSORS_W83791D is not set
885# CONFIG_SENSORS_W83792D is not set
886# CONFIG_SENSORS_W83793 is not set
887# CONFIG_SENSORS_W83L785TS is not set
888# CONFIG_SENSORS_W83L786NG is not set
889# CONFIG_SENSORS_W83627HF is not set
890# CONFIG_SENSORS_W83627EHF is not set
891# CONFIG_SENSORS_LIS3_SPI is not set
892# CONFIG_SENSORS_LIS3_I2C is not set
893# CONFIG_THERMAL is not set
894# CONFIG_WATCHDOG is not set
895CONFIG_SSB_POSSIBLE=y
896
897#
898# Sonics Silicon Backplane
899#
900# CONFIG_SSB is not set
901
902#
903# Multifunction device drivers
904#
905# CONFIG_MFD_CORE is not set
906# CONFIG_MFD_SM501 is not set
907# CONFIG_HTC_PASIC3 is not set
908# CONFIG_UCB1400_CORE is not set
909# CONFIG_TPS65010 is not set
910# CONFIG_TWL4030_CORE is not set
911# CONFIG_MFD_TMIO is not set
912# CONFIG_PMIC_DA903X is not set
913# CONFIG_PMIC_ADP5520 is not set
914# CONFIG_MFD_WM8400 is not set
915# CONFIG_MFD_WM831X is not set
916# CONFIG_MFD_WM8350_I2C is not set
917# CONFIG_MFD_PCF50633 is not set
918# CONFIG_MFD_MC13783 is not set
919# CONFIG_AB3100_CORE is not set
920# CONFIG_EZX_PCAP is not set
921# CONFIG_MFD_88PM8607 is not set
922# CONFIG_AB4500_CORE is not set
923# CONFIG_REGULATOR is not set
924# CONFIG_MEDIA_SUPPORT is not set
852 925
853# 926#
854# Graphics support 927# Graphics support
855# 928#
856# CONFIG_FIRMWARE_EDID is not set 929# CONFIG_VGASTATE is not set
930# CONFIG_VIDEO_OUTPUT_CONTROL is not set
857CONFIG_FB=y 931CONFIG_FB=y
932# CONFIG_FIRMWARE_EDID is not set
933# CONFIG_FB_DDC is not set
934# CONFIG_FB_BOOT_VESA_SUPPORT is not set
858CONFIG_FB_CFB_FILLRECT=y 935CONFIG_FB_CFB_FILLRECT=y
859CONFIG_FB_CFB_COPYAREA=y 936CONFIG_FB_CFB_COPYAREA=y
860CONFIG_FB_CFB_IMAGEBLIT=y 937CONFIG_FB_CFB_IMAGEBLIT=y
938# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
939# CONFIG_FB_SYS_FILLRECT is not set
940# CONFIG_FB_SYS_COPYAREA is not set
941# CONFIG_FB_SYS_IMAGEBLIT is not set
942# CONFIG_FB_FOREIGN_ENDIAN is not set
943# CONFIG_FB_SYS_FOPS is not set
861# CONFIG_FB_SVGALIB is not set 944# CONFIG_FB_SVGALIB is not set
862# CONFIG_FB_MACMODES is not set 945# CONFIG_FB_MACMODES is not set
863# CONFIG_FB_BACKLIGHT is not set 946# CONFIG_FB_BACKLIGHT is not set
864# CONFIG_FB_MODE_HELPERS is not set 947# CONFIG_FB_MODE_HELPERS is not set
865# CONFIG_FB_TILEBLITTING is not set 948# CONFIG_FB_TILEBLITTING is not set
949
950#
951# Frame buffer hardware drivers
952#
866# CONFIG_FB_S1D13XXX is not set 953# CONFIG_FB_S1D13XXX is not set
867CONFIG_FB_AU1200=y 954CONFIG_FB_AU1200=y
868# CONFIG_FB_VIRTUAL is not set 955# CONFIG_FB_VIRTUAL is not set
956# CONFIG_FB_METRONOME is not set
957# CONFIG_FB_MB862XX is not set
958# CONFIG_FB_BROADSHEET is not set
959# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
960
961#
962# Display device support
963#
964# CONFIG_DISPLAY_SUPPORT is not set
869 965
870# 966#
871# Console display driver support 967# Console display driver support
872# 968#
873CONFIG_VGA_CONSOLE=y 969# CONFIG_VGA_CONSOLE is not set
874# CONFIG_VGACON_SOFT_SCROLLBACK is not set
875CONFIG_DUMMY_CONSOLE=y 970CONFIG_DUMMY_CONSOLE=y
876# CONFIG_FRAMEBUFFER_CONSOLE is not set 971CONFIG_FRAMEBUFFER_CONSOLE=y
972# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
973# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
974CONFIG_FONTS=y
975# CONFIG_FONT_8x8 is not set
976CONFIG_FONT_8x16=y
977# CONFIG_FONT_6x11 is not set
978# CONFIG_FONT_7x14 is not set
979# CONFIG_FONT_PEARL_8x8 is not set
980# CONFIG_FONT_ACORN_8x8 is not set
981# CONFIG_FONT_MINI_4x6 is not set
982# CONFIG_FONT_SUN8x16 is not set
983# CONFIG_FONT_SUN12x22 is not set
984# CONFIG_FONT_10x18 is not set
985# CONFIG_LOGO is not set
986CONFIG_SOUND=y
987# CONFIG_SOUND_OSS_CORE is not set
988CONFIG_SND=y
989CONFIG_SND_TIMER=y
990CONFIG_SND_PCM=y
991CONFIG_SND_JACK=y
992# CONFIG_SND_SEQUENCER is not set
993# CONFIG_SND_MIXER_OSS is not set
994# CONFIG_SND_PCM_OSS is not set
995# CONFIG_SND_HRTIMER is not set
996CONFIG_SND_DYNAMIC_MINORS=y
997# CONFIG_SND_SUPPORT_OLD_API is not set
998# CONFIG_SND_VERBOSE_PROCFS is not set
999# CONFIG_SND_VERBOSE_PRINTK is not set
1000# CONFIG_SND_DEBUG is not set
1001CONFIG_SND_VMASTER=y
1002# CONFIG_SND_RAWMIDI_SEQ is not set
1003# CONFIG_SND_OPL3_LIB_SEQ is not set
1004# CONFIG_SND_OPL4_LIB_SEQ is not set
1005# CONFIG_SND_SBAWE_SEQ is not set
1006# CONFIG_SND_EMU10K1_SEQ is not set
1007CONFIG_SND_AC97_CODEC=y
1008# CONFIG_SND_DRIVERS is not set
1009# CONFIG_SND_SPI is not set
1010# CONFIG_SND_MIPS is not set
1011# CONFIG_SND_USB is not set
1012# CONFIG_SND_PCMCIA is not set
1013CONFIG_SND_SOC=y
1014CONFIG_SND_SOC_AC97_BUS=y
1015CONFIG_SND_SOC_AU1XPSC=y
1016CONFIG_SND_SOC_AU1XPSC_I2S=y
1017CONFIG_SND_SOC_AU1XPSC_AC97=y
1018CONFIG_SND_SOC_DB1200=y
1019CONFIG_SND_SOC_I2C_AND_SPI=y
1020# CONFIG_SND_SOC_ALL_CODECS is not set
1021CONFIG_SND_SOC_AC97_CODEC=y
1022CONFIG_SND_SOC_WM8731=y
1023# CONFIG_SOUND_PRIME is not set
1024CONFIG_AC97_BUS=y
1025CONFIG_HID_SUPPORT=y
1026CONFIG_HID=y
1027CONFIG_HIDRAW=y
1028
1029#
1030# USB Input Devices
1031#
1032CONFIG_USB_HID=y
1033# CONFIG_HID_PID is not set
1034CONFIG_USB_HIDDEV=y
1035
1036#
1037# Special HID drivers
1038#
1039# CONFIG_HID_A4TECH is not set
1040# CONFIG_HID_APPLE is not set
1041# CONFIG_HID_BELKIN is not set
1042# CONFIG_HID_CHERRY is not set
1043# CONFIG_HID_CHICONY is not set
1044# CONFIG_HID_CYPRESS is not set
1045# CONFIG_HID_DRAGONRISE is not set
1046# CONFIG_HID_EZKEY is not set
1047# CONFIG_HID_KYE is not set
1048# CONFIG_HID_GYRATION is not set
1049# CONFIG_HID_TWINHAN is not set
1050# CONFIG_HID_KENSINGTON is not set
1051# CONFIG_HID_LOGITECH is not set
1052# CONFIG_HID_MICROSOFT is not set
1053# CONFIG_HID_MONTEREY is not set
1054# CONFIG_HID_NTRIG is not set
1055# CONFIG_HID_PANTHERLORD is not set
1056# CONFIG_HID_PETALYNX is not set
1057# CONFIG_HID_SAMSUNG is not set
1058# CONFIG_HID_SONY is not set
1059# CONFIG_HID_SUNPLUS is not set
1060# CONFIG_HID_GREENASIA is not set
1061# CONFIG_HID_SMARTJOYPLUS is not set
1062# CONFIG_HID_TOPSEED is not set
1063# CONFIG_HID_THRUSTMASTER is not set
1064# CONFIG_HID_ZEROPLUS is not set
1065CONFIG_USB_SUPPORT=y
1066CONFIG_USB_ARCH_HAS_HCD=y
1067CONFIG_USB_ARCH_HAS_OHCI=y
1068CONFIG_USB_ARCH_HAS_EHCI=y
1069CONFIG_USB=y
1070CONFIG_USB_DEBUG=y
1071CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
877 1072
878# 1073#
879# Logo configuration 1074# Miscellaneous USB options
880# 1075#
881CONFIG_LOGO=y 1076# CONFIG_USB_DEVICEFS is not set
882CONFIG_LOGO_LINUX_MONO=y 1077# CONFIG_USB_DEVICE_CLASS is not set
883CONFIG_LOGO_LINUX_VGA16=y 1078CONFIG_USB_DYNAMIC_MINORS=y
884CONFIG_LOGO_LINUX_CLUT224=y 1079# CONFIG_USB_OTG is not set
885# CONFIG_BACKLIGHT_LCD_SUPPORT is not set 1080# CONFIG_USB_OTG_WHITELIST is not set
1081# CONFIG_USB_OTG_BLACKLIST_HUB is not set
1082# CONFIG_USB_MON is not set
1083# CONFIG_USB_WUSB is not set
1084# CONFIG_USB_WUSB_CBAF is not set
886 1085
887# 1086#
888# Sound 1087# USB Host Controller Drivers
889# 1088#
890# CONFIG_SOUND is not set 1089# CONFIG_USB_C67X00_HCD is not set
1090CONFIG_USB_EHCI_HCD=y
1091CONFIG_USB_EHCI_ROOT_HUB_TT=y
1092CONFIG_USB_EHCI_TT_NEWSCHED=y
1093# CONFIG_USB_OXU210HP_HCD is not set
1094# CONFIG_USB_ISP116X_HCD is not set
1095# CONFIG_USB_ISP1760_HCD is not set
1096# CONFIG_USB_ISP1362_HCD is not set
1097CONFIG_USB_OHCI_HCD=y
1098# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
1099# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
1100CONFIG_USB_OHCI_LITTLE_ENDIAN=y
1101# CONFIG_USB_SL811_HCD is not set
1102# CONFIG_USB_R8A66597_HCD is not set
1103# CONFIG_USB_HWA_HCD is not set
891 1104
892# 1105#
893# HID Devices 1106# USB Device Class drivers
894# 1107#
895CONFIG_HID=y 1108# CONFIG_USB_ACM is not set
896# CONFIG_HID_DEBUG is not set 1109# CONFIG_USB_PRINTER is not set
1110# CONFIG_USB_WDM is not set
1111# CONFIG_USB_TMC is not set
897 1112
898# 1113#
899# USB support 1114# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
900# 1115#
901CONFIG_USB_ARCH_HAS_HCD=y
902CONFIG_USB_ARCH_HAS_OHCI=y
903CONFIG_USB_ARCH_HAS_EHCI=y
904# CONFIG_USB is not set
905 1116
906# 1117#
907# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' 1118# also be needed; see USB_STORAGE Help for more info
908# 1119#
1120# CONFIG_USB_LIBUSUAL is not set
909 1121
910# 1122#
911# USB Gadget Support 1123# USB Imaging devices
912# 1124#
913CONFIG_USB_GADGET=m 1125# CONFIG_USB_MDC800 is not set
914# CONFIG_USB_GADGET_DEBUG_FILES is not set
915# CONFIG_USB_GADGET_NET2280 is not set
916# CONFIG_USB_GADGET_PXA2XX is not set
917# CONFIG_USB_GADGET_GOKU is not set
918# CONFIG_USB_GADGET_LH7A40X is not set
919# CONFIG_USB_GADGET_OMAP is not set
920# CONFIG_USB_GADGET_AT91 is not set
921# CONFIG_USB_GADGET_DUMMY_HCD is not set
922# CONFIG_USB_GADGET_DUALSPEED is not set
923 1126
924# 1127#
925# MMC/SD Card support 1128# USB port drivers
926# 1129#
1130# CONFIG_USB_SERIAL is not set
1131
1132#
1133# USB Miscellaneous drivers
1134#
1135# CONFIG_USB_EMI62 is not set
1136# CONFIG_USB_EMI26 is not set
1137# CONFIG_USB_ADUTUX is not set
1138# CONFIG_USB_SEVSEG is not set
1139# CONFIG_USB_RIO500 is not set
1140# CONFIG_USB_LEGOTOWER is not set
1141# CONFIG_USB_LCD is not set
1142# CONFIG_USB_BERRY_CHARGE is not set
1143# CONFIG_USB_LED is not set
1144# CONFIG_USB_CYPRESS_CY7C63 is not set
1145# CONFIG_USB_CYTHERM is not set
1146# CONFIG_USB_IDMOUSE is not set
1147# CONFIG_USB_FTDI_ELAN is not set
1148# CONFIG_USB_APPLEDISPLAY is not set
1149# CONFIG_USB_SISUSBVGA is not set
1150# CONFIG_USB_LD is not set
1151# CONFIG_USB_TRANCEVIBRATOR is not set
1152# CONFIG_USB_IOWARRIOR is not set
1153# CONFIG_USB_TEST is not set
1154# CONFIG_USB_ISIGHTFW is not set
1155# CONFIG_USB_VST is not set
1156# CONFIG_USB_GADGET is not set
1157
1158#
1159# OTG and related infrastructure
1160#
1161# CONFIG_USB_GPIO_VBUS is not set
1162# CONFIG_NOP_USB_XCEIV is not set
927CONFIG_MMC=y 1163CONFIG_MMC=y
928# CONFIG_MMC_DEBUG is not set 1164# CONFIG_MMC_DEBUG is not set
929CONFIG_MMC_BLOCK=y 1165# CONFIG_MMC_UNSAFE_RESUME is not set
930CONFIG_MMC_AU1X=y
931 1166
932# 1167#
933# LED devices 1168# MMC/SD/SDIO Card Drivers
934# 1169#
935# CONFIG_NEW_LEDS is not set 1170CONFIG_MMC_BLOCK=y
1171# CONFIG_MMC_BLOCK_BOUNCE is not set
1172# CONFIG_SDIO_UART is not set
1173# CONFIG_MMC_TEST is not set
936 1174
937# 1175#
938# LED drivers 1176# MMC/SD/SDIO Host Controller Drivers
939# 1177#
1178# CONFIG_MMC_SDHCI is not set
1179CONFIG_MMC_AU1X=y
1180# CONFIG_MMC_AT91 is not set
1181# CONFIG_MMC_ATMELMCI is not set
1182# CONFIG_MMC_SPI is not set
1183# CONFIG_MEMSTICK is not set
1184CONFIG_NEW_LEDS=y
1185CONFIG_LEDS_CLASS=y
940 1186
941# 1187#
942# LED Triggers 1188# LED drivers
943# 1189#
1190# CONFIG_LEDS_PCA9532 is not set
1191# CONFIG_LEDS_GPIO is not set
1192# CONFIG_LEDS_LP3944 is not set
1193# CONFIG_LEDS_PCA955X is not set
1194# CONFIG_LEDS_DAC124S085 is not set
1195# CONFIG_LEDS_BD2802 is not set
1196# CONFIG_LEDS_LT3593 is not set
944 1197
945# 1198#
946# InfiniBand support 1199# LED Triggers
947# 1200#
1201CONFIG_LEDS_TRIGGERS=y
1202# CONFIG_LEDS_TRIGGER_TIMER is not set
1203# CONFIG_LEDS_TRIGGER_IDE_DISK is not set
1204# CONFIG_LEDS_TRIGGER_HEARTBEAT is not set
1205# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set
1206# CONFIG_LEDS_TRIGGER_GPIO is not set
1207# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set
948 1208
949# 1209#
950# EDAC - error detection and reporting (RAS) (EXPERIMENTAL) 1210# iptables trigger is under Netfilter config (LED target)
951# 1211#
1212# CONFIG_ACCESSIBILITY is not set
1213CONFIG_RTC_LIB=y
1214CONFIG_RTC_CLASS=y
1215CONFIG_RTC_HCTOSYS=y
1216CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
1217# CONFIG_RTC_DEBUG is not set
952 1218
953# 1219#
954# Real Time Clock 1220# RTC interfaces
955# 1221#
956# CONFIG_RTC_CLASS is not set 1222CONFIG_RTC_INTF_SYSFS=y
1223CONFIG_RTC_INTF_PROC=y
1224CONFIG_RTC_INTF_DEV=y
1225# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
1226# CONFIG_RTC_DRV_TEST is not set
957 1227
958# 1228#
959# DMA Engine support 1229# I2C RTC drivers
960# 1230#
961# CONFIG_DMA_ENGINE is not set 1231# CONFIG_RTC_DRV_DS1307 is not set
1232# CONFIG_RTC_DRV_DS1374 is not set
1233# CONFIG_RTC_DRV_DS1672 is not set
1234# CONFIG_RTC_DRV_MAX6900 is not set
1235# CONFIG_RTC_DRV_RS5C372 is not set
1236# CONFIG_RTC_DRV_ISL1208 is not set
1237# CONFIG_RTC_DRV_X1205 is not set
1238# CONFIG_RTC_DRV_PCF8563 is not set
1239# CONFIG_RTC_DRV_PCF8583 is not set
1240# CONFIG_RTC_DRV_M41T80 is not set
1241# CONFIG_RTC_DRV_BQ32K is not set
1242# CONFIG_RTC_DRV_S35390A is not set
1243# CONFIG_RTC_DRV_FM3130 is not set
1244# CONFIG_RTC_DRV_RX8581 is not set
1245# CONFIG_RTC_DRV_RX8025 is not set
962 1246
963# 1247#
964# DMA Clients 1248# SPI RTC drivers
965# 1249#
1250# CONFIG_RTC_DRV_M41T94 is not set
1251# CONFIG_RTC_DRV_DS1305 is not set
1252# CONFIG_RTC_DRV_DS1390 is not set
1253# CONFIG_RTC_DRV_MAX6902 is not set
1254# CONFIG_RTC_DRV_R9701 is not set
1255# CONFIG_RTC_DRV_RS5C348 is not set
1256# CONFIG_RTC_DRV_DS3234 is not set
1257# CONFIG_RTC_DRV_PCF2123 is not set
966 1258
967# 1259#
968# DMA Devices 1260# Platform RTC drivers
969# 1261#
1262# CONFIG_RTC_DRV_CMOS is not set
1263# CONFIG_RTC_DRV_DS1286 is not set
1264# CONFIG_RTC_DRV_DS1511 is not set
1265# CONFIG_RTC_DRV_DS1553 is not set
1266# CONFIG_RTC_DRV_DS1742 is not set
1267# CONFIG_RTC_DRV_STK17TA8 is not set
1268# CONFIG_RTC_DRV_M48T86 is not set
1269# CONFIG_RTC_DRV_M48T35 is not set
1270# CONFIG_RTC_DRV_M48T59 is not set
1271# CONFIG_RTC_DRV_MSM6242 is not set
1272# CONFIG_RTC_DRV_BQ4802 is not set
1273# CONFIG_RTC_DRV_RP5C01 is not set
1274# CONFIG_RTC_DRV_V3020 is not set
970 1275
971# 1276#
972# Auxiliary Display support 1277# on-CPU RTC drivers
973# 1278#
1279CONFIG_RTC_DRV_AU1XXX=y
1280# CONFIG_DMADEVICES is not set
1281# CONFIG_AUXDISPLAY is not set
1282# CONFIG_UIO is not set
974 1283
975# 1284#
976# Virtualization 1285# TI VLYNQ
977# 1286#
1287# CONFIG_STAGING is not set
978 1288
979# 1289#
980# File systems 1290# File systems
981# 1291#
982CONFIG_EXT2_FS=y 1292CONFIG_EXT2_FS=y
983CONFIG_EXT2_FS_XATTR=y 1293# CONFIG_EXT2_FS_XATTR is not set
984CONFIG_EXT2_FS_POSIX_ACL=y
985# CONFIG_EXT2_FS_SECURITY is not set
986# CONFIG_EXT2_FS_XIP is not set 1294# CONFIG_EXT2_FS_XIP is not set
987CONFIG_EXT3_FS=y 1295# CONFIG_EXT3_FS is not set
988CONFIG_EXT3_FS_XATTR=y 1296# CONFIG_EXT4_FS is not set
989CONFIG_EXT3_FS_POSIX_ACL=y
990CONFIG_EXT3_FS_SECURITY=y
991# CONFIG_EXT4DEV_FS is not set
992CONFIG_JBD=y
993# CONFIG_JBD_DEBUG is not set
994CONFIG_FS_MBCACHE=y
995# CONFIG_REISERFS_FS is not set 1297# CONFIG_REISERFS_FS is not set
996CONFIG_JFS_FS=y 1298# CONFIG_JFS_FS is not set
997# CONFIG_JFS_POSIX_ACL is not set 1299# CONFIG_FS_POSIX_ACL is not set
998# CONFIG_JFS_SECURITY is not set
999# CONFIG_JFS_DEBUG is not set
1000# CONFIG_JFS_STATISTICS is not set
1001CONFIG_FS_POSIX_ACL=y
1002# CONFIG_XFS_FS is not set 1300# CONFIG_XFS_FS is not set
1003# CONFIG_GFS2_FS is not set
1004# CONFIG_OCFS2_FS is not set 1301# CONFIG_OCFS2_FS is not set
1005# CONFIG_MINIX_FS is not set 1302# CONFIG_BTRFS_FS is not set
1006# CONFIG_ROMFS_FS is not set 1303# CONFIG_NILFS2_FS is not set
1304CONFIG_FILE_LOCKING=y
1305CONFIG_FSNOTIFY=y
1306CONFIG_DNOTIFY=y
1007CONFIG_INOTIFY=y 1307CONFIG_INOTIFY=y
1008CONFIG_INOTIFY_USER=y 1308CONFIG_INOTIFY_USER=y
1009# CONFIG_QUOTA is not set 1309# CONFIG_QUOTA is not set
1010CONFIG_DNOTIFY=y
1011# CONFIG_AUTOFS_FS is not set 1310# CONFIG_AUTOFS_FS is not set
1012# CONFIG_AUTOFS4_FS is not set 1311# CONFIG_AUTOFS4_FS is not set
1013# CONFIG_FUSE_FS is not set 1312# CONFIG_FUSE_FS is not set
1014CONFIG_GENERIC_ACL=y 1313
1314#
1315# Caches
1316#
1317# CONFIG_FSCACHE is not set
1015 1318
1016# 1319#
1017# CD-ROM/DVD Filesystems 1320# CD-ROM/DVD Filesystems
1018# 1321#
1019CONFIG_ISO9660_FS=m 1322CONFIG_ISO9660_FS=y
1020CONFIG_JOLIET=y 1323CONFIG_JOLIET=y
1021CONFIG_ZISOFS=y 1324CONFIG_ZISOFS=y
1022CONFIG_UDF_FS=m 1325CONFIG_UDF_FS=y
1023CONFIG_UDF_NLS=y 1326CONFIG_UDF_NLS=y
1024 1327
1025# 1328#
1026# DOS/FAT/NT Filesystems 1329# DOS/FAT/NT Filesystems
1027# 1330#
1028CONFIG_FAT_FS=m 1331CONFIG_FAT_FS=y
1029CONFIG_MSDOS_FS=m 1332# CONFIG_MSDOS_FS is not set
1030CONFIG_VFAT_FS=m 1333CONFIG_VFAT_FS=y
1031CONFIG_FAT_DEFAULT_CODEPAGE=437 1334CONFIG_FAT_DEFAULT_CODEPAGE=437
1032CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" 1335CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1033# CONFIG_NTFS_FS is not set 1336# CONFIG_NTFS_FS is not set
@@ -1036,21 +1339,17 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1036# Pseudo filesystems 1339# Pseudo filesystems
1037# 1340#
1038CONFIG_PROC_FS=y 1341CONFIG_PROC_FS=y
1039CONFIG_PROC_KCORE=y 1342# CONFIG_PROC_KCORE is not set
1040CONFIG_PROC_SYSCTL=y 1343CONFIG_PROC_SYSCTL=y
1344# CONFIG_PROC_PAGE_MONITOR is not set
1041CONFIG_SYSFS=y 1345CONFIG_SYSFS=y
1042CONFIG_TMPFS=y 1346CONFIG_TMPFS=y
1043CONFIG_TMPFS_POSIX_ACL=y 1347# CONFIG_TMPFS_POSIX_ACL is not set
1044# CONFIG_HUGETLB_PAGE is not set 1348# CONFIG_HUGETLB_PAGE is not set
1045CONFIG_RAMFS=y 1349# CONFIG_CONFIGFS_FS is not set
1046CONFIG_CONFIGFS_FS=m 1350CONFIG_MISC_FILESYSTEMS=y
1047
1048#
1049# Miscellaneous filesystems
1050#
1051# CONFIG_ADFS_FS is not set 1351# CONFIG_ADFS_FS is not set
1052# CONFIG_AFFS_FS is not set 1352# CONFIG_AFFS_FS is not set
1053# CONFIG_ECRYPT_FS is not set
1054# CONFIG_HFS_FS is not set 1353# CONFIG_HFS_FS is not set
1055# CONFIG_HFSPLUS_FS is not set 1354# CONFIG_HFSPLUS_FS is not set
1056# CONFIG_BEFS_FS is not set 1355# CONFIG_BEFS_FS is not set
@@ -1059,27 +1358,36 @@ CONFIG_CONFIGFS_FS=m
1059CONFIG_JFFS2_FS=y 1358CONFIG_JFFS2_FS=y
1060CONFIG_JFFS2_FS_DEBUG=0 1359CONFIG_JFFS2_FS_DEBUG=0
1061CONFIG_JFFS2_FS_WRITEBUFFER=y 1360CONFIG_JFFS2_FS_WRITEBUFFER=y
1062# CONFIG_JFFS2_SUMMARY is not set 1361# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
1362CONFIG_JFFS2_SUMMARY=y
1063# CONFIG_JFFS2_FS_XATTR is not set 1363# CONFIG_JFFS2_FS_XATTR is not set
1064# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set 1364CONFIG_JFFS2_COMPRESSION_OPTIONS=y
1065CONFIG_JFFS2_ZLIB=y 1365CONFIG_JFFS2_ZLIB=y
1366CONFIG_JFFS2_LZO=y
1066CONFIG_JFFS2_RTIME=y 1367CONFIG_JFFS2_RTIME=y
1067# CONFIG_JFFS2_RUBIN is not set 1368CONFIG_JFFS2_RUBIN=y
1068CONFIG_CRAMFS=m 1369# CONFIG_JFFS2_CMODE_NONE is not set
1370CONFIG_JFFS2_CMODE_PRIORITY=y
1371# CONFIG_JFFS2_CMODE_SIZE is not set
1372# CONFIG_JFFS2_CMODE_FAVOURLZO is not set
1373# CONFIG_CRAMFS is not set
1374CONFIG_SQUASHFS=y
1375# CONFIG_SQUASHFS_EMBEDDED is not set
1376CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
1069# CONFIG_VXFS_FS is not set 1377# CONFIG_VXFS_FS is not set
1378# CONFIG_MINIX_FS is not set
1379# CONFIG_OMFS_FS is not set
1070# CONFIG_HPFS_FS is not set 1380# CONFIG_HPFS_FS is not set
1071# CONFIG_QNX4FS_FS is not set 1381# CONFIG_QNX4FS_FS is not set
1382# CONFIG_ROMFS_FS is not set
1072# CONFIG_SYSV_FS is not set 1383# CONFIG_SYSV_FS is not set
1073# CONFIG_UFS_FS is not set 1384# CONFIG_UFS_FS is not set
1074 1385CONFIG_NETWORK_FILESYSTEMS=y
1075#
1076# Network File Systems
1077#
1078CONFIG_NFS_FS=y 1386CONFIG_NFS_FS=y
1079CONFIG_NFS_V3=y 1387CONFIG_NFS_V3=y
1080# CONFIG_NFS_V3_ACL is not set 1388# CONFIG_NFS_V3_ACL is not set
1081# CONFIG_NFS_V4 is not set 1389# CONFIG_NFS_V4 is not set
1082# CONFIG_NFS_DIRECTIO is not set 1390CONFIG_ROOT_NFS=y
1083# CONFIG_NFSD is not set 1391# CONFIG_NFSD is not set
1084CONFIG_LOCKD=y 1392CONFIG_LOCKD=y
1085CONFIG_LOCKD_V4=y 1393CONFIG_LOCKD_V4=y
@@ -1087,93 +1395,140 @@ CONFIG_NFS_COMMON=y
1087CONFIG_SUNRPC=y 1395CONFIG_SUNRPC=y
1088# CONFIG_RPCSEC_GSS_KRB5 is not set 1396# CONFIG_RPCSEC_GSS_KRB5 is not set
1089# CONFIG_RPCSEC_GSS_SPKM3 is not set 1397# CONFIG_RPCSEC_GSS_SPKM3 is not set
1090CONFIG_SMB_FS=y 1398# CONFIG_SMB_FS is not set
1091# CONFIG_SMB_NLS_DEFAULT is not set
1092# CONFIG_CIFS is not set 1399# CONFIG_CIFS is not set
1093# CONFIG_NCP_FS is not set 1400# CONFIG_NCP_FS is not set
1094# CONFIG_CODA_FS is not set 1401# CONFIG_CODA_FS is not set
1095# CONFIG_AFS_FS is not set 1402# CONFIG_AFS_FS is not set
1096# CONFIG_9P_FS is not set
1097 1403
1098# 1404#
1099# Partition Types 1405# Partition Types
1100# 1406#
1101# CONFIG_PARTITION_ADVANCED is not set 1407CONFIG_PARTITION_ADVANCED=y
1408# CONFIG_ACORN_PARTITION is not set
1409# CONFIG_OSF_PARTITION is not set
1410# CONFIG_AMIGA_PARTITION is not set
1411# CONFIG_ATARI_PARTITION is not set
1412# CONFIG_MAC_PARTITION is not set
1102CONFIG_MSDOS_PARTITION=y 1413CONFIG_MSDOS_PARTITION=y
1103 1414# CONFIG_BSD_DISKLABEL is not set
1104# 1415# CONFIG_MINIX_SUBPARTITION is not set
1105# Native Language Support 1416# CONFIG_SOLARIS_X86_PARTITION is not set
1106# 1417# CONFIG_UNIXWARE_DISKLABEL is not set
1418# CONFIG_LDM_PARTITION is not set
1419# CONFIG_SGI_PARTITION is not set
1420# CONFIG_ULTRIX_PARTITION is not set
1421# CONFIG_SUN_PARTITION is not set
1422# CONFIG_KARMA_PARTITION is not set
1423CONFIG_EFI_PARTITION=y
1424# CONFIG_SYSV68_PARTITION is not set
1107CONFIG_NLS=y 1425CONFIG_NLS=y
1108CONFIG_NLS_DEFAULT="iso8859-1" 1426CONFIG_NLS_DEFAULT="iso8859-1"
1109CONFIG_NLS_CODEPAGE_437=m 1427CONFIG_NLS_CODEPAGE_437=y
1110CONFIG_NLS_CODEPAGE_737=m 1428# CONFIG_NLS_CODEPAGE_737 is not set
1111CONFIG_NLS_CODEPAGE_775=m 1429# CONFIG_NLS_CODEPAGE_775 is not set
1112CONFIG_NLS_CODEPAGE_850=m 1430CONFIG_NLS_CODEPAGE_850=y
1113CONFIG_NLS_CODEPAGE_852=m 1431CONFIG_NLS_CODEPAGE_852=y
1114CONFIG_NLS_CODEPAGE_855=m 1432# CONFIG_NLS_CODEPAGE_855 is not set
1115CONFIG_NLS_CODEPAGE_857=m 1433# CONFIG_NLS_CODEPAGE_857 is not set
1116CONFIG_NLS_CODEPAGE_860=m 1434# CONFIG_NLS_CODEPAGE_860 is not set
1117CONFIG_NLS_CODEPAGE_861=m 1435# CONFIG_NLS_CODEPAGE_861 is not set
1118CONFIG_NLS_CODEPAGE_862=m 1436# CONFIG_NLS_CODEPAGE_862 is not set
1119CONFIG_NLS_CODEPAGE_863=m 1437# CONFIG_NLS_CODEPAGE_863 is not set
1120CONFIG_NLS_CODEPAGE_864=m 1438# CONFIG_NLS_CODEPAGE_864 is not set
1121CONFIG_NLS_CODEPAGE_865=m 1439# CONFIG_NLS_CODEPAGE_865 is not set
1122CONFIG_NLS_CODEPAGE_866=m 1440# CONFIG_NLS_CODEPAGE_866 is not set
1123CONFIG_NLS_CODEPAGE_869=m 1441# CONFIG_NLS_CODEPAGE_869 is not set
1124CONFIG_NLS_CODEPAGE_936=m 1442# CONFIG_NLS_CODEPAGE_936 is not set
1125CONFIG_NLS_CODEPAGE_950=m 1443# CONFIG_NLS_CODEPAGE_950 is not set
1126CONFIG_NLS_CODEPAGE_932=m 1444# CONFIG_NLS_CODEPAGE_932 is not set
1127CONFIG_NLS_CODEPAGE_949=m 1445# CONFIG_NLS_CODEPAGE_949 is not set
1128CONFIG_NLS_CODEPAGE_874=m 1446# CONFIG_NLS_CODEPAGE_874 is not set
1129CONFIG_NLS_ISO8859_8=m 1447# CONFIG_NLS_ISO8859_8 is not set
1130CONFIG_NLS_CODEPAGE_1250=m 1448CONFIG_NLS_CODEPAGE_1250=y
1131CONFIG_NLS_CODEPAGE_1251=m 1449# CONFIG_NLS_CODEPAGE_1251 is not set
1132CONFIG_NLS_ASCII=m 1450CONFIG_NLS_ASCII=y
1133CONFIG_NLS_ISO8859_1=m 1451CONFIG_NLS_ISO8859_1=y
1134CONFIG_NLS_ISO8859_2=m 1452CONFIG_NLS_ISO8859_2=y
1135CONFIG_NLS_ISO8859_3=m 1453# CONFIG_NLS_ISO8859_3 is not set
1136CONFIG_NLS_ISO8859_4=m 1454# CONFIG_NLS_ISO8859_4 is not set
1137CONFIG_NLS_ISO8859_5=m 1455# CONFIG_NLS_ISO8859_5 is not set
1138CONFIG_NLS_ISO8859_6=m 1456# CONFIG_NLS_ISO8859_6 is not set
1139CONFIG_NLS_ISO8859_7=m 1457# CONFIG_NLS_ISO8859_7 is not set
1140CONFIG_NLS_ISO8859_9=m 1458# CONFIG_NLS_ISO8859_9 is not set
1141CONFIG_NLS_ISO8859_13=m 1459# CONFIG_NLS_ISO8859_13 is not set
1142CONFIG_NLS_ISO8859_14=m 1460# CONFIG_NLS_ISO8859_14 is not set
1143CONFIG_NLS_ISO8859_15=m 1461CONFIG_NLS_ISO8859_15=y
1144CONFIG_NLS_KOI8_R=m 1462# CONFIG_NLS_KOI8_R is not set
1145CONFIG_NLS_KOI8_U=m 1463# CONFIG_NLS_KOI8_U is not set
1146CONFIG_NLS_UTF8=m 1464CONFIG_NLS_UTF8=y
1147 1465# CONFIG_DLM is not set
1148#
1149# Distributed Lock Manager
1150#
1151CONFIG_DLM=m
1152CONFIG_DLM_TCP=y
1153# CONFIG_DLM_SCTP is not set
1154# CONFIG_DLM_DEBUG is not set
1155
1156#
1157# Profiling support
1158#
1159# CONFIG_PROFILING is not set
1160 1466
1161# 1467#
1162# Kernel hacking 1468# Kernel hacking
1163# 1469#
1164CONFIG_TRACE_IRQFLAGS_SUPPORT=y 1470CONFIG_TRACE_IRQFLAGS_SUPPORT=y
1165# CONFIG_PRINTK_TIME is not set 1471# CONFIG_PRINTK_TIME is not set
1166CONFIG_ENABLE_MUST_CHECK=y 1472# CONFIG_ENABLE_WARN_DEPRECATED is not set
1167# CONFIG_MAGIC_SYSRQ is not set 1473# CONFIG_ENABLE_MUST_CHECK is not set
1474CONFIG_FRAME_WARN=1024
1475CONFIG_MAGIC_SYSRQ=y
1476CONFIG_STRIP_ASM_SYMS=y
1168# CONFIG_UNUSED_SYMBOLS is not set 1477# CONFIG_UNUSED_SYMBOLS is not set
1169# CONFIG_DEBUG_FS is not set 1478# CONFIG_DEBUG_FS is not set
1170# CONFIG_HEADERS_CHECK is not set 1479# CONFIG_HEADERS_CHECK is not set
1171# CONFIG_DEBUG_KERNEL is not set 1480CONFIG_DEBUG_KERNEL=y
1172CONFIG_LOG_BUF_SHIFT=14 1481# CONFIG_DEBUG_SHIRQ is not set
1173CONFIG_CROSSCOMPILE=y 1482# CONFIG_DETECT_SOFTLOCKUP is not set
1483# CONFIG_DETECT_HUNG_TASK is not set
1484# CONFIG_SCHED_DEBUG is not set
1485# CONFIG_SCHEDSTATS is not set
1486# CONFIG_TIMER_STATS is not set
1487# CONFIG_DEBUG_OBJECTS is not set
1488# CONFIG_DEBUG_SLAB is not set
1489# CONFIG_DEBUG_RT_MUTEXES is not set
1490# CONFIG_RT_MUTEX_TESTER is not set
1491# CONFIG_DEBUG_SPINLOCK is not set
1492# CONFIG_DEBUG_MUTEXES is not set
1493# CONFIG_DEBUG_LOCK_ALLOC is not set
1494# CONFIG_PROVE_LOCKING is not set
1495# CONFIG_LOCK_STAT is not set
1496# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1497# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1498# CONFIG_DEBUG_KOBJECT is not set
1499# CONFIG_DEBUG_INFO is not set
1500# CONFIG_DEBUG_VM is not set
1501# CONFIG_DEBUG_WRITECOUNT is not set
1502# CONFIG_DEBUG_MEMORY_INIT is not set
1503# CONFIG_DEBUG_LIST is not set
1504# CONFIG_DEBUG_SG is not set
1505# CONFIG_DEBUG_NOTIFIERS is not set
1506# CONFIG_DEBUG_CREDENTIALS is not set
1507# CONFIG_BOOT_PRINTK_DELAY is not set
1508# CONFIG_RCU_TORTURE_TEST is not set
1509# CONFIG_BACKTRACE_SELF_TEST is not set
1510# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1511# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
1512# CONFIG_FAULT_INJECTION is not set
1513# CONFIG_SYSCTL_SYSCALL_CHECK is not set
1514# CONFIG_PAGE_POISONING is not set
1515CONFIG_HAVE_FUNCTION_TRACER=y
1516CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1517CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y
1518CONFIG_HAVE_DYNAMIC_FTRACE=y
1519CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1520CONFIG_TRACING_SUPPORT=y
1521# CONFIG_FTRACE is not set
1522# CONFIG_SAMPLES is not set
1523CONFIG_HAVE_ARCH_KGDB=y
1524# CONFIG_KGDB is not set
1525CONFIG_EARLY_PRINTK=y
1174CONFIG_CMDLINE_BOOL=y 1526CONFIG_CMDLINE_BOOL=y
1175CONFIG_CMDLINE="mem=48M" 1527CONFIG_CMDLINE="console=ttyS0,115200"
1176# CONFIG_CMDLINE_OVERRIDE is not set 1528# CONFIG_CMDLINE_OVERRIDE is not set
1529# CONFIG_DEBUG_STACK_USAGE is not set
1530# CONFIG_RUNTIME_DEBUG is not set
1531CONFIG_DEBUG_ZBOOT=y
1177 1532
1178# 1533#
1179# Security options 1534# Security options
@@ -1181,67 +1536,32 @@ CONFIG_CMDLINE="mem=48M"
1181CONFIG_KEYS=y 1536CONFIG_KEYS=y
1182CONFIG_KEYS_DEBUG_PROC_KEYS=y 1537CONFIG_KEYS_DEBUG_PROC_KEYS=y
1183# CONFIG_SECURITY is not set 1538# CONFIG_SECURITY is not set
1184 1539CONFIG_SECURITYFS=y
1185# 1540# CONFIG_DEFAULT_SECURITY_SELINUX is not set
1186# Cryptographic options 1541# CONFIG_DEFAULT_SECURITY_SMACK is not set
1187# 1542# CONFIG_DEFAULT_SECURITY_TOMOYO is not set
1188CONFIG_CRYPTO=y 1543CONFIG_DEFAULT_SECURITY_DAC=y
1189CONFIG_CRYPTO_ALGAPI=y 1544CONFIG_DEFAULT_SECURITY=""
1190CONFIG_CRYPTO_BLKCIPHER=m 1545# CONFIG_CRYPTO is not set
1191CONFIG_CRYPTO_HASH=m 1546# CONFIG_BINARY_PRINTF is not set
1192CONFIG_CRYPTO_MANAGER=m
1193CONFIG_CRYPTO_HMAC=m
1194CONFIG_CRYPTO_XCBC=m
1195CONFIG_CRYPTO_NULL=m
1196CONFIG_CRYPTO_MD4=m
1197CONFIG_CRYPTO_MD5=y
1198CONFIG_CRYPTO_SHA1=m
1199CONFIG_CRYPTO_SHA256=m
1200CONFIG_CRYPTO_SHA512=m
1201CONFIG_CRYPTO_WP512=m
1202CONFIG_CRYPTO_TGR192=m
1203CONFIG_CRYPTO_GF128MUL=m
1204CONFIG_CRYPTO_ECB=m
1205CONFIG_CRYPTO_CBC=m
1206CONFIG_CRYPTO_PCBC=m
1207CONFIG_CRYPTO_LRW=m
1208CONFIG_CRYPTO_DES=m
1209CONFIG_CRYPTO_FCRYPT=m
1210CONFIG_CRYPTO_BLOWFISH=m
1211CONFIG_CRYPTO_TWOFISH=m
1212CONFIG_CRYPTO_TWOFISH_COMMON=m
1213CONFIG_CRYPTO_SERPENT=m
1214CONFIG_CRYPTO_AES=m
1215CONFIG_CRYPTO_CAST5=m
1216CONFIG_CRYPTO_CAST6=m
1217CONFIG_CRYPTO_TEA=m
1218CONFIG_CRYPTO_ARC4=m
1219CONFIG_CRYPTO_KHAZAD=m
1220CONFIG_CRYPTO_ANUBIS=m
1221CONFIG_CRYPTO_DEFLATE=m
1222CONFIG_CRYPTO_MICHAEL_MIC=m
1223CONFIG_CRYPTO_CRC32C=m
1224CONFIG_CRYPTO_CAMELLIA=m
1225# CONFIG_CRYPTO_TEST is not set
1226
1227#
1228# Hardware crypto devices
1229#
1230 1547
1231# 1548#
1232# Library routines 1549# Library routines
1233# 1550#
1234CONFIG_BITREVERSE=y 1551CONFIG_BITREVERSE=y
1235CONFIG_CRC_CCITT=y 1552CONFIG_GENERIC_FIND_LAST_BIT=y
1553# CONFIG_CRC_CCITT is not set
1236# CONFIG_CRC16 is not set 1554# CONFIG_CRC16 is not set
1555# CONFIG_CRC_T10DIF is not set
1556CONFIG_CRC_ITU_T=y
1237CONFIG_CRC32=y 1557CONFIG_CRC32=y
1238CONFIG_LIBCRC32C=y 1558# CONFIG_CRC7 is not set
1559# CONFIG_LIBCRC32C is not set
1239CONFIG_ZLIB_INFLATE=y 1560CONFIG_ZLIB_INFLATE=y
1240CONFIG_ZLIB_DEFLATE=y 1561CONFIG_ZLIB_DEFLATE=y
1241CONFIG_TEXTSEARCH=y 1562CONFIG_LZO_COMPRESS=y
1242CONFIG_TEXTSEARCH_KMP=m 1563CONFIG_LZO_DECOMPRESS=y
1243CONFIG_TEXTSEARCH_BM=m
1244CONFIG_TEXTSEARCH_FSM=m
1245CONFIG_PLIST=y
1246CONFIG_HAS_IOMEM=y 1564CONFIG_HAS_IOMEM=y
1247CONFIG_HAS_IOPORT=y 1565CONFIG_HAS_IOPORT=y
1566CONFIG_HAS_DMA=y
1567CONFIG_NLATTR=y
diff --git a/arch/mips/configs/db1500_defconfig b/arch/mips/configs/db1500_defconfig
index a15131373138..5424c9167bf2 100644
--- a/arch/mips/configs/db1500_defconfig
+++ b/arch/mips/configs/db1500_defconfig
@@ -1,80 +1,104 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.20 3# Linux kernel version: 2.6.33
4# Tue Feb 20 21:47:26 2007 4# Fri Feb 26 08:46:33 2010
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
8# 8#
9# Machine selection 9# Machine selection
10# 10#
11CONFIG_ZONE_DMA=y
12CONFIG_MACH_ALCHEMY=y 11CONFIG_MACH_ALCHEMY=y
13# CONFIG_MIPS_MTX1 is not set 12# CONFIG_AR7 is not set
14# CONFIG_MIPS_BOSPORUS is not set 13# CONFIG_BCM47XX is not set
15# CONFIG_MIPS_PB1000 is not set 14# CONFIG_BCM63XX is not set
16# CONFIG_MIPS_PB1100 is not set
17# CONFIG_MIPS_PB1500 is not set
18# CONFIG_MIPS_PB1550 is not set
19# CONFIG_MIPS_PB1200 is not set
20# CONFIG_MIPS_DB1000 is not set
21# CONFIG_MIPS_DB1100 is not set
22CONFIG_MIPS_DB1500=y
23# CONFIG_MIPS_DB1550 is not set
24# CONFIG_MIPS_DB1200 is not set
25# CONFIG_MIPS_MIRAGE is not set
26# CONFIG_MIPS_COBALT is not set 15# CONFIG_MIPS_COBALT is not set
27# CONFIG_MACH_DECSTATION is not set 16# CONFIG_MACH_DECSTATION is not set
28# CONFIG_MACH_JAZZ is not set 17# CONFIG_MACH_JAZZ is not set
18# CONFIG_LASAT is not set
19# CONFIG_MACH_LOONGSON is not set
29# CONFIG_MIPS_MALTA is not set 20# CONFIG_MIPS_MALTA is not set
30# CONFIG_WR_PPMC is not set
31# CONFIG_MIPS_SIM is not set 21# CONFIG_MIPS_SIM is not set
32# CONFIG_MOMENCO_JAGUAR_ATX is not set 22# CONFIG_NEC_MARKEINS is not set
33# CONFIG_MIPS_XXS1500 is not set 23# CONFIG_MACH_VR41XX is not set
24# CONFIG_NXP_STB220 is not set
25# CONFIG_NXP_STB225 is not set
34# CONFIG_PNX8550_JBS is not set 26# CONFIG_PNX8550_JBS is not set
35# CONFIG_PNX8550_STB810 is not set 27# CONFIG_PNX8550_STB810 is not set
36# CONFIG_MACH_VR41XX is not set 28# CONFIG_PMC_MSP is not set
37# CONFIG_PMC_YOSEMITE is not set 29# CONFIG_PMC_YOSEMITE is not set
38# CONFIG_MARKEINS is not set 30# CONFIG_POWERTV is not set
39# CONFIG_SGI_IP22 is not set 31# CONFIG_SGI_IP22 is not set
40# CONFIG_SGI_IP27 is not set 32# CONFIG_SGI_IP27 is not set
33# CONFIG_SGI_IP28 is not set
41# CONFIG_SGI_IP32 is not set 34# CONFIG_SGI_IP32 is not set
42# CONFIG_SIBYTE_BIGSUR is not set
43# CONFIG_SIBYTE_SWARM is not set
44# CONFIG_SIBYTE_SENTOSA is not set
45# CONFIG_SIBYTE_RHONE is not set
46# CONFIG_SIBYTE_CARMEL is not set
47# CONFIG_SIBYTE_LITTLESUR is not set
48# CONFIG_SIBYTE_CRHINE is not set 35# CONFIG_SIBYTE_CRHINE is not set
36# CONFIG_SIBYTE_CARMEL is not set
49# CONFIG_SIBYTE_CRHONE is not set 37# CONFIG_SIBYTE_CRHONE is not set
38# CONFIG_SIBYTE_RHONE is not set
39# CONFIG_SIBYTE_SWARM is not set
40# CONFIG_SIBYTE_LITTLESUR is not set
41# CONFIG_SIBYTE_SENTOSA is not set
42# CONFIG_SIBYTE_BIGSUR is not set
50# CONFIG_SNI_RM is not set 43# CONFIG_SNI_RM is not set
51# CONFIG_TOSHIBA_JMR3927 is not set 44# CONFIG_MACH_TX39XX is not set
52# CONFIG_TOSHIBA_RBTX4927 is not set 45# CONFIG_MACH_TX49XX is not set
53# CONFIG_TOSHIBA_RBTX4938 is not set 46# CONFIG_MIKROTIK_RB532 is not set
47# CONFIG_WR_PPMC is not set
48# CONFIG_CAVIUM_OCTEON_SIMULATOR is not set
49# CONFIG_CAVIUM_OCTEON_REFERENCE_BOARD is not set
50CONFIG_ALCHEMY_GPIOINT_AU1000=y
51# CONFIG_ALCHEMY_GPIO_INDIRECT is not set
52# CONFIG_MIPS_MTX1 is not set
53# CONFIG_MIPS_BOSPORUS is not set
54# CONFIG_MIPS_DB1000 is not set
55# CONFIG_MIPS_DB1100 is not set
56# CONFIG_MIPS_DB1200 is not set
57CONFIG_MIPS_DB1500=y
58# CONFIG_MIPS_DB1550 is not set
59# CONFIG_MIPS_MIRAGE is not set
60# CONFIG_MIPS_PB1000 is not set
61# CONFIG_MIPS_PB1100 is not set
62# CONFIG_MIPS_PB1200 is not set
63# CONFIG_MIPS_PB1500 is not set
64# CONFIG_MIPS_PB1550 is not set
65# CONFIG_MIPS_XXS1500 is not set
66CONFIG_SOC_AU1500=y
67CONFIG_SOC_AU1X00=y
68CONFIG_LOONGSON_UART_BASE=y
54CONFIG_RWSEM_GENERIC_SPINLOCK=y 69CONFIG_RWSEM_GENERIC_SPINLOCK=y
55# CONFIG_ARCH_HAS_ILOG2_U32 is not set 70# CONFIG_ARCH_HAS_ILOG2_U32 is not set
56# CONFIG_ARCH_HAS_ILOG2_U64 is not set 71# CONFIG_ARCH_HAS_ILOG2_U64 is not set
72CONFIG_ARCH_SUPPORTS_OPROFILE=y
57CONFIG_GENERIC_FIND_NEXT_BIT=y 73CONFIG_GENERIC_FIND_NEXT_BIT=y
58CONFIG_GENERIC_HWEIGHT=y 74CONFIG_GENERIC_HWEIGHT=y
59CONFIG_GENERIC_CALIBRATE_DELAY=y 75CONFIG_GENERIC_CALIBRATE_DELAY=y
76CONFIG_GENERIC_CLOCKEVENTS=y
60CONFIG_GENERIC_TIME=y 77CONFIG_GENERIC_TIME=y
61CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y 78CONFIG_GENERIC_CMOS_UPDATE=y
62# CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ is not set 79CONFIG_SCHED_OMIT_FRAME_POINTER=y
80CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
81CONFIG_CEVT_R4K_LIB=y
82CONFIG_CSRC_R4K_LIB=y
63CONFIG_DMA_NONCOHERENT=y 83CONFIG_DMA_NONCOHERENT=y
64CONFIG_DMA_NEED_PCI_MAP_STATE=y 84CONFIG_DMA_NEED_PCI_MAP_STATE=y
85CONFIG_SYS_HAS_EARLY_PRINTK=y
65CONFIG_MIPS_DISABLE_OBSOLETE_IDE=y 86CONFIG_MIPS_DISABLE_OBSOLETE_IDE=y
87# CONFIG_NO_IOPORT is not set
88CONFIG_GENERIC_GPIO=y
66# CONFIG_CPU_BIG_ENDIAN is not set 89# CONFIG_CPU_BIG_ENDIAN is not set
67CONFIG_CPU_LITTLE_ENDIAN=y 90CONFIG_CPU_LITTLE_ENDIAN=y
68CONFIG_SYS_SUPPORTS_APM_EMULATION=y 91CONFIG_SYS_SUPPORTS_APM_EMULATION=y
69CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y 92CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y
70CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y 93CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
71CONFIG_SOC_AU1500=y 94CONFIG_IRQ_CPU=y
72CONFIG_SOC_AU1X00=y
73CONFIG_MIPS_L1_CACHE_SHIFT=5 95CONFIG_MIPS_L1_CACHE_SHIFT=5
74 96
75# 97#
76# CPU selection 98# CPU selection
77# 99#
100# CONFIG_CPU_LOONGSON2E is not set
101# CONFIG_CPU_LOONGSON2F is not set
78CONFIG_CPU_MIPS32_R1=y 102CONFIG_CPU_MIPS32_R1=y
79# CONFIG_CPU_MIPS32_R2 is not set 103# CONFIG_CPU_MIPS32_R2 is not set
80# CONFIG_CPU_MIPS64_R1 is not set 104# CONFIG_CPU_MIPS64_R1 is not set
@@ -87,6 +111,7 @@ CONFIG_CPU_MIPS32_R1=y
87# CONFIG_CPU_TX49XX is not set 111# CONFIG_CPU_TX49XX is not set
88# CONFIG_CPU_R5000 is not set 112# CONFIG_CPU_R5000 is not set
89# CONFIG_CPU_R5432 is not set 113# CONFIG_CPU_R5432 is not set
114# CONFIG_CPU_R5500 is not set
90# CONFIG_CPU_R6000 is not set 115# CONFIG_CPU_R6000 is not set
91# CONFIG_CPU_NEVADA is not set 116# CONFIG_CPU_NEVADA is not set
92# CONFIG_CPU_R8000 is not set 117# CONFIG_CPU_R8000 is not set
@@ -94,11 +119,14 @@ CONFIG_CPU_MIPS32_R1=y
94# CONFIG_CPU_RM7000 is not set 119# CONFIG_CPU_RM7000 is not set
95# CONFIG_CPU_RM9000 is not set 120# CONFIG_CPU_RM9000 is not set
96# CONFIG_CPU_SB1 is not set 121# CONFIG_CPU_SB1 is not set
122# CONFIG_CPU_CAVIUM_OCTEON is not set
123CONFIG_SYS_SUPPORTS_ZBOOT=y
97CONFIG_SYS_HAS_CPU_MIPS32_R1=y 124CONFIG_SYS_HAS_CPU_MIPS32_R1=y
98CONFIG_CPU_MIPS32=y 125CONFIG_CPU_MIPS32=y
99CONFIG_CPU_MIPSR1=y 126CONFIG_CPU_MIPSR1=y
100CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y 127CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
101CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y 128CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
129CONFIG_HARDWARE_WATCHPOINTS=y
102 130
103# 131#
104# Kernel type 132# Kernel type
@@ -108,137 +136,207 @@ CONFIG_32BIT=y
108CONFIG_PAGE_SIZE_4KB=y 136CONFIG_PAGE_SIZE_4KB=y
109# CONFIG_PAGE_SIZE_8KB is not set 137# CONFIG_PAGE_SIZE_8KB is not set
110# CONFIG_PAGE_SIZE_16KB is not set 138# CONFIG_PAGE_SIZE_16KB is not set
139# CONFIG_PAGE_SIZE_32KB is not set
111# CONFIG_PAGE_SIZE_64KB is not set 140# CONFIG_PAGE_SIZE_64KB is not set
112CONFIG_CPU_HAS_PREFETCH=y 141CONFIG_CPU_HAS_PREFETCH=y
113CONFIG_MIPS_MT_DISABLED=y 142CONFIG_MIPS_MT_DISABLED=y
114# CONFIG_MIPS_MT_SMP is not set 143# CONFIG_MIPS_MT_SMP is not set
115# CONFIG_MIPS_MT_SMTC is not set 144# CONFIG_MIPS_MT_SMTC is not set
116# CONFIG_MIPS_VPE_LOADER is not set
117CONFIG_64BIT_PHYS_ADDR=y 145CONFIG_64BIT_PHYS_ADDR=y
146CONFIG_ARCH_PHYS_ADDR_T_64BIT=y
118CONFIG_CPU_HAS_SYNC=y 147CONFIG_CPU_HAS_SYNC=y
119CONFIG_GENERIC_HARDIRQS=y 148CONFIG_GENERIC_HARDIRQS=y
120CONFIG_GENERIC_IRQ_PROBE=y 149CONFIG_GENERIC_IRQ_PROBE=y
121CONFIG_CPU_SUPPORTS_HIGHMEM=y 150CONFIG_CPU_SUPPORTS_HIGHMEM=y
122CONFIG_ARCH_FLATMEM_ENABLE=y 151CONFIG_ARCH_FLATMEM_ENABLE=y
152CONFIG_ARCH_POPULATES_NODE_MAP=y
123CONFIG_SELECT_MEMORY_MODEL=y 153CONFIG_SELECT_MEMORY_MODEL=y
124CONFIG_FLATMEM_MANUAL=y 154CONFIG_FLATMEM_MANUAL=y
125# CONFIG_DISCONTIGMEM_MANUAL is not set 155# CONFIG_DISCONTIGMEM_MANUAL is not set
126# CONFIG_SPARSEMEM_MANUAL is not set 156# CONFIG_SPARSEMEM_MANUAL is not set
127CONFIG_FLATMEM=y 157CONFIG_FLATMEM=y
128CONFIG_FLAT_NODE_MEM_MAP=y 158CONFIG_FLAT_NODE_MEM_MAP=y
129# CONFIG_SPARSEMEM_STATIC is not set 159CONFIG_PAGEFLAGS_EXTENDED=y
130CONFIG_SPLIT_PTLOCK_CPUS=4 160CONFIG_SPLIT_PTLOCK_CPUS=4
131CONFIG_RESOURCES_64BIT=y 161CONFIG_PHYS_ADDR_T_64BIT=y
132CONFIG_ZONE_DMA_FLAG=1 162CONFIG_ZONE_DMA_FLAG=0
163CONFIG_VIRT_TO_BUS=y
164# CONFIG_KSM is not set
165CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
166CONFIG_TICK_ONESHOT=y
167CONFIG_NO_HZ=y
168CONFIG_HIGH_RES_TIMERS=y
169CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
133# CONFIG_HZ_48 is not set 170# CONFIG_HZ_48 is not set
134# CONFIG_HZ_100 is not set 171CONFIG_HZ_100=y
135# CONFIG_HZ_128 is not set 172# CONFIG_HZ_128 is not set
136# CONFIG_HZ_250 is not set 173# CONFIG_HZ_250 is not set
137# CONFIG_HZ_256 is not set 174# CONFIG_HZ_256 is not set
138CONFIG_HZ_1000=y 175# CONFIG_HZ_1000 is not set
139# CONFIG_HZ_1024 is not set 176# CONFIG_HZ_1024 is not set
140CONFIG_SYS_SUPPORTS_ARBIT_HZ=y 177CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
141CONFIG_HZ=1000 178CONFIG_HZ=100
142CONFIG_PREEMPT_NONE=y 179CONFIG_PREEMPT_NONE=y
143# CONFIG_PREEMPT_VOLUNTARY is not set 180# CONFIG_PREEMPT_VOLUNTARY is not set
144# CONFIG_PREEMPT is not set 181# CONFIG_PREEMPT is not set
145# CONFIG_KEXEC is not set 182# CONFIG_KEXEC is not set
183# CONFIG_SECCOMP is not set
146CONFIG_LOCKDEP_SUPPORT=y 184CONFIG_LOCKDEP_SUPPORT=y
147CONFIG_STACKTRACE_SUPPORT=y 185CONFIG_STACKTRACE_SUPPORT=y
148CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 186CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
187CONFIG_CONSTRUCTORS=y
149 188
150# 189#
151# Code maturity level options 190# General setup
152# 191#
153CONFIG_EXPERIMENTAL=y 192CONFIG_EXPERIMENTAL=y
154CONFIG_BROKEN_ON_SMP=y 193CONFIG_BROKEN_ON_SMP=y
155CONFIG_INIT_ENV_ARG_LIMIT=32 194CONFIG_INIT_ENV_ARG_LIMIT=32
156 195CONFIG_LOCALVERSION="-db1500"
157#
158# General setup
159#
160CONFIG_LOCALVERSION=""
161CONFIG_LOCALVERSION_AUTO=y 196CONFIG_LOCALVERSION_AUTO=y
197CONFIG_HAVE_KERNEL_GZIP=y
198CONFIG_HAVE_KERNEL_BZIP2=y
199CONFIG_HAVE_KERNEL_LZMA=y
200CONFIG_HAVE_KERNEL_LZO=y
201# CONFIG_KERNEL_GZIP is not set
202# CONFIG_KERNEL_BZIP2 is not set
203CONFIG_KERNEL_LZMA=y
204# CONFIG_KERNEL_LZO is not set
162CONFIG_SWAP=y 205CONFIG_SWAP=y
163CONFIG_SYSVIPC=y 206CONFIG_SYSVIPC=y
164# CONFIG_IPC_NS is not set
165CONFIG_SYSVIPC_SYSCTL=y 207CONFIG_SYSVIPC_SYSCTL=y
166# CONFIG_POSIX_MQUEUE is not set 208# CONFIG_POSIX_MQUEUE is not set
167# CONFIG_BSD_PROCESS_ACCT is not set 209# CONFIG_BSD_PROCESS_ACCT is not set
168# CONFIG_TASKSTATS is not set 210# CONFIG_TASKSTATS is not set
169# CONFIG_UTS_NS is not set
170# CONFIG_AUDIT is not set 211# CONFIG_AUDIT is not set
212
213#
214# RCU Subsystem
215#
216CONFIG_TREE_RCU=y
217# CONFIG_TREE_PREEMPT_RCU is not set
218# CONFIG_TINY_RCU is not set
219# CONFIG_RCU_TRACE is not set
220CONFIG_RCU_FANOUT=32
221# CONFIG_RCU_FANOUT_EXACT is not set
222# CONFIG_TREE_RCU_TRACE is not set
171# CONFIG_IKCONFIG is not set 223# CONFIG_IKCONFIG is not set
172CONFIG_SYSFS_DEPRECATED=y 224CONFIG_LOG_BUF_SHIFT=14
173CONFIG_RELAY=y 225# CONFIG_GROUP_SCHED is not set
174# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 226# CONFIG_CGROUPS is not set
227# CONFIG_SYSFS_DEPRECATED_V2 is not set
228# CONFIG_RELAY is not set
229# CONFIG_NAMESPACES is not set
230# CONFIG_BLK_DEV_INITRD is not set
231CONFIG_CC_OPTIMIZE_FOR_SIZE=y
175CONFIG_SYSCTL=y 232CONFIG_SYSCTL=y
233CONFIG_ANON_INODES=y
176CONFIG_EMBEDDED=y 234CONFIG_EMBEDDED=y
177CONFIG_SYSCTL_SYSCALL=y 235CONFIG_SYSCTL_SYSCALL=y
178CONFIG_KALLSYMS=y 236# CONFIG_KALLSYMS is not set
179# CONFIG_KALLSYMS_EXTRA_PASS is not set
180CONFIG_HOTPLUG=y 237CONFIG_HOTPLUG=y
181CONFIG_PRINTK=y 238CONFIG_PRINTK=y
182CONFIG_BUG=y 239CONFIG_BUG=y
183CONFIG_ELF_CORE=y 240CONFIG_ELF_CORE=y
241# CONFIG_PCSPKR_PLATFORM is not set
184CONFIG_BASE_FULL=y 242CONFIG_BASE_FULL=y
185CONFIG_FUTEX=y 243CONFIG_FUTEX=y
186CONFIG_EPOLL=y 244CONFIG_EPOLL=y
245CONFIG_SIGNALFD=y
246CONFIG_TIMERFD=y
247CONFIG_EVENTFD=y
187CONFIG_SHMEM=y 248CONFIG_SHMEM=y
249CONFIG_AIO=y
250
251#
252# Kernel Performance Events And Counters
253#
254# CONFIG_VM_EVENT_COUNTERS is not set
255CONFIG_PCI_QUIRKS=y
256# CONFIG_COMPAT_BRK is not set
188CONFIG_SLAB=y 257CONFIG_SLAB=y
189CONFIG_VM_EVENT_COUNTERS=y 258# CONFIG_SLUB is not set
190CONFIG_RT_MUTEXES=y
191# CONFIG_TINY_SHMEM is not set
192CONFIG_BASE_SMALL=0
193# CONFIG_SLOB is not set 259# CONFIG_SLOB is not set
260# CONFIG_PROFILING is not set
261CONFIG_HAVE_OPROFILE=y
194 262
195# 263#
196# Loadable module support 264# GCOV-based kernel profiling
197# 265#
266# CONFIG_SLOW_WORK is not set
267CONFIG_HAVE_GENERIC_DMA_COHERENT=y
268CONFIG_SLABINFO=y
269CONFIG_RT_MUTEXES=y
270CONFIG_BASE_SMALL=0
198CONFIG_MODULES=y 271CONFIG_MODULES=y
272# CONFIG_MODULE_FORCE_LOAD is not set
199CONFIG_MODULE_UNLOAD=y 273CONFIG_MODULE_UNLOAD=y
200# CONFIG_MODULE_FORCE_UNLOAD is not set 274# CONFIG_MODULE_FORCE_UNLOAD is not set
201CONFIG_MODVERSIONS=y 275# CONFIG_MODVERSIONS is not set
202CONFIG_MODULE_SRCVERSION_ALL=y 276# CONFIG_MODULE_SRCVERSION_ALL is not set
203CONFIG_KMOD=y
204
205#
206# Block layer
207#
208CONFIG_BLOCK=y 277CONFIG_BLOCK=y
209# CONFIG_LBD is not set 278CONFIG_LBDAF=y
210# CONFIG_BLK_DEV_IO_TRACE is not set 279CONFIG_BLK_DEV_BSG=y
211# CONFIG_LSF is not set 280# CONFIG_BLK_DEV_INTEGRITY is not set
212 281
213# 282#
214# IO Schedulers 283# IO Schedulers
215# 284#
216CONFIG_IOSCHED_NOOP=y 285CONFIG_IOSCHED_NOOP=y
217CONFIG_IOSCHED_AS=y 286# CONFIG_IOSCHED_DEADLINE is not set
218CONFIG_IOSCHED_DEADLINE=y 287# CONFIG_IOSCHED_CFQ is not set
219CONFIG_IOSCHED_CFQ=y
220CONFIG_DEFAULT_AS=y
221# CONFIG_DEFAULT_DEADLINE is not set 288# CONFIG_DEFAULT_DEADLINE is not set
222# CONFIG_DEFAULT_CFQ is not set 289# CONFIG_DEFAULT_CFQ is not set
223# CONFIG_DEFAULT_NOOP is not set 290CONFIG_DEFAULT_NOOP=y
224CONFIG_DEFAULT_IOSCHED="anticipatory" 291CONFIG_DEFAULT_IOSCHED="noop"
292# CONFIG_INLINE_SPIN_TRYLOCK is not set
293# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set
294# CONFIG_INLINE_SPIN_LOCK is not set
295# CONFIG_INLINE_SPIN_LOCK_BH is not set
296# CONFIG_INLINE_SPIN_LOCK_IRQ is not set
297# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set
298CONFIG_INLINE_SPIN_UNLOCK=y
299# CONFIG_INLINE_SPIN_UNLOCK_BH is not set
300CONFIG_INLINE_SPIN_UNLOCK_IRQ=y
301# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set
302# CONFIG_INLINE_READ_TRYLOCK is not set
303# CONFIG_INLINE_READ_LOCK is not set
304# CONFIG_INLINE_READ_LOCK_BH is not set
305# CONFIG_INLINE_READ_LOCK_IRQ is not set
306# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set
307CONFIG_INLINE_READ_UNLOCK=y
308# CONFIG_INLINE_READ_UNLOCK_BH is not set
309CONFIG_INLINE_READ_UNLOCK_IRQ=y
310# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set
311# CONFIG_INLINE_WRITE_TRYLOCK is not set
312# CONFIG_INLINE_WRITE_LOCK is not set
313# CONFIG_INLINE_WRITE_LOCK_BH is not set
314# CONFIG_INLINE_WRITE_LOCK_IRQ is not set
315# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set
316CONFIG_INLINE_WRITE_UNLOCK=y
317# CONFIG_INLINE_WRITE_UNLOCK_BH is not set
318CONFIG_INLINE_WRITE_UNLOCK_IRQ=y
319# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set
320# CONFIG_MUTEX_SPIN_ON_OWNER is not set
321CONFIG_FREEZER=y
225 322
226# 323#
227# Bus options (PCI, PCMCIA, EISA, ISA, TC) 324# Bus options (PCI, PCMCIA, EISA, ISA, TC)
228# 325#
229CONFIG_HW_HAS_PCI=y 326CONFIG_HW_HAS_PCI=y
230CONFIG_PCI=y 327CONFIG_PCI=y
328CONFIG_PCI_DOMAINS=y
329# CONFIG_ARCH_SUPPORTS_MSI is not set
330# CONFIG_PCI_LEGACY is not set
331# CONFIG_PCI_DEBUG is not set
332# CONFIG_PCI_STUB is not set
333# CONFIG_PCI_IOV is not set
231CONFIG_MMU=y 334CONFIG_MMU=y
232 335CONFIG_PCCARD=y
233# 336CONFIG_PCMCIA=y
234# PCCARD (PCMCIA/CardBus) support
235#
236CONFIG_PCCARD=m
237# CONFIG_PCMCIA_DEBUG is not set
238CONFIG_PCMCIA=m
239CONFIG_PCMCIA_LOAD_CIS=y 337CONFIG_PCMCIA_LOAD_CIS=y
240CONFIG_PCMCIA_IOCTL=y 338# CONFIG_PCMCIA_IOCTL is not set
241CONFIG_CARDBUS=y 339# CONFIG_CARDBUS is not set
242 340
243# 341#
244# PC-card bridges 342# PC-card bridges
@@ -246,51 +344,49 @@ CONFIG_CARDBUS=y
246# CONFIG_YENTA is not set 344# CONFIG_YENTA is not set
247# CONFIG_PD6729 is not set 345# CONFIG_PD6729 is not set
248# CONFIG_I82092 is not set 346# CONFIG_I82092 is not set
249CONFIG_PCMCIA_AU1X00=m 347# CONFIG_PCMCIA_AU1X00 is not set
250 348CONFIG_PCMCIA_ALCHEMY_DEVBOARD=y
251#
252# PCI Hotplug Support
253#
254# CONFIG_HOTPLUG_PCI is not set 349# CONFIG_HOTPLUG_PCI is not set
255 350
256# 351#
257# Executable file formats 352# Executable file formats
258# 353#
259CONFIG_BINFMT_ELF=y 354CONFIG_BINFMT_ELF=y
355# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
356# CONFIG_HAVE_AOUT is not set
260# CONFIG_BINFMT_MISC is not set 357# CONFIG_BINFMT_MISC is not set
261CONFIG_TRAD_SIGNALS=y 358CONFIG_TRAD_SIGNALS=y
262 359
263# 360#
264# Power management options 361# Power management options
265# 362#
266# CONFIG_PM is not set 363CONFIG_ARCH_HIBERNATION_POSSIBLE=y
267 364CONFIG_ARCH_SUSPEND_POSSIBLE=y
268# 365CONFIG_PM=y
269# Networking 366# CONFIG_PM_DEBUG is not set
270# 367CONFIG_PM_SLEEP=y
368CONFIG_SUSPEND=y
369CONFIG_SUSPEND_FREEZER=y
370# CONFIG_HIBERNATION is not set
371# CONFIG_APM_EMULATION is not set
372CONFIG_PM_RUNTIME=y
271CONFIG_NET=y 373CONFIG_NET=y
272 374
273# 375#
274# Networking options 376# Networking options
275# 377#
276# CONFIG_NETDEBUG is not set
277CONFIG_PACKET=y 378CONFIG_PACKET=y
278# CONFIG_PACKET_MMAP is not set 379CONFIG_PACKET_MMAP=y
279CONFIG_UNIX=y 380CONFIG_UNIX=y
280CONFIG_XFRM=y 381# CONFIG_NET_KEY is not set
281CONFIG_XFRM_USER=m
282# CONFIG_XFRM_SUB_POLICY is not set
283CONFIG_XFRM_MIGRATE=y
284CONFIG_NET_KEY=y
285CONFIG_NET_KEY_MIGRATE=y
286CONFIG_INET=y 382CONFIG_INET=y
287CONFIG_IP_MULTICAST=y 383CONFIG_IP_MULTICAST=y
288# CONFIG_IP_ADVANCED_ROUTER is not set 384# CONFIG_IP_ADVANCED_ROUTER is not set
289CONFIG_IP_FIB_HASH=y 385CONFIG_IP_FIB_HASH=y
290CONFIG_IP_PNP=y 386CONFIG_IP_PNP=y
291# CONFIG_IP_PNP_DHCP is not set 387CONFIG_IP_PNP_DHCP=y
292CONFIG_IP_PNP_BOOTP=y 388CONFIG_IP_PNP_BOOTP=y
293# CONFIG_IP_PNP_RARP is not set 389CONFIG_IP_PNP_RARP=y
294# CONFIG_NET_IPIP is not set 390# CONFIG_NET_IPIP is not set
295# CONFIG_NET_IPGRE is not set 391# CONFIG_NET_IPGRE is not set
296# CONFIG_IP_MROUTE is not set 392# CONFIG_IP_MROUTE is not set
@@ -301,110 +397,25 @@ CONFIG_IP_PNP_BOOTP=y
301# CONFIG_INET_IPCOMP is not set 397# CONFIG_INET_IPCOMP is not set
302# CONFIG_INET_XFRM_TUNNEL is not set 398# CONFIG_INET_XFRM_TUNNEL is not set
303# CONFIG_INET_TUNNEL is not set 399# CONFIG_INET_TUNNEL is not set
304CONFIG_INET_XFRM_MODE_TRANSPORT=m 400# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
305CONFIG_INET_XFRM_MODE_TUNNEL=m 401# CONFIG_INET_XFRM_MODE_TUNNEL is not set
306CONFIG_INET_XFRM_MODE_BEET=m 402# CONFIG_INET_XFRM_MODE_BEET is not set
307CONFIG_INET_DIAG=y 403CONFIG_INET_LRO=y
308CONFIG_INET_TCP_DIAG=y 404# CONFIG_INET_DIAG is not set
309# CONFIG_TCP_CONG_ADVANCED is not set 405# CONFIG_TCP_CONG_ADVANCED is not set
310CONFIG_TCP_CONG_CUBIC=y 406CONFIG_TCP_CONG_CUBIC=y
311CONFIG_DEFAULT_TCP_CONG="cubic" 407CONFIG_DEFAULT_TCP_CONG="cubic"
312CONFIG_TCP_MD5SIG=y 408# CONFIG_TCP_MD5SIG is not set
313
314#
315# IP: Virtual Server Configuration
316#
317# CONFIG_IP_VS is not set
318# CONFIG_IPV6 is not set 409# CONFIG_IPV6 is not set
319# CONFIG_INET6_XFRM_TUNNEL is not set 410# CONFIG_NETWORK_SECMARK is not set
320# CONFIG_INET6_TUNNEL is not set 411# CONFIG_NETFILTER is not set
321CONFIG_NETWORK_SECMARK=y
322CONFIG_NETFILTER=y
323# CONFIG_NETFILTER_DEBUG is not set
324
325#
326# Core Netfilter Configuration
327#
328CONFIG_NETFILTER_NETLINK=m
329CONFIG_NETFILTER_NETLINK_QUEUE=m
330CONFIG_NETFILTER_NETLINK_LOG=m
331CONFIG_NF_CONNTRACK_ENABLED=m
332CONFIG_NF_CONNTRACK_SUPPORT=y
333# CONFIG_IP_NF_CONNTRACK_SUPPORT is not set
334CONFIG_NF_CONNTRACK=m
335CONFIG_NF_CT_ACCT=y
336CONFIG_NF_CONNTRACK_MARK=y
337CONFIG_NF_CONNTRACK_SECMARK=y
338CONFIG_NF_CONNTRACK_EVENTS=y
339CONFIG_NF_CT_PROTO_GRE=m
340CONFIG_NF_CT_PROTO_SCTP=m
341CONFIG_NF_CONNTRACK_AMANDA=m
342CONFIG_NF_CONNTRACK_FTP=m
343CONFIG_NF_CONNTRACK_H323=m
344CONFIG_NF_CONNTRACK_IRC=m
345# CONFIG_NF_CONNTRACK_NETBIOS_NS is not set
346CONFIG_NF_CONNTRACK_PPTP=m
347CONFIG_NF_CONNTRACK_SANE=m
348CONFIG_NF_CONNTRACK_SIP=m
349CONFIG_NF_CONNTRACK_TFTP=m
350CONFIG_NF_CT_NETLINK=m
351CONFIG_NETFILTER_XTABLES=m
352CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
353CONFIG_NETFILTER_XT_TARGET_MARK=m
354CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
355CONFIG_NETFILTER_XT_TARGET_NFLOG=m
356CONFIG_NETFILTER_XT_TARGET_SECMARK=m
357CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=m
358CONFIG_NETFILTER_XT_TARGET_TCPMSS=m
359CONFIG_NETFILTER_XT_MATCH_COMMENT=m
360CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
361CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
362CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
363CONFIG_NETFILTER_XT_MATCH_DCCP=m
364CONFIG_NETFILTER_XT_MATCH_DSCP=m
365CONFIG_NETFILTER_XT_MATCH_ESP=m
366CONFIG_NETFILTER_XT_MATCH_HELPER=m
367CONFIG_NETFILTER_XT_MATCH_LENGTH=m
368CONFIG_NETFILTER_XT_MATCH_LIMIT=m
369CONFIG_NETFILTER_XT_MATCH_MAC=m
370CONFIG_NETFILTER_XT_MATCH_MARK=m
371CONFIG_NETFILTER_XT_MATCH_POLICY=m
372CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
373CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
374CONFIG_NETFILTER_XT_MATCH_QUOTA=m
375CONFIG_NETFILTER_XT_MATCH_REALM=m
376CONFIG_NETFILTER_XT_MATCH_SCTP=m
377CONFIG_NETFILTER_XT_MATCH_STATE=m
378CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
379CONFIG_NETFILTER_XT_MATCH_STRING=m
380CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
381CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
382
383#
384# IP: Netfilter Configuration
385#
386CONFIG_NF_CONNTRACK_IPV4=m
387CONFIG_NF_CONNTRACK_PROC_COMPAT=y
388# CONFIG_IP_NF_QUEUE is not set
389# CONFIG_IP_NF_IPTABLES is not set
390# CONFIG_IP_NF_ARPTABLES is not set
391
392#
393# DCCP Configuration (EXPERIMENTAL)
394#
395# CONFIG_IP_DCCP is not set 412# CONFIG_IP_DCCP is not set
396
397#
398# SCTP Configuration (EXPERIMENTAL)
399#
400# CONFIG_IP_SCTP is not set 413# CONFIG_IP_SCTP is not set
401 414# CONFIG_RDS is not set
402#
403# TIPC Configuration (EXPERIMENTAL)
404#
405# CONFIG_TIPC is not set 415# CONFIG_TIPC is not set
406# CONFIG_ATM is not set 416# CONFIG_ATM is not set
407# CONFIG_BRIDGE is not set 417# CONFIG_BRIDGE is not set
418# CONFIG_NET_DSA is not set
408# CONFIG_VLAN_8021Q is not set 419# CONFIG_VLAN_8021Q is not set
409# CONFIG_DECNET is not set 420# CONFIG_DECNET is not set
410# CONFIG_LLC2 is not set 421# CONFIG_LLC2 is not set
@@ -414,27 +425,24 @@ CONFIG_NF_CONNTRACK_PROC_COMPAT=y
414# CONFIG_LAPB is not set 425# CONFIG_LAPB is not set
415# CONFIG_ECONET is not set 426# CONFIG_ECONET is not set
416# CONFIG_WAN_ROUTER is not set 427# CONFIG_WAN_ROUTER is not set
417 428# CONFIG_PHONET is not set
418# 429# CONFIG_IEEE802154 is not set
419# QoS and/or fair queueing
420#
421# CONFIG_NET_SCHED is not set 430# CONFIG_NET_SCHED is not set
422CONFIG_NET_CLS_ROUTE=y 431# CONFIG_DCB is not set
423 432
424# 433#
425# Network testing 434# Network testing
426# 435#
427# CONFIG_NET_PKTGEN is not set 436# CONFIG_NET_PKTGEN is not set
428# CONFIG_HAMRADIO is not set 437# CONFIG_HAMRADIO is not set
438# CONFIG_CAN is not set
429# CONFIG_IRDA is not set 439# CONFIG_IRDA is not set
430# CONFIG_BT is not set 440# CONFIG_BT is not set
431CONFIG_IEEE80211=m 441# CONFIG_AF_RXRPC is not set
432# CONFIG_IEEE80211_DEBUG is not set 442# CONFIG_WIRELESS is not set
433CONFIG_IEEE80211_CRYPT_WEP=m 443# CONFIG_WIMAX is not set
434CONFIG_IEEE80211_CRYPT_CCMP=m 444# CONFIG_RFKILL is not set
435CONFIG_IEEE80211_SOFTMAC=m 445# CONFIG_NET_9P is not set
436# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set
437CONFIG_WIRELESS_EXT=y
438 446
439# 447#
440# Device Drivers 448# Device Drivers
@@ -443,25 +451,25 @@ CONFIG_WIRELESS_EXT=y
443# 451#
444# Generic Driver Options 452# Generic Driver Options
445# 453#
454CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
455# CONFIG_DEVTMPFS is not set
446CONFIG_STANDALONE=y 456CONFIG_STANDALONE=y
447CONFIG_PREVENT_FIRMWARE_BUILD=y 457CONFIG_PREVENT_FIRMWARE_BUILD=y
448CONFIG_FW_LOADER=m 458CONFIG_FW_LOADER=y
459CONFIG_FIRMWARE_IN_KERNEL=y
460CONFIG_EXTRA_FIRMWARE=""
461# CONFIG_DEBUG_DRIVER is not set
462# CONFIG_DEBUG_DEVRES is not set
449# CONFIG_SYS_HYPERVISOR is not set 463# CONFIG_SYS_HYPERVISOR is not set
450 464# CONFIG_CONNECTOR is not set
451#
452# Connector - unified userspace <-> kernelspace linker
453#
454CONFIG_CONNECTOR=m
455
456#
457# Memory Technology Devices (MTD)
458#
459CONFIG_MTD=y 465CONFIG_MTD=y
460# CONFIG_MTD_DEBUG is not set 466# CONFIG_MTD_DEBUG is not set
467# CONFIG_MTD_TESTS is not set
461# CONFIG_MTD_CONCAT is not set 468# CONFIG_MTD_CONCAT is not set
462CONFIG_MTD_PARTITIONS=y 469CONFIG_MTD_PARTITIONS=y
463# CONFIG_MTD_REDBOOT_PARTS is not set 470# CONFIG_MTD_REDBOOT_PARTS is not set
464# CONFIG_MTD_CMDLINE_PARTS is not set 471CONFIG_MTD_CMDLINE_PARTS=y
472# CONFIG_MTD_AR7_PARTS is not set
465 473
466# 474#
467# User Modules And Translation Layers 475# User Modules And Translation Layers
@@ -474,6 +482,7 @@ CONFIG_MTD_BLOCK=y
474# CONFIG_INFTL is not set 482# CONFIG_INFTL is not set
475# CONFIG_RFD_FTL is not set 483# CONFIG_RFD_FTL is not set
476# CONFIG_SSFDC is not set 484# CONFIG_SSFDC is not set
485# CONFIG_MTD_OOPS is not set
477 486
478# 487#
479# RAM/ROM/Flash chip drivers 488# RAM/ROM/Flash chip drivers
@@ -499,14 +508,14 @@ CONFIG_MTD_CFI_UTIL=y
499# CONFIG_MTD_RAM is not set 508# CONFIG_MTD_RAM is not set
500# CONFIG_MTD_ROM is not set 509# CONFIG_MTD_ROM is not set
501# CONFIG_MTD_ABSENT is not set 510# CONFIG_MTD_ABSENT is not set
502# CONFIG_MTD_OBSOLETE_CHIPS is not set
503 511
504# 512#
505# Mapping drivers for chip access 513# Mapping drivers for chip access
506# 514#
507# CONFIG_MTD_COMPLEX_MAPPINGS is not set 515# CONFIG_MTD_COMPLEX_MAPPINGS is not set
508# CONFIG_MTD_PHYSMAP is not set 516CONFIG_MTD_PHYSMAP=y
509CONFIG_MTD_ALCHEMY=y 517# CONFIG_MTD_PHYSMAP_COMPAT is not set
518# CONFIG_MTD_INTEL_VR_NOR is not set
510# CONFIG_MTD_PLATRAM is not set 519# CONFIG_MTD_PLATRAM is not set
511 520
512# 521#
@@ -524,152 +533,152 @@ CONFIG_MTD_ALCHEMY=y
524# CONFIG_MTD_DOC2000 is not set 533# CONFIG_MTD_DOC2000 is not set
525# CONFIG_MTD_DOC2001 is not set 534# CONFIG_MTD_DOC2001 is not set
526# CONFIG_MTD_DOC2001PLUS is not set 535# CONFIG_MTD_DOC2001PLUS is not set
527
528#
529# NAND Flash Device Drivers
530#
531# CONFIG_MTD_NAND is not set 536# CONFIG_MTD_NAND is not set
532
533#
534# OneNAND Flash Device Drivers
535#
536# CONFIG_MTD_ONENAND is not set 537# CONFIG_MTD_ONENAND is not set
537 538
538# 539#
539# Parallel port support 540# LPDDR flash memory drivers
540#
541# CONFIG_PARPORT is not set
542
543#
544# Plug and Play support
545# 541#
546# CONFIG_PNPACPI is not set 542# CONFIG_MTD_LPDDR is not set
547 543
548# 544#
549# Block devices 545# UBI - Unsorted block images
550# 546#
547# CONFIG_MTD_UBI is not set
548# CONFIG_PARPORT is not set
549CONFIG_BLK_DEV=y
551# CONFIG_BLK_CPQ_DA is not set 550# CONFIG_BLK_CPQ_DA is not set
552# CONFIG_BLK_CPQ_CISS_DA is not set 551# CONFIG_BLK_CPQ_CISS_DA is not set
553# CONFIG_BLK_DEV_DAC960 is not set 552# CONFIG_BLK_DEV_DAC960 is not set
554# CONFIG_BLK_DEV_UMEM is not set 553# CONFIG_BLK_DEV_UMEM is not set
555# CONFIG_BLK_DEV_COW_COMMON is not set 554# CONFIG_BLK_DEV_COW_COMMON is not set
556CONFIG_BLK_DEV_LOOP=y 555# CONFIG_BLK_DEV_LOOP is not set
557# CONFIG_BLK_DEV_CRYPTOLOOP is not set 556
557#
558# DRBD disabled because PROC_FS, INET or CONNECTOR not selected
559#
558# CONFIG_BLK_DEV_NBD is not set 560# CONFIG_BLK_DEV_NBD is not set
559# CONFIG_BLK_DEV_SX8 is not set 561# CONFIG_BLK_DEV_SX8 is not set
560# CONFIG_BLK_DEV_UB is not set 562# CONFIG_BLK_DEV_UB is not set
561# CONFIG_BLK_DEV_RAM is not set 563# CONFIG_BLK_DEV_RAM is not set
562# CONFIG_BLK_DEV_INITRD is not set 564# CONFIG_CDROM_PKTCDVD is not set
563CONFIG_CDROM_PKTCDVD=m 565# CONFIG_ATA_OVER_ETH is not set
564CONFIG_CDROM_PKTCDVD_BUFFERS=8 566# CONFIG_BLK_DEV_HD is not set
565# CONFIG_CDROM_PKTCDVD_WCACHE is not set 567# CONFIG_MISC_DEVICES is not set
566CONFIG_ATA_OVER_ETH=m 568CONFIG_HAVE_IDE=y
567
568#
569# Misc devices
570#
571CONFIG_SGI_IOC4=m
572# CONFIG_TIFM_CORE is not set
573
574#
575# ATA/ATAPI/MFM/RLL support
576#
577CONFIG_IDE=y 569CONFIG_IDE=y
578CONFIG_IDE_MAX_HWIFS=4
579CONFIG_BLK_DEV_IDE=y
580 570
581# 571#
582# Please see Documentation/ide.txt for help/info on IDE drives 572# Please see Documentation/ide/ide.txt for help/info on IDE drives
583# 573#
574CONFIG_IDE_XFER_MODE=y
584# CONFIG_BLK_DEV_IDE_SATA is not set 575# CONFIG_BLK_DEV_IDE_SATA is not set
585CONFIG_BLK_DEV_IDEDISK=y 576CONFIG_IDE_GD=y
586# CONFIG_IDEDISK_MULTI_MODE is not set 577CONFIG_IDE_GD_ATA=y
587CONFIG_BLK_DEV_IDECS=m 578# CONFIG_IDE_GD_ATAPI is not set
588# CONFIG_BLK_DEV_DELKIN is not set 579CONFIG_BLK_DEV_IDECS=y
589# CONFIG_BLK_DEV_IDECD is not set 580# CONFIG_BLK_DEV_IDECD is not set
590# CONFIG_BLK_DEV_IDETAPE is not set 581# CONFIG_BLK_DEV_IDETAPE is not set
591# CONFIG_BLK_DEV_IDEFLOPPY is not set
592# CONFIG_IDE_TASK_IOCTL is not set 582# CONFIG_IDE_TASK_IOCTL is not set
583CONFIG_IDE_PROC_FS=y
593 584
594# 585#
595# IDE chipset support/bugfixes 586# IDE chipset support/bugfixes
596# 587#
597# CONFIG_IDE_GENERIC is not set 588# CONFIG_IDE_GENERIC is not set
598# CONFIG_BLK_DEV_IDEPCI is not set 589# CONFIG_BLK_DEV_PLATFORM is not set
599# CONFIG_IDE_ARM is not set 590CONFIG_BLK_DEV_IDEDMA_SFF=y
600# CONFIG_BLK_DEV_IDEDMA is not set 591
601# CONFIG_IDEDMA_AUTO is not set 592#
602# CONFIG_BLK_DEV_HD is not set 593# PCI IDE chipsets support
594#
595CONFIG_BLK_DEV_IDEPCI=y
596# CONFIG_IDEPCI_PCIBUS_ORDER is not set
597# CONFIG_BLK_DEV_OFFBOARD is not set
598# CONFIG_BLK_DEV_GENERIC is not set
599# CONFIG_BLK_DEV_OPTI621 is not set
600CONFIG_BLK_DEV_IDEDMA_PCI=y
601# CONFIG_BLK_DEV_AEC62XX is not set
602# CONFIG_BLK_DEV_ALI15X3 is not set
603# CONFIG_BLK_DEV_AMD74XX is not set
604# CONFIG_BLK_DEV_CMD64X is not set
605# CONFIG_BLK_DEV_TRIFLEX is not set
606# CONFIG_BLK_DEV_CS5520 is not set
607# CONFIG_BLK_DEV_CS5530 is not set
608CONFIG_BLK_DEV_HPT366=y
609# CONFIG_BLK_DEV_JMICRON is not set
610# CONFIG_BLK_DEV_SC1200 is not set
611# CONFIG_BLK_DEV_PIIX is not set
612# CONFIG_BLK_DEV_IT8172 is not set
613# CONFIG_BLK_DEV_IT8213 is not set
614# CONFIG_BLK_DEV_IT821X is not set
615# CONFIG_BLK_DEV_NS87415 is not set
616# CONFIG_BLK_DEV_PDC202XX_OLD is not set
617# CONFIG_BLK_DEV_PDC202XX_NEW is not set
618# CONFIG_BLK_DEV_SVWKS is not set
619# CONFIG_BLK_DEV_SIIMAGE is not set
620# CONFIG_BLK_DEV_SLC90E66 is not set
621# CONFIG_BLK_DEV_TRM290 is not set
622# CONFIG_BLK_DEV_VIA82CXXX is not set
623# CONFIG_BLK_DEV_TC86C001 is not set
624CONFIG_BLK_DEV_IDEDMA=y
603 625
604# 626#
605# SCSI device support 627# SCSI device support
606# 628#
607CONFIG_RAID_ATTRS=m 629# CONFIG_RAID_ATTRS is not set
608# CONFIG_SCSI is not set 630# CONFIG_SCSI is not set
631# CONFIG_SCSI_DMA is not set
609# CONFIG_SCSI_NETLINK is not set 632# CONFIG_SCSI_NETLINK is not set
610
611#
612# Serial ATA (prod) and Parallel ATA (experimental) drivers
613#
614# CONFIG_ATA is not set 633# CONFIG_ATA is not set
615
616#
617# Multi-device support (RAID and LVM)
618#
619# CONFIG_MD is not set 634# CONFIG_MD is not set
620
621#
622# Fusion MPT device support
623#
624# CONFIG_FUSION is not set 635# CONFIG_FUSION is not set
625 636
626# 637#
627# IEEE 1394 (FireWire) support 638# IEEE 1394 (FireWire) support
628# 639#
629# CONFIG_IEEE1394 is not set
630 640
631# 641#
632# I2O device support 642# You can enable one or both FireWire driver stacks.
633# 643#
634# CONFIG_I2O is not set
635 644
636# 645#
637# Network device support 646# The newer stack is recommended.
638# 647#
648# CONFIG_FIREWIRE is not set
649# CONFIG_IEEE1394 is not set
650# CONFIG_I2O is not set
639CONFIG_NETDEVICES=y 651CONFIG_NETDEVICES=y
640# CONFIG_DUMMY is not set 652# CONFIG_DUMMY is not set
641# CONFIG_BONDING is not set 653# CONFIG_BONDING is not set
654# CONFIG_MACVLAN is not set
642# CONFIG_EQUALIZER is not set 655# CONFIG_EQUALIZER is not set
643# CONFIG_TUN is not set 656# CONFIG_TUN is not set
644 657# CONFIG_VETH is not set
645#
646# ARCnet devices
647#
648# CONFIG_ARCNET is not set 658# CONFIG_ARCNET is not set
649
650#
651# PHY device support
652#
653CONFIG_PHYLIB=y 659CONFIG_PHYLIB=y
654 660
655# 661#
656# MII PHY device drivers 662# MII PHY device drivers
657# 663#
658CONFIG_MARVELL_PHY=m 664CONFIG_MARVELL_PHY=y
659CONFIG_DAVICOM_PHY=m 665CONFIG_DAVICOM_PHY=y
660CONFIG_QSEMI_PHY=m 666CONFIG_QSEMI_PHY=y
661CONFIG_LXT_PHY=m 667CONFIG_LXT_PHY=y
662CONFIG_CICADA_PHY=m 668CONFIG_CICADA_PHY=y
663CONFIG_VITESSE_PHY=m 669CONFIG_VITESSE_PHY=y
664CONFIG_SMSC_PHY=m 670CONFIG_SMSC_PHY=y
665# CONFIG_BROADCOM_PHY is not set 671CONFIG_BROADCOM_PHY=y
672CONFIG_ICPLUS_PHY=y
673CONFIG_REALTEK_PHY=y
674CONFIG_NATIONAL_PHY=y
675CONFIG_STE10XP=y
676CONFIG_LSI_ET1011C_PHY=y
666# CONFIG_FIXED_PHY is not set 677# CONFIG_FIXED_PHY is not set
667 678# CONFIG_MDIO_BITBANG is not set
668#
669# Ethernet (10 or 100Mbit)
670#
671CONFIG_NET_ETHERNET=y 679CONFIG_NET_ETHERNET=y
672# CONFIG_MII is not set 680CONFIG_MII=y
681# CONFIG_AX88796 is not set
673CONFIG_MIPS_AU1X00_ENET=y 682CONFIG_MIPS_AU1X00_ENET=y
674# CONFIG_HAPPYMEAL is not set 683# CONFIG_HAPPYMEAL is not set
675# CONFIG_SUNGEM is not set 684# CONFIG_SUNGEM is not set
@@ -677,88 +686,51 @@ CONFIG_MIPS_AU1X00_ENET=y
677# CONFIG_NET_VENDOR_3COM is not set 686# CONFIG_NET_VENDOR_3COM is not set
678# CONFIG_SMC91X is not set 687# CONFIG_SMC91X is not set
679# CONFIG_DM9000 is not set 688# CONFIG_DM9000 is not set
680 689# CONFIG_ETHOC is not set
681# 690# CONFIG_SMSC911X is not set
682# Tulip family network device support 691# CONFIG_DNET is not set
683#
684# CONFIG_NET_TULIP is not set 692# CONFIG_NET_TULIP is not set
685# CONFIG_HP100 is not set 693# CONFIG_HP100 is not set
694# CONFIG_IBM_NEW_EMAC_ZMII is not set
695# CONFIG_IBM_NEW_EMAC_RGMII is not set
696# CONFIG_IBM_NEW_EMAC_TAH is not set
697# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
698# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
699# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
700# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
686# CONFIG_NET_PCI is not set 701# CONFIG_NET_PCI is not set
687 702# CONFIG_B44 is not set
688# 703# CONFIG_KS8842 is not set
689# Ethernet (1000 Mbit) 704# CONFIG_KS8851_MLL is not set
690# 705# CONFIG_ATL2 is not set
691# CONFIG_ACENIC is not set 706# CONFIG_NETDEV_1000 is not set
692# CONFIG_DL2K is not set 707# CONFIG_NETDEV_10000 is not set
693# CONFIG_E1000 is not set
694# CONFIG_NS83820 is not set
695# CONFIG_HAMACHI is not set
696# CONFIG_YELLOWFIN is not set
697# CONFIG_R8169 is not set
698# CONFIG_SIS190 is not set
699# CONFIG_SKGE is not set
700# CONFIG_SKY2 is not set
701# CONFIG_SK98LIN is not set
702# CONFIG_TIGON3 is not set
703# CONFIG_BNX2 is not set
704CONFIG_QLA3XXX=m
705# CONFIG_ATL1 is not set
706
707#
708# Ethernet (10000 Mbit)
709#
710# CONFIG_CHELSIO_T1 is not set
711CONFIG_CHELSIO_T3=m
712# CONFIG_IXGB is not set
713# CONFIG_S2IO is not set
714# CONFIG_MYRI10GE is not set
715CONFIG_NETXEN_NIC=m
716
717#
718# Token Ring devices
719#
720# CONFIG_TR is not set 708# CONFIG_TR is not set
709# CONFIG_WLAN is not set
721 710
722# 711#
723# Wireless LAN (non-hamradio) 712# Enable WiMAX (Networking options) to see the WiMAX drivers
724# 713#
725# CONFIG_NET_RADIO is not set
726 714
727# 715#
728# PCMCIA network device support 716# USB Network Adapters
729# 717#
718# CONFIG_USB_CATC is not set
719# CONFIG_USB_KAWETH is not set
720# CONFIG_USB_PEGASUS is not set
721# CONFIG_USB_RTL8150 is not set
722# CONFIG_USB_USBNET is not set
730# CONFIG_NET_PCMCIA is not set 723# CONFIG_NET_PCMCIA is not set
731
732#
733# Wan interfaces
734#
735# CONFIG_WAN is not set 724# CONFIG_WAN is not set
736# CONFIG_FDDI is not set 725# CONFIG_FDDI is not set
737# CONFIG_HIPPI is not set 726# CONFIG_HIPPI is not set
738CONFIG_PPP=m 727# CONFIG_PPP is not set
739CONFIG_PPP_MULTILINK=y
740# CONFIG_PPP_FILTER is not set
741CONFIG_PPP_ASYNC=m
742# CONFIG_PPP_SYNC_TTY is not set
743CONFIG_PPP_DEFLATE=m
744# CONFIG_PPP_BSDCOMP is not set
745CONFIG_PPP_MPPE=m
746CONFIG_PPPOE=m
747# CONFIG_SLIP is not set 728# CONFIG_SLIP is not set
748CONFIG_SLHC=m
749# CONFIG_SHAPER is not set
750# CONFIG_NETCONSOLE is not set 729# CONFIG_NETCONSOLE is not set
751# CONFIG_NETPOLL is not set 730# CONFIG_NETPOLL is not set
752# CONFIG_NET_POLL_CONTROLLER is not set 731# CONFIG_NET_POLL_CONTROLLER is not set
753 732# CONFIG_VMXNET3 is not set
754#
755# ISDN subsystem
756#
757# CONFIG_ISDN is not set 733# CONFIG_ISDN is not set
758
759#
760# Telephony Support
761#
762# CONFIG_PHONE is not set 734# CONFIG_PHONE is not set
763 735
764# 736#
@@ -766,16 +738,14 @@ CONFIG_SLHC=m
766# 738#
767CONFIG_INPUT=y 739CONFIG_INPUT=y
768# CONFIG_INPUT_FF_MEMLESS is not set 740# CONFIG_INPUT_FF_MEMLESS is not set
741# CONFIG_INPUT_POLLDEV is not set
742# CONFIG_INPUT_SPARSEKMAP is not set
769 743
770# 744#
771# Userland interfaces 745# Userland interfaces
772# 746#
773CONFIG_INPUT_MOUSEDEV=y 747# CONFIG_INPUT_MOUSEDEV is not set
774CONFIG_INPUT_MOUSEDEV_PSAUX=y
775CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
776CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
777# CONFIG_INPUT_JOYDEV is not set 748# CONFIG_INPUT_JOYDEV is not set
778# CONFIG_INPUT_TSDEV is not set
779CONFIG_INPUT_EVDEV=y 749CONFIG_INPUT_EVDEV=y
780# CONFIG_INPUT_EVBUG is not set 750# CONFIG_INPUT_EVBUG is not set
781 751
@@ -785,33 +755,34 @@ CONFIG_INPUT_EVDEV=y
785# CONFIG_INPUT_KEYBOARD is not set 755# CONFIG_INPUT_KEYBOARD is not set
786# CONFIG_INPUT_MOUSE is not set 756# CONFIG_INPUT_MOUSE is not set
787# CONFIG_INPUT_JOYSTICK is not set 757# CONFIG_INPUT_JOYSTICK is not set
758# CONFIG_INPUT_TABLET is not set
788# CONFIG_INPUT_TOUCHSCREEN is not set 759# CONFIG_INPUT_TOUCHSCREEN is not set
789# CONFIG_INPUT_MISC is not set 760# CONFIG_INPUT_MISC is not set
790 761
791# 762#
792# Hardware I/O ports 763# Hardware I/O ports
793# 764#
794CONFIG_SERIO=y 765# CONFIG_SERIO is not set
795# CONFIG_SERIO_I8042 is not set
796CONFIG_SERIO_SERPORT=y
797# CONFIG_SERIO_PCIPS2 is not set
798# CONFIG_SERIO_LIBPS2 is not set
799CONFIG_SERIO_RAW=m
800# CONFIG_GAMEPORT is not set 766# CONFIG_GAMEPORT is not set
801 767
802# 768#
803# Character devices 769# Character devices
804# 770#
805# CONFIG_VT is not set 771CONFIG_VT=y
772CONFIG_CONSOLE_TRANSLATIONS=y
773CONFIG_VT_CONSOLE=y
774CONFIG_HW_CONSOLE=y
775# CONFIG_VT_HW_CONSOLE_BINDING is not set
776CONFIG_DEVKMEM=y
806# CONFIG_SERIAL_NONSTANDARD is not set 777# CONFIG_SERIAL_NONSTANDARD is not set
807# CONFIG_AU1X00_GPIO is not set 778# CONFIG_NOZOMI is not set
808 779
809# 780#
810# Serial drivers 781# Serial drivers
811# 782#
812CONFIG_SERIAL_8250=y 783CONFIG_SERIAL_8250=y
813CONFIG_SERIAL_8250_CONSOLE=y 784CONFIG_SERIAL_8250_CONSOLE=y
814CONFIG_SERIAL_8250_PCI=y 785# CONFIG_SERIAL_8250_PCI is not set
815# CONFIG_SERIAL_8250_CS is not set 786# CONFIG_SERIAL_8250_CS is not set
816CONFIG_SERIAL_8250_NR_UARTS=4 787CONFIG_SERIAL_8250_NR_UARTS=4
817CONFIG_SERIAL_8250_RUNTIME_UARTS=4 788CONFIG_SERIAL_8250_RUNTIME_UARTS=4
@@ -825,301 +796,143 @@ CONFIG_SERIAL_CORE=y
825CONFIG_SERIAL_CORE_CONSOLE=y 796CONFIG_SERIAL_CORE_CONSOLE=y
826# CONFIG_SERIAL_JSM is not set 797# CONFIG_SERIAL_JSM is not set
827CONFIG_UNIX98_PTYS=y 798CONFIG_UNIX98_PTYS=y
828CONFIG_LEGACY_PTYS=y 799# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
829CONFIG_LEGACY_PTY_COUNT=256 800# CONFIG_LEGACY_PTYS is not set
830
831#
832# IPMI
833#
834# CONFIG_IPMI_HANDLER is not set 801# CONFIG_IPMI_HANDLER is not set
835
836#
837# Watchdog Cards
838#
839# CONFIG_WATCHDOG is not set
840# CONFIG_HW_RANDOM is not set 802# CONFIG_HW_RANDOM is not set
841# CONFIG_RTC is not set
842# CONFIG_GEN_RTC is not set
843# CONFIG_DTLK is not set
844# CONFIG_R3964 is not set 803# CONFIG_R3964 is not set
845# CONFIG_APPLICOM is not set 804# CONFIG_APPLICOM is not set
846# CONFIG_DRM is not set
847 805
848# 806#
849# PCMCIA character devices 807# PCMCIA character devices
850# 808#
851CONFIG_SYNCLINK_CS=m 809# CONFIG_SYNCLINK_CS is not set
852# CONFIG_CARDMAN_4000 is not set 810# CONFIG_CARDMAN_4000 is not set
853# CONFIG_CARDMAN_4040 is not set 811# CONFIG_CARDMAN_4040 is not set
812# CONFIG_IPWIRELESS is not set
854# CONFIG_RAW_DRIVER is not set 813# CONFIG_RAW_DRIVER is not set
855
856#
857# TPM devices
858#
859# CONFIG_TCG_TPM is not set 814# CONFIG_TCG_TPM is not set
860 815CONFIG_DEVPORT=y
861#
862# I2C support
863#
864# CONFIG_I2C is not set 816# CONFIG_I2C is not set
865
866#
867# SPI support
868#
869# CONFIG_SPI is not set 817# CONFIG_SPI is not set
870# CONFIG_SPI_MASTER is not set
871 818
872# 819#
873# Dallas's 1-wire bus 820# PPS support
874# 821#
822# CONFIG_PPS is not set
823CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
824# CONFIG_GPIOLIB is not set
875# CONFIG_W1 is not set 825# CONFIG_W1 is not set
876 826# CONFIG_POWER_SUPPLY is not set
877#
878# Hardware Monitoring support
879#
880# CONFIG_HWMON is not set 827# CONFIG_HWMON is not set
881# CONFIG_HWMON_VID is not set 828# CONFIG_THERMAL is not set
829# CONFIG_WATCHDOG is not set
830CONFIG_SSB_POSSIBLE=y
882 831
883# 832#
884# Multimedia devices 833# Sonics Silicon Backplane
885# 834#
886# CONFIG_VIDEO_DEV is not set 835# CONFIG_SSB is not set
887 836
888# 837#
889# Digital Video Broadcasting Devices 838# Multifunction device drivers
890# 839#
891# CONFIG_DVB is not set 840# CONFIG_MFD_CORE is not set
892# CONFIG_USB_DABUSB is not set 841# CONFIG_MFD_SM501 is not set
842# CONFIG_HTC_PASIC3 is not set
843# CONFIG_MFD_TMIO is not set
844# CONFIG_REGULATOR is not set
845# CONFIG_MEDIA_SUPPORT is not set
893 846
894# 847#
895# Graphics support 848# Graphics support
896# 849#
897# CONFIG_FIRMWARE_EDID is not set 850# CONFIG_VGA_ARB is not set
851# CONFIG_DRM is not set
852# CONFIG_VGASTATE is not set
853# CONFIG_VIDEO_OUTPUT_CONTROL is not set
898# CONFIG_FB is not set 854# CONFIG_FB is not set
899# CONFIG_BACKLIGHT_LCD_SUPPORT is not set 855# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
900 856
901# 857#
902# Sound 858# Display device support
903# 859#
904CONFIG_SOUND=y 860# CONFIG_DISPLAY_SUPPORT is not set
905 861
906# 862#
907# Advanced Linux Sound Architecture 863# Console display driver support
908#
909CONFIG_SND=m
910CONFIG_SND_TIMER=m
911CONFIG_SND_PCM=m
912CONFIG_SND_RAWMIDI=m
913CONFIG_SND_SEQUENCER=m
914CONFIG_SND_SEQ_DUMMY=m
915CONFIG_SND_OSSEMUL=y
916CONFIG_SND_MIXER_OSS=m
917CONFIG_SND_PCM_OSS=m
918CONFIG_SND_PCM_OSS_PLUGINS=y
919CONFIG_SND_SEQUENCER_OSS=y
920# CONFIG_SND_DYNAMIC_MINORS is not set
921CONFIG_SND_SUPPORT_OLD_API=y
922CONFIG_SND_VERBOSE_PROCFS=y
923# CONFIG_SND_VERBOSE_PRINTK is not set
924# CONFIG_SND_DEBUG is not set
925
926#
927# Generic devices
928#
929CONFIG_SND_AC97_CODEC=m
930# CONFIG_SND_DUMMY is not set
931CONFIG_SND_VIRMIDI=m
932CONFIG_SND_MTPAV=m
933# CONFIG_SND_SERIAL_U16550 is not set
934# CONFIG_SND_MPU401 is not set
935
936#
937# PCI devices
938#
939# CONFIG_SND_AD1889 is not set
940# CONFIG_SND_ALS300 is not set
941# CONFIG_SND_ALI5451 is not set
942# CONFIG_SND_ATIIXP is not set
943# CONFIG_SND_ATIIXP_MODEM is not set
944# CONFIG_SND_AU8810 is not set
945# CONFIG_SND_AU8820 is not set
946# CONFIG_SND_AU8830 is not set
947# CONFIG_SND_AZT3328 is not set
948# CONFIG_SND_BT87X is not set
949# CONFIG_SND_CA0106 is not set
950# CONFIG_SND_CMIPCI is not set
951# CONFIG_SND_CS4281 is not set
952# CONFIG_SND_CS46XX is not set
953# CONFIG_SND_DARLA20 is not set
954# CONFIG_SND_GINA20 is not set
955# CONFIG_SND_LAYLA20 is not set
956# CONFIG_SND_DARLA24 is not set
957# CONFIG_SND_GINA24 is not set
958# CONFIG_SND_LAYLA24 is not set
959# CONFIG_SND_MONA is not set
960# CONFIG_SND_MIA is not set
961# CONFIG_SND_ECHO3G is not set
962# CONFIG_SND_INDIGO is not set
963# CONFIG_SND_INDIGOIO is not set
964# CONFIG_SND_INDIGODJ is not set
965# CONFIG_SND_EMU10K1 is not set
966# CONFIG_SND_EMU10K1X is not set
967# CONFIG_SND_ENS1370 is not set
968# CONFIG_SND_ENS1371 is not set
969# CONFIG_SND_ES1938 is not set
970# CONFIG_SND_ES1968 is not set
971# CONFIG_SND_FM801 is not set
972# CONFIG_SND_HDA_INTEL is not set
973# CONFIG_SND_HDSP is not set
974# CONFIG_SND_HDSPM is not set
975# CONFIG_SND_ICE1712 is not set
976# CONFIG_SND_ICE1724 is not set
977# CONFIG_SND_INTEL8X0 is not set
978# CONFIG_SND_INTEL8X0M is not set
979# CONFIG_SND_KORG1212 is not set
980# CONFIG_SND_MAESTRO3 is not set
981# CONFIG_SND_MIXART is not set
982# CONFIG_SND_NM256 is not set
983# CONFIG_SND_PCXHR is not set
984# CONFIG_SND_RIPTIDE is not set
985# CONFIG_SND_RME32 is not set
986# CONFIG_SND_RME96 is not set
987# CONFIG_SND_RME9652 is not set
988# CONFIG_SND_SONICVIBES is not set
989# CONFIG_SND_TRIDENT is not set
990# CONFIG_SND_VIA82XX is not set
991# CONFIG_SND_VIA82XX_MODEM is not set
992# CONFIG_SND_VX222 is not set
993# CONFIG_SND_YMFPCI is not set
994# CONFIG_SND_AC97_POWER_SAVE is not set
995
996#
997# ALSA MIPS devices
998#
999CONFIG_SND_AU1X00=m
1000
1001#
1002# USB devices
1003#
1004# CONFIG_SND_USB_AUDIO is not set
1005
1006#
1007# PCMCIA devices
1008#
1009# CONFIG_SND_VXPOCKET is not set
1010# CONFIG_SND_PDAUDIOCF is not set
1011
1012#
1013# SoC audio support
1014#
1015# CONFIG_SND_SOC is not set
1016
1017#
1018# Open Sound System
1019#
1020CONFIG_SOUND_PRIME=y
1021# CONFIG_OBSOLETE_OSS is not set
1022# CONFIG_SOUND_BT878 is not set
1023# CONFIG_SOUND_ICH is not set
1024# CONFIG_SOUND_TRIDENT is not set
1025# CONFIG_SOUND_MSNDCLAS is not set
1026# CONFIG_SOUND_MSNDPIN is not set
1027# CONFIG_SOUND_VIA82CXXX is not set
1028CONFIG_AC97_BUS=m
1029
1030#
1031# HID Devices
1032#
1033CONFIG_HID=y
1034# CONFIG_HID_DEBUG is not set
1035
1036#
1037# USB support
1038# 864#
865# CONFIG_VGA_CONSOLE is not set
866CONFIG_DUMMY_CONSOLE=y
867# CONFIG_SOUND is not set
868# CONFIG_HID_SUPPORT is not set
869CONFIG_USB_SUPPORT=y
1039CONFIG_USB_ARCH_HAS_HCD=y 870CONFIG_USB_ARCH_HAS_HCD=y
1040CONFIG_USB_ARCH_HAS_OHCI=y 871CONFIG_USB_ARCH_HAS_OHCI=y
1041CONFIG_USB_ARCH_HAS_EHCI=y 872CONFIG_USB_ARCH_HAS_EHCI=y
1042CONFIG_USB=y 873CONFIG_USB=y
1043# CONFIG_USB_DEBUG is not set 874# CONFIG_USB_DEBUG is not set
875# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
1044 876
1045# 877#
1046# Miscellaneous USB options 878# Miscellaneous USB options
1047# 879#
1048# CONFIG_USB_DEVICEFS is not set 880# CONFIG_USB_DEVICEFS is not set
1049# CONFIG_USB_DYNAMIC_MINORS is not set 881# CONFIG_USB_DEVICE_CLASS is not set
882CONFIG_USB_DYNAMIC_MINORS=y
883CONFIG_USB_SUSPEND=y
1050# CONFIG_USB_OTG is not set 884# CONFIG_USB_OTG is not set
885# CONFIG_USB_OTG_WHITELIST is not set
886# CONFIG_USB_OTG_BLACKLIST_HUB is not set
887# CONFIG_USB_MON is not set
888# CONFIG_USB_WUSB is not set
889# CONFIG_USB_WUSB_CBAF is not set
1051 890
1052# 891#
1053# USB Host Controller Drivers 892# USB Host Controller Drivers
1054# 893#
894# CONFIG_USB_C67X00_HCD is not set
895# CONFIG_USB_XHCI_HCD is not set
1055# CONFIG_USB_EHCI_HCD is not set 896# CONFIG_USB_EHCI_HCD is not set
897# CONFIG_USB_OXU210HP_HCD is not set
1056# CONFIG_USB_ISP116X_HCD is not set 898# CONFIG_USB_ISP116X_HCD is not set
899# CONFIG_USB_ISP1760_HCD is not set
900# CONFIG_USB_ISP1362_HCD is not set
1057CONFIG_USB_OHCI_HCD=y 901CONFIG_USB_OHCI_HCD=y
1058# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set 902# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
1059# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set 903# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
1060CONFIG_USB_OHCI_LITTLE_ENDIAN=y 904CONFIG_USB_OHCI_LITTLE_ENDIAN=y
1061# CONFIG_USB_UHCI_HCD is not set 905# CONFIG_USB_UHCI_HCD is not set
1062# CONFIG_USB_SL811_HCD is not set 906# CONFIG_USB_SL811_HCD is not set
907# CONFIG_USB_R8A66597_HCD is not set
908# CONFIG_USB_WHCI_HCD is not set
909# CONFIG_USB_HWA_HCD is not set
1063 910
1064# 911#
1065# USB Device Class drivers 912# USB Device Class drivers
1066# 913#
1067# CONFIG_USB_ACM is not set 914# CONFIG_USB_ACM is not set
1068# CONFIG_USB_PRINTER is not set 915# CONFIG_USB_PRINTER is not set
916# CONFIG_USB_WDM is not set
917# CONFIG_USB_TMC is not set
1069 918
1070# 919#
1071# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' 920# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
1072# 921#
1073 922
1074# 923#
1075# may also be needed; see USB_STORAGE Help for more information 924# also be needed; see USB_STORAGE Help for more info
1076# 925#
1077# CONFIG_USB_LIBUSUAL is not set 926# CONFIG_USB_LIBUSUAL is not set
1078 927
1079# 928#
1080# USB Input Devices
1081#
1082CONFIG_USB_HID=y
1083# CONFIG_USB_HIDINPUT_POWERBOOK is not set
1084# CONFIG_HID_FF is not set
1085# CONFIG_USB_HIDDEV is not set
1086# CONFIG_USB_AIPTEK is not set
1087# CONFIG_USB_WACOM is not set
1088# CONFIG_USB_ACECAD is not set
1089# CONFIG_USB_KBTAB is not set
1090# CONFIG_USB_POWERMATE is not set
1091# CONFIG_USB_TOUCHSCREEN is not set
1092CONFIG_USB_YEALINK=m
1093# CONFIG_USB_XPAD is not set
1094# CONFIG_USB_ATI_REMOTE is not set
1095# CONFIG_USB_ATI_REMOTE2 is not set
1096# CONFIG_USB_KEYSPAN_REMOTE is not set
1097# CONFIG_USB_APPLETOUCH is not set
1098# CONFIG_USB_GTCO is not set
1099
1100#
1101# USB Imaging devices 929# USB Imaging devices
1102# 930#
1103# CONFIG_USB_MDC800 is not set 931# CONFIG_USB_MDC800 is not set
1104 932
1105# 933#
1106# USB Network Adapters
1107#
1108# CONFIG_USB_CATC is not set
1109# CONFIG_USB_KAWETH is not set
1110# CONFIG_USB_PEGASUS is not set
1111# CONFIG_USB_RTL8150 is not set
1112# CONFIG_USB_USBNET_MII is not set
1113# CONFIG_USB_USBNET is not set
1114CONFIG_USB_MON=y
1115
1116#
1117# USB port drivers 934# USB port drivers
1118# 935#
1119
1120#
1121# USB Serial Converter support
1122#
1123# CONFIG_USB_SERIAL is not set 936# CONFIG_USB_SERIAL is not set
1124 937
1125# 938#
@@ -1128,7 +941,7 @@ CONFIG_USB_MON=y
1128# CONFIG_USB_EMI62 is not set 941# CONFIG_USB_EMI62 is not set
1129# CONFIG_USB_EMI26 is not set 942# CONFIG_USB_EMI26 is not set
1130# CONFIG_USB_ADUTUX is not set 943# CONFIG_USB_ADUTUX is not set
1131# CONFIG_USB_AUERSWALD is not set 944# CONFIG_USB_SEVSEG is not set
1132# CONFIG_USB_RIO500 is not set 945# CONFIG_USB_RIO500 is not set
1133# CONFIG_USB_LEGOTOWER is not set 946# CONFIG_USB_LEGOTOWER is not set
1134# CONFIG_USB_LCD is not set 947# CONFIG_USB_LCD is not set
@@ -1136,112 +949,107 @@ CONFIG_USB_MON=y
1136# CONFIG_USB_LED is not set 949# CONFIG_USB_LED is not set
1137# CONFIG_USB_CYPRESS_CY7C63 is not set 950# CONFIG_USB_CYPRESS_CY7C63 is not set
1138# CONFIG_USB_CYTHERM is not set 951# CONFIG_USB_CYTHERM is not set
1139# CONFIG_USB_PHIDGET is not set
1140# CONFIG_USB_IDMOUSE is not set 952# CONFIG_USB_IDMOUSE is not set
1141# CONFIG_USB_FTDI_ELAN is not set 953# CONFIG_USB_FTDI_ELAN is not set
1142# CONFIG_USB_APPLEDISPLAY is not set 954# CONFIG_USB_APPLEDISPLAY is not set
1143CONFIG_USB_LD=m 955# CONFIG_USB_LD is not set
1144# CONFIG_USB_TRANCEVIBRATOR is not set 956# CONFIG_USB_TRANCEVIBRATOR is not set
1145 957# CONFIG_USB_IOWARRIOR is not set
1146# 958# CONFIG_USB_TEST is not set
1147# USB DSL modem support 959# CONFIG_USB_ISIGHTFW is not set
1148# 960# CONFIG_USB_VST is not set
1149
1150#
1151# USB Gadget Support
1152#
1153# CONFIG_USB_GADGET is not set 961# CONFIG_USB_GADGET is not set
1154 962
1155# 963#
1156# MMC/SD Card support 964# OTG and related infrastructure
1157# 965#
966# CONFIG_USB_GPIO_VBUS is not set
967# CONFIG_NOP_USB_XCEIV is not set
968# CONFIG_UWB is not set
1158# CONFIG_MMC is not set 969# CONFIG_MMC is not set
1159 970# CONFIG_MEMSTICK is not set
1160#
1161# LED devices
1162#
1163# CONFIG_NEW_LEDS is not set 971# CONFIG_NEW_LEDS is not set
1164 972# CONFIG_ACCESSIBILITY is not set
1165#
1166# LED drivers
1167#
1168
1169#
1170# LED Triggers
1171#
1172
1173#
1174# InfiniBand support
1175#
1176# CONFIG_INFINIBAND is not set 973# CONFIG_INFINIBAND is not set
974CONFIG_RTC_LIB=y
975CONFIG_RTC_CLASS=y
976CONFIG_RTC_HCTOSYS=y
977CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
978# CONFIG_RTC_DEBUG is not set
1177 979
1178# 980#
1179# EDAC - error detection and reporting (RAS) (EXPERIMENTAL) 981# RTC interfaces
1180#
1181
1182#
1183# Real Time Clock
1184# 982#
1185# CONFIG_RTC_CLASS is not set 983CONFIG_RTC_INTF_SYSFS=y
984CONFIG_RTC_INTF_PROC=y
985CONFIG_RTC_INTF_DEV=y
986# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
987# CONFIG_RTC_DRV_TEST is not set
1186 988
1187# 989#
1188# DMA Engine support 990# SPI RTC drivers
1189# 991#
1190# CONFIG_DMA_ENGINE is not set
1191 992
1192# 993#
1193# DMA Clients 994# Platform RTC drivers
1194# 995#
996# CONFIG_RTC_DRV_CMOS is not set
997# CONFIG_RTC_DRV_DS1286 is not set
998# CONFIG_RTC_DRV_DS1511 is not set
999# CONFIG_RTC_DRV_DS1553 is not set
1000# CONFIG_RTC_DRV_DS1742 is not set
1001# CONFIG_RTC_DRV_STK17TA8 is not set
1002# CONFIG_RTC_DRV_M48T86 is not set
1003# CONFIG_RTC_DRV_M48T35 is not set
1004# CONFIG_RTC_DRV_M48T59 is not set
1005# CONFIG_RTC_DRV_MSM6242 is not set
1006# CONFIG_RTC_DRV_BQ4802 is not set
1007# CONFIG_RTC_DRV_RP5C01 is not set
1008# CONFIG_RTC_DRV_V3020 is not set
1195 1009
1196# 1010#
1197# DMA Devices 1011# on-CPU RTC drivers
1198# 1012#
1013CONFIG_RTC_DRV_AU1XXX=y
1014# CONFIG_DMADEVICES is not set
1015# CONFIG_AUXDISPLAY is not set
1016# CONFIG_UIO is not set
1199 1017
1200# 1018#
1201# Auxiliary Display support 1019# TI VLYNQ
1202#
1203
1204#
1205# Virtualization
1206# 1020#
1021# CONFIG_STAGING is not set
1207 1022
1208# 1023#
1209# File systems 1024# File systems
1210# 1025#
1211CONFIG_EXT2_FS=y 1026CONFIG_EXT2_FS=y
1212CONFIG_EXT2_FS_XATTR=y 1027# CONFIG_EXT2_FS_XATTR is not set
1213CONFIG_EXT2_FS_POSIX_ACL=y
1214# CONFIG_EXT2_FS_SECURITY is not set
1215# CONFIG_EXT2_FS_XIP is not set 1028# CONFIG_EXT2_FS_XIP is not set
1216CONFIG_EXT3_FS=y 1029# CONFIG_EXT3_FS is not set
1217CONFIG_EXT3_FS_XATTR=y 1030# CONFIG_EXT4_FS is not set
1218CONFIG_EXT3_FS_POSIX_ACL=y 1031# CONFIG_REISERFS_FS is not set
1219CONFIG_EXT3_FS_SECURITY=y
1220# CONFIG_EXT4DEV_FS is not set
1221CONFIG_JBD=y
1222# CONFIG_JBD_DEBUG is not set
1223CONFIG_FS_MBCACHE=y
1224CONFIG_REISERFS_FS=m
1225# CONFIG_REISERFS_CHECK is not set
1226# CONFIG_REISERFS_PROC_INFO is not set
1227CONFIG_REISERFS_FS_XATTR=y
1228CONFIG_REISERFS_FS_POSIX_ACL=y
1229CONFIG_REISERFS_FS_SECURITY=y
1230# CONFIG_JFS_FS is not set 1032# CONFIG_JFS_FS is not set
1231CONFIG_FS_POSIX_ACL=y 1033CONFIG_FS_POSIX_ACL=y
1232# CONFIG_XFS_FS is not set 1034# CONFIG_XFS_FS is not set
1233# CONFIG_GFS2_FS is not set 1035# CONFIG_GFS2_FS is not set
1234# CONFIG_OCFS2_FS is not set 1036# CONFIG_OCFS2_FS is not set
1235# CONFIG_MINIX_FS is not set 1037# CONFIG_BTRFS_FS is not set
1236# CONFIG_ROMFS_FS is not set 1038# CONFIG_NILFS2_FS is not set
1039CONFIG_FILE_LOCKING=y
1040CONFIG_FSNOTIFY=y
1041CONFIG_DNOTIFY=y
1237CONFIG_INOTIFY=y 1042CONFIG_INOTIFY=y
1238CONFIG_INOTIFY_USER=y 1043CONFIG_INOTIFY_USER=y
1239# CONFIG_QUOTA is not set 1044# CONFIG_QUOTA is not set
1240CONFIG_DNOTIFY=y 1045# CONFIG_AUTOFS_FS is not set
1241CONFIG_AUTOFS_FS=m 1046# CONFIG_AUTOFS4_FS is not set
1242CONFIG_AUTOFS4_FS=m 1047# CONFIG_FUSE_FS is not set
1243CONFIG_FUSE_FS=m 1048
1244CONFIG_GENERIC_ACL=y 1049#
1050# Caches
1051#
1052# CONFIG_FSCACHE is not set
1245 1053
1246# 1054#
1247# CD-ROM/DVD Filesystems 1055# CD-ROM/DVD Filesystems
@@ -1260,74 +1068,81 @@ CONFIG_GENERIC_ACL=y
1260# Pseudo filesystems 1068# Pseudo filesystems
1261# 1069#
1262CONFIG_PROC_FS=y 1070CONFIG_PROC_FS=y
1263CONFIG_PROC_KCORE=y 1071# CONFIG_PROC_KCORE is not set
1264CONFIG_PROC_SYSCTL=y 1072CONFIG_PROC_SYSCTL=y
1073# CONFIG_PROC_PAGE_MONITOR is not set
1265CONFIG_SYSFS=y 1074CONFIG_SYSFS=y
1266CONFIG_TMPFS=y 1075CONFIG_TMPFS=y
1267CONFIG_TMPFS_POSIX_ACL=y 1076# CONFIG_TMPFS_POSIX_ACL is not set
1268# CONFIG_HUGETLB_PAGE is not set 1077# CONFIG_HUGETLB_PAGE is not set
1269CONFIG_RAMFS=y 1078# CONFIG_CONFIGFS_FS is not set
1270CONFIG_CONFIGFS_FS=m 1079CONFIG_MISC_FILESYSTEMS=y
1271
1272#
1273# Miscellaneous filesystems
1274#
1275# CONFIG_ADFS_FS is not set 1080# CONFIG_ADFS_FS is not set
1276# CONFIG_AFFS_FS is not set 1081# CONFIG_AFFS_FS is not set
1277# CONFIG_ECRYPT_FS is not set
1278# CONFIG_HFS_FS is not set 1082# CONFIG_HFS_FS is not set
1279# CONFIG_HFSPLUS_FS is not set 1083# CONFIG_HFSPLUS_FS is not set
1280# CONFIG_BEFS_FS is not set 1084# CONFIG_BEFS_FS is not set
1281# CONFIG_BFS_FS is not set 1085# CONFIG_BFS_FS is not set
1282# CONFIG_EFS_FS is not set 1086# CONFIG_EFS_FS is not set
1283# CONFIG_JFFS2_FS is not set 1087CONFIG_JFFS2_FS=y
1284CONFIG_CRAMFS=m 1088CONFIG_JFFS2_FS_DEBUG=0
1089CONFIG_JFFS2_FS_WRITEBUFFER=y
1090# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
1091CONFIG_JFFS2_SUMMARY=y
1092CONFIG_JFFS2_FS_XATTR=y
1093CONFIG_JFFS2_FS_POSIX_ACL=y
1094CONFIG_JFFS2_FS_SECURITY=y
1095CONFIG_JFFS2_COMPRESSION_OPTIONS=y
1096CONFIG_JFFS2_ZLIB=y
1097CONFIG_JFFS2_LZO=y
1098CONFIG_JFFS2_RTIME=y
1099CONFIG_JFFS2_RUBIN=y
1100# CONFIG_JFFS2_CMODE_NONE is not set
1101CONFIG_JFFS2_CMODE_PRIORITY=y
1102# CONFIG_JFFS2_CMODE_SIZE is not set
1103# CONFIG_JFFS2_CMODE_FAVOURLZO is not set
1104# CONFIG_CRAMFS is not set
1105CONFIG_SQUASHFS=y
1106# CONFIG_SQUASHFS_EMBEDDED is not set
1107CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
1285# CONFIG_VXFS_FS is not set 1108# CONFIG_VXFS_FS is not set
1109# CONFIG_MINIX_FS is not set
1110# CONFIG_OMFS_FS is not set
1286# CONFIG_HPFS_FS is not set 1111# CONFIG_HPFS_FS is not set
1287# CONFIG_QNX4FS_FS is not set 1112# CONFIG_QNX4FS_FS is not set
1113# CONFIG_ROMFS_FS is not set
1288# CONFIG_SYSV_FS is not set 1114# CONFIG_SYSV_FS is not set
1289# CONFIG_UFS_FS is not set 1115# CONFIG_UFS_FS is not set
1290 1116CONFIG_NETWORK_FILESYSTEMS=y
1291#
1292# Network File Systems
1293#
1294CONFIG_NFS_FS=y 1117CONFIG_NFS_FS=y
1295# CONFIG_NFS_V3 is not set 1118CONFIG_NFS_V3=y
1119# CONFIG_NFS_V3_ACL is not set
1296# CONFIG_NFS_V4 is not set 1120# CONFIG_NFS_V4 is not set
1297# CONFIG_NFS_DIRECTIO is not set
1298CONFIG_NFSD=m
1299# CONFIG_NFSD_V3 is not set
1300# CONFIG_NFSD_TCP is not set
1301CONFIG_ROOT_NFS=y 1121CONFIG_ROOT_NFS=y
1122# CONFIG_NFSD is not set
1302CONFIG_LOCKD=y 1123CONFIG_LOCKD=y
1303CONFIG_EXPORTFS=m 1124CONFIG_LOCKD_V4=y
1304CONFIG_NFS_COMMON=y 1125CONFIG_NFS_COMMON=y
1305CONFIG_SUNRPC=y 1126CONFIG_SUNRPC=y
1306# CONFIG_RPCSEC_GSS_KRB5 is not set 1127# CONFIG_RPCSEC_GSS_KRB5 is not set
1307# CONFIG_RPCSEC_GSS_SPKM3 is not set 1128# CONFIG_RPCSEC_GSS_SPKM3 is not set
1308CONFIG_SMB_FS=m 1129# CONFIG_SMB_FS is not set
1309# CONFIG_SMB_NLS_DEFAULT is not set
1310# CONFIG_CIFS is not set 1130# CONFIG_CIFS is not set
1311# CONFIG_NCP_FS is not set 1131# CONFIG_NCP_FS is not set
1312# CONFIG_CODA_FS is not set 1132# CONFIG_CODA_FS is not set
1313# CONFIG_AFS_FS is not set 1133# CONFIG_AFS_FS is not set
1314# CONFIG_9P_FS is not set
1315 1134
1316# 1135#
1317# Partition Types 1136# Partition Types
1318# 1137#
1319# CONFIG_PARTITION_ADVANCED is not set 1138# CONFIG_PARTITION_ADVANCED is not set
1320CONFIG_MSDOS_PARTITION=y 1139CONFIG_MSDOS_PARTITION=y
1321 1140CONFIG_NLS=y
1322#
1323# Native Language Support
1324#
1325CONFIG_NLS=m
1326CONFIG_NLS_DEFAULT="iso8859-1" 1141CONFIG_NLS_DEFAULT="iso8859-1"
1327# CONFIG_NLS_CODEPAGE_437 is not set 1142CONFIG_NLS_CODEPAGE_437=y
1328# CONFIG_NLS_CODEPAGE_737 is not set 1143# CONFIG_NLS_CODEPAGE_737 is not set
1329# CONFIG_NLS_CODEPAGE_775 is not set 1144# CONFIG_NLS_CODEPAGE_775 is not set
1330# CONFIG_NLS_CODEPAGE_850 is not set 1145CONFIG_NLS_CODEPAGE_850=y
1331# CONFIG_NLS_CODEPAGE_852 is not set 1146# CONFIG_NLS_CODEPAGE_852 is not set
1332# CONFIG_NLS_CODEPAGE_855 is not set 1147# CONFIG_NLS_CODEPAGE_855 is not set
1333# CONFIG_NLS_CODEPAGE_857 is not set 1148# CONFIG_NLS_CODEPAGE_857 is not set
@@ -1345,10 +1160,10 @@ CONFIG_NLS_DEFAULT="iso8859-1"
1345# CONFIG_NLS_CODEPAGE_949 is not set 1160# CONFIG_NLS_CODEPAGE_949 is not set
1346# CONFIG_NLS_CODEPAGE_874 is not set 1161# CONFIG_NLS_CODEPAGE_874 is not set
1347# CONFIG_NLS_ISO8859_8 is not set 1162# CONFIG_NLS_ISO8859_8 is not set
1348# CONFIG_NLS_CODEPAGE_1250 is not set 1163CONFIG_NLS_CODEPAGE_1250=y
1349# CONFIG_NLS_CODEPAGE_1251 is not set 1164# CONFIG_NLS_CODEPAGE_1251 is not set
1350# CONFIG_NLS_ASCII is not set 1165CONFIG_NLS_ASCII=y
1351# CONFIG_NLS_ISO8859_1 is not set 1166CONFIG_NLS_ISO8859_1=y
1352# CONFIG_NLS_ISO8859_2 is not set 1167# CONFIG_NLS_ISO8859_2 is not set
1353# CONFIG_NLS_ISO8859_3 is not set 1168# CONFIG_NLS_ISO8859_3 is not set
1354# CONFIG_NLS_ISO8859_4 is not set 1169# CONFIG_NLS_ISO8859_4 is not set
@@ -1358,38 +1173,76 @@ CONFIG_NLS_DEFAULT="iso8859-1"
1358# CONFIG_NLS_ISO8859_9 is not set 1173# CONFIG_NLS_ISO8859_9 is not set
1359# CONFIG_NLS_ISO8859_13 is not set 1174# CONFIG_NLS_ISO8859_13 is not set
1360# CONFIG_NLS_ISO8859_14 is not set 1175# CONFIG_NLS_ISO8859_14 is not set
1361# CONFIG_NLS_ISO8859_15 is not set 1176CONFIG_NLS_ISO8859_15=y
1362# CONFIG_NLS_KOI8_R is not set 1177# CONFIG_NLS_KOI8_R is not set
1363# CONFIG_NLS_KOI8_U is not set 1178# CONFIG_NLS_KOI8_U is not set
1364# CONFIG_NLS_UTF8 is not set 1179CONFIG_NLS_UTF8=y
1365 1180# CONFIG_DLM is not set
1366#
1367# Distributed Lock Manager
1368#
1369CONFIG_DLM=m
1370CONFIG_DLM_TCP=y
1371# CONFIG_DLM_SCTP is not set
1372# CONFIG_DLM_DEBUG is not set
1373
1374#
1375# Profiling support
1376#
1377# CONFIG_PROFILING is not set
1378 1181
1379# 1182#
1380# Kernel hacking 1183# Kernel hacking
1381# 1184#
1382CONFIG_TRACE_IRQFLAGS_SUPPORT=y 1185CONFIG_TRACE_IRQFLAGS_SUPPORT=y
1383# CONFIG_PRINTK_TIME is not set 1186# CONFIG_PRINTK_TIME is not set
1187CONFIG_ENABLE_WARN_DEPRECATED=y
1384CONFIG_ENABLE_MUST_CHECK=y 1188CONFIG_ENABLE_MUST_CHECK=y
1189CONFIG_FRAME_WARN=1024
1385# CONFIG_MAGIC_SYSRQ is not set 1190# CONFIG_MAGIC_SYSRQ is not set
1191CONFIG_STRIP_ASM_SYMS=y
1386# CONFIG_UNUSED_SYMBOLS is not set 1192# CONFIG_UNUSED_SYMBOLS is not set
1387# CONFIG_DEBUG_FS is not set 1193# CONFIG_DEBUG_FS is not set
1388# CONFIG_HEADERS_CHECK is not set 1194# CONFIG_HEADERS_CHECK is not set
1389# CONFIG_DEBUG_KERNEL is not set 1195CONFIG_DEBUG_KERNEL=y
1390CONFIG_LOG_BUF_SHIFT=14 1196# CONFIG_DEBUG_SHIRQ is not set
1391CONFIG_CROSSCOMPILE=y 1197# CONFIG_DETECT_SOFTLOCKUP is not set
1198# CONFIG_DETECT_HUNG_TASK is not set
1199# CONFIG_SCHED_DEBUG is not set
1200# CONFIG_SCHEDSTATS is not set
1201# CONFIG_TIMER_STATS is not set
1202# CONFIG_DEBUG_OBJECTS is not set
1203# CONFIG_DEBUG_SLAB is not set
1204# CONFIG_DEBUG_RT_MUTEXES is not set
1205# CONFIG_RT_MUTEX_TESTER is not set
1206# CONFIG_DEBUG_SPINLOCK is not set
1207# CONFIG_DEBUG_MUTEXES is not set
1208# CONFIG_DEBUG_LOCK_ALLOC is not set
1209# CONFIG_PROVE_LOCKING is not set
1210# CONFIG_LOCK_STAT is not set
1211# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1212# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1213# CONFIG_DEBUG_KOBJECT is not set
1214# CONFIG_DEBUG_INFO is not set
1215# CONFIG_DEBUG_VM is not set
1216# CONFIG_DEBUG_WRITECOUNT is not set
1217# CONFIG_DEBUG_MEMORY_INIT is not set
1218# CONFIG_DEBUG_LIST is not set
1219# CONFIG_DEBUG_SG is not set
1220# CONFIG_DEBUG_NOTIFIERS is not set
1221# CONFIG_DEBUG_CREDENTIALS is not set
1222# CONFIG_BOOT_PRINTK_DELAY is not set
1223# CONFIG_RCU_TORTURE_TEST is not set
1224# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1225# CONFIG_BACKTRACE_SELF_TEST is not set
1226# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1227# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
1228# CONFIG_FAULT_INJECTION is not set
1229# CONFIG_SYSCTL_SYSCALL_CHECK is not set
1230# CONFIG_PAGE_POISONING is not set
1231CONFIG_HAVE_FUNCTION_TRACER=y
1232CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1233CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y
1234CONFIG_HAVE_DYNAMIC_FTRACE=y
1235CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1236CONFIG_TRACING_SUPPORT=y
1237# CONFIG_FTRACE is not set
1238# CONFIG_SAMPLES is not set
1239CONFIG_HAVE_ARCH_KGDB=y
1240# CONFIG_KGDB is not set
1241CONFIG_EARLY_PRINTK=y
1392# CONFIG_CMDLINE_BOOL is not set 1242# CONFIG_CMDLINE_BOOL is not set
1243# CONFIG_DEBUG_STACK_USAGE is not set
1244# CONFIG_RUNTIME_DEBUG is not set
1245CONFIG_DEBUG_ZBOOT=y
1393 1246
1394# 1247#
1395# Security options 1248# Security options
@@ -1397,67 +1250,32 @@ CONFIG_CROSSCOMPILE=y
1397CONFIG_KEYS=y 1250CONFIG_KEYS=y
1398CONFIG_KEYS_DEBUG_PROC_KEYS=y 1251CONFIG_KEYS_DEBUG_PROC_KEYS=y
1399# CONFIG_SECURITY is not set 1252# CONFIG_SECURITY is not set
1400 1253CONFIG_SECURITYFS=y
1401# 1254# CONFIG_DEFAULT_SECURITY_SELINUX is not set
1402# Cryptographic options 1255# CONFIG_DEFAULT_SECURITY_SMACK is not set
1403# 1256# CONFIG_DEFAULT_SECURITY_TOMOYO is not set
1404CONFIG_CRYPTO=y 1257CONFIG_DEFAULT_SECURITY_DAC=y
1405CONFIG_CRYPTO_ALGAPI=y 1258CONFIG_DEFAULT_SECURITY=""
1406CONFIG_CRYPTO_BLKCIPHER=m 1259# CONFIG_CRYPTO is not set
1407CONFIG_CRYPTO_HASH=y 1260# CONFIG_BINARY_PRINTF is not set
1408CONFIG_CRYPTO_MANAGER=y
1409CONFIG_CRYPTO_HMAC=y
1410CONFIG_CRYPTO_XCBC=m
1411CONFIG_CRYPTO_NULL=m
1412CONFIG_CRYPTO_MD4=m
1413CONFIG_CRYPTO_MD5=y
1414CONFIG_CRYPTO_SHA1=m
1415CONFIG_CRYPTO_SHA256=m
1416CONFIG_CRYPTO_SHA512=m
1417CONFIG_CRYPTO_WP512=m
1418CONFIG_CRYPTO_TGR192=m
1419CONFIG_CRYPTO_GF128MUL=m
1420CONFIG_CRYPTO_ECB=m
1421CONFIG_CRYPTO_CBC=m
1422CONFIG_CRYPTO_PCBC=m
1423CONFIG_CRYPTO_LRW=m
1424CONFIG_CRYPTO_DES=m
1425CONFIG_CRYPTO_FCRYPT=m
1426CONFIG_CRYPTO_BLOWFISH=m
1427CONFIG_CRYPTO_TWOFISH=m
1428CONFIG_CRYPTO_TWOFISH_COMMON=m
1429CONFIG_CRYPTO_SERPENT=m
1430CONFIG_CRYPTO_AES=m
1431CONFIG_CRYPTO_CAST5=m
1432CONFIG_CRYPTO_CAST6=m
1433CONFIG_CRYPTO_TEA=m
1434CONFIG_CRYPTO_ARC4=m
1435CONFIG_CRYPTO_KHAZAD=m
1436CONFIG_CRYPTO_ANUBIS=m
1437CONFIG_CRYPTO_DEFLATE=m
1438CONFIG_CRYPTO_MICHAEL_MIC=m
1439CONFIG_CRYPTO_CRC32C=m
1440CONFIG_CRYPTO_CAMELLIA=m
1441# CONFIG_CRYPTO_TEST is not set
1442
1443#
1444# Hardware crypto devices
1445#
1446 1261
1447# 1262#
1448# Library routines 1263# Library routines
1449# 1264#
1450CONFIG_BITREVERSE=y 1265CONFIG_BITREVERSE=y
1451CONFIG_CRC_CCITT=m 1266CONFIG_GENERIC_FIND_LAST_BIT=y
1452CONFIG_CRC16=m 1267# CONFIG_CRC_CCITT is not set
1268# CONFIG_CRC16 is not set
1269# CONFIG_CRC_T10DIF is not set
1270# CONFIG_CRC_ITU_T is not set
1453CONFIG_CRC32=y 1271CONFIG_CRC32=y
1454CONFIG_LIBCRC32C=m 1272# CONFIG_CRC7 is not set
1455CONFIG_ZLIB_INFLATE=m 1273# CONFIG_LIBCRC32C is not set
1456CONFIG_ZLIB_DEFLATE=m 1274CONFIG_ZLIB_INFLATE=y
1457CONFIG_TEXTSEARCH=y 1275CONFIG_ZLIB_DEFLATE=y
1458CONFIG_TEXTSEARCH_KMP=m 1276CONFIG_LZO_COMPRESS=y
1459CONFIG_TEXTSEARCH_BM=m 1277CONFIG_LZO_DECOMPRESS=y
1460CONFIG_TEXTSEARCH_FSM=m
1461CONFIG_PLIST=y
1462CONFIG_HAS_IOMEM=y 1278CONFIG_HAS_IOMEM=y
1463CONFIG_HAS_IOPORT=y 1279CONFIG_HAS_IOPORT=y
1280CONFIG_HAS_DMA=y
1281CONFIG_NLATTR=y
diff --git a/arch/mips/configs/db1550_defconfig b/arch/mips/configs/db1550_defconfig
index 6b64339c0014..949b6dcf634b 100644
--- a/arch/mips/configs/db1550_defconfig
+++ b/arch/mips/configs/db1550_defconfig
@@ -1,79 +1,103 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.20 3# Linux kernel version: 2.6.33
4# Tue Feb 20 21:47:27 2007 4# Fri Feb 26 08:58:22 2010
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
8# 8#
9# Machine selection 9# Machine selection
10# 10#
11CONFIG_ZONE_DMA=y
12CONFIG_MACH_ALCHEMY=y 11CONFIG_MACH_ALCHEMY=y
13# CONFIG_MIPS_MTX1 is not set 12# CONFIG_AR7 is not set
14# CONFIG_MIPS_BOSPORUS is not set 13# CONFIG_BCM47XX is not set
15# CONFIG_MIPS_PB1000 is not set 14# CONFIG_BCM63XX is not set
16# CONFIG_MIPS_PB1100 is not set
17# CONFIG_MIPS_PB1500 is not set
18# CONFIG_MIPS_PB1550 is not set
19# CONFIG_MIPS_PB1200 is not set
20# CONFIG_MIPS_DB1000 is not set
21# CONFIG_MIPS_DB1100 is not set
22# CONFIG_MIPS_DB1500 is not set
23CONFIG_MIPS_DB1550=y
24# CONFIG_MIPS_DB1200 is not set
25# CONFIG_MIPS_MIRAGE is not set
26# CONFIG_MIPS_COBALT is not set 15# CONFIG_MIPS_COBALT is not set
27# CONFIG_MACH_DECSTATION is not set 16# CONFIG_MACH_DECSTATION is not set
28# CONFIG_MACH_JAZZ is not set 17# CONFIG_MACH_JAZZ is not set
18# CONFIG_LASAT is not set
19# CONFIG_MACH_LOONGSON is not set
29# CONFIG_MIPS_MALTA is not set 20# CONFIG_MIPS_MALTA is not set
30# CONFIG_WR_PPMC is not set
31# CONFIG_MIPS_SIM is not set 21# CONFIG_MIPS_SIM is not set
32# CONFIG_MOMENCO_JAGUAR_ATX is not set 22# CONFIG_NEC_MARKEINS is not set
33# CONFIG_MIPS_XXS1500 is not set 23# CONFIG_MACH_VR41XX is not set
24# CONFIG_NXP_STB220 is not set
25# CONFIG_NXP_STB225 is not set
34# CONFIG_PNX8550_JBS is not set 26# CONFIG_PNX8550_JBS is not set
35# CONFIG_PNX8550_STB810 is not set 27# CONFIG_PNX8550_STB810 is not set
36# CONFIG_MACH_VR41XX is not set 28# CONFIG_PMC_MSP is not set
37# CONFIG_PMC_YOSEMITE is not set 29# CONFIG_PMC_YOSEMITE is not set
38# CONFIG_MARKEINS is not set 30# CONFIG_POWERTV is not set
39# CONFIG_SGI_IP22 is not set 31# CONFIG_SGI_IP22 is not set
40# CONFIG_SGI_IP27 is not set 32# CONFIG_SGI_IP27 is not set
33# CONFIG_SGI_IP28 is not set
41# CONFIG_SGI_IP32 is not set 34# CONFIG_SGI_IP32 is not set
42# CONFIG_SIBYTE_BIGSUR is not set
43# CONFIG_SIBYTE_SWARM is not set
44# CONFIG_SIBYTE_SENTOSA is not set
45# CONFIG_SIBYTE_RHONE is not set
46# CONFIG_SIBYTE_CARMEL is not set
47# CONFIG_SIBYTE_LITTLESUR is not set
48# CONFIG_SIBYTE_CRHINE is not set 35# CONFIG_SIBYTE_CRHINE is not set
36# CONFIG_SIBYTE_CARMEL is not set
49# CONFIG_SIBYTE_CRHONE is not set 37# CONFIG_SIBYTE_CRHONE is not set
38# CONFIG_SIBYTE_RHONE is not set
39# CONFIG_SIBYTE_SWARM is not set
40# CONFIG_SIBYTE_LITTLESUR is not set
41# CONFIG_SIBYTE_SENTOSA is not set
42# CONFIG_SIBYTE_BIGSUR is not set
50# CONFIG_SNI_RM is not set 43# CONFIG_SNI_RM is not set
51# CONFIG_TOSHIBA_JMR3927 is not set 44# CONFIG_MACH_TX39XX is not set
52# CONFIG_TOSHIBA_RBTX4927 is not set 45# CONFIG_MACH_TX49XX is not set
53# CONFIG_TOSHIBA_RBTX4938 is not set 46# CONFIG_MIKROTIK_RB532 is not set
47# CONFIG_WR_PPMC is not set
48# CONFIG_CAVIUM_OCTEON_SIMULATOR is not set
49# CONFIG_CAVIUM_OCTEON_REFERENCE_BOARD is not set
50CONFIG_ALCHEMY_GPIOINT_AU1000=y
51# CONFIG_ALCHEMY_GPIO_INDIRECT is not set
52# CONFIG_MIPS_MTX1 is not set
53# CONFIG_MIPS_BOSPORUS is not set
54# CONFIG_MIPS_DB1000 is not set
55# CONFIG_MIPS_DB1100 is not set
56# CONFIG_MIPS_DB1200 is not set
57# CONFIG_MIPS_DB1500 is not set
58CONFIG_MIPS_DB1550=y
59# CONFIG_MIPS_MIRAGE is not set
60# CONFIG_MIPS_PB1000 is not set
61# CONFIG_MIPS_PB1100 is not set
62# CONFIG_MIPS_PB1200 is not set
63# CONFIG_MIPS_PB1500 is not set
64# CONFIG_MIPS_PB1550 is not set
65# CONFIG_MIPS_XXS1500 is not set
66CONFIG_SOC_AU1550=y
67CONFIG_SOC_AU1X00=y
68CONFIG_LOONGSON_UART_BASE=y
54CONFIG_RWSEM_GENERIC_SPINLOCK=y 69CONFIG_RWSEM_GENERIC_SPINLOCK=y
55# CONFIG_ARCH_HAS_ILOG2_U32 is not set 70# CONFIG_ARCH_HAS_ILOG2_U32 is not set
56# CONFIG_ARCH_HAS_ILOG2_U64 is not set 71# CONFIG_ARCH_HAS_ILOG2_U64 is not set
72CONFIG_ARCH_SUPPORTS_OPROFILE=y
57CONFIG_GENERIC_FIND_NEXT_BIT=y 73CONFIG_GENERIC_FIND_NEXT_BIT=y
58CONFIG_GENERIC_HWEIGHT=y 74CONFIG_GENERIC_HWEIGHT=y
59CONFIG_GENERIC_CALIBRATE_DELAY=y 75CONFIG_GENERIC_CALIBRATE_DELAY=y
76CONFIG_GENERIC_CLOCKEVENTS=y
60CONFIG_GENERIC_TIME=y 77CONFIG_GENERIC_TIME=y
61CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y 78CONFIG_GENERIC_CMOS_UPDATE=y
62# CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ is not set 79CONFIG_SCHED_OMIT_FRAME_POINTER=y
80CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
81CONFIG_CEVT_R4K_LIB=y
82CONFIG_CSRC_R4K_LIB=y
63CONFIG_DMA_NONCOHERENT=y 83CONFIG_DMA_NONCOHERENT=y
64CONFIG_DMA_NEED_PCI_MAP_STATE=y 84CONFIG_DMA_NEED_PCI_MAP_STATE=y
85CONFIG_SYS_HAS_EARLY_PRINTK=y
65CONFIG_MIPS_DISABLE_OBSOLETE_IDE=y 86CONFIG_MIPS_DISABLE_OBSOLETE_IDE=y
87# CONFIG_NO_IOPORT is not set
88CONFIG_GENERIC_GPIO=y
66# CONFIG_CPU_BIG_ENDIAN is not set 89# CONFIG_CPU_BIG_ENDIAN is not set
67CONFIG_CPU_LITTLE_ENDIAN=y 90CONFIG_CPU_LITTLE_ENDIAN=y
68CONFIG_SYS_SUPPORTS_APM_EMULATION=y 91CONFIG_SYS_SUPPORTS_APM_EMULATION=y
69CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y 92CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
70CONFIG_SOC_AU1550=y 93CONFIG_IRQ_CPU=y
71CONFIG_SOC_AU1X00=y
72CONFIG_MIPS_L1_CACHE_SHIFT=5 94CONFIG_MIPS_L1_CACHE_SHIFT=5
73 95
74# 96#
75# CPU selection 97# CPU selection
76# 98#
99# CONFIG_CPU_LOONGSON2E is not set
100# CONFIG_CPU_LOONGSON2F is not set
77CONFIG_CPU_MIPS32_R1=y 101CONFIG_CPU_MIPS32_R1=y
78# CONFIG_CPU_MIPS32_R2 is not set 102# CONFIG_CPU_MIPS32_R2 is not set
79# CONFIG_CPU_MIPS64_R1 is not set 103# CONFIG_CPU_MIPS64_R1 is not set
@@ -86,6 +110,7 @@ CONFIG_CPU_MIPS32_R1=y
86# CONFIG_CPU_TX49XX is not set 110# CONFIG_CPU_TX49XX is not set
87# CONFIG_CPU_R5000 is not set 111# CONFIG_CPU_R5000 is not set
88# CONFIG_CPU_R5432 is not set 112# CONFIG_CPU_R5432 is not set
113# CONFIG_CPU_R5500 is not set
89# CONFIG_CPU_R6000 is not set 114# CONFIG_CPU_R6000 is not set
90# CONFIG_CPU_NEVADA is not set 115# CONFIG_CPU_NEVADA is not set
91# CONFIG_CPU_R8000 is not set 116# CONFIG_CPU_R8000 is not set
@@ -93,11 +118,14 @@ CONFIG_CPU_MIPS32_R1=y
93# CONFIG_CPU_RM7000 is not set 118# CONFIG_CPU_RM7000 is not set
94# CONFIG_CPU_RM9000 is not set 119# CONFIG_CPU_RM9000 is not set
95# CONFIG_CPU_SB1 is not set 120# CONFIG_CPU_SB1 is not set
121# CONFIG_CPU_CAVIUM_OCTEON is not set
122CONFIG_SYS_SUPPORTS_ZBOOT=y
96CONFIG_SYS_HAS_CPU_MIPS32_R1=y 123CONFIG_SYS_HAS_CPU_MIPS32_R1=y
97CONFIG_CPU_MIPS32=y 124CONFIG_CPU_MIPS32=y
98CONFIG_CPU_MIPSR1=y 125CONFIG_CPU_MIPSR1=y
99CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y 126CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
100CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y 127CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
128CONFIG_HARDWARE_WATCHPOINTS=y
101 129
102# 130#
103# Kernel type 131# Kernel type
@@ -107,137 +135,205 @@ CONFIG_32BIT=y
107CONFIG_PAGE_SIZE_4KB=y 135CONFIG_PAGE_SIZE_4KB=y
108# CONFIG_PAGE_SIZE_8KB is not set 136# CONFIG_PAGE_SIZE_8KB is not set
109# CONFIG_PAGE_SIZE_16KB is not set 137# CONFIG_PAGE_SIZE_16KB is not set
138# CONFIG_PAGE_SIZE_32KB is not set
110# CONFIG_PAGE_SIZE_64KB is not set 139# CONFIG_PAGE_SIZE_64KB is not set
111CONFIG_CPU_HAS_PREFETCH=y 140CONFIG_CPU_HAS_PREFETCH=y
112CONFIG_MIPS_MT_DISABLED=y 141CONFIG_MIPS_MT_DISABLED=y
113# CONFIG_MIPS_MT_SMP is not set 142# CONFIG_MIPS_MT_SMP is not set
114# CONFIG_MIPS_MT_SMTC is not set 143# CONFIG_MIPS_MT_SMTC is not set
115# CONFIG_MIPS_VPE_LOADER is not set
116CONFIG_64BIT_PHYS_ADDR=y 144CONFIG_64BIT_PHYS_ADDR=y
145CONFIG_ARCH_PHYS_ADDR_T_64BIT=y
117CONFIG_CPU_HAS_SYNC=y 146CONFIG_CPU_HAS_SYNC=y
118CONFIG_GENERIC_HARDIRQS=y 147CONFIG_GENERIC_HARDIRQS=y
119CONFIG_GENERIC_IRQ_PROBE=y 148CONFIG_GENERIC_IRQ_PROBE=y
120CONFIG_CPU_SUPPORTS_HIGHMEM=y 149CONFIG_CPU_SUPPORTS_HIGHMEM=y
121CONFIG_ARCH_FLATMEM_ENABLE=y 150CONFIG_ARCH_FLATMEM_ENABLE=y
151CONFIG_ARCH_POPULATES_NODE_MAP=y
122CONFIG_SELECT_MEMORY_MODEL=y 152CONFIG_SELECT_MEMORY_MODEL=y
123CONFIG_FLATMEM_MANUAL=y 153CONFIG_FLATMEM_MANUAL=y
124# CONFIG_DISCONTIGMEM_MANUAL is not set 154# CONFIG_DISCONTIGMEM_MANUAL is not set
125# CONFIG_SPARSEMEM_MANUAL is not set 155# CONFIG_SPARSEMEM_MANUAL is not set
126CONFIG_FLATMEM=y 156CONFIG_FLATMEM=y
127CONFIG_FLAT_NODE_MEM_MAP=y 157CONFIG_FLAT_NODE_MEM_MAP=y
128# CONFIG_SPARSEMEM_STATIC is not set 158CONFIG_PAGEFLAGS_EXTENDED=y
129CONFIG_SPLIT_PTLOCK_CPUS=4 159CONFIG_SPLIT_PTLOCK_CPUS=4
130CONFIG_RESOURCES_64BIT=y 160CONFIG_PHYS_ADDR_T_64BIT=y
131CONFIG_ZONE_DMA_FLAG=1 161CONFIG_ZONE_DMA_FLAG=0
162CONFIG_VIRT_TO_BUS=y
163# CONFIG_KSM is not set
164CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
165CONFIG_TICK_ONESHOT=y
166CONFIG_NO_HZ=y
167CONFIG_HIGH_RES_TIMERS=y
168CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
132# CONFIG_HZ_48 is not set 169# CONFIG_HZ_48 is not set
133# CONFIG_HZ_100 is not set 170CONFIG_HZ_100=y
134# CONFIG_HZ_128 is not set 171# CONFIG_HZ_128 is not set
135# CONFIG_HZ_250 is not set 172# CONFIG_HZ_250 is not set
136# CONFIG_HZ_256 is not set 173# CONFIG_HZ_256 is not set
137CONFIG_HZ_1000=y 174# CONFIG_HZ_1000 is not set
138# CONFIG_HZ_1024 is not set 175# CONFIG_HZ_1024 is not set
139CONFIG_SYS_SUPPORTS_ARBIT_HZ=y 176CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
140CONFIG_HZ=1000 177CONFIG_HZ=100
141CONFIG_PREEMPT_NONE=y 178CONFIG_PREEMPT_NONE=y
142# CONFIG_PREEMPT_VOLUNTARY is not set 179# CONFIG_PREEMPT_VOLUNTARY is not set
143# CONFIG_PREEMPT is not set 180# CONFIG_PREEMPT is not set
144# CONFIG_KEXEC is not set 181# CONFIG_KEXEC is not set
182# CONFIG_SECCOMP is not set
145CONFIG_LOCKDEP_SUPPORT=y 183CONFIG_LOCKDEP_SUPPORT=y
146CONFIG_STACKTRACE_SUPPORT=y 184CONFIG_STACKTRACE_SUPPORT=y
147CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 185CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
186CONFIG_CONSTRUCTORS=y
148 187
149# 188#
150# Code maturity level options 189# General setup
151# 190#
152CONFIG_EXPERIMENTAL=y 191CONFIG_EXPERIMENTAL=y
153CONFIG_BROKEN_ON_SMP=y 192CONFIG_BROKEN_ON_SMP=y
154CONFIG_INIT_ENV_ARG_LIMIT=32 193CONFIG_INIT_ENV_ARG_LIMIT=32
155 194CONFIG_LOCALVERSION="-db1550"
156#
157# General setup
158#
159CONFIG_LOCALVERSION=""
160CONFIG_LOCALVERSION_AUTO=y 195CONFIG_LOCALVERSION_AUTO=y
196CONFIG_HAVE_KERNEL_GZIP=y
197CONFIG_HAVE_KERNEL_BZIP2=y
198CONFIG_HAVE_KERNEL_LZMA=y
199CONFIG_HAVE_KERNEL_LZO=y
200# CONFIG_KERNEL_GZIP is not set
201# CONFIG_KERNEL_BZIP2 is not set
202CONFIG_KERNEL_LZMA=y
203# CONFIG_KERNEL_LZO is not set
161CONFIG_SWAP=y 204CONFIG_SWAP=y
162CONFIG_SYSVIPC=y 205CONFIG_SYSVIPC=y
163# CONFIG_IPC_NS is not set
164CONFIG_SYSVIPC_SYSCTL=y 206CONFIG_SYSVIPC_SYSCTL=y
165# CONFIG_POSIX_MQUEUE is not set 207CONFIG_POSIX_MQUEUE=y
208CONFIG_POSIX_MQUEUE_SYSCTL=y
166# CONFIG_BSD_PROCESS_ACCT is not set 209# CONFIG_BSD_PROCESS_ACCT is not set
167# CONFIG_TASKSTATS is not set 210# CONFIG_TASKSTATS is not set
168# CONFIG_UTS_NS is not set
169# CONFIG_AUDIT is not set 211# CONFIG_AUDIT is not set
212
213#
214# RCU Subsystem
215#
216# CONFIG_TREE_RCU is not set
217# CONFIG_TREE_PREEMPT_RCU is not set
218CONFIG_TINY_RCU=y
219# CONFIG_TREE_RCU_TRACE is not set
170# CONFIG_IKCONFIG is not set 220# CONFIG_IKCONFIG is not set
171CONFIG_SYSFS_DEPRECATED=y 221CONFIG_LOG_BUF_SHIFT=14
172CONFIG_RELAY=y 222# CONFIG_GROUP_SCHED is not set
173# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 223# CONFIG_CGROUPS is not set
224# CONFIG_SYSFS_DEPRECATED_V2 is not set
225# CONFIG_RELAY is not set
226# CONFIG_NAMESPACES is not set
227# CONFIG_BLK_DEV_INITRD is not set
228CONFIG_CC_OPTIMIZE_FOR_SIZE=y
174CONFIG_SYSCTL=y 229CONFIG_SYSCTL=y
230CONFIG_ANON_INODES=y
175CONFIG_EMBEDDED=y 231CONFIG_EMBEDDED=y
176CONFIG_SYSCTL_SYSCALL=y 232# CONFIG_SYSCTL_SYSCALL is not set
177CONFIG_KALLSYMS=y 233# CONFIG_KALLSYMS is not set
178# CONFIG_KALLSYMS_EXTRA_PASS is not set
179CONFIG_HOTPLUG=y 234CONFIG_HOTPLUG=y
180CONFIG_PRINTK=y 235CONFIG_PRINTK=y
181CONFIG_BUG=y 236CONFIG_BUG=y
182CONFIG_ELF_CORE=y 237CONFIG_ELF_CORE=y
238# CONFIG_PCSPKR_PLATFORM is not set
183CONFIG_BASE_FULL=y 239CONFIG_BASE_FULL=y
184CONFIG_FUTEX=y 240CONFIG_FUTEX=y
185CONFIG_EPOLL=y 241CONFIG_EPOLL=y
242CONFIG_SIGNALFD=y
243CONFIG_TIMERFD=y
244CONFIG_EVENTFD=y
186CONFIG_SHMEM=y 245CONFIG_SHMEM=y
246CONFIG_AIO=y
247
248#
249# Kernel Performance Events And Counters
250#
251# CONFIG_VM_EVENT_COUNTERS is not set
252CONFIG_PCI_QUIRKS=y
253# CONFIG_COMPAT_BRK is not set
187CONFIG_SLAB=y 254CONFIG_SLAB=y
188CONFIG_VM_EVENT_COUNTERS=y 255# CONFIG_SLUB is not set
189CONFIG_RT_MUTEXES=y
190# CONFIG_TINY_SHMEM is not set
191CONFIG_BASE_SMALL=0
192# CONFIG_SLOB is not set 256# CONFIG_SLOB is not set
257# CONFIG_PROFILING is not set
258CONFIG_HAVE_OPROFILE=y
193 259
194# 260#
195# Loadable module support 261# GCOV-based kernel profiling
196# 262#
263# CONFIG_SLOW_WORK is not set
264CONFIG_HAVE_GENERIC_DMA_COHERENT=y
265CONFIG_SLABINFO=y
266CONFIG_RT_MUTEXES=y
267CONFIG_BASE_SMALL=0
197CONFIG_MODULES=y 268CONFIG_MODULES=y
269# CONFIG_MODULE_FORCE_LOAD is not set
198CONFIG_MODULE_UNLOAD=y 270CONFIG_MODULE_UNLOAD=y
199# CONFIG_MODULE_FORCE_UNLOAD is not set 271# CONFIG_MODULE_FORCE_UNLOAD is not set
200CONFIG_MODVERSIONS=y 272# CONFIG_MODVERSIONS is not set
201CONFIG_MODULE_SRCVERSION_ALL=y 273# CONFIG_MODULE_SRCVERSION_ALL is not set
202CONFIG_KMOD=y
203
204#
205# Block layer
206#
207CONFIG_BLOCK=y 274CONFIG_BLOCK=y
208# CONFIG_LBD is not set 275CONFIG_LBDAF=y
209# CONFIG_BLK_DEV_IO_TRACE is not set 276CONFIG_BLK_DEV_BSG=y
210# CONFIG_LSF is not set 277# CONFIG_BLK_DEV_INTEGRITY is not set
211 278
212# 279#
213# IO Schedulers 280# IO Schedulers
214# 281#
215CONFIG_IOSCHED_NOOP=y 282CONFIG_IOSCHED_NOOP=y
216CONFIG_IOSCHED_AS=y 283# CONFIG_IOSCHED_DEADLINE is not set
217CONFIG_IOSCHED_DEADLINE=y 284# CONFIG_IOSCHED_CFQ is not set
218CONFIG_IOSCHED_CFQ=y
219CONFIG_DEFAULT_AS=y
220# CONFIG_DEFAULT_DEADLINE is not set 285# CONFIG_DEFAULT_DEADLINE is not set
221# CONFIG_DEFAULT_CFQ is not set 286# CONFIG_DEFAULT_CFQ is not set
222# CONFIG_DEFAULT_NOOP is not set 287CONFIG_DEFAULT_NOOP=y
223CONFIG_DEFAULT_IOSCHED="anticipatory" 288CONFIG_DEFAULT_IOSCHED="noop"
289# CONFIG_INLINE_SPIN_TRYLOCK is not set
290# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set
291# CONFIG_INLINE_SPIN_LOCK is not set
292# CONFIG_INLINE_SPIN_LOCK_BH is not set
293# CONFIG_INLINE_SPIN_LOCK_IRQ is not set
294# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set
295CONFIG_INLINE_SPIN_UNLOCK=y
296# CONFIG_INLINE_SPIN_UNLOCK_BH is not set
297CONFIG_INLINE_SPIN_UNLOCK_IRQ=y
298# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set
299# CONFIG_INLINE_READ_TRYLOCK is not set
300# CONFIG_INLINE_READ_LOCK is not set
301# CONFIG_INLINE_READ_LOCK_BH is not set
302# CONFIG_INLINE_READ_LOCK_IRQ is not set
303# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set
304CONFIG_INLINE_READ_UNLOCK=y
305# CONFIG_INLINE_READ_UNLOCK_BH is not set
306CONFIG_INLINE_READ_UNLOCK_IRQ=y
307# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set
308# CONFIG_INLINE_WRITE_TRYLOCK is not set
309# CONFIG_INLINE_WRITE_LOCK is not set
310# CONFIG_INLINE_WRITE_LOCK_BH is not set
311# CONFIG_INLINE_WRITE_LOCK_IRQ is not set
312# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set
313CONFIG_INLINE_WRITE_UNLOCK=y
314# CONFIG_INLINE_WRITE_UNLOCK_BH is not set
315CONFIG_INLINE_WRITE_UNLOCK_IRQ=y
316# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set
317# CONFIG_MUTEX_SPIN_ON_OWNER is not set
318CONFIG_FREEZER=y
224 319
225# 320#
226# Bus options (PCI, PCMCIA, EISA, ISA, TC) 321# Bus options (PCI, PCMCIA, EISA, ISA, TC)
227# 322#
228CONFIG_HW_HAS_PCI=y 323CONFIG_HW_HAS_PCI=y
229CONFIG_PCI=y 324CONFIG_PCI=y
325CONFIG_PCI_DOMAINS=y
326# CONFIG_ARCH_SUPPORTS_MSI is not set
327CONFIG_PCI_LEGACY=y
328# CONFIG_PCI_DEBUG is not set
329# CONFIG_PCI_STUB is not set
330# CONFIG_PCI_IOV is not set
230CONFIG_MMU=y 331CONFIG_MMU=y
231 332CONFIG_PCCARD=y
232# 333CONFIG_PCMCIA=y
233# PCCARD (PCMCIA/CardBus) support
234#
235CONFIG_PCCARD=m
236# CONFIG_PCMCIA_DEBUG is not set
237CONFIG_PCMCIA=m
238CONFIG_PCMCIA_LOAD_CIS=y 334CONFIG_PCMCIA_LOAD_CIS=y
239CONFIG_PCMCIA_IOCTL=y 335# CONFIG_PCMCIA_IOCTL is not set
240CONFIG_CARDBUS=y 336# CONFIG_CARDBUS is not set
241 337
242# 338#
243# PC-card bridges 339# PC-card bridges
@@ -245,51 +341,49 @@ CONFIG_CARDBUS=y
245# CONFIG_YENTA is not set 341# CONFIG_YENTA is not set
246# CONFIG_PD6729 is not set 342# CONFIG_PD6729 is not set
247# CONFIG_I82092 is not set 343# CONFIG_I82092 is not set
248CONFIG_PCMCIA_AU1X00=m 344# CONFIG_PCMCIA_AU1X00 is not set
249 345CONFIG_PCMCIA_ALCHEMY_DEVBOARD=y
250#
251# PCI Hotplug Support
252#
253# CONFIG_HOTPLUG_PCI is not set 346# CONFIG_HOTPLUG_PCI is not set
254 347
255# 348#
256# Executable file formats 349# Executable file formats
257# 350#
258CONFIG_BINFMT_ELF=y 351CONFIG_BINFMT_ELF=y
352# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
353# CONFIG_HAVE_AOUT is not set
259# CONFIG_BINFMT_MISC is not set 354# CONFIG_BINFMT_MISC is not set
260CONFIG_TRAD_SIGNALS=y 355CONFIG_TRAD_SIGNALS=y
261 356
262# 357#
263# Power management options 358# Power management options
264# 359#
265# CONFIG_PM is not set 360CONFIG_ARCH_HIBERNATION_POSSIBLE=y
266 361CONFIG_ARCH_SUSPEND_POSSIBLE=y
267# 362CONFIG_PM=y
268# Networking 363# CONFIG_PM_DEBUG is not set
269# 364CONFIG_PM_SLEEP=y
365CONFIG_SUSPEND=y
366CONFIG_SUSPEND_FREEZER=y
367# CONFIG_HIBERNATION is not set
368# CONFIG_APM_EMULATION is not set
369CONFIG_PM_RUNTIME=y
270CONFIG_NET=y 370CONFIG_NET=y
271 371
272# 372#
273# Networking options 373# Networking options
274# 374#
275# CONFIG_NETDEBUG is not set
276CONFIG_PACKET=y 375CONFIG_PACKET=y
277# CONFIG_PACKET_MMAP is not set 376CONFIG_PACKET_MMAP=y
278CONFIG_UNIX=y 377CONFIG_UNIX=y
279CONFIG_XFRM=y 378# CONFIG_NET_KEY is not set
280CONFIG_XFRM_USER=m
281# CONFIG_XFRM_SUB_POLICY is not set
282CONFIG_XFRM_MIGRATE=y
283CONFIG_NET_KEY=y
284CONFIG_NET_KEY_MIGRATE=y
285CONFIG_INET=y 379CONFIG_INET=y
286CONFIG_IP_MULTICAST=y 380CONFIG_IP_MULTICAST=y
287# CONFIG_IP_ADVANCED_ROUTER is not set 381# CONFIG_IP_ADVANCED_ROUTER is not set
288CONFIG_IP_FIB_HASH=y 382CONFIG_IP_FIB_HASH=y
289CONFIG_IP_PNP=y 383CONFIG_IP_PNP=y
290# CONFIG_IP_PNP_DHCP is not set 384CONFIG_IP_PNP_DHCP=y
291CONFIG_IP_PNP_BOOTP=y 385CONFIG_IP_PNP_BOOTP=y
292# CONFIG_IP_PNP_RARP is not set 386CONFIG_IP_PNP_RARP=y
293# CONFIG_NET_IPIP is not set 387# CONFIG_NET_IPIP is not set
294# CONFIG_NET_IPGRE is not set 388# CONFIG_NET_IPGRE is not set
295# CONFIG_IP_MROUTE is not set 389# CONFIG_IP_MROUTE is not set
@@ -300,110 +394,25 @@ CONFIG_IP_PNP_BOOTP=y
300# CONFIG_INET_IPCOMP is not set 394# CONFIG_INET_IPCOMP is not set
301# CONFIG_INET_XFRM_TUNNEL is not set 395# CONFIG_INET_XFRM_TUNNEL is not set
302# CONFIG_INET_TUNNEL is not set 396# CONFIG_INET_TUNNEL is not set
303CONFIG_INET_XFRM_MODE_TRANSPORT=m 397# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
304CONFIG_INET_XFRM_MODE_TUNNEL=m 398# CONFIG_INET_XFRM_MODE_TUNNEL is not set
305CONFIG_INET_XFRM_MODE_BEET=m 399# CONFIG_INET_XFRM_MODE_BEET is not set
306CONFIG_INET_DIAG=y 400CONFIG_INET_LRO=y
307CONFIG_INET_TCP_DIAG=y 401# CONFIG_INET_DIAG is not set
308# CONFIG_TCP_CONG_ADVANCED is not set 402# CONFIG_TCP_CONG_ADVANCED is not set
309CONFIG_TCP_CONG_CUBIC=y 403CONFIG_TCP_CONG_CUBIC=y
310CONFIG_DEFAULT_TCP_CONG="cubic" 404CONFIG_DEFAULT_TCP_CONG="cubic"
311CONFIG_TCP_MD5SIG=y 405# CONFIG_TCP_MD5SIG is not set
312
313#
314# IP: Virtual Server Configuration
315#
316# CONFIG_IP_VS is not set
317# CONFIG_IPV6 is not set 406# CONFIG_IPV6 is not set
318# CONFIG_INET6_XFRM_TUNNEL is not set 407# CONFIG_NETWORK_SECMARK is not set
319# CONFIG_INET6_TUNNEL is not set 408# CONFIG_NETFILTER is not set
320CONFIG_NETWORK_SECMARK=y
321CONFIG_NETFILTER=y
322# CONFIG_NETFILTER_DEBUG is not set
323
324#
325# Core Netfilter Configuration
326#
327CONFIG_NETFILTER_NETLINK=m
328CONFIG_NETFILTER_NETLINK_QUEUE=m
329CONFIG_NETFILTER_NETLINK_LOG=m
330CONFIG_NF_CONNTRACK_ENABLED=m
331CONFIG_NF_CONNTRACK_SUPPORT=y
332# CONFIG_IP_NF_CONNTRACK_SUPPORT is not set
333CONFIG_NF_CONNTRACK=m
334CONFIG_NF_CT_ACCT=y
335CONFIG_NF_CONNTRACK_MARK=y
336CONFIG_NF_CONNTRACK_SECMARK=y
337CONFIG_NF_CONNTRACK_EVENTS=y
338CONFIG_NF_CT_PROTO_GRE=m
339CONFIG_NF_CT_PROTO_SCTP=m
340CONFIG_NF_CONNTRACK_AMANDA=m
341CONFIG_NF_CONNTRACK_FTP=m
342CONFIG_NF_CONNTRACK_H323=m
343CONFIG_NF_CONNTRACK_IRC=m
344# CONFIG_NF_CONNTRACK_NETBIOS_NS is not set
345CONFIG_NF_CONNTRACK_PPTP=m
346CONFIG_NF_CONNTRACK_SANE=m
347CONFIG_NF_CONNTRACK_SIP=m
348CONFIG_NF_CONNTRACK_TFTP=m
349CONFIG_NF_CT_NETLINK=m
350CONFIG_NETFILTER_XTABLES=m
351CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
352CONFIG_NETFILTER_XT_TARGET_MARK=m
353CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
354CONFIG_NETFILTER_XT_TARGET_NFLOG=m
355CONFIG_NETFILTER_XT_TARGET_SECMARK=m
356CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=m
357CONFIG_NETFILTER_XT_TARGET_TCPMSS=m
358CONFIG_NETFILTER_XT_MATCH_COMMENT=m
359CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
360CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
361CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
362CONFIG_NETFILTER_XT_MATCH_DCCP=m
363CONFIG_NETFILTER_XT_MATCH_DSCP=m
364CONFIG_NETFILTER_XT_MATCH_ESP=m
365CONFIG_NETFILTER_XT_MATCH_HELPER=m
366CONFIG_NETFILTER_XT_MATCH_LENGTH=m
367CONFIG_NETFILTER_XT_MATCH_LIMIT=m
368CONFIG_NETFILTER_XT_MATCH_MAC=m
369CONFIG_NETFILTER_XT_MATCH_MARK=m
370CONFIG_NETFILTER_XT_MATCH_POLICY=m
371CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
372CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
373CONFIG_NETFILTER_XT_MATCH_QUOTA=m
374CONFIG_NETFILTER_XT_MATCH_REALM=m
375CONFIG_NETFILTER_XT_MATCH_SCTP=m
376CONFIG_NETFILTER_XT_MATCH_STATE=m
377CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
378CONFIG_NETFILTER_XT_MATCH_STRING=m
379CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
380CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
381
382#
383# IP: Netfilter Configuration
384#
385CONFIG_NF_CONNTRACK_IPV4=m
386CONFIG_NF_CONNTRACK_PROC_COMPAT=y
387# CONFIG_IP_NF_QUEUE is not set
388# CONFIG_IP_NF_IPTABLES is not set
389# CONFIG_IP_NF_ARPTABLES is not set
390
391#
392# DCCP Configuration (EXPERIMENTAL)
393#
394# CONFIG_IP_DCCP is not set 409# CONFIG_IP_DCCP is not set
395
396#
397# SCTP Configuration (EXPERIMENTAL)
398#
399# CONFIG_IP_SCTP is not set 410# CONFIG_IP_SCTP is not set
400 411# CONFIG_RDS is not set
401#
402# TIPC Configuration (EXPERIMENTAL)
403#
404# CONFIG_TIPC is not set 412# CONFIG_TIPC is not set
405# CONFIG_ATM is not set 413# CONFIG_ATM is not set
406# CONFIG_BRIDGE is not set 414# CONFIG_BRIDGE is not set
415# CONFIG_NET_DSA is not set
407# CONFIG_VLAN_8021Q is not set 416# CONFIG_VLAN_8021Q is not set
408# CONFIG_DECNET is not set 417# CONFIG_DECNET is not set
409# CONFIG_LLC2 is not set 418# CONFIG_LLC2 is not set
@@ -413,27 +422,24 @@ CONFIG_NF_CONNTRACK_PROC_COMPAT=y
413# CONFIG_LAPB is not set 422# CONFIG_LAPB is not set
414# CONFIG_ECONET is not set 423# CONFIG_ECONET is not set
415# CONFIG_WAN_ROUTER is not set 424# CONFIG_WAN_ROUTER is not set
416 425# CONFIG_PHONET is not set
417# 426# CONFIG_IEEE802154 is not set
418# QoS and/or fair queueing
419#
420# CONFIG_NET_SCHED is not set 427# CONFIG_NET_SCHED is not set
421CONFIG_NET_CLS_ROUTE=y 428# CONFIG_DCB is not set
422 429
423# 430#
424# Network testing 431# Network testing
425# 432#
426# CONFIG_NET_PKTGEN is not set 433# CONFIG_NET_PKTGEN is not set
427# CONFIG_HAMRADIO is not set 434# CONFIG_HAMRADIO is not set
435# CONFIG_CAN is not set
428# CONFIG_IRDA is not set 436# CONFIG_IRDA is not set
429# CONFIG_BT is not set 437# CONFIG_BT is not set
430CONFIG_IEEE80211=m 438# CONFIG_AF_RXRPC is not set
431# CONFIG_IEEE80211_DEBUG is not set 439# CONFIG_WIRELESS is not set
432CONFIG_IEEE80211_CRYPT_WEP=m 440# CONFIG_WIMAX is not set
433CONFIG_IEEE80211_CRYPT_CCMP=m 441# CONFIG_RFKILL is not set
434CONFIG_IEEE80211_SOFTMAC=m 442# CONFIG_NET_9P is not set
435# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set
436CONFIG_WIRELESS_EXT=y
437 443
438# 444#
439# Device Drivers 445# Device Drivers
@@ -442,25 +448,25 @@ CONFIG_WIRELESS_EXT=y
442# 448#
443# Generic Driver Options 449# Generic Driver Options
444# 450#
451CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
452# CONFIG_DEVTMPFS is not set
445CONFIG_STANDALONE=y 453CONFIG_STANDALONE=y
446CONFIG_PREVENT_FIRMWARE_BUILD=y 454CONFIG_PREVENT_FIRMWARE_BUILD=y
447CONFIG_FW_LOADER=m 455CONFIG_FW_LOADER=y
456CONFIG_FIRMWARE_IN_KERNEL=y
457CONFIG_EXTRA_FIRMWARE=""
458# CONFIG_DEBUG_DRIVER is not set
459# CONFIG_DEBUG_DEVRES is not set
448# CONFIG_SYS_HYPERVISOR is not set 460# CONFIG_SYS_HYPERVISOR is not set
449 461# CONFIG_CONNECTOR is not set
450#
451# Connector - unified userspace <-> kernelspace linker
452#
453CONFIG_CONNECTOR=m
454
455#
456# Memory Technology Devices (MTD)
457#
458CONFIG_MTD=y 462CONFIG_MTD=y
459# CONFIG_MTD_DEBUG is not set 463# CONFIG_MTD_DEBUG is not set
464# CONFIG_MTD_TESTS is not set
460# CONFIG_MTD_CONCAT is not set 465# CONFIG_MTD_CONCAT is not set
461CONFIG_MTD_PARTITIONS=y 466CONFIG_MTD_PARTITIONS=y
462# CONFIG_MTD_REDBOOT_PARTS is not set 467# CONFIG_MTD_REDBOOT_PARTS is not set
463# CONFIG_MTD_CMDLINE_PARTS is not set 468# CONFIG_MTD_CMDLINE_PARTS is not set
469# CONFIG_MTD_AR7_PARTS is not set
464 470
465# 471#
466# User Modules And Translation Layers 472# User Modules And Translation Layers
@@ -473,6 +479,7 @@ CONFIG_MTD_BLOCK=y
473# CONFIG_INFTL is not set 479# CONFIG_INFTL is not set
474# CONFIG_RFD_FTL is not set 480# CONFIG_RFD_FTL is not set
475# CONFIG_SSFDC is not set 481# CONFIG_SSFDC is not set
482# CONFIG_MTD_OOPS is not set
476 483
477# 484#
478# RAM/ROM/Flash chip drivers 485# RAM/ROM/Flash chip drivers
@@ -498,20 +505,23 @@ CONFIG_MTD_CFI_UTIL=y
498# CONFIG_MTD_RAM is not set 505# CONFIG_MTD_RAM is not set
499# CONFIG_MTD_ROM is not set 506# CONFIG_MTD_ROM is not set
500# CONFIG_MTD_ABSENT is not set 507# CONFIG_MTD_ABSENT is not set
501# CONFIG_MTD_OBSOLETE_CHIPS is not set
502 508
503# 509#
504# Mapping drivers for chip access 510# Mapping drivers for chip access
505# 511#
506# CONFIG_MTD_COMPLEX_MAPPINGS is not set 512# CONFIG_MTD_COMPLEX_MAPPINGS is not set
507# CONFIG_MTD_PHYSMAP is not set 513CONFIG_MTD_PHYSMAP=y
508CONFIG_MTD_ALCHEMY=y 514# CONFIG_MTD_PHYSMAP_COMPAT is not set
515# CONFIG_MTD_INTEL_VR_NOR is not set
509# CONFIG_MTD_PLATRAM is not set 516# CONFIG_MTD_PLATRAM is not set
510 517
511# 518#
512# Self-contained MTD device drivers 519# Self-contained MTD device drivers
513# 520#
514# CONFIG_MTD_PMC551 is not set 521# CONFIG_MTD_PMC551 is not set
522# CONFIG_MTD_DATAFLASH is not set
523# CONFIG_MTD_M25P80 is not set
524# CONFIG_MTD_SST25L is not set
515# CONFIG_MTD_SLRAM is not set 525# CONFIG_MTD_SLRAM is not set
516# CONFIG_MTD_PHRAM is not set 526# CONFIG_MTD_PHRAM is not set
517# CONFIG_MTD_MTDRAM is not set 527# CONFIG_MTD_MTDRAM is not set
@@ -523,105 +533,96 @@ CONFIG_MTD_ALCHEMY=y
523# CONFIG_MTD_DOC2000 is not set 533# CONFIG_MTD_DOC2000 is not set
524# CONFIG_MTD_DOC2001 is not set 534# CONFIG_MTD_DOC2001 is not set
525# CONFIG_MTD_DOC2001PLUS is not set 535# CONFIG_MTD_DOC2001PLUS is not set
526 536CONFIG_MTD_NAND=y
527#
528# NAND Flash Device Drivers
529#
530CONFIG_MTD_NAND=m
531# CONFIG_MTD_NAND_VERIFY_WRITE is not set 537# CONFIG_MTD_NAND_VERIFY_WRITE is not set
532# CONFIG_MTD_NAND_ECC_SMC is not set 538# CONFIG_MTD_NAND_ECC_SMC is not set
533CONFIG_MTD_NAND_IDS=m 539# CONFIG_MTD_NAND_MUSEUM_IDS is not set
534CONFIG_MTD_NAND_AU1550=m 540CONFIG_MTD_NAND_IDS=y
541CONFIG_MTD_NAND_AU1550=y
535# CONFIG_MTD_NAND_DISKONCHIP is not set 542# CONFIG_MTD_NAND_DISKONCHIP is not set
536# CONFIG_MTD_NAND_CAFE is not set 543# CONFIG_MTD_NAND_CAFE is not set
537# CONFIG_MTD_NAND_NANDSIM is not set 544# CONFIG_MTD_NAND_NANDSIM is not set
538 545# CONFIG_MTD_NAND_PLATFORM is not set
539# 546# CONFIG_MTD_ALAUDA is not set
540# OneNAND Flash Device Drivers
541#
542# CONFIG_MTD_ONENAND is not set 547# CONFIG_MTD_ONENAND is not set
543 548
544# 549#
545# Parallel port support 550# LPDDR flash memory drivers
546# 551#
547# CONFIG_PARPORT is not set 552# CONFIG_MTD_LPDDR is not set
548 553
549# 554#
550# Plug and Play support 555# UBI - Unsorted block images
551#
552# CONFIG_PNPACPI is not set
553
554#
555# Block devices
556# 556#
557# CONFIG_MTD_UBI is not set
558# CONFIG_PARPORT is not set
559CONFIG_BLK_DEV=y
557# CONFIG_BLK_CPQ_DA is not set 560# CONFIG_BLK_CPQ_DA is not set
558# CONFIG_BLK_CPQ_CISS_DA is not set 561# CONFIG_BLK_CPQ_CISS_DA is not set
559# CONFIG_BLK_DEV_DAC960 is not set 562# CONFIG_BLK_DEV_DAC960 is not set
560# CONFIG_BLK_DEV_UMEM is not set 563# CONFIG_BLK_DEV_UMEM is not set
561# CONFIG_BLK_DEV_COW_COMMON is not set 564# CONFIG_BLK_DEV_COW_COMMON is not set
562CONFIG_BLK_DEV_LOOP=y 565# CONFIG_BLK_DEV_LOOP is not set
563# CONFIG_BLK_DEV_CRYPTOLOOP is not set
564# CONFIG_BLK_DEV_NBD is not set
565# CONFIG_BLK_DEV_SX8 is not set
566# CONFIG_BLK_DEV_RAM is not set
567# CONFIG_BLK_DEV_INITRD is not set
568CONFIG_CDROM_PKTCDVD=m
569CONFIG_CDROM_PKTCDVD_BUFFERS=8
570# CONFIG_CDROM_PKTCDVD_WCACHE is not set
571CONFIG_ATA_OVER_ETH=m
572
573#
574# Misc devices
575#
576CONFIG_SGI_IOC4=m
577# CONFIG_TIFM_CORE is not set
578 566
579# 567#
580# ATA/ATAPI/MFM/RLL support 568# DRBD disabled because PROC_FS, INET or CONNECTOR not selected
581# 569#
570# CONFIG_BLK_DEV_NBD is not set
571# CONFIG_BLK_DEV_SX8 is not set
572CONFIG_BLK_DEV_UB=y
573# CONFIG_BLK_DEV_RAM is not set
574# CONFIG_CDROM_PKTCDVD is not set
575# CONFIG_ATA_OVER_ETH is not set
576# CONFIG_BLK_DEV_HD is not set
577# CONFIG_MISC_DEVICES is not set
578CONFIG_HAVE_IDE=y
582CONFIG_IDE=y 579CONFIG_IDE=y
583CONFIG_IDE_MAX_HWIFS=4
584CONFIG_BLK_DEV_IDE=y
585 580
586# 581#
587# Please see Documentation/ide.txt for help/info on IDE drives 582# Please see Documentation/ide/ide.txt for help/info on IDE drives
588# 583#
584CONFIG_IDE_XFER_MODE=y
585CONFIG_IDE_ATAPI=y
589# CONFIG_BLK_DEV_IDE_SATA is not set 586# CONFIG_BLK_DEV_IDE_SATA is not set
590CONFIG_BLK_DEV_IDEDISK=y 587CONFIG_IDE_GD=y
591# CONFIG_IDEDISK_MULTI_MODE is not set 588CONFIG_IDE_GD_ATA=y
592CONFIG_BLK_DEV_IDECS=m 589# CONFIG_IDE_GD_ATAPI is not set
593# CONFIG_BLK_DEV_DELKIN is not set 590CONFIG_BLK_DEV_IDECS=y
594# CONFIG_BLK_DEV_IDECD is not set 591CONFIG_BLK_DEV_IDECD=y
592# CONFIG_BLK_DEV_IDECD_VERBOSE_ERRORS is not set
595# CONFIG_BLK_DEV_IDETAPE is not set 593# CONFIG_BLK_DEV_IDETAPE is not set
596# CONFIG_BLK_DEV_IDEFLOPPY is not set 594CONFIG_IDE_TASK_IOCTL=y
597# CONFIG_IDE_TASK_IOCTL is not set 595CONFIG_IDE_PROC_FS=y
598 596
599# 597#
600# IDE chipset support/bugfixes 598# IDE chipset support/bugfixes
601# 599#
602CONFIG_IDE_GENERIC=y 600# CONFIG_IDE_GENERIC is not set
601# CONFIG_BLK_DEV_PLATFORM is not set
602CONFIG_BLK_DEV_IDEDMA_SFF=y
603
604#
605# PCI IDE chipsets support
606#
603CONFIG_BLK_DEV_IDEPCI=y 607CONFIG_BLK_DEV_IDEPCI=y
604# CONFIG_IDEPCI_SHARE_IRQ is not set 608# CONFIG_IDEPCI_PCIBUS_ORDER is not set
605# CONFIG_BLK_DEV_OFFBOARD is not set 609# CONFIG_BLK_DEV_OFFBOARD is not set
606CONFIG_BLK_DEV_GENERIC=y 610# CONFIG_BLK_DEV_GENERIC is not set
607# CONFIG_BLK_DEV_OPTI621 is not set 611# CONFIG_BLK_DEV_OPTI621 is not set
608CONFIG_BLK_DEV_IDEDMA_PCI=y 612CONFIG_BLK_DEV_IDEDMA_PCI=y
609# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
610# CONFIG_IDEDMA_PCI_AUTO is not set
611# CONFIG_BLK_DEV_AEC62XX is not set 613# CONFIG_BLK_DEV_AEC62XX is not set
612# CONFIG_BLK_DEV_ALI15X3 is not set 614# CONFIG_BLK_DEV_ALI15X3 is not set
613# CONFIG_BLK_DEV_AMD74XX is not set 615# CONFIG_BLK_DEV_AMD74XX is not set
614# CONFIG_BLK_DEV_CMD64X is not set 616# CONFIG_BLK_DEV_CMD64X is not set
615# CONFIG_BLK_DEV_TRIFLEX is not set 617# CONFIG_BLK_DEV_TRIFLEX is not set
616# CONFIG_BLK_DEV_CY82C693 is not set
617# CONFIG_BLK_DEV_CS5520 is not set 618# CONFIG_BLK_DEV_CS5520 is not set
618# CONFIG_BLK_DEV_CS5530 is not set 619# CONFIG_BLK_DEV_CS5530 is not set
619# CONFIG_BLK_DEV_HPT34X is not set 620CONFIG_BLK_DEV_HPT366=y
620# CONFIG_BLK_DEV_HPT366 is not set
621# CONFIG_BLK_DEV_JMICRON is not set 621# CONFIG_BLK_DEV_JMICRON is not set
622# CONFIG_BLK_DEV_SC1200 is not set 622# CONFIG_BLK_DEV_SC1200 is not set
623# CONFIG_BLK_DEV_PIIX is not set 623# CONFIG_BLK_DEV_PIIX is not set
624CONFIG_BLK_DEV_IT8213=m 624# CONFIG_BLK_DEV_IT8172 is not set
625# CONFIG_BLK_DEV_IT8213 is not set
625# CONFIG_BLK_DEV_IT821X is not set 626# CONFIG_BLK_DEV_IT821X is not set
626# CONFIG_BLK_DEV_NS87415 is not set 627# CONFIG_BLK_DEV_NS87415 is not set
627# CONFIG_BLK_DEV_PDC202XX_OLD is not set 628# CONFIG_BLK_DEV_PDC202XX_OLD is not set
@@ -631,82 +632,65 @@ CONFIG_BLK_DEV_IT8213=m
631# CONFIG_BLK_DEV_SLC90E66 is not set 632# CONFIG_BLK_DEV_SLC90E66 is not set
632# CONFIG_BLK_DEV_TRM290 is not set 633# CONFIG_BLK_DEV_TRM290 is not set
633# CONFIG_BLK_DEV_VIA82CXXX is not set 634# CONFIG_BLK_DEV_VIA82CXXX is not set
634CONFIG_BLK_DEV_TC86C001=m 635# CONFIG_BLK_DEV_TC86C001 is not set
635# CONFIG_IDE_ARM is not set
636CONFIG_BLK_DEV_IDEDMA=y 636CONFIG_BLK_DEV_IDEDMA=y
637# CONFIG_IDEDMA_IVB is not set
638# CONFIG_IDEDMA_AUTO is not set
639# CONFIG_BLK_DEV_HD is not set
640 637
641# 638#
642# SCSI device support 639# SCSI device support
643# 640#
644CONFIG_RAID_ATTRS=m 641# CONFIG_RAID_ATTRS is not set
645# CONFIG_SCSI is not set 642# CONFIG_SCSI is not set
643# CONFIG_SCSI_DMA is not set
646# CONFIG_SCSI_NETLINK is not set 644# CONFIG_SCSI_NETLINK is not set
647
648#
649# Serial ATA (prod) and Parallel ATA (experimental) drivers
650#
651# CONFIG_ATA is not set 645# CONFIG_ATA is not set
652
653#
654# Multi-device support (RAID and LVM)
655#
656# CONFIG_MD is not set 646# CONFIG_MD is not set
657
658#
659# Fusion MPT device support
660#
661# CONFIG_FUSION is not set 647# CONFIG_FUSION is not set
662 648
663# 649#
664# IEEE 1394 (FireWire) support 650# IEEE 1394 (FireWire) support
665# 651#
666# CONFIG_IEEE1394 is not set
667 652
668# 653#
669# I2O device support 654# You can enable one or both FireWire driver stacks.
670# 655#
671# CONFIG_I2O is not set
672 656
673# 657#
674# Network device support 658# The newer stack is recommended.
675# 659#
660# CONFIG_FIREWIRE is not set
661# CONFIG_IEEE1394 is not set
662# CONFIG_I2O is not set
676CONFIG_NETDEVICES=y 663CONFIG_NETDEVICES=y
677# CONFIG_DUMMY is not set 664# CONFIG_DUMMY is not set
678# CONFIG_BONDING is not set 665# CONFIG_BONDING is not set
666# CONFIG_MACVLAN is not set
679# CONFIG_EQUALIZER is not set 667# CONFIG_EQUALIZER is not set
680# CONFIG_TUN is not set 668# CONFIG_TUN is not set
681 669# CONFIG_VETH is not set
682#
683# ARCnet devices
684#
685# CONFIG_ARCNET is not set 670# CONFIG_ARCNET is not set
686
687#
688# PHY device support
689#
690CONFIG_PHYLIB=y 671CONFIG_PHYLIB=y
691 672
692# 673#
693# MII PHY device drivers 674# MII PHY device drivers
694# 675#
695CONFIG_MARVELL_PHY=m 676CONFIG_MARVELL_PHY=y
696CONFIG_DAVICOM_PHY=m 677CONFIG_DAVICOM_PHY=y
697CONFIG_QSEMI_PHY=m 678CONFIG_QSEMI_PHY=y
698CONFIG_LXT_PHY=m 679CONFIG_LXT_PHY=y
699CONFIG_CICADA_PHY=m 680CONFIG_CICADA_PHY=y
700CONFIG_VITESSE_PHY=m 681CONFIG_VITESSE_PHY=y
701CONFIG_SMSC_PHY=m 682CONFIG_SMSC_PHY=y
702# CONFIG_BROADCOM_PHY is not set 683CONFIG_BROADCOM_PHY=y
684CONFIG_ICPLUS_PHY=y
685CONFIG_REALTEK_PHY=y
686CONFIG_NATIONAL_PHY=y
687CONFIG_STE10XP=y
688CONFIG_LSI_ET1011C_PHY=y
703# CONFIG_FIXED_PHY is not set 689# CONFIG_FIXED_PHY is not set
704 690# CONFIG_MDIO_BITBANG is not set
705#
706# Ethernet (10 or 100Mbit)
707#
708CONFIG_NET_ETHERNET=y 691CONFIG_NET_ETHERNET=y
709CONFIG_MII=m 692CONFIG_MII=y
693# CONFIG_AX88796 is not set
710CONFIG_MIPS_AU1X00_ENET=y 694CONFIG_MIPS_AU1X00_ENET=y
711# CONFIG_HAPPYMEAL is not set 695# CONFIG_HAPPYMEAL is not set
712# CONFIG_SUNGEM is not set 696# CONFIG_SUNGEM is not set
@@ -714,96 +698,53 @@ CONFIG_MIPS_AU1X00_ENET=y
714# CONFIG_NET_VENDOR_3COM is not set 698# CONFIG_NET_VENDOR_3COM is not set
715# CONFIG_SMC91X is not set 699# CONFIG_SMC91X is not set
716# CONFIG_DM9000 is not set 700# CONFIG_DM9000 is not set
717 701# CONFIG_ENC28J60 is not set
718# 702# CONFIG_ETHOC is not set
719# Tulip family network device support 703# CONFIG_SMSC911X is not set
720# 704# CONFIG_DNET is not set
721# CONFIG_NET_TULIP is not set 705# CONFIG_NET_TULIP is not set
722# CONFIG_HP100 is not set 706# CONFIG_HP100 is not set
707# CONFIG_IBM_NEW_EMAC_ZMII is not set
708# CONFIG_IBM_NEW_EMAC_RGMII is not set
709# CONFIG_IBM_NEW_EMAC_TAH is not set
710# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
711# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
712# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
713# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
723# CONFIG_NET_PCI is not set 714# CONFIG_NET_PCI is not set
724 715# CONFIG_B44 is not set
725# 716# CONFIG_KS8842 is not set
726# Ethernet (1000 Mbit) 717# CONFIG_KS8851 is not set
727# 718# CONFIG_KS8851_MLL is not set
728# CONFIG_ACENIC is not set 719# CONFIG_ATL2 is not set
729# CONFIG_DL2K is not set 720# CONFIG_NETDEV_1000 is not set
730# CONFIG_E1000 is not set 721# CONFIG_NETDEV_10000 is not set
731# CONFIG_NS83820 is not set
732# CONFIG_HAMACHI is not set
733# CONFIG_YELLOWFIN is not set
734# CONFIG_R8169 is not set
735# CONFIG_SIS190 is not set
736# CONFIG_SKGE is not set
737# CONFIG_SKY2 is not set
738# CONFIG_SK98LIN is not set
739# CONFIG_TIGON3 is not set
740# CONFIG_BNX2 is not set
741CONFIG_QLA3XXX=m
742# CONFIG_ATL1 is not set
743
744#
745# Ethernet (10000 Mbit)
746#
747# CONFIG_CHELSIO_T1 is not set
748CONFIG_CHELSIO_T3=m
749# CONFIG_IXGB is not set
750# CONFIG_S2IO is not set
751# CONFIG_MYRI10GE is not set
752CONFIG_NETXEN_NIC=m
753
754#
755# Token Ring devices
756#
757# CONFIG_TR is not set 722# CONFIG_TR is not set
723# CONFIG_WLAN is not set
758 724
759# 725#
760# Wireless LAN (non-hamradio) 726# Enable WiMAX (Networking options) to see the WiMAX drivers
761#
762# CONFIG_NET_RADIO is not set
763
764#
765# PCMCIA network device support
766# 727#
767CONFIG_NET_PCMCIA=y
768CONFIG_PCMCIA_3C589=m
769CONFIG_PCMCIA_3C574=m
770CONFIG_PCMCIA_FMVJ18X=m
771CONFIG_PCMCIA_PCNET=m
772CONFIG_PCMCIA_NMCLAN=m
773CONFIG_PCMCIA_SMC91C92=m
774CONFIG_PCMCIA_XIRC2PS=m
775CONFIG_PCMCIA_AXNET=m
776 728
777# 729#
778# Wan interfaces 730# USB Network Adapters
779# 731#
732# CONFIG_USB_CATC is not set
733# CONFIG_USB_KAWETH is not set
734# CONFIG_USB_PEGASUS is not set
735# CONFIG_USB_RTL8150 is not set
736# CONFIG_USB_USBNET is not set
737# CONFIG_NET_PCMCIA is not set
780# CONFIG_WAN is not set 738# CONFIG_WAN is not set
781# CONFIG_FDDI is not set 739# CONFIG_FDDI is not set
782# CONFIG_HIPPI is not set 740# CONFIG_HIPPI is not set
783CONFIG_PPP=m 741# CONFIG_PPP is not set
784CONFIG_PPP_MULTILINK=y
785# CONFIG_PPP_FILTER is not set
786CONFIG_PPP_ASYNC=m
787# CONFIG_PPP_SYNC_TTY is not set
788CONFIG_PPP_DEFLATE=m
789# CONFIG_PPP_BSDCOMP is not set
790CONFIG_PPP_MPPE=m
791CONFIG_PPPOE=m
792# CONFIG_SLIP is not set 742# CONFIG_SLIP is not set
793CONFIG_SLHC=m
794# CONFIG_SHAPER is not set
795# CONFIG_NETCONSOLE is not set 743# CONFIG_NETCONSOLE is not set
796# CONFIG_NETPOLL is not set 744# CONFIG_NETPOLL is not set
797# CONFIG_NET_POLL_CONTROLLER is not set 745# CONFIG_NET_POLL_CONTROLLER is not set
798 746# CONFIG_VMXNET3 is not set
799#
800# ISDN subsystem
801#
802# CONFIG_ISDN is not set 747# CONFIG_ISDN is not set
803
804#
805# Telephony Support
806#
807# CONFIG_PHONE is not set 748# CONFIG_PHONE is not set
808 749
809# 750#
@@ -811,16 +752,14 @@ CONFIG_SLHC=m
811# 752#
812CONFIG_INPUT=y 753CONFIG_INPUT=y
813# CONFIG_INPUT_FF_MEMLESS is not set 754# CONFIG_INPUT_FF_MEMLESS is not set
755# CONFIG_INPUT_POLLDEV is not set
756# CONFIG_INPUT_SPARSEKMAP is not set
814 757
815# 758#
816# Userland interfaces 759# Userland interfaces
817# 760#
818CONFIG_INPUT_MOUSEDEV=y 761# CONFIG_INPUT_MOUSEDEV is not set
819CONFIG_INPUT_MOUSEDEV_PSAUX=y
820CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
821CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
822# CONFIG_INPUT_JOYDEV is not set 762# CONFIG_INPUT_JOYDEV is not set
823# CONFIG_INPUT_TSDEV is not set
824CONFIG_INPUT_EVDEV=y 763CONFIG_INPUT_EVDEV=y
825# CONFIG_INPUT_EVBUG is not set 764# CONFIG_INPUT_EVBUG is not set
826 765
@@ -830,26 +769,27 @@ CONFIG_INPUT_EVDEV=y
830# CONFIG_INPUT_KEYBOARD is not set 769# CONFIG_INPUT_KEYBOARD is not set
831# CONFIG_INPUT_MOUSE is not set 770# CONFIG_INPUT_MOUSE is not set
832# CONFIG_INPUT_JOYSTICK is not set 771# CONFIG_INPUT_JOYSTICK is not set
772# CONFIG_INPUT_TABLET is not set
833# CONFIG_INPUT_TOUCHSCREEN is not set 773# CONFIG_INPUT_TOUCHSCREEN is not set
834# CONFIG_INPUT_MISC is not set 774# CONFIG_INPUT_MISC is not set
835 775
836# 776#
837# Hardware I/O ports 777# Hardware I/O ports
838# 778#
839CONFIG_SERIO=y 779# CONFIG_SERIO is not set
840# CONFIG_SERIO_I8042 is not set
841CONFIG_SERIO_SERPORT=y
842# CONFIG_SERIO_PCIPS2 is not set
843# CONFIG_SERIO_LIBPS2 is not set
844CONFIG_SERIO_RAW=m
845# CONFIG_GAMEPORT is not set 780# CONFIG_GAMEPORT is not set
846 781
847# 782#
848# Character devices 783# Character devices
849# 784#
850# CONFIG_VT is not set 785CONFIG_VT=y
786CONFIG_CONSOLE_TRANSLATIONS=y
787CONFIG_VT_CONSOLE=y
788CONFIG_HW_CONSOLE=y
789# CONFIG_VT_HW_CONSOLE_BINDING is not set
790CONFIG_DEVKMEM=y
851# CONFIG_SERIAL_NONSTANDARD is not set 791# CONFIG_SERIAL_NONSTANDARD is not set
852# CONFIG_AU1X00_GPIO is not set 792# CONFIG_NOZOMI is not set
853 793
854# 794#
855# Serial drivers 795# Serial drivers
@@ -866,199 +806,420 @@ CONFIG_SERIAL_8250_AU1X00=y
866# 806#
867# Non-8250 serial port support 807# Non-8250 serial port support
868# 808#
809# CONFIG_SERIAL_MAX3100 is not set
869CONFIG_SERIAL_CORE=y 810CONFIG_SERIAL_CORE=y
870CONFIG_SERIAL_CORE_CONSOLE=y 811CONFIG_SERIAL_CORE_CONSOLE=y
871# CONFIG_SERIAL_JSM is not set 812# CONFIG_SERIAL_JSM is not set
872CONFIG_UNIX98_PTYS=y 813CONFIG_UNIX98_PTYS=y
873CONFIG_LEGACY_PTYS=y 814# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
874CONFIG_LEGACY_PTY_COUNT=256 815# CONFIG_LEGACY_PTYS is not set
875
876#
877# IPMI
878#
879# CONFIG_IPMI_HANDLER is not set 816# CONFIG_IPMI_HANDLER is not set
880
881#
882# Watchdog Cards
883#
884# CONFIG_WATCHDOG is not set
885# CONFIG_HW_RANDOM is not set 817# CONFIG_HW_RANDOM is not set
886# CONFIG_RTC is not set
887# CONFIG_GEN_RTC is not set
888# CONFIG_DTLK is not set
889# CONFIG_R3964 is not set 818# CONFIG_R3964 is not set
890# CONFIG_APPLICOM is not set 819# CONFIG_APPLICOM is not set
891# CONFIG_DRM is not set
892 820
893# 821#
894# PCMCIA character devices 822# PCMCIA character devices
895# 823#
896CONFIG_SYNCLINK_CS=m 824# CONFIG_SYNCLINK_CS is not set
897# CONFIG_CARDMAN_4000 is not set 825# CONFIG_CARDMAN_4000 is not set
898# CONFIG_CARDMAN_4040 is not set 826# CONFIG_CARDMAN_4040 is not set
827# CONFIG_IPWIRELESS is not set
899# CONFIG_RAW_DRIVER is not set 828# CONFIG_RAW_DRIVER is not set
829# CONFIG_TCG_TPM is not set
830CONFIG_DEVPORT=y
831CONFIG_I2C=y
832CONFIG_I2C_BOARDINFO=y
833# CONFIG_I2C_COMPAT is not set
834CONFIG_I2C_CHARDEV=y
835# CONFIG_I2C_HELPER_AUTO is not set
900 836
901# 837#
902# TPM devices 838# I2C Algorithms
903# 839#
904# CONFIG_TCG_TPM is not set 840# CONFIG_I2C_ALGOBIT is not set
841# CONFIG_I2C_ALGOPCF is not set
842# CONFIG_I2C_ALGOPCA is not set
905 843
906# 844#
907# I2C support 845# I2C Hardware Bus support
908# 846#
909# CONFIG_I2C is not set
910 847
911# 848#
912# SPI support 849# PC SMBus host controller drivers
913# 850#
914# CONFIG_SPI is not set 851# CONFIG_I2C_ALI1535 is not set
915# CONFIG_SPI_MASTER is not set 852# CONFIG_I2C_ALI1563 is not set
853# CONFIG_I2C_ALI15X3 is not set
854# CONFIG_I2C_AMD756 is not set
855# CONFIG_I2C_AMD8111 is not set
856# CONFIG_I2C_I801 is not set
857# CONFIG_I2C_ISCH is not set
858# CONFIG_I2C_PIIX4 is not set
859# CONFIG_I2C_NFORCE2 is not set
860# CONFIG_I2C_SIS5595 is not set
861# CONFIG_I2C_SIS630 is not set
862# CONFIG_I2C_SIS96X is not set
863# CONFIG_I2C_VIA is not set
864# CONFIG_I2C_VIAPRO is not set
916 865
917# 866#
918# Dallas's 1-wire bus 867# I2C system bus drivers (mostly embedded / system-on-chip)
919# 868#
920# CONFIG_W1 is not set 869CONFIG_I2C_AU1550=y
870# CONFIG_I2C_GPIO is not set
871# CONFIG_I2C_OCORES is not set
872# CONFIG_I2C_SIMTEC is not set
921 873
922# 874#
923# Hardware Monitoring support 875# External I2C/SMBus adapter drivers
924# 876#
925# CONFIG_HWMON is not set 877# CONFIG_I2C_PARPORT_LIGHT is not set
926# CONFIG_HWMON_VID is not set 878# CONFIG_I2C_TAOS_EVM is not set
879# CONFIG_I2C_TINY_USB is not set
927 880
928# 881#
929# Multimedia devices 882# Other I2C/SMBus bus drivers
930# 883#
931# CONFIG_VIDEO_DEV is not set 884# CONFIG_I2C_PCA_PLATFORM is not set
885# CONFIG_I2C_STUB is not set
932 886
933# 887#
934# Digital Video Broadcasting Devices 888# Miscellaneous I2C Chip support
935# 889#
936# CONFIG_DVB is not set 890# CONFIG_SENSORS_TSL2550 is not set
891# CONFIG_I2C_DEBUG_CORE is not set
892# CONFIG_I2C_DEBUG_ALGO is not set
893# CONFIG_I2C_DEBUG_BUS is not set
894# CONFIG_I2C_DEBUG_CHIP is not set
895CONFIG_SPI=y
896# CONFIG_SPI_DEBUG is not set
897CONFIG_SPI_MASTER=y
937 898
938# 899#
939# Graphics support 900# SPI Master Controller Drivers
940# 901#
941# CONFIG_FIRMWARE_EDID is not set 902CONFIG_SPI_AU1550=y
942# CONFIG_FB is not set 903CONFIG_SPI_BITBANG=y
943# CONFIG_BACKLIGHT_LCD_SUPPORT is not set 904# CONFIG_SPI_GPIO is not set
905# CONFIG_SPI_XILINX is not set
906# CONFIG_SPI_DESIGNWARE is not set
944 907
945# 908#
946# Sound 909# SPI Protocol Masters
947# 910#
948# CONFIG_SOUND is not set 911# CONFIG_SPI_SPIDEV is not set
912# CONFIG_SPI_TLE62X0 is not set
949 913
950# 914#
951# HID Devices 915# PPS support
952# 916#
953# CONFIG_HID is not set 917# CONFIG_PPS is not set
918CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
919# CONFIG_GPIOLIB is not set
920# CONFIG_W1 is not set
921# CONFIG_POWER_SUPPLY is not set
922# CONFIG_HWMON is not set
923# CONFIG_THERMAL is not set
924# CONFIG_WATCHDOG is not set
925CONFIG_SSB_POSSIBLE=y
954 926
955# 927#
956# USB support 928# Sonics Silicon Backplane
929#
930# CONFIG_SSB is not set
931
932#
933# Multifunction device drivers
934#
935# CONFIG_MFD_CORE is not set
936# CONFIG_MFD_SM501 is not set
937# CONFIG_HTC_PASIC3 is not set
938# CONFIG_TWL4030_CORE is not set
939# CONFIG_MFD_TMIO is not set
940# CONFIG_PMIC_DA903X is not set
941# CONFIG_PMIC_ADP5520 is not set
942# CONFIG_MFD_WM8400 is not set
943# CONFIG_MFD_WM831X is not set
944# CONFIG_MFD_WM8350_I2C is not set
945# CONFIG_MFD_PCF50633 is not set
946# CONFIG_MFD_MC13783 is not set
947# CONFIG_AB3100_CORE is not set
948# CONFIG_EZX_PCAP is not set
949# CONFIG_MFD_88PM8607 is not set
950# CONFIG_AB4500_CORE is not set
951# CONFIG_REGULATOR is not set
952# CONFIG_MEDIA_SUPPORT is not set
953
954#
955# Graphics support
956#
957# CONFIG_VGA_ARB is not set
958# CONFIG_DRM is not set
959# CONFIG_VGASTATE is not set
960# CONFIG_VIDEO_OUTPUT_CONTROL is not set
961# CONFIG_FB is not set
962# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
963
957# 964#
965# Display device support
966#
967# CONFIG_DISPLAY_SUPPORT is not set
968
969#
970# Console display driver support
971#
972# CONFIG_VGA_CONSOLE is not set
973CONFIG_DUMMY_CONSOLE=y
974CONFIG_SOUND=y
975# CONFIG_SOUND_OSS_CORE is not set
976CONFIG_SND=y
977CONFIG_SND_TIMER=y
978CONFIG_SND_PCM=y
979CONFIG_SND_JACK=y
980# CONFIG_SND_SEQUENCER is not set
981# CONFIG_SND_MIXER_OSS is not set
982# CONFIG_SND_PCM_OSS is not set
983CONFIG_SND_HRTIMER=y
984CONFIG_SND_DYNAMIC_MINORS=y
985# CONFIG_SND_SUPPORT_OLD_API is not set
986# CONFIG_SND_VERBOSE_PROCFS is not set
987# CONFIG_SND_VERBOSE_PRINTK is not set
988# CONFIG_SND_DEBUG is not set
989# CONFIG_SND_RAWMIDI_SEQ is not set
990# CONFIG_SND_OPL3_LIB_SEQ is not set
991# CONFIG_SND_OPL4_LIB_SEQ is not set
992# CONFIG_SND_SBAWE_SEQ is not set
993# CONFIG_SND_EMU10K1_SEQ is not set
994# CONFIG_SND_DRIVERS is not set
995# CONFIG_SND_PCI is not set
996# CONFIG_SND_SPI is not set
997# CONFIG_SND_MIPS is not set
998CONFIG_SND_USB=y
999# CONFIG_SND_USB_AUDIO is not set
1000# CONFIG_SND_USB_CAIAQ is not set
1001# CONFIG_SND_PCMCIA is not set
1002CONFIG_SND_SOC=y
1003CONFIG_SND_SOC_AU1XPSC=y
1004# CONFIG_SND_SOC_DB1200 is not set
1005CONFIG_SND_SOC_I2C_AND_SPI=y
1006# CONFIG_SND_SOC_ALL_CODECS is not set
1007# CONFIG_SOUND_PRIME is not set
1008# CONFIG_HID_SUPPORT is not set
1009CONFIG_USB_SUPPORT=y
958CONFIG_USB_ARCH_HAS_HCD=y 1010CONFIG_USB_ARCH_HAS_HCD=y
959CONFIG_USB_ARCH_HAS_OHCI=y 1011CONFIG_USB_ARCH_HAS_OHCI=y
960CONFIG_USB_ARCH_HAS_EHCI=y 1012CONFIG_USB_ARCH_HAS_EHCI=y
961# CONFIG_USB is not set 1013CONFIG_USB=y
1014# CONFIG_USB_DEBUG is not set
1015# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
962 1016
963# 1017#
964# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' 1018# Miscellaneous USB options
965# 1019#
1020# CONFIG_USB_DEVICEFS is not set
1021# CONFIG_USB_DEVICE_CLASS is not set
1022CONFIG_USB_DYNAMIC_MINORS=y
1023CONFIG_USB_SUSPEND=y
1024# CONFIG_USB_OTG is not set
1025# CONFIG_USB_OTG_WHITELIST is not set
1026# CONFIG_USB_OTG_BLACKLIST_HUB is not set
1027# CONFIG_USB_MON is not set
1028# CONFIG_USB_WUSB is not set
1029# CONFIG_USB_WUSB_CBAF is not set
966 1030
967# 1031#
968# USB Gadget Support 1032# USB Host Controller Drivers
969# 1033#
970# CONFIG_USB_GADGET is not set 1034# CONFIG_USB_C67X00_HCD is not set
1035# CONFIG_USB_XHCI_HCD is not set
1036CONFIG_USB_EHCI_HCD=y
1037CONFIG_USB_EHCI_ROOT_HUB_TT=y
1038CONFIG_USB_EHCI_TT_NEWSCHED=y
1039# CONFIG_USB_OXU210HP_HCD is not set
1040# CONFIG_USB_ISP116X_HCD is not set
1041# CONFIG_USB_ISP1760_HCD is not set
1042# CONFIG_USB_ISP1362_HCD is not set
1043CONFIG_USB_OHCI_HCD=y
1044# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
1045# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
1046CONFIG_USB_OHCI_LITTLE_ENDIAN=y
1047# CONFIG_USB_UHCI_HCD is not set
1048# CONFIG_USB_SL811_HCD is not set
1049# CONFIG_USB_R8A66597_HCD is not set
1050# CONFIG_USB_WHCI_HCD is not set
1051# CONFIG_USB_HWA_HCD is not set
971 1052
972# 1053#
973# MMC/SD Card support 1054# USB Device Class drivers
974# 1055#
975# CONFIG_MMC is not set 1056# CONFIG_USB_ACM is not set
1057# CONFIG_USB_PRINTER is not set
1058# CONFIG_USB_WDM is not set
1059# CONFIG_USB_TMC is not set
976 1060
977# 1061#
978# LED devices 1062# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
979# 1063#
980# CONFIG_NEW_LEDS is not set
981 1064
982# 1065#
983# LED drivers 1066# also be needed; see USB_STORAGE Help for more info
984# 1067#
1068# CONFIG_USB_LIBUSUAL is not set
985 1069
986# 1070#
987# LED Triggers 1071# USB Imaging devices
988# 1072#
1073# CONFIG_USB_MDC800 is not set
989 1074
990# 1075#
991# InfiniBand support 1076# USB port drivers
992# 1077#
993# CONFIG_INFINIBAND is not set 1078# CONFIG_USB_SERIAL is not set
994 1079
995# 1080#
996# EDAC - error detection and reporting (RAS) (EXPERIMENTAL) 1081# USB Miscellaneous drivers
997# 1082#
1083# CONFIG_USB_EMI62 is not set
1084# CONFIG_USB_EMI26 is not set
1085# CONFIG_USB_ADUTUX is not set
1086# CONFIG_USB_SEVSEG is not set
1087# CONFIG_USB_RIO500 is not set
1088# CONFIG_USB_LEGOTOWER is not set
1089# CONFIG_USB_LCD is not set
1090# CONFIG_USB_BERRY_CHARGE is not set
1091# CONFIG_USB_LED is not set
1092# CONFIG_USB_CYPRESS_CY7C63 is not set
1093# CONFIG_USB_CYTHERM is not set
1094# CONFIG_USB_IDMOUSE is not set
1095# CONFIG_USB_FTDI_ELAN is not set
1096# CONFIG_USB_APPLEDISPLAY is not set
1097# CONFIG_USB_SISUSBVGA is not set
1098# CONFIG_USB_LD is not set
1099# CONFIG_USB_TRANCEVIBRATOR is not set
1100# CONFIG_USB_IOWARRIOR is not set
1101# CONFIG_USB_TEST is not set
1102# CONFIG_USB_ISIGHTFW is not set
1103# CONFIG_USB_VST is not set
1104# CONFIG_USB_GADGET is not set
1105
1106#
1107# OTG and related infrastructure
1108#
1109# CONFIG_USB_GPIO_VBUS is not set
1110# CONFIG_NOP_USB_XCEIV is not set
1111# CONFIG_UWB is not set
1112# CONFIG_MMC is not set
1113# CONFIG_MEMSTICK is not set
1114# CONFIG_NEW_LEDS is not set
1115# CONFIG_ACCESSIBILITY is not set
1116# CONFIG_INFINIBAND is not set
1117CONFIG_RTC_LIB=y
1118CONFIG_RTC_CLASS=y
1119CONFIG_RTC_HCTOSYS=y
1120CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
1121# CONFIG_RTC_DEBUG is not set
998 1122
999# 1123#
1000# Real Time Clock 1124# RTC interfaces
1001# 1125#
1002# CONFIG_RTC_CLASS is not set 1126CONFIG_RTC_INTF_SYSFS=y
1127CONFIG_RTC_INTF_PROC=y
1128CONFIG_RTC_INTF_DEV=y
1129# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
1130# CONFIG_RTC_DRV_TEST is not set
1003 1131
1004# 1132#
1005# DMA Engine support 1133# I2C RTC drivers
1006# 1134#
1007# CONFIG_DMA_ENGINE is not set 1135# CONFIG_RTC_DRV_DS1307 is not set
1136# CONFIG_RTC_DRV_DS1374 is not set
1137# CONFIG_RTC_DRV_DS1672 is not set
1138# CONFIG_RTC_DRV_MAX6900 is not set
1139# CONFIG_RTC_DRV_RS5C372 is not set
1140# CONFIG_RTC_DRV_ISL1208 is not set
1141# CONFIG_RTC_DRV_X1205 is not set
1142# CONFIG_RTC_DRV_PCF8563 is not set
1143# CONFIG_RTC_DRV_PCF8583 is not set
1144# CONFIG_RTC_DRV_M41T80 is not set
1145# CONFIG_RTC_DRV_BQ32K is not set
1146# CONFIG_RTC_DRV_S35390A is not set
1147# CONFIG_RTC_DRV_FM3130 is not set
1148# CONFIG_RTC_DRV_RX8581 is not set
1149# CONFIG_RTC_DRV_RX8025 is not set
1008 1150
1009# 1151#
1010# DMA Clients 1152# SPI RTC drivers
1011# 1153#
1154# CONFIG_RTC_DRV_M41T94 is not set
1155# CONFIG_RTC_DRV_DS1305 is not set
1156# CONFIG_RTC_DRV_DS1390 is not set
1157# CONFIG_RTC_DRV_MAX6902 is not set
1158# CONFIG_RTC_DRV_R9701 is not set
1159# CONFIG_RTC_DRV_RS5C348 is not set
1160# CONFIG_RTC_DRV_DS3234 is not set
1161# CONFIG_RTC_DRV_PCF2123 is not set
1012 1162
1013# 1163#
1014# DMA Devices 1164# Platform RTC drivers
1015# 1165#
1166# CONFIG_RTC_DRV_CMOS is not set
1167# CONFIG_RTC_DRV_DS1286 is not set
1168# CONFIG_RTC_DRV_DS1511 is not set
1169# CONFIG_RTC_DRV_DS1553 is not set
1170# CONFIG_RTC_DRV_DS1742 is not set
1171# CONFIG_RTC_DRV_STK17TA8 is not set
1172# CONFIG_RTC_DRV_M48T86 is not set
1173# CONFIG_RTC_DRV_M48T35 is not set
1174# CONFIG_RTC_DRV_M48T59 is not set
1175# CONFIG_RTC_DRV_MSM6242 is not set
1176# CONFIG_RTC_DRV_BQ4802 is not set
1177# CONFIG_RTC_DRV_RP5C01 is not set
1178# CONFIG_RTC_DRV_V3020 is not set
1016 1179
1017# 1180#
1018# Auxiliary Display support 1181# on-CPU RTC drivers
1019# 1182#
1183CONFIG_RTC_DRV_AU1XXX=y
1184# CONFIG_DMADEVICES is not set
1185# CONFIG_AUXDISPLAY is not set
1186# CONFIG_UIO is not set
1020 1187
1021# 1188#
1022# Virtualization 1189# TI VLYNQ
1023# 1190#
1191# CONFIG_STAGING is not set
1024 1192
1025# 1193#
1026# File systems 1194# File systems
1027# 1195#
1028CONFIG_EXT2_FS=y 1196CONFIG_EXT2_FS=y
1029CONFIG_EXT2_FS_XATTR=y 1197# CONFIG_EXT2_FS_XATTR is not set
1030CONFIG_EXT2_FS_POSIX_ACL=y
1031# CONFIG_EXT2_FS_SECURITY is not set
1032# CONFIG_EXT2_FS_XIP is not set 1198# CONFIG_EXT2_FS_XIP is not set
1033CONFIG_EXT3_FS=y 1199# CONFIG_EXT3_FS is not set
1034CONFIG_EXT3_FS_XATTR=y 1200# CONFIG_EXT4_FS is not set
1035CONFIG_EXT3_FS_POSIX_ACL=y 1201# CONFIG_REISERFS_FS is not set
1036CONFIG_EXT3_FS_SECURITY=y
1037# CONFIG_EXT4DEV_FS is not set
1038CONFIG_JBD=y
1039# CONFIG_JBD_DEBUG is not set
1040CONFIG_FS_MBCACHE=y
1041CONFIG_REISERFS_FS=m
1042# CONFIG_REISERFS_CHECK is not set
1043# CONFIG_REISERFS_PROC_INFO is not set
1044CONFIG_REISERFS_FS_XATTR=y
1045CONFIG_REISERFS_FS_POSIX_ACL=y
1046CONFIG_REISERFS_FS_SECURITY=y
1047# CONFIG_JFS_FS is not set 1202# CONFIG_JFS_FS is not set
1048CONFIG_FS_POSIX_ACL=y 1203# CONFIG_FS_POSIX_ACL is not set
1049# CONFIG_XFS_FS is not set 1204# CONFIG_XFS_FS is not set
1050# CONFIG_GFS2_FS is not set 1205# CONFIG_GFS2_FS is not set
1051# CONFIG_OCFS2_FS is not set 1206# CONFIG_OCFS2_FS is not set
1052# CONFIG_MINIX_FS is not set 1207# CONFIG_BTRFS_FS is not set
1053# CONFIG_ROMFS_FS is not set 1208# CONFIG_NILFS2_FS is not set
1209CONFIG_FILE_LOCKING=y
1210CONFIG_FSNOTIFY=y
1211CONFIG_DNOTIFY=y
1054CONFIG_INOTIFY=y 1212CONFIG_INOTIFY=y
1055CONFIG_INOTIFY_USER=y 1213CONFIG_INOTIFY_USER=y
1056# CONFIG_QUOTA is not set 1214# CONFIG_QUOTA is not set
1057CONFIG_DNOTIFY=y 1215# CONFIG_AUTOFS_FS is not set
1058CONFIG_AUTOFS_FS=m 1216# CONFIG_AUTOFS4_FS is not set
1059CONFIG_AUTOFS4_FS=m 1217# CONFIG_FUSE_FS is not set
1060CONFIG_FUSE_FS=m 1218
1061CONFIG_GENERIC_ACL=y 1219#
1220# Caches
1221#
1222# CONFIG_FSCACHE is not set
1062 1223
1063# 1224#
1064# CD-ROM/DVD Filesystems 1225# CD-ROM/DVD Filesystems
@@ -1077,75 +1238,82 @@ CONFIG_GENERIC_ACL=y
1077# Pseudo filesystems 1238# Pseudo filesystems
1078# 1239#
1079CONFIG_PROC_FS=y 1240CONFIG_PROC_FS=y
1080CONFIG_PROC_KCORE=y 1241# CONFIG_PROC_KCORE is not set
1081CONFIG_PROC_SYSCTL=y 1242CONFIG_PROC_SYSCTL=y
1243# CONFIG_PROC_PAGE_MONITOR is not set
1082CONFIG_SYSFS=y 1244CONFIG_SYSFS=y
1083CONFIG_TMPFS=y 1245CONFIG_TMPFS=y
1084CONFIG_TMPFS_POSIX_ACL=y 1246# CONFIG_TMPFS_POSIX_ACL is not set
1085# CONFIG_HUGETLB_PAGE is not set 1247# CONFIG_HUGETLB_PAGE is not set
1086CONFIG_RAMFS=y 1248CONFIG_CONFIGFS_FS=y
1087CONFIG_CONFIGFS_FS=m 1249CONFIG_MISC_FILESYSTEMS=y
1088
1089#
1090# Miscellaneous filesystems
1091#
1092# CONFIG_ADFS_FS is not set 1250# CONFIG_ADFS_FS is not set
1093# CONFIG_AFFS_FS is not set 1251# CONFIG_AFFS_FS is not set
1094# CONFIG_ECRYPT_FS is not set
1095# CONFIG_HFS_FS is not set 1252# CONFIG_HFS_FS is not set
1096# CONFIG_HFSPLUS_FS is not set 1253# CONFIG_HFSPLUS_FS is not set
1097# CONFIG_BEFS_FS is not set 1254# CONFIG_BEFS_FS is not set
1098# CONFIG_BFS_FS is not set 1255# CONFIG_BFS_FS is not set
1099# CONFIG_EFS_FS is not set 1256# CONFIG_EFS_FS is not set
1100# CONFIG_JFFS2_FS is not set 1257CONFIG_JFFS2_FS=y
1101CONFIG_CRAMFS=m 1258CONFIG_JFFS2_FS_DEBUG=0
1259CONFIG_JFFS2_FS_WRITEBUFFER=y
1260# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
1261CONFIG_JFFS2_SUMMARY=y
1262CONFIG_JFFS2_FS_XATTR=y
1263# CONFIG_JFFS2_FS_POSIX_ACL is not set
1264# CONFIG_JFFS2_FS_SECURITY is not set
1265CONFIG_JFFS2_COMPRESSION_OPTIONS=y
1266CONFIG_JFFS2_ZLIB=y
1267CONFIG_JFFS2_LZO=y
1268CONFIG_JFFS2_RTIME=y
1269CONFIG_JFFS2_RUBIN=y
1270# CONFIG_JFFS2_CMODE_NONE is not set
1271CONFIG_JFFS2_CMODE_PRIORITY=y
1272# CONFIG_JFFS2_CMODE_SIZE is not set
1273# CONFIG_JFFS2_CMODE_FAVOURLZO is not set
1274# CONFIG_CRAMFS is not set
1275CONFIG_SQUASHFS=y
1276# CONFIG_SQUASHFS_EMBEDDED is not set
1277CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
1102# CONFIG_VXFS_FS is not set 1278# CONFIG_VXFS_FS is not set
1279# CONFIG_MINIX_FS is not set
1280# CONFIG_OMFS_FS is not set
1103# CONFIG_HPFS_FS is not set 1281# CONFIG_HPFS_FS is not set
1104# CONFIG_QNX4FS_FS is not set 1282# CONFIG_QNX4FS_FS is not set
1283# CONFIG_ROMFS_FS is not set
1105# CONFIG_SYSV_FS is not set 1284# CONFIG_SYSV_FS is not set
1106# CONFIG_UFS_FS is not set 1285# CONFIG_UFS_FS is not set
1107 1286CONFIG_NETWORK_FILESYSTEMS=y
1108#
1109# Network File Systems
1110#
1111CONFIG_NFS_FS=y 1287CONFIG_NFS_FS=y
1112# CONFIG_NFS_V3 is not set 1288CONFIG_NFS_V3=y
1289# CONFIG_NFS_V3_ACL is not set
1113# CONFIG_NFS_V4 is not set 1290# CONFIG_NFS_V4 is not set
1114# CONFIG_NFS_DIRECTIO is not set
1115CONFIG_NFSD=m
1116# CONFIG_NFSD_V3 is not set
1117# CONFIG_NFSD_TCP is not set
1118CONFIG_ROOT_NFS=y 1291CONFIG_ROOT_NFS=y
1292# CONFIG_NFSD is not set
1119CONFIG_LOCKD=y 1293CONFIG_LOCKD=y
1120CONFIG_EXPORTFS=m 1294CONFIG_LOCKD_V4=y
1121CONFIG_NFS_COMMON=y 1295CONFIG_NFS_COMMON=y
1122CONFIG_SUNRPC=y 1296CONFIG_SUNRPC=y
1123# CONFIG_RPCSEC_GSS_KRB5 is not set 1297# CONFIG_RPCSEC_GSS_KRB5 is not set
1124# CONFIG_RPCSEC_GSS_SPKM3 is not set 1298# CONFIG_RPCSEC_GSS_SPKM3 is not set
1125CONFIG_SMB_FS=m 1299# CONFIG_SMB_FS is not set
1126# CONFIG_SMB_NLS_DEFAULT is not set
1127# CONFIG_CIFS is not set 1300# CONFIG_CIFS is not set
1128# CONFIG_NCP_FS is not set 1301# CONFIG_NCP_FS is not set
1129# CONFIG_CODA_FS is not set 1302# CONFIG_CODA_FS is not set
1130# CONFIG_AFS_FS is not set 1303# CONFIG_AFS_FS is not set
1131# CONFIG_9P_FS is not set
1132 1304
1133# 1305#
1134# Partition Types 1306# Partition Types
1135# 1307#
1136# CONFIG_PARTITION_ADVANCED is not set 1308# CONFIG_PARTITION_ADVANCED is not set
1137CONFIG_MSDOS_PARTITION=y 1309CONFIG_MSDOS_PARTITION=y
1138 1310CONFIG_NLS=y
1139#
1140# Native Language Support
1141#
1142CONFIG_NLS=m
1143CONFIG_NLS_DEFAULT="iso8859-1" 1311CONFIG_NLS_DEFAULT="iso8859-1"
1144# CONFIG_NLS_CODEPAGE_437 is not set 1312CONFIG_NLS_CODEPAGE_437=y
1145# CONFIG_NLS_CODEPAGE_737 is not set 1313# CONFIG_NLS_CODEPAGE_737 is not set
1146# CONFIG_NLS_CODEPAGE_775 is not set 1314# CONFIG_NLS_CODEPAGE_775 is not set
1147# CONFIG_NLS_CODEPAGE_850 is not set 1315CONFIG_NLS_CODEPAGE_850=y
1148# CONFIG_NLS_CODEPAGE_852 is not set 1316CONFIG_NLS_CODEPAGE_852=y
1149# CONFIG_NLS_CODEPAGE_855 is not set 1317# CONFIG_NLS_CODEPAGE_855 is not set
1150# CONFIG_NLS_CODEPAGE_857 is not set 1318# CONFIG_NLS_CODEPAGE_857 is not set
1151# CONFIG_NLS_CODEPAGE_860 is not set 1319# CONFIG_NLS_CODEPAGE_860 is not set
@@ -1162,10 +1330,10 @@ CONFIG_NLS_DEFAULT="iso8859-1"
1162# CONFIG_NLS_CODEPAGE_949 is not set 1330# CONFIG_NLS_CODEPAGE_949 is not set
1163# CONFIG_NLS_CODEPAGE_874 is not set 1331# CONFIG_NLS_CODEPAGE_874 is not set
1164# CONFIG_NLS_ISO8859_8 is not set 1332# CONFIG_NLS_ISO8859_8 is not set
1165# CONFIG_NLS_CODEPAGE_1250 is not set 1333CONFIG_NLS_CODEPAGE_1250=y
1166# CONFIG_NLS_CODEPAGE_1251 is not set 1334# CONFIG_NLS_CODEPAGE_1251 is not set
1167# CONFIG_NLS_ASCII is not set 1335CONFIG_NLS_ASCII=y
1168# CONFIG_NLS_ISO8859_1 is not set 1336CONFIG_NLS_ISO8859_1=y
1169# CONFIG_NLS_ISO8859_2 is not set 1337# CONFIG_NLS_ISO8859_2 is not set
1170# CONFIG_NLS_ISO8859_3 is not set 1338# CONFIG_NLS_ISO8859_3 is not set
1171# CONFIG_NLS_ISO8859_4 is not set 1339# CONFIG_NLS_ISO8859_4 is not set
@@ -1175,38 +1343,75 @@ CONFIG_NLS_DEFAULT="iso8859-1"
1175# CONFIG_NLS_ISO8859_9 is not set 1343# CONFIG_NLS_ISO8859_9 is not set
1176# CONFIG_NLS_ISO8859_13 is not set 1344# CONFIG_NLS_ISO8859_13 is not set
1177# CONFIG_NLS_ISO8859_14 is not set 1345# CONFIG_NLS_ISO8859_14 is not set
1178# CONFIG_NLS_ISO8859_15 is not set 1346CONFIG_NLS_ISO8859_15=y
1179# CONFIG_NLS_KOI8_R is not set 1347# CONFIG_NLS_KOI8_R is not set
1180# CONFIG_NLS_KOI8_U is not set 1348# CONFIG_NLS_KOI8_U is not set
1181# CONFIG_NLS_UTF8 is not set 1349CONFIG_NLS_UTF8=y
1182 1350# CONFIG_DLM is not set
1183#
1184# Distributed Lock Manager
1185#
1186CONFIG_DLM=m
1187CONFIG_DLM_TCP=y
1188# CONFIG_DLM_SCTP is not set
1189# CONFIG_DLM_DEBUG is not set
1190
1191#
1192# Profiling support
1193#
1194# CONFIG_PROFILING is not set
1195 1351
1196# 1352#
1197# Kernel hacking 1353# Kernel hacking
1198# 1354#
1199CONFIG_TRACE_IRQFLAGS_SUPPORT=y 1355CONFIG_TRACE_IRQFLAGS_SUPPORT=y
1200# CONFIG_PRINTK_TIME is not set 1356# CONFIG_PRINTK_TIME is not set
1357CONFIG_ENABLE_WARN_DEPRECATED=y
1201CONFIG_ENABLE_MUST_CHECK=y 1358CONFIG_ENABLE_MUST_CHECK=y
1359CONFIG_FRAME_WARN=1024
1202# CONFIG_MAGIC_SYSRQ is not set 1360# CONFIG_MAGIC_SYSRQ is not set
1361# CONFIG_STRIP_ASM_SYMS is not set
1203# CONFIG_UNUSED_SYMBOLS is not set 1362# CONFIG_UNUSED_SYMBOLS is not set
1204# CONFIG_DEBUG_FS is not set 1363# CONFIG_DEBUG_FS is not set
1205# CONFIG_HEADERS_CHECK is not set 1364# CONFIG_HEADERS_CHECK is not set
1206# CONFIG_DEBUG_KERNEL is not set 1365CONFIG_DEBUG_KERNEL=y
1207CONFIG_LOG_BUF_SHIFT=14 1366# CONFIG_DEBUG_SHIRQ is not set
1208CONFIG_CROSSCOMPILE=y 1367# CONFIG_DETECT_SOFTLOCKUP is not set
1368# CONFIG_DETECT_HUNG_TASK is not set
1369# CONFIG_SCHED_DEBUG is not set
1370# CONFIG_SCHEDSTATS is not set
1371# CONFIG_TIMER_STATS is not set
1372# CONFIG_DEBUG_OBJECTS is not set
1373# CONFIG_DEBUG_SLAB is not set
1374# CONFIG_DEBUG_RT_MUTEXES is not set
1375# CONFIG_RT_MUTEX_TESTER is not set
1376# CONFIG_DEBUG_SPINLOCK is not set
1377# CONFIG_DEBUG_MUTEXES is not set
1378# CONFIG_DEBUG_LOCK_ALLOC is not set
1379# CONFIG_PROVE_LOCKING is not set
1380# CONFIG_LOCK_STAT is not set
1381# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1382# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1383# CONFIG_DEBUG_KOBJECT is not set
1384# CONFIG_DEBUG_INFO is not set
1385# CONFIG_DEBUG_VM is not set
1386# CONFIG_DEBUG_WRITECOUNT is not set
1387# CONFIG_DEBUG_MEMORY_INIT is not set
1388# CONFIG_DEBUG_LIST is not set
1389# CONFIG_DEBUG_SG is not set
1390# CONFIG_DEBUG_NOTIFIERS is not set
1391# CONFIG_DEBUG_CREDENTIALS is not set
1392# CONFIG_BOOT_PRINTK_DELAY is not set
1393# CONFIG_RCU_TORTURE_TEST is not set
1394# CONFIG_BACKTRACE_SELF_TEST is not set
1395# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1396# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
1397# CONFIG_FAULT_INJECTION is not set
1398# CONFIG_SYSCTL_SYSCALL_CHECK is not set
1399# CONFIG_PAGE_POISONING is not set
1400CONFIG_HAVE_FUNCTION_TRACER=y
1401CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1402CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y
1403CONFIG_HAVE_DYNAMIC_FTRACE=y
1404CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1405CONFIG_TRACING_SUPPORT=y
1406# CONFIG_FTRACE is not set
1407# CONFIG_SAMPLES is not set
1408CONFIG_HAVE_ARCH_KGDB=y
1409# CONFIG_KGDB is not set
1410CONFIG_EARLY_PRINTK=y
1209# CONFIG_CMDLINE_BOOL is not set 1411# CONFIG_CMDLINE_BOOL is not set
1412# CONFIG_DEBUG_STACK_USAGE is not set
1413# CONFIG_RUNTIME_DEBUG is not set
1414CONFIG_DEBUG_ZBOOT=y
1210 1415
1211# 1416#
1212# Security options 1417# Security options
@@ -1214,67 +1419,32 @@ CONFIG_CROSSCOMPILE=y
1214CONFIG_KEYS=y 1419CONFIG_KEYS=y
1215CONFIG_KEYS_DEBUG_PROC_KEYS=y 1420CONFIG_KEYS_DEBUG_PROC_KEYS=y
1216# CONFIG_SECURITY is not set 1421# CONFIG_SECURITY is not set
1217 1422CONFIG_SECURITYFS=y
1218# 1423# CONFIG_DEFAULT_SECURITY_SELINUX is not set
1219# Cryptographic options 1424# CONFIG_DEFAULT_SECURITY_SMACK is not set
1220# 1425# CONFIG_DEFAULT_SECURITY_TOMOYO is not set
1221CONFIG_CRYPTO=y 1426CONFIG_DEFAULT_SECURITY_DAC=y
1222CONFIG_CRYPTO_ALGAPI=y 1427CONFIG_DEFAULT_SECURITY=""
1223CONFIG_CRYPTO_BLKCIPHER=m 1428# CONFIG_CRYPTO is not set
1224CONFIG_CRYPTO_HASH=y 1429# CONFIG_BINARY_PRINTF is not set
1225CONFIG_CRYPTO_MANAGER=y
1226CONFIG_CRYPTO_HMAC=y
1227CONFIG_CRYPTO_XCBC=m
1228CONFIG_CRYPTO_NULL=m
1229CONFIG_CRYPTO_MD4=m
1230CONFIG_CRYPTO_MD5=y
1231CONFIG_CRYPTO_SHA1=m
1232CONFIG_CRYPTO_SHA256=m
1233CONFIG_CRYPTO_SHA512=m
1234CONFIG_CRYPTO_WP512=m
1235CONFIG_CRYPTO_TGR192=m
1236CONFIG_CRYPTO_GF128MUL=m
1237CONFIG_CRYPTO_ECB=m
1238CONFIG_CRYPTO_CBC=m
1239CONFIG_CRYPTO_PCBC=m
1240CONFIG_CRYPTO_LRW=m
1241CONFIG_CRYPTO_DES=m
1242CONFIG_CRYPTO_FCRYPT=m
1243CONFIG_CRYPTO_BLOWFISH=m
1244CONFIG_CRYPTO_TWOFISH=m
1245CONFIG_CRYPTO_TWOFISH_COMMON=m
1246CONFIG_CRYPTO_SERPENT=m
1247CONFIG_CRYPTO_AES=m
1248CONFIG_CRYPTO_CAST5=m
1249CONFIG_CRYPTO_CAST6=m
1250CONFIG_CRYPTO_TEA=m
1251CONFIG_CRYPTO_ARC4=m
1252CONFIG_CRYPTO_KHAZAD=m
1253CONFIG_CRYPTO_ANUBIS=m
1254CONFIG_CRYPTO_DEFLATE=m
1255CONFIG_CRYPTO_MICHAEL_MIC=m
1256CONFIG_CRYPTO_CRC32C=m
1257CONFIG_CRYPTO_CAMELLIA=m
1258# CONFIG_CRYPTO_TEST is not set
1259
1260#
1261# Hardware crypto devices
1262#
1263 1430
1264# 1431#
1265# Library routines 1432# Library routines
1266# 1433#
1267CONFIG_BITREVERSE=y 1434CONFIG_BITREVERSE=y
1268CONFIG_CRC_CCITT=m 1435CONFIG_GENERIC_FIND_LAST_BIT=y
1269CONFIG_CRC16=m 1436# CONFIG_CRC_CCITT is not set
1437# CONFIG_CRC16 is not set
1438# CONFIG_CRC_T10DIF is not set
1439# CONFIG_CRC_ITU_T is not set
1270CONFIG_CRC32=y 1440CONFIG_CRC32=y
1271CONFIG_LIBCRC32C=m 1441# CONFIG_CRC7 is not set
1272CONFIG_ZLIB_INFLATE=m 1442# CONFIG_LIBCRC32C is not set
1273CONFIG_ZLIB_DEFLATE=m 1443CONFIG_ZLIB_INFLATE=y
1274CONFIG_TEXTSEARCH=y 1444CONFIG_ZLIB_DEFLATE=y
1275CONFIG_TEXTSEARCH_KMP=m 1445CONFIG_LZO_COMPRESS=y
1276CONFIG_TEXTSEARCH_BM=m 1446CONFIG_LZO_DECOMPRESS=y
1277CONFIG_TEXTSEARCH_FSM=m
1278CONFIG_PLIST=y
1279CONFIG_HAS_IOMEM=y 1447CONFIG_HAS_IOMEM=y
1280CONFIG_HAS_IOPORT=y 1448CONFIG_HAS_IOPORT=y
1449CONFIG_HAS_DMA=y
1450CONFIG_NLATTR=y
diff --git a/arch/mips/configs/lemote2f_defconfig b/arch/mips/configs/lemote2f_defconfig
index b71a0a4fb95f..4caa0e0fee81 100644
--- a/arch/mips/configs/lemote2f_defconfig
+++ b/arch/mips/configs/lemote2f_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.32-rc6 3# Linux kernel version: 2.6.33-rc2
4# Mon Nov 9 23:42:42 2009 4# Mon Jan 4 13:41:09 2010
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -27,6 +27,7 @@ CONFIG_MACH_LOONGSON=y
27# CONFIG_PNX8550_STB810 is not set 27# CONFIG_PNX8550_STB810 is not set
28# CONFIG_PMC_MSP is not set 28# CONFIG_PMC_MSP is not set
29# CONFIG_PMC_YOSEMITE is not set 29# CONFIG_PMC_YOSEMITE is not set
30# CONFIG_POWERTV is not set
30# CONFIG_SGI_IP22 is not set 31# CONFIG_SGI_IP22 is not set
31# CONFIG_SGI_IP27 is not set 32# CONFIG_SGI_IP27 is not set
32# CONFIG_SGI_IP28 is not set 33# CONFIG_SGI_IP28 is not set
@@ -51,6 +52,9 @@ CONFIG_ARCH_SPARSEMEM_ENABLE=y
51# CONFIG_LEMOTE_FULOONG2E is not set 52# CONFIG_LEMOTE_FULOONG2E is not set
52CONFIG_LEMOTE_MACH2F=y 53CONFIG_LEMOTE_MACH2F=y
53CONFIG_CS5536=y 54CONFIG_CS5536=y
55CONFIG_CS5536_MFGPT=y
56CONFIG_LOONGSON_SUSPEND=y
57CONFIG_LOONGSON_UART_BASE=y
54CONFIG_RWSEM_GENERIC_SPINLOCK=y 58CONFIG_RWSEM_GENERIC_SPINLOCK=y
55# CONFIG_ARCH_HAS_ILOG2_U32 is not set 59# CONFIG_ARCH_HAS_ILOG2_U32 is not set
56# CONFIG_ARCH_HAS_ILOG2_U64 is not set 60# CONFIG_ARCH_HAS_ILOG2_U64 is not set
@@ -63,13 +67,8 @@ CONFIG_GENERIC_TIME=y
63CONFIG_GENERIC_CMOS_UPDATE=y 67CONFIG_GENERIC_CMOS_UPDATE=y
64CONFIG_SCHED_OMIT_FRAME_POINTER=y 68CONFIG_SCHED_OMIT_FRAME_POINTER=y
65CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 69CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
66CONFIG_CEVT_R4K_LIB=y
67CONFIG_CEVT_R4K=y
68CONFIG_CSRC_R4K_LIB=y
69CONFIG_CSRC_R4K=y
70CONFIG_DMA_NONCOHERENT=y 70CONFIG_DMA_NONCOHERENT=y
71CONFIG_DMA_NEED_PCI_MAP_STATE=y 71CONFIG_DMA_NEED_PCI_MAP_STATE=y
72CONFIG_EARLY_PRINTK=y
73CONFIG_SYS_HAS_EARLY_PRINTK=y 72CONFIG_SYS_HAS_EARLY_PRINTK=y
74CONFIG_I8259=y 73CONFIG_I8259=y
75# CONFIG_NO_IOPORT is not set 74# CONFIG_NO_IOPORT is not set
@@ -109,13 +108,15 @@ CONFIG_CPU_LOONGSON2F=y
109# CONFIG_CPU_SB1 is not set 108# CONFIG_CPU_SB1 is not set
110# CONFIG_CPU_CAVIUM_OCTEON is not set 109# CONFIG_CPU_CAVIUM_OCTEON is not set
111CONFIG_SYS_SUPPORTS_ZBOOT=y 110CONFIG_SYS_SUPPORTS_ZBOOT=y
112CONFIG_SYS_SUPPORTS_ZBOOT_UART16550=y
113CONFIG_CPU_LOONGSON2=y 111CONFIG_CPU_LOONGSON2=y
114CONFIG_SYS_HAS_CPU_LOONGSON2F=y 112CONFIG_SYS_HAS_CPU_LOONGSON2F=y
115CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y 113CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
116CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y 114CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
117CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y 115CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
118CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y 116CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
117CONFIG_CPU_SUPPORTS_CPUFREQ=y
118CONFIG_CPU_SUPPORTS_ADDRWINCFG=y
119CONFIG_CPU_SUPPORTS_UNCACHED_ACCELERATED=y
119 120
120# 121#
121# Kernel type 122# Kernel type
@@ -137,7 +138,6 @@ CONFIG_GENERIC_HARDIRQS=y
137CONFIG_GENERIC_IRQ_PROBE=y 138CONFIG_GENERIC_IRQ_PROBE=y
138CONFIG_CPU_SUPPORTS_HIGHMEM=y 139CONFIG_CPU_SUPPORTS_HIGHMEM=y
139CONFIG_SYS_SUPPORTS_HIGHMEM=y 140CONFIG_SYS_SUPPORTS_HIGHMEM=y
140CONFIG_ARCH_FLATMEM_ENABLE=y
141CONFIG_ARCH_POPULATES_NODE_MAP=y 141CONFIG_ARCH_POPULATES_NODE_MAP=y
142CONFIG_SELECT_MEMORY_MODEL=y 142CONFIG_SELECT_MEMORY_MODEL=y
143# CONFIG_FLATMEM_MANUAL is not set 143# CONFIG_FLATMEM_MANUAL is not set
@@ -146,17 +146,11 @@ CONFIG_SPARSEMEM_MANUAL=y
146CONFIG_SPARSEMEM=y 146CONFIG_SPARSEMEM=y
147CONFIG_HAVE_MEMORY_PRESENT=y 147CONFIG_HAVE_MEMORY_PRESENT=y
148CONFIG_SPARSEMEM_STATIC=y 148CONFIG_SPARSEMEM_STATIC=y
149
150#
151# Memory hotplug is currently incompatible with Software Suspend
152#
153CONFIG_PAGEFLAGS_EXTENDED=y 149CONFIG_PAGEFLAGS_EXTENDED=y
154CONFIG_SPLIT_PTLOCK_CPUS=4 150CONFIG_SPLIT_PTLOCK_CPUS=4
155CONFIG_PHYS_ADDR_T_64BIT=y 151CONFIG_PHYS_ADDR_T_64BIT=y
156CONFIG_ZONE_DMA_FLAG=0 152CONFIG_ZONE_DMA_FLAG=0
157CONFIG_VIRT_TO_BUS=y 153CONFIG_VIRT_TO_BUS=y
158CONFIG_HAVE_MLOCK=y
159CONFIG_HAVE_MLOCKED_PAGE_BIT=y
160# CONFIG_KSM is not set 154# CONFIG_KSM is not set
161CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 155CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
162CONFIG_TICK_ONESHOT=y 156CONFIG_TICK_ONESHOT=y
@@ -175,7 +169,7 @@ CONFIG_HZ=250
175# CONFIG_PREEMPT_NONE is not set 169# CONFIG_PREEMPT_NONE is not set
176# CONFIG_PREEMPT_VOLUNTARY is not set 170# CONFIG_PREEMPT_VOLUNTARY is not set
177CONFIG_PREEMPT=y 171CONFIG_PREEMPT=y
178# CONFIG_KEXEC is not set 172CONFIG_KEXEC=y
179# CONFIG_SECCOMP is not set 173# CONFIG_SECCOMP is not set
180CONFIG_LOCKDEP_SUPPORT=y 174CONFIG_LOCKDEP_SUPPORT=y
181CONFIG_STACKTRACE_SUPPORT=y 175CONFIG_STACKTRACE_SUPPORT=y
@@ -194,9 +188,9 @@ CONFIG_LOCALVERSION=""
194CONFIG_HAVE_KERNEL_GZIP=y 188CONFIG_HAVE_KERNEL_GZIP=y
195CONFIG_HAVE_KERNEL_BZIP2=y 189CONFIG_HAVE_KERNEL_BZIP2=y
196CONFIG_HAVE_KERNEL_LZMA=y 190CONFIG_HAVE_KERNEL_LZMA=y
197# CONFIG_KERNEL_GZIP is not set 191CONFIG_KERNEL_GZIP=y
198# CONFIG_KERNEL_BZIP2 is not set 192# CONFIG_KERNEL_BZIP2 is not set
199CONFIG_KERNEL_LZMA=y 193# CONFIG_KERNEL_LZMA is not set
200CONFIG_SWAP=y 194CONFIG_SWAP=y
201CONFIG_SYSVIPC=y 195CONFIG_SYSVIPC=y
202CONFIG_SYSVIPC_SYSCTL=y 196CONFIG_SYSVIPC_SYSCTL=y
@@ -211,6 +205,7 @@ CONFIG_AUDIT=y
211# 205#
212CONFIG_TREE_RCU=y 206CONFIG_TREE_RCU=y
213# CONFIG_TREE_PREEMPT_RCU is not set 207# CONFIG_TREE_PREEMPT_RCU is not set
208# CONFIG_TINY_RCU is not set
214# CONFIG_RCU_TRACE is not set 209# CONFIG_RCU_TRACE is not set
215CONFIG_RCU_FANOUT=64 210CONFIG_RCU_FANOUT=64
216# CONFIG_RCU_FANOUT_EXACT is not set 211# CONFIG_RCU_FANOUT_EXACT is not set
@@ -224,7 +219,11 @@ CONFIG_SYSFS_DEPRECATED=y
224CONFIG_SYSFS_DEPRECATED_V2=y 219CONFIG_SYSFS_DEPRECATED_V2=y
225# CONFIG_RELAY is not set 220# CONFIG_RELAY is not set
226# CONFIG_NAMESPACES is not set 221# CONFIG_NAMESPACES is not set
227# CONFIG_BLK_DEV_INITRD is not set 222CONFIG_BLK_DEV_INITRD=y
223CONFIG_INITRAMFS_SOURCE=""
224CONFIG_RD_GZIP=y
225CONFIG_RD_BZIP2=y
226CONFIG_RD_LZMA=y
228# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 227# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
229CONFIG_SYSCTL=y 228CONFIG_SYSCTL=y
230CONFIG_ANON_INODES=y 229CONFIG_ANON_INODES=y
@@ -256,14 +255,18 @@ CONFIG_COMPAT_BRK=y
256# CONFIG_SLAB is not set 255# CONFIG_SLAB is not set
257CONFIG_SLUB=y 256CONFIG_SLUB=y
258# CONFIG_SLOB is not set 257# CONFIG_SLOB is not set
259# CONFIG_PROFILING is not set 258CONFIG_PROFILING=y
259CONFIG_TRACEPOINTS=y
260CONFIG_OPROFILE=m
260CONFIG_HAVE_OPROFILE=y 261CONFIG_HAVE_OPROFILE=y
261CONFIG_HAVE_SYSCALL_WRAPPERS=y 262CONFIG_HAVE_SYSCALL_WRAPPERS=y
262 263
263# 264#
264# GCOV-based kernel profiling 265# GCOV-based kernel profiling
265# 266#
266# CONFIG_SLOW_WORK is not set 267# CONFIG_GCOV_KERNEL is not set
268CONFIG_SLOW_WORK=y
269# CONFIG_SLOW_WORK_DEBUG is not set
267CONFIG_HAVE_GENERIC_DMA_COHERENT=y 270CONFIG_HAVE_GENERIC_DMA_COHERENT=y
268CONFIG_SLABINFO=y 271CONFIG_SLABINFO=y
269CONFIG_RT_MUTEXES=y 272CONFIG_RT_MUTEXES=y
@@ -283,14 +286,41 @@ CONFIG_BLOCK_COMPAT=y
283# IO Schedulers 286# IO Schedulers
284# 287#
285CONFIG_IOSCHED_NOOP=y 288CONFIG_IOSCHED_NOOP=y
286CONFIG_IOSCHED_AS=y 289CONFIG_IOSCHED_DEADLINE=m
287CONFIG_IOSCHED_DEADLINE=y
288CONFIG_IOSCHED_CFQ=y 290CONFIG_IOSCHED_CFQ=y
289# CONFIG_DEFAULT_AS is not set
290# CONFIG_DEFAULT_DEADLINE is not set 291# CONFIG_DEFAULT_DEADLINE is not set
291CONFIG_DEFAULT_CFQ=y 292CONFIG_DEFAULT_CFQ=y
292# CONFIG_DEFAULT_NOOP is not set 293# CONFIG_DEFAULT_NOOP is not set
293CONFIG_DEFAULT_IOSCHED="cfq" 294CONFIG_DEFAULT_IOSCHED="cfq"
295# CONFIG_INLINE_SPIN_TRYLOCK is not set
296# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set
297# CONFIG_INLINE_SPIN_LOCK is not set
298# CONFIG_INLINE_SPIN_LOCK_BH is not set
299# CONFIG_INLINE_SPIN_LOCK_IRQ is not set
300# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set
301# CONFIG_INLINE_SPIN_UNLOCK is not set
302# CONFIG_INLINE_SPIN_UNLOCK_BH is not set
303# CONFIG_INLINE_SPIN_UNLOCK_IRQ is not set
304# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set
305# CONFIG_INLINE_READ_TRYLOCK is not set
306# CONFIG_INLINE_READ_LOCK is not set
307# CONFIG_INLINE_READ_LOCK_BH is not set
308# CONFIG_INLINE_READ_LOCK_IRQ is not set
309# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set
310# CONFIG_INLINE_READ_UNLOCK is not set
311# CONFIG_INLINE_READ_UNLOCK_BH is not set
312# CONFIG_INLINE_READ_UNLOCK_IRQ is not set
313# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set
314# CONFIG_INLINE_WRITE_TRYLOCK is not set
315# CONFIG_INLINE_WRITE_LOCK is not set
316# CONFIG_INLINE_WRITE_LOCK_BH is not set
317# CONFIG_INLINE_WRITE_LOCK_IRQ is not set
318# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set
319# CONFIG_INLINE_WRITE_UNLOCK is not set
320# CONFIG_INLINE_WRITE_UNLOCK_BH is not set
321# CONFIG_INLINE_WRITE_UNLOCK_IRQ is not set
322# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set
323# CONFIG_MUTEX_SPIN_ON_OWNER is not set
294CONFIG_FREEZER=y 324CONFIG_FREEZER=y
295 325
296# 326#
@@ -314,7 +344,7 @@ CONFIG_MMU=y
314CONFIG_BINFMT_ELF=y 344CONFIG_BINFMT_ELF=y
315# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set 345# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
316# CONFIG_HAVE_AOUT is not set 346# CONFIG_HAVE_AOUT is not set
317# CONFIG_BINFMT_MISC is not set 347CONFIG_BINFMT_MISC=m
318CONFIG_MIPS32_COMPAT=y 348CONFIG_MIPS32_COMPAT=y
319CONFIG_COMPAT=y 349CONFIG_COMPAT=y
320CONFIG_SYSVIPC_COMPAT=y 350CONFIG_SYSVIPC_COMPAT=y
@@ -335,9 +365,34 @@ CONFIG_SUSPEND_FREEZER=y
335CONFIG_HIBERNATION_NVS=y 365CONFIG_HIBERNATION_NVS=y
336CONFIG_HIBERNATION=y 366CONFIG_HIBERNATION=y
337CONFIG_PM_STD_PARTITION="/dev/hda3" 367CONFIG_PM_STD_PARTITION="/dev/hda3"
338# CONFIG_PM_RUNTIME is not set 368CONFIG_PM_RUNTIME=y
369CONFIG_MIPS_EXTERNAL_TIMER=y
370CONFIG_MIPS_CPUFREQ=y
371
372#
373# CPU Frequency scaling
374#
375CONFIG_CPU_FREQ=y
376CONFIG_CPU_FREQ_TABLE=y
377CONFIG_CPU_FREQ_DEBUG=y
378CONFIG_CPU_FREQ_STAT=m
379CONFIG_CPU_FREQ_STAT_DETAILS=y
380# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
381# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
382# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
383CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
384# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
385CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
386CONFIG_CPU_FREQ_GOV_POWERSAVE=m
387CONFIG_CPU_FREQ_GOV_USERSPACE=m
388CONFIG_CPU_FREQ_GOV_ONDEMAND=y
389CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m
390
391#
392# CPUFreq processor drivers
393#
394CONFIG_LOONGSON2_CPUFREQ=m
339CONFIG_NET=y 395CONFIG_NET=y
340CONFIG_COMPAT_NETLINK_MESSAGES=y
341 396
342# 397#
343# Networking options 398# Networking options
@@ -346,11 +401,12 @@ CONFIG_PACKET=y
346CONFIG_PACKET_MMAP=y 401CONFIG_PACKET_MMAP=y
347CONFIG_UNIX=y 402CONFIG_UNIX=y
348CONFIG_XFRM=y 403CONFIG_XFRM=y
349# CONFIG_XFRM_USER is not set 404CONFIG_XFRM_USER=m
350# CONFIG_XFRM_SUB_POLICY is not set 405# CONFIG_XFRM_SUB_POLICY is not set
351# CONFIG_XFRM_MIGRATE is not set 406# CONFIG_XFRM_MIGRATE is not set
352# CONFIG_XFRM_STATISTICS is not set 407# CONFIG_XFRM_STATISTICS is not set
353# CONFIG_NET_KEY is not set 408CONFIG_NET_KEY=m
409# CONFIG_NET_KEY_MIGRATE is not set
354CONFIG_INET=y 410CONFIG_INET=y
355CONFIG_IP_MULTICAST=y 411CONFIG_IP_MULTICAST=y
356CONFIG_IP_ADVANCED_ROUTER=y 412CONFIG_IP_ADVANCED_ROUTER=y
@@ -361,12 +417,13 @@ CONFIG_IP_MULTIPLE_TABLES=y
361CONFIG_IP_ROUTE_MULTIPATH=y 417CONFIG_IP_ROUTE_MULTIPATH=y
362CONFIG_IP_ROUTE_VERBOSE=y 418CONFIG_IP_ROUTE_VERBOSE=y
363# CONFIG_IP_PNP is not set 419# CONFIG_IP_PNP is not set
364# CONFIG_NET_IPIP is not set 420CONFIG_NET_IPIP=m
365# CONFIG_NET_IPGRE is not set 421CONFIG_NET_IPGRE=m
422# CONFIG_NET_IPGRE_BROADCAST is not set
366CONFIG_IP_MROUTE=y 423CONFIG_IP_MROUTE=y
367CONFIG_IP_PIMSM_V1=y 424CONFIG_IP_PIMSM_V1=y
368CONFIG_IP_PIMSM_V2=y 425CONFIG_IP_PIMSM_V2=y
369# CONFIG_ARPD is not set 426CONFIG_ARPD=y
370CONFIG_SYN_COOKIES=y 427CONFIG_SYN_COOKIES=y
371# CONFIG_INET_AH is not set 428# CONFIG_INET_AH is not set
372# CONFIG_INET_ESP is not set 429# CONFIG_INET_ESP is not set
@@ -399,30 +456,34 @@ CONFIG_DEFAULT_BIC=y
399# CONFIG_DEFAULT_WESTWOOD is not set 456# CONFIG_DEFAULT_WESTWOOD is not set
400# CONFIG_DEFAULT_RENO is not set 457# CONFIG_DEFAULT_RENO is not set
401CONFIG_DEFAULT_TCP_CONG="bic" 458CONFIG_DEFAULT_TCP_CONG="bic"
402# CONFIG_TCP_MD5SIG is not set 459CONFIG_TCP_MD5SIG=y
403CONFIG_IPV6=m 460CONFIG_IPV6=m
404CONFIG_IPV6_PRIVACY=y 461CONFIG_IPV6_PRIVACY=y
405# CONFIG_IPV6_ROUTER_PREF is not set 462CONFIG_IPV6_ROUTER_PREF=y
463# CONFIG_IPV6_ROUTE_INFO is not set
406# CONFIG_IPV6_OPTIMISTIC_DAD is not set 464# CONFIG_IPV6_OPTIMISTIC_DAD is not set
407# CONFIG_INET6_AH is not set 465# CONFIG_INET6_AH is not set
408# CONFIG_INET6_ESP is not set 466# CONFIG_INET6_ESP is not set
409# CONFIG_INET6_IPCOMP is not set 467# CONFIG_INET6_IPCOMP is not set
410# CONFIG_IPV6_MIP6 is not set 468# CONFIG_IPV6_MIP6 is not set
411# CONFIG_INET6_XFRM_TUNNEL is not set 469# CONFIG_INET6_XFRM_TUNNEL is not set
412# CONFIG_INET6_TUNNEL is not set 470CONFIG_INET6_TUNNEL=m
413CONFIG_INET6_XFRM_MODE_TRANSPORT=m 471CONFIG_INET6_XFRM_MODE_TRANSPORT=m
414CONFIG_INET6_XFRM_MODE_TUNNEL=m 472CONFIG_INET6_XFRM_MODE_TUNNEL=m
415CONFIG_INET6_XFRM_MODE_BEET=m 473CONFIG_INET6_XFRM_MODE_BEET=m
416# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set 474# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
417CONFIG_IPV6_SIT=m 475CONFIG_IPV6_SIT=m
476# CONFIG_IPV6_SIT_6RD is not set
418CONFIG_IPV6_NDISC_NODETYPE=y 477CONFIG_IPV6_NDISC_NODETYPE=y
419# CONFIG_IPV6_TUNNEL is not set 478CONFIG_IPV6_TUNNEL=m
420# CONFIG_IPV6_MULTIPLE_TABLES is not set 479CONFIG_IPV6_MULTIPLE_TABLES=y
480CONFIG_IPV6_SUBTREES=y
421# CONFIG_IPV6_MROUTE is not set 481# CONFIG_IPV6_MROUTE is not set
422CONFIG_NETWORK_SECMARK=y 482CONFIG_NETWORK_SECMARK=y
423CONFIG_NETFILTER=y 483CONFIG_NETFILTER=y
424# CONFIG_NETFILTER_DEBUG is not set 484# CONFIG_NETFILTER_DEBUG is not set
425CONFIG_NETFILTER_ADVANCED=y 485CONFIG_NETFILTER_ADVANCED=y
486CONFIG_BRIDGE_NETFILTER=y
426 487
427# 488#
428# Core Netfilter Configuration 489# Core Netfilter Configuration
@@ -446,17 +507,22 @@ CONFIG_NETFILTER_ADVANCED=y
446# 507#
447# CONFIG_IP6_NF_QUEUE is not set 508# CONFIG_IP6_NF_QUEUE is not set
448# CONFIG_IP6_NF_IPTABLES is not set 509# CONFIG_IP6_NF_IPTABLES is not set
510# CONFIG_BRIDGE_NF_EBTABLES is not set
449# CONFIG_IP_DCCP is not set 511# CONFIG_IP_DCCP is not set
450# CONFIG_IP_SCTP is not set 512# CONFIG_IP_SCTP is not set
451# CONFIG_RDS is not set 513# CONFIG_RDS is not set
452# CONFIG_TIPC is not set 514# CONFIG_TIPC is not set
453# CONFIG_ATM is not set 515# CONFIG_ATM is not set
454# CONFIG_BRIDGE is not set 516CONFIG_STP=m
517CONFIG_BRIDGE=m
455# CONFIG_NET_DSA is not set 518# CONFIG_NET_DSA is not set
456# CONFIG_VLAN_8021Q is not set 519CONFIG_VLAN_8021Q=m
520# CONFIG_VLAN_8021Q_GVRP is not set
457# CONFIG_DECNET is not set 521# CONFIG_DECNET is not set
522CONFIG_LLC=m
458# CONFIG_LLC2 is not set 523# CONFIG_LLC2 is not set
459# CONFIG_IPX is not set 524CONFIG_IPX=m
525# CONFIG_IPX_INTERN is not set
460# CONFIG_ATALK is not set 526# CONFIG_ATALK is not set
461# CONFIG_X25 is not set 527# CONFIG_X25 is not set
462# CONFIG_LAPB is not set 528# CONFIG_LAPB is not set
@@ -518,26 +584,61 @@ CONFIG_NET_SCH_FIFO=y
518# Network testing 584# Network testing
519# 585#
520# CONFIG_NET_PKTGEN is not set 586# CONFIG_NET_PKTGEN is not set
587# CONFIG_NET_DROP_MONITOR is not set
521# CONFIG_HAMRADIO is not set 588# CONFIG_HAMRADIO is not set
522# CONFIG_CAN is not set 589# CONFIG_CAN is not set
523# CONFIG_IRDA is not set 590# CONFIG_IRDA is not set
524# CONFIG_BT is not set 591CONFIG_BT=m
592CONFIG_BT_L2CAP=m
593CONFIG_BT_SCO=m
594CONFIG_BT_RFCOMM=m
595CONFIG_BT_RFCOMM_TTY=y
596CONFIG_BT_BNEP=m
597CONFIG_BT_BNEP_MC_FILTER=y
598CONFIG_BT_BNEP_PROTO_FILTER=y
599CONFIG_BT_HIDP=m
600
601#
602# Bluetooth device drivers
603#
604CONFIG_BT_HCIBTUSB=m
605# CONFIG_BT_HCIBTSDIO is not set
606# CONFIG_BT_HCIUART is not set
607# CONFIG_BT_HCIBCM203X is not set
608# CONFIG_BT_HCIBPA10X is not set
609CONFIG_BT_HCIBFUSB=m
610CONFIG_BT_HCIVHCI=m
611# CONFIG_BT_MRVL is not set
525# CONFIG_AF_RXRPC is not set 612# CONFIG_AF_RXRPC is not set
526CONFIG_FIB_RULES=y 613CONFIG_FIB_RULES=y
527CONFIG_WIRELESS=y 614CONFIG_WIRELESS=y
528# CONFIG_CFG80211 is not set 615CONFIG_WEXT_CORE=y
529CONFIG_CFG80211_DEFAULT_PS_VALUE=0 616CONFIG_WEXT_PROC=y
617CONFIG_CFG80211=m
618# CONFIG_NL80211_TESTMODE is not set
619# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set
620# CONFIG_CFG80211_REG_DEBUG is not set
621CONFIG_CFG80211_DEFAULT_PS=y
622# CONFIG_CFG80211_DEBUGFS is not set
530# CONFIG_WIRELESS_OLD_REGULATORY is not set 623# CONFIG_WIRELESS_OLD_REGULATORY is not set
531CONFIG_WIRELESS_EXT=y 624CONFIG_CFG80211_WEXT=y
532CONFIG_WIRELESS_EXT_SYSFS=y 625CONFIG_WIRELESS_EXT_SYSFS=y
533# CONFIG_LIB80211 is not set 626CONFIG_LIB80211=m
534 627CONFIG_LIB80211_DEBUG=y
535# 628CONFIG_MAC80211=m
536# CFG80211 needs to be enabled for MAC80211 629# CONFIG_MAC80211_RC_PID is not set
537# 630CONFIG_MAC80211_RC_MINSTREL=y
631# CONFIG_MAC80211_RC_DEFAULT_PID is not set
632CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y
633CONFIG_MAC80211_RC_DEFAULT="minstrel"
634# CONFIG_MAC80211_MESH is not set
635CONFIG_MAC80211_LEDS=y
636# CONFIG_MAC80211_DEBUGFS is not set
637# CONFIG_MAC80211_DEBUG_MENU is not set
538# CONFIG_WIMAX is not set 638# CONFIG_WIMAX is not set
539CONFIG_RFKILL=m 639CONFIG_RFKILL=m
540# CONFIG_RFKILL_INPUT is not set 640CONFIG_RFKILL_LEDS=y
641CONFIG_RFKILL_INPUT=y
541# CONFIG_NET_9P is not set 642# CONFIG_NET_9P is not set
542 643
543# 644#
@@ -555,7 +656,7 @@ CONFIG_FW_LOADER=y
555CONFIG_FIRMWARE_IN_KERNEL=y 656CONFIG_FIRMWARE_IN_KERNEL=y
556CONFIG_EXTRA_FIRMWARE="" 657CONFIG_EXTRA_FIRMWARE=""
557# CONFIG_SYS_HYPERVISOR is not set 658# CONFIG_SYS_HYPERVISOR is not set
558# CONFIG_CONNECTOR is not set 659CONFIG_CONNECTOR=m
559# CONFIG_MTD is not set 660# CONFIG_MTD is not set
560# CONFIG_PARPORT is not set 661# CONFIG_PARPORT is not set
561# CONFIG_PNP is not set 662# CONFIG_PNP is not set
@@ -566,7 +667,12 @@ CONFIG_BLK_DEV=y
566# CONFIG_BLK_DEV_UMEM is not set 667# CONFIG_BLK_DEV_UMEM is not set
567# CONFIG_BLK_DEV_COW_COMMON is not set 668# CONFIG_BLK_DEV_COW_COMMON is not set
568CONFIG_BLK_DEV_LOOP=y 669CONFIG_BLK_DEV_LOOP=y
569CONFIG_BLK_DEV_CRYPTOLOOP=y 670CONFIG_BLK_DEV_CRYPTOLOOP=m
671
672#
673# DRBD disabled because PROC_FS, INET or CONNECTOR not selected
674#
675# CONFIG_BLK_DEV_DRBD is not set
570# CONFIG_BLK_DEV_NBD is not set 676# CONFIG_BLK_DEV_NBD is not set
571# CONFIG_BLK_DEV_SX8 is not set 677# CONFIG_BLK_DEV_SX8 is not set
572# CONFIG_BLK_DEV_UB is not set 678# CONFIG_BLK_DEV_UB is not set
@@ -577,19 +683,7 @@ CONFIG_BLK_DEV_RAM_SIZE=8192
577# CONFIG_CDROM_PKTCDVD is not set 683# CONFIG_CDROM_PKTCDVD is not set
578# CONFIG_ATA_OVER_ETH is not set 684# CONFIG_ATA_OVER_ETH is not set
579# CONFIG_BLK_DEV_HD is not set 685# CONFIG_BLK_DEV_HD is not set
580CONFIG_MISC_DEVICES=y 686# CONFIG_MISC_DEVICES is not set
581# CONFIG_PHANTOM is not set
582# CONFIG_SGI_IOC4 is not set
583# CONFIG_TIFM_CORE is not set
584# CONFIG_ENCLOSURE_SERVICES is not set
585# CONFIG_HP_ILO is not set
586# CONFIG_C2PORT is not set
587
588#
589# EEPROM support
590#
591# CONFIG_EEPROM_93CX6 is not set
592# CONFIG_CB710_CORE is not set
593CONFIG_HAVE_IDE=y 687CONFIG_HAVE_IDE=y
594CONFIG_IDE=y 688CONFIG_IDE=y
595 689
@@ -619,8 +713,7 @@ CONFIG_BLK_DEV_IDEDMA_SFF=y
619# 713#
620CONFIG_BLK_DEV_IDEPCI=y 714CONFIG_BLK_DEV_IDEPCI=y
621# CONFIG_IDEPCI_PCIBUS_ORDER is not set 715# CONFIG_IDEPCI_PCIBUS_ORDER is not set
622# CONFIG_BLK_DEV_OFFBOARD is not set 716# CONFIG_BLK_DEV_GENERIC is not set
623CONFIG_BLK_DEV_GENERIC=y
624# CONFIG_BLK_DEV_OPTI621 is not set 717# CONFIG_BLK_DEV_OPTI621 is not set
625CONFIG_BLK_DEV_IDEDMA_PCI=y 718CONFIG_BLK_DEV_IDEDMA_PCI=y
626# CONFIG_BLK_DEV_AEC62XX is not set 719# CONFIG_BLK_DEV_AEC62XX is not set
@@ -700,7 +793,29 @@ CONFIG_SCSI_WAIT_SCAN=m
700# CONFIG_SCSI_DH is not set 793# CONFIG_SCSI_DH is not set
701# CONFIG_SCSI_OSD_INITIATOR is not set 794# CONFIG_SCSI_OSD_INITIATOR is not set
702# CONFIG_ATA is not set 795# CONFIG_ATA is not set
703# CONFIG_MD is not set 796CONFIG_MD=y
797CONFIG_BLK_DEV_MD=m
798CONFIG_MD_LINEAR=m
799CONFIG_MD_RAID0=m
800CONFIG_MD_RAID1=m
801CONFIG_MD_RAID10=m
802CONFIG_MD_RAID456=m
803CONFIG_MD_RAID6_PQ=m
804# CONFIG_ASYNC_RAID6_TEST is not set
805CONFIG_MD_MULTIPATH=m
806CONFIG_MD_FAULTY=m
807CONFIG_BLK_DEV_DM=m
808CONFIG_DM_DEBUG=y
809CONFIG_DM_CRYPT=m
810CONFIG_DM_SNAPSHOT=m
811CONFIG_DM_MIRROR=m
812CONFIG_DM_LOG_USERSPACE=m
813CONFIG_DM_ZERO=m
814CONFIG_DM_MULTIPATH=m
815CONFIG_DM_MULTIPATH_QL=m
816CONFIG_DM_MULTIPATH_ST=m
817CONFIG_DM_DELAY=m
818CONFIG_DM_UEVENT=y
704# CONFIG_FUSION is not set 819# CONFIG_FUSION is not set
705 820
706# 821#
@@ -712,19 +827,19 @@ CONFIG_SCSI_WAIT_SCAN=m
712# 827#
713 828
714# 829#
715# See the help texts for more information. 830# The newer stack is recommended.
716# 831#
717# CONFIG_FIREWIRE is not set 832# CONFIG_FIREWIRE is not set
718# CONFIG_IEEE1394 is not set 833# CONFIG_IEEE1394 is not set
719# CONFIG_I2O is not set 834# CONFIG_I2O is not set
720CONFIG_NETDEVICES=y 835CONFIG_NETDEVICES=y
721# CONFIG_IFB is not set 836# CONFIG_IFB is not set
722# CONFIG_DUMMY is not set 837CONFIG_DUMMY=m
723# CONFIG_BONDING is not set 838# CONFIG_BONDING is not set
724# CONFIG_MACVLAN is not set 839# CONFIG_MACVLAN is not set
725# CONFIG_EQUALIZER is not set 840# CONFIG_EQUALIZER is not set
726# CONFIG_TUN is not set 841CONFIG_TUN=m
727# CONFIG_VETH is not set 842CONFIG_VETH=m
728# CONFIG_ARCNET is not set 843# CONFIG_ARCNET is not set
729# CONFIG_PHYLIB is not set 844# CONFIG_PHYLIB is not set
730CONFIG_NET_ETHERNET=y 845CONFIG_NET_ETHERNET=y
@@ -738,6 +853,7 @@ CONFIG_MII=y
738# CONFIG_SMC91X is not set 853# CONFIG_SMC91X is not set
739# CONFIG_DM9000 is not set 854# CONFIG_DM9000 is not set
740# CONFIG_ETHOC is not set 855# CONFIG_ETHOC is not set
856# CONFIG_SMSC911X is not set
741# CONFIG_NET_VENDOR_RACAL is not set 857# CONFIG_NET_VENDOR_RACAL is not set
742# CONFIG_DNET is not set 858# CONFIG_DNET is not set
743# CONFIG_NET_TULIP is not set 859# CONFIG_NET_TULIP is not set
@@ -769,7 +885,7 @@ CONFIG_NET_PCI=y
769# CONFIG_8139CP is not set 885# CONFIG_8139CP is not set
770CONFIG_8139TOO=y 886CONFIG_8139TOO=y
771# CONFIG_8139TOO_PIO is not set 887# CONFIG_8139TOO_PIO is not set
772CONFIG_8139TOO_TUNE_TWISTER=y 888# CONFIG_8139TOO_TUNE_TWISTER is not set
773# CONFIG_8139TOO_8129 is not set 889# CONFIG_8139TOO_8129 is not set
774# CONFIG_8139_OLD_RX_RESET is not set 890# CONFIG_8139_OLD_RX_RESET is not set
775# CONFIG_R6040 is not set 891# CONFIG_R6040 is not set
@@ -795,6 +911,7 @@ CONFIG_NETDEV_1000=y
795# CONFIG_HAMACHI is not set 911# CONFIG_HAMACHI is not set
796# CONFIG_YELLOWFIN is not set 912# CONFIG_YELLOWFIN is not set
797CONFIG_R8169=y 913CONFIG_R8169=y
914CONFIG_R8169_VLAN=y
798# CONFIG_SIS190 is not set 915# CONFIG_SIS190 is not set
799# CONFIG_SKGE is not set 916# CONFIG_SKGE is not set
800# CONFIG_SKY2 is not set 917# CONFIG_SKY2 is not set
@@ -810,15 +927,31 @@ CONFIG_R8169=y
810# CONFIG_NETDEV_10000 is not set 927# CONFIG_NETDEV_10000 is not set
811# CONFIG_TR is not set 928# CONFIG_TR is not set
812CONFIG_WLAN=y 929CONFIG_WLAN=y
813CONFIG_WLAN_PRE80211=y 930# CONFIG_LIBERTAS_THINFIRM is not set
814# CONFIG_STRIP is not set
815# CONFIG_WAVELAN is not set
816CONFIG_WLAN_80211=y
817# CONFIG_LIBERTAS is not set
818# CONFIG_ATMEL is not set 931# CONFIG_ATMEL is not set
932# CONFIG_AT76C50X_USB is not set
819# CONFIG_PRISM54 is not set 933# CONFIG_PRISM54 is not set
820# CONFIG_USB_ZD1201 is not set 934# CONFIG_USB_ZD1201 is not set
935# CONFIG_USB_NET_RNDIS_WLAN is not set
936# CONFIG_RTL8180 is not set
937# CONFIG_RTL8187 is not set
938# CONFIG_ADM8211 is not set
939# CONFIG_MAC80211_HWSIM is not set
940# CONFIG_MWL8K is not set
941# CONFIG_ATH_COMMON is not set
942# CONFIG_B43 is not set
943# CONFIG_B43LEGACY is not set
821# CONFIG_HOSTAP is not set 944# CONFIG_HOSTAP is not set
945# CONFIG_IPW2100 is not set
946# CONFIG_IPW2200 is not set
947# CONFIG_IWLWIFI is not set
948# CONFIG_IWM is not set
949# CONFIG_LIBERTAS is not set
950# CONFIG_HERMES is not set
951# CONFIG_P54_COMMON is not set
952# CONFIG_RT2X00 is not set
953# CONFIG_WL12XX is not set
954# CONFIG_ZD1211RW is not set
822 955
823# 956#
824# Enable WiMAX (Networking options) to see the WiMAX drivers 957# Enable WiMAX (Networking options) to see the WiMAX drivers
@@ -831,17 +964,39 @@ CONFIG_WLAN_80211=y
831# CONFIG_USB_KAWETH is not set 964# CONFIG_USB_KAWETH is not set
832# CONFIG_USB_PEGASUS is not set 965# CONFIG_USB_PEGASUS is not set
833# CONFIG_USB_RTL8150 is not set 966# CONFIG_USB_RTL8150 is not set
834# CONFIG_USB_USBNET is not set 967CONFIG_USB_USBNET=m
968CONFIG_USB_NET_AX8817X=m
969CONFIG_USB_NET_CDCETHER=m
970CONFIG_USB_NET_CDC_EEM=m
971# CONFIG_USB_NET_DM9601 is not set
972# CONFIG_USB_NET_SMSC95XX is not set
973# CONFIG_USB_NET_GL620A is not set
974CONFIG_USB_NET_NET1080=m
975# CONFIG_USB_NET_PLUSB is not set
976# CONFIG_USB_NET_MCS7830 is not set
977# CONFIG_USB_NET_RNDIS_HOST is not set
978CONFIG_USB_NET_CDC_SUBSET=m
979# CONFIG_USB_ALI_M5632 is not set
980# CONFIG_USB_AN2720 is not set
981CONFIG_USB_BELKIN=y
982CONFIG_USB_ARMLINUX=y
983# CONFIG_USB_EPSON2888 is not set
984# CONFIG_USB_KC2190 is not set
985CONFIG_USB_NET_ZAURUS=m
835# CONFIG_USB_HSO is not set 986# CONFIG_USB_HSO is not set
987# CONFIG_USB_NET_INT51X1 is not set
836# CONFIG_WAN is not set 988# CONFIG_WAN is not set
837# CONFIG_FDDI is not set 989# CONFIG_FDDI is not set
838# CONFIG_HIPPI is not set 990# CONFIG_HIPPI is not set
839# CONFIG_PPP is not set 991# CONFIG_PPP is not set
840# CONFIG_SLIP is not set 992# CONFIG_SLIP is not set
841# CONFIG_NET_FC is not set 993# CONFIG_NET_FC is not set
842# CONFIG_NETCONSOLE is not set 994CONFIG_NETCONSOLE=m
843# CONFIG_NETPOLL is not set 995CONFIG_NETCONSOLE_DYNAMIC=y
844# CONFIG_NET_POLL_CONTROLLER is not set 996CONFIG_NETPOLL=y
997# CONFIG_NETPOLL_TRAP is not set
998CONFIG_NET_POLL_CONTROLLER=y
999# CONFIG_VMXNET3 is not set
845# CONFIG_ISDN is not set 1000# CONFIG_ISDN is not set
846# CONFIG_PHONE is not set 1001# CONFIG_PHONE is not set
847 1002
@@ -849,8 +1004,9 @@ CONFIG_WLAN_80211=y
849# Input device support 1004# Input device support
850# 1005#
851CONFIG_INPUT=y 1006CONFIG_INPUT=y
852# CONFIG_INPUT_FF_MEMLESS is not set 1007CONFIG_INPUT_FF_MEMLESS=m
853# CONFIG_INPUT_POLLDEV is not set 1008CONFIG_INPUT_POLLDEV=m
1009# CONFIG_INPUT_SPARSEKMAP is not set
854 1010
855# 1011#
856# Userland interfaces 1012# Userland interfaces
@@ -884,7 +1040,7 @@ CONFIG_MOUSE_PS2_SYNAPTICS=y
884# CONFIG_MOUSE_PS2_SENTELIC is not set 1040# CONFIG_MOUSE_PS2_SENTELIC is not set
885# CONFIG_MOUSE_PS2_TOUCHKIT is not set 1041# CONFIG_MOUSE_PS2_TOUCHKIT is not set
886# CONFIG_MOUSE_SERIAL is not set 1042# CONFIG_MOUSE_SERIAL is not set
887# CONFIG_MOUSE_APPLETOUCH is not set 1043CONFIG_MOUSE_APPLETOUCH=m
888# CONFIG_MOUSE_BCM5974 is not set 1044# CONFIG_MOUSE_BCM5974 is not set
889# CONFIG_MOUSE_INPORT is not set 1045# CONFIG_MOUSE_INPORT is not set
890# CONFIG_MOUSE_LOGIBM is not set 1046# CONFIG_MOUSE_LOGIBM is not set
@@ -904,6 +1060,7 @@ CONFIG_SERIO_I8042=y
904# CONFIG_SERIO_PCIPS2 is not set 1060# CONFIG_SERIO_PCIPS2 is not set
905CONFIG_SERIO_LIBPS2=y 1061CONFIG_SERIO_LIBPS2=y
906# CONFIG_SERIO_RAW is not set 1062# CONFIG_SERIO_RAW is not set
1063# CONFIG_SERIO_ALTERA_PS2 is not set
907# CONFIG_GAMEPORT is not set 1064# CONFIG_GAMEPORT is not set
908 1065
909# 1066#
@@ -934,8 +1091,7 @@ CONFIG_SERIAL_NONSTANDARD=y
934# 1091#
935# Serial drivers 1092# Serial drivers
936# 1093#
937CONFIG_SERIAL_8250=y 1094CONFIG_SERIAL_8250=m
938CONFIG_SERIAL_8250_CONSOLE=y
939# CONFIG_SERIAL_8250_PCI is not set 1095# CONFIG_SERIAL_8250_PCI is not set
940CONFIG_SERIAL_8250_NR_UARTS=16 1096CONFIG_SERIAL_8250_NR_UARTS=16
941CONFIG_SERIAL_8250_RUNTIME_UARTS=4 1097CONFIG_SERIAL_8250_RUNTIME_UARTS=4
@@ -953,8 +1109,7 @@ CONFIG_SERIAL_8250_FOURPORT=y
953# 1109#
954# Non-8250 serial port support 1110# Non-8250 serial port support
955# 1111#
956CONFIG_SERIAL_CORE=y 1112CONFIG_SERIAL_CORE=m
957CONFIG_SERIAL_CORE_CONSOLE=y
958# CONFIG_SERIAL_JSM is not set 1113# CONFIG_SERIAL_JSM is not set
959CONFIG_UNIX98_PTYS=y 1114CONFIG_UNIX98_PTYS=y
960# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set 1115# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
@@ -1033,14 +1188,18 @@ CONFIG_VIDEO_MEDIA=m
1033# 1188#
1034# Multimedia drivers 1189# Multimedia drivers
1035# 1190#
1191CONFIG_IR_CORE=m
1192CONFIG_VIDEO_IR=m
1036# CONFIG_MEDIA_ATTACH is not set 1193# CONFIG_MEDIA_ATTACH is not set
1037CONFIG_VIDEO_V4L2=m 1194CONFIG_VIDEO_V4L2=m
1038CONFIG_VIDEO_V4L1=m 1195CONFIG_VIDEO_V4L1=m
1196CONFIG_VIDEOBUF_GEN=m
1197CONFIG_VIDEOBUF_VMALLOC=m
1039CONFIG_VIDEO_CAPTURE_DRIVERS=y 1198CONFIG_VIDEO_CAPTURE_DRIVERS=y
1040# CONFIG_VIDEO_ADV_DEBUG is not set 1199# CONFIG_VIDEO_ADV_DEBUG is not set
1041# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set 1200# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set
1042CONFIG_VIDEO_HELPER_CHIPS_AUTO=y 1201CONFIG_VIDEO_HELPER_CHIPS_AUTO=y
1043# CONFIG_VIDEO_VIVI is not set 1202CONFIG_VIDEO_VIVI=m
1044# CONFIG_VIDEO_PMS is not set 1203# CONFIG_VIDEO_PMS is not set
1045# CONFIG_VIDEO_CPIA is not set 1204# CONFIG_VIDEO_CPIA is not set
1046# CONFIG_VIDEO_CPIA2 is not set 1205# CONFIG_VIDEO_CPIA2 is not set
@@ -1049,52 +1208,55 @@ CONFIG_V4L_USB_DRIVERS=y
1049CONFIG_USB_VIDEO_CLASS=m 1208CONFIG_USB_VIDEO_CLASS=m
1050CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y 1209CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y
1051CONFIG_USB_GSPCA=m 1210CONFIG_USB_GSPCA=m
1052# CONFIG_USB_M5602 is not set 1211CONFIG_USB_M5602=m
1053# CONFIG_USB_STV06XX is not set 1212CONFIG_USB_STV06XX=m
1054# CONFIG_USB_GL860 is not set 1213# CONFIG_USB_GL860 is not set
1055# CONFIG_USB_GSPCA_CONEX is not set 1214CONFIG_USB_GSPCA_CONEX=m
1056# CONFIG_USB_GSPCA_ETOMS is not set 1215CONFIG_USB_GSPCA_ETOMS=m
1057# CONFIG_USB_GSPCA_FINEPIX is not set 1216CONFIG_USB_GSPCA_FINEPIX=m
1058# CONFIG_USB_GSPCA_JEILINJ is not set 1217# CONFIG_USB_GSPCA_JEILINJ is not set
1059# CONFIG_USB_GSPCA_MARS is not set 1218CONFIG_USB_GSPCA_MARS=m
1060# CONFIG_USB_GSPCA_MR97310A is not set 1219CONFIG_USB_GSPCA_MR97310A=m
1061# CONFIG_USB_GSPCA_OV519 is not set 1220CONFIG_USB_GSPCA_OV519=m
1062# CONFIG_USB_GSPCA_OV534 is not set 1221CONFIG_USB_GSPCA_OV534=m
1063# CONFIG_USB_GSPCA_PAC207 is not set 1222CONFIG_USB_GSPCA_PAC207=m
1064# CONFIG_USB_GSPCA_PAC7311 is not set 1223# CONFIG_USB_GSPCA_PAC7302 is not set
1065# CONFIG_USB_GSPCA_SN9C20X is not set 1224CONFIG_USB_GSPCA_PAC7311=m
1066# CONFIG_USB_GSPCA_SONIXB is not set 1225CONFIG_USB_GSPCA_SN9C20X=m
1067# CONFIG_USB_GSPCA_SONIXJ is not set 1226CONFIG_USB_GSPCA_SN9C20X_EVDEV=y
1068# CONFIG_USB_GSPCA_SPCA500 is not set 1227CONFIG_USB_GSPCA_SONIXB=m
1069# CONFIG_USB_GSPCA_SPCA501 is not set 1228CONFIG_USB_GSPCA_SONIXJ=m
1070# CONFIG_USB_GSPCA_SPCA505 is not set 1229CONFIG_USB_GSPCA_SPCA500=m
1071# CONFIG_USB_GSPCA_SPCA506 is not set 1230CONFIG_USB_GSPCA_SPCA501=m
1072# CONFIG_USB_GSPCA_SPCA508 is not set 1231CONFIG_USB_GSPCA_SPCA505=m
1073# CONFIG_USB_GSPCA_SPCA561 is not set 1232CONFIG_USB_GSPCA_SPCA506=m
1074# CONFIG_USB_GSPCA_SQ905 is not set 1233CONFIG_USB_GSPCA_SPCA508=m
1075# CONFIG_USB_GSPCA_SQ905C is not set 1234CONFIG_USB_GSPCA_SPCA561=m
1076# CONFIG_USB_GSPCA_STK014 is not set 1235CONFIG_USB_GSPCA_SQ905=m
1077# CONFIG_USB_GSPCA_SUNPLUS is not set 1236CONFIG_USB_GSPCA_SQ905C=m
1078# CONFIG_USB_GSPCA_T613 is not set 1237CONFIG_USB_GSPCA_STK014=m
1079# CONFIG_USB_GSPCA_TV8532 is not set 1238# CONFIG_USB_GSPCA_STV0680 is not set
1080# CONFIG_USB_GSPCA_VC032X is not set 1239CONFIG_USB_GSPCA_SUNPLUS=m
1081# CONFIG_USB_GSPCA_ZC3XX is not set 1240CONFIG_USB_GSPCA_T613=m
1241CONFIG_USB_GSPCA_TV8532=m
1242CONFIG_USB_GSPCA_VC032X=m
1243CONFIG_USB_GSPCA_ZC3XX=m
1082# CONFIG_VIDEO_HDPVR is not set 1244# CONFIG_VIDEO_HDPVR is not set
1083# CONFIG_USB_VICAM is not set 1245# CONFIG_USB_VICAM is not set
1084# CONFIG_USB_IBMCAM is not set 1246# CONFIG_USB_IBMCAM is not set
1085# CONFIG_USB_KONICAWC is not set 1247# CONFIG_USB_KONICAWC is not set
1086# CONFIG_USB_QUICKCAM_MESSENGER is not set 1248# CONFIG_USB_QUICKCAM_MESSENGER is not set
1087# CONFIG_USB_ET61X251 is not set 1249CONFIG_USB_ET61X251=m
1088# CONFIG_USB_OV511 is not set 1250# CONFIG_USB_OV511 is not set
1089# CONFIG_USB_SE401 is not set 1251# CONFIG_USB_SE401 is not set
1090# CONFIG_USB_SN9C102 is not set 1252CONFIG_USB_SN9C102=m
1091# CONFIG_USB_STV680 is not set 1253# CONFIG_USB_STV680 is not set
1092# CONFIG_USB_ZC0301 is not set 1254CONFIG_USB_ZC0301=m
1093# CONFIG_USB_PWC is not set 1255# CONFIG_USB_PWC is not set
1094CONFIG_USB_PWC_INPUT_EVDEV=y 1256CONFIG_USB_PWC_INPUT_EVDEV=y
1095# CONFIG_USB_ZR364XX is not set 1257CONFIG_USB_ZR364XX=m
1096# CONFIG_USB_STKWEBCAM is not set 1258CONFIG_USB_STKWEBCAM=m
1097# CONFIG_USB_S2255 is not set 1259CONFIG_USB_S2255=m
1098# CONFIG_RADIO_ADAPTERS is not set 1260# CONFIG_RADIO_ADAPTERS is not set
1099# CONFIG_DAB is not set 1261# CONFIG_DAB is not set
1100 1262
@@ -1132,6 +1294,7 @@ CONFIG_FB_TILEBLITTING=y
1132# CONFIG_FB_CYBER2000 is not set 1294# CONFIG_FB_CYBER2000 is not set
1133# CONFIG_FB_ASILIANT is not set 1295# CONFIG_FB_ASILIANT is not set
1134# CONFIG_FB_IMSTT is not set 1296# CONFIG_FB_IMSTT is not set
1297# CONFIG_FB_UVESA is not set
1135# CONFIG_FB_S1D13XXX is not set 1298# CONFIG_FB_S1D13XXX is not set
1136# CONFIG_FB_NVIDIA is not set 1299# CONFIG_FB_NVIDIA is not set
1137# CONFIG_FB_RIVA is not set 1300# CONFIG_FB_RIVA is not set
@@ -1161,7 +1324,7 @@ CONFIG_FB_SIS_315=y
1161CONFIG_BACKLIGHT_LCD_SUPPORT=y 1324CONFIG_BACKLIGHT_LCD_SUPPORT=y
1162# CONFIG_LCD_CLASS_DEVICE is not set 1325# CONFIG_LCD_CLASS_DEVICE is not set
1163CONFIG_BACKLIGHT_CLASS_DEVICE=y 1326CONFIG_BACKLIGHT_CLASS_DEVICE=y
1164CONFIG_BACKLIGHT_GENERIC=y 1327CONFIG_BACKLIGHT_GENERIC=m
1165 1328
1166# 1329#
1167# Display device support 1330# Display device support
@@ -1193,28 +1356,44 @@ CONFIG_LOGO=y
1193# CONFIG_LOGO_LINUX_VGA16 is not set 1356# CONFIG_LOGO_LINUX_VGA16 is not set
1194CONFIG_LOGO_LINUX_CLUT224=y 1357CONFIG_LOGO_LINUX_CLUT224=y
1195CONFIG_SOUND=m 1358CONFIG_SOUND=m
1196# CONFIG_SOUND_OSS_CORE is not set 1359CONFIG_SOUND_OSS_CORE=y
1360CONFIG_SOUND_OSS_CORE_PRECLAIM=y
1197CONFIG_SND=m 1361CONFIG_SND=m
1198CONFIG_SND_TIMER=m 1362CONFIG_SND_TIMER=m
1199CONFIG_SND_PCM=m 1363CONFIG_SND_PCM=m
1200# CONFIG_SND_SEQUENCER is not set 1364CONFIG_SND_HWDEP=m
1201# CONFIG_SND_MIXER_OSS is not set 1365CONFIG_SND_RAWMIDI=m
1202# CONFIG_SND_PCM_OSS is not set 1366CONFIG_SND_SEQUENCER=m
1203# CONFIG_SND_HRTIMER is not set 1367CONFIG_SND_SEQ_DUMMY=m
1368CONFIG_SND_OSSEMUL=y
1369CONFIG_SND_MIXER_OSS=m
1370CONFIG_SND_PCM_OSS=m
1371CONFIG_SND_PCM_OSS_PLUGINS=y
1372CONFIG_SND_SEQUENCER_OSS=y
1373CONFIG_SND_HRTIMER=m
1374CONFIG_SND_SEQ_HRTIMER_DEFAULT=y
1204# CONFIG_SND_RTCTIMER is not set 1375# CONFIG_SND_RTCTIMER is not set
1205# CONFIG_SND_DYNAMIC_MINORS is not set 1376# CONFIG_SND_DYNAMIC_MINORS is not set
1206# CONFIG_SND_SUPPORT_OLD_API is not set 1377CONFIG_SND_SUPPORT_OLD_API=y
1207# CONFIG_SND_VERBOSE_PROCFS is not set 1378CONFIG_SND_VERBOSE_PROCFS=y
1208# CONFIG_SND_VERBOSE_PRINTK is not set 1379# CONFIG_SND_VERBOSE_PRINTK is not set
1209# CONFIG_SND_DEBUG is not set 1380# CONFIG_SND_DEBUG is not set
1210CONFIG_SND_VMASTER=y 1381CONFIG_SND_VMASTER=y
1211# CONFIG_SND_RAWMIDI_SEQ is not set 1382CONFIG_SND_RAWMIDI_SEQ=m
1212# CONFIG_SND_OPL3_LIB_SEQ is not set 1383# CONFIG_SND_OPL3_LIB_SEQ is not set
1213# CONFIG_SND_OPL4_LIB_SEQ is not set 1384# CONFIG_SND_OPL4_LIB_SEQ is not set
1214# CONFIG_SND_SBAWE_SEQ is not set 1385# CONFIG_SND_SBAWE_SEQ is not set
1215# CONFIG_SND_EMU10K1_SEQ is not set 1386# CONFIG_SND_EMU10K1_SEQ is not set
1387CONFIG_SND_MPU401_UART=m
1216CONFIG_SND_AC97_CODEC=m 1388CONFIG_SND_AC97_CODEC=m
1217# CONFIG_SND_DRIVERS is not set 1389CONFIG_SND_DRIVERS=y
1390CONFIG_SND_DUMMY=m
1391CONFIG_SND_VIRMIDI=m
1392# CONFIG_SND_MTPAV is not set
1393CONFIG_SND_SERIAL_U16550=m
1394CONFIG_SND_MPU401=m
1395CONFIG_SND_AC97_POWER_SAVE=y
1396CONFIG_SND_AC97_POWER_SAVE_DEFAULT=10
1218CONFIG_SND_PCI=y 1397CONFIG_SND_PCI=y
1219# CONFIG_SND_AD1889 is not set 1398# CONFIG_SND_AD1889 is not set
1220# CONFIG_SND_ALS300 is not set 1399# CONFIG_SND_ALS300 is not set
@@ -1281,7 +1460,10 @@ CONFIG_SND_CS5535AUDIO=m
1281# CONFIG_SND_VX222 is not set 1460# CONFIG_SND_VX222 is not set
1282# CONFIG_SND_YMFPCI is not set 1461# CONFIG_SND_YMFPCI is not set
1283# CONFIG_SND_MIPS is not set 1462# CONFIG_SND_MIPS is not set
1284# CONFIG_SND_USB is not set 1463CONFIG_SND_USB=y
1464CONFIG_SND_USB_AUDIO=m
1465CONFIG_SND_USB_CAIAQ=m
1466CONFIG_SND_USB_CAIAQ_INPUT=y
1285# CONFIG_SND_SOC is not set 1467# CONFIG_SND_SOC is not set
1286# CONFIG_SOUND_PRIME is not set 1468# CONFIG_SOUND_PRIME is not set
1287CONFIG_AC97_BUS=m 1469CONFIG_AC97_BUS=m
@@ -1299,32 +1481,41 @@ CONFIG_USB_HIDDEV=y
1299# 1481#
1300# Special HID drivers 1482# Special HID drivers
1301# 1483#
1302# CONFIG_HID_A4TECH is not set 1484CONFIG_HID_A4TECH=m
1303# CONFIG_HID_APPLE is not set 1485CONFIG_HID_APPLE=m
1304# CONFIG_HID_BELKIN is not set 1486CONFIG_HID_BELKIN=m
1305# CONFIG_HID_CHERRY is not set 1487CONFIG_HID_CHERRY=m
1306# CONFIG_HID_CHICONY is not set 1488CONFIG_HID_CHICONY=m
1307# CONFIG_HID_CYPRESS is not set 1489CONFIG_HID_CYPRESS=m
1308# CONFIG_HID_DRAGONRISE is not set 1490CONFIG_HID_DRAGONRISE=m
1309# CONFIG_HID_EZKEY is not set 1491CONFIG_DRAGONRISE_FF=y
1310# CONFIG_HID_KYE is not set 1492CONFIG_HID_EZKEY=m
1311# CONFIG_HID_GYRATION is not set 1493CONFIG_HID_KYE=m
1312# CONFIG_HID_TWINHAN is not set 1494CONFIG_HID_GYRATION=m
1313# CONFIG_HID_KENSINGTON is not set 1495CONFIG_HID_TWINHAN=m
1314# CONFIG_HID_LOGITECH is not set 1496CONFIG_HID_KENSINGTON=m
1315# CONFIG_HID_MICROSOFT is not set 1497CONFIG_HID_LOGITECH=m
1316# CONFIG_HID_MONTEREY is not set 1498CONFIG_LOGITECH_FF=y
1317# CONFIG_HID_NTRIG is not set 1499CONFIG_LOGIRUMBLEPAD2_FF=y
1318# CONFIG_HID_PANTHERLORD is not set 1500CONFIG_HID_MICROSOFT=m
1319# CONFIG_HID_PETALYNX is not set 1501CONFIG_HID_MONTEREY=m
1320# CONFIG_HID_SAMSUNG is not set 1502CONFIG_HID_NTRIG=m
1321# CONFIG_HID_SONY is not set 1503CONFIG_HID_PANTHERLORD=m
1322# CONFIG_HID_SUNPLUS is not set 1504CONFIG_PANTHERLORD_FF=y
1323# CONFIG_HID_GREENASIA is not set 1505CONFIG_HID_PETALYNX=m
1324# CONFIG_HID_SMARTJOYPLUS is not set 1506CONFIG_HID_SAMSUNG=m
1325# CONFIG_HID_TOPSEED is not set 1507CONFIG_HID_SONY=m
1326# CONFIG_HID_THRUSTMASTER is not set 1508CONFIG_HID_SUNPLUS=m
1327# CONFIG_HID_ZEROPLUS is not set 1509CONFIG_HID_GREENASIA=m
1510CONFIG_GREENASIA_FF=y
1511CONFIG_HID_SMARTJOYPLUS=m
1512CONFIG_SMARTJOYPLUS_FF=y
1513CONFIG_HID_TOPSEED=m
1514CONFIG_HID_THRUSTMASTER=m
1515CONFIG_THRUSTMASTER_FF=y
1516CONFIG_HID_WACOM=m
1517CONFIG_HID_ZEROPLUS=m
1518CONFIG_ZEROPLUS_FF=y
1328CONFIG_USB_SUPPORT=y 1519CONFIG_USB_SUPPORT=y
1329CONFIG_USB_ARCH_HAS_HCD=y 1520CONFIG_USB_ARCH_HAS_HCD=y
1330CONFIG_USB_ARCH_HAS_OHCI=y 1521CONFIG_USB_ARCH_HAS_OHCI=y
@@ -1344,7 +1535,7 @@ CONFIG_USB_SUSPEND=y
1344CONFIG_USB_OTG_WHITELIST=y 1535CONFIG_USB_OTG_WHITELIST=y
1345# CONFIG_USB_OTG_BLACKLIST_HUB is not set 1536# CONFIG_USB_OTG_BLACKLIST_HUB is not set
1346CONFIG_USB_MON=y 1537CONFIG_USB_MON=y
1347# CONFIG_USB_WUSB is not set 1538CONFIG_USB_WUSB=m
1348# CONFIG_USB_WUSB_CBAF is not set 1539# CONFIG_USB_WUSB_CBAF is not set
1349 1540
1350# 1541#
@@ -1366,14 +1557,15 @@ CONFIG_USB_OHCI_LITTLE_ENDIAN=y
1366CONFIG_USB_UHCI_HCD=m 1557CONFIG_USB_UHCI_HCD=m
1367# CONFIG_USB_SL811_HCD is not set 1558# CONFIG_USB_SL811_HCD is not set
1368# CONFIG_USB_R8A66597_HCD is not set 1559# CONFIG_USB_R8A66597_HCD is not set
1369# CONFIG_USB_WHCI_HCD is not set 1560CONFIG_USB_WHCI_HCD=m
1370# CONFIG_USB_HWA_HCD is not set 1561CONFIG_USB_HWA_HCD=m
1562# CONFIG_USB_GADGET_MUSB_HDRC is not set
1371 1563
1372# 1564#
1373# USB Device Class drivers 1565# USB Device Class drivers
1374# 1566#
1375CONFIG_USB_ACM=m 1567CONFIG_USB_ACM=m
1376# CONFIG_USB_PRINTER is not set 1568CONFIG_USB_PRINTER=m
1377CONFIG_USB_WDM=m 1569CONFIG_USB_WDM=m
1378# CONFIG_USB_TMC is not set 1570# CONFIG_USB_TMC is not set
1379 1571
@@ -1397,7 +1589,7 @@ CONFIG_USB_STORAGE_ALAUDA=m
1397# CONFIG_USB_STORAGE_ONETOUCH is not set 1589# CONFIG_USB_STORAGE_ONETOUCH is not set
1398# CONFIG_USB_STORAGE_KARMA is not set 1590# CONFIG_USB_STORAGE_KARMA is not set
1399# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set 1591# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
1400# CONFIG_USB_LIBUSUAL is not set 1592CONFIG_USB_LIBUSUAL=y
1401 1593
1402# 1594#
1403# USB Imaging devices 1595# USB Imaging devices
@@ -1467,7 +1659,7 @@ CONFIG_USB_SERIAL_GENERIC=y
1467# CONFIG_USB_LEGOTOWER is not set 1659# CONFIG_USB_LEGOTOWER is not set
1468# CONFIG_USB_LCD is not set 1660# CONFIG_USB_LCD is not set
1469# CONFIG_USB_BERRY_CHARGE is not set 1661# CONFIG_USB_BERRY_CHARGE is not set
1470# CONFIG_USB_LED is not set 1662CONFIG_USB_LED=m
1471# CONFIG_USB_CYPRESS_CY7C63 is not set 1663# CONFIG_USB_CYPRESS_CY7C63 is not set
1472# CONFIG_USB_CYTHERM is not set 1664# CONFIG_USB_CYTHERM is not set
1473# CONFIG_USB_IDMOUSE is not set 1665# CONFIG_USB_IDMOUSE is not set
@@ -1480,16 +1672,95 @@ CONFIG_USB_SERIAL_GENERIC=y
1480# CONFIG_USB_TEST is not set 1672# CONFIG_USB_TEST is not set
1481# CONFIG_USB_ISIGHTFW is not set 1673# CONFIG_USB_ISIGHTFW is not set
1482# CONFIG_USB_VST is not set 1674# CONFIG_USB_VST is not set
1483# CONFIG_USB_GADGET is not set 1675CONFIG_USB_GADGET=m
1676# CONFIG_USB_GADGET_DEBUG_FILES is not set
1677# CONFIG_USB_GADGET_DEBUG_FS is not set
1678CONFIG_USB_GADGET_VBUS_DRAW=2
1679CONFIG_USB_GADGET_SELECTED=y
1680# CONFIG_USB_GADGET_AT91 is not set
1681# CONFIG_USB_GADGET_ATMEL_USBA is not set
1682# CONFIG_USB_GADGET_FSL_USB2 is not set
1683# CONFIG_USB_GADGET_LH7A40X is not set
1684# CONFIG_USB_GADGET_OMAP is not set
1685# CONFIG_USB_GADGET_PXA25X is not set
1686# CONFIG_USB_GADGET_R8A66597 is not set
1687# CONFIG_USB_GADGET_PXA27X is not set
1688# CONFIG_USB_GADGET_S3C_HSOTG is not set
1689# CONFIG_USB_GADGET_IMX is not set
1690# CONFIG_USB_GADGET_S3C2410 is not set
1691CONFIG_USB_GADGET_M66592=y
1692CONFIG_USB_M66592=m
1693# CONFIG_USB_GADGET_AMD5536UDC is not set
1694# CONFIG_USB_GADGET_FSL_QE is not set
1695# CONFIG_USB_GADGET_CI13XXX is not set
1696# CONFIG_USB_GADGET_NET2280 is not set
1697# CONFIG_USB_GADGET_GOKU is not set
1698# CONFIG_USB_GADGET_LANGWELL is not set
1699# CONFIG_USB_GADGET_DUMMY_HCD is not set
1700CONFIG_USB_GADGET_DUALSPEED=y
1701# CONFIG_USB_ZERO is not set
1702# CONFIG_USB_AUDIO is not set
1703# CONFIG_USB_ETH is not set
1704# CONFIG_USB_GADGETFS is not set
1705# CONFIG_USB_FILE_STORAGE is not set
1706# CONFIG_USB_MASS_STORAGE is not set
1707# CONFIG_USB_G_SERIAL is not set
1708# CONFIG_USB_MIDI_GADGET is not set
1709# CONFIG_USB_G_PRINTER is not set
1710# CONFIG_USB_CDC_COMPOSITE is not set
1711# CONFIG_USB_G_MULTI is not set
1484 1712
1485# 1713#
1486# OTG and related infrastructure 1714# OTG and related infrastructure
1487# 1715#
1488# CONFIG_NOP_USB_XCEIV is not set 1716# CONFIG_NOP_USB_XCEIV is not set
1489# CONFIG_UWB is not set 1717CONFIG_UWB=m
1490# CONFIG_MMC is not set 1718CONFIG_UWB_HWA=m
1719CONFIG_UWB_WHCI=m
1720# CONFIG_UWB_WLP is not set
1721# CONFIG_UWB_I1480U is not set
1722CONFIG_MMC=m
1723# CONFIG_MMC_DEBUG is not set
1724# CONFIG_MMC_UNSAFE_RESUME is not set
1725
1726#
1727# MMC/SD/SDIO Card Drivers
1728#
1729CONFIG_MMC_BLOCK=m
1730CONFIG_MMC_BLOCK_BOUNCE=y
1731# CONFIG_SDIO_UART is not set
1732# CONFIG_MMC_TEST is not set
1733
1734#
1735# MMC/SD/SDIO Host Controller Drivers
1736#
1737# CONFIG_MMC_SDHCI is not set
1738# CONFIG_MMC_AT91 is not set
1739# CONFIG_MMC_ATMELMCI is not set
1740# CONFIG_MMC_TIFM_SD is not set
1741# CONFIG_MMC_CB710 is not set
1742# CONFIG_MMC_VIA_SDMMC is not set
1491# CONFIG_MEMSTICK is not set 1743# CONFIG_MEMSTICK is not set
1492# CONFIG_NEW_LEDS is not set 1744CONFIG_NEW_LEDS=y
1745CONFIG_LEDS_CLASS=m
1746
1747#
1748# LED drivers
1749#
1750
1751#
1752# LED Triggers
1753#
1754CONFIG_LEDS_TRIGGERS=y
1755# CONFIG_LEDS_TRIGGER_TIMER is not set
1756# CONFIG_LEDS_TRIGGER_IDE_DISK is not set
1757# CONFIG_LEDS_TRIGGER_HEARTBEAT is not set
1758# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set
1759# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set
1760
1761#
1762# iptables trigger is under Netfilter config (LED target)
1763#
1493# CONFIG_ACCESSIBILITY is not set 1764# CONFIG_ACCESSIBILITY is not set
1494# CONFIG_INFINIBAND is not set 1765# CONFIG_INFINIBAND is not set
1495# CONFIG_RTC_CLASS is not set 1766# CONFIG_RTC_CLASS is not set
@@ -1504,22 +1775,18 @@ CONFIG_STAGING=y
1504# CONFIG_STAGING_EXCLUDE_BUILD is not set 1775# CONFIG_STAGING_EXCLUDE_BUILD is not set
1505# CONFIG_ET131X is not set 1776# CONFIG_ET131X is not set
1506# CONFIG_USB_IP_COMMON is not set 1777# CONFIG_USB_IP_COMMON is not set
1507# CONFIG_PRISM2_USB is not set 1778# CONFIG_W35UND is not set
1508# CONFIG_ECHO is not set 1779# CONFIG_ECHO is not set
1780# CONFIG_OTUS is not set
1509# CONFIG_COMEDI is not set 1781# CONFIG_COMEDI is not set
1510# CONFIG_ASUS_OLED is not set 1782# CONFIG_ASUS_OLED is not set
1511# CONFIG_ALTERA_PCIE_CHDMA is not set 1783# CONFIG_ALTERA_PCIE_CHDMA is not set
1512# CONFIG_RTL8187SE is not set 1784# CONFIG_R8187SE is not set
1513# CONFIG_RTL8192SU is not set
1514# CONFIG_RTL8192E is not set 1785# CONFIG_RTL8192E is not set
1515# CONFIG_INPUT_MIMIO is not set 1786# CONFIG_INPUT_MIMIO is not set
1516# CONFIG_TRANZPORT is not set 1787# CONFIG_TRANZPORT is not set
1517 1788
1518# 1789#
1519# Android
1520#
1521
1522#
1523# Qualcomm MSM Camera And Video 1790# Qualcomm MSM Camera And Video
1524# 1791#
1525 1792
@@ -1527,7 +1794,6 @@ CONFIG_STAGING=y
1527# Camera Sensor Selection 1794# Camera Sensor Selection
1528# 1795#
1529# CONFIG_INPUT_GPIO is not set 1796# CONFIG_INPUT_GPIO is not set
1530# CONFIG_DST is not set
1531# CONFIG_POHMELFS is not set 1797# CONFIG_POHMELFS is not set
1532# CONFIG_B3DFG is not set 1798# CONFIG_B3DFG is not set
1533# CONFIG_PLAN9AUTH is not set 1799# CONFIG_PLAN9AUTH is not set
@@ -1544,28 +1810,55 @@ CONFIG_STAGING=y
1544# 1810#
1545# CONFIG_RAR_REGISTER is not set 1811# CONFIG_RAR_REGISTER is not set
1546# CONFIG_IIO is not set 1812# CONFIG_IIO is not set
1813# CONFIG_RAMZSWAP is not set
1814# CONFIG_BATMAN_ADV is not set
1815# CONFIG_STRIP is not set
1816# CONFIG_WAVELAN is not set
1547CONFIG_FB_SM7XX=y 1817CONFIG_FB_SM7XX=y
1548CONFIG_FB_SM7XX_ACCEL=y 1818# CONFIG_FB_SM7XX_ACCEL is not set
1549 1819
1550# 1820#
1551# File systems 1821# File systems
1552# 1822#
1553# CONFIG_EXT2_FS is not set 1823CONFIG_EXT2_FS=m
1824# CONFIG_EXT2_FS_XATTR is not set
1825# CONFIG_EXT2_FS_XIP is not set
1554CONFIG_EXT3_FS=y 1826CONFIG_EXT3_FS=y
1555# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set 1827# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
1556CONFIG_EXT3_FS_XATTR=y 1828CONFIG_EXT3_FS_XATTR=y
1557CONFIG_EXT3_FS_POSIX_ACL=y 1829CONFIG_EXT3_FS_POSIX_ACL=y
1558CONFIG_EXT3_FS_SECURITY=y 1830CONFIG_EXT3_FS_SECURITY=y
1559# CONFIG_EXT4_FS is not set 1831CONFIG_EXT4_FS=y
1832CONFIG_EXT4_FS_XATTR=y
1833# CONFIG_EXT4_FS_POSIX_ACL is not set
1834# CONFIG_EXT4_FS_SECURITY is not set
1835# CONFIG_EXT4_DEBUG is not set
1560CONFIG_JBD=y 1836CONFIG_JBD=y
1837# CONFIG_JBD_DEBUG is not set
1838CONFIG_JBD2=y
1839# CONFIG_JBD2_DEBUG is not set
1561CONFIG_FS_MBCACHE=y 1840CONFIG_FS_MBCACHE=y
1562# CONFIG_REISERFS_FS is not set 1841CONFIG_REISERFS_FS=m
1563# CONFIG_JFS_FS is not set 1842# CONFIG_REISERFS_CHECK is not set
1843CONFIG_REISERFS_PROC_INFO=y
1844CONFIG_REISERFS_FS_XATTR=y
1845# CONFIG_REISERFS_FS_POSIX_ACL is not set
1846# CONFIG_REISERFS_FS_SECURITY is not set
1847CONFIG_JFS_FS=m
1848CONFIG_JFS_POSIX_ACL=y
1849# CONFIG_JFS_SECURITY is not set
1850# CONFIG_JFS_DEBUG is not set
1851# CONFIG_JFS_STATISTICS is not set
1564CONFIG_FS_POSIX_ACL=y 1852CONFIG_FS_POSIX_ACL=y
1565# CONFIG_XFS_FS is not set 1853CONFIG_XFS_FS=m
1854CONFIG_XFS_QUOTA=y
1855CONFIG_XFS_POSIX_ACL=y
1856# CONFIG_XFS_RT is not set
1857# CONFIG_XFS_DEBUG is not set
1566# CONFIG_GFS2_FS is not set 1858# CONFIG_GFS2_FS is not set
1567# CONFIG_OCFS2_FS is not set 1859# CONFIG_OCFS2_FS is not set
1568# CONFIG_BTRFS_FS is not set 1860CONFIG_BTRFS_FS=m
1861# CONFIG_BTRFS_FS_POSIX_ACL is not set
1569# CONFIG_NILFS2_FS is not set 1862# CONFIG_NILFS2_FS is not set
1570CONFIG_FILE_LOCKING=y 1863CONFIG_FILE_LOCKING=y
1571CONFIG_FSNOTIFY=y 1864CONFIG_FSNOTIFY=y
@@ -1575,17 +1868,25 @@ CONFIG_INOTIFY_USER=y
1575CONFIG_QUOTA=y 1868CONFIG_QUOTA=y
1576# CONFIG_QUOTA_NETLINK_INTERFACE is not set 1869# CONFIG_QUOTA_NETLINK_INTERFACE is not set
1577CONFIG_PRINT_QUOTA_WARNING=y 1870CONFIG_PRINT_QUOTA_WARNING=y
1871CONFIG_QUOTA_TREE=m
1578# CONFIG_QFMT_V1 is not set 1872# CONFIG_QFMT_V1 is not set
1579# CONFIG_QFMT_V2 is not set 1873CONFIG_QFMT_V2=m
1580CONFIG_QUOTACTL=y 1874CONFIG_QUOTACTL=y
1581# CONFIG_AUTOFS_FS is not set 1875CONFIG_AUTOFS_FS=m
1582# CONFIG_AUTOFS4_FS is not set 1876CONFIG_AUTOFS4_FS=m
1583# CONFIG_FUSE_FS is not set 1877# CONFIG_FUSE_FS is not set
1584 1878
1585# 1879#
1586# Caches 1880# Caches
1587# 1881#
1588# CONFIG_FSCACHE is not set 1882CONFIG_FSCACHE=m
1883# CONFIG_FSCACHE_STATS is not set
1884# CONFIG_FSCACHE_HISTOGRAM is not set
1885# CONFIG_FSCACHE_DEBUG is not set
1886# CONFIG_FSCACHE_OBJECT_LIST is not set
1887CONFIG_CACHEFILES=m
1888# CONFIG_CACHEFILES_DEBUG is not set
1889# CONFIG_CACHEFILES_HISTOGRAM is not set
1589 1890
1590# 1891#
1591# CD-ROM/DVD Filesystems 1892# CD-ROM/DVD Filesystems
@@ -1599,11 +1900,13 @@ CONFIG_ZISOFS=y
1599# DOS/FAT/NT Filesystems 1900# DOS/FAT/NT Filesystems
1600# 1901#
1601CONFIG_FAT_FS=m 1902CONFIG_FAT_FS=m
1602# CONFIG_MSDOS_FS is not set 1903CONFIG_MSDOS_FS=m
1603CONFIG_VFAT_FS=m 1904CONFIG_VFAT_FS=m
1604CONFIG_FAT_DEFAULT_CODEPAGE=437 1905CONFIG_FAT_DEFAULT_CODEPAGE=437
1605CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" 1906CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1606# CONFIG_NTFS_FS is not set 1907CONFIG_NTFS_FS=m
1908# CONFIG_NTFS_DEBUG is not set
1909CONFIG_NTFS_RW=y
1607 1910
1608# 1911#
1609# Pseudo filesystems 1912# Pseudo filesystems
@@ -1616,23 +1919,60 @@ CONFIG_SYSFS=y
1616CONFIG_TMPFS=y 1919CONFIG_TMPFS=y
1617# CONFIG_TMPFS_POSIX_ACL is not set 1920# CONFIG_TMPFS_POSIX_ACL is not set
1618# CONFIG_HUGETLB_PAGE is not set 1921# CONFIG_HUGETLB_PAGE is not set
1619# CONFIG_CONFIGFS_FS is not set 1922CONFIG_CONFIGFS_FS=m
1620# CONFIG_MISC_FILESYSTEMS is not set 1923CONFIG_MISC_FILESYSTEMS=y
1924# CONFIG_ADFS_FS is not set
1925# CONFIG_AFFS_FS is not set
1926# CONFIG_ECRYPT_FS is not set
1927# CONFIG_HFS_FS is not set
1928# CONFIG_HFSPLUS_FS is not set
1929# CONFIG_BEFS_FS is not set
1930# CONFIG_BFS_FS is not set
1931# CONFIG_EFS_FS is not set
1932CONFIG_CRAMFS=m
1933CONFIG_SQUASHFS=m
1934CONFIG_SQUASHFS_EMBEDDED=y
1935CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
1936# CONFIG_VXFS_FS is not set
1937# CONFIG_MINIX_FS is not set
1938# CONFIG_OMFS_FS is not set
1939# CONFIG_HPFS_FS is not set
1940# CONFIG_QNX4FS_FS is not set
1941CONFIG_ROMFS_FS=m
1942CONFIG_ROMFS_BACKED_BY_BLOCK=y
1943# CONFIG_ROMFS_BACKED_BY_MTD is not set
1944# CONFIG_ROMFS_BACKED_BY_BOTH is not set
1945CONFIG_ROMFS_ON_BLOCK=y
1946# CONFIG_SYSV_FS is not set
1947# CONFIG_UFS_FS is not set
1621CONFIG_NETWORK_FILESYSTEMS=y 1948CONFIG_NETWORK_FILESYSTEMS=y
1622CONFIG_NFS_FS=m 1949CONFIG_NFS_FS=m
1623CONFIG_NFS_V3=y 1950CONFIG_NFS_V3=y
1624CONFIG_NFS_V3_ACL=y 1951CONFIG_NFS_V3_ACL=y
1625# CONFIG_NFS_V4 is not set 1952# CONFIG_NFS_V4 is not set
1626# CONFIG_NFSD is not set 1953# CONFIG_NFS_FSCACHE is not set
1954CONFIG_NFSD=m
1955CONFIG_NFSD_V3=y
1956# CONFIG_NFSD_V3_ACL is not set
1957CONFIG_NFSD_V4=y
1627CONFIG_LOCKD=m 1958CONFIG_LOCKD=m
1628CONFIG_LOCKD_V4=y 1959CONFIG_LOCKD_V4=y
1960CONFIG_EXPORTFS=m
1629CONFIG_NFS_ACL_SUPPORT=m 1961CONFIG_NFS_ACL_SUPPORT=m
1630CONFIG_NFS_COMMON=y 1962CONFIG_NFS_COMMON=y
1631CONFIG_SUNRPC=m 1963CONFIG_SUNRPC=m
1632# CONFIG_RPCSEC_GSS_KRB5 is not set 1964CONFIG_SUNRPC_GSS=m
1965CONFIG_RPCSEC_GSS_KRB5=m
1633# CONFIG_RPCSEC_GSS_SPKM3 is not set 1966# CONFIG_RPCSEC_GSS_SPKM3 is not set
1634# CONFIG_SMB_FS is not set 1967# CONFIG_SMB_FS is not set
1635# CONFIG_CIFS is not set 1968CONFIG_CIFS=m
1969# CONFIG_CIFS_STATS is not set
1970# CONFIG_CIFS_WEAK_PW_HASH is not set
1971# CONFIG_CIFS_UPCALL is not set
1972# CONFIG_CIFS_XATTR is not set
1973# CONFIG_CIFS_DEBUG2 is not set
1974# CONFIG_CIFS_DFS_UPCALL is not set
1975# CONFIG_CIFS_EXPERIMENTAL is not set
1636# CONFIG_NCP_FS is not set 1976# CONFIG_NCP_FS is not set
1637# CONFIG_CODA_FS is not set 1977# CONFIG_CODA_FS is not set
1638# CONFIG_AFS_FS is not set 1978# CONFIG_AFS_FS is not set
@@ -1643,45 +1983,45 @@ CONFIG_SUNRPC=m
1643# CONFIG_PARTITION_ADVANCED is not set 1983# CONFIG_PARTITION_ADVANCED is not set
1644CONFIG_MSDOS_PARTITION=y 1984CONFIG_MSDOS_PARTITION=y
1645CONFIG_NLS=y 1985CONFIG_NLS=y
1646CONFIG_NLS_DEFAULT="utf-8" 1986CONFIG_NLS_DEFAULT="utf8"
1647# CONFIG_NLS_CODEPAGE_437 is not set 1987CONFIG_NLS_CODEPAGE_437=m
1648# CONFIG_NLS_CODEPAGE_737 is not set 1988CONFIG_NLS_CODEPAGE_737=m
1649# CONFIG_NLS_CODEPAGE_775 is not set 1989CONFIG_NLS_CODEPAGE_775=m
1650# CONFIG_NLS_CODEPAGE_850 is not set 1990CONFIG_NLS_CODEPAGE_850=m
1651# CONFIG_NLS_CODEPAGE_852 is not set 1991CONFIG_NLS_CODEPAGE_852=m
1652# CONFIG_NLS_CODEPAGE_855 is not set 1992CONFIG_NLS_CODEPAGE_855=m
1653# CONFIG_NLS_CODEPAGE_857 is not set 1993CONFIG_NLS_CODEPAGE_857=m
1654# CONFIG_NLS_CODEPAGE_860 is not set 1994CONFIG_NLS_CODEPAGE_860=m
1655# CONFIG_NLS_CODEPAGE_861 is not set 1995CONFIG_NLS_CODEPAGE_861=m
1656# CONFIG_NLS_CODEPAGE_862 is not set 1996CONFIG_NLS_CODEPAGE_862=m
1657# CONFIG_NLS_CODEPAGE_863 is not set 1997CONFIG_NLS_CODEPAGE_863=m
1658# CONFIG_NLS_CODEPAGE_864 is not set 1998CONFIG_NLS_CODEPAGE_864=m
1659# CONFIG_NLS_CODEPAGE_865 is not set 1999CONFIG_NLS_CODEPAGE_865=m
1660# CONFIG_NLS_CODEPAGE_866 is not set 2000CONFIG_NLS_CODEPAGE_866=m
1661# CONFIG_NLS_CODEPAGE_869 is not set 2001CONFIG_NLS_CODEPAGE_869=m
1662# CONFIG_NLS_CODEPAGE_936 is not set 2002CONFIG_NLS_CODEPAGE_936=m
1663# CONFIG_NLS_CODEPAGE_950 is not set 2003CONFIG_NLS_CODEPAGE_950=m
1664# CONFIG_NLS_CODEPAGE_932 is not set 2004CONFIG_NLS_CODEPAGE_932=m
1665# CONFIG_NLS_CODEPAGE_949 is not set 2005CONFIG_NLS_CODEPAGE_949=m
1666# CONFIG_NLS_CODEPAGE_874 is not set 2006CONFIG_NLS_CODEPAGE_874=m
1667# CONFIG_NLS_ISO8859_8 is not set 2007CONFIG_NLS_ISO8859_8=m
1668# CONFIG_NLS_CODEPAGE_1250 is not set 2008CONFIG_NLS_CODEPAGE_1250=m
1669# CONFIG_NLS_CODEPAGE_1251 is not set 2009CONFIG_NLS_CODEPAGE_1251=m
1670# CONFIG_NLS_ASCII is not set 2010CONFIG_NLS_ASCII=m
1671# CONFIG_NLS_ISO8859_1 is not set 2011CONFIG_NLS_ISO8859_1=m
1672# CONFIG_NLS_ISO8859_2 is not set 2012CONFIG_NLS_ISO8859_2=m
1673# CONFIG_NLS_ISO8859_3 is not set 2013CONFIG_NLS_ISO8859_3=m
1674# CONFIG_NLS_ISO8859_4 is not set 2014CONFIG_NLS_ISO8859_4=m
1675# CONFIG_NLS_ISO8859_5 is not set 2015CONFIG_NLS_ISO8859_5=m
1676# CONFIG_NLS_ISO8859_6 is not set 2016CONFIG_NLS_ISO8859_6=m
1677# CONFIG_NLS_ISO8859_7 is not set 2017CONFIG_NLS_ISO8859_7=m
1678# CONFIG_NLS_ISO8859_9 is not set 2018CONFIG_NLS_ISO8859_9=m
1679# CONFIG_NLS_ISO8859_13 is not set 2019CONFIG_NLS_ISO8859_13=m
1680# CONFIG_NLS_ISO8859_14 is not set 2020CONFIG_NLS_ISO8859_14=m
1681# CONFIG_NLS_ISO8859_15 is not set 2021CONFIG_NLS_ISO8859_15=m
1682# CONFIG_NLS_KOI8_R is not set 2022CONFIG_NLS_KOI8_R=m
1683# CONFIG_NLS_KOI8_U is not set 2023CONFIG_NLS_KOI8_U=m
1684# CONFIG_NLS_UTF8 is not set 2024CONFIG_NLS_UTF8=y
1685# CONFIG_DLM is not set 2025# CONFIG_DLM is not set
1686 2026
1687# 2027#
@@ -1695,125 +2035,155 @@ CONFIG_FRAME_WARN=1024
1695# CONFIG_MAGIC_SYSRQ is not set 2035# CONFIG_MAGIC_SYSRQ is not set
1696CONFIG_STRIP_ASM_SYMS=y 2036CONFIG_STRIP_ASM_SYMS=y
1697# CONFIG_UNUSED_SYMBOLS is not set 2037# CONFIG_UNUSED_SYMBOLS is not set
1698# CONFIG_DEBUG_FS is not set 2038CONFIG_DEBUG_FS=y
1699# CONFIG_HEADERS_CHECK is not set 2039# CONFIG_HEADERS_CHECK is not set
1700# CONFIG_DEBUG_KERNEL is not set 2040# CONFIG_DEBUG_KERNEL is not set
1701# CONFIG_SLUB_DEBUG_ON is not set 2041# CONFIG_SLUB_DEBUG_ON is not set
1702# CONFIG_SLUB_STATS is not set 2042# CONFIG_SLUB_STATS is not set
2043CONFIG_STACKTRACE=y
1703# CONFIG_DEBUG_MEMORY_INIT is not set 2044# CONFIG_DEBUG_MEMORY_INIT is not set
1704# CONFIG_RCU_CPU_STALL_DETECTOR is not set 2045# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1705CONFIG_SYSCTL_SYSCALL_CHECK=y 2046CONFIG_SYSCTL_SYSCALL_CHECK=y
2047CONFIG_NOP_TRACER=y
2048CONFIG_HAVE_FUNCTION_TRACER=y
2049CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
2050CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y
2051CONFIG_HAVE_DYNAMIC_FTRACE=y
2052CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
2053CONFIG_RING_BUFFER=y
2054CONFIG_EVENT_TRACING=y
2055CONFIG_CONTEXT_SWITCH_TRACER=y
2056CONFIG_RING_BUFFER_ALLOW_SWAP=y
2057CONFIG_TRACING=y
1706CONFIG_TRACING_SUPPORT=y 2058CONFIG_TRACING_SUPPORT=y
1707# CONFIG_FTRACE is not set 2059# CONFIG_FTRACE is not set
2060# CONFIG_DYNAMIC_DEBUG is not set
1708# CONFIG_SAMPLES is not set 2061# CONFIG_SAMPLES is not set
1709CONFIG_HAVE_ARCH_KGDB=y 2062CONFIG_HAVE_ARCH_KGDB=y
2063CONFIG_EARLY_PRINTK=y
1710# CONFIG_CMDLINE_BOOL is not set 2064# CONFIG_CMDLINE_BOOL is not set
1711 2065
1712# 2066#
1713# Security options 2067# Security options
1714# 2068#
1715# CONFIG_KEYS is not set 2069CONFIG_KEYS=y
2070CONFIG_KEYS_DEBUG_PROC_KEYS=y
1716# CONFIG_SECURITY is not set 2071# CONFIG_SECURITY is not set
1717# CONFIG_SECURITYFS is not set 2072# CONFIG_SECURITYFS is not set
1718# CONFIG_SECURITY_FILE_CAPABILITIES is not set 2073# CONFIG_DEFAULT_SECURITY_SELINUX is not set
2074# CONFIG_DEFAULT_SECURITY_SMACK is not set
2075# CONFIG_DEFAULT_SECURITY_TOMOYO is not set
2076CONFIG_DEFAULT_SECURITY_DAC=y
2077CONFIG_DEFAULT_SECURITY=""
2078CONFIG_XOR_BLOCKS=m
2079CONFIG_ASYNC_CORE=m
2080CONFIG_ASYNC_MEMCPY=m
2081CONFIG_ASYNC_XOR=m
2082CONFIG_ASYNC_PQ=m
2083CONFIG_ASYNC_RAID6_RECOV=m
1719CONFIG_CRYPTO=y 2084CONFIG_CRYPTO=y
1720 2085
1721# 2086#
1722# Crypto core or helper 2087# Crypto core or helper
1723# 2088#
2089CONFIG_CRYPTO_FIPS=y
1724CONFIG_CRYPTO_ALGAPI=y 2090CONFIG_CRYPTO_ALGAPI=y
1725CONFIG_CRYPTO_ALGAPI2=y 2091CONFIG_CRYPTO_ALGAPI2=y
2092CONFIG_CRYPTO_AEAD=m
1726CONFIG_CRYPTO_AEAD2=y 2093CONFIG_CRYPTO_AEAD2=y
1727CONFIG_CRYPTO_BLKCIPHER=y 2094CONFIG_CRYPTO_BLKCIPHER=m
1728CONFIG_CRYPTO_BLKCIPHER2=y 2095CONFIG_CRYPTO_BLKCIPHER2=y
2096CONFIG_CRYPTO_HASH=y
1729CONFIG_CRYPTO_HASH2=y 2097CONFIG_CRYPTO_HASH2=y
2098CONFIG_CRYPTO_RNG=m
1730CONFIG_CRYPTO_RNG2=y 2099CONFIG_CRYPTO_RNG2=y
1731CONFIG_CRYPTO_PCOMP=y 2100CONFIG_CRYPTO_PCOMP=y
1732CONFIG_CRYPTO_MANAGER=y 2101CONFIG_CRYPTO_MANAGER=m
1733CONFIG_CRYPTO_MANAGER2=y 2102CONFIG_CRYPTO_MANAGER2=y
1734# CONFIG_CRYPTO_GF128MUL is not set 2103CONFIG_CRYPTO_GF128MUL=m
1735# CONFIG_CRYPTO_NULL is not set 2104CONFIG_CRYPTO_NULL=m
1736CONFIG_CRYPTO_WORKQUEUE=y 2105CONFIG_CRYPTO_WORKQUEUE=y
1737# CONFIG_CRYPTO_CRYPTD is not set 2106CONFIG_CRYPTO_CRYPTD=m
1738# CONFIG_CRYPTO_AUTHENC is not set 2107CONFIG_CRYPTO_AUTHENC=m
1739# CONFIG_CRYPTO_TEST is not set 2108CONFIG_CRYPTO_TEST=m
1740 2109
1741# 2110#
1742# Authenticated Encryption with Associated Data 2111# Authenticated Encryption with Associated Data
1743# 2112#
1744# CONFIG_CRYPTO_CCM is not set 2113CONFIG_CRYPTO_CCM=m
1745# CONFIG_CRYPTO_GCM is not set 2114CONFIG_CRYPTO_GCM=m
1746# CONFIG_CRYPTO_SEQIV is not set 2115CONFIG_CRYPTO_SEQIV=m
1747 2116
1748# 2117#
1749# Block modes 2118# Block modes
1750# 2119#
1751CONFIG_CRYPTO_CBC=y 2120CONFIG_CRYPTO_CBC=m
1752# CONFIG_CRYPTO_CTR is not set 2121CONFIG_CRYPTO_CTR=m
1753# CONFIG_CRYPTO_CTS is not set 2122# CONFIG_CRYPTO_CTS is not set
1754# CONFIG_CRYPTO_ECB is not set 2123CONFIG_CRYPTO_ECB=m
1755# CONFIG_CRYPTO_LRW is not set 2124CONFIG_CRYPTO_LRW=m
1756# CONFIG_CRYPTO_PCBC is not set 2125CONFIG_CRYPTO_PCBC=m
1757# CONFIG_CRYPTO_XTS is not set 2126CONFIG_CRYPTO_XTS=m
1758 2127
1759# 2128#
1760# Hash modes 2129# Hash modes
1761# 2130#
1762# CONFIG_CRYPTO_HMAC is not set 2131CONFIG_CRYPTO_HMAC=m
1763# CONFIG_CRYPTO_XCBC is not set 2132CONFIG_CRYPTO_XCBC=m
1764# CONFIG_CRYPTO_VMAC is not set 2133# CONFIG_CRYPTO_VMAC is not set
1765 2134
1766# 2135#
1767# Digest 2136# Digest
1768# 2137#
1769# CONFIG_CRYPTO_CRC32C is not set 2138CONFIG_CRYPTO_CRC32C=m
1770# CONFIG_CRYPTO_GHASH is not set 2139CONFIG_CRYPTO_GHASH=m
1771# CONFIG_CRYPTO_MD4 is not set 2140CONFIG_CRYPTO_MD4=m
1772# CONFIG_CRYPTO_MD5 is not set 2141CONFIG_CRYPTO_MD5=y
1773# CONFIG_CRYPTO_MICHAEL_MIC is not set 2142CONFIG_CRYPTO_MICHAEL_MIC=m
1774# CONFIG_CRYPTO_RMD128 is not set 2143CONFIG_CRYPTO_RMD128=m
1775# CONFIG_CRYPTO_RMD160 is not set 2144CONFIG_CRYPTO_RMD160=m
1776# CONFIG_CRYPTO_RMD256 is not set 2145CONFIG_CRYPTO_RMD256=m
1777# CONFIG_CRYPTO_RMD320 is not set 2146CONFIG_CRYPTO_RMD320=m
1778# CONFIG_CRYPTO_SHA1 is not set 2147CONFIG_CRYPTO_SHA1=m
1779# CONFIG_CRYPTO_SHA256 is not set 2148CONFIG_CRYPTO_SHA256=m
1780# CONFIG_CRYPTO_SHA512 is not set 2149CONFIG_CRYPTO_SHA512=m
1781# CONFIG_CRYPTO_TGR192 is not set 2150CONFIG_CRYPTO_TGR192=m
1782# CONFIG_CRYPTO_WP512 is not set 2151CONFIG_CRYPTO_WP512=m
1783 2152
1784# 2153#
1785# Ciphers 2154# Ciphers
1786# 2155#
1787# CONFIG_CRYPTO_AES is not set 2156CONFIG_CRYPTO_AES=m
1788# CONFIG_CRYPTO_ANUBIS is not set 2157CONFIG_CRYPTO_ANUBIS=m
1789# CONFIG_CRYPTO_ARC4 is not set 2158CONFIG_CRYPTO_ARC4=m
1790# CONFIG_CRYPTO_BLOWFISH is not set 2159CONFIG_CRYPTO_BLOWFISH=m
1791# CONFIG_CRYPTO_CAMELLIA is not set 2160CONFIG_CRYPTO_CAMELLIA=m
1792# CONFIG_CRYPTO_CAST5 is not set 2161CONFIG_CRYPTO_CAST5=m
1793# CONFIG_CRYPTO_CAST6 is not set 2162CONFIG_CRYPTO_CAST6=m
1794# CONFIG_CRYPTO_DES is not set 2163CONFIG_CRYPTO_DES=m
1795# CONFIG_CRYPTO_FCRYPT is not set 2164CONFIG_CRYPTO_FCRYPT=m
1796# CONFIG_CRYPTO_KHAZAD is not set 2165CONFIG_CRYPTO_KHAZAD=m
1797# CONFIG_CRYPTO_SALSA20 is not set 2166CONFIG_CRYPTO_SALSA20=m
1798# CONFIG_CRYPTO_SEED is not set 2167CONFIG_CRYPTO_SEED=m
1799# CONFIG_CRYPTO_SERPENT is not set 2168CONFIG_CRYPTO_SERPENT=m
1800# CONFIG_CRYPTO_TEA is not set 2169CONFIG_CRYPTO_TEA=m
1801# CONFIG_CRYPTO_TWOFISH is not set 2170CONFIG_CRYPTO_TWOFISH=m
2171CONFIG_CRYPTO_TWOFISH_COMMON=m
1802 2172
1803# 2173#
1804# Compression 2174# Compression
1805# 2175#
1806# CONFIG_CRYPTO_DEFLATE is not set 2176CONFIG_CRYPTO_DEFLATE=m
1807# CONFIG_CRYPTO_ZLIB is not set 2177CONFIG_CRYPTO_ZLIB=m
1808# CONFIG_CRYPTO_LZO is not set 2178CONFIG_CRYPTO_LZO=m
1809 2179
1810# 2180#
1811# Random Number Generation 2181# Random Number Generation
1812# 2182#
1813# CONFIG_CRYPTO_ANSI_CPRNG is not set 2183CONFIG_CRYPTO_ANSI_CPRNG=m
1814CONFIG_CRYPTO_HW=y 2184CONFIG_CRYPTO_HW=y
1815# CONFIG_CRYPTO_DEV_HIFN_795X is not set 2185# CONFIG_CRYPTO_DEV_HIFN_795X is not set
1816# CONFIG_BINARY_PRINTF is not set 2186CONFIG_BINARY_PRINTF=y
1817 2187
1818# 2188#
1819# Library routines 2189# Library routines
@@ -1821,14 +2191,20 @@ CONFIG_CRYPTO_HW=y
1821CONFIG_BITREVERSE=y 2191CONFIG_BITREVERSE=y
1822CONFIG_GENERIC_FIND_LAST_BIT=y 2192CONFIG_GENERIC_FIND_LAST_BIT=y
1823# CONFIG_CRC_CCITT is not set 2193# CONFIG_CRC_CCITT is not set
1824# CONFIG_CRC16 is not set 2194CONFIG_CRC16=y
1825CONFIG_CRC_T10DIF=y 2195CONFIG_CRC_T10DIF=y
1826# CONFIG_CRC_ITU_T is not set 2196# CONFIG_CRC_ITU_T is not set
1827CONFIG_CRC32=y 2197CONFIG_CRC32=y
1828# CONFIG_CRC7 is not set 2198# CONFIG_CRC7 is not set
1829# CONFIG_LIBCRC32C is not set 2199CONFIG_LIBCRC32C=m
1830CONFIG_AUDIT_GENERIC=y 2200CONFIG_AUDIT_GENERIC=y
1831CONFIG_ZLIB_INFLATE=m 2201CONFIG_ZLIB_INFLATE=y
2202CONFIG_ZLIB_DEFLATE=m
2203CONFIG_LZO_COMPRESS=m
2204CONFIG_LZO_DECOMPRESS=m
2205CONFIG_DECOMPRESS_GZIP=y
2206CONFIG_DECOMPRESS_BZIP2=y
2207CONFIG_DECOMPRESS_LZMA=y
1832CONFIG_HAS_IOMEM=y 2208CONFIG_HAS_IOMEM=y
1833CONFIG_HAS_IOPORT=y 2209CONFIG_HAS_IOPORT=y
1834CONFIG_HAS_DMA=y 2210CONFIG_HAS_DMA=y
diff --git a/arch/mips/configs/pb1100_defconfig b/arch/mips/configs/pb1100_defconfig
index ddf67f639194..97382b698b9b 100644
--- a/arch/mips/configs/pb1100_defconfig
+++ b/arch/mips/configs/pb1100_defconfig
@@ -1,79 +1,103 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.20 3# Linux kernel version: 2.6.33
4# Tue Feb 20 21:47:37 2007 4# Fri Feb 26 09:53:29 2010
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
8# 8#
9# Machine selection 9# Machine selection
10# 10#
11CONFIG_ZONE_DMA=y
12CONFIG_MACH_ALCHEMY=y 11CONFIG_MACH_ALCHEMY=y
13# CONFIG_MIPS_MTX1 is not set 12# CONFIG_AR7 is not set
14# CONFIG_MIPS_BOSPORUS is not set 13# CONFIG_BCM47XX is not set
15# CONFIG_MIPS_PB1000 is not set 14# CONFIG_BCM63XX is not set
16CONFIG_MIPS_PB1100=y
17# CONFIG_MIPS_PB1500 is not set
18# CONFIG_MIPS_PB1550 is not set
19# CONFIG_MIPS_PB1200 is not set
20# CONFIG_MIPS_DB1000 is not set
21# CONFIG_MIPS_DB1100 is not set
22# CONFIG_MIPS_DB1500 is not set
23# CONFIG_MIPS_DB1550 is not set
24# CONFIG_MIPS_DB1200 is not set
25# CONFIG_MIPS_MIRAGE is not set
26# CONFIG_MIPS_COBALT is not set 15# CONFIG_MIPS_COBALT is not set
27# CONFIG_MACH_DECSTATION is not set 16# CONFIG_MACH_DECSTATION is not set
28# CONFIG_MACH_JAZZ is not set 17# CONFIG_MACH_JAZZ is not set
18# CONFIG_LASAT is not set
19# CONFIG_MACH_LOONGSON is not set
29# CONFIG_MIPS_MALTA is not set 20# CONFIG_MIPS_MALTA is not set
30# CONFIG_WR_PPMC is not set
31# CONFIG_MIPS_SIM is not set 21# CONFIG_MIPS_SIM is not set
32# CONFIG_MOMENCO_JAGUAR_ATX is not set 22# CONFIG_NEC_MARKEINS is not set
33# CONFIG_MIPS_XXS1500 is not set 23# CONFIG_MACH_VR41XX is not set
24# CONFIG_NXP_STB220 is not set
25# CONFIG_NXP_STB225 is not set
34# CONFIG_PNX8550_JBS is not set 26# CONFIG_PNX8550_JBS is not set
35# CONFIG_PNX8550_STB810 is not set 27# CONFIG_PNX8550_STB810 is not set
36# CONFIG_MACH_VR41XX is not set 28# CONFIG_PMC_MSP is not set
37# CONFIG_PMC_YOSEMITE is not set 29# CONFIG_PMC_YOSEMITE is not set
38# CONFIG_MARKEINS is not set 30# CONFIG_POWERTV is not set
39# CONFIG_SGI_IP22 is not set 31# CONFIG_SGI_IP22 is not set
40# CONFIG_SGI_IP27 is not set 32# CONFIG_SGI_IP27 is not set
33# CONFIG_SGI_IP28 is not set
41# CONFIG_SGI_IP32 is not set 34# CONFIG_SGI_IP32 is not set
42# CONFIG_SIBYTE_BIGSUR is not set
43# CONFIG_SIBYTE_SWARM is not set
44# CONFIG_SIBYTE_SENTOSA is not set
45# CONFIG_SIBYTE_RHONE is not set
46# CONFIG_SIBYTE_CARMEL is not set
47# CONFIG_SIBYTE_LITTLESUR is not set
48# CONFIG_SIBYTE_CRHINE is not set 35# CONFIG_SIBYTE_CRHINE is not set
36# CONFIG_SIBYTE_CARMEL is not set
49# CONFIG_SIBYTE_CRHONE is not set 37# CONFIG_SIBYTE_CRHONE is not set
38# CONFIG_SIBYTE_RHONE is not set
39# CONFIG_SIBYTE_SWARM is not set
40# CONFIG_SIBYTE_LITTLESUR is not set
41# CONFIG_SIBYTE_SENTOSA is not set
42# CONFIG_SIBYTE_BIGSUR is not set
50# CONFIG_SNI_RM is not set 43# CONFIG_SNI_RM is not set
51# CONFIG_TOSHIBA_JMR3927 is not set 44# CONFIG_MACH_TX39XX is not set
52# CONFIG_TOSHIBA_RBTX4927 is not set 45# CONFIG_MACH_TX49XX is not set
53# CONFIG_TOSHIBA_RBTX4938 is not set 46# CONFIG_MIKROTIK_RB532 is not set
47# CONFIG_WR_PPMC is not set
48# CONFIG_CAVIUM_OCTEON_SIMULATOR is not set
49# CONFIG_CAVIUM_OCTEON_REFERENCE_BOARD is not set
50CONFIG_ALCHEMY_GPIOINT_AU1000=y
51# CONFIG_ALCHEMY_GPIO_INDIRECT is not set
52# CONFIG_MIPS_MTX1 is not set
53# CONFIG_MIPS_BOSPORUS is not set
54# CONFIG_MIPS_DB1000 is not set
55# CONFIG_MIPS_DB1100 is not set
56# CONFIG_MIPS_DB1200 is not set
57# CONFIG_MIPS_DB1500 is not set
58# CONFIG_MIPS_DB1550 is not set
59# CONFIG_MIPS_MIRAGE is not set
60# CONFIG_MIPS_PB1000 is not set
61CONFIG_MIPS_PB1100=y
62# CONFIG_MIPS_PB1200 is not set
63# CONFIG_MIPS_PB1500 is not set
64# CONFIG_MIPS_PB1550 is not set
65# CONFIG_MIPS_XXS1500 is not set
66CONFIG_SOC_AU1100=y
67CONFIG_SOC_AU1X00=y
68CONFIG_LOONGSON_UART_BASE=y
54CONFIG_RWSEM_GENERIC_SPINLOCK=y 69CONFIG_RWSEM_GENERIC_SPINLOCK=y
55# CONFIG_ARCH_HAS_ILOG2_U32 is not set 70# CONFIG_ARCH_HAS_ILOG2_U32 is not set
56# CONFIG_ARCH_HAS_ILOG2_U64 is not set 71# CONFIG_ARCH_HAS_ILOG2_U64 is not set
72CONFIG_ARCH_SUPPORTS_OPROFILE=y
57CONFIG_GENERIC_FIND_NEXT_BIT=y 73CONFIG_GENERIC_FIND_NEXT_BIT=y
58CONFIG_GENERIC_HWEIGHT=y 74CONFIG_GENERIC_HWEIGHT=y
59CONFIG_GENERIC_CALIBRATE_DELAY=y 75CONFIG_GENERIC_CALIBRATE_DELAY=y
76CONFIG_GENERIC_CLOCKEVENTS=y
60CONFIG_GENERIC_TIME=y 77CONFIG_GENERIC_TIME=y
61CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y 78CONFIG_GENERIC_CMOS_UPDATE=y
62# CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ is not set 79CONFIG_SCHED_OMIT_FRAME_POINTER=y
80CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
81CONFIG_CEVT_R4K_LIB=y
82CONFIG_CSRC_R4K_LIB=y
63CONFIG_DMA_NONCOHERENT=y 83CONFIG_DMA_NONCOHERENT=y
64CONFIG_DMA_NEED_PCI_MAP_STATE=y 84CONFIG_DMA_NEED_PCI_MAP_STATE=y
85CONFIG_SYS_HAS_EARLY_PRINTK=y
86# CONFIG_NO_IOPORT is not set
87CONFIG_GENERIC_GPIO=y
65# CONFIG_CPU_BIG_ENDIAN is not set 88# CONFIG_CPU_BIG_ENDIAN is not set
66CONFIG_CPU_LITTLE_ENDIAN=y 89CONFIG_CPU_LITTLE_ENDIAN=y
67CONFIG_SYS_SUPPORTS_APM_EMULATION=y 90CONFIG_SYS_SUPPORTS_APM_EMULATION=y
68CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y 91CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
69CONFIG_SOC_AU1100=y 92CONFIG_IRQ_CPU=y
70CONFIG_SOC_AU1X00=y
71CONFIG_SWAP_IO_SPACE=y 93CONFIG_SWAP_IO_SPACE=y
72CONFIG_MIPS_L1_CACHE_SHIFT=5 94CONFIG_MIPS_L1_CACHE_SHIFT=5
73 95
74# 96#
75# CPU selection 97# CPU selection
76# 98#
99# CONFIG_CPU_LOONGSON2E is not set
100# CONFIG_CPU_LOONGSON2F is not set
77CONFIG_CPU_MIPS32_R1=y 101CONFIG_CPU_MIPS32_R1=y
78# CONFIG_CPU_MIPS32_R2 is not set 102# CONFIG_CPU_MIPS32_R2 is not set
79# CONFIG_CPU_MIPS64_R1 is not set 103# CONFIG_CPU_MIPS64_R1 is not set
@@ -86,6 +110,7 @@ CONFIG_CPU_MIPS32_R1=y
86# CONFIG_CPU_TX49XX is not set 110# CONFIG_CPU_TX49XX is not set
87# CONFIG_CPU_R5000 is not set 111# CONFIG_CPU_R5000 is not set
88# CONFIG_CPU_R5432 is not set 112# CONFIG_CPU_R5432 is not set
113# CONFIG_CPU_R5500 is not set
89# CONFIG_CPU_R6000 is not set 114# CONFIG_CPU_R6000 is not set
90# CONFIG_CPU_NEVADA is not set 115# CONFIG_CPU_NEVADA is not set
91# CONFIG_CPU_R8000 is not set 116# CONFIG_CPU_R8000 is not set
@@ -93,11 +118,14 @@ CONFIG_CPU_MIPS32_R1=y
93# CONFIG_CPU_RM7000 is not set 118# CONFIG_CPU_RM7000 is not set
94# CONFIG_CPU_RM9000 is not set 119# CONFIG_CPU_RM9000 is not set
95# CONFIG_CPU_SB1 is not set 120# CONFIG_CPU_SB1 is not set
121# CONFIG_CPU_CAVIUM_OCTEON is not set
122CONFIG_SYS_SUPPORTS_ZBOOT=y
96CONFIG_SYS_HAS_CPU_MIPS32_R1=y 123CONFIG_SYS_HAS_CPU_MIPS32_R1=y
97CONFIG_CPU_MIPS32=y 124CONFIG_CPU_MIPS32=y
98CONFIG_CPU_MIPSR1=y 125CONFIG_CPU_MIPSR1=y
99CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y 126CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
100CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y 127CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
128CONFIG_HARDWARE_WATCHPOINTS=y
101 129
102# 130#
103# Kernel type 131# Kernel type
@@ -107,184 +135,244 @@ CONFIG_32BIT=y
107CONFIG_PAGE_SIZE_4KB=y 135CONFIG_PAGE_SIZE_4KB=y
108# CONFIG_PAGE_SIZE_8KB is not set 136# CONFIG_PAGE_SIZE_8KB is not set
109# CONFIG_PAGE_SIZE_16KB is not set 137# CONFIG_PAGE_SIZE_16KB is not set
138# CONFIG_PAGE_SIZE_32KB is not set
110# CONFIG_PAGE_SIZE_64KB is not set 139# CONFIG_PAGE_SIZE_64KB is not set
111CONFIG_CPU_HAS_PREFETCH=y 140CONFIG_CPU_HAS_PREFETCH=y
112CONFIG_MIPS_MT_DISABLED=y 141CONFIG_MIPS_MT_DISABLED=y
113# CONFIG_MIPS_MT_SMP is not set 142# CONFIG_MIPS_MT_SMP is not set
114# CONFIG_MIPS_MT_SMTC is not set 143# CONFIG_MIPS_MT_SMTC is not set
115# CONFIG_MIPS_VPE_LOADER is not set
116CONFIG_64BIT_PHYS_ADDR=y 144CONFIG_64BIT_PHYS_ADDR=y
145CONFIG_ARCH_PHYS_ADDR_T_64BIT=y
117CONFIG_CPU_HAS_SYNC=y 146CONFIG_CPU_HAS_SYNC=y
118CONFIG_GENERIC_HARDIRQS=y 147CONFIG_GENERIC_HARDIRQS=y
119CONFIG_GENERIC_IRQ_PROBE=y 148CONFIG_GENERIC_IRQ_PROBE=y
120CONFIG_CPU_SUPPORTS_HIGHMEM=y 149CONFIG_CPU_SUPPORTS_HIGHMEM=y
121CONFIG_ARCH_FLATMEM_ENABLE=y 150CONFIG_ARCH_FLATMEM_ENABLE=y
151CONFIG_ARCH_POPULATES_NODE_MAP=y
122CONFIG_SELECT_MEMORY_MODEL=y 152CONFIG_SELECT_MEMORY_MODEL=y
123CONFIG_FLATMEM_MANUAL=y 153CONFIG_FLATMEM_MANUAL=y
124# CONFIG_DISCONTIGMEM_MANUAL is not set 154# CONFIG_DISCONTIGMEM_MANUAL is not set
125# CONFIG_SPARSEMEM_MANUAL is not set 155# CONFIG_SPARSEMEM_MANUAL is not set
126CONFIG_FLATMEM=y 156CONFIG_FLATMEM=y
127CONFIG_FLAT_NODE_MEM_MAP=y 157CONFIG_FLAT_NODE_MEM_MAP=y
128# CONFIG_SPARSEMEM_STATIC is not set 158CONFIG_PAGEFLAGS_EXTENDED=y
129CONFIG_SPLIT_PTLOCK_CPUS=4 159CONFIG_SPLIT_PTLOCK_CPUS=4
130# CONFIG_RESOURCES_64BIT is not set 160CONFIG_PHYS_ADDR_T_64BIT=y
131CONFIG_ZONE_DMA_FLAG=1 161CONFIG_ZONE_DMA_FLAG=0
162CONFIG_VIRT_TO_BUS=y
163# CONFIG_KSM is not set
164CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
165CONFIG_TICK_ONESHOT=y
166CONFIG_NO_HZ=y
167CONFIG_HIGH_RES_TIMERS=y
168CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
132# CONFIG_HZ_48 is not set 169# CONFIG_HZ_48 is not set
133# CONFIG_HZ_100 is not set 170CONFIG_HZ_100=y
134# CONFIG_HZ_128 is not set 171# CONFIG_HZ_128 is not set
135# CONFIG_HZ_250 is not set 172# CONFIG_HZ_250 is not set
136# CONFIG_HZ_256 is not set 173# CONFIG_HZ_256 is not set
137CONFIG_HZ_1000=y 174# CONFIG_HZ_1000 is not set
138# CONFIG_HZ_1024 is not set 175# CONFIG_HZ_1024 is not set
139CONFIG_SYS_SUPPORTS_ARBIT_HZ=y 176CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
140CONFIG_HZ=1000 177CONFIG_HZ=100
141CONFIG_PREEMPT_NONE=y 178CONFIG_PREEMPT_NONE=y
142# CONFIG_PREEMPT_VOLUNTARY is not set 179# CONFIG_PREEMPT_VOLUNTARY is not set
143# CONFIG_PREEMPT is not set 180# CONFIG_PREEMPT is not set
144# CONFIG_KEXEC is not set 181# CONFIG_KEXEC is not set
182# CONFIG_SECCOMP is not set
145CONFIG_LOCKDEP_SUPPORT=y 183CONFIG_LOCKDEP_SUPPORT=y
146CONFIG_STACKTRACE_SUPPORT=y 184CONFIG_STACKTRACE_SUPPORT=y
147CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 185CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
186CONFIG_CONSTRUCTORS=y
148 187
149# 188#
150# Code maturity level options 189# General setup
151# 190#
152CONFIG_EXPERIMENTAL=y 191CONFIG_EXPERIMENTAL=y
153CONFIG_BROKEN_ON_SMP=y 192CONFIG_BROKEN_ON_SMP=y
154CONFIG_INIT_ENV_ARG_LIMIT=32 193CONFIG_INIT_ENV_ARG_LIMIT=32
155 194CONFIG_LOCALVERSION="-pb1100"
156#
157# General setup
158#
159CONFIG_LOCALVERSION=""
160CONFIG_LOCALVERSION_AUTO=y 195CONFIG_LOCALVERSION_AUTO=y
196CONFIG_HAVE_KERNEL_GZIP=y
197CONFIG_HAVE_KERNEL_BZIP2=y
198CONFIG_HAVE_KERNEL_LZMA=y
199CONFIG_HAVE_KERNEL_LZO=y
200# CONFIG_KERNEL_GZIP is not set
201# CONFIG_KERNEL_BZIP2 is not set
202CONFIG_KERNEL_LZMA=y
203# CONFIG_KERNEL_LZO is not set
161CONFIG_SWAP=y 204CONFIG_SWAP=y
162CONFIG_SYSVIPC=y 205CONFIG_SYSVIPC=y
163# CONFIG_IPC_NS is not set
164CONFIG_SYSVIPC_SYSCTL=y 206CONFIG_SYSVIPC_SYSCTL=y
165# CONFIG_POSIX_MQUEUE is not set 207CONFIG_POSIX_MQUEUE=y
208CONFIG_POSIX_MQUEUE_SYSCTL=y
166# CONFIG_BSD_PROCESS_ACCT is not set 209# CONFIG_BSD_PROCESS_ACCT is not set
167# CONFIG_TASKSTATS is not set 210# CONFIG_TASKSTATS is not set
168# CONFIG_UTS_NS is not set
169# CONFIG_AUDIT is not set 211# CONFIG_AUDIT is not set
212
213#
214# RCU Subsystem
215#
216# CONFIG_TREE_RCU is not set
217# CONFIG_TREE_PREEMPT_RCU is not set
218CONFIG_TINY_RCU=y
219# CONFIG_TREE_RCU_TRACE is not set
170# CONFIG_IKCONFIG is not set 220# CONFIG_IKCONFIG is not set
171CONFIG_SYSFS_DEPRECATED=y 221CONFIG_LOG_BUF_SHIFT=14
172CONFIG_RELAY=y 222# CONFIG_GROUP_SCHED is not set
173# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 223# CONFIG_CGROUPS is not set
224# CONFIG_SYSFS_DEPRECATED_V2 is not set
225# CONFIG_RELAY is not set
226# CONFIG_NAMESPACES is not set
227# CONFIG_BLK_DEV_INITRD is not set
228CONFIG_CC_OPTIMIZE_FOR_SIZE=y
174CONFIG_SYSCTL=y 229CONFIG_SYSCTL=y
230CONFIG_ANON_INODES=y
175CONFIG_EMBEDDED=y 231CONFIG_EMBEDDED=y
176CONFIG_SYSCTL_SYSCALL=y 232# CONFIG_SYSCTL_SYSCALL is not set
177CONFIG_KALLSYMS=y 233# CONFIG_KALLSYMS is not set
178# CONFIG_KALLSYMS_EXTRA_PASS is not set
179CONFIG_HOTPLUG=y 234CONFIG_HOTPLUG=y
180CONFIG_PRINTK=y 235CONFIG_PRINTK=y
181CONFIG_BUG=y 236CONFIG_BUG=y
182CONFIG_ELF_CORE=y 237CONFIG_ELF_CORE=y
238# CONFIG_PCSPKR_PLATFORM is not set
183CONFIG_BASE_FULL=y 239CONFIG_BASE_FULL=y
184CONFIG_FUTEX=y 240CONFIG_FUTEX=y
185CONFIG_EPOLL=y 241CONFIG_EPOLL=y
242CONFIG_SIGNALFD=y
243CONFIG_TIMERFD=y
244CONFIG_EVENTFD=y
186CONFIG_SHMEM=y 245CONFIG_SHMEM=y
246CONFIG_AIO=y
247
248#
249# Kernel Performance Events And Counters
250#
251# CONFIG_VM_EVENT_COUNTERS is not set
252# CONFIG_COMPAT_BRK is not set
187CONFIG_SLAB=y 253CONFIG_SLAB=y
188CONFIG_VM_EVENT_COUNTERS=y 254# CONFIG_SLUB is not set
189CONFIG_RT_MUTEXES=y
190# CONFIG_TINY_SHMEM is not set
191CONFIG_BASE_SMALL=0
192# CONFIG_SLOB is not set 255# CONFIG_SLOB is not set
256# CONFIG_PROFILING is not set
257CONFIG_HAVE_OPROFILE=y
193 258
194# 259#
195# Loadable module support 260# GCOV-based kernel profiling
196# 261#
262# CONFIG_SLOW_WORK is not set
263CONFIG_HAVE_GENERIC_DMA_COHERENT=y
264CONFIG_SLABINFO=y
265CONFIG_RT_MUTEXES=y
266CONFIG_BASE_SMALL=0
197CONFIG_MODULES=y 267CONFIG_MODULES=y
268# CONFIG_MODULE_FORCE_LOAD is not set
198CONFIG_MODULE_UNLOAD=y 269CONFIG_MODULE_UNLOAD=y
199# CONFIG_MODULE_FORCE_UNLOAD is not set 270# CONFIG_MODULE_FORCE_UNLOAD is not set
200CONFIG_MODVERSIONS=y 271# CONFIG_MODVERSIONS is not set
201CONFIG_MODULE_SRCVERSION_ALL=y 272# CONFIG_MODULE_SRCVERSION_ALL is not set
202CONFIG_KMOD=y
203
204#
205# Block layer
206#
207CONFIG_BLOCK=y 273CONFIG_BLOCK=y
208# CONFIG_LBD is not set 274# CONFIG_LBDAF is not set
209# CONFIG_BLK_DEV_IO_TRACE is not set 275# CONFIG_BLK_DEV_BSG is not set
210# CONFIG_LSF is not set 276# CONFIG_BLK_DEV_INTEGRITY is not set
211 277
212# 278#
213# IO Schedulers 279# IO Schedulers
214# 280#
215CONFIG_IOSCHED_NOOP=y 281CONFIG_IOSCHED_NOOP=y
216CONFIG_IOSCHED_AS=y 282# CONFIG_IOSCHED_DEADLINE is not set
217CONFIG_IOSCHED_DEADLINE=y 283# CONFIG_IOSCHED_CFQ is not set
218CONFIG_IOSCHED_CFQ=y
219CONFIG_DEFAULT_AS=y
220# CONFIG_DEFAULT_DEADLINE is not set 284# CONFIG_DEFAULT_DEADLINE is not set
221# CONFIG_DEFAULT_CFQ is not set 285# CONFIG_DEFAULT_CFQ is not set
222# CONFIG_DEFAULT_NOOP is not set 286CONFIG_DEFAULT_NOOP=y
223CONFIG_DEFAULT_IOSCHED="anticipatory" 287CONFIG_DEFAULT_IOSCHED="noop"
288# CONFIG_INLINE_SPIN_TRYLOCK is not set
289# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set
290# CONFIG_INLINE_SPIN_LOCK is not set
291# CONFIG_INLINE_SPIN_LOCK_BH is not set
292# CONFIG_INLINE_SPIN_LOCK_IRQ is not set
293# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set
294CONFIG_INLINE_SPIN_UNLOCK=y
295# CONFIG_INLINE_SPIN_UNLOCK_BH is not set
296CONFIG_INLINE_SPIN_UNLOCK_IRQ=y
297# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set
298# CONFIG_INLINE_READ_TRYLOCK is not set
299# CONFIG_INLINE_READ_LOCK is not set
300# CONFIG_INLINE_READ_LOCK_BH is not set
301# CONFIG_INLINE_READ_LOCK_IRQ is not set
302# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set
303CONFIG_INLINE_READ_UNLOCK=y
304# CONFIG_INLINE_READ_UNLOCK_BH is not set
305CONFIG_INLINE_READ_UNLOCK_IRQ=y
306# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set
307# CONFIG_INLINE_WRITE_TRYLOCK is not set
308# CONFIG_INLINE_WRITE_LOCK is not set
309# CONFIG_INLINE_WRITE_LOCK_BH is not set
310# CONFIG_INLINE_WRITE_LOCK_IRQ is not set
311# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set
312CONFIG_INLINE_WRITE_UNLOCK=y
313# CONFIG_INLINE_WRITE_UNLOCK_BH is not set
314CONFIG_INLINE_WRITE_UNLOCK_IRQ=y
315# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set
316# CONFIG_MUTEX_SPIN_ON_OWNER is not set
317CONFIG_FREEZER=y
224 318
225# 319#
226# Bus options (PCI, PCMCIA, EISA, ISA, TC) 320# Bus options (PCI, PCMCIA, EISA, ISA, TC)
227# 321#
228CONFIG_HW_HAS_PCI=y 322CONFIG_HW_HAS_PCI=y
229# CONFIG_PCI is not set 323# CONFIG_PCI is not set
324# CONFIG_ARCH_SUPPORTS_MSI is not set
230CONFIG_MMU=y 325CONFIG_MMU=y
231 326CONFIG_PCCARD=y
232# 327CONFIG_PCMCIA=y
233# PCCARD (PCMCIA/CardBus) support
234#
235CONFIG_PCCARD=m
236# CONFIG_PCMCIA_DEBUG is not set
237CONFIG_PCMCIA=m
238CONFIG_PCMCIA_LOAD_CIS=y 328CONFIG_PCMCIA_LOAD_CIS=y
239CONFIG_PCMCIA_IOCTL=y 329# CONFIG_PCMCIA_IOCTL is not set
240 330
241# 331#
242# PC-card bridges 332# PC-card bridges
243# 333#
244# CONFIG_PCMCIA_AU1X00 is not set 334# CONFIG_PCMCIA_AU1X00 is not set
245 335CONFIG_PCMCIA_ALCHEMY_DEVBOARD=y
246#
247# PCI Hotplug Support
248#
249 336
250# 337#
251# Executable file formats 338# Executable file formats
252# 339#
253CONFIG_BINFMT_ELF=y 340CONFIG_BINFMT_ELF=y
341# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
342# CONFIG_HAVE_AOUT is not set
254# CONFIG_BINFMT_MISC is not set 343# CONFIG_BINFMT_MISC is not set
255CONFIG_TRAD_SIGNALS=y 344CONFIG_TRAD_SIGNALS=y
256 345
257# 346#
258# Power management options 347# Power management options
259# 348#
260# CONFIG_PM is not set 349CONFIG_ARCH_HIBERNATION_POSSIBLE=y
261 350CONFIG_ARCH_SUSPEND_POSSIBLE=y
262# 351CONFIG_PM=y
263# Networking 352# CONFIG_PM_DEBUG is not set
264# 353CONFIG_PM_SLEEP=y
354CONFIG_SUSPEND=y
355CONFIG_SUSPEND_FREEZER=y
356# CONFIG_HIBERNATION is not set
357# CONFIG_APM_EMULATION is not set
358CONFIG_PM_RUNTIME=y
265CONFIG_NET=y 359CONFIG_NET=y
266 360
267# 361#
268# Networking options 362# Networking options
269# 363#
270# CONFIG_NETDEBUG is not set
271CONFIG_PACKET=y 364CONFIG_PACKET=y
272# CONFIG_PACKET_MMAP is not set 365# CONFIG_PACKET_MMAP is not set
273CONFIG_UNIX=y 366CONFIG_UNIX=y
274CONFIG_XFRM=y 367# CONFIG_NET_KEY is not set
275CONFIG_XFRM_USER=m
276# CONFIG_XFRM_SUB_POLICY is not set
277CONFIG_XFRM_MIGRATE=y
278CONFIG_NET_KEY=y
279CONFIG_NET_KEY_MIGRATE=y
280CONFIG_INET=y 368CONFIG_INET=y
281CONFIG_IP_MULTICAST=y 369CONFIG_IP_MULTICAST=y
282# CONFIG_IP_ADVANCED_ROUTER is not set 370# CONFIG_IP_ADVANCED_ROUTER is not set
283CONFIG_IP_FIB_HASH=y 371CONFIG_IP_FIB_HASH=y
284CONFIG_IP_PNP=y 372CONFIG_IP_PNP=y
285# CONFIG_IP_PNP_DHCP is not set 373CONFIG_IP_PNP_DHCP=y
286CONFIG_IP_PNP_BOOTP=y 374CONFIG_IP_PNP_BOOTP=y
287# CONFIG_IP_PNP_RARP is not set 375CONFIG_IP_PNP_RARP=y
288# CONFIG_NET_IPIP is not set 376# CONFIG_NET_IPIP is not set
289# CONFIG_NET_IPGRE is not set 377# CONFIG_NET_IPGRE is not set
290# CONFIG_IP_MROUTE is not set 378# CONFIG_IP_MROUTE is not set
@@ -295,110 +383,25 @@ CONFIG_IP_PNP_BOOTP=y
295# CONFIG_INET_IPCOMP is not set 383# CONFIG_INET_IPCOMP is not set
296# CONFIG_INET_XFRM_TUNNEL is not set 384# CONFIG_INET_XFRM_TUNNEL is not set
297# CONFIG_INET_TUNNEL is not set 385# CONFIG_INET_TUNNEL is not set
298CONFIG_INET_XFRM_MODE_TRANSPORT=m 386# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
299CONFIG_INET_XFRM_MODE_TUNNEL=m 387# CONFIG_INET_XFRM_MODE_TUNNEL is not set
300CONFIG_INET_XFRM_MODE_BEET=m 388# CONFIG_INET_XFRM_MODE_BEET is not set
301CONFIG_INET_DIAG=y 389CONFIG_INET_LRO=y
302CONFIG_INET_TCP_DIAG=y 390# CONFIG_INET_DIAG is not set
303# CONFIG_TCP_CONG_ADVANCED is not set 391# CONFIG_TCP_CONG_ADVANCED is not set
304CONFIG_TCP_CONG_CUBIC=y 392CONFIG_TCP_CONG_CUBIC=y
305CONFIG_DEFAULT_TCP_CONG="cubic" 393CONFIG_DEFAULT_TCP_CONG="cubic"
306CONFIG_TCP_MD5SIG=y 394# CONFIG_TCP_MD5SIG is not set
307
308#
309# IP: Virtual Server Configuration
310#
311# CONFIG_IP_VS is not set
312# CONFIG_IPV6 is not set 395# CONFIG_IPV6 is not set
313# CONFIG_INET6_XFRM_TUNNEL is not set 396# CONFIG_NETWORK_SECMARK is not set
314# CONFIG_INET6_TUNNEL is not set 397# CONFIG_NETFILTER is not set
315CONFIG_NETWORK_SECMARK=y
316CONFIG_NETFILTER=y
317# CONFIG_NETFILTER_DEBUG is not set
318
319#
320# Core Netfilter Configuration
321#
322CONFIG_NETFILTER_NETLINK=m
323CONFIG_NETFILTER_NETLINK_QUEUE=m
324CONFIG_NETFILTER_NETLINK_LOG=m
325CONFIG_NF_CONNTRACK_ENABLED=m
326CONFIG_NF_CONNTRACK_SUPPORT=y
327# CONFIG_IP_NF_CONNTRACK_SUPPORT is not set
328CONFIG_NF_CONNTRACK=m
329CONFIG_NF_CT_ACCT=y
330CONFIG_NF_CONNTRACK_MARK=y
331CONFIG_NF_CONNTRACK_SECMARK=y
332CONFIG_NF_CONNTRACK_EVENTS=y
333CONFIG_NF_CT_PROTO_GRE=m
334CONFIG_NF_CT_PROTO_SCTP=m
335CONFIG_NF_CONNTRACK_AMANDA=m
336CONFIG_NF_CONNTRACK_FTP=m
337CONFIG_NF_CONNTRACK_H323=m
338CONFIG_NF_CONNTRACK_IRC=m
339# CONFIG_NF_CONNTRACK_NETBIOS_NS is not set
340CONFIG_NF_CONNTRACK_PPTP=m
341CONFIG_NF_CONNTRACK_SANE=m
342CONFIG_NF_CONNTRACK_SIP=m
343CONFIG_NF_CONNTRACK_TFTP=m
344CONFIG_NF_CT_NETLINK=m
345CONFIG_NETFILTER_XTABLES=m
346CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
347CONFIG_NETFILTER_XT_TARGET_MARK=m
348CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
349CONFIG_NETFILTER_XT_TARGET_NFLOG=m
350CONFIG_NETFILTER_XT_TARGET_SECMARK=m
351CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=m
352CONFIG_NETFILTER_XT_TARGET_TCPMSS=m
353CONFIG_NETFILTER_XT_MATCH_COMMENT=m
354CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
355CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
356CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
357CONFIG_NETFILTER_XT_MATCH_DCCP=m
358CONFIG_NETFILTER_XT_MATCH_DSCP=m
359CONFIG_NETFILTER_XT_MATCH_ESP=m
360CONFIG_NETFILTER_XT_MATCH_HELPER=m
361CONFIG_NETFILTER_XT_MATCH_LENGTH=m
362CONFIG_NETFILTER_XT_MATCH_LIMIT=m
363CONFIG_NETFILTER_XT_MATCH_MAC=m
364CONFIG_NETFILTER_XT_MATCH_MARK=m
365CONFIG_NETFILTER_XT_MATCH_POLICY=m
366CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
367CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
368CONFIG_NETFILTER_XT_MATCH_QUOTA=m
369CONFIG_NETFILTER_XT_MATCH_REALM=m
370CONFIG_NETFILTER_XT_MATCH_SCTP=m
371CONFIG_NETFILTER_XT_MATCH_STATE=m
372CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
373CONFIG_NETFILTER_XT_MATCH_STRING=m
374CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
375CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
376
377#
378# IP: Netfilter Configuration
379#
380CONFIG_NF_CONNTRACK_IPV4=m
381CONFIG_NF_CONNTRACK_PROC_COMPAT=y
382# CONFIG_IP_NF_QUEUE is not set
383# CONFIG_IP_NF_IPTABLES is not set
384# CONFIG_IP_NF_ARPTABLES is not set
385
386#
387# DCCP Configuration (EXPERIMENTAL)
388#
389# CONFIG_IP_DCCP is not set 398# CONFIG_IP_DCCP is not set
390
391#
392# SCTP Configuration (EXPERIMENTAL)
393#
394# CONFIG_IP_SCTP is not set 399# CONFIG_IP_SCTP is not set
395 400# CONFIG_RDS is not set
396#
397# TIPC Configuration (EXPERIMENTAL)
398#
399# CONFIG_TIPC is not set 401# CONFIG_TIPC is not set
400# CONFIG_ATM is not set 402# CONFIG_ATM is not set
401# CONFIG_BRIDGE is not set 403# CONFIG_BRIDGE is not set
404# CONFIG_NET_DSA is not set
402# CONFIG_VLAN_8021Q is not set 405# CONFIG_VLAN_8021Q is not set
403# CONFIG_DECNET is not set 406# CONFIG_DECNET is not set
404# CONFIG_LLC2 is not set 407# CONFIG_LLC2 is not set
@@ -408,27 +411,24 @@ CONFIG_NF_CONNTRACK_PROC_COMPAT=y
408# CONFIG_LAPB is not set 411# CONFIG_LAPB is not set
409# CONFIG_ECONET is not set 412# CONFIG_ECONET is not set
410# CONFIG_WAN_ROUTER is not set 413# CONFIG_WAN_ROUTER is not set
411 414# CONFIG_PHONET is not set
412# 415# CONFIG_IEEE802154 is not set
413# QoS and/or fair queueing
414#
415# CONFIG_NET_SCHED is not set 416# CONFIG_NET_SCHED is not set
416CONFIG_NET_CLS_ROUTE=y 417# CONFIG_DCB is not set
417 418
418# 419#
419# Network testing 420# Network testing
420# 421#
421# CONFIG_NET_PKTGEN is not set 422# CONFIG_NET_PKTGEN is not set
422# CONFIG_HAMRADIO is not set 423# CONFIG_HAMRADIO is not set
424# CONFIG_CAN is not set
423# CONFIG_IRDA is not set 425# CONFIG_IRDA is not set
424# CONFIG_BT is not set 426# CONFIG_BT is not set
425CONFIG_IEEE80211=m 427# CONFIG_AF_RXRPC is not set
426# CONFIG_IEEE80211_DEBUG is not set 428# CONFIG_WIRELESS is not set
427CONFIG_IEEE80211_CRYPT_WEP=m 429# CONFIG_WIMAX is not set
428CONFIG_IEEE80211_CRYPT_CCMP=m 430# CONFIG_RFKILL is not set
429CONFIG_IEEE80211_SOFTMAC=m 431# CONFIG_NET_9P is not set
430# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set
431CONFIG_WIRELESS_EXT=y
432 432
433# 433#
434# Device Drivers 434# Device Drivers
@@ -437,25 +437,25 @@ CONFIG_WIRELESS_EXT=y
437# 437#
438# Generic Driver Options 438# Generic Driver Options
439# 439#
440CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
441# CONFIG_DEVTMPFS is not set
440CONFIG_STANDALONE=y 442CONFIG_STANDALONE=y
441CONFIG_PREVENT_FIRMWARE_BUILD=y 443CONFIG_PREVENT_FIRMWARE_BUILD=y
442CONFIG_FW_LOADER=m 444CONFIG_FW_LOADER=y
445CONFIG_FIRMWARE_IN_KERNEL=y
446CONFIG_EXTRA_FIRMWARE=""
447# CONFIG_DEBUG_DRIVER is not set
448# CONFIG_DEBUG_DEVRES is not set
443# CONFIG_SYS_HYPERVISOR is not set 449# CONFIG_SYS_HYPERVISOR is not set
444 450# CONFIG_CONNECTOR is not set
445#
446# Connector - unified userspace <-> kernelspace linker
447#
448CONFIG_CONNECTOR=m
449
450#
451# Memory Technology Devices (MTD)
452#
453CONFIG_MTD=y 451CONFIG_MTD=y
454# CONFIG_MTD_DEBUG is not set 452# CONFIG_MTD_DEBUG is not set
453# CONFIG_MTD_TESTS is not set
455# CONFIG_MTD_CONCAT is not set 454# CONFIG_MTD_CONCAT is not set
456CONFIG_MTD_PARTITIONS=y 455CONFIG_MTD_PARTITIONS=y
457# CONFIG_MTD_REDBOOT_PARTS is not set 456# CONFIG_MTD_REDBOOT_PARTS is not set
458# CONFIG_MTD_CMDLINE_PARTS is not set 457# CONFIG_MTD_CMDLINE_PARTS is not set
458# CONFIG_MTD_AR7_PARTS is not set
459 459
460# 460#
461# User Modules And Translation Layers 461# User Modules And Translation Layers
@@ -468,6 +468,7 @@ CONFIG_MTD_BLOCK=y
468# CONFIG_INFTL is not set 468# CONFIG_INFTL is not set
469# CONFIG_RFD_FTL is not set 469# CONFIG_RFD_FTL is not set
470# CONFIG_SSFDC is not set 470# CONFIG_SSFDC is not set
471# CONFIG_MTD_OOPS is not set
471 472
472# 473#
473# RAM/ROM/Flash chip drivers 474# RAM/ROM/Flash chip drivers
@@ -493,14 +494,13 @@ CONFIG_MTD_CFI_UTIL=y
493# CONFIG_MTD_RAM is not set 494# CONFIG_MTD_RAM is not set
494# CONFIG_MTD_ROM is not set 495# CONFIG_MTD_ROM is not set
495# CONFIG_MTD_ABSENT is not set 496# CONFIG_MTD_ABSENT is not set
496# CONFIG_MTD_OBSOLETE_CHIPS is not set
497 497
498# 498#
499# Mapping drivers for chip access 499# Mapping drivers for chip access
500# 500#
501# CONFIG_MTD_COMPLEX_MAPPINGS is not set 501# CONFIG_MTD_COMPLEX_MAPPINGS is not set
502# CONFIG_MTD_PHYSMAP is not set 502CONFIG_MTD_PHYSMAP=y
503CONFIG_MTD_ALCHEMY=y 503# CONFIG_MTD_PHYSMAP_COMPAT is not set
504# CONFIG_MTD_PLATRAM is not set 504# CONFIG_MTD_PLATRAM is not set
505 505
506# 506#
@@ -517,166 +517,136 @@ CONFIG_MTD_ALCHEMY=y
517# CONFIG_MTD_DOC2000 is not set 517# CONFIG_MTD_DOC2000 is not set
518# CONFIG_MTD_DOC2001 is not set 518# CONFIG_MTD_DOC2001 is not set
519# CONFIG_MTD_DOC2001PLUS is not set 519# CONFIG_MTD_DOC2001PLUS is not set
520
521#
522# NAND Flash Device Drivers
523#
524# CONFIG_MTD_NAND is not set 520# CONFIG_MTD_NAND is not set
525
526#
527# OneNAND Flash Device Drivers
528#
529# CONFIG_MTD_ONENAND is not set 521# CONFIG_MTD_ONENAND is not set
530 522
531# 523#
532# Parallel port support 524# LPDDR flash memory drivers
533# 525#
534# CONFIG_PARPORT is not set 526# CONFIG_MTD_LPDDR is not set
535 527
536# 528#
537# Plug and Play support 529# UBI - Unsorted block images
538#
539# CONFIG_PNPACPI is not set
540
541#
542# Block devices
543# 530#
531# CONFIG_MTD_UBI is not set
532# CONFIG_PARPORT is not set
533CONFIG_BLK_DEV=y
544# CONFIG_BLK_DEV_COW_COMMON is not set 534# CONFIG_BLK_DEV_COW_COMMON is not set
545CONFIG_BLK_DEV_LOOP=y 535CONFIG_BLK_DEV_LOOP=y
546# CONFIG_BLK_DEV_CRYPTOLOOP is not set 536# CONFIG_BLK_DEV_CRYPTOLOOP is not set
537
538#
539# DRBD disabled because PROC_FS, INET or CONNECTOR not selected
540#
547# CONFIG_BLK_DEV_NBD is not set 541# CONFIG_BLK_DEV_NBD is not set
542CONFIG_BLK_DEV_UB=y
548# CONFIG_BLK_DEV_RAM is not set 543# CONFIG_BLK_DEV_RAM is not set
549# CONFIG_BLK_DEV_INITRD is not set 544# CONFIG_CDROM_PKTCDVD is not set
550CONFIG_CDROM_PKTCDVD=m 545# CONFIG_ATA_OVER_ETH is not set
551CONFIG_CDROM_PKTCDVD_BUFFERS=8 546# CONFIG_BLK_DEV_HD is not set
552# CONFIG_CDROM_PKTCDVD_WCACHE is not set 547# CONFIG_MISC_DEVICES is not set
553CONFIG_ATA_OVER_ETH=m 548CONFIG_HAVE_IDE=y
549CONFIG_IDE=y
554 550
555# 551#
556# Misc devices 552# Please see Documentation/ide/ide.txt for help/info on IDE drives
557# 553#
554# CONFIG_BLK_DEV_IDE_SATA is not set
555CONFIG_IDE_GD=y
556CONFIG_IDE_GD_ATA=y
557# CONFIG_IDE_GD_ATAPI is not set
558CONFIG_BLK_DEV_IDECS=y
559# CONFIG_BLK_DEV_IDECD is not set
560# CONFIG_BLK_DEV_IDETAPE is not set
561CONFIG_IDE_TASK_IOCTL=y
562# CONFIG_IDE_PROC_FS is not set
558 563
559# 564#
560# ATA/ATAPI/MFM/RLL support 565# IDE chipset support/bugfixes
561# 566#
562# CONFIG_IDE is not set 567# CONFIG_IDE_GENERIC is not set
568# CONFIG_BLK_DEV_PLATFORM is not set
569# CONFIG_BLK_DEV_IDEDMA is not set
563 570
564# 571#
565# SCSI device support 572# SCSI device support
566# 573#
567CONFIG_RAID_ATTRS=m 574# CONFIG_RAID_ATTRS is not set
568# CONFIG_SCSI is not set 575# CONFIG_SCSI is not set
576# CONFIG_SCSI_DMA is not set
569# CONFIG_SCSI_NETLINK is not set 577# CONFIG_SCSI_NETLINK is not set
570
571#
572# Serial ATA (prod) and Parallel ATA (experimental) drivers
573#
574# CONFIG_ATA is not set 578# CONFIG_ATA is not set
575
576#
577# Multi-device support (RAID and LVM)
578#
579# CONFIG_MD is not set 579# CONFIG_MD is not set
580
581#
582# Fusion MPT device support
583#
584# CONFIG_FUSION is not set
585
586#
587# IEEE 1394 (FireWire) support
588#
589
590#
591# I2O device support
592#
593
594#
595# Network device support
596#
597CONFIG_NETDEVICES=y 580CONFIG_NETDEVICES=y
598# CONFIG_DUMMY is not set 581# CONFIG_DUMMY is not set
599# CONFIG_BONDING is not set 582# CONFIG_BONDING is not set
583# CONFIG_MACVLAN is not set
600# CONFIG_EQUALIZER is not set 584# CONFIG_EQUALIZER is not set
601# CONFIG_TUN is not set 585# CONFIG_TUN is not set
602 586# CONFIG_VETH is not set
603# 587CONFIG_PHYLIB=y
604# PHY device support
605#
606CONFIG_PHYLIB=m
607 588
608# 589#
609# MII PHY device drivers 590# MII PHY device drivers
610# 591#
611CONFIG_MARVELL_PHY=m 592CONFIG_MARVELL_PHY=y
612CONFIG_DAVICOM_PHY=m 593CONFIG_DAVICOM_PHY=y
613CONFIG_QSEMI_PHY=m 594CONFIG_QSEMI_PHY=y
614CONFIG_LXT_PHY=m 595CONFIG_LXT_PHY=y
615CONFIG_CICADA_PHY=m 596CONFIG_CICADA_PHY=y
616CONFIG_VITESSE_PHY=m 597CONFIG_VITESSE_PHY=y
617CONFIG_SMSC_PHY=m 598CONFIG_SMSC_PHY=y
618# CONFIG_BROADCOM_PHY is not set 599CONFIG_BROADCOM_PHY=y
600CONFIG_ICPLUS_PHY=y
601CONFIG_REALTEK_PHY=y
602CONFIG_NATIONAL_PHY=y
603CONFIG_STE10XP=y
604CONFIG_LSI_ET1011C_PHY=y
619# CONFIG_FIXED_PHY is not set 605# CONFIG_FIXED_PHY is not set
620 606# CONFIG_MDIO_BITBANG is not set
621#
622# Ethernet (10 or 100Mbit)
623#
624CONFIG_NET_ETHERNET=y 607CONFIG_NET_ETHERNET=y
625# CONFIG_MII is not set 608CONFIG_MII=y
626# CONFIG_MIPS_AU1X00_ENET is not set 609# CONFIG_AX88796 is not set
610CONFIG_MIPS_AU1X00_ENET=y
627# CONFIG_SMC91X is not set 611# CONFIG_SMC91X is not set
628# CONFIG_DM9000 is not set 612# CONFIG_DM9000 is not set
629 613# CONFIG_ETHOC is not set
630# 614# CONFIG_SMSC911X is not set
631# Ethernet (1000 Mbit) 615# CONFIG_DNET is not set
632# 616# CONFIG_IBM_NEW_EMAC_ZMII is not set
633 617# CONFIG_IBM_NEW_EMAC_RGMII is not set
634# 618# CONFIG_IBM_NEW_EMAC_TAH is not set
635# Ethernet (10000 Mbit) 619# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
636# 620# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
637 621# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
638# 622# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
639# Token Ring devices 623# CONFIG_B44 is not set
640# 624# CONFIG_KS8842 is not set
641 625# CONFIG_KS8851_MLL is not set
642# 626# CONFIG_NETDEV_1000 is not set
643# Wireless LAN (non-hamradio) 627# CONFIG_NETDEV_10000 is not set
644# 628# CONFIG_WLAN is not set
645# CONFIG_NET_RADIO is not set 629
646 630#
647# 631# Enable WiMAX (Networking options) to see the WiMAX drivers
648# PCMCIA network device support 632#
649# 633
634#
635# USB Network Adapters
636#
637# CONFIG_USB_CATC is not set
638# CONFIG_USB_KAWETH is not set
639# CONFIG_USB_PEGASUS is not set
640# CONFIG_USB_RTL8150 is not set
641# CONFIG_USB_USBNET is not set
650# CONFIG_NET_PCMCIA is not set 642# CONFIG_NET_PCMCIA is not set
651
652#
653# Wan interfaces
654#
655# CONFIG_WAN is not set 643# CONFIG_WAN is not set
656CONFIG_PPP=m 644# CONFIG_PPP is not set
657CONFIG_PPP_MULTILINK=y
658# CONFIG_PPP_FILTER is not set
659CONFIG_PPP_ASYNC=m
660# CONFIG_PPP_SYNC_TTY is not set
661CONFIG_PPP_DEFLATE=m
662# CONFIG_PPP_BSDCOMP is not set
663CONFIG_PPP_MPPE=m
664CONFIG_PPPOE=m
665# CONFIG_SLIP is not set 645# CONFIG_SLIP is not set
666CONFIG_SLHC=m
667# CONFIG_SHAPER is not set
668# CONFIG_NETCONSOLE is not set 646# CONFIG_NETCONSOLE is not set
669# CONFIG_NETPOLL is not set 647# CONFIG_NETPOLL is not set
670# CONFIG_NET_POLL_CONTROLLER is not set 648# CONFIG_NET_POLL_CONTROLLER is not set
671
672#
673# ISDN subsystem
674#
675# CONFIG_ISDN is not set 649# CONFIG_ISDN is not set
676
677#
678# Telephony Support
679#
680# CONFIG_PHONE is not set 650# CONFIG_PHONE is not set
681 651
682# 652#
@@ -684,16 +654,14 @@ CONFIG_SLHC=m
684# 654#
685CONFIG_INPUT=y 655CONFIG_INPUT=y
686# CONFIG_INPUT_FF_MEMLESS is not set 656# CONFIG_INPUT_FF_MEMLESS is not set
657# CONFIG_INPUT_POLLDEV is not set
658# CONFIG_INPUT_SPARSEKMAP is not set
687 659
688# 660#
689# Userland interfaces 661# Userland interfaces
690# 662#
691CONFIG_INPUT_MOUSEDEV=y 663# CONFIG_INPUT_MOUSEDEV is not set
692CONFIG_INPUT_MOUSEDEV_PSAUX=y
693CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
694CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
695# CONFIG_INPUT_JOYDEV is not set 664# CONFIG_INPUT_JOYDEV is not set
696# CONFIG_INPUT_TSDEV is not set
697CONFIG_INPUT_EVDEV=y 665CONFIG_INPUT_EVDEV=y
698# CONFIG_INPUT_EVBUG is not set 666# CONFIG_INPUT_EVBUG is not set
699 667
@@ -703,28 +671,26 @@ CONFIG_INPUT_EVDEV=y
703# CONFIG_INPUT_KEYBOARD is not set 671# CONFIG_INPUT_KEYBOARD is not set
704# CONFIG_INPUT_MOUSE is not set 672# CONFIG_INPUT_MOUSE is not set
705# CONFIG_INPUT_JOYSTICK is not set 673# CONFIG_INPUT_JOYSTICK is not set
674# CONFIG_INPUT_TABLET is not set
706# CONFIG_INPUT_TOUCHSCREEN is not set 675# CONFIG_INPUT_TOUCHSCREEN is not set
707# CONFIG_INPUT_MISC is not set 676# CONFIG_INPUT_MISC is not set
708 677
709# 678#
710# Hardware I/O ports 679# Hardware I/O ports
711# 680#
712CONFIG_SERIO=y 681# CONFIG_SERIO is not set
713# CONFIG_SERIO_I8042 is not set
714CONFIG_SERIO_SERPORT=y
715# CONFIG_SERIO_LIBPS2 is not set
716CONFIG_SERIO_RAW=m
717# CONFIG_GAMEPORT is not set 682# CONFIG_GAMEPORT is not set
718 683
719# 684#
720# Character devices 685# Character devices
721# 686#
722CONFIG_VT=y 687CONFIG_VT=y
688CONFIG_CONSOLE_TRANSLATIONS=y
723CONFIG_VT_CONSOLE=y 689CONFIG_VT_CONSOLE=y
724CONFIG_HW_CONSOLE=y 690CONFIG_HW_CONSOLE=y
725CONFIG_VT_HW_CONSOLE_BINDING=y 691CONFIG_VT_HW_CONSOLE_BINDING=y
692CONFIG_DEVKMEM=y
726# CONFIG_SERIAL_NONSTANDARD is not set 693# CONFIG_SERIAL_NONSTANDARD is not set
727# CONFIG_AU1X00_GPIO is not set
728 694
729# 695#
730# Serial drivers 696# Serial drivers
@@ -743,198 +709,288 @@ CONFIG_SERIAL_8250_AU1X00=y
743CONFIG_SERIAL_CORE=y 709CONFIG_SERIAL_CORE=y
744CONFIG_SERIAL_CORE_CONSOLE=y 710CONFIG_SERIAL_CORE_CONSOLE=y
745CONFIG_UNIX98_PTYS=y 711CONFIG_UNIX98_PTYS=y
746CONFIG_LEGACY_PTYS=y 712# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
747CONFIG_LEGACY_PTY_COUNT=256 713# CONFIG_LEGACY_PTYS is not set
748
749#
750# IPMI
751#
752# CONFIG_IPMI_HANDLER is not set 714# CONFIG_IPMI_HANDLER is not set
753
754#
755# Watchdog Cards
756#
757# CONFIG_WATCHDOG is not set
758# CONFIG_HW_RANDOM is not set 715# CONFIG_HW_RANDOM is not set
759# CONFIG_RTC is not set
760# CONFIG_GEN_RTC is not set
761# CONFIG_DTLK is not set
762# CONFIG_R3964 is not set 716# CONFIG_R3964 is not set
763 717
764# 718#
765# PCMCIA character devices 719# PCMCIA character devices
766# 720#
767CONFIG_SYNCLINK_CS=m 721# CONFIG_SYNCLINK_CS is not set
768# CONFIG_CARDMAN_4000 is not set 722# CONFIG_CARDMAN_4000 is not set
769# CONFIG_CARDMAN_4040 is not set 723# CONFIG_CARDMAN_4040 is not set
724# CONFIG_IPWIRELESS is not set
770# CONFIG_RAW_DRIVER is not set 725# CONFIG_RAW_DRIVER is not set
771
772#
773# TPM devices
774#
775# CONFIG_TCG_TPM is not set 726# CONFIG_TCG_TPM is not set
776
777#
778# I2C support
779#
780# CONFIG_I2C is not set 727# CONFIG_I2C is not set
781
782#
783# SPI support
784#
785# CONFIG_SPI is not set 728# CONFIG_SPI is not set
786# CONFIG_SPI_MASTER is not set
787 729
788# 730#
789# Dallas's 1-wire bus 731# PPS support
790# 732#
733# CONFIG_PPS is not set
734CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
735# CONFIG_GPIOLIB is not set
791# CONFIG_W1 is not set 736# CONFIG_W1 is not set
792 737# CONFIG_POWER_SUPPLY is not set
793#
794# Hardware Monitoring support
795#
796# CONFIG_HWMON is not set 738# CONFIG_HWMON is not set
797# CONFIG_HWMON_VID is not set 739# CONFIG_THERMAL is not set
740# CONFIG_WATCHDOG is not set
741CONFIG_SSB_POSSIBLE=y
798 742
799# 743#
800# Multimedia devices 744# Sonics Silicon Backplane
801# 745#
802# CONFIG_VIDEO_DEV is not set 746# CONFIG_SSB is not set
803 747
804# 748#
805# Digital Video Broadcasting Devices 749# Multifunction device drivers
806# 750#
807# CONFIG_DVB is not set 751# CONFIG_MFD_CORE is not set
752# CONFIG_MFD_SM501 is not set
753# CONFIG_HTC_PASIC3 is not set
754# CONFIG_MFD_TMIO is not set
755# CONFIG_REGULATOR is not set
756# CONFIG_MEDIA_SUPPORT is not set
808 757
809# 758#
810# Graphics support 759# Graphics support
811# 760#
812# CONFIG_FIRMWARE_EDID is not set 761# CONFIG_VGASTATE is not set
762# CONFIG_VIDEO_OUTPUT_CONTROL is not set
813# CONFIG_FB is not set 763# CONFIG_FB is not set
814
815#
816# Console display driver support
817#
818# CONFIG_VGA_CONSOLE is not set
819CONFIG_DUMMY_CONSOLE=y
820# CONFIG_BACKLIGHT_LCD_SUPPORT is not set 764# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
821 765
822# 766#
823# Sound 767# Display device support
824# 768#
825# CONFIG_SOUND is not set 769# CONFIG_DISPLAY_SUPPORT is not set
826 770
827# 771#
828# HID Devices 772# Console display driver support
829#
830# CONFIG_HID is not set
831
832#
833# USB support
834# 773#
774# CONFIG_VGA_CONSOLE is not set
775CONFIG_DUMMY_CONSOLE=y
776# CONFIG_SOUND is not set
777CONFIG_HID_SUPPORT=y
778CONFIG_HID=y
779CONFIG_HIDRAW=y
780
781#
782# USB Input Devices
783#
784CONFIG_USB_HID=y
785# CONFIG_HID_PID is not set
786CONFIG_USB_HIDDEV=y
787
788#
789# Special HID drivers
790#
791# CONFIG_HID_A4TECH is not set
792# CONFIG_HID_APPLE is not set
793# CONFIG_HID_BELKIN is not set
794# CONFIG_HID_CHERRY is not set
795# CONFIG_HID_CHICONY is not set
796# CONFIG_HID_CYPRESS is not set
797# CONFIG_HID_DRAGONRISE is not set
798# CONFIG_HID_EZKEY is not set
799# CONFIG_HID_KYE is not set
800# CONFIG_HID_GYRATION is not set
801# CONFIG_HID_TWINHAN is not set
802# CONFIG_HID_KENSINGTON is not set
803# CONFIG_HID_LOGITECH is not set
804# CONFIG_HID_MICROSOFT is not set
805# CONFIG_HID_MONTEREY is not set
806# CONFIG_HID_NTRIG is not set
807# CONFIG_HID_PANTHERLORD is not set
808# CONFIG_HID_PETALYNX is not set
809# CONFIG_HID_SAMSUNG is not set
810# CONFIG_HID_SONY is not set
811# CONFIG_HID_SUNPLUS is not set
812# CONFIG_HID_GREENASIA is not set
813# CONFIG_HID_SMARTJOYPLUS is not set
814# CONFIG_HID_TOPSEED is not set
815# CONFIG_HID_THRUSTMASTER is not set
816# CONFIG_HID_ZEROPLUS is not set
817CONFIG_USB_SUPPORT=y
835CONFIG_USB_ARCH_HAS_HCD=y 818CONFIG_USB_ARCH_HAS_HCD=y
836CONFIG_USB_ARCH_HAS_OHCI=y 819CONFIG_USB_ARCH_HAS_OHCI=y
837# CONFIG_USB_ARCH_HAS_EHCI is not set 820# CONFIG_USB_ARCH_HAS_EHCI is not set
838# CONFIG_USB is not set 821CONFIG_USB=y
822# CONFIG_USB_DEBUG is not set
823# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
839 824
840# 825#
841# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' 826# Miscellaneous USB options
842# 827#
828# CONFIG_USB_DEVICEFS is not set
829# CONFIG_USB_DEVICE_CLASS is not set
830CONFIG_USB_DYNAMIC_MINORS=y
831CONFIG_USB_SUSPEND=y
832# CONFIG_USB_OTG is not set
833# CONFIG_USB_OTG_WHITELIST is not set
834# CONFIG_USB_OTG_BLACKLIST_HUB is not set
835# CONFIG_USB_MON is not set
836# CONFIG_USB_WUSB is not set
837# CONFIG_USB_WUSB_CBAF is not set
843 838
844# 839#
845# USB Gadget Support 840# USB Host Controller Drivers
846# 841#
847# CONFIG_USB_GADGET is not set 842# CONFIG_USB_C67X00_HCD is not set
843# CONFIG_USB_OXU210HP_HCD is not set
844# CONFIG_USB_ISP116X_HCD is not set
845# CONFIG_USB_ISP1760_HCD is not set
846# CONFIG_USB_ISP1362_HCD is not set
847CONFIG_USB_OHCI_HCD=y
848# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
849# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
850CONFIG_USB_OHCI_LITTLE_ENDIAN=y
851# CONFIG_USB_SL811_HCD is not set
852# CONFIG_USB_R8A66597_HCD is not set
853# CONFIG_USB_HWA_HCD is not set
848 854
849# 855#
850# MMC/SD Card support 856# USB Device Class drivers
851# 857#
852# CONFIG_MMC is not set 858# CONFIG_USB_ACM is not set
859# CONFIG_USB_PRINTER is not set
860# CONFIG_USB_WDM is not set
861# CONFIG_USB_TMC is not set
853 862
854# 863#
855# LED devices 864# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
856# 865#
857# CONFIG_NEW_LEDS is not set
858 866
859# 867#
860# LED drivers 868# also be needed; see USB_STORAGE Help for more info
861# 869#
870# CONFIG_USB_LIBUSUAL is not set
862 871
863# 872#
864# LED Triggers 873# USB Imaging devices
865# 874#
875# CONFIG_USB_MDC800 is not set
866 876
867# 877#
868# InfiniBand support 878# USB port drivers
869# 879#
880# CONFIG_USB_SERIAL is not set
870 881
871# 882#
872# EDAC - error detection and reporting (RAS) (EXPERIMENTAL) 883# USB Miscellaneous drivers
873# 884#
885# CONFIG_USB_EMI62 is not set
886# CONFIG_USB_EMI26 is not set
887# CONFIG_USB_ADUTUX is not set
888# CONFIG_USB_SEVSEG is not set
889# CONFIG_USB_RIO500 is not set
890# CONFIG_USB_LEGOTOWER is not set
891# CONFIG_USB_LCD is not set
892# CONFIG_USB_BERRY_CHARGE is not set
893# CONFIG_USB_LED is not set
894# CONFIG_USB_CYPRESS_CY7C63 is not set
895# CONFIG_USB_CYTHERM is not set
896# CONFIG_USB_IDMOUSE is not set
897# CONFIG_USB_FTDI_ELAN is not set
898# CONFIG_USB_APPLEDISPLAY is not set
899# CONFIG_USB_LD is not set
900# CONFIG_USB_TRANCEVIBRATOR is not set
901# CONFIG_USB_IOWARRIOR is not set
902# CONFIG_USB_TEST is not set
903# CONFIG_USB_ISIGHTFW is not set
904# CONFIG_USB_VST is not set
905# CONFIG_USB_GADGET is not set
874 906
875# 907#
876# Real Time Clock 908# OTG and related infrastructure
877# 909#
878# CONFIG_RTC_CLASS is not set 910# CONFIG_USB_GPIO_VBUS is not set
911# CONFIG_NOP_USB_XCEIV is not set
912# CONFIG_MMC is not set
913# CONFIG_MEMSTICK is not set
914# CONFIG_NEW_LEDS is not set
915# CONFIG_ACCESSIBILITY is not set
916CONFIG_RTC_LIB=y
917CONFIG_RTC_CLASS=y
918CONFIG_RTC_HCTOSYS=y
919CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
920# CONFIG_RTC_DEBUG is not set
879 921
880# 922#
881# DMA Engine support 923# RTC interfaces
882# 924#
883# CONFIG_DMA_ENGINE is not set 925CONFIG_RTC_INTF_SYSFS=y
926CONFIG_RTC_INTF_PROC=y
927CONFIG_RTC_INTF_DEV=y
928# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
929# CONFIG_RTC_DRV_TEST is not set
884 930
885# 931#
886# DMA Clients 932# SPI RTC drivers
887# 933#
888 934
889# 935#
890# DMA Devices 936# Platform RTC drivers
891# 937#
938# CONFIG_RTC_DRV_CMOS is not set
939# CONFIG_RTC_DRV_DS1286 is not set
940# CONFIG_RTC_DRV_DS1511 is not set
941# CONFIG_RTC_DRV_DS1553 is not set
942# CONFIG_RTC_DRV_DS1742 is not set
943# CONFIG_RTC_DRV_STK17TA8 is not set
944# CONFIG_RTC_DRV_M48T86 is not set
945# CONFIG_RTC_DRV_M48T35 is not set
946# CONFIG_RTC_DRV_M48T59 is not set
947# CONFIG_RTC_DRV_MSM6242 is not set
948# CONFIG_RTC_DRV_BQ4802 is not set
949# CONFIG_RTC_DRV_RP5C01 is not set
950# CONFIG_RTC_DRV_V3020 is not set
892 951
893# 952#
894# Auxiliary Display support 953# on-CPU RTC drivers
895# 954#
955CONFIG_RTC_DRV_AU1XXX=y
956# CONFIG_DMADEVICES is not set
957# CONFIG_AUXDISPLAY is not set
958# CONFIG_UIO is not set
896 959
897# 960#
898# Virtualization 961# TI VLYNQ
899# 962#
963# CONFIG_STAGING is not set
900 964
901# 965#
902# File systems 966# File systems
903# 967#
904CONFIG_EXT2_FS=y 968CONFIG_EXT2_FS=y
905CONFIG_EXT2_FS_XATTR=y 969# CONFIG_EXT2_FS_XATTR is not set
906CONFIG_EXT2_FS_POSIX_ACL=y
907# CONFIG_EXT2_FS_SECURITY is not set
908# CONFIG_EXT2_FS_XIP is not set 970# CONFIG_EXT2_FS_XIP is not set
909CONFIG_EXT3_FS=y 971# CONFIG_EXT3_FS is not set
910CONFIG_EXT3_FS_XATTR=y 972# CONFIG_EXT4_FS is not set
911CONFIG_EXT3_FS_POSIX_ACL=y 973# CONFIG_REISERFS_FS is not set
912CONFIG_EXT3_FS_SECURITY=y
913# CONFIG_EXT4DEV_FS is not set
914CONFIG_JBD=y
915# CONFIG_JBD_DEBUG is not set
916CONFIG_FS_MBCACHE=y
917CONFIG_REISERFS_FS=m
918# CONFIG_REISERFS_CHECK is not set
919# CONFIG_REISERFS_PROC_INFO is not set
920CONFIG_REISERFS_FS_XATTR=y
921CONFIG_REISERFS_FS_POSIX_ACL=y
922CONFIG_REISERFS_FS_SECURITY=y
923# CONFIG_JFS_FS is not set 974# CONFIG_JFS_FS is not set
924CONFIG_FS_POSIX_ACL=y 975# CONFIG_FS_POSIX_ACL is not set
925# CONFIG_XFS_FS is not set 976# CONFIG_XFS_FS is not set
926# CONFIG_GFS2_FS is not set
927# CONFIG_OCFS2_FS is not set 977# CONFIG_OCFS2_FS is not set
928# CONFIG_MINIX_FS is not set 978# CONFIG_BTRFS_FS is not set
929# CONFIG_ROMFS_FS is not set 979# CONFIG_NILFS2_FS is not set
980CONFIG_FILE_LOCKING=y
981CONFIG_FSNOTIFY=y
982CONFIG_DNOTIFY=y
930CONFIG_INOTIFY=y 983CONFIG_INOTIFY=y
931CONFIG_INOTIFY_USER=y 984CONFIG_INOTIFY_USER=y
932# CONFIG_QUOTA is not set 985# CONFIG_QUOTA is not set
933CONFIG_DNOTIFY=y 986# CONFIG_AUTOFS_FS is not set
934CONFIG_AUTOFS_FS=m 987# CONFIG_AUTOFS4_FS is not set
935CONFIG_AUTOFS4_FS=m 988# CONFIG_FUSE_FS is not set
936CONFIG_FUSE_FS=m 989
937CONFIG_GENERIC_ACL=y 990#
991# Caches
992#
993# CONFIG_FSCACHE is not set
938 994
939# 995#
940# CD-ROM/DVD Filesystems 996# CD-ROM/DVD Filesystems
@@ -953,69 +1009,76 @@ CONFIG_GENERIC_ACL=y
953# Pseudo filesystems 1009# Pseudo filesystems
954# 1010#
955CONFIG_PROC_FS=y 1011CONFIG_PROC_FS=y
956CONFIG_PROC_KCORE=y 1012# CONFIG_PROC_KCORE is not set
957CONFIG_PROC_SYSCTL=y 1013CONFIG_PROC_SYSCTL=y
1014# CONFIG_PROC_PAGE_MONITOR is not set
958CONFIG_SYSFS=y 1015CONFIG_SYSFS=y
959CONFIG_TMPFS=y 1016CONFIG_TMPFS=y
960CONFIG_TMPFS_POSIX_ACL=y 1017# CONFIG_TMPFS_POSIX_ACL is not set
961# CONFIG_HUGETLB_PAGE is not set 1018# CONFIG_HUGETLB_PAGE is not set
962CONFIG_RAMFS=y 1019# CONFIG_CONFIGFS_FS is not set
963CONFIG_CONFIGFS_FS=m 1020CONFIG_MISC_FILESYSTEMS=y
964
965#
966# Miscellaneous filesystems
967#
968# CONFIG_ADFS_FS is not set 1021# CONFIG_ADFS_FS is not set
969# CONFIG_AFFS_FS is not set 1022# CONFIG_AFFS_FS is not set
970# CONFIG_ECRYPT_FS is not set
971# CONFIG_HFS_FS is not set 1023# CONFIG_HFS_FS is not set
972# CONFIG_HFSPLUS_FS is not set 1024# CONFIG_HFSPLUS_FS is not set
973# CONFIG_BEFS_FS is not set 1025# CONFIG_BEFS_FS is not set
974# CONFIG_BFS_FS is not set 1026# CONFIG_BFS_FS is not set
975# CONFIG_EFS_FS is not set 1027# CONFIG_EFS_FS is not set
976# CONFIG_JFFS2_FS is not set 1028CONFIG_JFFS2_FS=y
977CONFIG_CRAMFS=m 1029CONFIG_JFFS2_FS_DEBUG=0
1030CONFIG_JFFS2_FS_WRITEBUFFER=y
1031# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
1032CONFIG_JFFS2_SUMMARY=y
1033CONFIG_JFFS2_FS_XATTR=y
1034# CONFIG_JFFS2_FS_POSIX_ACL is not set
1035# CONFIG_JFFS2_FS_SECURITY is not set
1036CONFIG_JFFS2_COMPRESSION_OPTIONS=y
1037CONFIG_JFFS2_ZLIB=y
1038CONFIG_JFFS2_LZO=y
1039CONFIG_JFFS2_RTIME=y
1040CONFIG_JFFS2_RUBIN=y
1041# CONFIG_JFFS2_CMODE_NONE is not set
1042CONFIG_JFFS2_CMODE_PRIORITY=y
1043# CONFIG_JFFS2_CMODE_SIZE is not set
1044# CONFIG_JFFS2_CMODE_FAVOURLZO is not set
1045# CONFIG_CRAMFS is not set
1046CONFIG_SQUASHFS=y
1047# CONFIG_SQUASHFS_EMBEDDED is not set
1048CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
978# CONFIG_VXFS_FS is not set 1049# CONFIG_VXFS_FS is not set
1050# CONFIG_MINIX_FS is not set
1051# CONFIG_OMFS_FS is not set
979# CONFIG_HPFS_FS is not set 1052# CONFIG_HPFS_FS is not set
980# CONFIG_QNX4FS_FS is not set 1053# CONFIG_QNX4FS_FS is not set
1054# CONFIG_ROMFS_FS is not set
981# CONFIG_SYSV_FS is not set 1055# CONFIG_SYSV_FS is not set
982# CONFIG_UFS_FS is not set 1056# CONFIG_UFS_FS is not set
983 1057CONFIG_NETWORK_FILESYSTEMS=y
984#
985# Network File Systems
986#
987CONFIG_NFS_FS=y 1058CONFIG_NFS_FS=y
988# CONFIG_NFS_V3 is not set 1059CONFIG_NFS_V3=y
1060# CONFIG_NFS_V3_ACL is not set
989# CONFIG_NFS_V4 is not set 1061# CONFIG_NFS_V4 is not set
990# CONFIG_NFS_DIRECTIO is not set
991CONFIG_NFSD=m
992# CONFIG_NFSD_V3 is not set
993# CONFIG_NFSD_TCP is not set
994CONFIG_ROOT_NFS=y 1062CONFIG_ROOT_NFS=y
1063# CONFIG_NFSD is not set
995CONFIG_LOCKD=y 1064CONFIG_LOCKD=y
996CONFIG_EXPORTFS=m 1065CONFIG_LOCKD_V4=y
997CONFIG_NFS_COMMON=y 1066CONFIG_NFS_COMMON=y
998CONFIG_SUNRPC=y 1067CONFIG_SUNRPC=y
999# CONFIG_RPCSEC_GSS_KRB5 is not set 1068# CONFIG_RPCSEC_GSS_KRB5 is not set
1000# CONFIG_RPCSEC_GSS_SPKM3 is not set 1069# CONFIG_RPCSEC_GSS_SPKM3 is not set
1001CONFIG_SMB_FS=m 1070# CONFIG_SMB_FS is not set
1002# CONFIG_SMB_NLS_DEFAULT is not set
1003# CONFIG_CIFS is not set 1071# CONFIG_CIFS is not set
1004# CONFIG_NCP_FS is not set 1072# CONFIG_NCP_FS is not set
1005# CONFIG_CODA_FS is not set 1073# CONFIG_CODA_FS is not set
1006# CONFIG_AFS_FS is not set 1074# CONFIG_AFS_FS is not set
1007# CONFIG_9P_FS is not set
1008 1075
1009# 1076#
1010# Partition Types 1077# Partition Types
1011# 1078#
1012# CONFIG_PARTITION_ADVANCED is not set 1079# CONFIG_PARTITION_ADVANCED is not set
1013CONFIG_MSDOS_PARTITION=y 1080CONFIG_MSDOS_PARTITION=y
1014 1081CONFIG_NLS=y
1015#
1016# Native Language Support
1017#
1018CONFIG_NLS=m
1019CONFIG_NLS_DEFAULT="iso8859-1" 1082CONFIG_NLS_DEFAULT="iso8859-1"
1020# CONFIG_NLS_CODEPAGE_437 is not set 1083# CONFIG_NLS_CODEPAGE_437 is not set
1021# CONFIG_NLS_CODEPAGE_737 is not set 1084# CONFIG_NLS_CODEPAGE_737 is not set
@@ -1055,34 +1118,71 @@ CONFIG_NLS_DEFAULT="iso8859-1"
1055# CONFIG_NLS_KOI8_R is not set 1118# CONFIG_NLS_KOI8_R is not set
1056# CONFIG_NLS_KOI8_U is not set 1119# CONFIG_NLS_KOI8_U is not set
1057# CONFIG_NLS_UTF8 is not set 1120# CONFIG_NLS_UTF8 is not set
1058 1121# CONFIG_DLM is not set
1059#
1060# Distributed Lock Manager
1061#
1062CONFIG_DLM=m
1063CONFIG_DLM_TCP=y
1064# CONFIG_DLM_SCTP is not set
1065# CONFIG_DLM_DEBUG is not set
1066
1067#
1068# Profiling support
1069#
1070# CONFIG_PROFILING is not set
1071 1122
1072# 1123#
1073# Kernel hacking 1124# Kernel hacking
1074# 1125#
1075CONFIG_TRACE_IRQFLAGS_SUPPORT=y 1126CONFIG_TRACE_IRQFLAGS_SUPPORT=y
1076# CONFIG_PRINTK_TIME is not set 1127# CONFIG_PRINTK_TIME is not set
1128CONFIG_ENABLE_WARN_DEPRECATED=y
1077CONFIG_ENABLE_MUST_CHECK=y 1129CONFIG_ENABLE_MUST_CHECK=y
1130CONFIG_FRAME_WARN=1024
1078# CONFIG_MAGIC_SYSRQ is not set 1131# CONFIG_MAGIC_SYSRQ is not set
1132CONFIG_STRIP_ASM_SYMS=y
1079# CONFIG_UNUSED_SYMBOLS is not set 1133# CONFIG_UNUSED_SYMBOLS is not set
1080# CONFIG_DEBUG_FS is not set 1134# CONFIG_DEBUG_FS is not set
1081# CONFIG_HEADERS_CHECK is not set 1135# CONFIG_HEADERS_CHECK is not set
1082# CONFIG_DEBUG_KERNEL is not set 1136CONFIG_DEBUG_KERNEL=y
1083CONFIG_LOG_BUF_SHIFT=14 1137# CONFIG_DEBUG_SHIRQ is not set
1084CONFIG_CROSSCOMPILE=y 1138# CONFIG_DETECT_SOFTLOCKUP is not set
1139# CONFIG_DETECT_HUNG_TASK is not set
1140# CONFIG_SCHED_DEBUG is not set
1141# CONFIG_SCHEDSTATS is not set
1142# CONFIG_TIMER_STATS is not set
1143# CONFIG_DEBUG_OBJECTS is not set
1144# CONFIG_DEBUG_SLAB is not set
1145# CONFIG_DEBUG_RT_MUTEXES is not set
1146# CONFIG_RT_MUTEX_TESTER is not set
1147# CONFIG_DEBUG_SPINLOCK is not set
1148# CONFIG_DEBUG_MUTEXES is not set
1149# CONFIG_DEBUG_LOCK_ALLOC is not set
1150# CONFIG_PROVE_LOCKING is not set
1151# CONFIG_LOCK_STAT is not set
1152# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1153# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1154# CONFIG_DEBUG_KOBJECT is not set
1155# CONFIG_DEBUG_INFO is not set
1156# CONFIG_DEBUG_VM is not set
1157# CONFIG_DEBUG_WRITECOUNT is not set
1158# CONFIG_DEBUG_MEMORY_INIT is not set
1159# CONFIG_DEBUG_LIST is not set
1160# CONFIG_DEBUG_SG is not set
1161# CONFIG_DEBUG_NOTIFIERS is not set
1162# CONFIG_DEBUG_CREDENTIALS is not set
1163# CONFIG_BOOT_PRINTK_DELAY is not set
1164# CONFIG_RCU_TORTURE_TEST is not set
1165# CONFIG_BACKTRACE_SELF_TEST is not set
1166# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1167# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
1168# CONFIG_FAULT_INJECTION is not set
1169# CONFIG_SYSCTL_SYSCALL_CHECK is not set
1170# CONFIG_PAGE_POISONING is not set
1171CONFIG_HAVE_FUNCTION_TRACER=y
1172CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1173CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y
1174CONFIG_HAVE_DYNAMIC_FTRACE=y
1175CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1176CONFIG_TRACING_SUPPORT=y
1177# CONFIG_FTRACE is not set
1178# CONFIG_SAMPLES is not set
1179CONFIG_HAVE_ARCH_KGDB=y
1180# CONFIG_KGDB is not set
1181CONFIG_EARLY_PRINTK=y
1085# CONFIG_CMDLINE_BOOL is not set 1182# CONFIG_CMDLINE_BOOL is not set
1183# CONFIG_DEBUG_STACK_USAGE is not set
1184# CONFIG_RUNTIME_DEBUG is not set
1185CONFIG_DEBUG_ZBOOT=y
1086 1186
1087# 1187#
1088# Security options 1188# Security options
@@ -1090,67 +1190,32 @@ CONFIG_CROSSCOMPILE=y
1090CONFIG_KEYS=y 1190CONFIG_KEYS=y
1091CONFIG_KEYS_DEBUG_PROC_KEYS=y 1191CONFIG_KEYS_DEBUG_PROC_KEYS=y
1092# CONFIG_SECURITY is not set 1192# CONFIG_SECURITY is not set
1093 1193CONFIG_SECURITYFS=y
1094# 1194# CONFIG_DEFAULT_SECURITY_SELINUX is not set
1095# Cryptographic options 1195# CONFIG_DEFAULT_SECURITY_SMACK is not set
1096# 1196# CONFIG_DEFAULT_SECURITY_TOMOYO is not set
1097CONFIG_CRYPTO=y 1197CONFIG_DEFAULT_SECURITY_DAC=y
1098CONFIG_CRYPTO_ALGAPI=y 1198CONFIG_DEFAULT_SECURITY=""
1099CONFIG_CRYPTO_BLKCIPHER=m 1199# CONFIG_CRYPTO is not set
1100CONFIG_CRYPTO_HASH=y 1200# CONFIG_BINARY_PRINTF is not set
1101CONFIG_CRYPTO_MANAGER=y
1102CONFIG_CRYPTO_HMAC=y
1103CONFIG_CRYPTO_XCBC=m
1104CONFIG_CRYPTO_NULL=m
1105CONFIG_CRYPTO_MD4=m
1106CONFIG_CRYPTO_MD5=y
1107CONFIG_CRYPTO_SHA1=m
1108CONFIG_CRYPTO_SHA256=m
1109CONFIG_CRYPTO_SHA512=m
1110CONFIG_CRYPTO_WP512=m
1111CONFIG_CRYPTO_TGR192=m
1112CONFIG_CRYPTO_GF128MUL=m
1113CONFIG_CRYPTO_ECB=m
1114CONFIG_CRYPTO_CBC=m
1115CONFIG_CRYPTO_PCBC=m
1116CONFIG_CRYPTO_LRW=m
1117CONFIG_CRYPTO_DES=m
1118CONFIG_CRYPTO_FCRYPT=m
1119CONFIG_CRYPTO_BLOWFISH=m
1120CONFIG_CRYPTO_TWOFISH=m
1121CONFIG_CRYPTO_TWOFISH_COMMON=m
1122CONFIG_CRYPTO_SERPENT=m
1123CONFIG_CRYPTO_AES=m
1124CONFIG_CRYPTO_CAST5=m
1125CONFIG_CRYPTO_CAST6=m
1126CONFIG_CRYPTO_TEA=m
1127CONFIG_CRYPTO_ARC4=m
1128CONFIG_CRYPTO_KHAZAD=m
1129CONFIG_CRYPTO_ANUBIS=m
1130CONFIG_CRYPTO_DEFLATE=m
1131CONFIG_CRYPTO_MICHAEL_MIC=m
1132CONFIG_CRYPTO_CRC32C=m
1133CONFIG_CRYPTO_CAMELLIA=m
1134# CONFIG_CRYPTO_TEST is not set
1135
1136#
1137# Hardware crypto devices
1138#
1139 1201
1140# 1202#
1141# Library routines 1203# Library routines
1142# 1204#
1143CONFIG_BITREVERSE=y 1205CONFIG_BITREVERSE=y
1144CONFIG_CRC_CCITT=m 1206CONFIG_GENERIC_FIND_LAST_BIT=y
1145CONFIG_CRC16=m 1207# CONFIG_CRC_CCITT is not set
1208# CONFIG_CRC16 is not set
1209# CONFIG_CRC_T10DIF is not set
1210# CONFIG_CRC_ITU_T is not set
1146CONFIG_CRC32=y 1211CONFIG_CRC32=y
1147CONFIG_LIBCRC32C=m 1212# CONFIG_CRC7 is not set
1148CONFIG_ZLIB_INFLATE=m 1213# CONFIG_LIBCRC32C is not set
1149CONFIG_ZLIB_DEFLATE=m 1214CONFIG_ZLIB_INFLATE=y
1150CONFIG_TEXTSEARCH=y 1215CONFIG_ZLIB_DEFLATE=y
1151CONFIG_TEXTSEARCH_KMP=m 1216CONFIG_LZO_COMPRESS=y
1152CONFIG_TEXTSEARCH_BM=m 1217CONFIG_LZO_DECOMPRESS=y
1153CONFIG_TEXTSEARCH_FSM=m
1154CONFIG_PLIST=y
1155CONFIG_HAS_IOMEM=y 1218CONFIG_HAS_IOMEM=y
1156CONFIG_HAS_IOPORT=y 1219CONFIG_HAS_IOPORT=y
1220CONFIG_HAS_DMA=y
1221CONFIG_NLATTR=y
diff --git a/arch/mips/configs/pb1200_defconfig b/arch/mips/configs/pb1200_defconfig
new file mode 100644
index 000000000000..e9ad77320f16
--- /dev/null
+++ b/arch/mips/configs/pb1200_defconfig
@@ -0,0 +1,1568 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.33
4# Fri Feb 26 10:23:34 2010
5#
6CONFIG_MIPS=y
7
8#
9# Machine selection
10#
11CONFIG_MACH_ALCHEMY=y
12# CONFIG_AR7 is not set
13# CONFIG_BCM47XX is not set
14# CONFIG_BCM63XX is not set
15# CONFIG_MIPS_COBALT is not set
16# CONFIG_MACH_DECSTATION is not set
17# CONFIG_MACH_JAZZ is not set
18# CONFIG_LASAT is not set
19# CONFIG_MACH_LOONGSON is not set
20# CONFIG_MIPS_MALTA is not set
21# CONFIG_MIPS_SIM is not set
22# CONFIG_NEC_MARKEINS is not set
23# CONFIG_MACH_VR41XX is not set
24# CONFIG_NXP_STB220 is not set
25# CONFIG_NXP_STB225 is not set
26# CONFIG_PNX8550_JBS is not set
27# CONFIG_PNX8550_STB810 is not set
28# CONFIG_PMC_MSP is not set
29# CONFIG_PMC_YOSEMITE is not set
30# CONFIG_POWERTV is not set
31# CONFIG_SGI_IP22 is not set
32# CONFIG_SGI_IP27 is not set
33# CONFIG_SGI_IP28 is not set
34# CONFIG_SGI_IP32 is not set
35# CONFIG_SIBYTE_CRHINE is not set
36# CONFIG_SIBYTE_CARMEL is not set
37# CONFIG_SIBYTE_CRHONE is not set
38# CONFIG_SIBYTE_RHONE is not set
39# CONFIG_SIBYTE_SWARM is not set
40# CONFIG_SIBYTE_LITTLESUR is not set
41# CONFIG_SIBYTE_SENTOSA is not set
42# CONFIG_SIBYTE_BIGSUR is not set
43# CONFIG_SNI_RM is not set
44# CONFIG_MACH_TX39XX is not set
45# CONFIG_MACH_TX49XX is not set
46# CONFIG_MIKROTIK_RB532 is not set
47# CONFIG_WR_PPMC is not set
48# CONFIG_CAVIUM_OCTEON_SIMULATOR is not set
49# CONFIG_CAVIUM_OCTEON_REFERENCE_BOARD is not set
50CONFIG_ALCHEMY_GPIOINT_AU1000=y
51# CONFIG_ALCHEMY_GPIO_INDIRECT is not set
52# CONFIG_MIPS_MTX1 is not set
53# CONFIG_MIPS_BOSPORUS is not set
54# CONFIG_MIPS_DB1000 is not set
55# CONFIG_MIPS_DB1100 is not set
56# CONFIG_MIPS_DB1200 is not set
57# CONFIG_MIPS_DB1500 is not set
58# CONFIG_MIPS_DB1550 is not set
59# CONFIG_MIPS_MIRAGE is not set
60# CONFIG_MIPS_PB1000 is not set
61# CONFIG_MIPS_PB1100 is not set
62CONFIG_MIPS_PB1200=y
63# CONFIG_MIPS_PB1500 is not set
64# CONFIG_MIPS_PB1550 is not set
65# CONFIG_MIPS_XXS1500 is not set
66CONFIG_SOC_AU1200=y
67CONFIG_SOC_AU1X00=y
68CONFIG_LOONGSON_UART_BASE=y
69CONFIG_RWSEM_GENERIC_SPINLOCK=y
70# CONFIG_ARCH_HAS_ILOG2_U32 is not set
71# CONFIG_ARCH_HAS_ILOG2_U64 is not set
72CONFIG_ARCH_SUPPORTS_OPROFILE=y
73CONFIG_GENERIC_FIND_NEXT_BIT=y
74CONFIG_GENERIC_HWEIGHT=y
75CONFIG_GENERIC_CALIBRATE_DELAY=y
76CONFIG_GENERIC_CLOCKEVENTS=y
77CONFIG_GENERIC_TIME=y
78CONFIG_GENERIC_CMOS_UPDATE=y
79CONFIG_SCHED_OMIT_FRAME_POINTER=y
80CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
81CONFIG_CEVT_R4K_LIB=y
82CONFIG_CSRC_R4K_LIB=y
83CONFIG_DMA_NONCOHERENT=y
84CONFIG_DMA_NEED_PCI_MAP_STATE=y
85CONFIG_SYS_HAS_EARLY_PRINTK=y
86CONFIG_MIPS_DISABLE_OBSOLETE_IDE=y
87# CONFIG_NO_IOPORT is not set
88CONFIG_GENERIC_GPIO=y
89# CONFIG_CPU_BIG_ENDIAN is not set
90CONFIG_CPU_LITTLE_ENDIAN=y
91CONFIG_SYS_SUPPORTS_APM_EMULATION=y
92CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
93CONFIG_IRQ_CPU=y
94CONFIG_MIPS_L1_CACHE_SHIFT=5
95
96#
97# CPU selection
98#
99# CONFIG_CPU_LOONGSON2E is not set
100# CONFIG_CPU_LOONGSON2F is not set
101CONFIG_CPU_MIPS32_R1=y
102# CONFIG_CPU_MIPS32_R2 is not set
103# CONFIG_CPU_MIPS64_R1 is not set
104# CONFIG_CPU_MIPS64_R2 is not set
105# CONFIG_CPU_R3000 is not set
106# CONFIG_CPU_TX39XX is not set
107# CONFIG_CPU_VR41XX is not set
108# CONFIG_CPU_R4300 is not set
109# CONFIG_CPU_R4X00 is not set
110# CONFIG_CPU_TX49XX is not set
111# CONFIG_CPU_R5000 is not set
112# CONFIG_CPU_R5432 is not set
113# CONFIG_CPU_R5500 is not set
114# CONFIG_CPU_R6000 is not set
115# CONFIG_CPU_NEVADA is not set
116# CONFIG_CPU_R8000 is not set
117# CONFIG_CPU_R10000 is not set
118# CONFIG_CPU_RM7000 is not set
119# CONFIG_CPU_RM9000 is not set
120# CONFIG_CPU_SB1 is not set
121# CONFIG_CPU_CAVIUM_OCTEON is not set
122CONFIG_SYS_SUPPORTS_ZBOOT=y
123CONFIG_SYS_HAS_CPU_MIPS32_R1=y
124CONFIG_CPU_MIPS32=y
125CONFIG_CPU_MIPSR1=y
126CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
127CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
128CONFIG_HARDWARE_WATCHPOINTS=y
129
130#
131# Kernel type
132#
133CONFIG_32BIT=y
134# CONFIG_64BIT is not set
135CONFIG_PAGE_SIZE_4KB=y
136# CONFIG_PAGE_SIZE_8KB is not set
137# CONFIG_PAGE_SIZE_16KB is not set
138# CONFIG_PAGE_SIZE_32KB is not set
139# CONFIG_PAGE_SIZE_64KB is not set
140CONFIG_CPU_HAS_PREFETCH=y
141CONFIG_MIPS_MT_DISABLED=y
142# CONFIG_MIPS_MT_SMP is not set
143# CONFIG_MIPS_MT_SMTC is not set
144CONFIG_64BIT_PHYS_ADDR=y
145CONFIG_ARCH_PHYS_ADDR_T_64BIT=y
146CONFIG_CPU_HAS_SYNC=y
147CONFIG_GENERIC_HARDIRQS=y
148CONFIG_GENERIC_IRQ_PROBE=y
149CONFIG_CPU_SUPPORTS_HIGHMEM=y
150CONFIG_ARCH_FLATMEM_ENABLE=y
151CONFIG_ARCH_POPULATES_NODE_MAP=y
152CONFIG_SELECT_MEMORY_MODEL=y
153CONFIG_FLATMEM_MANUAL=y
154# CONFIG_DISCONTIGMEM_MANUAL is not set
155# CONFIG_SPARSEMEM_MANUAL is not set
156CONFIG_FLATMEM=y
157CONFIG_FLAT_NODE_MEM_MAP=y
158CONFIG_PAGEFLAGS_EXTENDED=y
159CONFIG_SPLIT_PTLOCK_CPUS=4
160CONFIG_PHYS_ADDR_T_64BIT=y
161CONFIG_ZONE_DMA_FLAG=0
162CONFIG_VIRT_TO_BUS=y
163CONFIG_KSM=y
164CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
165CONFIG_TICK_ONESHOT=y
166CONFIG_NO_HZ=y
167CONFIG_HIGH_RES_TIMERS=y
168CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
169# CONFIG_HZ_48 is not set
170CONFIG_HZ_100=y
171# CONFIG_HZ_128 is not set
172# CONFIG_HZ_250 is not set
173# CONFIG_HZ_256 is not set
174# CONFIG_HZ_1000 is not set
175# CONFIG_HZ_1024 is not set
176CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
177CONFIG_HZ=100
178CONFIG_PREEMPT_NONE=y
179# CONFIG_PREEMPT_VOLUNTARY is not set
180# CONFIG_PREEMPT is not set
181# CONFIG_KEXEC is not set
182# CONFIG_SECCOMP is not set
183CONFIG_LOCKDEP_SUPPORT=y
184CONFIG_STACKTRACE_SUPPORT=y
185CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
186CONFIG_CONSTRUCTORS=y
187
188#
189# General setup
190#
191CONFIG_EXPERIMENTAL=y
192CONFIG_BROKEN_ON_SMP=y
193CONFIG_INIT_ENV_ARG_LIMIT=32
194CONFIG_LOCALVERSION="-pb1200"
195CONFIG_LOCALVERSION_AUTO=y
196CONFIG_HAVE_KERNEL_GZIP=y
197CONFIG_HAVE_KERNEL_BZIP2=y
198CONFIG_HAVE_KERNEL_LZMA=y
199CONFIG_HAVE_KERNEL_LZO=y
200# CONFIG_KERNEL_GZIP is not set
201# CONFIG_KERNEL_BZIP2 is not set
202CONFIG_KERNEL_LZMA=y
203# CONFIG_KERNEL_LZO is not set
204CONFIG_SWAP=y
205CONFIG_SYSVIPC=y
206CONFIG_SYSVIPC_SYSCTL=y
207CONFIG_POSIX_MQUEUE=y
208CONFIG_POSIX_MQUEUE_SYSCTL=y
209# CONFIG_BSD_PROCESS_ACCT is not set
210# CONFIG_TASKSTATS is not set
211# CONFIG_AUDIT is not set
212
213#
214# RCU Subsystem
215#
216# CONFIG_TREE_RCU is not set
217# CONFIG_TREE_PREEMPT_RCU is not set
218CONFIG_TINY_RCU=y
219# CONFIG_TREE_RCU_TRACE is not set
220# CONFIG_IKCONFIG is not set
221CONFIG_LOG_BUF_SHIFT=14
222# CONFIG_GROUP_SCHED is not set
223# CONFIG_CGROUPS is not set
224# CONFIG_SYSFS_DEPRECATED_V2 is not set
225# CONFIG_RELAY is not set
226# CONFIG_NAMESPACES is not set
227# CONFIG_BLK_DEV_INITRD is not set
228CONFIG_CC_OPTIMIZE_FOR_SIZE=y
229CONFIG_SYSCTL=y
230CONFIG_ANON_INODES=y
231CONFIG_EMBEDDED=y
232# CONFIG_SYSCTL_SYSCALL is not set
233# CONFIG_KALLSYMS is not set
234CONFIG_HOTPLUG=y
235CONFIG_PRINTK=y
236CONFIG_BUG=y
237CONFIG_ELF_CORE=y
238# CONFIG_PCSPKR_PLATFORM is not set
239CONFIG_BASE_FULL=y
240CONFIG_FUTEX=y
241CONFIG_EPOLL=y
242CONFIG_SIGNALFD=y
243CONFIG_TIMERFD=y
244CONFIG_EVENTFD=y
245CONFIG_SHMEM=y
246CONFIG_AIO=y
247
248#
249# Kernel Performance Events And Counters
250#
251# CONFIG_VM_EVENT_COUNTERS is not set
252# CONFIG_COMPAT_BRK is not set
253CONFIG_SLAB=y
254# CONFIG_SLUB is not set
255# CONFIG_SLOB is not set
256# CONFIG_PROFILING is not set
257CONFIG_HAVE_OPROFILE=y
258
259#
260# GCOV-based kernel profiling
261#
262# CONFIG_SLOW_WORK is not set
263CONFIG_HAVE_GENERIC_DMA_COHERENT=y
264CONFIG_SLABINFO=y
265CONFIG_RT_MUTEXES=y
266CONFIG_BASE_SMALL=0
267CONFIG_MODULES=y
268# CONFIG_MODULE_FORCE_LOAD is not set
269CONFIG_MODULE_UNLOAD=y
270# CONFIG_MODULE_FORCE_UNLOAD is not set
271# CONFIG_MODVERSIONS is not set
272# CONFIG_MODULE_SRCVERSION_ALL is not set
273CONFIG_BLOCK=y
274# CONFIG_LBDAF is not set
275# CONFIG_BLK_DEV_BSG is not set
276# CONFIG_BLK_DEV_INTEGRITY is not set
277
278#
279# IO Schedulers
280#
281CONFIG_IOSCHED_NOOP=y
282# CONFIG_IOSCHED_DEADLINE is not set
283# CONFIG_IOSCHED_CFQ is not set
284# CONFIG_DEFAULT_DEADLINE is not set
285# CONFIG_DEFAULT_CFQ is not set
286CONFIG_DEFAULT_NOOP=y
287CONFIG_DEFAULT_IOSCHED="noop"
288# CONFIG_INLINE_SPIN_TRYLOCK is not set
289# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set
290# CONFIG_INLINE_SPIN_LOCK is not set
291# CONFIG_INLINE_SPIN_LOCK_BH is not set
292# CONFIG_INLINE_SPIN_LOCK_IRQ is not set
293# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set
294CONFIG_INLINE_SPIN_UNLOCK=y
295# CONFIG_INLINE_SPIN_UNLOCK_BH is not set
296CONFIG_INLINE_SPIN_UNLOCK_IRQ=y
297# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set
298# CONFIG_INLINE_READ_TRYLOCK is not set
299# CONFIG_INLINE_READ_LOCK is not set
300# CONFIG_INLINE_READ_LOCK_BH is not set
301# CONFIG_INLINE_READ_LOCK_IRQ is not set
302# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set
303CONFIG_INLINE_READ_UNLOCK=y
304# CONFIG_INLINE_READ_UNLOCK_BH is not set
305CONFIG_INLINE_READ_UNLOCK_IRQ=y
306# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set
307# CONFIG_INLINE_WRITE_TRYLOCK is not set
308# CONFIG_INLINE_WRITE_LOCK is not set
309# CONFIG_INLINE_WRITE_LOCK_BH is not set
310# CONFIG_INLINE_WRITE_LOCK_IRQ is not set
311# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set
312CONFIG_INLINE_WRITE_UNLOCK=y
313# CONFIG_INLINE_WRITE_UNLOCK_BH is not set
314CONFIG_INLINE_WRITE_UNLOCK_IRQ=y
315# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set
316# CONFIG_MUTEX_SPIN_ON_OWNER is not set
317# CONFIG_FREEZER is not set
318
319#
320# Bus options (PCI, PCMCIA, EISA, ISA, TC)
321#
322# CONFIG_ARCH_SUPPORTS_MSI is not set
323CONFIG_MMU=y
324CONFIG_PCCARD=y
325CONFIG_PCMCIA=y
326CONFIG_PCMCIA_LOAD_CIS=y
327# CONFIG_PCMCIA_IOCTL is not set
328
329#
330# PC-card bridges
331#
332# CONFIG_PCMCIA_AU1X00 is not set
333CONFIG_PCMCIA_ALCHEMY_DEVBOARD=y
334
335#
336# Executable file formats
337#
338CONFIG_BINFMT_ELF=y
339CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
340# CONFIG_HAVE_AOUT is not set
341CONFIG_BINFMT_MISC=y
342CONFIG_TRAD_SIGNALS=y
343
344#
345# Power management options
346#
347CONFIG_ARCH_HIBERNATION_POSSIBLE=y
348CONFIG_ARCH_SUSPEND_POSSIBLE=y
349# CONFIG_PM is not set
350CONFIG_NET=y
351
352#
353# Networking options
354#
355CONFIG_PACKET=y
356CONFIG_PACKET_MMAP=y
357CONFIG_UNIX=y
358# CONFIG_NET_KEY is not set
359CONFIG_INET=y
360CONFIG_IP_MULTICAST=y
361# CONFIG_IP_ADVANCED_ROUTER is not set
362CONFIG_IP_FIB_HASH=y
363CONFIG_IP_PNP=y
364# CONFIG_IP_PNP_DHCP is not set
365# CONFIG_IP_PNP_BOOTP is not set
366# CONFIG_IP_PNP_RARP is not set
367# CONFIG_NET_IPIP is not set
368# CONFIG_NET_IPGRE is not set
369# CONFIG_IP_MROUTE is not set
370# CONFIG_ARPD is not set
371# CONFIG_SYN_COOKIES is not set
372# CONFIG_INET_AH is not set
373# CONFIG_INET_ESP is not set
374# CONFIG_INET_IPCOMP is not set
375# CONFIG_INET_XFRM_TUNNEL is not set
376# CONFIG_INET_TUNNEL is not set
377# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
378# CONFIG_INET_XFRM_MODE_TUNNEL is not set
379# CONFIG_INET_XFRM_MODE_BEET is not set
380CONFIG_INET_LRO=y
381# CONFIG_INET_DIAG is not set
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
386# CONFIG_IPV6 is not set
387# CONFIG_NETWORK_SECMARK is not set
388# CONFIG_NETFILTER is not set
389# CONFIG_IP_DCCP is not set
390# CONFIG_IP_SCTP is not set
391# CONFIG_RDS is not set
392# CONFIG_TIPC is not set
393# CONFIG_ATM is not set
394# CONFIG_BRIDGE is not set
395# CONFIG_NET_DSA is not set
396# CONFIG_VLAN_8021Q is not set
397# CONFIG_DECNET is not set
398# CONFIG_LLC2 is not set
399# CONFIG_IPX is not set
400# CONFIG_ATALK is not set
401# CONFIG_X25 is not set
402# CONFIG_LAPB is not set
403# CONFIG_ECONET is not set
404# CONFIG_WAN_ROUTER is not set
405# CONFIG_PHONET is not set
406# CONFIG_IEEE802154 is not set
407# CONFIG_NET_SCHED is not set
408# CONFIG_DCB is not set
409
410#
411# Network testing
412#
413# CONFIG_NET_PKTGEN is not set
414# CONFIG_HAMRADIO is not set
415# CONFIG_CAN is not set
416# CONFIG_IRDA is not set
417# CONFIG_BT is not set
418# CONFIG_AF_RXRPC is not set
419# CONFIG_WIRELESS is not set
420# CONFIG_WIMAX is not set
421# CONFIG_RFKILL is not set
422# CONFIG_NET_9P is not set
423
424#
425# Device Drivers
426#
427
428#
429# Generic Driver Options
430#
431CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
432# CONFIG_DEVTMPFS is not set
433CONFIG_STANDALONE=y
434CONFIG_PREVENT_FIRMWARE_BUILD=y
435CONFIG_FW_LOADER=y
436CONFIG_FIRMWARE_IN_KERNEL=y
437CONFIG_EXTRA_FIRMWARE=""
438# CONFIG_DEBUG_DRIVER is not set
439# CONFIG_DEBUG_DEVRES is not set
440# CONFIG_SYS_HYPERVISOR is not set
441# CONFIG_CONNECTOR is not set
442CONFIG_MTD=y
443# CONFIG_MTD_DEBUG is not set
444# CONFIG_MTD_TESTS is not set
445# CONFIG_MTD_CONCAT is not set
446CONFIG_MTD_PARTITIONS=y
447# CONFIG_MTD_REDBOOT_PARTS is not set
448CONFIG_MTD_CMDLINE_PARTS=y
449# CONFIG_MTD_AR7_PARTS is not set
450
451#
452# User Modules And Translation Layers
453#
454CONFIG_MTD_CHAR=y
455CONFIG_MTD_BLKDEVS=y
456CONFIG_MTD_BLOCK=y
457# CONFIG_FTL is not set
458# CONFIG_NFTL is not set
459# CONFIG_INFTL is not set
460# CONFIG_RFD_FTL is not set
461# CONFIG_SSFDC is not set
462# CONFIG_MTD_OOPS is not set
463
464#
465# RAM/ROM/Flash chip drivers
466#
467CONFIG_MTD_CFI=y
468# CONFIG_MTD_JEDECPROBE is not set
469CONFIG_MTD_GEN_PROBE=y
470# CONFIG_MTD_CFI_ADV_OPTIONS is not set
471CONFIG_MTD_MAP_BANK_WIDTH_1=y
472CONFIG_MTD_MAP_BANK_WIDTH_2=y
473CONFIG_MTD_MAP_BANK_WIDTH_4=y
474# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
475# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
476# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
477CONFIG_MTD_CFI_I1=y
478CONFIG_MTD_CFI_I2=y
479# CONFIG_MTD_CFI_I4 is not set
480# CONFIG_MTD_CFI_I8 is not set
481# CONFIG_MTD_CFI_INTELEXT is not set
482CONFIG_MTD_CFI_AMDSTD=y
483# CONFIG_MTD_CFI_STAA is not set
484CONFIG_MTD_CFI_UTIL=y
485# CONFIG_MTD_RAM is not set
486# CONFIG_MTD_ROM is not set
487# CONFIG_MTD_ABSENT is not set
488
489#
490# Mapping drivers for chip access
491#
492# CONFIG_MTD_COMPLEX_MAPPINGS is not set
493CONFIG_MTD_PHYSMAP=y
494# CONFIG_MTD_PHYSMAP_COMPAT is not set
495# CONFIG_MTD_PLATRAM is not set
496
497#
498# Self-contained MTD device drivers
499#
500# CONFIG_MTD_DATAFLASH is not set
501# CONFIG_MTD_M25P80 is not set
502# CONFIG_MTD_SST25L is not set
503# CONFIG_MTD_SLRAM is not set
504# CONFIG_MTD_PHRAM is not set
505# CONFIG_MTD_MTDRAM is not set
506# CONFIG_MTD_BLOCK2MTD is not set
507
508#
509# Disk-On-Chip Device Drivers
510#
511# CONFIG_MTD_DOC2000 is not set
512# CONFIG_MTD_DOC2001 is not set
513# CONFIG_MTD_DOC2001PLUS is not set
514CONFIG_MTD_NAND=y
515# CONFIG_MTD_NAND_VERIFY_WRITE is not set
516# CONFIG_MTD_NAND_ECC_SMC is not set
517# CONFIG_MTD_NAND_MUSEUM_IDS is not set
518CONFIG_MTD_NAND_IDS=y
519# CONFIG_MTD_NAND_AU1550 is not set
520# CONFIG_MTD_NAND_DISKONCHIP is not set
521# CONFIG_MTD_NAND_NANDSIM is not set
522CONFIG_MTD_NAND_PLATFORM=y
523# CONFIG_MTD_ALAUDA is not set
524# CONFIG_MTD_ONENAND is not set
525
526#
527# LPDDR flash memory drivers
528#
529# CONFIG_MTD_LPDDR is not set
530
531#
532# UBI - Unsorted block images
533#
534# CONFIG_MTD_UBI is not set
535# CONFIG_PARPORT is not set
536CONFIG_BLK_DEV=y
537# CONFIG_BLK_DEV_COW_COMMON is not set
538CONFIG_BLK_DEV_LOOP=y
539# CONFIG_BLK_DEV_CRYPTOLOOP is not set
540
541#
542# DRBD disabled because PROC_FS, INET or CONNECTOR not selected
543#
544# CONFIG_BLK_DEV_NBD is not set
545CONFIG_BLK_DEV_UB=y
546# CONFIG_BLK_DEV_RAM is not set
547# CONFIG_CDROM_PKTCDVD is not set
548# CONFIG_ATA_OVER_ETH is not set
549# CONFIG_BLK_DEV_HD is not set
550# CONFIG_MISC_DEVICES is not set
551CONFIG_HAVE_IDE=y
552CONFIG_IDE=y
553
554#
555# Please see Documentation/ide/ide.txt for help/info on IDE drives
556#
557CONFIG_IDE_XFER_MODE=y
558CONFIG_IDE_ATAPI=y
559# CONFIG_BLK_DEV_IDE_SATA is not set
560CONFIG_IDE_GD=y
561CONFIG_IDE_GD_ATA=y
562# CONFIG_IDE_GD_ATAPI is not set
563CONFIG_BLK_DEV_IDECS=y
564CONFIG_BLK_DEV_IDECD=y
565CONFIG_BLK_DEV_IDECD_VERBOSE_ERRORS=y
566# CONFIG_BLK_DEV_IDETAPE is not set
567CONFIG_IDE_TASK_IOCTL=y
568# CONFIG_IDE_PROC_FS is not set
569
570#
571# IDE chipset support/bugfixes
572#
573# CONFIG_IDE_GENERIC is not set
574# CONFIG_BLK_DEV_PLATFORM is not set
575CONFIG_BLK_DEV_IDE_AU1XXX=y
576CONFIG_BLK_DEV_IDE_AU1XXX_PIO_DBDMA=y
577# CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA is not set
578# CONFIG_BLK_DEV_IDEDMA is not set
579
580#
581# SCSI device support
582#
583# CONFIG_RAID_ATTRS is not set
584# CONFIG_SCSI is not set
585# CONFIG_SCSI_DMA is not set
586# CONFIG_SCSI_NETLINK is not set
587# CONFIG_ATA is not set
588# CONFIG_MD is not set
589CONFIG_NETDEVICES=y
590# CONFIG_DUMMY is not set
591# CONFIG_BONDING is not set
592# CONFIG_MACVLAN is not set
593# CONFIG_EQUALIZER is not set
594# CONFIG_TUN is not set
595# CONFIG_VETH is not set
596# CONFIG_PHYLIB is not set
597CONFIG_NET_ETHERNET=y
598CONFIG_MII=y
599# CONFIG_AX88796 is not set
600# CONFIG_MIPS_AU1X00_ENET is not set
601CONFIG_SMC91X=y
602# CONFIG_DM9000 is not set
603# CONFIG_ENC28J60 is not set
604# CONFIG_ETHOC is not set
605# CONFIG_SMSC911X is not set
606# CONFIG_DNET is not set
607# CONFIG_IBM_NEW_EMAC_ZMII is not set
608# CONFIG_IBM_NEW_EMAC_RGMII is not set
609# CONFIG_IBM_NEW_EMAC_TAH is not set
610# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
611# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
612# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
613# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
614# CONFIG_B44 is not set
615# CONFIG_KS8842 is not set
616# CONFIG_KS8851 is not set
617# CONFIG_KS8851_MLL is not set
618# CONFIG_NETDEV_1000 is not set
619# CONFIG_NETDEV_10000 is not set
620# CONFIG_WLAN is not set
621
622#
623# Enable WiMAX (Networking options) to see the WiMAX drivers
624#
625
626#
627# USB Network Adapters
628#
629# CONFIG_USB_CATC is not set
630# CONFIG_USB_KAWETH is not set
631# CONFIG_USB_PEGASUS is not set
632# CONFIG_USB_RTL8150 is not set
633# CONFIG_USB_USBNET is not set
634# CONFIG_NET_PCMCIA is not set
635# CONFIG_WAN is not set
636# CONFIG_PPP is not set
637# CONFIG_SLIP is not set
638# CONFIG_NETCONSOLE is not set
639# CONFIG_NETPOLL is not set
640# CONFIG_NET_POLL_CONTROLLER is not set
641# CONFIG_ISDN is not set
642# CONFIG_PHONE is not set
643
644#
645# Input device support
646#
647CONFIG_INPUT=y
648# CONFIG_INPUT_FF_MEMLESS is not set
649# CONFIG_INPUT_POLLDEV is not set
650# CONFIG_INPUT_SPARSEKMAP is not set
651
652#
653# Userland interfaces
654#
655# CONFIG_INPUT_MOUSEDEV is not set
656# CONFIG_INPUT_JOYDEV is not set
657CONFIG_INPUT_EVDEV=y
658# CONFIG_INPUT_EVBUG is not set
659
660#
661# Input Device Drivers
662#
663# CONFIG_INPUT_KEYBOARD is not set
664# CONFIG_INPUT_MOUSE is not set
665# CONFIG_INPUT_JOYSTICK is not set
666# CONFIG_INPUT_TABLET is not set
667# CONFIG_INPUT_TOUCHSCREEN is not set
668# CONFIG_INPUT_MISC is not set
669
670#
671# Hardware I/O ports
672#
673# CONFIG_SERIO is not set
674# CONFIG_GAMEPORT is not set
675
676#
677# Character devices
678#
679CONFIG_VT=y
680CONFIG_CONSOLE_TRANSLATIONS=y
681CONFIG_VT_CONSOLE=y
682CONFIG_HW_CONSOLE=y
683CONFIG_VT_HW_CONSOLE_BINDING=y
684CONFIG_DEVKMEM=y
685# CONFIG_SERIAL_NONSTANDARD is not set
686
687#
688# Serial drivers
689#
690CONFIG_SERIAL_8250=y
691CONFIG_SERIAL_8250_CONSOLE=y
692# CONFIG_SERIAL_8250_CS is not set
693CONFIG_SERIAL_8250_NR_UARTS=2
694CONFIG_SERIAL_8250_RUNTIME_UARTS=2
695# CONFIG_SERIAL_8250_EXTENDED is not set
696CONFIG_SERIAL_8250_AU1X00=y
697
698#
699# Non-8250 serial port support
700#
701# CONFIG_SERIAL_MAX3100 is not set
702CONFIG_SERIAL_CORE=y
703CONFIG_SERIAL_CORE_CONSOLE=y
704CONFIG_UNIX98_PTYS=y
705# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
706# CONFIG_LEGACY_PTYS is not set
707# CONFIG_IPMI_HANDLER is not set
708# CONFIG_HW_RANDOM is not set
709# CONFIG_R3964 is not set
710
711#
712# PCMCIA character devices
713#
714# CONFIG_SYNCLINK_CS is not set
715# CONFIG_CARDMAN_4000 is not set
716# CONFIG_CARDMAN_4040 is not set
717# CONFIG_IPWIRELESS is not set
718# CONFIG_RAW_DRIVER is not set
719# CONFIG_TCG_TPM is not set
720CONFIG_I2C=y
721CONFIG_I2C_BOARDINFO=y
722# CONFIG_I2C_COMPAT is not set
723CONFIG_I2C_CHARDEV=y
724# CONFIG_I2C_HELPER_AUTO is not set
725
726#
727# I2C Algorithms
728#
729# CONFIG_I2C_ALGOBIT is not set
730# CONFIG_I2C_ALGOPCF is not set
731# CONFIG_I2C_ALGOPCA is not set
732
733#
734# I2C Hardware Bus support
735#
736
737#
738# I2C system bus drivers (mostly embedded / system-on-chip)
739#
740CONFIG_I2C_AU1550=y
741# CONFIG_I2C_GPIO is not set
742# CONFIG_I2C_OCORES is not set
743# CONFIG_I2C_SIMTEC is not set
744
745#
746# External I2C/SMBus adapter drivers
747#
748# CONFIG_I2C_PARPORT_LIGHT is not set
749# CONFIG_I2C_TAOS_EVM is not set
750# CONFIG_I2C_TINY_USB is not set
751
752#
753# Other I2C/SMBus bus drivers
754#
755# CONFIG_I2C_PCA_PLATFORM is not set
756# CONFIG_I2C_STUB is not set
757
758#
759# Miscellaneous I2C Chip support
760#
761# CONFIG_SENSORS_TSL2550 is not set
762# CONFIG_I2C_DEBUG_CORE is not set
763# CONFIG_I2C_DEBUG_ALGO is not set
764# CONFIG_I2C_DEBUG_BUS is not set
765# CONFIG_I2C_DEBUG_CHIP is not set
766CONFIG_SPI=y
767# CONFIG_SPI_DEBUG is not set
768CONFIG_SPI_MASTER=y
769
770#
771# SPI Master Controller Drivers
772#
773CONFIG_SPI_AU1550=y
774CONFIG_SPI_BITBANG=y
775# CONFIG_SPI_GPIO is not set
776# CONFIG_SPI_XILINX is not set
777# CONFIG_SPI_DESIGNWARE is not set
778
779#
780# SPI Protocol Masters
781#
782# CONFIG_SPI_SPIDEV is not set
783# CONFIG_SPI_TLE62X0 is not set
784
785#
786# PPS support
787#
788# CONFIG_PPS is not set
789CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
790CONFIG_GPIOLIB=y
791# CONFIG_DEBUG_GPIO is not set
792CONFIG_GPIO_SYSFS=y
793
794#
795# Memory mapped GPIO expanders:
796#
797
798#
799# I2C GPIO expanders:
800#
801# CONFIG_GPIO_MAX732X is not set
802# CONFIG_GPIO_PCA953X is not set
803# CONFIG_GPIO_PCF857X is not set
804# CONFIG_GPIO_ADP5588 is not set
805
806#
807# PCI GPIO expanders:
808#
809
810#
811# SPI GPIO expanders:
812#
813# CONFIG_GPIO_MAX7301 is not set
814# CONFIG_GPIO_MCP23S08 is not set
815# CONFIG_GPIO_MC33880 is not set
816
817#
818# AC97 GPIO expanders:
819#
820# CONFIG_W1 is not set
821# CONFIG_POWER_SUPPLY is not set
822CONFIG_HWMON=y
823CONFIG_HWMON_VID=y
824# CONFIG_HWMON_DEBUG_CHIP is not set
825
826#
827# Native drivers
828#
829# CONFIG_SENSORS_AD7414 is not set
830# CONFIG_SENSORS_AD7418 is not set
831# CONFIG_SENSORS_ADCXX is not set
832# CONFIG_SENSORS_ADM1021 is not set
833CONFIG_SENSORS_ADM1025=y
834# CONFIG_SENSORS_ADM1026 is not set
835# CONFIG_SENSORS_ADM1029 is not set
836# CONFIG_SENSORS_ADM1031 is not set
837# CONFIG_SENSORS_ADM9240 is not set
838# CONFIG_SENSORS_ADT7462 is not set
839# CONFIG_SENSORS_ADT7470 is not set
840# CONFIG_SENSORS_ADT7473 is not set
841# CONFIG_SENSORS_ADT7475 is not set
842# CONFIG_SENSORS_ATXP1 is not set
843# CONFIG_SENSORS_DS1621 is not set
844# CONFIG_SENSORS_F71805F is not set
845# CONFIG_SENSORS_F71882FG is not set
846# CONFIG_SENSORS_F75375S is not set
847# CONFIG_SENSORS_G760A is not set
848# CONFIG_SENSORS_GL518SM is not set
849# CONFIG_SENSORS_GL520SM is not set
850# CONFIG_SENSORS_IT87 is not set
851# CONFIG_SENSORS_LM63 is not set
852CONFIG_SENSORS_LM70=y
853# CONFIG_SENSORS_LM73 is not set
854# CONFIG_SENSORS_LM75 is not set
855# CONFIG_SENSORS_LM77 is not set
856# CONFIG_SENSORS_LM78 is not set
857# CONFIG_SENSORS_LM80 is not set
858# CONFIG_SENSORS_LM83 is not set
859# CONFIG_SENSORS_LM85 is not set
860# CONFIG_SENSORS_LM87 is not set
861# CONFIG_SENSORS_LM90 is not set
862# CONFIG_SENSORS_LM92 is not set
863# CONFIG_SENSORS_LM93 is not set
864# CONFIG_SENSORS_LTC4215 is not set
865# CONFIG_SENSORS_LTC4245 is not set
866# CONFIG_SENSORS_LM95241 is not set
867# CONFIG_SENSORS_MAX1111 is not set
868# CONFIG_SENSORS_MAX1619 is not set
869# CONFIG_SENSORS_MAX6650 is not set
870# CONFIG_SENSORS_PC87360 is not set
871# CONFIG_SENSORS_PC87427 is not set
872# CONFIG_SENSORS_PCF8591 is not set
873# CONFIG_SENSORS_SHT15 is not set
874# CONFIG_SENSORS_DME1737 is not set
875# CONFIG_SENSORS_SMSC47M1 is not set
876# CONFIG_SENSORS_SMSC47M192 is not set
877# CONFIG_SENSORS_SMSC47B397 is not set
878# CONFIG_SENSORS_ADS7828 is not set
879# CONFIG_SENSORS_AMC6821 is not set
880# CONFIG_SENSORS_THMC50 is not set
881# CONFIG_SENSORS_TMP401 is not set
882# CONFIG_SENSORS_TMP421 is not set
883# CONFIG_SENSORS_VT1211 is not set
884# CONFIG_SENSORS_W83781D is not set
885# CONFIG_SENSORS_W83791D is not set
886# CONFIG_SENSORS_W83792D is not set
887# CONFIG_SENSORS_W83793 is not set
888# CONFIG_SENSORS_W83L785TS is not set
889# CONFIG_SENSORS_W83L786NG is not set
890# CONFIG_SENSORS_W83627HF is not set
891# CONFIG_SENSORS_W83627EHF is not set
892# CONFIG_SENSORS_LIS3_SPI is not set
893# CONFIG_SENSORS_LIS3_I2C is not set
894# CONFIG_THERMAL is not set
895# CONFIG_WATCHDOG is not set
896CONFIG_SSB_POSSIBLE=y
897
898#
899# Sonics Silicon Backplane
900#
901# CONFIG_SSB is not set
902
903#
904# Multifunction device drivers
905#
906# CONFIG_MFD_CORE is not set
907# CONFIG_MFD_SM501 is not set
908# CONFIG_HTC_PASIC3 is not set
909# CONFIG_UCB1400_CORE is not set
910# CONFIG_TPS65010 is not set
911# CONFIG_TWL4030_CORE is not set
912# CONFIG_MFD_TMIO is not set
913# CONFIG_PMIC_DA903X is not set
914# CONFIG_PMIC_ADP5520 is not set
915# CONFIG_MFD_WM8400 is not set
916# CONFIG_MFD_WM831X is not set
917# CONFIG_MFD_WM8350_I2C is not set
918# CONFIG_MFD_PCF50633 is not set
919# CONFIG_MFD_MC13783 is not set
920# CONFIG_AB3100_CORE is not set
921# CONFIG_EZX_PCAP is not set
922# CONFIG_MFD_88PM8607 is not set
923# CONFIG_AB4500_CORE is not set
924# CONFIG_REGULATOR is not set
925# CONFIG_MEDIA_SUPPORT is not set
926
927#
928# Graphics support
929#
930# CONFIG_VGASTATE is not set
931# CONFIG_VIDEO_OUTPUT_CONTROL is not set
932CONFIG_FB=y
933# CONFIG_FIRMWARE_EDID is not set
934# CONFIG_FB_DDC is not set
935# CONFIG_FB_BOOT_VESA_SUPPORT is not set
936CONFIG_FB_CFB_FILLRECT=y
937CONFIG_FB_CFB_COPYAREA=y
938CONFIG_FB_CFB_IMAGEBLIT=y
939# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
940# CONFIG_FB_SYS_FILLRECT is not set
941# CONFIG_FB_SYS_COPYAREA is not set
942# CONFIG_FB_SYS_IMAGEBLIT is not set
943# CONFIG_FB_FOREIGN_ENDIAN is not set
944# CONFIG_FB_SYS_FOPS is not set
945# CONFIG_FB_SVGALIB is not set
946# CONFIG_FB_MACMODES is not set
947# CONFIG_FB_BACKLIGHT is not set
948# CONFIG_FB_MODE_HELPERS is not set
949# CONFIG_FB_TILEBLITTING is not set
950
951#
952# Frame buffer hardware drivers
953#
954# CONFIG_FB_S1D13XXX is not set
955CONFIG_FB_AU1200=y
956# CONFIG_FB_VIRTUAL is not set
957# CONFIG_FB_METRONOME is not set
958# CONFIG_FB_MB862XX is not set
959# CONFIG_FB_BROADSHEET is not set
960# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
961
962#
963# Display device support
964#
965# CONFIG_DISPLAY_SUPPORT is not set
966
967#
968# Console display driver support
969#
970# CONFIG_VGA_CONSOLE is not set
971CONFIG_DUMMY_CONSOLE=y
972CONFIG_FRAMEBUFFER_CONSOLE=y
973# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
974# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
975CONFIG_FONTS=y
976# CONFIG_FONT_8x8 is not set
977CONFIG_FONT_8x16=y
978# CONFIG_FONT_6x11 is not set
979# CONFIG_FONT_7x14 is not set
980# CONFIG_FONT_PEARL_8x8 is not set
981# CONFIG_FONT_ACORN_8x8 is not set
982# CONFIG_FONT_MINI_4x6 is not set
983# CONFIG_FONT_SUN8x16 is not set
984# CONFIG_FONT_SUN12x22 is not set
985# CONFIG_FONT_10x18 is not set
986# CONFIG_LOGO is not set
987CONFIG_SOUND=y
988# CONFIG_SOUND_OSS_CORE is not set
989CONFIG_SND=y
990CONFIG_SND_TIMER=y
991CONFIG_SND_PCM=y
992CONFIG_SND_JACK=y
993# CONFIG_SND_SEQUENCER is not set
994# CONFIG_SND_MIXER_OSS is not set
995# CONFIG_SND_PCM_OSS is not set
996# CONFIG_SND_HRTIMER is not set
997CONFIG_SND_DYNAMIC_MINORS=y
998# CONFIG_SND_SUPPORT_OLD_API is not set
999# CONFIG_SND_VERBOSE_PROCFS is not set
1000# CONFIG_SND_VERBOSE_PRINTK is not set
1001# CONFIG_SND_DEBUG is not set
1002CONFIG_SND_VMASTER=y
1003# CONFIG_SND_RAWMIDI_SEQ is not set
1004# CONFIG_SND_OPL3_LIB_SEQ is not set
1005# CONFIG_SND_OPL4_LIB_SEQ is not set
1006# CONFIG_SND_SBAWE_SEQ is not set
1007# CONFIG_SND_EMU10K1_SEQ is not set
1008CONFIG_SND_AC97_CODEC=y
1009# CONFIG_SND_DRIVERS is not set
1010# CONFIG_SND_SPI is not set
1011# CONFIG_SND_MIPS is not set
1012# CONFIG_SND_USB is not set
1013# CONFIG_SND_PCMCIA is not set
1014CONFIG_SND_SOC=y
1015CONFIG_SND_SOC_AC97_BUS=y
1016CONFIG_SND_SOC_AU1XPSC=y
1017CONFIG_SND_SOC_AU1XPSC_I2S=y
1018CONFIG_SND_SOC_AU1XPSC_AC97=y
1019CONFIG_SND_SOC_DB1200=y
1020CONFIG_SND_SOC_I2C_AND_SPI=y
1021# CONFIG_SND_SOC_ALL_CODECS is not set
1022CONFIG_SND_SOC_AC97_CODEC=y
1023CONFIG_SND_SOC_WM8731=y
1024# CONFIG_SOUND_PRIME is not set
1025CONFIG_AC97_BUS=y
1026CONFIG_HID_SUPPORT=y
1027CONFIG_HID=y
1028CONFIG_HIDRAW=y
1029
1030#
1031# USB Input Devices
1032#
1033CONFIG_USB_HID=y
1034# CONFIG_HID_PID is not set
1035CONFIG_USB_HIDDEV=y
1036
1037#
1038# Special HID drivers
1039#
1040# CONFIG_HID_A4TECH is not set
1041# CONFIG_HID_APPLE is not set
1042# CONFIG_HID_BELKIN is not set
1043# CONFIG_HID_CHERRY is not set
1044# CONFIG_HID_CHICONY is not set
1045# CONFIG_HID_CYPRESS is not set
1046# CONFIG_HID_DRAGONRISE is not set
1047# CONFIG_HID_EZKEY is not set
1048# CONFIG_HID_KYE is not set
1049# CONFIG_HID_GYRATION is not set
1050# CONFIG_HID_TWINHAN is not set
1051# CONFIG_HID_KENSINGTON is not set
1052# CONFIG_HID_LOGITECH is not set
1053# CONFIG_HID_MICROSOFT is not set
1054# CONFIG_HID_MONTEREY is not set
1055# CONFIG_HID_NTRIG is not set
1056# CONFIG_HID_PANTHERLORD is not set
1057# CONFIG_HID_PETALYNX is not set
1058# CONFIG_HID_SAMSUNG is not set
1059# CONFIG_HID_SONY is not set
1060# CONFIG_HID_SUNPLUS is not set
1061# CONFIG_HID_GREENASIA is not set
1062# CONFIG_HID_SMARTJOYPLUS is not set
1063# CONFIG_HID_TOPSEED is not set
1064# CONFIG_HID_THRUSTMASTER is not set
1065# CONFIG_HID_ZEROPLUS is not set
1066CONFIG_USB_SUPPORT=y
1067CONFIG_USB_ARCH_HAS_HCD=y
1068CONFIG_USB_ARCH_HAS_OHCI=y
1069CONFIG_USB_ARCH_HAS_EHCI=y
1070CONFIG_USB=y
1071CONFIG_USB_DEBUG=y
1072CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
1073
1074#
1075# Miscellaneous USB options
1076#
1077# CONFIG_USB_DEVICEFS is not set
1078# CONFIG_USB_DEVICE_CLASS is not set
1079CONFIG_USB_DYNAMIC_MINORS=y
1080# CONFIG_USB_OTG is not set
1081# CONFIG_USB_OTG_WHITELIST is not set
1082# CONFIG_USB_OTG_BLACKLIST_HUB is not set
1083# CONFIG_USB_MON is not set
1084# CONFIG_USB_WUSB is not set
1085# CONFIG_USB_WUSB_CBAF is not set
1086
1087#
1088# USB Host Controller Drivers
1089#
1090# CONFIG_USB_C67X00_HCD is not set
1091CONFIG_USB_EHCI_HCD=y
1092CONFIG_USB_EHCI_ROOT_HUB_TT=y
1093CONFIG_USB_EHCI_TT_NEWSCHED=y
1094# CONFIG_USB_OXU210HP_HCD is not set
1095# CONFIG_USB_ISP116X_HCD is not set
1096# CONFIG_USB_ISP1760_HCD is not set
1097# CONFIG_USB_ISP1362_HCD is not set
1098CONFIG_USB_OHCI_HCD=y
1099# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
1100# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
1101CONFIG_USB_OHCI_LITTLE_ENDIAN=y
1102# CONFIG_USB_SL811_HCD is not set
1103# CONFIG_USB_R8A66597_HCD is not set
1104# CONFIG_USB_HWA_HCD is not set
1105
1106#
1107# USB Device Class drivers
1108#
1109# CONFIG_USB_ACM is not set
1110# CONFIG_USB_PRINTER is not set
1111# CONFIG_USB_WDM is not set
1112# CONFIG_USB_TMC is not set
1113
1114#
1115# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
1116#
1117
1118#
1119# also be needed; see USB_STORAGE Help for more info
1120#
1121# CONFIG_USB_LIBUSUAL is not set
1122
1123#
1124# USB Imaging devices
1125#
1126# CONFIG_USB_MDC800 is not set
1127
1128#
1129# USB port drivers
1130#
1131# CONFIG_USB_SERIAL is not set
1132
1133#
1134# USB Miscellaneous drivers
1135#
1136# CONFIG_USB_EMI62 is not set
1137# CONFIG_USB_EMI26 is not set
1138# CONFIG_USB_ADUTUX is not set
1139# CONFIG_USB_SEVSEG is not set
1140# CONFIG_USB_RIO500 is not set
1141# CONFIG_USB_LEGOTOWER is not set
1142# CONFIG_USB_LCD is not set
1143# CONFIG_USB_BERRY_CHARGE is not set
1144# CONFIG_USB_LED is not set
1145# CONFIG_USB_CYPRESS_CY7C63 is not set
1146# CONFIG_USB_CYTHERM is not set
1147# CONFIG_USB_IDMOUSE is not set
1148# CONFIG_USB_FTDI_ELAN is not set
1149# CONFIG_USB_APPLEDISPLAY is not set
1150# CONFIG_USB_SISUSBVGA is not set
1151# CONFIG_USB_LD is not set
1152# CONFIG_USB_TRANCEVIBRATOR is not set
1153# CONFIG_USB_IOWARRIOR is not set
1154# CONFIG_USB_TEST is not set
1155# CONFIG_USB_ISIGHTFW is not set
1156# CONFIG_USB_VST is not set
1157# CONFIG_USB_GADGET is not set
1158
1159#
1160# OTG and related infrastructure
1161#
1162# CONFIG_USB_GPIO_VBUS is not set
1163# CONFIG_NOP_USB_XCEIV is not set
1164CONFIG_MMC=y
1165# CONFIG_MMC_DEBUG is not set
1166# CONFIG_MMC_UNSAFE_RESUME is not set
1167
1168#
1169# MMC/SD/SDIO Card Drivers
1170#
1171CONFIG_MMC_BLOCK=y
1172# CONFIG_MMC_BLOCK_BOUNCE is not set
1173# CONFIG_SDIO_UART is not set
1174# CONFIG_MMC_TEST is not set
1175
1176#
1177# MMC/SD/SDIO Host Controller Drivers
1178#
1179# CONFIG_MMC_SDHCI is not set
1180CONFIG_MMC_AU1X=y
1181# CONFIG_MMC_AT91 is not set
1182# CONFIG_MMC_ATMELMCI is not set
1183# CONFIG_MMC_SPI is not set
1184# CONFIG_MEMSTICK is not set
1185CONFIG_NEW_LEDS=y
1186CONFIG_LEDS_CLASS=y
1187
1188#
1189# LED drivers
1190#
1191# CONFIG_LEDS_PCA9532 is not set
1192# CONFIG_LEDS_GPIO is not set
1193# CONFIG_LEDS_LP3944 is not set
1194# CONFIG_LEDS_PCA955X is not set
1195# CONFIG_LEDS_DAC124S085 is not set
1196# CONFIG_LEDS_BD2802 is not set
1197# CONFIG_LEDS_LT3593 is not set
1198
1199#
1200# LED Triggers
1201#
1202CONFIG_LEDS_TRIGGERS=y
1203# CONFIG_LEDS_TRIGGER_TIMER is not set
1204# CONFIG_LEDS_TRIGGER_IDE_DISK is not set
1205# CONFIG_LEDS_TRIGGER_HEARTBEAT is not set
1206# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set
1207# CONFIG_LEDS_TRIGGER_GPIO is not set
1208# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set
1209
1210#
1211# iptables trigger is under Netfilter config (LED target)
1212#
1213# CONFIG_ACCESSIBILITY is not set
1214CONFIG_RTC_LIB=y
1215CONFIG_RTC_CLASS=y
1216CONFIG_RTC_HCTOSYS=y
1217CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
1218# CONFIG_RTC_DEBUG is not set
1219
1220#
1221# RTC interfaces
1222#
1223CONFIG_RTC_INTF_SYSFS=y
1224CONFIG_RTC_INTF_PROC=y
1225CONFIG_RTC_INTF_DEV=y
1226# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
1227# CONFIG_RTC_DRV_TEST is not set
1228
1229#
1230# I2C RTC drivers
1231#
1232# CONFIG_RTC_DRV_DS1307 is not set
1233# CONFIG_RTC_DRV_DS1374 is not set
1234# CONFIG_RTC_DRV_DS1672 is not set
1235# CONFIG_RTC_DRV_MAX6900 is not set
1236# CONFIG_RTC_DRV_RS5C372 is not set
1237# CONFIG_RTC_DRV_ISL1208 is not set
1238# CONFIG_RTC_DRV_X1205 is not set
1239# CONFIG_RTC_DRV_PCF8563 is not set
1240# CONFIG_RTC_DRV_PCF8583 is not set
1241# CONFIG_RTC_DRV_M41T80 is not set
1242# CONFIG_RTC_DRV_BQ32K is not set
1243# CONFIG_RTC_DRV_S35390A is not set
1244# CONFIG_RTC_DRV_FM3130 is not set
1245# CONFIG_RTC_DRV_RX8581 is not set
1246# CONFIG_RTC_DRV_RX8025 is not set
1247
1248#
1249# SPI RTC drivers
1250#
1251# CONFIG_RTC_DRV_M41T94 is not set
1252# CONFIG_RTC_DRV_DS1305 is not set
1253# CONFIG_RTC_DRV_DS1390 is not set
1254# CONFIG_RTC_DRV_MAX6902 is not set
1255# CONFIG_RTC_DRV_R9701 is not set
1256# CONFIG_RTC_DRV_RS5C348 is not set
1257# CONFIG_RTC_DRV_DS3234 is not set
1258# CONFIG_RTC_DRV_PCF2123 is not set
1259
1260#
1261# Platform RTC drivers
1262#
1263# CONFIG_RTC_DRV_CMOS is not set
1264# CONFIG_RTC_DRV_DS1286 is not set
1265# CONFIG_RTC_DRV_DS1511 is not set
1266# CONFIG_RTC_DRV_DS1553 is not set
1267# CONFIG_RTC_DRV_DS1742 is not set
1268# CONFIG_RTC_DRV_STK17TA8 is not set
1269# CONFIG_RTC_DRV_M48T86 is not set
1270# CONFIG_RTC_DRV_M48T35 is not set
1271# CONFIG_RTC_DRV_M48T59 is not set
1272# CONFIG_RTC_DRV_MSM6242 is not set
1273# CONFIG_RTC_DRV_BQ4802 is not set
1274# CONFIG_RTC_DRV_RP5C01 is not set
1275# CONFIG_RTC_DRV_V3020 is not set
1276
1277#
1278# on-CPU RTC drivers
1279#
1280CONFIG_RTC_DRV_AU1XXX=y
1281# CONFIG_DMADEVICES is not set
1282# CONFIG_AUXDISPLAY is not set
1283# CONFIG_UIO is not set
1284
1285#
1286# TI VLYNQ
1287#
1288# CONFIG_STAGING is not set
1289
1290#
1291# File systems
1292#
1293CONFIG_EXT2_FS=y
1294# CONFIG_EXT2_FS_XATTR is not set
1295# CONFIG_EXT2_FS_XIP is not set
1296# CONFIG_EXT3_FS is not set
1297# CONFIG_EXT4_FS is not set
1298# CONFIG_REISERFS_FS is not set
1299# CONFIG_JFS_FS is not set
1300# CONFIG_FS_POSIX_ACL is not set
1301# CONFIG_XFS_FS is not set
1302# CONFIG_OCFS2_FS is not set
1303# CONFIG_BTRFS_FS is not set
1304# CONFIG_NILFS2_FS is not set
1305CONFIG_FILE_LOCKING=y
1306CONFIG_FSNOTIFY=y
1307CONFIG_DNOTIFY=y
1308CONFIG_INOTIFY=y
1309CONFIG_INOTIFY_USER=y
1310# CONFIG_QUOTA is not set
1311# CONFIG_AUTOFS_FS is not set
1312# CONFIG_AUTOFS4_FS is not set
1313# CONFIG_FUSE_FS is not set
1314
1315#
1316# Caches
1317#
1318# CONFIG_FSCACHE is not set
1319
1320#
1321# CD-ROM/DVD Filesystems
1322#
1323CONFIG_ISO9660_FS=y
1324CONFIG_JOLIET=y
1325CONFIG_ZISOFS=y
1326CONFIG_UDF_FS=y
1327CONFIG_UDF_NLS=y
1328
1329#
1330# DOS/FAT/NT Filesystems
1331#
1332CONFIG_FAT_FS=y
1333# CONFIG_MSDOS_FS is not set
1334CONFIG_VFAT_FS=y
1335CONFIG_FAT_DEFAULT_CODEPAGE=437
1336CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1337# CONFIG_NTFS_FS is not set
1338
1339#
1340# Pseudo filesystems
1341#
1342CONFIG_PROC_FS=y
1343# CONFIG_PROC_KCORE is not set
1344CONFIG_PROC_SYSCTL=y
1345# CONFIG_PROC_PAGE_MONITOR is not set
1346CONFIG_SYSFS=y
1347CONFIG_TMPFS=y
1348# CONFIG_TMPFS_POSIX_ACL is not set
1349# CONFIG_HUGETLB_PAGE is not set
1350# CONFIG_CONFIGFS_FS is not set
1351CONFIG_MISC_FILESYSTEMS=y
1352# CONFIG_ADFS_FS is not set
1353# CONFIG_AFFS_FS is not set
1354# CONFIG_HFS_FS is not set
1355# CONFIG_HFSPLUS_FS is not set
1356# CONFIG_BEFS_FS is not set
1357# CONFIG_BFS_FS is not set
1358# CONFIG_EFS_FS is not set
1359CONFIG_JFFS2_FS=y
1360CONFIG_JFFS2_FS_DEBUG=0
1361CONFIG_JFFS2_FS_WRITEBUFFER=y
1362# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
1363CONFIG_JFFS2_SUMMARY=y
1364# CONFIG_JFFS2_FS_XATTR is not set
1365CONFIG_JFFS2_COMPRESSION_OPTIONS=y
1366CONFIG_JFFS2_ZLIB=y
1367CONFIG_JFFS2_LZO=y
1368CONFIG_JFFS2_RTIME=y
1369CONFIG_JFFS2_RUBIN=y
1370# CONFIG_JFFS2_CMODE_NONE is not set
1371CONFIG_JFFS2_CMODE_PRIORITY=y
1372# CONFIG_JFFS2_CMODE_SIZE is not set
1373# CONFIG_JFFS2_CMODE_FAVOURLZO is not set
1374# CONFIG_CRAMFS is not set
1375CONFIG_SQUASHFS=y
1376# CONFIG_SQUASHFS_EMBEDDED is not set
1377CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
1378# CONFIG_VXFS_FS is not set
1379# CONFIG_MINIX_FS is not set
1380# CONFIG_OMFS_FS is not set
1381# CONFIG_HPFS_FS is not set
1382# CONFIG_QNX4FS_FS is not set
1383# CONFIG_ROMFS_FS is not set
1384# CONFIG_SYSV_FS is not set
1385# CONFIG_UFS_FS is not set
1386CONFIG_NETWORK_FILESYSTEMS=y
1387CONFIG_NFS_FS=y
1388CONFIG_NFS_V3=y
1389# CONFIG_NFS_V3_ACL is not set
1390# CONFIG_NFS_V4 is not set
1391CONFIG_ROOT_NFS=y
1392# CONFIG_NFSD is not set
1393CONFIG_LOCKD=y
1394CONFIG_LOCKD_V4=y
1395CONFIG_NFS_COMMON=y
1396CONFIG_SUNRPC=y
1397# CONFIG_RPCSEC_GSS_KRB5 is not set
1398# CONFIG_RPCSEC_GSS_SPKM3 is not set
1399# CONFIG_SMB_FS is not set
1400# CONFIG_CIFS is not set
1401# CONFIG_NCP_FS is not set
1402# CONFIG_CODA_FS is not set
1403# CONFIG_AFS_FS is not set
1404
1405#
1406# Partition Types
1407#
1408CONFIG_PARTITION_ADVANCED=y
1409# CONFIG_ACORN_PARTITION is not set
1410# CONFIG_OSF_PARTITION is not set
1411# CONFIG_AMIGA_PARTITION is not set
1412# CONFIG_ATARI_PARTITION is not set
1413# CONFIG_MAC_PARTITION is not set
1414CONFIG_MSDOS_PARTITION=y
1415# CONFIG_BSD_DISKLABEL is not set
1416# CONFIG_MINIX_SUBPARTITION is not set
1417# CONFIG_SOLARIS_X86_PARTITION is not set
1418# CONFIG_UNIXWARE_DISKLABEL is not set
1419# CONFIG_LDM_PARTITION is not set
1420# CONFIG_SGI_PARTITION is not set
1421# CONFIG_ULTRIX_PARTITION is not set
1422# CONFIG_SUN_PARTITION is not set
1423# CONFIG_KARMA_PARTITION is not set
1424CONFIG_EFI_PARTITION=y
1425# CONFIG_SYSV68_PARTITION is not set
1426CONFIG_NLS=y
1427CONFIG_NLS_DEFAULT="iso8859-1"
1428CONFIG_NLS_CODEPAGE_437=y
1429# CONFIG_NLS_CODEPAGE_737 is not set
1430# CONFIG_NLS_CODEPAGE_775 is not set
1431CONFIG_NLS_CODEPAGE_850=y
1432CONFIG_NLS_CODEPAGE_852=y
1433# CONFIG_NLS_CODEPAGE_855 is not set
1434# CONFIG_NLS_CODEPAGE_857 is not set
1435# CONFIG_NLS_CODEPAGE_860 is not set
1436# CONFIG_NLS_CODEPAGE_861 is not set
1437# CONFIG_NLS_CODEPAGE_862 is not set
1438# CONFIG_NLS_CODEPAGE_863 is not set
1439# CONFIG_NLS_CODEPAGE_864 is not set
1440# CONFIG_NLS_CODEPAGE_865 is not set
1441# CONFIG_NLS_CODEPAGE_866 is not set
1442# CONFIG_NLS_CODEPAGE_869 is not set
1443# CONFIG_NLS_CODEPAGE_936 is not set
1444# CONFIG_NLS_CODEPAGE_950 is not set
1445# CONFIG_NLS_CODEPAGE_932 is not set
1446# CONFIG_NLS_CODEPAGE_949 is not set
1447# CONFIG_NLS_CODEPAGE_874 is not set
1448# CONFIG_NLS_ISO8859_8 is not set
1449CONFIG_NLS_CODEPAGE_1250=y
1450# CONFIG_NLS_CODEPAGE_1251 is not set
1451CONFIG_NLS_ASCII=y
1452CONFIG_NLS_ISO8859_1=y
1453CONFIG_NLS_ISO8859_2=y
1454# CONFIG_NLS_ISO8859_3 is not set
1455# CONFIG_NLS_ISO8859_4 is not set
1456# CONFIG_NLS_ISO8859_5 is not set
1457# CONFIG_NLS_ISO8859_6 is not set
1458# CONFIG_NLS_ISO8859_7 is not set
1459# CONFIG_NLS_ISO8859_9 is not set
1460# CONFIG_NLS_ISO8859_13 is not set
1461# CONFIG_NLS_ISO8859_14 is not set
1462CONFIG_NLS_ISO8859_15=y
1463# CONFIG_NLS_KOI8_R is not set
1464# CONFIG_NLS_KOI8_U is not set
1465CONFIG_NLS_UTF8=y
1466# CONFIG_DLM is not set
1467
1468#
1469# Kernel hacking
1470#
1471CONFIG_TRACE_IRQFLAGS_SUPPORT=y
1472# CONFIG_PRINTK_TIME is not set
1473# CONFIG_ENABLE_WARN_DEPRECATED is not set
1474# CONFIG_ENABLE_MUST_CHECK is not set
1475CONFIG_FRAME_WARN=1024
1476CONFIG_MAGIC_SYSRQ=y
1477CONFIG_STRIP_ASM_SYMS=y
1478# CONFIG_UNUSED_SYMBOLS is not set
1479# CONFIG_DEBUG_FS is not set
1480# CONFIG_HEADERS_CHECK is not set
1481CONFIG_DEBUG_KERNEL=y
1482# CONFIG_DEBUG_SHIRQ is not set
1483# CONFIG_DETECT_SOFTLOCKUP is not set
1484# CONFIG_DETECT_HUNG_TASK is not set
1485# CONFIG_SCHED_DEBUG is not set
1486# CONFIG_SCHEDSTATS is not set
1487# CONFIG_TIMER_STATS is not set
1488# CONFIG_DEBUG_OBJECTS is not set
1489# CONFIG_DEBUG_SLAB is not set
1490# CONFIG_DEBUG_RT_MUTEXES is not set
1491# CONFIG_RT_MUTEX_TESTER is not set
1492# CONFIG_DEBUG_SPINLOCK is not set
1493# CONFIG_DEBUG_MUTEXES is not set
1494# CONFIG_DEBUG_LOCK_ALLOC is not set
1495# CONFIG_PROVE_LOCKING is not set
1496# CONFIG_LOCK_STAT is not set
1497# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1498# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1499# CONFIG_DEBUG_KOBJECT is not set
1500# CONFIG_DEBUG_INFO is not set
1501# CONFIG_DEBUG_VM is not set
1502# CONFIG_DEBUG_WRITECOUNT is not set
1503# CONFIG_DEBUG_MEMORY_INIT is not set
1504# CONFIG_DEBUG_LIST is not set
1505# CONFIG_DEBUG_SG is not set
1506# CONFIG_DEBUG_NOTIFIERS is not set
1507# CONFIG_DEBUG_CREDENTIALS is not set
1508# CONFIG_BOOT_PRINTK_DELAY is not set
1509# CONFIG_RCU_TORTURE_TEST is not set
1510# CONFIG_BACKTRACE_SELF_TEST is not set
1511# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1512# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
1513# CONFIG_FAULT_INJECTION is not set
1514# CONFIG_SYSCTL_SYSCALL_CHECK is not set
1515# CONFIG_PAGE_POISONING is not set
1516CONFIG_HAVE_FUNCTION_TRACER=y
1517CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1518CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y
1519CONFIG_HAVE_DYNAMIC_FTRACE=y
1520CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1521CONFIG_TRACING_SUPPORT=y
1522# CONFIG_FTRACE is not set
1523# CONFIG_SAMPLES is not set
1524CONFIG_HAVE_ARCH_KGDB=y
1525# CONFIG_KGDB is not set
1526CONFIG_EARLY_PRINTK=y
1527CONFIG_CMDLINE_BOOL=y
1528CONFIG_CMDLINE="console=ttyS0,115200"
1529# CONFIG_CMDLINE_OVERRIDE is not set
1530# CONFIG_DEBUG_STACK_USAGE is not set
1531# CONFIG_RUNTIME_DEBUG is not set
1532CONFIG_DEBUG_ZBOOT=y
1533
1534#
1535# Security options
1536#
1537CONFIG_KEYS=y
1538CONFIG_KEYS_DEBUG_PROC_KEYS=y
1539# CONFIG_SECURITY is not set
1540CONFIG_SECURITYFS=y
1541# CONFIG_DEFAULT_SECURITY_SELINUX is not set
1542# CONFIG_DEFAULT_SECURITY_SMACK is not set
1543# CONFIG_DEFAULT_SECURITY_TOMOYO is not set
1544CONFIG_DEFAULT_SECURITY_DAC=y
1545CONFIG_DEFAULT_SECURITY=""
1546# CONFIG_CRYPTO is not set
1547# CONFIG_BINARY_PRINTF is not set
1548
1549#
1550# Library routines
1551#
1552CONFIG_BITREVERSE=y
1553CONFIG_GENERIC_FIND_LAST_BIT=y
1554# CONFIG_CRC_CCITT is not set
1555# CONFIG_CRC16 is not set
1556# CONFIG_CRC_T10DIF is not set
1557CONFIG_CRC_ITU_T=y
1558CONFIG_CRC32=y
1559# CONFIG_CRC7 is not set
1560# CONFIG_LIBCRC32C is not set
1561CONFIG_ZLIB_INFLATE=y
1562CONFIG_ZLIB_DEFLATE=y
1563CONFIG_LZO_COMPRESS=y
1564CONFIG_LZO_DECOMPRESS=y
1565CONFIG_HAS_IOMEM=y
1566CONFIG_HAS_IOPORT=y
1567CONFIG_HAS_DMA=y
1568CONFIG_NLATTR=y
diff --git a/arch/mips/configs/pb1500_defconfig b/arch/mips/configs/pb1500_defconfig
index 5ec60836b645..7497d3306b91 100644
--- a/arch/mips/configs/pb1500_defconfig
+++ b/arch/mips/configs/pb1500_defconfig
@@ -1,78 +1,102 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.20 3# Linux kernel version: 2.6.33
4# Tue Feb 20 21:47:37 2007 4# Fri Feb 26 10:05:27 2010
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
8# 8#
9# Machine selection 9# Machine selection
10# 10#
11CONFIG_ZONE_DMA=y
12CONFIG_MACH_ALCHEMY=y 11CONFIG_MACH_ALCHEMY=y
13# CONFIG_MIPS_MTX1 is not set 12# CONFIG_AR7 is not set
14# CONFIG_MIPS_BOSPORUS is not set 13# CONFIG_BCM47XX is not set
15# CONFIG_MIPS_PB1000 is not set 14# CONFIG_BCM63XX is not set
16# CONFIG_MIPS_PB1100 is not set
17CONFIG_MIPS_PB1500=y
18# CONFIG_MIPS_PB1550 is not set
19# CONFIG_MIPS_PB1200 is not set
20# CONFIG_MIPS_DB1000 is not set
21# CONFIG_MIPS_DB1100 is not set
22# CONFIG_MIPS_DB1500 is not set
23# CONFIG_MIPS_DB1550 is not set
24# CONFIG_MIPS_DB1200 is not set
25# CONFIG_MIPS_MIRAGE is not set
26# CONFIG_MIPS_COBALT is not set 15# CONFIG_MIPS_COBALT is not set
27# CONFIG_MACH_DECSTATION is not set 16# CONFIG_MACH_DECSTATION is not set
28# CONFIG_MACH_JAZZ is not set 17# CONFIG_MACH_JAZZ is not set
18# CONFIG_LASAT is not set
19# CONFIG_MACH_LOONGSON is not set
29# CONFIG_MIPS_MALTA is not set 20# CONFIG_MIPS_MALTA is not set
30# CONFIG_WR_PPMC is not set
31# CONFIG_MIPS_SIM is not set 21# CONFIG_MIPS_SIM is not set
32# CONFIG_MOMENCO_JAGUAR_ATX is not set 22# CONFIG_NEC_MARKEINS is not set
33# CONFIG_MIPS_XXS1500 is not set 23# CONFIG_MACH_VR41XX is not set
24# CONFIG_NXP_STB220 is not set
25# CONFIG_NXP_STB225 is not set
34# CONFIG_PNX8550_JBS is not set 26# CONFIG_PNX8550_JBS is not set
35# CONFIG_PNX8550_STB810 is not set 27# CONFIG_PNX8550_STB810 is not set
36# CONFIG_MACH_VR41XX is not set 28# CONFIG_PMC_MSP is not set
37# CONFIG_PMC_YOSEMITE is not set 29# CONFIG_PMC_YOSEMITE is not set
38# CONFIG_MARKEINS is not set 30# CONFIG_POWERTV is not set
39# CONFIG_SGI_IP22 is not set 31# CONFIG_SGI_IP22 is not set
40# CONFIG_SGI_IP27 is not set 32# CONFIG_SGI_IP27 is not set
33# CONFIG_SGI_IP28 is not set
41# CONFIG_SGI_IP32 is not set 34# CONFIG_SGI_IP32 is not set
42# CONFIG_SIBYTE_BIGSUR is not set
43# CONFIG_SIBYTE_SWARM is not set
44# CONFIG_SIBYTE_SENTOSA is not set
45# CONFIG_SIBYTE_RHONE is not set
46# CONFIG_SIBYTE_CARMEL is not set
47# CONFIG_SIBYTE_LITTLESUR is not set
48# CONFIG_SIBYTE_CRHINE is not set 35# CONFIG_SIBYTE_CRHINE is not set
36# CONFIG_SIBYTE_CARMEL is not set
49# CONFIG_SIBYTE_CRHONE is not set 37# CONFIG_SIBYTE_CRHONE is not set
38# CONFIG_SIBYTE_RHONE is not set
39# CONFIG_SIBYTE_SWARM is not set
40# CONFIG_SIBYTE_LITTLESUR is not set
41# CONFIG_SIBYTE_SENTOSA is not set
42# CONFIG_SIBYTE_BIGSUR is not set
50# CONFIG_SNI_RM is not set 43# CONFIG_SNI_RM is not set
51# CONFIG_TOSHIBA_JMR3927 is not set 44# CONFIG_MACH_TX39XX is not set
52# CONFIG_TOSHIBA_RBTX4927 is not set 45# CONFIG_MACH_TX49XX is not set
53# CONFIG_TOSHIBA_RBTX4938 is not set 46# CONFIG_MIKROTIK_RB532 is not set
47# CONFIG_WR_PPMC is not set
48# CONFIG_CAVIUM_OCTEON_SIMULATOR is not set
49# CONFIG_CAVIUM_OCTEON_REFERENCE_BOARD is not set
50CONFIG_ALCHEMY_GPIOINT_AU1000=y
51# CONFIG_ALCHEMY_GPIO_INDIRECT is not set
52# CONFIG_MIPS_MTX1 is not set
53# CONFIG_MIPS_BOSPORUS is not set
54# CONFIG_MIPS_DB1000 is not set
55# CONFIG_MIPS_DB1100 is not set
56# CONFIG_MIPS_DB1200 is not set
57# CONFIG_MIPS_DB1500 is not set
58# CONFIG_MIPS_DB1550 is not set
59# CONFIG_MIPS_MIRAGE is not set
60# CONFIG_MIPS_PB1000 is not set
61# CONFIG_MIPS_PB1100 is not set
62# CONFIG_MIPS_PB1200 is not set
63CONFIG_MIPS_PB1500=y
64# CONFIG_MIPS_PB1550 is not set
65# CONFIG_MIPS_XXS1500 is not set
66CONFIG_SOC_AU1500=y
67CONFIG_SOC_AU1X00=y
68CONFIG_LOONGSON_UART_BASE=y
54CONFIG_RWSEM_GENERIC_SPINLOCK=y 69CONFIG_RWSEM_GENERIC_SPINLOCK=y
55# CONFIG_ARCH_HAS_ILOG2_U32 is not set 70# CONFIG_ARCH_HAS_ILOG2_U32 is not set
56# CONFIG_ARCH_HAS_ILOG2_U64 is not set 71# CONFIG_ARCH_HAS_ILOG2_U64 is not set
72CONFIG_ARCH_SUPPORTS_OPROFILE=y
57CONFIG_GENERIC_FIND_NEXT_BIT=y 73CONFIG_GENERIC_FIND_NEXT_BIT=y
58CONFIG_GENERIC_HWEIGHT=y 74CONFIG_GENERIC_HWEIGHT=y
59CONFIG_GENERIC_CALIBRATE_DELAY=y 75CONFIG_GENERIC_CALIBRATE_DELAY=y
76CONFIG_GENERIC_CLOCKEVENTS=y
60CONFIG_GENERIC_TIME=y 77CONFIG_GENERIC_TIME=y
61CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y 78CONFIG_GENERIC_CMOS_UPDATE=y
62# CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ is not set 79CONFIG_SCHED_OMIT_FRAME_POINTER=y
80CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
81CONFIG_CEVT_R4K_LIB=y
82CONFIG_CSRC_R4K_LIB=y
63CONFIG_DMA_NONCOHERENT=y 83CONFIG_DMA_NONCOHERENT=y
64CONFIG_DMA_NEED_PCI_MAP_STATE=y 84CONFIG_DMA_NEED_PCI_MAP_STATE=y
85CONFIG_SYS_HAS_EARLY_PRINTK=y
86# CONFIG_NO_IOPORT is not set
87CONFIG_GENERIC_GPIO=y
65# CONFIG_CPU_BIG_ENDIAN is not set 88# CONFIG_CPU_BIG_ENDIAN is not set
66CONFIG_CPU_LITTLE_ENDIAN=y 89CONFIG_CPU_LITTLE_ENDIAN=y
67CONFIG_SYS_SUPPORTS_APM_EMULATION=y 90CONFIG_SYS_SUPPORTS_APM_EMULATION=y
68CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y 91CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
69CONFIG_SOC_AU1500=y 92CONFIG_IRQ_CPU=y
70CONFIG_SOC_AU1X00=y
71CONFIG_MIPS_L1_CACHE_SHIFT=5 93CONFIG_MIPS_L1_CACHE_SHIFT=5
72 94
73# 95#
74# CPU selection 96# CPU selection
75# 97#
98# CONFIG_CPU_LOONGSON2E is not set
99# CONFIG_CPU_LOONGSON2F is not set
76CONFIG_CPU_MIPS32_R1=y 100CONFIG_CPU_MIPS32_R1=y
77# CONFIG_CPU_MIPS32_R2 is not set 101# CONFIG_CPU_MIPS32_R2 is not set
78# CONFIG_CPU_MIPS64_R1 is not set 102# CONFIG_CPU_MIPS64_R1 is not set
@@ -85,6 +109,7 @@ CONFIG_CPU_MIPS32_R1=y
85# CONFIG_CPU_TX49XX is not set 109# CONFIG_CPU_TX49XX is not set
86# CONFIG_CPU_R5000 is not set 110# CONFIG_CPU_R5000 is not set
87# CONFIG_CPU_R5432 is not set 111# CONFIG_CPU_R5432 is not set
112# CONFIG_CPU_R5500 is not set
88# CONFIG_CPU_R6000 is not set 113# CONFIG_CPU_R6000 is not set
89# CONFIG_CPU_NEVADA is not set 114# CONFIG_CPU_NEVADA is not set
90# CONFIG_CPU_R8000 is not set 115# CONFIG_CPU_R8000 is not set
@@ -92,11 +117,14 @@ CONFIG_CPU_MIPS32_R1=y
92# CONFIG_CPU_RM7000 is not set 117# CONFIG_CPU_RM7000 is not set
93# CONFIG_CPU_RM9000 is not set 118# CONFIG_CPU_RM9000 is not set
94# CONFIG_CPU_SB1 is not set 119# CONFIG_CPU_SB1 is not set
120# CONFIG_CPU_CAVIUM_OCTEON is not set
121CONFIG_SYS_SUPPORTS_ZBOOT=y
95CONFIG_SYS_HAS_CPU_MIPS32_R1=y 122CONFIG_SYS_HAS_CPU_MIPS32_R1=y
96CONFIG_CPU_MIPS32=y 123CONFIG_CPU_MIPS32=y
97CONFIG_CPU_MIPSR1=y 124CONFIG_CPU_MIPSR1=y
98CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y 125CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
99CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y 126CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
127CONFIG_HARDWARE_WATCHPOINTS=y
100 128
101# 129#
102# Kernel type 130# Kernel type
@@ -106,190 +134,255 @@ CONFIG_32BIT=y
106CONFIG_PAGE_SIZE_4KB=y 134CONFIG_PAGE_SIZE_4KB=y
107# CONFIG_PAGE_SIZE_8KB is not set 135# CONFIG_PAGE_SIZE_8KB is not set
108# CONFIG_PAGE_SIZE_16KB is not set 136# CONFIG_PAGE_SIZE_16KB is not set
137# CONFIG_PAGE_SIZE_32KB is not set
109# CONFIG_PAGE_SIZE_64KB is not set 138# CONFIG_PAGE_SIZE_64KB is not set
110CONFIG_CPU_HAS_PREFETCH=y 139CONFIG_CPU_HAS_PREFETCH=y
111CONFIG_MIPS_MT_DISABLED=y 140CONFIG_MIPS_MT_DISABLED=y
112# CONFIG_MIPS_MT_SMP is not set 141# CONFIG_MIPS_MT_SMP is not set
113# CONFIG_MIPS_MT_SMTC is not set 142# CONFIG_MIPS_MT_SMTC is not set
114# CONFIG_MIPS_VPE_LOADER is not set
115CONFIG_64BIT_PHYS_ADDR=y 143CONFIG_64BIT_PHYS_ADDR=y
144CONFIG_ARCH_PHYS_ADDR_T_64BIT=y
116CONFIG_CPU_HAS_SYNC=y 145CONFIG_CPU_HAS_SYNC=y
117CONFIG_GENERIC_HARDIRQS=y 146CONFIG_GENERIC_HARDIRQS=y
118CONFIG_GENERIC_IRQ_PROBE=y 147CONFIG_GENERIC_IRQ_PROBE=y
119CONFIG_CPU_SUPPORTS_HIGHMEM=y 148CONFIG_CPU_SUPPORTS_HIGHMEM=y
120CONFIG_ARCH_FLATMEM_ENABLE=y 149CONFIG_ARCH_FLATMEM_ENABLE=y
150CONFIG_ARCH_POPULATES_NODE_MAP=y
121CONFIG_SELECT_MEMORY_MODEL=y 151CONFIG_SELECT_MEMORY_MODEL=y
122CONFIG_FLATMEM_MANUAL=y 152CONFIG_FLATMEM_MANUAL=y
123# CONFIG_DISCONTIGMEM_MANUAL is not set 153# CONFIG_DISCONTIGMEM_MANUAL is not set
124# CONFIG_SPARSEMEM_MANUAL is not set 154# CONFIG_SPARSEMEM_MANUAL is not set
125CONFIG_FLATMEM=y 155CONFIG_FLATMEM=y
126CONFIG_FLAT_NODE_MEM_MAP=y 156CONFIG_FLAT_NODE_MEM_MAP=y
127# CONFIG_SPARSEMEM_STATIC is not set 157CONFIG_PAGEFLAGS_EXTENDED=y
128CONFIG_SPLIT_PTLOCK_CPUS=4 158CONFIG_SPLIT_PTLOCK_CPUS=4
129CONFIG_RESOURCES_64BIT=y 159CONFIG_PHYS_ADDR_T_64BIT=y
130CONFIG_ZONE_DMA_FLAG=1 160CONFIG_ZONE_DMA_FLAG=0
161CONFIG_VIRT_TO_BUS=y
162# CONFIG_KSM is not set
163CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
164CONFIG_TICK_ONESHOT=y
165CONFIG_NO_HZ=y
166CONFIG_HIGH_RES_TIMERS=y
167CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
131# CONFIG_HZ_48 is not set 168# CONFIG_HZ_48 is not set
132# CONFIG_HZ_100 is not set 169CONFIG_HZ_100=y
133# CONFIG_HZ_128 is not set 170# CONFIG_HZ_128 is not set
134# CONFIG_HZ_250 is not set 171# CONFIG_HZ_250 is not set
135# CONFIG_HZ_256 is not set 172# CONFIG_HZ_256 is not set
136CONFIG_HZ_1000=y 173# CONFIG_HZ_1000 is not set
137# CONFIG_HZ_1024 is not set 174# CONFIG_HZ_1024 is not set
138CONFIG_SYS_SUPPORTS_ARBIT_HZ=y 175CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
139CONFIG_HZ=1000 176CONFIG_HZ=100
140CONFIG_PREEMPT_NONE=y 177CONFIG_PREEMPT_NONE=y
141# CONFIG_PREEMPT_VOLUNTARY is not set 178# CONFIG_PREEMPT_VOLUNTARY is not set
142# CONFIG_PREEMPT is not set 179# CONFIG_PREEMPT is not set
143# CONFIG_KEXEC is not set 180# CONFIG_KEXEC is not set
181# CONFIG_SECCOMP is not set
144CONFIG_LOCKDEP_SUPPORT=y 182CONFIG_LOCKDEP_SUPPORT=y
145CONFIG_STACKTRACE_SUPPORT=y 183CONFIG_STACKTRACE_SUPPORT=y
146CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 184CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
185CONFIG_CONSTRUCTORS=y
147 186
148# 187#
149# Code maturity level options 188# General setup
150# 189#
151CONFIG_EXPERIMENTAL=y 190CONFIG_EXPERIMENTAL=y
152CONFIG_BROKEN_ON_SMP=y 191CONFIG_BROKEN_ON_SMP=y
153CONFIG_INIT_ENV_ARG_LIMIT=32 192CONFIG_INIT_ENV_ARG_LIMIT=32
154 193CONFIG_LOCALVERSION="-pb1500"
155#
156# General setup
157#
158CONFIG_LOCALVERSION=""
159CONFIG_LOCALVERSION_AUTO=y 194CONFIG_LOCALVERSION_AUTO=y
195CONFIG_HAVE_KERNEL_GZIP=y
196CONFIG_HAVE_KERNEL_BZIP2=y
197CONFIG_HAVE_KERNEL_LZMA=y
198CONFIG_HAVE_KERNEL_LZO=y
199# CONFIG_KERNEL_GZIP is not set
200# CONFIG_KERNEL_BZIP2 is not set
201CONFIG_KERNEL_LZMA=y
202# CONFIG_KERNEL_LZO is not set
160CONFIG_SWAP=y 203CONFIG_SWAP=y
161CONFIG_SYSVIPC=y 204CONFIG_SYSVIPC=y
162# CONFIG_IPC_NS is not set
163CONFIG_SYSVIPC_SYSCTL=y 205CONFIG_SYSVIPC_SYSCTL=y
164# CONFIG_POSIX_MQUEUE is not set 206CONFIG_POSIX_MQUEUE=y
207CONFIG_POSIX_MQUEUE_SYSCTL=y
165# CONFIG_BSD_PROCESS_ACCT is not set 208# CONFIG_BSD_PROCESS_ACCT is not set
166# CONFIG_TASKSTATS is not set 209# CONFIG_TASKSTATS is not set
167# CONFIG_UTS_NS is not set
168# CONFIG_AUDIT is not set 210# CONFIG_AUDIT is not set
211
212#
213# RCU Subsystem
214#
215# CONFIG_TREE_RCU is not set
216# CONFIG_TREE_PREEMPT_RCU is not set
217CONFIG_TINY_RCU=y
218# CONFIG_TREE_RCU_TRACE is not set
169# CONFIG_IKCONFIG is not set 219# CONFIG_IKCONFIG is not set
170CONFIG_SYSFS_DEPRECATED=y 220CONFIG_LOG_BUF_SHIFT=14
171CONFIG_RELAY=y 221# CONFIG_GROUP_SCHED is not set
172# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 222# CONFIG_CGROUPS is not set
223# CONFIG_SYSFS_DEPRECATED_V2 is not set
224# CONFIG_RELAY is not set
225# CONFIG_NAMESPACES is not set
226# CONFIG_BLK_DEV_INITRD is not set
227CONFIG_CC_OPTIMIZE_FOR_SIZE=y
173CONFIG_SYSCTL=y 228CONFIG_SYSCTL=y
229CONFIG_ANON_INODES=y
174CONFIG_EMBEDDED=y 230CONFIG_EMBEDDED=y
175CONFIG_SYSCTL_SYSCALL=y 231# CONFIG_SYSCTL_SYSCALL is not set
176CONFIG_KALLSYMS=y 232# CONFIG_KALLSYMS is not set
177# CONFIG_KALLSYMS_EXTRA_PASS is not set
178CONFIG_HOTPLUG=y 233CONFIG_HOTPLUG=y
179CONFIG_PRINTK=y 234CONFIG_PRINTK=y
180CONFIG_BUG=y 235CONFIG_BUG=y
181CONFIG_ELF_CORE=y 236CONFIG_ELF_CORE=y
237# CONFIG_PCSPKR_PLATFORM is not set
182CONFIG_BASE_FULL=y 238CONFIG_BASE_FULL=y
183CONFIG_FUTEX=y 239CONFIG_FUTEX=y
184CONFIG_EPOLL=y 240CONFIG_EPOLL=y
241CONFIG_SIGNALFD=y
242CONFIG_TIMERFD=y
243CONFIG_EVENTFD=y
185CONFIG_SHMEM=y 244CONFIG_SHMEM=y
245CONFIG_AIO=y
246
247#
248# Kernel Performance Events And Counters
249#
250# CONFIG_VM_EVENT_COUNTERS is not set
251CONFIG_PCI_QUIRKS=y
252# CONFIG_COMPAT_BRK is not set
186CONFIG_SLAB=y 253CONFIG_SLAB=y
187CONFIG_VM_EVENT_COUNTERS=y 254# CONFIG_SLUB is not set
188CONFIG_RT_MUTEXES=y
189# CONFIG_TINY_SHMEM is not set
190CONFIG_BASE_SMALL=0
191# CONFIG_SLOB is not set 255# CONFIG_SLOB is not set
256# CONFIG_PROFILING is not set
257CONFIG_HAVE_OPROFILE=y
192 258
193# 259#
194# Loadable module support 260# GCOV-based kernel profiling
195# 261#
262# CONFIG_SLOW_WORK is not set
263CONFIG_HAVE_GENERIC_DMA_COHERENT=y
264CONFIG_SLABINFO=y
265CONFIG_RT_MUTEXES=y
266CONFIG_BASE_SMALL=0
196CONFIG_MODULES=y 267CONFIG_MODULES=y
268# CONFIG_MODULE_FORCE_LOAD is not set
197CONFIG_MODULE_UNLOAD=y 269CONFIG_MODULE_UNLOAD=y
198# CONFIG_MODULE_FORCE_UNLOAD is not set 270# CONFIG_MODULE_FORCE_UNLOAD is not set
199CONFIG_MODVERSIONS=y 271# CONFIG_MODVERSIONS is not set
200CONFIG_MODULE_SRCVERSION_ALL=y 272# CONFIG_MODULE_SRCVERSION_ALL is not set
201CONFIG_KMOD=y
202
203#
204# Block layer
205#
206CONFIG_BLOCK=y 273CONFIG_BLOCK=y
207# CONFIG_LBD is not set 274CONFIG_LBDAF=y
208# CONFIG_BLK_DEV_IO_TRACE is not set 275CONFIG_BLK_DEV_BSG=y
209# CONFIG_LSF is not set 276# CONFIG_BLK_DEV_INTEGRITY is not set
210 277
211# 278#
212# IO Schedulers 279# IO Schedulers
213# 280#
214CONFIG_IOSCHED_NOOP=y 281CONFIG_IOSCHED_NOOP=y
215CONFIG_IOSCHED_AS=y 282# CONFIG_IOSCHED_DEADLINE is not set
216CONFIG_IOSCHED_DEADLINE=y 283# CONFIG_IOSCHED_CFQ is not set
217CONFIG_IOSCHED_CFQ=y
218CONFIG_DEFAULT_AS=y
219# CONFIG_DEFAULT_DEADLINE is not set 284# CONFIG_DEFAULT_DEADLINE is not set
220# CONFIG_DEFAULT_CFQ is not set 285# CONFIG_DEFAULT_CFQ is not set
221# CONFIG_DEFAULT_NOOP is not set 286CONFIG_DEFAULT_NOOP=y
222CONFIG_DEFAULT_IOSCHED="anticipatory" 287CONFIG_DEFAULT_IOSCHED="noop"
288# CONFIG_INLINE_SPIN_TRYLOCK is not set
289# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set
290# CONFIG_INLINE_SPIN_LOCK is not set
291# CONFIG_INLINE_SPIN_LOCK_BH is not set
292# CONFIG_INLINE_SPIN_LOCK_IRQ is not set
293# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set
294CONFIG_INLINE_SPIN_UNLOCK=y
295# CONFIG_INLINE_SPIN_UNLOCK_BH is not set
296CONFIG_INLINE_SPIN_UNLOCK_IRQ=y
297# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set
298# CONFIG_INLINE_READ_TRYLOCK is not set
299# CONFIG_INLINE_READ_LOCK is not set
300# CONFIG_INLINE_READ_LOCK_BH is not set
301# CONFIG_INLINE_READ_LOCK_IRQ is not set
302# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set
303CONFIG_INLINE_READ_UNLOCK=y
304# CONFIG_INLINE_READ_UNLOCK_BH is not set
305CONFIG_INLINE_READ_UNLOCK_IRQ=y
306# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set
307# CONFIG_INLINE_WRITE_TRYLOCK is not set
308# CONFIG_INLINE_WRITE_LOCK is not set
309# CONFIG_INLINE_WRITE_LOCK_BH is not set
310# CONFIG_INLINE_WRITE_LOCK_IRQ is not set
311# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set
312CONFIG_INLINE_WRITE_UNLOCK=y
313# CONFIG_INLINE_WRITE_UNLOCK_BH is not set
314CONFIG_INLINE_WRITE_UNLOCK_IRQ=y
315# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set
316# CONFIG_MUTEX_SPIN_ON_OWNER is not set
317CONFIG_FREEZER=y
223 318
224# 319#
225# Bus options (PCI, PCMCIA, EISA, ISA, TC) 320# Bus options (PCI, PCMCIA, EISA, ISA, TC)
226# 321#
227CONFIG_HW_HAS_PCI=y 322CONFIG_HW_HAS_PCI=y
228CONFIG_PCI=y 323CONFIG_PCI=y
324CONFIG_PCI_DOMAINS=y
325# CONFIG_ARCH_SUPPORTS_MSI is not set
326CONFIG_PCI_LEGACY=y
327# CONFIG_PCI_DEBUG is not set
328# CONFIG_PCI_STUB is not set
329# CONFIG_PCI_IOV is not set
229CONFIG_MMU=y 330CONFIG_MMU=y
230 331CONFIG_PCCARD=y
231# 332CONFIG_PCMCIA=y
232# PCCARD (PCMCIA/CardBus) support
233#
234CONFIG_PCCARD=m
235# CONFIG_PCMCIA_DEBUG is not set
236CONFIG_PCMCIA=m
237CONFIG_PCMCIA_LOAD_CIS=y 333CONFIG_PCMCIA_LOAD_CIS=y
238CONFIG_PCMCIA_IOCTL=y 334CONFIG_PCMCIA_IOCTL=y
239CONFIG_CARDBUS=y 335# CONFIG_CARDBUS is not set
240 336
241# 337#
242# PC-card bridges 338# PC-card bridges
243# 339#
244# CONFIG_YENTA is not set 340# CONFIG_YENTA is not set
245CONFIG_PD6729=m 341# CONFIG_PD6729 is not set
246# CONFIG_I82092 is not set 342# CONFIG_I82092 is not set
247# CONFIG_PCMCIA_AU1X00 is not set 343# CONFIG_PCMCIA_AU1X00 is not set
248CONFIG_PCCARD_NONSTATIC=m 344CONFIG_PCMCIA_ALCHEMY_DEVBOARD=y
249
250#
251# PCI Hotplug Support
252#
253# CONFIG_HOTPLUG_PCI is not set 345# CONFIG_HOTPLUG_PCI is not set
254 346
255# 347#
256# Executable file formats 348# Executable file formats
257# 349#
258CONFIG_BINFMT_ELF=y 350CONFIG_BINFMT_ELF=y
351# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
352# CONFIG_HAVE_AOUT is not set
259# CONFIG_BINFMT_MISC is not set 353# CONFIG_BINFMT_MISC is not set
260CONFIG_TRAD_SIGNALS=y 354CONFIG_TRAD_SIGNALS=y
261 355
262# 356#
263# Power management options 357# Power management options
264# 358#
265# CONFIG_PM is not set 359CONFIG_ARCH_HIBERNATION_POSSIBLE=y
266 360CONFIG_ARCH_SUSPEND_POSSIBLE=y
267# 361CONFIG_PM=y
268# Networking 362# CONFIG_PM_DEBUG is not set
269# 363CONFIG_PM_SLEEP=y
364CONFIG_SUSPEND=y
365CONFIG_SUSPEND_FREEZER=y
366# CONFIG_HIBERNATION is not set
367# CONFIG_APM_EMULATION is not set
368CONFIG_PM_RUNTIME=y
270CONFIG_NET=y 369CONFIG_NET=y
271 370
272# 371#
273# Networking options 372# Networking options
274# 373#
275# CONFIG_NETDEBUG is not set
276CONFIG_PACKET=y 374CONFIG_PACKET=y
277# CONFIG_PACKET_MMAP is not set 375CONFIG_PACKET_MMAP=y
278CONFIG_UNIX=y 376CONFIG_UNIX=y
279CONFIG_XFRM=y 377# CONFIG_NET_KEY is not set
280CONFIG_XFRM_USER=m
281# CONFIG_XFRM_SUB_POLICY is not set
282CONFIG_XFRM_MIGRATE=y
283CONFIG_NET_KEY=y
284CONFIG_NET_KEY_MIGRATE=y
285CONFIG_INET=y 378CONFIG_INET=y
286CONFIG_IP_MULTICAST=y 379CONFIG_IP_MULTICAST=y
287# CONFIG_IP_ADVANCED_ROUTER is not set 380# CONFIG_IP_ADVANCED_ROUTER is not set
288CONFIG_IP_FIB_HASH=y 381CONFIG_IP_FIB_HASH=y
289CONFIG_IP_PNP=y 382CONFIG_IP_PNP=y
290# CONFIG_IP_PNP_DHCP is not set 383CONFIG_IP_PNP_DHCP=y
291CONFIG_IP_PNP_BOOTP=y 384CONFIG_IP_PNP_BOOTP=y
292# CONFIG_IP_PNP_RARP is not set 385CONFIG_IP_PNP_RARP=y
293# CONFIG_NET_IPIP is not set 386# CONFIG_NET_IPIP is not set
294# CONFIG_NET_IPGRE is not set 387# CONFIG_NET_IPGRE is not set
295# CONFIG_IP_MROUTE is not set 388# CONFIG_IP_MROUTE is not set
@@ -300,110 +393,25 @@ CONFIG_IP_PNP_BOOTP=y
300# CONFIG_INET_IPCOMP is not set 393# CONFIG_INET_IPCOMP is not set
301# CONFIG_INET_XFRM_TUNNEL is not set 394# CONFIG_INET_XFRM_TUNNEL is not set
302# CONFIG_INET_TUNNEL is not set 395# CONFIG_INET_TUNNEL is not set
303CONFIG_INET_XFRM_MODE_TRANSPORT=m 396# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
304CONFIG_INET_XFRM_MODE_TUNNEL=m 397# CONFIG_INET_XFRM_MODE_TUNNEL is not set
305CONFIG_INET_XFRM_MODE_BEET=m 398# CONFIG_INET_XFRM_MODE_BEET is not set
306CONFIG_INET_DIAG=y 399CONFIG_INET_LRO=y
307CONFIG_INET_TCP_DIAG=y 400# CONFIG_INET_DIAG is not set
308# CONFIG_TCP_CONG_ADVANCED is not set 401# CONFIG_TCP_CONG_ADVANCED is not set
309CONFIG_TCP_CONG_CUBIC=y 402CONFIG_TCP_CONG_CUBIC=y
310CONFIG_DEFAULT_TCP_CONG="cubic" 403CONFIG_DEFAULT_TCP_CONG="cubic"
311CONFIG_TCP_MD5SIG=y 404# CONFIG_TCP_MD5SIG is not set
312
313#
314# IP: Virtual Server Configuration
315#
316# CONFIG_IP_VS is not set
317# CONFIG_IPV6 is not set 405# CONFIG_IPV6 is not set
318# CONFIG_INET6_XFRM_TUNNEL is not set 406# CONFIG_NETWORK_SECMARK is not set
319# CONFIG_INET6_TUNNEL is not set 407# CONFIG_NETFILTER is not set
320CONFIG_NETWORK_SECMARK=y
321CONFIG_NETFILTER=y
322# CONFIG_NETFILTER_DEBUG is not set
323
324#
325# Core Netfilter Configuration
326#
327CONFIG_NETFILTER_NETLINK=m
328CONFIG_NETFILTER_NETLINK_QUEUE=m
329CONFIG_NETFILTER_NETLINK_LOG=m
330CONFIG_NF_CONNTRACK_ENABLED=m
331CONFIG_NF_CONNTRACK_SUPPORT=y
332# CONFIG_IP_NF_CONNTRACK_SUPPORT is not set
333CONFIG_NF_CONNTRACK=m
334CONFIG_NF_CT_ACCT=y
335CONFIG_NF_CONNTRACK_MARK=y
336CONFIG_NF_CONNTRACK_SECMARK=y
337CONFIG_NF_CONNTRACK_EVENTS=y
338CONFIG_NF_CT_PROTO_GRE=m
339CONFIG_NF_CT_PROTO_SCTP=m
340CONFIG_NF_CONNTRACK_AMANDA=m
341CONFIG_NF_CONNTRACK_FTP=m
342CONFIG_NF_CONNTRACK_H323=m
343CONFIG_NF_CONNTRACK_IRC=m
344# CONFIG_NF_CONNTRACK_NETBIOS_NS is not set
345CONFIG_NF_CONNTRACK_PPTP=m
346CONFIG_NF_CONNTRACK_SANE=m
347CONFIG_NF_CONNTRACK_SIP=m
348CONFIG_NF_CONNTRACK_TFTP=m
349CONFIG_NF_CT_NETLINK=m
350CONFIG_NETFILTER_XTABLES=m
351CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
352CONFIG_NETFILTER_XT_TARGET_MARK=m
353CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
354CONFIG_NETFILTER_XT_TARGET_NFLOG=m
355CONFIG_NETFILTER_XT_TARGET_SECMARK=m
356CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=m
357CONFIG_NETFILTER_XT_TARGET_TCPMSS=m
358CONFIG_NETFILTER_XT_MATCH_COMMENT=m
359CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
360CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
361CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
362CONFIG_NETFILTER_XT_MATCH_DCCP=m
363CONFIG_NETFILTER_XT_MATCH_DSCP=m
364CONFIG_NETFILTER_XT_MATCH_ESP=m
365CONFIG_NETFILTER_XT_MATCH_HELPER=m
366CONFIG_NETFILTER_XT_MATCH_LENGTH=m
367CONFIG_NETFILTER_XT_MATCH_LIMIT=m
368CONFIG_NETFILTER_XT_MATCH_MAC=m
369CONFIG_NETFILTER_XT_MATCH_MARK=m
370CONFIG_NETFILTER_XT_MATCH_POLICY=m
371CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
372CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
373CONFIG_NETFILTER_XT_MATCH_QUOTA=m
374CONFIG_NETFILTER_XT_MATCH_REALM=m
375CONFIG_NETFILTER_XT_MATCH_SCTP=m
376CONFIG_NETFILTER_XT_MATCH_STATE=m
377CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
378CONFIG_NETFILTER_XT_MATCH_STRING=m
379CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
380CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
381
382#
383# IP: Netfilter Configuration
384#
385CONFIG_NF_CONNTRACK_IPV4=m
386CONFIG_NF_CONNTRACK_PROC_COMPAT=y
387# CONFIG_IP_NF_QUEUE is not set
388# CONFIG_IP_NF_IPTABLES is not set
389# CONFIG_IP_NF_ARPTABLES is not set
390
391#
392# DCCP Configuration (EXPERIMENTAL)
393#
394# CONFIG_IP_DCCP is not set 408# CONFIG_IP_DCCP is not set
395
396#
397# SCTP Configuration (EXPERIMENTAL)
398#
399# CONFIG_IP_SCTP is not set 409# CONFIG_IP_SCTP is not set
400 410# CONFIG_RDS is not set
401#
402# TIPC Configuration (EXPERIMENTAL)
403#
404# CONFIG_TIPC is not set 411# CONFIG_TIPC is not set
405# CONFIG_ATM is not set 412# CONFIG_ATM is not set
406# CONFIG_BRIDGE is not set 413# CONFIG_BRIDGE is not set
414# CONFIG_NET_DSA is not set
407# CONFIG_VLAN_8021Q is not set 415# CONFIG_VLAN_8021Q is not set
408# CONFIG_DECNET is not set 416# CONFIG_DECNET is not set
409# CONFIG_LLC2 is not set 417# CONFIG_LLC2 is not set
@@ -413,27 +421,24 @@ CONFIG_NF_CONNTRACK_PROC_COMPAT=y
413# CONFIG_LAPB is not set 421# CONFIG_LAPB is not set
414# CONFIG_ECONET is not set 422# CONFIG_ECONET is not set
415# CONFIG_WAN_ROUTER is not set 423# CONFIG_WAN_ROUTER is not set
416 424# CONFIG_PHONET is not set
417# 425# CONFIG_IEEE802154 is not set
418# QoS and/or fair queueing
419#
420# CONFIG_NET_SCHED is not set 426# CONFIG_NET_SCHED is not set
421CONFIG_NET_CLS_ROUTE=y 427# CONFIG_DCB is not set
422 428
423# 429#
424# Network testing 430# Network testing
425# 431#
426# CONFIG_NET_PKTGEN is not set 432# CONFIG_NET_PKTGEN is not set
427# CONFIG_HAMRADIO is not set 433# CONFIG_HAMRADIO is not set
434# CONFIG_CAN is not set
428# CONFIG_IRDA is not set 435# CONFIG_IRDA is not set
429# CONFIG_BT is not set 436# CONFIG_BT is not set
430CONFIG_IEEE80211=m 437# CONFIG_AF_RXRPC is not set
431# CONFIG_IEEE80211_DEBUG is not set 438# CONFIG_WIRELESS is not set
432CONFIG_IEEE80211_CRYPT_WEP=m 439# CONFIG_WIMAX is not set
433CONFIG_IEEE80211_CRYPT_CCMP=m 440# CONFIG_RFKILL is not set
434CONFIG_IEEE80211_SOFTMAC=m 441# CONFIG_NET_9P is not set
435# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set
436CONFIG_WIRELESS_EXT=y
437 442
438# 443#
439# Device Drivers 444# Device Drivers
@@ -442,25 +447,25 @@ CONFIG_WIRELESS_EXT=y
442# 447#
443# Generic Driver Options 448# Generic Driver Options
444# 449#
450CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
451# CONFIG_DEVTMPFS is not set
445CONFIG_STANDALONE=y 452CONFIG_STANDALONE=y
446CONFIG_PREVENT_FIRMWARE_BUILD=y 453CONFIG_PREVENT_FIRMWARE_BUILD=y
447CONFIG_FW_LOADER=m 454CONFIG_FW_LOADER=y
455CONFIG_FIRMWARE_IN_KERNEL=y
456CONFIG_EXTRA_FIRMWARE=""
457# CONFIG_DEBUG_DRIVER is not set
458# CONFIG_DEBUG_DEVRES is not set
448# CONFIG_SYS_HYPERVISOR is not set 459# CONFIG_SYS_HYPERVISOR is not set
449 460# CONFIG_CONNECTOR is not set
450#
451# Connector - unified userspace <-> kernelspace linker
452#
453CONFIG_CONNECTOR=m
454
455#
456# Memory Technology Devices (MTD)
457#
458CONFIG_MTD=y 461CONFIG_MTD=y
459# CONFIG_MTD_DEBUG is not set 462# CONFIG_MTD_DEBUG is not set
463# CONFIG_MTD_TESTS is not set
460# CONFIG_MTD_CONCAT is not set 464# CONFIG_MTD_CONCAT is not set
461CONFIG_MTD_PARTITIONS=y 465CONFIG_MTD_PARTITIONS=y
462# CONFIG_MTD_REDBOOT_PARTS is not set 466# CONFIG_MTD_REDBOOT_PARTS is not set
463# CONFIG_MTD_CMDLINE_PARTS is not set 467# CONFIG_MTD_CMDLINE_PARTS is not set
468# CONFIG_MTD_AR7_PARTS is not set
464 469
465# 470#
466# User Modules And Translation Layers 471# User Modules And Translation Layers
@@ -473,6 +478,7 @@ CONFIG_MTD_BLOCK=y
473# CONFIG_INFTL is not set 478# CONFIG_INFTL is not set
474# CONFIG_RFD_FTL is not set 479# CONFIG_RFD_FTL is not set
475# CONFIG_SSFDC is not set 480# CONFIG_SSFDC is not set
481# CONFIG_MTD_OOPS is not set
476 482
477# 483#
478# RAM/ROM/Flash chip drivers 484# RAM/ROM/Flash chip drivers
@@ -498,14 +504,14 @@ CONFIG_MTD_CFI_UTIL=y
498# CONFIG_MTD_RAM is not set 504# CONFIG_MTD_RAM is not set
499# CONFIG_MTD_ROM is not set 505# CONFIG_MTD_ROM is not set
500# CONFIG_MTD_ABSENT is not set 506# CONFIG_MTD_ABSENT is not set
501# CONFIG_MTD_OBSOLETE_CHIPS is not set
502 507
503# 508#
504# Mapping drivers for chip access 509# Mapping drivers for chip access
505# 510#
506# CONFIG_MTD_COMPLEX_MAPPINGS is not set 511# CONFIG_MTD_COMPLEX_MAPPINGS is not set
507# CONFIG_MTD_PHYSMAP is not set 512CONFIG_MTD_PHYSMAP=y
508CONFIG_MTD_ALCHEMY=y 513# CONFIG_MTD_PHYSMAP_COMPAT is not set
514# CONFIG_MTD_INTEL_VR_NOR is not set
509# CONFIG_MTD_PLATRAM is not set 515# CONFIG_MTD_PLATRAM is not set
510 516
511# 517#
@@ -523,30 +529,20 @@ CONFIG_MTD_ALCHEMY=y
523# CONFIG_MTD_DOC2000 is not set 529# CONFIG_MTD_DOC2000 is not set
524# CONFIG_MTD_DOC2001 is not set 530# CONFIG_MTD_DOC2001 is not set
525# CONFIG_MTD_DOC2001PLUS is not set 531# CONFIG_MTD_DOC2001PLUS is not set
526
527#
528# NAND Flash Device Drivers
529#
530# CONFIG_MTD_NAND is not set 532# CONFIG_MTD_NAND is not set
531
532#
533# OneNAND Flash Device Drivers
534#
535# CONFIG_MTD_ONENAND is not set 533# CONFIG_MTD_ONENAND is not set
536 534
537# 535#
538# Parallel port support 536# LPDDR flash memory drivers
539# 537#
540# CONFIG_PARPORT is not set 538# CONFIG_MTD_LPDDR is not set
541 539
542# 540#
543# Plug and Play support 541# UBI - Unsorted block images
544#
545# CONFIG_PNPACPI is not set
546
547#
548# Block devices
549# 542#
543# CONFIG_MTD_UBI is not set
544# CONFIG_PARPORT is not set
545CONFIG_BLK_DEV=y
550# CONFIG_BLK_CPQ_DA is not set 546# CONFIG_BLK_CPQ_DA is not set
551# CONFIG_BLK_CPQ_CISS_DA is not set 547# CONFIG_BLK_CPQ_CISS_DA is not set
552# CONFIG_BLK_DEV_DAC960 is not set 548# CONFIG_BLK_DEV_DAC960 is not set
@@ -554,67 +550,66 @@ CONFIG_MTD_ALCHEMY=y
554# CONFIG_BLK_DEV_COW_COMMON is not set 550# CONFIG_BLK_DEV_COW_COMMON is not set
555CONFIG_BLK_DEV_LOOP=y 551CONFIG_BLK_DEV_LOOP=y
556# CONFIG_BLK_DEV_CRYPTOLOOP is not set 552# CONFIG_BLK_DEV_CRYPTOLOOP is not set
557# CONFIG_BLK_DEV_NBD is not set
558# CONFIG_BLK_DEV_SX8 is not set
559# CONFIG_BLK_DEV_RAM is not set
560# CONFIG_BLK_DEV_INITRD is not set
561CONFIG_CDROM_PKTCDVD=m
562CONFIG_CDROM_PKTCDVD_BUFFERS=8
563# CONFIG_CDROM_PKTCDVD_WCACHE is not set
564CONFIG_ATA_OVER_ETH=m
565
566#
567# Misc devices
568#
569CONFIG_SGI_IOC4=m
570# CONFIG_TIFM_CORE is not set
571 553
572# 554#
573# ATA/ATAPI/MFM/RLL support 555# DRBD disabled because PROC_FS, INET or CONNECTOR not selected
574# 556#
557# CONFIG_BLK_DEV_NBD is not set
558# CONFIG_BLK_DEV_SX8 is not set
559CONFIG_BLK_DEV_UB=y
560# CONFIG_BLK_DEV_RAM is not set
561# CONFIG_CDROM_PKTCDVD is not set
562# CONFIG_ATA_OVER_ETH is not set
563# CONFIG_BLK_DEV_HD is not set
564# CONFIG_MISC_DEVICES is not set
565CONFIG_HAVE_IDE=y
575CONFIG_IDE=y 566CONFIG_IDE=y
576CONFIG_IDE_MAX_HWIFS=4
577CONFIG_BLK_DEV_IDE=y
578 567
579# 568#
580# Please see Documentation/ide.txt for help/info on IDE drives 569# Please see Documentation/ide/ide.txt for help/info on IDE drives
581# 570#
571CONFIG_IDE_XFER_MODE=y
572CONFIG_IDE_ATAPI=y
582# CONFIG_BLK_DEV_IDE_SATA is not set 573# CONFIG_BLK_DEV_IDE_SATA is not set
583CONFIG_BLK_DEV_IDEDISK=y 574CONFIG_IDE_GD=y
584# CONFIG_IDEDISK_MULTI_MODE is not set 575CONFIG_IDE_GD_ATA=y
585CONFIG_BLK_DEV_IDECS=m 576# CONFIG_IDE_GD_ATAPI is not set
586# CONFIG_BLK_DEV_DELKIN is not set 577CONFIG_BLK_DEV_IDECS=y
587# CONFIG_BLK_DEV_IDECD is not set 578CONFIG_BLK_DEV_IDECD=y
579CONFIG_BLK_DEV_IDECD_VERBOSE_ERRORS=y
588# CONFIG_BLK_DEV_IDETAPE is not set 580# CONFIG_BLK_DEV_IDETAPE is not set
589# CONFIG_BLK_DEV_IDEFLOPPY is not set 581CONFIG_IDE_TASK_IOCTL=y
590# CONFIG_IDE_TASK_IOCTL is not set 582CONFIG_IDE_PROC_FS=y
591 583
592# 584#
593# IDE chipset support/bugfixes 585# IDE chipset support/bugfixes
594# 586#
595CONFIG_IDE_GENERIC=y 587# CONFIG_IDE_GENERIC is not set
588# CONFIG_BLK_DEV_PLATFORM is not set
589CONFIG_BLK_DEV_IDEDMA_SFF=y
590
591#
592# PCI IDE chipsets support
593#
596CONFIG_BLK_DEV_IDEPCI=y 594CONFIG_BLK_DEV_IDEPCI=y
597# CONFIG_IDEPCI_SHARE_IRQ is not set 595# CONFIG_IDEPCI_PCIBUS_ORDER is not set
598# CONFIG_BLK_DEV_OFFBOARD is not set 596# CONFIG_BLK_DEV_OFFBOARD is not set
599CONFIG_BLK_DEV_GENERIC=y 597# CONFIG_BLK_DEV_GENERIC is not set
600# CONFIG_BLK_DEV_OPTI621 is not set 598# CONFIG_BLK_DEV_OPTI621 is not set
601CONFIG_BLK_DEV_IDEDMA_PCI=y 599CONFIG_BLK_DEV_IDEDMA_PCI=y
602# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
603# CONFIG_IDEDMA_PCI_AUTO is not set
604# CONFIG_BLK_DEV_AEC62XX is not set 600# CONFIG_BLK_DEV_AEC62XX is not set
605# CONFIG_BLK_DEV_ALI15X3 is not set 601# CONFIG_BLK_DEV_ALI15X3 is not set
606# CONFIG_BLK_DEV_AMD74XX is not set 602# CONFIG_BLK_DEV_AMD74XX is not set
607# CONFIG_BLK_DEV_CMD64X is not set 603# CONFIG_BLK_DEV_CMD64X is not set
608# CONFIG_BLK_DEV_TRIFLEX is not set 604# CONFIG_BLK_DEV_TRIFLEX is not set
609# CONFIG_BLK_DEV_CY82C693 is not set
610# CONFIG_BLK_DEV_CS5520 is not set 605# CONFIG_BLK_DEV_CS5520 is not set
611# CONFIG_BLK_DEV_CS5530 is not set 606# CONFIG_BLK_DEV_CS5530 is not set
612# CONFIG_BLK_DEV_HPT34X is not set
613CONFIG_BLK_DEV_HPT366=y 607CONFIG_BLK_DEV_HPT366=y
614# CONFIG_BLK_DEV_JMICRON is not set 608# CONFIG_BLK_DEV_JMICRON is not set
615# CONFIG_BLK_DEV_SC1200 is not set 609# CONFIG_BLK_DEV_SC1200 is not set
616# CONFIG_BLK_DEV_PIIX is not set 610# CONFIG_BLK_DEV_PIIX is not set
617CONFIG_BLK_DEV_IT8213=m 611# CONFIG_BLK_DEV_IT8172 is not set
612# CONFIG_BLK_DEV_IT8213 is not set
618# CONFIG_BLK_DEV_IT821X is not set 613# CONFIG_BLK_DEV_IT821X is not set
619# CONFIG_BLK_DEV_NS87415 is not set 614# CONFIG_BLK_DEV_NS87415 is not set
620# CONFIG_BLK_DEV_PDC202XX_OLD is not set 615# CONFIG_BLK_DEV_PDC202XX_OLD is not set
@@ -624,82 +619,65 @@ CONFIG_BLK_DEV_IT8213=m
624# CONFIG_BLK_DEV_SLC90E66 is not set 619# CONFIG_BLK_DEV_SLC90E66 is not set
625# CONFIG_BLK_DEV_TRM290 is not set 620# CONFIG_BLK_DEV_TRM290 is not set
626# CONFIG_BLK_DEV_VIA82CXXX is not set 621# CONFIG_BLK_DEV_VIA82CXXX is not set
627CONFIG_BLK_DEV_TC86C001=m 622# CONFIG_BLK_DEV_TC86C001 is not set
628# CONFIG_IDE_ARM is not set
629CONFIG_BLK_DEV_IDEDMA=y 623CONFIG_BLK_DEV_IDEDMA=y
630# CONFIG_IDEDMA_IVB is not set
631# CONFIG_IDEDMA_AUTO is not set
632# CONFIG_BLK_DEV_HD is not set
633 624
634# 625#
635# SCSI device support 626# SCSI device support
636# 627#
637CONFIG_RAID_ATTRS=m 628# CONFIG_RAID_ATTRS is not set
638# CONFIG_SCSI is not set 629# CONFIG_SCSI is not set
630# CONFIG_SCSI_DMA is not set
639# CONFIG_SCSI_NETLINK is not set 631# CONFIG_SCSI_NETLINK is not set
640
641#
642# Serial ATA (prod) and Parallel ATA (experimental) drivers
643#
644# CONFIG_ATA is not set 632# CONFIG_ATA is not set
645
646#
647# Multi-device support (RAID and LVM)
648#
649# CONFIG_MD is not set 633# CONFIG_MD is not set
650
651#
652# Fusion MPT device support
653#
654# CONFIG_FUSION is not set 634# CONFIG_FUSION is not set
655 635
656# 636#
657# IEEE 1394 (FireWire) support 637# IEEE 1394 (FireWire) support
658# 638#
659# CONFIG_IEEE1394 is not set
660 639
661# 640#
662# I2O device support 641# You can enable one or both FireWire driver stacks.
663# 642#
664# CONFIG_I2O is not set
665 643
666# 644#
667# Network device support 645# The newer stack is recommended.
668# 646#
647# CONFIG_FIREWIRE is not set
648# CONFIG_IEEE1394 is not set
649# CONFIG_I2O is not set
669CONFIG_NETDEVICES=y 650CONFIG_NETDEVICES=y
670# CONFIG_DUMMY is not set 651# CONFIG_DUMMY is not set
671# CONFIG_BONDING is not set 652# CONFIG_BONDING is not set
653# CONFIG_MACVLAN is not set
672# CONFIG_EQUALIZER is not set 654# CONFIG_EQUALIZER is not set
673# CONFIG_TUN is not set 655# CONFIG_TUN is not set
674 656# CONFIG_VETH is not set
675#
676# ARCnet devices
677#
678# CONFIG_ARCNET is not set 657# CONFIG_ARCNET is not set
679
680#
681# PHY device support
682#
683CONFIG_PHYLIB=y 658CONFIG_PHYLIB=y
684 659
685# 660#
686# MII PHY device drivers 661# MII PHY device drivers
687# 662#
688CONFIG_MARVELL_PHY=m 663CONFIG_MARVELL_PHY=y
689CONFIG_DAVICOM_PHY=m 664CONFIG_DAVICOM_PHY=y
690CONFIG_QSEMI_PHY=m 665CONFIG_QSEMI_PHY=y
691CONFIG_LXT_PHY=m 666CONFIG_LXT_PHY=y
692CONFIG_CICADA_PHY=m 667CONFIG_CICADA_PHY=y
693CONFIG_VITESSE_PHY=m 668CONFIG_VITESSE_PHY=y
694CONFIG_SMSC_PHY=m 669CONFIG_SMSC_PHY=y
695# CONFIG_BROADCOM_PHY is not set 670CONFIG_BROADCOM_PHY=y
671CONFIG_ICPLUS_PHY=y
672CONFIG_REALTEK_PHY=y
673CONFIG_NATIONAL_PHY=y
674CONFIG_STE10XP=y
675CONFIG_LSI_ET1011C_PHY=y
696# CONFIG_FIXED_PHY is not set 676# CONFIG_FIXED_PHY is not set
697 677# CONFIG_MDIO_BITBANG is not set
698#
699# Ethernet (10 or 100Mbit)
700#
701CONFIG_NET_ETHERNET=y 678CONFIG_NET_ETHERNET=y
702CONFIG_MII=m 679CONFIG_MII=y
680# CONFIG_AX88796 is not set
703CONFIG_MIPS_AU1X00_ENET=y 681CONFIG_MIPS_AU1X00_ENET=y
704# CONFIG_HAPPYMEAL is not set 682# CONFIG_HAPPYMEAL is not set
705# CONFIG_SUNGEM is not set 683# CONFIG_SUNGEM is not set
@@ -707,96 +685,51 @@ CONFIG_MIPS_AU1X00_ENET=y
707# CONFIG_NET_VENDOR_3COM is not set 685# CONFIG_NET_VENDOR_3COM is not set
708# CONFIG_SMC91X is not set 686# CONFIG_SMC91X is not set
709# CONFIG_DM9000 is not set 687# CONFIG_DM9000 is not set
710 688# CONFIG_ETHOC is not set
711# 689# CONFIG_SMSC911X is not set
712# Tulip family network device support 690# CONFIG_DNET is not set
713#
714# CONFIG_NET_TULIP is not set 691# CONFIG_NET_TULIP is not set
715# CONFIG_HP100 is not set 692# CONFIG_HP100 is not set
693# CONFIG_IBM_NEW_EMAC_ZMII is not set
694# CONFIG_IBM_NEW_EMAC_RGMII is not set
695# CONFIG_IBM_NEW_EMAC_TAH is not set
696# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
697# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
698# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
699# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
716# CONFIG_NET_PCI is not set 700# CONFIG_NET_PCI is not set
717 701# CONFIG_B44 is not set
718# 702# CONFIG_KS8842 is not set
719# Ethernet (1000 Mbit) 703# CONFIG_KS8851_MLL is not set
720# 704# CONFIG_ATL2 is not set
721# CONFIG_ACENIC is not set 705# CONFIG_NETDEV_1000 is not set
722# CONFIG_DL2K is not set 706# CONFIG_NETDEV_10000 is not set
723# CONFIG_E1000 is not set
724# CONFIG_NS83820 is not set
725# CONFIG_HAMACHI is not set
726# CONFIG_YELLOWFIN is not set
727# CONFIG_R8169 is not set
728# CONFIG_SIS190 is not set
729# CONFIG_SKGE is not set
730# CONFIG_SKY2 is not set
731# CONFIG_SK98LIN is not set
732# CONFIG_TIGON3 is not set
733# CONFIG_BNX2 is not set
734CONFIG_QLA3XXX=m
735# CONFIG_ATL1 is not set
736
737#
738# Ethernet (10000 Mbit)
739#
740# CONFIG_CHELSIO_T1 is not set
741CONFIG_CHELSIO_T3=m
742# CONFIG_IXGB is not set
743# CONFIG_S2IO is not set
744# CONFIG_MYRI10GE is not set
745CONFIG_NETXEN_NIC=m
746
747#
748# Token Ring devices
749#
750# CONFIG_TR is not set 707# CONFIG_TR is not set
708# CONFIG_WLAN is not set
751 709
752# 710#
753# Wireless LAN (non-hamradio) 711# Enable WiMAX (Networking options) to see the WiMAX drivers
754# 712#
755# CONFIG_NET_RADIO is not set
756 713
757# 714#
758# PCMCIA network device support 715# USB Network Adapters
759#
760CONFIG_NET_PCMCIA=y
761CONFIG_PCMCIA_3C589=m
762CONFIG_PCMCIA_3C574=m
763CONFIG_PCMCIA_FMVJ18X=m
764CONFIG_PCMCIA_PCNET=m
765CONFIG_PCMCIA_NMCLAN=m
766CONFIG_PCMCIA_SMC91C92=m
767CONFIG_PCMCIA_XIRC2PS=m
768CONFIG_PCMCIA_AXNET=m
769
770#
771# Wan interfaces
772# 716#
717# CONFIG_USB_CATC is not set
718# CONFIG_USB_KAWETH is not set
719# CONFIG_USB_PEGASUS is not set
720# CONFIG_USB_RTL8150 is not set
721# CONFIG_USB_USBNET is not set
722# CONFIG_NET_PCMCIA is not set
773# CONFIG_WAN is not set 723# CONFIG_WAN is not set
774# CONFIG_FDDI is not set 724# CONFIG_FDDI is not set
775# CONFIG_HIPPI is not set 725# CONFIG_HIPPI is not set
776CONFIG_PPP=m 726# CONFIG_PPP is not set
777CONFIG_PPP_MULTILINK=y
778# CONFIG_PPP_FILTER is not set
779CONFIG_PPP_ASYNC=m
780# CONFIG_PPP_SYNC_TTY is not set
781CONFIG_PPP_DEFLATE=m
782# CONFIG_PPP_BSDCOMP is not set
783CONFIG_PPP_MPPE=m
784CONFIG_PPPOE=m
785# CONFIG_SLIP is not set 727# CONFIG_SLIP is not set
786CONFIG_SLHC=m
787# CONFIG_SHAPER is not set
788# CONFIG_NETCONSOLE is not set 728# CONFIG_NETCONSOLE is not set
789# CONFIG_NETPOLL is not set 729# CONFIG_NETPOLL is not set
790# CONFIG_NET_POLL_CONTROLLER is not set 730# CONFIG_NET_POLL_CONTROLLER is not set
791 731# CONFIG_VMXNET3 is not set
792#
793# ISDN subsystem
794#
795# CONFIG_ISDN is not set 732# CONFIG_ISDN is not set
796
797#
798# Telephony Support
799#
800# CONFIG_PHONE is not set 733# CONFIG_PHONE is not set
801 734
802# 735#
@@ -804,16 +737,14 @@ CONFIG_SLHC=m
804# 737#
805CONFIG_INPUT=y 738CONFIG_INPUT=y
806# CONFIG_INPUT_FF_MEMLESS is not set 739# CONFIG_INPUT_FF_MEMLESS is not set
740# CONFIG_INPUT_POLLDEV is not set
741# CONFIG_INPUT_SPARSEKMAP is not set
807 742
808# 743#
809# Userland interfaces 744# Userland interfaces
810# 745#
811CONFIG_INPUT_MOUSEDEV=y 746# CONFIG_INPUT_MOUSEDEV is not set
812CONFIG_INPUT_MOUSEDEV_PSAUX=y
813CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
814CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
815# CONFIG_INPUT_JOYDEV is not set 747# CONFIG_INPUT_JOYDEV is not set
816# CONFIG_INPUT_TSDEV is not set
817CONFIG_INPUT_EVDEV=y 748CONFIG_INPUT_EVDEV=y
818# CONFIG_INPUT_EVBUG is not set 749# CONFIG_INPUT_EVBUG is not set
819 750
@@ -823,33 +754,34 @@ CONFIG_INPUT_EVDEV=y
823# CONFIG_INPUT_KEYBOARD is not set 754# CONFIG_INPUT_KEYBOARD is not set
824# CONFIG_INPUT_MOUSE is not set 755# CONFIG_INPUT_MOUSE is not set
825# CONFIG_INPUT_JOYSTICK is not set 756# CONFIG_INPUT_JOYSTICK is not set
757# CONFIG_INPUT_TABLET is not set
826# CONFIG_INPUT_TOUCHSCREEN is not set 758# CONFIG_INPUT_TOUCHSCREEN is not set
827# CONFIG_INPUT_MISC is not set 759# CONFIG_INPUT_MISC is not set
828 760
829# 761#
830# Hardware I/O ports 762# Hardware I/O ports
831# 763#
832CONFIG_SERIO=y 764# CONFIG_SERIO is not set
833# CONFIG_SERIO_I8042 is not set
834CONFIG_SERIO_SERPORT=y
835# CONFIG_SERIO_PCIPS2 is not set
836# CONFIG_SERIO_LIBPS2 is not set
837CONFIG_SERIO_RAW=m
838# CONFIG_GAMEPORT is not set 765# CONFIG_GAMEPORT is not set
839 766
840# 767#
841# Character devices 768# Character devices
842# 769#
843# CONFIG_VT is not set 770CONFIG_VT=y
771CONFIG_CONSOLE_TRANSLATIONS=y
772CONFIG_VT_CONSOLE=y
773CONFIG_HW_CONSOLE=y
774CONFIG_VT_HW_CONSOLE_BINDING=y
775CONFIG_DEVKMEM=y
844# CONFIG_SERIAL_NONSTANDARD is not set 776# CONFIG_SERIAL_NONSTANDARD is not set
845# CONFIG_AU1X00_GPIO is not set 777# CONFIG_NOZOMI is not set
846 778
847# 779#
848# Serial drivers 780# Serial drivers
849# 781#
850CONFIG_SERIAL_8250=y 782CONFIG_SERIAL_8250=y
851CONFIG_SERIAL_8250_CONSOLE=y 783CONFIG_SERIAL_8250_CONSOLE=y
852CONFIG_SERIAL_8250_PCI=y 784# CONFIG_SERIAL_8250_PCI is not set
853# CONFIG_SERIAL_8250_CS is not set 785# CONFIG_SERIAL_8250_CS is not set
854CONFIG_SERIAL_8250_NR_UARTS=4 786CONFIG_SERIAL_8250_NR_UARTS=4
855CONFIG_SERIAL_8250_RUNTIME_UARTS=4 787CONFIG_SERIAL_8250_RUNTIME_UARTS=4
@@ -863,282 +795,450 @@ CONFIG_SERIAL_CORE=y
863CONFIG_SERIAL_CORE_CONSOLE=y 795CONFIG_SERIAL_CORE_CONSOLE=y
864# CONFIG_SERIAL_JSM is not set 796# CONFIG_SERIAL_JSM is not set
865CONFIG_UNIX98_PTYS=y 797CONFIG_UNIX98_PTYS=y
866CONFIG_LEGACY_PTYS=y 798# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
867CONFIG_LEGACY_PTY_COUNT=256 799# CONFIG_LEGACY_PTYS is not set
868
869#
870# IPMI
871#
872# CONFIG_IPMI_HANDLER is not set 800# CONFIG_IPMI_HANDLER is not set
873
874#
875# Watchdog Cards
876#
877# CONFIG_WATCHDOG is not set
878# CONFIG_HW_RANDOM is not set 801# CONFIG_HW_RANDOM is not set
879# CONFIG_RTC is not set
880# CONFIG_GEN_RTC is not set
881# CONFIG_DTLK is not set
882# CONFIG_R3964 is not set 802# CONFIG_R3964 is not set
883# CONFIG_APPLICOM is not set 803# CONFIG_APPLICOM is not set
884# CONFIG_DRM is not set
885 804
886# 805#
887# PCMCIA character devices 806# PCMCIA character devices
888# 807#
889CONFIG_SYNCLINK_CS=m 808# CONFIG_SYNCLINK_CS is not set
890# CONFIG_CARDMAN_4000 is not set 809# CONFIG_CARDMAN_4000 is not set
891# CONFIG_CARDMAN_4040 is not set 810# CONFIG_CARDMAN_4040 is not set
811# CONFIG_IPWIRELESS is not set
892# CONFIG_RAW_DRIVER is not set 812# CONFIG_RAW_DRIVER is not set
893
894#
895# TPM devices
896#
897# CONFIG_TCG_TPM is not set 813# CONFIG_TCG_TPM is not set
898 814CONFIG_DEVPORT=y
899#
900# I2C support
901#
902# CONFIG_I2C is not set 815# CONFIG_I2C is not set
903
904#
905# SPI support
906#
907# CONFIG_SPI is not set 816# CONFIG_SPI is not set
908# CONFIG_SPI_MASTER is not set
909 817
910# 818#
911# Dallas's 1-wire bus 819# PPS support
912# 820#
821# CONFIG_PPS is not set
822CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
823# CONFIG_GPIOLIB is not set
913# CONFIG_W1 is not set 824# CONFIG_W1 is not set
914 825# CONFIG_POWER_SUPPLY is not set
915#
916# Hardware Monitoring support
917#
918# CONFIG_HWMON is not set 826# CONFIG_HWMON is not set
919# CONFIG_HWMON_VID is not set 827# CONFIG_THERMAL is not set
828# CONFIG_WATCHDOG is not set
829CONFIG_SSB_POSSIBLE=y
920 830
921# 831#
922# Multimedia devices 832# Sonics Silicon Backplane
923# 833#
924# CONFIG_VIDEO_DEV is not set 834# CONFIG_SSB is not set
925 835
926# 836#
927# Digital Video Broadcasting Devices 837# Multifunction device drivers
928# 838#
929# CONFIG_DVB is not set 839# CONFIG_MFD_CORE is not set
840# CONFIG_MFD_SM501 is not set
841# CONFIG_HTC_PASIC3 is not set
842# CONFIG_MFD_TMIO is not set
843# CONFIG_REGULATOR is not set
844# CONFIG_MEDIA_SUPPORT is not set
930 845
931# 846#
932# Graphics support 847# Graphics support
933# 848#
934# CONFIG_FIRMWARE_EDID is not set 849# CONFIG_VGA_ARB is not set
935# CONFIG_FB is not set 850# CONFIG_DRM is not set
851# CONFIG_VGASTATE is not set
852# CONFIG_VIDEO_OUTPUT_CONTROL is not set
853CONFIG_FB=y
854CONFIG_FIRMWARE_EDID=y
855# CONFIG_FB_DDC is not set
856# CONFIG_FB_BOOT_VESA_SUPPORT is not set
857CONFIG_FB_CFB_FILLRECT=y
858CONFIG_FB_CFB_COPYAREA=y
859CONFIG_FB_CFB_IMAGEBLIT=y
860# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
861# CONFIG_FB_SYS_FILLRECT is not set
862# CONFIG_FB_SYS_COPYAREA is not set
863# CONFIG_FB_SYS_IMAGEBLIT is not set
864# CONFIG_FB_FOREIGN_ENDIAN is not set
865# CONFIG_FB_SYS_FOPS is not set
866# CONFIG_FB_SVGALIB is not set
867# CONFIG_FB_MACMODES is not set
868# CONFIG_FB_BACKLIGHT is not set
869CONFIG_FB_MODE_HELPERS=y
870CONFIG_FB_TILEBLITTING=y
871
872#
873# Frame buffer hardware drivers
874#
875# CONFIG_FB_CIRRUS is not set
876# CONFIG_FB_PM2 is not set
877# CONFIG_FB_CYBER2000 is not set
878# CONFIG_FB_ASILIANT is not set
879# CONFIG_FB_IMSTT is not set
880CONFIG_FB_S1D13XXX=y
881# CONFIG_FB_NVIDIA is not set
882# CONFIG_FB_RIVA is not set
883# CONFIG_FB_MATROX is not set
884# CONFIG_FB_RADEON is not set
885# CONFIG_FB_ATY128 is not set
886# CONFIG_FB_ATY is not set
887# CONFIG_FB_S3 is not set
888# CONFIG_FB_SAVAGE is not set
889# CONFIG_FB_SIS is not set
890# CONFIG_FB_VIA is not set
891# CONFIG_FB_NEOMAGIC is not set
892# CONFIG_FB_KYRO is not set
893# CONFIG_FB_3DFX is not set
894# CONFIG_FB_VOODOO1 is not set
895# CONFIG_FB_VT8623 is not set
896# CONFIG_FB_TRIDENT is not set
897# CONFIG_FB_ARK is not set
898# CONFIG_FB_PM3 is not set
899# CONFIG_FB_CARMINE is not set
900# CONFIG_FB_VIRTUAL is not set
901# CONFIG_FB_METRONOME is not set
902# CONFIG_FB_MB862XX is not set
903# CONFIG_FB_BROADSHEET is not set
936# CONFIG_BACKLIGHT_LCD_SUPPORT is not set 904# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
937 905
938# 906#
939# Sound 907# Display device support
940# 908#
941# CONFIG_SOUND is not set 909# CONFIG_DISPLAY_SUPPORT is not set
942
943#
944# HID Devices
945#
946# CONFIG_HID is not set
947 910
948# 911#
949# USB support 912# Console display driver support
950# 913#
914CONFIG_VGA_CONSOLE=y
915# CONFIG_VGACON_SOFT_SCROLLBACK is not set
916CONFIG_DUMMY_CONSOLE=y
917# CONFIG_FRAMEBUFFER_CONSOLE is not set
918# CONFIG_LOGO is not set
919# CONFIG_SOUND is not set
920CONFIG_HID_SUPPORT=y
921CONFIG_HID=y
922# CONFIG_HIDRAW is not set
923
924#
925# USB Input Devices
926#
927CONFIG_USB_HID=y
928# CONFIG_HID_PID is not set
929CONFIG_USB_HIDDEV=y
930
931#
932# Special HID drivers
933#
934# CONFIG_HID_A4TECH is not set
935# CONFIG_HID_APPLE is not set
936# CONFIG_HID_BELKIN is not set
937# CONFIG_HID_CHERRY is not set
938# CONFIG_HID_CHICONY is not set
939# CONFIG_HID_CYPRESS is not set
940# CONFIG_HID_DRAGONRISE is not set
941# CONFIG_HID_EZKEY is not set
942# CONFIG_HID_KYE is not set
943# CONFIG_HID_GYRATION is not set
944# CONFIG_HID_TWINHAN is not set
945# CONFIG_HID_KENSINGTON is not set
946# CONFIG_HID_LOGITECH is not set
947# CONFIG_HID_MICROSOFT is not set
948# CONFIG_HID_MONTEREY is not set
949# CONFIG_HID_NTRIG is not set
950# CONFIG_HID_PANTHERLORD is not set
951# CONFIG_HID_PETALYNX is not set
952# CONFIG_HID_SAMSUNG is not set
953# CONFIG_HID_SONY is not set
954# CONFIG_HID_SUNPLUS is not set
955# CONFIG_HID_GREENASIA is not set
956# CONFIG_HID_SMARTJOYPLUS is not set
957# CONFIG_HID_TOPSEED is not set
958# CONFIG_HID_THRUSTMASTER is not set
959# CONFIG_HID_ZEROPLUS is not set
960CONFIG_USB_SUPPORT=y
951CONFIG_USB_ARCH_HAS_HCD=y 961CONFIG_USB_ARCH_HAS_HCD=y
952CONFIG_USB_ARCH_HAS_OHCI=y 962CONFIG_USB_ARCH_HAS_OHCI=y
953CONFIG_USB_ARCH_HAS_EHCI=y 963CONFIG_USB_ARCH_HAS_EHCI=y
954# CONFIG_USB is not set 964CONFIG_USB=y
965# CONFIG_USB_DEBUG is not set
966# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
955 967
956# 968#
957# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' 969# Miscellaneous USB options
958# 970#
971# CONFIG_USB_DEVICEFS is not set
972# CONFIG_USB_DEVICE_CLASS is not set
973CONFIG_USB_DYNAMIC_MINORS=y
974# CONFIG_USB_SUSPEND is not set
975# CONFIG_USB_OTG is not set
976CONFIG_USB_OTG_WHITELIST=y
977# CONFIG_USB_OTG_BLACKLIST_HUB is not set
978# CONFIG_USB_MON is not set
979# CONFIG_USB_WUSB is not set
980# CONFIG_USB_WUSB_CBAF is not set
959 981
960# 982#
961# USB Gadget Support 983# USB Host Controller Drivers
962# 984#
963# CONFIG_USB_GADGET is not set 985# CONFIG_USB_C67X00_HCD is not set
986# CONFIG_USB_XHCI_HCD is not set
987# CONFIG_USB_EHCI_HCD is not set
988# CONFIG_USB_OXU210HP_HCD is not set
989# CONFIG_USB_ISP116X_HCD is not set
990# CONFIG_USB_ISP1760_HCD is not set
991# CONFIG_USB_ISP1362_HCD is not set
992CONFIG_USB_OHCI_HCD=y
993# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
994# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
995CONFIG_USB_OHCI_LITTLE_ENDIAN=y
996# CONFIG_USB_UHCI_HCD is not set
997# CONFIG_USB_SL811_HCD is not set
998# CONFIG_USB_R8A66597_HCD is not set
999# CONFIG_USB_WHCI_HCD is not set
1000# CONFIG_USB_HWA_HCD is not set
964 1001
965# 1002#
966# MMC/SD Card support 1003# USB Device Class drivers
967# 1004#
968# CONFIG_MMC is not set 1005# CONFIG_USB_ACM is not set
1006# CONFIG_USB_PRINTER is not set
1007# CONFIG_USB_WDM is not set
1008# CONFIG_USB_TMC is not set
969 1009
970# 1010#
971# LED devices 1011# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
972# 1012#
973# CONFIG_NEW_LEDS is not set
974 1013
975# 1014#
976# LED drivers 1015# also be needed; see USB_STORAGE Help for more info
977# 1016#
1017# CONFIG_USB_LIBUSUAL is not set
978 1018
979# 1019#
980# LED Triggers 1020# USB Imaging devices
981# 1021#
1022# CONFIG_USB_MDC800 is not set
982 1023
983# 1024#
984# InfiniBand support 1025# USB port drivers
985# 1026#
986# CONFIG_INFINIBAND is not set 1027# CONFIG_USB_SERIAL is not set
987 1028
988# 1029#
989# EDAC - error detection and reporting (RAS) (EXPERIMENTAL) 1030# USB Miscellaneous drivers
990# 1031#
1032# CONFIG_USB_EMI62 is not set
1033# CONFIG_USB_EMI26 is not set
1034# CONFIG_USB_ADUTUX is not set
1035# CONFIG_USB_SEVSEG is not set
1036# CONFIG_USB_RIO500 is not set
1037# CONFIG_USB_LEGOTOWER is not set
1038# CONFIG_USB_LCD is not set
1039# CONFIG_USB_BERRY_CHARGE is not set
1040# CONFIG_USB_LED is not set
1041# CONFIG_USB_CYPRESS_CY7C63 is not set
1042# CONFIG_USB_CYTHERM is not set
1043# CONFIG_USB_IDMOUSE is not set
1044# CONFIG_USB_FTDI_ELAN is not set
1045# CONFIG_USB_APPLEDISPLAY is not set
1046# CONFIG_USB_LD is not set
1047# CONFIG_USB_TRANCEVIBRATOR is not set
1048# CONFIG_USB_IOWARRIOR is not set
1049# CONFIG_USB_TEST is not set
1050# CONFIG_USB_ISIGHTFW is not set
1051# CONFIG_USB_VST is not set
1052# CONFIG_USB_GADGET is not set
991 1053
992# 1054#
993# Real Time Clock 1055# OTG and related infrastructure
994# 1056#
995# CONFIG_RTC_CLASS is not set 1057# CONFIG_USB_GPIO_VBUS is not set
1058# CONFIG_NOP_USB_XCEIV is not set
1059# CONFIG_UWB is not set
1060# CONFIG_MMC is not set
1061# CONFIG_MEMSTICK is not set
1062# CONFIG_NEW_LEDS is not set
1063# CONFIG_ACCESSIBILITY is not set
1064# CONFIG_INFINIBAND is not set
1065CONFIG_RTC_LIB=y
1066CONFIG_RTC_CLASS=y
1067CONFIG_RTC_HCTOSYS=y
1068CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
1069# CONFIG_RTC_DEBUG is not set
996 1070
997# 1071#
998# DMA Engine support 1072# RTC interfaces
999# 1073#
1000# CONFIG_DMA_ENGINE is not set 1074CONFIG_RTC_INTF_SYSFS=y
1075CONFIG_RTC_INTF_PROC=y
1076CONFIG_RTC_INTF_DEV=y
1077# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
1078# CONFIG_RTC_DRV_TEST is not set
1001 1079
1002# 1080#
1003# DMA Clients 1081# SPI RTC drivers
1004# 1082#
1005 1083
1006# 1084#
1007# DMA Devices 1085# Platform RTC drivers
1008# 1086#
1087# CONFIG_RTC_DRV_CMOS is not set
1088# CONFIG_RTC_DRV_DS1286 is not set
1089# CONFIG_RTC_DRV_DS1511 is not set
1090# CONFIG_RTC_DRV_DS1553 is not set
1091# CONFIG_RTC_DRV_DS1742 is not set
1092# CONFIG_RTC_DRV_STK17TA8 is not set
1093# CONFIG_RTC_DRV_M48T86 is not set
1094# CONFIG_RTC_DRV_M48T35 is not set
1095# CONFIG_RTC_DRV_M48T59 is not set
1096# CONFIG_RTC_DRV_MSM6242 is not set
1097# CONFIG_RTC_DRV_BQ4802 is not set
1098# CONFIG_RTC_DRV_RP5C01 is not set
1099# CONFIG_RTC_DRV_V3020 is not set
1009 1100
1010# 1101#
1011# Auxiliary Display support 1102# on-CPU RTC drivers
1012# 1103#
1104CONFIG_RTC_DRV_AU1XXX=y
1105# CONFIG_DMADEVICES is not set
1106# CONFIG_AUXDISPLAY is not set
1107# CONFIG_UIO is not set
1013 1108
1014# 1109#
1015# Virtualization 1110# TI VLYNQ
1016# 1111#
1112# CONFIG_STAGING is not set
1017 1113
1018# 1114#
1019# File systems 1115# File systems
1020# 1116#
1021CONFIG_EXT2_FS=y 1117CONFIG_EXT2_FS=y
1022CONFIG_EXT2_FS_XATTR=y 1118# CONFIG_EXT2_FS_XATTR is not set
1023CONFIG_EXT2_FS_POSIX_ACL=y
1024# CONFIG_EXT2_FS_SECURITY is not set
1025# CONFIG_EXT2_FS_XIP is not set 1119# CONFIG_EXT2_FS_XIP is not set
1026CONFIG_EXT3_FS=y 1120# CONFIG_EXT3_FS is not set
1027CONFIG_EXT3_FS_XATTR=y 1121# CONFIG_EXT4_FS is not set
1028CONFIG_EXT3_FS_POSIX_ACL=y 1122# CONFIG_REISERFS_FS is not set
1029CONFIG_EXT3_FS_SECURITY=y
1030# CONFIG_EXT4DEV_FS is not set
1031CONFIG_JBD=y
1032# CONFIG_JBD_DEBUG is not set
1033CONFIG_FS_MBCACHE=y
1034CONFIG_REISERFS_FS=m
1035# CONFIG_REISERFS_CHECK is not set
1036# CONFIG_REISERFS_PROC_INFO is not set
1037CONFIG_REISERFS_FS_XATTR=y
1038CONFIG_REISERFS_FS_POSIX_ACL=y
1039CONFIG_REISERFS_FS_SECURITY=y
1040# CONFIG_JFS_FS is not set 1123# CONFIG_JFS_FS is not set
1041CONFIG_FS_POSIX_ACL=y 1124# CONFIG_FS_POSIX_ACL is not set
1042# CONFIG_XFS_FS is not set 1125# CONFIG_XFS_FS is not set
1043# CONFIG_GFS2_FS is not set 1126# CONFIG_GFS2_FS is not set
1044# CONFIG_OCFS2_FS is not set 1127# CONFIG_OCFS2_FS is not set
1045# CONFIG_MINIX_FS is not set 1128# CONFIG_BTRFS_FS is not set
1046# CONFIG_ROMFS_FS is not set 1129# CONFIG_NILFS2_FS is not set
1130CONFIG_FILE_LOCKING=y
1131CONFIG_FSNOTIFY=y
1132CONFIG_DNOTIFY=y
1047CONFIG_INOTIFY=y 1133CONFIG_INOTIFY=y
1048CONFIG_INOTIFY_USER=y 1134CONFIG_INOTIFY_USER=y
1049# CONFIG_QUOTA is not set 1135# CONFIG_QUOTA is not set
1050CONFIG_DNOTIFY=y 1136# CONFIG_AUTOFS_FS is not set
1051CONFIG_AUTOFS_FS=m 1137# CONFIG_AUTOFS4_FS is not set
1052CONFIG_AUTOFS4_FS=m 1138# CONFIG_FUSE_FS is not set
1053CONFIG_FUSE_FS=m 1139
1054CONFIG_GENERIC_ACL=y 1140#
1141# Caches
1142#
1143# CONFIG_FSCACHE is not set
1055 1144
1056# 1145#
1057# CD-ROM/DVD Filesystems 1146# CD-ROM/DVD Filesystems
1058# 1147#
1059# CONFIG_ISO9660_FS is not set 1148CONFIG_ISO9660_FS=y
1060# CONFIG_UDF_FS is not set 1149CONFIG_JOLIET=y
1150CONFIG_ZISOFS=y
1151CONFIG_UDF_FS=y
1152CONFIG_UDF_NLS=y
1061 1153
1062# 1154#
1063# DOS/FAT/NT Filesystems 1155# DOS/FAT/NT Filesystems
1064# 1156#
1157CONFIG_FAT_FS=y
1065# CONFIG_MSDOS_FS is not set 1158# CONFIG_MSDOS_FS is not set
1066# CONFIG_VFAT_FS is not set 1159CONFIG_VFAT_FS=y
1160CONFIG_FAT_DEFAULT_CODEPAGE=437
1161CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1067# CONFIG_NTFS_FS is not set 1162# CONFIG_NTFS_FS is not set
1068 1163
1069# 1164#
1070# Pseudo filesystems 1165# Pseudo filesystems
1071# 1166#
1072CONFIG_PROC_FS=y 1167CONFIG_PROC_FS=y
1073CONFIG_PROC_KCORE=y 1168# CONFIG_PROC_KCORE is not set
1074CONFIG_PROC_SYSCTL=y 1169CONFIG_PROC_SYSCTL=y
1170# CONFIG_PROC_PAGE_MONITOR is not set
1075CONFIG_SYSFS=y 1171CONFIG_SYSFS=y
1076CONFIG_TMPFS=y 1172CONFIG_TMPFS=y
1077CONFIG_TMPFS_POSIX_ACL=y 1173# CONFIG_TMPFS_POSIX_ACL is not set
1078# CONFIG_HUGETLB_PAGE is not set 1174# CONFIG_HUGETLB_PAGE is not set
1079CONFIG_RAMFS=y 1175# CONFIG_CONFIGFS_FS is not set
1080CONFIG_CONFIGFS_FS=m 1176CONFIG_MISC_FILESYSTEMS=y
1081
1082#
1083# Miscellaneous filesystems
1084#
1085# CONFIG_ADFS_FS is not set 1177# CONFIG_ADFS_FS is not set
1086# CONFIG_AFFS_FS is not set 1178# CONFIG_AFFS_FS is not set
1087# CONFIG_ECRYPT_FS is not set
1088# CONFIG_HFS_FS is not set 1179# CONFIG_HFS_FS is not set
1089# CONFIG_HFSPLUS_FS is not set 1180# CONFIG_HFSPLUS_FS is not set
1090# CONFIG_BEFS_FS is not set 1181# CONFIG_BEFS_FS is not set
1091# CONFIG_BFS_FS is not set 1182# CONFIG_BFS_FS is not set
1092# CONFIG_EFS_FS is not set 1183# CONFIG_EFS_FS is not set
1093# CONFIG_JFFS2_FS is not set 1184CONFIG_JFFS2_FS=y
1094CONFIG_CRAMFS=m 1185CONFIG_JFFS2_FS_DEBUG=0
1186CONFIG_JFFS2_FS_WRITEBUFFER=y
1187# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
1188CONFIG_JFFS2_SUMMARY=y
1189# CONFIG_JFFS2_FS_XATTR is not set
1190CONFIG_JFFS2_COMPRESSION_OPTIONS=y
1191CONFIG_JFFS2_ZLIB=y
1192CONFIG_JFFS2_LZO=y
1193CONFIG_JFFS2_RTIME=y
1194CONFIG_JFFS2_RUBIN=y
1195# CONFIG_JFFS2_CMODE_NONE is not set
1196CONFIG_JFFS2_CMODE_PRIORITY=y
1197# CONFIG_JFFS2_CMODE_SIZE is not set
1198# CONFIG_JFFS2_CMODE_FAVOURLZO is not set
1199# CONFIG_CRAMFS is not set
1200CONFIG_SQUASHFS=y
1201# CONFIG_SQUASHFS_EMBEDDED is not set
1202CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
1095# CONFIG_VXFS_FS is not set 1203# CONFIG_VXFS_FS is not set
1204# CONFIG_MINIX_FS is not set
1205# CONFIG_OMFS_FS is not set
1096# CONFIG_HPFS_FS is not set 1206# CONFIG_HPFS_FS is not set
1097# CONFIG_QNX4FS_FS is not set 1207# CONFIG_QNX4FS_FS is not set
1208# CONFIG_ROMFS_FS is not set
1098# CONFIG_SYSV_FS is not set 1209# CONFIG_SYSV_FS is not set
1099# CONFIG_UFS_FS is not set 1210# CONFIG_UFS_FS is not set
1100 1211CONFIG_NETWORK_FILESYSTEMS=y
1101#
1102# Network File Systems
1103#
1104CONFIG_NFS_FS=y 1212CONFIG_NFS_FS=y
1105# CONFIG_NFS_V3 is not set 1213CONFIG_NFS_V3=y
1214# CONFIG_NFS_V3_ACL is not set
1106# CONFIG_NFS_V4 is not set 1215# CONFIG_NFS_V4 is not set
1107# CONFIG_NFS_DIRECTIO is not set
1108CONFIG_NFSD=m
1109# CONFIG_NFSD_V3 is not set
1110# CONFIG_NFSD_TCP is not set
1111CONFIG_ROOT_NFS=y 1216CONFIG_ROOT_NFS=y
1217# CONFIG_NFSD is not set
1112CONFIG_LOCKD=y 1218CONFIG_LOCKD=y
1113CONFIG_EXPORTFS=m 1219CONFIG_LOCKD_V4=y
1114CONFIG_NFS_COMMON=y 1220CONFIG_NFS_COMMON=y
1115CONFIG_SUNRPC=y 1221CONFIG_SUNRPC=y
1116# CONFIG_RPCSEC_GSS_KRB5 is not set 1222# CONFIG_RPCSEC_GSS_KRB5 is not set
1117# CONFIG_RPCSEC_GSS_SPKM3 is not set 1223# CONFIG_RPCSEC_GSS_SPKM3 is not set
1118CONFIG_SMB_FS=m 1224# CONFIG_SMB_FS is not set
1119# CONFIG_SMB_NLS_DEFAULT is not set
1120# CONFIG_CIFS is not set 1225# CONFIG_CIFS is not set
1121# CONFIG_NCP_FS is not set 1226# CONFIG_NCP_FS is not set
1122# CONFIG_CODA_FS is not set 1227# CONFIG_CODA_FS is not set
1123# CONFIG_AFS_FS is not set 1228# CONFIG_AFS_FS is not set
1124# CONFIG_9P_FS is not set
1125 1229
1126# 1230#
1127# Partition Types 1231# Partition Types
1128# 1232#
1129# CONFIG_PARTITION_ADVANCED is not set 1233# CONFIG_PARTITION_ADVANCED is not set
1130CONFIG_MSDOS_PARTITION=y 1234CONFIG_MSDOS_PARTITION=y
1131 1235CONFIG_NLS=y
1132#
1133# Native Language Support
1134#
1135CONFIG_NLS=m
1136CONFIG_NLS_DEFAULT="iso8859-1" 1236CONFIG_NLS_DEFAULT="iso8859-1"
1137# CONFIG_NLS_CODEPAGE_437 is not set 1237CONFIG_NLS_CODEPAGE_437=y
1138# CONFIG_NLS_CODEPAGE_737 is not set 1238# CONFIG_NLS_CODEPAGE_737 is not set
1139# CONFIG_NLS_CODEPAGE_775 is not set 1239# CONFIG_NLS_CODEPAGE_775 is not set
1140# CONFIG_NLS_CODEPAGE_850 is not set 1240CONFIG_NLS_CODEPAGE_850=y
1141# CONFIG_NLS_CODEPAGE_852 is not set 1241CONFIG_NLS_CODEPAGE_852=y
1142# CONFIG_NLS_CODEPAGE_855 is not set 1242# CONFIG_NLS_CODEPAGE_855 is not set
1143# CONFIG_NLS_CODEPAGE_857 is not set 1243# CONFIG_NLS_CODEPAGE_857 is not set
1144# CONFIG_NLS_CODEPAGE_860 is not set 1244# CONFIG_NLS_CODEPAGE_860 is not set
@@ -1155,10 +1255,10 @@ CONFIG_NLS_DEFAULT="iso8859-1"
1155# CONFIG_NLS_CODEPAGE_949 is not set 1255# CONFIG_NLS_CODEPAGE_949 is not set
1156# CONFIG_NLS_CODEPAGE_874 is not set 1256# CONFIG_NLS_CODEPAGE_874 is not set
1157# CONFIG_NLS_ISO8859_8 is not set 1257# CONFIG_NLS_ISO8859_8 is not set
1158# CONFIG_NLS_CODEPAGE_1250 is not set 1258CONFIG_NLS_CODEPAGE_1250=y
1159# CONFIG_NLS_CODEPAGE_1251 is not set 1259# CONFIG_NLS_CODEPAGE_1251 is not set
1160# CONFIG_NLS_ASCII is not set 1260CONFIG_NLS_ASCII=y
1161# CONFIG_NLS_ISO8859_1 is not set 1261CONFIG_NLS_ISO8859_1=y
1162# CONFIG_NLS_ISO8859_2 is not set 1262# CONFIG_NLS_ISO8859_2 is not set
1163# CONFIG_NLS_ISO8859_3 is not set 1263# CONFIG_NLS_ISO8859_3 is not set
1164# CONFIG_NLS_ISO8859_4 is not set 1264# CONFIG_NLS_ISO8859_4 is not set
@@ -1168,38 +1268,75 @@ CONFIG_NLS_DEFAULT="iso8859-1"
1168# CONFIG_NLS_ISO8859_9 is not set 1268# CONFIG_NLS_ISO8859_9 is not set
1169# CONFIG_NLS_ISO8859_13 is not set 1269# CONFIG_NLS_ISO8859_13 is not set
1170# CONFIG_NLS_ISO8859_14 is not set 1270# CONFIG_NLS_ISO8859_14 is not set
1171# CONFIG_NLS_ISO8859_15 is not set 1271CONFIG_NLS_ISO8859_15=y
1172# CONFIG_NLS_KOI8_R is not set 1272# CONFIG_NLS_KOI8_R is not set
1173# CONFIG_NLS_KOI8_U is not set 1273# CONFIG_NLS_KOI8_U is not set
1174# CONFIG_NLS_UTF8 is not set 1274CONFIG_NLS_UTF8=y
1175 1275# CONFIG_DLM is not set
1176#
1177# Distributed Lock Manager
1178#
1179CONFIG_DLM=m
1180CONFIG_DLM_TCP=y
1181# CONFIG_DLM_SCTP is not set
1182# CONFIG_DLM_DEBUG is not set
1183
1184#
1185# Profiling support
1186#
1187# CONFIG_PROFILING is not set
1188 1276
1189# 1277#
1190# Kernel hacking 1278# Kernel hacking
1191# 1279#
1192CONFIG_TRACE_IRQFLAGS_SUPPORT=y 1280CONFIG_TRACE_IRQFLAGS_SUPPORT=y
1193# CONFIG_PRINTK_TIME is not set 1281# CONFIG_PRINTK_TIME is not set
1282CONFIG_ENABLE_WARN_DEPRECATED=y
1194CONFIG_ENABLE_MUST_CHECK=y 1283CONFIG_ENABLE_MUST_CHECK=y
1284CONFIG_FRAME_WARN=1024
1195# CONFIG_MAGIC_SYSRQ is not set 1285# CONFIG_MAGIC_SYSRQ is not set
1286CONFIG_STRIP_ASM_SYMS=y
1196# CONFIG_UNUSED_SYMBOLS is not set 1287# CONFIG_UNUSED_SYMBOLS is not set
1197# CONFIG_DEBUG_FS is not set 1288# CONFIG_DEBUG_FS is not set
1198# CONFIG_HEADERS_CHECK is not set 1289# CONFIG_HEADERS_CHECK is not set
1199# CONFIG_DEBUG_KERNEL is not set 1290CONFIG_DEBUG_KERNEL=y
1200CONFIG_LOG_BUF_SHIFT=14 1291# CONFIG_DEBUG_SHIRQ is not set
1201CONFIG_CROSSCOMPILE=y 1292# CONFIG_DETECT_SOFTLOCKUP is not set
1293# CONFIG_DETECT_HUNG_TASK is not set
1294# CONFIG_SCHED_DEBUG is not set
1295# CONFIG_SCHEDSTATS is not set
1296# CONFIG_TIMER_STATS is not set
1297# CONFIG_DEBUG_OBJECTS is not set
1298# CONFIG_DEBUG_SLAB is not set
1299# CONFIG_DEBUG_RT_MUTEXES is not set
1300# CONFIG_RT_MUTEX_TESTER is not set
1301# CONFIG_DEBUG_SPINLOCK is not set
1302# CONFIG_DEBUG_MUTEXES is not set
1303# CONFIG_DEBUG_LOCK_ALLOC is not set
1304# CONFIG_PROVE_LOCKING is not set
1305# CONFIG_LOCK_STAT is not set
1306# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1307# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1308# CONFIG_DEBUG_KOBJECT is not set
1309# CONFIG_DEBUG_INFO is not set
1310# CONFIG_DEBUG_VM is not set
1311# CONFIG_DEBUG_WRITECOUNT is not set
1312# CONFIG_DEBUG_MEMORY_INIT is not set
1313# CONFIG_DEBUG_LIST is not set
1314# CONFIG_DEBUG_SG is not set
1315# CONFIG_DEBUG_NOTIFIERS is not set
1316# CONFIG_DEBUG_CREDENTIALS is not set
1317# CONFIG_BOOT_PRINTK_DELAY is not set
1318# CONFIG_RCU_TORTURE_TEST is not set
1319# CONFIG_BACKTRACE_SELF_TEST is not set
1320# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1321# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
1322# CONFIG_FAULT_INJECTION is not set
1323# CONFIG_SYSCTL_SYSCALL_CHECK is not set
1324# CONFIG_PAGE_POISONING is not set
1325CONFIG_HAVE_FUNCTION_TRACER=y
1326CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1327CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y
1328CONFIG_HAVE_DYNAMIC_FTRACE=y
1329CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1330CONFIG_TRACING_SUPPORT=y
1331# CONFIG_FTRACE is not set
1332# CONFIG_SAMPLES is not set
1333CONFIG_HAVE_ARCH_KGDB=y
1334# CONFIG_KGDB is not set
1335CONFIG_EARLY_PRINTK=y
1202# CONFIG_CMDLINE_BOOL is not set 1336# CONFIG_CMDLINE_BOOL is not set
1337# CONFIG_DEBUG_STACK_USAGE is not set
1338# CONFIG_RUNTIME_DEBUG is not set
1339CONFIG_DEBUG_ZBOOT=y
1203 1340
1204# 1341#
1205# Security options 1342# Security options
@@ -1207,67 +1344,32 @@ CONFIG_CROSSCOMPILE=y
1207CONFIG_KEYS=y 1344CONFIG_KEYS=y
1208CONFIG_KEYS_DEBUG_PROC_KEYS=y 1345CONFIG_KEYS_DEBUG_PROC_KEYS=y
1209# CONFIG_SECURITY is not set 1346# CONFIG_SECURITY is not set
1210 1347CONFIG_SECURITYFS=y
1211# 1348# CONFIG_DEFAULT_SECURITY_SELINUX is not set
1212# Cryptographic options 1349# CONFIG_DEFAULT_SECURITY_SMACK is not set
1213# 1350# CONFIG_DEFAULT_SECURITY_TOMOYO is not set
1214CONFIG_CRYPTO=y 1351CONFIG_DEFAULT_SECURITY_DAC=y
1215CONFIG_CRYPTO_ALGAPI=y 1352CONFIG_DEFAULT_SECURITY=""
1216CONFIG_CRYPTO_BLKCIPHER=m 1353# CONFIG_CRYPTO is not set
1217CONFIG_CRYPTO_HASH=y 1354# CONFIG_BINARY_PRINTF is not set
1218CONFIG_CRYPTO_MANAGER=y
1219CONFIG_CRYPTO_HMAC=y
1220CONFIG_CRYPTO_XCBC=m
1221CONFIG_CRYPTO_NULL=m
1222CONFIG_CRYPTO_MD4=m
1223CONFIG_CRYPTO_MD5=y
1224CONFIG_CRYPTO_SHA1=m
1225CONFIG_CRYPTO_SHA256=m
1226CONFIG_CRYPTO_SHA512=m
1227CONFIG_CRYPTO_WP512=m
1228CONFIG_CRYPTO_TGR192=m
1229CONFIG_CRYPTO_GF128MUL=m
1230CONFIG_CRYPTO_ECB=m
1231CONFIG_CRYPTO_CBC=m
1232CONFIG_CRYPTO_PCBC=m
1233CONFIG_CRYPTO_LRW=m
1234CONFIG_CRYPTO_DES=m
1235CONFIG_CRYPTO_FCRYPT=m
1236CONFIG_CRYPTO_BLOWFISH=m
1237CONFIG_CRYPTO_TWOFISH=m
1238CONFIG_CRYPTO_TWOFISH_COMMON=m
1239CONFIG_CRYPTO_SERPENT=m
1240CONFIG_CRYPTO_AES=m
1241CONFIG_CRYPTO_CAST5=m
1242CONFIG_CRYPTO_CAST6=m
1243CONFIG_CRYPTO_TEA=m
1244CONFIG_CRYPTO_ARC4=m
1245CONFIG_CRYPTO_KHAZAD=m
1246CONFIG_CRYPTO_ANUBIS=m
1247CONFIG_CRYPTO_DEFLATE=m
1248CONFIG_CRYPTO_MICHAEL_MIC=m
1249CONFIG_CRYPTO_CRC32C=m
1250CONFIG_CRYPTO_CAMELLIA=m
1251# CONFIG_CRYPTO_TEST is not set
1252
1253#
1254# Hardware crypto devices
1255#
1256 1355
1257# 1356#
1258# Library routines 1357# Library routines
1259# 1358#
1260CONFIG_BITREVERSE=y 1359CONFIG_BITREVERSE=y
1261CONFIG_CRC_CCITT=m 1360CONFIG_GENERIC_FIND_LAST_BIT=y
1262CONFIG_CRC16=m 1361# CONFIG_CRC_CCITT is not set
1362# CONFIG_CRC16 is not set
1363# CONFIG_CRC_T10DIF is not set
1364CONFIG_CRC_ITU_T=y
1263CONFIG_CRC32=y 1365CONFIG_CRC32=y
1264CONFIG_LIBCRC32C=m 1366# CONFIG_CRC7 is not set
1265CONFIG_ZLIB_INFLATE=m 1367# CONFIG_LIBCRC32C is not set
1266CONFIG_ZLIB_DEFLATE=m 1368CONFIG_ZLIB_INFLATE=y
1267CONFIG_TEXTSEARCH=y 1369CONFIG_ZLIB_DEFLATE=y
1268CONFIG_TEXTSEARCH_KMP=m 1370CONFIG_LZO_COMPRESS=y
1269CONFIG_TEXTSEARCH_BM=m 1371CONFIG_LZO_DECOMPRESS=y
1270CONFIG_TEXTSEARCH_FSM=m
1271CONFIG_PLIST=y
1272CONFIG_HAS_IOMEM=y 1372CONFIG_HAS_IOMEM=y
1273CONFIG_HAS_IOPORT=y 1373CONFIG_HAS_IOPORT=y
1374CONFIG_HAS_DMA=y
1375CONFIG_NLATTR=y
diff --git a/arch/mips/configs/pb1550_defconfig b/arch/mips/configs/pb1550_defconfig
index 6647642b5d97..aa526f53cb1b 100644
--- a/arch/mips/configs/pb1550_defconfig
+++ b/arch/mips/configs/pb1550_defconfig
@@ -1,79 +1,103 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.20 3# Linux kernel version: 2.6.33
4# Tue Feb 20 21:47:37 2007 4# Fri Feb 26 10:06:07 2010
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
8# 8#
9# Machine selection 9# Machine selection
10# 10#
11CONFIG_ZONE_DMA=y
12CONFIG_MACH_ALCHEMY=y 11CONFIG_MACH_ALCHEMY=y
13# CONFIG_MIPS_MTX1 is not set 12# CONFIG_AR7 is not set
14# CONFIG_MIPS_BOSPORUS is not set 13# CONFIG_BCM47XX is not set
15# CONFIG_MIPS_PB1000 is not set 14# CONFIG_BCM63XX is not set
16# CONFIG_MIPS_PB1100 is not set
17# CONFIG_MIPS_PB1500 is not set
18CONFIG_MIPS_PB1550=y
19# CONFIG_MIPS_PB1200 is not set
20# CONFIG_MIPS_DB1000 is not set
21# CONFIG_MIPS_DB1100 is not set
22# CONFIG_MIPS_DB1500 is not set
23# CONFIG_MIPS_DB1550 is not set
24# CONFIG_MIPS_DB1200 is not set
25# CONFIG_MIPS_MIRAGE is not set
26# CONFIG_MIPS_COBALT is not set 15# CONFIG_MIPS_COBALT is not set
27# CONFIG_MACH_DECSTATION is not set 16# CONFIG_MACH_DECSTATION is not set
28# CONFIG_MACH_JAZZ is not set 17# CONFIG_MACH_JAZZ is not set
18# CONFIG_LASAT is not set
19# CONFIG_MACH_LOONGSON is not set
29# CONFIG_MIPS_MALTA is not set 20# CONFIG_MIPS_MALTA is not set
30# CONFIG_WR_PPMC is not set
31# CONFIG_MIPS_SIM is not set 21# CONFIG_MIPS_SIM is not set
32# CONFIG_MOMENCO_JAGUAR_ATX is not set 22# CONFIG_NEC_MARKEINS is not set
33# CONFIG_MIPS_XXS1500 is not set 23# CONFIG_MACH_VR41XX is not set
24# CONFIG_NXP_STB220 is not set
25# CONFIG_NXP_STB225 is not set
34# CONFIG_PNX8550_JBS is not set 26# CONFIG_PNX8550_JBS is not set
35# CONFIG_PNX8550_STB810 is not set 27# CONFIG_PNX8550_STB810 is not set
36# CONFIG_MACH_VR41XX is not set 28# CONFIG_PMC_MSP is not set
37# CONFIG_PMC_YOSEMITE is not set 29# CONFIG_PMC_YOSEMITE is not set
38# CONFIG_MARKEINS is not set 30# CONFIG_POWERTV is not set
39# CONFIG_SGI_IP22 is not set 31# CONFIG_SGI_IP22 is not set
40# CONFIG_SGI_IP27 is not set 32# CONFIG_SGI_IP27 is not set
33# CONFIG_SGI_IP28 is not set
41# CONFIG_SGI_IP32 is not set 34# CONFIG_SGI_IP32 is not set
42# CONFIG_SIBYTE_BIGSUR is not set
43# CONFIG_SIBYTE_SWARM is not set
44# CONFIG_SIBYTE_SENTOSA is not set
45# CONFIG_SIBYTE_RHONE is not set
46# CONFIG_SIBYTE_CARMEL is not set
47# CONFIG_SIBYTE_LITTLESUR is not set
48# CONFIG_SIBYTE_CRHINE is not set 35# CONFIG_SIBYTE_CRHINE is not set
36# CONFIG_SIBYTE_CARMEL is not set
49# CONFIG_SIBYTE_CRHONE is not set 37# CONFIG_SIBYTE_CRHONE is not set
38# CONFIG_SIBYTE_RHONE is not set
39# CONFIG_SIBYTE_SWARM is not set
40# CONFIG_SIBYTE_LITTLESUR is not set
41# CONFIG_SIBYTE_SENTOSA is not set
42# CONFIG_SIBYTE_BIGSUR is not set
50# CONFIG_SNI_RM is not set 43# CONFIG_SNI_RM is not set
51# CONFIG_TOSHIBA_JMR3927 is not set 44# CONFIG_MACH_TX39XX is not set
52# CONFIG_TOSHIBA_RBTX4927 is not set 45# CONFIG_MACH_TX49XX is not set
53# CONFIG_TOSHIBA_RBTX4938 is not set 46# CONFIG_MIKROTIK_RB532 is not set
47# CONFIG_WR_PPMC is not set
48# CONFIG_CAVIUM_OCTEON_SIMULATOR is not set
49# CONFIG_CAVIUM_OCTEON_REFERENCE_BOARD is not set
50CONFIG_ALCHEMY_GPIOINT_AU1000=y
51# CONFIG_ALCHEMY_GPIO_INDIRECT is not set
52# CONFIG_MIPS_MTX1 is not set
53# CONFIG_MIPS_BOSPORUS is not set
54# CONFIG_MIPS_DB1000 is not set
55# CONFIG_MIPS_DB1100 is not set
56# CONFIG_MIPS_DB1200 is not set
57# CONFIG_MIPS_DB1500 is not set
58# CONFIG_MIPS_DB1550 is not set
59# CONFIG_MIPS_MIRAGE is not set
60# CONFIG_MIPS_PB1000 is not set
61# CONFIG_MIPS_PB1100 is not set
62# CONFIG_MIPS_PB1200 is not set
63# CONFIG_MIPS_PB1500 is not set
64CONFIG_MIPS_PB1550=y
65# CONFIG_MIPS_XXS1500 is not set
66CONFIG_SOC_AU1550=y
67CONFIG_SOC_AU1X00=y
68CONFIG_LOONGSON_UART_BASE=y
54CONFIG_RWSEM_GENERIC_SPINLOCK=y 69CONFIG_RWSEM_GENERIC_SPINLOCK=y
55# CONFIG_ARCH_HAS_ILOG2_U32 is not set 70# CONFIG_ARCH_HAS_ILOG2_U32 is not set
56# CONFIG_ARCH_HAS_ILOG2_U64 is not set 71# CONFIG_ARCH_HAS_ILOG2_U64 is not set
72CONFIG_ARCH_SUPPORTS_OPROFILE=y
57CONFIG_GENERIC_FIND_NEXT_BIT=y 73CONFIG_GENERIC_FIND_NEXT_BIT=y
58CONFIG_GENERIC_HWEIGHT=y 74CONFIG_GENERIC_HWEIGHT=y
59CONFIG_GENERIC_CALIBRATE_DELAY=y 75CONFIG_GENERIC_CALIBRATE_DELAY=y
76CONFIG_GENERIC_CLOCKEVENTS=y
60CONFIG_GENERIC_TIME=y 77CONFIG_GENERIC_TIME=y
61CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y 78CONFIG_GENERIC_CMOS_UPDATE=y
62# CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ is not set 79CONFIG_SCHED_OMIT_FRAME_POINTER=y
80CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
81CONFIG_CEVT_R4K_LIB=y
82CONFIG_CSRC_R4K_LIB=y
63CONFIG_DMA_NONCOHERENT=y 83CONFIG_DMA_NONCOHERENT=y
64CONFIG_DMA_NEED_PCI_MAP_STATE=y 84CONFIG_DMA_NEED_PCI_MAP_STATE=y
85CONFIG_SYS_HAS_EARLY_PRINTK=y
65CONFIG_MIPS_DISABLE_OBSOLETE_IDE=y 86CONFIG_MIPS_DISABLE_OBSOLETE_IDE=y
87# CONFIG_NO_IOPORT is not set
88CONFIG_GENERIC_GPIO=y
66# CONFIG_CPU_BIG_ENDIAN is not set 89# CONFIG_CPU_BIG_ENDIAN is not set
67CONFIG_CPU_LITTLE_ENDIAN=y 90CONFIG_CPU_LITTLE_ENDIAN=y
68CONFIG_SYS_SUPPORTS_APM_EMULATION=y 91CONFIG_SYS_SUPPORTS_APM_EMULATION=y
69CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y 92CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
70CONFIG_SOC_AU1550=y 93CONFIG_IRQ_CPU=y
71CONFIG_SOC_AU1X00=y
72CONFIG_MIPS_L1_CACHE_SHIFT=5 94CONFIG_MIPS_L1_CACHE_SHIFT=5
73 95
74# 96#
75# CPU selection 97# CPU selection
76# 98#
99# CONFIG_CPU_LOONGSON2E is not set
100# CONFIG_CPU_LOONGSON2F is not set
77CONFIG_CPU_MIPS32_R1=y 101CONFIG_CPU_MIPS32_R1=y
78# CONFIG_CPU_MIPS32_R2 is not set 102# CONFIG_CPU_MIPS32_R2 is not set
79# CONFIG_CPU_MIPS64_R1 is not set 103# CONFIG_CPU_MIPS64_R1 is not set
@@ -86,6 +110,7 @@ CONFIG_CPU_MIPS32_R1=y
86# CONFIG_CPU_TX49XX is not set 110# CONFIG_CPU_TX49XX is not set
87# CONFIG_CPU_R5000 is not set 111# CONFIG_CPU_R5000 is not set
88# CONFIG_CPU_R5432 is not set 112# CONFIG_CPU_R5432 is not set
113# CONFIG_CPU_R5500 is not set
89# CONFIG_CPU_R6000 is not set 114# CONFIG_CPU_R6000 is not set
90# CONFIG_CPU_NEVADA is not set 115# CONFIG_CPU_NEVADA is not set
91# CONFIG_CPU_R8000 is not set 116# CONFIG_CPU_R8000 is not set
@@ -93,11 +118,14 @@ CONFIG_CPU_MIPS32_R1=y
93# CONFIG_CPU_RM7000 is not set 118# CONFIG_CPU_RM7000 is not set
94# CONFIG_CPU_RM9000 is not set 119# CONFIG_CPU_RM9000 is not set
95# CONFIG_CPU_SB1 is not set 120# CONFIG_CPU_SB1 is not set
121# CONFIG_CPU_CAVIUM_OCTEON is not set
122CONFIG_SYS_SUPPORTS_ZBOOT=y
96CONFIG_SYS_HAS_CPU_MIPS32_R1=y 123CONFIG_SYS_HAS_CPU_MIPS32_R1=y
97CONFIG_CPU_MIPS32=y 124CONFIG_CPU_MIPS32=y
98CONFIG_CPU_MIPSR1=y 125CONFIG_CPU_MIPSR1=y
99CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y 126CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
100CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y 127CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
128CONFIG_HARDWARE_WATCHPOINTS=y
101 129
102# 130#
103# Kernel type 131# Kernel type
@@ -107,190 +135,255 @@ CONFIG_32BIT=y
107CONFIG_PAGE_SIZE_4KB=y 135CONFIG_PAGE_SIZE_4KB=y
108# CONFIG_PAGE_SIZE_8KB is not set 136# CONFIG_PAGE_SIZE_8KB is not set
109# CONFIG_PAGE_SIZE_16KB is not set 137# CONFIG_PAGE_SIZE_16KB is not set
138# CONFIG_PAGE_SIZE_32KB is not set
110# CONFIG_PAGE_SIZE_64KB is not set 139# CONFIG_PAGE_SIZE_64KB is not set
111CONFIG_CPU_HAS_PREFETCH=y 140CONFIG_CPU_HAS_PREFETCH=y
112CONFIG_MIPS_MT_DISABLED=y 141CONFIG_MIPS_MT_DISABLED=y
113# CONFIG_MIPS_MT_SMP is not set 142# CONFIG_MIPS_MT_SMP is not set
114# CONFIG_MIPS_MT_SMTC is not set 143# CONFIG_MIPS_MT_SMTC is not set
115# CONFIG_MIPS_VPE_LOADER is not set
116CONFIG_64BIT_PHYS_ADDR=y 144CONFIG_64BIT_PHYS_ADDR=y
145CONFIG_ARCH_PHYS_ADDR_T_64BIT=y
117CONFIG_CPU_HAS_SYNC=y 146CONFIG_CPU_HAS_SYNC=y
118CONFIG_GENERIC_HARDIRQS=y 147CONFIG_GENERIC_HARDIRQS=y
119CONFIG_GENERIC_IRQ_PROBE=y 148CONFIG_GENERIC_IRQ_PROBE=y
120CONFIG_CPU_SUPPORTS_HIGHMEM=y 149CONFIG_CPU_SUPPORTS_HIGHMEM=y
121CONFIG_ARCH_FLATMEM_ENABLE=y 150CONFIG_ARCH_FLATMEM_ENABLE=y
151CONFIG_ARCH_POPULATES_NODE_MAP=y
122CONFIG_SELECT_MEMORY_MODEL=y 152CONFIG_SELECT_MEMORY_MODEL=y
123CONFIG_FLATMEM_MANUAL=y 153CONFIG_FLATMEM_MANUAL=y
124# CONFIG_DISCONTIGMEM_MANUAL is not set 154# CONFIG_DISCONTIGMEM_MANUAL is not set
125# CONFIG_SPARSEMEM_MANUAL is not set 155# CONFIG_SPARSEMEM_MANUAL is not set
126CONFIG_FLATMEM=y 156CONFIG_FLATMEM=y
127CONFIG_FLAT_NODE_MEM_MAP=y 157CONFIG_FLAT_NODE_MEM_MAP=y
128# CONFIG_SPARSEMEM_STATIC is not set 158CONFIG_PAGEFLAGS_EXTENDED=y
129CONFIG_SPLIT_PTLOCK_CPUS=4 159CONFIG_SPLIT_PTLOCK_CPUS=4
130CONFIG_RESOURCES_64BIT=y 160CONFIG_PHYS_ADDR_T_64BIT=y
131CONFIG_ZONE_DMA_FLAG=1 161CONFIG_ZONE_DMA_FLAG=0
162CONFIG_VIRT_TO_BUS=y
163# CONFIG_KSM is not set
164CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
165CONFIG_TICK_ONESHOT=y
166CONFIG_NO_HZ=y
167CONFIG_HIGH_RES_TIMERS=y
168CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
132# CONFIG_HZ_48 is not set 169# CONFIG_HZ_48 is not set
133# CONFIG_HZ_100 is not set 170CONFIG_HZ_100=y
134# CONFIG_HZ_128 is not set 171# CONFIG_HZ_128 is not set
135# CONFIG_HZ_250 is not set 172# CONFIG_HZ_250 is not set
136# CONFIG_HZ_256 is not set 173# CONFIG_HZ_256 is not set
137CONFIG_HZ_1000=y 174# CONFIG_HZ_1000 is not set
138# CONFIG_HZ_1024 is not set 175# CONFIG_HZ_1024 is not set
139CONFIG_SYS_SUPPORTS_ARBIT_HZ=y 176CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
140CONFIG_HZ=1000 177CONFIG_HZ=100
141CONFIG_PREEMPT_NONE=y 178CONFIG_PREEMPT_NONE=y
142# CONFIG_PREEMPT_VOLUNTARY is not set 179# CONFIG_PREEMPT_VOLUNTARY is not set
143# CONFIG_PREEMPT is not set 180# CONFIG_PREEMPT is not set
144# CONFIG_KEXEC is not set 181# CONFIG_KEXEC is not set
182# CONFIG_SECCOMP is not set
145CONFIG_LOCKDEP_SUPPORT=y 183CONFIG_LOCKDEP_SUPPORT=y
146CONFIG_STACKTRACE_SUPPORT=y 184CONFIG_STACKTRACE_SUPPORT=y
147CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 185CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
186CONFIG_CONSTRUCTORS=y
148 187
149# 188#
150# Code maturity level options 189# General setup
151# 190#
152CONFIG_EXPERIMENTAL=y 191CONFIG_EXPERIMENTAL=y
153CONFIG_BROKEN_ON_SMP=y 192CONFIG_BROKEN_ON_SMP=y
154CONFIG_INIT_ENV_ARG_LIMIT=32 193CONFIG_INIT_ENV_ARG_LIMIT=32
155 194CONFIG_LOCALVERSION="-pb1550"
156#
157# General setup
158#
159CONFIG_LOCALVERSION=""
160CONFIG_LOCALVERSION_AUTO=y 195CONFIG_LOCALVERSION_AUTO=y
196CONFIG_HAVE_KERNEL_GZIP=y
197CONFIG_HAVE_KERNEL_BZIP2=y
198CONFIG_HAVE_KERNEL_LZMA=y
199CONFIG_HAVE_KERNEL_LZO=y
200# CONFIG_KERNEL_GZIP is not set
201# CONFIG_KERNEL_BZIP2 is not set
202CONFIG_KERNEL_LZMA=y
203# CONFIG_KERNEL_LZO is not set
161CONFIG_SWAP=y 204CONFIG_SWAP=y
162CONFIG_SYSVIPC=y 205CONFIG_SYSVIPC=y
163# CONFIG_IPC_NS is not set
164CONFIG_SYSVIPC_SYSCTL=y 206CONFIG_SYSVIPC_SYSCTL=y
165# CONFIG_POSIX_MQUEUE is not set 207CONFIG_POSIX_MQUEUE=y
208CONFIG_POSIX_MQUEUE_SYSCTL=y
166# CONFIG_BSD_PROCESS_ACCT is not set 209# CONFIG_BSD_PROCESS_ACCT is not set
167# CONFIG_TASKSTATS is not set 210# CONFIG_TASKSTATS is not set
168# CONFIG_UTS_NS is not set
169# CONFIG_AUDIT is not set 211# CONFIG_AUDIT is not set
212
213#
214# RCU Subsystem
215#
216# CONFIG_TREE_RCU is not set
217# CONFIG_TREE_PREEMPT_RCU is not set
218CONFIG_TINY_RCU=y
219# CONFIG_TREE_RCU_TRACE is not set
170# CONFIG_IKCONFIG is not set 220# CONFIG_IKCONFIG is not set
171CONFIG_SYSFS_DEPRECATED=y 221CONFIG_LOG_BUF_SHIFT=14
172CONFIG_RELAY=y 222# CONFIG_GROUP_SCHED is not set
173# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 223# CONFIG_CGROUPS is not set
224# CONFIG_SYSFS_DEPRECATED_V2 is not set
225# CONFIG_RELAY is not set
226# CONFIG_NAMESPACES is not set
227# CONFIG_BLK_DEV_INITRD is not set
228CONFIG_CC_OPTIMIZE_FOR_SIZE=y
174CONFIG_SYSCTL=y 229CONFIG_SYSCTL=y
230CONFIG_ANON_INODES=y
175CONFIG_EMBEDDED=y 231CONFIG_EMBEDDED=y
176CONFIG_SYSCTL_SYSCALL=y 232# CONFIG_SYSCTL_SYSCALL is not set
177CONFIG_KALLSYMS=y 233# CONFIG_KALLSYMS is not set
178# CONFIG_KALLSYMS_EXTRA_PASS is not set
179CONFIG_HOTPLUG=y 234CONFIG_HOTPLUG=y
180CONFIG_PRINTK=y 235CONFIG_PRINTK=y
181CONFIG_BUG=y 236CONFIG_BUG=y
182CONFIG_ELF_CORE=y 237CONFIG_ELF_CORE=y
238# CONFIG_PCSPKR_PLATFORM is not set
183CONFIG_BASE_FULL=y 239CONFIG_BASE_FULL=y
184CONFIG_FUTEX=y 240CONFIG_FUTEX=y
185CONFIG_EPOLL=y 241CONFIG_EPOLL=y
242CONFIG_SIGNALFD=y
243CONFIG_TIMERFD=y
244CONFIG_EVENTFD=y
186CONFIG_SHMEM=y 245CONFIG_SHMEM=y
246CONFIG_AIO=y
247
248#
249# Kernel Performance Events And Counters
250#
251# CONFIG_VM_EVENT_COUNTERS is not set
252CONFIG_PCI_QUIRKS=y
253# CONFIG_COMPAT_BRK is not set
187CONFIG_SLAB=y 254CONFIG_SLAB=y
188CONFIG_VM_EVENT_COUNTERS=y 255# CONFIG_SLUB is not set
189CONFIG_RT_MUTEXES=y
190# CONFIG_TINY_SHMEM is not set
191CONFIG_BASE_SMALL=0
192# CONFIG_SLOB is not set 256# CONFIG_SLOB is not set
257# CONFIG_PROFILING is not set
258CONFIG_HAVE_OPROFILE=y
193 259
194# 260#
195# Loadable module support 261# GCOV-based kernel profiling
196# 262#
263# CONFIG_SLOW_WORK is not set
264CONFIG_HAVE_GENERIC_DMA_COHERENT=y
265CONFIG_SLABINFO=y
266CONFIG_RT_MUTEXES=y
267CONFIG_BASE_SMALL=0
197CONFIG_MODULES=y 268CONFIG_MODULES=y
269# CONFIG_MODULE_FORCE_LOAD is not set
198CONFIG_MODULE_UNLOAD=y 270CONFIG_MODULE_UNLOAD=y
199# CONFIG_MODULE_FORCE_UNLOAD is not set 271# CONFIG_MODULE_FORCE_UNLOAD is not set
200CONFIG_MODVERSIONS=y 272# CONFIG_MODVERSIONS is not set
201CONFIG_MODULE_SRCVERSION_ALL=y 273# CONFIG_MODULE_SRCVERSION_ALL is not set
202CONFIG_KMOD=y
203
204#
205# Block layer
206#
207CONFIG_BLOCK=y 274CONFIG_BLOCK=y
208# CONFIG_LBD is not set 275CONFIG_LBDAF=y
209# CONFIG_BLK_DEV_IO_TRACE is not set 276CONFIG_BLK_DEV_BSG=y
210# CONFIG_LSF is not set 277# CONFIG_BLK_DEV_INTEGRITY is not set
211 278
212# 279#
213# IO Schedulers 280# IO Schedulers
214# 281#
215CONFIG_IOSCHED_NOOP=y 282CONFIG_IOSCHED_NOOP=y
216CONFIG_IOSCHED_AS=y 283# CONFIG_IOSCHED_DEADLINE is not set
217CONFIG_IOSCHED_DEADLINE=y 284# CONFIG_IOSCHED_CFQ is not set
218CONFIG_IOSCHED_CFQ=y
219CONFIG_DEFAULT_AS=y
220# CONFIG_DEFAULT_DEADLINE is not set 285# CONFIG_DEFAULT_DEADLINE is not set
221# CONFIG_DEFAULT_CFQ is not set 286# CONFIG_DEFAULT_CFQ is not set
222# CONFIG_DEFAULT_NOOP is not set 287CONFIG_DEFAULT_NOOP=y
223CONFIG_DEFAULT_IOSCHED="anticipatory" 288CONFIG_DEFAULT_IOSCHED="noop"
289# CONFIG_INLINE_SPIN_TRYLOCK is not set
290# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set
291# CONFIG_INLINE_SPIN_LOCK is not set
292# CONFIG_INLINE_SPIN_LOCK_BH is not set
293# CONFIG_INLINE_SPIN_LOCK_IRQ is not set
294# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set
295CONFIG_INLINE_SPIN_UNLOCK=y
296# CONFIG_INLINE_SPIN_UNLOCK_BH is not set
297CONFIG_INLINE_SPIN_UNLOCK_IRQ=y
298# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set
299# CONFIG_INLINE_READ_TRYLOCK is not set
300# CONFIG_INLINE_READ_LOCK is not set
301# CONFIG_INLINE_READ_LOCK_BH is not set
302# CONFIG_INLINE_READ_LOCK_IRQ is not set
303# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set
304CONFIG_INLINE_READ_UNLOCK=y
305# CONFIG_INLINE_READ_UNLOCK_BH is not set
306CONFIG_INLINE_READ_UNLOCK_IRQ=y
307# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set
308# CONFIG_INLINE_WRITE_TRYLOCK is not set
309# CONFIG_INLINE_WRITE_LOCK is not set
310# CONFIG_INLINE_WRITE_LOCK_BH is not set
311# CONFIG_INLINE_WRITE_LOCK_IRQ is not set
312# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set
313CONFIG_INLINE_WRITE_UNLOCK=y
314# CONFIG_INLINE_WRITE_UNLOCK_BH is not set
315CONFIG_INLINE_WRITE_UNLOCK_IRQ=y
316# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set
317# CONFIG_MUTEX_SPIN_ON_OWNER is not set
318CONFIG_FREEZER=y
224 319
225# 320#
226# Bus options (PCI, PCMCIA, EISA, ISA, TC) 321# Bus options (PCI, PCMCIA, EISA, ISA, TC)
227# 322#
228CONFIG_HW_HAS_PCI=y 323CONFIG_HW_HAS_PCI=y
229CONFIG_PCI=y 324CONFIG_PCI=y
325CONFIG_PCI_DOMAINS=y
326# CONFIG_ARCH_SUPPORTS_MSI is not set
327CONFIG_PCI_LEGACY=y
328# CONFIG_PCI_DEBUG is not set
329# CONFIG_PCI_STUB is not set
330# CONFIG_PCI_IOV is not set
230CONFIG_MMU=y 331CONFIG_MMU=y
231 332CONFIG_PCCARD=y
232# 333CONFIG_PCMCIA=y
233# PCCARD (PCMCIA/CardBus) support
234#
235CONFIG_PCCARD=m
236# CONFIG_PCMCIA_DEBUG is not set
237CONFIG_PCMCIA=m
238CONFIG_PCMCIA_LOAD_CIS=y 334CONFIG_PCMCIA_LOAD_CIS=y
239CONFIG_PCMCIA_IOCTL=y 335CONFIG_PCMCIA_IOCTL=y
240CONFIG_CARDBUS=y 336# CONFIG_CARDBUS is not set
241 337
242# 338#
243# PC-card bridges 339# PC-card bridges
244# 340#
245# CONFIG_YENTA is not set 341# CONFIG_YENTA is not set
246CONFIG_PD6729=m 342# CONFIG_PD6729 is not set
247# CONFIG_I82092 is not set 343# CONFIG_I82092 is not set
248# CONFIG_PCMCIA_AU1X00 is not set 344# CONFIG_PCMCIA_AU1X00 is not set
249CONFIG_PCCARD_NONSTATIC=m 345CONFIG_PCMCIA_ALCHEMY_DEVBOARD=y
250
251#
252# PCI Hotplug Support
253#
254# CONFIG_HOTPLUG_PCI is not set 346# CONFIG_HOTPLUG_PCI is not set
255 347
256# 348#
257# Executable file formats 349# Executable file formats
258# 350#
259CONFIG_BINFMT_ELF=y 351CONFIG_BINFMT_ELF=y
352# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
353# CONFIG_HAVE_AOUT is not set
260# CONFIG_BINFMT_MISC is not set 354# CONFIG_BINFMT_MISC is not set
261CONFIG_TRAD_SIGNALS=y 355CONFIG_TRAD_SIGNALS=y
262 356
263# 357#
264# Power management options 358# Power management options
265# 359#
266# CONFIG_PM is not set 360CONFIG_ARCH_HIBERNATION_POSSIBLE=y
267 361CONFIG_ARCH_SUSPEND_POSSIBLE=y
268# 362CONFIG_PM=y
269# Networking 363# CONFIG_PM_DEBUG is not set
270# 364CONFIG_PM_SLEEP=y
365CONFIG_SUSPEND=y
366CONFIG_SUSPEND_FREEZER=y
367# CONFIG_HIBERNATION is not set
368# CONFIG_APM_EMULATION is not set
369CONFIG_PM_RUNTIME=y
271CONFIG_NET=y 370CONFIG_NET=y
272 371
273# 372#
274# Networking options 373# Networking options
275# 374#
276# CONFIG_NETDEBUG is not set
277CONFIG_PACKET=y 375CONFIG_PACKET=y
278# CONFIG_PACKET_MMAP is not set 376CONFIG_PACKET_MMAP=y
279CONFIG_UNIX=y 377CONFIG_UNIX=y
280CONFIG_XFRM=y 378# CONFIG_NET_KEY is not set
281CONFIG_XFRM_USER=m
282# CONFIG_XFRM_SUB_POLICY is not set
283CONFIG_XFRM_MIGRATE=y
284CONFIG_NET_KEY=y
285CONFIG_NET_KEY_MIGRATE=y
286CONFIG_INET=y 379CONFIG_INET=y
287CONFIG_IP_MULTICAST=y 380CONFIG_IP_MULTICAST=y
288# CONFIG_IP_ADVANCED_ROUTER is not set 381# CONFIG_IP_ADVANCED_ROUTER is not set
289CONFIG_IP_FIB_HASH=y 382CONFIG_IP_FIB_HASH=y
290CONFIG_IP_PNP=y 383CONFIG_IP_PNP=y
291# CONFIG_IP_PNP_DHCP is not set 384CONFIG_IP_PNP_DHCP=y
292CONFIG_IP_PNP_BOOTP=y 385CONFIG_IP_PNP_BOOTP=y
293# CONFIG_IP_PNP_RARP is not set 386CONFIG_IP_PNP_RARP=y
294# CONFIG_NET_IPIP is not set 387# CONFIG_NET_IPIP is not set
295# CONFIG_NET_IPGRE is not set 388# CONFIG_NET_IPGRE is not set
296# CONFIG_IP_MROUTE is not set 389# CONFIG_IP_MROUTE is not set
@@ -301,110 +394,25 @@ CONFIG_IP_PNP_BOOTP=y
301# CONFIG_INET_IPCOMP is not set 394# CONFIG_INET_IPCOMP is not set
302# CONFIG_INET_XFRM_TUNNEL is not set 395# CONFIG_INET_XFRM_TUNNEL is not set
303# CONFIG_INET_TUNNEL is not set 396# CONFIG_INET_TUNNEL is not set
304CONFIG_INET_XFRM_MODE_TRANSPORT=m 397# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
305CONFIG_INET_XFRM_MODE_TUNNEL=m 398# CONFIG_INET_XFRM_MODE_TUNNEL is not set
306CONFIG_INET_XFRM_MODE_BEET=m 399# CONFIG_INET_XFRM_MODE_BEET is not set
307CONFIG_INET_DIAG=y 400CONFIG_INET_LRO=y
308CONFIG_INET_TCP_DIAG=y 401# CONFIG_INET_DIAG is not set
309# CONFIG_TCP_CONG_ADVANCED is not set 402# CONFIG_TCP_CONG_ADVANCED is not set
310CONFIG_TCP_CONG_CUBIC=y 403CONFIG_TCP_CONG_CUBIC=y
311CONFIG_DEFAULT_TCP_CONG="cubic" 404CONFIG_DEFAULT_TCP_CONG="cubic"
312CONFIG_TCP_MD5SIG=y 405# CONFIG_TCP_MD5SIG is not set
313
314#
315# IP: Virtual Server Configuration
316#
317# CONFIG_IP_VS is not set
318# CONFIG_IPV6 is not set 406# CONFIG_IPV6 is not set
319# CONFIG_INET6_XFRM_TUNNEL is not set 407# CONFIG_NETWORK_SECMARK is not set
320# CONFIG_INET6_TUNNEL is not set 408# CONFIG_NETFILTER is not set
321CONFIG_NETWORK_SECMARK=y
322CONFIG_NETFILTER=y
323# CONFIG_NETFILTER_DEBUG is not set
324
325#
326# Core Netfilter Configuration
327#
328CONFIG_NETFILTER_NETLINK=m
329CONFIG_NETFILTER_NETLINK_QUEUE=m
330CONFIG_NETFILTER_NETLINK_LOG=m
331CONFIG_NF_CONNTRACK_ENABLED=m
332CONFIG_NF_CONNTRACK_SUPPORT=y
333# CONFIG_IP_NF_CONNTRACK_SUPPORT is not set
334CONFIG_NF_CONNTRACK=m
335CONFIG_NF_CT_ACCT=y
336CONFIG_NF_CONNTRACK_MARK=y
337CONFIG_NF_CONNTRACK_SECMARK=y
338CONFIG_NF_CONNTRACK_EVENTS=y
339CONFIG_NF_CT_PROTO_GRE=m
340CONFIG_NF_CT_PROTO_SCTP=m
341CONFIG_NF_CONNTRACK_AMANDA=m
342CONFIG_NF_CONNTRACK_FTP=m
343CONFIG_NF_CONNTRACK_H323=m
344CONFIG_NF_CONNTRACK_IRC=m
345# CONFIG_NF_CONNTRACK_NETBIOS_NS is not set
346CONFIG_NF_CONNTRACK_PPTP=m
347CONFIG_NF_CONNTRACK_SANE=m
348CONFIG_NF_CONNTRACK_SIP=m
349CONFIG_NF_CONNTRACK_TFTP=m
350CONFIG_NF_CT_NETLINK=m
351CONFIG_NETFILTER_XTABLES=m
352CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
353CONFIG_NETFILTER_XT_TARGET_MARK=m
354CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
355CONFIG_NETFILTER_XT_TARGET_NFLOG=m
356CONFIG_NETFILTER_XT_TARGET_SECMARK=m
357CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=m
358CONFIG_NETFILTER_XT_TARGET_TCPMSS=m
359CONFIG_NETFILTER_XT_MATCH_COMMENT=m
360CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
361CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
362CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
363CONFIG_NETFILTER_XT_MATCH_DCCP=m
364CONFIG_NETFILTER_XT_MATCH_DSCP=m
365CONFIG_NETFILTER_XT_MATCH_ESP=m
366CONFIG_NETFILTER_XT_MATCH_HELPER=m
367CONFIG_NETFILTER_XT_MATCH_LENGTH=m
368CONFIG_NETFILTER_XT_MATCH_LIMIT=m
369CONFIG_NETFILTER_XT_MATCH_MAC=m
370CONFIG_NETFILTER_XT_MATCH_MARK=m
371CONFIG_NETFILTER_XT_MATCH_POLICY=m
372CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
373CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
374CONFIG_NETFILTER_XT_MATCH_QUOTA=m
375CONFIG_NETFILTER_XT_MATCH_REALM=m
376CONFIG_NETFILTER_XT_MATCH_SCTP=m
377CONFIG_NETFILTER_XT_MATCH_STATE=m
378CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
379CONFIG_NETFILTER_XT_MATCH_STRING=m
380CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
381CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
382
383#
384# IP: Netfilter Configuration
385#
386CONFIG_NF_CONNTRACK_IPV4=m
387CONFIG_NF_CONNTRACK_PROC_COMPAT=y
388# CONFIG_IP_NF_QUEUE is not set
389# CONFIG_IP_NF_IPTABLES is not set
390# CONFIG_IP_NF_ARPTABLES is not set
391
392#
393# DCCP Configuration (EXPERIMENTAL)
394#
395# CONFIG_IP_DCCP is not set 409# CONFIG_IP_DCCP is not set
396
397#
398# SCTP Configuration (EXPERIMENTAL)
399#
400# CONFIG_IP_SCTP is not set 410# CONFIG_IP_SCTP is not set
401 411# CONFIG_RDS is not set
402#
403# TIPC Configuration (EXPERIMENTAL)
404#
405# CONFIG_TIPC is not set 412# CONFIG_TIPC is not set
406# CONFIG_ATM is not set 413# CONFIG_ATM is not set
407# CONFIG_BRIDGE is not set 414# CONFIG_BRIDGE is not set
415# CONFIG_NET_DSA is not set
408# CONFIG_VLAN_8021Q is not set 416# CONFIG_VLAN_8021Q is not set
409# CONFIG_DECNET is not set 417# CONFIG_DECNET is not set
410# CONFIG_LLC2 is not set 418# CONFIG_LLC2 is not set
@@ -414,27 +422,30 @@ CONFIG_NF_CONNTRACK_PROC_COMPAT=y
414# CONFIG_LAPB is not set 422# CONFIG_LAPB is not set
415# CONFIG_ECONET is not set 423# CONFIG_ECONET is not set
416# CONFIG_WAN_ROUTER is not set 424# CONFIG_WAN_ROUTER is not set
417 425# CONFIG_PHONET is not set
418# 426# CONFIG_IEEE802154 is not set
419# QoS and/or fair queueing
420#
421# CONFIG_NET_SCHED is not set 427# CONFIG_NET_SCHED is not set
422CONFIG_NET_CLS_ROUTE=y 428# CONFIG_DCB is not set
423 429
424# 430#
425# Network testing 431# Network testing
426# 432#
427# CONFIG_NET_PKTGEN is not set 433# CONFIG_NET_PKTGEN is not set
428# CONFIG_HAMRADIO is not set 434# CONFIG_HAMRADIO is not set
435# CONFIG_CAN is not set
429# CONFIG_IRDA is not set 436# CONFIG_IRDA is not set
430# CONFIG_BT is not set 437# CONFIG_BT is not set
431CONFIG_IEEE80211=m 438# CONFIG_AF_RXRPC is not set
432# CONFIG_IEEE80211_DEBUG is not set 439CONFIG_WIRELESS=y
433CONFIG_IEEE80211_CRYPT_WEP=m 440# CONFIG_CFG80211 is not set
434CONFIG_IEEE80211_CRYPT_CCMP=m 441# CONFIG_LIB80211 is not set
435CONFIG_IEEE80211_SOFTMAC=m 442
436# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set 443#
437CONFIG_WIRELESS_EXT=y 444# CFG80211 needs to be enabled for MAC80211
445#
446# CONFIG_WIMAX is not set
447# CONFIG_RFKILL is not set
448# CONFIG_NET_9P is not set
438 449
439# 450#
440# Device Drivers 451# Device Drivers
@@ -443,25 +454,25 @@ CONFIG_WIRELESS_EXT=y
443# 454#
444# Generic Driver Options 455# Generic Driver Options
445# 456#
457CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
458# CONFIG_DEVTMPFS is not set
446CONFIG_STANDALONE=y 459CONFIG_STANDALONE=y
447CONFIG_PREVENT_FIRMWARE_BUILD=y 460CONFIG_PREVENT_FIRMWARE_BUILD=y
448CONFIG_FW_LOADER=m 461CONFIG_FW_LOADER=y
462CONFIG_FIRMWARE_IN_KERNEL=y
463CONFIG_EXTRA_FIRMWARE=""
464# CONFIG_DEBUG_DRIVER is not set
465# CONFIG_DEBUG_DEVRES is not set
449# CONFIG_SYS_HYPERVISOR is not set 466# CONFIG_SYS_HYPERVISOR is not set
450 467# CONFIG_CONNECTOR is not set
451#
452# Connector - unified userspace <-> kernelspace linker
453#
454CONFIG_CONNECTOR=m
455
456#
457# Memory Technology Devices (MTD)
458#
459CONFIG_MTD=y 468CONFIG_MTD=y
460# CONFIG_MTD_DEBUG is not set 469# CONFIG_MTD_DEBUG is not set
470# CONFIG_MTD_TESTS is not set
461# CONFIG_MTD_CONCAT is not set 471# CONFIG_MTD_CONCAT is not set
462CONFIG_MTD_PARTITIONS=y 472CONFIG_MTD_PARTITIONS=y
463# CONFIG_MTD_REDBOOT_PARTS is not set 473# CONFIG_MTD_REDBOOT_PARTS is not set
464# CONFIG_MTD_CMDLINE_PARTS is not set 474# CONFIG_MTD_CMDLINE_PARTS is not set
475# CONFIG_MTD_AR7_PARTS is not set
465 476
466# 477#
467# User Modules And Translation Layers 478# User Modules And Translation Layers
@@ -474,6 +485,7 @@ CONFIG_MTD_BLOCK=y
474# CONFIG_INFTL is not set 485# CONFIG_INFTL is not set
475# CONFIG_RFD_FTL is not set 486# CONFIG_RFD_FTL is not set
476# CONFIG_SSFDC is not set 487# CONFIG_SSFDC is not set
488# CONFIG_MTD_OOPS is not set
477 489
478# 490#
479# RAM/ROM/Flash chip drivers 491# RAM/ROM/Flash chip drivers
@@ -499,14 +511,14 @@ CONFIG_MTD_CFI_UTIL=y
499# CONFIG_MTD_RAM is not set 511# CONFIG_MTD_RAM is not set
500# CONFIG_MTD_ROM is not set 512# CONFIG_MTD_ROM is not set
501# CONFIG_MTD_ABSENT is not set 513# CONFIG_MTD_ABSENT is not set
502# CONFIG_MTD_OBSOLETE_CHIPS is not set
503 514
504# 515#
505# Mapping drivers for chip access 516# Mapping drivers for chip access
506# 517#
507# CONFIG_MTD_COMPLEX_MAPPINGS is not set 518# CONFIG_MTD_COMPLEX_MAPPINGS is not set
508# CONFIG_MTD_PHYSMAP is not set 519CONFIG_MTD_PHYSMAP=y
509CONFIG_MTD_ALCHEMY=y 520# CONFIG_MTD_PHYSMAP_COMPAT is not set
521# CONFIG_MTD_INTEL_VR_NOR is not set
510# CONFIG_MTD_PLATRAM is not set 522# CONFIG_MTD_PLATRAM is not set
511 523
512# 524#
@@ -524,30 +536,30 @@ CONFIG_MTD_ALCHEMY=y
524# CONFIG_MTD_DOC2000 is not set 536# CONFIG_MTD_DOC2000 is not set
525# CONFIG_MTD_DOC2001 is not set 537# CONFIG_MTD_DOC2001 is not set
526# CONFIG_MTD_DOC2001PLUS is not set 538# CONFIG_MTD_DOC2001PLUS is not set
527 539CONFIG_MTD_NAND=y
528# 540# CONFIG_MTD_NAND_VERIFY_WRITE is not set
529# NAND Flash Device Drivers 541# CONFIG_MTD_NAND_ECC_SMC is not set
530# 542# CONFIG_MTD_NAND_MUSEUM_IDS is not set
531# CONFIG_MTD_NAND is not set 543CONFIG_MTD_NAND_IDS=y
532 544CONFIG_MTD_NAND_AU1550=y
533# 545# CONFIG_MTD_NAND_DISKONCHIP is not set
534# OneNAND Flash Device Drivers 546# CONFIG_MTD_NAND_CAFE is not set
535# 547# CONFIG_MTD_NAND_NANDSIM is not set
548# CONFIG_MTD_NAND_PLATFORM is not set
549# CONFIG_MTD_ALAUDA is not set
536# CONFIG_MTD_ONENAND is not set 550# CONFIG_MTD_ONENAND is not set
537 551
538# 552#
539# Parallel port support 553# LPDDR flash memory drivers
540#
541# CONFIG_PARPORT is not set
542
543#
544# Plug and Play support
545# 554#
546# CONFIG_PNPACPI is not set 555# CONFIG_MTD_LPDDR is not set
547 556
548# 557#
549# Block devices 558# UBI - Unsorted block images
550# 559#
560# CONFIG_MTD_UBI is not set
561# CONFIG_PARPORT is not set
562CONFIG_BLK_DEV=y
551# CONFIG_BLK_CPQ_DA is not set 563# CONFIG_BLK_CPQ_DA is not set
552# CONFIG_BLK_CPQ_CISS_DA is not set 564# CONFIG_BLK_CPQ_CISS_DA is not set
553# CONFIG_BLK_DEV_DAC960 is not set 565# CONFIG_BLK_DEV_DAC960 is not set
@@ -555,67 +567,66 @@ CONFIG_MTD_ALCHEMY=y
555# CONFIG_BLK_DEV_COW_COMMON is not set 567# CONFIG_BLK_DEV_COW_COMMON is not set
556CONFIG_BLK_DEV_LOOP=y 568CONFIG_BLK_DEV_LOOP=y
557# CONFIG_BLK_DEV_CRYPTOLOOP is not set 569# CONFIG_BLK_DEV_CRYPTOLOOP is not set
558# CONFIG_BLK_DEV_NBD is not set
559# CONFIG_BLK_DEV_SX8 is not set
560# CONFIG_BLK_DEV_RAM is not set
561# CONFIG_BLK_DEV_INITRD is not set
562CONFIG_CDROM_PKTCDVD=m
563CONFIG_CDROM_PKTCDVD_BUFFERS=8
564# CONFIG_CDROM_PKTCDVD_WCACHE is not set
565CONFIG_ATA_OVER_ETH=m
566 570
567# 571#
568# Misc devices 572# DRBD disabled because PROC_FS, INET or CONNECTOR not selected
569#
570CONFIG_SGI_IOC4=m
571# CONFIG_TIFM_CORE is not set
572
573#
574# ATA/ATAPI/MFM/RLL support
575# 573#
574# CONFIG_BLK_DEV_NBD is not set
575# CONFIG_BLK_DEV_SX8 is not set
576CONFIG_BLK_DEV_UB=y
577# CONFIG_BLK_DEV_RAM is not set
578# CONFIG_CDROM_PKTCDVD is not set
579# CONFIG_ATA_OVER_ETH is not set
580# CONFIG_BLK_DEV_HD is not set
581# CONFIG_MISC_DEVICES is not set
582CONFIG_HAVE_IDE=y
576CONFIG_IDE=y 583CONFIG_IDE=y
577CONFIG_IDE_MAX_HWIFS=4
578CONFIG_BLK_DEV_IDE=y
579 584
580# 585#
581# Please see Documentation/ide.txt for help/info on IDE drives 586# Please see Documentation/ide/ide.txt for help/info on IDE drives
582# 587#
588CONFIG_IDE_XFER_MODE=y
589CONFIG_IDE_ATAPI=y
583# CONFIG_BLK_DEV_IDE_SATA is not set 590# CONFIG_BLK_DEV_IDE_SATA is not set
584CONFIG_BLK_DEV_IDEDISK=y 591CONFIG_IDE_GD=y
585# CONFIG_IDEDISK_MULTI_MODE is not set 592CONFIG_IDE_GD_ATA=y
586CONFIG_BLK_DEV_IDECS=m 593# CONFIG_IDE_GD_ATAPI is not set
587# CONFIG_BLK_DEV_DELKIN is not set 594CONFIG_BLK_DEV_IDECS=y
588# CONFIG_BLK_DEV_IDECD is not set 595CONFIG_BLK_DEV_IDECD=y
596# CONFIG_BLK_DEV_IDECD_VERBOSE_ERRORS is not set
589# CONFIG_BLK_DEV_IDETAPE is not set 597# CONFIG_BLK_DEV_IDETAPE is not set
590# CONFIG_BLK_DEV_IDEFLOPPY is not set
591# CONFIG_IDE_TASK_IOCTL is not set 598# CONFIG_IDE_TASK_IOCTL is not set
599CONFIG_IDE_PROC_FS=y
592 600
593# 601#
594# IDE chipset support/bugfixes 602# IDE chipset support/bugfixes
595# 603#
596CONFIG_IDE_GENERIC=y 604# CONFIG_IDE_GENERIC is not set
605# CONFIG_BLK_DEV_PLATFORM is not set
606CONFIG_BLK_DEV_IDEDMA_SFF=y
607
608#
609# PCI IDE chipsets support
610#
597CONFIG_BLK_DEV_IDEPCI=y 611CONFIG_BLK_DEV_IDEPCI=y
598# CONFIG_IDEPCI_SHARE_IRQ is not set 612# CONFIG_IDEPCI_PCIBUS_ORDER is not set
599# CONFIG_BLK_DEV_OFFBOARD is not set 613# CONFIG_BLK_DEV_OFFBOARD is not set
600CONFIG_BLK_DEV_GENERIC=y 614# CONFIG_BLK_DEV_GENERIC is not set
601# CONFIG_BLK_DEV_OPTI621 is not set 615# CONFIG_BLK_DEV_OPTI621 is not set
602CONFIG_BLK_DEV_IDEDMA_PCI=y 616CONFIG_BLK_DEV_IDEDMA_PCI=y
603# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
604# CONFIG_IDEDMA_PCI_AUTO is not set
605# CONFIG_BLK_DEV_AEC62XX is not set 617# CONFIG_BLK_DEV_AEC62XX is not set
606# CONFIG_BLK_DEV_ALI15X3 is not set 618# CONFIG_BLK_DEV_ALI15X3 is not set
607# CONFIG_BLK_DEV_AMD74XX is not set 619# CONFIG_BLK_DEV_AMD74XX is not set
608# CONFIG_BLK_DEV_CMD64X is not set 620# CONFIG_BLK_DEV_CMD64X is not set
609# CONFIG_BLK_DEV_TRIFLEX is not set 621# CONFIG_BLK_DEV_TRIFLEX is not set
610# CONFIG_BLK_DEV_CY82C693 is not set
611# CONFIG_BLK_DEV_CS5520 is not set 622# CONFIG_BLK_DEV_CS5520 is not set
612# CONFIG_BLK_DEV_CS5530 is not set 623# CONFIG_BLK_DEV_CS5530 is not set
613# CONFIG_BLK_DEV_HPT34X is not set
614CONFIG_BLK_DEV_HPT366=y 624CONFIG_BLK_DEV_HPT366=y
615# CONFIG_BLK_DEV_JMICRON is not set 625# CONFIG_BLK_DEV_JMICRON is not set
616# CONFIG_BLK_DEV_SC1200 is not set 626# CONFIG_BLK_DEV_SC1200 is not set
617# CONFIG_BLK_DEV_PIIX is not set 627# CONFIG_BLK_DEV_PIIX is not set
618CONFIG_BLK_DEV_IT8213=m 628# CONFIG_BLK_DEV_IT8172 is not set
629# CONFIG_BLK_DEV_IT8213 is not set
619# CONFIG_BLK_DEV_IT821X is not set 630# CONFIG_BLK_DEV_IT821X is not set
620# CONFIG_BLK_DEV_NS87415 is not set 631# CONFIG_BLK_DEV_NS87415 is not set
621# CONFIG_BLK_DEV_PDC202XX_OLD is not set 632# CONFIG_BLK_DEV_PDC202XX_OLD is not set
@@ -625,82 +636,65 @@ CONFIG_BLK_DEV_IT8213=m
625# CONFIG_BLK_DEV_SLC90E66 is not set 636# CONFIG_BLK_DEV_SLC90E66 is not set
626# CONFIG_BLK_DEV_TRM290 is not set 637# CONFIG_BLK_DEV_TRM290 is not set
627# CONFIG_BLK_DEV_VIA82CXXX is not set 638# CONFIG_BLK_DEV_VIA82CXXX is not set
628CONFIG_BLK_DEV_TC86C001=m 639# CONFIG_BLK_DEV_TC86C001 is not set
629# CONFIG_IDE_ARM is not set
630CONFIG_BLK_DEV_IDEDMA=y 640CONFIG_BLK_DEV_IDEDMA=y
631# CONFIG_IDEDMA_IVB is not set
632# CONFIG_IDEDMA_AUTO is not set
633# CONFIG_BLK_DEV_HD is not set
634 641
635# 642#
636# SCSI device support 643# SCSI device support
637# 644#
638CONFIG_RAID_ATTRS=m 645# CONFIG_RAID_ATTRS is not set
639# CONFIG_SCSI is not set 646# CONFIG_SCSI is not set
647# CONFIG_SCSI_DMA is not set
640# CONFIG_SCSI_NETLINK is not set 648# CONFIG_SCSI_NETLINK is not set
641
642#
643# Serial ATA (prod) and Parallel ATA (experimental) drivers
644#
645# CONFIG_ATA is not set 649# CONFIG_ATA is not set
646
647#
648# Multi-device support (RAID and LVM)
649#
650# CONFIG_MD is not set 650# CONFIG_MD is not set
651
652#
653# Fusion MPT device support
654#
655# CONFIG_FUSION is not set 651# CONFIG_FUSION is not set
656 652
657# 653#
658# IEEE 1394 (FireWire) support 654# IEEE 1394 (FireWire) support
659# 655#
660# CONFIG_IEEE1394 is not set
661 656
662# 657#
663# I2O device support 658# You can enable one or both FireWire driver stacks.
664# 659#
665# CONFIG_I2O is not set
666 660
667# 661#
668# Network device support 662# The newer stack is recommended.
669# 663#
664# CONFIG_FIREWIRE is not set
665# CONFIG_IEEE1394 is not set
666# CONFIG_I2O is not set
670CONFIG_NETDEVICES=y 667CONFIG_NETDEVICES=y
671# CONFIG_DUMMY is not set 668# CONFIG_DUMMY is not set
672# CONFIG_BONDING is not set 669# CONFIG_BONDING is not set
670# CONFIG_MACVLAN is not set
673# CONFIG_EQUALIZER is not set 671# CONFIG_EQUALIZER is not set
674# CONFIG_TUN is not set 672# CONFIG_TUN is not set
675 673# CONFIG_VETH is not set
676#
677# ARCnet devices
678#
679# CONFIG_ARCNET is not set 674# CONFIG_ARCNET is not set
680
681#
682# PHY device support
683#
684CONFIG_PHYLIB=y 675CONFIG_PHYLIB=y
685 676
686# 677#
687# MII PHY device drivers 678# MII PHY device drivers
688# 679#
689CONFIG_MARVELL_PHY=m 680CONFIG_MARVELL_PHY=y
690CONFIG_DAVICOM_PHY=m 681CONFIG_DAVICOM_PHY=y
691CONFIG_QSEMI_PHY=m 682CONFIG_QSEMI_PHY=y
692CONFIG_LXT_PHY=m 683CONFIG_LXT_PHY=y
693CONFIG_CICADA_PHY=m 684CONFIG_CICADA_PHY=y
694CONFIG_VITESSE_PHY=m 685CONFIG_VITESSE_PHY=y
695CONFIG_SMSC_PHY=m 686CONFIG_SMSC_PHY=y
696# CONFIG_BROADCOM_PHY is not set 687CONFIG_BROADCOM_PHY=y
688CONFIG_ICPLUS_PHY=y
689CONFIG_REALTEK_PHY=y
690CONFIG_NATIONAL_PHY=y
691CONFIG_STE10XP=y
692CONFIG_LSI_ET1011C_PHY=y
697# CONFIG_FIXED_PHY is not set 693# CONFIG_FIXED_PHY is not set
698 694# CONFIG_MDIO_BITBANG is not set
699#
700# Ethernet (10 or 100Mbit)
701#
702CONFIG_NET_ETHERNET=y 695CONFIG_NET_ETHERNET=y
703# CONFIG_MII is not set 696CONFIG_MII=y
697# CONFIG_AX88796 is not set
704CONFIG_MIPS_AU1X00_ENET=y 698CONFIG_MIPS_AU1X00_ENET=y
705# CONFIG_HAPPYMEAL is not set 699# CONFIG_HAPPYMEAL is not set
706# CONFIG_SUNGEM is not set 700# CONFIG_SUNGEM is not set
@@ -708,88 +702,51 @@ CONFIG_MIPS_AU1X00_ENET=y
708# CONFIG_NET_VENDOR_3COM is not set 702# CONFIG_NET_VENDOR_3COM is not set
709# CONFIG_SMC91X is not set 703# CONFIG_SMC91X is not set
710# CONFIG_DM9000 is not set 704# CONFIG_DM9000 is not set
711 705# CONFIG_ETHOC is not set
712# 706# CONFIG_SMSC911X is not set
713# Tulip family network device support 707# CONFIG_DNET is not set
714#
715# CONFIG_NET_TULIP is not set 708# CONFIG_NET_TULIP is not set
716# CONFIG_HP100 is not set 709# CONFIG_HP100 is not set
710# CONFIG_IBM_NEW_EMAC_ZMII is not set
711# CONFIG_IBM_NEW_EMAC_RGMII is not set
712# CONFIG_IBM_NEW_EMAC_TAH is not set
713# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
714# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
715# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
716# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
717# CONFIG_NET_PCI is not set 717# CONFIG_NET_PCI is not set
718 718# CONFIG_B44 is not set
719# 719# CONFIG_KS8842 is not set
720# Ethernet (1000 Mbit) 720# CONFIG_KS8851_MLL is not set
721# 721# CONFIG_ATL2 is not set
722# CONFIG_ACENIC is not set 722# CONFIG_NETDEV_1000 is not set
723# CONFIG_DL2K is not set 723# CONFIG_NETDEV_10000 is not set
724# CONFIG_E1000 is not set
725# CONFIG_NS83820 is not set
726# CONFIG_HAMACHI is not set
727# CONFIG_YELLOWFIN is not set
728# CONFIG_R8169 is not set
729# CONFIG_SIS190 is not set
730# CONFIG_SKGE is not set
731# CONFIG_SKY2 is not set
732# CONFIG_SK98LIN is not set
733# CONFIG_TIGON3 is not set
734# CONFIG_BNX2 is not set
735CONFIG_QLA3XXX=m
736# CONFIG_ATL1 is not set
737
738#
739# Ethernet (10000 Mbit)
740#
741# CONFIG_CHELSIO_T1 is not set
742CONFIG_CHELSIO_T3=m
743# CONFIG_IXGB is not set
744# CONFIG_S2IO is not set
745# CONFIG_MYRI10GE is not set
746CONFIG_NETXEN_NIC=m
747
748#
749# Token Ring devices
750#
751# CONFIG_TR is not set 724# CONFIG_TR is not set
725# CONFIG_WLAN is not set
752 726
753# 727#
754# Wireless LAN (non-hamradio) 728# Enable WiMAX (Networking options) to see the WiMAX drivers
755# 729#
756# CONFIG_NET_RADIO is not set
757 730
758# 731#
759# PCMCIA network device support 732# USB Network Adapters
760# 733#
734# CONFIG_USB_CATC is not set
735# CONFIG_USB_KAWETH is not set
736# CONFIG_USB_PEGASUS is not set
737# CONFIG_USB_RTL8150 is not set
738# CONFIG_USB_USBNET is not set
761# CONFIG_NET_PCMCIA is not set 739# CONFIG_NET_PCMCIA is not set
762
763#
764# Wan interfaces
765#
766# CONFIG_WAN is not set 740# CONFIG_WAN is not set
767# CONFIG_FDDI is not set 741# CONFIG_FDDI is not set
768# CONFIG_HIPPI is not set 742# CONFIG_HIPPI is not set
769CONFIG_PPP=m 743# CONFIG_PPP is not set
770CONFIG_PPP_MULTILINK=y
771# CONFIG_PPP_FILTER is not set
772CONFIG_PPP_ASYNC=m
773# CONFIG_PPP_SYNC_TTY is not set
774CONFIG_PPP_DEFLATE=m
775# CONFIG_PPP_BSDCOMP is not set
776CONFIG_PPP_MPPE=m
777CONFIG_PPPOE=m
778# CONFIG_SLIP is not set 744# CONFIG_SLIP is not set
779CONFIG_SLHC=m
780# CONFIG_SHAPER is not set
781# CONFIG_NETCONSOLE is not set 745# CONFIG_NETCONSOLE is not set
782# CONFIG_NETPOLL is not set 746# CONFIG_NETPOLL is not set
783# CONFIG_NET_POLL_CONTROLLER is not set 747# CONFIG_NET_POLL_CONTROLLER is not set
784 748# CONFIG_VMXNET3 is not set
785#
786# ISDN subsystem
787#
788# CONFIG_ISDN is not set 749# CONFIG_ISDN is not set
789
790#
791# Telephony Support
792#
793# CONFIG_PHONE is not set 750# CONFIG_PHONE is not set
794 751
795# 752#
@@ -797,16 +754,14 @@ CONFIG_SLHC=m
797# 754#
798CONFIG_INPUT=y 755CONFIG_INPUT=y
799# CONFIG_INPUT_FF_MEMLESS is not set 756# CONFIG_INPUT_FF_MEMLESS is not set
757# CONFIG_INPUT_POLLDEV is not set
758# CONFIG_INPUT_SPARSEKMAP is not set
800 759
801# 760#
802# Userland interfaces 761# Userland interfaces
803# 762#
804CONFIG_INPUT_MOUSEDEV=y 763# CONFIG_INPUT_MOUSEDEV is not set
805CONFIG_INPUT_MOUSEDEV_PSAUX=y
806CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
807CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
808# CONFIG_INPUT_JOYDEV is not set 764# CONFIG_INPUT_JOYDEV is not set
809# CONFIG_INPUT_TSDEV is not set
810CONFIG_INPUT_EVDEV=y 765CONFIG_INPUT_EVDEV=y
811# CONFIG_INPUT_EVBUG is not set 766# CONFIG_INPUT_EVBUG is not set
812 767
@@ -816,33 +771,34 @@ CONFIG_INPUT_EVDEV=y
816# CONFIG_INPUT_KEYBOARD is not set 771# CONFIG_INPUT_KEYBOARD is not set
817# CONFIG_INPUT_MOUSE is not set 772# CONFIG_INPUT_MOUSE is not set
818# CONFIG_INPUT_JOYSTICK is not set 773# CONFIG_INPUT_JOYSTICK is not set
774# CONFIG_INPUT_TABLET is not set
819# CONFIG_INPUT_TOUCHSCREEN is not set 775# CONFIG_INPUT_TOUCHSCREEN is not set
820# CONFIG_INPUT_MISC is not set 776# CONFIG_INPUT_MISC is not set
821 777
822# 778#
823# Hardware I/O ports 779# Hardware I/O ports
824# 780#
825CONFIG_SERIO=y 781# CONFIG_SERIO is not set
826# CONFIG_SERIO_I8042 is not set
827CONFIG_SERIO_SERPORT=y
828# CONFIG_SERIO_PCIPS2 is not set
829# CONFIG_SERIO_LIBPS2 is not set
830CONFIG_SERIO_RAW=m
831# CONFIG_GAMEPORT is not set 782# CONFIG_GAMEPORT is not set
832 783
833# 784#
834# Character devices 785# Character devices
835# 786#
836# CONFIG_VT is not set 787CONFIG_VT=y
788CONFIG_CONSOLE_TRANSLATIONS=y
789CONFIG_VT_CONSOLE=y
790CONFIG_HW_CONSOLE=y
791CONFIG_VT_HW_CONSOLE_BINDING=y
792CONFIG_DEVKMEM=y
837# CONFIG_SERIAL_NONSTANDARD is not set 793# CONFIG_SERIAL_NONSTANDARD is not set
838# CONFIG_AU1X00_GPIO is not set 794# CONFIG_NOZOMI is not set
839 795
840# 796#
841# Serial drivers 797# Serial drivers
842# 798#
843CONFIG_SERIAL_8250=y 799CONFIG_SERIAL_8250=y
844CONFIG_SERIAL_8250_CONSOLE=y 800CONFIG_SERIAL_8250_CONSOLE=y
845CONFIG_SERIAL_8250_PCI=y 801# CONFIG_SERIAL_8250_PCI is not set
846# CONFIG_SERIAL_8250_CS is not set 802# CONFIG_SERIAL_8250_CS is not set
847CONFIG_SERIAL_8250_NR_UARTS=4 803CONFIG_SERIAL_8250_NR_UARTS=4
848CONFIG_SERIAL_8250_RUNTIME_UARTS=4 804CONFIG_SERIAL_8250_RUNTIME_UARTS=4
@@ -856,282 +812,492 @@ CONFIG_SERIAL_CORE=y
856CONFIG_SERIAL_CORE_CONSOLE=y 812CONFIG_SERIAL_CORE_CONSOLE=y
857# CONFIG_SERIAL_JSM is not set 813# CONFIG_SERIAL_JSM is not set
858CONFIG_UNIX98_PTYS=y 814CONFIG_UNIX98_PTYS=y
859CONFIG_LEGACY_PTYS=y 815# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
860CONFIG_LEGACY_PTY_COUNT=256 816# CONFIG_LEGACY_PTYS is not set
861
862#
863# IPMI
864#
865# CONFIG_IPMI_HANDLER is not set 817# CONFIG_IPMI_HANDLER is not set
866
867#
868# Watchdog Cards
869#
870# CONFIG_WATCHDOG is not set
871# CONFIG_HW_RANDOM is not set 818# CONFIG_HW_RANDOM is not set
872# CONFIG_RTC is not set
873# CONFIG_GEN_RTC is not set
874# CONFIG_DTLK is not set
875# CONFIG_R3964 is not set 819# CONFIG_R3964 is not set
876# CONFIG_APPLICOM is not set 820# CONFIG_APPLICOM is not set
877# CONFIG_DRM is not set
878 821
879# 822#
880# PCMCIA character devices 823# PCMCIA character devices
881# 824#
882CONFIG_SYNCLINK_CS=m 825# CONFIG_SYNCLINK_CS is not set
883# CONFIG_CARDMAN_4000 is not set 826# CONFIG_CARDMAN_4000 is not set
884# CONFIG_CARDMAN_4040 is not set 827# CONFIG_CARDMAN_4040 is not set
828# CONFIG_IPWIRELESS is not set
885# CONFIG_RAW_DRIVER is not set 829# CONFIG_RAW_DRIVER is not set
830# CONFIG_TCG_TPM is not set
831CONFIG_DEVPORT=y
832CONFIG_I2C=y
833CONFIG_I2C_BOARDINFO=y
834# CONFIG_I2C_COMPAT is not set
835CONFIG_I2C_CHARDEV=y
836# CONFIG_I2C_HELPER_AUTO is not set
886 837
887# 838#
888# TPM devices 839# I2C Algorithms
889# 840#
890# CONFIG_TCG_TPM is not set 841# CONFIG_I2C_ALGOBIT is not set
842# CONFIG_I2C_ALGOPCF is not set
843# CONFIG_I2C_ALGOPCA is not set
891 844
892# 845#
893# I2C support 846# I2C Hardware Bus support
894# 847#
895# CONFIG_I2C is not set
896 848
897# 849#
898# SPI support 850# PC SMBus host controller drivers
899# 851#
900# CONFIG_SPI is not set 852# CONFIG_I2C_ALI1535 is not set
901# CONFIG_SPI_MASTER is not set 853# CONFIG_I2C_ALI1563 is not set
854# CONFIG_I2C_ALI15X3 is not set
855# CONFIG_I2C_AMD756 is not set
856# CONFIG_I2C_AMD8111 is not set
857# CONFIG_I2C_I801 is not set
858# CONFIG_I2C_ISCH is not set
859# CONFIG_I2C_PIIX4 is not set
860# CONFIG_I2C_NFORCE2 is not set
861# CONFIG_I2C_SIS5595 is not set
862# CONFIG_I2C_SIS630 is not set
863# CONFIG_I2C_SIS96X is not set
864# CONFIG_I2C_VIA is not set
865# CONFIG_I2C_VIAPRO is not set
902 866
903# 867#
904# Dallas's 1-wire bus 868# I2C system bus drivers (mostly embedded / system-on-chip)
905# 869#
906# CONFIG_W1 is not set 870CONFIG_I2C_AU1550=y
871# CONFIG_I2C_GPIO is not set
872# CONFIG_I2C_OCORES is not set
873# CONFIG_I2C_SIMTEC is not set
874
875#
876# External I2C/SMBus adapter drivers
877#
878# CONFIG_I2C_PARPORT_LIGHT is not set
879# CONFIG_I2C_TAOS_EVM is not set
880# CONFIG_I2C_TINY_USB is not set
907 881
908# 882#
909# Hardware Monitoring support 883# Other I2C/SMBus bus drivers
910# 884#
885# CONFIG_I2C_PCA_PLATFORM is not set
886# CONFIG_I2C_STUB is not set
887
888#
889# Miscellaneous I2C Chip support
890#
891# CONFIG_SENSORS_TSL2550 is not set
892# CONFIG_I2C_DEBUG_CORE is not set
893# CONFIG_I2C_DEBUG_ALGO is not set
894# CONFIG_I2C_DEBUG_BUS is not set
895# CONFIG_I2C_DEBUG_CHIP is not set
896# CONFIG_SPI is not set
897
898#
899# PPS support
900#
901# CONFIG_PPS is not set
902CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
903# CONFIG_GPIOLIB is not set
904# CONFIG_W1 is not set
905# CONFIG_POWER_SUPPLY is not set
911# CONFIG_HWMON is not set 906# CONFIG_HWMON is not set
912# CONFIG_HWMON_VID is not set 907# CONFIG_THERMAL is not set
908# CONFIG_WATCHDOG is not set
909CONFIG_SSB_POSSIBLE=y
913 910
914# 911#
915# Multimedia devices 912# Sonics Silicon Backplane
916# 913#
917# CONFIG_VIDEO_DEV is not set 914# CONFIG_SSB is not set
918 915
919# 916#
920# Digital Video Broadcasting Devices 917# Multifunction device drivers
921# 918#
922# CONFIG_DVB is not set 919# CONFIG_MFD_CORE is not set
920# CONFIG_MFD_SM501 is not set
921# CONFIG_HTC_PASIC3 is not set
922# CONFIG_TWL4030_CORE is not set
923# CONFIG_MFD_TMIO is not set
924# CONFIG_PMIC_DA903X is not set
925# CONFIG_PMIC_ADP5520 is not set
926# CONFIG_MFD_WM8400 is not set
927# CONFIG_MFD_WM831X is not set
928# CONFIG_MFD_WM8350_I2C is not set
929# CONFIG_MFD_PCF50633 is not set
930# CONFIG_AB3100_CORE is not set
931# CONFIG_MFD_88PM8607 is not set
932# CONFIG_REGULATOR is not set
933# CONFIG_MEDIA_SUPPORT is not set
923 934
924# 935#
925# Graphics support 936# Graphics support
926# 937#
927# CONFIG_FIRMWARE_EDID is not set 938# CONFIG_VGA_ARB is not set
939# CONFIG_DRM is not set
940# CONFIG_VGASTATE is not set
941# CONFIG_VIDEO_OUTPUT_CONTROL is not set
928# CONFIG_FB is not set 942# CONFIG_FB is not set
929# CONFIG_BACKLIGHT_LCD_SUPPORT is not set 943# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
930 944
931# 945#
932# Sound 946# Display device support
933#
934# CONFIG_SOUND is not set
935
936#
937# HID Devices
938# 947#
939# CONFIG_HID is not set 948# CONFIG_DISPLAY_SUPPORT is not set
940 949
941# 950#
942# USB support 951# Console display driver support
943# 952#
953CONFIG_VGA_CONSOLE=y
954# CONFIG_VGACON_SOFT_SCROLLBACK is not set
955CONFIG_DUMMY_CONSOLE=y
956# CONFIG_SOUND is not set
957CONFIG_HID_SUPPORT=y
958CONFIG_HID=y
959CONFIG_HIDRAW=y
960
961#
962# USB Input Devices
963#
964CONFIG_USB_HID=y
965# CONFIG_HID_PID is not set
966CONFIG_USB_HIDDEV=y
967
968#
969# Special HID drivers
970#
971# CONFIG_HID_A4TECH is not set
972# CONFIG_HID_APPLE is not set
973# CONFIG_HID_BELKIN is not set
974# CONFIG_HID_CHERRY is not set
975# CONFIG_HID_CHICONY is not set
976# CONFIG_HID_CYPRESS is not set
977# CONFIG_HID_DRAGONRISE is not set
978# CONFIG_HID_EZKEY is not set
979# CONFIG_HID_KYE is not set
980# CONFIG_HID_GYRATION is not set
981# CONFIG_HID_TWINHAN is not set
982# CONFIG_HID_KENSINGTON is not set
983# CONFIG_HID_LOGITECH is not set
984# CONFIG_HID_MICROSOFT is not set
985# CONFIG_HID_MONTEREY is not set
986# CONFIG_HID_NTRIG is not set
987# CONFIG_HID_PANTHERLORD is not set
988# CONFIG_HID_PETALYNX is not set
989# CONFIG_HID_SAMSUNG is not set
990# CONFIG_HID_SONY is not set
991# CONFIG_HID_SUNPLUS is not set
992# CONFIG_HID_GREENASIA is not set
993# CONFIG_HID_SMARTJOYPLUS is not set
994# CONFIG_HID_TOPSEED is not set
995# CONFIG_HID_THRUSTMASTER is not set
996# CONFIG_HID_ZEROPLUS is not set
997CONFIG_USB_SUPPORT=y
944CONFIG_USB_ARCH_HAS_HCD=y 998CONFIG_USB_ARCH_HAS_HCD=y
945CONFIG_USB_ARCH_HAS_OHCI=y 999CONFIG_USB_ARCH_HAS_OHCI=y
946CONFIG_USB_ARCH_HAS_EHCI=y 1000CONFIG_USB_ARCH_HAS_EHCI=y
947# CONFIG_USB is not set 1001CONFIG_USB=y
1002# CONFIG_USB_DEBUG is not set
1003# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
948 1004
949# 1005#
950# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' 1006# Miscellaneous USB options
951# 1007#
1008CONFIG_USB_DEVICEFS=y
1009CONFIG_USB_DEVICE_CLASS=y
1010CONFIG_USB_DYNAMIC_MINORS=y
1011CONFIG_USB_SUSPEND=y
1012# CONFIG_USB_OTG is not set
1013# CONFIG_USB_OTG_WHITELIST is not set
1014# CONFIG_USB_OTG_BLACKLIST_HUB is not set
1015# CONFIG_USB_MON is not set
1016# CONFIG_USB_WUSB is not set
1017# CONFIG_USB_WUSB_CBAF is not set
952 1018
953# 1019#
954# USB Gadget Support 1020# USB Host Controller Drivers
955# 1021#
956# CONFIG_USB_GADGET is not set 1022# CONFIG_USB_C67X00_HCD is not set
1023# CONFIG_USB_XHCI_HCD is not set
1024CONFIG_USB_EHCI_HCD=y
1025CONFIG_USB_EHCI_ROOT_HUB_TT=y
1026CONFIG_USB_EHCI_TT_NEWSCHED=y
1027# CONFIG_USB_OXU210HP_HCD is not set
1028# CONFIG_USB_ISP116X_HCD is not set
1029# CONFIG_USB_ISP1760_HCD is not set
1030# CONFIG_USB_ISP1362_HCD is not set
1031CONFIG_USB_OHCI_HCD=y
1032# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
1033# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
1034CONFIG_USB_OHCI_LITTLE_ENDIAN=y
1035# CONFIG_USB_UHCI_HCD is not set
1036# CONFIG_USB_SL811_HCD is not set
1037# CONFIG_USB_R8A66597_HCD is not set
1038# CONFIG_USB_WHCI_HCD is not set
1039# CONFIG_USB_HWA_HCD is not set
957 1040
958# 1041#
959# MMC/SD Card support 1042# USB Device Class drivers
960# 1043#
961# CONFIG_MMC is not set 1044# CONFIG_USB_ACM is not set
1045# CONFIG_USB_PRINTER is not set
1046# CONFIG_USB_WDM is not set
1047# CONFIG_USB_TMC is not set
962 1048
963# 1049#
964# LED devices 1050# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
965# 1051#
966# CONFIG_NEW_LEDS is not set
967 1052
968# 1053#
969# LED drivers 1054# also be needed; see USB_STORAGE Help for more info
970# 1055#
1056# CONFIG_USB_LIBUSUAL is not set
971 1057
972# 1058#
973# LED Triggers 1059# USB Imaging devices
974# 1060#
1061# CONFIG_USB_MDC800 is not set
975 1062
976# 1063#
977# InfiniBand support 1064# USB port drivers
978# 1065#
979# CONFIG_INFINIBAND is not set 1066# CONFIG_USB_SERIAL is not set
980 1067
981# 1068#
982# EDAC - error detection and reporting (RAS) (EXPERIMENTAL) 1069# USB Miscellaneous drivers
983# 1070#
1071# CONFIG_USB_EMI62 is not set
1072# CONFIG_USB_EMI26 is not set
1073# CONFIG_USB_ADUTUX is not set
1074# CONFIG_USB_SEVSEG is not set
1075# CONFIG_USB_RIO500 is not set
1076# CONFIG_USB_LEGOTOWER is not set
1077# CONFIG_USB_LCD is not set
1078# CONFIG_USB_BERRY_CHARGE is not set
1079# CONFIG_USB_LED is not set
1080# CONFIG_USB_CYPRESS_CY7C63 is not set
1081# CONFIG_USB_CYTHERM is not set
1082# CONFIG_USB_IDMOUSE is not set
1083# CONFIG_USB_FTDI_ELAN is not set
1084# CONFIG_USB_APPLEDISPLAY is not set
1085# CONFIG_USB_SISUSBVGA is not set
1086# CONFIG_USB_LD is not set
1087# CONFIG_USB_TRANCEVIBRATOR is not set
1088# CONFIG_USB_IOWARRIOR is not set
1089# CONFIG_USB_TEST is not set
1090# CONFIG_USB_ISIGHTFW is not set
1091# CONFIG_USB_VST is not set
1092# CONFIG_USB_GADGET is not set
1093
1094#
1095# OTG and related infrastructure
1096#
1097# CONFIG_USB_GPIO_VBUS is not set
1098# CONFIG_NOP_USB_XCEIV is not set
1099# CONFIG_UWB is not set
1100# CONFIG_MMC is not set
1101# CONFIG_MEMSTICK is not set
1102# CONFIG_NEW_LEDS is not set
1103# CONFIG_ACCESSIBILITY is not set
1104# CONFIG_INFINIBAND is not set
1105CONFIG_RTC_LIB=y
1106CONFIG_RTC_CLASS=y
1107CONFIG_RTC_HCTOSYS=y
1108CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
1109# CONFIG_RTC_DEBUG is not set
984 1110
985# 1111#
986# Real Time Clock 1112# RTC interfaces
987# 1113#
988# CONFIG_RTC_CLASS is not set 1114CONFIG_RTC_INTF_SYSFS=y
1115CONFIG_RTC_INTF_PROC=y
1116CONFIG_RTC_INTF_DEV=y
1117# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
1118# CONFIG_RTC_DRV_TEST is not set
989 1119
990# 1120#
991# DMA Engine support 1121# I2C RTC drivers
992# 1122#
993# CONFIG_DMA_ENGINE is not set 1123# CONFIG_RTC_DRV_DS1307 is not set
1124# CONFIG_RTC_DRV_DS1374 is not set
1125# CONFIG_RTC_DRV_DS1672 is not set
1126# CONFIG_RTC_DRV_MAX6900 is not set
1127# CONFIG_RTC_DRV_RS5C372 is not set
1128# CONFIG_RTC_DRV_ISL1208 is not set
1129# CONFIG_RTC_DRV_X1205 is not set
1130# CONFIG_RTC_DRV_PCF8563 is not set
1131# CONFIG_RTC_DRV_PCF8583 is not set
1132# CONFIG_RTC_DRV_M41T80 is not set
1133# CONFIG_RTC_DRV_BQ32K is not set
1134# CONFIG_RTC_DRV_S35390A is not set
1135# CONFIG_RTC_DRV_FM3130 is not set
1136# CONFIG_RTC_DRV_RX8581 is not set
1137# CONFIG_RTC_DRV_RX8025 is not set
994 1138
995# 1139#
996# DMA Clients 1140# SPI RTC drivers
997# 1141#
998 1142
999# 1143#
1000# DMA Devices 1144# Platform RTC drivers
1001# 1145#
1146# CONFIG_RTC_DRV_CMOS is not set
1147# CONFIG_RTC_DRV_DS1286 is not set
1148# CONFIG_RTC_DRV_DS1511 is not set
1149# CONFIG_RTC_DRV_DS1553 is not set
1150# CONFIG_RTC_DRV_DS1742 is not set
1151# CONFIG_RTC_DRV_STK17TA8 is not set
1152# CONFIG_RTC_DRV_M48T86 is not set
1153# CONFIG_RTC_DRV_M48T35 is not set
1154# CONFIG_RTC_DRV_M48T59 is not set
1155# CONFIG_RTC_DRV_MSM6242 is not set
1156# CONFIG_RTC_DRV_BQ4802 is not set
1157# CONFIG_RTC_DRV_RP5C01 is not set
1158# CONFIG_RTC_DRV_V3020 is not set
1002 1159
1003# 1160#
1004# Auxiliary Display support 1161# on-CPU RTC drivers
1005# 1162#
1163CONFIG_RTC_DRV_AU1XXX=y
1164# CONFIG_DMADEVICES is not set
1165# CONFIG_AUXDISPLAY is not set
1166# CONFIG_UIO is not set
1006 1167
1007# 1168#
1008# Virtualization 1169# TI VLYNQ
1009# 1170#
1171# CONFIG_STAGING is not set
1010 1172
1011# 1173#
1012# File systems 1174# File systems
1013# 1175#
1014CONFIG_EXT2_FS=y 1176CONFIG_EXT2_FS=y
1015CONFIG_EXT2_FS_XATTR=y 1177# CONFIG_EXT2_FS_XATTR is not set
1016CONFIG_EXT2_FS_POSIX_ACL=y
1017# CONFIG_EXT2_FS_SECURITY is not set
1018# CONFIG_EXT2_FS_XIP is not set 1178# CONFIG_EXT2_FS_XIP is not set
1019CONFIG_EXT3_FS=y 1179# CONFIG_EXT3_FS is not set
1020CONFIG_EXT3_FS_XATTR=y 1180# CONFIG_EXT4_FS is not set
1021CONFIG_EXT3_FS_POSIX_ACL=y 1181# CONFIG_REISERFS_FS is not set
1022CONFIG_EXT3_FS_SECURITY=y
1023# CONFIG_EXT4DEV_FS is not set
1024CONFIG_JBD=y
1025# CONFIG_JBD_DEBUG is not set
1026CONFIG_FS_MBCACHE=y
1027CONFIG_REISERFS_FS=m
1028# CONFIG_REISERFS_CHECK is not set
1029# CONFIG_REISERFS_PROC_INFO is not set
1030CONFIG_REISERFS_FS_XATTR=y
1031CONFIG_REISERFS_FS_POSIX_ACL=y
1032CONFIG_REISERFS_FS_SECURITY=y
1033# CONFIG_JFS_FS is not set 1182# CONFIG_JFS_FS is not set
1034CONFIG_FS_POSIX_ACL=y 1183# CONFIG_FS_POSIX_ACL is not set
1035# CONFIG_XFS_FS is not set 1184# CONFIG_XFS_FS is not set
1036# CONFIG_GFS2_FS is not set 1185# CONFIG_GFS2_FS is not set
1037# CONFIG_OCFS2_FS is not set 1186# CONFIG_OCFS2_FS is not set
1038# CONFIG_MINIX_FS is not set 1187# CONFIG_BTRFS_FS is not set
1039# CONFIG_ROMFS_FS is not set 1188# CONFIG_NILFS2_FS is not set
1189CONFIG_FILE_LOCKING=y
1190CONFIG_FSNOTIFY=y
1191CONFIG_DNOTIFY=y
1040CONFIG_INOTIFY=y 1192CONFIG_INOTIFY=y
1041CONFIG_INOTIFY_USER=y 1193CONFIG_INOTIFY_USER=y
1042# CONFIG_QUOTA is not set 1194# CONFIG_QUOTA is not set
1043CONFIG_DNOTIFY=y 1195# CONFIG_AUTOFS_FS is not set
1044CONFIG_AUTOFS_FS=m 1196# CONFIG_AUTOFS4_FS is not set
1045CONFIG_AUTOFS4_FS=m 1197# CONFIG_FUSE_FS is not set
1046CONFIG_FUSE_FS=m 1198
1047CONFIG_GENERIC_ACL=y 1199#
1200# Caches
1201#
1202# CONFIG_FSCACHE is not set
1048 1203
1049# 1204#
1050# CD-ROM/DVD Filesystems 1205# CD-ROM/DVD Filesystems
1051# 1206#
1052# CONFIG_ISO9660_FS is not set 1207CONFIG_ISO9660_FS=y
1053# CONFIG_UDF_FS is not set 1208CONFIG_JOLIET=y
1209CONFIG_ZISOFS=y
1210CONFIG_UDF_FS=y
1211CONFIG_UDF_NLS=y
1054 1212
1055# 1213#
1056# DOS/FAT/NT Filesystems 1214# DOS/FAT/NT Filesystems
1057# 1215#
1216CONFIG_FAT_FS=y
1058# CONFIG_MSDOS_FS is not set 1217# CONFIG_MSDOS_FS is not set
1059# CONFIG_VFAT_FS is not set 1218CONFIG_VFAT_FS=y
1219CONFIG_FAT_DEFAULT_CODEPAGE=437
1220CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1060# CONFIG_NTFS_FS is not set 1221# CONFIG_NTFS_FS is not set
1061 1222
1062# 1223#
1063# Pseudo filesystems 1224# Pseudo filesystems
1064# 1225#
1065CONFIG_PROC_FS=y 1226CONFIG_PROC_FS=y
1066CONFIG_PROC_KCORE=y 1227# CONFIG_PROC_KCORE is not set
1067CONFIG_PROC_SYSCTL=y 1228CONFIG_PROC_SYSCTL=y
1229# CONFIG_PROC_PAGE_MONITOR is not set
1068CONFIG_SYSFS=y 1230CONFIG_SYSFS=y
1069CONFIG_TMPFS=y 1231CONFIG_TMPFS=y
1070CONFIG_TMPFS_POSIX_ACL=y 1232# CONFIG_TMPFS_POSIX_ACL is not set
1071# CONFIG_HUGETLB_PAGE is not set 1233# CONFIG_HUGETLB_PAGE is not set
1072CONFIG_RAMFS=y 1234# CONFIG_CONFIGFS_FS is not set
1073CONFIG_CONFIGFS_FS=m 1235CONFIG_MISC_FILESYSTEMS=y
1074
1075#
1076# Miscellaneous filesystems
1077#
1078# CONFIG_ADFS_FS is not set 1236# CONFIG_ADFS_FS is not set
1079# CONFIG_AFFS_FS is not set 1237# CONFIG_AFFS_FS is not set
1080# CONFIG_ECRYPT_FS is not set
1081# CONFIG_HFS_FS is not set 1238# CONFIG_HFS_FS is not set
1082# CONFIG_HFSPLUS_FS is not set 1239# CONFIG_HFSPLUS_FS is not set
1083# CONFIG_BEFS_FS is not set 1240# CONFIG_BEFS_FS is not set
1084# CONFIG_BFS_FS is not set 1241# CONFIG_BFS_FS is not set
1085# CONFIG_EFS_FS is not set 1242# CONFIG_EFS_FS is not set
1086# CONFIG_JFFS2_FS is not set 1243CONFIG_JFFS2_FS=y
1087CONFIG_CRAMFS=m 1244CONFIG_JFFS2_FS_DEBUG=0
1245CONFIG_JFFS2_FS_WRITEBUFFER=y
1246# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
1247CONFIG_JFFS2_SUMMARY=y
1248# CONFIG_JFFS2_FS_XATTR is not set
1249CONFIG_JFFS2_COMPRESSION_OPTIONS=y
1250CONFIG_JFFS2_ZLIB=y
1251CONFIG_JFFS2_LZO=y
1252CONFIG_JFFS2_RTIME=y
1253CONFIG_JFFS2_RUBIN=y
1254# CONFIG_JFFS2_CMODE_NONE is not set
1255CONFIG_JFFS2_CMODE_PRIORITY=y
1256# CONFIG_JFFS2_CMODE_SIZE is not set
1257# CONFIG_JFFS2_CMODE_FAVOURLZO is not set
1258# CONFIG_CRAMFS is not set
1259CONFIG_SQUASHFS=y
1260# CONFIG_SQUASHFS_EMBEDDED is not set
1261CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
1088# CONFIG_VXFS_FS is not set 1262# CONFIG_VXFS_FS is not set
1263# CONFIG_MINIX_FS is not set
1264# CONFIG_OMFS_FS is not set
1089# CONFIG_HPFS_FS is not set 1265# CONFIG_HPFS_FS is not set
1090# CONFIG_QNX4FS_FS is not set 1266# CONFIG_QNX4FS_FS is not set
1267# CONFIG_ROMFS_FS is not set
1091# CONFIG_SYSV_FS is not set 1268# CONFIG_SYSV_FS is not set
1092# CONFIG_UFS_FS is not set 1269# CONFIG_UFS_FS is not set
1093 1270CONFIG_NETWORK_FILESYSTEMS=y
1094#
1095# Network File Systems
1096#
1097CONFIG_NFS_FS=y 1271CONFIG_NFS_FS=y
1098# CONFIG_NFS_V3 is not set 1272CONFIG_NFS_V3=y
1273# CONFIG_NFS_V3_ACL is not set
1099# CONFIG_NFS_V4 is not set 1274# CONFIG_NFS_V4 is not set
1100# CONFIG_NFS_DIRECTIO is not set
1101CONFIG_NFSD=m
1102# CONFIG_NFSD_V3 is not set
1103# CONFIG_NFSD_TCP is not set
1104CONFIG_ROOT_NFS=y 1275CONFIG_ROOT_NFS=y
1276# CONFIG_NFSD is not set
1105CONFIG_LOCKD=y 1277CONFIG_LOCKD=y
1106CONFIG_EXPORTFS=m 1278CONFIG_LOCKD_V4=y
1107CONFIG_NFS_COMMON=y 1279CONFIG_NFS_COMMON=y
1108CONFIG_SUNRPC=y 1280CONFIG_SUNRPC=y
1109# CONFIG_RPCSEC_GSS_KRB5 is not set 1281# CONFIG_RPCSEC_GSS_KRB5 is not set
1110# CONFIG_RPCSEC_GSS_SPKM3 is not set 1282# CONFIG_RPCSEC_GSS_SPKM3 is not set
1111CONFIG_SMB_FS=m 1283# CONFIG_SMB_FS is not set
1112# CONFIG_SMB_NLS_DEFAULT is not set
1113# CONFIG_CIFS is not set 1284# CONFIG_CIFS is not set
1114# CONFIG_NCP_FS is not set 1285# CONFIG_NCP_FS is not set
1115# CONFIG_CODA_FS is not set 1286# CONFIG_CODA_FS is not set
1116# CONFIG_AFS_FS is not set 1287# CONFIG_AFS_FS is not set
1117# CONFIG_9P_FS is not set
1118 1288
1119# 1289#
1120# Partition Types 1290# Partition Types
1121# 1291#
1122# CONFIG_PARTITION_ADVANCED is not set 1292# CONFIG_PARTITION_ADVANCED is not set
1123CONFIG_MSDOS_PARTITION=y 1293CONFIG_MSDOS_PARTITION=y
1124 1294CONFIG_NLS=y
1125#
1126# Native Language Support
1127#
1128CONFIG_NLS=m
1129CONFIG_NLS_DEFAULT="iso8859-1" 1295CONFIG_NLS_DEFAULT="iso8859-1"
1130# CONFIG_NLS_CODEPAGE_437 is not set 1296CONFIG_NLS_CODEPAGE_437=y
1131# CONFIG_NLS_CODEPAGE_737 is not set 1297# CONFIG_NLS_CODEPAGE_737 is not set
1132# CONFIG_NLS_CODEPAGE_775 is not set 1298# CONFIG_NLS_CODEPAGE_775 is not set
1133# CONFIG_NLS_CODEPAGE_850 is not set 1299CONFIG_NLS_CODEPAGE_850=y
1134# CONFIG_NLS_CODEPAGE_852 is not set 1300CONFIG_NLS_CODEPAGE_852=y
1135# CONFIG_NLS_CODEPAGE_855 is not set 1301# CONFIG_NLS_CODEPAGE_855 is not set
1136# CONFIG_NLS_CODEPAGE_857 is not set 1302# CONFIG_NLS_CODEPAGE_857 is not set
1137# CONFIG_NLS_CODEPAGE_860 is not set 1303# CONFIG_NLS_CODEPAGE_860 is not set
@@ -1148,10 +1314,10 @@ CONFIG_NLS_DEFAULT="iso8859-1"
1148# CONFIG_NLS_CODEPAGE_949 is not set 1314# CONFIG_NLS_CODEPAGE_949 is not set
1149# CONFIG_NLS_CODEPAGE_874 is not set 1315# CONFIG_NLS_CODEPAGE_874 is not set
1150# CONFIG_NLS_ISO8859_8 is not set 1316# CONFIG_NLS_ISO8859_8 is not set
1151# CONFIG_NLS_CODEPAGE_1250 is not set 1317CONFIG_NLS_CODEPAGE_1250=y
1152# CONFIG_NLS_CODEPAGE_1251 is not set 1318# CONFIG_NLS_CODEPAGE_1251 is not set
1153# CONFIG_NLS_ASCII is not set 1319CONFIG_NLS_ASCII=y
1154# CONFIG_NLS_ISO8859_1 is not set 1320CONFIG_NLS_ISO8859_1=y
1155# CONFIG_NLS_ISO8859_2 is not set 1321# CONFIG_NLS_ISO8859_2 is not set
1156# CONFIG_NLS_ISO8859_3 is not set 1322# CONFIG_NLS_ISO8859_3 is not set
1157# CONFIG_NLS_ISO8859_4 is not set 1323# CONFIG_NLS_ISO8859_4 is not set
@@ -1161,38 +1327,75 @@ CONFIG_NLS_DEFAULT="iso8859-1"
1161# CONFIG_NLS_ISO8859_9 is not set 1327# CONFIG_NLS_ISO8859_9 is not set
1162# CONFIG_NLS_ISO8859_13 is not set 1328# CONFIG_NLS_ISO8859_13 is not set
1163# CONFIG_NLS_ISO8859_14 is not set 1329# CONFIG_NLS_ISO8859_14 is not set
1164# CONFIG_NLS_ISO8859_15 is not set 1330CONFIG_NLS_ISO8859_15=y
1165# CONFIG_NLS_KOI8_R is not set 1331# CONFIG_NLS_KOI8_R is not set
1166# CONFIG_NLS_KOI8_U is not set 1332# CONFIG_NLS_KOI8_U is not set
1167# CONFIG_NLS_UTF8 is not set 1333CONFIG_NLS_UTF8=y
1168 1334# CONFIG_DLM is not set
1169#
1170# Distributed Lock Manager
1171#
1172CONFIG_DLM=m
1173CONFIG_DLM_TCP=y
1174# CONFIG_DLM_SCTP is not set
1175# CONFIG_DLM_DEBUG is not set
1176
1177#
1178# Profiling support
1179#
1180# CONFIG_PROFILING is not set
1181 1335
1182# 1336#
1183# Kernel hacking 1337# Kernel hacking
1184# 1338#
1185CONFIG_TRACE_IRQFLAGS_SUPPORT=y 1339CONFIG_TRACE_IRQFLAGS_SUPPORT=y
1186# CONFIG_PRINTK_TIME is not set 1340# CONFIG_PRINTK_TIME is not set
1341CONFIG_ENABLE_WARN_DEPRECATED=y
1187CONFIG_ENABLE_MUST_CHECK=y 1342CONFIG_ENABLE_MUST_CHECK=y
1343CONFIG_FRAME_WARN=1024
1188# CONFIG_MAGIC_SYSRQ is not set 1344# CONFIG_MAGIC_SYSRQ is not set
1345CONFIG_STRIP_ASM_SYMS=y
1189# CONFIG_UNUSED_SYMBOLS is not set 1346# CONFIG_UNUSED_SYMBOLS is not set
1190# CONFIG_DEBUG_FS is not set 1347# CONFIG_DEBUG_FS is not set
1191# CONFIG_HEADERS_CHECK is not set 1348# CONFIG_HEADERS_CHECK is not set
1192# CONFIG_DEBUG_KERNEL is not set 1349CONFIG_DEBUG_KERNEL=y
1193CONFIG_LOG_BUF_SHIFT=14 1350# CONFIG_DEBUG_SHIRQ is not set
1194CONFIG_CROSSCOMPILE=y 1351# CONFIG_DETECT_SOFTLOCKUP is not set
1352# CONFIG_DETECT_HUNG_TASK is not set
1353# CONFIG_SCHED_DEBUG is not set
1354# CONFIG_SCHEDSTATS is not set
1355# CONFIG_TIMER_STATS is not set
1356# CONFIG_DEBUG_OBJECTS is not set
1357# CONFIG_DEBUG_SLAB is not set
1358# CONFIG_DEBUG_RT_MUTEXES is not set
1359# CONFIG_RT_MUTEX_TESTER is not set
1360# CONFIG_DEBUG_SPINLOCK is not set
1361# CONFIG_DEBUG_MUTEXES is not set
1362# CONFIG_DEBUG_LOCK_ALLOC is not set
1363# CONFIG_PROVE_LOCKING is not set
1364# CONFIG_LOCK_STAT is not set
1365# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1366# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1367# CONFIG_DEBUG_KOBJECT is not set
1368# CONFIG_DEBUG_INFO is not set
1369# CONFIG_DEBUG_VM is not set
1370# CONFIG_DEBUG_WRITECOUNT is not set
1371# CONFIG_DEBUG_MEMORY_INIT is not set
1372# CONFIG_DEBUG_LIST is not set
1373# CONFIG_DEBUG_SG is not set
1374# CONFIG_DEBUG_NOTIFIERS is not set
1375# CONFIG_DEBUG_CREDENTIALS is not set
1376# CONFIG_BOOT_PRINTK_DELAY is not set
1377# CONFIG_RCU_TORTURE_TEST is not set
1378# CONFIG_BACKTRACE_SELF_TEST is not set
1379# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1380# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
1381# CONFIG_FAULT_INJECTION is not set
1382# CONFIG_SYSCTL_SYSCALL_CHECK is not set
1383# CONFIG_PAGE_POISONING is not set
1384CONFIG_HAVE_FUNCTION_TRACER=y
1385CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1386CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y
1387CONFIG_HAVE_DYNAMIC_FTRACE=y
1388CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1389CONFIG_TRACING_SUPPORT=y
1390# CONFIG_FTRACE is not set
1391# CONFIG_SAMPLES is not set
1392CONFIG_HAVE_ARCH_KGDB=y
1393# CONFIG_KGDB is not set
1394CONFIG_EARLY_PRINTK=y
1195# CONFIG_CMDLINE_BOOL is not set 1395# CONFIG_CMDLINE_BOOL is not set
1396# CONFIG_DEBUG_STACK_USAGE is not set
1397# CONFIG_RUNTIME_DEBUG is not set
1398CONFIG_DEBUG_ZBOOT=y
1196 1399
1197# 1400#
1198# Security options 1401# Security options
@@ -1200,67 +1403,32 @@ CONFIG_CROSSCOMPILE=y
1200CONFIG_KEYS=y 1403CONFIG_KEYS=y
1201CONFIG_KEYS_DEBUG_PROC_KEYS=y 1404CONFIG_KEYS_DEBUG_PROC_KEYS=y
1202# CONFIG_SECURITY is not set 1405# CONFIG_SECURITY is not set
1203 1406CONFIG_SECURITYFS=y
1204# 1407# CONFIG_DEFAULT_SECURITY_SELINUX is not set
1205# Cryptographic options 1408# CONFIG_DEFAULT_SECURITY_SMACK is not set
1206# 1409# CONFIG_DEFAULT_SECURITY_TOMOYO is not set
1207CONFIG_CRYPTO=y 1410CONFIG_DEFAULT_SECURITY_DAC=y
1208CONFIG_CRYPTO_ALGAPI=y 1411CONFIG_DEFAULT_SECURITY=""
1209CONFIG_CRYPTO_BLKCIPHER=m 1412# CONFIG_CRYPTO is not set
1210CONFIG_CRYPTO_HASH=y 1413# CONFIG_BINARY_PRINTF is not set
1211CONFIG_CRYPTO_MANAGER=y
1212CONFIG_CRYPTO_HMAC=y
1213CONFIG_CRYPTO_XCBC=m
1214CONFIG_CRYPTO_NULL=m
1215CONFIG_CRYPTO_MD4=m
1216CONFIG_CRYPTO_MD5=y
1217CONFIG_CRYPTO_SHA1=m
1218CONFIG_CRYPTO_SHA256=m
1219CONFIG_CRYPTO_SHA512=m
1220CONFIG_CRYPTO_WP512=m
1221CONFIG_CRYPTO_TGR192=m
1222CONFIG_CRYPTO_GF128MUL=m
1223CONFIG_CRYPTO_ECB=m
1224CONFIG_CRYPTO_CBC=m
1225CONFIG_CRYPTO_PCBC=m
1226CONFIG_CRYPTO_LRW=m
1227CONFIG_CRYPTO_DES=m
1228CONFIG_CRYPTO_FCRYPT=m
1229CONFIG_CRYPTO_BLOWFISH=m
1230CONFIG_CRYPTO_TWOFISH=m
1231CONFIG_CRYPTO_TWOFISH_COMMON=m
1232CONFIG_CRYPTO_SERPENT=m
1233CONFIG_CRYPTO_AES=m
1234CONFIG_CRYPTO_CAST5=m
1235CONFIG_CRYPTO_CAST6=m
1236CONFIG_CRYPTO_TEA=m
1237CONFIG_CRYPTO_ARC4=m
1238CONFIG_CRYPTO_KHAZAD=m
1239CONFIG_CRYPTO_ANUBIS=m
1240CONFIG_CRYPTO_DEFLATE=m
1241CONFIG_CRYPTO_MICHAEL_MIC=m
1242CONFIG_CRYPTO_CRC32C=m
1243CONFIG_CRYPTO_CAMELLIA=m
1244# CONFIG_CRYPTO_TEST is not set
1245
1246#
1247# Hardware crypto devices
1248#
1249 1414
1250# 1415#
1251# Library routines 1416# Library routines
1252# 1417#
1253CONFIG_BITREVERSE=y 1418CONFIG_BITREVERSE=y
1254CONFIG_CRC_CCITT=m 1419CONFIG_GENERIC_FIND_LAST_BIT=y
1255CONFIG_CRC16=m 1420# CONFIG_CRC_CCITT is not set
1421# CONFIG_CRC16 is not set
1422# CONFIG_CRC_T10DIF is not set
1423CONFIG_CRC_ITU_T=y
1256CONFIG_CRC32=y 1424CONFIG_CRC32=y
1257CONFIG_LIBCRC32C=m 1425# CONFIG_CRC7 is not set
1258CONFIG_ZLIB_INFLATE=m 1426# CONFIG_LIBCRC32C is not set
1259CONFIG_ZLIB_DEFLATE=m 1427CONFIG_ZLIB_INFLATE=y
1260CONFIG_TEXTSEARCH=y 1428CONFIG_ZLIB_DEFLATE=y
1261CONFIG_TEXTSEARCH_KMP=m 1429CONFIG_LZO_COMPRESS=y
1262CONFIG_TEXTSEARCH_BM=m 1430CONFIG_LZO_DECOMPRESS=y
1263CONFIG_TEXTSEARCH_FSM=m
1264CONFIG_PLIST=y
1265CONFIG_HAS_IOMEM=y 1431CONFIG_HAS_IOMEM=y
1266CONFIG_HAS_IOPORT=y 1432CONFIG_HAS_IOPORT=y
1433CONFIG_HAS_DMA=y
1434CONFIG_NLATTR=y
diff --git a/arch/mips/dec/kn01-berr.c b/arch/mips/dec/kn01-berr.c
index b0dc6d53edd6..94d23b4a7dc3 100644
--- a/arch/mips/dec/kn01-berr.c
+++ b/arch/mips/dec/kn01-berr.c
@@ -46,7 +46,7 @@
46 * There is no default value -- it has to be initialized. 46 * There is no default value -- it has to be initialized.
47 */ 47 */
48u16 cached_kn01_csr; 48u16 cached_kn01_csr;
49DEFINE_SPINLOCK(kn01_lock); 49static DEFINE_RAW_SPINLOCK(kn01_lock);
50 50
51 51
52static inline void dec_kn01_be_ack(void) 52static inline void dec_kn01_be_ack(void)
@@ -54,12 +54,12 @@ static inline void dec_kn01_be_ack(void)
54 volatile u16 *csr = (void *)CKSEG1ADDR(KN01_SLOT_BASE + KN01_CSR); 54 volatile u16 *csr = (void *)CKSEG1ADDR(KN01_SLOT_BASE + KN01_CSR);
55 unsigned long flags; 55 unsigned long flags;
56 56
57 spin_lock_irqsave(&kn01_lock, flags); 57 raw_spin_lock_irqsave(&kn01_lock, flags);
58 58
59 *csr = cached_kn01_csr | KN01_CSR_MEMERR; /* Clear bus IRQ. */ 59 *csr = cached_kn01_csr | KN01_CSR_MEMERR; /* Clear bus IRQ. */
60 iob(); 60 iob();
61 61
62 spin_unlock_irqrestore(&kn01_lock, flags); 62 raw_spin_unlock_irqrestore(&kn01_lock, flags);
63} 63}
64 64
65static int dec_kn01_be_backend(struct pt_regs *regs, int is_fixup, int invoker) 65static int dec_kn01_be_backend(struct pt_regs *regs, int is_fixup, int invoker)
@@ -182,7 +182,7 @@ void __init dec_kn01_be_init(void)
182 volatile u16 *csr = (void *)CKSEG1ADDR(KN01_SLOT_BASE + KN01_CSR); 182 volatile u16 *csr = (void *)CKSEG1ADDR(KN01_SLOT_BASE + KN01_CSR);
183 unsigned long flags; 183 unsigned long flags;
184 184
185 spin_lock_irqsave(&kn01_lock, flags); 185 raw_spin_lock_irqsave(&kn01_lock, flags);
186 186
187 /* Preset write-only bits of the Control Register cache. */ 187 /* Preset write-only bits of the Control Register cache. */
188 cached_kn01_csr = *csr; 188 cached_kn01_csr = *csr;
@@ -194,7 +194,7 @@ void __init dec_kn01_be_init(void)
194 *csr = cached_kn01_csr; 194 *csr = cached_kn01_csr;
195 iob(); 195 iob();
196 196
197 spin_unlock_irqrestore(&kn01_lock, flags); 197 raw_spin_unlock_irqrestore(&kn01_lock, flags);
198 198
199 /* Clear any leftover errors from the firmware. */ 199 /* Clear any leftover errors from the firmware. */
200 dec_kn01_be_ack(); 200 dec_kn01_be_ack();
diff --git a/arch/mips/dec/prom/locore.S b/arch/mips/dec/prom/locore.S
index d9acdcefee81..f72b5741025f 100644
--- a/arch/mips/dec/prom/locore.S
+++ b/arch/mips/dec/prom/locore.S
@@ -27,4 +27,3 @@ NESTED(genexcept_early, 0, sp)
27 jr k0 27 jr k0
28 rfe 28 rfe
29END(genexcept_early) 29END(genexcept_early)
30
diff --git a/arch/mips/include/asm/atomic.h b/arch/mips/include/asm/atomic.h
index dd75d673447e..519197ede089 100644
--- a/arch/mips/include/asm/atomic.h
+++ b/arch/mips/include/asm/atomic.h
@@ -137,7 +137,7 @@ static __inline__ int atomic_add_return(int i, atomic_t * v)
137{ 137{
138 int result; 138 int result;
139 139
140 smp_llsc_mb(); 140 smp_mb__before_llsc();
141 141
142 if (kernel_uses_llsc && R10000_LLSC_WAR) { 142 if (kernel_uses_llsc && R10000_LLSC_WAR) {
143 int temp; 143 int temp;
@@ -189,7 +189,7 @@ static __inline__ int atomic_sub_return(int i, atomic_t * v)
189{ 189{
190 int result; 190 int result;
191 191
192 smp_llsc_mb(); 192 smp_mb__before_llsc();
193 193
194 if (kernel_uses_llsc && R10000_LLSC_WAR) { 194 if (kernel_uses_llsc && R10000_LLSC_WAR) {
195 int temp; 195 int temp;
@@ -249,7 +249,7 @@ static __inline__ int atomic_sub_if_positive(int i, atomic_t * v)
249{ 249{
250 int result; 250 int result;
251 251
252 smp_llsc_mb(); 252 smp_mb__before_llsc();
253 253
254 if (kernel_uses_llsc && R10000_LLSC_WAR) { 254 if (kernel_uses_llsc && R10000_LLSC_WAR) {
255 int temp; 255 int temp;
@@ -516,7 +516,7 @@ static __inline__ long atomic64_add_return(long i, atomic64_t * v)
516{ 516{
517 long result; 517 long result;
518 518
519 smp_llsc_mb(); 519 smp_mb__before_llsc();
520 520
521 if (kernel_uses_llsc && R10000_LLSC_WAR) { 521 if (kernel_uses_llsc && R10000_LLSC_WAR) {
522 long temp; 522 long temp;
@@ -568,7 +568,7 @@ static __inline__ long atomic64_sub_return(long i, atomic64_t * v)
568{ 568{
569 long result; 569 long result;
570 570
571 smp_llsc_mb(); 571 smp_mb__before_llsc();
572 572
573 if (kernel_uses_llsc && R10000_LLSC_WAR) { 573 if (kernel_uses_llsc && R10000_LLSC_WAR) {
574 long temp; 574 long temp;
@@ -628,7 +628,7 @@ static __inline__ long atomic64_sub_if_positive(long i, atomic64_t * v)
628{ 628{
629 long result; 629 long result;
630 630
631 smp_llsc_mb(); 631 smp_mb__before_llsc();
632 632
633 if (kernel_uses_llsc && R10000_LLSC_WAR) { 633 if (kernel_uses_llsc && R10000_LLSC_WAR) {
634 long temp; 634 long temp;
@@ -788,9 +788,9 @@ static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u)
788 * atomic*_return operations are serializing but not the non-*_return 788 * atomic*_return operations are serializing but not the non-*_return
789 * versions. 789 * versions.
790 */ 790 */
791#define smp_mb__before_atomic_dec() smp_llsc_mb() 791#define smp_mb__before_atomic_dec() smp_mb__before_llsc()
792#define smp_mb__after_atomic_dec() smp_llsc_mb() 792#define smp_mb__after_atomic_dec() smp_llsc_mb()
793#define smp_mb__before_atomic_inc() smp_llsc_mb() 793#define smp_mb__before_atomic_inc() smp_mb__before_llsc()
794#define smp_mb__after_atomic_inc() smp_llsc_mb() 794#define smp_mb__after_atomic_inc() smp_llsc_mb()
795 795
796#include <asm-generic/atomic-long.h> 796#include <asm-generic/atomic-long.h>
diff --git a/arch/mips/include/asm/barrier.h b/arch/mips/include/asm/barrier.h
index 8e9ac313ca3b..c0884f02d3a6 100644
--- a/arch/mips/include/asm/barrier.h
+++ b/arch/mips/include/asm/barrier.h
@@ -88,12 +88,20 @@
88 : /* no output */ \ 88 : /* no output */ \
89 : "m" (*(int *)CKSEG1) \ 89 : "m" (*(int *)CKSEG1) \
90 : "memory") 90 : "memory")
91 91#ifdef CONFIG_CPU_CAVIUM_OCTEON
92#define fast_wmb() __sync() 92# define OCTEON_SYNCW_STR ".set push\n.set arch=octeon\nsyncw\nsyncw\n.set pop\n"
93#define fast_rmb() __sync() 93# define __syncw() __asm__ __volatile__(OCTEON_SYNCW_STR : : : "memory")
94#define fast_mb() __sync() 94
95#ifdef CONFIG_SGI_IP28 95# define fast_wmb() __syncw()
96#define fast_iob() \ 96# define fast_rmb() barrier()
97# define fast_mb() __sync()
98# define fast_iob() do { } while (0)
99#else /* ! CONFIG_CPU_CAVIUM_OCTEON */
100# define fast_wmb() __sync()
101# define fast_rmb() __sync()
102# define fast_mb() __sync()
103# ifdef CONFIG_SGI_IP28
104# define fast_iob() \
97 __asm__ __volatile__( \ 105 __asm__ __volatile__( \
98 ".set push\n\t" \ 106 ".set push\n\t" \
99 ".set noreorder\n\t" \ 107 ".set noreorder\n\t" \
@@ -104,13 +112,14 @@
104 : /* no output */ \ 112 : /* no output */ \
105 : "m" (*(int *)CKSEG1ADDR(0x1fa00004)) \ 113 : "m" (*(int *)CKSEG1ADDR(0x1fa00004)) \
106 : "memory") 114 : "memory")
107#else 115# else
108#define fast_iob() \ 116# define fast_iob() \
109 do { \ 117 do { \
110 __sync(); \ 118 __sync(); \
111 __fast_iob(); \ 119 __fast_iob(); \
112 } while (0) 120 } while (0)
113#endif 121# endif
122#endif /* CONFIG_CPU_CAVIUM_OCTEON */
114 123
115#ifdef CONFIG_CPU_HAS_WB 124#ifdef CONFIG_CPU_HAS_WB
116 125
@@ -131,25 +140,42 @@
131#endif /* !CONFIG_CPU_HAS_WB */ 140#endif /* !CONFIG_CPU_HAS_WB */
132 141
133#if defined(CONFIG_WEAK_ORDERING) && defined(CONFIG_SMP) 142#if defined(CONFIG_WEAK_ORDERING) && defined(CONFIG_SMP)
134#define __WEAK_ORDERING_MB " sync \n" 143# ifdef CONFIG_CPU_CAVIUM_OCTEON
144# define smp_mb() __sync()
145# define smp_rmb() barrier()
146# define smp_wmb() __syncw()
147# else
148# define smp_mb() __asm__ __volatile__("sync" : : :"memory")
149# define smp_rmb() __asm__ __volatile__("sync" : : :"memory")
150# define smp_wmb() __asm__ __volatile__("sync" : : :"memory")
151# endif
135#else 152#else
136#define __WEAK_ORDERING_MB " \n" 153#define smp_mb() barrier()
154#define smp_rmb() barrier()
155#define smp_wmb() barrier()
137#endif 156#endif
157
138#if defined(CONFIG_WEAK_REORDERING_BEYOND_LLSC) && defined(CONFIG_SMP) 158#if defined(CONFIG_WEAK_REORDERING_BEYOND_LLSC) && defined(CONFIG_SMP)
139#define __WEAK_LLSC_MB " sync \n" 159#define __WEAK_LLSC_MB " sync \n"
140#else 160#else
141#define __WEAK_LLSC_MB " \n" 161#define __WEAK_LLSC_MB " \n"
142#endif 162#endif
143 163
144#define smp_mb() __asm__ __volatile__(__WEAK_ORDERING_MB : : :"memory")
145#define smp_rmb() __asm__ __volatile__(__WEAK_ORDERING_MB : : :"memory")
146#define smp_wmb() __asm__ __volatile__(__WEAK_ORDERING_MB : : :"memory")
147
148#define set_mb(var, value) \ 164#define set_mb(var, value) \
149 do { var = value; smp_mb(); } while (0) 165 do { var = value; smp_mb(); } while (0)
150 166
151#define smp_llsc_mb() __asm__ __volatile__(__WEAK_LLSC_MB : : :"memory") 167#define smp_llsc_mb() __asm__ __volatile__(__WEAK_LLSC_MB : : :"memory")
152#define smp_llsc_rmb() __asm__ __volatile__(__WEAK_LLSC_MB : : :"memory") 168
153#define smp_llsc_wmb() __asm__ __volatile__(__WEAK_LLSC_MB : : :"memory") 169#ifdef CONFIG_CPU_CAVIUM_OCTEON
170#define smp_mb__before_llsc() smp_wmb()
171/* Cause previous writes to become visible on all CPUs as soon as possible */
172#define nudge_writes() __asm__ __volatile__(".set push\n\t" \
173 ".set arch=octeon\n\t" \
174 "syncw\n\t" \
175 ".set pop" : : : "memory")
176#else
177#define smp_mb__before_llsc() smp_llsc_mb()
178#define nudge_writes() mb()
179#endif
154 180
155#endif /* __ASM_BARRIER_H */ 181#endif /* __ASM_BARRIER_H */
diff --git a/arch/mips/include/asm/bitops.h b/arch/mips/include/asm/bitops.h
index 84a383806b2c..9255cfbee459 100644
--- a/arch/mips/include/asm/bitops.h
+++ b/arch/mips/include/asm/bitops.h
@@ -42,7 +42,7 @@
42/* 42/*
43 * clear_bit() doesn't provide any barrier for the compiler. 43 * clear_bit() doesn't provide any barrier for the compiler.
44 */ 44 */
45#define smp_mb__before_clear_bit() smp_llsc_mb() 45#define smp_mb__before_clear_bit() smp_mb__before_llsc()
46#define smp_mb__after_clear_bit() smp_llsc_mb() 46#define smp_mb__after_clear_bit() smp_llsc_mb()
47 47
48/* 48/*
@@ -258,7 +258,7 @@ static inline int test_and_set_bit(unsigned long nr,
258 unsigned short bit = nr & SZLONG_MASK; 258 unsigned short bit = nr & SZLONG_MASK;
259 unsigned long res; 259 unsigned long res;
260 260
261 smp_llsc_mb(); 261 smp_mb__before_llsc();
262 262
263 if (kernel_uses_llsc && R10000_LLSC_WAR) { 263 if (kernel_uses_llsc && R10000_LLSC_WAR) {
264 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG); 264 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG);
@@ -395,7 +395,7 @@ static inline int test_and_clear_bit(unsigned long nr,
395 unsigned short bit = nr & SZLONG_MASK; 395 unsigned short bit = nr & SZLONG_MASK;
396 unsigned long res; 396 unsigned long res;
397 397
398 smp_llsc_mb(); 398 smp_mb__before_llsc();
399 399
400 if (kernel_uses_llsc && R10000_LLSC_WAR) { 400 if (kernel_uses_llsc && R10000_LLSC_WAR) {
401 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG); 401 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG);
@@ -485,7 +485,7 @@ static inline int test_and_change_bit(unsigned long nr,
485 unsigned short bit = nr & SZLONG_MASK; 485 unsigned short bit = nr & SZLONG_MASK;
486 unsigned long res; 486 unsigned long res;
487 487
488 smp_llsc_mb(); 488 smp_mb__before_llsc();
489 489
490 if (kernel_uses_llsc && R10000_LLSC_WAR) { 490 if (kernel_uses_llsc && R10000_LLSC_WAR) {
491 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG); 491 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG);
diff --git a/arch/mips/include/asm/cmpxchg.h b/arch/mips/include/asm/cmpxchg.h
index 815a438a268d..ed9aaaaf0749 100644
--- a/arch/mips/include/asm/cmpxchg.h
+++ b/arch/mips/include/asm/cmpxchg.h
@@ -72,14 +72,14 @@
72 */ 72 */
73extern void __cmpxchg_called_with_bad_pointer(void); 73extern void __cmpxchg_called_with_bad_pointer(void);
74 74
75#define __cmpxchg(ptr, old, new, barrier) \ 75#define __cmpxchg(ptr, old, new, pre_barrier, post_barrier) \
76({ \ 76({ \
77 __typeof__(ptr) __ptr = (ptr); \ 77 __typeof__(ptr) __ptr = (ptr); \
78 __typeof__(*(ptr)) __old = (old); \ 78 __typeof__(*(ptr)) __old = (old); \
79 __typeof__(*(ptr)) __new = (new); \ 79 __typeof__(*(ptr)) __new = (new); \
80 __typeof__(*(ptr)) __res = 0; \ 80 __typeof__(*(ptr)) __res = 0; \
81 \ 81 \
82 barrier; \ 82 pre_barrier; \
83 \ 83 \
84 switch (sizeof(*(__ptr))) { \ 84 switch (sizeof(*(__ptr))) { \
85 case 4: \ 85 case 4: \
@@ -96,13 +96,13 @@ extern void __cmpxchg_called_with_bad_pointer(void);
96 break; \ 96 break; \
97 } \ 97 } \
98 \ 98 \
99 barrier; \ 99 post_barrier; \
100 \ 100 \
101 __res; \ 101 __res; \
102}) 102})
103 103
104#define cmpxchg(ptr, old, new) __cmpxchg(ptr, old, new, smp_llsc_mb()) 104#define cmpxchg(ptr, old, new) __cmpxchg(ptr, old, new, smp_mb__before_llsc(), smp_llsc_mb())
105#define cmpxchg_local(ptr, old, new) __cmpxchg(ptr, old, new, ) 105#define cmpxchg_local(ptr, old, new) __cmpxchg(ptr, old, new, , )
106 106
107#define cmpxchg64(ptr, o, n) \ 107#define cmpxchg64(ptr, o, n) \
108 ({ \ 108 ({ \
diff --git a/arch/mips/include/asm/cpu-features.h b/arch/mips/include/asm/cpu-features.h
index 272c5ef35bbb..ac73cede3a0a 100644
--- a/arch/mips/include/asm/cpu-features.h
+++ b/arch/mips/include/asm/cpu-features.h
@@ -95,6 +95,9 @@
95#ifndef cpu_has_smartmips 95#ifndef cpu_has_smartmips
96#define cpu_has_smartmips (cpu_data[0].ases & MIPS_ASE_SMARTMIPS) 96#define cpu_has_smartmips (cpu_data[0].ases & MIPS_ASE_SMARTMIPS)
97#endif 97#endif
98#ifndef kernel_uses_smartmips_rixi
99#define kernel_uses_smartmips_rixi 0
100#endif
98#ifndef cpu_has_vtag_icache 101#ifndef cpu_has_vtag_icache
99#define cpu_has_vtag_icache (cpu_data[0].icache.flags & MIPS_CACHE_VTAG) 102#define cpu_has_vtag_icache (cpu_data[0].icache.flags & MIPS_CACHE_VTAG)
100#endif 103#endif
diff --git a/arch/mips/include/asm/cpu.h b/arch/mips/include/asm/cpu.h
index cf373a95fe4a..a5acda416946 100644
--- a/arch/mips/include/asm/cpu.h
+++ b/arch/mips/include/asm/cpu.h
@@ -224,7 +224,7 @@ enum cpu_type_enum {
224 * MIPS64 class processors 224 * MIPS64 class processors
225 */ 225 */
226 CPU_5KC, CPU_20KC, CPU_25KF, CPU_SB1, CPU_SB1A, CPU_LOONGSON2, 226 CPU_5KC, CPU_20KC, CPU_25KF, CPU_SB1, CPU_SB1A, CPU_LOONGSON2,
227 CPU_CAVIUM_OCTEON, 227 CPU_CAVIUM_OCTEON, CPU_CAVIUM_OCTEON_PLUS,
228 228
229 CPU_LAST 229 CPU_LAST
230}; 230};
diff --git a/arch/mips/include/asm/current.h b/arch/mips/include/asm/current.h
index 559db66b9790..4c51401b5537 100644
--- a/arch/mips/include/asm/current.h
+++ b/arch/mips/include/asm/current.h
@@ -1,23 +1 @@
1/* #include <asm-generic/current.h>
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 1998, 2002 Ralf Baechle
7 * Copyright (C) 1999 Silicon Graphics, Inc.
8 */
9#ifndef _ASM_CURRENT_H
10#define _ASM_CURRENT_H
11
12#include <linux/thread_info.h>
13
14struct task_struct;
15
16static inline struct task_struct * get_current(void)
17{
18 return current_thread_info()->task;
19}
20
21#define current get_current()
22
23#endif /* _ASM_CURRENT_H */
diff --git a/arch/mips/include/asm/dec/kn01.h b/arch/mips/include/asm/dec/kn01.h
index 28fa717ac423..88d9ffd74258 100644
--- a/arch/mips/include/asm/dec/kn01.h
+++ b/arch/mips/include/asm/dec/kn01.h
@@ -80,7 +80,6 @@
80struct pt_regs; 80struct pt_regs;
81 81
82extern u16 cached_kn01_csr; 82extern u16 cached_kn01_csr;
83extern spinlock_t kn01_lock;
84 83
85extern void dec_kn01_be_init(void); 84extern void dec_kn01_be_init(void);
86extern int dec_kn01_be_handler(struct pt_regs *regs, int is_fixup); 85extern int dec_kn01_be_handler(struct pt_regs *regs, int is_fixup);
diff --git a/arch/mips/include/asm/device.h b/arch/mips/include/asm/device.h
index d8f9872b0e2d..06746c5e8099 100644
--- a/arch/mips/include/asm/device.h
+++ b/arch/mips/include/asm/device.h
@@ -4,4 +4,3 @@
4 * This file is released under the GPLv2 4 * This file is released under the GPLv2
5 */ 5 */
6#include <asm-generic/device.h> 6#include <asm-generic/device.h>
7
diff --git a/arch/mips/include/asm/elf.h b/arch/mips/include/asm/elf.h
index 7a6a35dbe529..e53d7bed5cda 100644
--- a/arch/mips/include/asm/elf.h
+++ b/arch/mips/include/asm/elf.h
@@ -334,14 +334,14 @@ extern int dump_task_fpu(struct task_struct *, elf_fpregset_t *);
334 334
335#define ELF_HWCAP (0) 335#define ELF_HWCAP (0)
336 336
337/* This yields a string that ld.so will use to load implementation 337/*
338 specific libraries for optimization. This is more specific in 338 * This yields a string that ld.so will use to load implementation
339 intent than poking at uname or /proc/cpuinfo. 339 * specific libraries for optimization. This is more specific in
340 340 * intent than poking at uname or /proc/cpuinfo.
341 For the moment, we have only optimizations for the Intel generations, 341 */
342 but that could change... */
343 342
344#define ELF_PLATFORM (NULL) 343#define ELF_PLATFORM __elf_platform
344extern const char *__elf_platform;
345 345
346/* 346/*
347 * See comments in asm-alpha/elf.h, this is the same thing 347 * See comments in asm-alpha/elf.h, this is the same thing
diff --git a/arch/mips/include/asm/ftrace.h b/arch/mips/include/asm/ftrace.h
index 3986cd8704f3..ce35c9af0c28 100644
--- a/arch/mips/include/asm/ftrace.h
+++ b/arch/mips/include/asm/ftrace.h
@@ -4,7 +4,7 @@
4 * more details. 4 * more details.
5 * 5 *
6 * Copyright (C) 2009 DSLab, Lanzhou University, China 6 * Copyright (C) 2009 DSLab, Lanzhou University, China
7 * Author: Wu Zhangjin <wuzj@lemote.com> 7 * Author: Wu Zhangjin <wuzhangjin@gmail.com>
8 */ 8 */
9 9
10#ifndef _ASM_MIPS_FTRACE_H 10#ifndef _ASM_MIPS_FTRACE_H
diff --git a/arch/mips/include/asm/i8259.h b/arch/mips/include/asm/i8259.h
index 8572a2d90484..c7e278447c0a 100644
--- a/arch/mips/include/asm/i8259.h
+++ b/arch/mips/include/asm/i8259.h
@@ -35,7 +35,7 @@
35#define SLAVE_ICW4_DEFAULT 0x01 35#define SLAVE_ICW4_DEFAULT 0x01
36#define PIC_ICW4_AEOI 2 36#define PIC_ICW4_AEOI 2
37 37
38extern spinlock_t i8259A_lock; 38extern raw_spinlock_t i8259A_lock;
39 39
40extern int i8259A_irq_pending(unsigned int irq); 40extern int i8259A_irq_pending(unsigned int irq);
41extern void make_8259A_irq(unsigned int irq); 41extern void make_8259A_irq(unsigned int irq);
@@ -51,7 +51,7 @@ static inline int i8259_irq(void)
51{ 51{
52 int irq; 52 int irq;
53 53
54 spin_lock(&i8259A_lock); 54 raw_spin_lock(&i8259A_lock);
55 55
56 /* Perform an interrupt acknowledge cycle on controller 1. */ 56 /* Perform an interrupt acknowledge cycle on controller 1. */
57 outb(0x0C, PIC_MASTER_CMD); /* prepare for poll */ 57 outb(0x0C, PIC_MASTER_CMD); /* prepare for poll */
@@ -78,7 +78,7 @@ static inline int i8259_irq(void)
78 irq = -1; 78 irq = -1;
79 } 79 }
80 80
81 spin_unlock(&i8259A_lock); 81 raw_spin_unlock(&i8259A_lock);
82 82
83 return likely(irq >= 0) ? irq + I8259A_IRQ_BASE : irq; 83 return likely(irq >= 0) ? irq + I8259A_IRQ_BASE : irq;
84} 84}
diff --git a/arch/mips/include/asm/io.h b/arch/mips/include/asm/io.h
index 436878e4e063..c98bf514ec7d 100644
--- a/arch/mips/include/asm/io.h
+++ b/arch/mips/include/asm/io.h
@@ -447,6 +447,24 @@ __BUILDIO(q, u64)
447#define readl_relaxed readl 447#define readl_relaxed readl
448#define readq_relaxed readq 448#define readq_relaxed readq
449 449
450#define readb_be(addr) \
451 __raw_readb((__force unsigned *)(addr))
452#define readw_be(addr) \
453 be16_to_cpu(__raw_readw((__force unsigned *)(addr)))
454#define readl_be(addr) \
455 be32_to_cpu(__raw_readl((__force unsigned *)(addr)))
456#define readq_be(addr) \
457 be64_to_cpu(__raw_readq((__force unsigned *)(addr)))
458
459#define writeb_be(val, addr) \
460 __raw_writeb((val), (__force unsigned *)(addr))
461#define writew_be(val, addr) \
462 __raw_writew(cpu_to_be16((val)), (__force unsigned *)(addr))
463#define writel_be(val, addr) \
464 __raw_writel(cpu_to_be32((val)), (__force unsigned *)(addr))
465#define writeq_be(val, addr) \
466 __raw_writeq(cpu_to_be64((val)), (__force unsigned *)(addr))
467
450/* 468/*
451 * Some code tests for these symbols 469 * Some code tests for these symbols
452 */ 470 */
diff --git a/arch/mips/include/asm/mach-ar7/ar7.h b/arch/mips/include/asm/mach-ar7/ar7.h
index 21cbbc706448..f1cf38943497 100644
--- a/arch/mips/include/asm/mach-ar7/ar7.h
+++ b/arch/mips/include/asm/mach-ar7/ar7.h
@@ -105,26 +105,9 @@ static inline u8 ar7_chip_rev(void)
105 return (readl((void *)KSEG1ADDR(AR7_REGS_GPIO + 0x14)) >> 16) & 0xff; 105 return (readl((void *)KSEG1ADDR(AR7_REGS_GPIO + 0x14)) >> 16) & 0xff;
106} 106}
107 107
108static inline int ar7_cpu_freq(void) 108struct clk {
109{ 109 unsigned int rate;
110 return ar7_cpu_clock; 110};
111}
112
113static inline int ar7_bus_freq(void)
114{
115 return ar7_bus_clock;
116}
117
118static inline int ar7_vbus_freq(void)
119{
120 return ar7_bus_clock / 2;
121}
122#define ar7_cpmac_freq ar7_vbus_freq
123
124static inline int ar7_dsp_freq(void)
125{
126 return ar7_dsp_clock;
127}
128 111
129static inline int ar7_has_high_cpmac(void) 112static inline int ar7_has_high_cpmac(void)
130{ 113{
diff --git a/arch/mips/include/asm/mach-ar7/gpio.h b/arch/mips/include/asm/mach-ar7/gpio.h
index cbe9c4f126df..73f9b162c970 100644
--- a/arch/mips/include/asm/mach-ar7/gpio.h
+++ b/arch/mips/include/asm/mach-ar7/gpio.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2007 Florian Fainelli <florian@openwrt.org> 2 * Copyright (C) 2007-2009 Florian Fainelli <florian@openwrt.org>
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify 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 5 * it under the terms of the GNU General Public License as published by
@@ -22,88 +22,18 @@
22#include <asm/mach-ar7/ar7.h> 22#include <asm/mach-ar7/ar7.h>
23 23
24#define AR7_GPIO_MAX 32 24#define AR7_GPIO_MAX 32
25#define NR_BUILTIN_GPIO AR7_GPIO_MAX
25 26
26extern int gpio_request(unsigned gpio, const char *label); 27#define gpio_to_irq(gpio) NULL
27extern void gpio_free(unsigned gpio);
28 28
29/* Common GPIO layer */ 29#define gpio_get_value __gpio_get_value
30static inline int gpio_get_value(unsigned gpio) 30#define gpio_set_value __gpio_set_value
31{
32 void __iomem *gpio_in =
33 (void __iomem *)KSEG1ADDR(AR7_REGS_GPIO + AR7_GPIO_INPUT);
34 31
35 return readl(gpio_in) & (1 << gpio); 32#define gpio_cansleep __gpio_cansleep
36}
37
38static inline void gpio_set_value(unsigned gpio, int value)
39{
40 void __iomem *gpio_out =
41 (void __iomem *)KSEG1ADDR(AR7_REGS_GPIO + AR7_GPIO_OUTPUT);
42 unsigned tmp;
43
44 tmp = readl(gpio_out) & ~(1 << gpio);
45 if (value)
46 tmp |= 1 << gpio;
47 writel(tmp, gpio_out);
48}
49
50static inline int gpio_direction_input(unsigned gpio)
51{
52 void __iomem *gpio_dir =
53 (void __iomem *)KSEG1ADDR(AR7_REGS_GPIO + AR7_GPIO_DIR);
54
55 if (gpio >= AR7_GPIO_MAX)
56 return -EINVAL;
57
58 writel(readl(gpio_dir) | (1 << gpio), gpio_dir);
59
60 return 0;
61}
62
63static inline int gpio_direction_output(unsigned gpio, int value)
64{
65 void __iomem *gpio_dir =
66 (void __iomem *)KSEG1ADDR(AR7_REGS_GPIO + AR7_GPIO_DIR);
67
68 if (gpio >= AR7_GPIO_MAX)
69 return -EINVAL;
70
71 gpio_set_value(gpio, value);
72 writel(readl(gpio_dir) & ~(1 << gpio), gpio_dir);
73
74 return 0;
75}
76
77static inline int gpio_to_irq(unsigned gpio)
78{
79 return -EINVAL;
80}
81
82static inline int irq_to_gpio(unsigned irq)
83{
84 return -EINVAL;
85}
86 33
87/* Board specific GPIO functions */ 34/* Board specific GPIO functions */
88static inline int ar7_gpio_enable(unsigned gpio) 35int ar7_gpio_enable(unsigned gpio);
89{ 36int ar7_gpio_disable(unsigned gpio);
90 void __iomem *gpio_en =
91 (void __iomem *)KSEG1ADDR(AR7_REGS_GPIO + AR7_GPIO_ENABLE);
92
93 writel(readl(gpio_en) | (1 << gpio), gpio_en);
94
95 return 0;
96}
97
98static inline int ar7_gpio_disable(unsigned gpio)
99{
100 void __iomem *gpio_en =
101 (void __iomem *)KSEG1ADDR(AR7_REGS_GPIO + AR7_GPIO_ENABLE);
102
103 writel(readl(gpio_en) & ~(1 << gpio), gpio_en);
104
105 return 0;
106}
107 37
108#include <asm-generic/gpio.h> 38#include <asm-generic/gpio.h>
109 39
diff --git a/arch/mips/include/asm/mach-au1x00/au1000.h b/arch/mips/include/asm/mach-au1x00/au1000.h
index 854e95f1b07c..ae07423e6e82 100644
--- a/arch/mips/include/asm/mach-au1x00/au1000.h
+++ b/arch/mips/include/asm/mach-au1x00/au1000.h
@@ -130,6 +130,56 @@ static inline int au1xxx_cpu_needs_config_od(void)
130 return 0; 130 return 0;
131} 131}
132 132
133#define ALCHEMY_CPU_UNKNOWN -1
134#define ALCHEMY_CPU_AU1000 0
135#define ALCHEMY_CPU_AU1500 1
136#define ALCHEMY_CPU_AU1100 2
137#define ALCHEMY_CPU_AU1550 3
138#define ALCHEMY_CPU_AU1200 4
139
140static inline int alchemy_get_cputype(void)
141{
142 switch (read_c0_prid() & 0xffff0000) {
143 case 0x00030000:
144 return ALCHEMY_CPU_AU1000;
145 break;
146 case 0x01030000:
147 return ALCHEMY_CPU_AU1500;
148 break;
149 case 0x02030000:
150 return ALCHEMY_CPU_AU1100;
151 break;
152 case 0x03030000:
153 return ALCHEMY_CPU_AU1550;
154 break;
155 case 0x04030000:
156 case 0x05030000:
157 return ALCHEMY_CPU_AU1200;
158 break;
159 }
160
161 return ALCHEMY_CPU_UNKNOWN;
162}
163
164static inline void alchemy_uart_putchar(u32 uart_phys, u8 c)
165{
166 void __iomem *base = (void __iomem *)KSEG1ADDR(uart_phys);
167 int timeout, i;
168
169 /* check LSR TX_EMPTY bit */
170 timeout = 0xffffff;
171 do {
172 if (__raw_readl(base + 0x1c) & 0x20)
173 break;
174 /* slow down */
175 for (i = 10000; i; i--)
176 asm volatile ("nop");
177 } while (--timeout);
178
179 __raw_writel(c, base + 0x04); /* tx */
180 wmb();
181}
182
133/* arch/mips/au1000/common/clocks.c */ 183/* arch/mips/au1000/common/clocks.c */
134extern void set_au1x00_speed(unsigned int new_freq); 184extern void set_au1x00_speed(unsigned int new_freq);
135extern unsigned int get_au1x00_speed(void); 185extern unsigned int get_au1x00_speed(void);
@@ -143,20 +193,332 @@ void au_sleep(void);
143void save_au1xxx_intctl(void); 193void save_au1xxx_intctl(void);
144void restore_au1xxx_intctl(void); 194void restore_au1xxx_intctl(void);
145 195
146/* 196
147 * Every board describes its IRQ mapping with this table. 197/* SOC Interrupt numbers */
148 */ 198
149struct au1xxx_irqmap { 199#define AU1000_INTC0_INT_BASE (MIPS_CPU_IRQ_BASE + 8)
150 int im_irq; 200#define AU1000_INTC0_INT_LAST (AU1000_INTC0_INT_BASE + 31)
151 int im_type; 201#define AU1000_INTC1_INT_BASE (AU1000_INTC0_INT_LAST + 1)
152 int im_request; 202#define AU1000_INTC1_INT_LAST (AU1000_INTC1_INT_BASE + 31)
203#define AU1000_MAX_INTR AU1000_INTC1_INT_LAST
204
205enum soc_au1000_ints {
206 AU1000_FIRST_INT = AU1000_INTC0_INT_BASE,
207 AU1000_UART0_INT = AU1000_FIRST_INT,
208 AU1000_UART1_INT,
209 AU1000_UART2_INT,
210 AU1000_UART3_INT,
211 AU1000_SSI0_INT,
212 AU1000_SSI1_INT,
213 AU1000_DMA_INT_BASE,
214
215 AU1000_TOY_INT = AU1000_FIRST_INT + 14,
216 AU1000_TOY_MATCH0_INT,
217 AU1000_TOY_MATCH1_INT,
218 AU1000_TOY_MATCH2_INT,
219 AU1000_RTC_INT,
220 AU1000_RTC_MATCH0_INT,
221 AU1000_RTC_MATCH1_INT,
222 AU1000_RTC_MATCH2_INT,
223 AU1000_IRDA_TX_INT,
224 AU1000_IRDA_RX_INT,
225 AU1000_USB_DEV_REQ_INT,
226 AU1000_USB_DEV_SUS_INT,
227 AU1000_USB_HOST_INT,
228 AU1000_ACSYNC_INT,
229 AU1000_MAC0_DMA_INT,
230 AU1000_MAC1_DMA_INT,
231 AU1000_I2S_UO_INT,
232 AU1000_AC97C_INT,
233 AU1000_GPIO0_INT,
234 AU1000_GPIO1_INT,
235 AU1000_GPIO2_INT,
236 AU1000_GPIO3_INT,
237 AU1000_GPIO4_INT,
238 AU1000_GPIO5_INT,
239 AU1000_GPIO6_INT,
240 AU1000_GPIO7_INT,
241 AU1000_GPIO8_INT,
242 AU1000_GPIO9_INT,
243 AU1000_GPIO10_INT,
244 AU1000_GPIO11_INT,
245 AU1000_GPIO12_INT,
246 AU1000_GPIO13_INT,
247 AU1000_GPIO14_INT,
248 AU1000_GPIO15_INT,
249 AU1000_GPIO16_INT,
250 AU1000_GPIO17_INT,
251 AU1000_GPIO18_INT,
252 AU1000_GPIO19_INT,
253 AU1000_GPIO20_INT,
254 AU1000_GPIO21_INT,
255 AU1000_GPIO22_INT,
256 AU1000_GPIO23_INT,
257 AU1000_GPIO24_INT,
258 AU1000_GPIO25_INT,
259 AU1000_GPIO26_INT,
260 AU1000_GPIO27_INT,
261 AU1000_GPIO28_INT,
262 AU1000_GPIO29_INT,
263 AU1000_GPIO30_INT,
264 AU1000_GPIO31_INT,
153}; 265};
154 266
155/* core calls this function to let boards initialize other IRQ sources */ 267enum soc_au1100_ints {
156void board_init_irq(void); 268 AU1100_FIRST_INT = AU1000_INTC0_INT_BASE,
269 AU1100_UART0_INT = AU1100_FIRST_INT,
270 AU1100_UART1_INT,
271 AU1100_SD_INT,
272 AU1100_UART3_INT,
273 AU1100_SSI0_INT,
274 AU1100_SSI1_INT,
275 AU1100_DMA_INT_BASE,
276
277 AU1100_TOY_INT = AU1100_FIRST_INT + 14,
278 AU1100_TOY_MATCH0_INT,
279 AU1100_TOY_MATCH1_INT,
280 AU1100_TOY_MATCH2_INT,
281 AU1100_RTC_INT,
282 AU1100_RTC_MATCH0_INT,
283 AU1100_RTC_MATCH1_INT,
284 AU1100_RTC_MATCH2_INT,
285 AU1100_IRDA_TX_INT,
286 AU1100_IRDA_RX_INT,
287 AU1100_USB_DEV_REQ_INT,
288 AU1100_USB_DEV_SUS_INT,
289 AU1100_USB_HOST_INT,
290 AU1100_ACSYNC_INT,
291 AU1100_MAC0_DMA_INT,
292 AU1100_GPIO208_215_INT,
293 AU1100_LCD_INT,
294 AU1100_AC97C_INT,
295 AU1100_GPIO0_INT,
296 AU1100_GPIO1_INT,
297 AU1100_GPIO2_INT,
298 AU1100_GPIO3_INT,
299 AU1100_GPIO4_INT,
300 AU1100_GPIO5_INT,
301 AU1100_GPIO6_INT,
302 AU1100_GPIO7_INT,
303 AU1100_GPIO8_INT,
304 AU1100_GPIO9_INT,
305 AU1100_GPIO10_INT,
306 AU1100_GPIO11_INT,
307 AU1100_GPIO12_INT,
308 AU1100_GPIO13_INT,
309 AU1100_GPIO14_INT,
310 AU1100_GPIO15_INT,
311 AU1100_GPIO16_INT,
312 AU1100_GPIO17_INT,
313 AU1100_GPIO18_INT,
314 AU1100_GPIO19_INT,
315 AU1100_GPIO20_INT,
316 AU1100_GPIO21_INT,
317 AU1100_GPIO22_INT,
318 AU1100_GPIO23_INT,
319 AU1100_GPIO24_INT,
320 AU1100_GPIO25_INT,
321 AU1100_GPIO26_INT,
322 AU1100_GPIO27_INT,
323 AU1100_GPIO28_INT,
324 AU1100_GPIO29_INT,
325 AU1100_GPIO30_INT,
326 AU1100_GPIO31_INT,
327};
157 328
158/* boards call this to register additional (GPIO) interrupts */ 329enum soc_au1500_ints {
159void au1xxx_setup_irqmap(struct au1xxx_irqmap *map, int count); 330 AU1500_FIRST_INT = AU1000_INTC0_INT_BASE,
331 AU1500_UART0_INT = AU1500_FIRST_INT,
332 AU1500_PCI_INTA,
333 AU1500_PCI_INTB,
334 AU1500_UART3_INT,
335 AU1500_PCI_INTC,
336 AU1500_PCI_INTD,
337 AU1500_DMA_INT_BASE,
338
339 AU1500_TOY_INT = AU1500_FIRST_INT + 14,
340 AU1500_TOY_MATCH0_INT,
341 AU1500_TOY_MATCH1_INT,
342 AU1500_TOY_MATCH2_INT,
343 AU1500_RTC_INT,
344 AU1500_RTC_MATCH0_INT,
345 AU1500_RTC_MATCH1_INT,
346 AU1500_RTC_MATCH2_INT,
347 AU1500_PCI_ERR_INT,
348 AU1500_RESERVED_INT,
349 AU1500_USB_DEV_REQ_INT,
350 AU1500_USB_DEV_SUS_INT,
351 AU1500_USB_HOST_INT,
352 AU1500_ACSYNC_INT,
353 AU1500_MAC0_DMA_INT,
354 AU1500_MAC1_DMA_INT,
355 AU1500_AC97C_INT = AU1500_FIRST_INT + 31,
356 AU1500_GPIO0_INT,
357 AU1500_GPIO1_INT,
358 AU1500_GPIO2_INT,
359 AU1500_GPIO3_INT,
360 AU1500_GPIO4_INT,
361 AU1500_GPIO5_INT,
362 AU1500_GPIO6_INT,
363 AU1500_GPIO7_INT,
364 AU1500_GPIO8_INT,
365 AU1500_GPIO9_INT,
366 AU1500_GPIO10_INT,
367 AU1500_GPIO11_INT,
368 AU1500_GPIO12_INT,
369 AU1500_GPIO13_INT,
370 AU1500_GPIO14_INT,
371 AU1500_GPIO15_INT,
372 AU1500_GPIO200_INT,
373 AU1500_GPIO201_INT,
374 AU1500_GPIO202_INT,
375 AU1500_GPIO203_INT,
376 AU1500_GPIO20_INT,
377 AU1500_GPIO204_INT,
378 AU1500_GPIO205_INT,
379 AU1500_GPIO23_INT,
380 AU1500_GPIO24_INT,
381 AU1500_GPIO25_INT,
382 AU1500_GPIO26_INT,
383 AU1500_GPIO27_INT,
384 AU1500_GPIO28_INT,
385 AU1500_GPIO206_INT,
386 AU1500_GPIO207_INT,
387 AU1500_GPIO208_215_INT,
388};
389
390enum soc_au1550_ints {
391 AU1550_FIRST_INT = AU1000_INTC0_INT_BASE,
392 AU1550_UART0_INT = AU1550_FIRST_INT,
393 AU1550_PCI_INTA,
394 AU1550_PCI_INTB,
395 AU1550_DDMA_INT,
396 AU1550_CRYPTO_INT,
397 AU1550_PCI_INTC,
398 AU1550_PCI_INTD,
399 AU1550_PCI_RST_INT,
400 AU1550_UART1_INT,
401 AU1550_UART3_INT,
402 AU1550_PSC0_INT,
403 AU1550_PSC1_INT,
404 AU1550_PSC2_INT,
405 AU1550_PSC3_INT,
406 AU1550_TOY_INT,
407 AU1550_TOY_MATCH0_INT,
408 AU1550_TOY_MATCH1_INT,
409 AU1550_TOY_MATCH2_INT,
410 AU1550_RTC_INT,
411 AU1550_RTC_MATCH0_INT,
412 AU1550_RTC_MATCH1_INT,
413 AU1550_RTC_MATCH2_INT,
414
415 AU1550_NAND_INT = AU1550_FIRST_INT + 23,
416 AU1550_USB_DEV_REQ_INT,
417 AU1550_USB_DEV_SUS_INT,
418 AU1550_USB_HOST_INT,
419 AU1550_MAC0_DMA_INT,
420 AU1550_MAC1_DMA_INT,
421 AU1550_GPIO0_INT = AU1550_FIRST_INT + 32,
422 AU1550_GPIO1_INT,
423 AU1550_GPIO2_INT,
424 AU1550_GPIO3_INT,
425 AU1550_GPIO4_INT,
426 AU1550_GPIO5_INT,
427 AU1550_GPIO6_INT,
428 AU1550_GPIO7_INT,
429 AU1550_GPIO8_INT,
430 AU1550_GPIO9_INT,
431 AU1550_GPIO10_INT,
432 AU1550_GPIO11_INT,
433 AU1550_GPIO12_INT,
434 AU1550_GPIO13_INT,
435 AU1550_GPIO14_INT,
436 AU1550_GPIO15_INT,
437 AU1550_GPIO200_INT,
438 AU1550_GPIO201_205_INT, /* Logical or of GPIO201:205 */
439 AU1550_GPIO16_INT,
440 AU1550_GPIO17_INT,
441 AU1550_GPIO20_INT,
442 AU1550_GPIO21_INT,
443 AU1550_GPIO22_INT,
444 AU1550_GPIO23_INT,
445 AU1550_GPIO24_INT,
446 AU1550_GPIO25_INT,
447 AU1550_GPIO26_INT,
448 AU1550_GPIO27_INT,
449 AU1550_GPIO28_INT,
450 AU1550_GPIO206_INT,
451 AU1550_GPIO207_INT,
452 AU1550_GPIO208_215_INT, /* Logical or of GPIO208:215 */
453};
454
455enum soc_au1200_ints {
456 AU1200_FIRST_INT = AU1000_INTC0_INT_BASE,
457 AU1200_UART0_INT = AU1200_FIRST_INT,
458 AU1200_SWT_INT,
459 AU1200_SD_INT,
460 AU1200_DDMA_INT,
461 AU1200_MAE_BE_INT,
462 AU1200_GPIO200_INT,
463 AU1200_GPIO201_INT,
464 AU1200_GPIO202_INT,
465 AU1200_UART1_INT,
466 AU1200_MAE_FE_INT,
467 AU1200_PSC0_INT,
468 AU1200_PSC1_INT,
469 AU1200_AES_INT,
470 AU1200_CAMERA_INT,
471 AU1200_TOY_INT,
472 AU1200_TOY_MATCH0_INT,
473 AU1200_TOY_MATCH1_INT,
474 AU1200_TOY_MATCH2_INT,
475 AU1200_RTC_INT,
476 AU1200_RTC_MATCH0_INT,
477 AU1200_RTC_MATCH1_INT,
478 AU1200_RTC_MATCH2_INT,
479 AU1200_GPIO203_INT,
480 AU1200_NAND_INT,
481 AU1200_GPIO204_INT,
482 AU1200_GPIO205_INT,
483 AU1200_GPIO206_INT,
484 AU1200_GPIO207_INT,
485 AU1200_GPIO208_215_INT, /* Logical OR of 208:215 */
486 AU1200_USB_INT,
487 AU1200_LCD_INT,
488 AU1200_MAE_BOTH_INT,
489 AU1200_GPIO0_INT,
490 AU1200_GPIO1_INT,
491 AU1200_GPIO2_INT,
492 AU1200_GPIO3_INT,
493 AU1200_GPIO4_INT,
494 AU1200_GPIO5_INT,
495 AU1200_GPIO6_INT,
496 AU1200_GPIO7_INT,
497 AU1200_GPIO8_INT,
498 AU1200_GPIO9_INT,
499 AU1200_GPIO10_INT,
500 AU1200_GPIO11_INT,
501 AU1200_GPIO12_INT,
502 AU1200_GPIO13_INT,
503 AU1200_GPIO14_INT,
504 AU1200_GPIO15_INT,
505 AU1200_GPIO16_INT,
506 AU1200_GPIO17_INT,
507 AU1200_GPIO18_INT,
508 AU1200_GPIO19_INT,
509 AU1200_GPIO20_INT,
510 AU1200_GPIO21_INT,
511 AU1200_GPIO22_INT,
512 AU1200_GPIO23_INT,
513 AU1200_GPIO24_INT,
514 AU1200_GPIO25_INT,
515 AU1200_GPIO26_INT,
516 AU1200_GPIO27_INT,
517 AU1200_GPIO28_INT,
518 AU1200_GPIO29_INT,
519 AU1200_GPIO30_INT,
520 AU1200_GPIO31_INT,
521};
160 522
161#endif /* !defined (_LANGUAGE_ASSEMBLY) */ 523#endif /* !defined (_LANGUAGE_ASSEMBLY) */
162 524
@@ -549,78 +911,16 @@ void au1xxx_setup_irqmap(struct au1xxx_irqmap *map, int count);
549 911
550#define IC1_TESTBIT 0xB1800080 912#define IC1_TESTBIT 0xB1800080
551 913
552/* Interrupt Numbers */ 914
553/* Au1000 */ 915/* Au1000 */
554#ifdef CONFIG_SOC_AU1000 916#ifdef CONFIG_SOC_AU1000
555enum soc_au1000_ints {
556 AU1000_FIRST_INT = MIPS_CPU_IRQ_BASE + 8,
557 AU1000_UART0_INT = AU1000_FIRST_INT,
558 AU1000_UART1_INT, /* au1000 */
559 AU1000_UART2_INT, /* au1000 */
560 AU1000_UART3_INT,
561 AU1000_SSI0_INT, /* au1000 */
562 AU1000_SSI1_INT, /* au1000 */
563 AU1000_DMA_INT_BASE,
564
565 AU1000_TOY_INT = AU1000_FIRST_INT + 14,
566 AU1000_TOY_MATCH0_INT,
567 AU1000_TOY_MATCH1_INT,
568 AU1000_TOY_MATCH2_INT,
569 AU1000_RTC_INT,
570 AU1000_RTC_MATCH0_INT,
571 AU1000_RTC_MATCH1_INT,
572 AU1000_RTC_MATCH2_INT,
573 AU1000_IRDA_TX_INT, /* au1000 */
574 AU1000_IRDA_RX_INT, /* au1000 */
575 AU1000_USB_DEV_REQ_INT,
576 AU1000_USB_DEV_SUS_INT,
577 AU1000_USB_HOST_INT,
578 AU1000_ACSYNC_INT,
579 AU1000_MAC0_DMA_INT,
580 AU1000_MAC1_DMA_INT,
581 AU1000_I2S_UO_INT, /* au1000 */
582 AU1000_AC97C_INT,
583 AU1000_GPIO_0,
584 AU1000_GPIO_1,
585 AU1000_GPIO_2,
586 AU1000_GPIO_3,
587 AU1000_GPIO_4,
588 AU1000_GPIO_5,
589 AU1000_GPIO_6,
590 AU1000_GPIO_7,
591 AU1000_GPIO_8,
592 AU1000_GPIO_9,
593 AU1000_GPIO_10,
594 AU1000_GPIO_11,
595 AU1000_GPIO_12,
596 AU1000_GPIO_13,
597 AU1000_GPIO_14,
598 AU1000_GPIO_15,
599 AU1000_GPIO_16,
600 AU1000_GPIO_17,
601 AU1000_GPIO_18,
602 AU1000_GPIO_19,
603 AU1000_GPIO_20,
604 AU1000_GPIO_21,
605 AU1000_GPIO_22,
606 AU1000_GPIO_23,
607 AU1000_GPIO_24,
608 AU1000_GPIO_25,
609 AU1000_GPIO_26,
610 AU1000_GPIO_27,
611 AU1000_GPIO_28,
612 AU1000_GPIO_29,
613 AU1000_GPIO_30,
614 AU1000_GPIO_31,
615};
616 917
617#define UART0_ADDR 0xB1100000 918#define UART0_ADDR 0xB1100000
618#define UART1_ADDR 0xB1200000
619#define UART2_ADDR 0xB1300000
620#define UART3_ADDR 0xB1400000 919#define UART3_ADDR 0xB1400000
621 920
622#define USB_OHCI_BASE 0x10100000 /* phys addr for ioremap */ 921#define USB_OHCI_BASE 0x10100000 /* phys addr for ioremap */
623#define USB_HOST_CONFIG 0xB017FFFC 922#define USB_HOST_CONFIG 0xB017FFFC
923#define FOR_PLATFORM_C_USB_HOST_INT AU1000_USB_HOST_INT
624 924
625#define AU1000_ETH0_BASE 0xB0500000 925#define AU1000_ETH0_BASE 0xB0500000
626#define AU1000_ETH1_BASE 0xB0510000 926#define AU1000_ETH1_BASE 0xB0510000
@@ -631,78 +931,13 @@ enum soc_au1000_ints {
631 931
632/* Au1500 */ 932/* Au1500 */
633#ifdef CONFIG_SOC_AU1500 933#ifdef CONFIG_SOC_AU1500
634enum soc_au1500_ints {
635 AU1500_FIRST_INT = MIPS_CPU_IRQ_BASE + 8,
636 AU1500_UART0_INT = AU1500_FIRST_INT,
637 AU1000_PCI_INTA, /* au1500 */
638 AU1000_PCI_INTB, /* au1500 */
639 AU1500_UART3_INT,
640 AU1000_PCI_INTC, /* au1500 */
641 AU1000_PCI_INTD, /* au1500 */
642 AU1000_DMA_INT_BASE,
643
644 AU1000_TOY_INT = AU1500_FIRST_INT + 14,
645 AU1000_TOY_MATCH0_INT,
646 AU1000_TOY_MATCH1_INT,
647 AU1000_TOY_MATCH2_INT,
648 AU1000_RTC_INT,
649 AU1000_RTC_MATCH0_INT,
650 AU1000_RTC_MATCH1_INT,
651 AU1000_RTC_MATCH2_INT,
652 AU1500_PCI_ERR_INT,
653 AU1500_RESERVED_INT,
654 AU1000_USB_DEV_REQ_INT,
655 AU1000_USB_DEV_SUS_INT,
656 AU1000_USB_HOST_INT,
657 AU1000_ACSYNC_INT,
658 AU1500_MAC0_DMA_INT,
659 AU1500_MAC1_DMA_INT,
660 AU1000_AC97C_INT = AU1500_FIRST_INT + 31,
661 AU1000_GPIO_0,
662 AU1000_GPIO_1,
663 AU1000_GPIO_2,
664 AU1000_GPIO_3,
665 AU1000_GPIO_4,
666 AU1000_GPIO_5,
667 AU1000_GPIO_6,
668 AU1000_GPIO_7,
669 AU1000_GPIO_8,
670 AU1000_GPIO_9,
671 AU1000_GPIO_10,
672 AU1000_GPIO_11,
673 AU1000_GPIO_12,
674 AU1000_GPIO_13,
675 AU1000_GPIO_14,
676 AU1000_GPIO_15,
677 AU1500_GPIO_200,
678 AU1500_GPIO_201,
679 AU1500_GPIO_202,
680 AU1500_GPIO_203,
681 AU1500_GPIO_20,
682 AU1500_GPIO_204,
683 AU1500_GPIO_205,
684 AU1500_GPIO_23,
685 AU1500_GPIO_24,
686 AU1500_GPIO_25,
687 AU1500_GPIO_26,
688 AU1500_GPIO_27,
689 AU1500_GPIO_28,
690 AU1500_GPIO_206,
691 AU1500_GPIO_207,
692 AU1500_GPIO_208_215,
693};
694
695/* shortcuts */
696#define INTA AU1000_PCI_INTA
697#define INTB AU1000_PCI_INTB
698#define INTC AU1000_PCI_INTC
699#define INTD AU1000_PCI_INTD
700 934
701#define UART0_ADDR 0xB1100000 935#define UART0_ADDR 0xB1100000
702#define UART3_ADDR 0xB1400000 936#define UART3_ADDR 0xB1400000
703 937
704#define USB_OHCI_BASE 0x10100000 /* phys addr for ioremap */ 938#define USB_OHCI_BASE 0x10100000 /* phys addr for ioremap */
705#define USB_HOST_CONFIG 0xB017fffc 939#define USB_HOST_CONFIG 0xB017fffc
940#define FOR_PLATFORM_C_USB_HOST_INT AU1500_USB_HOST_INT
706 941
707#define AU1500_ETH0_BASE 0xB1500000 942#define AU1500_ETH0_BASE 0xB1500000
708#define AU1500_ETH1_BASE 0xB1510000 943#define AU1500_ETH1_BASE 0xB1510000
@@ -713,74 +948,13 @@ enum soc_au1500_ints {
713 948
714/* Au1100 */ 949/* Au1100 */
715#ifdef CONFIG_SOC_AU1100 950#ifdef CONFIG_SOC_AU1100
716enum soc_au1100_ints {
717 AU1100_FIRST_INT = MIPS_CPU_IRQ_BASE + 8,
718 AU1100_UART0_INT = AU1100_FIRST_INT,
719 AU1100_UART1_INT,
720 AU1100_SD_INT,
721 AU1100_UART3_INT,
722 AU1000_SSI0_INT,
723 AU1000_SSI1_INT,
724 AU1000_DMA_INT_BASE,
725
726 AU1000_TOY_INT = AU1100_FIRST_INT + 14,
727 AU1000_TOY_MATCH0_INT,
728 AU1000_TOY_MATCH1_INT,
729 AU1000_TOY_MATCH2_INT,
730 AU1000_RTC_INT,
731 AU1000_RTC_MATCH0_INT,
732 AU1000_RTC_MATCH1_INT,
733 AU1000_RTC_MATCH2_INT,
734 AU1000_IRDA_TX_INT,
735 AU1000_IRDA_RX_INT,
736 AU1000_USB_DEV_REQ_INT,
737 AU1000_USB_DEV_SUS_INT,
738 AU1000_USB_HOST_INT,
739 AU1000_ACSYNC_INT,
740 AU1100_MAC0_DMA_INT,
741 AU1100_GPIO_208_215,
742 AU1100_LCD_INT,
743 AU1000_AC97C_INT,
744 AU1000_GPIO_0,
745 AU1000_GPIO_1,
746 AU1000_GPIO_2,
747 AU1000_GPIO_3,
748 AU1000_GPIO_4,
749 AU1000_GPIO_5,
750 AU1000_GPIO_6,
751 AU1000_GPIO_7,
752 AU1000_GPIO_8,
753 AU1000_GPIO_9,
754 AU1000_GPIO_10,
755 AU1000_GPIO_11,
756 AU1000_GPIO_12,
757 AU1000_GPIO_13,
758 AU1000_GPIO_14,
759 AU1000_GPIO_15,
760 AU1000_GPIO_16,
761 AU1000_GPIO_17,
762 AU1000_GPIO_18,
763 AU1000_GPIO_19,
764 AU1000_GPIO_20,
765 AU1000_GPIO_21,
766 AU1000_GPIO_22,
767 AU1000_GPIO_23,
768 AU1000_GPIO_24,
769 AU1000_GPIO_25,
770 AU1000_GPIO_26,
771 AU1000_GPIO_27,
772 AU1000_GPIO_28,
773 AU1000_GPIO_29,
774 AU1000_GPIO_30,
775 AU1000_GPIO_31,
776};
777 951
778#define UART0_ADDR 0xB1100000 952#define UART0_ADDR 0xB1100000
779#define UART1_ADDR 0xB1200000
780#define UART3_ADDR 0xB1400000 953#define UART3_ADDR 0xB1400000
781 954
782#define USB_OHCI_BASE 0x10100000 /* phys addr for ioremap */ 955#define USB_OHCI_BASE 0x10100000 /* phys addr for ioremap */
783#define USB_HOST_CONFIG 0xB017FFFC 956#define USB_HOST_CONFIG 0xB017FFFC
957#define FOR_PLATFORM_C_USB_HOST_INT AU1100_USB_HOST_INT
784 958
785#define AU1100_ETH0_BASE 0xB0500000 959#define AU1100_ETH0_BASE 0xB0500000
786#define AU1100_MAC0_ENABLE 0xB0520000 960#define AU1100_MAC0_ENABLE 0xB0520000
@@ -788,87 +962,12 @@ enum soc_au1100_ints {
788#endif /* CONFIG_SOC_AU1100 */ 962#endif /* CONFIG_SOC_AU1100 */
789 963
790#ifdef CONFIG_SOC_AU1550 964#ifdef CONFIG_SOC_AU1550
791enum soc_au1550_ints {
792 AU1550_FIRST_INT = MIPS_CPU_IRQ_BASE + 8,
793 AU1550_UART0_INT = AU1550_FIRST_INT,
794 AU1550_PCI_INTA,
795 AU1550_PCI_INTB,
796 AU1550_DDMA_INT,
797 AU1550_CRYPTO_INT,
798 AU1550_PCI_INTC,
799 AU1550_PCI_INTD,
800 AU1550_PCI_RST_INT,
801 AU1550_UART1_INT,
802 AU1550_UART3_INT,
803 AU1550_PSC0_INT,
804 AU1550_PSC1_INT,
805 AU1550_PSC2_INT,
806 AU1550_PSC3_INT,
807 AU1000_TOY_INT,
808 AU1000_TOY_MATCH0_INT,
809 AU1000_TOY_MATCH1_INT,
810 AU1000_TOY_MATCH2_INT,
811 AU1000_RTC_INT,
812 AU1000_RTC_MATCH0_INT,
813 AU1000_RTC_MATCH1_INT,
814 AU1000_RTC_MATCH2_INT,
815
816 AU1550_NAND_INT = AU1550_FIRST_INT + 23,
817 AU1550_USB_DEV_REQ_INT,
818 AU1000_USB_DEV_REQ_INT = AU1550_USB_DEV_REQ_INT,
819 AU1550_USB_DEV_SUS_INT,
820 AU1000_USB_DEV_SUS_INT = AU1550_USB_DEV_SUS_INT,
821 AU1550_USB_HOST_INT,
822 AU1000_USB_HOST_INT = AU1550_USB_HOST_INT,
823 AU1550_MAC0_DMA_INT,
824 AU1550_MAC1_DMA_INT,
825 AU1000_GPIO_0 = AU1550_FIRST_INT + 32,
826 AU1000_GPIO_1,
827 AU1000_GPIO_2,
828 AU1000_GPIO_3,
829 AU1000_GPIO_4,
830 AU1000_GPIO_5,
831 AU1000_GPIO_6,
832 AU1000_GPIO_7,
833 AU1000_GPIO_8,
834 AU1000_GPIO_9,
835 AU1000_GPIO_10,
836 AU1000_GPIO_11,
837 AU1000_GPIO_12,
838 AU1000_GPIO_13,
839 AU1000_GPIO_14,
840 AU1000_GPIO_15,
841 AU1550_GPIO_200,
842 AU1500_GPIO_201_205, /* Logical or of GPIO201:205 */
843 AU1500_GPIO_16,
844 AU1500_GPIO_17,
845 AU1500_GPIO_20,
846 AU1500_GPIO_21,
847 AU1500_GPIO_22,
848 AU1500_GPIO_23,
849 AU1500_GPIO_24,
850 AU1500_GPIO_25,
851 AU1500_GPIO_26,
852 AU1500_GPIO_27,
853 AU1500_GPIO_28,
854 AU1500_GPIO_206,
855 AU1500_GPIO_207,
856 AU1500_GPIO_208_218, /* Logical or of GPIO208:218 */
857};
858
859/* shortcuts */
860#define INTA AU1550_PCI_INTA
861#define INTB AU1550_PCI_INTB
862#define INTC AU1550_PCI_INTC
863#define INTD AU1550_PCI_INTD
864
865#define UART0_ADDR 0xB1100000 965#define UART0_ADDR 0xB1100000
866#define UART1_ADDR 0xB1200000
867#define UART3_ADDR 0xB1400000
868 966
869#define USB_OHCI_BASE 0x14020000 /* phys addr for ioremap */ 967#define USB_OHCI_BASE 0x14020000 /* phys addr for ioremap */
870#define USB_OHCI_LEN 0x00060000 968#define USB_OHCI_LEN 0x00060000
871#define USB_HOST_CONFIG 0xB4027ffc 969#define USB_HOST_CONFIG 0xB4027ffc
970#define FOR_PLATFORM_C_USB_HOST_INT AU1550_USB_HOST_INT
872 971
873#define AU1550_ETH0_BASE 0xB0500000 972#define AU1550_ETH0_BASE 0xB0500000
874#define AU1550_ETH1_BASE 0xB0510000 973#define AU1550_ETH1_BASE 0xB0510000
@@ -877,78 +976,10 @@ enum soc_au1550_ints {
877#define NUM_ETH_INTERFACES 2 976#define NUM_ETH_INTERFACES 2
878#endif /* CONFIG_SOC_AU1550 */ 977#endif /* CONFIG_SOC_AU1550 */
879 978
979
880#ifdef CONFIG_SOC_AU1200 980#ifdef CONFIG_SOC_AU1200
881enum soc_au1200_ints {
882 AU1200_FIRST_INT = MIPS_CPU_IRQ_BASE + 8,
883 AU1200_UART0_INT = AU1200_FIRST_INT,
884 AU1200_SWT_INT,
885 AU1200_SD_INT,
886 AU1200_DDMA_INT,
887 AU1200_MAE_BE_INT,
888 AU1200_GPIO_200,
889 AU1200_GPIO_201,
890 AU1200_GPIO_202,
891 AU1200_UART1_INT,
892 AU1200_MAE_FE_INT,
893 AU1200_PSC0_INT,
894 AU1200_PSC1_INT,
895 AU1200_AES_INT,
896 AU1200_CAMERA_INT,
897 AU1000_TOY_INT,
898 AU1000_TOY_MATCH0_INT,
899 AU1000_TOY_MATCH1_INT,
900 AU1000_TOY_MATCH2_INT,
901 AU1000_RTC_INT,
902 AU1000_RTC_MATCH0_INT,
903 AU1000_RTC_MATCH1_INT,
904 AU1000_RTC_MATCH2_INT,
905 AU1200_GPIO_203,
906 AU1200_NAND_INT,
907 AU1200_GPIO_204,
908 AU1200_GPIO_205,
909 AU1200_GPIO_206,
910 AU1200_GPIO_207,
911 AU1200_GPIO_208_215, /* Logical OR of 208:215 */
912 AU1200_USB_INT,
913 AU1000_USB_HOST_INT = AU1200_USB_INT,
914 AU1200_LCD_INT,
915 AU1200_MAE_BOTH_INT,
916 AU1000_GPIO_0,
917 AU1000_GPIO_1,
918 AU1000_GPIO_2,
919 AU1000_GPIO_3,
920 AU1000_GPIO_4,
921 AU1000_GPIO_5,
922 AU1000_GPIO_6,
923 AU1000_GPIO_7,
924 AU1000_GPIO_8,
925 AU1000_GPIO_9,
926 AU1000_GPIO_10,
927 AU1000_GPIO_11,
928 AU1000_GPIO_12,
929 AU1000_GPIO_13,
930 AU1000_GPIO_14,
931 AU1000_GPIO_15,
932 AU1000_GPIO_16,
933 AU1000_GPIO_17,
934 AU1000_GPIO_18,
935 AU1000_GPIO_19,
936 AU1000_GPIO_20,
937 AU1000_GPIO_21,
938 AU1000_GPIO_22,
939 AU1000_GPIO_23,
940 AU1000_GPIO_24,
941 AU1000_GPIO_25,
942 AU1000_GPIO_26,
943 AU1000_GPIO_27,
944 AU1000_GPIO_28,
945 AU1000_GPIO_29,
946 AU1000_GPIO_30,
947 AU1000_GPIO_31,
948};
949 981
950#define UART0_ADDR 0xB1100000 982#define UART0_ADDR 0xB1100000
951#define UART1_ADDR 0xB1200000
952 983
953#define USB_UOC_BASE 0x14020020 984#define USB_UOC_BASE 0x14020020
954#define USB_UOC_LEN 0x20 985#define USB_UOC_LEN 0x20
@@ -974,15 +1005,9 @@ enum soc_au1200_ints {
974#define USBMSRMCFG_RDCOMB 30 1005#define USBMSRMCFG_RDCOMB 30
975#define USBMSRMCFG_PFEN 31 1006#define USBMSRMCFG_PFEN 31
976 1007
977#endif /* CONFIG_SOC_AU1200 */ 1008#define FOR_PLATFORM_C_USB_HOST_INT AU1200_USB_INT
978
979#define AU1000_INTC0_INT_BASE (MIPS_CPU_IRQ_BASE + 8)
980#define AU1000_INTC0_INT_LAST (AU1000_INTC0_INT_BASE + 31)
981#define AU1000_INTC1_INT_BASE (AU1000_INTC0_INT_BASE + 32)
982#define AU1000_INTC1_INT_LAST (AU1000_INTC1_INT_BASE + 31)
983 1009
984#define AU1000_MAX_INTR AU1000_INTC1_INT_LAST 1010#endif /* CONFIG_SOC_AU1200 */
985#define INTX 0xFF /* not valid */
986 1011
987/* Programmable Counters 0 and 1 */ 1012/* Programmable Counters 0 and 1 */
988#define SYS_BASE 0xB1900000 1013#define SYS_BASE 0xB1900000
@@ -1231,14 +1256,6 @@ enum soc_au1200_ints {
1231#define MAC_RX_BUFF3_STATUS 0x30 1256#define MAC_RX_BUFF3_STATUS 0x30
1232#define MAC_RX_BUFF3_ADDR 0x34 1257#define MAC_RX_BUFF3_ADDR 0x34
1233 1258
1234/* UARTS 0-3 */
1235#define UART_BASE UART0_ADDR
1236#ifdef CONFIG_SOC_AU1200
1237#define UART_DEBUG_BASE UART1_ADDR
1238#else
1239#define UART_DEBUG_BASE UART3_ADDR
1240#endif
1241
1242#define UART_RX 0 /* Receive buffer */ 1259#define UART_RX 0 /* Receive buffer */
1243#define UART_TX 4 /* Transmit buffer */ 1260#define UART_TX 4 /* Transmit buffer */
1244#define UART_IER 8 /* Interrupt Enable Register */ 1261#define UART_IER 8 /* Interrupt Enable Register */
@@ -1251,84 +1268,6 @@ enum soc_au1200_ints {
1251#define UART_CLK 0x28 /* Baud Rate Clock Divider */ 1268#define UART_CLK 0x28 /* Baud Rate Clock Divider */
1252#define UART_MOD_CNTRL 0x100 /* Module Control */ 1269#define UART_MOD_CNTRL 0x100 /* Module Control */
1253 1270
1254#define UART_FCR_ENABLE_FIFO 0x01 /* Enable the FIFO */
1255#define UART_FCR_CLEAR_RCVR 0x02 /* Clear the RCVR FIFO */
1256#define UART_FCR_CLEAR_XMIT 0x04 /* Clear the XMIT FIFO */
1257#define UART_FCR_DMA_SELECT 0x08 /* For DMA applications */
1258#define UART_FCR_TRIGGER_MASK 0xF0 /* Mask for the FIFO trigger range */
1259#define UART_FCR_R_TRIGGER_1 0x00 /* Mask for receive trigger set at 1 */
1260#define UART_FCR_R_TRIGGER_4 0x40 /* Mask for receive trigger set at 4 */
1261#define UART_FCR_R_TRIGGER_8 0x80 /* Mask for receive trigger set at 8 */
1262#define UART_FCR_R_TRIGGER_14 0xA0 /* Mask for receive trigger set at 14 */
1263#define UART_FCR_T_TRIGGER_0 0x00 /* Mask for transmit trigger set at 0 */
1264#define UART_FCR_T_TRIGGER_4 0x10 /* Mask for transmit trigger set at 4 */
1265#define UART_FCR_T_TRIGGER_8 0x20 /* Mask for transmit trigger set at 8 */
1266#define UART_FCR_T_TRIGGER_12 0x30 /* Mask for transmit trigger set at 12 */
1267
1268/*
1269 * These are the definitions for the Line Control Register
1270 */
1271#define UART_LCR_SBC 0x40 /* Set break control */
1272#define UART_LCR_SPAR 0x20 /* Stick parity (?) */
1273#define UART_LCR_EPAR 0x10 /* Even parity select */
1274#define UART_LCR_PARITY 0x08 /* Parity Enable */
1275#define UART_LCR_STOP 0x04 /* Stop bits: 0=1 stop bit, 1= 2 stop bits */
1276#define UART_LCR_WLEN5 0x00 /* Wordlength: 5 bits */
1277#define UART_LCR_WLEN6 0x01 /* Wordlength: 6 bits */
1278#define UART_LCR_WLEN7 0x02 /* Wordlength: 7 bits */
1279#define UART_LCR_WLEN8 0x03 /* Wordlength: 8 bits */
1280
1281/*
1282 * These are the definitions for the Line Status Register
1283 */
1284#define UART_LSR_TEMT 0x40 /* Transmitter empty */
1285#define UART_LSR_THRE 0x20 /* Transmit-hold-register empty */
1286#define UART_LSR_BI 0x10 /* Break interrupt indicator */
1287#define UART_LSR_FE 0x08 /* Frame error indicator */
1288#define UART_LSR_PE 0x04 /* Parity error indicator */
1289#define UART_LSR_OE 0x02 /* Overrun error indicator */
1290#define UART_LSR_DR 0x01 /* Receiver data ready */
1291
1292/*
1293 * These are the definitions for the Interrupt Identification Register
1294 */
1295#define UART_IIR_NO_INT 0x01 /* No interrupts pending */
1296#define UART_IIR_ID 0x06 /* Mask for the interrupt ID */
1297#define UART_IIR_MSI 0x00 /* Modem status interrupt */
1298#define UART_IIR_THRI 0x02 /* Transmitter holding register empty */
1299#define UART_IIR_RDI 0x04 /* Receiver data interrupt */
1300#define UART_IIR_RLSI 0x06 /* Receiver line status interrupt */
1301
1302/*
1303 * These are the definitions for the Interrupt Enable Register
1304 */
1305#define UART_IER_MSI 0x08 /* Enable Modem status interrupt */
1306#define UART_IER_RLSI 0x04 /* Enable receiver line status interrupt */
1307#define UART_IER_THRI 0x02 /* Enable Transmitter holding register int. */
1308#define UART_IER_RDI 0x01 /* Enable receiver data interrupt */
1309
1310/*
1311 * These are the definitions for the Modem Control Register
1312 */
1313#define UART_MCR_LOOP 0x10 /* Enable loopback test mode */
1314#define UART_MCR_OUT2 0x08 /* Out2 complement */
1315#define UART_MCR_OUT1 0x04 /* Out1 complement */
1316#define UART_MCR_RTS 0x02 /* RTS complement */
1317#define UART_MCR_DTR 0x01 /* DTR complement */
1318
1319/*
1320 * These are the definitions for the Modem Status Register
1321 */
1322#define UART_MSR_DCD 0x80 /* Data Carrier Detect */
1323#define UART_MSR_RI 0x40 /* Ring Indicator */
1324#define UART_MSR_DSR 0x20 /* Data Set Ready */
1325#define UART_MSR_CTS 0x10 /* Clear to Send */
1326#define UART_MSR_DDCD 0x08 /* Delta DCD */
1327#define UART_MSR_TERI 0x04 /* Trailing edge ring indicator */
1328#define UART_MSR_DDSR 0x02 /* Delta DSR */
1329#define UART_MSR_DCTS 0x01 /* Delta CTS */
1330#define UART_MSR_ANY_DELTA 0x0F /* Any of the delta bits! */
1331
1332/* SSIO */ 1271/* SSIO */
1333#define SSI0_STATUS 0xB1600000 1272#define SSI0_STATUS 0xB1600000
1334# define SSI_STATUS_BF (1 << 4) 1273# define SSI_STATUS_BF (1 << 4)
@@ -1720,7 +1659,7 @@ enum soc_au1200_ints {
1720#define IOPORT_RESOURCE_START 0x00001000 /* skip legacy probing */ 1659#define IOPORT_RESOURCE_START 0x00001000 /* skip legacy probing */
1721#define IOPORT_RESOURCE_END 0xffffffff 1660#define IOPORT_RESOURCE_END 0xffffffff
1722#define IOMEM_RESOURCE_START 0x10000000 1661#define IOMEM_RESOURCE_START 0x10000000
1723#define IOMEM_RESOURCE_END 0xffffffff 1662#define IOMEM_RESOURCE_END 0xfffffffffULL
1724 1663
1725#else /* Au1000 and Au1100 and Au1200 */ 1664#else /* Au1000 and Au1100 and Au1200 */
1726 1665
@@ -1728,7 +1667,7 @@ enum soc_au1200_ints {
1728#define IOPORT_RESOURCE_START 0x10000000 1667#define IOPORT_RESOURCE_START 0x10000000
1729#define IOPORT_RESOURCE_END 0xffffffff 1668#define IOPORT_RESOURCE_END 0xffffffff
1730#define IOMEM_RESOURCE_START 0x10000000 1669#define IOMEM_RESOURCE_START 0x10000000
1731#define IOMEM_RESOURCE_END 0xffffffff 1670#define IOMEM_RESOURCE_END 0xfffffffffULL
1732 1671
1733#define PCI_IO_START 0 1672#define PCI_IO_START 0
1734#define PCI_IO_END 0 1673#define PCI_IO_END 0
@@ -1739,53 +1678,4 @@ enum soc_au1200_ints {
1739 1678
1740#endif 1679#endif
1741 1680
1742#ifndef _LANGUAGE_ASSEMBLY
1743typedef volatile struct {
1744 /* 0x0000 */ u32 toytrim;
1745 /* 0x0004 */ u32 toywrite;
1746 /* 0x0008 */ u32 toymatch0;
1747 /* 0x000C */ u32 toymatch1;
1748 /* 0x0010 */ u32 toymatch2;
1749 /* 0x0014 */ u32 cntrctrl;
1750 /* 0x0018 */ u32 scratch0;
1751 /* 0x001C */ u32 scratch1;
1752 /* 0x0020 */ u32 freqctrl0;
1753 /* 0x0024 */ u32 freqctrl1;
1754 /* 0x0028 */ u32 clksrc;
1755 /* 0x002C */ u32 pinfunc;
1756 /* 0x0030 */ u32 reserved0;
1757 /* 0x0034 */ u32 wakemsk;
1758 /* 0x0038 */ u32 endian;
1759 /* 0x003C */ u32 powerctrl;
1760 /* 0x0040 */ u32 toyread;
1761 /* 0x0044 */ u32 rtctrim;
1762 /* 0x0048 */ u32 rtcwrite;
1763 /* 0x004C */ u32 rtcmatch0;
1764 /* 0x0050 */ u32 rtcmatch1;
1765 /* 0x0054 */ u32 rtcmatch2;
1766 /* 0x0058 */ u32 rtcread;
1767 /* 0x005C */ u32 wakesrc;
1768 /* 0x0060 */ u32 cpupll;
1769 /* 0x0064 */ u32 auxpll;
1770 /* 0x0068 */ u32 reserved1;
1771 /* 0x006C */ u32 reserved2;
1772 /* 0x0070 */ u32 reserved3;
1773 /* 0x0074 */ u32 reserved4;
1774 /* 0x0078 */ u32 slppwr;
1775 /* 0x007C */ u32 sleep;
1776 /* 0x0080 */ u32 reserved5[32];
1777 /* 0x0100 */ u32 trioutrd;
1778#define trioutclr trioutrd
1779 /* 0x0104 */ u32 reserved6;
1780 /* 0x0108 */ u32 outputrd;
1781#define outputset outputrd
1782 /* 0x010C */ u32 outputclr;
1783 /* 0x0110 */ u32 pinstaterd;
1784#define pininputen pinstaterd
1785} AU1X00_SYS;
1786
1787static AU1X00_SYS * const sys = (AU1X00_SYS *)SYS_BASE;
1788
1789#endif
1790
1791#endif 1681#endif
diff --git a/arch/mips/include/asm/mach-au1x00/au1100_mmc.h b/arch/mips/include/asm/mach-au1x00/au1100_mmc.h
index c35e20918490..94000a3b6f0b 100644
--- a/arch/mips/include/asm/mach-au1x00/au1100_mmc.h
+++ b/arch/mips/include/asm/mach-au1x00/au1100_mmc.h
@@ -46,6 +46,7 @@ struct au1xmmc_platform_data {
46 int(*card_readonly)(void *mmc_host); 46 int(*card_readonly)(void *mmc_host);
47 void(*set_power)(void *mmc_host, int state); 47 void(*set_power)(void *mmc_host, int state);
48 struct led_classdev *led; 48 struct led_classdev *led;
49 unsigned long mask_host_caps;
49}; 50};
50 51
51#define SD0_BASE 0xB0600000 52#define SD0_BASE 0xB0600000
@@ -205,4 +206,3 @@ struct au1xmmc_platform_data {
205 206
206 207
207#endif /* __ASM_AU1100_MMC_H */ 208#endif /* __ASM_AU1100_MMC_H */
208
diff --git a/arch/mips/include/asm/mach-au1x00/au1xxx_dbdma.h b/arch/mips/include/asm/mach-au1x00/au1xxx_dbdma.h
index d206000fbfe2..8c6b1105ce0b 100644
--- a/arch/mips/include/asm/mach-au1x00/au1xxx_dbdma.h
+++ b/arch/mips/include/asm/mach-au1x00/au1xxx_dbdma.h
@@ -339,8 +339,8 @@ u32 au1xxx_dbdma_set_devwidth(u32 chanid, int bits);
339u32 au1xxx_dbdma_ring_alloc(u32 chanid, int entries); 339u32 au1xxx_dbdma_ring_alloc(u32 chanid, int entries);
340 340
341/* Put buffers on source/destination descriptors. */ 341/* Put buffers on source/destination descriptors. */
342u32 _au1xxx_dbdma_put_source(u32 chanid, void *buf, int nbytes, u32 flags); 342u32 au1xxx_dbdma_put_source(u32 chanid, dma_addr_t buf, int nbytes, u32 flags);
343u32 _au1xxx_dbdma_put_dest(u32 chanid, void *buf, int nbytes, u32 flags); 343u32 au1xxx_dbdma_put_dest(u32 chanid, dma_addr_t buf, int nbytes, u32 flags);
344 344
345/* Get a buffer from the destination descriptor. */ 345/* Get a buffer from the destination descriptor. */
346u32 au1xxx_dbdma_get_dest(u32 chanid, void **buf, int *nbytes); 346u32 au1xxx_dbdma_get_dest(u32 chanid, void **buf, int *nbytes);
@@ -363,25 +363,6 @@ void au1xxx_dbdma_suspend(void);
363void au1xxx_dbdma_resume(void); 363void au1xxx_dbdma_resume(void);
364#endif 364#endif
365 365
366
367/*
368 * Some compatibilty macros -- needed to make changes to API
369 * without breaking existing drivers.
370 */
371#define au1xxx_dbdma_put_source(chanid, buf, nbytes) \
372 _au1xxx_dbdma_put_source(chanid, buf, nbytes, DDMA_FLAGS_IE)
373#define au1xxx_dbdma_put_source_flags(chanid, buf, nbytes, flags) \
374 _au1xxx_dbdma_put_source(chanid, buf, nbytes, flags)
375#define put_source_flags(chanid, buf, nbytes, flags) \
376 au1xxx_dbdma_put_source_flags(chanid, buf, nbytes, flags)
377
378#define au1xxx_dbdma_put_dest(chanid, buf, nbytes) \
379 _au1xxx_dbdma_put_dest(chanid, buf, nbytes, DDMA_FLAGS_IE)
380#define au1xxx_dbdma_put_dest_flags(chanid, buf, nbytes, flags) \
381 _au1xxx_dbdma_put_dest(chanid, buf, nbytes, flags)
382#define put_dest_flags(chanid, buf, nbytes, flags) \
383 au1xxx_dbdma_put_dest_flags(chanid, buf, nbytes, flags)
384
385/* 366/*
386 * Flags for the put_source/put_dest functions. 367 * Flags for the put_source/put_dest functions.
387 */ 368 */
diff --git a/arch/mips/include/asm/mach-au1x00/au1xxx_eth.h b/arch/mips/include/asm/mach-au1x00/au1xxx_eth.h
new file mode 100644
index 000000000000..bae9b758fcde
--- /dev/null
+++ b/arch/mips/include/asm/mach-au1x00/au1xxx_eth.h
@@ -0,0 +1,17 @@
1#ifndef __AU1X00_ETH_DATA_H
2#define __AU1X00_ETH_DATA_H
3
4/* Platform specific PHY configuration passed to the MAC driver */
5struct au1000_eth_platform_data {
6 int phy_static_config;
7 int phy_search_highest_addr;
8 int phy1_search_mac0;
9 int phy_addr;
10 int phy_busid;
11 int phy_irq;
12};
13
14void __init au1xxx_override_eth_cfg(unsigned port,
15 struct au1000_eth_platform_data *eth_data);
16
17#endif /* __AU1X00_ETH_DATA_H */
diff --git a/arch/mips/include/asm/mach-au1x00/gpio-au1000.h b/arch/mips/include/asm/mach-au1x00/gpio-au1000.h
index 91595fa89034..62d2f136d941 100644
--- a/arch/mips/include/asm/mach-au1x00/gpio-au1000.h
+++ b/arch/mips/include/asm/mach-au1x00/gpio-au1000.h
@@ -35,15 +35,13 @@ static inline int au1000_gpio2_to_irq(int gpio)
35 return -ENXIO; 35 return -ENXIO;
36} 36}
37 37
38#ifdef CONFIG_SOC_AU1000
39static inline int au1000_irq_to_gpio(int irq) 38static inline int au1000_irq_to_gpio(int irq)
40{ 39{
41 if ((irq >= AU1000_GPIO_0) && (irq <= AU1000_GPIO_31)) 40 if ((irq >= AU1000_GPIO0_INT) && (irq <= AU1000_GPIO31_INT))
42 return ALCHEMY_GPIO1_BASE + (irq - AU1000_GPIO_0) + 0; 41 return ALCHEMY_GPIO1_BASE + (irq - AU1000_GPIO0_INT) + 0;
43 42
44 return -ENXIO; 43 return -ENXIO;
45} 44}
46#endif
47 45
48static inline int au1500_gpio1_to_irq(int gpio) 46static inline int au1500_gpio1_to_irq(int gpio)
49{ 47{
@@ -71,27 +69,25 @@ static inline int au1500_gpio2_to_irq(int gpio)
71 return -ENXIO; 69 return -ENXIO;
72} 70}
73 71
74#ifdef CONFIG_SOC_AU1500
75static inline int au1500_irq_to_gpio(int irq) 72static inline int au1500_irq_to_gpio(int irq)
76{ 73{
77 switch (irq) { 74 switch (irq) {
78 case AU1000_GPIO_0 ... AU1000_GPIO_15: 75 case AU1500_GPIO0_INT ... AU1500_GPIO15_INT:
79 case AU1500_GPIO_20: 76 case AU1500_GPIO20_INT:
80 case AU1500_GPIO_23 ... AU1500_GPIO_28: 77 case AU1500_GPIO23_INT ... AU1500_GPIO28_INT:
81 return ALCHEMY_GPIO1_BASE + (irq - AU1000_GPIO_0) + 0; 78 return ALCHEMY_GPIO1_BASE + (irq - AU1500_GPIO0_INT) + 0;
82 case AU1500_GPIO_200 ... AU1500_GPIO_203: 79 case AU1500_GPIO200_INT ... AU1500_GPIO203_INT:
83 return ALCHEMY_GPIO2_BASE + (irq - AU1500_GPIO_200) + 0; 80 return ALCHEMY_GPIO2_BASE + (irq - AU1500_GPIO200_INT) + 0;
84 case AU1500_GPIO_204 ... AU1500_GPIO_205: 81 case AU1500_GPIO204_INT ... AU1500_GPIO205_INT:
85 return ALCHEMY_GPIO2_BASE + (irq - AU1500_GPIO_204) + 4; 82 return ALCHEMY_GPIO2_BASE + (irq - AU1500_GPIO204_INT) + 4;
86 case AU1500_GPIO_206 ... AU1500_GPIO_207: 83 case AU1500_GPIO206_INT ... AU1500_GPIO207_INT:
87 return ALCHEMY_GPIO2_BASE + (irq - AU1500_GPIO_206) + 6; 84 return ALCHEMY_GPIO2_BASE + (irq - AU1500_GPIO206_INT) + 6;
88 case AU1500_GPIO_208_215: 85 case AU1500_GPIO208_215_INT:
89 return ALCHEMY_GPIO2_BASE + 8; 86 return ALCHEMY_GPIO2_BASE + 8;
90 } 87 }
91 88
92 return -ENXIO; 89 return -ENXIO;
93} 90}
94#endif
95 91
96static inline int au1100_gpio1_to_irq(int gpio) 92static inline int au1100_gpio1_to_irq(int gpio)
97{ 93{
@@ -108,19 +104,17 @@ static inline int au1100_gpio2_to_irq(int gpio)
108 return -ENXIO; 104 return -ENXIO;
109} 105}
110 106
111#ifdef CONFIG_SOC_AU1100
112static inline int au1100_irq_to_gpio(int irq) 107static inline int au1100_irq_to_gpio(int irq)
113{ 108{
114 switch (irq) { 109 switch (irq) {
115 case AU1000_GPIO_0 ... AU1000_GPIO_31: 110 case AU1100_GPIO0_INT ... AU1100_GPIO31_INT:
116 return ALCHEMY_GPIO1_BASE + (irq - AU1000_GPIO_0) + 0; 111 return ALCHEMY_GPIO1_BASE + (irq - AU1100_GPIO0_INT) + 0;
117 case AU1100_GPIO_208_215: 112 case AU1100_GPIO208_215_INT:
118 return ALCHEMY_GPIO2_BASE + 8; 113 return ALCHEMY_GPIO2_BASE + 8;
119 } 114 }
120 115
121 return -ENXIO; 116 return -ENXIO;
122} 117}
123#endif
124 118
125static inline int au1550_gpio1_to_irq(int gpio) 119static inline int au1550_gpio1_to_irq(int gpio)
126{ 120{
@@ -149,24 +143,22 @@ static inline int au1550_gpio2_to_irq(int gpio)
149 return -ENXIO; 143 return -ENXIO;
150} 144}
151 145
152#ifdef CONFIG_SOC_AU1550
153static inline int au1550_irq_to_gpio(int irq) 146static inline int au1550_irq_to_gpio(int irq)
154{ 147{
155 switch (irq) { 148 switch (irq) {
156 case AU1000_GPIO_0 ... AU1000_GPIO_15: 149 case AU1550_GPIO0_INT ... AU1550_GPIO15_INT:
157 return ALCHEMY_GPIO1_BASE + (irq - AU1000_GPIO_0) + 0; 150 return ALCHEMY_GPIO1_BASE + (irq - AU1550_GPIO0_INT) + 0;
158 case AU1550_GPIO_200: 151 case AU1550_GPIO200_INT:
159 case AU1500_GPIO_201_205: 152 case AU1550_GPIO201_205_INT:
160 return ALCHEMY_GPIO2_BASE + (irq - AU1550_GPIO_200) + 0; 153 return ALCHEMY_GPIO2_BASE + (irq - AU1550_GPIO200_INT) + 0;
161 case AU1500_GPIO_16 ... AU1500_GPIO_28: 154 case AU1550_GPIO16_INT ... AU1550_GPIO28_INT:
162 return ALCHEMY_GPIO1_BASE + (irq - AU1500_GPIO_16) + 16; 155 return ALCHEMY_GPIO1_BASE + (irq - AU1550_GPIO16_INT) + 16;
163 case AU1500_GPIO_206 ... AU1500_GPIO_208_218: 156 case AU1550_GPIO206_INT ... AU1550_GPIO208_215_INT:
164 return ALCHEMY_GPIO2_BASE + (irq - AU1500_GPIO_206) + 6; 157 return ALCHEMY_GPIO2_BASE + (irq - AU1550_GPIO206_INT) + 6;
165 } 158 }
166 159
167 return -ENXIO; 160 return -ENXIO;
168} 161}
169#endif
170 162
171static inline int au1200_gpio1_to_irq(int gpio) 163static inline int au1200_gpio1_to_irq(int gpio)
172{ 164{
@@ -187,23 +179,21 @@ static inline int au1200_gpio2_to_irq(int gpio)
187 return -ENXIO; 179 return -ENXIO;
188} 180}
189 181
190#ifdef CONFIG_SOC_AU1200
191static inline int au1200_irq_to_gpio(int irq) 182static inline int au1200_irq_to_gpio(int irq)
192{ 183{
193 switch (irq) { 184 switch (irq) {
194 case AU1000_GPIO_0 ... AU1000_GPIO_31: 185 case AU1200_GPIO0_INT ... AU1200_GPIO31_INT:
195 return ALCHEMY_GPIO1_BASE + (irq - AU1000_GPIO_0) + 0; 186 return ALCHEMY_GPIO1_BASE + (irq - AU1200_GPIO0_INT) + 0;
196 case AU1200_GPIO_200 ... AU1200_GPIO_202: 187 case AU1200_GPIO200_INT ... AU1200_GPIO202_INT:
197 return ALCHEMY_GPIO2_BASE + (irq - AU1200_GPIO_200) + 0; 188 return ALCHEMY_GPIO2_BASE + (irq - AU1200_GPIO200_INT) + 0;
198 case AU1200_GPIO_203: 189 case AU1200_GPIO203_INT:
199 return ALCHEMY_GPIO2_BASE + 3; 190 return ALCHEMY_GPIO2_BASE + 3;
200 case AU1200_GPIO_204 ... AU1200_GPIO_208_215: 191 case AU1200_GPIO204_INT ... AU1200_GPIO208_215_INT:
201 return ALCHEMY_GPIO2_BASE + (irq - AU1200_GPIO_204) + 4; 192 return ALCHEMY_GPIO2_BASE + (irq - AU1200_GPIO204_INT) + 4;
202 } 193 }
203 194
204 return -ENXIO; 195 return -ENXIO;
205} 196}
206#endif
207 197
208/* 198/*
209 * GPIO1 block macros for common linux gpio functions. 199 * GPIO1 block macros for common linux gpio functions.
@@ -246,19 +236,19 @@ static inline int alchemy_gpio1_is_valid(int gpio)
246 236
247static inline int alchemy_gpio1_to_irq(int gpio) 237static inline int alchemy_gpio1_to_irq(int gpio)
248{ 238{
249#if defined(CONFIG_SOC_AU1000) 239 switch (alchemy_get_cputype()) {
250 return au1000_gpio1_to_irq(gpio); 240 case ALCHEMY_CPU_AU1000:
251#elif defined(CONFIG_SOC_AU1100) 241 return au1000_gpio1_to_irq(gpio);
252 return au1100_gpio1_to_irq(gpio); 242 case ALCHEMY_CPU_AU1100:
253#elif defined(CONFIG_SOC_AU1500) 243 return au1100_gpio1_to_irq(gpio);
254 return au1500_gpio1_to_irq(gpio); 244 case ALCHEMY_CPU_AU1500:
255#elif defined(CONFIG_SOC_AU1550) 245 return au1500_gpio1_to_irq(gpio);
256 return au1550_gpio1_to_irq(gpio); 246 case ALCHEMY_CPU_AU1550:
257#elif defined(CONFIG_SOC_AU1200) 247 return au1550_gpio1_to_irq(gpio);
258 return au1200_gpio1_to_irq(gpio); 248 case ALCHEMY_CPU_AU1200:
259#else 249 return au1200_gpio1_to_irq(gpio);
250 }
260 return -ENXIO; 251 return -ENXIO;
261#endif
262} 252}
263 253
264/* 254/*
@@ -316,19 +306,19 @@ static inline int alchemy_gpio2_is_valid(int gpio)
316 306
317static inline int alchemy_gpio2_to_irq(int gpio) 307static inline int alchemy_gpio2_to_irq(int gpio)
318{ 308{
319#if defined(CONFIG_SOC_AU1000) 309 switch (alchemy_get_cputype()) {
320 return au1000_gpio2_to_irq(gpio); 310 case ALCHEMY_CPU_AU1000:
321#elif defined(CONFIG_SOC_AU1100) 311 return au1000_gpio2_to_irq(gpio);
322 return au1100_gpio2_to_irq(gpio); 312 case ALCHEMY_CPU_AU1100:
323#elif defined(CONFIG_SOC_AU1500) 313 return au1100_gpio2_to_irq(gpio);
324 return au1500_gpio2_to_irq(gpio); 314 case ALCHEMY_CPU_AU1500:
325#elif defined(CONFIG_SOC_AU1550) 315 return au1500_gpio2_to_irq(gpio);
326 return au1550_gpio2_to_irq(gpio); 316 case ALCHEMY_CPU_AU1550:
327#elif defined(CONFIG_SOC_AU1200) 317 return au1550_gpio2_to_irq(gpio);
328 return au1200_gpio2_to_irq(gpio); 318 case ALCHEMY_CPU_AU1200:
329#else 319 return au1200_gpio2_to_irq(gpio);
320 }
330 return -ENXIO; 321 return -ENXIO;
331#endif
332} 322}
333 323
334/**********************************************************************/ 324/**********************************************************************/
@@ -384,10 +374,13 @@ static inline void alchemy_gpio2_enable_int(int gpio2)
384 374
385 gpio2 -= ALCHEMY_GPIO2_BASE; 375 gpio2 -= ALCHEMY_GPIO2_BASE;
386 376
387#if defined(CONFIG_SOC_AU1100) || defined(CONFIG_SOC_AU1500)
388 /* Au1100/Au1500 have GPIO208-215 enable bits at 0..7 */ 377 /* Au1100/Au1500 have GPIO208-215 enable bits at 0..7 */
389 gpio2 -= 8; 378 switch (alchemy_get_cputype()) {
390#endif 379 case ALCHEMY_CPU_AU1100:
380 case ALCHEMY_CPU_AU1500:
381 gpio2 -= 8;
382 }
383
391 local_irq_save(flags); 384 local_irq_save(flags);
392 __alchemy_gpio2_mod_int(gpio2, 1); 385 __alchemy_gpio2_mod_int(gpio2, 1);
393 local_irq_restore(flags); 386 local_irq_restore(flags);
@@ -405,10 +398,13 @@ static inline void alchemy_gpio2_disable_int(int gpio2)
405 398
406 gpio2 -= ALCHEMY_GPIO2_BASE; 399 gpio2 -= ALCHEMY_GPIO2_BASE;
407 400
408#if defined(CONFIG_SOC_AU1100) || defined(CONFIG_SOC_AU1500)
409 /* Au1100/Au1500 have GPIO208-215 enable bits at 0..7 */ 401 /* Au1100/Au1500 have GPIO208-215 enable bits at 0..7 */
410 gpio2 -= 8; 402 switch (alchemy_get_cputype()) {
411#endif 403 case ALCHEMY_CPU_AU1100:
404 case ALCHEMY_CPU_AU1500:
405 gpio2 -= 8;
406 }
407
412 local_irq_save(flags); 408 local_irq_save(flags);
413 __alchemy_gpio2_mod_int(gpio2, 0); 409 __alchemy_gpio2_mod_int(gpio2, 0);
414 local_irq_restore(flags); 410 local_irq_restore(flags);
@@ -494,19 +490,19 @@ static inline int alchemy_gpio_to_irq(int gpio)
494 490
495static inline int alchemy_irq_to_gpio(int irq) 491static inline int alchemy_irq_to_gpio(int irq)
496{ 492{
497#if defined(CONFIG_SOC_AU1000) 493 switch (alchemy_get_cputype()) {
498 return au1000_irq_to_gpio(irq); 494 case ALCHEMY_CPU_AU1000:
499#elif defined(CONFIG_SOC_AU1100) 495 return au1000_irq_to_gpio(irq);
500 return au1100_irq_to_gpio(irq); 496 case ALCHEMY_CPU_AU1100:
501#elif defined(CONFIG_SOC_AU1500) 497 return au1100_irq_to_gpio(irq);
502 return au1500_irq_to_gpio(irq); 498 case ALCHEMY_CPU_AU1500:
503#elif defined(CONFIG_SOC_AU1550) 499 return au1500_irq_to_gpio(irq);
504 return au1550_irq_to_gpio(irq); 500 case ALCHEMY_CPU_AU1550:
505#elif defined(CONFIG_SOC_AU1200) 501 return au1550_irq_to_gpio(irq);
506 return au1200_irq_to_gpio(irq); 502 case ALCHEMY_CPU_AU1200:
507#else 503 return au1200_irq_to_gpio(irq);
504 }
508 return -ENXIO; 505 return -ENXIO;
509#endif
510} 506}
511 507
512/**********************************************************************/ 508/**********************************************************************/
diff --git a/arch/mips/include/asm/mach-au1x00/gpio.h b/arch/mips/include/asm/mach-au1x00/gpio.h
index f9b7d41c659a..c3f60cdc3203 100644
--- a/arch/mips/include/asm/mach-au1x00/gpio.h
+++ b/arch/mips/include/asm/mach-au1x00/gpio.h
@@ -1,7 +1,7 @@
1#ifndef _ALCHEMY_GPIO_H_ 1#ifndef _ALCHEMY_GPIO_H_
2#define _ALCHEMY_GPIO_H_ 2#define _ALCHEMY_GPIO_H_
3 3
4#if defined(CONFIG_ALCHEMY_GPIO_AU1000) 4#if defined(CONFIG_ALCHEMY_GPIOINT_AU1000)
5 5
6#include <asm/mach-au1x00/gpio-au1000.h> 6#include <asm/mach-au1x00/gpio-au1000.h>
7 7
diff --git a/arch/mips/include/asm/mach-au1x00/ioremap.h b/arch/mips/include/asm/mach-au1x00/ioremap.h
index 364cea2dc71f..75a94ad3ac91 100644
--- a/arch/mips/include/asm/mach-au1x00/ioremap.h
+++ b/arch/mips/include/asm/mach-au1x00/ioremap.h
@@ -11,7 +11,7 @@
11 11
12#include <linux/types.h> 12#include <linux/types.h>
13 13
14#ifdef CONFIG_64BIT_PHYS_ADDR 14#if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_PCI)
15extern phys_t __fixup_bigphys_addr(phys_t, phys_t); 15extern phys_t __fixup_bigphys_addr(phys_t, phys_t);
16#else 16#else
17static inline phys_t __fixup_bigphys_addr(phys_t phys_addr, phys_t size) 17static inline phys_t __fixup_bigphys_addr(phys_t phys_addr, phys_t size)
diff --git a/arch/mips/include/asm/mach-au1x00/prom.h b/arch/mips/include/asm/mach-au1x00/prom.h
index e38715577c51..4c0e09cf1735 100644
--- a/arch/mips/include/asm/mach-au1x00/prom.h
+++ b/arch/mips/include/asm/mach-au1x00/prom.h
@@ -6,7 +6,6 @@ extern char **prom_argv;
6extern char **prom_envp; 6extern char **prom_envp;
7 7
8extern void prom_init_cmdline(void); 8extern void prom_init_cmdline(void);
9extern char *prom_getcmdline(void);
10extern char *prom_getenv(char *envname); 9extern char *prom_getenv(char *envname);
11extern int prom_get_ethernet_addr(char *ethernet_addr); 10extern int prom_get_ethernet_addr(char *ethernet_addr);
12 11
diff --git a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h
index ed4ccec87dd4..85fd27509aac 100644
--- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h
+++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h
@@ -770,4 +770,3 @@
770#define DMIPSPLLCFG_N2_MASK (0x7 << DMIPSPLLCFG_N2_SHIFT) 770#define DMIPSPLLCFG_N2_MASK (0x7 << DMIPSPLLCFG_N2_SHIFT)
771 771
772#endif /* BCM63XX_REGS_H_ */ 772#endif /* BCM63XX_REGS_H_ */
773
diff --git a/arch/mips/include/asm/mach-cavium-octeon/cpu-feature-overrides.h b/arch/mips/include/asm/mach-cavium-octeon/cpu-feature-overrides.h
index 425e708d4fb9..bbf054042395 100644
--- a/arch/mips/include/asm/mach-cavium-octeon/cpu-feature-overrides.h
+++ b/arch/mips/include/asm/mach-cavium-octeon/cpu-feature-overrides.h
@@ -58,6 +58,9 @@
58#define cpu_has_vint 0 58#define cpu_has_vint 0
59#define cpu_has_veic 0 59#define cpu_has_veic 0
60#define cpu_hwrena_impl_bits 0xc0000000 60#define cpu_hwrena_impl_bits 0xc0000000
61
62#define kernel_uses_smartmips_rixi (cpu_data[0].cputype == CPU_CAVIUM_OCTEON_PLUS)
63
61#define ARCH_HAS_READ_CURRENT_TIMER 1 64#define ARCH_HAS_READ_CURRENT_TIMER 1
62#define ARCH_HAS_IRQ_PER_CPU 1 65#define ARCH_HAS_IRQ_PER_CPU 1
63#define ARCH_HAS_SPINLOCK_PREFETCH 1 66#define ARCH_HAS_SPINLOCK_PREFETCH 1
diff --git a/arch/mips/include/asm/mach-db1x00/bcsr.h b/arch/mips/include/asm/mach-db1x00/bcsr.h
new file mode 100644
index 000000000000..618d2de02ed3
--- /dev/null
+++ b/arch/mips/include/asm/mach-db1x00/bcsr.h
@@ -0,0 +1,238 @@
1/*
2 * bcsr.h -- Db1xxx/Pb1xxx Devboard CPLD registers ("BCSR") abstraction.
3 *
4 * All Alchemy development boards (except, of course, the weird PB1000)
5 * have a few registers in a CPLD with standardised layout; they mostly
6 * only differ in base address and bit meanings in the RESETS and BOARD
7 * registers.
8 *
9 * All data taken from the official AMD board documentation sheets.
10 */
11
12#ifndef _DB1XXX_BCSR_H_
13#define _DB1XXX_BCSR_H_
14
15
16/* BCSR base addresses on various boards. BCSR base 2 refers to the
17 * physical address of the first HEXLEDS register, which is usually
18 * a variable offset from the WHOAMI register.
19 */
20
21/* DB1000, DB1100, DB1500, PB1100, PB1500 */
22#define DB1000_BCSR_PHYS_ADDR 0x0E000000
23#define DB1000_BCSR_HEXLED_OFS 0x01000000
24
25#define DB1550_BCSR_PHYS_ADDR 0x0F000000
26#define DB1550_BCSR_HEXLED_OFS 0x00400000
27
28#define PB1550_BCSR_PHYS_ADDR 0x0F000000
29#define PB1550_BCSR_HEXLED_OFS 0x00800000
30
31#define DB1200_BCSR_PHYS_ADDR 0x19800000
32#define DB1200_BCSR_HEXLED_OFS 0x00400000
33
34#define PB1200_BCSR_PHYS_ADDR 0x0D800000
35#define PB1200_BCSR_HEXLED_OFS 0x00400000
36
37
38enum bcsr_id {
39 /* BCSR base 1 */
40 BCSR_WHOAMI = 0,
41 BCSR_STATUS,
42 BCSR_SWITCHES,
43 BCSR_RESETS,
44 BCSR_PCMCIA,
45 BCSR_BOARD,
46 BCSR_LEDS,
47 BCSR_SYSTEM,
48 /* Au1200/1300 based boards */
49 BCSR_INTCLR,
50 BCSR_INTSET,
51 BCSR_MASKCLR,
52 BCSR_MASKSET,
53 BCSR_SIGSTAT,
54 BCSR_INTSTAT,
55
56 /* BCSR base 2 */
57 BCSR_HEXLEDS,
58 BCSR_RSVD1,
59 BCSR_HEXCLEAR,
60
61 BCSR_CNT,
62};
63
64/* register offsets, valid for all Db1xxx/Pb1xxx boards */
65#define BCSR_REG_WHOAMI 0x00
66#define BCSR_REG_STATUS 0x04
67#define BCSR_REG_SWITCHES 0x08
68#define BCSR_REG_RESETS 0x0c
69#define BCSR_REG_PCMCIA 0x10
70#define BCSR_REG_BOARD 0x14
71#define BCSR_REG_LEDS 0x18
72#define BCSR_REG_SYSTEM 0x1c
73/* Au1200/Au1300 based boards: CPLD IRQ muxer */
74#define BCSR_REG_INTCLR 0x20
75#define BCSR_REG_INTSET 0x24
76#define BCSR_REG_MASKCLR 0x28
77#define BCSR_REG_MASKSET 0x2c
78#define BCSR_REG_SIGSTAT 0x30
79#define BCSR_REG_INTSTAT 0x34
80
81/* hexled control, offset from BCSR base 2 */
82#define BCSR_REG_HEXLEDS 0x00
83#define BCSR_REG_HEXCLEAR 0x08
84
85/*
86 * Register Bits and Pieces.
87 */
88#define BCSR_WHOAMI_DCID(x) ((x) & 0xf)
89#define BCSR_WHOAMI_CPLD(x) (((x) >> 4) & 0xf)
90#define BCSR_WHOAMI_BOARD(x) (((x) >> 8) & 0xf)
91
92/* register "WHOAMI" bits 11:8 identify the board */
93enum bcsr_whoami_boards {
94 BCSR_WHOAMI_PB1500 = 1,
95 BCSR_WHOAMI_PB1500R2,
96 BCSR_WHOAMI_PB1100,
97 BCSR_WHOAMI_DB1000,
98 BCSR_WHOAMI_DB1100,
99 BCSR_WHOAMI_DB1500,
100 BCSR_WHOAMI_DB1550,
101 BCSR_WHOAMI_PB1550_DDR,
102 BCSR_WHOAMI_PB1550 = BCSR_WHOAMI_PB1550_DDR,
103 BCSR_WHOAMI_PB1550_SDR,
104 BCSR_WHOAMI_PB1200_DDR1,
105 BCSR_WHOAMI_PB1200 = BCSR_WHOAMI_PB1200_DDR1,
106 BCSR_WHOAMI_PB1200_DDR2,
107 BCSR_WHOAMI_DB1200,
108};
109
110/* STATUS reg. Unless otherwise noted, they're valid on all boards.
111 * PB1200 = DB1200.
112 */
113#define BCSR_STATUS_PC0VS 0x0003
114#define BCSR_STATUS_PC1VS 0x000C
115#define BCSR_STATUS_PC0FI 0x0010
116#define BCSR_STATUS_PC1FI 0x0020
117#define BCSR_STATUS_PB1550_SWAPBOOT 0x0040
118#define BCSR_STATUS_SRAMWIDTH 0x0080
119#define BCSR_STATUS_FLASHBUSY 0x0100
120#define BCSR_STATUS_ROMBUSY 0x0400
121#define BCSR_STATUS_SD0WP 0x0400 /* DB1200 */
122#define BCSR_STATUS_SD1WP 0x0800
123#define BCSR_STATUS_USBOTGID 0x0800 /* PB/DB1550 */
124#define BCSR_STATUS_DB1000_SWAPBOOT 0x2000
125#define BCSR_STATUS_DB1200_SWAPBOOT 0x0040 /* DB1200 */
126#define BCSR_STATUS_IDECBLID 0x0200 /* DB1200 */
127#define BCSR_STATUS_DB1200_U0RXD 0x1000 /* DB1200 */
128#define BCSR_STATUS_DB1200_U1RXD 0x2000 /* DB1200 */
129#define BCSR_STATUS_FLASHDEN 0xC000
130#define BCSR_STATUS_DB1550_U0RXD 0x1000 /* DB1550 */
131#define BCSR_STATUS_DB1550_U3RXD 0x2000 /* DB1550 */
132#define BCSR_STATUS_PB1550_U0RXD 0x1000 /* PB1550 */
133#define BCSR_STATUS_PB1550_U1RXD 0x2000 /* PB1550 */
134#define BCSR_STATUS_PB1550_U3RXD 0x8000 /* PB1550 */
135
136
137/* DB/PB1000,1100,1500,1550 */
138#define BCSR_RESETS_PHY0 0x0001
139#define BCSR_RESETS_PHY1 0x0002
140#define BCSR_RESETS_DC 0x0004
141#define BCSR_RESETS_FIR_SEL 0x2000
142#define BCSR_RESETS_IRDA_MODE_MASK 0xC000
143#define BCSR_RESETS_IRDA_MODE_FULL 0x0000
144#define BCSR_RESETS_PB1550_WSCFSM 0x2000
145#define BCSR_RESETS_IRDA_MODE_OFF 0x4000
146#define BCSR_RESETS_IRDA_MODE_2_3 0x8000
147#define BCSR_RESETS_IRDA_MODE_1_3 0xC000
148#define BCSR_RESETS_DMAREQ 0x8000 /* PB1550 */
149
150#define BCSR_BOARD_PCIM66EN 0x0001
151#define BCSR_BOARD_SD0PWR 0x0040
152#define BCSR_BOARD_SD1PWR 0x0080
153#define BCSR_BOARD_PCIM33 0x0100
154#define BCSR_BOARD_PCIEXTARB 0x0200
155#define BCSR_BOARD_GPIO200RST 0x0400
156#define BCSR_BOARD_PCICLKOUT 0x0800
157#define BCSR_BOARD_PCICFG 0x1000
158#define BCSR_BOARD_SPISEL 0x4000 /* PB/DB1550 */
159#define BCSR_BOARD_SD0WP 0x4000 /* DB1100 */
160#define BCSR_BOARD_SD1WP 0x8000 /* DB1100 */
161
162
163/* DB/PB1200 */
164#define BCSR_RESETS_ETH 0x0001
165#define BCSR_RESETS_CAMERA 0x0002
166#define BCSR_RESETS_DC 0x0004
167#define BCSR_RESETS_IDE 0x0008
168#define BCSR_RESETS_TV 0x0010 /* DB1200 */
169/* Not resets but in the same register */
170#define BCSR_RESETS_PWMR1MUX 0x0800 /* DB1200 */
171#define BCSR_RESETS_PB1200_WSCFSM 0x0800 /* PB1200 */
172#define BCSR_RESETS_PSC0MUX 0x1000
173#define BCSR_RESETS_PSC1MUX 0x2000
174#define BCSR_RESETS_SPISEL 0x4000
175#define BCSR_RESETS_SD1MUX 0x8000 /* PB1200 */
176
177#define BCSR_BOARD_LCDVEE 0x0001
178#define BCSR_BOARD_LCDVDD 0x0002
179#define BCSR_BOARD_LCDBL 0x0004
180#define BCSR_BOARD_CAMSNAP 0x0010
181#define BCSR_BOARD_CAMPWR 0x0020
182#define BCSR_BOARD_SD0PWR 0x0040
183
184
185#define BCSR_SWITCHES_DIP 0x00FF
186#define BCSR_SWITCHES_DIP_1 0x0080
187#define BCSR_SWITCHES_DIP_2 0x0040
188#define BCSR_SWITCHES_DIP_3 0x0020
189#define BCSR_SWITCHES_DIP_4 0x0010
190#define BCSR_SWITCHES_DIP_5 0x0008
191#define BCSR_SWITCHES_DIP_6 0x0004
192#define BCSR_SWITCHES_DIP_7 0x0002
193#define BCSR_SWITCHES_DIP_8 0x0001
194#define BCSR_SWITCHES_ROTARY 0x0F00
195
196
197#define BCSR_PCMCIA_PC0VPP 0x0003
198#define BCSR_PCMCIA_PC0VCC 0x000C
199#define BCSR_PCMCIA_PC0DRVEN 0x0010
200#define BCSR_PCMCIA_PC0RST 0x0080
201#define BCSR_PCMCIA_PC1VPP 0x0300
202#define BCSR_PCMCIA_PC1VCC 0x0C00
203#define BCSR_PCMCIA_PC1DRVEN 0x1000
204#define BCSR_PCMCIA_PC1RST 0x8000
205
206
207#define BCSR_LEDS_DECIMALS 0x0003
208#define BCSR_LEDS_LED0 0x0100
209#define BCSR_LEDS_LED1 0x0200
210#define BCSR_LEDS_LED2 0x0400
211#define BCSR_LEDS_LED3 0x0800
212
213
214#define BCSR_SYSTEM_RESET 0x8000 /* clear to reset */
215#define BCSR_SYSTEM_PWROFF 0x4000 /* set to power off */
216#define BCSR_SYSTEM_VDDI 0x001F /* PB1xxx boards */
217
218
219
220
221/* initialize BCSR for a board. Provide the PHYSICAL addresses of both
222 * BCSR spaces.
223 */
224void __init bcsr_init(unsigned long bcsr1_phys, unsigned long bcsr2_phys);
225
226/* read a board register */
227unsigned short bcsr_read(enum bcsr_id reg);
228
229/* write to a board register */
230void bcsr_write(enum bcsr_id reg, unsigned short val);
231
232/* modify a register. clear bits set in 'clr', set bits set in 'set' */
233void bcsr_mod(enum bcsr_id reg, unsigned short clr, unsigned short set);
234
235/* install CPLD IRQ demuxer (DB1200/PB1200) */
236void __init bcsr_init_irq(int csc_start, int csc_end, int hook_irq);
237
238#endif
diff --git a/arch/mips/include/asm/mach-db1x00/db1200.h b/arch/mips/include/asm/mach-db1x00/db1200.h
index 27f26102b1bb..3404248f5094 100644
--- a/arch/mips/include/asm/mach-db1x00/db1200.h
+++ b/arch/mips/include/asm/mach-db1x00/db1200.h
@@ -25,133 +25,9 @@
25#define __ASM_DB1200_H 25#define __ASM_DB1200_H
26 26
27#include <linux/types.h> 27#include <linux/types.h>
28#include <asm/mach-au1x00/au1000.h>
28#include <asm/mach-au1x00/au1xxx_psc.h> 29#include <asm/mach-au1x00/au1xxx_psc.h>
29 30
30#define DBDMA_AC97_TX_CHAN DSCR_CMD0_PSC1_TX
31#define DBDMA_AC97_RX_CHAN DSCR_CMD0_PSC1_RX
32#define DBDMA_I2S_TX_CHAN DSCR_CMD0_PSC1_TX
33#define DBDMA_I2S_RX_CHAN DSCR_CMD0_PSC1_RX
34
35/*
36 * SPI and SMB are muxed on the DBAu1200 board.
37 * Refer to board documentation.
38 */
39#define SPI_PSC_BASE PSC0_BASE_ADDR
40#define SMBUS_PSC_BASE PSC0_BASE_ADDR
41/*
42 * AC'97 and I2S are muxed on the DBAu1200 board.
43 * Refer to board documentation.
44 */
45#define AC97_PSC_BASE PSC1_BASE_ADDR
46#define I2S_PSC_BASE PSC1_BASE_ADDR
47
48#define BCSR_KSEG1_ADDR 0xB9800000
49
50typedef volatile struct
51{
52 /*00*/ u16 whoami;
53 u16 reserved0;
54 /*04*/ u16 status;
55 u16 reserved1;
56 /*08*/ u16 switches;
57 u16 reserved2;
58 /*0C*/ u16 resets;
59 u16 reserved3;
60
61 /*10*/ u16 pcmcia;
62 u16 reserved4;
63 /*14*/ u16 board;
64 u16 reserved5;
65 /*18*/ u16 disk_leds;
66 u16 reserved6;
67 /*1C*/ u16 system;
68 u16 reserved7;
69
70 /*20*/ u16 intclr;
71 u16 reserved8;
72 /*24*/ u16 intset;
73 u16 reserved9;
74 /*28*/ u16 intclr_mask;
75 u16 reserved10;
76 /*2C*/ u16 intset_mask;
77 u16 reserved11;
78
79 /*30*/ u16 sig_status;
80 u16 reserved12;
81 /*34*/ u16 int_status;
82 u16 reserved13;
83 /*38*/ u16 reserved14;
84 u16 reserved15;
85 /*3C*/ u16 reserved16;
86 u16 reserved17;
87
88} BCSR;
89
90static BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR;
91
92/*
93 * Register bit definitions for the BCSRs
94 */
95#define BCSR_WHOAMI_DCID 0x000F
96#define BCSR_WHOAMI_CPLD 0x00F0
97#define BCSR_WHOAMI_BOARD 0x0F00
98
99#define BCSR_STATUS_PCMCIA0VS 0x0003
100#define BCSR_STATUS_PCMCIA1VS 0x000C
101#define BCSR_STATUS_SWAPBOOT 0x0040
102#define BCSR_STATUS_FLASHBUSY 0x0100
103#define BCSR_STATUS_IDECBLID 0x0200
104#define BCSR_STATUS_SD0WP 0x0400
105#define BCSR_STATUS_U0RXD 0x1000
106#define BCSR_STATUS_U1RXD 0x2000
107
108#define BCSR_SWITCHES_OCTAL 0x00FF
109#define BCSR_SWITCHES_DIP_1 0x0080
110#define BCSR_SWITCHES_DIP_2 0x0040
111#define BCSR_SWITCHES_DIP_3 0x0020
112#define BCSR_SWITCHES_DIP_4 0x0010
113#define BCSR_SWITCHES_DIP_5 0x0008
114#define BCSR_SWITCHES_DIP_6 0x0004
115#define BCSR_SWITCHES_DIP_7 0x0002
116#define BCSR_SWITCHES_DIP_8 0x0001
117#define BCSR_SWITCHES_ROTARY 0x0F00
118
119#define BCSR_RESETS_ETH 0x0001
120#define BCSR_RESETS_CAMERA 0x0002
121#define BCSR_RESETS_DC 0x0004
122#define BCSR_RESETS_IDE 0x0008
123#define BCSR_RESETS_TV 0x0010
124/* Not resets but in the same register */
125#define BCSR_RESETS_PWMR1MUX 0x0800
126#define BCSR_RESETS_PCS0MUX 0x1000
127#define BCSR_RESETS_PCS1MUX 0x2000
128#define BCSR_RESETS_SPISEL 0x4000
129
130#define BCSR_PCMCIA_PC0VPP 0x0003
131#define BCSR_PCMCIA_PC0VCC 0x000C
132#define BCSR_PCMCIA_PC0DRVEN 0x0010
133#define BCSR_PCMCIA_PC0RST 0x0080
134#define BCSR_PCMCIA_PC1VPP 0x0300
135#define BCSR_PCMCIA_PC1VCC 0x0C00
136#define BCSR_PCMCIA_PC1DRVEN 0x1000
137#define BCSR_PCMCIA_PC1RST 0x8000
138
139#define BCSR_BOARD_LCDVEE 0x0001
140#define BCSR_BOARD_LCDVDD 0x0002
141#define BCSR_BOARD_LCDBL 0x0004
142#define BCSR_BOARD_CAMSNAP 0x0010
143#define BCSR_BOARD_CAMPWR 0x0020
144#define BCSR_BOARD_SD0PWR 0x0040
145
146#define BCSR_LEDS_DECIMALS 0x0003
147#define BCSR_LEDS_LED0 0x0100
148#define BCSR_LEDS_LED1 0x0200
149#define BCSR_LEDS_LED2 0x0400
150#define BCSR_LEDS_LED3 0x0800
151
152#define BCSR_SYSTEM_POWEROFF 0x4000
153#define BCSR_SYSTEM_RESET 0x8000
154
155/* Bit positions for the different interrupt sources */ 31/* Bit positions for the different interrupt sources */
156#define BCSR_INT_IDE 0x0001 32#define BCSR_INT_IDE 0x0001
157#define BCSR_INT_ETH 0x0002 33#define BCSR_INT_ETH 0x0002
@@ -168,17 +44,15 @@ static BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR;
168#define BCSR_INT_SD0INSERT 0x1000 44#define BCSR_INT_SD0INSERT 0x1000
169#define BCSR_INT_SD0EJECT 0x2000 45#define BCSR_INT_SD0EJECT 0x2000
170 46
171#define SMC91C111_PHYS_ADDR 0x19000300
172#define SMC91C111_INT DB1200_ETH_INT
173
174#define IDE_PHYS_ADDR 0x18800000 47#define IDE_PHYS_ADDR 0x18800000
175#define IDE_REG_SHIFT 5 48#define IDE_REG_SHIFT 5
176#define IDE_PHYS_LEN (16 << IDE_REG_SHIFT)
177#define IDE_INT DB1200_IDE_INT
178#define IDE_DDMA_REQ DSCR_CMD0_DMA_REQ1 49#define IDE_DDMA_REQ DSCR_CMD0_DMA_REQ1
179#define IDE_RQSIZE 128 50#define IDE_RQSIZE 128
180 51
181#define NAND_PHYS_ADDR 0x20000000 52#define DB1200_IDE_PHYS_ADDR IDE_PHYS_ADDR
53#define DB1200_IDE_PHYS_LEN (16 << IDE_REG_SHIFT)
54#define DB1200_ETH_PHYS_ADDR 0x19000300
55#define DB1200_NAND_PHYS_ADDR 0x20000000
182 56
183/* 57/*
184 * External Interrupts for DBAu1200 as of 8/6/2004. 58 * External Interrupts for DBAu1200 as of 8/6/2004.
@@ -188,7 +62,7 @@ static BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR;
188 * Example: IDE bis pos is = 64 - 64 62 * Example: IDE bis pos is = 64 - 64
189 * ETH bit pos is = 65 - 64 63 * ETH bit pos is = 65 - 64
190 */ 64 */
191enum external_pb1200_ints { 65enum external_db1200_ints {
192 DB1200_INT_BEGIN = AU1000_MAX_INTR + 1, 66 DB1200_INT_BEGIN = AU1000_MAX_INTR + 1,
193 67
194 DB1200_IDE_INT = DB1200_INT_BEGIN, 68 DB1200_IDE_INT = DB1200_INT_BEGIN,
@@ -209,22 +83,4 @@ enum external_pb1200_ints {
209 DB1200_INT_END = DB1200_INT_BEGIN + 15, 83 DB1200_INT_END = DB1200_INT_BEGIN + 15,
210}; 84};
211 85
212
213/*
214 * DBAu1200 specific PCMCIA defines for drivers/pcmcia/au1000_db1x00.c
215 */
216#define PCMCIA_MAX_SOCK 1
217#define PCMCIA_NUM_SOCKS (PCMCIA_MAX_SOCK + 1)
218
219/* VPP/VCC */
220#define SET_VCC_VPP(VCC, VPP, SLOT) \
221 ((((VCC) << 2) | ((VPP) << 0)) << ((SLOT) * 8))
222
223#define BOARD_PC0_INT DB1200_PC0_INT
224#define BOARD_PC1_INT DB1200_PC1_INT
225#define BOARD_CARD_INSERTED(SOCKET) bcsr->sig_status & (1 << (8 + (2 * SOCKET)))
226
227/* NAND chip select */
228#define NAND_CS 1
229
230#endif /* __ASM_DB1200_H */ 86#endif /* __ASM_DB1200_H */
diff --git a/arch/mips/include/asm/mach-db1x00/db1x00.h b/arch/mips/include/asm/mach-db1x00/db1x00.h
index 1a515b8c870f..a919dac525a1 100644
--- a/arch/mips/include/asm/mach-db1x00/db1x00.h
+++ b/arch/mips/include/asm/mach-db1x00/db1x00.h
@@ -41,111 +41,11 @@
41#define SMBUS_PSC_BASE PSC2_BASE_ADDR 41#define SMBUS_PSC_BASE PSC2_BASE_ADDR
42#define I2S_PSC_BASE PSC3_BASE_ADDR 42#define I2S_PSC_BASE PSC3_BASE_ADDR
43 43
44#define BCSR_KSEG1_ADDR 0xAF000000
45#define NAND_PHYS_ADDR 0x20000000 44#define NAND_PHYS_ADDR 0x20000000
46 45
47#else
48#define BCSR_KSEG1_ADDR 0xAE000000
49#endif 46#endif
50 47
51/* 48/*
52 * Overlay data structure of the DBAu1x00 board registers.
53 * Registers are located at physical 0E0000xx, KSEG1 0xAE0000xx.
54 */
55typedef volatile struct
56{
57 /*00*/ unsigned short whoami;
58 unsigned short reserved0;
59 /*04*/ unsigned short status;
60 unsigned short reserved1;
61 /*08*/ unsigned short switches;
62 unsigned short reserved2;
63 /*0C*/ unsigned short resets;
64 unsigned short reserved3;
65 /*10*/ unsigned short pcmcia;
66 unsigned short reserved4;
67 /*14*/ unsigned short specific;
68 unsigned short reserved5;
69 /*18*/ unsigned short leds;
70 unsigned short reserved6;
71 /*1C*/ unsigned short swreset;
72 unsigned short reserved7;
73
74} BCSR;
75
76
77/*
78 * Register/mask bit definitions for the BCSRs
79 */
80#define BCSR_WHOAMI_DCID 0x000F
81#define BCSR_WHOAMI_CPLD 0x00F0
82#define BCSR_WHOAMI_BOARD 0x0F00
83
84#define BCSR_STATUS_PC0VS 0x0003
85#define BCSR_STATUS_PC1VS 0x000C
86#define BCSR_STATUS_PC0FI 0x0010
87#define BCSR_STATUS_PC1FI 0x0020
88#define BCSR_STATUS_FLASHBUSY 0x0100
89#define BCSR_STATUS_ROMBUSY 0x0400
90#define BCSR_STATUS_SWAPBOOT 0x2000
91#define BCSR_STATUS_FLASHDEN 0xC000
92
93#define BCSR_SWITCHES_DIP 0x00FF
94#define BCSR_SWITCHES_DIP_1 0x0080
95#define BCSR_SWITCHES_DIP_2 0x0040
96#define BCSR_SWITCHES_DIP_3 0x0020
97#define BCSR_SWITCHES_DIP_4 0x0010
98#define BCSR_SWITCHES_DIP_5 0x0008
99#define BCSR_SWITCHES_DIP_6 0x0004
100#define BCSR_SWITCHES_DIP_7 0x0002
101#define BCSR_SWITCHES_DIP_8 0x0001
102#define BCSR_SWITCHES_ROTARY 0x0F00
103
104#define BCSR_RESETS_PHY0 0x0001
105#define BCSR_RESETS_PHY1 0x0002
106#define BCSR_RESETS_DC 0x0004
107#define BCSR_RESETS_FIR_SEL 0x2000
108#define BCSR_RESETS_IRDA_MODE_MASK 0xC000
109#define BCSR_RESETS_IRDA_MODE_FULL 0x0000
110#define BCSR_RESETS_IRDA_MODE_OFF 0x4000
111#define BCSR_RESETS_IRDA_MODE_2_3 0x8000
112#define BCSR_RESETS_IRDA_MODE_1_3 0xC000
113
114#define BCSR_PCMCIA_PC0VPP 0x0003
115#define BCSR_PCMCIA_PC0VCC 0x000C
116#define BCSR_PCMCIA_PC0DRVEN 0x0010
117#define BCSR_PCMCIA_PC0RST 0x0080
118#define BCSR_PCMCIA_PC1VPP 0x0300
119#define BCSR_PCMCIA_PC1VCC 0x0C00
120#define BCSR_PCMCIA_PC1DRVEN 0x1000
121#define BCSR_PCMCIA_PC1RST 0x8000
122
123#define BCSR_BOARD_PCIM66EN 0x0001
124#define BCSR_BOARD_SD0_PWR 0x0040
125#define BCSR_BOARD_SD1_PWR 0x0080
126#define BCSR_BOARD_PCIM33 0x0100
127#define BCSR_BOARD_GPIO200RST 0x0400
128#define BCSR_BOARD_PCICFG 0x1000
129#define BCSR_BOARD_SD0_WP 0x4000
130#define BCSR_BOARD_SD1_WP 0x8000
131
132#define BCSR_LEDS_DECIMALS 0x0003
133#define BCSR_LEDS_LED0 0x0100
134#define BCSR_LEDS_LED1 0x0200
135#define BCSR_LEDS_LED2 0x0400
136#define BCSR_LEDS_LED3 0x0800
137
138#define BCSR_SWRESET_RESET 0x0080
139
140/* PCMCIA DBAu1x00 specific defines */
141#define PCMCIA_MAX_SOCK 1
142#define PCMCIA_NUM_SOCKS (PCMCIA_MAX_SOCK + 1)
143
144/* VPP/VCC */
145#define SET_VCC_VPP(VCC, VPP, SLOT)\
146 ((((VCC) << 2) | ((VPP) << 0)) << ((SLOT) * 8))
147
148/*
149 * NAND defines 49 * NAND defines
150 * 50 *
151 * Timing values as described in databook, * ns value stripped of the 51 * Timing values as described in databook, * ns value stripped of the
diff --git a/arch/mips/include/asm/mach-loongson/cpu-feature-overrides.h b/arch/mips/include/asm/mach-loongson/cpu-feature-overrides.h
index 9947e57c91de..16210cedd929 100644
--- a/arch/mips/include/asm/mach-loongson/cpu-feature-overrides.h
+++ b/arch/mips/include/asm/mach-loongson/cpu-feature-overrides.h
@@ -3,7 +3,7 @@
3 * License. See the file "COPYING" in the main directory of this archive 3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details. 4 * for more details.
5 * 5 *
6 * Copyright (C) 2009 Wu Zhangjin <wuzj@lemote.com> 6 * Copyright (C) 2009 Wu Zhangjin <wuzhangjin@gmail.com>
7 * Copyright (C) 2009 Philippe Vachon <philippe@cowpig.ca> 7 * Copyright (C) 2009 Philippe Vachon <philippe@cowpig.ca>
8 * Copyright (C) 2009 Zhang Le <r0bertz@gentoo.org> 8 * Copyright (C) 2009 Zhang Le <r0bertz@gentoo.org>
9 * 9 *
diff --git a/arch/mips/include/asm/mach-loongson/cs5536/cs5536_vsm.h b/arch/mips/include/asm/mach-loongson/cs5536/cs5536_vsm.h
index 6305bea7e18e..21c4ecedebe7 100644
--- a/arch/mips/include/asm/mach-loongson/cs5536/cs5536_vsm.h
+++ b/arch/mips/include/asm/mach-loongson/cs5536/cs5536_vsm.h
@@ -2,7 +2,7 @@
2 * the read/write interfaces for Virtual Support Module(VSM) 2 * the read/write interfaces for Virtual Support Module(VSM)
3 * 3 *
4 * Copyright (C) 2009 Lemote, Inc. 4 * Copyright (C) 2009 Lemote, Inc.
5 * Author: Wu Zhangjin <wuzj@lemote.com> 5 * Author: Wu Zhangjin <wuzhangjin@gmail.com>
6 */ 6 */
7 7
8#ifndef _CS5536_VSM_H 8#ifndef _CS5536_VSM_H
diff --git a/arch/mips/include/asm/mach-loongson/loongson.h b/arch/mips/include/asm/mach-loongson/loongson.h
index ee8bc8376972..1cf7b1401ee4 100644
--- a/arch/mips/include/asm/mach-loongson/loongson.h
+++ b/arch/mips/include/asm/mach-loongson/loongson.h
@@ -1,12 +1,11 @@
1/* 1/*
2 * Copyright (C) 2009 Lemote, Inc. 2 * Copyright (C) 2009 Lemote, Inc.
3 * Author: Wu Zhangjin <wuzj@lemote.com> 3 * Author: Wu Zhangjin <wuzhangjin@gmail.com>
4 * 4 *
5 * This program is free software; you can redistribute it and/or modify it 5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the 6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your 7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version. 8 * option) any later version.
9 *
10 */ 9 */
11 10
12#ifndef __ASM_MACH_LOONGSON_LOONGSON_H 11#ifndef __ASM_MACH_LOONGSON_LOONGSON_H
@@ -23,7 +22,7 @@ extern void mach_prepare_reboot(void);
23extern void mach_prepare_shutdown(void); 22extern void mach_prepare_shutdown(void);
24 23
25/* environment arguments from bootloader */ 24/* environment arguments from bootloader */
26extern unsigned long bus_clock, cpu_clock_freq; 25extern unsigned long cpu_clock_freq;
27extern unsigned long memsize, highmemsize; 26extern unsigned long memsize, highmemsize;
28 27
29/* loongson-specific command line, env and memory initialization */ 28/* loongson-specific command line, env and memory initialization */
diff --git a/arch/mips/include/asm/mach-loongson/machine.h b/arch/mips/include/asm/mach-loongson/machine.h
index acf8359cb135..43213388c174 100644
--- a/arch/mips/include/asm/mach-loongson/machine.h
+++ b/arch/mips/include/asm/mach-loongson/machine.h
@@ -1,6 +1,6 @@
1/* 1/*
2 * Copyright (C) 2009 Lemote, Inc. & Institute of Computing Technology 2 * Copyright (C) 2009 Lemote, Inc.
3 * Author: Wu Zhangjin <wuzj@lemote.com> 3 * Author: Wu Zhangjin <wuzhangjin@gmail.com>
4 * 4 *
5 * This program is free software; you can redistribute it and/or modify it 5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the 6 * under the terms of the GNU General Public License as published by the
diff --git a/arch/mips/include/asm/mach-loongson/mem.h b/arch/mips/include/asm/mach-loongson/mem.h
index e9960f341b96..3b23ee8647d6 100644
--- a/arch/mips/include/asm/mach-loongson/mem.h
+++ b/arch/mips/include/asm/mach-loongson/mem.h
@@ -1,6 +1,6 @@
1/* 1/*
2 * Copyright (C) 2009 Lemote, Inc. 2 * Copyright (C) 2009 Lemote, Inc.
3 * Author: Wu Zhangjin <wuzj@lemote.com> 3 * Author: Wu Zhangjin <wuzhangjin@gmail.com>
4 * 4 *
5 * This program is free software; you can redistribute it and/or modify it 5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the 6 * under the terms of the GNU General Public License as published by the
diff --git a/arch/mips/include/asm/mach-loongson/pci.h b/arch/mips/include/asm/mach-loongson/pci.h
index a199a4f6de4e..bc99dab4ef63 100644
--- a/arch/mips/include/asm/mach-loongson/pci.h
+++ b/arch/mips/include/asm/mach-loongson/pci.h
@@ -1,23 +1,12 @@
1/* 1/*
2 * Copyright (c) 2008 Zhang Le <r0bertz@gentoo.org> 2 * Copyright (c) 2008 Zhang Le <r0bertz@gentoo.org>
3 * Copyright (c) 2009 Wu Zhangjin <wuzj@lemote.com> 3 * Copyright (c) 2009 Wu Zhangjin <wuzhangjin@gmail.com>
4 * 4 *
5 * This program is free software; you can redistribute it 5 * This program is free software; you can redistribute it
6 * and/or modify it under the terms of the GNU General 6 * and/or modify it under the terms of the GNU General
7 * Public License as published by the Free Software 7 * Public License as published by the Free Software
8 * Foundation; either version 2 of the License, or (at your 8 * Foundation; either version 2 of the License, or (at your
9 * option) any later version. 9 * option) any later version.
10 *
11 * This program is distributed in the hope that it will be
12 * useful, but WITHOUT ANY WARRANTY; without even the implied
13 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 * PURPOSE. See the GNU General Public License for more
15 * details.
16 *
17 * You should have received a copy of the GNU General Public
18 * License along with this program; if not, write to the Free
19 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA
20 * 02139, USA.
21 */ 10 */
22 11
23#ifndef __ASM_MACH_LOONGSON_PCI_H_ 12#ifndef __ASM_MACH_LOONGSON_PCI_H_
diff --git a/arch/mips/include/asm/mach-pb1x00/pb1100.h b/arch/mips/include/asm/mach-pb1x00/pb1100.h
deleted file mode 100644
index b1a60f1cbd02..000000000000
--- a/arch/mips/include/asm/mach-pb1x00/pb1100.h
+++ /dev/null
@@ -1,85 +0,0 @@
1/*
2 * Alchemy Semi Pb1100 Referrence Board
3 *
4 * Copyright 2001, 2008 MontaVista Software Inc.
5 * Author: MontaVista Software, Inc. <source@mvista.com>
6 *
7 * ########################################################################
8 *
9 * This program is free software; you can distribute it and/or modify it
10 * under the terms of the GNU General Public License (Version 2) as
11 * published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 * for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
21 *
22 * ########################################################################
23 *
24 *
25 */
26#ifndef __ASM_PB1100_H
27#define __ASM_PB1100_H
28
29#define PB1100_IDENT 0xAE000000
30#define BOARD_STATUS_REG 0xAE000004
31# define PB1100_ROM_SEL (1 << 15)
32# define PB1100_ROM_SIZ (1 << 14)
33# define PB1100_SWAP_BOOT (1 << 13)
34# define PB1100_FLASH_WP (1 << 12)
35# define PB1100_ROM_H_STS (1 << 11)
36# define PB1100_ROM_L_STS (1 << 10)
37# define PB1100_FLASH_H_STS (1 << 9)
38# define PB1100_FLASH_L_STS (1 << 8)
39# define PB1100_SRAM_SIZ (1 << 7)
40# define PB1100_TSC_BUSY (1 << 6)
41# define PB1100_PCMCIA_VS_MASK (3 << 4)
42# define PB1100_RS232_CD (1 << 3)
43# define PB1100_RS232_CTS (1 << 2)
44# define PB1100_RS232_DSR (1 << 1)
45# define PB1100_RS232_RI (1 << 0)
46
47#define PB1100_IRDA_RS232 0xAE00000C
48# define PB1100_IRDA_FULL (0 << 14) /* full power */
49# define PB1100_IRDA_SHUTDOWN (1 << 14)
50# define PB1100_IRDA_TT (2 << 14) /* 2/3 power */
51# define PB1100_IRDA_OT (3 << 14) /* 1/3 power */
52# define PB1100_IRDA_FIR (1 << 13)
53
54#define PCMCIA_BOARD_REG 0xAE000010
55# define PB1100_SD_WP1_RO (1 << 15) /* read only */
56# define PB1100_SD_WP0_RO (1 << 14) /* read only */
57# define PB1100_SD_PWR1 (1 << 11) /* applies power to SD1 */
58# define PB1100_SD_PWR0 (1 << 10) /* applies power to SD0 */
59# define PB1100_SEL_SD_CONN1 (1 << 9)
60# define PB1100_SEL_SD_CONN0 (1 << 8)
61# define PC_DEASSERT_RST (1 << 7)
62# define PC_DRV_EN (1 << 4)
63
64#define PB1100_G_CONTROL 0xAE000014 /* graphics control */
65
66#define PB1100_RST_VDDI 0xAE00001C
67# define PB1100_SOFT_RESET (1 << 15) /* clear to reset the board */
68# define PB1100_VDDI_MASK 0x1F
69
70#define PB1100_LEDS 0xAE000018
71
72/*
73 * 11:8 is 4 discreet LEDs. Clearing a bit illuminates the LED.
74 * 7:0 is the LED Display's decimal points.
75 */
76#define PB1100_HEX_LED 0xAE000018
77
78/* PCMCIA Pb1100 specific defines */
79#define PCMCIA_MAX_SOCK 0
80#define PCMCIA_NUM_SOCKS (PCMCIA_MAX_SOCK + 1)
81
82/* VPP/VCC */
83#define SET_VCC_VPP(VCC, VPP) (((VCC) << 2) | ((VPP) << 0))
84
85#endif /* __ASM_PB1100_H */
diff --git a/arch/mips/include/asm/mach-pb1x00/pb1200.h b/arch/mips/include/asm/mach-pb1x00/pb1200.h
index c8618df88cb5..962eb55dc880 100644
--- a/arch/mips/include/asm/mach-pb1x00/pb1200.h
+++ b/arch/mips/include/asm/mach-pb1x00/pb1200.h
@@ -25,6 +25,7 @@
25#define __ASM_PB1200_H 25#define __ASM_PB1200_H
26 26
27#include <linux/types.h> 27#include <linux/types.h>
28#include <asm/mach-au1x00/au1000.h>
28#include <asm/mach-au1x00/au1xxx_psc.h> 29#include <asm/mach-au1x00/au1xxx_psc.h>
29 30
30#define DBDMA_AC97_TX_CHAN DSCR_CMD0_PSC1_TX 31#define DBDMA_AC97_TX_CHAN DSCR_CMD0_PSC1_TX
@@ -43,113 +44,8 @@
43 * Refer to board documentation. 44 * Refer to board documentation.
44 */ 45 */
45#define AC97_PSC_BASE PSC1_BASE_ADDR 46#define AC97_PSC_BASE PSC1_BASE_ADDR
46#define I2S_PSC_BASE PSC1_BASE_ADDR 47#define I2S_PSC_BASE PSC1_BASE_ADDR
47 48
48#define BCSR_KSEG1_ADDR 0xAD800000
49
50typedef volatile struct
51{
52 /*00*/ u16 whoami;
53 u16 reserved0;
54 /*04*/ u16 status;
55 u16 reserved1;
56 /*08*/ u16 switches;
57 u16 reserved2;
58 /*0C*/ u16 resets;
59 u16 reserved3;
60
61 /*10*/ u16 pcmcia;
62 u16 reserved4;
63 /*14*/ u16 board;
64 u16 reserved5;
65 /*18*/ u16 disk_leds;
66 u16 reserved6;
67 /*1C*/ u16 system;
68 u16 reserved7;
69
70 /*20*/ u16 intclr;
71 u16 reserved8;
72 /*24*/ u16 intset;
73 u16 reserved9;
74 /*28*/ u16 intclr_mask;
75 u16 reserved10;
76 /*2C*/ u16 intset_mask;
77 u16 reserved11;
78
79 /*30*/ u16 sig_status;
80 u16 reserved12;
81 /*34*/ u16 int_status;
82 u16 reserved13;
83 /*38*/ u16 reserved14;
84 u16 reserved15;
85 /*3C*/ u16 reserved16;
86 u16 reserved17;
87
88} BCSR;
89
90static BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR;
91
92/*
93 * Register bit definitions for the BCSRs
94 */
95#define BCSR_WHOAMI_DCID 0x000F
96#define BCSR_WHOAMI_CPLD 0x00F0
97#define BCSR_WHOAMI_BOARD 0x0F00
98
99#define BCSR_STATUS_PCMCIA0VS 0x0003
100#define BCSR_STATUS_PCMCIA1VS 0x000C
101#define BCSR_STATUS_SWAPBOOT 0x0040
102#define BCSR_STATUS_FLASHBUSY 0x0100
103#define BCSR_STATUS_IDECBLID 0x0200
104#define BCSR_STATUS_SD0WP 0x0400
105#define BCSR_STATUS_SD1WP 0x0800
106#define BCSR_STATUS_U0RXD 0x1000
107#define BCSR_STATUS_U1RXD 0x2000
108
109#define BCSR_SWITCHES_OCTAL 0x00FF
110#define BCSR_SWITCHES_DIP_1 0x0080
111#define BCSR_SWITCHES_DIP_2 0x0040
112#define BCSR_SWITCHES_DIP_3 0x0020
113#define BCSR_SWITCHES_DIP_4 0x0010
114#define BCSR_SWITCHES_DIP_5 0x0008
115#define BCSR_SWITCHES_DIP_6 0x0004
116#define BCSR_SWITCHES_DIP_7 0x0002
117#define BCSR_SWITCHES_DIP_8 0x0001
118#define BCSR_SWITCHES_ROTARY 0x0F00
119
120#define BCSR_RESETS_ETH 0x0001
121#define BCSR_RESETS_CAMERA 0x0002
122#define BCSR_RESETS_DC 0x0004
123#define BCSR_RESETS_IDE 0x0008
124/* not resets but in the same register */
125#define BCSR_RESETS_WSCFSM 0x0800
126#define BCSR_RESETS_PCS0MUX 0x1000
127#define BCSR_RESETS_PCS1MUX 0x2000
128#define BCSR_RESETS_SPISEL 0x4000
129#define BCSR_RESETS_SD1MUX 0x8000
130
131#define BCSR_PCMCIA_PC0VPP 0x0003
132#define BCSR_PCMCIA_PC0VCC 0x000C
133#define BCSR_PCMCIA_PC0DRVEN 0x0010
134#define BCSR_PCMCIA_PC0RST 0x0080
135#define BCSR_PCMCIA_PC1VPP 0x0300
136#define BCSR_PCMCIA_PC1VCC 0x0C00
137#define BCSR_PCMCIA_PC1DRVEN 0x1000
138#define BCSR_PCMCIA_PC1RST 0x8000
139
140#define BCSR_BOARD_LCDVEE 0x0001
141#define BCSR_BOARD_LCDVDD 0x0002
142#define BCSR_BOARD_LCDBL 0x0004
143#define BCSR_BOARD_CAMSNAP 0x0010
144#define BCSR_BOARD_CAMPWR 0x0020
145#define BCSR_BOARD_SD0PWR 0x0040
146#define BCSR_BOARD_SD1PWR 0x0080
147
148#define BCSR_LEDS_DECIMALS 0x00FF
149#define BCSR_LEDS_LED0 0x0100
150#define BCSR_LEDS_LED1 0x0200
151#define BCSR_LEDS_LED2 0x0400
152#define BCSR_LEDS_LED3 0x0800
153 49
154#define BCSR_SYSTEM_VDDI 0x001F 50#define BCSR_SYSTEM_VDDI 0x001F
155#define BCSR_SYSTEM_POWEROFF 0x4000 51#define BCSR_SYSTEM_POWEROFF 0x4000
@@ -239,20 +135,6 @@ enum external_pb1200_ints {
239 PB1200_INT_END = PB1200_INT_BEGIN + 15 135 PB1200_INT_END = PB1200_INT_BEGIN + 15
240}; 136};
241 137
242/*
243 * Pb1200 specific PCMCIA defines for drivers/pcmcia/au1000_db1x00.c
244 */
245#define PCMCIA_MAX_SOCK 1
246#define PCMCIA_NUM_SOCKS (PCMCIA_MAX_SOCK + 1)
247
248/* VPP/VCC */
249#define SET_VCC_VPP(VCC, VPP, SLOT) \
250 ((((VCC) << 2) | ((VPP) << 0)) << ((SLOT) * 8))
251
252#define BOARD_PC0_INT PB1200_PC0_INT
253#define BOARD_PC1_INT PB1200_PC1_INT
254#define BOARD_CARD_INSERTED(SOCKET) bcsr->sig_status & (1 << (8 + (2 * SOCKET)))
255
256/* NAND chip select */ 138/* NAND chip select */
257#define NAND_CS 1 139#define NAND_CS 1
258 140
diff --git a/arch/mips/include/asm/mach-pb1x00/pb1500.h b/arch/mips/include/asm/mach-pb1x00/pb1500.h
deleted file mode 100644
index da51a2eb7b82..000000000000
--- a/arch/mips/include/asm/mach-pb1x00/pb1500.h
+++ /dev/null
@@ -1,49 +0,0 @@
1/*
2 * Alchemy Semi Pb1500 Referrence Board
3 *
4 * Copyright 2001, 2008 MontaVista Software Inc.
5 * Author: MontaVista Software, Inc. <source@mvista.com>
6 *
7 * ########################################################################
8 *
9 * This program is free software; you can distribute it and/or modify it
10 * under the terms of the GNU General Public License (Version 2) as
11 * published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 * for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
21 *
22 * ########################################################################
23 *
24 *
25 */
26#ifndef __ASM_PB1500_H
27#define __ASM_PB1500_H
28
29#define IDENT_BOARD_REG 0xAE000000
30#define BOARD_STATUS_REG 0xAE000004
31#define PCI_BOARD_REG 0xAE000010
32#define PCMCIA_BOARD_REG 0xAE000010
33# define PC_DEASSERT_RST 0x80
34# define PC_DRV_EN 0x10
35#define PB1500_G_CONTROL 0xAE000014
36#define PB1500_RST_VDDI 0xAE00001C
37#define PB1500_LEDS 0xAE000018
38
39#define PB1500_HEX_LED 0xAF000004
40#define PB1500_HEX_LED_BLANK 0xAF000008
41
42/* PCMCIA Pb1500 specific defines */
43#define PCMCIA_MAX_SOCK 0
44#define PCMCIA_NUM_SOCKS (PCMCIA_MAX_SOCK + 1)
45
46/* VPP/VCC */
47#define SET_VCC_VPP(VCC, VPP) (((VCC) << 2) | ((VPP) << 0))
48
49#endif /* __ASM_PB1500_H */
diff --git a/arch/mips/include/asm/mach-pb1x00/pb1550.h b/arch/mips/include/asm/mach-pb1x00/pb1550.h
index 6704a11497db..58796410bd6e 100644
--- a/arch/mips/include/asm/mach-pb1x00/pb1550.h
+++ b/arch/mips/include/asm/mach-pb1x00/pb1550.h
@@ -40,102 +40,6 @@
40#define SMBUS_PSC_BASE PSC2_BASE_ADDR 40#define SMBUS_PSC_BASE PSC2_BASE_ADDR
41#define I2S_PSC_BASE PSC3_BASE_ADDR 41#define I2S_PSC_BASE PSC3_BASE_ADDR
42 42
43#define BCSR_PHYS_ADDR 0xAF000000
44
45typedef volatile struct
46{
47 /*00*/ u16 whoami;
48 u16 reserved0;
49 /*04*/ u16 status;
50 u16 reserved1;
51 /*08*/ u16 switches;
52 u16 reserved2;
53 /*0C*/ u16 resets;
54 u16 reserved3;
55 /*10*/ u16 pcmcia;
56 u16 reserved4;
57 /*14*/ u16 pci;
58 u16 reserved5;
59 /*18*/ u16 leds;
60 u16 reserved6;
61 /*1C*/ u16 system;
62 u16 reserved7;
63
64} BCSR;
65
66static BCSR * const bcsr = (BCSR *)BCSR_PHYS_ADDR;
67
68/*
69 * Register bit definitions for the BCSRs
70 */
71#define BCSR_WHOAMI_DCID 0x000F
72#define BCSR_WHOAMI_CPLD 0x00F0
73#define BCSR_WHOAMI_BOARD 0x0F00
74
75#define BCSR_STATUS_PCMCIA0VS 0x0003
76#define BCSR_STATUS_PCMCIA1VS 0x000C
77#define BCSR_STATUS_PCMCIA0FI 0x0010
78#define BCSR_STATUS_PCMCIA1FI 0x0020
79#define BCSR_STATUS_SWAPBOOT 0x0040
80#define BCSR_STATUS_SRAMWIDTH 0x0080
81#define BCSR_STATUS_FLASHBUSY 0x0100
82#define BCSR_STATUS_ROMBUSY 0x0200
83#define BCSR_STATUS_USBOTGID 0x0800
84#define BCSR_STATUS_U0RXD 0x1000
85#define BCSR_STATUS_U1RXD 0x2000
86#define BCSR_STATUS_U3RXD 0x8000
87
88#define BCSR_SWITCHES_OCTAL 0x00FF
89#define BCSR_SWITCHES_DIP_1 0x0080
90#define BCSR_SWITCHES_DIP_2 0x0040
91#define BCSR_SWITCHES_DIP_3 0x0020
92#define BCSR_SWITCHES_DIP_4 0x0010
93#define BCSR_SWITCHES_DIP_5 0x0008
94#define BCSR_SWITCHES_DIP_6 0x0004
95#define BCSR_SWITCHES_DIP_7 0x0002
96#define BCSR_SWITCHES_DIP_8 0x0001
97#define BCSR_SWITCHES_ROTARY 0x0F00
98
99#define BCSR_RESETS_PHY0 0x0001
100#define BCSR_RESETS_PHY1 0x0002
101#define BCSR_RESETS_DC 0x0004
102#define BCSR_RESETS_WSC 0x2000
103#define BCSR_RESETS_SPISEL 0x4000
104#define BCSR_RESETS_DMAREQ 0x8000
105
106#define BCSR_PCMCIA_PC0VPP 0x0003
107#define BCSR_PCMCIA_PC0VCC 0x000C
108#define BCSR_PCMCIA_PC0DRVEN 0x0010
109#define BCSR_PCMCIA_PC0RST 0x0080
110#define BCSR_PCMCIA_PC1VPP 0x0300
111#define BCSR_PCMCIA_PC1VCC 0x0C00
112#define BCSR_PCMCIA_PC1DRVEN 0x1000
113#define BCSR_PCMCIA_PC1RST 0x8000
114
115#define BCSR_PCI_M66EN 0x0001
116#define BCSR_PCI_M33 0x0100
117#define BCSR_PCI_EXTERNARB 0x0200
118#define BCSR_PCI_GPIO200RST 0x0400
119#define BCSR_PCI_CLKOUT 0x0800
120#define BCSR_PCI_CFGHOST 0x1000
121
122#define BCSR_LEDS_DECIMALS 0x00FF
123#define BCSR_LEDS_LED0 0x0100
124#define BCSR_LEDS_LED1 0x0200
125#define BCSR_LEDS_LED2 0x0400
126#define BCSR_LEDS_LED3 0x0800
127
128#define BCSR_SYSTEM_VDDI 0x001F
129#define BCSR_SYSTEM_POWEROFF 0x4000
130#define BCSR_SYSTEM_RESET 0x8000
131
132#define PCMCIA_MAX_SOCK 1
133#define PCMCIA_NUM_SOCKS (PCMCIA_MAX_SOCK + 1)
134
135/* VPP/VCC */
136#define SET_VCC_VPP(VCC, VPP, SLOT) \
137 ((((VCC) << 2) | ((VPP) << 0)) << ((SLOT) * 8))
138
139#if defined(CONFIG_MTD_PB1550_BOOT) && defined(CONFIG_MTD_PB1550_USER) 43#if defined(CONFIG_MTD_PB1550_BOOT) && defined(CONFIG_MTD_PB1550_USER)
140#define PB1550_BOTH_BANKS 44#define PB1550_BOTH_BANKS
141#elif defined(CONFIG_MTD_PB1550_BOOT) && !defined(CONFIG_MTD_PB1550_USER) 45#elif defined(CONFIG_MTD_PB1550_BOOT) && !defined(CONFIG_MTD_PB1550_USER)
diff --git a/arch/mips/include/asm/mach-pnx833x/irq-mapping.h b/arch/mips/include/asm/mach-pnx833x/irq-mapping.h
index 657f089b1724..6d70264557b2 100644
--- a/arch/mips/include/asm/mach-pnx833x/irq-mapping.h
+++ b/arch/mips/include/asm/mach-pnx833x/irq-mapping.h
@@ -123,4 +123,3 @@
123#define PNX833X_GPIO_15_INT (PNX833X_GPIO_IRQ_BASE + 15) 123#define PNX833X_GPIO_15_INT (PNX833X_GPIO_IRQ_BASE + 15)
124 124
125#endif 125#endif
126
diff --git a/arch/mips/include/asm/mach-powertv/interrupts.h b/arch/mips/include/asm/mach-powertv/interrupts.h
index 629a57413657..4fd652ceb52a 100644
--- a/arch/mips/include/asm/mach-powertv/interrupts.h
+++ b/arch/mips/include/asm/mach-powertv/interrupts.h
@@ -251,4 +251,3 @@
251 * channel 3. */ 251 * channel 3. */
252#define irq_mpeg_d (ibase+0) /* MPEG Decoder Interrupt */ 252#define irq_mpeg_d (ibase+0) /* MPEG Decoder Interrupt */
253#endif /* _ASM_MACH_POWERTV_INTERRUPTS_H_ */ 253#endif /* _ASM_MACH_POWERTV_INTERRUPTS_H_ */
254
diff --git a/arch/mips/include/asm/mipsregs.h b/arch/mips/include/asm/mipsregs.h
index f4ab3139d737..49382d5e891a 100644
--- a/arch/mips/include/asm/mipsregs.h
+++ b/arch/mips/include/asm/mipsregs.h
@@ -251,6 +251,14 @@
251#define PL_256M 28 251#define PL_256M 28
252 252
253/* 253/*
254 * PageGrain bits
255 */
256#define PG_RIE (_ULCAST_(1) << 31)
257#define PG_XIE (_ULCAST_(1) << 30)
258#define PG_ELPA (_ULCAST_(1) << 29)
259#define PG_ESP (_ULCAST_(1) << 28)
260
261/*
254 * R4x00 interrupt enable / cause bits 262 * R4x00 interrupt enable / cause bits
255 */ 263 */
256#define IE_SW0 (_ULCAST_(1) << 8) 264#define IE_SW0 (_ULCAST_(1) << 8)
@@ -576,6 +584,10 @@
576#define MIPS_CONF3_DSP (_ULCAST_(1) << 10) 584#define MIPS_CONF3_DSP (_ULCAST_(1) << 10)
577#define MIPS_CONF3_ULRI (_ULCAST_(1) << 13) 585#define MIPS_CONF3_ULRI (_ULCAST_(1) << 13)
578 586
587#define MIPS_CONF4_MMUSIZEEXT (_ULCAST_(255) << 0)
588#define MIPS_CONF4_MMUEXTDEF (_ULCAST_(3) << 14)
589#define MIPS_CONF4_MMUEXTDEF_MMUSIZEEXT (_ULCAST_(1) << 14)
590
579#define MIPS_CONF7_WII (_ULCAST_(1) << 31) 591#define MIPS_CONF7_WII (_ULCAST_(1) << 31)
580 592
581#define MIPS_CONF7_RPS (_ULCAST_(1) << 2) 593#define MIPS_CONF7_RPS (_ULCAST_(1) << 2)
@@ -826,6 +838,9 @@ do { \
826#define read_c0_pagemask() __read_32bit_c0_register($5, 0) 838#define read_c0_pagemask() __read_32bit_c0_register($5, 0)
827#define write_c0_pagemask(val) __write_32bit_c0_register($5, 0, val) 839#define write_c0_pagemask(val) __write_32bit_c0_register($5, 0, val)
828 840
841#define read_c0_pagegrain() __read_32bit_c0_register($5, 1)
842#define write_c0_pagegrain(val) __write_32bit_c0_register($5, 1, val)
843
829#define read_c0_wired() __read_32bit_c0_register($6, 0) 844#define read_c0_wired() __read_32bit_c0_register($6, 0)
830#define write_c0_wired(val) __write_32bit_c0_register($6, 0, val) 845#define write_c0_wired(val) __write_32bit_c0_register($6, 0, val)
831 846
diff --git a/arch/mips/include/asm/msc01_ic.h b/arch/mips/include/asm/msc01_ic.h
index 7989b9ffc1d2..d92406ae2841 100644
--- a/arch/mips/include/asm/msc01_ic.h
+++ b/arch/mips/include/asm/msc01_ic.h
@@ -145,4 +145,3 @@ extern void __init init_msc_irqs(unsigned long icubase, unsigned int base, msc_i
145extern void ll_msc_irq(void); 145extern void ll_msc_irq(void);
146 146
147#endif /* __ASM_MIPS_BOARDS_MSC01_IC_H */ 147#endif /* __ASM_MIPS_BOARDS_MSC01_IC_H */
148
diff --git a/arch/mips/include/asm/nile4.h b/arch/mips/include/asm/nile4.h
index c3ca959aa4d9..af0e51a9f68a 100644
--- a/arch/mips/include/asm/nile4.h
+++ b/arch/mips/include/asm/nile4.h
@@ -307,4 +307,3 @@ extern u8 nile4_i8259_iack(void);
307extern void nile4_dump_irq_status(void); /* Debug */ 307extern void nile4_dump_irq_status(void); /* Debug */
308 308
309#endif 309#endif
310
diff --git a/arch/mips/include/asm/octeon/octeon-feature.h b/arch/mips/include/asm/octeon/octeon-feature.h
index ef24a7b4ea57..cba6fbed9f43 100644
--- a/arch/mips/include/asm/octeon/octeon-feature.h
+++ b/arch/mips/include/asm/octeon/octeon-feature.h
@@ -99,6 +99,8 @@ static inline int octeon_has_feature(enum octeon_feature feature)
99 return !cvmx_fuse_read(90); 99 return !cvmx_fuse_read(90);
100 100
101 case OCTEON_FEATURE_PCIE: 101 case OCTEON_FEATURE_PCIE:
102 case OCTEON_FEATURE_MGMT_PORT:
103 case OCTEON_FEATURE_RAID:
102 return OCTEON_IS_MODEL(OCTEON_CN56XX) 104 return OCTEON_IS_MODEL(OCTEON_CN56XX)
103 || OCTEON_IS_MODEL(OCTEON_CN52XX); 105 || OCTEON_IS_MODEL(OCTEON_CN52XX);
104 106
@@ -110,12 +112,6 @@ static inline int octeon_has_feature(enum octeon_feature feature)
110 case OCTEON_FEATURE_TRA: 112 case OCTEON_FEATURE_TRA:
111 return !(OCTEON_IS_MODEL(OCTEON_CN30XX) 113 return !(OCTEON_IS_MODEL(OCTEON_CN30XX)
112 || OCTEON_IS_MODEL(OCTEON_CN50XX)); 114 || OCTEON_IS_MODEL(OCTEON_CN50XX));
113 case OCTEON_FEATURE_MGMT_PORT:
114 return OCTEON_IS_MODEL(OCTEON_CN56XX)
115 || OCTEON_IS_MODEL(OCTEON_CN52XX);
116 case OCTEON_FEATURE_RAID:
117 return OCTEON_IS_MODEL(OCTEON_CN56XX)
118 || OCTEON_IS_MODEL(OCTEON_CN52XX);
119 case OCTEON_FEATURE_USB: 115 case OCTEON_FEATURE_USB:
120 return !(OCTEON_IS_MODEL(OCTEON_CN38XX) 116 return !(OCTEON_IS_MODEL(OCTEON_CN38XX)
121 || OCTEON_IS_MODEL(OCTEON_CN58XX)); 117 || OCTEON_IS_MODEL(OCTEON_CN58XX));
diff --git a/arch/mips/include/asm/octeon/octeon.h b/arch/mips/include/asm/octeon/octeon.h
index 4d0a8c61fc3e..ca6214b5ccb9 100644
--- a/arch/mips/include/asm/octeon/octeon.h
+++ b/arch/mips/include/asm/octeon/octeon.h
@@ -213,6 +213,11 @@ struct octeon_cf_data {
213 int dma_engine; /* -1 for no DMA */ 213 int dma_engine; /* -1 for no DMA */
214}; 214};
215 215
216struct octeon_i2c_data {
217 unsigned int sys_freq;
218 unsigned int i2c_freq;
219};
220
216extern void octeon_write_lcd(const char *s); 221extern void octeon_write_lcd(const char *s);
217extern void octeon_check_cpu_bist(void); 222extern void octeon_check_cpu_bist(void);
218extern int octeon_get_boot_debug_flag(void); 223extern int octeon_get_boot_debug_flag(void);
diff --git a/arch/mips/include/asm/page.h b/arch/mips/include/asm/page.h
index f266295cce51..ac32572430f4 100644
--- a/arch/mips/include/asm/page.h
+++ b/arch/mips/include/asm/page.h
@@ -107,18 +107,6 @@ typedef struct { unsigned long pte; } pte_t;
107typedef struct page *pgtable_t; 107typedef struct page *pgtable_t;
108 108
109/* 109/*
110 * For 3-level pagetables we defines these ourselves, for 2-level the
111 * definitions are supplied by <asm-generic/pgtable-nopmd.h>.
112 */
113#ifdef CONFIG_64BIT
114
115typedef struct { unsigned long pmd; } pmd_t;
116#define pmd_val(x) ((x).pmd)
117#define __pmd(x) ((pmd_t) { (x) } )
118
119#endif
120
121/*
122 * Right now we don't support 4-level pagetables, so all pud-related 110 * Right now we don't support 4-level pagetables, so all pud-related
123 * definitions come from <asm-generic/pgtable-nopud.h>. 111 * definitions come from <asm-generic/pgtable-nopud.h>.
124 */ 112 */
diff --git a/arch/mips/include/asm/param.h b/arch/mips/include/asm/param.h
index 1d9bb8c5ab24..da3920fce9ad 100644
--- a/arch/mips/include/asm/param.h
+++ b/arch/mips/include/asm/param.h
@@ -9,23 +9,8 @@
9#ifndef _ASM_PARAM_H 9#ifndef _ASM_PARAM_H
10#define _ASM_PARAM_H 10#define _ASM_PARAM_H
11 11
12#ifdef __KERNEL__
13
14# define HZ CONFIG_HZ /* Internal kernel timer frequency */
15# define USER_HZ 100 /* .. some user interfaces are in "ticks" */
16# define CLOCKS_PER_SEC (USER_HZ) /* like times() */
17#endif
18
19#ifndef HZ
20#define HZ 100
21#endif
22
23#define EXEC_PAGESIZE 65536 12#define EXEC_PAGESIZE 65536
24 13
25#ifndef NOGROUP 14#include <asm-generic/param.h>
26#define NOGROUP (-1)
27#endif
28
29#define MAXHOSTNAMELEN 64 /* max length of hostname */
30 15
31#endif /* _ASM_PARAM_H */ 16#endif /* _ASM_PARAM_H */
diff --git a/arch/mips/include/asm/parport.h b/arch/mips/include/asm/parport.h
index f52656826cce..cf252af64590 100644
--- a/arch/mips/include/asm/parport.h
+++ b/arch/mips/include/asm/parport.h
@@ -1,15 +1 @@
1/* #include <asm-generic/parport.h>
2 * Copyright (C) 1999, 2000 Tim Waugh <tim@cyberelk.demon.co.uk>
3 *
4 * This file should only be included by drivers/parport/parport_pc.c.
5 */
6#ifndef _ASM_PARPORT_H
7#define _ASM_PARPORT_H
8
9static int __devinit parport_pc_find_isa_ports(int autoirq, int autodma);
10static int __devinit parport_pc_find_nonpci_ports(int autoirq, int autodma)
11{
12 return parport_pc_find_isa_ports(autoirq, autodma);
13}
14
15#endif /* _ASM_PARPORT_H */
diff --git a/arch/mips/include/asm/pgalloc.h b/arch/mips/include/asm/pgalloc.h
index 3738f4b48cbd..881d18b4e298 100644
--- a/arch/mips/include/asm/pgalloc.h
+++ b/arch/mips/include/asm/pgalloc.h
@@ -31,7 +31,7 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd,
31 */ 31 */
32extern void pmd_init(unsigned long page, unsigned long pagetable); 32extern void pmd_init(unsigned long page, unsigned long pagetable);
33 33
34#ifdef CONFIG_64BIT 34#ifndef __PAGETABLE_PMD_FOLDED
35 35
36static inline void pud_populate(struct mm_struct *mm, pud_t *pud, pmd_t *pmd) 36static inline void pud_populate(struct mm_struct *mm, pud_t *pud, pmd_t *pmd)
37{ 37{
@@ -104,7 +104,7 @@ do { \
104 tlb_remove_page((tlb), pte); \ 104 tlb_remove_page((tlb), pte); \
105} while (0) 105} while (0)
106 106
107#ifdef CONFIG_64BIT 107#ifndef __PAGETABLE_PMD_FOLDED
108 108
109static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address) 109static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address)
110{ 110{
diff --git a/arch/mips/include/asm/pgtable-32.h b/arch/mips/include/asm/pgtable-32.h
index 55813d6150c7..ae90412556d0 100644
--- a/arch/mips/include/asm/pgtable-32.h
+++ b/arch/mips/include/asm/pgtable-32.h
@@ -127,8 +127,8 @@ pfn_pte(unsigned long pfn, pgprot_t prot)
127#define pte_pfn(x) ((unsigned long)((x).pte >> (PAGE_SHIFT + 2))) 127#define pte_pfn(x) ((unsigned long)((x).pte >> (PAGE_SHIFT + 2)))
128#define pfn_pte(pfn, prot) __pte(((pfn) << (PAGE_SHIFT + 2)) | pgprot_val(prot)) 128#define pfn_pte(pfn, prot) __pte(((pfn) << (PAGE_SHIFT + 2)) | pgprot_val(prot))
129#else 129#else
130#define pte_pfn(x) ((unsigned long)((x).pte >> PAGE_SHIFT)) 130#define pte_pfn(x) ((unsigned long)((x).pte >> _PFN_SHIFT))
131#define pfn_pte(pfn, prot) __pte(((unsigned long long)(pfn) << PAGE_SHIFT) | pgprot_val(prot)) 131#define pfn_pte(pfn, prot) __pte(((unsigned long long)(pfn) << _PFN_SHIFT) | pgprot_val(prot))
132#endif 132#endif
133#endif /* defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32) */ 133#endif /* defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32) */
134 134
diff --git a/arch/mips/include/asm/pgtable-64.h b/arch/mips/include/asm/pgtable-64.h
index 8eda30b467da..26dc69d792a6 100644
--- a/arch/mips/include/asm/pgtable-64.h
+++ b/arch/mips/include/asm/pgtable-64.h
@@ -16,7 +16,11 @@
16#include <asm/cachectl.h> 16#include <asm/cachectl.h>
17#include <asm/fixmap.h> 17#include <asm/fixmap.h>
18 18
19#ifdef CONFIG_PAGE_SIZE_64KB
20#include <asm-generic/pgtable-nopmd.h>
21#else
19#include <asm-generic/pgtable-nopud.h> 22#include <asm-generic/pgtable-nopud.h>
23#endif
20 24
21/* 25/*
22 * Each address space has 2 4K pages as its page directory, giving 1024 26 * Each address space has 2 4K pages as its page directory, giving 1024
@@ -37,13 +41,20 @@
37 * fault address - VMALLOC_START. 41 * fault address - VMALLOC_START.
38 */ 42 */
39 43
44
45/* PGDIR_SHIFT determines what a third-level page table entry can map */
46#ifdef __PAGETABLE_PMD_FOLDED
47#define PGDIR_SHIFT (PAGE_SHIFT + PAGE_SHIFT + PTE_ORDER - 3)
48#else
49
40/* PMD_SHIFT determines the size of the area a second-level page table can map */ 50/* PMD_SHIFT determines the size of the area a second-level page table can map */
41#define PMD_SHIFT (PAGE_SHIFT + (PAGE_SHIFT + PTE_ORDER - 3)) 51#define PMD_SHIFT (PAGE_SHIFT + (PAGE_SHIFT + PTE_ORDER - 3))
42#define PMD_SIZE (1UL << PMD_SHIFT) 52#define PMD_SIZE (1UL << PMD_SHIFT)
43#define PMD_MASK (~(PMD_SIZE-1)) 53#define PMD_MASK (~(PMD_SIZE-1))
44 54
45/* PGDIR_SHIFT determines what a third-level page table entry can map */ 55
46#define PGDIR_SHIFT (PMD_SHIFT + (PAGE_SHIFT + PMD_ORDER - 3)) 56#define PGDIR_SHIFT (PMD_SHIFT + (PAGE_SHIFT + PMD_ORDER - 3))
57#endif
47#define PGDIR_SIZE (1UL << PGDIR_SHIFT) 58#define PGDIR_SIZE (1UL << PGDIR_SHIFT)
48#define PGDIR_MASK (~(PGDIR_SIZE-1)) 59#define PGDIR_MASK (~(PGDIR_SIZE-1))
49 60
@@ -92,12 +103,14 @@
92#ifdef CONFIG_PAGE_SIZE_64KB 103#ifdef CONFIG_PAGE_SIZE_64KB
93#define PGD_ORDER 0 104#define PGD_ORDER 0
94#define PUD_ORDER aieeee_attempt_to_allocate_pud 105#define PUD_ORDER aieeee_attempt_to_allocate_pud
95#define PMD_ORDER 0 106#define PMD_ORDER aieeee_attempt_to_allocate_pmd
96#define PTE_ORDER 0 107#define PTE_ORDER 0
97#endif 108#endif
98 109
99#define PTRS_PER_PGD ((PAGE_SIZE << PGD_ORDER) / sizeof(pgd_t)) 110#define PTRS_PER_PGD ((PAGE_SIZE << PGD_ORDER) / sizeof(pgd_t))
111#ifndef __PAGETABLE_PMD_FOLDED
100#define PTRS_PER_PMD ((PAGE_SIZE << PMD_ORDER) / sizeof(pmd_t)) 112#define PTRS_PER_PMD ((PAGE_SIZE << PMD_ORDER) / sizeof(pmd_t))
113#endif
101#define PTRS_PER_PTE ((PAGE_SIZE << PTE_ORDER) / sizeof(pte_t)) 114#define PTRS_PER_PTE ((PAGE_SIZE << PTE_ORDER) / sizeof(pte_t))
102 115
103#if PGDIR_SIZE >= TASK_SIZE 116#if PGDIR_SIZE >= TASK_SIZE
@@ -122,15 +135,30 @@
122 135
123#define pte_ERROR(e) \ 136#define pte_ERROR(e) \
124 printk("%s:%d: bad pte %016lx.\n", __FILE__, __LINE__, pte_val(e)) 137 printk("%s:%d: bad pte %016lx.\n", __FILE__, __LINE__, pte_val(e))
138#ifndef __PAGETABLE_PMD_FOLDED
125#define pmd_ERROR(e) \ 139#define pmd_ERROR(e) \
126 printk("%s:%d: bad pmd %016lx.\n", __FILE__, __LINE__, pmd_val(e)) 140 printk("%s:%d: bad pmd %016lx.\n", __FILE__, __LINE__, pmd_val(e))
141#endif
127#define pgd_ERROR(e) \ 142#define pgd_ERROR(e) \
128 printk("%s:%d: bad pgd %016lx.\n", __FILE__, __LINE__, pgd_val(e)) 143 printk("%s:%d: bad pgd %016lx.\n", __FILE__, __LINE__, pgd_val(e))
129 144
130extern pte_t invalid_pte_table[PTRS_PER_PTE]; 145extern pte_t invalid_pte_table[PTRS_PER_PTE];
131extern pte_t empty_bad_page_table[PTRS_PER_PTE]; 146extern pte_t empty_bad_page_table[PTRS_PER_PTE];
147
148
149#ifndef __PAGETABLE_PMD_FOLDED
150/*
151 * For 3-level pagetables we defines these ourselves, for 2-level the
152 * definitions are supplied by <asm-generic/pgtable-nopmd.h>.
153 */
154typedef struct { unsigned long pmd; } pmd_t;
155#define pmd_val(x) ((x).pmd)
156#define __pmd(x) ((pmd_t) { (x) } )
157
158
132extern pmd_t invalid_pmd_table[PTRS_PER_PMD]; 159extern pmd_t invalid_pmd_table[PTRS_PER_PMD];
133extern pmd_t empty_bad_pmd_table[PTRS_PER_PMD]; 160extern pmd_t empty_bad_pmd_table[PTRS_PER_PMD];
161#endif
134 162
135/* 163/*
136 * Empty pgd/pmd entries point to the invalid_pte_table. 164 * Empty pgd/pmd entries point to the invalid_pte_table.
@@ -151,6 +179,7 @@ static inline void pmd_clear(pmd_t *pmdp)
151{ 179{
152 pmd_val(*pmdp) = ((unsigned long) invalid_pte_table); 180 pmd_val(*pmdp) = ((unsigned long) invalid_pte_table);
153} 181}
182#ifndef __PAGETABLE_PMD_FOLDED
154 183
155/* 184/*
156 * Empty pud entries point to the invalid_pmd_table. 185 * Empty pud entries point to the invalid_pmd_table.
@@ -174,6 +203,7 @@ static inline void pud_clear(pud_t *pudp)
174{ 203{
175 pud_val(*pudp) = ((unsigned long) invalid_pmd_table); 204 pud_val(*pudp) = ((unsigned long) invalid_pmd_table);
176} 205}
206#endif
177 207
178#define pte_page(x) pfn_to_page(pte_pfn(x)) 208#define pte_page(x) pfn_to_page(pte_pfn(x))
179 209
@@ -181,8 +211,8 @@ static inline void pud_clear(pud_t *pudp)
181#define pte_pfn(x) ((unsigned long)((x).pte >> (PAGE_SHIFT + 2))) 211#define pte_pfn(x) ((unsigned long)((x).pte >> (PAGE_SHIFT + 2)))
182#define pfn_pte(pfn, prot) __pte(((pfn) << (PAGE_SHIFT + 2)) | pgprot_val(prot)) 212#define pfn_pte(pfn, prot) __pte(((pfn) << (PAGE_SHIFT + 2)) | pgprot_val(prot))
183#else 213#else
184#define pte_pfn(x) ((unsigned long)((x).pte >> PAGE_SHIFT)) 214#define pte_pfn(x) ((unsigned long)((x).pte >> _PFN_SHIFT))
185#define pfn_pte(pfn, prot) __pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot)) 215#define pfn_pte(pfn, prot) __pte(((pfn) << _PFN_SHIFT) | pgprot_val(prot))
186#endif 216#endif
187 217
188#define __pgd_offset(address) pgd_index(address) 218#define __pgd_offset(address) pgd_index(address)
@@ -198,6 +228,7 @@ static inline void pud_clear(pud_t *pudp)
198/* to find an entry in a page-table-directory */ 228/* to find an entry in a page-table-directory */
199#define pgd_offset(mm, addr) ((mm)->pgd + pgd_index(addr)) 229#define pgd_offset(mm, addr) ((mm)->pgd + pgd_index(addr))
200 230
231#ifndef __PAGETABLE_PMD_FOLDED
201static inline unsigned long pud_page_vaddr(pud_t pud) 232static inline unsigned long pud_page_vaddr(pud_t pud)
202{ 233{
203 return pud_val(pud); 234 return pud_val(pud);
@@ -210,6 +241,7 @@ static inline pmd_t *pmd_offset(pud_t * pud, unsigned long address)
210{ 241{
211 return (pmd_t *) pud_page_vaddr(*pud) + pmd_index(address); 242 return (pmd_t *) pud_page_vaddr(*pud) + pmd_index(address);
212} 243}
244#endif
213 245
214/* Find an entry in the third-level page table.. */ 246/* Find an entry in the third-level page table.. */
215#define __pte_offset(address) \ 247#define __pte_offset(address) \
diff --git a/arch/mips/include/asm/pgtable-bits.h b/arch/mips/include/asm/pgtable-bits.h
index 1073e6df8621..e9fe7e97ce4c 100644
--- a/arch/mips/include/asm/pgtable-bits.h
+++ b/arch/mips/include/asm/pgtable-bits.h
@@ -50,7 +50,7 @@
50#define _CACHE_SHIFT 3 50#define _CACHE_SHIFT 3
51#define _CACHE_MASK (7<<3) 51#define _CACHE_MASK (7<<3)
52 52
53#else 53#elif defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX)
54 54
55#define _PAGE_PRESENT (1<<0) /* implemented in software */ 55#define _PAGE_PRESENT (1<<0) /* implemented in software */
56#define _PAGE_READ (1<<1) /* implemented in software */ 56#define _PAGE_READ (1<<1) /* implemented in software */
@@ -59,8 +59,6 @@
59#define _PAGE_MODIFIED (1<<4) /* implemented in software */ 59#define _PAGE_MODIFIED (1<<4) /* implemented in software */
60#define _PAGE_FILE (1<<4) /* set:pagecache unset:swap */ 60#define _PAGE_FILE (1<<4) /* set:pagecache unset:swap */
61 61
62#if defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX)
63
64#define _PAGE_GLOBAL (1<<8) 62#define _PAGE_GLOBAL (1<<8)
65#define _PAGE_VALID (1<<9) 63#define _PAGE_VALID (1<<9)
66#define _PAGE_SILENT_READ (1<<9) /* synonym */ 64#define _PAGE_SILENT_READ (1<<9) /* synonym */
@@ -69,21 +67,113 @@
69#define _CACHE_UNCACHED (1<<11) 67#define _CACHE_UNCACHED (1<<11)
70#define _CACHE_MASK (1<<11) 68#define _CACHE_MASK (1<<11)
71 69
70#else /* 'Normal' r4K case */
71/*
72 * When using the RI/XI bit support, we have 13 bits of flags below
73 * the physical address. The RI/XI bits are placed such that a SRL 5
74 * can strip off the software bits, then a ROTR 2 can move the RI/XI
75 * into bits [63:62]. This also limits physical address to 56 bits,
76 * which is more than we need right now.
77 */
78
79/* implemented in software */
80#define _PAGE_PRESENT_SHIFT (0)
81#define _PAGE_PRESENT (1 << _PAGE_PRESENT_SHIFT)
82/* implemented in software, should be unused if kernel_uses_smartmips_rixi. */
83#define _PAGE_READ_SHIFT (kernel_uses_smartmips_rixi ? _PAGE_PRESENT_SHIFT : _PAGE_PRESENT_SHIFT + 1)
84#define _PAGE_READ ({if (kernel_uses_smartmips_rixi) BUG(); 1 << _PAGE_READ_SHIFT; })
85/* implemented in software */
86#define _PAGE_WRITE_SHIFT (_PAGE_READ_SHIFT + 1)
87#define _PAGE_WRITE (1 << _PAGE_WRITE_SHIFT)
88/* implemented in software */
89#define _PAGE_ACCESSED_SHIFT (_PAGE_WRITE_SHIFT + 1)
90#define _PAGE_ACCESSED (1 << _PAGE_ACCESSED_SHIFT)
91/* implemented in software */
92#define _PAGE_MODIFIED_SHIFT (_PAGE_ACCESSED_SHIFT + 1)
93#define _PAGE_MODIFIED (1 << _PAGE_MODIFIED_SHIFT)
94/* set:pagecache unset:swap */
95#define _PAGE_FILE (_PAGE_MODIFIED)
96
97#ifdef CONFIG_HUGETLB_PAGE
98/* huge tlb page */
99#define _PAGE_HUGE_SHIFT (_PAGE_MODIFIED_SHIFT + 1)
100#define _PAGE_HUGE (1 << _PAGE_HUGE_SHIFT)
72#else 101#else
102#define _PAGE_HUGE_SHIFT (_PAGE_MODIFIED_SHIFT)
103#define _PAGE_HUGE ({BUG(); 1; }) /* Dummy value */
104#endif
73 105
74#define _PAGE_R4KBUG (1<<5) /* workaround for r4k bug */ 106/* Page cannot be executed */
75#define _PAGE_HUGE (1<<5) /* huge tlb page */ 107#define _PAGE_NO_EXEC_SHIFT (kernel_uses_smartmips_rixi ? _PAGE_HUGE_SHIFT + 1 : _PAGE_HUGE_SHIFT)
76#define _PAGE_GLOBAL (1<<6) 108#define _PAGE_NO_EXEC ({if (!kernel_uses_smartmips_rixi) BUG(); 1 << _PAGE_NO_EXEC_SHIFT; })
77#define _PAGE_VALID (1<<7) 109
78#define _PAGE_SILENT_READ (1<<7) /* synonym */ 110/* Page cannot be read */
79#define _PAGE_DIRTY (1<<8) /* The MIPS dirty bit */ 111#define _PAGE_NO_READ_SHIFT (kernel_uses_smartmips_rixi ? _PAGE_NO_EXEC_SHIFT + 1 : _PAGE_NO_EXEC_SHIFT)
80#define _PAGE_SILENT_WRITE (1<<8) 112#define _PAGE_NO_READ ({if (!kernel_uses_smartmips_rixi) BUG(); 1 << _PAGE_NO_READ_SHIFT; })
81#define _CACHE_SHIFT 9 113
82#define _CACHE_MASK (7<<9) 114#define _PAGE_GLOBAL_SHIFT (_PAGE_NO_READ_SHIFT + 1)
115#define _PAGE_GLOBAL (1 << _PAGE_GLOBAL_SHIFT)
116
117#define _PAGE_VALID_SHIFT (_PAGE_GLOBAL_SHIFT + 1)
118#define _PAGE_VALID (1 << _PAGE_VALID_SHIFT)
119/* synonym */
120#define _PAGE_SILENT_READ (_PAGE_VALID)
121
122/* The MIPS dirty bit */
123#define _PAGE_DIRTY_SHIFT (_PAGE_VALID_SHIFT + 1)
124#define _PAGE_DIRTY (1 << _PAGE_DIRTY_SHIFT)
125#define _PAGE_SILENT_WRITE (_PAGE_DIRTY)
126
127#define _CACHE_SHIFT (_PAGE_DIRTY_SHIFT + 1)
128#define _CACHE_MASK (7 << _CACHE_SHIFT)
129
130#define _PFN_SHIFT (PAGE_SHIFT - 12 + _CACHE_SHIFT + 3)
83 131
84#endif
85#endif /* defined(CONFIG_64BIT_PHYS_ADDR && defined(CONFIG_CPU_MIPS32) */ 132#endif /* defined(CONFIG_64BIT_PHYS_ADDR && defined(CONFIG_CPU_MIPS32) */
86 133
134#ifndef _PFN_SHIFT
135#define _PFN_SHIFT PAGE_SHIFT
136#endif
137#define _PFN_MASK (~((1 << (_PFN_SHIFT)) - 1))
138
139#ifndef _PAGE_NO_READ
140#define _PAGE_NO_READ ({BUG(); 0; })
141#define _PAGE_NO_READ_SHIFT ({BUG(); 0; })
142#endif
143#ifndef _PAGE_NO_EXEC
144#define _PAGE_NO_EXEC ({BUG(); 0; })
145#endif
146#ifndef _PAGE_GLOBAL_SHIFT
147#define _PAGE_GLOBAL_SHIFT ilog2(_PAGE_GLOBAL)
148#endif
149
150
151#ifndef __ASSEMBLY__
152/*
153 * pte_to_entrylo converts a page table entry (PTE) into a Mips
154 * entrylo0/1 value.
155 */
156static inline uint64_t pte_to_entrylo(unsigned long pte_val)
157{
158 if (kernel_uses_smartmips_rixi) {
159 int sa;
160#ifdef CONFIG_32BIT
161 sa = 31 - _PAGE_NO_READ_SHIFT;
162#else
163 sa = 63 - _PAGE_NO_READ_SHIFT;
164#endif
165 /*
166 * C has no way to express that this is a DSRL
167 * _PAGE_NO_EXEC_SHIFT followed by a ROTR 2. Luckily
168 * in the fast path this is done in assembly
169 */
170 return (pte_val >> _PAGE_GLOBAL_SHIFT) |
171 ((pte_val & (_PAGE_NO_EXEC | _PAGE_NO_READ)) << sa);
172 }
173
174 return pte_val >> _PAGE_GLOBAL_SHIFT;
175}
176#endif
87 177
88/* 178/*
89 * Cache attributes 179 * Cache attributes
@@ -130,9 +220,9 @@
130 220
131#endif 221#endif
132 222
133#define __READABLE (_PAGE_READ | _PAGE_SILENT_READ | _PAGE_ACCESSED) 223#define __READABLE (_PAGE_SILENT_READ | _PAGE_ACCESSED | (kernel_uses_smartmips_rixi ? 0 : _PAGE_READ))
134#define __WRITEABLE (_PAGE_WRITE | _PAGE_SILENT_WRITE | _PAGE_MODIFIED) 224#define __WRITEABLE (_PAGE_WRITE | _PAGE_SILENT_WRITE | _PAGE_MODIFIED)
135 225
136#define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_MODIFIED | _CACHE_MASK) 226#define _PAGE_CHG_MASK (_PFN_MASK | _PAGE_ACCESSED | _PAGE_MODIFIED | _CACHE_MASK)
137 227
138#endif /* _ASM_PGTABLE_BITS_H */ 228#endif /* _ASM_PGTABLE_BITS_H */
diff --git a/arch/mips/include/asm/pgtable.h b/arch/mips/include/asm/pgtable.h
index 1854336e56a2..7e40f3778179 100644
--- a/arch/mips/include/asm/pgtable.h
+++ b/arch/mips/include/asm/pgtable.h
@@ -22,23 +22,24 @@ struct mm_struct;
22struct vm_area_struct; 22struct vm_area_struct;
23 23
24#define PAGE_NONE __pgprot(_PAGE_PRESENT | _CACHE_CACHABLE_NONCOHERENT) 24#define PAGE_NONE __pgprot(_PAGE_PRESENT | _CACHE_CACHABLE_NONCOHERENT)
25#define PAGE_SHARED __pgprot(_PAGE_PRESENT | _PAGE_READ | _PAGE_WRITE | \ 25#define PAGE_SHARED __pgprot(_PAGE_PRESENT | _PAGE_WRITE | (kernel_uses_smartmips_rixi ? 0 : _PAGE_READ) | \
26 _page_cachable_default) 26 _page_cachable_default)
27#define PAGE_COPY __pgprot(_PAGE_PRESENT | _PAGE_READ | \ 27#define PAGE_COPY __pgprot(_PAGE_PRESENT | (kernel_uses_smartmips_rixi ? 0 : _PAGE_READ) | \
28 _page_cachable_default) 28 (kernel_uses_smartmips_rixi ? _PAGE_NO_EXEC : 0) | _page_cachable_default)
29#define PAGE_READONLY __pgprot(_PAGE_PRESENT | _PAGE_READ | \ 29#define PAGE_READONLY __pgprot(_PAGE_PRESENT | (kernel_uses_smartmips_rixi ? 0 : _PAGE_READ) | \
30 _page_cachable_default) 30 _page_cachable_default)
31#define PAGE_KERNEL __pgprot(_PAGE_PRESENT | __READABLE | __WRITEABLE | \ 31#define PAGE_KERNEL __pgprot(_PAGE_PRESENT | __READABLE | __WRITEABLE | \
32 _PAGE_GLOBAL | _page_cachable_default) 32 _PAGE_GLOBAL | _page_cachable_default)
33#define PAGE_USERIO __pgprot(_PAGE_PRESENT | _PAGE_READ | _PAGE_WRITE | \ 33#define PAGE_USERIO __pgprot(_PAGE_PRESENT | (kernel_uses_smartmips_rixi ? 0 : _PAGE_READ) | _PAGE_WRITE | \
34 _page_cachable_default) 34 _page_cachable_default)
35#define PAGE_KERNEL_UNCACHED __pgprot(_PAGE_PRESENT | __READABLE | \ 35#define PAGE_KERNEL_UNCACHED __pgprot(_PAGE_PRESENT | __READABLE | \
36 __WRITEABLE | _PAGE_GLOBAL | _CACHE_UNCACHED) 36 __WRITEABLE | _PAGE_GLOBAL | _CACHE_UNCACHED)
37 37
38/* 38/*
39 * MIPS can't do page protection for execute, and considers that the same like 39 * If _PAGE_NO_EXEC is not defined, we can't do page protection for
40 * read. Also, write permissions imply read permissions. This is the closest 40 * execute, and consider it to be the same as read. Also, write
41 * we can get by reasonable means.. 41 * permissions imply read permissions. This is the closest we can get
42 * by reasonable means..
42 */ 43 */
43 44
44/* 45/*
@@ -177,7 +178,7 @@ static inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *pt
177 */ 178 */
178#define set_pmd(pmdptr, pmdval) do { *(pmdptr) = (pmdval); } while(0) 179#define set_pmd(pmdptr, pmdval) do { *(pmdptr) = (pmdval); } while(0)
179 180
180#ifdef CONFIG_64BIT 181#ifndef __PAGETABLE_PMD_FOLDED
181/* 182/*
182 * (puds are folded into pgds so this doesn't get actually called, 183 * (puds are folded into pgds so this doesn't get actually called,
183 * but the define is needed for a generic inline function.) 184 * but the define is needed for a generic inline function.)
@@ -298,8 +299,13 @@ static inline pte_t pte_mkdirty(pte_t pte)
298static inline pte_t pte_mkyoung(pte_t pte) 299static inline pte_t pte_mkyoung(pte_t pte)
299{ 300{
300 pte_val(pte) |= _PAGE_ACCESSED; 301 pte_val(pte) |= _PAGE_ACCESSED;
301 if (pte_val(pte) & _PAGE_READ) 302 if (kernel_uses_smartmips_rixi) {
302 pte_val(pte) |= _PAGE_SILENT_READ; 303 if (!(pte_val(pte) & _PAGE_NO_READ))
304 pte_val(pte) |= _PAGE_SILENT_READ;
305 } else {
306 if (pte_val(pte) & _PAGE_READ)
307 pte_val(pte) |= _PAGE_SILENT_READ;
308 }
303 return pte; 309 return pte;
304} 310}
305 311
@@ -362,8 +368,9 @@ extern void __update_cache(struct vm_area_struct *vma, unsigned long address,
362 pte_t pte); 368 pte_t pte);
363 369
364static inline void update_mmu_cache(struct vm_area_struct *vma, 370static inline void update_mmu_cache(struct vm_area_struct *vma,
365 unsigned long address, pte_t pte) 371 unsigned long address, pte_t *ptep)
366{ 372{
373 pte_t pte = *ptep;
367 __update_tlb(vma, address, pte); 374 __update_tlb(vma, address, pte);
368 __update_cache(vma, address, pte); 375 __update_cache(vma, address, pte);
369} 376}
diff --git a/arch/mips/include/asm/pmc-sierra/msp71xx/msp_prom.h b/arch/mips/include/asm/pmc-sierra/msp71xx/msp_prom.h
index 14ca7dc382a8..54ef1a96d7ce 100644
--- a/arch/mips/include/asm/pmc-sierra/msp71xx/msp_prom.h
+++ b/arch/mips/include/asm/pmc-sierra/msp71xx/msp_prom.h
@@ -118,7 +118,6 @@
118#define ZSP_DUET 'D' /* one DUET zsp engine */ 118#define ZSP_DUET 'D' /* one DUET zsp engine */
119#define ZSP_TRIAD 'T' /* two TRIAD zsp engines */ 119#define ZSP_TRIAD 'T' /* two TRIAD zsp engines */
120 120
121extern char *prom_getcmdline(void);
122extern char *prom_getenv(char *name); 121extern char *prom_getenv(char *name);
123extern void prom_init_cmdline(void); 122extern void prom_init_cmdline(void);
124extern void prom_meminit(void); 123extern void prom_meminit(void);
diff --git a/arch/mips/include/asm/serial.h b/arch/mips/include/asm/serial.h
index c07ebd8eb9e7..a0cb0caff152 100644
--- a/arch/mips/include/asm/serial.h
+++ b/arch/mips/include/asm/serial.h
@@ -1,22 +1 @@
1/* #include <asm-generic/serial.h>
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 1999 by Ralf Baechle
7 * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
8 */
9#ifndef _ASM_SERIAL_H
10#define _ASM_SERIAL_H
11
12
13/*
14 * This assumes you have a 1.8432 MHz clock for your UART.
15 *
16 * It'd be nice if someone built a serial card with a 24.576 MHz
17 * clock, since the 16550A is capable of handling a top speed of 1.5
18 * megabits/second; but this requires the faster clock.
19 */
20#define BASE_BAUD (1843200 / 16)
21
22#endif /* _ASM_SERIAL_H */
diff --git a/arch/mips/include/asm/sgialib.h b/arch/mips/include/asm/sgialib.h
index 63741ca1e422..2a2f1bddc276 100644
--- a/arch/mips/include/asm/sgialib.h
+++ b/arch/mips/include/asm/sgialib.h
@@ -33,14 +33,6 @@ extern int prom_flags;
33extern void prom_putchar(char c); 33extern void prom_putchar(char c);
34extern char prom_getchar(void); 34extern char prom_getchar(void);
35 35
36/* Memory descriptor management. */
37#define PROM_MAX_PMEMBLOCKS 32
38struct prom_pmemblock {
39 LONG base; /* Within KSEG0 or XKPHYS. */
40 ULONG size; /* In bytes. */
41 ULONG type; /* free or prom memory */
42};
43
44/* Get next memory descriptor after CURR, returns first descriptor 36/* Get next memory descriptor after CURR, returns first descriptor
45 * in chain is CURR is NULL. 37 * in chain is CURR is NULL.
46 */ 38 */
@@ -51,7 +43,6 @@ extern struct linux_mdesc *prom_getmdesc(struct linux_mdesc *curr);
51 * array. 43 * array.
52 */ 44 */
53extern void prom_meminit(void); 45extern void prom_meminit(void);
54extern void prom_fixup_mem_map(unsigned long start_mem, unsigned long end_mem);
55 46
56/* PROM device tree library routines. */ 47/* PROM device tree library routines. */
57#define PROM_NULL_COMPONENT ((pcomponent *) 0) 48#define PROM_NULL_COMPONENT ((pcomponent *) 0)
@@ -62,20 +53,6 @@ extern pcomponent *ArcGetPeer(pcomponent *this);
62/* Get child component of THIS. */ 53/* Get child component of THIS. */
63extern pcomponent *ArcGetChild(pcomponent *this); 54extern pcomponent *ArcGetChild(pcomponent *this);
64 55
65/* Get parent component of CHILD. */
66extern pcomponent *prom_getparent(pcomponent *child);
67
68/* Copy component opaque data of component THIS into BUFFER
69 * if component THIS has opaque data. Returns success or
70 * failure status.
71 */
72extern long prom_getcdata(void *buffer, pcomponent *this);
73
74/* Other misc. component routines. */
75extern pcomponent *prom_childadd(pcomponent *this, pcomponent *tmp, void *data);
76extern long prom_delcomponent(pcomponent *this);
77extern pcomponent *prom_componentbypath(char *path);
78
79/* This is called at prom_init time to identify the 56/* This is called at prom_init time to identify the
80 * ARC architecture we are running on 57 * ARC architecture we are running on
81 */ 58 */
@@ -88,35 +65,13 @@ extern LONG ArcSetEnvironmentVariable(PCHAR name, PCHAR value);
88/* ARCS command line parsing. */ 65/* ARCS command line parsing. */
89extern void prom_init_cmdline(void); 66extern void prom_init_cmdline(void);
90 67
91/* Acquiring info about the current time, etc. */
92extern struct linux_tinfo *prom_gettinfo(void);
93extern unsigned long prom_getrtime(void);
94
95/* File operations. */ 68/* File operations. */
96extern long prom_getvdirent(unsigned long fd, struct linux_vdirent *ent, unsigned long num, unsigned long *cnt);
97extern long prom_open(char *name, enum linux_omode md, unsigned long *fd);
98extern long prom_close(unsigned long fd);
99extern LONG ArcRead(ULONG fd, PVOID buf, ULONG num, PULONG cnt); 69extern LONG ArcRead(ULONG fd, PVOID buf, ULONG num, PULONG cnt);
100extern long prom_getrstatus(unsigned long fd);
101extern LONG ArcWrite(ULONG fd, PVOID buf, ULONG num, PULONG cnt); 70extern LONG ArcWrite(ULONG fd, PVOID buf, ULONG num, PULONG cnt);
102extern long prom_seek(unsigned long fd, struct linux_bigint *off, enum linux_seekmode sm);
103extern long prom_mount(char *name, enum linux_mountops op);
104extern long prom_getfinfo(unsigned long fd, struct linux_finfo *buf);
105extern long prom_setfinfo(unsigned long fd, unsigned long flags, unsigned long msk);
106
107/* Running stand-along programs. */
108extern long prom_load(char *name, unsigned long end, unsigned long *pc, unsigned long *eaddr);
109extern long prom_invoke(unsigned long pc, unsigned long sp, long argc, char **argv, char **envp);
110extern long prom_exec(char *name, long argc, char **argv, char **envp);
111 71
112/* Misc. routines. */ 72/* Misc. routines. */
113extern VOID prom_halt(VOID) __attribute__((noreturn));
114extern VOID prom_powerdown(VOID) __attribute__((noreturn));
115extern VOID prom_restart(VOID) __attribute__((noreturn));
116extern VOID ArcReboot(VOID) __attribute__((noreturn)); 73extern VOID ArcReboot(VOID) __attribute__((noreturn));
117extern VOID ArcEnterInteractiveMode(VOID) __attribute__((noreturn)); 74extern VOID ArcEnterInteractiveMode(VOID) __attribute__((noreturn));
118extern long prom_cfgsave(VOID);
119extern struct linux_sysid *prom_getsysid(VOID);
120extern VOID ArcFlushAllCaches(VOID); 75extern VOID ArcFlushAllCaches(VOID);
121extern DISPLAY_STATUS *ArcGetDisplayStatus(ULONG FileID); 76extern DISPLAY_STATUS *ArcGetDisplayStatus(ULONG FileID);
122 77
diff --git a/arch/mips/include/asm/sibyte/bigsur.h b/arch/mips/include/asm/sibyte/bigsur.h
index ebefe797fc1d..2d1a26d3436a 100644
--- a/arch/mips/include/asm/sibyte/bigsur.h
+++ b/arch/mips/include/asm/sibyte/bigsur.h
@@ -46,4 +46,3 @@
46#endif 46#endif
47 47
48#endif /* __ASM_SIBYTE_BIGSUR_H */ 48#endif /* __ASM_SIBYTE_BIGSUR_H */
49
diff --git a/arch/mips/include/asm/sibyte/sb1250_ldt.h b/arch/mips/include/asm/sibyte/sb1250_ldt.h
index 081e8b1c4ad0..1e76cf137995 100644
--- a/arch/mips/include/asm/sibyte/sb1250_ldt.h
+++ b/arch/mips/include/asm/sibyte/sb1250_ldt.h
@@ -420,4 +420,3 @@
420#endif /* 1250 PASS2 || 112x PASS1 */ 420#endif /* 1250 PASS2 || 112x PASS1 */
421 421
422#endif 422#endif
423
diff --git a/arch/mips/include/asm/sn/klkernvars.h b/arch/mips/include/asm/sn/klkernvars.h
index 5de4c5e8ab30..6af25ba41ade 100644
--- a/arch/mips/include/asm/sn/klkernvars.h
+++ b/arch/mips/include/asm/sn/klkernvars.h
@@ -26,4 +26,3 @@ typedef struct kern_vars_s {
26#endif /* !__ASSEMBLY__ */ 26#endif /* !__ASSEMBLY__ */
27 27
28#endif /* __ASM_SN_KLKERNVARS_H */ 28#endif /* __ASM_SN_KLKERNVARS_H */
29
diff --git a/arch/mips/include/asm/sparsemem.h b/arch/mips/include/asm/sparsemem.h
index 795ac6c23203..7165333ad043 100644
--- a/arch/mips/include/asm/sparsemem.h
+++ b/arch/mips/include/asm/sparsemem.h
@@ -11,4 +11,3 @@
11 11
12#endif /* CONFIG_SPARSEMEM */ 12#endif /* CONFIG_SPARSEMEM */
13#endif /* _MIPS_SPARSEMEM_H */ 13#endif /* _MIPS_SPARSEMEM_H */
14
diff --git a/arch/mips/include/asm/spinlock.h b/arch/mips/include/asm/spinlock.h
index 21ef9efbde43..396e402fbe2c 100644
--- a/arch/mips/include/asm/spinlock.h
+++ b/arch/mips/include/asm/spinlock.h
@@ -36,9 +36,9 @@
36 36
37static inline int arch_spin_is_locked(arch_spinlock_t *lock) 37static inline int arch_spin_is_locked(arch_spinlock_t *lock)
38{ 38{
39 unsigned int counters = ACCESS_ONCE(lock->lock); 39 u32 counters = ACCESS_ONCE(lock->lock);
40 40
41 return ((counters >> 14) ^ counters) & 0x1fff; 41 return ((counters >> 16) ^ counters) & 0xffff;
42} 42}
43 43
44#define arch_spin_lock_flags(lock, flags) arch_spin_lock(lock) 44#define arch_spin_lock_flags(lock, flags) arch_spin_lock(lock)
@@ -47,9 +47,9 @@ static inline int arch_spin_is_locked(arch_spinlock_t *lock)
47 47
48static inline int arch_spin_is_contended(arch_spinlock_t *lock) 48static inline int arch_spin_is_contended(arch_spinlock_t *lock)
49{ 49{
50 unsigned int counters = ACCESS_ONCE(lock->lock); 50 u32 counters = ACCESS_ONCE(lock->lock);
51 51
52 return (((counters >> 14) - counters) & 0x1fff) > 1; 52 return (((counters >> 16) - counters) & 0xffff) > 1;
53} 53}
54#define arch_spin_is_contended arch_spin_is_contended 54#define arch_spin_is_contended arch_spin_is_contended
55 55
@@ -57,6 +57,7 @@ static inline void arch_spin_lock(arch_spinlock_t *lock)
57{ 57{
58 int my_ticket; 58 int my_ticket;
59 int tmp; 59 int tmp;
60 int inc = 0x10000;
60 61
61 if (R10000_LLSC_WAR) { 62 if (R10000_LLSC_WAR) {
62 __asm__ __volatile__ ( 63 __asm__ __volatile__ (
@@ -64,25 +65,24 @@ static inline void arch_spin_lock(arch_spinlock_t *lock)
64 " .set noreorder \n" 65 " .set noreorder \n"
65 " \n" 66 " \n"
66 "1: ll %[ticket], %[ticket_ptr] \n" 67 "1: ll %[ticket], %[ticket_ptr] \n"
67 " addiu %[my_ticket], %[ticket], 0x4000 \n" 68 " addu %[my_ticket], %[ticket], %[inc] \n"
68 " sc %[my_ticket], %[ticket_ptr] \n" 69 " sc %[my_ticket], %[ticket_ptr] \n"
69 " beqzl %[my_ticket], 1b \n" 70 " beqzl %[my_ticket], 1b \n"
70 " nop \n" 71 " nop \n"
71 " srl %[my_ticket], %[ticket], 14 \n" 72 " srl %[my_ticket], %[ticket], 16 \n"
72 " andi %[my_ticket], %[my_ticket], 0x1fff \n" 73 " andi %[ticket], %[ticket], 0xffff \n"
73 " andi %[ticket], %[ticket], 0x1fff \n" 74 " andi %[my_ticket], %[my_ticket], 0xffff \n"
74 " bne %[ticket], %[my_ticket], 4f \n" 75 " bne %[ticket], %[my_ticket], 4f \n"
75 " subu %[ticket], %[my_ticket], %[ticket] \n" 76 " subu %[ticket], %[my_ticket], %[ticket] \n"
76 "2: \n" 77 "2: \n"
77 " .subsection 2 \n" 78 " .subsection 2 \n"
78 "4: andi %[ticket], %[ticket], 0x1fff \n" 79 "4: andi %[ticket], %[ticket], 0xffff \n"
79 " sll %[ticket], 5 \n" 80 " sll %[ticket], 5 \n"
80 " \n" 81 " \n"
81 "6: bnez %[ticket], 6b \n" 82 "6: bnez %[ticket], 6b \n"
82 " subu %[ticket], 1 \n" 83 " subu %[ticket], 1 \n"
83 " \n" 84 " \n"
84 " lw %[ticket], %[ticket_ptr] \n" 85 " lhu %[ticket], %[serving_now_ptr] \n"
85 " andi %[ticket], %[ticket], 0x1fff \n"
86 " beq %[ticket], %[my_ticket], 2b \n" 86 " beq %[ticket], %[my_ticket], 2b \n"
87 " subu %[ticket], %[my_ticket], %[ticket] \n" 87 " subu %[ticket], %[my_ticket], %[ticket] \n"
88 " b 4b \n" 88 " b 4b \n"
@@ -90,36 +90,33 @@ static inline void arch_spin_lock(arch_spinlock_t *lock)
90 " .previous \n" 90 " .previous \n"
91 " .set pop \n" 91 " .set pop \n"
92 : [ticket_ptr] "+m" (lock->lock), 92 : [ticket_ptr] "+m" (lock->lock),
93 [serving_now_ptr] "+m" (lock->h.serving_now),
93 [ticket] "=&r" (tmp), 94 [ticket] "=&r" (tmp),
94 [my_ticket] "=&r" (my_ticket)); 95 [my_ticket] "=&r" (my_ticket)
96 : [inc] "r" (inc));
95 } else { 97 } else {
96 __asm__ __volatile__ ( 98 __asm__ __volatile__ (
97 " .set push # arch_spin_lock \n" 99 " .set push # arch_spin_lock \n"
98 " .set noreorder \n" 100 " .set noreorder \n"
99 " \n" 101 " \n"
100 " ll %[ticket], %[ticket_ptr] \n" 102 "1: ll %[ticket], %[ticket_ptr] \n"
101 "1: addiu %[my_ticket], %[ticket], 0x4000 \n" 103 " addu %[my_ticket], %[ticket], %[inc] \n"
102 " sc %[my_ticket], %[ticket_ptr] \n" 104 " sc %[my_ticket], %[ticket_ptr] \n"
103 " beqz %[my_ticket], 3f \n" 105 " beqz %[my_ticket], 1b \n"
104 " nop \n" 106 " srl %[my_ticket], %[ticket], 16 \n"
105 " srl %[my_ticket], %[ticket], 14 \n" 107 " andi %[ticket], %[ticket], 0xffff \n"
106 " andi %[my_ticket], %[my_ticket], 0x1fff \n" 108 " andi %[my_ticket], %[my_ticket], 0xffff \n"
107 " andi %[ticket], %[ticket], 0x1fff \n"
108 " bne %[ticket], %[my_ticket], 4f \n" 109 " bne %[ticket], %[my_ticket], 4f \n"
109 " subu %[ticket], %[my_ticket], %[ticket] \n" 110 " subu %[ticket], %[my_ticket], %[ticket] \n"
110 "2: \n" 111 "2: \n"
111 " .subsection 2 \n" 112 " .subsection 2 \n"
112 "3: b 1b \n"
113 " ll %[ticket], %[ticket_ptr] \n"
114 " \n"
115 "4: andi %[ticket], %[ticket], 0x1fff \n" 113 "4: andi %[ticket], %[ticket], 0x1fff \n"
116 " sll %[ticket], 5 \n" 114 " sll %[ticket], 5 \n"
117 " \n" 115 " \n"
118 "6: bnez %[ticket], 6b \n" 116 "6: bnez %[ticket], 6b \n"
119 " subu %[ticket], 1 \n" 117 " subu %[ticket], 1 \n"
120 " \n" 118 " \n"
121 " lw %[ticket], %[ticket_ptr] \n" 119 " lhu %[ticket], %[serving_now_ptr] \n"
122 " andi %[ticket], %[ticket], 0x1fff \n"
123 " beq %[ticket], %[my_ticket], 2b \n" 120 " beq %[ticket], %[my_ticket], 2b \n"
124 " subu %[ticket], %[my_ticket], %[ticket] \n" 121 " subu %[ticket], %[my_ticket], %[ticket] \n"
125 " b 4b \n" 122 " b 4b \n"
@@ -127,8 +124,10 @@ static inline void arch_spin_lock(arch_spinlock_t *lock)
127 " .previous \n" 124 " .previous \n"
128 " .set pop \n" 125 " .set pop \n"
129 : [ticket_ptr] "+m" (lock->lock), 126 : [ticket_ptr] "+m" (lock->lock),
127 [serving_now_ptr] "+m" (lock->h.serving_now),
130 [ticket] "=&r" (tmp), 128 [ticket] "=&r" (tmp),
131 [my_ticket] "=&r" (my_ticket)); 129 [my_ticket] "=&r" (my_ticket)
130 : [inc] "r" (inc));
132 } 131 }
133 132
134 smp_llsc_mb(); 133 smp_llsc_mb();
@@ -136,47 +135,16 @@ static inline void arch_spin_lock(arch_spinlock_t *lock)
136 135
137static inline void arch_spin_unlock(arch_spinlock_t *lock) 136static inline void arch_spin_unlock(arch_spinlock_t *lock)
138{ 137{
139 int tmp; 138 unsigned int serving_now = lock->h.serving_now + 1;
140 139 wmb();
141 smp_llsc_mb(); 140 lock->h.serving_now = (u16)serving_now;
142 141 nudge_writes();
143 if (R10000_LLSC_WAR) {
144 __asm__ __volatile__ (
145 " # arch_spin_unlock \n"
146 "1: ll %[ticket], %[ticket_ptr] \n"
147 " addiu %[ticket], %[ticket], 1 \n"
148 " ori %[ticket], %[ticket], 0x2000 \n"
149 " xori %[ticket], %[ticket], 0x2000 \n"
150 " sc %[ticket], %[ticket_ptr] \n"
151 " beqzl %[ticket], 1b \n"
152 : [ticket_ptr] "+m" (lock->lock),
153 [ticket] "=&r" (tmp));
154 } else {
155 __asm__ __volatile__ (
156 " .set push # arch_spin_unlock \n"
157 " .set noreorder \n"
158 " \n"
159 " ll %[ticket], %[ticket_ptr] \n"
160 "1: addiu %[ticket], %[ticket], 1 \n"
161 " ori %[ticket], %[ticket], 0x2000 \n"
162 " xori %[ticket], %[ticket], 0x2000 \n"
163 " sc %[ticket], %[ticket_ptr] \n"
164 " beqz %[ticket], 2f \n"
165 " nop \n"
166 " \n"
167 " .subsection 2 \n"
168 "2: b 1b \n"
169 " ll %[ticket], %[ticket_ptr] \n"
170 " .previous \n"
171 " .set pop \n"
172 : [ticket_ptr] "+m" (lock->lock),
173 [ticket] "=&r" (tmp));
174 }
175} 142}
176 143
177static inline unsigned int arch_spin_trylock(arch_spinlock_t *lock) 144static inline unsigned int arch_spin_trylock(arch_spinlock_t *lock)
178{ 145{
179 int tmp, tmp2, tmp3; 146 int tmp, tmp2, tmp3;
147 int inc = 0x10000;
180 148
181 if (R10000_LLSC_WAR) { 149 if (R10000_LLSC_WAR) {
182 __asm__ __volatile__ ( 150 __asm__ __volatile__ (
@@ -184,11 +152,11 @@ static inline unsigned int arch_spin_trylock(arch_spinlock_t *lock)
184 " .set noreorder \n" 152 " .set noreorder \n"
185 " \n" 153 " \n"
186 "1: ll %[ticket], %[ticket_ptr] \n" 154 "1: ll %[ticket], %[ticket_ptr] \n"
187 " srl %[my_ticket], %[ticket], 14 \n" 155 " srl %[my_ticket], %[ticket], 16 \n"
188 " andi %[my_ticket], %[my_ticket], 0x1fff \n" 156 " andi %[my_ticket], %[my_ticket], 0xffff \n"
189 " andi %[now_serving], %[ticket], 0x1fff \n" 157 " andi %[now_serving], %[ticket], 0xffff \n"
190 " bne %[my_ticket], %[now_serving], 3f \n" 158 " bne %[my_ticket], %[now_serving], 3f \n"
191 " addiu %[ticket], %[ticket], 0x4000 \n" 159 " addu %[ticket], %[ticket], %[inc] \n"
192 " sc %[ticket], %[ticket_ptr] \n" 160 " sc %[ticket], %[ticket_ptr] \n"
193 " beqzl %[ticket], 1b \n" 161 " beqzl %[ticket], 1b \n"
194 " li %[ticket], 1 \n" 162 " li %[ticket], 1 \n"
@@ -201,33 +169,33 @@ static inline unsigned int arch_spin_trylock(arch_spinlock_t *lock)
201 : [ticket_ptr] "+m" (lock->lock), 169 : [ticket_ptr] "+m" (lock->lock),
202 [ticket] "=&r" (tmp), 170 [ticket] "=&r" (tmp),
203 [my_ticket] "=&r" (tmp2), 171 [my_ticket] "=&r" (tmp2),
204 [now_serving] "=&r" (tmp3)); 172 [now_serving] "=&r" (tmp3)
173 : [inc] "r" (inc));
205 } else { 174 } else {
206 __asm__ __volatile__ ( 175 __asm__ __volatile__ (
207 " .set push # arch_spin_trylock \n" 176 " .set push # arch_spin_trylock \n"
208 " .set noreorder \n" 177 " .set noreorder \n"
209 " \n" 178 " \n"
210 " ll %[ticket], %[ticket_ptr] \n" 179 "1: ll %[ticket], %[ticket_ptr] \n"
211 "1: srl %[my_ticket], %[ticket], 14 \n" 180 " srl %[my_ticket], %[ticket], 16 \n"
212 " andi %[my_ticket], %[my_ticket], 0x1fff \n" 181 " andi %[my_ticket], %[my_ticket], 0xffff \n"
213 " andi %[now_serving], %[ticket], 0x1fff \n" 182 " andi %[now_serving], %[ticket], 0xffff \n"
214 " bne %[my_ticket], %[now_serving], 3f \n" 183 " bne %[my_ticket], %[now_serving], 3f \n"
215 " addiu %[ticket], %[ticket], 0x4000 \n" 184 " addu %[ticket], %[ticket], %[inc] \n"
216 " sc %[ticket], %[ticket_ptr] \n" 185 " sc %[ticket], %[ticket_ptr] \n"
217 " beqz %[ticket], 4f \n" 186 " beqz %[ticket], 1b \n"
218 " li %[ticket], 1 \n" 187 " li %[ticket], 1 \n"
219 "2: \n" 188 "2: \n"
220 " .subsection 2 \n" 189 " .subsection 2 \n"
221 "3: b 2b \n" 190 "3: b 2b \n"
222 " li %[ticket], 0 \n" 191 " li %[ticket], 0 \n"
223 "4: b 1b \n"
224 " ll %[ticket], %[ticket_ptr] \n"
225 " .previous \n" 192 " .previous \n"
226 " .set pop \n" 193 " .set pop \n"
227 : [ticket_ptr] "+m" (lock->lock), 194 : [ticket_ptr] "+m" (lock->lock),
228 [ticket] "=&r" (tmp), 195 [ticket] "=&r" (tmp),
229 [my_ticket] "=&r" (tmp2), 196 [my_ticket] "=&r" (tmp2),
230 [now_serving] "=&r" (tmp3)); 197 [now_serving] "=&r" (tmp3)
198 : [inc] "r" (inc));
231 } 199 }
232 200
233 smp_llsc_mb(); 201 smp_llsc_mb();
@@ -305,7 +273,7 @@ static inline void arch_read_unlock(arch_rwlock_t *rw)
305{ 273{
306 unsigned int tmp; 274 unsigned int tmp;
307 275
308 smp_llsc_mb(); 276 smp_mb__before_llsc();
309 277
310 if (R10000_LLSC_WAR) { 278 if (R10000_LLSC_WAR) {
311 __asm__ __volatile__( 279 __asm__ __volatile__(
diff --git a/arch/mips/include/asm/spinlock_types.h b/arch/mips/include/asm/spinlock_types.h
index ee197c2f9c98..c52f36013a9d 100644
--- a/arch/mips/include/asm/spinlock_types.h
+++ b/arch/mips/include/asm/spinlock_types.h
@@ -5,16 +5,28 @@
5# error "please don't include this file directly" 5# error "please don't include this file directly"
6#endif 6#endif
7 7
8typedef struct { 8#include <linux/types.h>
9
10#include <asm/byteorder.h>
11
12typedef union {
9 /* 13 /*
10 * bits 0..13: serving_now 14 * bits 0..15 : serving_now
11 * bits 14 : junk data 15 * bits 16..31 : ticket
12 * bits 15..28: ticket
13 */ 16 */
14 unsigned int lock; 17 u32 lock;
18 struct {
19#ifdef __BIG_ENDIAN
20 u16 ticket;
21 u16 serving_now;
22#else
23 u16 serving_now;
24 u16 ticket;
25#endif
26 } h;
15} arch_spinlock_t; 27} arch_spinlock_t;
16 28
17#define __ARCH_SPIN_LOCK_UNLOCKED { 0 } 29#define __ARCH_SPIN_LOCK_UNLOCKED { .lock = 0 }
18 30
19typedef struct { 31typedef struct {
20 volatile unsigned int lock; 32 volatile unsigned int lock;
diff --git a/arch/mips/include/asm/system.h b/arch/mips/include/asm/system.h
index 83b5509e09e8..bb937ccfba1e 100644
--- a/arch/mips/include/asm/system.h
+++ b/arch/mips/include/asm/system.h
@@ -95,6 +95,8 @@ static inline unsigned long __xchg_u32(volatile int * m, unsigned int val)
95{ 95{
96 __u32 retval; 96 __u32 retval;
97 97
98 smp_mb__before_llsc();
99
98 if (kernel_uses_llsc && R10000_LLSC_WAR) { 100 if (kernel_uses_llsc && R10000_LLSC_WAR) {
99 unsigned long dummy; 101 unsigned long dummy;
100 102
@@ -147,6 +149,8 @@ static inline __u64 __xchg_u64(volatile __u64 * m, __u64 val)
147{ 149{
148 __u64 retval; 150 __u64 retval;
149 151
152 smp_mb__before_llsc();
153
150 if (kernel_uses_llsc && R10000_LLSC_WAR) { 154 if (kernel_uses_llsc && R10000_LLSC_WAR) {
151 unsigned long dummy; 155 unsigned long dummy;
152 156
diff --git a/arch/mips/include/asm/txx9/generic.h b/arch/mips/include/asm/txx9/generic.h
index 827dc22be2ea..64887d3c7ec3 100644
--- a/arch/mips/include/asm/txx9/generic.h
+++ b/arch/mips/include/asm/txx9/generic.h
@@ -42,7 +42,6 @@ struct txx9_board_vec {
42}; 42};
43extern struct txx9_board_vec *txx9_board_vec; 43extern struct txx9_board_vec *txx9_board_vec;
44extern int (*txx9_irq_dispatch)(int pending); 44extern int (*txx9_irq_dispatch)(int pending);
45char *prom_getcmdline(void);
46const char *prom_getenv(const char *name); 45const char *prom_getenv(const char *name);
47void txx9_wdt_init(unsigned long base); 46void txx9_wdt_init(unsigned long base);
48void txx9_wdt_now(unsigned long base); 47void txx9_wdt_now(unsigned long base);
diff --git a/arch/mips/mm/uasm.h b/arch/mips/include/asm/uasm.h
index 3d153edaa51e..b99bd07e199b 100644
--- a/arch/mips/mm/uasm.h
+++ b/arch/mips/include/asm/uasm.h
@@ -92,9 +92,11 @@ Ip_u2s3u1(_sd);
92Ip_u2u1u3(_sll); 92Ip_u2u1u3(_sll);
93Ip_u2u1u3(_sra); 93Ip_u2u1u3(_sra);
94Ip_u2u1u3(_srl); 94Ip_u2u1u3(_srl);
95Ip_u2u1u3(_rotr);
95Ip_u3u1u2(_subu); 96Ip_u3u1u2(_subu);
96Ip_u2s3u1(_sw); 97Ip_u2s3u1(_sw);
97Ip_0(_tlbp); 98Ip_0(_tlbp);
99Ip_0(_tlbr);
98Ip_0(_tlbwi); 100Ip_0(_tlbwi);
99Ip_0(_tlbwr); 101Ip_0(_tlbwr);
100Ip_u3u1u2(_xor); 102Ip_u3u1u2(_xor);
@@ -129,6 +131,7 @@ static inline void __cpuinit uasm_l##lb(struct uasm_label **lab, u32 *addr) \
129# define UASM_i_SLL(buf, rs, rt, sh) uasm_i_dsll(buf, rs, rt, sh) 131# define UASM_i_SLL(buf, rs, rt, sh) uasm_i_dsll(buf, rs, rt, sh)
130# define UASM_i_SRA(buf, rs, rt, sh) uasm_i_dsra(buf, rs, rt, sh) 132# define UASM_i_SRA(buf, rs, rt, sh) uasm_i_dsra(buf, rs, rt, sh)
131# define UASM_i_SRL(buf, rs, rt, sh) uasm_i_dsrl(buf, rs, rt, sh) 133# define UASM_i_SRL(buf, rs, rt, sh) uasm_i_dsrl(buf, rs, rt, sh)
134# define UASM_i_ROTR(buf, rs, rt, sh) uasm_i_drotr(buf, rs, rt, sh)
132# define UASM_i_MFC0(buf, rt, rd...) uasm_i_dmfc0(buf, rt, rd) 135# define UASM_i_MFC0(buf, rt, rd...) uasm_i_dmfc0(buf, rt, rd)
133# define UASM_i_MTC0(buf, rt, rd...) uasm_i_dmtc0(buf, rt, rd) 136# define UASM_i_MTC0(buf, rt, rd...) uasm_i_dmtc0(buf, rt, rd)
134# define UASM_i_ADDIU(buf, rs, rt, val) uasm_i_daddiu(buf, rs, rt, val) 137# define UASM_i_ADDIU(buf, rs, rt, val) uasm_i_daddiu(buf, rs, rt, val)
@@ -142,6 +145,7 @@ static inline void __cpuinit uasm_l##lb(struct uasm_label **lab, u32 *addr) \
142# define UASM_i_SLL(buf, rs, rt, sh) uasm_i_sll(buf, rs, rt, sh) 145# define UASM_i_SLL(buf, rs, rt, sh) uasm_i_sll(buf, rs, rt, sh)
143# define UASM_i_SRA(buf, rs, rt, sh) uasm_i_sra(buf, rs, rt, sh) 146# define UASM_i_SRA(buf, rs, rt, sh) uasm_i_sra(buf, rs, rt, sh)
144# define UASM_i_SRL(buf, rs, rt, sh) uasm_i_srl(buf, rs, rt, sh) 147# define UASM_i_SRL(buf, rs, rt, sh) uasm_i_srl(buf, rs, rt, sh)
148# define UASM_i_ROTR(buf, rs, rt, sh) uasm_i_rotr(buf, rs, rt, sh)
145# define UASM_i_MFC0(buf, rt, rd...) uasm_i_mfc0(buf, rt, rd) 149# define UASM_i_MFC0(buf, rt, rd...) uasm_i_mfc0(buf, rt, rd)
146# define UASM_i_MTC0(buf, rt, rd...) uasm_i_mtc0(buf, rt, rd) 150# define UASM_i_MTC0(buf, rt, rd...) uasm_i_mtc0(buf, rt, rd)
147# define UASM_i_ADDIU(buf, rs, rt, val) uasm_i_addiu(buf, rs, rt, val) 151# define UASM_i_ADDIU(buf, rs, rt, val) uasm_i_addiu(buf, rs, rt, val)
diff --git a/arch/mips/include/asm/ucontext.h b/arch/mips/include/asm/ucontext.h
index 8a4b20e88b81..9bc07b9f30fb 100644
--- a/arch/mips/include/asm/ucontext.h
+++ b/arch/mips/include/asm/ucontext.h
@@ -1,21 +1 @@
1/* #include <asm-generic/ucontext.h>
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Low level exception handling
7 *
8 * Copyright (C) 1998, 1999 by Ralf Baechle
9 */
10#ifndef _ASM_UCONTEXT_H
11#define _ASM_UCONTEXT_H
12
13struct ucontext {
14 unsigned long uc_flags;
15 struct ucontext *uc_link;
16 stack_t uc_stack;
17 struct sigcontext uc_mcontext;
18 sigset_t uc_sigmask; /* mask last for extensibility */
19};
20
21#endif /* _ASM_UCONTEXT_H */
diff --git a/arch/mips/jazz/irq.c b/arch/mips/jazz/irq.c
index 7bd32d04c2cc..ee18028efe92 100644
--- a/arch/mips/jazz/irq.c
+++ b/arch/mips/jazz/irq.c
@@ -20,17 +20,17 @@
20#include <asm/jazz.h> 20#include <asm/jazz.h>
21#include <asm/pgtable.h> 21#include <asm/pgtable.h>
22 22
23static DEFINE_SPINLOCK(r4030_lock); 23static DEFINE_RAW_SPINLOCK(r4030_lock);
24 24
25static void enable_r4030_irq(unsigned int irq) 25static void enable_r4030_irq(unsigned int irq)
26{ 26{
27 unsigned int mask = 1 << (irq - JAZZ_IRQ_START); 27 unsigned int mask = 1 << (irq - JAZZ_IRQ_START);
28 unsigned long flags; 28 unsigned long flags;
29 29
30 spin_lock_irqsave(&r4030_lock, flags); 30 raw_spin_lock_irqsave(&r4030_lock, flags);
31 mask |= r4030_read_reg16(JAZZ_IO_IRQ_ENABLE); 31 mask |= r4030_read_reg16(JAZZ_IO_IRQ_ENABLE);
32 r4030_write_reg16(JAZZ_IO_IRQ_ENABLE, mask); 32 r4030_write_reg16(JAZZ_IO_IRQ_ENABLE, mask);
33 spin_unlock_irqrestore(&r4030_lock, flags); 33 raw_spin_unlock_irqrestore(&r4030_lock, flags);
34} 34}
35 35
36void disable_r4030_irq(unsigned int irq) 36void disable_r4030_irq(unsigned int irq)
@@ -38,10 +38,10 @@ void disable_r4030_irq(unsigned int irq)
38 unsigned int mask = ~(1 << (irq - JAZZ_IRQ_START)); 38 unsigned int mask = ~(1 << (irq - JAZZ_IRQ_START));
39 unsigned long flags; 39 unsigned long flags;
40 40
41 spin_lock_irqsave(&r4030_lock, flags); 41 raw_spin_lock_irqsave(&r4030_lock, flags);
42 mask &= r4030_read_reg16(JAZZ_IO_IRQ_ENABLE); 42 mask &= r4030_read_reg16(JAZZ_IO_IRQ_ENABLE);
43 r4030_write_reg16(JAZZ_IO_IRQ_ENABLE, mask); 43 r4030_write_reg16(JAZZ_IO_IRQ_ENABLE, mask);
44 spin_unlock_irqrestore(&r4030_lock, flags); 44 raw_spin_unlock_irqrestore(&r4030_lock, flags);
45} 45}
46 46
47static struct irq_chip r4030_irq_type = { 47static struct irq_chip r4030_irq_type = {
diff --git a/arch/mips/kernel/Makefile b/arch/mips/kernel/Makefile
index 9326af5186fe..ef20957ca14b 100644
--- a/arch/mips/kernel/Makefile
+++ b/arch/mips/kernel/Makefile
@@ -93,6 +93,7 @@ obj-$(CONFIG_GPIO_TXX9) += gpio_txx9.o
93 93
94obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o 94obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o
95obj-$(CONFIG_EARLY_PRINTK) += early_printk.o 95obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
96obj-$(CONFIG_SPINLOCK_TEST) += spinlock_test.o
96 97
97CFLAGS_cpu-bugs64.o = $(shell if $(CC) $(KBUILD_CFLAGS) -Wa,-mdaddi -c -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-DHAVE_AS_SET_DADDI"; fi) 98CFLAGS_cpu-bugs64.o = $(shell if $(CC) $(KBUILD_CFLAGS) -Wa,-mdaddi -c -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-DHAVE_AS_SET_DADDI"; fi)
98 99
diff --git a/arch/mips/kernel/asm-offsets.c b/arch/mips/kernel/asm-offsets.c
index 2c1e1d02338b..ca6c83218caa 100644
--- a/arch/mips/kernel/asm-offsets.c
+++ b/arch/mips/kernel/asm-offsets.c
@@ -188,11 +188,15 @@ void output_mm_defines(void)
188 DEFINE(_PTE_T_SIZE, sizeof(pte_t)); 188 DEFINE(_PTE_T_SIZE, sizeof(pte_t));
189 BLANK(); 189 BLANK();
190 DEFINE(_PGD_T_LOG2, PGD_T_LOG2); 190 DEFINE(_PGD_T_LOG2, PGD_T_LOG2);
191#ifndef __PAGETABLE_PMD_FOLDED
191 DEFINE(_PMD_T_LOG2, PMD_T_LOG2); 192 DEFINE(_PMD_T_LOG2, PMD_T_LOG2);
193#endif
192 DEFINE(_PTE_T_LOG2, PTE_T_LOG2); 194 DEFINE(_PTE_T_LOG2, PTE_T_LOG2);
193 BLANK(); 195 BLANK();
194 DEFINE(_PGD_ORDER, PGD_ORDER); 196 DEFINE(_PGD_ORDER, PGD_ORDER);
197#ifndef __PAGETABLE_PMD_FOLDED
195 DEFINE(_PMD_ORDER, PMD_ORDER); 198 DEFINE(_PMD_ORDER, PMD_ORDER);
199#endif
196 DEFINE(_PTE_ORDER, PTE_ORDER); 200 DEFINE(_PTE_ORDER, PTE_ORDER);
197 BLANK(); 201 BLANK();
198 DEFINE(_PMD_SHIFT, PMD_SHIFT); 202 DEFINE(_PMD_SHIFT, PMD_SHIFT);
diff --git a/arch/mips/kernel/cevt-gt641xx.c b/arch/mips/kernel/cevt-gt641xx.c
index f5d265eb6eae..392ef3756c56 100644
--- a/arch/mips/kernel/cevt-gt641xx.c
+++ b/arch/mips/kernel/cevt-gt641xx.c
@@ -25,7 +25,7 @@
25#include <asm/gt64120.h> 25#include <asm/gt64120.h>
26#include <asm/time.h> 26#include <asm/time.h>
27 27
28static DEFINE_SPINLOCK(gt641xx_timer_lock); 28static DEFINE_RAW_SPINLOCK(gt641xx_timer_lock);
29static unsigned int gt641xx_base_clock; 29static unsigned int gt641xx_base_clock;
30 30
31void gt641xx_set_base_clock(unsigned int clock) 31void gt641xx_set_base_clock(unsigned int clock)
@@ -49,7 +49,7 @@ static int gt641xx_timer0_set_next_event(unsigned long delta,
49{ 49{
50 u32 ctrl; 50 u32 ctrl;
51 51
52 spin_lock(&gt641xx_timer_lock); 52 raw_spin_lock(&gt641xx_timer_lock);
53 53
54 ctrl = GT_READ(GT_TC_CONTROL_OFS); 54 ctrl = GT_READ(GT_TC_CONTROL_OFS);
55 ctrl &= ~(GT_TC_CONTROL_ENTC0_MSK | GT_TC_CONTROL_SELTC0_MSK); 55 ctrl &= ~(GT_TC_CONTROL_ENTC0_MSK | GT_TC_CONTROL_SELTC0_MSK);
@@ -58,7 +58,7 @@ static int gt641xx_timer0_set_next_event(unsigned long delta,
58 GT_WRITE(GT_TC0_OFS, delta); 58 GT_WRITE(GT_TC0_OFS, delta);
59 GT_WRITE(GT_TC_CONTROL_OFS, ctrl); 59 GT_WRITE(GT_TC_CONTROL_OFS, ctrl);
60 60
61 spin_unlock(&gt641xx_timer_lock); 61 raw_spin_unlock(&gt641xx_timer_lock);
62 62
63 return 0; 63 return 0;
64} 64}
@@ -68,7 +68,7 @@ static void gt641xx_timer0_set_mode(enum clock_event_mode mode,
68{ 68{
69 u32 ctrl; 69 u32 ctrl;
70 70
71 spin_lock(&gt641xx_timer_lock); 71 raw_spin_lock(&gt641xx_timer_lock);
72 72
73 ctrl = GT_READ(GT_TC_CONTROL_OFS); 73 ctrl = GT_READ(GT_TC_CONTROL_OFS);
74 ctrl &= ~(GT_TC_CONTROL_ENTC0_MSK | GT_TC_CONTROL_SELTC0_MSK); 74 ctrl &= ~(GT_TC_CONTROL_ENTC0_MSK | GT_TC_CONTROL_SELTC0_MSK);
@@ -86,7 +86,7 @@ static void gt641xx_timer0_set_mode(enum clock_event_mode mode,
86 86
87 GT_WRITE(GT_TC_CONTROL_OFS, ctrl); 87 GT_WRITE(GT_TC_CONTROL_OFS, ctrl);
88 88
89 spin_unlock(&gt641xx_timer_lock); 89 raw_spin_unlock(&gt641xx_timer_lock);
90} 90}
91 91
92static void gt641xx_timer0_event_handler(struct clock_event_device *dev) 92static void gt641xx_timer0_event_handler(struct clock_event_device *dev)
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
index 758ad426c57f..be5bb16be4e0 100644
--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
@@ -162,6 +162,7 @@ void __init check_wait(void)
162 case CPU_BCM6348: 162 case CPU_BCM6348:
163 case CPU_BCM6358: 163 case CPU_BCM6358:
164 case CPU_CAVIUM_OCTEON: 164 case CPU_CAVIUM_OCTEON:
165 case CPU_CAVIUM_OCTEON_PLUS:
165 cpu_wait = r4k_wait; 166 cpu_wait = r4k_wait;
166 break; 167 break;
167 168
@@ -700,6 +701,19 @@ static inline unsigned int decode_config3(struct cpuinfo_mips *c)
700 return config3 & MIPS_CONF_M; 701 return config3 & MIPS_CONF_M;
701} 702}
702 703
704static inline unsigned int decode_config4(struct cpuinfo_mips *c)
705{
706 unsigned int config4;
707
708 config4 = read_c0_config4();
709
710 if ((config4 & MIPS_CONF4_MMUEXTDEF) == MIPS_CONF4_MMUEXTDEF_MMUSIZEEXT
711 && cpu_has_tlb)
712 c->tlbsize += (config4 & MIPS_CONF4_MMUSIZEEXT) * 0x40;
713
714 return config4 & MIPS_CONF_M;
715}
716
703static void __cpuinit decode_configs(struct cpuinfo_mips *c) 717static void __cpuinit decode_configs(struct cpuinfo_mips *c)
704{ 718{
705 int ok; 719 int ok;
@@ -718,6 +732,8 @@ static void __cpuinit decode_configs(struct cpuinfo_mips *c)
718 ok = decode_config2(c); 732 ok = decode_config2(c);
719 if (ok) 733 if (ok)
720 ok = decode_config3(c); 734 ok = decode_config3(c);
735 if (ok)
736 ok = decode_config4(c);
721 737
722 mips_probe_watch_registers(c); 738 mips_probe_watch_registers(c);
723} 739}
@@ -731,9 +747,6 @@ static inline void cpu_probe_mips(struct cpuinfo_mips *c, unsigned int cpu)
731 __cpu_name[cpu] = "MIPS 4Kc"; 747 __cpu_name[cpu] = "MIPS 4Kc";
732 break; 748 break;
733 case PRID_IMP_4KEC: 749 case PRID_IMP_4KEC:
734 c->cputype = CPU_4KEC;
735 __cpu_name[cpu] = "MIPS 4KEc";
736 break;
737 case PRID_IMP_4KECR2: 750 case PRID_IMP_4KECR2:
738 c->cputype = CPU_4KEC; 751 c->cputype = CPU_4KEC;
739 __cpu_name[cpu] = "MIPS 4KEc"; 752 __cpu_name[cpu] = "MIPS 4KEc";
@@ -899,12 +912,18 @@ static inline void cpu_probe_cavium(struct cpuinfo_mips *c, unsigned int cpu)
899 case PRID_IMP_CAVIUM_CN38XX: 912 case PRID_IMP_CAVIUM_CN38XX:
900 case PRID_IMP_CAVIUM_CN31XX: 913 case PRID_IMP_CAVIUM_CN31XX:
901 case PRID_IMP_CAVIUM_CN30XX: 914 case PRID_IMP_CAVIUM_CN30XX:
915 c->cputype = CPU_CAVIUM_OCTEON;
916 __cpu_name[cpu] = "Cavium Octeon";
917 goto platform;
902 case PRID_IMP_CAVIUM_CN58XX: 918 case PRID_IMP_CAVIUM_CN58XX:
903 case PRID_IMP_CAVIUM_CN56XX: 919 case PRID_IMP_CAVIUM_CN56XX:
904 case PRID_IMP_CAVIUM_CN50XX: 920 case PRID_IMP_CAVIUM_CN50XX:
905 case PRID_IMP_CAVIUM_CN52XX: 921 case PRID_IMP_CAVIUM_CN52XX:
906 c->cputype = CPU_CAVIUM_OCTEON; 922 c->cputype = CPU_CAVIUM_OCTEON_PLUS;
907 __cpu_name[cpu] = "Cavium Octeon"; 923 __cpu_name[cpu] = "Cavium Octeon+";
924platform:
925 if (cpu == 0)
926 __elf_platform = "octeon";
908 break; 927 break;
909 default: 928 default:
910 printk(KERN_INFO "Unknown Octeon chip!\n"); 929 printk(KERN_INFO "Unknown Octeon chip!\n");
@@ -914,6 +933,7 @@ static inline void cpu_probe_cavium(struct cpuinfo_mips *c, unsigned int cpu)
914} 933}
915 934
916const char *__cpu_name[NR_CPUS]; 935const char *__cpu_name[NR_CPUS];
936const char *__elf_platform;
917 937
918__cpuinit void cpu_probe(void) 938__cpuinit void cpu_probe(void)
919{ 939{
diff --git a/arch/mips/kernel/ftrace.c b/arch/mips/kernel/ftrace.c
index 68b067040d8b..e9e64e0ff7aa 100644
--- a/arch/mips/kernel/ftrace.c
+++ b/arch/mips/kernel/ftrace.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Copyright (C) 2007-2008 Steven Rostedt <srostedt@redhat.com> 4 * Copyright (C) 2007-2008 Steven Rostedt <srostedt@redhat.com>
5 * Copyright (C) 2009 DSLab, Lanzhou University, China 5 * Copyright (C) 2009 DSLab, Lanzhou University, China
6 * Author: Wu Zhangjin <wuzj@lemote.com> 6 * Author: Wu Zhangjin <wuzhangjin@gmail.com>
7 * 7 *
8 * Thanks goes to Steven Rostedt for writing the original x86 version. 8 * Thanks goes to Steven Rostedt for writing the original x86 version.
9 */ 9 */
diff --git a/arch/mips/kernel/i8259.c b/arch/mips/kernel/i8259.c
index 01c0885a8061..27799113332c 100644
--- a/arch/mips/kernel/i8259.c
+++ b/arch/mips/kernel/i8259.c
@@ -29,7 +29,7 @@
29 */ 29 */
30 30
31static int i8259A_auto_eoi = -1; 31static int i8259A_auto_eoi = -1;
32DEFINE_SPINLOCK(i8259A_lock); 32DEFINE_RAW_SPINLOCK(i8259A_lock);
33static void disable_8259A_irq(unsigned int irq); 33static void disable_8259A_irq(unsigned int irq);
34static void enable_8259A_irq(unsigned int irq); 34static void enable_8259A_irq(unsigned int irq);
35static void mask_and_ack_8259A(unsigned int irq); 35static void mask_and_ack_8259A(unsigned int irq);
@@ -65,13 +65,13 @@ static void disable_8259A_irq(unsigned int irq)
65 65
66 irq -= I8259A_IRQ_BASE; 66 irq -= I8259A_IRQ_BASE;
67 mask = 1 << irq; 67 mask = 1 << irq;
68 spin_lock_irqsave(&i8259A_lock, flags); 68 raw_spin_lock_irqsave(&i8259A_lock, flags);
69 cached_irq_mask |= mask; 69 cached_irq_mask |= mask;
70 if (irq & 8) 70 if (irq & 8)
71 outb(cached_slave_mask, PIC_SLAVE_IMR); 71 outb(cached_slave_mask, PIC_SLAVE_IMR);
72 else 72 else
73 outb(cached_master_mask, PIC_MASTER_IMR); 73 outb(cached_master_mask, PIC_MASTER_IMR);
74 spin_unlock_irqrestore(&i8259A_lock, flags); 74 raw_spin_unlock_irqrestore(&i8259A_lock, flags);
75} 75}
76 76
77static void enable_8259A_irq(unsigned int irq) 77static void enable_8259A_irq(unsigned int irq)
@@ -81,13 +81,13 @@ static void enable_8259A_irq(unsigned int irq)
81 81
82 irq -= I8259A_IRQ_BASE; 82 irq -= I8259A_IRQ_BASE;
83 mask = ~(1 << irq); 83 mask = ~(1 << irq);
84 spin_lock_irqsave(&i8259A_lock, flags); 84 raw_spin_lock_irqsave(&i8259A_lock, flags);
85 cached_irq_mask &= mask; 85 cached_irq_mask &= mask;
86 if (irq & 8) 86 if (irq & 8)
87 outb(cached_slave_mask, PIC_SLAVE_IMR); 87 outb(cached_slave_mask, PIC_SLAVE_IMR);
88 else 88 else
89 outb(cached_master_mask, PIC_MASTER_IMR); 89 outb(cached_master_mask, PIC_MASTER_IMR);
90 spin_unlock_irqrestore(&i8259A_lock, flags); 90 raw_spin_unlock_irqrestore(&i8259A_lock, flags);
91} 91}
92 92
93int i8259A_irq_pending(unsigned int irq) 93int i8259A_irq_pending(unsigned int irq)
@@ -98,12 +98,12 @@ int i8259A_irq_pending(unsigned int irq)
98 98
99 irq -= I8259A_IRQ_BASE; 99 irq -= I8259A_IRQ_BASE;
100 mask = 1 << irq; 100 mask = 1 << irq;
101 spin_lock_irqsave(&i8259A_lock, flags); 101 raw_spin_lock_irqsave(&i8259A_lock, flags);
102 if (irq < 8) 102 if (irq < 8)
103 ret = inb(PIC_MASTER_CMD) & mask; 103 ret = inb(PIC_MASTER_CMD) & mask;
104 else 104 else
105 ret = inb(PIC_SLAVE_CMD) & (mask >> 8); 105 ret = inb(PIC_SLAVE_CMD) & (mask >> 8);
106 spin_unlock_irqrestore(&i8259A_lock, flags); 106 raw_spin_unlock_irqrestore(&i8259A_lock, flags);
107 107
108 return ret; 108 return ret;
109} 109}
@@ -151,7 +151,7 @@ static void mask_and_ack_8259A(unsigned int irq)
151 151
152 irq -= I8259A_IRQ_BASE; 152 irq -= I8259A_IRQ_BASE;
153 irqmask = 1 << irq; 153 irqmask = 1 << irq;
154 spin_lock_irqsave(&i8259A_lock, flags); 154 raw_spin_lock_irqsave(&i8259A_lock, flags);
155 /* 155 /*
156 * Lightweight spurious IRQ detection. We do not want 156 * Lightweight spurious IRQ detection. We do not want
157 * to overdo spurious IRQ handling - it's usually a sign 157 * to overdo spurious IRQ handling - it's usually a sign
@@ -183,7 +183,7 @@ handle_real_irq:
183 outb(0x60+irq, PIC_MASTER_CMD); /* 'Specific EOI to master */ 183 outb(0x60+irq, PIC_MASTER_CMD); /* 'Specific EOI to master */
184 } 184 }
185 smtc_im_ack_irq(irq); 185 smtc_im_ack_irq(irq);
186 spin_unlock_irqrestore(&i8259A_lock, flags); 186 raw_spin_unlock_irqrestore(&i8259A_lock, flags);
187 return; 187 return;
188 188
189spurious_8259A_irq: 189spurious_8259A_irq:
@@ -264,7 +264,7 @@ static void init_8259A(int auto_eoi)
264 264
265 i8259A_auto_eoi = auto_eoi; 265 i8259A_auto_eoi = auto_eoi;
266 266
267 spin_lock_irqsave(&i8259A_lock, flags); 267 raw_spin_lock_irqsave(&i8259A_lock, flags);
268 268
269 outb(0xff, PIC_MASTER_IMR); /* mask all of 8259A-1 */ 269 outb(0xff, PIC_MASTER_IMR); /* mask all of 8259A-1 */
270 outb(0xff, PIC_SLAVE_IMR); /* mask all of 8259A-2 */ 270 outb(0xff, PIC_SLAVE_IMR); /* mask all of 8259A-2 */
@@ -298,7 +298,7 @@ static void init_8259A(int auto_eoi)
298 outb(cached_master_mask, PIC_MASTER_IMR); /* restore master IRQ mask */ 298 outb(cached_master_mask, PIC_MASTER_IMR); /* restore master IRQ mask */
299 outb(cached_slave_mask, PIC_SLAVE_IMR); /* restore slave IRQ mask */ 299 outb(cached_slave_mask, PIC_SLAVE_IMR); /* restore slave IRQ mask */
300 300
301 spin_unlock_irqrestore(&i8259A_lock, flags); 301 raw_spin_unlock_irqrestore(&i8259A_lock, flags);
302} 302}
303 303
304/* 304/*
diff --git a/arch/mips/kernel/irq-gt641xx.c b/arch/mips/kernel/irq-gt641xx.c
index ebcc5f7ad9c2..42ef81461bfc 100644
--- a/arch/mips/kernel/irq-gt641xx.c
+++ b/arch/mips/kernel/irq-gt641xx.c
@@ -27,18 +27,18 @@
27 27
28#define GT641XX_IRQ_TO_BIT(irq) (1U << (irq - GT641XX_IRQ_BASE)) 28#define GT641XX_IRQ_TO_BIT(irq) (1U << (irq - GT641XX_IRQ_BASE))
29 29
30static DEFINE_SPINLOCK(gt641xx_irq_lock); 30static DEFINE_RAW_SPINLOCK(gt641xx_irq_lock);
31 31
32static void ack_gt641xx_irq(unsigned int irq) 32static void ack_gt641xx_irq(unsigned int irq)
33{ 33{
34 unsigned long flags; 34 unsigned long flags;
35 u32 cause; 35 u32 cause;
36 36
37 spin_lock_irqsave(&gt641xx_irq_lock, flags); 37 raw_spin_lock_irqsave(&gt641xx_irq_lock, flags);
38 cause = GT_READ(GT_INTRCAUSE_OFS); 38 cause = GT_READ(GT_INTRCAUSE_OFS);
39 cause &= ~GT641XX_IRQ_TO_BIT(irq); 39 cause &= ~GT641XX_IRQ_TO_BIT(irq);
40 GT_WRITE(GT_INTRCAUSE_OFS, cause); 40 GT_WRITE(GT_INTRCAUSE_OFS, cause);
41 spin_unlock_irqrestore(&gt641xx_irq_lock, flags); 41 raw_spin_unlock_irqrestore(&gt641xx_irq_lock, flags);
42} 42}
43 43
44static void mask_gt641xx_irq(unsigned int irq) 44static void mask_gt641xx_irq(unsigned int irq)
@@ -46,11 +46,11 @@ static void mask_gt641xx_irq(unsigned int irq)
46 unsigned long flags; 46 unsigned long flags;
47 u32 mask; 47 u32 mask;
48 48
49 spin_lock_irqsave(&gt641xx_irq_lock, flags); 49 raw_spin_lock_irqsave(&gt641xx_irq_lock, flags);
50 mask = GT_READ(GT_INTRMASK_OFS); 50 mask = GT_READ(GT_INTRMASK_OFS);
51 mask &= ~GT641XX_IRQ_TO_BIT(irq); 51 mask &= ~GT641XX_IRQ_TO_BIT(irq);
52 GT_WRITE(GT_INTRMASK_OFS, mask); 52 GT_WRITE(GT_INTRMASK_OFS, mask);
53 spin_unlock_irqrestore(&gt641xx_irq_lock, flags); 53 raw_spin_unlock_irqrestore(&gt641xx_irq_lock, flags);
54} 54}
55 55
56static void mask_ack_gt641xx_irq(unsigned int irq) 56static void mask_ack_gt641xx_irq(unsigned int irq)
@@ -58,7 +58,7 @@ static void mask_ack_gt641xx_irq(unsigned int irq)
58 unsigned long flags; 58 unsigned long flags;
59 u32 cause, mask; 59 u32 cause, mask;
60 60
61 spin_lock_irqsave(&gt641xx_irq_lock, flags); 61 raw_spin_lock_irqsave(&gt641xx_irq_lock, flags);
62 mask = GT_READ(GT_INTRMASK_OFS); 62 mask = GT_READ(GT_INTRMASK_OFS);
63 mask &= ~GT641XX_IRQ_TO_BIT(irq); 63 mask &= ~GT641XX_IRQ_TO_BIT(irq);
64 GT_WRITE(GT_INTRMASK_OFS, mask); 64 GT_WRITE(GT_INTRMASK_OFS, mask);
@@ -66,7 +66,7 @@ static void mask_ack_gt641xx_irq(unsigned int irq)
66 cause = GT_READ(GT_INTRCAUSE_OFS); 66 cause = GT_READ(GT_INTRCAUSE_OFS);
67 cause &= ~GT641XX_IRQ_TO_BIT(irq); 67 cause &= ~GT641XX_IRQ_TO_BIT(irq);
68 GT_WRITE(GT_INTRCAUSE_OFS, cause); 68 GT_WRITE(GT_INTRCAUSE_OFS, cause);
69 spin_unlock_irqrestore(&gt641xx_irq_lock, flags); 69 raw_spin_unlock_irqrestore(&gt641xx_irq_lock, flags);
70} 70}
71 71
72static void unmask_gt641xx_irq(unsigned int irq) 72static void unmask_gt641xx_irq(unsigned int irq)
@@ -74,11 +74,11 @@ static void unmask_gt641xx_irq(unsigned int irq)
74 unsigned long flags; 74 unsigned long flags;
75 u32 mask; 75 u32 mask;
76 76
77 spin_lock_irqsave(&gt641xx_irq_lock, flags); 77 raw_spin_lock_irqsave(&gt641xx_irq_lock, flags);
78 mask = GT_READ(GT_INTRMASK_OFS); 78 mask = GT_READ(GT_INTRMASK_OFS);
79 mask |= GT641XX_IRQ_TO_BIT(irq); 79 mask |= GT641XX_IRQ_TO_BIT(irq);
80 GT_WRITE(GT_INTRMASK_OFS, mask); 80 GT_WRITE(GT_INTRMASK_OFS, mask);
81 spin_unlock_irqrestore(&gt641xx_irq_lock, flags); 81 raw_spin_unlock_irqrestore(&gt641xx_irq_lock, flags);
82} 82}
83 83
84static struct irq_chip gt641xx_irq_chip = { 84static struct irq_chip gt641xx_irq_chip = {
diff --git a/arch/mips/kernel/linux32.c b/arch/mips/kernel/linux32.c
index f042563c924f..bde79ef602e6 100644
--- a/arch/mips/kernel/linux32.c
+++ b/arch/mips/kernel/linux32.c
@@ -9,7 +9,6 @@
9#include <linux/mm.h> 9#include <linux/mm.h>
10#include <linux/errno.h> 10#include <linux/errno.h>
11#include <linux/file.h> 11#include <linux/file.h>
12#include <linux/smp_lock.h>
13#include <linux/highuid.h> 12#include <linux/highuid.h>
14#include <linux/resource.h> 13#include <linux/resource.h>
15#include <linux/highmem.h> 14#include <linux/highmem.h>
diff --git a/arch/mips/kernel/mcount.S b/arch/mips/kernel/mcount.S
index 0a9cfdb271dd..6851fc97a511 100644
--- a/arch/mips/kernel/mcount.S
+++ b/arch/mips/kernel/mcount.S
@@ -6,7 +6,7 @@
6 * more details. 6 * more details.
7 * 7 *
8 * Copyright (C) 2009 Lemote Inc. & DSLab, Lanzhou University, China 8 * Copyright (C) 2009 Lemote Inc. & DSLab, Lanzhou University, China
9 * Author: Wu Zhangjin <wuzj@lemote.com> 9 * Author: Wu Zhangjin <wuzhangjin@gmail.com>
10 */ 10 */
11 11
12#include <asm/regdef.h> 12#include <asm/regdef.h>
diff --git a/arch/mips/kernel/octeon_switch.S b/arch/mips/kernel/octeon_switch.S
index 3952b8323efa..dd18b26a358a 100644
--- a/arch/mips/kernel/octeon_switch.S
+++ b/arch/mips/kernel/octeon_switch.S
@@ -500,4 +500,3 @@ done_restore:
500 nop 500 nop
501 END(octeon_mult_restore) 501 END(octeon_mult_restore)
502 .set pop 502 .set pop
503
diff --git a/arch/mips/kernel/rtlx.c b/arch/mips/kernel/rtlx.c
index 364f066cb497..dcaed1bbbfe5 100644
--- a/arch/mips/kernel/rtlx.c
+++ b/arch/mips/kernel/rtlx.c
@@ -28,7 +28,6 @@
28#include <linux/vmalloc.h> 28#include <linux/vmalloc.h>
29#include <linux/elf.h> 29#include <linux/elf.h>
30#include <linux/seq_file.h> 30#include <linux/seq_file.h>
31#include <linux/smp_lock.h>
32#include <linux/syscalls.h> 31#include <linux/syscalls.h>
33#include <linux/moduleloader.h> 32#include <linux/moduleloader.h>
34#include <linux/interrupt.h> 33#include <linux/interrupt.h>
diff --git a/arch/mips/kernel/spinlock_test.c b/arch/mips/kernel/spinlock_test.c
new file mode 100644
index 000000000000..da61134dfc53
--- /dev/null
+++ b/arch/mips/kernel/spinlock_test.c
@@ -0,0 +1,141 @@
1#include <linux/init.h>
2#include <linux/kthread.h>
3#include <linux/hrtimer.h>
4#include <linux/fs.h>
5#include <linux/debugfs.h>
6#include <linux/module.h>
7#include <linux/spinlock.h>
8
9
10static int ss_get(void *data, u64 *val)
11{
12 ktime_t start, finish;
13 int loops;
14 int cont;
15 DEFINE_RAW_SPINLOCK(ss_spin);
16
17 loops = 1000000;
18 cont = 1;
19
20 start = ktime_get();
21
22 while (cont) {
23 raw_spin_lock(&ss_spin);
24 loops--;
25 if (loops == 0)
26 cont = 0;
27 raw_spin_unlock(&ss_spin);
28 }
29
30 finish = ktime_get();
31
32 *val = ktime_us_delta(finish, start);
33
34 return 0;
35}
36
37DEFINE_SIMPLE_ATTRIBUTE(fops_ss, ss_get, NULL, "%llu\n");
38
39
40
41struct spin_multi_state {
42 raw_spinlock_t lock;
43 atomic_t start_wait;
44 atomic_t enter_wait;
45 atomic_t exit_wait;
46 int loops;
47};
48
49struct spin_multi_per_thread {
50 struct spin_multi_state *state;
51 ktime_t start;
52};
53
54static int multi_other(void *data)
55{
56 int loops;
57 int cont;
58 struct spin_multi_per_thread *pt = data;
59 struct spin_multi_state *s = pt->state;
60
61 loops = s->loops;
62 cont = 1;
63
64 atomic_dec(&s->enter_wait);
65
66 while (atomic_read(&s->enter_wait))
67 ; /* spin */
68
69 pt->start = ktime_get();
70
71 atomic_dec(&s->start_wait);
72
73 while (atomic_read(&s->start_wait))
74 ; /* spin */
75
76 while (cont) {
77 raw_spin_lock(&s->lock);
78 loops--;
79 if (loops == 0)
80 cont = 0;
81 raw_spin_unlock(&s->lock);
82 }
83
84 atomic_dec(&s->exit_wait);
85 while (atomic_read(&s->exit_wait))
86 ; /* spin */
87 return 0;
88}
89
90static int multi_get(void *data, u64 *val)
91{
92 ktime_t finish;
93 struct spin_multi_state ms;
94 struct spin_multi_per_thread t1, t2;
95
96 ms.lock = __RAW_SPIN_LOCK_UNLOCKED("multi_get");
97 ms.loops = 1000000;
98
99 atomic_set(&ms.start_wait, 2);
100 atomic_set(&ms.enter_wait, 2);
101 atomic_set(&ms.exit_wait, 2);
102 t1.state = &ms;
103 t2.state = &ms;
104
105 kthread_run(multi_other, &t2, "multi_get");
106
107 multi_other(&t1);
108
109 finish = ktime_get();
110
111 *val = ktime_us_delta(finish, t1.start);
112
113 return 0;
114}
115
116DEFINE_SIMPLE_ATTRIBUTE(fops_multi, multi_get, NULL, "%llu\n");
117
118
119extern struct dentry *mips_debugfs_dir;
120static int __init spinlock_test(void)
121{
122 struct dentry *d;
123
124 if (!mips_debugfs_dir)
125 return -ENODEV;
126
127 d = debugfs_create_file("spin_single", S_IRUGO,
128 mips_debugfs_dir, NULL,
129 &fops_ss);
130 if (!d)
131 return -ENOMEM;
132
133 d = debugfs_create_file("spin_multi", S_IRUGO,
134 mips_debugfs_dir, NULL,
135 &fops_multi);
136 if (!d)
137 return -ENOMEM;
138
139 return 0;
140}
141device_initcall(spinlock_test);
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index 31b204b26ba0..4e00f9bc23ee 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -50,6 +50,7 @@
50#include <asm/types.h> 50#include <asm/types.h>
51#include <asm/stacktrace.h> 51#include <asm/stacktrace.h>
52#include <asm/irq.h> 52#include <asm/irq.h>
53#include <asm/uasm.h>
53 54
54extern void check_wait(void); 55extern void check_wait(void);
55extern asmlinkage void r4k_wait(void); 56extern asmlinkage void r4k_wait(void);
@@ -1271,21 +1272,25 @@ unsigned long ebase;
1271unsigned long exception_handlers[32]; 1272unsigned long exception_handlers[32];
1272unsigned long vi_handlers[64]; 1273unsigned long vi_handlers[64];
1273 1274
1274/* 1275void __init *set_except_vector(int n, void *addr)
1275 * As a side effect of the way this is implemented we're limited
1276 * to interrupt handlers in the address range from
1277 * KSEG0 <= x < KSEG0 + 256mb on the Nevada. Oh well ...
1278 */
1279void *set_except_vector(int n, void *addr)
1280{ 1276{
1281 unsigned long handler = (unsigned long) addr; 1277 unsigned long handler = (unsigned long) addr;
1282 unsigned long old_handler = exception_handlers[n]; 1278 unsigned long old_handler = exception_handlers[n];
1283 1279
1284 exception_handlers[n] = handler; 1280 exception_handlers[n] = handler;
1285 if (n == 0 && cpu_has_divec) { 1281 if (n == 0 && cpu_has_divec) {
1286 *(u32 *)(ebase + 0x200) = 0x08000000 | 1282 unsigned long jump_mask = ~((1 << 28) - 1);
1287 (0x03ffffff & (handler >> 2)); 1283 u32 *buf = (u32 *)(ebase + 0x200);
1288 local_flush_icache_range(ebase + 0x200, ebase + 0x204); 1284 unsigned int k0 = 26;
1285 if ((handler & jump_mask) == ((ebase + 0x200) & jump_mask)) {
1286 uasm_i_j(&buf, handler & ~jump_mask);
1287 uasm_i_nop(&buf);
1288 } else {
1289 UASM_i_LA(&buf, k0, handler);
1290 uasm_i_jr(&buf, k0);
1291 uasm_i_nop(&buf);
1292 }
1293 local_flush_icache_range(ebase + 0x200, (unsigned long)buf);
1289 } 1294 }
1290 return (void *)old_handler; 1295 return (void *)old_handler;
1291} 1296}
diff --git a/arch/mips/kernel/vpe.c b/arch/mips/kernel/vpe.c
index 60477529362e..2bd2151c586a 100644
--- a/arch/mips/kernel/vpe.c
+++ b/arch/mips/kernel/vpe.c
@@ -38,7 +38,6 @@
38#include <linux/vmalloc.h> 38#include <linux/vmalloc.h>
39#include <linux/elf.h> 39#include <linux/elf.h>
40#include <linux/seq_file.h> 40#include <linux/seq_file.h>
41#include <linux/smp_lock.h>
42#include <linux/syscalls.h> 41#include <linux/syscalls.h>
43#include <linux/moduleloader.h> 42#include <linux/moduleloader.h>
44#include <linux/interrupt.h> 43#include <linux/interrupt.h>
diff --git a/arch/mips/lasat/picvue.h b/arch/mips/lasat/picvue.h
index 91df55371127..2f0757738fdb 100644
--- a/arch/mips/lasat/picvue.h
+++ b/arch/mips/lasat/picvue.h
@@ -42,4 +42,3 @@ void pvc_move(u8 cmd);
42 42
43void pvc_clear(void); 43void pvc_clear(void);
44void pvc_home(void); 44void pvc_home(void);
45
diff --git a/arch/mips/loongson/common/cmdline.c b/arch/mips/loongson/common/cmdline.c
index 7ad47f227477..1a06defc4f7f 100644
--- a/arch/mips/loongson/common/cmdline.c
+++ b/arch/mips/loongson/common/cmdline.c
@@ -10,7 +10,7 @@
10 * Author: Fuxin Zhang, zhangfx@lemote.com 10 * Author: Fuxin Zhang, zhangfx@lemote.com
11 * 11 *
12 * Copyright (C) 2009 Lemote Inc. 12 * Copyright (C) 2009 Lemote Inc.
13 * Author: Wu Zhangjin, wuzj@lemote.com 13 * Author: Wu Zhangjin, wuzhangjin@gmail.com
14 * 14 *
15 * This program is free software; you can redistribute it and/or modify it 15 * This program is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by the 16 * under the terms of the GNU General Public License as published by the
@@ -21,12 +21,11 @@
21 21
22#include <loongson.h> 22#include <loongson.h>
23 23
24int prom_argc;
25/* pmon passes arguments in 32bit pointers */
26int *_prom_argv;
27
28void __init prom_init_cmdline(void) 24void __init prom_init_cmdline(void)
29{ 25{
26 int prom_argc;
27 /* pmon passes arguments in 32bit pointers */
28 int *_prom_argv;
30 int i; 29 int i;
31 long l; 30 long l;
32 31
diff --git a/arch/mips/loongson/common/cs5536/cs5536_acc.c b/arch/mips/loongson/common/cs5536/cs5536_acc.c
index b49485f187e0..b3fd5eab6548 100644
--- a/arch/mips/loongson/common/cs5536/cs5536_acc.c
+++ b/arch/mips/loongson/common/cs5536/cs5536_acc.c
@@ -5,7 +5,7 @@
5 * Author : jlliu, liujl@lemote.com 5 * Author : jlliu, liujl@lemote.com
6 * 6 *
7 * Copyright (C) 2009 Lemote, Inc. 7 * Copyright (C) 2009 Lemote, Inc.
8 * Author: Wu Zhangjin, wuzj@lemote.com 8 * Author: Wu Zhangjin, wuzhangjin@gmail.com
9 * 9 *
10 * This program is free software; you can redistribute it and/or modify it 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 11 * under the terms of the GNU General Public License as published by the
diff --git a/arch/mips/loongson/common/cs5536/cs5536_ehci.c b/arch/mips/loongson/common/cs5536/cs5536_ehci.c
index 74f9c59d36af..eaf8b86e3318 100644
--- a/arch/mips/loongson/common/cs5536/cs5536_ehci.c
+++ b/arch/mips/loongson/common/cs5536/cs5536_ehci.c
@@ -5,7 +5,7 @@
5 * Author : jlliu, liujl@lemote.com 5 * Author : jlliu, liujl@lemote.com
6 * 6 *
7 * Copyright (C) 2009 Lemote, Inc. 7 * Copyright (C) 2009 Lemote, Inc.
8 * Author: Wu Zhangjin, wuzj@lemote.com 8 * Author: Wu Zhangjin, wuzhangjin@gmail.com
9 * 9 *
10 * This program is free software; you can redistribute it and/or modify it 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 11 * under the terms of the GNU General Public License as published by the
diff --git a/arch/mips/loongson/common/cs5536/cs5536_ide.c b/arch/mips/loongson/common/cs5536/cs5536_ide.c
index 3f61594b3884..9a96b5664c78 100644
--- a/arch/mips/loongson/common/cs5536/cs5536_ide.c
+++ b/arch/mips/loongson/common/cs5536/cs5536_ide.c
@@ -5,7 +5,7 @@
5 * Author : jlliu, liujl@lemote.com 5 * Author : jlliu, liujl@lemote.com
6 * 6 *
7 * Copyright (C) 2009 Lemote, Inc. 7 * Copyright (C) 2009 Lemote, Inc.
8 * Author: Wu Zhangjin, wuzj@lemote.com 8 * Author: Wu Zhangjin, wuzhangjin@gmail.com
9 * 9 *
10 * This program is free software; you can redistribute it and/or modify it 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 11 * under the terms of the GNU General Public License as published by the
diff --git a/arch/mips/loongson/common/cs5536/cs5536_isa.c b/arch/mips/loongson/common/cs5536/cs5536_isa.c
index b6f17f538e48..f5c0818831b2 100644
--- a/arch/mips/loongson/common/cs5536/cs5536_isa.c
+++ b/arch/mips/loongson/common/cs5536/cs5536_isa.c
@@ -5,7 +5,7 @@
5 * Author : jlliu, liujl@lemote.com 5 * Author : jlliu, liujl@lemote.com
6 * 6 *
7 * Copyright (C) 2009 Lemote, Inc. 7 * Copyright (C) 2009 Lemote, Inc.
8 * Author: Wu Zhangjin, wuzj@lemote.com 8 * Author: Wu Zhangjin, wuzhangjin@gmail.com
9 * 9 *
10 * This program is free software; you can redistribute it and/or modify it 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 11 * under the terms of the GNU General Public License as published by the
diff --git a/arch/mips/loongson/common/cs5536/cs5536_mfgpt.c b/arch/mips/loongson/common/cs5536/cs5536_mfgpt.c
index 6cb44dbaeec2..8c807c965199 100644
--- a/arch/mips/loongson/common/cs5536/cs5536_mfgpt.c
+++ b/arch/mips/loongson/common/cs5536/cs5536_mfgpt.c
@@ -5,7 +5,7 @@
5 * Author: Yanhua, yanh@lemote.com 5 * Author: Yanhua, yanh@lemote.com
6 * 6 *
7 * Copyright (C) 2009 Lemote Inc. 7 * Copyright (C) 2009 Lemote Inc.
8 * Author: Wu zhangjin, wuzj@lemote.com 8 * Author: Wu zhangjin, wuzhangjin@gmail.com
9 * 9 *
10 * Reference: AMD Geode(TM) CS5536 Companion Device Data Book 10 * Reference: AMD Geode(TM) CS5536 Companion Device Data Book
11 * 11 *
diff --git a/arch/mips/loongson/common/cs5536/cs5536_ohci.c b/arch/mips/loongson/common/cs5536/cs5536_ohci.c
index 8fdb02b6e90f..db5900aadd6b 100644
--- a/arch/mips/loongson/common/cs5536/cs5536_ohci.c
+++ b/arch/mips/loongson/common/cs5536/cs5536_ohci.c
@@ -5,7 +5,7 @@
5 * Author : jlliu, liujl@lemote.com 5 * Author : jlliu, liujl@lemote.com
6 * 6 *
7 * Copyright (C) 2009 Lemote, Inc. 7 * Copyright (C) 2009 Lemote, Inc.
8 * Author: Wu Zhangjin, wuzj@lemote.com 8 * Author: Wu Zhangjin, wuzhangjin@gmail.com
9 * 9 *
10 * This program is free software; you can redistribute it and/or modify it 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 11 * under the terms of the GNU General Public License as published by the
diff --git a/arch/mips/loongson/common/cs5536/cs5536_pci.c b/arch/mips/loongson/common/cs5536/cs5536_pci.c
index e23f3d7d2c1d..6dfeab11af08 100644
--- a/arch/mips/loongson/common/cs5536/cs5536_pci.c
+++ b/arch/mips/loongson/common/cs5536/cs5536_pci.c
@@ -5,7 +5,7 @@
5 * Author : jlliu, liujl@lemote.com 5 * Author : jlliu, liujl@lemote.com
6 * 6 *
7 * Copyright (C) 2009 Lemote, Inc. 7 * Copyright (C) 2009 Lemote, Inc.
8 * Author: Wu Zhangjin, wuzj@lemote.com 8 * Author: Wu Zhangjin, wuzhangjin@gmail.com
9 * 9 *
10 * This program is free software; you can redistribute it and/or modify it 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 11 * under the terms of the GNU General Public License as published by the
diff --git a/arch/mips/loongson/common/early_printk.c b/arch/mips/loongson/common/early_printk.c
index 23e7a8f8897f..a71736f00443 100644
--- a/arch/mips/loongson/common/early_printk.c
+++ b/arch/mips/loongson/common/early_printk.c
@@ -2,7 +2,7 @@
2 * 2 *
3 * Copyright (c) 2009 Philippe Vachon <philippe@cowpig.ca> 3 * Copyright (c) 2009 Philippe Vachon <philippe@cowpig.ca>
4 * Copyright (c) 2009 Lemote Inc. 4 * Copyright (c) 2009 Lemote Inc.
5 * Author: Wu Zhangjin, wuzj@lemote.com 5 * Author: Wu Zhangjin, wuzhangjin@gmail.com
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify it 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 8 * under the terms of the GNU General Public License as published by the
diff --git a/arch/mips/loongson/common/env.c b/arch/mips/loongson/common/env.c
index 196d947d929a..ae4cff97a56c 100644
--- a/arch/mips/loongson/common/env.c
+++ b/arch/mips/loongson/common/env.c
@@ -9,8 +9,8 @@
9 * Copyright (C) 2007 Lemote Inc. & Insititute of Computing Technology 9 * Copyright (C) 2007 Lemote Inc. & Insititute of Computing Technology
10 * Author: Fuxin Zhang, zhangfx@lemote.com 10 * Author: Fuxin Zhang, zhangfx@lemote.com
11 * 11 *
12 * Copyright (C) 2009 Lemote Inc. & Insititute of Computing Technology 12 * Copyright (C) 2009 Lemote Inc.
13 * Author: Wu Zhangjin, wuzj@lemote.com 13 * Author: Wu Zhangjin, wuzhangjin@gmail.com
14 * 14 *
15 * This program is free software; you can redistribute it and/or modify it 15 * This program is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by the 16 * under the terms of the GNU General Public License as published by the
@@ -23,13 +23,10 @@
23 23
24#include <loongson.h> 24#include <loongson.h>
25 25
26unsigned long bus_clock, cpu_clock_freq; 26unsigned long cpu_clock_freq;
27EXPORT_SYMBOL(cpu_clock_freq); 27EXPORT_SYMBOL(cpu_clock_freq);
28unsigned long memsize, highmemsize; 28unsigned long memsize, highmemsize;
29 29
30/* pmon passes arguments in 32bit pointers */
31int *_prom_envp;
32
33#define parse_even_earlier(res, option, p) \ 30#define parse_even_earlier(res, option, p) \
34do { \ 31do { \
35 if (strncmp(option, (char *)p, strlen(option)) == 0) \ 32 if (strncmp(option, (char *)p, strlen(option)) == 0) \
@@ -39,6 +36,10 @@ do { \
39 36
40void __init prom_init_env(void) 37void __init prom_init_env(void)
41{ 38{
39 /* pmon passes arguments in 32bit pointers */
40 int *_prom_envp;
41 unsigned long bus_clock;
42 unsigned int processor_id;
42 long l; 43 long l;
43 44
44 /* firmware arguments are initialized in head.S */ 45 /* firmware arguments are initialized in head.S */
@@ -55,6 +56,22 @@ void __init prom_init_env(void)
55 } 56 }
56 if (memsize == 0) 57 if (memsize == 0)
57 memsize = 256; 58 memsize = 256;
59 if (bus_clock == 0)
60 bus_clock = 66000000;
61 if (cpu_clock_freq == 0) {
62 processor_id = (&current_cpu_data)->processor_id;
63 switch (processor_id & PRID_REV_MASK) {
64 case PRID_REV_LOONGSON2E:
65 cpu_clock_freq = 533080000;
66 break;
67 case PRID_REV_LOONGSON2F:
68 cpu_clock_freq = 797000000;
69 break;
70 default:
71 cpu_clock_freq = 100000000;
72 break;
73 }
74 }
58 75
59 pr_info("busclock=%ld, cpuclock=%ld, memsize=%ld, highmemsize=%ld\n", 76 pr_info("busclock=%ld, cpuclock=%ld, memsize=%ld, highmemsize=%ld\n",
60 bus_clock, cpu_clock_freq, memsize, highmemsize); 77 bus_clock, cpu_clock_freq, memsize, highmemsize);
diff --git a/arch/mips/loongson/common/init.c b/arch/mips/loongson/common/init.c
index a2abd9355737..19d341591254 100644
--- a/arch/mips/loongson/common/init.c
+++ b/arch/mips/loongson/common/init.c
@@ -1,6 +1,6 @@
1/* 1/*
2 * Copyright (C) 2009 Lemote Inc. 2 * Copyright (C) 2009 Lemote Inc.
3 * Author: Wu Zhangjin, wuzj@lemote.com 3 * Author: Wu Zhangjin, wuzhangjin@gmail.com
4 * 4 *
5 * This program is free software; you can redistribute it and/or modify it 5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the 6 * under the terms of the GNU General Public License as published by the
diff --git a/arch/mips/loongson/common/machtype.c b/arch/mips/loongson/common/machtype.c
index 0ed52b3f5314..853f184b793e 100644
--- a/arch/mips/loongson/common/machtype.c
+++ b/arch/mips/loongson/common/machtype.c
@@ -1,6 +1,6 @@
1/* 1/*
2 * Copyright (C) 2009 Lemote Inc. & Insititute of Computing Technology 2 * Copyright (C) 2009 Lemote Inc.
3 * Author: Wu Zhangjin, wuzj@lemote.com 3 * Author: Wu Zhangjin, wuzhangjin@gmail.com
4 * 4 *
5 * Copyright (c) 2009 Zhang Le <r0bertz@gentoo.org> 5 * Copyright (c) 2009 Zhang Le <r0bertz@gentoo.org>
6 * 6 *
@@ -35,6 +35,10 @@ const char *get_system_type(void)
35 return system_types[mips_machtype]; 35 return system_types[mips_machtype];
36} 36}
37 37
38void __weak __init mach_prom_init_machtype(void)
39{
40}
41
38void __init prom_init_machtype(void) 42void __init prom_init_machtype(void)
39{ 43{
40 char *p, str[MACHTYPE_LEN]; 44 char *p, str[MACHTYPE_LEN];
@@ -43,8 +47,10 @@ void __init prom_init_machtype(void)
43 mips_machtype = LOONGSON_MACHTYPE; 47 mips_machtype = LOONGSON_MACHTYPE;
44 48
45 p = strstr(arcs_cmdline, "machtype="); 49 p = strstr(arcs_cmdline, "machtype=");
46 if (!p) 50 if (!p) {
51 mach_prom_init_machtype();
47 return; 52 return;
53 }
48 p += strlen("machtype="); 54 p += strlen("machtype=");
49 strncpy(str, p, MACHTYPE_LEN); 55 strncpy(str, p, MACHTYPE_LEN);
50 p = strstr(str, " "); 56 p = strstr(str, " ");
diff --git a/arch/mips/loongson/common/mem.c b/arch/mips/loongson/common/mem.c
index ceacd092b446..ec2f7964a0b0 100644
--- a/arch/mips/loongson/common/mem.c
+++ b/arch/mips/loongson/common/mem.c
@@ -16,10 +16,11 @@
16 16
17void __init prom_init_memory(void) 17void __init prom_init_memory(void)
18{ 18{
19 add_memory_region(0x0, (memsize << 20), BOOT_MEM_RAM); 19 add_memory_region(0x0, (memsize << 20), BOOT_MEM_RAM);
20
21 add_memory_region(memsize << 20, LOONGSON_PCI_MEM_START - (memsize <<
22 20), BOOT_MEM_RESERVED);
20 23
21 add_memory_region(memsize << 20, LOONGSON_PCI_MEM_START - (memsize <<
22 20), BOOT_MEM_RESERVED);
23#ifdef CONFIG_CPU_SUPPORTS_ADDRWINCFG 24#ifdef CONFIG_CPU_SUPPORTS_ADDRWINCFG
24 { 25 {
25 int bit; 26 int bit;
diff --git a/arch/mips/loongson/common/platform.c b/arch/mips/loongson/common/platform.c
index be81777eb94d..ed007a2e0e1f 100644
--- a/arch/mips/loongson/common/platform.c
+++ b/arch/mips/loongson/common/platform.c
@@ -1,6 +1,6 @@
1/* 1/*
2 * Copyright (C) 2009 Lemote Inc. 2 * Copyright (C) 2009 Lemote Inc.
3 * Author: Wu Zhangjin, wuzj@lemote.com 3 * Author: Wu Zhangjin, wuzhangjin@gmail.com
4 * 4 *
5 * This program is free software; you can redistribute it and/or modify it 5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the 6 * under the terms of the GNU General Public License as published by the
diff --git a/arch/mips/loongson/common/pm.c b/arch/mips/loongson/common/pm.c
index b625fec8a4d5..6c1fd9001712 100644
--- a/arch/mips/loongson/common/pm.c
+++ b/arch/mips/loongson/common/pm.c
@@ -2,7 +2,7 @@
2 * loongson-specific suspend support 2 * loongson-specific suspend support
3 * 3 *
4 * Copyright (C) 2009 Lemote Inc. 4 * Copyright (C) 2009 Lemote Inc.
5 * Author: Wu Zhangjin <wuzj@lemote.com> 5 * Author: Wu Zhangjin <wuzhangjin@gmail.com>
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
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/loongson/common/reset.c b/arch/mips/loongson/common/reset.c
index d57f1719da95..4bd9c18b07a5 100644
--- a/arch/mips/loongson/common/reset.c
+++ b/arch/mips/loongson/common/reset.c
@@ -6,8 +6,8 @@
6 * 6 *
7 * Copyright (C) 2007 Lemote, Inc. & Institute of Computing Technology 7 * Copyright (C) 2007 Lemote, Inc. & Institute of Computing Technology
8 * Author: Fuxin Zhang, zhangfx@lemote.com 8 * Author: Fuxin Zhang, zhangfx@lemote.com
9 * Copyright (C) 2009 Lemote, Inc. & Institute of Computing Technology 9 * Copyright (C) 2009 Lemote, Inc.
10 * Author: Zhangjin Wu, wuzj@lemote.com 10 * Author: Zhangjin Wu, wuzhangjin@gmail.com
11 */ 11 */
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/pm.h> 13#include <linux/pm.h>
@@ -25,18 +25,26 @@ static void loongson_restart(char *command)
25 ((void (*)(void))ioremap_nocache(LOONGSON_BOOT_BASE, 4)) (); 25 ((void (*)(void))ioremap_nocache(LOONGSON_BOOT_BASE, 4)) ();
26} 26}
27 27
28static void loongson_halt(void) 28static void loongson_poweroff(void)
29{ 29{
30 mach_prepare_shutdown(); 30 mach_prepare_shutdown();
31 while (1) 31 unreachable();
32 ; 32}
33
34static void loongson_halt(void)
35{
36 pr_notice("\n\n** You can safely turn off the power now **\n\n");
37 while (1) {
38 if (cpu_wait)
39 cpu_wait();
40 }
33} 41}
34 42
35static int __init mips_reboot_setup(void) 43static int __init mips_reboot_setup(void)
36{ 44{
37 _machine_restart = loongson_restart; 45 _machine_restart = loongson_restart;
38 _machine_halt = loongson_halt; 46 _machine_halt = loongson_halt;
39 pm_power_off = loongson_halt; 47 pm_power_off = loongson_poweroff;
40 48
41 return 0; 49 return 0;
42} 50}
diff --git a/arch/mips/loongson/common/serial.c b/arch/mips/loongson/common/serial.c
index 23b66a5f88cb..7580873143c8 100644
--- a/arch/mips/loongson/common/serial.c
+++ b/arch/mips/loongson/common/serial.c
@@ -7,7 +7,7 @@
7 * 7 *
8 * Copyright (C) 2009 Lemote, Inc. 8 * Copyright (C) 2009 Lemote, Inc.
9 * Author: Yan hua (yanhua@lemote.com) 9 * Author: Yan hua (yanhua@lemote.com)
10 * Author: Wu Zhangjin (wuzj@lemote.com) 10 * Author: Wu Zhangjin (wuzhangjin@gmail.com)
11 */ 11 */
12 12
13#include <linux/io.h> 13#include <linux/io.h>
diff --git a/arch/mips/loongson/common/time.c b/arch/mips/loongson/common/time.c
index 35f0b66a94f5..9fdd01f6c56a 100644
--- a/arch/mips/loongson/common/time.c
+++ b/arch/mips/loongson/common/time.c
@@ -2,8 +2,8 @@
2 * Copyright (C) 2007 Lemote, Inc. & Institute of Computing Technology 2 * Copyright (C) 2007 Lemote, Inc. & Institute of Computing Technology
3 * Author: Fuxin Zhang, zhangfx@lemote.com 3 * Author: Fuxin Zhang, zhangfx@lemote.com
4 * 4 *
5 * Copyright (C) 2009 Lemote Inc. & Insititute of Computing Technology 5 * Copyright (C) 2009 Lemote Inc.
6 * Author: Wu Zhangjin, wuzj@lemote.com 6 * Author: Wu Zhangjin, wuzhangjin@gmail.com
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify it 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 9 * under the terms of the GNU General Public License as published by the
diff --git a/arch/mips/loongson/common/uart_base.c b/arch/mips/loongson/common/uart_base.c
index 78ff66ae749e..d69ea54bc3d1 100644
--- a/arch/mips/loongson/common/uart_base.c
+++ b/arch/mips/loongson/common/uart_base.c
@@ -1,6 +1,6 @@
1/* 1/*
2 * Copyright (C) 2009 Lemote Inc. 2 * Copyright (C) 2009 Lemote Inc.
3 * Author: Wu Zhangjin, wuzj@lemote.com 3 * Author: Wu Zhangjin, wuzhangjin@gmail.com
4 * 4 *
5 * This program is free software; you can redistribute it and/or modify it 5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the 6 * under the terms of the GNU General Public License as published by the
diff --git a/arch/mips/loongson/fuloong-2e/reset.c b/arch/mips/loongson/fuloong-2e/reset.c
index fc16c677d476..bc39ec62c8c2 100644
--- a/arch/mips/loongson/fuloong-2e/reset.c
+++ b/arch/mips/loongson/fuloong-2e/reset.c
@@ -1,8 +1,8 @@
1/* Board-specific reboot/shutdown routines 1/* Board-specific reboot/shutdown routines
2 * Copyright (c) 2009 Philippe Vachon <philippe@cowpig.ca> 2 * Copyright (c) 2009 Philippe Vachon <philippe@cowpig.ca>
3 * 3 *
4 * Copyright (C) 2009 Lemote Inc. & Insititute of Computing Technology 4 * Copyright (C) 2009 Lemote Inc.
5 * Author: Wu Zhangjin, wuzj@lemote.com 5 * Author: Wu Zhangjin, wuzhangjin@gmail.com
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify it 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 8 * under the terms of the GNU General Public License as published by the
diff --git a/arch/mips/loongson/lemote-2f/Makefile b/arch/mips/loongson/lemote-2f/Makefile
index 4d84b27dc41b..8699a53f0477 100644
--- a/arch/mips/loongson/lemote-2f/Makefile
+++ b/arch/mips/loongson/lemote-2f/Makefile
@@ -2,7 +2,7 @@
2# Makefile for lemote loongson2f family machines 2# Makefile for lemote loongson2f family machines
3# 3#
4 4
5obj-y += irq.o reset.o ec_kb3310b.o 5obj-y += machtype.o irq.o reset.o ec_kb3310b.o
6 6
7# 7#
8# Suspend Support 8# Suspend Support
diff --git a/arch/mips/loongson/lemote-2f/ec_kb3310b.c b/arch/mips/loongson/lemote-2f/ec_kb3310b.c
index 4d84111a2cd4..64057244eec5 100644
--- a/arch/mips/loongson/lemote-2f/ec_kb3310b.c
+++ b/arch/mips/loongson/lemote-2f/ec_kb3310b.c
@@ -75,6 +75,8 @@ int ec_query_seq(unsigned char cmd)
75 udelay(EC_REG_DELAY); 75 udelay(EC_REG_DELAY);
76 } 76 }
77 77
78 spin_unlock_irqrestore(&port_access_lock, flags);
79
78 if (timeout <= 0) { 80 if (timeout <= 0) {
79 printk(KERN_ERR "%s: deadable error : timeout...\n", __func__); 81 printk(KERN_ERR "%s: deadable error : timeout...\n", __func__);
80 ret = -EINVAL; 82 ret = -EINVAL;
@@ -83,8 +85,6 @@ int ec_query_seq(unsigned char cmd)
83 "(%x/%d)ec issued command %d status : 0x%x\n", 85 "(%x/%d)ec issued command %d status : 0x%x\n",
84 timeout, EC_CMD_TIMEOUT - timeout, cmd, status); 86 timeout, EC_CMD_TIMEOUT - timeout, cmd, status);
85 87
86 spin_unlock_irqrestore(&port_access_lock, flags);
87
88 return ret; 88 return ret;
89} 89}
90EXPORT_SYMBOL_GPL(ec_query_seq); 90EXPORT_SYMBOL_GPL(ec_query_seq);
diff --git a/arch/mips/loongson/lemote-2f/irq.c b/arch/mips/loongson/lemote-2f/irq.c
index 77d32f9cf31e..882dfcd42c00 100644
--- a/arch/mips/loongson/lemote-2f/irq.c
+++ b/arch/mips/loongson/lemote-2f/irq.c
@@ -38,7 +38,7 @@ int mach_i8259_irq(void)
38 irq = -1; 38 irq = -1;
39 39
40 if ((LOONGSON_INTISR & LOONGSON_INTEN) & LOONGSON_INT_BIT_INT0) { 40 if ((LOONGSON_INTISR & LOONGSON_INTEN) & LOONGSON_INT_BIT_INT0) {
41 spin_lock(&i8259A_lock); 41 raw_spin_lock(&i8259A_lock);
42 isr = inb(PIC_MASTER_CMD) & 42 isr = inb(PIC_MASTER_CMD) &
43 ~inb(PIC_MASTER_IMR) & ~(1 << PIC_CASCADE_IR); 43 ~inb(PIC_MASTER_IMR) & ~(1 << PIC_CASCADE_IR);
44 if (!isr) 44 if (!isr)
@@ -56,7 +56,7 @@ int mach_i8259_irq(void)
56 if (~inb(PIC_MASTER_ISR) & 0x80) 56 if (~inb(PIC_MASTER_ISR) & 0x80)
57 irq = -1; 57 irq = -1;
58 } 58 }
59 spin_unlock(&i8259A_lock); 59 raw_spin_unlock(&i8259A_lock);
60 } 60 }
61 61
62 return irq; 62 return irq;
diff --git a/arch/mips/loongson/lemote-2f/machtype.c b/arch/mips/loongson/lemote-2f/machtype.c
new file mode 100644
index 000000000000..e860a2705c27
--- /dev/null
+++ b/arch/mips/loongson/lemote-2f/machtype.c
@@ -0,0 +1,45 @@
1/*
2 * Copyright (C) 2009 Lemote Inc.
3 * Author: Wu Zhangjin, wuzhangjin@gmail.com
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 */
10#include <asm/bootinfo.h>
11
12#include <loongson.h>
13
14void __init mach_prom_init_machtype(void)
15{
16 /* We share the same kernel image file among Lemote 2F family
17 * of machines, and provide the machtype= kernel command line
18 * to users to indicate their machine, this command line will
19 * be passed by the latest PMON automatically. and fortunately,
20 * up to now, we can get the machine type from the PMON_VER=
21 * commandline directly except the NAS machine, In the old
22 * machines, this will help the users a lot.
23 *
24 * If no "machtype=" passed, get machine type from "PMON_VER=".
25 * PMON_VER=LM8089 Lemote 8.9'' netbook
26 * LM8101 Lemote 10.1'' netbook
27 * (The above two netbooks have the same kernel support)
28 * LM6XXX Lemote FuLoong(2F) box series
29 * LM9XXX Lemote LynLoong PC series
30 */
31 if (strstr(arcs_cmdline, "PMON_VER=LM")) {
32 if (strstr(arcs_cmdline, "PMON_VER=LM8"))
33 mips_machtype = MACH_LEMOTE_YL2F89;
34 else if (strstr(arcs_cmdline, "PMON_VER=LM6"))
35 mips_machtype = MACH_LEMOTE_FL2F;
36 else if (strstr(arcs_cmdline, "PMON_VER=LM9"))
37 mips_machtype = MACH_LEMOTE_LL2F;
38 else
39 mips_machtype = MACH_LEMOTE_NAS;
40
41 strcat(arcs_cmdline, " machtype=");
42 strcat(arcs_cmdline, get_system_type());
43 strcat(arcs_cmdline, " ");
44 }
45}
diff --git a/arch/mips/loongson/lemote-2f/pm.c b/arch/mips/loongson/lemote-2f/pm.c
index d7af2e616592..cac4d382ea73 100644
--- a/arch/mips/loongson/lemote-2f/pm.c
+++ b/arch/mips/loongson/lemote-2f/pm.c
@@ -2,7 +2,7 @@
2 * Lemote loongson2f family machines' specific suspend support 2 * Lemote loongson2f family machines' specific suspend support
3 * 3 *
4 * Copyright (C) 2009 Lemote Inc. 4 * Copyright (C) 2009 Lemote Inc.
5 * Author: Wu Zhangjin <wuzj@lemote.com> 5 * Author: Wu Zhangjin <wuzhangjin@gmail.com>
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
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/loongson/lemote-2f/reset.c b/arch/mips/loongson/lemote-2f/reset.c
index 51d1a60d5349..36020a07e180 100644
--- a/arch/mips/loongson/lemote-2f/reset.c
+++ b/arch/mips/loongson/lemote-2f/reset.c
@@ -3,7 +3,7 @@
3 * Copyright (c) 2009 Philippe Vachon <philippe@cowpig.ca> 3 * Copyright (c) 2009 Philippe Vachon <philippe@cowpig.ca>
4 * 4 *
5 * Copyright (C) 2009 Lemote Inc. 5 * Copyright (C) 2009 Lemote Inc.
6 * Author: Wu Zhangjin, wuzj@lemote.com 6 * Author: Wu Zhangjin, wuzhangjin@gmail.com
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify it 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 9 * under the terms of the GNU General Public License as published by the
diff --git a/arch/mips/math-emu/ieee754d.c b/arch/mips/math-emu/ieee754d.c
index 7e900f30987e..a0325337b76c 100644
--- a/arch/mips/math-emu/ieee754d.c
+++ b/arch/mips/math-emu/ieee754d.c
@@ -135,4 +135,3 @@ ieee754sp ieee754sp_dump(char *m, ieee754sp x)
135 printk("\n"); 135 printk("\n");
136 return x; 136 return x;
137} 137}
138
diff --git a/arch/mips/math-emu/ieee754dp.c b/arch/mips/math-emu/ieee754dp.c
index 6d2d89f32472..2f22fd7fd784 100644
--- a/arch/mips/math-emu/ieee754dp.c
+++ b/arch/mips/math-emu/ieee754dp.c
@@ -148,7 +148,6 @@ ieee754dp ieee754dp_format(int sn, int xe, u64 xm)
148 148
149 switch(ieee754_csr.rm) { 149 switch(ieee754_csr.rm) {
150 case IEEE754_RN: 150 case IEEE754_RN:
151 return ieee754dp_zero(sn);
152 case IEEE754_RZ: 151 case IEEE754_RZ:
153 return ieee754dp_zero(sn); 152 return ieee754dp_zero(sn);
154 case IEEE754_RU: /* toward +Infinity */ 153 case IEEE754_RU: /* toward +Infinity */
diff --git a/arch/mips/math-emu/ieee754sp.c b/arch/mips/math-emu/ieee754sp.c
index 463534045ab6..a19b72185ab9 100644
--- a/arch/mips/math-emu/ieee754sp.c
+++ b/arch/mips/math-emu/ieee754sp.c
@@ -149,7 +149,6 @@ ieee754sp ieee754sp_format(int sn, int xe, unsigned xm)
149 149
150 switch(ieee754_csr.rm) { 150 switch(ieee754_csr.rm) {
151 case IEEE754_RN: 151 case IEEE754_RN:
152 return ieee754sp_zero(sn);
153 case IEEE754_RZ: 152 case IEEE754_RZ:
154 return ieee754sp_zero(sn); 153 return ieee754sp_zero(sn);
155 case IEEE754_RU: /* toward +Infinity */ 154 case IEEE754_RU: /* toward +Infinity */
diff --git a/arch/mips/math-emu/ieee754xcpt.c b/arch/mips/math-emu/ieee754xcpt.c
index 7d8ef8965067..e02423a0ae23 100644
--- a/arch/mips/math-emu/ieee754xcpt.c
+++ b/arch/mips/math-emu/ieee754xcpt.c
@@ -46,4 +46,3 @@ void ieee754_xcpt(struct ieee754xctx *xcp)
46 printk(KERN_DEBUG "floating point exception in \"%s\", type=%s\n", 46 printk(KERN_DEBUG "floating point exception in \"%s\", type=%s\n",
47 xcp->op, rtnames[xcp->rt]); 47 xcp->op, rtnames[xcp->rt]);
48} 48}
49
diff --git a/arch/mips/mm/c-octeon.c b/arch/mips/mm/c-octeon.c
index e06f1af760a7..0f9c488044d1 100644
--- a/arch/mips/mm/c-octeon.c
+++ b/arch/mips/mm/c-octeon.c
@@ -183,6 +183,7 @@ static void __cpuinit probe_octeon(void)
183 183
184 switch (c->cputype) { 184 switch (c->cputype) {
185 case CPU_CAVIUM_OCTEON: 185 case CPU_CAVIUM_OCTEON:
186 case CPU_CAVIUM_OCTEON_PLUS:
186 config1 = read_c0_config1(); 187 config1 = read_c0_config1();
187 c->icache.linesz = 2 << ((config1 >> 19) & 7); 188 c->icache.linesz = 2 << ((config1 >> 19) & 7);
188 c->icache.sets = 64 << ((config1 >> 22) & 7); 189 c->icache.sets = 64 << ((config1 >> 22) & 7);
@@ -192,10 +193,10 @@ static void __cpuinit probe_octeon(void)
192 c->icache.sets * c->icache.ways * c->icache.linesz; 193 c->icache.sets * c->icache.ways * c->icache.linesz;
193 c->icache.waybit = ffs(icache_size / c->icache.ways) - 1; 194 c->icache.waybit = ffs(icache_size / c->icache.ways) - 1;
194 c->dcache.linesz = 128; 195 c->dcache.linesz = 128;
195 if (OCTEON_IS_MODEL(OCTEON_CN3XXX)) 196 if (c->cputype == CPU_CAVIUM_OCTEON_PLUS)
196 c->dcache.sets = 1; /* CN3XXX has one Dcache set */
197 else
198 c->dcache.sets = 2; /* CN5XXX has two Dcache sets */ 197 c->dcache.sets = 2; /* CN5XXX has two Dcache sets */
198 else
199 c->dcache.sets = 1; /* CN3XXX has one Dcache set */
199 c->dcache.ways = 64; 200 c->dcache.ways = 64;
200 dcache_size = 201 dcache_size =
201 c->dcache.sets * c->dcache.ways * c->dcache.linesz; 202 c->dcache.sets * c->dcache.ways * c->dcache.linesz;
@@ -305,4 +306,3 @@ asmlinkage void cache_parity_error_octeon_non_recoverable(void)
305{ 306{
306 cache_parity_error_octeon(1); 307 cache_parity_error_octeon(1);
307} 308}
308
diff --git a/arch/mips/mm/cache.c b/arch/mips/mm/cache.c
index e716cafc346d..be8627bc5b02 100644
--- a/arch/mips/mm/cache.c
+++ b/arch/mips/mm/cache.c
@@ -137,22 +137,43 @@ EXPORT_SYMBOL_GPL(_page_cachable_default);
137 137
138static inline void setup_protection_map(void) 138static inline void setup_protection_map(void)
139{ 139{
140 protection_map[0] = PAGE_NONE; 140 if (kernel_uses_smartmips_rixi) {
141 protection_map[1] = PAGE_READONLY; 141 protection_map[0] = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_NO_EXEC | _PAGE_NO_READ);
142 protection_map[2] = PAGE_COPY; 142 protection_map[1] = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_NO_EXEC);
143 protection_map[3] = PAGE_COPY; 143 protection_map[2] = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_NO_EXEC | _PAGE_NO_READ);
144 protection_map[4] = PAGE_READONLY; 144 protection_map[3] = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_NO_EXEC);
145 protection_map[5] = PAGE_READONLY; 145 protection_map[4] = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_NO_READ);
146 protection_map[6] = PAGE_COPY; 146 protection_map[5] = __pgprot(_page_cachable_default | _PAGE_PRESENT);
147 protection_map[7] = PAGE_COPY; 147 protection_map[6] = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_NO_READ);
148 protection_map[8] = PAGE_NONE; 148 protection_map[7] = __pgprot(_page_cachable_default | _PAGE_PRESENT);
149 protection_map[9] = PAGE_READONLY; 149
150 protection_map[10] = PAGE_SHARED; 150 protection_map[8] = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_NO_EXEC | _PAGE_NO_READ);
151 protection_map[11] = PAGE_SHARED; 151 protection_map[9] = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_NO_EXEC);
152 protection_map[12] = PAGE_READONLY; 152 protection_map[10] = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_NO_EXEC | _PAGE_WRITE | _PAGE_NO_READ);
153 protection_map[13] = PAGE_READONLY; 153 protection_map[11] = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_NO_EXEC | _PAGE_WRITE);
154 protection_map[14] = PAGE_SHARED; 154 protection_map[12] = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_NO_READ);
155 protection_map[15] = PAGE_SHARED; 155 protection_map[13] = __pgprot(_page_cachable_default | _PAGE_PRESENT);
156 protection_map[14] = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_WRITE | _PAGE_NO_READ);
157 protection_map[15] = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_WRITE);
158
159 } else {
160 protection_map[0] = PAGE_NONE;
161 protection_map[1] = PAGE_READONLY;
162 protection_map[2] = PAGE_COPY;
163 protection_map[3] = PAGE_COPY;
164 protection_map[4] = PAGE_READONLY;
165 protection_map[5] = PAGE_READONLY;
166 protection_map[6] = PAGE_COPY;
167 protection_map[7] = PAGE_COPY;
168 protection_map[8] = PAGE_NONE;
169 protection_map[9] = PAGE_READONLY;
170 protection_map[10] = PAGE_SHARED;
171 protection_map[11] = PAGE_SHARED;
172 protection_map[12] = PAGE_READONLY;
173 protection_map[13] = PAGE_READONLY;
174 protection_map[14] = PAGE_SHARED;
175 protection_map[15] = PAGE_SHARED;
176 }
156} 177}
157 178
158void __cpuinit cpu_cache_init(void) 179void __cpuinit cpu_cache_init(void)
diff --git a/arch/mips/mm/fault.c b/arch/mips/mm/fault.c
index e97a7a2fb2c0..b78f7d913ca4 100644
--- a/arch/mips/mm/fault.c
+++ b/arch/mips/mm/fault.c
@@ -99,8 +99,31 @@ good_area:
99 if (!(vma->vm_flags & VM_WRITE)) 99 if (!(vma->vm_flags & VM_WRITE))
100 goto bad_area; 100 goto bad_area;
101 } else { 101 } else {
102 if (!(vma->vm_flags & (VM_READ | VM_WRITE | VM_EXEC))) 102 if (kernel_uses_smartmips_rixi) {
103 goto bad_area; 103 if (address == regs->cp0_epc && !(vma->vm_flags & VM_EXEC)) {
104#if 0
105 pr_notice("Cpu%d[%s:%d:%0*lx:%ld:%0*lx] XI violation\n",
106 raw_smp_processor_id(),
107 current->comm, current->pid,
108 field, address, write,
109 field, regs->cp0_epc);
110#endif
111 goto bad_area;
112 }
113 if (!(vma->vm_flags & VM_READ)) {
114#if 0
115 pr_notice("Cpu%d[%s:%d:%0*lx:%ld:%0*lx] RI violation\n",
116 raw_smp_processor_id(),
117 current->comm, current->pid,
118 field, address, write,
119 field, regs->cp0_epc);
120#endif
121 goto bad_area;
122 }
123 } else {
124 if (!(vma->vm_flags & (VM_READ | VM_WRITE | VM_EXEC)))
125 goto bad_area;
126 }
104 } 127 }
105 128
106 /* 129 /*
diff --git a/arch/mips/mm/highmem.c b/arch/mips/mm/highmem.c
index e274fda329f4..127d732474bf 100644
--- a/arch/mips/mm/highmem.c
+++ b/arch/mips/mm/highmem.c
@@ -1,5 +1,6 @@
1#include <linux/module.h> 1#include <linux/module.h>
2#include <linux/highmem.h> 2#include <linux/highmem.h>
3#include <linux/sched.h>
3#include <linux/smp.h> 4#include <linux/smp.h>
4#include <asm/fixmap.h> 5#include <asm/fixmap.h>
5#include <asm/tlbflush.h> 6#include <asm/tlbflush.h>
diff --git a/arch/mips/mm/hugetlbpage.c b/arch/mips/mm/hugetlbpage.c
index 8c2834f5919d..cd0660c51f28 100644
--- a/arch/mips/mm/hugetlbpage.c
+++ b/arch/mips/mm/hugetlbpage.c
@@ -97,4 +97,3 @@ follow_huge_pmd(struct mm_struct *mm, unsigned long address,
97 page += ((address & ~HPAGE_MASK) >> PAGE_SHIFT); 97 page += ((address & ~HPAGE_MASK) >> PAGE_SHIFT);
98 return page; 98 return page;
99} 99}
100
diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c
index 1651942f7feb..12539af38a99 100644
--- a/arch/mips/mm/init.c
+++ b/arch/mips/mm/init.c
@@ -143,7 +143,7 @@ void *kmap_coherent(struct page *page, unsigned long addr)
143#if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32) 143#if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32)
144 entrylo = pte.pte_high; 144 entrylo = pte.pte_high;
145#else 145#else
146 entrylo = pte_val(pte) >> 6; 146 entrylo = pte_to_entrylo(pte_val(pte));
147#endif 147#endif
148 148
149 ENTER_CRITICAL(flags); 149 ENTER_CRITICAL(flags);
@@ -298,7 +298,7 @@ void __init fixrange_init(unsigned long start, unsigned long end,
298} 298}
299 299
300#ifndef CONFIG_NEED_MULTIPLE_NODES 300#ifndef CONFIG_NEED_MULTIPLE_NODES
301static int __init page_is_ram(unsigned long pagenr) 301int page_is_ram(unsigned long pagenr)
302{ 302{
303 int i; 303 int i;
304 304
@@ -477,7 +477,7 @@ unsigned long pgd_current[NR_CPUS];
477 * will officially be retired. 477 * will officially be retired.
478 */ 478 */
479pgd_t swapper_pg_dir[_PTRS_PER_PGD] __page_aligned(_PGD_ORDER); 479pgd_t swapper_pg_dir[_PTRS_PER_PGD] __page_aligned(_PGD_ORDER);
480#ifdef CONFIG_64BIT 480#ifndef __PAGETABLE_PMD_FOLDED
481pmd_t invalid_pmd_table[PTRS_PER_PMD] __page_aligned(PMD_ORDER); 481pmd_t invalid_pmd_table[PTRS_PER_PMD] __page_aligned(PMD_ORDER);
482#endif 482#endif
483pte_t invalid_pte_table[PTRS_PER_PTE] __page_aligned(PTE_ORDER); 483pte_t invalid_pte_table[PTRS_PER_PTE] __page_aligned(PTE_ORDER);
diff --git a/arch/mips/mm/page.c b/arch/mips/mm/page.c
index f5c73754d664..36272f7d3744 100644
--- a/arch/mips/mm/page.c
+++ b/arch/mips/mm/page.c
@@ -35,7 +35,7 @@
35#include <asm/sibyte/sb1250_dma.h> 35#include <asm/sibyte/sb1250_dma.h>
36#endif 36#endif
37 37
38#include "uasm.h" 38#include <asm/uasm.h>
39 39
40/* Registers used in the assembled routines. */ 40/* Registers used in the assembled routines. */
41#define ZERO 0 41#define ZERO 0
diff --git a/arch/mips/mm/pgtable-64.c b/arch/mips/mm/pgtable-64.c
index 1121019fa456..78eaa4f0b0ec 100644
--- a/arch/mips/mm/pgtable-64.c
+++ b/arch/mips/mm/pgtable-64.c
@@ -15,23 +15,31 @@
15void pgd_init(unsigned long page) 15void pgd_init(unsigned long page)
16{ 16{
17 unsigned long *p, *end; 17 unsigned long *p, *end;
18 unsigned long entry;
19
20#ifdef __PAGETABLE_PMD_FOLDED
21 entry = (unsigned long)invalid_pte_table;
22#else
23 entry = (unsigned long)invalid_pmd_table;
24#endif
18 25
19 p = (unsigned long *) page; 26 p = (unsigned long *) page;
20 end = p + PTRS_PER_PGD; 27 end = p + PTRS_PER_PGD;
21 28
22 while (p < end) { 29 while (p < end) {
23 p[0] = (unsigned long) invalid_pmd_table; 30 p[0] = entry;
24 p[1] = (unsigned long) invalid_pmd_table; 31 p[1] = entry;
25 p[2] = (unsigned long) invalid_pmd_table; 32 p[2] = entry;
26 p[3] = (unsigned long) invalid_pmd_table; 33 p[3] = entry;
27 p[4] = (unsigned long) invalid_pmd_table; 34 p[4] = entry;
28 p[5] = (unsigned long) invalid_pmd_table; 35 p[5] = entry;
29 p[6] = (unsigned long) invalid_pmd_table; 36 p[6] = entry;
30 p[7] = (unsigned long) invalid_pmd_table; 37 p[7] = entry;
31 p += 8; 38 p += 8;
32 } 39 }
33} 40}
34 41
42#ifndef __PAGETABLE_PMD_FOLDED
35void pmd_init(unsigned long addr, unsigned long pagetable) 43void pmd_init(unsigned long addr, unsigned long pagetable)
36{ 44{
37 unsigned long *p, *end; 45 unsigned long *p, *end;
@@ -40,17 +48,18 @@ void pmd_init(unsigned long addr, unsigned long pagetable)
40 end = p + PTRS_PER_PMD; 48 end = p + PTRS_PER_PMD;
41 49
42 while (p < end) { 50 while (p < end) {
43 p[0] = (unsigned long)pagetable; 51 p[0] = pagetable;
44 p[1] = (unsigned long)pagetable; 52 p[1] = pagetable;
45 p[2] = (unsigned long)pagetable; 53 p[2] = pagetable;
46 p[3] = (unsigned long)pagetable; 54 p[3] = pagetable;
47 p[4] = (unsigned long)pagetable; 55 p[4] = pagetable;
48 p[5] = (unsigned long)pagetable; 56 p[5] = pagetable;
49 p[6] = (unsigned long)pagetable; 57 p[6] = pagetable;
50 p[7] = (unsigned long)pagetable; 58 p[7] = pagetable;
51 p += 8; 59 p += 8;
52 } 60 }
53} 61}
62#endif
54 63
55void __init pagetable_init(void) 64void __init pagetable_init(void)
56{ 65{
@@ -59,8 +68,9 @@ void __init pagetable_init(void)
59 68
60 /* Initialize the entire pgd. */ 69 /* Initialize the entire pgd. */
61 pgd_init((unsigned long)swapper_pg_dir); 70 pgd_init((unsigned long)swapper_pg_dir);
71#ifndef __PAGETABLE_PMD_FOLDED
62 pmd_init((unsigned long)invalid_pmd_table, (unsigned long)invalid_pte_table); 72 pmd_init((unsigned long)invalid_pmd_table, (unsigned long)invalid_pte_table);
63 73#endif
64 pgd_base = swapper_pg_dir; 74 pgd_base = swapper_pg_dir;
65 /* 75 /*
66 * Fixed mappings: 76 * Fixed mappings:
diff --git a/arch/mips/mm/tlb-r4k.c b/arch/mips/mm/tlb-r4k.c
index d73428b18b0a..c618eed933a1 100644
--- a/arch/mips/mm/tlb-r4k.c
+++ b/arch/mips/mm/tlb-r4k.c
@@ -303,7 +303,7 @@ void __update_tlb(struct vm_area_struct * vma, unsigned long address, pte_t pte)
303 unsigned long lo; 303 unsigned long lo;
304 write_c0_pagemask(PM_HUGE_MASK); 304 write_c0_pagemask(PM_HUGE_MASK);
305 ptep = (pte_t *)pmdp; 305 ptep = (pte_t *)pmdp;
306 lo = pte_val(*ptep) >> 6; 306 lo = pte_to_entrylo(pte_val(*ptep));
307 write_c0_entrylo0(lo); 307 write_c0_entrylo0(lo);
308 write_c0_entrylo1(lo + (HPAGE_SIZE >> 7)); 308 write_c0_entrylo1(lo + (HPAGE_SIZE >> 7));
309 309
@@ -323,8 +323,8 @@ void __update_tlb(struct vm_area_struct * vma, unsigned long address, pte_t pte)
323 ptep++; 323 ptep++;
324 write_c0_entrylo1(ptep->pte_high); 324 write_c0_entrylo1(ptep->pte_high);
325#else 325#else
326 write_c0_entrylo0(pte_val(*ptep++) >> 6); 326 write_c0_entrylo0(pte_to_entrylo(pte_val(*ptep++)));
327 write_c0_entrylo1(pte_val(*ptep) >> 6); 327 write_c0_entrylo1(pte_to_entrylo(pte_val(*ptep)));
328#endif 328#endif
329 mtc0_tlbw_hazard(); 329 mtc0_tlbw_hazard();
330 if (idx < 0) 330 if (idx < 0)
@@ -337,40 +337,6 @@ void __update_tlb(struct vm_area_struct * vma, unsigned long address, pte_t pte)
337 EXIT_CRITICAL(flags); 337 EXIT_CRITICAL(flags);
338} 338}
339 339
340#if 0
341static void r4k_update_mmu_cache_hwbug(struct vm_area_struct * vma,
342 unsigned long address, pte_t pte)
343{
344 unsigned long flags;
345 unsigned int asid;
346 pgd_t *pgdp;
347 pmd_t *pmdp;
348 pte_t *ptep;
349 int idx;
350
351 ENTER_CRITICAL(flags);
352 address &= (PAGE_MASK << 1);
353 asid = read_c0_entryhi() & ASID_MASK;
354 write_c0_entryhi(address | asid);
355 pgdp = pgd_offset(vma->vm_mm, address);
356 mtc0_tlbw_hazard();
357 tlb_probe();
358 tlb_probe_hazard();
359 pmdp = pmd_offset(pgdp, address);
360 idx = read_c0_index();
361 ptep = pte_offset_map(pmdp, address);
362 write_c0_entrylo0(pte_val(*ptep++) >> 6);
363 write_c0_entrylo1(pte_val(*ptep) >> 6);
364 mtc0_tlbw_hazard();
365 if (idx < 0)
366 tlb_write_random();
367 else
368 tlb_write_indexed();
369 tlbw_use_hazard();
370 EXIT_CRITICAL(flags);
371}
372#endif
373
374void __init add_wired_entry(unsigned long entrylo0, unsigned long entrylo1, 340void __init add_wired_entry(unsigned long entrylo0, unsigned long entrylo1,
375 unsigned long entryhi, unsigned long pagemask) 341 unsigned long entryhi, unsigned long pagemask)
376{ 342{
@@ -447,34 +413,6 @@ out:
447 return ret; 413 return ret;
448} 414}
449 415
450static void __cpuinit probe_tlb(unsigned long config)
451{
452 struct cpuinfo_mips *c = &current_cpu_data;
453 unsigned int reg;
454
455 /*
456 * If this isn't a MIPS32 / MIPS64 compliant CPU. Config 1 register
457 * is not supported, we assume R4k style. Cpu probing already figured
458 * out the number of tlb entries.
459 */
460 if ((c->processor_id & 0xff0000) == PRID_COMP_LEGACY)
461 return;
462#ifdef CONFIG_MIPS_MT_SMTC
463 /*
464 * If TLB is shared in SMTC system, total size already
465 * has been calculated and written into cpu_data tlbsize
466 */
467 if((smtc_status & SMTC_TLB_SHARED) == SMTC_TLB_SHARED)
468 return;
469#endif /* CONFIG_MIPS_MT_SMTC */
470
471 reg = read_c0_config1();
472 if (!((config >> 7) & 3))
473 panic("No TLB present");
474
475 c->tlbsize = ((reg >> 25) & 0x3f) + 1;
476}
477
478static int __cpuinitdata ntlb; 416static int __cpuinitdata ntlb;
479static int __init set_ntlb(char *str) 417static int __init set_ntlb(char *str)
480{ 418{
@@ -486,8 +424,6 @@ __setup("ntlb=", set_ntlb);
486 424
487void __cpuinit tlb_init(void) 425void __cpuinit tlb_init(void)
488{ 426{
489 unsigned int config = read_c0_config();
490
491 /* 427 /*
492 * You should never change this register: 428 * You should never change this register:
493 * - On R4600 1.7 the tlbp never hits for pages smaller than 429 * - On R4600 1.7 the tlbp never hits for pages smaller than
@@ -495,13 +431,25 @@ void __cpuinit tlb_init(void)
495 * - The entire mm handling assumes the c0_pagemask register to 431 * - The entire mm handling assumes the c0_pagemask register to
496 * be set to fixed-size pages. 432 * be set to fixed-size pages.
497 */ 433 */
498 probe_tlb(config);
499 write_c0_pagemask(PM_DEFAULT_MASK); 434 write_c0_pagemask(PM_DEFAULT_MASK);
500 write_c0_wired(0); 435 write_c0_wired(0);
501 if (current_cpu_type() == CPU_R10000 || 436 if (current_cpu_type() == CPU_R10000 ||
502 current_cpu_type() == CPU_R12000 || 437 current_cpu_type() == CPU_R12000 ||
503 current_cpu_type() == CPU_R14000) 438 current_cpu_type() == CPU_R14000)
504 write_c0_framemask(0); 439 write_c0_framemask(0);
440
441 if (kernel_uses_smartmips_rixi) {
442 /*
443 * Enable the no read, no exec bits, and enable large virtual
444 * address.
445 */
446 u32 pg = PG_RIE | PG_XIE;
447#ifdef CONFIG_64BIT
448 pg |= PG_ELPA;
449#endif
450 write_c0_pagegrain(pg);
451 }
452
505 temp_tlb_entry = current_cpu_data.tlbsize - 1; 453 temp_tlb_entry = current_cpu_data.tlbsize - 1;
506 454
507 /* From this point on the ARC firmware is dead. */ 455 /* From this point on the ARC firmware is dead. */
diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c
index badcf5e8d695..0de0e4127d66 100644
--- a/arch/mips/mm/tlbex.c
+++ b/arch/mips/mm/tlbex.c
@@ -29,8 +29,7 @@
29 29
30#include <asm/mmu_context.h> 30#include <asm/mmu_context.h>
31#include <asm/war.h> 31#include <asm/war.h>
32 32#include <asm/uasm.h>
33#include "uasm.h"
34 33
35static inline int r45k_bvahwbug(void) 34static inline int r45k_bvahwbug(void)
36{ 35{
@@ -77,6 +76,8 @@ enum label_id {
77 label_vmalloc_done, 76 label_vmalloc_done,
78 label_tlbw_hazard, 77 label_tlbw_hazard,
79 label_split, 78 label_split,
79 label_tlbl_goaround1,
80 label_tlbl_goaround2,
80 label_nopage_tlbl, 81 label_nopage_tlbl,
81 label_nopage_tlbs, 82 label_nopage_tlbs,
82 label_nopage_tlbm, 83 label_nopage_tlbm,
@@ -93,6 +94,8 @@ UASM_L_LA(_vmalloc)
93UASM_L_LA(_vmalloc_done) 94UASM_L_LA(_vmalloc_done)
94UASM_L_LA(_tlbw_hazard) 95UASM_L_LA(_tlbw_hazard)
95UASM_L_LA(_split) 96UASM_L_LA(_split)
97UASM_L_LA(_tlbl_goaround1)
98UASM_L_LA(_tlbl_goaround2)
96UASM_L_LA(_nopage_tlbl) 99UASM_L_LA(_nopage_tlbl)
97UASM_L_LA(_nopage_tlbs) 100UASM_L_LA(_nopage_tlbs)
98UASM_L_LA(_nopage_tlbm) 101UASM_L_LA(_nopage_tlbm)
@@ -397,36 +400,60 @@ static void __cpuinit build_tlb_write_entry(u32 **p, struct uasm_label **l,
397 } 400 }
398} 401}
399 402
400#ifdef CONFIG_HUGETLB_PAGE 403static __cpuinit __maybe_unused void build_convert_pte_to_entrylo(u32 **p,
401static __cpuinit void build_huge_tlb_write_entry(u32 **p, 404 unsigned int reg)
402 struct uasm_label **l,
403 struct uasm_reloc **r,
404 unsigned int tmp,
405 enum tlb_write_entry wmode)
406{ 405{
407 /* Set huge page tlb entry size */ 406 if (kernel_uses_smartmips_rixi) {
408 uasm_i_lui(p, tmp, PM_HUGE_MASK >> 16); 407 UASM_i_SRL(p, reg, reg, ilog2(_PAGE_NO_EXEC));
409 uasm_i_ori(p, tmp, tmp, PM_HUGE_MASK & 0xffff); 408 UASM_i_ROTR(p, reg, reg, ilog2(_PAGE_GLOBAL) - ilog2(_PAGE_NO_EXEC));
410 uasm_i_mtc0(p, tmp, C0_PAGEMASK); 409 } else {
410#ifdef CONFIG_64BIT_PHYS_ADDR
411 uasm_i_dsrl(p, reg, reg, ilog2(_PAGE_GLOBAL));
412#else
413 UASM_i_SRL(p, reg, reg, ilog2(_PAGE_GLOBAL));
414#endif
415 }
416}
411 417
412 build_tlb_write_entry(p, l, r, wmode); 418#ifdef CONFIG_HUGETLB_PAGE
413 419
420static __cpuinit void build_restore_pagemask(u32 **p,
421 struct uasm_reloc **r,
422 unsigned int tmp,
423 enum label_id lid)
424{
414 /* Reset default page size */ 425 /* Reset default page size */
415 if (PM_DEFAULT_MASK >> 16) { 426 if (PM_DEFAULT_MASK >> 16) {
416 uasm_i_lui(p, tmp, PM_DEFAULT_MASK >> 16); 427 uasm_i_lui(p, tmp, PM_DEFAULT_MASK >> 16);
417 uasm_i_ori(p, tmp, tmp, PM_DEFAULT_MASK & 0xffff); 428 uasm_i_ori(p, tmp, tmp, PM_DEFAULT_MASK & 0xffff);
418 uasm_il_b(p, r, label_leave); 429 uasm_il_b(p, r, lid);
419 uasm_i_mtc0(p, tmp, C0_PAGEMASK); 430 uasm_i_mtc0(p, tmp, C0_PAGEMASK);
420 } else if (PM_DEFAULT_MASK) { 431 } else if (PM_DEFAULT_MASK) {
421 uasm_i_ori(p, tmp, 0, PM_DEFAULT_MASK); 432 uasm_i_ori(p, tmp, 0, PM_DEFAULT_MASK);
422 uasm_il_b(p, r, label_leave); 433 uasm_il_b(p, r, lid);
423 uasm_i_mtc0(p, tmp, C0_PAGEMASK); 434 uasm_i_mtc0(p, tmp, C0_PAGEMASK);
424 } else { 435 } else {
425 uasm_il_b(p, r, label_leave); 436 uasm_il_b(p, r, lid);
426 uasm_i_mtc0(p, 0, C0_PAGEMASK); 437 uasm_i_mtc0(p, 0, C0_PAGEMASK);
427 } 438 }
428} 439}
429 440
441static __cpuinit void build_huge_tlb_write_entry(u32 **p,
442 struct uasm_label **l,
443 struct uasm_reloc **r,
444 unsigned int tmp,
445 enum tlb_write_entry wmode)
446{
447 /* Set huge page tlb entry size */
448 uasm_i_lui(p, tmp, PM_HUGE_MASK >> 16);
449 uasm_i_ori(p, tmp, tmp, PM_HUGE_MASK & 0xffff);
450 uasm_i_mtc0(p, tmp, C0_PAGEMASK);
451
452 build_tlb_write_entry(p, l, r, wmode);
453
454 build_restore_pagemask(p, r, tmp, label_leave);
455}
456
430/* 457/*
431 * Check if Huge PTE is present, if so then jump to LABEL. 458 * Check if Huge PTE is present, if so then jump to LABEL.
432 */ 459 */
@@ -460,15 +487,15 @@ static __cpuinit void build_huge_update_entries(u32 **p,
460 if (!small_sequence) 487 if (!small_sequence)
461 uasm_i_lui(p, tmp, HPAGE_SIZE >> (7 + 16)); 488 uasm_i_lui(p, tmp, HPAGE_SIZE >> (7 + 16));
462 489
463 UASM_i_SRL(p, pte, pte, 6); /* convert to entrylo */ 490 build_convert_pte_to_entrylo(p, pte);
464 uasm_i_mtc0(p, pte, C0_ENTRYLO0); /* load it */ 491 UASM_i_MTC0(p, pte, C0_ENTRYLO0); /* load it */
465 /* convert to entrylo1 */ 492 /* convert to entrylo1 */
466 if (small_sequence) 493 if (small_sequence)
467 UASM_i_ADDIU(p, pte, pte, HPAGE_SIZE >> 7); 494 UASM_i_ADDIU(p, pte, pte, HPAGE_SIZE >> 7);
468 else 495 else
469 UASM_i_ADDU(p, pte, pte, tmp); 496 UASM_i_ADDU(p, pte, pte, tmp);
470 497
471 uasm_i_mtc0(p, pte, C0_ENTRYLO1); /* load it */ 498 UASM_i_MTC0(p, pte, C0_ENTRYLO1); /* load it */
472} 499}
473 500
474static __cpuinit void build_huge_handler_tail(u32 **p, 501static __cpuinit void build_huge_handler_tail(u32 **p,
@@ -549,11 +576,13 @@ build_get_pmde64(u32 **p, struct uasm_label **l, struct uasm_reloc **r,
549 576
550 uasm_i_andi(p, tmp, tmp, (PTRS_PER_PGD - 1)<<3); 577 uasm_i_andi(p, tmp, tmp, (PTRS_PER_PGD - 1)<<3);
551 uasm_i_daddu(p, ptr, ptr, tmp); /* add in pgd offset */ 578 uasm_i_daddu(p, ptr, ptr, tmp); /* add in pgd offset */
579#ifndef __PAGETABLE_PMD_FOLDED
552 uasm_i_dmfc0(p, tmp, C0_BADVADDR); /* get faulting address */ 580 uasm_i_dmfc0(p, tmp, C0_BADVADDR); /* get faulting address */
553 uasm_i_ld(p, ptr, 0, ptr); /* get pmd pointer */ 581 uasm_i_ld(p, ptr, 0, ptr); /* get pmd pointer */
554 uasm_i_dsrl(p, tmp, tmp, PMD_SHIFT-3); /* get pmd offset in bytes */ 582 uasm_i_dsrl(p, tmp, tmp, PMD_SHIFT-3); /* get pmd offset in bytes */
555 uasm_i_andi(p, tmp, tmp, (PTRS_PER_PMD - 1)<<3); 583 uasm_i_andi(p, tmp, tmp, (PTRS_PER_PMD - 1)<<3);
556 uasm_i_daddu(p, ptr, ptr, tmp); /* add in pmd offset */ 584 uasm_i_daddu(p, ptr, ptr, tmp); /* add in pmd offset */
585#endif
557} 586}
558 587
559/* 588/*
@@ -684,35 +713,53 @@ static void __cpuinit build_update_entries(u32 **p, unsigned int tmp,
684 if (cpu_has_64bits) { 713 if (cpu_has_64bits) {
685 uasm_i_ld(p, tmp, 0, ptep); /* get even pte */ 714 uasm_i_ld(p, tmp, 0, ptep); /* get even pte */
686 uasm_i_ld(p, ptep, sizeof(pte_t), ptep); /* get odd pte */ 715 uasm_i_ld(p, ptep, sizeof(pte_t), ptep); /* get odd pte */
687 uasm_i_dsrl(p, tmp, tmp, 6); /* convert to entrylo0 */ 716 if (kernel_uses_smartmips_rixi) {
688 uasm_i_mtc0(p, tmp, C0_ENTRYLO0); /* load it */ 717 UASM_i_SRL(p, tmp, tmp, ilog2(_PAGE_NO_EXEC));
689 uasm_i_dsrl(p, ptep, ptep, 6); /* convert to entrylo1 */ 718 UASM_i_SRL(p, ptep, ptep, ilog2(_PAGE_NO_EXEC));
690 uasm_i_mtc0(p, ptep, C0_ENTRYLO1); /* load it */ 719 UASM_i_ROTR(p, tmp, tmp, ilog2(_PAGE_GLOBAL) - ilog2(_PAGE_NO_EXEC));
720 UASM_i_MTC0(p, tmp, C0_ENTRYLO0); /* load it */
721 UASM_i_ROTR(p, ptep, ptep, ilog2(_PAGE_GLOBAL) - ilog2(_PAGE_NO_EXEC));
722 } else {
723 uasm_i_dsrl(p, tmp, tmp, ilog2(_PAGE_GLOBAL)); /* convert to entrylo0 */
724 UASM_i_MTC0(p, tmp, C0_ENTRYLO0); /* load it */
725 uasm_i_dsrl(p, ptep, ptep, ilog2(_PAGE_GLOBAL)); /* convert to entrylo1 */
726 }
727 UASM_i_MTC0(p, ptep, C0_ENTRYLO1); /* load it */
691 } else { 728 } else {
692 int pte_off_even = sizeof(pte_t) / 2; 729 int pte_off_even = sizeof(pte_t) / 2;
693 int pte_off_odd = pte_off_even + sizeof(pte_t); 730 int pte_off_odd = pte_off_even + sizeof(pte_t);
694 731
695 /* The pte entries are pre-shifted */ 732 /* The pte entries are pre-shifted */
696 uasm_i_lw(p, tmp, pte_off_even, ptep); /* get even pte */ 733 uasm_i_lw(p, tmp, pte_off_even, ptep); /* get even pte */
697 uasm_i_mtc0(p, tmp, C0_ENTRYLO0); /* load it */ 734 UASM_i_MTC0(p, tmp, C0_ENTRYLO0); /* load it */
698 uasm_i_lw(p, ptep, pte_off_odd, ptep); /* get odd pte */ 735 uasm_i_lw(p, ptep, pte_off_odd, ptep); /* get odd pte */
699 uasm_i_mtc0(p, ptep, C0_ENTRYLO1); /* load it */ 736 UASM_i_MTC0(p, ptep, C0_ENTRYLO1); /* load it */
700 } 737 }
701#else 738#else
702 UASM_i_LW(p, tmp, 0, ptep); /* get even pte */ 739 UASM_i_LW(p, tmp, 0, ptep); /* get even pte */
703 UASM_i_LW(p, ptep, sizeof(pte_t), ptep); /* get odd pte */ 740 UASM_i_LW(p, ptep, sizeof(pte_t), ptep); /* get odd pte */
704 if (r45k_bvahwbug()) 741 if (r45k_bvahwbug())
705 build_tlb_probe_entry(p); 742 build_tlb_probe_entry(p);
706 UASM_i_SRL(p, tmp, tmp, 6); /* convert to entrylo0 */ 743 if (kernel_uses_smartmips_rixi) {
707 if (r4k_250MHZhwbug()) 744 UASM_i_SRL(p, tmp, tmp, ilog2(_PAGE_NO_EXEC));
708 uasm_i_mtc0(p, 0, C0_ENTRYLO0); 745 UASM_i_SRL(p, ptep, ptep, ilog2(_PAGE_NO_EXEC));
709 uasm_i_mtc0(p, tmp, C0_ENTRYLO0); /* load it */ 746 UASM_i_ROTR(p, tmp, tmp, ilog2(_PAGE_GLOBAL) - ilog2(_PAGE_NO_EXEC));
710 UASM_i_SRL(p, ptep, ptep, 6); /* convert to entrylo1 */ 747 if (r4k_250MHZhwbug())
711 if (r45k_bvahwbug()) 748 UASM_i_MTC0(p, 0, C0_ENTRYLO0);
712 uasm_i_mfc0(p, tmp, C0_INDEX); 749 UASM_i_MTC0(p, tmp, C0_ENTRYLO0); /* load it */
750 UASM_i_ROTR(p, ptep, ptep, ilog2(_PAGE_GLOBAL) - ilog2(_PAGE_NO_EXEC));
751 } else {
752 UASM_i_SRL(p, tmp, tmp, ilog2(_PAGE_GLOBAL)); /* convert to entrylo0 */
753 if (r4k_250MHZhwbug())
754 UASM_i_MTC0(p, 0, C0_ENTRYLO0);
755 UASM_i_MTC0(p, tmp, C0_ENTRYLO0); /* load it */
756 UASM_i_SRL(p, ptep, ptep, ilog2(_PAGE_GLOBAL)); /* convert to entrylo1 */
757 if (r45k_bvahwbug())
758 uasm_i_mfc0(p, tmp, C0_INDEX);
759 }
713 if (r4k_250MHZhwbug()) 760 if (r4k_250MHZhwbug())
714 uasm_i_mtc0(p, 0, C0_ENTRYLO1); 761 UASM_i_MTC0(p, 0, C0_ENTRYLO1);
715 uasm_i_mtc0(p, ptep, C0_ENTRYLO1); /* load it */ 762 UASM_i_MTC0(p, ptep, C0_ENTRYLO1); /* load it */
716#endif 763#endif
717} 764}
718 765
@@ -985,9 +1032,14 @@ static void __cpuinit
985build_pte_present(u32 **p, struct uasm_reloc **r, 1032build_pte_present(u32 **p, struct uasm_reloc **r,
986 unsigned int pte, unsigned int ptr, enum label_id lid) 1033 unsigned int pte, unsigned int ptr, enum label_id lid)
987{ 1034{
988 uasm_i_andi(p, pte, pte, _PAGE_PRESENT | _PAGE_READ); 1035 if (kernel_uses_smartmips_rixi) {
989 uasm_i_xori(p, pte, pte, _PAGE_PRESENT | _PAGE_READ); 1036 uasm_i_andi(p, pte, pte, _PAGE_PRESENT);
990 uasm_il_bnez(p, r, pte, lid); 1037 uasm_il_beqz(p, r, pte, lid);
1038 } else {
1039 uasm_i_andi(p, pte, pte, _PAGE_PRESENT | _PAGE_READ);
1040 uasm_i_xori(p, pte, pte, _PAGE_PRESENT | _PAGE_READ);
1041 uasm_il_bnez(p, r, pte, lid);
1042 }
991 iPTE_LW(p, pte, ptr); 1043 iPTE_LW(p, pte, ptr);
992} 1044}
993 1045
@@ -1272,6 +1324,34 @@ static void __cpuinit build_r4000_tlb_load_handler(void)
1272 build_pte_present(&p, &r, K0, K1, label_nopage_tlbl); 1324 build_pte_present(&p, &r, K0, K1, label_nopage_tlbl);
1273 if (m4kc_tlbp_war()) 1325 if (m4kc_tlbp_war())
1274 build_tlb_probe_entry(&p); 1326 build_tlb_probe_entry(&p);
1327
1328 if (kernel_uses_smartmips_rixi) {
1329 /*
1330 * If the page is not _PAGE_VALID, RI or XI could not
1331 * have triggered it. Skip the expensive test..
1332 */
1333 uasm_i_andi(&p, K0, K0, _PAGE_VALID);
1334 uasm_il_beqz(&p, &r, K0, label_tlbl_goaround1);
1335 uasm_i_nop(&p);
1336
1337 uasm_i_tlbr(&p);
1338 /* Examine entrylo 0 or 1 based on ptr. */
1339 uasm_i_andi(&p, K0, K1, sizeof(pte_t));
1340 uasm_i_beqz(&p, K0, 8);
1341
1342 UASM_i_MFC0(&p, K0, C0_ENTRYLO0); /* load it in the delay slot*/
1343 UASM_i_MFC0(&p, K0, C0_ENTRYLO1); /* load it if ptr is odd */
1344 /*
1345 * If the entryLo (now in K0) is valid (bit 1), RI or
1346 * XI must have triggered it.
1347 */
1348 uasm_i_andi(&p, K0, K0, 2);
1349 uasm_il_bnez(&p, &r, K0, label_nopage_tlbl);
1350
1351 uasm_l_tlbl_goaround1(&l, p);
1352 /* Reload the PTE value */
1353 iPTE_LW(&p, K0, K1);
1354 }
1275 build_make_valid(&p, &r, K0, K1); 1355 build_make_valid(&p, &r, K0, K1);
1276 build_r4000_tlbchange_handler_tail(&p, &l, &r, K0, K1); 1356 build_r4000_tlbchange_handler_tail(&p, &l, &r, K0, K1);
1277 1357
@@ -1284,6 +1364,40 @@ static void __cpuinit build_r4000_tlb_load_handler(void)
1284 iPTE_LW(&p, K0, K1); 1364 iPTE_LW(&p, K0, K1);
1285 build_pte_present(&p, &r, K0, K1, label_nopage_tlbl); 1365 build_pte_present(&p, &r, K0, K1, label_nopage_tlbl);
1286 build_tlb_probe_entry(&p); 1366 build_tlb_probe_entry(&p);
1367
1368 if (kernel_uses_smartmips_rixi) {
1369 /*
1370 * If the page is not _PAGE_VALID, RI or XI could not
1371 * have triggered it. Skip the expensive test..
1372 */
1373 uasm_i_andi(&p, K0, K0, _PAGE_VALID);
1374 uasm_il_beqz(&p, &r, K0, label_tlbl_goaround2);
1375 uasm_i_nop(&p);
1376
1377 uasm_i_tlbr(&p);
1378 /* Examine entrylo 0 or 1 based on ptr. */
1379 uasm_i_andi(&p, K0, K1, sizeof(pte_t));
1380 uasm_i_beqz(&p, K0, 8);
1381
1382 UASM_i_MFC0(&p, K0, C0_ENTRYLO0); /* load it in the delay slot*/
1383 UASM_i_MFC0(&p, K0, C0_ENTRYLO1); /* load it if ptr is odd */
1384 /*
1385 * If the entryLo (now in K0) is valid (bit 1), RI or
1386 * XI must have triggered it.
1387 */
1388 uasm_i_andi(&p, K0, K0, 2);
1389 uasm_il_beqz(&p, &r, K0, label_tlbl_goaround2);
1390 /* Reload the PTE value */
1391 iPTE_LW(&p, K0, K1);
1392
1393 /*
1394 * We clobbered C0_PAGEMASK, restore it. On the other branch
1395 * it is restored in build_huge_tlb_write_entry.
1396 */
1397 build_restore_pagemask(&p, &r, K0, label_nopage_tlbl);
1398
1399 uasm_l_tlbl_goaround2(&l, p);
1400 }
1287 uasm_i_ori(&p, K0, K0, (_PAGE_ACCESSED | _PAGE_VALID)); 1401 uasm_i_ori(&p, K0, K0, (_PAGE_ACCESSED | _PAGE_VALID));
1288 build_huge_handler_tail(&p, &r, &l, K0, K1); 1402 build_huge_handler_tail(&p, &r, &l, K0, K1);
1289#endif 1403#endif
diff --git a/arch/mips/mm/uasm.c b/arch/mips/mm/uasm.c
index 0a165c5179a1..1581e9852461 100644
--- a/arch/mips/mm/uasm.c
+++ b/arch/mips/mm/uasm.c
@@ -19,8 +19,7 @@
19#include <asm/inst.h> 19#include <asm/inst.h>
20#include <asm/elf.h> 20#include <asm/elf.h>
21#include <asm/bugs.h> 21#include <asm/bugs.h>
22 22#include <asm/uasm.h>
23#include "uasm.h"
24 23
25enum fields { 24enum fields {
26 RS = 0x001, 25 RS = 0x001,
@@ -63,8 +62,9 @@ enum opcode {
63 insn_dsrl32, insn_drotr, insn_dsubu, insn_eret, insn_j, insn_jal, 62 insn_dsrl32, insn_drotr, insn_dsubu, insn_eret, insn_j, insn_jal,
64 insn_jr, insn_ld, insn_ll, insn_lld, insn_lui, insn_lw, insn_mfc0, 63 insn_jr, insn_ld, insn_ll, insn_lld, insn_lui, insn_lw, insn_mfc0,
65 insn_mtc0, insn_ori, insn_pref, insn_rfe, insn_sc, insn_scd, 64 insn_mtc0, insn_ori, insn_pref, insn_rfe, insn_sc, insn_scd,
66 insn_sd, insn_sll, insn_sra, insn_srl, insn_subu, insn_sw, 65 insn_sd, insn_sll, insn_sra, insn_srl, insn_rotr, insn_subu, insn_sw,
67 insn_tlbp, insn_tlbwi, insn_tlbwr, insn_xor, insn_xori, insn_dins 66 insn_tlbp, insn_tlbr, insn_tlbwi, insn_tlbwr, insn_xor, insn_xori,
67 insn_dins
68}; 68};
69 69
70struct insn { 70struct insn {
@@ -126,9 +126,11 @@ static struct insn insn_table[] __cpuinitdata = {
126 { insn_sll, M(spec_op, 0, 0, 0, 0, sll_op), RT | RD | RE }, 126 { insn_sll, M(spec_op, 0, 0, 0, 0, sll_op), RT | RD | RE },
127 { insn_sra, M(spec_op, 0, 0, 0, 0, sra_op), RT | RD | RE }, 127 { insn_sra, M(spec_op, 0, 0, 0, 0, sra_op), RT | RD | RE },
128 { insn_srl, M(spec_op, 0, 0, 0, 0, srl_op), RT | RD | RE }, 128 { insn_srl, M(spec_op, 0, 0, 0, 0, srl_op), RT | RD | RE },
129 { insn_rotr, M(spec_op, 1, 0, 0, 0, srl_op), RT | RD | RE },
129 { insn_subu, M(spec_op, 0, 0, 0, 0, subu_op), RS | RT | RD }, 130 { insn_subu, M(spec_op, 0, 0, 0, 0, subu_op), RS | RT | RD },
130 { insn_sw, M(sw_op, 0, 0, 0, 0, 0), RS | RT | SIMM }, 131 { insn_sw, M(sw_op, 0, 0, 0, 0, 0), RS | RT | SIMM },
131 { insn_tlbp, M(cop0_op, cop_op, 0, 0, 0, tlbp_op), 0 }, 132 { insn_tlbp, M(cop0_op, cop_op, 0, 0, 0, tlbp_op), 0 },
133 { insn_tlbr, M(cop0_op, cop_op, 0, 0, 0, tlbr_op), 0 },
132 { insn_tlbwi, M(cop0_op, cop_op, 0, 0, 0, tlbwi_op), 0 }, 134 { insn_tlbwi, M(cop0_op, cop_op, 0, 0, 0, tlbwi_op), 0 },
133 { insn_tlbwr, M(cop0_op, cop_op, 0, 0, 0, tlbwr_op), 0 }, 135 { insn_tlbwr, M(cop0_op, cop_op, 0, 0, 0, tlbwr_op), 0 },
134 { insn_xor, M(spec_op, 0, 0, 0, 0, xor_op), RS | RT | RD }, 136 { insn_xor, M(spec_op, 0, 0, 0, 0, xor_op), RS | RT | RD },
@@ -379,9 +381,11 @@ I_u2s3u1(_sd)
379I_u2u1u3(_sll) 381I_u2u1u3(_sll)
380I_u2u1u3(_sra) 382I_u2u1u3(_sra)
381I_u2u1u3(_srl) 383I_u2u1u3(_srl)
384I_u2u1u3(_rotr)
382I_u3u1u2(_subu) 385I_u3u1u2(_subu)
383I_u2s3u1(_sw) 386I_u2s3u1(_sw)
384I_0(_tlbp) 387I_0(_tlbp)
388I_0(_tlbr)
385I_0(_tlbwi) 389I_0(_tlbwi)
386I_0(_tlbwr) 390I_0(_tlbwr)
387I_u3u1u2(_xor) 391I_u3u1u2(_xor)
diff --git a/arch/mips/mti-malta/malta-int.c b/arch/mips/mti-malta/malta-int.c
index 4c3fca18a171..2cb5ae790203 100644
--- a/arch/mips/mti-malta/malta-int.c
+++ b/arch/mips/mti-malta/malta-int.c
@@ -52,7 +52,7 @@ static unsigned long _msc01_biu_base;
52static unsigned long _gcmp_base; 52static unsigned long _gcmp_base;
53static unsigned int ipi_map[NR_CPUS]; 53static unsigned int ipi_map[NR_CPUS];
54 54
55static DEFINE_SPINLOCK(mips_irq_lock); 55static DEFINE_RAW_SPINLOCK(mips_irq_lock);
56 56
57static inline int mips_pcibios_iack(void) 57static inline int mips_pcibios_iack(void)
58{ 58{
@@ -103,7 +103,7 @@ static inline int get_int(void)
103{ 103{
104 unsigned long flags; 104 unsigned long flags;
105 int irq; 105 int irq;
106 spin_lock_irqsave(&mips_irq_lock, flags); 106 raw_spin_lock_irqsave(&mips_irq_lock, flags);
107 107
108 irq = mips_pcibios_iack(); 108 irq = mips_pcibios_iack();
109 109
@@ -113,7 +113,7 @@ static inline int get_int(void)
113 * on an SMP system, so leave it up to the generic code... 113 * on an SMP system, so leave it up to the generic code...
114 */ 114 */
115 115
116 spin_unlock_irqrestore(&mips_irq_lock, flags); 116 raw_spin_unlock_irqrestore(&mips_irq_lock, flags);
117 117
118 return irq; 118 return irq;
119} 119}
diff --git a/arch/mips/nxp/pnx833x/common/interrupts.c b/arch/mips/nxp/pnx833x/common/interrupts.c
index 3a467c04f811..941916f8aaff 100644
--- a/arch/mips/nxp/pnx833x/common/interrupts.c
+++ b/arch/mips/nxp/pnx833x/common/interrupts.c
@@ -156,19 +156,19 @@ static int irqflags[PNX833X_PIC_NUM_IRQ]; /* initialized by zeroes */
156#define IRQFLAG_STARTED 1 156#define IRQFLAG_STARTED 1
157#define IRQFLAG_DISABLED 2 157#define IRQFLAG_DISABLED 2
158 158
159static DEFINE_SPINLOCK(pnx833x_irq_lock); 159static DEFINE_RAW_SPINLOCK(pnx833x_irq_lock);
160 160
161static unsigned int pnx833x_startup_pic_irq(unsigned int irq) 161static unsigned int pnx833x_startup_pic_irq(unsigned int irq)
162{ 162{
163 unsigned long flags; 163 unsigned long flags;
164 unsigned int pic_irq = irq - PNX833X_PIC_IRQ_BASE; 164 unsigned int pic_irq = irq - PNX833X_PIC_IRQ_BASE;
165 165
166 spin_lock_irqsave(&pnx833x_irq_lock, flags); 166 raw_spin_lock_irqsave(&pnx833x_irq_lock, flags);
167 167
168 irqflags[pic_irq] = IRQFLAG_STARTED; /* started, not disabled */ 168 irqflags[pic_irq] = IRQFLAG_STARTED; /* started, not disabled */
169 pnx833x_hard_enable_pic_irq(pic_irq); 169 pnx833x_hard_enable_pic_irq(pic_irq);
170 170
171 spin_unlock_irqrestore(&pnx833x_irq_lock, flags); 171 raw_spin_unlock_irqrestore(&pnx833x_irq_lock, flags);
172 return 0; 172 return 0;
173} 173}
174 174
@@ -177,12 +177,12 @@ static void pnx833x_shutdown_pic_irq(unsigned int irq)
177 unsigned long flags; 177 unsigned long flags;
178 unsigned int pic_irq = irq - PNX833X_PIC_IRQ_BASE; 178 unsigned int pic_irq = irq - PNX833X_PIC_IRQ_BASE;
179 179
180 spin_lock_irqsave(&pnx833x_irq_lock, flags); 180 raw_spin_lock_irqsave(&pnx833x_irq_lock, flags);
181 181
182 irqflags[pic_irq] = 0; /* not started */ 182 irqflags[pic_irq] = 0; /* not started */
183 pnx833x_hard_disable_pic_irq(pic_irq); 183 pnx833x_hard_disable_pic_irq(pic_irq);
184 184
185 spin_unlock_irqrestore(&pnx833x_irq_lock, flags); 185 raw_spin_unlock_irqrestore(&pnx833x_irq_lock, flags);
186} 186}
187 187
188static void pnx833x_enable_pic_irq(unsigned int irq) 188static void pnx833x_enable_pic_irq(unsigned int irq)
@@ -190,13 +190,13 @@ static void pnx833x_enable_pic_irq(unsigned int irq)
190 unsigned long flags; 190 unsigned long flags;
191 unsigned int pic_irq = irq - PNX833X_PIC_IRQ_BASE; 191 unsigned int pic_irq = irq - PNX833X_PIC_IRQ_BASE;
192 192
193 spin_lock_irqsave(&pnx833x_irq_lock, flags); 193 raw_spin_lock_irqsave(&pnx833x_irq_lock, flags);
194 194
195 irqflags[pic_irq] &= ~IRQFLAG_DISABLED; 195 irqflags[pic_irq] &= ~IRQFLAG_DISABLED;
196 if (irqflags[pic_irq] == IRQFLAG_STARTED) 196 if (irqflags[pic_irq] == IRQFLAG_STARTED)
197 pnx833x_hard_enable_pic_irq(pic_irq); 197 pnx833x_hard_enable_pic_irq(pic_irq);
198 198
199 spin_unlock_irqrestore(&pnx833x_irq_lock, flags); 199 raw_spin_unlock_irqrestore(&pnx833x_irq_lock, flags);
200} 200}
201 201
202static void pnx833x_disable_pic_irq(unsigned int irq) 202static void pnx833x_disable_pic_irq(unsigned int irq)
@@ -204,12 +204,12 @@ static void pnx833x_disable_pic_irq(unsigned int irq)
204 unsigned long flags; 204 unsigned long flags;
205 unsigned int pic_irq = irq - PNX833X_PIC_IRQ_BASE; 205 unsigned int pic_irq = irq - PNX833X_PIC_IRQ_BASE;
206 206
207 spin_lock_irqsave(&pnx833x_irq_lock, flags); 207 raw_spin_lock_irqsave(&pnx833x_irq_lock, flags);
208 208
209 irqflags[pic_irq] |= IRQFLAG_DISABLED; 209 irqflags[pic_irq] |= IRQFLAG_DISABLED;
210 pnx833x_hard_disable_pic_irq(pic_irq); 210 pnx833x_hard_disable_pic_irq(pic_irq);
211 211
212 spin_unlock_irqrestore(&pnx833x_irq_lock, flags); 212 raw_spin_unlock_irqrestore(&pnx833x_irq_lock, flags);
213} 213}
214 214
215static void pnx833x_ack_pic_irq(unsigned int irq) 215static void pnx833x_ack_pic_irq(unsigned int irq)
@@ -220,15 +220,15 @@ static void pnx833x_end_pic_irq(unsigned int irq)
220{ 220{
221} 221}
222 222
223static DEFINE_SPINLOCK(pnx833x_gpio_pnx833x_irq_lock); 223static DEFINE_RAW_SPINLOCK(pnx833x_gpio_pnx833x_irq_lock);
224 224
225static unsigned int pnx833x_startup_gpio_irq(unsigned int irq) 225static unsigned int pnx833x_startup_gpio_irq(unsigned int irq)
226{ 226{
227 int pin = irq - PNX833X_GPIO_IRQ_BASE; 227 int pin = irq - PNX833X_GPIO_IRQ_BASE;
228 unsigned long flags; 228 unsigned long flags;
229 spin_lock_irqsave(&pnx833x_gpio_pnx833x_irq_lock, flags); 229 raw_spin_lock_irqsave(&pnx833x_gpio_pnx833x_irq_lock, flags);
230 pnx833x_gpio_enable_irq(pin); 230 pnx833x_gpio_enable_irq(pin);
231 spin_unlock_irqrestore(&pnx833x_gpio_pnx833x_irq_lock, flags); 231 raw_spin_unlock_irqrestore(&pnx833x_gpio_pnx833x_irq_lock, flags);
232 return 0; 232 return 0;
233} 233}
234 234
@@ -236,18 +236,18 @@ static void pnx833x_enable_gpio_irq(unsigned int irq)
236{ 236{
237 int pin = irq - PNX833X_GPIO_IRQ_BASE; 237 int pin = irq - PNX833X_GPIO_IRQ_BASE;
238 unsigned long flags; 238 unsigned long flags;
239 spin_lock_irqsave(&pnx833x_gpio_pnx833x_irq_lock, flags); 239 raw_spin_lock_irqsave(&pnx833x_gpio_pnx833x_irq_lock, flags);
240 pnx833x_gpio_enable_irq(pin); 240 pnx833x_gpio_enable_irq(pin);
241 spin_unlock_irqrestore(&pnx833x_gpio_pnx833x_irq_lock, flags); 241 raw_spin_unlock_irqrestore(&pnx833x_gpio_pnx833x_irq_lock, flags);
242} 242}
243 243
244static void pnx833x_disable_gpio_irq(unsigned int irq) 244static void pnx833x_disable_gpio_irq(unsigned int irq)
245{ 245{
246 int pin = irq - PNX833X_GPIO_IRQ_BASE; 246 int pin = irq - PNX833X_GPIO_IRQ_BASE;
247 unsigned long flags; 247 unsigned long flags;
248 spin_lock_irqsave(&pnx833x_gpio_pnx833x_irq_lock, flags); 248 raw_spin_lock_irqsave(&pnx833x_gpio_pnx833x_irq_lock, flags);
249 pnx833x_gpio_disable_irq(pin); 249 pnx833x_gpio_disable_irq(pin);
250 spin_unlock_irqrestore(&pnx833x_gpio_pnx833x_irq_lock, flags); 250 raw_spin_unlock_irqrestore(&pnx833x_gpio_pnx833x_irq_lock, flags);
251} 251}
252 252
253static void pnx833x_ack_gpio_irq(unsigned int irq) 253static void pnx833x_ack_gpio_irq(unsigned int irq)
@@ -258,9 +258,9 @@ static void pnx833x_end_gpio_irq(unsigned int irq)
258{ 258{
259 int pin = irq - PNX833X_GPIO_IRQ_BASE; 259 int pin = irq - PNX833X_GPIO_IRQ_BASE;
260 unsigned long flags; 260 unsigned long flags;
261 spin_lock_irqsave(&pnx833x_gpio_pnx833x_irq_lock, flags); 261 raw_spin_lock_irqsave(&pnx833x_gpio_pnx833x_irq_lock, flags);
262 pnx833x_gpio_clear_irq(pin); 262 pnx833x_gpio_clear_irq(pin);
263 spin_unlock_irqrestore(&pnx833x_gpio_pnx833x_irq_lock, flags); 263 raw_spin_unlock_irqrestore(&pnx833x_gpio_pnx833x_irq_lock, flags);
264} 264}
265 265
266static int pnx833x_set_type_gpio_irq(unsigned int irq, unsigned int flow_type) 266static int pnx833x_set_type_gpio_irq(unsigned int irq, unsigned int flow_type)
@@ -377,4 +377,3 @@ void __init plat_time_init(void)
377 377
378 mips_hpt_frequency *= 500000; 378 mips_hpt_frequency *= 500000;
379} 379}
380
diff --git a/arch/mips/nxp/pnx833x/common/prom.c b/arch/mips/nxp/pnx833x/common/prom.c
index 2a41e8fec210..29969f90a6b0 100644
--- a/arch/mips/nxp/pnx833x/common/prom.c
+++ b/arch/mips/nxp/pnx833x/common/prom.c
@@ -62,9 +62,3 @@ char __init *prom_getenv(char *envname)
62void __init prom_free_prom_memory(void) 62void __init prom_free_prom_memory(void)
63{ 63{
64} 64}
65
66char * __init prom_getcmdline(void)
67{
68 return arcs_cmdline;
69}
70
diff --git a/arch/mips/nxp/pnx8550/common/prom.c b/arch/mips/nxp/pnx8550/common/prom.c
index 2f567452e7ac..32f70097c3c7 100644
--- a/arch/mips/nxp/pnx8550/common/prom.c
+++ b/arch/mips/nxp/pnx8550/common/prom.c
@@ -124,6 +124,5 @@ void prom_putchar(char c)
124 } 124 }
125} 125}
126 126
127EXPORT_SYMBOL(prom_getcmdline);
128EXPORT_SYMBOL(get_ethernet_addr); 127EXPORT_SYMBOL(get_ethernet_addr);
129EXPORT_SYMBOL(str2eaddr); 128EXPORT_SYMBOL(str2eaddr);
diff --git a/arch/mips/oprofile/common.c b/arch/mips/oprofile/common.c
index 7832ad257a14..f9eb1aba6345 100644
--- a/arch/mips/oprofile/common.c
+++ b/arch/mips/oprofile/common.c
@@ -6,6 +6,7 @@
6 * Copyright (C) 2004, 2005 Ralf Baechle 6 * Copyright (C) 2004, 2005 Ralf Baechle
7 * Copyright (C) 2005 MIPS Technologies, Inc. 7 * Copyright (C) 2005 MIPS Technologies, Inc.
8 */ 8 */
9#include <linux/compiler.h>
9#include <linux/errno.h> 10#include <linux/errno.h>
10#include <linux/init.h> 11#include <linux/init.h>
11#include <linux/oprofile.h> 12#include <linux/oprofile.h>
@@ -14,9 +15,9 @@
14 15
15#include "op_impl.h" 16#include "op_impl.h"
16 17
17extern struct op_mips_model op_model_mipsxx_ops __attribute__((weak)); 18extern struct op_mips_model op_model_mipsxx_ops __weak;
18extern struct op_mips_model op_model_rm9000_ops __attribute__((weak)); 19extern struct op_mips_model op_model_rm9000_ops __weak;
19extern struct op_mips_model op_model_loongson2_ops __attribute__((weak)); 20extern struct op_mips_model op_model_loongson2_ops __weak;
20 21
21static struct op_mips_model *model; 22static struct op_mips_model *model;
22 23
diff --git a/arch/mips/oprofile/op_model_loongson2.c b/arch/mips/oprofile/op_model_loongson2.c
index 475ff46712ab..29e2326b6257 100644
--- a/arch/mips/oprofile/op_model_loongson2.c
+++ b/arch/mips/oprofile/op_model_loongson2.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Copyright (C) 2009 Lemote Inc. 4 * Copyright (C) 2009 Lemote Inc.
5 * Author: Yanhua <yanh@lemote.com> 5 * Author: Yanhua <yanh@lemote.com>
6 * Author: Wu Zhangjin <wuzj@lemote.com> 6 * Author: Wu Zhangjin <wuzhangjin@gmail.com>
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
@@ -47,8 +47,6 @@ static struct loongson2_register_config {
47 int cnt1_enabled, cnt2_enabled; 47 int cnt1_enabled, cnt2_enabled;
48} reg; 48} reg;
49 49
50DEFINE_SPINLOCK(sample_lock);
51
52static char *oprofid = "LoongsonPerf"; 50static char *oprofid = "LoongsonPerf";
53static irqreturn_t loongson2_perfcount_handler(int irq, void *dev_id); 51static irqreturn_t loongson2_perfcount_handler(int irq, void *dev_id);
54/* Compute all of the registers in preparation for enabling profiling. */ 52/* Compute all of the registers in preparation for enabling profiling. */
@@ -115,7 +113,6 @@ static irqreturn_t loongson2_perfcount_handler(int irq, void *dev_id)
115 uint64_t counter, counter1, counter2; 113 uint64_t counter, counter1, counter2;
116 struct pt_regs *regs = get_irq_regs(); 114 struct pt_regs *regs = get_irq_regs();
117 int enabled; 115 int enabled;
118 unsigned long flags;
119 116
120 /* 117 /*
121 * LOONGSON2 defines two 32-bit performance counters. 118 * LOONGSON2 defines two 32-bit performance counters.
@@ -136,8 +133,6 @@ static irqreturn_t loongson2_perfcount_handler(int irq, void *dev_id)
136 counter1 = counter & 0xffffffff; 133 counter1 = counter & 0xffffffff;
137 counter2 = counter >> 32; 134 counter2 = counter >> 32;
138 135
139 spin_lock_irqsave(&sample_lock, flags);
140
141 if (counter1 & LOONGSON2_PERFCNT_OVERFLOW) { 136 if (counter1 & LOONGSON2_PERFCNT_OVERFLOW) {
142 if (reg.cnt1_enabled) 137 if (reg.cnt1_enabled)
143 oprofile_add_sample(regs, 0); 138 oprofile_add_sample(regs, 0);
@@ -149,8 +144,6 @@ static irqreturn_t loongson2_perfcount_handler(int irq, void *dev_id)
149 counter2 = reg.reset_counter2; 144 counter2 = reg.reset_counter2;
150 } 145 }
151 146
152 spin_unlock_irqrestore(&sample_lock, flags);
153
154 write_c0_perfcnt((counter2 << 32) | counter1); 147 write_c0_perfcnt((counter2 << 32) | counter1);
155 148
156 return IRQ_HANDLED; 149 return IRQ_HANDLED;
diff --git a/arch/mips/pci/fixup-cobalt.c b/arch/mips/pci/fixup-cobalt.c
index 9553b14002dd..acacd1407c63 100644
--- a/arch/mips/pci/fixup-cobalt.c
+++ b/arch/mips/pci/fixup-cobalt.c
@@ -51,6 +51,67 @@ static void qube_raq_galileo_early_fixup(struct pci_dev *dev)
51DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_MARVELL, PCI_DEVICE_ID_MARVELL_GT64111, 51DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_MARVELL, PCI_DEVICE_ID_MARVELL_GT64111,
52 qube_raq_galileo_early_fixup); 52 qube_raq_galileo_early_fixup);
53 53
54static void __devinit cobalt_legacy_ide_resource_fixup(struct pci_dev *dev,
55 struct resource *res)
56{
57 struct pci_controller *hose = (struct pci_controller *)dev->sysdata;
58 unsigned long offset = hose->io_offset;
59 struct resource orig = *res;
60
61 if (!(res->flags & IORESOURCE_IO) ||
62 !(res->flags & IORESOURCE_PCI_FIXED))
63 return;
64
65 res->start -= offset;
66 res->end -= offset;
67 dev_printk(KERN_DEBUG, &dev->dev, "converted legacy %pR to bus %pR\n",
68 &orig, res);
69}
70
71static void __devinit cobalt_legacy_ide_fixup(struct pci_dev *dev)
72{
73 u32 class;
74 u8 progif;
75
76 /*
77 * If the IDE controller is in legacy mode, pci_setup_device() fills in
78 * the resources with the legacy addresses that normally appear on the
79 * PCI bus, just as if we had read them from a BAR.
80 *
81 * However, with the GT-64111, those legacy addresses, e.g., 0x1f0,
82 * will never appear on the PCI bus because it converts memory accesses
83 * in the PCI I/O region (which is never at address zero) into I/O port
84 * accesses with no address translation.
85 *
86 * For example, if GT_DEF_PCI0_IO_BASE is 0x10000000, a load or store
87 * to physical address 0x100001f0 will become a PCI access to I/O port
88 * 0x100001f0. There's no way to generate an access to I/O port 0x1f0,
89 * but the VT82C586 IDE controller does respond at 0x100001f0 because
90 * it only decodes the low 24 bits of the address.
91 *
92 * When this quirk runs, the pci_dev resources should contain bus
93 * addresses, not Linux I/O port numbers, so convert legacy addresses
94 * like 0x1f0 to bus addresses like 0x100001f0. Later, we'll convert
95 * them back with pcibios_fixup_bus() or pcibios_bus_to_resource().
96 */
97 class = dev->class >> 8;
98 if (class != PCI_CLASS_STORAGE_IDE)
99 return;
100
101 pci_read_config_byte(dev, PCI_CLASS_PROG, &progif);
102 if ((progif & 1) == 0) {
103 cobalt_legacy_ide_resource_fixup(dev, &dev->resource[0]);
104 cobalt_legacy_ide_resource_fixup(dev, &dev->resource[1]);
105 }
106 if ((progif & 4) == 0) {
107 cobalt_legacy_ide_resource_fixup(dev, &dev->resource[2]);
108 cobalt_legacy_ide_resource_fixup(dev, &dev->resource[3]);
109 }
110}
111
112DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_1,
113 cobalt_legacy_ide_fixup);
114
54static void qube_raq_via_bmIDE_fixup(struct pci_dev *dev) 115static void qube_raq_via_bmIDE_fixup(struct pci_dev *dev)
55{ 116{
56 unsigned short cfgword; 117 unsigned short cfgword;
diff --git a/arch/mips/pci/fixup-lemote2f.c b/arch/mips/pci/fixup-lemote2f.c
index caf2edeb02f0..4b9768d5d729 100644
--- a/arch/mips/pci/fixup-lemote2f.c
+++ b/arch/mips/pci/fixup-lemote2f.c
@@ -131,7 +131,7 @@ static void __init loongson_cs5536_ehci_fixup(struct pci_dev *pdev)
131 131
132 /* Serial short detect enable */ 132 /* Serial short detect enable */
133 _rdmsr(USB_MSR_REG(USB_CONFIG), &hi, &lo); 133 _rdmsr(USB_MSR_REG(USB_CONFIG), &hi, &lo);
134 _wrmsr(USB_MSR_REG(USB_CONFIG), (1 << 1) | (1 << 2) | (1 << 3), lo); 134 _wrmsr(USB_MSR_REG(USB_CONFIG), (1 << 1) | (1 << 3), lo);
135 135
136 /* setting the USB2.0 micro frame length */ 136 /* setting the USB2.0 micro frame length */
137 pci_write_config_dword(pdev, PCI_EHCI_FLADJ_REG, 0x2000); 137 pci_write_config_dword(pdev, PCI_EHCI_FLADJ_REG, 0x2000);
diff --git a/arch/mips/pci/ops-loongson2.c b/arch/mips/pci/ops-loongson2.c
index aa5d3da27212..2bb4057bf6c7 100644
--- a/arch/mips/pci/ops-loongson2.c
+++ b/arch/mips/pci/ops-loongson2.c
@@ -1,13 +1,11 @@
1/* 1/*
2 * fuloong2e specific PCI support.
3 *
4 * Copyright (C) 1999, 2000, 2004 MIPS Technologies, Inc. 2 * Copyright (C) 1999, 2000, 2004 MIPS Technologies, Inc.
5 * All rights reserved. 3 * All rights reserved.
6 * Authors: Carsten Langgaard <carstenl@mips.com> 4 * Authors: Carsten Langgaard <carstenl@mips.com>
7 * Maciej W. Rozycki <macro@mips.com> 5 * Maciej W. Rozycki <macro@mips.com>
8 * 6 *
9 * Copyright (C) 2009 Lemote Inc. 7 * Copyright (C) 2009 Lemote Inc.
10 * Author: Wu Zhangjin <wuzj@lemote.com> 8 * Author: Wu Zhangjin <wuzhangjin@gmail.com>
11 * 9 *
12 * This program is free software; you can distribute it and/or modify it 10 * This program is free software; you can distribute it and/or modify it
13 * under the terms of the GNU General Public License (Version 2) as 11 * under the terms of the GNU General Public License (Version 2) as
diff --git a/arch/mips/pci/ops-pmcmsp.c b/arch/mips/pci/ops-pmcmsp.c
index 32548b5d68d6..04b31478a6d7 100644
--- a/arch/mips/pci/ops-pmcmsp.c
+++ b/arch/mips/pci/ops-pmcmsp.c
@@ -206,7 +206,7 @@ static void pci_proc_init(void)
206} 206}
207#endif /* CONFIG_PROC_FS && PCI_COUNTERS */ 207#endif /* CONFIG_PROC_FS && PCI_COUNTERS */
208 208
209DEFINE_SPINLOCK(bpci_lock); 209static DEFINE_SPINLOCK(bpci_lock);
210 210
211/***************************************************************************** 211/*****************************************************************************
212 * 212 *
diff --git a/arch/mips/pci/pci-bcm47xx.c b/arch/mips/pci/pci-bcm47xx.c
index bea9b6cdfdbf..455f8e50a007 100644
--- a/arch/mips/pci/pci-bcm47xx.c
+++ b/arch/mips/pci/pci-bcm47xx.c
@@ -57,4 +57,3 @@ int pcibios_plat_dev_init(struct pci_dev *dev)
57 dev->irq = res; 57 dev->irq = res;
58 return 0; 58 return 0;
59} 59}
60
diff --git a/arch/mips/pci/pci-octeon.c b/arch/mips/pci/pci-octeon.c
index 9cb0c807f564..d248b707eff3 100644
--- a/arch/mips/pci/pci-octeon.c
+++ b/arch/mips/pci/pci-octeon.c
@@ -209,16 +209,14 @@ const char *octeon_get_pci_interrupts(void)
209 case CVMX_BOARD_TYPE_NAO38: 209 case CVMX_BOARD_TYPE_NAO38:
210 /* This is really the NAC38 */ 210 /* This is really the NAC38 */
211 return "AAAAADABAAAAAAAAAAAAAAAAAAAAAAAA"; 211 return "AAAAADABAAAAAAAAAAAAAAAAAAAAAAAA";
212 case CVMX_BOARD_TYPE_THUNDER:
213 return "";
214 case CVMX_BOARD_TYPE_EBH3000:
215 return "";
216 case CVMX_BOARD_TYPE_EBH3100: 212 case CVMX_BOARD_TYPE_EBH3100:
217 case CVMX_BOARD_TYPE_CN3010_EVB_HS5: 213 case CVMX_BOARD_TYPE_CN3010_EVB_HS5:
218 case CVMX_BOARD_TYPE_CN3005_EVB_HS5: 214 case CVMX_BOARD_TYPE_CN3005_EVB_HS5:
219 return "AAABAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; 215 return "AAABAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
220 case CVMX_BOARD_TYPE_BBGW_REF: 216 case CVMX_BOARD_TYPE_BBGW_REF:
221 return "AABCD"; 217 return "AABCD";
218 case CVMX_BOARD_TYPE_THUNDER:
219 case CVMX_BOARD_TYPE_EBH3000:
222 default: 220 default:
223 return ""; 221 return "";
224 } 222 }
diff --git a/arch/mips/pci/pci.c b/arch/mips/pci/pci.c
index 9a11c2226891..38bc28005b4a 100644
--- a/arch/mips/pci/pci.c
+++ b/arch/mips/pci/pci.c
@@ -49,8 +49,8 @@ static int pci_initialized;
49 * but we want to try to avoid allocating at 0x2900-0x2bff 49 * but we want to try to avoid allocating at 0x2900-0x2bff
50 * which might have be mirrored at 0x0100-0x03ff.. 50 * which might have be mirrored at 0x0100-0x03ff..
51 */ 51 */
52void 52resource_size_t
53pcibios_align_resource(void *data, struct resource *res, 53pcibios_align_resource(void *data, const struct resource *res,
54 resource_size_t size, resource_size_t align) 54 resource_size_t size, resource_size_t align)
55{ 55{
56 struct pci_dev *dev = data; 56 struct pci_dev *dev = data;
@@ -73,7 +73,7 @@ pcibios_align_resource(void *data, struct resource *res,
73 start = PCIBIOS_MIN_MEM + hose->mem_resource->start; 73 start = PCIBIOS_MIN_MEM + hose->mem_resource->start;
74 } 74 }
75 75
76 res->start = start; 76 return start;
77} 77}
78 78
79static void __devinit pcibios_scanbus(struct pci_controller *hose) 79static void __devinit pcibios_scanbus(struct pci_controller *hose)
@@ -251,8 +251,6 @@ static void pcibios_fixup_device_resources(struct pci_dev *dev,
251 for (i = 0; i < PCI_NUM_RESOURCES; i++) { 251 for (i = 0; i < PCI_NUM_RESOURCES; i++) {
252 if (!dev->resource[i].start) 252 if (!dev->resource[i].start)
253 continue; 253 continue;
254 if (dev->resource[i].flags & IORESOURCE_PCI_FIXED)
255 continue;
256 if (dev->resource[i].flags & IORESOURCE_IO) 254 if (dev->resource[i].flags & IORESOURCE_IO)
257 offset = hose->io_offset; 255 offset = hose->io_offset;
258 else if (dev->resource[i].flags & IORESOURCE_MEM) 256 else if (dev->resource[i].flags & IORESOURCE_MEM)
diff --git a/arch/mips/pmc-sierra/msp71xx/msp_irq_cic.c b/arch/mips/pmc-sierra/msp71xx/msp_irq_cic.c
index 5175357d0a25..94c9c2c9fbc1 100644
--- a/arch/mips/pmc-sierra/msp71xx/msp_irq_cic.c
+++ b/arch/mips/pmc-sierra/msp71xx/msp_irq_cic.c
@@ -131,4 +131,3 @@ void msp_cic_irq_dispatch(void)
131 else 131 else
132 do_IRQ(ffs(pending) + intbase - 1); 132 do_IRQ(ffs(pending) + intbase - 1);
133} 133}
134
diff --git a/arch/mips/pmc-sierra/msp71xx/msp_prom.c b/arch/mips/pmc-sierra/msp71xx/msp_prom.c
index c317a3623ce9..db98d87a0922 100644
--- a/arch/mips/pmc-sierra/msp71xx/msp_prom.c
+++ b/arch/mips/pmc-sierra/msp71xx/msp_prom.c
@@ -303,12 +303,6 @@ char *prom_getenv(char *env_name)
303} 303}
304 304
305/* PROM commandline functions */ 305/* PROM commandline functions */
306char *prom_getcmdline(void)
307{
308 return &(arcs_cmdline[0]);
309}
310EXPORT_SYMBOL(prom_getcmdline);
311
312void __init prom_init_cmdline(void) 306void __init prom_init_cmdline(void)
313{ 307{
314 char *cp; 308 char *cp;
diff --git a/arch/mips/pmc-sierra/yosemite/atmel_read_eeprom.c b/arch/mips/pmc-sierra/yosemite/atmel_read_eeprom.c
index fc990cb31941..d6f8bdff8cbb 100644
--- a/arch/mips/pmc-sierra/yosemite/atmel_read_eeprom.c
+++ b/arch/mips/pmc-sierra/yosemite/atmel_read_eeprom.c
@@ -127,7 +127,7 @@ static int recv_ack(void)
127 127
128 if (ack) { 128 if (ack) {
129 do_idle(); 129 do_idle();
130 printk(KERN_ERR "Error reading the Atmel 24C32/24C64 EEPROM \n"); 130 printk(KERN_ERR "Error reading the Atmel 24C32/24C64 EEPROM\n");
131 return -1; 131 return -1;
132 } 132 }
133 133
diff --git a/arch/mips/pmc-sierra/yosemite/atmel_read_eeprom.h b/arch/mips/pmc-sierra/yosemite/atmel_read_eeprom.h
index a31288335fba..d6c7ec469fa8 100644
--- a/arch/mips/pmc-sierra/yosemite/atmel_read_eeprom.h
+++ b/arch/mips/pmc-sierra/yosemite/atmel_read_eeprom.h
@@ -65,4 +65,3 @@
65const char rts = TIOCM_RTS; 65const char rts = TIOCM_RTS;
66const char dtr = TIOCM_DTR; 66const char dtr = TIOCM_DTR;
67int fd; 67int fd;
68
diff --git a/arch/mips/pmc-sierra/yosemite/ht.c b/arch/mips/pmc-sierra/yosemite/ht.c
index 678388fd34b1..fd22597edb64 100644
--- a/arch/mips/pmc-sierra/yosemite/ht.c
+++ b/arch/mips/pmc-sierra/yosemite/ht.c
@@ -345,14 +345,13 @@ int pcibios_enable_device(struct pci_dev *dev, int mask)
345 return pcibios_enable_resources(dev); 345 return pcibios_enable_resources(dev);
346} 346}
347 347
348void pcibios_align_resource(void *data, struct resource *res, 348resource_size_t pcibios_align_resource(void *data, const struct resource *res,
349 resource_size_t size, resource_size_t align) 349 resource_size_t size, resource_size_t align)
350{ 350{
351 struct pci_dev *dev = data; 351 struct pci_dev *dev = data;
352 resource_size_t start = res->start;
352 353
353 if (res->flags & IORESOURCE_IO) { 354 if (res->flags & IORESOURCE_IO) {
354 resource_size_t start = res->start;
355
356 /* We need to avoid collisions with `mirrored' VGA ports 355 /* We need to avoid collisions with `mirrored' VGA ports
357 and other strange ISA hardware, so we always want the 356 and other strange ISA hardware, so we always want the
358 addresses kilobyte aligned. */ 357 addresses kilobyte aligned. */
@@ -363,8 +362,9 @@ void pcibios_align_resource(void *data, struct resource *res,
363 } 362 }
364 363
365 start = (start + 1024 - 1) & ~(1024 - 1); 364 start = (start + 1024 - 1) & ~(1024 - 1);
366 res->start = start;
367 } 365 }
366
367 return start;
368} 368}
369 369
370struct pci_ops titan_pci_ops = { 370struct pci_ops titan_pci_ops = {
diff --git a/arch/mips/pmc-sierra/yosemite/smp.c b/arch/mips/pmc-sierra/yosemite/smp.c
index 326fe7a392e8..efc9e889b349 100644
--- a/arch/mips/pmc-sierra/yosemite/smp.c
+++ b/arch/mips/pmc-sierra/yosemite/smp.c
@@ -8,7 +8,7 @@
8 8
9#define LAUNCHSTACK_SIZE 256 9#define LAUNCHSTACK_SIZE 256
10 10
11static __cpuinitdata DEFINE_SPINLOCK(launch_lock); 11static __cpuinitdata arch_spinlock_t launch_lock = __ARCH_SPIN_LOCK_UNLOCKED;
12 12
13static unsigned long secondary_sp __cpuinitdata; 13static unsigned long secondary_sp __cpuinitdata;
14static unsigned long secondary_gp __cpuinitdata; 14static unsigned long secondary_gp __cpuinitdata;
@@ -20,7 +20,7 @@ static void __init prom_smp_bootstrap(void)
20{ 20{
21 local_irq_disable(); 21 local_irq_disable();
22 22
23 while (spin_is_locked(&launch_lock)); 23 while (arch_spin_is_locked(&launch_lock));
24 24
25 __asm__ __volatile__( 25 __asm__ __volatile__(
26 " move $sp, %0 \n" 26 " move $sp, %0 \n"
@@ -37,7 +37,7 @@ static void __init prom_smp_bootstrap(void)
37 */ 37 */
38void __init prom_grab_secondary(void) 38void __init prom_grab_secondary(void)
39{ 39{
40 spin_lock(&launch_lock); 40 arch_spin_lock(&launch_lock);
41 41
42 pmon_cpustart(1, &prom_smp_bootstrap, 42 pmon_cpustart(1, &prom_smp_bootstrap,
43 launchstack + LAUNCHSTACK_SIZE, 0); 43 launchstack + LAUNCHSTACK_SIZE, 0);
@@ -138,7 +138,7 @@ static void __cpuinit yos_boot_secondary(int cpu, struct task_struct *idle)
138 secondary_sp = sp; 138 secondary_sp = sp;
139 secondary_gp = gp; 139 secondary_gp = gp;
140 140
141 spin_unlock(&launch_lock); 141 arch_spin_unlock(&launch_lock);
142} 142}
143 143
144/* 144/*
diff --git a/arch/mips/power/cpu.c b/arch/mips/power/cpu.c
index 7995df45dc8d..26a6ef19d71f 100644
--- a/arch/mips/power/cpu.c
+++ b/arch/mips/power/cpu.c
@@ -3,9 +3,9 @@
3 * 3 *
4 * Licensed under the GPLv2 4 * Licensed under the GPLv2
5 * 5 *
6 * Copyright (C) 2009 Lemote Inc. & Insititute of Computing Technology 6 * Copyright (C) 2009 Lemote Inc.
7 * Author: Hu Hongbing <huhb@lemote.com> 7 * Author: Hu Hongbing <huhb@lemote.com>
8 * Wu Zhangjin <wuzj@lemote.com> 8 * Wu Zhangjin <wuzhangjin@gmail.com>
9 */ 9 */
10#include <asm/suspend.h> 10#include <asm/suspend.h>
11#include <asm/fpu.h> 11#include <asm/fpu.h>
diff --git a/arch/mips/power/hibernate.S b/arch/mips/power/hibernate.S
index 0cf86fb32ec3..dbb5c7b4b70f 100644
--- a/arch/mips/power/hibernate.S
+++ b/arch/mips/power/hibernate.S
@@ -3,9 +3,9 @@
3 * 3 *
4 * Licensed under the GPLv2 4 * Licensed under the GPLv2
5 * 5 *
6 * Copyright (C) 2009 Lemote Inc. & Insititute of Computing Technology 6 * Copyright (C) 2009 Lemote Inc.
7 * Author: Hu Hongbing <huhb@lemote.com> 7 * Author: Hu Hongbing <huhb@lemote.com>
8 * Wu Zhangjin <wuzj@lemote.com> 8 * Wu Zhangjin <wuzhangjin@gmail.com>
9 */ 9 */
10#include <asm/asm-offsets.h> 10#include <asm/asm-offsets.h>
11#include <asm/page.h> 11#include <asm/page.h>
diff --git a/arch/mips/powertv/asic/asic_devices.c b/arch/mips/powertv/asic/asic_devices.c
index 6a882194e063..217424231eb6 100644
--- a/arch/mips/powertv/asic/asic_devices.c
+++ b/arch/mips/powertv/asic/asic_devices.c
@@ -340,10 +340,6 @@ static void __init platform_configure_usb(void)
340 340
341 switch (asic) { 341 switch (asic) {
342 case ASIC_ZEUS: 342 case ASIC_ZEUS:
343 fs_update(0x0000, 0x11, 0x02, 0);
344 bcm1_usb2_ctl = 0x803;
345 break;
346
347 case ASIC_CRONUS: 343 case ASIC_CRONUS:
348 case ASIC_CRONUSLITE: 344 case ASIC_CRONUSLITE:
349 fs_update(0x0000, 0x11, 0x02, 0); 345 fs_update(0x0000, 0x11, 0x02, 0);
diff --git a/arch/mips/powertv/asic/asic_int.c b/arch/mips/powertv/asic/asic_int.c
index 80b2eed21ac3..325fab9685d1 100644
--- a/arch/mips/powertv/asic/asic_int.c
+++ b/arch/mips/powertv/asic/asic_int.c
@@ -39,21 +39,21 @@
39 39
40#include <asm/mach-powertv/asic_regs.h> 40#include <asm/mach-powertv/asic_regs.h>
41 41
42static DEFINE_SPINLOCK(asic_irq_lock); 42static DEFINE_RAW_SPINLOCK(asic_irq_lock);
43 43
44static inline int get_int(void) 44static inline int get_int(void)
45{ 45{
46 unsigned long flags; 46 unsigned long flags;
47 int irq; 47 int irq;
48 48
49 spin_lock_irqsave(&asic_irq_lock, flags); 49 raw_spin_lock_irqsave(&asic_irq_lock, flags);
50 50
51 irq = (asic_read(int_int_scan) >> 4) - 1; 51 irq = (asic_read(int_int_scan) >> 4) - 1;
52 52
53 if (irq == 0 || irq >= NR_IRQS) 53 if (irq == 0 || irq >= NR_IRQS)
54 irq = -1; 54 irq = -1;
55 55
56 spin_unlock_irqrestore(&asic_irq_lock, flags); 56 raw_spin_unlock_irqrestore(&asic_irq_lock, flags);
57 57
58 return irq; 58 return irq;
59} 59}
diff --git a/arch/mips/powertv/powertv_setup.c b/arch/mips/powertv/powertv_setup.c
index 698b1eafbe98..af2cae0a5ab3 100644
--- a/arch/mips/powertv/powertv_setup.c
+++ b/arch/mips/powertv/powertv_setup.c
@@ -25,14 +25,15 @@
25#include <linux/etherdevice.h> 25#include <linux/etherdevice.h>
26#include <linux/if_ether.h> 26#include <linux/if_ether.h>
27#include <linux/ctype.h> 27#include <linux/ctype.h>
28
29#include <linux/cpu.h> 28#include <linux/cpu.h>
29#include <linux/time.h>
30
30#include <asm/bootinfo.h> 31#include <asm/bootinfo.h>
31#include <asm/irq.h> 32#include <asm/irq.h>
32#include <asm/mips-boards/generic.h> 33#include <asm/mips-boards/generic.h>
33#include <asm/mips-boards/prom.h> 34#include <asm/mips-boards/prom.h>
34#include <asm/dma.h> 35#include <asm/dma.h>
35#include <linux/time.h> 36#include <asm/asm.h>
36#include <asm/traps.h> 37#include <asm/traps.h>
37#include <asm/asm-offsets.h> 38#include <asm/asm-offsets.h>
38#include "reset.h" 39#include "reset.h"
@@ -41,26 +42,21 @@
41 42
42/* 43/*
43 * Macros for loading addresses and storing registers: 44 * Macros for loading addresses and storing registers:
44 * PTR_LA Load the address into a register 45 * LONG_L_ Stringified version of LONG_L for use in asm() statement
45 * LONG_S Store the full width of the given register. 46 * LONG_S_ Stringified version of LONG_S for use in asm() statement
46 * LONG_L Load the full width of the given register 47 * PTR_LA_ Stringified version of PTR_LA for use in asm() statement
47 * PTR_ADDIU Add a constant value to a register used as a pointer
48 * REG_SIZE Number of 8-bit bytes in a full width register 48 * REG_SIZE Number of 8-bit bytes in a full width register
49 */ 49 */
50#define LONG_L_ VAL(LONG_L) " "
51#define LONG_S_ VAL(LONG_S) " "
52#define PTR_LA_ VAL(PTR_LA) " "
53
50#ifdef CONFIG_64BIT 54#ifdef CONFIG_64BIT
51#warning TODO: 64-bit code needs to be verified 55#warning TODO: 64-bit code needs to be verified
52#define PTR_LA "dla "
53#define LONG_S "sd "
54#define LONG_L "ld "
55#define PTR_ADDIU "daddiu "
56#define REG_SIZE "8" /* In bytes */ 56#define REG_SIZE "8" /* In bytes */
57#endif 57#endif
58 58
59#ifdef CONFIG_32BIT 59#ifdef CONFIG_32BIT
60#define PTR_LA "la "
61#define LONG_S "sw "
62#define LONG_L "lw "
63#define PTR_ADDIU "addiu "
64#define REG_SIZE "4" /* In bytes */ 60#define REG_SIZE "4" /* In bytes */
65#endif 61#endif
66 62
@@ -113,9 +109,9 @@ static int panic_handler(struct notifier_block *notifier_block,
113 * structure. */ 109 * structure. */
114 __asm__ __volatile__ ( 110 __asm__ __volatile__ (
115 ".set noat\n" 111 ".set noat\n"
116 LONG_S "$at, %[at]\n" 112 LONG_S_ "$at, %[at]\n"
117 LONG_S "$2, %[v0]\n" 113 LONG_S_ "$2, %[v0]\n"
118 LONG_S "$3, %[v1]\n" 114 LONG_S_ "$3, %[v1]\n"
119 : 115 :
120 [at] "=m" (at), 116 [at] "=m" (at),
121 [v0] "=m" (v0), 117 [v0] "=m" (v0),
@@ -129,54 +125,54 @@ static int panic_handler(struct notifier_block *notifier_block,
129 "move $at, %[pt_regs]\n" 125 "move $at, %[pt_regs]\n"
130 126
131 /* Argument registers */ 127 /* Argument registers */
132 LONG_S "$4, " VAL(PT_R4) "($at)\n" 128 LONG_S_ "$4, " VAL(PT_R4) "($at)\n"
133 LONG_S "$5, " VAL(PT_R5) "($at)\n" 129 LONG_S_ "$5, " VAL(PT_R5) "($at)\n"
134 LONG_S "$6, " VAL(PT_R6) "($at)\n" 130 LONG_S_ "$6, " VAL(PT_R6) "($at)\n"
135 LONG_S "$7, " VAL(PT_R7) "($at)\n" 131 LONG_S_ "$7, " VAL(PT_R7) "($at)\n"
136 132
137 /* Temporary regs */ 133 /* Temporary regs */
138 LONG_S "$8, " VAL(PT_R8) "($at)\n" 134 LONG_S_ "$8, " VAL(PT_R8) "($at)\n"
139 LONG_S "$9, " VAL(PT_R9) "($at)\n" 135 LONG_S_ "$9, " VAL(PT_R9) "($at)\n"
140 LONG_S "$10, " VAL(PT_R10) "($at)\n" 136 LONG_S_ "$10, " VAL(PT_R10) "($at)\n"
141 LONG_S "$11, " VAL(PT_R11) "($at)\n" 137 LONG_S_ "$11, " VAL(PT_R11) "($at)\n"
142 LONG_S "$12, " VAL(PT_R12) "($at)\n" 138 LONG_S_ "$12, " VAL(PT_R12) "($at)\n"
143 LONG_S "$13, " VAL(PT_R13) "($at)\n" 139 LONG_S_ "$13, " VAL(PT_R13) "($at)\n"
144 LONG_S "$14, " VAL(PT_R14) "($at)\n" 140 LONG_S_ "$14, " VAL(PT_R14) "($at)\n"
145 LONG_S "$15, " VAL(PT_R15) "($at)\n" 141 LONG_S_ "$15, " VAL(PT_R15) "($at)\n"
146 142
147 /* "Saved" registers */ 143 /* "Saved" registers */
148 LONG_S "$16, " VAL(PT_R16) "($at)\n" 144 LONG_S_ "$16, " VAL(PT_R16) "($at)\n"
149 LONG_S "$17, " VAL(PT_R17) "($at)\n" 145 LONG_S_ "$17, " VAL(PT_R17) "($at)\n"
150 LONG_S "$18, " VAL(PT_R18) "($at)\n" 146 LONG_S_ "$18, " VAL(PT_R18) "($at)\n"
151 LONG_S "$19, " VAL(PT_R19) "($at)\n" 147 LONG_S_ "$19, " VAL(PT_R19) "($at)\n"
152 LONG_S "$20, " VAL(PT_R20) "($at)\n" 148 LONG_S_ "$20, " VAL(PT_R20) "($at)\n"
153 LONG_S "$21, " VAL(PT_R21) "($at)\n" 149 LONG_S_ "$21, " VAL(PT_R21) "($at)\n"
154 LONG_S "$22, " VAL(PT_R22) "($at)\n" 150 LONG_S_ "$22, " VAL(PT_R22) "($at)\n"
155 LONG_S "$23, " VAL(PT_R23) "($at)\n" 151 LONG_S_ "$23, " VAL(PT_R23) "($at)\n"
156 152
157 /* Add'l temp regs */ 153 /* Add'l temp regs */
158 LONG_S "$24, " VAL(PT_R24) "($at)\n" 154 LONG_S_ "$24, " VAL(PT_R24) "($at)\n"
159 LONG_S "$25, " VAL(PT_R25) "($at)\n" 155 LONG_S_ "$25, " VAL(PT_R25) "($at)\n"
160 156
161 /* Kernel temp regs */ 157 /* Kernel temp regs */
162 LONG_S "$26, " VAL(PT_R26) "($at)\n" 158 LONG_S_ "$26, " VAL(PT_R26) "($at)\n"
163 LONG_S "$27, " VAL(PT_R27) "($at)\n" 159 LONG_S_ "$27, " VAL(PT_R27) "($at)\n"
164 160
165 /* Global pointer, stack pointer, frame pointer and 161 /* Global pointer, stack pointer, frame pointer and
166 * return address */ 162 * return address */
167 LONG_S "$gp, " VAL(PT_R28) "($at)\n" 163 LONG_S_ "$gp, " VAL(PT_R28) "($at)\n"
168 LONG_S "$sp, " VAL(PT_R29) "($at)\n" 164 LONG_S_ "$sp, " VAL(PT_R29) "($at)\n"
169 LONG_S "$fp, " VAL(PT_R30) "($at)\n" 165 LONG_S_ "$fp, " VAL(PT_R30) "($at)\n"
170 LONG_S "$ra, " VAL(PT_R31) "($at)\n" 166 LONG_S_ "$ra, " VAL(PT_R31) "($at)\n"
171 167
172 /* Now we can get the $at and v0 registers back and 168 /* Now we can get the $at and v0 registers back and
173 * store them */ 169 * store them */
174 LONG_L "$8, %[at]\n" 170 LONG_L_ "$8, %[at]\n"
175 LONG_S "$8, " VAL(PT_R1) "($at)\n" 171 LONG_S_ "$8, " VAL(PT_R1) "($at)\n"
176 LONG_L "$8, %[v0]\n" 172 LONG_L_ "$8, %[v0]\n"
177 LONG_S "$8, " VAL(PT_R2) "($at)\n" 173 LONG_S_ "$8, " VAL(PT_R2) "($at)\n"
178 LONG_L "$8, %[v1]\n" 174 LONG_L_ "$8, %[v1]\n"
179 LONG_S "$8, " VAL(PT_R3) "($at)\n" 175 LONG_S_ "$8, " VAL(PT_R3) "($at)\n"
180 : 176 :
181 : 177 :
182 [at] "m" (at), 178 [at] "m" (at),
@@ -191,8 +187,8 @@ static int panic_handler(struct notifier_block *notifier_block,
191 __asm__ __volatile__ ( 187 __asm__ __volatile__ (
192 ".set noat\n" 188 ".set noat\n"
193 "1:\n" 189 "1:\n"
194 PTR_LA "$at, 1b\n" 190 PTR_LA_ "$at, 1b\n"
195 LONG_S "$at, %[cp0_epc]\n" 191 LONG_S_ "$at, %[cp0_epc]\n"
196 : 192 :
197 [cp0_epc] "=m" (my_regs.cp0_epc) 193 [cp0_epc] "=m" (my_regs.cp0_epc)
198 : 194 :
diff --git a/arch/mips/sgi-ip27/ip27-klnuma.c b/arch/mips/sgi-ip27/ip27-klnuma.c
index d9c79d8be81d..c3d30a88daf3 100644
--- a/arch/mips/sgi-ip27/ip27-klnuma.c
+++ b/arch/mips/sgi-ip27/ip27-klnuma.c
@@ -133,4 +133,3 @@ pfn_t node_getfirstfree(cnodeid_t cnode)
133 return (KDM_TO_PHYS(PAGE_ALIGN(SYMMON_STK_ADDR(nasid, 0))) >> 133 return (KDM_TO_PHYS(PAGE_ALIGN(SYMMON_STK_ADDR(nasid, 0))) >>
134 PAGE_SHIFT); 134 PAGE_SHIFT);
135} 135}
136
diff --git a/arch/mips/sgi-ip27/ip27-nmi.c b/arch/mips/sgi-ip27/ip27-nmi.c
index 6c5a630566f9..bc4fa8dd67f3 100644
--- a/arch/mips/sgi-ip27/ip27-nmi.c
+++ b/arch/mips/sgi-ip27/ip27-nmi.c
@@ -17,11 +17,10 @@
17#endif 17#endif
18 18
19#define CNODEID_NONE (cnodeid_t)-1 19#define CNODEID_NONE (cnodeid_t)-1
20#define enter_panic_mode() spin_lock(&nmi_lock)
21 20
22typedef unsigned long machreg_t; 21typedef unsigned long machreg_t;
23 22
24DEFINE_SPINLOCK(nmi_lock); 23static arch_spinlock_t nmi_lock = __ARCH_SPIN_LOCK_UNLOCKED;
25 24
26/* 25/*
27 * Lets see what else we need to do here. Set up sp, gp? 26 * Lets see what else we need to do here. Set up sp, gp?
@@ -193,9 +192,9 @@ cont_nmi_dump(void)
193 atomic_inc(&nmied_cpus); 192 atomic_inc(&nmied_cpus);
194#endif 193#endif
195 /* 194 /*
196 * Use enter_panic_mode to allow only 1 cpu to proceed 195 * Only allow 1 cpu to proceed
197 */ 196 */
198 enter_panic_mode(); 197 arch_spin_lock(&nmi_lock);
199 198
200#ifdef REAL_NMI_SIGNAL 199#ifdef REAL_NMI_SIGNAL
201 /* 200 /*
diff --git a/arch/mips/sgi-ip32/ip32-irq.c b/arch/mips/sgi-ip32/ip32-irq.c
index 5c2bf111ca67..d8b65204d288 100644
--- a/arch/mips/sgi-ip32/ip32-irq.c
+++ b/arch/mips/sgi-ip32/ip32-irq.c
@@ -512,10 +512,6 @@ void __init arch_init_irq(void)
512 "level"); 512 "level");
513 break; 513 break;
514 514
515 case CRIME_GBE0_IRQ ... CRIME_GBE3_IRQ:
516 set_irq_chip_and_handler_name(irq,
517 &crime_edge_interrupt, handle_edge_irq, "edge");
518 break;
519 case CRIME_CPUERR_IRQ: 515 case CRIME_CPUERR_IRQ:
520 case CRIME_MEMERR_IRQ: 516 case CRIME_MEMERR_IRQ:
521 set_irq_chip_and_handler_name(irq, 517 set_irq_chip_and_handler_name(irq,
@@ -523,12 +519,9 @@ void __init arch_init_irq(void)
523 "level"); 519 "level");
524 break; 520 break;
525 521
522 case CRIME_GBE0_IRQ ... CRIME_GBE3_IRQ:
526 case CRIME_RE_EMPTY_E_IRQ ... CRIME_RE_IDLE_E_IRQ: 523 case CRIME_RE_EMPTY_E_IRQ ... CRIME_RE_IDLE_E_IRQ:
527 case CRIME_SOFT0_IRQ ... CRIME_SOFT2_IRQ: 524 case CRIME_SOFT0_IRQ ... CRIME_SOFT2_IRQ:
528 set_irq_chip_and_handler_name(irq,
529 &crime_edge_interrupt, handle_edge_irq, "edge");
530 break;
531
532 case CRIME_VICE_IRQ: 525 case CRIME_VICE_IRQ:
533 set_irq_chip_and_handler_name(irq, 526 set_irq_chip_and_handler_name(irq,
534 &crime_edge_interrupt, handle_edge_irq, "edge"); 527 &crime_edge_interrupt, handle_edge_irq, "edge");
diff --git a/arch/mips/sibyte/bcm1480/irq.c b/arch/mips/sibyte/bcm1480/irq.c
index 4070268aa769..06e25d949768 100644
--- a/arch/mips/sibyte/bcm1480/irq.c
+++ b/arch/mips/sibyte/bcm1480/irq.c
@@ -73,14 +73,14 @@ static struct irq_chip bcm1480_irq_type = {
73/* Store the CPU id (not the logical number) */ 73/* Store the CPU id (not the logical number) */
74int bcm1480_irq_owner[BCM1480_NR_IRQS]; 74int bcm1480_irq_owner[BCM1480_NR_IRQS];
75 75
76DEFINE_SPINLOCK(bcm1480_imr_lock); 76static DEFINE_RAW_SPINLOCK(bcm1480_imr_lock);
77 77
78void bcm1480_mask_irq(int cpu, int irq) 78void bcm1480_mask_irq(int cpu, int irq)
79{ 79{
80 unsigned long flags, hl_spacing; 80 unsigned long flags, hl_spacing;
81 u64 cur_ints; 81 u64 cur_ints;
82 82
83 spin_lock_irqsave(&bcm1480_imr_lock, flags); 83 raw_spin_lock_irqsave(&bcm1480_imr_lock, flags);
84 hl_spacing = 0; 84 hl_spacing = 0;
85 if ((irq >= BCM1480_NR_IRQS_HALF) && (irq <= BCM1480_NR_IRQS)) { 85 if ((irq >= BCM1480_NR_IRQS_HALF) && (irq <= BCM1480_NR_IRQS)) {
86 hl_spacing = BCM1480_IMR_HL_SPACING; 86 hl_spacing = BCM1480_IMR_HL_SPACING;
@@ -89,7 +89,7 @@ void bcm1480_mask_irq(int cpu, int irq)
89 cur_ints = ____raw_readq(IOADDR(A_BCM1480_IMR_MAPPER(cpu) + R_BCM1480_IMR_INTERRUPT_MASK_H + hl_spacing)); 89 cur_ints = ____raw_readq(IOADDR(A_BCM1480_IMR_MAPPER(cpu) + R_BCM1480_IMR_INTERRUPT_MASK_H + hl_spacing));
90 cur_ints |= (((u64) 1) << irq); 90 cur_ints |= (((u64) 1) << irq);
91 ____raw_writeq(cur_ints, IOADDR(A_BCM1480_IMR_MAPPER(cpu) + R_BCM1480_IMR_INTERRUPT_MASK_H + hl_spacing)); 91 ____raw_writeq(cur_ints, IOADDR(A_BCM1480_IMR_MAPPER(cpu) + R_BCM1480_IMR_INTERRUPT_MASK_H + hl_spacing));
92 spin_unlock_irqrestore(&bcm1480_imr_lock, flags); 92 raw_spin_unlock_irqrestore(&bcm1480_imr_lock, flags);
93} 93}
94 94
95void bcm1480_unmask_irq(int cpu, int irq) 95void bcm1480_unmask_irq(int cpu, int irq)
@@ -97,7 +97,7 @@ void bcm1480_unmask_irq(int cpu, int irq)
97 unsigned long flags, hl_spacing; 97 unsigned long flags, hl_spacing;
98 u64 cur_ints; 98 u64 cur_ints;
99 99
100 spin_lock_irqsave(&bcm1480_imr_lock, flags); 100 raw_spin_lock_irqsave(&bcm1480_imr_lock, flags);
101 hl_spacing = 0; 101 hl_spacing = 0;
102 if ((irq >= BCM1480_NR_IRQS_HALF) && (irq <= BCM1480_NR_IRQS)) { 102 if ((irq >= BCM1480_NR_IRQS_HALF) && (irq <= BCM1480_NR_IRQS)) {
103 hl_spacing = BCM1480_IMR_HL_SPACING; 103 hl_spacing = BCM1480_IMR_HL_SPACING;
@@ -106,7 +106,7 @@ void bcm1480_unmask_irq(int cpu, int irq)
106 cur_ints = ____raw_readq(IOADDR(A_BCM1480_IMR_MAPPER(cpu) + R_BCM1480_IMR_INTERRUPT_MASK_H + hl_spacing)); 106 cur_ints = ____raw_readq(IOADDR(A_BCM1480_IMR_MAPPER(cpu) + R_BCM1480_IMR_INTERRUPT_MASK_H + hl_spacing));
107 cur_ints &= ~(((u64) 1) << irq); 107 cur_ints &= ~(((u64) 1) << irq);
108 ____raw_writeq(cur_ints, IOADDR(A_BCM1480_IMR_MAPPER(cpu) + R_BCM1480_IMR_INTERRUPT_MASK_H + hl_spacing)); 108 ____raw_writeq(cur_ints, IOADDR(A_BCM1480_IMR_MAPPER(cpu) + R_BCM1480_IMR_INTERRUPT_MASK_H + hl_spacing));
109 spin_unlock_irqrestore(&bcm1480_imr_lock, flags); 109 raw_spin_unlock_irqrestore(&bcm1480_imr_lock, flags);
110} 110}
111 111
112#ifdef CONFIG_SMP 112#ifdef CONFIG_SMP
@@ -123,7 +123,7 @@ static int bcm1480_set_affinity(unsigned int irq, const struct cpumask *mask)
123 cpu = cpu_logical_map(i); 123 cpu = cpu_logical_map(i);
124 124
125 /* Protect against other affinity changers and IMR manipulation */ 125 /* Protect against other affinity changers and IMR manipulation */
126 spin_lock_irqsave(&bcm1480_imr_lock, flags); 126 raw_spin_lock_irqsave(&bcm1480_imr_lock, flags);
127 127
128 /* Swizzle each CPU's IMR (but leave the IP selection alone) */ 128 /* Swizzle each CPU's IMR (but leave the IP selection alone) */
129 old_cpu = bcm1480_irq_owner[irq]; 129 old_cpu = bcm1480_irq_owner[irq];
@@ -148,7 +148,7 @@ static int bcm1480_set_affinity(unsigned int irq, const struct cpumask *mask)
148 ____raw_writeq(cur_ints, IOADDR(A_BCM1480_IMR_MAPPER(cpu) + R_BCM1480_IMR_INTERRUPT_MASK_H + (k*BCM1480_IMR_HL_SPACING))); 148 ____raw_writeq(cur_ints, IOADDR(A_BCM1480_IMR_MAPPER(cpu) + R_BCM1480_IMR_INTERRUPT_MASK_H + (k*BCM1480_IMR_HL_SPACING)));
149 } 149 }
150 } 150 }
151 spin_unlock_irqrestore(&bcm1480_imr_lock, flags); 151 raw_spin_unlock_irqrestore(&bcm1480_imr_lock, flags);
152 152
153 return 0; 153 return 0;
154} 154}
diff --git a/arch/mips/sibyte/common/sb_tbprof.c b/arch/mips/sibyte/common/sb_tbprof.c
index 15ea778b5e66..ed2453eab5cb 100644
--- a/arch/mips/sibyte/common/sb_tbprof.c
+++ b/arch/mips/sibyte/common/sb_tbprof.c
@@ -28,7 +28,6 @@
28#include <linux/init.h> 28#include <linux/init.h>
29#include <linux/interrupt.h> 29#include <linux/interrupt.h>
30#include <linux/slab.h> 30#include <linux/slab.h>
31#include <linux/smp_lock.h>
32#include <linux/vmalloc.h> 31#include <linux/vmalloc.h>
33#include <linux/fs.h> 32#include <linux/fs.h>
34#include <linux/errno.h> 33#include <linux/errno.h>
diff --git a/arch/mips/sibyte/sb1250/irq.c b/arch/mips/sibyte/sb1250/irq.c
index 5e7f2016cceb..ab44a2f59ee4 100644
--- a/arch/mips/sibyte/sb1250/irq.c
+++ b/arch/mips/sibyte/sb1250/irq.c
@@ -72,20 +72,20 @@ static struct irq_chip sb1250_irq_type = {
72/* Store the CPU id (not the logical number) */ 72/* Store the CPU id (not the logical number) */
73int sb1250_irq_owner[SB1250_NR_IRQS]; 73int sb1250_irq_owner[SB1250_NR_IRQS];
74 74
75DEFINE_SPINLOCK(sb1250_imr_lock); 75static DEFINE_RAW_SPINLOCK(sb1250_imr_lock);
76 76
77void sb1250_mask_irq(int cpu, int irq) 77void sb1250_mask_irq(int cpu, int irq)
78{ 78{
79 unsigned long flags; 79 unsigned long flags;
80 u64 cur_ints; 80 u64 cur_ints;
81 81
82 spin_lock_irqsave(&sb1250_imr_lock, flags); 82 raw_spin_lock_irqsave(&sb1250_imr_lock, flags);
83 cur_ints = ____raw_readq(IOADDR(A_IMR_MAPPER(cpu) + 83 cur_ints = ____raw_readq(IOADDR(A_IMR_MAPPER(cpu) +
84 R_IMR_INTERRUPT_MASK)); 84 R_IMR_INTERRUPT_MASK));
85 cur_ints |= (((u64) 1) << irq); 85 cur_ints |= (((u64) 1) << irq);
86 ____raw_writeq(cur_ints, IOADDR(A_IMR_MAPPER(cpu) + 86 ____raw_writeq(cur_ints, IOADDR(A_IMR_MAPPER(cpu) +
87 R_IMR_INTERRUPT_MASK)); 87 R_IMR_INTERRUPT_MASK));
88 spin_unlock_irqrestore(&sb1250_imr_lock, flags); 88 raw_spin_unlock_irqrestore(&sb1250_imr_lock, flags);
89} 89}
90 90
91void sb1250_unmask_irq(int cpu, int irq) 91void sb1250_unmask_irq(int cpu, int irq)
@@ -93,13 +93,13 @@ void sb1250_unmask_irq(int cpu, int irq)
93 unsigned long flags; 93 unsigned long flags;
94 u64 cur_ints; 94 u64 cur_ints;
95 95
96 spin_lock_irqsave(&sb1250_imr_lock, flags); 96 raw_spin_lock_irqsave(&sb1250_imr_lock, flags);
97 cur_ints = ____raw_readq(IOADDR(A_IMR_MAPPER(cpu) + 97 cur_ints = ____raw_readq(IOADDR(A_IMR_MAPPER(cpu) +
98 R_IMR_INTERRUPT_MASK)); 98 R_IMR_INTERRUPT_MASK));
99 cur_ints &= ~(((u64) 1) << irq); 99 cur_ints &= ~(((u64) 1) << irq);
100 ____raw_writeq(cur_ints, IOADDR(A_IMR_MAPPER(cpu) + 100 ____raw_writeq(cur_ints, IOADDR(A_IMR_MAPPER(cpu) +
101 R_IMR_INTERRUPT_MASK)); 101 R_IMR_INTERRUPT_MASK));
102 spin_unlock_irqrestore(&sb1250_imr_lock, flags); 102 raw_spin_unlock_irqrestore(&sb1250_imr_lock, flags);
103} 103}
104 104
105#ifdef CONFIG_SMP 105#ifdef CONFIG_SMP
@@ -115,7 +115,7 @@ static int sb1250_set_affinity(unsigned int irq, const struct cpumask *mask)
115 cpu = cpu_logical_map(i); 115 cpu = cpu_logical_map(i);
116 116
117 /* Protect against other affinity changers and IMR manipulation */ 117 /* Protect against other affinity changers and IMR manipulation */
118 spin_lock_irqsave(&sb1250_imr_lock, flags); 118 raw_spin_lock_irqsave(&sb1250_imr_lock, flags);
119 119
120 /* Swizzle each CPU's IMR (but leave the IP selection alone) */ 120 /* Swizzle each CPU's IMR (but leave the IP selection alone) */
121 old_cpu = sb1250_irq_owner[irq]; 121 old_cpu = sb1250_irq_owner[irq];
@@ -137,7 +137,7 @@ static int sb1250_set_affinity(unsigned int irq, const struct cpumask *mask)
137 ____raw_writeq(cur_ints, IOADDR(A_IMR_MAPPER(cpu) + 137 ____raw_writeq(cur_ints, IOADDR(A_IMR_MAPPER(cpu) +
138 R_IMR_INTERRUPT_MASK)); 138 R_IMR_INTERRUPT_MASK));
139 } 139 }
140 spin_unlock_irqrestore(&sb1250_imr_lock, flags); 140 raw_spin_unlock_irqrestore(&sb1250_imr_lock, flags);
141 141
142 return 0; 142 return 0;
143} 143}
diff --git a/arch/mips/sni/rm200.c b/arch/mips/sni/rm200.c
index 31e2583ec622..90c558f7c0fa 100644
--- a/arch/mips/sni/rm200.c
+++ b/arch/mips/sni/rm200.c
@@ -132,7 +132,7 @@ device_initcall(snirm_setup_devinit);
132 * readb/writeb to access them 132 * readb/writeb to access them
133 */ 133 */
134 134
135DEFINE_SPINLOCK(sni_rm200_i8259A_lock); 135static DEFINE_RAW_SPINLOCK(sni_rm200_i8259A_lock);
136#define PIC_CMD 0x00 136#define PIC_CMD 0x00
137#define PIC_IMR 0x01 137#define PIC_IMR 0x01
138#define PIC_ISR PIC_CMD 138#define PIC_ISR PIC_CMD
@@ -161,13 +161,13 @@ static void sni_rm200_disable_8259A_irq(unsigned int irq)
161 161
162 irq -= RM200_I8259A_IRQ_BASE; 162 irq -= RM200_I8259A_IRQ_BASE;
163 mask = 1 << irq; 163 mask = 1 << irq;
164 spin_lock_irqsave(&sni_rm200_i8259A_lock, flags); 164 raw_spin_lock_irqsave(&sni_rm200_i8259A_lock, flags);
165 rm200_cached_irq_mask |= mask; 165 rm200_cached_irq_mask |= mask;
166 if (irq & 8) 166 if (irq & 8)
167 writeb(cached_slave_mask, rm200_pic_slave + PIC_IMR); 167 writeb(cached_slave_mask, rm200_pic_slave + PIC_IMR);
168 else 168 else
169 writeb(cached_master_mask, rm200_pic_master + PIC_IMR); 169 writeb(cached_master_mask, rm200_pic_master + PIC_IMR);
170 spin_unlock_irqrestore(&sni_rm200_i8259A_lock, flags); 170 raw_spin_unlock_irqrestore(&sni_rm200_i8259A_lock, flags);
171} 171}
172 172
173static void sni_rm200_enable_8259A_irq(unsigned int irq) 173static void sni_rm200_enable_8259A_irq(unsigned int irq)
@@ -177,13 +177,13 @@ static void sni_rm200_enable_8259A_irq(unsigned int irq)
177 177
178 irq -= RM200_I8259A_IRQ_BASE; 178 irq -= RM200_I8259A_IRQ_BASE;
179 mask = ~(1 << irq); 179 mask = ~(1 << irq);
180 spin_lock_irqsave(&sni_rm200_i8259A_lock, flags); 180 raw_spin_lock_irqsave(&sni_rm200_i8259A_lock, flags);
181 rm200_cached_irq_mask &= mask; 181 rm200_cached_irq_mask &= mask;
182 if (irq & 8) 182 if (irq & 8)
183 writeb(cached_slave_mask, rm200_pic_slave + PIC_IMR); 183 writeb(cached_slave_mask, rm200_pic_slave + PIC_IMR);
184 else 184 else
185 writeb(cached_master_mask, rm200_pic_master + PIC_IMR); 185 writeb(cached_master_mask, rm200_pic_master + PIC_IMR);
186 spin_unlock_irqrestore(&sni_rm200_i8259A_lock, flags); 186 raw_spin_unlock_irqrestore(&sni_rm200_i8259A_lock, flags);
187} 187}
188 188
189static inline int sni_rm200_i8259A_irq_real(unsigned int irq) 189static inline int sni_rm200_i8259A_irq_real(unsigned int irq)
@@ -216,7 +216,7 @@ void sni_rm200_mask_and_ack_8259A(unsigned int irq)
216 216
217 irq -= RM200_I8259A_IRQ_BASE; 217 irq -= RM200_I8259A_IRQ_BASE;
218 irqmask = 1 << irq; 218 irqmask = 1 << irq;
219 spin_lock_irqsave(&sni_rm200_i8259A_lock, flags); 219 raw_spin_lock_irqsave(&sni_rm200_i8259A_lock, flags);
220 /* 220 /*
221 * Lightweight spurious IRQ detection. We do not want 221 * Lightweight spurious IRQ detection. We do not want
222 * to overdo spurious IRQ handling - it's usually a sign 222 * to overdo spurious IRQ handling - it's usually a sign
@@ -247,7 +247,7 @@ handle_real_irq:
247 writeb(cached_master_mask, rm200_pic_master + PIC_IMR); 247 writeb(cached_master_mask, rm200_pic_master + PIC_IMR);
248 writeb(0x60+irq, rm200_pic_master + PIC_CMD); 248 writeb(0x60+irq, rm200_pic_master + PIC_CMD);
249 } 249 }
250 spin_unlock_irqrestore(&sni_rm200_i8259A_lock, flags); 250 raw_spin_unlock_irqrestore(&sni_rm200_i8259A_lock, flags);
251 return; 251 return;
252 252
253spurious_8259A_irq: 253spurious_8259A_irq:
@@ -298,7 +298,7 @@ static inline int sni_rm200_i8259_irq(void)
298{ 298{
299 int irq; 299 int irq;
300 300
301 spin_lock(&sni_rm200_i8259A_lock); 301 raw_spin_lock(&sni_rm200_i8259A_lock);
302 302
303 /* Perform an interrupt acknowledge cycle on controller 1. */ 303 /* Perform an interrupt acknowledge cycle on controller 1. */
304 writeb(0x0C, rm200_pic_master + PIC_CMD); /* prepare for poll */ 304 writeb(0x0C, rm200_pic_master + PIC_CMD); /* prepare for poll */
@@ -325,7 +325,7 @@ static inline int sni_rm200_i8259_irq(void)
325 irq = -1; 325 irq = -1;
326 } 326 }
327 327
328 spin_unlock(&sni_rm200_i8259A_lock); 328 raw_spin_unlock(&sni_rm200_i8259A_lock);
329 329
330 return likely(irq >= 0) ? irq + RM200_I8259A_IRQ_BASE : irq; 330 return likely(irq >= 0) ? irq + RM200_I8259A_IRQ_BASE : irq;
331} 331}
@@ -334,7 +334,7 @@ void sni_rm200_init_8259A(void)
334{ 334{
335 unsigned long flags; 335 unsigned long flags;
336 336
337 spin_lock_irqsave(&sni_rm200_i8259A_lock, flags); 337 raw_spin_lock_irqsave(&sni_rm200_i8259A_lock, flags);
338 338
339 writeb(0xff, rm200_pic_master + PIC_IMR); 339 writeb(0xff, rm200_pic_master + PIC_IMR);
340 writeb(0xff, rm200_pic_slave + PIC_IMR); 340 writeb(0xff, rm200_pic_slave + PIC_IMR);
@@ -352,7 +352,7 @@ void sni_rm200_init_8259A(void)
352 writeb(cached_master_mask, rm200_pic_master + PIC_IMR); 352 writeb(cached_master_mask, rm200_pic_master + PIC_IMR);
353 writeb(cached_slave_mask, rm200_pic_slave + PIC_IMR); 353 writeb(cached_slave_mask, rm200_pic_slave + PIC_IMR);
354 354
355 spin_unlock_irqrestore(&sni_rm200_i8259A_lock, flags); 355 raw_spin_unlock_irqrestore(&sni_rm200_i8259A_lock, flags);
356} 356}
357 357
358/* 358/*
diff --git a/arch/mips/txx9/generic/setup.c b/arch/mips/txx9/generic/setup.c
index e27809b6d04f..7174d830dd05 100644
--- a/arch/mips/txx9/generic/setup.c
+++ b/arch/mips/txx9/generic/setup.c
@@ -399,11 +399,6 @@ const char *get_system_type(void)
399 return txx9_system_type; 399 return txx9_system_type;
400} 400}
401 401
402char * __init prom_getcmdline(void)
403{
404 return &(arcs_cmdline[0]);
405}
406
407const char *__init prom_getenv(const char *name) 402const char *__init prom_getenv(const char *name)
408{ 403{
409 const s32 *str; 404 const s32 *str;
diff --git a/arch/mips/txx9/jmr3927/setup.c b/arch/mips/txx9/jmr3927/setup.c
index 25e50a7be387..3206f76f300b 100644
--- a/arch/mips/txx9/jmr3927/setup.c
+++ b/arch/mips/txx9/jmr3927/setup.c
@@ -67,8 +67,6 @@ static void jmr3927_board_init(void);
67 67
68static void __init jmr3927_mem_setup(void) 68static void __init jmr3927_mem_setup(void)
69{ 69{
70 char *argptr;
71
72 set_io_port_base(JMR3927_PORT_BASE + JMR3927_PCIIO); 70 set_io_port_base(JMR3927_PORT_BASE + JMR3927_PCIIO);
73 71
74 _machine_restart = jmr3927_machine_restart; 72 _machine_restart = jmr3927_machine_restart;
@@ -97,11 +95,6 @@ static void __init jmr3927_mem_setup(void)
97 jmr3927_board_init(); 95 jmr3927_board_init();
98 96
99 tx3927_sio_init(0, 1 << 1); /* ch1: noCTS */ 97 tx3927_sio_init(0, 1 << 1); /* ch1: noCTS */
100#ifdef CONFIG_SERIAL_TXX9_CONSOLE
101 argptr = prom_getcmdline();
102 if (!strstr(argptr, "console="))
103 strcat(argptr, " console=ttyS1,115200");
104#endif
105} 98}
106 99
107static void __init jmr3927_pci_setup(void) 100static void __init jmr3927_pci_setup(void)
diff --git a/arch/mips/txx9/rbtx4927/setup.c b/arch/mips/txx9/rbtx4927/setup.c
index ee468eaee4f7..b15adfc2d726 100644
--- a/arch/mips/txx9/rbtx4927/setup.c
+++ b/arch/mips/txx9/rbtx4927/setup.c
@@ -187,8 +187,6 @@ static void __init rbtx4937_clock_init(void);
187 187
188static void __init rbtx4927_mem_setup(void) 188static void __init rbtx4927_mem_setup(void)
189{ 189{
190 char *argptr;
191
192 if (TX4927_REV_PCODE() == 0x4927) { 190 if (TX4927_REV_PCODE() == 0x4927) {
193 rbtx4927_clock_init(); 191 rbtx4927_clock_init();
194 tx4927_setup(); 192 tx4927_setup();
@@ -213,11 +211,6 @@ static void __init rbtx4927_mem_setup(void)
213 gpio_direction_output(15, 1); 211 gpio_direction_output(15, 1);
214 212
215 tx4927_sio_init(0, 0); 213 tx4927_sio_init(0, 0);
216#ifdef CONFIG_SERIAL_TXX9_CONSOLE
217 argptr = prom_getcmdline();
218 if (!strstr(argptr, "console="))
219 strcat(argptr, " console=ttyS0,38400");
220#endif
221} 214}
222 215
223static void __init rbtx4927_clock_init(void) 216static void __init rbtx4927_clock_init(void)
diff --git a/arch/mips/txx9/rbtx4938/setup.c b/arch/mips/txx9/rbtx4938/setup.c
index d66509b14284..d6e70dab3bd3 100644
--- a/arch/mips/txx9/rbtx4938/setup.c
+++ b/arch/mips/txx9/rbtx4938/setup.c
@@ -153,7 +153,6 @@ static void __init rbtx4938_time_init(void)
153static void __init rbtx4938_mem_setup(void) 153static void __init rbtx4938_mem_setup(void)
154{ 154{
155 unsigned long long pcfg; 155 unsigned long long pcfg;
156 char *argptr;
157 156
158 if (txx9_master_clock == 0) 157 if (txx9_master_clock == 0)
159 txx9_master_clock = 25000000; /* 25MHz */ 158 txx9_master_clock = 25000000; /* 25MHz */
@@ -168,11 +167,6 @@ static void __init rbtx4938_mem_setup(void)
168#endif 167#endif
169 168
170 tx4938_sio_init(7372800, 0); 169 tx4938_sio_init(7372800, 0);
171#ifdef CONFIG_SERIAL_TXX9_CONSOLE
172 argptr = prom_getcmdline();
173 if (!strstr(argptr, "console="))
174 strcat(argptr, " console=ttyS0,38400");
175#endif
176 170
177#ifdef CONFIG_TOSHIBA_RBTX4938_MPLEX_PIO58_61 171#ifdef CONFIG_TOSHIBA_RBTX4938_MPLEX_PIO58_61
178 pr_info("PIOSEL: disabling both ATA and NAND selection\n"); 172 pr_info("PIOSEL: disabling both ATA and NAND selection\n");
diff --git a/arch/mn10300/include/asm/pgtable.h b/arch/mn10300/include/asm/pgtable.h
index 6dc30fc827c4..16d88577f3e0 100644
--- a/arch/mn10300/include/asm/pgtable.h
+++ b/arch/mn10300/include/asm/pgtable.h
@@ -466,7 +466,7 @@ static inline int set_kernel_exec(unsigned long vaddr, int enable)
466 * the kernel page tables containing the necessary information by tlb-mn10300.S 466 * the kernel page tables containing the necessary information by tlb-mn10300.S
467 */ 467 */
468extern void update_mmu_cache(struct vm_area_struct *vma, 468extern void update_mmu_cache(struct vm_area_struct *vma,
469 unsigned long address, pte_t pte); 469 unsigned long address, pte_t *ptep);
470 470
471#endif /* !__ASSEMBLY__ */ 471#endif /* !__ASSEMBLY__ */
472 472
diff --git a/arch/mn10300/mm/mmu-context.c b/arch/mn10300/mm/mmu-context.c
index 31c9d27a75ae..36ba02191d40 100644
--- a/arch/mn10300/mm/mmu-context.c
+++ b/arch/mn10300/mm/mmu-context.c
@@ -51,9 +51,10 @@ void flush_tlb_page(struct vm_area_struct *vma, unsigned long addr)
51/* 51/*
52 * preemptively set a TLB entry 52 * preemptively set a TLB entry
53 */ 53 */
54void update_mmu_cache(struct vm_area_struct *vma, unsigned long addr, pte_t pte) 54void update_mmu_cache(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep)
55{ 55{
56 unsigned long pteu, ptel, cnx, flags; 56 unsigned long pteu, ptel, cnx, flags;
57 pte_t pte = *ptep;
57 58
58 addr &= PAGE_MASK; 59 addr &= PAGE_MASK;
59 ptel = pte_val(pte) & ~(xPTEL_UNUSED1 | xPTEL_UNUSED2); 60 ptel = pte_val(pte) & ~(xPTEL_UNUSED1 | xPTEL_UNUSED2);
diff --git a/arch/mn10300/unit-asb2305/pci-asb2305.c b/arch/mn10300/unit-asb2305/pci-asb2305.c
index 78cd134ddf7d..d6119b879a98 100644
--- a/arch/mn10300/unit-asb2305/pci-asb2305.c
+++ b/arch/mn10300/unit-asb2305/pci-asb2305.c
@@ -31,9 +31,11 @@
31 * but we want to try to avoid allocating at 0x2900-0x2bff 31 * but we want to try to avoid allocating at 0x2900-0x2bff
32 * which might have be mirrored at 0x0100-0x03ff.. 32 * which might have be mirrored at 0x0100-0x03ff..
33 */ 33 */
34void pcibios_align_resource(void *data, struct resource *res, 34resource_size_t pcibios_align_resource(void *data, const struct resource *res,
35 resource_size_t size, resource_size_t align) 35 resource_size_t size, resource_size_t align)
36{ 36{
37 resource_size_t start = res->start;
38
37#if 0 39#if 0
38 struct pci_dev *dev = data; 40 struct pci_dev *dev = data;
39 41
@@ -47,14 +49,10 @@ void pcibios_align_resource(void *data, struct resource *res,
47 ); 49 );
48#endif 50#endif
49 51
50 if (res->flags & IORESOURCE_IO) { 52 if ((res->flags & IORESOURCE_IO) && (start & 0x300))
51 unsigned long start = res->start; 53 start = (start + 0x3ff) & ~0x3ff;
52 54
53 if (start & 0x300) { 55 return start;
54 start = (start + 0x3ff) & ~0x3ff;
55 res->start = start;
56 }
57 }
58} 56}
59 57
60 58
diff --git a/arch/mn10300/unit-asb2305/pci.c b/arch/mn10300/unit-asb2305/pci.c
index 2cb7e75ba1c0..6d8720a0a599 100644
--- a/arch/mn10300/unit-asb2305/pci.c
+++ b/arch/mn10300/unit-asb2305/pci.c
@@ -331,12 +331,10 @@ static int __init pci_check_direct(void)
331static int __devinit is_valid_resource(struct pci_dev *dev, int idx) 331static int __devinit is_valid_resource(struct pci_dev *dev, int idx)
332{ 332{
333 unsigned int i, type_mask = IORESOURCE_IO | IORESOURCE_MEM; 333 unsigned int i, type_mask = IORESOURCE_IO | IORESOURCE_MEM;
334 struct resource *devr = &dev->resource[idx]; 334 struct resource *devr = &dev->resource[idx], *busr;
335 335
336 if (dev->bus) { 336 if (dev->bus) {
337 for (i = 0; i < PCI_BUS_NUM_RESOURCES; i++) { 337 pci_bus_for_each_resource(dev->bus, busr, i) {
338 struct resource *busr = dev->bus->resource[i];
339
340 if (!busr || (busr->flags ^ devr->flags) & type_mask) 338 if (!busr || (busr->flags ^ devr->flags) & type_mask)
341 continue; 339 continue;
342 340
diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig
index 524d9352f17e..f388dc68f605 100644
--- a/arch/parisc/Kconfig
+++ b/arch/parisc/Kconfig
@@ -18,7 +18,6 @@ config PARISC
18 select BUG 18 select BUG
19 select HAVE_PERF_EVENTS 19 select HAVE_PERF_EVENTS
20 select GENERIC_ATOMIC64 if !64BIT 20 select GENERIC_ATOMIC64 if !64BIT
21 select HAVE_ARCH_TRACEHOOK
22 help 21 help
23 The PA-RISC microprocessor is designed by Hewlett-Packard and used 22 The PA-RISC microprocessor is designed by Hewlett-Packard and used
24 in many of their workstations & servers (HP9000 700 and 800 series, 23 in many of their workstations & servers (HP9000 700 and 800 series,
diff --git a/arch/parisc/include/asm/cacheflush.h b/arch/parisc/include/asm/cacheflush.h
index 7a73b615c23d..477277739da5 100644
--- a/arch/parisc/include/asm/cacheflush.h
+++ b/arch/parisc/include/asm/cacheflush.h
@@ -38,6 +38,18 @@ void flush_cache_mm(struct mm_struct *mm);
38 38
39#define flush_kernel_dcache_range(start,size) \ 39#define flush_kernel_dcache_range(start,size) \
40 flush_kernel_dcache_range_asm((start), (start)+(size)); 40 flush_kernel_dcache_range_asm((start), (start)+(size));
41/* vmap range flushes and invalidates. Architecturally, we don't need
42 * the invalidate, because the CPU should refuse to speculate once an
43 * area has been flushed, so invalidate is left empty */
44static inline void flush_kernel_vmap_range(void *vaddr, int size)
45{
46 unsigned long start = (unsigned long)vaddr;
47
48 flush_kernel_dcache_range_asm(start, start + size);
49}
50static inline void invalidate_kernel_vmap_range(void *vaddr, int size)
51{
52}
41 53
42#define flush_cache_vmap(start, end) flush_cache_all() 54#define flush_cache_vmap(start, end) flush_cache_all()
43#define flush_cache_vunmap(start, end) flush_cache_all() 55#define flush_cache_vunmap(start, end) flush_cache_all()
diff --git a/arch/parisc/include/asm/pgtable.h b/arch/parisc/include/asm/pgtable.h
index a27d2e200fb2..01c15035e783 100644
--- a/arch/parisc/include/asm/pgtable.h
+++ b/arch/parisc/include/asm/pgtable.h
@@ -410,7 +410,7 @@ extern void paging_init (void);
410 410
411#define PG_dcache_dirty PG_arch_1 411#define PG_dcache_dirty PG_arch_1
412 412
413extern void update_mmu_cache(struct vm_area_struct *, unsigned long, pte_t); 413extern void update_mmu_cache(struct vm_area_struct *, unsigned long, pte_t *);
414 414
415/* Encode and de-code a swap entry */ 415/* Encode and de-code a swap entry */
416 416
diff --git a/arch/parisc/kernel/cache.c b/arch/parisc/kernel/cache.c
index b6ed34de14e1..1054baa2fc69 100644
--- a/arch/parisc/kernel/cache.c
+++ b/arch/parisc/kernel/cache.c
@@ -68,9 +68,9 @@ flush_cache_all_local(void)
68EXPORT_SYMBOL(flush_cache_all_local); 68EXPORT_SYMBOL(flush_cache_all_local);
69 69
70void 70void
71update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t pte) 71update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t *ptep)
72{ 72{
73 struct page *page = pte_page(pte); 73 struct page *page = pte_page(*ptep);
74 74
75 if (pfn_valid(page_to_pfn(page)) && page_mapping(page) && 75 if (pfn_valid(page_to_pfn(page)) && page_mapping(page) &&
76 test_bit(PG_dcache_dirty, &page->flags)) { 76 test_bit(PG_dcache_dirty, &page->flags)) {
diff --git a/arch/parisc/kernel/pci.c b/arch/parisc/kernel/pci.c
index f7064abc3bb6..38372e7cbb88 100644
--- a/arch/parisc/kernel/pci.c
+++ b/arch/parisc/kernel/pci.c
@@ -18,7 +18,6 @@
18 18
19#include <asm/io.h> 19#include <asm/io.h>
20#include <asm/system.h> 20#include <asm/system.h>
21#include <asm/cache.h> /* for L1_CACHE_BYTES */
22#include <asm/superio.h> 21#include <asm/superio.h>
23 22
24#define DEBUG_RESOURCES 0 23#define DEBUG_RESOURCES 0
@@ -123,6 +122,10 @@ static int __init pcibios_init(void)
123 } else { 122 } else {
124 printk(KERN_WARNING "pci_bios != NULL but init() is!\n"); 123 printk(KERN_WARNING "pci_bios != NULL but init() is!\n");
125 } 124 }
125
126 /* Set the CLS for PCI as early as possible. */
127 pci_cache_line_size = pci_dfl_cache_line_size;
128
126 return 0; 129 return 0;
127} 130}
128 131
@@ -171,7 +174,7 @@ void pcibios_set_master(struct pci_dev *dev)
171 ** upper byte is PCI_LATENCY_TIMER. 174 ** upper byte is PCI_LATENCY_TIMER.
172 */ 175 */
173 pci_write_config_word(dev, PCI_CACHE_LINE_SIZE, 176 pci_write_config_word(dev, PCI_CACHE_LINE_SIZE,
174 (0x80 << 8) | (L1_CACHE_BYTES / sizeof(u32))); 177 (0x80 << 8) | pci_cache_line_size);
175} 178}
176 179
177 180
@@ -254,10 +257,10 @@ EXPORT_SYMBOL(pcibios_bus_to_resource);
254 * Since we are just checking candidates, don't use any fields other 257 * Since we are just checking candidates, don't use any fields other
255 * than res->start. 258 * than res->start.
256 */ 259 */
257void pcibios_align_resource(void *data, struct resource *res, 260resource_size_t pcibios_align_resource(void *data, const struct resource *res,
258 resource_size_t size, resource_size_t alignment) 261 resource_size_t size, resource_size_t alignment)
259{ 262{
260 resource_size_t mask, align; 263 resource_size_t mask, align, start = res->start;
261 264
262 DBG_RES("pcibios_align_resource(%s, (%p) [%lx,%lx]/%x, 0x%lx, 0x%lx)\n", 265 DBG_RES("pcibios_align_resource(%s, (%p) [%lx,%lx]/%x, 0x%lx, 0x%lx)\n",
263 pci_name(((struct pci_dev *) data)), 266 pci_name(((struct pci_dev *) data)),
@@ -269,10 +272,10 @@ void pcibios_align_resource(void *data, struct resource *res,
269 272
270 /* Align to largest of MIN or input size */ 273 /* Align to largest of MIN or input size */
271 mask = max(alignment, align) - 1; 274 mask = max(alignment, align) - 1;
272 res->start += mask; 275 start += mask;
273 res->start &= ~mask; 276 start &= ~mask;
274 277
275 /* The caller updates the end field, we don't. */ 278 return start;
276} 279}
277 280
278 281
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index ba3948c70072..155d571f5e26 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -58,7 +58,7 @@ config IRQ_PER_CPU
58 58
59config NR_IRQS 59config NR_IRQS
60 int "Number of virtual interrupt numbers" 60 int "Number of virtual interrupt numbers"
61 range 32 512 61 range 32 32768
62 default "512" 62 default "512"
63 help 63 help
64 This defines the number of virtual interrupt numbers the kernel 64 This defines the number of virtual interrupt numbers the kernel
@@ -173,6 +173,7 @@ config PPC_OF
173 173
174config OF 174config OF
175 def_bool y 175 def_bool y
176 select OF_FLATTREE
176 177
177config PPC_UDBG_16550 178config PPC_UDBG_16550
178 bool 179 bool
@@ -240,6 +241,33 @@ config PPC_OF_PLATFORM_PCI
240config ARCH_SUPPORTS_DEBUG_PAGEALLOC 241config ARCH_SUPPORTS_DEBUG_PAGEALLOC
241 def_bool y 242 def_bool y
242 243
244config PPC_ADV_DEBUG_REGS
245 bool
246 depends on 40x || BOOKE
247 default y
248
249config PPC_ADV_DEBUG_IACS
250 int
251 depends on PPC_ADV_DEBUG_REGS
252 default 4 if 44x
253 default 2
254
255config PPC_ADV_DEBUG_DACS
256 int
257 depends on PPC_ADV_DEBUG_REGS
258 default 2
259
260config PPC_ADV_DEBUG_DVCS
261 int
262 depends on PPC_ADV_DEBUG_REGS
263 default 2 if 44x
264 default 0
265
266config PPC_ADV_DEBUG_DAC_RANGE
267 bool
268 depends on PPC_ADV_DEBUG_REGS && 44x
269 default y
270
243source "init/Kconfig" 271source "init/Kconfig"
244 272
245source "kernel/Kconfig.freezer" 273source "kernel/Kconfig.freezer"
diff --git a/arch/powerpc/boot/dts/arches.dts b/arch/powerpc/boot/dts/arches.dts
index 414ef8b7e575..30f41204acfa 100644
--- a/arch/powerpc/boot/dts/arches.dts
+++ b/arch/powerpc/boot/dts/arches.dts
@@ -60,6 +60,7 @@
60 d-cache-size = <32768>; 60 d-cache-size = <32768>;
61 dcr-controller; 61 dcr-controller;
62 dcr-access-method = "native"; 62 dcr-access-method = "native";
63 next-level-cache = <&L2C0>;
63 }; 64 };
64 }; 65 };
65 66
@@ -146,6 +147,13 @@
146 dcr-reg = <0x010 0x002>; 147 dcr-reg = <0x010 0x002>;
147 }; 148 };
148 149
150 CRYPTO: crypto@180000 {
151 compatible = "amcc,ppc460gt-crypto", "amcc,ppc4xx-crypto";
152 reg = <4 0x00180000 0x80400>;
153 interrupt-parent = <&UIC0>;
154 interrupts = <0x1d 0x4>;
155 };
156
149 MAL0: mcmal { 157 MAL0: mcmal {
150 compatible = "ibm,mcmal-460gt", "ibm,mcmal2"; 158 compatible = "ibm,mcmal-460gt", "ibm,mcmal2";
151 dcr-reg = <0x180 0x062>; 159 dcr-reg = <0x180 0x062>;
@@ -274,6 +282,7 @@
274 max-frame-size = <9000>; 282 max-frame-size = <9000>;
275 rx-fifo-size = <4096>; 283 rx-fifo-size = <4096>;
276 tx-fifo-size = <2048>; 284 tx-fifo-size = <2048>;
285 rx-fifo-size-gige = <16384>;
277 phy-mode = "sgmii"; 286 phy-mode = "sgmii";
278 phy-map = <0xffffffff>; 287 phy-map = <0xffffffff>;
279 gpcs-address = <0x0000000a>; 288 gpcs-address = <0x0000000a>;
@@ -302,6 +311,7 @@
302 max-frame-size = <9000>; 311 max-frame-size = <9000>;
303 rx-fifo-size = <4096>; 312 rx-fifo-size = <4096>;
304 tx-fifo-size = <2048>; 313 tx-fifo-size = <2048>;
314 rx-fifo-size-gige = <16384>;
305 phy-mode = "sgmii"; 315 phy-mode = "sgmii";
306 phy-map = <0x00000000>; 316 phy-map = <0x00000000>;
307 gpcs-address = <0x0000000b>; 317 gpcs-address = <0x0000000b>;
@@ -331,6 +341,8 @@
331 max-frame-size = <9000>; 341 max-frame-size = <9000>;
332 rx-fifo-size = <4096>; 342 rx-fifo-size = <4096>;
333 tx-fifo-size = <2048>; 343 tx-fifo-size = <2048>;
344 rx-fifo-size-gige = <16384>;
345 tx-fifo-size-gige = <16384>; /* emac2&3 only */
334 phy-mode = "sgmii"; 346 phy-mode = "sgmii";
335 phy-map = <0x00000001>; 347 phy-map = <0x00000001>;
336 gpcs-address = <0x0000000C>; 348 gpcs-address = <0x0000000C>;
diff --git a/arch/powerpc/boot/dts/gef_ppc9a.dts b/arch/powerpc/boot/dts/gef_ppc9a.dts
index c86114e93f1e..977f260d5e64 100644
--- a/arch/powerpc/boot/dts/gef_ppc9a.dts
+++ b/arch/powerpc/boot/dts/gef_ppc9a.dts
@@ -341,6 +341,22 @@
341 device_type = "open-pic"; 341 device_type = "open-pic";
342 }; 342 };
343 343
344 msi@41600 {
345 compatible = "fsl,mpc8641-msi", "fsl,mpic-msi";
346 reg = <0x41600 0x80>;
347 msi-available-ranges = <0 0x100>;
348 interrupts = <
349 0xe0 0
350 0xe1 0
351 0xe2 0
352 0xe3 0
353 0xe4 0
354 0xe5 0
355 0xe6 0
356 0xe7 0>;
357 interrupt-parent = <&mpic>;
358 };
359
344 global-utilities@e0000 { 360 global-utilities@e0000 {
345 compatible = "fsl,mpc8641-guts"; 361 compatible = "fsl,mpc8641-guts";
346 reg = <0xe0000 0x1000>; 362 reg = <0xe0000 0x1000>;
diff --git a/arch/powerpc/boot/dts/gef_sbc310.dts b/arch/powerpc/boot/dts/gef_sbc310.dts
index 820c2b355ab1..8e4efff3bda1 100644
--- a/arch/powerpc/boot/dts/gef_sbc310.dts
+++ b/arch/powerpc/boot/dts/gef_sbc310.dts
@@ -32,6 +32,7 @@
32 serial0 = &serial0; 32 serial0 = &serial0;
33 serial1 = &serial1; 33 serial1 = &serial1;
34 pci0 = &pci0; 34 pci0 = &pci0;
35 pci1 = &pci1;
35 }; 36 };
36 37
37 cpus { 38 cpus {
@@ -338,6 +339,22 @@
338 device_type = "open-pic"; 339 device_type = "open-pic";
339 }; 340 };
340 341
342 msi@41600 {
343 compatible = "fsl,mpc8641-msi", "fsl,mpic-msi";
344 reg = <0x41600 0x80>;
345 msi-available-ranges = <0 0x100>;
346 interrupts = <
347 0xe0 0
348 0xe1 0
349 0xe2 0
350 0xe3 0
351 0xe4 0
352 0xe5 0
353 0xe6 0
354 0xe7 0>;
355 interrupt-parent = <&mpic>;
356 };
357
341 global-utilities@e0000 { 358 global-utilities@e0000 {
342 compatible = "fsl,mpc8641-guts"; 359 compatible = "fsl,mpc8641-guts";
343 reg = <0xe0000 0x1000>; 360 reg = <0xe0000 0x1000>;
@@ -358,7 +375,7 @@
358 clock-frequency = <33333333>; 375 clock-frequency = <33333333>;
359 interrupt-parent = <&mpic>; 376 interrupt-parent = <&mpic>;
360 interrupts = <0x18 0x2>; 377 interrupts = <0x18 0x2>;
361 interrupt-map-mask = <0xf800 0x0 0x0 0x7>; 378 interrupt-map-mask = <0xff00 0x0 0x0 0x7>;
362 interrupt-map = < 379 interrupt-map = <
363 0x0000 0x0 0x0 0x1 &mpic 0x0 0x2 380 0x0000 0x0 0x0 0x1 &mpic 0x0 0x2
364 0x0000 0x0 0x0 0x2 &mpic 0x1 0x2 381 0x0000 0x0 0x0 0x2 &mpic 0x1 0x2
diff --git a/arch/powerpc/boot/dts/gef_sbc610.dts b/arch/powerpc/boot/dts/gef_sbc610.dts
index 30911adefc8e..bb7060078fb4 100644
--- a/arch/powerpc/boot/dts/gef_sbc610.dts
+++ b/arch/powerpc/boot/dts/gef_sbc610.dts
@@ -75,14 +75,48 @@
75 interrupts = <19 2>; 75 interrupts = <19 2>;
76 interrupt-parent = <&mpic>; 76 interrupt-parent = <&mpic>;
77 77
78 ranges = <0 0 0xff000000 0x01000000 // 16MB Boot flash 78 ranges = <0 0 0xff000000 0x01000000 // 16MB Boot flash
79 1 0 0xe8000000 0x08000000 // Paged Flash 0 79 1 0 0xe8000000 0x08000000 // Paged Flash 0
80 2 0 0xe0000000 0x08000000 // Paged Flash 1 80 2 0 0xe0000000 0x08000000 // Paged Flash 1
81 3 0 0xfc100000 0x00020000 // NVRAM 81 3 0 0xfc100000 0x00020000 // NVRAM
82 4 0 0xfc000000 0x00008000 // FPGA 82 4 0 0xfc000000 0x00008000 // FPGA
83 5 0 0xfc008000 0x00008000 // AFIX FPGA 83 5 0 0xfc008000 0x00008000 // AFIX FPGA
84 6 0 0xfd000000 0x00800000 // IO FPGA (8-bit) 84 6 0 0xfd000000 0x00800000 // IO FPGA (8-bit)
85 7 0 0xfd800000 0x00800000>; // IO FPGA (32-bit) 85 7 0 0xfd800000 0x00800000>; // IO FPGA (32-bit)
86
87 /* flash@0,0 is a mirror of part of the memory in flash@1,0
88 flash@0,0 {
89 compatible = "gef,sbc610-firmware-mirror", "cfi-flash";
90 reg = <0x0 0x0 0x1000000>;
91 bank-width = <4>;
92 device-width = <2>;
93 #address-cells = <1>;
94 #size-cells = <1>;
95 partition@0 {
96 label = "firmware";
97 reg = <0x0 0x1000000>;
98 read-only;
99 };
100 };
101 */
102
103 flash@1,0 {
104 compatible = "gef,sbc610-paged-flash", "cfi-flash";
105 reg = <0x1 0x0 0x8000000>;
106 bank-width = <4>;
107 device-width = <2>;
108 #address-cells = <1>;
109 #size-cells = <1>;
110 partition@0 {
111 label = "user";
112 reg = <0x0 0x7800000>;
113 };
114 partition@7800000 {
115 label = "firmware";
116 reg = <0x7800000 0x800000>;
117 read-only;
118 };
119 };
86 120
87 nvram@3,0 { 121 nvram@3,0 {
88 device_type = "nvram"; 122 device_type = "nvram";
@@ -305,6 +339,22 @@
305 device_type = "open-pic"; 339 device_type = "open-pic";
306 }; 340 };
307 341
342 msi@41600 {
343 compatible = "fsl,mpc8641-msi", "fsl,mpic-msi";
344 reg = <0x41600 0x80>;
345 msi-available-ranges = <0 0x100>;
346 interrupts = <
347 0xe0 0
348 0xe1 0
349 0xe2 0
350 0xe3 0
351 0xe4 0
352 0xe5 0
353 0xe6 0
354 0xe7 0>;
355 interrupt-parent = <&mpic>;
356 };
357
308 global-utilities@e0000 { 358 global-utilities@e0000 {
309 compatible = "fsl,mpc8641-guts"; 359 compatible = "fsl,mpc8641-guts";
310 reg = <0xe0000 0x1000>; 360 reg = <0xe0000 0x1000>;
diff --git a/arch/powerpc/boot/dts/glacier.dts b/arch/powerpc/boot/dts/glacier.dts
index f6f618939293..d62a4fb6f93c 100644
--- a/arch/powerpc/boot/dts/glacier.dts
+++ b/arch/powerpc/boot/dts/glacier.dts
@@ -1,7 +1,7 @@
1/* 1/*
2 * Device Tree Source for AMCC Glacier (460GT) 2 * Device Tree Source for AMCC Glacier (460GT)
3 * 3 *
4 * Copyright 2008 DENX Software Engineering, Stefan Roese <sr@denx.de> 4 * Copyright 2008-2010 DENX Software Engineering, Stefan Roese <sr@denx.de>
5 * 5 *
6 * This file is licensed under the terms of the GNU General Public 6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without 7 * License version 2. This program is licensed "as is" without
@@ -42,6 +42,7 @@
42 d-cache-size = <32768>; 42 d-cache-size = <32768>;
43 dcr-controller; 43 dcr-controller;
44 dcr-access-method = "native"; 44 dcr-access-method = "native";
45 next-level-cache = <&L2C0>;
45 }; 46 };
46 }; 47 };
47 48
@@ -106,6 +107,16 @@
106 dcr-reg = <0x00c 0x002>; 107 dcr-reg = <0x00c 0x002>;
107 }; 108 };
108 109
110 L2C0: l2c {
111 compatible = "ibm,l2-cache-460gt", "ibm,l2-cache";
112 dcr-reg = <0x020 0x008 /* Internal SRAM DCR's */
113 0x030 0x008>; /* L2 cache DCR's */
114 cache-line-size = <32>; /* 32 bytes */
115 cache-size = <262144>; /* L2, 256K */
116 interrupt-parent = <&UIC1>;
117 interrupts = <11 1>;
118 };
119
109 plb { 120 plb {
110 compatible = "ibm,plb-460gt", "ibm,plb4"; 121 compatible = "ibm,plb-460gt", "ibm,plb4";
111 #address-cells = <2>; 122 #address-cells = <2>;
@@ -118,6 +129,13 @@
118 dcr-reg = <0x010 0x002>; 129 dcr-reg = <0x010 0x002>;
119 }; 130 };
120 131
132 CRYPTO: crypto@180000 {
133 compatible = "amcc,ppc460gt-crypto", "amcc,ppc4xx-crypto";
134 reg = <4 0x00180000 0x80400>;
135 interrupt-parent = <&UIC0>;
136 interrupts = <0x1d 0x4>;
137 };
138
121 MAL0: mcmal { 139 MAL0: mcmal {
122 compatible = "ibm,mcmal-460gt", "ibm,mcmal2"; 140 compatible = "ibm,mcmal-460gt", "ibm,mcmal2";
123 dcr-reg = <0x180 0x062>; 141 dcr-reg = <0x180 0x062>;
@@ -186,6 +204,29 @@
186 reg = <0x03fa0000 0x00060000>; 204 reg = <0x03fa0000 0x00060000>;
187 }; 205 };
188 }; 206 };
207
208 ndfc@3,0 {
209 compatible = "ibm,ndfc";
210 reg = <0x00000003 0x00000000 0x00002000>;
211 ccr = <0x00001000>;
212 bank-settings = <0x80002222>;
213 #address-cells = <1>;
214 #size-cells = <1>;
215
216 nand {
217 #address-cells = <1>;
218 #size-cells = <1>;
219
220 partition@0 {
221 label = "u-boot";
222 reg = <0x00000000 0x00100000>;
223 };
224 partition@100000 {
225 label = "user";
226 reg = <0x00000000 0x03f00000>;
227 };
228 };
229 };
189 }; 230 };
190 231
191 UART0: serial@ef600300 { 232 UART0: serial@ef600300 {
@@ -237,6 +278,20 @@
237 reg = <0xef600700 0x00000014>; 278 reg = <0xef600700 0x00000014>;
238 interrupt-parent = <&UIC0>; 279 interrupt-parent = <&UIC0>;
239 interrupts = <0x2 0x4>; 280 interrupts = <0x2 0x4>;
281 #address-cells = <1>;
282 #size-cells = <0>;
283 rtc@68 {
284 compatible = "stm,m41t80";
285 reg = <0x68>;
286 interrupt-parent = <&UIC2>;
287 interrupts = <0x19 0x8>;
288 };
289 sttm@48 {
290 compatible = "ad,ad7414";
291 reg = <0x48>;
292 interrupt-parent = <&UIC1>;
293 interrupts = <0x14 0x8>;
294 };
240 }; 295 };
241 296
242 IIC1: i2c@ef600800 { 297 IIC1: i2c@ef600800 {
@@ -275,7 +330,7 @@
275 330
276 EMAC0: ethernet@ef600e00 { 331 EMAC0: ethernet@ef600e00 {
277 device_type = "network"; 332 device_type = "network";
278 compatible = "ibm,emac-460gt", "ibm,emac4"; 333 compatible = "ibm,emac-460gt", "ibm,emac4sync";
279 interrupt-parent = <&EMAC0>; 334 interrupt-parent = <&EMAC0>;
280 interrupts = <0x0 0x1>; 335 interrupts = <0x0 0x1>;
281 #interrupt-cells = <1>; 336 #interrupt-cells = <1>;
@@ -283,7 +338,7 @@
283 #size-cells = <0>; 338 #size-cells = <0>;
284 interrupt-map = </*Status*/ 0x0 &UIC2 0x10 0x4 339 interrupt-map = </*Status*/ 0x0 &UIC2 0x10 0x4
285 /*Wake*/ 0x1 &UIC2 0x14 0x4>; 340 /*Wake*/ 0x1 &UIC2 0x14 0x4>;
286 reg = <0xef600e00 0x00000074>; 341 reg = <0xef600e00 0x000000c4>;
287 local-mac-address = [000000000000]; /* Filled in by U-Boot */ 342 local-mac-address = [000000000000]; /* Filled in by U-Boot */
288 mal-device = <&MAL0>; 343 mal-device = <&MAL0>;
289 mal-tx-channel = <0>; 344 mal-tx-channel = <0>;
@@ -305,7 +360,7 @@
305 360
306 EMAC1: ethernet@ef600f00 { 361 EMAC1: ethernet@ef600f00 {
307 device_type = "network"; 362 device_type = "network";
308 compatible = "ibm,emac-460gt", "ibm,emac4"; 363 compatible = "ibm,emac-460gt", "ibm,emac4sync";
309 interrupt-parent = <&EMAC1>; 364 interrupt-parent = <&EMAC1>;
310 interrupts = <0x0 0x1>; 365 interrupts = <0x0 0x1>;
311 #interrupt-cells = <1>; 366 #interrupt-cells = <1>;
@@ -313,7 +368,7 @@
313 #size-cells = <0>; 368 #size-cells = <0>;
314 interrupt-map = </*Status*/ 0x0 &UIC2 0x11 0x4 369 interrupt-map = </*Status*/ 0x0 &UIC2 0x11 0x4
315 /*Wake*/ 0x1 &UIC2 0x15 0x4>; 370 /*Wake*/ 0x1 &UIC2 0x15 0x4>;
316 reg = <0xef600f00 0x00000074>; 371 reg = <0xef600f00 0x000000c4>;
317 local-mac-address = [000000000000]; /* Filled in by U-Boot */ 372 local-mac-address = [000000000000]; /* Filled in by U-Boot */
318 mal-device = <&MAL0>; 373 mal-device = <&MAL0>;
319 mal-tx-channel = <1>; 374 mal-tx-channel = <1>;
@@ -336,7 +391,7 @@
336 391
337 EMAC2: ethernet@ef601100 { 392 EMAC2: ethernet@ef601100 {
338 device_type = "network"; 393 device_type = "network";
339 compatible = "ibm,emac-460gt", "ibm,emac4"; 394 compatible = "ibm,emac-460gt", "ibm,emac4sync";
340 interrupt-parent = <&EMAC2>; 395 interrupt-parent = <&EMAC2>;
341 interrupts = <0x0 0x1>; 396 interrupts = <0x0 0x1>;
342 #interrupt-cells = <1>; 397 #interrupt-cells = <1>;
@@ -344,7 +399,7 @@
344 #size-cells = <0>; 399 #size-cells = <0>;
345 interrupt-map = </*Status*/ 0x0 &UIC2 0x12 0x4 400 interrupt-map = </*Status*/ 0x0 &UIC2 0x12 0x4
346 /*Wake*/ 0x1 &UIC2 0x16 0x4>; 401 /*Wake*/ 0x1 &UIC2 0x16 0x4>;
347 reg = <0xef601100 0x00000074>; 402 reg = <0xef601100 0x000000c4>;
348 local-mac-address = [000000000000]; /* Filled in by U-Boot */ 403 local-mac-address = [000000000000]; /* Filled in by U-Boot */
349 mal-device = <&MAL0>; 404 mal-device = <&MAL0>;
350 mal-tx-channel = <2>; 405 mal-tx-channel = <2>;
@@ -366,7 +421,7 @@
366 421
367 EMAC3: ethernet@ef601200 { 422 EMAC3: ethernet@ef601200 {
368 device_type = "network"; 423 device_type = "network";
369 compatible = "ibm,emac-460gt", "ibm,emac4"; 424 compatible = "ibm,emac-460gt", "ibm,emac4sync";
370 interrupt-parent = <&EMAC3>; 425 interrupt-parent = <&EMAC3>;
371 interrupts = <0x0 0x1>; 426 interrupts = <0x0 0x1>;
372 #interrupt-cells = <1>; 427 #interrupt-cells = <1>;
@@ -374,7 +429,7 @@
374 #size-cells = <0>; 429 #size-cells = <0>;
375 interrupt-map = </*Status*/ 0x0 &UIC2 0x13 0x4 430 interrupt-map = </*Status*/ 0x0 &UIC2 0x13 0x4
376 /*Wake*/ 0x1 &UIC2 0x17 0x4>; 431 /*Wake*/ 0x1 &UIC2 0x17 0x4>;
377 reg = <0xef601200 0x00000074>; 432 reg = <0xef601200 0x000000c4>;
378 local-mac-address = [000000000000]; /* Filled in by U-Boot */ 433 local-mac-address = [000000000000]; /* Filled in by U-Boot */
379 mal-device = <&MAL0>; 434 mal-device = <&MAL0>;
380 mal-tx-channel = <3>; 435 mal-tx-channel = <3>;
@@ -414,6 +469,7 @@
414 * later cannot be changed 469 * later cannot be changed
415 */ 470 */
416 ranges = <0x02000000 0x00000000 0x80000000 0x0000000d 0x80000000 0x00000000 0x80000000 471 ranges = <0x02000000 0x00000000 0x80000000 0x0000000d 0x80000000 0x00000000 0x80000000
472 0x02000000 0x00000000 0x00000000 0x0000000c 0x0ee00000 0x00000000 0x00100000
417 0x01000000 0x00000000 0x00000000 0x0000000c 0x08000000 0x00000000 0x00010000>; 473 0x01000000 0x00000000 0x00000000 0x0000000c 0x08000000 0x00000000 0x00010000>;
418 474
419 /* Inbound 2GB range starting at 0 */ 475 /* Inbound 2GB range starting at 0 */
@@ -444,6 +500,7 @@
444 * later cannot be changed 500 * later cannot be changed
445 */ 501 */
446 ranges = <0x02000000 0x00000000 0x80000000 0x0000000e 0x00000000 0x00000000 0x80000000 502 ranges = <0x02000000 0x00000000 0x80000000 0x0000000e 0x00000000 0x00000000 0x80000000
503 0x02000000 0x00000000 0x00000000 0x0000000f 0x00000000 0x00000000 0x00100000
447 0x01000000 0x00000000 0x00000000 0x0000000f 0x80000000 0x00000000 0x00010000>; 504 0x01000000 0x00000000 0x00000000 0x0000000f 0x80000000 0x00000000 0x00010000>;
448 505
449 /* Inbound 2GB range starting at 0 */ 506 /* Inbound 2GB range starting at 0 */
@@ -485,6 +542,7 @@
485 * later cannot be changed 542 * later cannot be changed
486 */ 543 */
487 ranges = <0x02000000 0x00000000 0x80000000 0x0000000e 0x80000000 0x00000000 0x80000000 544 ranges = <0x02000000 0x00000000 0x80000000 0x0000000e 0x80000000 0x00000000 0x80000000
545 0x02000000 0x00000000 0x00000000 0x0000000f 0x00100000 0x00000000 0x00100000
488 0x01000000 0x00000000 0x00000000 0x0000000f 0x80010000 0x00000000 0x00010000>; 546 0x01000000 0x00000000 0x00000000 0x0000000f 0x80010000 0x00000000 0x00010000>;
489 547
490 /* Inbound 2GB range starting at 0 */ 548 /* Inbound 2GB range starting at 0 */
diff --git a/arch/powerpc/boot/dts/katmai.dts b/arch/powerpc/boot/dts/katmai.dts
index 8f345de960cd..8cf2c0c88c05 100644
--- a/arch/powerpc/boot/dts/katmai.dts
+++ b/arch/powerpc/boot/dts/katmai.dts
@@ -156,7 +156,7 @@
156 compatible = "ibm,opb-440spe", "ibm,opb-440gp", "ibm,opb"; 156 compatible = "ibm,opb-440spe", "ibm,opb-440gp", "ibm,opb";
157 #address-cells = <1>; 157 #address-cells = <1>;
158 #size-cells = <1>; 158 #size-cells = <1>;
159 ranges = <0x00000000 0x00000004 0xe0000000 0x20000000>; 159 ranges = <0xe0000000 0x00000004 0xe0000000 0x20000000>;
160 clock-frequency = <0>; /* Filled in by zImage */ 160 clock-frequency = <0>; /* Filled in by zImage */
161 161
162 EBC0: ebc { 162 EBC0: ebc {
@@ -165,14 +165,47 @@
165 #address-cells = <2>; 165 #address-cells = <2>;
166 #size-cells = <1>; 166 #size-cells = <1>;
167 clock-frequency = <0>; /* Filled in by zImage */ 167 clock-frequency = <0>; /* Filled in by zImage */
168 /* ranges property is supplied by U-Boot */
168 interrupts = <0x5 0x1>; 169 interrupts = <0x5 0x1>;
169 interrupt-parent = <&UIC1>; 170 interrupt-parent = <&UIC1>;
171
172 nor_flash@0,0 {
173 compatible = "cfi-flash";
174 bank-width = <2>;
175 reg = <0x00000000 0x00000000 0x01000000>;
176 #address-cells = <1>;
177 #size-cells = <1>;
178 partition@0 {
179 label = "kernel";
180 reg = <0x00000000 0x001e0000>;
181 };
182 partition@1e0000 {
183 label = "dtb";
184 reg = <0x001e0000 0x00020000>;
185 };
186 partition@200000 {
187 label = "root";
188 reg = <0x00200000 0x00200000>;
189 };
190 partition@400000 {
191 label = "user";
192 reg = <0x00400000 0x00b60000>;
193 };
194 partition@f60000 {
195 label = "env";
196 reg = <0x00f60000 0x00040000>;
197 };
198 partition@fa0000 {
199 label = "u-boot";
200 reg = <0x00fa0000 0x00060000>;
201 };
202 };
170 }; 203 };
171 204
172 UART0: serial@10000200 { 205 UART0: serial@f0000200 {
173 device_type = "serial"; 206 device_type = "serial";
174 compatible = "ns16550"; 207 compatible = "ns16550";
175 reg = <0x10000200 0x00000008>; 208 reg = <0xf0000200 0x00000008>;
176 virtual-reg = <0xa0000200>; 209 virtual-reg = <0xa0000200>;
177 clock-frequency = <0>; /* Filled in by zImage */ 210 clock-frequency = <0>; /* Filled in by zImage */
178 current-speed = <115200>; 211 current-speed = <115200>;
@@ -180,10 +213,10 @@
180 interrupts = <0x0 0x4>; 213 interrupts = <0x0 0x4>;
181 }; 214 };
182 215
183 UART1: serial@10000300 { 216 UART1: serial@f0000300 {
184 device_type = "serial"; 217 device_type = "serial";
185 compatible = "ns16550"; 218 compatible = "ns16550";
186 reg = <0x10000300 0x00000008>; 219 reg = <0xf0000300 0x00000008>;
187 virtual-reg = <0xa0000300>; 220 virtual-reg = <0xa0000300>;
188 clock-frequency = <0>; 221 clock-frequency = <0>;
189 current-speed = <0>; 222 current-speed = <0>;
@@ -192,10 +225,10 @@
192 }; 225 };
193 226
194 227
195 UART2: serial@10000600 { 228 UART2: serial@f0000600 {
196 device_type = "serial"; 229 device_type = "serial";
197 compatible = "ns16550"; 230 compatible = "ns16550";
198 reg = <0x10000600 0x00000008>; 231 reg = <0xf0000600 0x00000008>;
199 virtual-reg = <0xa0000600>; 232 virtual-reg = <0xa0000600>;
200 clock-frequency = <0>; 233 clock-frequency = <0>;
201 current-speed = <0>; 234 current-speed = <0>;
@@ -203,27 +236,27 @@
203 interrupts = <0x5 0x4>; 236 interrupts = <0x5 0x4>;
204 }; 237 };
205 238
206 IIC0: i2c@10000400 { 239 IIC0: i2c@f0000400 {
207 compatible = "ibm,iic-440spe", "ibm,iic-440gp", "ibm,iic"; 240 compatible = "ibm,iic-440spe", "ibm,iic-440gp", "ibm,iic";
208 reg = <0x10000400 0x00000014>; 241 reg = <0xf0000400 0x00000014>;
209 interrupt-parent = <&UIC0>; 242 interrupt-parent = <&UIC0>;
210 interrupts = <0x2 0x4>; 243 interrupts = <0x2 0x4>;
211 }; 244 };
212 245
213 IIC1: i2c@10000500 { 246 IIC1: i2c@f0000500 {
214 compatible = "ibm,iic-440spe", "ibm,iic-440gp", "ibm,iic"; 247 compatible = "ibm,iic-440spe", "ibm,iic-440gp", "ibm,iic";
215 reg = <0x10000500 0x00000014>; 248 reg = <0xf0000500 0x00000014>;
216 interrupt-parent = <&UIC0>; 249 interrupt-parent = <&UIC0>;
217 interrupts = <0x3 0x4>; 250 interrupts = <0x3 0x4>;
218 }; 251 };
219 252
220 EMAC0: ethernet@10000800 { 253 EMAC0: ethernet@f0000800 {
221 linux,network-index = <0x0>; 254 linux,network-index = <0x0>;
222 device_type = "network"; 255 device_type = "network";
223 compatible = "ibm,emac-440spe", "ibm,emac4"; 256 compatible = "ibm,emac-440spe", "ibm,emac4";
224 interrupt-parent = <&UIC1>; 257 interrupt-parent = <&UIC1>;
225 interrupts = <0x1c 0x4 0x1d 0x4>; 258 interrupts = <0x1c 0x4 0x1d 0x4>;
226 reg = <0x10000800 0x00000074>; 259 reg = <0xf0000800 0x00000074>;
227 local-mac-address = [000000000000]; 260 local-mac-address = [000000000000];
228 mal-device = <&MAL0>; 261 mal-device = <&MAL0>;
229 mal-tx-channel = <0>; 262 mal-tx-channel = <0>;
@@ -248,11 +281,11 @@
248 primary; 281 primary;
249 large-inbound-windows; 282 large-inbound-windows;
250 enable-msi-hole; 283 enable-msi-hole;
251 reg = <0x0000000c 0x0ec00000 0x00000008 /* Config space access */ 284 reg = <0x0000000c 0x0ec00000 0x00000008 /* Config space access */
252 0x00000000 0x00000000 0x00000000 /* no IACK cycles */ 285 0x00000000 0x00000000 0x00000000 /* no IACK cycles */
253 0x0000000c 0x0ed00000 0x00000004 /* Special cycles */ 286 0x0000000c 0x0ed00000 0x00000004 /* Special cycles */
254 0x0000000c 0x0ec80000 0x00000100 /* Internal registers */ 287 0x0000000c 0x0ec80000 0x00000100 /* Internal registers */
255 0x0000000c 0x0ec80100 0x000000fc>; /* Internal messaging registers */ 288 0x0000000c 0x0ec80100 0x000000fc>; /* Internal messaging registers */
256 289
257 /* Outbound ranges, one memory and one IO, 290 /* Outbound ranges, one memory and one IO,
258 * later cannot be changed 291 * later cannot be changed
@@ -453,6 +486,6 @@
453 }; 486 };
454 487
455 chosen { 488 chosen {
456 linux,stdout-path = "/plb/opb/serial@10000200"; 489 linux,stdout-path = "/plb/opb/serial@f0000200";
457 }; 490 };
458}; 491};
diff --git a/arch/powerpc/boot/dts/mpc5121ads.dts b/arch/powerpc/boot/dts/mpc5121ads.dts
index c353dac33416..c9ef6bbe26cf 100644
--- a/arch/powerpc/boot/dts/mpc5121ads.dts
+++ b/arch/powerpc/boot/dts/mpc5121ads.dts
@@ -62,17 +62,12 @@
62 interrupt-parent = < &ipic >; 62 interrupt-parent = < &ipic >;
63 #address-cells = <1>; 63 #address-cells = <1>;
64 #size-cells = <1>; 64 #size-cells = <1>;
65 bank-width = <1>;
66 // ADS has two Hynix 512MB Nand flash chips in a single 65 // ADS has two Hynix 512MB Nand flash chips in a single
67 // stacked package . 66 // stacked package.
68 chips = <2>; 67 chips = <2>;
69 nand0@0 { 68 nand@0 {
70 label = "nand0"; 69 label = "nand";
71 reg = <0x00000000 0x02000000>; // first 32 MB of chip 0 70 reg = <0x00000000 0x40000000>; // 512MB + 512MB
72 };
73 nand1@20000000 {
74 label = "nand1";
75 reg = <0x20000000 0x02000000>; // first 32 MB of chip 1
76 }; 71 };
77 }; 72 };
78 73
@@ -166,6 +161,11 @@
166 interrupt-parent = < &ipic >; 161 interrupt-parent = < &ipic >;
167 }; 162 };
168 163
164 reset@e00 { // Reset module
165 compatible = "fsl,mpc5121-reset";
166 reg = <0xe00 0x100>;
167 };
168
169 clock@f00 { // Clock control 169 clock@f00 { // Clock control
170 compatible = "fsl,mpc5121-clock"; 170 compatible = "fsl,mpc5121-clock";
171 reg = <0xf00 0x100>; 171 reg = <0xf00 0x100>;
@@ -185,17 +185,15 @@
185 interrupt-parent = < &ipic >; 185 interrupt-parent = < &ipic >;
186 }; 186 };
187 187
188 mscan@1300 { 188 can@1300 {
189 compatible = "fsl,mpc5121-mscan"; 189 compatible = "fsl,mpc5121-mscan";
190 cell-index = <0>;
191 interrupts = <12 0x8>; 190 interrupts = <12 0x8>;
192 interrupt-parent = < &ipic >; 191 interrupt-parent = < &ipic >;
193 reg = <0x1300 0x80>; 192 reg = <0x1300 0x80>;
194 }; 193 };
195 194
196 mscan@1380 { 195 can@1380 {
197 compatible = "fsl,mpc5121-mscan"; 196 compatible = "fsl,mpc5121-mscan";
198 cell-index = <1>;
199 interrupts = <13 0x8>; 197 interrupts = <13 0x8>;
200 interrupt-parent = < &ipic >; 198 interrupt-parent = < &ipic >;
201 reg = <0x1380 0x80>; 199 reg = <0x1380 0x80>;
@@ -205,17 +203,31 @@
205 #address-cells = <1>; 203 #address-cells = <1>;
206 #size-cells = <0>; 204 #size-cells = <0>;
207 compatible = "fsl,mpc5121-i2c", "fsl-i2c"; 205 compatible = "fsl,mpc5121-i2c", "fsl-i2c";
208 cell-index = <0>;
209 reg = <0x1700 0x20>; 206 reg = <0x1700 0x20>;
210 interrupts = <9 0x8>; 207 interrupts = <9 0x8>;
211 interrupt-parent = < &ipic >; 208 interrupt-parent = < &ipic >;
209 fsl,preserve-clocking;
210
211 hwmon@4a {
212 compatible = "adi,ad7414";
213 reg = <0x4a>;
214 };
215
216 eeprom@50 {
217 compatible = "at,24c32";
218 reg = <0x50>;
219 };
220
221 rtc@68 {
222 compatible = "stm,m41t62";
223 reg = <0x68>;
224 };
212 }; 225 };
213 226
214 i2c@1720 { 227 i2c@1720 {
215 #address-cells = <1>; 228 #address-cells = <1>;
216 #size-cells = <0>; 229 #size-cells = <0>;
217 compatible = "fsl,mpc5121-i2c", "fsl-i2c"; 230 compatible = "fsl,mpc5121-i2c", "fsl-i2c";
218 cell-index = <1>;
219 reg = <0x1720 0x20>; 231 reg = <0x1720 0x20>;
220 interrupts = <10 0x8>; 232 interrupts = <10 0x8>;
221 interrupt-parent = < &ipic >; 233 interrupt-parent = < &ipic >;
@@ -225,7 +237,6 @@
225 #address-cells = <1>; 237 #address-cells = <1>;
226 #size-cells = <0>; 238 #size-cells = <0>;
227 compatible = "fsl,mpc5121-i2c", "fsl-i2c"; 239 compatible = "fsl,mpc5121-i2c", "fsl-i2c";
228 cell-index = <2>;
229 reg = <0x1740 0x20>; 240 reg = <0x1740 0x20>;
230 interrupts = <11 0x8>; 241 interrupts = <11 0x8>;
231 interrupt-parent = < &ipic >; 242 interrupt-parent = < &ipic >;
@@ -244,7 +255,7 @@
244 }; 255 };
245 256
246 display@2100 { 257 display@2100 {
247 compatible = "fsl,mpc5121-diu", "fsl-diu"; 258 compatible = "fsl,mpc5121-diu";
248 reg = <0x2100 0x100>; 259 reg = <0x2100 0x100>;
249 interrupts = <64 0x8>; 260 interrupts = <64 0x8>;
250 interrupt-parent = < &ipic >; 261 interrupt-parent = < &ipic >;
@@ -277,7 +288,7 @@
277 288
278 // USB1 using external ULPI PHY 289 // USB1 using external ULPI PHY
279 //usb@3000 { 290 //usb@3000 {
280 // compatible = "fsl,mpc5121-usb2-dr", "fsl-usb2-dr"; 291 // compatible = "fsl,mpc5121-usb2-dr";
281 // reg = <0x3000 0x1000>; 292 // reg = <0x3000 0x1000>;
282 // #address-cells = <1>; 293 // #address-cells = <1>;
283 // #size-cells = <0>; 294 // #size-cells = <0>;
@@ -285,12 +296,11 @@
285 // interrupts = <43 0x8>; 296 // interrupts = <43 0x8>;
286 // dr_mode = "otg"; 297 // dr_mode = "otg";
287 // phy_type = "ulpi"; 298 // phy_type = "ulpi";
288 // port1;
289 //}; 299 //};
290 300
291 // USB0 using internal UTMI PHY 301 // USB0 using internal UTMI PHY
292 usb@4000 { 302 usb@4000 {
293 compatible = "fsl,mpc5121-usb2-dr", "fsl-usb2-dr"; 303 compatible = "fsl,mpc5121-usb2-dr";
294 reg = <0x4000 0x1000>; 304 reg = <0x4000 0x1000>;
295 #address-cells = <1>; 305 #address-cells = <1>;
296 #size-cells = <0>; 306 #size-cells = <0>;
@@ -298,7 +308,8 @@
298 interrupts = <44 0x8>; 308 interrupts = <44 0x8>;
299 dr_mode = "otg"; 309 dr_mode = "otg";
300 phy_type = "utmi_wide"; 310 phy_type = "utmi_wide";
301 port0; 311 fsl,invert-drvvbus;
312 fsl,invert-pwr-fault;
302 }; 313 };
303 314
304 // IO control 315 // IO control
@@ -365,7 +376,7 @@
365 }; 376 };
366 377
367 dma@14000 { 378 dma@14000 {
368 compatible = "fsl,mpc5121-dma2"; 379 compatible = "fsl,mpc5121-dma";
369 reg = <0x14000 0x1800>; 380 reg = <0x14000 0x1800>;
370 interrupts = <65 0x8>; 381 interrupts = <65 0x8>;
371 interrupt-parent = < &ipic >; 382 interrupt-parent = < &ipic >;
diff --git a/arch/powerpc/boot/dts/mpc8568mds.dts b/arch/powerpc/boot/dts/mpc8568mds.dts
index 6d892ba74e55..92fb17876e7d 100644
--- a/arch/powerpc/boot/dts/mpc8568mds.dts
+++ b/arch/powerpc/boot/dts/mpc8568mds.dts
@@ -54,9 +54,52 @@
54 reg = <0x0 0x10000000>; 54 reg = <0x0 0x10000000>;
55 }; 55 };
56 56
57 bcsr@f8000000 { 57 localbus@e0005000 {
58 compatible = "fsl,mpc8568mds-bcsr"; 58 #address-cells = <2>;
59 reg = <0xf8000000 0x8000>; 59 #size-cells = <1>;
60 compatible = "fsl,mpc8568-localbus", "fsl,pq3-localbus",
61 "simple-bus";
62 reg = <0xe0005000 0x1000>;
63
64 ranges = <0x0 0x0 0xfe000000 0x02000000
65 0x1 0x0 0xf8000000 0x00008000
66 0x2 0x0 0xf0000000 0x04000000
67 0x4 0x0 0xf8008000 0x00008000
68 0x5 0x0 0xf8010000 0x00008000>;
69
70 nor@0,0 {
71 #address-cells = <1>;
72 #size-cells = <1>;
73 compatible = "cfi-flash";
74 reg = <0x0 0x0 0x02000000>;
75 bank-width = <2>;
76 device-width = <2>;
77 };
78
79 bcsr@1,0 {
80 #address-cells = <1>;
81 #size-cells = <1>;
82 compatible = "fsl,mpc8568mds-bcsr";
83 reg = <1 0 0x8000>;
84 ranges = <0 1 0 0x8000>;
85
86 bcsr5: gpio-controller@11 {
87 #gpio-cells = <2>;
88 compatible = "fsl,mpc8568mds-bcsr-gpio";
89 reg = <0x5 0x1>;
90 gpio-controller;
91 };
92 };
93
94 pib@4,0 {
95 compatible = "fsl,mpc8568mds-pib";
96 reg = <4 0 0x8000>;
97 };
98
99 pib@5,0 {
100 compatible = "fsl,mpc8568mds-pib";
101 reg = <5 0 0x8000>;
102 };
60 }; 103 };
61 104
62 soc8568@e0000000 { 105 soc8568@e0000000 {
@@ -610,4 +653,20 @@
610 sleep = <&pmc 0x00080000 /* controller */ 653 sleep = <&pmc 0x00080000 /* controller */
611 &pmc 0x00040000>; /* message unit */ 654 &pmc 0x00040000>; /* message unit */
612 }; 655 };
656
657 leds {
658 compatible = "gpio-leds";
659
660 green {
661 gpios = <&bcsr5 1 0>;
662 };
663
664 amber {
665 gpios = <&bcsr5 2 0>;
666 };
667
668 red {
669 gpios = <&bcsr5 3 0>;
670 };
671 };
613}; 672};
diff --git a/arch/powerpc/configs/44x/katmai_defconfig b/arch/powerpc/configs/44x/katmai_defconfig
index dec901f9cc84..af244e1d255e 100644
--- a/arch/powerpc/configs/44x/katmai_defconfig
+++ b/arch/powerpc/configs/44x/katmai_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.33-rc1 3# Linux kernel version: 2.6.33-rc5
4# Mon Jan 4 14:55:34 2010 4# Tue Jan 26 14:40:58 2010
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -106,6 +106,7 @@ CONFIG_INITRAMFS_SOURCE=""
106CONFIG_RD_GZIP=y 106CONFIG_RD_GZIP=y
107# CONFIG_RD_BZIP2 is not set 107# CONFIG_RD_BZIP2 is not set
108# CONFIG_RD_LZMA is not set 108# CONFIG_RD_LZMA is not set
109# CONFIG_RD_LZO is not set
109# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 110# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
110CONFIG_SYSCTL=y 111CONFIG_SYSCTL=y
111CONFIG_ANON_INODES=y 112CONFIG_ANON_INODES=y
@@ -442,7 +443,90 @@ CONFIG_EXTRA_FIRMWARE=""
442# CONFIG_SYS_HYPERVISOR is not set 443# CONFIG_SYS_HYPERVISOR is not set
443CONFIG_CONNECTOR=y 444CONFIG_CONNECTOR=y
444CONFIG_PROC_EVENTS=y 445CONFIG_PROC_EVENTS=y
445# CONFIG_MTD is not set 446CONFIG_MTD=y
447# CONFIG_MTD_DEBUG is not set
448# CONFIG_MTD_TESTS is not set
449# CONFIG_MTD_CONCAT is not set
450CONFIG_MTD_PARTITIONS=y
451# CONFIG_MTD_REDBOOT_PARTS is not set
452CONFIG_MTD_CMDLINE_PARTS=y
453CONFIG_MTD_OF_PARTS=y
454# CONFIG_MTD_AR7_PARTS is not set
455
456#
457# User Modules And Translation Layers
458#
459CONFIG_MTD_CHAR=y
460CONFIG_MTD_BLKDEVS=y
461CONFIG_MTD_BLOCK=y
462# CONFIG_FTL is not set
463# CONFIG_NFTL is not set
464# CONFIG_INFTL is not set
465# CONFIG_RFD_FTL is not set
466# CONFIG_SSFDC is not set
467# CONFIG_MTD_OOPS is not set
468
469#
470# RAM/ROM/Flash chip drivers
471#
472CONFIG_MTD_CFI=y
473# CONFIG_MTD_JEDECPROBE is not set
474CONFIG_MTD_GEN_PROBE=y
475# CONFIG_MTD_CFI_ADV_OPTIONS is not set
476CONFIG_MTD_MAP_BANK_WIDTH_1=y
477CONFIG_MTD_MAP_BANK_WIDTH_2=y
478CONFIG_MTD_MAP_BANK_WIDTH_4=y
479# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
480# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
481# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
482CONFIG_MTD_CFI_I1=y
483CONFIG_MTD_CFI_I2=y
484# CONFIG_MTD_CFI_I4 is not set
485# CONFIG_MTD_CFI_I8 is not set
486# CONFIG_MTD_CFI_INTELEXT is not set
487CONFIG_MTD_CFI_AMDSTD=y
488# CONFIG_MTD_CFI_STAA is not set
489CONFIG_MTD_CFI_UTIL=y
490# CONFIG_MTD_RAM is not set
491# CONFIG_MTD_ROM is not set
492# CONFIG_MTD_ABSENT is not set
493
494#
495# Mapping drivers for chip access
496#
497# CONFIG_MTD_COMPLEX_MAPPINGS is not set
498# CONFIG_MTD_PHYSMAP is not set
499CONFIG_MTD_PHYSMAP_OF=y
500# CONFIG_MTD_INTEL_VR_NOR is not set
501# CONFIG_MTD_PLATRAM is not set
502
503#
504# Self-contained MTD device drivers
505#
506# CONFIG_MTD_PMC551 is not set
507# CONFIG_MTD_SLRAM is not set
508# CONFIG_MTD_PHRAM is not set
509# CONFIG_MTD_MTDRAM is not set
510# CONFIG_MTD_BLOCK2MTD is not set
511
512#
513# Disk-On-Chip Device Drivers
514#
515# CONFIG_MTD_DOC2000 is not set
516# CONFIG_MTD_DOC2001 is not set
517# CONFIG_MTD_DOC2001PLUS is not set
518# CONFIG_MTD_NAND is not set
519# CONFIG_MTD_ONENAND is not set
520
521#
522# LPDDR flash memory drivers
523#
524# CONFIG_MTD_LPDDR is not set
525
526#
527# UBI - Unsorted block images
528#
529# CONFIG_MTD_UBI is not set
446CONFIG_OF_DEVICE=y 530CONFIG_OF_DEVICE=y
447# CONFIG_PARPORT is not set 531# CONFIG_PARPORT is not set
448CONFIG_BLK_DEV=y 532CONFIG_BLK_DEV=y
@@ -500,7 +584,7 @@ CONFIG_HAVE_IDE=y
500# 584#
501 585
502# 586#
503# See the help texts for more information. 587# The newer stack is recommended.
504# 588#
505# CONFIG_FIREWIRE is not set 589# CONFIG_FIREWIRE is not set
506# CONFIG_IEEE1394 is not set 590# CONFIG_IEEE1394 is not set
@@ -763,7 +847,6 @@ CONFIG_EXT2_FS=y
763# CONFIG_EXT2_FS_XIP is not set 847# CONFIG_EXT2_FS_XIP is not set
764# CONFIG_EXT3_FS is not set 848# CONFIG_EXT3_FS is not set
765# CONFIG_EXT4_FS is not set 849# CONFIG_EXT4_FS is not set
766CONFIG_EXT4_USE_FOR_EXT23=y
767# CONFIG_REISERFS_FS is not set 850# CONFIG_REISERFS_FS is not set
768# CONFIG_JFS_FS is not set 851# CONFIG_JFS_FS is not set
769# CONFIG_FS_POSIX_ACL is not set 852# CONFIG_FS_POSIX_ACL is not set
@@ -820,6 +903,7 @@ CONFIG_MISC_FILESYSTEMS=y
820# CONFIG_BEFS_FS is not set 903# CONFIG_BEFS_FS is not set
821# CONFIG_BFS_FS is not set 904# CONFIG_BFS_FS is not set
822# CONFIG_EFS_FS is not set 905# CONFIG_EFS_FS is not set
906# CONFIG_JFFS2_FS is not set
823CONFIG_CRAMFS=y 907CONFIG_CRAMFS=y
824# CONFIG_SQUASHFS is not set 908# CONFIG_SQUASHFS is not set
825# CONFIG_VXFS_FS is not set 909# CONFIG_VXFS_FS is not set
diff --git a/arch/powerpc/configs/86xx/gef_ppc9a_defconfig b/arch/powerpc/configs/86xx/gef_ppc9a_defconfig
index a85f927bf225..622d84f48aba 100644
--- a/arch/powerpc/configs/86xx/gef_ppc9a_defconfig
+++ b/arch/powerpc/configs/86xx/gef_ppc9a_defconfig
@@ -1557,7 +1557,52 @@ CONFIG_RTC_DRV_RX8581=y
1557# 1557#
1558# TI VLYNQ 1558# TI VLYNQ
1559# 1559#
1560# CONFIG_STAGING is not set 1560CONFIG_STAGING=y
1561# CONFIG_STAGING_EXCLUDE_BUILD is not set
1562# CONFIG_ET131X is not set
1563# CONFIG_ME4000 is not set
1564# CONFIG_MEILHAUS is not set
1565# CONFIG_USB_IP_COMMON is not set
1566# CONFIG_ECHO is not set
1567# CONFIG_COMEDI is not set
1568# CONFIG_ASUS_OLED is not set
1569# CONFIG_ALTERA_PCIE_CHDMA is not set
1570# CONFIG_INPUT_MIMIO is not set
1571# CONFIG_TRANZPORT is not set
1572
1573#
1574# Android
1575#
1576# CONFIG_ANDROID is not set
1577# CONFIG_DST is not set
1578# CONFIG_POHMELFS is not set
1579# CONFIG_B3DFG is not set
1580# CONFIG_IDE_PHISON is not set
1581# CONFIG_PLAN9AUTH is not set
1582# CONFIG_HECI is not set
1583# CONFIG_USB_CPC is not set
1584
1585#
1586# Qualcomm MSM Camera And Video
1587#
1588
1589#
1590# Camera Sensor Selection
1591#
1592# CONFIG_HYPERV_STORAGE is not set
1593# CONFIG_HYPERV_BLOCK is not set
1594# CONFIG_HYPERV_NET is not set
1595CONFIG_VME_BUS=y
1596
1597#
1598# VME Bridge Drivers
1599#
1600CONFIG_VME_TSI148=y
1601
1602#
1603# VME Device Drivers
1604#
1605# CONFIG_VME_USER is not set
1561 1606
1562# 1607#
1563# File systems 1608# File systems
diff --git a/arch/powerpc/configs/86xx/gef_sbc610_defconfig b/arch/powerpc/configs/86xx/gef_sbc610_defconfig
index 4554d9bb03e5..62c2b81a4a8f 100644
--- a/arch/powerpc/configs/86xx/gef_sbc610_defconfig
+++ b/arch/powerpc/configs/86xx/gef_sbc610_defconfig
@@ -265,7 +265,7 @@ CONFIG_MMIO_NVRAM=y
265# 265#
266# Kernel options 266# Kernel options
267# 267#
268# CONFIG_HIGHMEM is not set 268CONFIG_HIGHMEM=y
269CONFIG_TICK_ONESHOT=y 269CONFIG_TICK_ONESHOT=y
270# CONFIG_NO_HZ is not set 270# CONFIG_NO_HZ is not set
271CONFIG_HIGH_RES_TIMERS=y 271CONFIG_HIGH_RES_TIMERS=y
@@ -651,7 +651,7 @@ CONFIG_MTD_CONCAT=y
651CONFIG_MTD_PARTITIONS=y 651CONFIG_MTD_PARTITIONS=y
652# CONFIG_MTD_REDBOOT_PARTS is not set 652# CONFIG_MTD_REDBOOT_PARTS is not set
653# CONFIG_MTD_CMDLINE_PARTS is not set 653# CONFIG_MTD_CMDLINE_PARTS is not set
654# CONFIG_MTD_OF_PARTS is not set 654CONFIG_MTD_OF_PARTS=y
655# CONFIG_MTD_AR7_PARTS is not set 655# CONFIG_MTD_AR7_PARTS is not set
656 656
657# 657#
@@ -671,13 +671,9 @@ CONFIG_MTD_BLOCK=y
671# RAM/ROM/Flash chip drivers 671# RAM/ROM/Flash chip drivers
672# 672#
673CONFIG_MTD_CFI=y 673CONFIG_MTD_CFI=y
674# CONFIG_MTD_JEDECPROBE is not set 674CONFIG_MTD_JEDECPROBE=y
675CONFIG_MTD_GEN_PROBE=y 675CONFIG_MTD_GEN_PROBE=y
676CONFIG_MTD_CFI_ADV_OPTIONS=y 676# CONFIG_MTD_CFI_ADV_OPTIONS is not set
677# CONFIG_MTD_CFI_NOSWAP is not set
678# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
679CONFIG_MTD_CFI_LE_BYTE_SWAP=y
680# CONFIG_MTD_CFI_GEOMETRY is not set
681CONFIG_MTD_MAP_BANK_WIDTH_1=y 677CONFIG_MTD_MAP_BANK_WIDTH_1=y
682CONFIG_MTD_MAP_BANK_WIDTH_2=y 678CONFIG_MTD_MAP_BANK_WIDTH_2=y
683CONFIG_MTD_MAP_BANK_WIDTH_4=y 679CONFIG_MTD_MAP_BANK_WIDTH_4=y
@@ -688,7 +684,6 @@ CONFIG_MTD_CFI_I1=y
688CONFIG_MTD_CFI_I2=y 684CONFIG_MTD_CFI_I2=y
689# CONFIG_MTD_CFI_I4 is not set 685# CONFIG_MTD_CFI_I4 is not set
690# CONFIG_MTD_CFI_I8 is not set 686# CONFIG_MTD_CFI_I8 is not set
691# CONFIG_MTD_OTP is not set
692CONFIG_MTD_CFI_INTELEXT=y 687CONFIG_MTD_CFI_INTELEXT=y
693CONFIG_MTD_CFI_AMDSTD=y 688CONFIG_MTD_CFI_AMDSTD=y
694# CONFIG_MTD_CFI_STAA is not set 689# CONFIG_MTD_CFI_STAA is not set
@@ -1652,7 +1647,44 @@ CONFIG_RTC_DRV_RX8581=y
1652# 1647#
1653# TI VLYNQ 1648# TI VLYNQ
1654# 1649#
1655# CONFIG_STAGING is not set 1650CONFIG_STAGING=y
1651# CONFIG_STAGING_EXCLUDE_BUILD is not set
1652# CONFIG_ET131X is not set
1653# CONFIG_ME4000 is not set
1654# CONFIG_MEILHAUS is not set
1655# CONFIG_USB_IP_COMMON is not set
1656# CONFIG_ECHO is not set
1657# CONFIG_COMEDI is not set
1658# CONFIG_ASUS_OLED is not set
1659# CONFIG_ALTERA_PCIE_CHDMA is not set
1660# CONFIG_INPUT_MIMIO is not set
1661# CONFIG_TRANZPORT is not set
1662
1663#
1664# Android
1665#
1666# CONFIG_ANDROID is not set
1667# CONFIG_DST is not set
1668# CONFIG_POHMELFS is not set
1669# CONFIG_B3DFG is not set
1670# CONFIG_IDE_PHISON is not set
1671# CONFIG_PLAN9AUTH is not set
1672# CONFIG_HECI is not set
1673# CONFIG_VT6655 is not set
1674# CONFIG_USB_CPC is not set
1675# CONFIG_RDC_17F3101X is not set
1676CONFIG_VME_BUS=y
1677
1678#
1679# VME Bridge Drivers
1680#
1681# CONFIG_VME_CA91CX42 is not set
1682CONFIG_VME_TSI148=y
1683
1684#
1685# VME Device Drivers
1686#
1687# CONFIG_VME_USER is not set
1656 1688
1657# 1689#
1658# File systems 1690# File systems
@@ -1729,7 +1761,17 @@ CONFIG_MISC_FILESYSTEMS=y
1729# CONFIG_BEFS_FS is not set 1761# CONFIG_BEFS_FS is not set
1730# CONFIG_BFS_FS is not set 1762# CONFIG_BFS_FS is not set
1731# CONFIG_EFS_FS is not set 1763# CONFIG_EFS_FS is not set
1732# CONFIG_JFFS2_FS is not set 1764CONFIG_JFFS2_FS=y
1765CONFIG_JFFS2_FS_DEBUG=0
1766CONFIG_JFFS2_FS_WRITEBUFFER=y
1767# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
1768# CONFIG_JFFS2_SUMMARY is not set
1769# CONFIG_JFFS2_FS_XATTR is not set
1770# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
1771CONFIG_JFFS2_ZLIB=y
1772# CONFIG_JFFS2_LZO is not set
1773CONFIG_JFFS2_RTIME=y
1774# CONFIG_JFFS2_RUBIN is not set
1733# CONFIG_CRAMFS is not set 1775# CONFIG_CRAMFS is not set
1734# CONFIG_SQUASHFS is not set 1776# CONFIG_SQUASHFS is not set
1735# CONFIG_VXFS_FS is not set 1777# CONFIG_VXFS_FS is not set
@@ -1874,6 +1916,7 @@ CONFIG_DEBUG_PREEMPT=y
1874# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1916# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1875# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 1917# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1876# CONFIG_DEBUG_KOBJECT is not set 1918# CONFIG_DEBUG_KOBJECT is not set
1919# CONFIG_DEBUG_HIGHMEM is not set
1877# CONFIG_DEBUG_BUGVERBOSE is not set 1920# CONFIG_DEBUG_BUGVERBOSE is not set
1878CONFIG_DEBUG_INFO=y 1921CONFIG_DEBUG_INFO=y
1879# CONFIG_DEBUG_VM is not set 1922# CONFIG_DEBUG_VM is not set
diff --git a/arch/powerpc/configs/mpc512x_defconfig b/arch/powerpc/configs/mpc512x_defconfig
new file mode 100644
index 000000000000..a04727295d46
--- /dev/null
+++ b/arch/powerpc/configs/mpc512x_defconfig
@@ -0,0 +1,1694 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.33-rc6
4# Fri Feb 5 11:48:29 2010
5#
6# CONFIG_PPC64 is not set
7
8#
9# Processor support
10#
11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set
15# CONFIG_44x is not set
16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
19CONFIG_PPC_FPU=y
20# CONFIG_ALTIVEC is not set
21CONFIG_PPC_STD_MMU=y
22CONFIG_PPC_STD_MMU_32=y
23# CONFIG_PPC_MM_SLICES is not set
24CONFIG_PPC_HAVE_PMU_SUPPORT=y
25# CONFIG_SMP is not set
26CONFIG_NOT_COHERENT_CACHE=y
27CONFIG_PPC32=y
28CONFIG_WORD_SIZE=32
29# CONFIG_ARCH_PHYS_ADDR_T_64BIT is not set
30CONFIG_MMU=y
31CONFIG_GENERIC_CMOS_UPDATE=y
32CONFIG_GENERIC_TIME=y
33CONFIG_GENERIC_TIME_VSYSCALL=y
34CONFIG_GENERIC_CLOCKEVENTS=y
35CONFIG_GENERIC_HARDIRQS=y
36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
38# CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK is not set
39CONFIG_IRQ_PER_CPU=y
40CONFIG_NR_IRQS=512
41CONFIG_STACKTRACE_SUPPORT=y
42CONFIG_HAVE_LATENCYTOP_SUPPORT=y
43CONFIG_TRACE_IRQFLAGS_SUPPORT=y
44CONFIG_LOCKDEP_SUPPORT=y
45CONFIG_RWSEM_XCHGADD_ALGORITHM=y
46CONFIG_ARCH_HAS_ILOG2_U32=y
47CONFIG_GENERIC_HWEIGHT=y
48CONFIG_GENERIC_FIND_NEXT_BIT=y
49# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
50CONFIG_PPC=y
51CONFIG_EARLY_PRINTK=y
52CONFIG_GENERIC_NVRAM=y
53CONFIG_SCHED_OMIT_FRAME_POINTER=y
54CONFIG_ARCH_MAY_HAVE_PC_FDC=y
55CONFIG_PPC_OF=y
56CONFIG_OF=y
57# CONFIG_PPC_UDBG_16550 is not set
58# CONFIG_GENERIC_TBSYNC is not set
59CONFIG_AUDIT_ARCH=y
60CONFIG_GENERIC_BUG=y
61CONFIG_DTC=y
62CONFIG_DEFAULT_UIMAGE=y
63CONFIG_ARCH_HIBERNATION_POSSIBLE=y
64# CONFIG_PPC_DCR_NATIVE is not set
65# CONFIG_PPC_DCR_MMIO is not set
66CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
67CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
68CONFIG_CONSTRUCTORS=y
69
70#
71# General setup
72#
73CONFIG_EXPERIMENTAL=y
74CONFIG_BROKEN_ON_SMP=y
75CONFIG_INIT_ENV_ARG_LIMIT=32
76CONFIG_LOCALVERSION=""
77CONFIG_LOCALVERSION_AUTO=y
78# CONFIG_SWAP is not set
79CONFIG_SYSVIPC=y
80CONFIG_SYSVIPC_SYSCTL=y
81# CONFIG_POSIX_MQUEUE is not set
82# CONFIG_BSD_PROCESS_ACCT is not set
83# CONFIG_TASKSTATS is not set
84# CONFIG_AUDIT is not set
85
86#
87# RCU Subsystem
88#
89CONFIG_TREE_RCU=y
90# CONFIG_TREE_PREEMPT_RCU is not set
91# CONFIG_TINY_RCU is not set
92# CONFIG_RCU_TRACE is not set
93CONFIG_RCU_FANOUT=32
94# CONFIG_RCU_FANOUT_EXACT is not set
95# CONFIG_TREE_RCU_TRACE is not set
96# CONFIG_IKCONFIG is not set
97CONFIG_LOG_BUF_SHIFT=16
98# CONFIG_GROUP_SCHED is not set
99# CONFIG_CGROUPS is not set
100CONFIG_SYSFS_DEPRECATED=y
101CONFIG_SYSFS_DEPRECATED_V2=y
102# CONFIG_RELAY is not set
103CONFIG_NAMESPACES=y
104# CONFIG_UTS_NS is not set
105# CONFIG_IPC_NS is not set
106# CONFIG_USER_NS is not set
107# CONFIG_PID_NS is not set
108# CONFIG_NET_NS is not set
109CONFIG_BLK_DEV_INITRD=y
110CONFIG_INITRAMFS_SOURCE=""
111CONFIG_RD_GZIP=y
112CONFIG_RD_BZIP2=y
113CONFIG_RD_LZMA=y
114CONFIG_RD_LZO=y
115# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
116CONFIG_SYSCTL=y
117CONFIG_ANON_INODES=y
118# CONFIG_EMBEDDED is not set
119CONFIG_SYSCTL_SYSCALL=y
120CONFIG_KALLSYMS=y
121# CONFIG_KALLSYMS_EXTRA_PASS is not set
122CONFIG_HOTPLUG=y
123CONFIG_PRINTK=y
124CONFIG_BUG=y
125CONFIG_ELF_CORE=y
126CONFIG_BASE_FULL=y
127CONFIG_FUTEX=y
128CONFIG_EPOLL=y
129CONFIG_SIGNALFD=y
130CONFIG_TIMERFD=y
131CONFIG_EVENTFD=y
132CONFIG_SHMEM=y
133CONFIG_AIO=y
134CONFIG_HAVE_PERF_EVENTS=y
135
136#
137# Kernel Performance Events And Counters
138#
139# CONFIG_PERF_EVENTS is not set
140# CONFIG_PERF_COUNTERS is not set
141CONFIG_VM_EVENT_COUNTERS=y
142# CONFIG_COMPAT_BRK is not set
143CONFIG_SLAB=y
144# CONFIG_SLUB is not set
145# CONFIG_SLOB is not set
146# CONFIG_PROFILING is not set
147CONFIG_HAVE_OPROFILE=y
148# CONFIG_KPROBES is not set
149CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
150CONFIG_HAVE_IOREMAP_PROT=y
151CONFIG_HAVE_KPROBES=y
152CONFIG_HAVE_KRETPROBES=y
153CONFIG_HAVE_ARCH_TRACEHOOK=y
154CONFIG_HAVE_DMA_ATTRS=y
155CONFIG_HAVE_CLK=y
156CONFIG_HAVE_DMA_API_DEBUG=y
157
158#
159# GCOV-based kernel profiling
160#
161# CONFIG_SLOW_WORK is not set
162# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
163CONFIG_SLABINFO=y
164CONFIG_RT_MUTEXES=y
165CONFIG_BASE_SMALL=0
166CONFIG_MODULES=y
167# CONFIG_MODULE_FORCE_LOAD is not set
168CONFIG_MODULE_UNLOAD=y
169# CONFIG_MODULE_FORCE_UNLOAD is not set
170# CONFIG_MODVERSIONS is not set
171# CONFIG_MODULE_SRCVERSION_ALL is not set
172CONFIG_BLOCK=y
173CONFIG_LBDAF=y
174# CONFIG_BLK_DEV_BSG is not set
175# CONFIG_BLK_DEV_INTEGRITY is not set
176
177#
178# IO Schedulers
179#
180CONFIG_IOSCHED_NOOP=y
181CONFIG_IOSCHED_DEADLINE=y
182# CONFIG_IOSCHED_CFQ is not set
183CONFIG_DEFAULT_DEADLINE=y
184# CONFIG_DEFAULT_CFQ is not set
185# CONFIG_DEFAULT_NOOP is not set
186CONFIG_DEFAULT_IOSCHED="deadline"
187# CONFIG_INLINE_SPIN_TRYLOCK is not set
188# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set
189# CONFIG_INLINE_SPIN_LOCK is not set
190# CONFIG_INLINE_SPIN_LOCK_BH is not set
191# CONFIG_INLINE_SPIN_LOCK_IRQ is not set
192# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set
193CONFIG_INLINE_SPIN_UNLOCK=y
194# CONFIG_INLINE_SPIN_UNLOCK_BH is not set
195CONFIG_INLINE_SPIN_UNLOCK_IRQ=y
196# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set
197# CONFIG_INLINE_READ_TRYLOCK is not set
198# CONFIG_INLINE_READ_LOCK is not set
199# CONFIG_INLINE_READ_LOCK_BH is not set
200# CONFIG_INLINE_READ_LOCK_IRQ is not set
201# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set
202CONFIG_INLINE_READ_UNLOCK=y
203# CONFIG_INLINE_READ_UNLOCK_BH is not set
204CONFIG_INLINE_READ_UNLOCK_IRQ=y
205# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set
206# CONFIG_INLINE_WRITE_TRYLOCK is not set
207# CONFIG_INLINE_WRITE_LOCK is not set
208# CONFIG_INLINE_WRITE_LOCK_BH is not set
209# CONFIG_INLINE_WRITE_LOCK_IRQ is not set
210# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set
211CONFIG_INLINE_WRITE_UNLOCK=y
212# CONFIG_INLINE_WRITE_UNLOCK_BH is not set
213CONFIG_INLINE_WRITE_UNLOCK_IRQ=y
214# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set
215# CONFIG_MUTEX_SPIN_ON_OWNER is not set
216# CONFIG_FREEZER is not set
217
218#
219# Platform support
220#
221# CONFIG_PPC_CHRP is not set
222CONFIG_PPC_MPC512x=y
223CONFIG_PPC_MPC5121=y
224CONFIG_MPC5121_ADS=y
225# CONFIG_MPC5121_GENERIC is not set
226# CONFIG_PPC_MPC52xx is not set
227# CONFIG_PPC_PMAC is not set
228# CONFIG_PPC_CELL is not set
229# CONFIG_PPC_CELL_NATIVE is not set
230# CONFIG_PPC_82xx is not set
231# CONFIG_PQ2ADS is not set
232# CONFIG_PPC_83xx is not set
233# CONFIG_PPC_86xx is not set
234# CONFIG_EMBEDDED6xx is not set
235# CONFIG_AMIGAONE is not set
236CONFIG_PPC_OF_BOOT_TRAMPOLINE=y
237CONFIG_IPIC=y
238# CONFIG_MPIC is not set
239# CONFIG_MPIC_WEIRD is not set
240# CONFIG_PPC_I8259 is not set
241# CONFIG_PPC_RTAS is not set
242# CONFIG_MMIO_NVRAM is not set
243# CONFIG_PPC_MPC106 is not set
244# CONFIG_PPC_970_NAP is not set
245# CONFIG_PPC_INDIRECT_IO is not set
246# CONFIG_GENERIC_IOMAP is not set
247# CONFIG_CPU_FREQ is not set
248# CONFIG_TAU is not set
249# CONFIG_QUICC_ENGINE is not set
250# CONFIG_FSL_ULI1575 is not set
251# CONFIG_SIMPLE_GPIO is not set
252
253#
254# Kernel options
255#
256# CONFIG_HIGHMEM is not set
257CONFIG_TICK_ONESHOT=y
258CONFIG_NO_HZ=y
259# CONFIG_HIGH_RES_TIMERS is not set
260CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
261# CONFIG_HZ_100 is not set
262# CONFIG_HZ_250 is not set
263# CONFIG_HZ_300 is not set
264CONFIG_HZ_1000=y
265CONFIG_HZ=1000
266# CONFIG_SCHED_HRTICK is not set
267CONFIG_PREEMPT_NONE=y
268# CONFIG_PREEMPT_VOLUNTARY is not set
269# CONFIG_PREEMPT is not set
270CONFIG_BINFMT_ELF=y
271# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
272# CONFIG_HAVE_AOUT is not set
273# CONFIG_BINFMT_MISC is not set
274# CONFIG_IOMMU_HELPER is not set
275# CONFIG_SWIOTLB is not set
276CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
277CONFIG_ARCH_HAS_WALK_MEMORY=y
278CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
279# CONFIG_KEXEC is not set
280# CONFIG_CRASH_DUMP is not set
281CONFIG_SPARSE_IRQ=y
282CONFIG_MAX_ACTIVE_REGIONS=32
283CONFIG_ARCH_FLATMEM_ENABLE=y
284CONFIG_ARCH_POPULATES_NODE_MAP=y
285CONFIG_SELECT_MEMORY_MODEL=y
286CONFIG_FLATMEM_MANUAL=y
287# CONFIG_DISCONTIGMEM_MANUAL is not set
288# CONFIG_SPARSEMEM_MANUAL is not set
289CONFIG_FLATMEM=y
290CONFIG_FLAT_NODE_MEM_MAP=y
291CONFIG_PAGEFLAGS_EXTENDED=y
292CONFIG_SPLIT_PTLOCK_CPUS=4
293# CONFIG_MIGRATION is not set
294# CONFIG_PHYS_ADDR_T_64BIT is not set
295CONFIG_ZONE_DMA_FLAG=1
296CONFIG_BOUNCE=y
297CONFIG_VIRT_TO_BUS=y
298# CONFIG_KSM is not set
299CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
300CONFIG_PPC_4K_PAGES=y
301# CONFIG_PPC_16K_PAGES is not set
302# CONFIG_PPC_64K_PAGES is not set
303# CONFIG_PPC_256K_PAGES is not set
304CONFIG_FORCE_MAX_ZONEORDER=11
305CONFIG_PROC_DEVICETREE=y
306# CONFIG_CMDLINE_BOOL is not set
307CONFIG_EXTRA_TARGETS=""
308# CONFIG_PM is not set
309# CONFIG_SECCOMP is not set
310CONFIG_ISA_DMA_API=y
311
312#
313# Bus options
314#
315CONFIG_ZONE_DMA=y
316CONFIG_GENERIC_ISA_DMA=y
317CONFIG_FSL_SOC=y
318CONFIG_PPC_PCI_CHOICE=y
319# CONFIG_PCI is not set
320# CONFIG_PCI_DOMAINS is not set
321# CONFIG_PCI_SYSCALL is not set
322# CONFIG_ARCH_SUPPORTS_MSI is not set
323# CONFIG_PCCARD is not set
324# CONFIG_HAS_RAPIDIO is not set
325
326#
327# Advanced setup
328#
329# CONFIG_ADVANCED_OPTIONS is not set
330
331#
332# Default settings for advanced configuration options are used
333#
334CONFIG_LOWMEM_SIZE=0x30000000
335CONFIG_PAGE_OFFSET=0xc0000000
336CONFIG_KERNEL_START=0xc0000000
337CONFIG_PHYSICAL_START=0x00000000
338CONFIG_TASK_SIZE=0xc0000000
339CONFIG_CONSISTENT_SIZE=0x00200000
340CONFIG_NET=y
341
342#
343# Networking options
344#
345CONFIG_PACKET=y
346# CONFIG_PACKET_MMAP is not set
347CONFIG_UNIX=y
348# CONFIG_NET_KEY is not set
349CONFIG_INET=y
350# CONFIG_IP_MULTICAST is not set
351# CONFIG_IP_ADVANCED_ROUTER is not set
352CONFIG_IP_FIB_HASH=y
353CONFIG_IP_PNP=y
354# CONFIG_IP_PNP_DHCP is not set
355# CONFIG_IP_PNP_BOOTP is not set
356# CONFIG_IP_PNP_RARP is not set
357# CONFIG_NET_IPIP is not set
358# CONFIG_NET_IPGRE is not set
359# CONFIG_ARPD is not set
360# CONFIG_SYN_COOKIES is not set
361# CONFIG_INET_AH is not set
362# CONFIG_INET_ESP is not set
363# CONFIG_INET_IPCOMP is not set
364# CONFIG_INET_XFRM_TUNNEL is not set
365# CONFIG_INET_TUNNEL is not set
366# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
367# CONFIG_INET_XFRM_MODE_TUNNEL is not set
368# CONFIG_INET_XFRM_MODE_BEET is not set
369# CONFIG_INET_LRO is not set
370# CONFIG_INET_DIAG is not set
371# CONFIG_TCP_CONG_ADVANCED is not set
372CONFIG_TCP_CONG_CUBIC=y
373CONFIG_DEFAULT_TCP_CONG="cubic"
374# CONFIG_TCP_MD5SIG is not set
375# CONFIG_IPV6 is not set
376# CONFIG_NETWORK_SECMARK is not set
377# CONFIG_NETFILTER is not set
378# CONFIG_IP_DCCP is not set
379# CONFIG_IP_SCTP is not set
380# CONFIG_RDS is not set
381# CONFIG_TIPC is not set
382# CONFIG_ATM is not set
383# CONFIG_BRIDGE is not set
384# CONFIG_NET_DSA is not set
385# CONFIG_VLAN_8021Q is not set
386# CONFIG_DECNET is not set
387# CONFIG_LLC2 is not set
388# CONFIG_IPX is not set
389# CONFIG_ATALK is not set
390# CONFIG_X25 is not set
391# CONFIG_LAPB is not set
392# CONFIG_ECONET is not set
393# CONFIG_WAN_ROUTER is not set
394# CONFIG_PHONET is not set
395# CONFIG_IEEE802154 is not set
396# CONFIG_NET_SCHED is not set
397# CONFIG_DCB is not set
398
399#
400# Network testing
401#
402# CONFIG_NET_PKTGEN is not set
403# CONFIG_HAMRADIO is not set
404CONFIG_CAN=y
405CONFIG_CAN_RAW=y
406CONFIG_CAN_BCM=y
407
408#
409# CAN Device Drivers
410#
411CONFIG_CAN_VCAN=y
412CONFIG_CAN_DEV=y
413# CONFIG_CAN_CALC_BITTIMING is not set
414CONFIG_CAN_MSCAN=y
415# CONFIG_CAN_SJA1000 is not set
416
417#
418# CAN USB interfaces
419#
420# CONFIG_CAN_EMS_USB is not set
421CONFIG_CAN_DEBUG_DEVICES=y
422# CONFIG_IRDA is not set
423# CONFIG_BT is not set
424# CONFIG_AF_RXRPC is not set
425# CONFIG_WIRELESS is not set
426# CONFIG_WIMAX is not set
427# CONFIG_RFKILL is not set
428# CONFIG_NET_9P is not set
429
430#
431# Device Drivers
432#
433
434#
435# Generic Driver Options
436#
437CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
438# CONFIG_DEVTMPFS is not set
439CONFIG_STANDALONE=y
440# CONFIG_PREVENT_FIRMWARE_BUILD is not set
441CONFIG_FW_LOADER=y
442# CONFIG_FIRMWARE_IN_KERNEL is not set
443CONFIG_EXTRA_FIRMWARE=""
444# CONFIG_SYS_HYPERVISOR is not set
445# CONFIG_CONNECTOR is not set
446CONFIG_MTD=y
447# CONFIG_MTD_DEBUG is not set
448# CONFIG_MTD_TESTS is not set
449CONFIG_MTD_CONCAT=y
450CONFIG_MTD_PARTITIONS=y
451# CONFIG_MTD_REDBOOT_PARTS is not set
452CONFIG_MTD_CMDLINE_PARTS=y
453CONFIG_MTD_OF_PARTS=y
454# CONFIG_MTD_AR7_PARTS is not set
455
456#
457# User Modules And Translation Layers
458#
459CONFIG_MTD_CHAR=y
460CONFIG_MTD_BLKDEVS=y
461CONFIG_MTD_BLOCK=y
462# CONFIG_FTL is not set
463# CONFIG_NFTL is not set
464# CONFIG_INFTL is not set
465# CONFIG_RFD_FTL is not set
466# CONFIG_SSFDC is not set
467# CONFIG_MTD_OOPS is not set
468
469#
470# RAM/ROM/Flash chip drivers
471#
472CONFIG_MTD_CFI=y
473# CONFIG_MTD_JEDECPROBE is not set
474CONFIG_MTD_GEN_PROBE=y
475# CONFIG_MTD_CFI_ADV_OPTIONS is not set
476CONFIG_MTD_MAP_BANK_WIDTH_1=y
477CONFIG_MTD_MAP_BANK_WIDTH_2=y
478CONFIG_MTD_MAP_BANK_WIDTH_4=y
479# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
480# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
481# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
482CONFIG_MTD_CFI_I1=y
483CONFIG_MTD_CFI_I2=y
484# CONFIG_MTD_CFI_I4 is not set
485# CONFIG_MTD_CFI_I8 is not set
486# CONFIG_MTD_CFI_INTELEXT is not set
487CONFIG_MTD_CFI_AMDSTD=y
488# CONFIG_MTD_CFI_STAA is not set
489CONFIG_MTD_CFI_UTIL=y
490# CONFIG_MTD_RAM is not set
491CONFIG_MTD_ROM=y
492# CONFIG_MTD_ABSENT is not set
493
494#
495# Mapping drivers for chip access
496#
497# CONFIG_MTD_COMPLEX_MAPPINGS is not set
498# CONFIG_MTD_PHYSMAP is not set
499CONFIG_MTD_PHYSMAP_OF=y
500# CONFIG_MTD_PLATRAM is not set
501
502#
503# Self-contained MTD device drivers
504#
505# CONFIG_MTD_SLRAM is not set
506# CONFIG_MTD_PHRAM is not set
507# CONFIG_MTD_MTDRAM is not set
508# CONFIG_MTD_BLOCK2MTD is not set
509
510#
511# Disk-On-Chip Device Drivers
512#
513# CONFIG_MTD_DOC2000 is not set
514# CONFIG_MTD_DOC2001 is not set
515# CONFIG_MTD_DOC2001PLUS is not set
516CONFIG_MTD_NAND=y
517# CONFIG_MTD_NAND_VERIFY_WRITE is not set
518# CONFIG_MTD_NAND_ECC_SMC is not set
519# CONFIG_MTD_NAND_MUSEUM_IDS is not set
520CONFIG_MTD_NAND_IDS=y
521# CONFIG_MTD_NAND_DISKONCHIP is not set
522# CONFIG_MTD_NAND_NANDSIM is not set
523# CONFIG_MTD_NAND_PLATFORM is not set
524# CONFIG_MTD_ALAUDA is not set
525# CONFIG_MTD_NAND_FSL_ELBC is not set
526CONFIG_MTD_NAND_MPC5121_NFC=y
527# CONFIG_MTD_ONENAND is not set
528
529#
530# LPDDR flash memory drivers
531#
532# CONFIG_MTD_LPDDR is not set
533
534#
535# UBI - Unsorted block images
536#
537CONFIG_MTD_UBI=y
538CONFIG_MTD_UBI_WL_THRESHOLD=4096
539CONFIG_MTD_UBI_BEB_RESERVE=1
540# CONFIG_MTD_UBI_GLUEBI is not set
541
542#
543# UBI debugging options
544#
545# CONFIG_MTD_UBI_DEBUG is not set
546CONFIG_OF_DEVICE=y
547CONFIG_OF_I2C=y
548CONFIG_OF_MDIO=y
549# CONFIG_PARPORT is not set
550CONFIG_BLK_DEV=y
551# CONFIG_BLK_DEV_FD is not set
552# CONFIG_BLK_DEV_COW_COMMON is not set
553# CONFIG_BLK_DEV_LOOP is not set
554
555#
556# DRBD disabled because PROC_FS, INET or CONNECTOR not selected
557#
558# CONFIG_BLK_DEV_NBD is not set
559# CONFIG_BLK_DEV_UB is not set
560CONFIG_BLK_DEV_RAM=y
561CONFIG_BLK_DEV_RAM_COUNT=1
562CONFIG_BLK_DEV_RAM_SIZE=8192
563CONFIG_BLK_DEV_XIP=y
564# CONFIG_CDROM_PKTCDVD is not set
565# CONFIG_ATA_OVER_ETH is not set
566# CONFIG_BLK_DEV_HD is not set
567CONFIG_MISC_DEVICES=y
568# CONFIG_AD525X_DPOT is not set
569# CONFIG_ICS932S401 is not set
570# CONFIG_ENCLOSURE_SERVICES is not set
571# CONFIG_ISL29003 is not set
572# CONFIG_DS1682 is not set
573# CONFIG_C2PORT is not set
574
575#
576# EEPROM support
577#
578CONFIG_EEPROM_AT24=y
579# CONFIG_EEPROM_LEGACY is not set
580# CONFIG_EEPROM_MAX6875 is not set
581# CONFIG_EEPROM_93CX6 is not set
582CONFIG_HAVE_IDE=y
583# CONFIG_IDE is not set
584
585#
586# SCSI device support
587#
588# CONFIG_RAID_ATTRS is not set
589CONFIG_SCSI=y
590CONFIG_SCSI_DMA=y
591# CONFIG_SCSI_TGT is not set
592# CONFIG_SCSI_NETLINK is not set
593# CONFIG_SCSI_PROC_FS is not set
594
595#
596# SCSI support type (disk, tape, CD-ROM)
597#
598CONFIG_BLK_DEV_SD=y
599# CONFIG_CHR_DEV_ST is not set
600# CONFIG_CHR_DEV_OSST is not set
601# CONFIG_BLK_DEV_SR is not set
602CONFIG_CHR_DEV_SG=y
603# CONFIG_CHR_DEV_SCH is not set
604# CONFIG_SCSI_MULTI_LUN is not set
605# CONFIG_SCSI_CONSTANTS is not set
606# CONFIG_SCSI_LOGGING is not set
607# CONFIG_SCSI_SCAN_ASYNC is not set
608CONFIG_SCSI_WAIT_SCAN=m
609
610#
611# SCSI Transports
612#
613# CONFIG_SCSI_SPI_ATTRS is not set
614# CONFIG_SCSI_FC_ATTRS is not set
615# CONFIG_SCSI_ISCSI_ATTRS is not set
616# CONFIG_SCSI_SAS_LIBSAS is not set
617# CONFIG_SCSI_SRP_ATTRS is not set
618CONFIG_SCSI_LOWLEVEL=y
619# CONFIG_ISCSI_TCP is not set
620# CONFIG_LIBFC is not set
621# CONFIG_LIBFCOE is not set
622# CONFIG_SCSI_DEBUG is not set
623# CONFIG_SCSI_DH is not set
624# CONFIG_SCSI_OSD_INITIATOR is not set
625# CONFIG_ATA is not set
626# CONFIG_MD is not set
627# CONFIG_MACINTOSH_DRIVERS is not set
628CONFIG_NETDEVICES=y
629# CONFIG_DUMMY is not set
630# CONFIG_BONDING is not set
631# CONFIG_MACVLAN is not set
632# CONFIG_EQUALIZER is not set
633# CONFIG_TUN is not set
634# CONFIG_VETH is not set
635CONFIG_PHYLIB=y
636
637#
638# MII PHY device drivers
639#
640CONFIG_MARVELL_PHY=y
641CONFIG_DAVICOM_PHY=y
642CONFIG_QSEMI_PHY=y
643CONFIG_LXT_PHY=y
644CONFIG_CICADA_PHY=y
645CONFIG_VITESSE_PHY=y
646CONFIG_SMSC_PHY=y
647CONFIG_BROADCOM_PHY=y
648CONFIG_ICPLUS_PHY=y
649CONFIG_REALTEK_PHY=y
650CONFIG_NATIONAL_PHY=y
651CONFIG_STE10XP=y
652CONFIG_LSI_ET1011C_PHY=y
653CONFIG_FIXED_PHY=y
654CONFIG_MDIO_BITBANG=y
655CONFIG_NET_ETHERNET=y
656CONFIG_MII=y
657# CONFIG_ETHOC is not set
658# CONFIG_DNET is not set
659# CONFIG_IBM_NEW_EMAC_ZMII is not set
660# CONFIG_IBM_NEW_EMAC_RGMII is not set
661# CONFIG_IBM_NEW_EMAC_TAH is not set
662# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
663# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
664# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
665# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
666# CONFIG_B44 is not set
667# CONFIG_KS8842 is not set
668# CONFIG_KS8851_MLL is not set
669# CONFIG_XILINX_EMACLITE is not set
670CONFIG_FS_ENET=y
671CONFIG_FS_ENET_MPC5121_FEC=y
672CONFIG_FS_ENET_HAS_FEC=y
673CONFIG_FS_ENET_MDIO_FEC=y
674# CONFIG_NETDEV_1000 is not set
675# CONFIG_NETDEV_10000 is not set
676# CONFIG_WLAN is not set
677
678#
679# Enable WiMAX (Networking options) to see the WiMAX drivers
680#
681
682#
683# USB Network Adapters
684#
685# CONFIG_USB_CATC is not set
686# CONFIG_USB_KAWETH is not set
687# CONFIG_USB_PEGASUS is not set
688# CONFIG_USB_RTL8150 is not set
689# CONFIG_USB_USBNET is not set
690# CONFIG_WAN is not set
691# CONFIG_PPP is not set
692# CONFIG_SLIP is not set
693# CONFIG_NETCONSOLE is not set
694# CONFIG_NETPOLL is not set
695# CONFIG_NET_POLL_CONTROLLER is not set
696# CONFIG_ISDN is not set
697# CONFIG_PHONE is not set
698
699#
700# Input device support
701#
702CONFIG_INPUT=y
703# CONFIG_INPUT_FF_MEMLESS is not set
704# CONFIG_INPUT_POLLDEV is not set
705# CONFIG_INPUT_SPARSEKMAP is not set
706
707#
708# Userland interfaces
709#
710CONFIG_INPUT_MOUSEDEV=y
711# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
712CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
713CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
714# CONFIG_INPUT_JOYDEV is not set
715CONFIG_INPUT_EVDEV=y
716# CONFIG_INPUT_EVBUG is not set
717
718#
719# Input Device Drivers
720#
721CONFIG_INPUT_KEYBOARD=y
722# CONFIG_KEYBOARD_ADP5588 is not set
723CONFIG_KEYBOARD_ATKBD=y
724# CONFIG_QT2160 is not set
725# CONFIG_KEYBOARD_LKKBD is not set
726# CONFIG_KEYBOARD_MAX7359 is not set
727# CONFIG_KEYBOARD_NEWTON is not set
728# CONFIG_KEYBOARD_OPENCORES is not set
729# CONFIG_KEYBOARD_STOWAWAY is not set
730# CONFIG_KEYBOARD_SUNKBD is not set
731# CONFIG_KEYBOARD_XTKBD is not set
732CONFIG_INPUT_MOUSE=y
733CONFIG_MOUSE_PS2=y
734CONFIG_MOUSE_PS2_ALPS=y
735CONFIG_MOUSE_PS2_LOGIPS2PP=y
736CONFIG_MOUSE_PS2_SYNAPTICS=y
737CONFIG_MOUSE_PS2_TRACKPOINT=y
738# CONFIG_MOUSE_PS2_ELANTECH is not set
739# CONFIG_MOUSE_PS2_SENTELIC is not set
740# CONFIG_MOUSE_PS2_TOUCHKIT is not set
741# CONFIG_MOUSE_SERIAL is not set
742# CONFIG_MOUSE_APPLETOUCH is not set
743# CONFIG_MOUSE_BCM5974 is not set
744# CONFIG_MOUSE_VSXXXAA is not set
745# CONFIG_MOUSE_SYNAPTICS_I2C is not set
746# CONFIG_INPUT_JOYSTICK is not set
747# CONFIG_INPUT_TABLET is not set
748# CONFIG_INPUT_TOUCHSCREEN is not set
749# CONFIG_INPUT_MISC is not set
750
751#
752# Hardware I/O ports
753#
754CONFIG_SERIO=y
755CONFIG_SERIO_I8042=y
756CONFIG_SERIO_SERPORT=y
757CONFIG_SERIO_LIBPS2=y
758# CONFIG_SERIO_RAW is not set
759# CONFIG_SERIO_XILINX_XPS_PS2 is not set
760# CONFIG_SERIO_ALTERA_PS2 is not set
761# CONFIG_GAMEPORT is not set
762
763#
764# Character devices
765#
766CONFIG_VT=y
767CONFIG_CONSOLE_TRANSLATIONS=y
768CONFIG_VT_CONSOLE=y
769CONFIG_HW_CONSOLE=y
770CONFIG_VT_HW_CONSOLE_BINDING=y
771# CONFIG_DEVKMEM is not set
772# CONFIG_SERIAL_NONSTANDARD is not set
773
774#
775# Serial drivers
776#
777# CONFIG_SERIAL_8250 is not set
778
779#
780# Non-8250 serial port support
781#
782# CONFIG_SERIAL_UARTLITE is not set
783CONFIG_SERIAL_CORE=y
784CONFIG_SERIAL_CORE_CONSOLE=y
785CONFIG_SERIAL_MPC52xx=y
786CONFIG_SERIAL_MPC52xx_CONSOLE=y
787CONFIG_SERIAL_MPC52xx_CONSOLE_BAUD=115200
788# CONFIG_SERIAL_GRLIB_GAISLER_APBUART is not set
789CONFIG_UNIX98_PTYS=y
790# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
791CONFIG_LEGACY_PTYS=y
792CONFIG_LEGACY_PTY_COUNT=256
793# CONFIG_HVC_UDBG is not set
794# CONFIG_IPMI_HANDLER is not set
795# CONFIG_HW_RANDOM is not set
796# CONFIG_NVRAM is not set
797# CONFIG_R3964 is not set
798# CONFIG_RAW_DRIVER is not set
799# CONFIG_TCG_TPM is not set
800CONFIG_I2C=y
801CONFIG_I2C_BOARDINFO=y
802CONFIG_I2C_COMPAT=y
803CONFIG_I2C_CHARDEV=y
804CONFIG_I2C_HELPER_AUTO=y
805
806#
807# I2C Hardware Bus support
808#
809
810#
811# I2C system bus drivers (mostly embedded / system-on-chip)
812#
813# CONFIG_I2C_DESIGNWARE is not set
814CONFIG_I2C_MPC=y
815# CONFIG_I2C_OCORES is not set
816# CONFIG_I2C_SIMTEC is not set
817
818#
819# External I2C/SMBus adapter drivers
820#
821# CONFIG_I2C_PARPORT_LIGHT is not set
822# CONFIG_I2C_TAOS_EVM is not set
823# CONFIG_I2C_TINY_USB is not set
824
825#
826# Other I2C/SMBus bus drivers
827#
828# CONFIG_I2C_PCA_PLATFORM is not set
829# CONFIG_I2C_STUB is not set
830
831#
832# Miscellaneous I2C Chip support
833#
834# CONFIG_SENSORS_TSL2550 is not set
835# CONFIG_I2C_DEBUG_CORE is not set
836# CONFIG_I2C_DEBUG_ALGO is not set
837# CONFIG_I2C_DEBUG_BUS is not set
838# CONFIG_I2C_DEBUG_CHIP is not set
839# CONFIG_SPI is not set
840
841#
842# PPS support
843#
844# CONFIG_PPS is not set
845CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
846# CONFIG_GPIOLIB is not set
847# CONFIG_W1 is not set
848# CONFIG_POWER_SUPPLY is not set
849# CONFIG_HWMON is not set
850# CONFIG_THERMAL is not set
851# CONFIG_WATCHDOG is not set
852CONFIG_SSB_POSSIBLE=y
853
854#
855# Sonics Silicon Backplane
856#
857# CONFIG_SSB is not set
858
859#
860# Multifunction device drivers
861#
862# CONFIG_MFD_CORE is not set
863# CONFIG_MFD_SM501 is not set
864# CONFIG_HTC_PASIC3 is not set
865# CONFIG_TWL4030_CORE is not set
866# CONFIG_MFD_TMIO is not set
867# CONFIG_PMIC_DA903X is not set
868# CONFIG_PMIC_ADP5520 is not set
869# CONFIG_MFD_WM8400 is not set
870# CONFIG_MFD_WM831X is not set
871# CONFIG_MFD_WM8350_I2C is not set
872# CONFIG_MFD_PCF50633 is not set
873# CONFIG_AB3100_CORE is not set
874# CONFIG_MFD_88PM8607 is not set
875# CONFIG_REGULATOR is not set
876CONFIG_MEDIA_SUPPORT=y
877
878#
879# Multimedia core support
880#
881CONFIG_VIDEO_DEV=y
882CONFIG_VIDEO_V4L2_COMMON=y
883# CONFIG_VIDEO_ALLOW_V4L1 is not set
884CONFIG_VIDEO_V4L1_COMPAT=y
885# CONFIG_DVB_CORE is not set
886CONFIG_VIDEO_MEDIA=y
887
888#
889# Multimedia drivers
890#
891CONFIG_IR_CORE=y
892CONFIG_VIDEO_IR=y
893# CONFIG_MEDIA_ATTACH is not set
894CONFIG_MEDIA_TUNER=y
895# CONFIG_MEDIA_TUNER_CUSTOMISE is not set
896CONFIG_MEDIA_TUNER_SIMPLE=y
897CONFIG_MEDIA_TUNER_TDA8290=y
898CONFIG_MEDIA_TUNER_TDA9887=y
899CONFIG_MEDIA_TUNER_TEA5761=y
900CONFIG_MEDIA_TUNER_TEA5767=y
901CONFIG_MEDIA_TUNER_MT20XX=y
902CONFIG_MEDIA_TUNER_XC2028=y
903CONFIG_MEDIA_TUNER_XC5000=y
904CONFIG_MEDIA_TUNER_MC44S803=y
905CONFIG_VIDEO_V4L2=y
906CONFIG_VIDEO_CAPTURE_DRIVERS=y
907CONFIG_VIDEO_ADV_DEBUG=y
908# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set
909# CONFIG_VIDEO_HELPER_CHIPS_AUTO is not set
910CONFIG_VIDEO_IR_I2C=y
911
912#
913# Encoders/decoders and other helper chips
914#
915
916#
917# Audio decoders
918#
919# CONFIG_VIDEO_TVAUDIO is not set
920# CONFIG_VIDEO_TDA7432 is not set
921# CONFIG_VIDEO_TDA9840 is not set
922# CONFIG_VIDEO_TDA9875 is not set
923# CONFIG_VIDEO_TEA6415C is not set
924# CONFIG_VIDEO_TEA6420 is not set
925# CONFIG_VIDEO_MSP3400 is not set
926# CONFIG_VIDEO_CS5345 is not set
927# CONFIG_VIDEO_CS53L32A is not set
928# CONFIG_VIDEO_M52790 is not set
929# CONFIG_VIDEO_TLV320AIC23B is not set
930# CONFIG_VIDEO_WM8775 is not set
931# CONFIG_VIDEO_WM8739 is not set
932# CONFIG_VIDEO_VP27SMPX is not set
933
934#
935# RDS decoders
936#
937# CONFIG_VIDEO_SAA6588 is not set
938
939#
940# Video decoders
941#
942# CONFIG_VIDEO_ADV7180 is not set
943# CONFIG_VIDEO_BT819 is not set
944# CONFIG_VIDEO_BT856 is not set
945# CONFIG_VIDEO_BT866 is not set
946# CONFIG_VIDEO_KS0127 is not set
947# CONFIG_VIDEO_OV7670 is not set
948# CONFIG_VIDEO_MT9V011 is not set
949# CONFIG_VIDEO_TCM825X is not set
950# CONFIG_VIDEO_SAA7110 is not set
951CONFIG_VIDEO_SAA711X=y
952# CONFIG_VIDEO_SAA717X is not set
953# CONFIG_VIDEO_TVP514X is not set
954# CONFIG_VIDEO_TVP5150 is not set
955# CONFIG_VIDEO_VPX3220 is not set
956
957#
958# Video and audio decoders
959#
960# CONFIG_VIDEO_CX25840 is not set
961
962#
963# MPEG video encoders
964#
965# CONFIG_VIDEO_CX2341X is not set
966
967#
968# Video encoders
969#
970# CONFIG_VIDEO_SAA7127 is not set
971# CONFIG_VIDEO_SAA7185 is not set
972# CONFIG_VIDEO_ADV7170 is not set
973# CONFIG_VIDEO_ADV7175 is not set
974# CONFIG_VIDEO_THS7303 is not set
975# CONFIG_VIDEO_ADV7343 is not set
976
977#
978# Video improvement chips
979#
980# CONFIG_VIDEO_UPD64031A is not set
981# CONFIG_VIDEO_UPD64083 is not set
982# CONFIG_VIDEO_VIVI is not set
983# CONFIG_VIDEO_SAA5246A is not set
984# CONFIG_VIDEO_SAA5249 is not set
985# CONFIG_SOC_CAMERA is not set
986CONFIG_V4L_USB_DRIVERS=y
987# CONFIG_USB_VIDEO_CLASS is not set
988CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y
989CONFIG_USB_GSPCA=m
990# CONFIG_USB_M5602 is not set
991# CONFIG_USB_STV06XX is not set
992# CONFIG_USB_GL860 is not set
993# CONFIG_USB_GSPCA_CONEX is not set
994# CONFIG_USB_GSPCA_ETOMS is not set
995# CONFIG_USB_GSPCA_FINEPIX is not set
996# CONFIG_USB_GSPCA_JEILINJ is not set
997# CONFIG_USB_GSPCA_MARS is not set
998# CONFIG_USB_GSPCA_MR97310A is not set
999# CONFIG_USB_GSPCA_OV519 is not set
1000# CONFIG_USB_GSPCA_OV534 is not set
1001# CONFIG_USB_GSPCA_PAC207 is not set
1002# CONFIG_USB_GSPCA_PAC7302 is not set
1003# CONFIG_USB_GSPCA_PAC7311 is not set
1004# CONFIG_USB_GSPCA_SN9C20X is not set
1005# CONFIG_USB_GSPCA_SONIXB is not set
1006# CONFIG_USB_GSPCA_SONIXJ is not set
1007# CONFIG_USB_GSPCA_SPCA500 is not set
1008# CONFIG_USB_GSPCA_SPCA501 is not set
1009# CONFIG_USB_GSPCA_SPCA505 is not set
1010# CONFIG_USB_GSPCA_SPCA506 is not set
1011# CONFIG_USB_GSPCA_SPCA508 is not set
1012# CONFIG_USB_GSPCA_SPCA561 is not set
1013# CONFIG_USB_GSPCA_SQ905 is not set
1014# CONFIG_USB_GSPCA_SQ905C is not set
1015# CONFIG_USB_GSPCA_STK014 is not set
1016# CONFIG_USB_GSPCA_STV0680 is not set
1017# CONFIG_USB_GSPCA_SUNPLUS is not set
1018# CONFIG_USB_GSPCA_T613 is not set
1019# CONFIG_USB_GSPCA_TV8532 is not set
1020# CONFIG_USB_GSPCA_VC032X is not set
1021# CONFIG_USB_GSPCA_ZC3XX is not set
1022# CONFIG_VIDEO_PVRUSB2 is not set
1023# CONFIG_VIDEO_HDPVR is not set
1024# CONFIG_VIDEO_EM28XX is not set
1025# CONFIG_VIDEO_CX231XX is not set
1026# CONFIG_VIDEO_USBVISION is not set
1027# CONFIG_USB_ET61X251 is not set
1028# CONFIG_USB_SN9C102 is not set
1029# CONFIG_USB_ZC0301 is not set
1030CONFIG_USB_PWC_INPUT_EVDEV=y
1031# CONFIG_USB_ZR364XX is not set
1032# CONFIG_USB_STKWEBCAM is not set
1033# CONFIG_USB_S2255 is not set
1034CONFIG_RADIO_ADAPTERS=y
1035# CONFIG_I2C_SI4713 is not set
1036# CONFIG_RADIO_SI4713 is not set
1037# CONFIG_USB_DSBR is not set
1038# CONFIG_RADIO_SI470X is not set
1039# CONFIG_USB_MR800 is not set
1040# CONFIG_RADIO_TEA5764 is not set
1041# CONFIG_RADIO_TEF6862 is not set
1042# CONFIG_DAB is not set
1043
1044#
1045# Graphics support
1046#
1047# CONFIG_VGASTATE is not set
1048# CONFIG_VIDEO_OUTPUT_CONTROL is not set
1049CONFIG_FB=y
1050# CONFIG_FIRMWARE_EDID is not set
1051# CONFIG_FB_DDC is not set
1052# CONFIG_FB_BOOT_VESA_SUPPORT is not set
1053CONFIG_FB_CFB_FILLRECT=y
1054CONFIG_FB_CFB_COPYAREA=y
1055CONFIG_FB_CFB_IMAGEBLIT=y
1056# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
1057# CONFIG_FB_SYS_FILLRECT is not set
1058# CONFIG_FB_SYS_COPYAREA is not set
1059# CONFIG_FB_SYS_IMAGEBLIT is not set
1060# CONFIG_FB_FOREIGN_ENDIAN is not set
1061# CONFIG_FB_SYS_FOPS is not set
1062# CONFIG_FB_SVGALIB is not set
1063# CONFIG_FB_MACMODES is not set
1064# CONFIG_FB_BACKLIGHT is not set
1065# CONFIG_FB_MODE_HELPERS is not set
1066# CONFIG_FB_TILEBLITTING is not set
1067
1068#
1069# Frame buffer hardware drivers
1070#
1071# CONFIG_FB_OF is not set
1072# CONFIG_FB_VGA16 is not set
1073# CONFIG_FB_S1D13XXX is not set
1074CONFIG_FB_FSL_DIU=y
1075# CONFIG_FB_IBM_GXT4500 is not set
1076# CONFIG_FB_VIRTUAL is not set
1077# CONFIG_FB_METRONOME is not set
1078# CONFIG_FB_MB862XX is not set
1079# CONFIG_FB_BROADSHEET is not set
1080# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
1081
1082#
1083# Display device support
1084#
1085# CONFIG_DISPLAY_SUPPORT is not set
1086
1087#
1088# Console display driver support
1089#
1090# CONFIG_VGA_CONSOLE is not set
1091CONFIG_DUMMY_CONSOLE=y
1092CONFIG_FRAMEBUFFER_CONSOLE=y
1093# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
1094# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
1095# CONFIG_FONTS is not set
1096CONFIG_FONT_8x8=y
1097CONFIG_FONT_8x16=y
1098# CONFIG_LOGO is not set
1099# CONFIG_SOUND is not set
1100CONFIG_HID_SUPPORT=y
1101CONFIG_HID=y
1102# CONFIG_HIDRAW is not set
1103
1104#
1105# USB Input Devices
1106#
1107CONFIG_USB_HID=y
1108# CONFIG_HID_PID is not set
1109# CONFIG_USB_HIDDEV is not set
1110
1111#
1112# Special HID drivers
1113#
1114CONFIG_HID_A4TECH=y
1115CONFIG_HID_APPLE=y
1116CONFIG_HID_BELKIN=y
1117CONFIG_HID_CHERRY=y
1118CONFIG_HID_CHICONY=y
1119CONFIG_HID_CYPRESS=y
1120CONFIG_HID_DRAGONRISE=y
1121# CONFIG_DRAGONRISE_FF is not set
1122CONFIG_HID_EZKEY=y
1123CONFIG_HID_KYE=y
1124CONFIG_HID_GYRATION=y
1125CONFIG_HID_TWINHAN=y
1126CONFIG_HID_KENSINGTON=y
1127CONFIG_HID_LOGITECH=y
1128# CONFIG_LOGITECH_FF is not set
1129# CONFIG_LOGIRUMBLEPAD2_FF is not set
1130CONFIG_HID_MICROSOFT=y
1131CONFIG_HID_MONTEREY=y
1132CONFIG_HID_NTRIG=y
1133CONFIG_HID_PANTHERLORD=y
1134# CONFIG_PANTHERLORD_FF is not set
1135CONFIG_HID_PETALYNX=y
1136CONFIG_HID_SAMSUNG=y
1137CONFIG_HID_SONY=y
1138CONFIG_HID_SUNPLUS=y
1139CONFIG_HID_GREENASIA=y
1140# CONFIG_GREENASIA_FF is not set
1141CONFIG_HID_SMARTJOYPLUS=y
1142# CONFIG_SMARTJOYPLUS_FF is not set
1143CONFIG_HID_TOPSEED=y
1144CONFIG_HID_THRUSTMASTER=y
1145# CONFIG_THRUSTMASTER_FF is not set
1146CONFIG_HID_ZEROPLUS=y
1147# CONFIG_ZEROPLUS_FF is not set
1148CONFIG_USB_SUPPORT=y
1149CONFIG_USB_ARCH_HAS_HCD=y
1150# CONFIG_USB_ARCH_HAS_OHCI is not set
1151CONFIG_USB_ARCH_HAS_EHCI=y
1152CONFIG_USB=y
1153# CONFIG_USB_DEBUG is not set
1154# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
1155
1156#
1157# Miscellaneous USB options
1158#
1159# CONFIG_USB_DEVICEFS is not set
1160CONFIG_USB_DEVICE_CLASS=y
1161# CONFIG_USB_DYNAMIC_MINORS is not set
1162# CONFIG_USB_OTG is not set
1163# CONFIG_USB_MON is not set
1164# CONFIG_USB_WUSB is not set
1165# CONFIG_USB_WUSB_CBAF is not set
1166
1167#
1168# USB Host Controller Drivers
1169#
1170# CONFIG_USB_C67X00_HCD is not set
1171CONFIG_USB_EHCI_HCD=y
1172CONFIG_USB_EHCI_ROOT_HUB_TT=y
1173# CONFIG_USB_EHCI_TT_NEWSCHED is not set
1174CONFIG_USB_EHCI_BIG_ENDIAN_MMIO=y
1175CONFIG_USB_EHCI_BIG_ENDIAN_DESC=y
1176# CONFIG_XPS_USB_HCD_XILINX is not set
1177CONFIG_USB_EHCI_FSL=y
1178CONFIG_USB_EHCI_HCD_PPC_OF=y
1179# CONFIG_USB_OXU210HP_HCD is not set
1180# CONFIG_USB_ISP116X_HCD is not set
1181# CONFIG_USB_ISP1760_HCD is not set
1182# CONFIG_USB_ISP1362_HCD is not set
1183# CONFIG_USB_SL811_HCD is not set
1184# CONFIG_USB_R8A66597_HCD is not set
1185# CONFIG_USB_HWA_HCD is not set
1186
1187#
1188# USB Device Class drivers
1189#
1190# CONFIG_USB_ACM is not set
1191# CONFIG_USB_PRINTER is not set
1192# CONFIG_USB_WDM is not set
1193# CONFIG_USB_TMC is not set
1194
1195#
1196# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
1197#
1198
1199#
1200# also be needed; see USB_STORAGE Help for more info
1201#
1202CONFIG_USB_STORAGE=y
1203# CONFIG_USB_STORAGE_DEBUG is not set
1204# CONFIG_USB_STORAGE_DATAFAB is not set
1205# CONFIG_USB_STORAGE_FREECOM is not set
1206# CONFIG_USB_STORAGE_ISD200 is not set
1207# CONFIG_USB_STORAGE_USBAT is not set
1208# CONFIG_USB_STORAGE_SDDR09 is not set
1209# CONFIG_USB_STORAGE_SDDR55 is not set
1210# CONFIG_USB_STORAGE_JUMPSHOT is not set
1211# CONFIG_USB_STORAGE_ALAUDA is not set
1212# CONFIG_USB_STORAGE_ONETOUCH is not set
1213# CONFIG_USB_STORAGE_KARMA is not set
1214# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
1215# CONFIG_USB_LIBUSUAL is not set
1216
1217#
1218# USB Imaging devices
1219#
1220# CONFIG_USB_MDC800 is not set
1221# CONFIG_USB_MICROTEK is not set
1222
1223#
1224# USB port drivers
1225#
1226# CONFIG_USB_SERIAL is not set
1227
1228#
1229# USB Miscellaneous drivers
1230#
1231# CONFIG_USB_EMI62 is not set
1232# CONFIG_USB_EMI26 is not set
1233# CONFIG_USB_ADUTUX is not set
1234# CONFIG_USB_SEVSEG is not set
1235# CONFIG_USB_RIO500 is not set
1236# CONFIG_USB_LEGOTOWER is not set
1237# CONFIG_USB_LCD is not set
1238# CONFIG_USB_BERRY_CHARGE is not set
1239# CONFIG_USB_LED is not set
1240# CONFIG_USB_CYPRESS_CY7C63 is not set
1241# CONFIG_USB_CYTHERM is not set
1242# CONFIG_USB_IDMOUSE is not set
1243# CONFIG_USB_FTDI_ELAN is not set
1244# CONFIG_USB_APPLEDISPLAY is not set
1245# CONFIG_USB_SISUSBVGA is not set
1246# CONFIG_USB_LD is not set
1247# CONFIG_USB_TRANCEVIBRATOR is not set
1248# CONFIG_USB_IOWARRIOR is not set
1249# CONFIG_USB_TEST is not set
1250# CONFIG_USB_ISIGHTFW is not set
1251# CONFIG_USB_VST is not set
1252# CONFIG_USB_GADGET is not set
1253
1254#
1255# OTG and related infrastructure
1256#
1257# CONFIG_NOP_USB_XCEIV is not set
1258# CONFIG_MMC is not set
1259# CONFIG_MEMSTICK is not set
1260# CONFIG_NEW_LEDS is not set
1261# CONFIG_ACCESSIBILITY is not set
1262# CONFIG_EDAC is not set
1263CONFIG_RTC_LIB=y
1264CONFIG_RTC_CLASS=y
1265CONFIG_RTC_HCTOSYS=y
1266CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
1267# CONFIG_RTC_DEBUG is not set
1268
1269#
1270# RTC interfaces
1271#
1272CONFIG_RTC_INTF_SYSFS=y
1273CONFIG_RTC_INTF_PROC=y
1274CONFIG_RTC_INTF_DEV=y
1275# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
1276# CONFIG_RTC_DRV_TEST is not set
1277
1278#
1279# I2C RTC drivers
1280#
1281# CONFIG_RTC_DRV_DS1307 is not set
1282# CONFIG_RTC_DRV_DS1374 is not set
1283# CONFIG_RTC_DRV_DS1672 is not set
1284# CONFIG_RTC_DRV_MAX6900 is not set
1285# CONFIG_RTC_DRV_RS5C372 is not set
1286# CONFIG_RTC_DRV_ISL1208 is not set
1287# CONFIG_RTC_DRV_X1205 is not set
1288# CONFIG_RTC_DRV_PCF8563 is not set
1289# CONFIG_RTC_DRV_PCF8583 is not set
1290CONFIG_RTC_DRV_M41T80=y
1291# CONFIG_RTC_DRV_M41T80_WDT is not set
1292# CONFIG_RTC_DRV_BQ32K is not set
1293# CONFIG_RTC_DRV_S35390A is not set
1294# CONFIG_RTC_DRV_FM3130 is not set
1295# CONFIG_RTC_DRV_RX8581 is not set
1296# CONFIG_RTC_DRV_RX8025 is not set
1297
1298#
1299# SPI RTC drivers
1300#
1301
1302#
1303# Platform RTC drivers
1304#
1305# CONFIG_RTC_DRV_CMOS is not set
1306# CONFIG_RTC_DRV_DS1286 is not set
1307# CONFIG_RTC_DRV_DS1511 is not set
1308# CONFIG_RTC_DRV_DS1553 is not set
1309# CONFIG_RTC_DRV_DS1742 is not set
1310# CONFIG_RTC_DRV_STK17TA8 is not set
1311# CONFIG_RTC_DRV_M48T86 is not set
1312# CONFIG_RTC_DRV_M48T35 is not set
1313# CONFIG_RTC_DRV_M48T59 is not set
1314# CONFIG_RTC_DRV_MSM6242 is not set
1315# CONFIG_RTC_DRV_BQ4802 is not set
1316# CONFIG_RTC_DRV_RP5C01 is not set
1317# CONFIG_RTC_DRV_V3020 is not set
1318
1319#
1320# on-CPU RTC drivers
1321#
1322# CONFIG_RTC_DRV_GENERIC is not set
1323CONFIG_RTC_DRV_MPC5121=y
1324CONFIG_DMADEVICES=y
1325
1326#
1327# DMA Devices
1328#
1329# CONFIG_FSL_DMA is not set
1330CONFIG_MPC512X_DMA=y
1331CONFIG_DMA_ENGINE=y
1332
1333#
1334# DMA Clients
1335#
1336# CONFIG_NET_DMA is not set
1337# CONFIG_ASYNC_TX_DMA is not set
1338# CONFIG_DMATEST is not set
1339# CONFIG_AUXDISPLAY is not set
1340# CONFIG_UIO is not set
1341
1342#
1343# TI VLYNQ
1344#
1345# CONFIG_STAGING is not set
1346
1347#
1348# File systems
1349#
1350CONFIG_EXT2_FS=y
1351# CONFIG_EXT2_FS_XATTR is not set
1352CONFIG_EXT2_FS_XIP=y
1353CONFIG_EXT3_FS=y
1354# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
1355CONFIG_EXT3_FS_XATTR=y
1356# CONFIG_EXT3_FS_POSIX_ACL is not set
1357# CONFIG_EXT3_FS_SECURITY is not set
1358# CONFIG_EXT4_FS is not set
1359CONFIG_FS_XIP=y
1360CONFIG_JBD=y
1361CONFIG_FS_MBCACHE=y
1362# CONFIG_REISERFS_FS is not set
1363# CONFIG_JFS_FS is not set
1364# CONFIG_FS_POSIX_ACL is not set
1365# CONFIG_XFS_FS is not set
1366# CONFIG_GFS2_FS is not set
1367# CONFIG_OCFS2_FS is not set
1368# CONFIG_BTRFS_FS is not set
1369# CONFIG_NILFS2_FS is not set
1370CONFIG_FILE_LOCKING=y
1371CONFIG_FSNOTIFY=y
1372# CONFIG_DNOTIFY is not set
1373# CONFIG_INOTIFY is not set
1374CONFIG_INOTIFY_USER=y
1375# CONFIG_QUOTA is not set
1376# CONFIG_AUTOFS_FS is not set
1377# CONFIG_AUTOFS4_FS is not set
1378# CONFIG_FUSE_FS is not set
1379
1380#
1381# Caches
1382#
1383# CONFIG_FSCACHE is not set
1384
1385#
1386# CD-ROM/DVD Filesystems
1387#
1388# CONFIG_ISO9660_FS is not set
1389# CONFIG_UDF_FS is not set
1390
1391#
1392# DOS/FAT/NT Filesystems
1393#
1394CONFIG_FAT_FS=y
1395# CONFIG_MSDOS_FS is not set
1396CONFIG_VFAT_FS=y
1397CONFIG_FAT_DEFAULT_CODEPAGE=437
1398CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1399# CONFIG_NTFS_FS is not set
1400
1401#
1402# Pseudo filesystems
1403#
1404CONFIG_PROC_FS=y
1405# CONFIG_PROC_KCORE is not set
1406CONFIG_PROC_SYSCTL=y
1407CONFIG_PROC_PAGE_MONITOR=y
1408CONFIG_SYSFS=y
1409CONFIG_TMPFS=y
1410# CONFIG_TMPFS_POSIX_ACL is not set
1411# CONFIG_HUGETLB_PAGE is not set
1412# CONFIG_CONFIGFS_FS is not set
1413CONFIG_MISC_FILESYSTEMS=y
1414# CONFIG_ADFS_FS is not set
1415# CONFIG_AFFS_FS is not set
1416# CONFIG_HFS_FS is not set
1417# CONFIG_HFSPLUS_FS is not set
1418# CONFIG_BEFS_FS is not set
1419# CONFIG_BFS_FS is not set
1420# CONFIG_EFS_FS is not set
1421CONFIG_JFFS2_FS=y
1422CONFIG_JFFS2_FS_DEBUG=0
1423CONFIG_JFFS2_FS_WRITEBUFFER=y
1424# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
1425# CONFIG_JFFS2_SUMMARY is not set
1426# CONFIG_JFFS2_FS_XATTR is not set
1427# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
1428CONFIG_JFFS2_ZLIB=y
1429# CONFIG_JFFS2_LZO is not set
1430CONFIG_JFFS2_RTIME=y
1431# CONFIG_JFFS2_RUBIN is not set
1432CONFIG_UBIFS_FS=y
1433# CONFIG_UBIFS_FS_XATTR is not set
1434# CONFIG_UBIFS_FS_ADVANCED_COMPR is not set
1435CONFIG_UBIFS_FS_LZO=y
1436CONFIG_UBIFS_FS_ZLIB=y
1437# CONFIG_UBIFS_FS_DEBUG is not set
1438# CONFIG_CRAMFS is not set
1439# CONFIG_SQUASHFS is not set
1440# CONFIG_VXFS_FS is not set
1441# CONFIG_MINIX_FS is not set
1442# CONFIG_OMFS_FS is not set
1443# CONFIG_HPFS_FS is not set
1444# CONFIG_QNX4FS_FS is not set
1445# CONFIG_ROMFS_FS is not set
1446# CONFIG_SYSV_FS is not set
1447# CONFIG_UFS_FS is not set
1448CONFIG_NETWORK_FILESYSTEMS=y
1449CONFIG_NFS_FS=y
1450CONFIG_NFS_V3=y
1451# CONFIG_NFS_V3_ACL is not set
1452# CONFIG_NFS_V4 is not set
1453CONFIG_ROOT_NFS=y
1454# CONFIG_NFSD is not set
1455CONFIG_LOCKD=y
1456CONFIG_LOCKD_V4=y
1457CONFIG_NFS_COMMON=y
1458CONFIG_SUNRPC=y
1459# CONFIG_RPCSEC_GSS_KRB5 is not set
1460# CONFIG_RPCSEC_GSS_SPKM3 is not set
1461# CONFIG_SMB_FS is not set
1462# CONFIG_CIFS is not set
1463# CONFIG_NCP_FS is not set
1464# CONFIG_CODA_FS is not set
1465# CONFIG_AFS_FS is not set
1466
1467#
1468# Partition Types
1469#
1470CONFIG_PARTITION_ADVANCED=y
1471# CONFIG_ACORN_PARTITION is not set
1472# CONFIG_OSF_PARTITION is not set
1473# CONFIG_AMIGA_PARTITION is not set
1474# CONFIG_ATARI_PARTITION is not set
1475# CONFIG_MAC_PARTITION is not set
1476CONFIG_MSDOS_PARTITION=y
1477# CONFIG_BSD_DISKLABEL is not set
1478# CONFIG_MINIX_SUBPARTITION is not set
1479# CONFIG_SOLARIS_X86_PARTITION is not set
1480# CONFIG_UNIXWARE_DISKLABEL is not set
1481# CONFIG_LDM_PARTITION is not set
1482# CONFIG_SGI_PARTITION is not set
1483# CONFIG_ULTRIX_PARTITION is not set
1484# CONFIG_SUN_PARTITION is not set
1485# CONFIG_KARMA_PARTITION is not set
1486# CONFIG_EFI_PARTITION is not set
1487# CONFIG_SYSV68_PARTITION is not set
1488CONFIG_NLS=y
1489CONFIG_NLS_DEFAULT="iso8859-1"
1490CONFIG_NLS_CODEPAGE_437=y
1491# CONFIG_NLS_CODEPAGE_737 is not set
1492# CONFIG_NLS_CODEPAGE_775 is not set
1493# CONFIG_NLS_CODEPAGE_850 is not set
1494# CONFIG_NLS_CODEPAGE_852 is not set
1495# CONFIG_NLS_CODEPAGE_855 is not set
1496# CONFIG_NLS_CODEPAGE_857 is not set
1497# CONFIG_NLS_CODEPAGE_860 is not set
1498# CONFIG_NLS_CODEPAGE_861 is not set
1499# CONFIG_NLS_CODEPAGE_862 is not set
1500# CONFIG_NLS_CODEPAGE_863 is not set
1501# CONFIG_NLS_CODEPAGE_864 is not set
1502# CONFIG_NLS_CODEPAGE_865 is not set
1503# CONFIG_NLS_CODEPAGE_866 is not set
1504# CONFIG_NLS_CODEPAGE_869 is not set
1505# CONFIG_NLS_CODEPAGE_936 is not set
1506# CONFIG_NLS_CODEPAGE_950 is not set
1507# CONFIG_NLS_CODEPAGE_932 is not set
1508# CONFIG_NLS_CODEPAGE_949 is not set
1509# CONFIG_NLS_CODEPAGE_874 is not set
1510# CONFIG_NLS_ISO8859_8 is not set
1511# CONFIG_NLS_CODEPAGE_1250 is not set
1512# CONFIG_NLS_CODEPAGE_1251 is not set
1513# CONFIG_NLS_ASCII is not set
1514CONFIG_NLS_ISO8859_1=y
1515# CONFIG_NLS_ISO8859_2 is not set
1516# CONFIG_NLS_ISO8859_3 is not set
1517# CONFIG_NLS_ISO8859_4 is not set
1518# CONFIG_NLS_ISO8859_5 is not set
1519# CONFIG_NLS_ISO8859_6 is not set
1520# CONFIG_NLS_ISO8859_7 is not set
1521# CONFIG_NLS_ISO8859_9 is not set
1522# CONFIG_NLS_ISO8859_13 is not set
1523# CONFIG_NLS_ISO8859_14 is not set
1524# CONFIG_NLS_ISO8859_15 is not set
1525# CONFIG_NLS_KOI8_R is not set
1526# CONFIG_NLS_KOI8_U is not set
1527# CONFIG_NLS_UTF8 is not set
1528# CONFIG_DLM is not set
1529# CONFIG_BINARY_PRINTF is not set
1530
1531#
1532# Library routines
1533#
1534CONFIG_BITREVERSE=y
1535CONFIG_GENERIC_FIND_LAST_BIT=y
1536# CONFIG_CRC_CCITT is not set
1537CONFIG_CRC16=y
1538# CONFIG_CRC_T10DIF is not set
1539# CONFIG_CRC_ITU_T is not set
1540CONFIG_CRC32=y
1541# CONFIG_CRC7 is not set
1542# CONFIG_LIBCRC32C is not set
1543CONFIG_ZLIB_INFLATE=y
1544CONFIG_ZLIB_DEFLATE=y
1545CONFIG_LZO_COMPRESS=y
1546CONFIG_LZO_DECOMPRESS=y
1547CONFIG_DECOMPRESS_GZIP=y
1548CONFIG_DECOMPRESS_BZIP2=y
1549CONFIG_DECOMPRESS_LZMA=y
1550CONFIG_DECOMPRESS_LZO=y
1551CONFIG_HAS_IOMEM=y
1552CONFIG_HAS_IOPORT=y
1553CONFIG_HAS_DMA=y
1554CONFIG_HAVE_LMB=y
1555CONFIG_NLATTR=y
1556CONFIG_GENERIC_ATOMIC64=y
1557
1558#
1559# Kernel hacking
1560#
1561# CONFIG_PRINTK_TIME is not set
1562# CONFIG_ENABLE_WARN_DEPRECATED is not set
1563# CONFIG_ENABLE_MUST_CHECK is not set
1564CONFIG_FRAME_WARN=1024
1565# CONFIG_MAGIC_SYSRQ is not set
1566# CONFIG_STRIP_ASM_SYMS is not set
1567# CONFIG_UNUSED_SYMBOLS is not set
1568# CONFIG_DEBUG_FS is not set
1569# CONFIG_HEADERS_CHECK is not set
1570# CONFIG_DEBUG_KERNEL is not set
1571CONFIG_DEBUG_BUGVERBOSE=y
1572CONFIG_DEBUG_MEMORY_INIT=y
1573# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1574# CONFIG_LATENCYTOP is not set
1575# CONFIG_SYSCTL_SYSCALL_CHECK is not set
1576CONFIG_HAVE_FUNCTION_TRACER=y
1577CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1578CONFIG_HAVE_DYNAMIC_FTRACE=y
1579CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1580CONFIG_TRACING_SUPPORT=y
1581# CONFIG_FTRACE is not set
1582# CONFIG_DMA_API_DEBUG is not set
1583# CONFIG_SAMPLES is not set
1584CONFIG_HAVE_ARCH_KGDB=y
1585# CONFIG_PPC_DISABLE_WERROR is not set
1586CONFIG_PPC_WERROR=y
1587CONFIG_PRINT_STACK_DEPTH=64
1588# CONFIG_IRQSTACKS is not set
1589# CONFIG_BOOTX_TEXT is not set
1590# CONFIG_PPC_EARLY_DEBUG is not set
1591
1592#
1593# Security options
1594#
1595# CONFIG_KEYS is not set
1596# CONFIG_SECURITY is not set
1597# CONFIG_SECURITYFS is not set
1598# CONFIG_DEFAULT_SECURITY_SELINUX is not set
1599# CONFIG_DEFAULT_SECURITY_SMACK is not set
1600# CONFIG_DEFAULT_SECURITY_TOMOYO is not set
1601CONFIG_DEFAULT_SECURITY_DAC=y
1602CONFIG_DEFAULT_SECURITY=""
1603CONFIG_CRYPTO=y
1604
1605#
1606# Crypto core or helper
1607#
1608CONFIG_CRYPTO_ALGAPI=y
1609CONFIG_CRYPTO_ALGAPI2=y
1610# CONFIG_CRYPTO_MANAGER is not set
1611# CONFIG_CRYPTO_MANAGER2 is not set
1612# CONFIG_CRYPTO_GF128MUL is not set
1613# CONFIG_CRYPTO_NULL is not set
1614# CONFIG_CRYPTO_CRYPTD is not set
1615# CONFIG_CRYPTO_AUTHENC is not set
1616# CONFIG_CRYPTO_TEST is not set
1617
1618#
1619# Authenticated Encryption with Associated Data
1620#
1621# CONFIG_CRYPTO_CCM is not set
1622# CONFIG_CRYPTO_GCM is not set
1623# CONFIG_CRYPTO_SEQIV is not set
1624
1625#
1626# Block modes
1627#
1628# CONFIG_CRYPTO_CBC is not set
1629# CONFIG_CRYPTO_CTR is not set
1630# CONFIG_CRYPTO_CTS is not set
1631# CONFIG_CRYPTO_ECB is not set
1632# CONFIG_CRYPTO_LRW is not set
1633# CONFIG_CRYPTO_PCBC is not set
1634# CONFIG_CRYPTO_XTS is not set
1635
1636#
1637# Hash modes
1638#
1639# CONFIG_CRYPTO_HMAC is not set
1640# CONFIG_CRYPTO_XCBC is not set
1641# CONFIG_CRYPTO_VMAC is not set
1642
1643#
1644# Digest
1645#
1646# CONFIG_CRYPTO_CRC32C is not set
1647# CONFIG_CRYPTO_GHASH is not set
1648# CONFIG_CRYPTO_MD4 is not set
1649# CONFIG_CRYPTO_MD5 is not set
1650# CONFIG_CRYPTO_MICHAEL_MIC is not set
1651# CONFIG_CRYPTO_RMD128 is not set
1652# CONFIG_CRYPTO_RMD160 is not set
1653# CONFIG_CRYPTO_RMD256 is not set
1654# CONFIG_CRYPTO_RMD320 is not set
1655# CONFIG_CRYPTO_SHA1 is not set
1656# CONFIG_CRYPTO_SHA256 is not set
1657# CONFIG_CRYPTO_SHA512 is not set
1658# CONFIG_CRYPTO_TGR192 is not set
1659# CONFIG_CRYPTO_WP512 is not set
1660
1661#
1662# Ciphers
1663#
1664# CONFIG_CRYPTO_AES is not set
1665# CONFIG_CRYPTO_ANUBIS is not set
1666# CONFIG_CRYPTO_ARC4 is not set
1667# CONFIG_CRYPTO_BLOWFISH is not set
1668# CONFIG_CRYPTO_CAMELLIA is not set
1669# CONFIG_CRYPTO_CAST5 is not set
1670# CONFIG_CRYPTO_CAST6 is not set
1671# CONFIG_CRYPTO_DES is not set
1672# CONFIG_CRYPTO_FCRYPT is not set
1673# CONFIG_CRYPTO_KHAZAD is not set
1674# CONFIG_CRYPTO_SALSA20 is not set
1675# CONFIG_CRYPTO_SEED is not set
1676# CONFIG_CRYPTO_SERPENT is not set
1677# CONFIG_CRYPTO_TEA is not set
1678# CONFIG_CRYPTO_TWOFISH is not set
1679
1680#
1681# Compression
1682#
1683CONFIG_CRYPTO_DEFLATE=y
1684# CONFIG_CRYPTO_ZLIB is not set
1685CONFIG_CRYPTO_LZO=y
1686
1687#
1688# Random Number Generation
1689#
1690# CONFIG_CRYPTO_ANSI_CPRNG is not set
1691# CONFIG_CRYPTO_HW is not set
1692CONFIG_PPC_CLOCK=y
1693CONFIG_PPC_LIB_RHEAP=y
1694# CONFIG_VIRTUALIZATION is not set
diff --git a/arch/powerpc/configs/ppc64_defconfig b/arch/powerpc/configs/ppc64_defconfig
index 7b3804a6e363..b5b259960794 100644
--- a/arch/powerpc/configs/ppc64_defconfig
+++ b/arch/powerpc/configs/ppc64_defconfig
@@ -137,8 +137,9 @@ CONFIG_TRACEPOINTS=y
137CONFIG_MARKERS=y 137CONFIG_MARKERS=y
138CONFIG_OPROFILE=y 138CONFIG_OPROFILE=y
139CONFIG_HAVE_OPROFILE=y 139CONFIG_HAVE_OPROFILE=y
140# CONFIG_KPROBES is not set 140CONFIG_KPROBES=y
141CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y 141CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
142CONFIG_KRETPROBES=y
142CONFIG_HAVE_IOREMAP_PROT=y 143CONFIG_HAVE_IOREMAP_PROT=y
143CONFIG_HAVE_KPROBES=y 144CONFIG_HAVE_KPROBES=y
144CONFIG_HAVE_KRETPROBES=y 145CONFIG_HAVE_KRETPROBES=y
@@ -191,6 +192,7 @@ CONFIG_SCANLOG=m
191CONFIG_LPARCFG=y 192CONFIG_LPARCFG=y
192CONFIG_PPC_SMLPAR=y 193CONFIG_PPC_SMLPAR=y
193CONFIG_CMM=y 194CONFIG_CMM=y
195CONFIG_DTL=y
194CONFIG_PPC_ISERIES=y 196CONFIG_PPC_ISERIES=y
195 197
196# 198#
@@ -328,9 +330,10 @@ CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
328CONFIG_KEXEC=y 330CONFIG_KEXEC=y
329# CONFIG_PHYP_DUMP is not set 331# CONFIG_PHYP_DUMP is not set
330CONFIG_IRQ_ALL_CPUS=y 332CONFIG_IRQ_ALL_CPUS=y
331# CONFIG_NUMA is not set 333CONFIG_NUMA=y
334CONFIG_NODES_SHIFT=8
335CONFIG_MAX_ACTIVE_REGIONS=256
332CONFIG_ARCH_SELECT_MEMORY_MODEL=y 336CONFIG_ARCH_SELECT_MEMORY_MODEL=y
333CONFIG_ARCH_FLATMEM_ENABLE=y
334CONFIG_ARCH_SPARSEMEM_ENABLE=y 337CONFIG_ARCH_SPARSEMEM_ENABLE=y
335CONFIG_ARCH_SPARSEMEM_DEFAULT=y 338CONFIG_ARCH_SPARSEMEM_DEFAULT=y
336CONFIG_ARCH_POPULATES_NODE_MAP=y 339CONFIG_ARCH_POPULATES_NODE_MAP=y
@@ -339,6 +342,7 @@ CONFIG_SELECT_MEMORY_MODEL=y
339# CONFIG_DISCONTIGMEM_MANUAL is not set 342# CONFIG_DISCONTIGMEM_MANUAL is not set
340CONFIG_SPARSEMEM_MANUAL=y 343CONFIG_SPARSEMEM_MANUAL=y
341CONFIG_SPARSEMEM=y 344CONFIG_SPARSEMEM=y
345CONFIG_NEED_MULTIPLE_NODES=y
342CONFIG_HAVE_MEMORY_PRESENT=y 346CONFIG_HAVE_MEMORY_PRESENT=y
343CONFIG_SPARSEMEM_EXTREME=y 347CONFIG_SPARSEMEM_EXTREME=y
344CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y 348CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
@@ -354,11 +358,12 @@ CONFIG_PHYS_ADDR_T_64BIT=y
354CONFIG_ZONE_DMA_FLAG=1 358CONFIG_ZONE_DMA_FLAG=1
355CONFIG_BOUNCE=y 359CONFIG_BOUNCE=y
356CONFIG_UNEVICTABLE_LRU=y 360CONFIG_UNEVICTABLE_LRU=y
361CONFIG_NODES_SPAN_OTHER_NODES=y
357CONFIG_ARCH_MEMORY_PROBE=y 362CONFIG_ARCH_MEMORY_PROBE=y
358CONFIG_PPC_HAS_HASH_64K=y 363CONFIG_PPC_HAS_HASH_64K=y
359# CONFIG_PPC_64K_PAGES is not set 364# CONFIG_PPC_64K_PAGES is not set
360CONFIG_FORCE_MAX_ZONEORDER=13 365CONFIG_FORCE_MAX_ZONEORDER=13
361# CONFIG_SCHED_SMT is not set 366CONFIG_SCHED_SMT=y
362CONFIG_PROC_DEVICETREE=y 367CONFIG_PROC_DEVICETREE=y
363# CONFIG_CMDLINE_BOOL is not set 368# CONFIG_CMDLINE_BOOL is not set
364CONFIG_EXTRA_TARGETS="" 369CONFIG_EXTRA_TARGETS=""
@@ -790,12 +795,12 @@ CONFIG_SCSI_IPR=y
790CONFIG_SCSI_IPR_TRACE=y 795CONFIG_SCSI_IPR_TRACE=y
791CONFIG_SCSI_IPR_DUMP=y 796CONFIG_SCSI_IPR_DUMP=y
792# CONFIG_SCSI_QLOGIC_1280 is not set 797# CONFIG_SCSI_QLOGIC_1280 is not set
793# CONFIG_SCSI_QLA_FC is not set 798CONFIG_SCSI_QLA_FC=m
794# CONFIG_SCSI_QLA_ISCSI is not set 799# CONFIG_SCSI_QLA_ISCSI is not set
795CONFIG_SCSI_LPFC=m 800CONFIG_SCSI_LPFC=m
796# CONFIG_SCSI_DC395x is not set 801# CONFIG_SCSI_DC395x is not set
797# CONFIG_SCSI_DC390T is not set 802# CONFIG_SCSI_DC390T is not set
798CONFIG_SCSI_DEBUG=m 803# CONFIG_SCSI_DEBUG is not set
799# CONFIG_SCSI_SRP is not set 804# CONFIG_SCSI_SRP is not set
800# CONFIG_SCSI_LOWLEVEL_PCMCIA is not set 805# CONFIG_SCSI_LOWLEVEL_PCMCIA is not set
801# CONFIG_SCSI_DH is not set 806# CONFIG_SCSI_DH is not set
@@ -867,9 +872,8 @@ CONFIG_MD_AUTODETECT=y
867CONFIG_MD_LINEAR=y 872CONFIG_MD_LINEAR=y
868CONFIG_MD_RAID0=y 873CONFIG_MD_RAID0=y
869CONFIG_MD_RAID1=y 874CONFIG_MD_RAID1=y
870CONFIG_MD_RAID10=y 875CONFIG_MD_RAID10=m
871CONFIG_MD_RAID456=y 876CONFIG_MD_RAID456=m
872CONFIG_MD_RAID5_RESHAPE=y
873CONFIG_MD_MULTIPATH=m 877CONFIG_MD_MULTIPATH=m
874CONFIG_MD_FAULTY=m 878CONFIG_MD_FAULTY=m
875CONFIG_BLK_DEV_DM=y 879CONFIG_BLK_DEV_DM=y
@@ -984,7 +988,7 @@ CONFIG_ACENIC=m
984CONFIG_ACENIC_OMIT_TIGON_I=y 988CONFIG_ACENIC_OMIT_TIGON_I=y
985# CONFIG_DL2K is not set 989# CONFIG_DL2K is not set
986CONFIG_E1000=y 990CONFIG_E1000=y
987# CONFIG_E1000E is not set 991CONFIG_E1000E=m
988# CONFIG_IP1000 is not set 992# CONFIG_IP1000 is not set
989# CONFIG_IGB is not set 993# CONFIG_IGB is not set
990# CONFIG_NS83820 is not set 994# CONFIG_NS83820 is not set
@@ -1006,19 +1010,19 @@ CONFIG_GELIC_WIRELESS=y
1006# CONFIG_ATL1E is not set 1010# CONFIG_ATL1E is not set
1007# CONFIG_JME is not set 1011# CONFIG_JME is not set
1008CONFIG_NETDEV_10000=y 1012CONFIG_NETDEV_10000=y
1009# CONFIG_CHELSIO_T1 is not set 1013CONFIG_CHELSIO_T1=m
1010# CONFIG_CHELSIO_T3 is not set 1014CONFIG_CHELSIO_T3=m
1011CONFIG_EHEA=m 1015CONFIG_EHEA=m
1012# CONFIG_ENIC is not set 1016# CONFIG_ENIC is not set
1013# CONFIG_IXGBE is not set 1017CONFIG_IXGBE=m
1014CONFIG_IXGB=m 1018CONFIG_IXGB=m
1015# CONFIG_S2IO is not set 1019CONFIG_S2IO=m
1016# CONFIG_MYRI10GE is not set 1020CONFIG_MYRI10GE=m
1017# CONFIG_NETXEN_NIC is not set 1021CONFIG_NETXEN_NIC=m
1018# CONFIG_NIU is not set 1022# CONFIG_NIU is not set
1019CONFIG_PASEMI_MAC=y 1023CONFIG_PASEMI_MAC=y
1020# CONFIG_MLX4_EN is not set 1024CONFIG_MLX4_EN=m
1021# CONFIG_MLX4_CORE is not set 1025CONFIG_MLX4_CORE=m
1022# CONFIG_TEHUTI is not set 1026# CONFIG_TEHUTI is not set
1023# CONFIG_BNX2X is not set 1027# CONFIG_BNX2X is not set
1024# CONFIG_QLGE is not set 1028# CONFIG_QLGE is not set
@@ -1169,7 +1173,7 @@ CONFIG_SERIAL_TXX9=y
1169CONFIG_HAS_TXX9_SERIAL=y 1173CONFIG_HAS_TXX9_SERIAL=y
1170CONFIG_SERIAL_TXX9_NR_UARTS=6 1174CONFIG_SERIAL_TXX9_NR_UARTS=6
1171CONFIG_SERIAL_TXX9_CONSOLE=y 1175CONFIG_SERIAL_TXX9_CONSOLE=y
1172# CONFIG_SERIAL_JSM is not set 1176CONFIG_SERIAL_JSM=m
1173# CONFIG_SERIAL_OF_PLATFORM is not set 1177# CONFIG_SERIAL_OF_PLATFORM is not set
1174CONFIG_UNIX98_PTYS=y 1178CONFIG_UNIX98_PTYS=y
1175CONFIG_LEGACY_PTYS=y 1179CONFIG_LEGACY_PTYS=y
@@ -1586,7 +1590,7 @@ CONFIG_USB_DEVICEFS=y
1586CONFIG_USB_DEVICE_CLASS=y 1590CONFIG_USB_DEVICE_CLASS=y
1587# CONFIG_USB_DYNAMIC_MINORS is not set 1591# CONFIG_USB_DYNAMIC_MINORS is not set
1588# CONFIG_USB_OTG is not set 1592# CONFIG_USB_OTG is not set
1589# CONFIG_USB_MON is not set 1593CONFIG_USB_MON=m
1590# CONFIG_USB_WUSB is not set 1594# CONFIG_USB_WUSB is not set
1591# CONFIG_USB_WUSB_CBAF is not set 1595# CONFIG_USB_WUSB_CBAF is not set
1592 1596
@@ -1686,21 +1690,22 @@ CONFIG_USB_APPLEDISPLAY=m
1686# CONFIG_NEW_LEDS is not set 1690# CONFIG_NEW_LEDS is not set
1687# CONFIG_ACCESSIBILITY is not set 1691# CONFIG_ACCESSIBILITY is not set
1688CONFIG_INFINIBAND=m 1692CONFIG_INFINIBAND=m
1689# CONFIG_INFINIBAND_USER_MAD is not set 1693CONFIG_INFINIBAND_USER_MAD=m
1690# CONFIG_INFINIBAND_USER_ACCESS is not set 1694CONFIG_INFINIBAND_USER_ACCESS=m
1695CONFIG_INFINIBAND_USER_MEM=y
1691CONFIG_INFINIBAND_ADDR_TRANS=y 1696CONFIG_INFINIBAND_ADDR_TRANS=y
1692CONFIG_INFINIBAND_MTHCA=m 1697CONFIG_INFINIBAND_MTHCA=m
1693CONFIG_INFINIBAND_MTHCA_DEBUG=y 1698CONFIG_INFINIBAND_MTHCA_DEBUG=y
1694# CONFIG_INFINIBAND_IPATH is not set 1699CONFIG_INFINIBAND_IPATH=m
1695CONFIG_INFINIBAND_EHCA=m 1700CONFIG_INFINIBAND_EHCA=m
1696# CONFIG_INFINIBAND_AMSO1100 is not set 1701# CONFIG_INFINIBAND_AMSO1100 is not set
1697# CONFIG_MLX4_INFINIBAND is not set 1702CONFIG_MLX4_INFINIBAND=m
1698# CONFIG_INFINIBAND_NES is not set 1703# CONFIG_INFINIBAND_NES is not set
1699CONFIG_INFINIBAND_IPOIB=m 1704CONFIG_INFINIBAND_IPOIB=m
1700# CONFIG_INFINIBAND_IPOIB_CM is not set 1705CONFIG_INFINIBAND_IPOIB_CM=y
1701CONFIG_INFINIBAND_IPOIB_DEBUG=y 1706CONFIG_INFINIBAND_IPOIB_DEBUG=y
1702# CONFIG_INFINIBAND_IPOIB_DEBUG_DATA is not set 1707# CONFIG_INFINIBAND_IPOIB_DEBUG_DATA is not set
1703# CONFIG_INFINIBAND_SRP is not set 1708CONFIG_INFINIBAND_SRP=m
1704CONFIG_INFINIBAND_ISER=m 1709CONFIG_INFINIBAND_ISER=m
1705CONFIG_EDAC=y 1710CONFIG_EDAC=y
1706 1711
@@ -1798,7 +1803,7 @@ CONFIG_REISERFS_FS=y
1798CONFIG_REISERFS_FS_XATTR=y 1803CONFIG_REISERFS_FS_XATTR=y
1799CONFIG_REISERFS_FS_POSIX_ACL=y 1804CONFIG_REISERFS_FS_POSIX_ACL=y
1800CONFIG_REISERFS_FS_SECURITY=y 1805CONFIG_REISERFS_FS_SECURITY=y
1801CONFIG_JFS_FS=y 1806CONFIG_JFS_FS=m
1802CONFIG_JFS_POSIX_ACL=y 1807CONFIG_JFS_POSIX_ACL=y
1803CONFIG_JFS_SECURITY=y 1808CONFIG_JFS_SECURITY=y
1804# CONFIG_JFS_DEBUG is not set 1809# CONFIG_JFS_DEBUG is not set
@@ -1811,14 +1816,22 @@ CONFIG_XFS_POSIX_ACL=y
1811# CONFIG_XFS_RT is not set 1816# CONFIG_XFS_RT is not set
1812# CONFIG_XFS_DEBUG is not set 1817# CONFIG_XFS_DEBUG is not set
1813# CONFIG_GFS2_FS is not set 1818# CONFIG_GFS2_FS is not set
1814# CONFIG_OCFS2_FS is not set 1819CONFIG_OCFS2_FS=m
1820CONFIG_OCFS2_FS_O2CB=m
1821CONFIG_OCFS2_FS_STATS=y
1822CONFIG_OCFS2_DEBUG_MASKLOG=y
1823# CONFIG_OCFS2_DEBUG_FS is not set
1824# CONFIG_OCFS2_COMPAT_JBD is not set
1825CONFIG_BTRFS_FS=m
1826CONFIG_BTRFS_FS_POSIX_ACL=y
1827CONFIG_NILFS2_FS=m
1815CONFIG_DNOTIFY=y 1828CONFIG_DNOTIFY=y
1816CONFIG_INOTIFY=y 1829CONFIG_INOTIFY=y
1817CONFIG_INOTIFY_USER=y 1830CONFIG_INOTIFY_USER=y
1818# CONFIG_QUOTA is not set 1831# CONFIG_QUOTA is not set
1819# CONFIG_AUTOFS_FS is not set 1832# CONFIG_AUTOFS_FS is not set
1820CONFIG_AUTOFS4_FS=m 1833CONFIG_AUTOFS4_FS=m
1821# CONFIG_FUSE_FS is not set 1834CONFIG_FUSE_FS=m
1822 1835
1823# 1836#
1824# CD-ROM/DVD Filesystems 1837# CD-ROM/DVD Filesystems
@@ -1851,7 +1864,7 @@ CONFIG_TMPFS=y
1851# CONFIG_TMPFS_POSIX_ACL is not set 1864# CONFIG_TMPFS_POSIX_ACL is not set
1852CONFIG_HUGETLBFS=y 1865CONFIG_HUGETLBFS=y
1853CONFIG_HUGETLB_PAGE=y 1866CONFIG_HUGETLB_PAGE=y
1854# CONFIG_CONFIGFS_FS is not set 1867CONFIG_CONFIGFS_FS=m
1855 1868
1856# 1869#
1857# Miscellaneous filesystems 1870# Miscellaneous filesystems
@@ -2075,7 +2088,7 @@ CONFIG_XMON=y
2075CONFIG_XMON_DISASSEMBLY=y 2088CONFIG_XMON_DISASSEMBLY=y
2076CONFIG_DEBUGGER=y 2089CONFIG_DEBUGGER=y
2077CONFIG_IRQSTACKS=y 2090CONFIG_IRQSTACKS=y
2078# CONFIG_VIRQ_DEBUG is not set 2091CONFIG_VIRQ_DEBUG=y
2079CONFIG_BOOTX_TEXT=y 2092CONFIG_BOOTX_TEXT=y
2080# CONFIG_PPC_EARLY_DEBUG is not set 2093# CONFIG_PPC_EARLY_DEBUG is not set
2081 2094
diff --git a/arch/powerpc/configs/pseries_defconfig b/arch/powerpc/configs/pseries_defconfig
index ca9ff9aad74a..41de3ddc9f24 100644
--- a/arch/powerpc/configs/pseries_defconfig
+++ b/arch/powerpc/configs/pseries_defconfig
@@ -159,7 +159,7 @@ CONFIG_MODULE_SRCVERSION_ALL=y
159CONFIG_KMOD=y 159CONFIG_KMOD=y
160CONFIG_STOP_MACHINE=y 160CONFIG_STOP_MACHINE=y
161CONFIG_BLOCK=y 161CONFIG_BLOCK=y
162# CONFIG_BLK_DEV_IO_TRACE is not set 162CONFIG_BLK_DEV_IO_TRACE=y
163CONFIG_BLK_DEV_BSG=y 163CONFIG_BLK_DEV_BSG=y
164# CONFIG_BLK_DEV_INTEGRITY is not set 164# CONFIG_BLK_DEV_INTEGRITY is not set
165CONFIG_BLOCK_COMPAT=y 165CONFIG_BLOCK_COMPAT=y
@@ -191,6 +191,7 @@ CONFIG_SCANLOG=m
191CONFIG_LPARCFG=y 191CONFIG_LPARCFG=y
192CONFIG_PPC_SMLPAR=y 192CONFIG_PPC_SMLPAR=y
193CONFIG_CMM=y 193CONFIG_CMM=y
194CONFIG_DTL=y
194# CONFIG_PPC_ISERIES is not set 195# CONFIG_PPC_ISERIES is not set
195# CONFIG_PPC_PMAC is not set 196# CONFIG_PPC_PMAC is not set
196# CONFIG_PPC_MAPLE is not set 197# CONFIG_PPC_MAPLE is not set
@@ -255,7 +256,8 @@ CONFIG_KEXEC=y
255# CONFIG_PHYP_DUMP is not set 256# CONFIG_PHYP_DUMP is not set
256CONFIG_IRQ_ALL_CPUS=y 257CONFIG_IRQ_ALL_CPUS=y
257CONFIG_NUMA=y 258CONFIG_NUMA=y
258CONFIG_NODES_SHIFT=4 259CONFIG_NODES_SHIFT=8
260CONFIG_MAX_ACTIVE_REGIONS=256
259CONFIG_ARCH_SELECT_MEMORY_MODEL=y 261CONFIG_ARCH_SELECT_MEMORY_MODEL=y
260CONFIG_ARCH_SPARSEMEM_ENABLE=y 262CONFIG_ARCH_SPARSEMEM_ENABLE=y
261CONFIG_ARCH_SPARSEMEM_DEFAULT=y 263CONFIG_ARCH_SPARSEMEM_DEFAULT=y
@@ -270,7 +272,9 @@ CONFIG_HAVE_MEMORY_PRESENT=y
270CONFIG_SPARSEMEM_EXTREME=y 272CONFIG_SPARSEMEM_EXTREME=y
271CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y 273CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
272CONFIG_SPARSEMEM_VMEMMAP=y 274CONFIG_SPARSEMEM_VMEMMAP=y
273# CONFIG_MEMORY_HOTPLUG is not set 275CONFIG_MEMORY_HOTPLUG=y
276CONFIG_MEMORY_HOTPLUG_SPARSE=y
277CONFIG_MEMORY_HOTREMOVE=y
274CONFIG_PAGEFLAGS_EXTENDED=y 278CONFIG_PAGEFLAGS_EXTENDED=y
275CONFIG_SPLIT_PTLOCK_CPUS=4 279CONFIG_SPLIT_PTLOCK_CPUS=4
276CONFIG_MIGRATION=y 280CONFIG_MIGRATION=y
@@ -705,7 +709,7 @@ CONFIG_MD_LINEAR=y
705CONFIG_MD_RAID0=y 709CONFIG_MD_RAID0=y
706CONFIG_MD_RAID1=y 710CONFIG_MD_RAID1=y
707CONFIG_MD_RAID10=m 711CONFIG_MD_RAID10=m
708# CONFIG_MD_RAID456 is not set 712CONFIG_MD_RAID456=m
709CONFIG_MD_MULTIPATH=m 713CONFIG_MD_MULTIPATH=m
710CONFIG_MD_FAULTY=m 714CONFIG_MD_FAULTY=m
711CONFIG_BLK_DEV_DM=y 715CONFIG_BLK_DEV_DM=y
@@ -800,7 +804,7 @@ CONFIG_ACENIC=m
800CONFIG_ACENIC_OMIT_TIGON_I=y 804CONFIG_ACENIC_OMIT_TIGON_I=y
801# CONFIG_DL2K is not set 805# CONFIG_DL2K is not set
802CONFIG_E1000=y 806CONFIG_E1000=y
803# CONFIG_E1000E is not set 807CONFIG_E1000E=m
804# CONFIG_IP1000 is not set 808# CONFIG_IP1000 is not set
805# CONFIG_IGB is not set 809# CONFIG_IGB is not set
806# CONFIG_NS83820 is not set 810# CONFIG_NS83820 is not set
@@ -818,18 +822,18 @@ CONFIG_TIGON3=y
818# CONFIG_ATL1E is not set 822# CONFIG_ATL1E is not set
819# CONFIG_JME is not set 823# CONFIG_JME is not set
820CONFIG_NETDEV_10000=y 824CONFIG_NETDEV_10000=y
821# CONFIG_CHELSIO_T1 is not set 825CONFIG_CHELSIO_T1=m
822# CONFIG_CHELSIO_T3 is not set 826CONFIG_CHELSIO_T3=m
823CONFIG_EHEA=y 827CONFIG_EHEA=y
824# CONFIG_ENIC is not set 828# CONFIG_ENIC is not set
825# CONFIG_IXGBE is not set 829CONFIG_IXGBE=m
826CONFIG_IXGB=m 830CONFIG_IXGB=m
827CONFIG_S2IO=m 831CONFIG_S2IO=m
828# CONFIG_MYRI10GE is not set 832CONFIG_MYRI10GE=m
829# CONFIG_NETXEN_NIC is not set 833CONFIG_NETXEN_NIC=m
830# CONFIG_NIU is not set 834# CONFIG_NIU is not set
831# CONFIG_MLX4_EN is not set 835CONFIG_MLX4_EN=m
832# CONFIG_MLX4_CORE is not set 836CONFIG_MLX4_CORE=m
833# CONFIG_TEHUTI is not set 837# CONFIG_TEHUTI is not set
834# CONFIG_BNX2X is not set 838# CONFIG_BNX2X is not set
835# CONFIG_QLGE is not set 839# CONFIG_QLGE is not set
@@ -894,7 +898,7 @@ CONFIG_INPUT_MOUSEDEV=y
894CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 898CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
895CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 899CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
896# CONFIG_INPUT_JOYDEV is not set 900# CONFIG_INPUT_JOYDEV is not set
897# CONFIG_INPUT_EVDEV is not set 901CONFIG_INPUT_EVDEV=m
898# CONFIG_INPUT_EVBUG is not set 902# CONFIG_INPUT_EVBUG is not set
899 903
900# 904#
@@ -1271,7 +1275,7 @@ CONFIG_USB_DEVICEFS=y
1271CONFIG_USB_DEVICE_CLASS=y 1275CONFIG_USB_DEVICE_CLASS=y
1272# CONFIG_USB_DYNAMIC_MINORS is not set 1276# CONFIG_USB_DYNAMIC_MINORS is not set
1273# CONFIG_USB_OTG is not set 1277# CONFIG_USB_OTG is not set
1274CONFIG_USB_MON=y 1278CONFIG_USB_MON=m
1275# CONFIG_USB_WUSB is not set 1279# CONFIG_USB_WUSB is not set
1276# CONFIG_USB_WUSB_CBAF is not set 1280# CONFIG_USB_WUSB_CBAF is not set
1277 1281
@@ -1311,7 +1315,7 @@ CONFIG_USB_OHCI_LITTLE_ENDIAN=y
1311# 1315#
1312# may also be needed; see USB_STORAGE Help for more information 1316# may also be needed; see USB_STORAGE Help for more information
1313# 1317#
1314CONFIG_USB_STORAGE=y 1318CONFIG_USB_STORAGE=m
1315# CONFIG_USB_STORAGE_DEBUG is not set 1319# CONFIG_USB_STORAGE_DEBUG is not set
1316# CONFIG_USB_STORAGE_DATAFAB is not set 1320# CONFIG_USB_STORAGE_DATAFAB is not set
1317# CONFIG_USB_STORAGE_FREECOM is not set 1321# CONFIG_USB_STORAGE_FREECOM is not set
@@ -1322,7 +1326,7 @@ CONFIG_USB_STORAGE=y
1322# CONFIG_USB_STORAGE_SDDR55 is not set 1326# CONFIG_USB_STORAGE_SDDR55 is not set
1323# CONFIG_USB_STORAGE_JUMPSHOT is not set 1327# CONFIG_USB_STORAGE_JUMPSHOT is not set
1324# CONFIG_USB_STORAGE_ALAUDA is not set 1328# CONFIG_USB_STORAGE_ALAUDA is not set
1325CONFIG_USB_STORAGE_ONETOUCH=y 1329# CONFIG_USB_STORAGE_ONETOUCH is not set
1326# CONFIG_USB_STORAGE_KARMA is not set 1330# CONFIG_USB_STORAGE_KARMA is not set
1327# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set 1331# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
1328# CONFIG_USB_LIBUSUAL is not set 1332# CONFIG_USB_LIBUSUAL is not set
@@ -1377,17 +1381,17 @@ CONFIG_INFINIBAND_USER_MEM=y
1377CONFIG_INFINIBAND_ADDR_TRANS=y 1381CONFIG_INFINIBAND_ADDR_TRANS=y
1378CONFIG_INFINIBAND_MTHCA=m 1382CONFIG_INFINIBAND_MTHCA=m
1379CONFIG_INFINIBAND_MTHCA_DEBUG=y 1383CONFIG_INFINIBAND_MTHCA_DEBUG=y
1380# CONFIG_INFINIBAND_IPATH is not set 1384CONFIG_INFINIBAND_IPATH=m
1381CONFIG_INFINIBAND_EHCA=m 1385CONFIG_INFINIBAND_EHCA=m
1382# CONFIG_INFINIBAND_AMSO1100 is not set 1386# CONFIG_INFINIBAND_AMSO1100 is not set
1383# CONFIG_MLX4_INFINIBAND is not set 1387CONFIG_MLX4_INFINIBAND=m
1384# CONFIG_INFINIBAND_NES is not set 1388# CONFIG_INFINIBAND_NES is not set
1385CONFIG_INFINIBAND_IPOIB=m 1389CONFIG_INFINIBAND_IPOIB=m
1386# CONFIG_INFINIBAND_IPOIB_CM is not set 1390CONFIG_INFINIBAND_IPOIB_CM=y
1387CONFIG_INFINIBAND_IPOIB_DEBUG=y 1391CONFIG_INFINIBAND_IPOIB_DEBUG=y
1388# CONFIG_INFINIBAND_IPOIB_DEBUG_DATA is not set 1392# CONFIG_INFINIBAND_IPOIB_DEBUG_DATA is not set
1389CONFIG_INFINIBAND_SRP=m 1393CONFIG_INFINIBAND_SRP=m
1390# CONFIG_INFINIBAND_ISER is not set 1394CONFIG_INFINIBAND_ISER=m
1391# CONFIG_EDAC is not set 1395# CONFIG_EDAC is not set
1392# CONFIG_RTC_CLASS is not set 1396# CONFIG_RTC_CLASS is not set
1393# CONFIG_DMADEVICES is not set 1397# CONFIG_DMADEVICES is not set
@@ -1443,6 +1447,9 @@ CONFIG_OCFS2_FS_STATS=y
1443CONFIG_OCFS2_DEBUG_MASKLOG=y 1447CONFIG_OCFS2_DEBUG_MASKLOG=y
1444# CONFIG_OCFS2_DEBUG_FS is not set 1448# CONFIG_OCFS2_DEBUG_FS is not set
1445# CONFIG_OCFS2_COMPAT_JBD is not set 1449# CONFIG_OCFS2_COMPAT_JBD is not set
1450CONFIG_BTRFS_FS=m
1451CONFIG_BTRFS_FS_POSIX_ACL=y
1452CONFIG_NILFS2_FS=m
1446CONFIG_DNOTIFY=y 1453CONFIG_DNOTIFY=y
1447CONFIG_INOTIFY=y 1454CONFIG_INOTIFY=y
1448CONFIG_INOTIFY_USER=y 1455CONFIG_INOTIFY_USER=y
@@ -1455,8 +1462,8 @@ CONFIG_FUSE_FS=m
1455# CD-ROM/DVD Filesystems 1462# CD-ROM/DVD Filesystems
1456# 1463#
1457CONFIG_ISO9660_FS=y 1464CONFIG_ISO9660_FS=y
1458CONFIG_JOLIET=y 1465# CONFIG_JOLIET is not set
1459CONFIG_ZISOFS=y 1466# CONFIG_ZISOFS is not set
1460CONFIG_UDF_FS=m 1467CONFIG_UDF_FS=m
1461CONFIG_UDF_NLS=y 1468CONFIG_UDF_NLS=y
1462 1469
@@ -1508,14 +1515,14 @@ CONFIG_NFS_FS=y
1508CONFIG_NFS_V3=y 1515CONFIG_NFS_V3=y
1509CONFIG_NFS_V3_ACL=y 1516CONFIG_NFS_V3_ACL=y
1510CONFIG_NFS_V4=y 1517CONFIG_NFS_V4=y
1511CONFIG_NFSD=y 1518CONFIG_NFSD=m
1512CONFIG_NFSD_V2_ACL=y 1519CONFIG_NFSD_V2_ACL=y
1513CONFIG_NFSD_V3=y 1520CONFIG_NFSD_V3=y
1514CONFIG_NFSD_V3_ACL=y 1521CONFIG_NFSD_V3_ACL=y
1515CONFIG_NFSD_V4=y 1522CONFIG_NFSD_V4=y
1516CONFIG_LOCKD=y 1523CONFIG_LOCKD=y
1517CONFIG_LOCKD_V4=y 1524CONFIG_LOCKD_V4=y
1518CONFIG_EXPORTFS=y 1525CONFIG_EXPORTFS=m
1519CONFIG_NFS_ACL_SUPPORT=y 1526CONFIG_NFS_ACL_SUPPORT=y
1520CONFIG_NFS_COMMON=y 1527CONFIG_NFS_COMMON=y
1521CONFIG_SUNRPC=y 1528CONFIG_SUNRPC=y
@@ -1681,12 +1688,12 @@ CONFIG_DYNAMIC_PRINTK_DEBUG=y
1681CONFIG_HAVE_ARCH_KGDB=y 1688CONFIG_HAVE_ARCH_KGDB=y
1682# CONFIG_KGDB is not set 1689# CONFIG_KGDB is not set
1683CONFIG_DEBUG_STACKOVERFLOW=y 1690CONFIG_DEBUG_STACKOVERFLOW=y
1684# CONFIG_DEBUG_STACK_USAGE is not set 1691CONFIG_DEBUG_STACK_USAGE=y
1685# CONFIG_DEBUG_PAGEALLOC is not set 1692# CONFIG_DEBUG_PAGEALLOC is not set
1686# CONFIG_HCALL_STATS is not set 1693# CONFIG_HCALL_STATS is not set
1687# CONFIG_CODE_PATCHING_SELFTEST is not set 1694CONFIG_CODE_PATCHING_SELFTEST=y
1688# CONFIG_FTR_FIXUP_SELFTEST is not set 1695CONFIG_FTR_FIXUP_SELFTEST=y
1689# CONFIG_MSI_BITMAP_SELFTEST is not set 1696CONFIG_MSI_BITMAP_SELFTEST=y
1690CONFIG_XMON=y 1697CONFIG_XMON=y
1691CONFIG_XMON_DEFAULT=y 1698CONFIG_XMON_DEFAULT=y
1692CONFIG_XMON_DISASSEMBLY=y 1699CONFIG_XMON_DISASSEMBLY=y
diff --git a/arch/powerpc/include/asm/asm-compat.h b/arch/powerpc/include/asm/asm-compat.h
index 8f0fe7971949..c1b475a941eb 100644
--- a/arch/powerpc/include/asm/asm-compat.h
+++ b/arch/powerpc/include/asm/asm-compat.h
@@ -2,6 +2,7 @@
2#define _ASM_POWERPC_ASM_COMPAT_H 2#define _ASM_POWERPC_ASM_COMPAT_H
3 3
4#include <asm/types.h> 4#include <asm/types.h>
5#include <asm/ppc-opcode.h>
5 6
6#ifdef __ASSEMBLY__ 7#ifdef __ASSEMBLY__
7# define stringify_in_c(...) __VA_ARGS__ 8# define stringify_in_c(...) __VA_ARGS__
@@ -24,7 +25,7 @@
24#define PPC_LONG stringify_in_c(.llong) 25#define PPC_LONG stringify_in_c(.llong)
25#define PPC_LONG_ALIGN stringify_in_c(.balign 8) 26#define PPC_LONG_ALIGN stringify_in_c(.balign 8)
26#define PPC_TLNEI stringify_in_c(tdnei) 27#define PPC_TLNEI stringify_in_c(tdnei)
27#define PPC_LLARX stringify_in_c(ldarx) 28#define PPC_LLARX(t, a, b, eh) PPC_LDARX(t, a, b, eh)
28#define PPC_STLCX stringify_in_c(stdcx.) 29#define PPC_STLCX stringify_in_c(stdcx.)
29#define PPC_CNTLZL stringify_in_c(cntlzd) 30#define PPC_CNTLZL stringify_in_c(cntlzd)
30 31
@@ -46,7 +47,7 @@
46#define PPC_LONG stringify_in_c(.long) 47#define PPC_LONG stringify_in_c(.long)
47#define PPC_LONG_ALIGN stringify_in_c(.balign 4) 48#define PPC_LONG_ALIGN stringify_in_c(.balign 4)
48#define PPC_TLNEI stringify_in_c(twnei) 49#define PPC_TLNEI stringify_in_c(twnei)
49#define PPC_LLARX stringify_in_c(lwarx) 50#define PPC_LLARX(t, a, b, eh) PPC_LWARX(t, a, b, eh)
50#define PPC_STLCX stringify_in_c(stwcx.) 51#define PPC_STLCX stringify_in_c(stwcx.)
51#define PPC_CNTLZL stringify_in_c(cntlzw) 52#define PPC_CNTLZL stringify_in_c(cntlzw)
52#define PPC_MTOCRF stringify_in_c(mtcrf) 53#define PPC_MTOCRF stringify_in_c(mtcrf)
diff --git a/arch/powerpc/include/asm/atomic.h b/arch/powerpc/include/asm/atomic.h
index 4012483b1899..b8f152ece025 100644
--- a/arch/powerpc/include/asm/atomic.h
+++ b/arch/powerpc/include/asm/atomic.h
@@ -49,13 +49,13 @@ static __inline__ int atomic_add_return(int a, atomic_t *v)
49 int t; 49 int t;
50 50
51 __asm__ __volatile__( 51 __asm__ __volatile__(
52 LWSYNC_ON_SMP 52 PPC_RELEASE_BARRIER
53"1: lwarx %0,0,%2 # atomic_add_return\n\ 53"1: lwarx %0,0,%2 # atomic_add_return\n\
54 add %0,%1,%0\n" 54 add %0,%1,%0\n"
55 PPC405_ERR77(0,%2) 55 PPC405_ERR77(0,%2)
56" stwcx. %0,0,%2 \n\ 56" stwcx. %0,0,%2 \n\
57 bne- 1b" 57 bne- 1b"
58 ISYNC_ON_SMP 58 PPC_ACQUIRE_BARRIER
59 : "=&r" (t) 59 : "=&r" (t)
60 : "r" (a), "r" (&v->counter) 60 : "r" (a), "r" (&v->counter)
61 : "cc", "memory"); 61 : "cc", "memory");
@@ -85,13 +85,13 @@ static __inline__ int atomic_sub_return(int a, atomic_t *v)
85 int t; 85 int t;
86 86
87 __asm__ __volatile__( 87 __asm__ __volatile__(
88 LWSYNC_ON_SMP 88 PPC_RELEASE_BARRIER
89"1: lwarx %0,0,%2 # atomic_sub_return\n\ 89"1: lwarx %0,0,%2 # atomic_sub_return\n\
90 subf %0,%1,%0\n" 90 subf %0,%1,%0\n"
91 PPC405_ERR77(0,%2) 91 PPC405_ERR77(0,%2)
92" stwcx. %0,0,%2 \n\ 92" stwcx. %0,0,%2 \n\
93 bne- 1b" 93 bne- 1b"
94 ISYNC_ON_SMP 94 PPC_ACQUIRE_BARRIER
95 : "=&r" (t) 95 : "=&r" (t)
96 : "r" (a), "r" (&v->counter) 96 : "r" (a), "r" (&v->counter)
97 : "cc", "memory"); 97 : "cc", "memory");
@@ -119,13 +119,13 @@ static __inline__ int atomic_inc_return(atomic_t *v)
119 int t; 119 int t;
120 120
121 __asm__ __volatile__( 121 __asm__ __volatile__(
122 LWSYNC_ON_SMP 122 PPC_RELEASE_BARRIER
123"1: lwarx %0,0,%1 # atomic_inc_return\n\ 123"1: lwarx %0,0,%1 # atomic_inc_return\n\
124 addic %0,%0,1\n" 124 addic %0,%0,1\n"
125 PPC405_ERR77(0,%1) 125 PPC405_ERR77(0,%1)
126" stwcx. %0,0,%1 \n\ 126" stwcx. %0,0,%1 \n\
127 bne- 1b" 127 bne- 1b"
128 ISYNC_ON_SMP 128 PPC_ACQUIRE_BARRIER
129 : "=&r" (t) 129 : "=&r" (t)
130 : "r" (&v->counter) 130 : "r" (&v->counter)
131 : "cc", "xer", "memory"); 131 : "cc", "xer", "memory");
@@ -163,13 +163,13 @@ static __inline__ int atomic_dec_return(atomic_t *v)
163 int t; 163 int t;
164 164
165 __asm__ __volatile__( 165 __asm__ __volatile__(
166 LWSYNC_ON_SMP 166 PPC_RELEASE_BARRIER
167"1: lwarx %0,0,%1 # atomic_dec_return\n\ 167"1: lwarx %0,0,%1 # atomic_dec_return\n\
168 addic %0,%0,-1\n" 168 addic %0,%0,-1\n"
169 PPC405_ERR77(0,%1) 169 PPC405_ERR77(0,%1)
170" stwcx. %0,0,%1\n\ 170" stwcx. %0,0,%1\n\
171 bne- 1b" 171 bne- 1b"
172 ISYNC_ON_SMP 172 PPC_ACQUIRE_BARRIER
173 : "=&r" (t) 173 : "=&r" (t)
174 : "r" (&v->counter) 174 : "r" (&v->counter)
175 : "cc", "xer", "memory"); 175 : "cc", "xer", "memory");
@@ -194,7 +194,7 @@ static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
194 int t; 194 int t;
195 195
196 __asm__ __volatile__ ( 196 __asm__ __volatile__ (
197 LWSYNC_ON_SMP 197 PPC_RELEASE_BARRIER
198"1: lwarx %0,0,%1 # atomic_add_unless\n\ 198"1: lwarx %0,0,%1 # atomic_add_unless\n\
199 cmpw 0,%0,%3 \n\ 199 cmpw 0,%0,%3 \n\
200 beq- 2f \n\ 200 beq- 2f \n\
@@ -202,7 +202,7 @@ static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
202 PPC405_ERR77(0,%2) 202 PPC405_ERR77(0,%2)
203" stwcx. %0,0,%1 \n\ 203" stwcx. %0,0,%1 \n\
204 bne- 1b \n" 204 bne- 1b \n"
205 ISYNC_ON_SMP 205 PPC_ACQUIRE_BARRIER
206" subf %0,%2,%0 \n\ 206" subf %0,%2,%0 \n\
2072:" 2072:"
208 : "=&r" (t) 208 : "=&r" (t)
@@ -227,7 +227,7 @@ static __inline__ int atomic_dec_if_positive(atomic_t *v)
227 int t; 227 int t;
228 228
229 __asm__ __volatile__( 229 __asm__ __volatile__(
230 LWSYNC_ON_SMP 230 PPC_RELEASE_BARRIER
231"1: lwarx %0,0,%1 # atomic_dec_if_positive\n\ 231"1: lwarx %0,0,%1 # atomic_dec_if_positive\n\
232 cmpwi %0,1\n\ 232 cmpwi %0,1\n\
233 addi %0,%0,-1\n\ 233 addi %0,%0,-1\n\
@@ -235,7 +235,7 @@ static __inline__ int atomic_dec_if_positive(atomic_t *v)
235 PPC405_ERR77(0,%1) 235 PPC405_ERR77(0,%1)
236" stwcx. %0,0,%1\n\ 236" stwcx. %0,0,%1\n\
237 bne- 1b" 237 bne- 1b"
238 ISYNC_ON_SMP 238 PPC_ACQUIRE_BARRIER
239 "\n\ 239 "\n\
2402:" : "=&b" (t) 2402:" : "=&b" (t)
241 : "r" (&v->counter) 241 : "r" (&v->counter)
@@ -286,12 +286,12 @@ static __inline__ long atomic64_add_return(long a, atomic64_t *v)
286 long t; 286 long t;
287 287
288 __asm__ __volatile__( 288 __asm__ __volatile__(
289 LWSYNC_ON_SMP 289 PPC_RELEASE_BARRIER
290"1: ldarx %0,0,%2 # atomic64_add_return\n\ 290"1: ldarx %0,0,%2 # atomic64_add_return\n\
291 add %0,%1,%0\n\ 291 add %0,%1,%0\n\
292 stdcx. %0,0,%2 \n\ 292 stdcx. %0,0,%2 \n\
293 bne- 1b" 293 bne- 1b"
294 ISYNC_ON_SMP 294 PPC_ACQUIRE_BARRIER
295 : "=&r" (t) 295 : "=&r" (t)
296 : "r" (a), "r" (&v->counter) 296 : "r" (a), "r" (&v->counter)
297 : "cc", "memory"); 297 : "cc", "memory");
@@ -320,12 +320,12 @@ static __inline__ long atomic64_sub_return(long a, atomic64_t *v)
320 long t; 320 long t;
321 321
322 __asm__ __volatile__( 322 __asm__ __volatile__(
323 LWSYNC_ON_SMP 323 PPC_RELEASE_BARRIER
324"1: ldarx %0,0,%2 # atomic64_sub_return\n\ 324"1: ldarx %0,0,%2 # atomic64_sub_return\n\
325 subf %0,%1,%0\n\ 325 subf %0,%1,%0\n\
326 stdcx. %0,0,%2 \n\ 326 stdcx. %0,0,%2 \n\
327 bne- 1b" 327 bne- 1b"
328 ISYNC_ON_SMP 328 PPC_ACQUIRE_BARRIER
329 : "=&r" (t) 329 : "=&r" (t)
330 : "r" (a), "r" (&v->counter) 330 : "r" (a), "r" (&v->counter)
331 : "cc", "memory"); 331 : "cc", "memory");
@@ -352,12 +352,12 @@ static __inline__ long atomic64_inc_return(atomic64_t *v)
352 long t; 352 long t;
353 353
354 __asm__ __volatile__( 354 __asm__ __volatile__(
355 LWSYNC_ON_SMP 355 PPC_RELEASE_BARRIER
356"1: ldarx %0,0,%1 # atomic64_inc_return\n\ 356"1: ldarx %0,0,%1 # atomic64_inc_return\n\
357 addic %0,%0,1\n\ 357 addic %0,%0,1\n\
358 stdcx. %0,0,%1 \n\ 358 stdcx. %0,0,%1 \n\
359 bne- 1b" 359 bne- 1b"
360 ISYNC_ON_SMP 360 PPC_ACQUIRE_BARRIER
361 : "=&r" (t) 361 : "=&r" (t)
362 : "r" (&v->counter) 362 : "r" (&v->counter)
363 : "cc", "xer", "memory"); 363 : "cc", "xer", "memory");
@@ -394,12 +394,12 @@ static __inline__ long atomic64_dec_return(atomic64_t *v)
394 long t; 394 long t;
395 395
396 __asm__ __volatile__( 396 __asm__ __volatile__(
397 LWSYNC_ON_SMP 397 PPC_RELEASE_BARRIER
398"1: ldarx %0,0,%1 # atomic64_dec_return\n\ 398"1: ldarx %0,0,%1 # atomic64_dec_return\n\
399 addic %0,%0,-1\n\ 399 addic %0,%0,-1\n\
400 stdcx. %0,0,%1\n\ 400 stdcx. %0,0,%1\n\
401 bne- 1b" 401 bne- 1b"
402 ISYNC_ON_SMP 402 PPC_ACQUIRE_BARRIER
403 : "=&r" (t) 403 : "=&r" (t)
404 : "r" (&v->counter) 404 : "r" (&v->counter)
405 : "cc", "xer", "memory"); 405 : "cc", "xer", "memory");
@@ -419,13 +419,13 @@ static __inline__ long atomic64_dec_if_positive(atomic64_t *v)
419 long t; 419 long t;
420 420
421 __asm__ __volatile__( 421 __asm__ __volatile__(
422 LWSYNC_ON_SMP 422 PPC_RELEASE_BARRIER
423"1: ldarx %0,0,%1 # atomic64_dec_if_positive\n\ 423"1: ldarx %0,0,%1 # atomic64_dec_if_positive\n\
424 addic. %0,%0,-1\n\ 424 addic. %0,%0,-1\n\
425 blt- 2f\n\ 425 blt- 2f\n\
426 stdcx. %0,0,%1\n\ 426 stdcx. %0,0,%1\n\
427 bne- 1b" 427 bne- 1b"
428 ISYNC_ON_SMP 428 PPC_ACQUIRE_BARRIER
429 "\n\ 429 "\n\
4302:" : "=&r" (t) 4302:" : "=&r" (t)
431 : "r" (&v->counter) 431 : "r" (&v->counter)
@@ -451,14 +451,14 @@ static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u)
451 long t; 451 long t;
452 452
453 __asm__ __volatile__ ( 453 __asm__ __volatile__ (
454 LWSYNC_ON_SMP 454 PPC_RELEASE_BARRIER
455"1: ldarx %0,0,%1 # atomic_add_unless\n\ 455"1: ldarx %0,0,%1 # atomic_add_unless\n\
456 cmpd 0,%0,%3 \n\ 456 cmpd 0,%0,%3 \n\
457 beq- 2f \n\ 457 beq- 2f \n\
458 add %0,%2,%0 \n" 458 add %0,%2,%0 \n"
459" stdcx. %0,0,%1 \n\ 459" stdcx. %0,0,%1 \n\
460 bne- 1b \n" 460 bne- 1b \n"
461 ISYNC_ON_SMP 461 PPC_ACQUIRE_BARRIER
462" subf %0,%2,%0 \n\ 462" subf %0,%2,%0 \n\
4632:" 4632:"
464 : "=&r" (t) 464 : "=&r" (t)
diff --git a/arch/powerpc/include/asm/bitops.h b/arch/powerpc/include/asm/bitops.h
index 56f2f2ea5631..30964ae2d096 100644
--- a/arch/powerpc/include/asm/bitops.h
+++ b/arch/powerpc/include/asm/bitops.h
@@ -65,7 +65,7 @@ static __inline__ void fn(unsigned long mask, \
65 unsigned long *p = (unsigned long *)_p; \ 65 unsigned long *p = (unsigned long *)_p; \
66 __asm__ __volatile__ ( \ 66 __asm__ __volatile__ ( \
67 prefix \ 67 prefix \
68"1:" PPC_LLARX "%0,0,%3\n" \ 68"1:" PPC_LLARX(%0,0,%3,0) "\n" \
69 stringify_in_c(op) "%0,%0,%2\n" \ 69 stringify_in_c(op) "%0,%0,%2\n" \
70 PPC405_ERR77(0,%3) \ 70 PPC405_ERR77(0,%3) \
71 PPC_STLCX "%0,0,%3\n" \ 71 PPC_STLCX "%0,0,%3\n" \
@@ -78,7 +78,7 @@ static __inline__ void fn(unsigned long mask, \
78 78
79DEFINE_BITOP(set_bits, or, "", "") 79DEFINE_BITOP(set_bits, or, "", "")
80DEFINE_BITOP(clear_bits, andc, "", "") 80DEFINE_BITOP(clear_bits, andc, "", "")
81DEFINE_BITOP(clear_bits_unlock, andc, LWSYNC_ON_SMP, "") 81DEFINE_BITOP(clear_bits_unlock, andc, PPC_RELEASE_BARRIER, "")
82DEFINE_BITOP(change_bits, xor, "", "") 82DEFINE_BITOP(change_bits, xor, "", "")
83 83
84static __inline__ void set_bit(int nr, volatile unsigned long *addr) 84static __inline__ void set_bit(int nr, volatile unsigned long *addr)
@@ -103,31 +103,35 @@ static __inline__ void change_bit(int nr, volatile unsigned long *addr)
103 103
104/* Like DEFINE_BITOP(), with changes to the arguments to 'op' and the output 104/* Like DEFINE_BITOP(), with changes to the arguments to 'op' and the output
105 * operands. */ 105 * operands. */
106#define DEFINE_TESTOP(fn, op, prefix, postfix) \ 106#define DEFINE_TESTOP(fn, op, prefix, postfix, eh) \
107static __inline__ unsigned long fn( \ 107static __inline__ unsigned long fn( \
108 unsigned long mask, \ 108 unsigned long mask, \
109 volatile unsigned long *_p) \ 109 volatile unsigned long *_p) \
110{ \ 110{ \
111 unsigned long old, t; \ 111 unsigned long old, t; \
112 unsigned long *p = (unsigned long *)_p; \ 112 unsigned long *p = (unsigned long *)_p; \
113 __asm__ __volatile__ ( \ 113 __asm__ __volatile__ ( \
114 prefix \ 114 prefix \
115"1:" PPC_LLARX "%0,0,%3\n" \ 115"1:" PPC_LLARX(%0,0,%3,eh) "\n" \
116 stringify_in_c(op) "%1,%0,%2\n" \ 116 stringify_in_c(op) "%1,%0,%2\n" \
117 PPC405_ERR77(0,%3) \ 117 PPC405_ERR77(0,%3) \
118 PPC_STLCX "%1,0,%3\n" \ 118 PPC_STLCX "%1,0,%3\n" \
119 "bne- 1b\n" \ 119 "bne- 1b\n" \
120 postfix \ 120 postfix \
121 : "=&r" (old), "=&r" (t) \ 121 : "=&r" (old), "=&r" (t) \
122 : "r" (mask), "r" (p) \ 122 : "r" (mask), "r" (p) \
123 : "cc", "memory"); \ 123 : "cc", "memory"); \
124 return (old & mask); \ 124 return (old & mask); \
125} 125}
126 126
127DEFINE_TESTOP(test_and_set_bits, or, LWSYNC_ON_SMP, ISYNC_ON_SMP) 127DEFINE_TESTOP(test_and_set_bits, or, PPC_RELEASE_BARRIER,
128DEFINE_TESTOP(test_and_set_bits_lock, or, "", ISYNC_ON_SMP) 128 PPC_ACQUIRE_BARRIER, 0)
129DEFINE_TESTOP(test_and_clear_bits, andc, LWSYNC_ON_SMP, ISYNC_ON_SMP) 129DEFINE_TESTOP(test_and_set_bits_lock, or, "",
130DEFINE_TESTOP(test_and_change_bits, xor, LWSYNC_ON_SMP, ISYNC_ON_SMP) 130 PPC_ACQUIRE_BARRIER, 1)
131DEFINE_TESTOP(test_and_clear_bits, andc, PPC_RELEASE_BARRIER,
132 PPC_ACQUIRE_BARRIER, 0)
133DEFINE_TESTOP(test_and_change_bits, xor, PPC_RELEASE_BARRIER,
134 PPC_ACQUIRE_BARRIER, 0)
131 135
132static __inline__ int test_and_set_bit(unsigned long nr, 136static __inline__ int test_and_set_bit(unsigned long nr,
133 volatile unsigned long *addr) 137 volatile unsigned long *addr)
@@ -158,7 +162,7 @@ static __inline__ int test_and_change_bit(unsigned long nr,
158 162
159static __inline__ void __clear_bit_unlock(int nr, volatile unsigned long *addr) 163static __inline__ void __clear_bit_unlock(int nr, volatile unsigned long *addr)
160{ 164{
161 __asm__ __volatile__(LWSYNC_ON_SMP "" ::: "memory"); 165 __asm__ __volatile__(PPC_RELEASE_BARRIER "" ::: "memory");
162 __clear_bit(nr, addr); 166 __clear_bit(nr, addr);
163} 167}
164 168
diff --git a/arch/powerpc/include/asm/cputable.h b/arch/powerpc/include/asm/cputable.h
index 80f315e8a421..abb833b0e58f 100644
--- a/arch/powerpc/include/asm/cputable.h
+++ b/arch/powerpc/include/asm/cputable.h
@@ -381,9 +381,9 @@ extern const char *powerpc_base_platform;
381#define CPU_FTRS_GENERIC_32 (CPU_FTR_COMMON | CPU_FTR_NODSISRALIGN) 381#define CPU_FTRS_GENERIC_32 (CPU_FTR_COMMON | CPU_FTR_NODSISRALIGN)
382 382
383/* 64-bit CPUs */ 383/* 64-bit CPUs */
384#define CPU_FTRS_POWER3 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \ 384#define CPU_FTRS_POWER3 (CPU_FTR_USE_TB | \
385 CPU_FTR_IABR | CPU_FTR_PPC_LE) 385 CPU_FTR_IABR | CPU_FTR_PPC_LE)
386#define CPU_FTRS_RS64 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \ 386#define CPU_FTRS_RS64 (CPU_FTR_USE_TB | \
387 CPU_FTR_IABR | \ 387 CPU_FTR_IABR | \
388 CPU_FTR_MMCRA | CPU_FTR_CTRL) 388 CPU_FTR_MMCRA | CPU_FTR_CTRL)
389#define CPU_FTRS_POWER4 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \ 389#define CPU_FTRS_POWER4 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \
diff --git a/arch/powerpc/include/asm/cputime.h b/arch/powerpc/include/asm/cputime.h
index fa19f3fe05ff..8bdc6a9e5773 100644
--- a/arch/powerpc/include/asm/cputime.h
+++ b/arch/powerpc/include/asm/cputime.h
@@ -73,10 +73,9 @@ static inline unsigned long cputime_to_jiffies(const cputime_t ct)
73static inline cputime_t cputime_to_scaled(const cputime_t ct) 73static inline cputime_t cputime_to_scaled(const cputime_t ct)
74{ 74{
75 if (cpu_has_feature(CPU_FTR_SPURR) && 75 if (cpu_has_feature(CPU_FTR_SPURR) &&
76 per_cpu(cputime_last_delta, smp_processor_id())) 76 __get_cpu_var(cputime_last_delta))
77 return ct * 77 return ct * __get_cpu_var(cputime_scaled_last_delta) /
78 per_cpu(cputime_scaled_last_delta, smp_processor_id())/ 78 __get_cpu_var(cputime_last_delta);
79 per_cpu(cputime_last_delta, smp_processor_id());
80 return ct; 79 return ct;
81} 80}
82 81
diff --git a/arch/powerpc/include/asm/feature-fixups.h b/arch/powerpc/include/asm/feature-fixups.h
index cbd4dfa4bce2..96a7d067fbb2 100644
--- a/arch/powerpc/include/asm/feature-fixups.h
+++ b/arch/powerpc/include/asm/feature-fixups.h
@@ -165,7 +165,7 @@ label##2: \
165 .pushsection sect,"a"; \ 165 .pushsection sect,"a"; \
166 .align 2; \ 166 .align 2; \
167label##3: \ 167label##3: \
168 .long label##1b-label##3b; \ 168 FTR_ENTRY_OFFSET label##1b-label##3b; \
169 .popsection; 169 .popsection;
170 170
171#endif /* __ASM_POWERPC_FEATURE_FIXUPS_H */ 171#endif /* __ASM_POWERPC_FEATURE_FIXUPS_H */
diff --git a/arch/powerpc/include/asm/futex.h b/arch/powerpc/include/asm/futex.h
index 9696cc36d2dc..7c589ef81fb0 100644
--- a/arch/powerpc/include/asm/futex.h
+++ b/arch/powerpc/include/asm/futex.h
@@ -11,7 +11,7 @@
11 11
12#define __futex_atomic_op(insn, ret, oldval, uaddr, oparg) \ 12#define __futex_atomic_op(insn, ret, oldval, uaddr, oparg) \
13 __asm__ __volatile ( \ 13 __asm__ __volatile ( \
14 LWSYNC_ON_SMP \ 14 PPC_RELEASE_BARRIER \
15"1: lwarx %0,0,%2\n" \ 15"1: lwarx %0,0,%2\n" \
16 insn \ 16 insn \
17 PPC405_ERR77(0, %2) \ 17 PPC405_ERR77(0, %2) \
@@ -90,14 +90,14 @@ futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)
90 return -EFAULT; 90 return -EFAULT;
91 91
92 __asm__ __volatile__ ( 92 __asm__ __volatile__ (
93 LWSYNC_ON_SMP 93 PPC_RELEASE_BARRIER
94"1: lwarx %0,0,%2 # futex_atomic_cmpxchg_inatomic\n\ 94"1: lwarx %0,0,%2 # futex_atomic_cmpxchg_inatomic\n\
95 cmpw 0,%0,%3\n\ 95 cmpw 0,%0,%3\n\
96 bne- 3f\n" 96 bne- 3f\n"
97 PPC405_ERR77(0,%2) 97 PPC405_ERR77(0,%2)
98"2: stwcx. %4,0,%2\n\ 98"2: stwcx. %4,0,%2\n\
99 bne- 1b\n" 99 bne- 1b\n"
100 ISYNC_ON_SMP 100 PPC_ACQUIRE_BARRIER
101"3: .section .fixup,\"ax\"\n\ 101"3: .section .fixup,\"ax\"\n\
1024: li %0,%5\n\ 1024: li %0,%5\n\
103 b 3b\n\ 103 b 3b\n\
diff --git a/arch/powerpc/include/asm/hardirq.h b/arch/powerpc/include/asm/hardirq.h
index fb3c05a0cbbf..3147a2970125 100644
--- a/arch/powerpc/include/asm/hardirq.h
+++ b/arch/powerpc/include/asm/hardirq.h
@@ -1 +1,29 @@
1#include <asm-generic/hardirq.h> 1#ifndef _ASM_POWERPC_HARDIRQ_H
2#define _ASM_POWERPC_HARDIRQ_H
3
4#include <linux/threads.h>
5#include <linux/irq.h>
6
7typedef struct {
8 unsigned int __softirq_pending;
9 unsigned int timer_irqs;
10 unsigned int pmu_irqs;
11 unsigned int mce_exceptions;
12 unsigned int spurious_irqs;
13} ____cacheline_aligned irq_cpustat_t;
14
15DECLARE_PER_CPU_SHARED_ALIGNED(irq_cpustat_t, irq_stat);
16
17#define __ARCH_IRQ_STAT
18
19#define local_softirq_pending() __get_cpu_var(irq_stat).__softirq_pending
20
21static inline void ack_bad_irq(unsigned int irq)
22{
23 printk(KERN_CRIT "unexpected IRQ trap at vector %02x\n", irq);
24}
25
26extern u64 arch_irq_stat_cpu(unsigned int cpu);
27#define arch_irq_stat_cpu arch_irq_stat_cpu
28
29#endif /* _ASM_POWERPC_HARDIRQ_H */
diff --git a/arch/powerpc/include/asm/local.h b/arch/powerpc/include/asm/local.h
index 84b457a3c1bc..ce58c80e1bcf 100644
--- a/arch/powerpc/include/asm/local.h
+++ b/arch/powerpc/include/asm/local.h
@@ -24,7 +24,7 @@ static __inline__ long local_add_return(long a, local_t *l)
24 long t; 24 long t;
25 25
26 __asm__ __volatile__( 26 __asm__ __volatile__(
27"1:" PPC_LLARX "%0,0,%2 # local_add_return\n\ 27"1:" PPC_LLARX(%0,0,%2,0) " # local_add_return\n\
28 add %0,%1,%0\n" 28 add %0,%1,%0\n"
29 PPC405_ERR77(0,%2) 29 PPC405_ERR77(0,%2)
30 PPC_STLCX "%0,0,%2 \n\ 30 PPC_STLCX "%0,0,%2 \n\
@@ -43,7 +43,7 @@ static __inline__ long local_sub_return(long a, local_t *l)
43 long t; 43 long t;
44 44
45 __asm__ __volatile__( 45 __asm__ __volatile__(
46"1:" PPC_LLARX "%0,0,%2 # local_sub_return\n\ 46"1:" PPC_LLARX(%0,0,%2,0) " # local_sub_return\n\
47 subf %0,%1,%0\n" 47 subf %0,%1,%0\n"
48 PPC405_ERR77(0,%2) 48 PPC405_ERR77(0,%2)
49 PPC_STLCX "%0,0,%2 \n\ 49 PPC_STLCX "%0,0,%2 \n\
@@ -60,7 +60,7 @@ static __inline__ long local_inc_return(local_t *l)
60 long t; 60 long t;
61 61
62 __asm__ __volatile__( 62 __asm__ __volatile__(
63"1:" PPC_LLARX "%0,0,%1 # local_inc_return\n\ 63"1:" PPC_LLARX(%0,0,%1,0) " # local_inc_return\n\
64 addic %0,%0,1\n" 64 addic %0,%0,1\n"
65 PPC405_ERR77(0,%1) 65 PPC405_ERR77(0,%1)
66 PPC_STLCX "%0,0,%1 \n\ 66 PPC_STLCX "%0,0,%1 \n\
@@ -87,7 +87,7 @@ static __inline__ long local_dec_return(local_t *l)
87 long t; 87 long t;
88 88
89 __asm__ __volatile__( 89 __asm__ __volatile__(
90"1:" PPC_LLARX "%0,0,%1 # local_dec_return\n\ 90"1:" PPC_LLARX(%0,0,%1,0) " # local_dec_return\n\
91 addic %0,%0,-1\n" 91 addic %0,%0,-1\n"
92 PPC405_ERR77(0,%1) 92 PPC405_ERR77(0,%1)
93 PPC_STLCX "%0,0,%1\n\ 93 PPC_STLCX "%0,0,%1\n\
@@ -117,7 +117,7 @@ static __inline__ int local_add_unless(local_t *l, long a, long u)
117 long t; 117 long t;
118 118
119 __asm__ __volatile__ ( 119 __asm__ __volatile__ (
120"1:" PPC_LLARX "%0,0,%1 # local_add_unless\n\ 120"1:" PPC_LLARX(%0,0,%1,0) " # local_add_unless\n\
121 cmpw 0,%0,%3 \n\ 121 cmpw 0,%0,%3 \n\
122 beq- 2f \n\ 122 beq- 2f \n\
123 add %0,%2,%0 \n" 123 add %0,%2,%0 \n"
@@ -147,7 +147,7 @@ static __inline__ long local_dec_if_positive(local_t *l)
147 long t; 147 long t;
148 148
149 __asm__ __volatile__( 149 __asm__ __volatile__(
150"1:" PPC_LLARX "%0,0,%1 # local_dec_if_positive\n\ 150"1:" PPC_LLARX(%0,0,%1,0) " # local_dec_if_positive\n\
151 cmpwi %0,1\n\ 151 cmpwi %0,1\n\
152 addi %0,%0,-1\n\ 152 addi %0,%0,-1\n\
153 blt- 2f\n" 153 blt- 2f\n"
diff --git a/arch/powerpc/include/asm/mpc5121.h b/arch/powerpc/include/asm/mpc5121.h
new file mode 100644
index 000000000000..e6a30bb1d16a
--- /dev/null
+++ b/arch/powerpc/include/asm/mpc5121.h
@@ -0,0 +1,24 @@
1/*
2 * MPC5121 Prototypes and definitions
3 *
4 * This file is licensed under the terms of the GNU General Public
5 * License version 2.
6 */
7
8#ifndef __ASM_POWERPC_MPC5121_H__
9#define __ASM_POWERPC_MPC5121_H__
10
11/* MPC512x Reset module registers */
12struct mpc512x_reset_module {
13 u32 rcwlr; /* Reset Configuration Word Low Register */
14 u32 rcwhr; /* Reset Configuration Word High Register */
15 u32 reserved1;
16 u32 reserved2;
17 u32 rsr; /* Reset Status Register */
18 u32 rmr; /* Reset Mode Register */
19 u32 rpr; /* Reset Protection Register */
20 u32 rcr; /* Reset Control Register */
21 u32 rcer; /* Reset Control Enable Register */
22};
23
24#endif /* __ASM_POWERPC_MPC5121_H__ */
diff --git a/arch/powerpc/include/asm/mpc52xx_psc.h b/arch/powerpc/include/asm/mpc52xx_psc.h
index fb8412057450..42561f4f032d 100644
--- a/arch/powerpc/include/asm/mpc52xx_psc.h
+++ b/arch/powerpc/include/asm/mpc52xx_psc.h
@@ -25,7 +25,11 @@
25#include <asm/types.h> 25#include <asm/types.h>
26 26
27/* Max number of PSCs */ 27/* Max number of PSCs */
28#ifdef CONFIG_PPC_MPC512x
29#define MPC52xx_PSC_MAXNUM 12
30#else
28#define MPC52xx_PSC_MAXNUM 6 31#define MPC52xx_PSC_MAXNUM 6
32#endif
29 33
30/* Programmable Serial Controller (PSC) status register bits */ 34/* Programmable Serial Controller (PSC) status register bits */
31#define MPC52xx_PSC_SR_UNEX_RX 0x0001 35#define MPC52xx_PSC_SR_UNEX_RX 0x0001
diff --git a/arch/powerpc/include/asm/mpic.h b/arch/powerpc/include/asm/mpic.h
index a002682f3a6d..61913d9a21a0 100644
--- a/arch/powerpc/include/asm/mpic.h
+++ b/arch/powerpc/include/asm/mpic.h
@@ -289,7 +289,7 @@ struct mpic
289#ifdef CONFIG_MPIC_U3_HT_IRQS 289#ifdef CONFIG_MPIC_U3_HT_IRQS
290 /* The fixup table */ 290 /* The fixup table */
291 struct mpic_irq_fixup *fixups; 291 struct mpic_irq_fixup *fixups;
292 spinlock_t fixup_lock; 292 raw_spinlock_t fixup_lock;
293#endif 293#endif
294 294
295 /* Register access method */ 295 /* Register access method */
diff --git a/arch/powerpc/include/asm/mutex.h b/arch/powerpc/include/asm/mutex.h
index dabc01c727b8..5399f7e18102 100644
--- a/arch/powerpc/include/asm/mutex.h
+++ b/arch/powerpc/include/asm/mutex.h
@@ -15,7 +15,7 @@ static inline int __mutex_cmpxchg_lock(atomic_t *v, int old, int new)
15 PPC405_ERR77(0,%1) 15 PPC405_ERR77(0,%1)
16" stwcx. %3,0,%1\n\ 16" stwcx. %3,0,%1\n\
17 bne- 1b" 17 bne- 1b"
18 ISYNC_ON_SMP 18 PPC_ACQUIRE_BARRIER
19 "\n\ 19 "\n\
202:" 202:"
21 : "=&r" (t) 21 : "=&r" (t)
@@ -35,7 +35,7 @@ static inline int __mutex_dec_return_lock(atomic_t *v)
35 PPC405_ERR77(0,%1) 35 PPC405_ERR77(0,%1)
36" stwcx. %0,0,%1\n\ 36" stwcx. %0,0,%1\n\
37 bne- 1b" 37 bne- 1b"
38 ISYNC_ON_SMP 38 PPC_ACQUIRE_BARRIER
39 : "=&r" (t) 39 : "=&r" (t)
40 : "r" (&v->counter) 40 : "r" (&v->counter)
41 : "cc", "memory"); 41 : "cc", "memory");
@@ -48,7 +48,7 @@ static inline int __mutex_inc_return_unlock(atomic_t *v)
48 int t; 48 int t;
49 49
50 __asm__ __volatile__( 50 __asm__ __volatile__(
51 LWSYNC_ON_SMP 51 PPC_RELEASE_BARRIER
52"1: lwarx %0,0,%1 # mutex unlock\n\ 52"1: lwarx %0,0,%1 # mutex unlock\n\
53 addic %0,%0,1\n" 53 addic %0,%0,1\n"
54 PPC405_ERR77(0,%1) 54 PPC405_ERR77(0,%1)
diff --git a/arch/powerpc/include/asm/param.h b/arch/powerpc/include/asm/param.h
index 094f63d4d5ca..965d45427975 100644
--- a/arch/powerpc/include/asm/param.h
+++ b/arch/powerpc/include/asm/param.h
@@ -1,22 +1 @@
1#ifndef _ASM_POWERPC_PARAM_H #include <asm-generic/param.h>
2#define _ASM_POWERPC_PARAM_H
3
4#ifdef __KERNEL__
5#define HZ CONFIG_HZ /* internal kernel timer frequency */
6#define USER_HZ 100 /* for user interfaces in "ticks" */
7#define CLOCKS_PER_SEC (USER_HZ) /* frequency at which times() counts */
8#endif /* __KERNEL__ */
9
10#ifndef HZ
11#define HZ 100
12#endif
13
14#define EXEC_PAGESIZE 4096
15
16#ifndef NOGROUP
17#define NOGROUP (-1)
18#endif
19
20#define MAXHOSTNAMELEN 64 /* max length of hostname */
21
22#endif /* _ASM_POWERPC_PARAM_H */
diff --git a/arch/powerpc/include/asm/pgtable.h b/arch/powerpc/include/asm/pgtable.h
index 21207e54825b..89f158731ce3 100644
--- a/arch/powerpc/include/asm/pgtable.h
+++ b/arch/powerpc/include/asm/pgtable.h
@@ -209,7 +209,7 @@ extern void paging_init(void);
209 * corresponding HPTE into the hash table ahead of time, instead of 209 * corresponding HPTE into the hash table ahead of time, instead of
210 * waiting for the inevitable extra hash-table miss exception. 210 * waiting for the inevitable extra hash-table miss exception.
211 */ 211 */
212extern void update_mmu_cache(struct vm_area_struct *, unsigned long, pte_t); 212extern void update_mmu_cache(struct vm_area_struct *, unsigned long, pte_t *);
213 213
214extern int gup_hugepd(hugepd_t *hugepd, unsigned pdshift, unsigned long addr, 214extern int gup_hugepd(hugepd_t *hugepd, unsigned pdshift, unsigned long addr,
215 unsigned long end, int write, struct page **pages, int *nr); 215 unsigned long end, int write, struct page **pages, int *nr);
diff --git a/arch/powerpc/include/asm/pmac_feature.h b/arch/powerpc/include/asm/pmac_feature.h
index 877c35a4356e..00eedc5a4e61 100644
--- a/arch/powerpc/include/asm/pmac_feature.h
+++ b/arch/powerpc/include/asm/pmac_feature.h
@@ -378,7 +378,7 @@ extern struct macio_chip* macio_find(struct device_node* child, int type);
378 * Those are exported by pmac feature for internal use by arch code 378 * Those are exported by pmac feature for internal use by arch code
379 * only like the platform function callbacks, do not use directly in drivers 379 * only like the platform function callbacks, do not use directly in drivers
380 */ 380 */
381extern spinlock_t feature_lock; 381extern raw_spinlock_t feature_lock;
382extern struct device_node *uninorth_node; 382extern struct device_node *uninorth_node;
383extern u32 __iomem *uninorth_base; 383extern u32 __iomem *uninorth_base;
384 384
diff --git a/arch/powerpc/include/asm/ppc-opcode.h b/arch/powerpc/include/asm/ppc-opcode.h
index ef9aa84cac5a..aea714797590 100644
--- a/arch/powerpc/include/asm/ppc-opcode.h
+++ b/arch/powerpc/include/asm/ppc-opcode.h
@@ -22,8 +22,10 @@
22#define PPC_INST_DCBZL 0x7c2007ec 22#define PPC_INST_DCBZL 0x7c2007ec
23#define PPC_INST_ISEL 0x7c00001e 23#define PPC_INST_ISEL 0x7c00001e
24#define PPC_INST_ISEL_MASK 0xfc00003e 24#define PPC_INST_ISEL_MASK 0xfc00003e
25#define PPC_INST_LDARX 0x7c0000a8
25#define PPC_INST_LSWI 0x7c0004aa 26#define PPC_INST_LSWI 0x7c0004aa
26#define PPC_INST_LSWX 0x7c00042a 27#define PPC_INST_LSWX 0x7c00042a
28#define PPC_INST_LWARX 0x7c000029
27#define PPC_INST_LWSYNC 0x7c2004ac 29#define PPC_INST_LWSYNC 0x7c2004ac
28#define PPC_INST_LXVD2X 0x7c000698 30#define PPC_INST_LXVD2X 0x7c000698
29#define PPC_INST_MCRXR 0x7c000400 31#define PPC_INST_MCRXR 0x7c000400
@@ -55,15 +57,31 @@
55#define __PPC_RA(a) (((a) & 0x1f) << 16) 57#define __PPC_RA(a) (((a) & 0x1f) << 16)
56#define __PPC_RB(b) (((b) & 0x1f) << 11) 58#define __PPC_RB(b) (((b) & 0x1f) << 11)
57#define __PPC_RS(s) (((s) & 0x1f) << 21) 59#define __PPC_RS(s) (((s) & 0x1f) << 21)
60#define __PPC_RT(s) __PPC_RS(s)
58#define __PPC_XS(s) ((((s) & 0x1f) << 21) | (((s) & 0x20) >> 5)) 61#define __PPC_XS(s) ((((s) & 0x1f) << 21) | (((s) & 0x20) >> 5))
59#define __PPC_T_TLB(t) (((t) & 0x3) << 21) 62#define __PPC_T_TLB(t) (((t) & 0x3) << 21)
60#define __PPC_WC(w) (((w) & 0x3) << 21) 63#define __PPC_WC(w) (((w) & 0x3) << 21)
64/*
65 * Only use the larx hint bit on 64bit CPUs. Once we verify it doesn't have
66 * any side effects on all 32bit processors, we can do this all the time.
67 */
68#ifdef CONFIG_PPC64
69#define __PPC_EH(eh) (((eh) & 0x1) << 0)
70#else
71#define __PPC_EH(eh) 0
72#endif
61 73
62/* Deal with instructions that older assemblers aren't aware of */ 74/* Deal with instructions that older assemblers aren't aware of */
63#define PPC_DCBAL(a, b) stringify_in_c(.long PPC_INST_DCBAL | \ 75#define PPC_DCBAL(a, b) stringify_in_c(.long PPC_INST_DCBAL | \
64 __PPC_RA(a) | __PPC_RB(b)) 76 __PPC_RA(a) | __PPC_RB(b))
65#define PPC_DCBZL(a, b) stringify_in_c(.long PPC_INST_DCBZL | \ 77#define PPC_DCBZL(a, b) stringify_in_c(.long PPC_INST_DCBZL | \
66 __PPC_RA(a) | __PPC_RB(b)) 78 __PPC_RA(a) | __PPC_RB(b))
79#define PPC_LDARX(t, a, b, eh) stringify_in_c(.long PPC_INST_LDARX | \
80 __PPC_RT(t) | __PPC_RA(a) | \
81 __PPC_RB(b) | __PPC_EH(eh))
82#define PPC_LWARX(t, a, b, eh) stringify_in_c(.long PPC_INST_LWARX | \
83 __PPC_RT(t) | __PPC_RA(a) | \
84 __PPC_RB(b) | __PPC_EH(eh))
67#define PPC_MSGSND(b) stringify_in_c(.long PPC_INST_MSGSND | \ 85#define PPC_MSGSND(b) stringify_in_c(.long PPC_INST_MSGSND | \
68 __PPC_RB(b)) 86 __PPC_RB(b))
69#define PPC_RFCI stringify_in_c(.long PPC_INST_RFCI) 87#define PPC_RFCI stringify_in_c(.long PPC_INST_RFCI)
diff --git a/arch/powerpc/include/asm/ppc-pci.h b/arch/powerpc/include/asm/ppc-pci.h
index 2828f9d0f66d..42fdff0e4b32 100644
--- a/arch/powerpc/include/asm/ppc-pci.h
+++ b/arch/powerpc/include/asm/ppc-pci.h
@@ -137,6 +137,11 @@ struct device_node * find_device_pe(struct device_node *dn);
137void eeh_sysfs_add_device(struct pci_dev *pdev); 137void eeh_sysfs_add_device(struct pci_dev *pdev);
138void eeh_sysfs_remove_device(struct pci_dev *pdev); 138void eeh_sysfs_remove_device(struct pci_dev *pdev);
139 139
140static inline const char *eeh_pci_name(struct pci_dev *pdev)
141{
142 return pdev ? pci_name(pdev) : "<null>";
143}
144
140#endif /* CONFIG_EEH */ 145#endif /* CONFIG_EEH */
141 146
142#else /* CONFIG_PCI */ 147#else /* CONFIG_PCI */
diff --git a/arch/powerpc/include/asm/processor.h b/arch/powerpc/include/asm/processor.h
index 9eed29eee604..221ba6240464 100644
--- a/arch/powerpc/include/asm/processor.h
+++ b/arch/powerpc/include/asm/processor.h
@@ -161,9 +161,41 @@ struct thread_struct {
161#ifdef CONFIG_PPC32 161#ifdef CONFIG_PPC32
162 void *pgdir; /* root of page-table tree */ 162 void *pgdir; /* root of page-table tree */
163#endif 163#endif
164#if defined(CONFIG_4xx) || defined (CONFIG_BOOKE) 164#ifdef CONFIG_PPC_ADV_DEBUG_REGS
165 unsigned long dbcr0; /* debug control register values */ 165 /*
166 * The following help to manage the use of Debug Control Registers
167 * om the BookE platforms.
168 */
169 unsigned long dbcr0;
166 unsigned long dbcr1; 170 unsigned long dbcr1;
171#ifdef CONFIG_BOOKE
172 unsigned long dbcr2;
173#endif
174 /*
175 * The stored value of the DBSR register will be the value at the
176 * last debug interrupt. This register can only be read from the
177 * user (will never be written to) and has value while helping to
178 * describe the reason for the last debug trap. Torez
179 */
180 unsigned long dbsr;
181 /*
182 * The following will contain addresses used by debug applications
183 * to help trace and trap on particular address locations.
184 * The bits in the Debug Control Registers above help define which
185 * of the following registers will contain valid data and/or addresses.
186 */
187 unsigned long iac1;
188 unsigned long iac2;
189#if CONFIG_PPC_ADV_DEBUG_IACS > 2
190 unsigned long iac3;
191 unsigned long iac4;
192#endif
193 unsigned long dac1;
194 unsigned long dac2;
195#if CONFIG_PPC_ADV_DEBUG_DVCS > 0
196 unsigned long dvc1;
197 unsigned long dvc2;
198#endif
167#endif 199#endif
168 /* FP and VSX 0-31 register set */ 200 /* FP and VSX 0-31 register set */
169 double fpr[32][TS_FPRWIDTH]; 201 double fpr[32][TS_FPRWIDTH];
diff --git a/arch/powerpc/include/asm/prom.h b/arch/powerpc/include/asm/prom.h
index 2ab9cbd98826..ddd408a93b5a 100644
--- a/arch/powerpc/include/asm/prom.h
+++ b/arch/powerpc/include/asm/prom.h
@@ -23,21 +23,8 @@
23#include <asm/irq.h> 23#include <asm/irq.h>
24#include <asm/atomic.h> 24#include <asm/atomic.h>
25 25
26#define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 1
27#define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1
28
29#define of_compat_cmp(s1, s2, l) strcasecmp((s1), (s2))
30#define of_prop_cmp(s1, s2) strcmp((s1), (s2))
31#define of_node_cmp(s1, s2) strcasecmp((s1), (s2))
32
33extern struct device_node *of_chosen;
34
35#define HAVE_ARCH_DEVTREE_FIXUPS 26#define HAVE_ARCH_DEVTREE_FIXUPS
36 27
37/* For updating the device tree at runtime */
38extern void of_attach_node(struct device_node *);
39extern void of_detach_node(struct device_node *);
40
41#ifdef CONFIG_PPC32 28#ifdef CONFIG_PPC32
42/* 29/*
43 * PCI <-> OF matching functions 30 * PCI <-> OF matching functions
@@ -52,11 +39,6 @@ extern struct device_node* pci_device_to_OF_node(struct pci_dev *);
52extern void pci_create_OF_bus_map(void); 39extern void pci_create_OF_bus_map(void);
53#endif 40#endif
54 41
55extern struct resource *request_OF_resource(struct device_node* node,
56 int index, const char* name_postfix);
57extern int release_OF_resource(struct device_node* node, int index);
58
59
60/* 42/*
61 * OF address retreival & translation 43 * OF address retreival & translation
62 */ 44 */
diff --git a/arch/powerpc/include/asm/ptrace.h b/arch/powerpc/include/asm/ptrace.h
index cbd759e3cd78..b45108126562 100644
--- a/arch/powerpc/include/asm/ptrace.h
+++ b/arch/powerpc/include/asm/ptrace.h
@@ -24,6 +24,12 @@
24 * 2 of the License, or (at your option) any later version. 24 * 2 of the License, or (at your option) any later version.
25 */ 25 */
26 26
27#ifdef __KERNEL__
28#include <linux/types.h>
29#else
30#include <stdint.h>
31#endif
32
27#ifndef __ASSEMBLY__ 33#ifndef __ASSEMBLY__
28 34
29struct pt_regs { 35struct pt_regs {
@@ -294,4 +300,75 @@ extern void user_disable_single_step(struct task_struct *);
294 300
295#define PTRACE_SINGLEBLOCK 0x100 /* resume execution until next branch */ 301#define PTRACE_SINGLEBLOCK 0x100 /* resume execution until next branch */
296 302
303#define PPC_PTRACE_GETHWDBGINFO 0x89
304#define PPC_PTRACE_SETHWDEBUG 0x88
305#define PPC_PTRACE_DELHWDEBUG 0x87
306
307#ifndef __ASSEMBLY__
308
309struct ppc_debug_info {
310 uint32_t version; /* Only version 1 exists to date */
311 uint32_t num_instruction_bps;
312 uint32_t num_data_bps;
313 uint32_t num_condition_regs;
314 uint32_t data_bp_alignment;
315 uint32_t sizeof_condition; /* size of the DVC register */
316 uint64_t features;
317};
318
319#endif /* __ASSEMBLY__ */
320
321/*
322 * features will have bits indication whether there is support for:
323 */
324#define PPC_DEBUG_FEATURE_INSN_BP_RANGE 0x0000000000000001
325#define PPC_DEBUG_FEATURE_INSN_BP_MASK 0x0000000000000002
326#define PPC_DEBUG_FEATURE_DATA_BP_RANGE 0x0000000000000004
327#define PPC_DEBUG_FEATURE_DATA_BP_MASK 0x0000000000000008
328
329#ifndef __ASSEMBLY__
330
331struct ppc_hw_breakpoint {
332 uint32_t version; /* currently, version must be 1 */
333 uint32_t trigger_type; /* only some combinations allowed */
334 uint32_t addr_mode; /* address match mode */
335 uint32_t condition_mode; /* break/watchpoint condition flags */
336 uint64_t addr; /* break/watchpoint address */
337 uint64_t addr2; /* range end or mask */
338 uint64_t condition_value; /* contents of the DVC register */
339};
340
341#endif /* __ASSEMBLY__ */
342
343/*
344 * Trigger Type
345 */
346#define PPC_BREAKPOINT_TRIGGER_EXECUTE 0x00000001
347#define PPC_BREAKPOINT_TRIGGER_READ 0x00000002
348#define PPC_BREAKPOINT_TRIGGER_WRITE 0x00000004
349#define PPC_BREAKPOINT_TRIGGER_RW \
350 (PPC_BREAKPOINT_TRIGGER_READ | PPC_BREAKPOINT_TRIGGER_WRITE)
351
352/*
353 * Address Mode
354 */
355#define PPC_BREAKPOINT_MODE_EXACT 0x00000000
356#define PPC_BREAKPOINT_MODE_RANGE_INCLUSIVE 0x00000001
357#define PPC_BREAKPOINT_MODE_RANGE_EXCLUSIVE 0x00000002
358#define PPC_BREAKPOINT_MODE_MASK 0x00000003
359
360/*
361 * Condition Mode
362 */
363#define PPC_BREAKPOINT_CONDITION_MODE 0x00000003
364#define PPC_BREAKPOINT_CONDITION_NONE 0x00000000
365#define PPC_BREAKPOINT_CONDITION_AND 0x00000001
366#define PPC_BREAKPOINT_CONDITION_EXACT PPC_BREAKPOINT_CONDITION_AND
367#define PPC_BREAKPOINT_CONDITION_OR 0x00000002
368#define PPC_BREAKPOINT_CONDITION_AND_OR 0x00000003
369#define PPC_BREAKPOINT_CONDITION_BE_ALL 0x00ff0000
370#define PPC_BREAKPOINT_CONDITION_BE_SHIFT 16
371#define PPC_BREAKPOINT_CONDITION_BE(n) \
372 (1<<((n)+PPC_BREAKPOINT_CONDITION_BE_SHIFT))
373
297#endif /* _ASM_POWERPC_PTRACE_H */ 374#endif /* _ASM_POWERPC_PTRACE_H */
diff --git a/arch/powerpc/include/asm/reg_booke.h b/arch/powerpc/include/asm/reg_booke.h
index 3bf783505528..8808d307fe7e 100644
--- a/arch/powerpc/include/asm/reg_booke.h
+++ b/arch/powerpc/include/asm/reg_booke.h
@@ -248,6 +248,8 @@
248#define DBSR_RET 0x00008000 /* Return Debug Event */ 248#define DBSR_RET 0x00008000 /* Return Debug Event */
249#define DBSR_CIRPT 0x00000040 /* Critical Interrupt Taken Event */ 249#define DBSR_CIRPT 0x00000040 /* Critical Interrupt Taken Event */
250#define DBSR_CRET 0x00000020 /* Critical Return Debug Event */ 250#define DBSR_CRET 0x00000020 /* Critical Return Debug Event */
251#define DBSR_IAC12ATS 0x00000002 /* Instr Address Compare 1/2 Toggle */
252#define DBSR_IAC34ATS 0x00000001 /* Instr Address Compare 3/4 Toggle */
251#endif 253#endif
252#ifdef CONFIG_40x 254#ifdef CONFIG_40x
253#define DBSR_IC 0x80000000 /* Instruction Completion */ 255#define DBSR_IC 0x80000000 /* Instruction Completion */
@@ -313,6 +315,38 @@
313#define DBCR0_IA12T 0x00008000 /* Instr Addr 1-2 range Toggle */ 315#define DBCR0_IA12T 0x00008000 /* Instr Addr 1-2 range Toggle */
314#define DBCR0_IA34T 0x00004000 /* Instr Addr 3-4 range Toggle */ 316#define DBCR0_IA34T 0x00004000 /* Instr Addr 3-4 range Toggle */
315#define DBCR0_FT 0x00000001 /* Freeze Timers on debug event */ 317#define DBCR0_FT 0x00000001 /* Freeze Timers on debug event */
318
319#define dbcr_iac_range(task) ((task)->thread.dbcr0)
320#define DBCR_IAC12I DBCR0_IA12 /* Range Inclusive */
321#define DBCR_IAC12X (DBCR0_IA12 | DBCR0_IA12X) /* Range Exclusive */
322#define DBCR_IAC12MODE (DBCR0_IA12 | DBCR0_IA12X) /* IAC 1-2 Mode Bits */
323#define DBCR_IAC34I DBCR0_IA34 /* Range Inclusive */
324#define DBCR_IAC34X (DBCR0_IA34 | DBCR0_IA34X) /* Range Exclusive */
325#define DBCR_IAC34MODE (DBCR0_IA34 | DBCR0_IA34X) /* IAC 3-4 Mode Bits */
326
327/* Bit definitions related to the DBCR1. */
328#define DBCR1_DAC1R 0x80000000 /* DAC1 Read Debug Event */
329#define DBCR1_DAC2R 0x40000000 /* DAC2 Read Debug Event */
330#define DBCR1_DAC1W 0x20000000 /* DAC1 Write Debug Event */
331#define DBCR1_DAC2W 0x10000000 /* DAC2 Write Debug Event */
332
333#define dbcr_dac(task) ((task)->thread.dbcr1)
334#define DBCR_DAC1R DBCR1_DAC1R
335#define DBCR_DAC1W DBCR1_DAC1W
336#define DBCR_DAC2R DBCR1_DAC2R
337#define DBCR_DAC2W DBCR1_DAC2W
338
339/*
340 * Are there any active Debug Events represented in the
341 * Debug Control Registers?
342 */
343#define DBCR0_ACTIVE_EVENTS (DBCR0_ICMP | DBCR0_IAC1 | DBCR0_IAC2 | \
344 DBCR0_IAC3 | DBCR0_IAC4)
345#define DBCR1_ACTIVE_EVENTS (DBCR1_DAC1R | DBCR1_DAC2R | \
346 DBCR1_DAC1W | DBCR1_DAC2W)
347#define DBCR_ACTIVE_EVENTS(dbcr0, dbcr1) (((dbcr0) & DBCR0_ACTIVE_EVENTS) || \
348 ((dbcr1) & DBCR1_ACTIVE_EVENTS))
349
316#elif defined(CONFIG_BOOKE) 350#elif defined(CONFIG_BOOKE)
317#define DBCR0_EDM 0x80000000 /* External Debug Mode */ 351#define DBCR0_EDM 0x80000000 /* External Debug Mode */
318#define DBCR0_IDM 0x40000000 /* Internal Debug Mode */ 352#define DBCR0_IDM 0x40000000 /* Internal Debug Mode */
@@ -342,19 +376,79 @@
342#define DBCR0_CRET 0x00000020 /* Critical Return Debug Event */ 376#define DBCR0_CRET 0x00000020 /* Critical Return Debug Event */
343#define DBCR0_FT 0x00000001 /* Freeze Timers on debug event */ 377#define DBCR0_FT 0x00000001 /* Freeze Timers on debug event */
344 378
379#define dbcr_dac(task) ((task)->thread.dbcr0)
380#define DBCR_DAC1R DBCR0_DAC1R
381#define DBCR_DAC1W DBCR0_DAC1W
382#define DBCR_DAC2R DBCR0_DAC2R
383#define DBCR_DAC2W DBCR0_DAC2W
384
345/* Bit definitions related to the DBCR1. */ 385/* Bit definitions related to the DBCR1. */
386#define DBCR1_IAC1US 0xC0000000 /* Instr Addr Cmp 1 Sup/User */
387#define DBCR1_IAC1ER 0x30000000 /* Instr Addr Cmp 1 Eff/Real */
388#define DBCR1_IAC1ER_01 0x10000000 /* reserved */
389#define DBCR1_IAC1ER_10 0x20000000 /* Instr Addr Cmp 1 Eff/Real MSR[IS]=0 */
390#define DBCR1_IAC1ER_11 0x30000000 /* Instr Addr Cmp 1 Eff/Real MSR[IS]=1 */
391#define DBCR1_IAC2US 0x0C000000 /* Instr Addr Cmp 2 Sup/User */
392#define DBCR1_IAC2ER 0x03000000 /* Instr Addr Cmp 2 Eff/Real */
393#define DBCR1_IAC2ER_01 0x01000000 /* reserved */
394#define DBCR1_IAC2ER_10 0x02000000 /* Instr Addr Cmp 2 Eff/Real MSR[IS]=0 */
395#define DBCR1_IAC2ER_11 0x03000000 /* Instr Addr Cmp 2 Eff/Real MSR[IS]=1 */
346#define DBCR1_IAC12M 0x00800000 /* Instr Addr 1-2 range enable */ 396#define DBCR1_IAC12M 0x00800000 /* Instr Addr 1-2 range enable */
347#define DBCR1_IAC12MX 0x00C00000 /* Instr Addr 1-2 range eXclusive */ 397#define DBCR1_IAC12MX 0x00C00000 /* Instr Addr 1-2 range eXclusive */
348#define DBCR1_IAC12AT 0x00010000 /* Instr Addr 1-2 range Toggle */ 398#define DBCR1_IAC12AT 0x00010000 /* Instr Addr 1-2 range Toggle */
399#define DBCR1_IAC3US 0x0000C000 /* Instr Addr Cmp 3 Sup/User */
400#define DBCR1_IAC3ER 0x00003000 /* Instr Addr Cmp 3 Eff/Real */
401#define DBCR1_IAC3ER_01 0x00001000 /* reserved */
402#define DBCR1_IAC3ER_10 0x00002000 /* Instr Addr Cmp 3 Eff/Real MSR[IS]=0 */
403#define DBCR1_IAC3ER_11 0x00003000 /* Instr Addr Cmp 3 Eff/Real MSR[IS]=1 */
404#define DBCR1_IAC4US 0x00000C00 /* Instr Addr Cmp 4 Sup/User */
405#define DBCR1_IAC4ER 0x00000300 /* Instr Addr Cmp 4 Eff/Real */
406#define DBCR1_IAC4ER_01 0x00000100 /* Instr Addr Cmp 4 Eff/Real MSR[IS]=0 */
407#define DBCR1_IAC4ER_10 0x00000200 /* Instr Addr Cmp 4 Eff/Real MSR[IS]=0 */
408#define DBCR1_IAC4ER_11 0x00000300 /* Instr Addr Cmp 4 Eff/Real MSR[IS]=1 */
349#define DBCR1_IAC34M 0x00000080 /* Instr Addr 3-4 range enable */ 409#define DBCR1_IAC34M 0x00000080 /* Instr Addr 3-4 range enable */
350#define DBCR1_IAC34MX 0x000000C0 /* Instr Addr 3-4 range eXclusive */ 410#define DBCR1_IAC34MX 0x000000C0 /* Instr Addr 3-4 range eXclusive */
351#define DBCR1_IAC34AT 0x00000001 /* Instr Addr 3-4 range Toggle */ 411#define DBCR1_IAC34AT 0x00000001 /* Instr Addr 3-4 range Toggle */
352 412
413#define dbcr_iac_range(task) ((task)->thread.dbcr1)
414#define DBCR_IAC12I DBCR1_IAC12M /* Range Inclusive */
415#define DBCR_IAC12X DBCR1_IAC12MX /* Range Exclusive */
416#define DBCR_IAC12MODE DBCR1_IAC12MX /* IAC 1-2 Mode Bits */
417#define DBCR_IAC34I DBCR1_IAC34M /* Range Inclusive */
418#define DBCR_IAC34X DBCR1_IAC34MX /* Range Exclusive */
419#define DBCR_IAC34MODE DBCR1_IAC34MX /* IAC 3-4 Mode Bits */
420
353/* Bit definitions related to the DBCR2. */ 421/* Bit definitions related to the DBCR2. */
422#define DBCR2_DAC1US 0xC0000000 /* Data Addr Cmp 1 Sup/User */
423#define DBCR2_DAC1ER 0x30000000 /* Data Addr Cmp 1 Eff/Real */
424#define DBCR2_DAC2US 0x00000000 /* Data Addr Cmp 2 Sup/User */
425#define DBCR2_DAC2ER 0x00000000 /* Data Addr Cmp 2 Eff/Real */
354#define DBCR2_DAC12M 0x00800000 /* DAC 1-2 range enable */ 426#define DBCR2_DAC12M 0x00800000 /* DAC 1-2 range enable */
427#define DBCR2_DAC12MM 0x00400000 /* DAC 1-2 Mask mode*/
355#define DBCR2_DAC12MX 0x00C00000 /* DAC 1-2 range eXclusive */ 428#define DBCR2_DAC12MX 0x00C00000 /* DAC 1-2 range eXclusive */
429#define DBCR2_DAC12MODE 0x00C00000 /* DAC 1-2 Mode Bits */
356#define DBCR2_DAC12A 0x00200000 /* DAC 1-2 Asynchronous */ 430#define DBCR2_DAC12A 0x00200000 /* DAC 1-2 Asynchronous */
357#endif 431#define DBCR2_DVC1M 0x000C0000 /* Data Value Comp 1 Mode */
432#define DBCR2_DVC1M_SHIFT 18 /* # of bits to shift DBCR2_DVC1M */
433#define DBCR2_DVC2M 0x00030000 /* Data Value Comp 2 Mode */
434#define DBCR2_DVC2M_SHIFT 16 /* # of bits to shift DBCR2_DVC2M */
435#define DBCR2_DVC1BE 0x00000F00 /* Data Value Comp 1 Byte */
436#define DBCR2_DVC1BE_SHIFT 8 /* # of bits to shift DBCR2_DVC1BE */
437#define DBCR2_DVC2BE 0x0000000F /* Data Value Comp 2 Byte */
438#define DBCR2_DVC2BE_SHIFT 0 /* # of bits to shift DBCR2_DVC2BE */
439
440/*
441 * Are there any active Debug Events represented in the
442 * Debug Control Registers?
443 */
444#define DBCR0_ACTIVE_EVENTS (DBCR0_ICMP | DBCR0_IAC1 | DBCR0_IAC2 | \
445 DBCR0_IAC3 | DBCR0_IAC4 | DBCR0_DAC1R | \
446 DBCR0_DAC1W | DBCR0_DAC2R | DBCR0_DAC2W)
447#define DBCR1_ACTIVE_EVENTS 0
448
449#define DBCR_ACTIVE_EVENTS(dbcr0, dbcr1) (((dbcr0) & DBCR0_ACTIVE_EVENTS) || \
450 ((dbcr1) & DBCR1_ACTIVE_EVENTS))
451#endif /* #elif defined(CONFIG_BOOKE) */
358 452
359/* Bit definitions related to the TCR. */ 453/* Bit definitions related to the TCR. */
360#define TCR_WP(x) (((x)&0x3)<<30) /* WDT Period */ 454#define TCR_WP(x) (((x)&0x3)<<30) /* WDT Period */
diff --git a/arch/powerpc/include/asm/spinlock.h b/arch/powerpc/include/asm/spinlock.h
index 764094cff681..f9611bd69ed2 100644
--- a/arch/powerpc/include/asm/spinlock.h
+++ b/arch/powerpc/include/asm/spinlock.h
@@ -27,6 +27,7 @@
27#endif 27#endif
28#include <asm/asm-compat.h> 28#include <asm/asm-compat.h>
29#include <asm/synch.h> 29#include <asm/synch.h>
30#include <asm/ppc-opcode.h>
30 31
31#define arch_spin_is_locked(x) ((x)->slock != 0) 32#define arch_spin_is_locked(x) ((x)->slock != 0)
32 33
@@ -60,13 +61,14 @@ static inline unsigned long __arch_spin_trylock(arch_spinlock_t *lock)
60 61
61 token = LOCK_TOKEN; 62 token = LOCK_TOKEN;
62 __asm__ __volatile__( 63 __asm__ __volatile__(
63"1: lwarx %0,0,%2\n\ 64"1: " PPC_LWARX(%0,0,%2,1) "\n\
64 cmpwi 0,%0,0\n\ 65 cmpwi 0,%0,0\n\
65 bne- 2f\n\ 66 bne- 2f\n\
66 stwcx. %1,0,%2\n\ 67 stwcx. %1,0,%2\n\
67 bne- 1b\n\ 68 bne- 1b\n"
68 isync\n\ 69 PPC_ACQUIRE_BARRIER
692:" : "=&r" (tmp) 70"2:"
71 : "=&r" (tmp)
70 : "r" (token), "r" (&lock->slock) 72 : "r" (token), "r" (&lock->slock)
71 : "cr0", "memory"); 73 : "cr0", "memory");
72 74
@@ -144,7 +146,7 @@ static inline void arch_spin_unlock(arch_spinlock_t *lock)
144{ 146{
145 SYNC_IO; 147 SYNC_IO;
146 __asm__ __volatile__("# arch_spin_unlock\n\t" 148 __asm__ __volatile__("# arch_spin_unlock\n\t"
147 LWSYNC_ON_SMP: : :"memory"); 149 PPC_RELEASE_BARRIER: : :"memory");
148 lock->slock = 0; 150 lock->slock = 0;
149} 151}
150 152
@@ -186,15 +188,15 @@ static inline long __arch_read_trylock(arch_rwlock_t *rw)
186 long tmp; 188 long tmp;
187 189
188 __asm__ __volatile__( 190 __asm__ __volatile__(
189"1: lwarx %0,0,%1\n" 191"1: " PPC_LWARX(%0,0,%1,1) "\n"
190 __DO_SIGN_EXTEND 192 __DO_SIGN_EXTEND
191" addic. %0,%0,1\n\ 193" addic. %0,%0,1\n\
192 ble- 2f\n" 194 ble- 2f\n"
193 PPC405_ERR77(0,%1) 195 PPC405_ERR77(0,%1)
194" stwcx. %0,0,%1\n\ 196" stwcx. %0,0,%1\n\
195 bne- 1b\n\ 197 bne- 1b\n"
196 isync\n\ 198 PPC_ACQUIRE_BARRIER
1972:" : "=&r" (tmp) 199"2:" : "=&r" (tmp)
198 : "r" (&rw->lock) 200 : "r" (&rw->lock)
199 : "cr0", "xer", "memory"); 201 : "cr0", "xer", "memory");
200 202
@@ -211,14 +213,14 @@ static inline long __arch_write_trylock(arch_rwlock_t *rw)
211 213
212 token = WRLOCK_TOKEN; 214 token = WRLOCK_TOKEN;
213 __asm__ __volatile__( 215 __asm__ __volatile__(
214"1: lwarx %0,0,%2\n\ 216"1: " PPC_LWARX(%0,0,%2,1) "\n\
215 cmpwi 0,%0,0\n\ 217 cmpwi 0,%0,0\n\
216 bne- 2f\n" 218 bne- 2f\n"
217 PPC405_ERR77(0,%1) 219 PPC405_ERR77(0,%1)
218" stwcx. %1,0,%2\n\ 220" stwcx. %1,0,%2\n\
219 bne- 1b\n\ 221 bne- 1b\n"
220 isync\n\ 222 PPC_ACQUIRE_BARRIER
2212:" : "=&r" (tmp) 223"2:" : "=&r" (tmp)
222 : "r" (token), "r" (&rw->lock) 224 : "r" (token), "r" (&rw->lock)
223 : "cr0", "memory"); 225 : "cr0", "memory");
224 226
@@ -269,7 +271,7 @@ static inline void arch_read_unlock(arch_rwlock_t *rw)
269 271
270 __asm__ __volatile__( 272 __asm__ __volatile__(
271 "# read_unlock\n\t" 273 "# read_unlock\n\t"
272 LWSYNC_ON_SMP 274 PPC_RELEASE_BARRIER
273"1: lwarx %0,0,%1\n\ 275"1: lwarx %0,0,%1\n\
274 addic %0,%0,-1\n" 276 addic %0,%0,-1\n"
275 PPC405_ERR77(0,%1) 277 PPC405_ERR77(0,%1)
@@ -283,7 +285,7 @@ static inline void arch_read_unlock(arch_rwlock_t *rw)
283static inline void arch_write_unlock(arch_rwlock_t *rw) 285static inline void arch_write_unlock(arch_rwlock_t *rw)
284{ 286{
285 __asm__ __volatile__("# write_unlock\n\t" 287 __asm__ __volatile__("# write_unlock\n\t"
286 LWSYNC_ON_SMP: : :"memory"); 288 PPC_RELEASE_BARRIER: : :"memory");
287 rw->lock = 0; 289 rw->lock = 0;
288} 290}
289 291
diff --git a/arch/powerpc/include/asm/synch.h b/arch/powerpc/include/asm/synch.h
index 28f6ddbff4cf..d7cab44643c5 100644
--- a/arch/powerpc/include/asm/synch.h
+++ b/arch/powerpc/include/asm/synch.h
@@ -37,11 +37,15 @@ static inline void isync(void)
37#endif 37#endif
38 38
39#ifdef CONFIG_SMP 39#ifdef CONFIG_SMP
40#define ISYNC_ON_SMP "\n\tisync\n" 40#define __PPC_ACQUIRE_BARRIER \
41#define LWSYNC_ON_SMP stringify_in_c(LWSYNC) "\n" 41 START_LWSYNC_SECTION(97); \
42 isync; \
43 MAKE_LWSYNC_SECTION_ENTRY(97, __lwsync_fixup);
44#define PPC_ACQUIRE_BARRIER "\n" stringify_in_c(__PPC_ACQUIRE_BARRIER)
45#define PPC_RELEASE_BARRIER stringify_in_c(LWSYNC) "\n"
42#else 46#else
43#define ISYNC_ON_SMP 47#define PPC_ACQUIRE_BARRIER
44#define LWSYNC_ON_SMP 48#define PPC_RELEASE_BARRIER
45#endif 49#endif
46 50
47#endif /* __KERNEL__ */ 51#endif /* __KERNEL__ */
diff --git a/arch/powerpc/include/asm/system.h b/arch/powerpc/include/asm/system.h
index bb8e006a47c6..a6297c67c3d6 100644
--- a/arch/powerpc/include/asm/system.h
+++ b/arch/powerpc/include/asm/system.h
@@ -112,8 +112,13 @@ static inline int debugger_fault_handler(struct pt_regs *regs) { return 0; }
112#endif 112#endif
113 113
114extern int set_dabr(unsigned long dabr); 114extern int set_dabr(unsigned long dabr);
115#ifdef CONFIG_PPC_ADV_DEBUG_REGS
116extern void do_send_trap(struct pt_regs *regs, unsigned long address,
117 unsigned long error_code, int signal_code, int brkpt);
118#else
115extern void do_dabr(struct pt_regs *regs, unsigned long address, 119extern void do_dabr(struct pt_regs *regs, unsigned long address,
116 unsigned long error_code); 120 unsigned long error_code);
121#endif
117extern void print_backtrace(unsigned long *); 122extern void print_backtrace(unsigned long *);
118extern void show_regs(struct pt_regs * regs); 123extern void show_regs(struct pt_regs * regs);
119extern void flush_instruction_cache(void); 124extern void flush_instruction_cache(void);
@@ -232,12 +237,12 @@ __xchg_u32(volatile void *p, unsigned long val)
232 unsigned long prev; 237 unsigned long prev;
233 238
234 __asm__ __volatile__( 239 __asm__ __volatile__(
235 LWSYNC_ON_SMP 240 PPC_RELEASE_BARRIER
236"1: lwarx %0,0,%2 \n" 241"1: lwarx %0,0,%2 \n"
237 PPC405_ERR77(0,%2) 242 PPC405_ERR77(0,%2)
238" stwcx. %3,0,%2 \n\ 243" stwcx. %3,0,%2 \n\
239 bne- 1b" 244 bne- 1b"
240 ISYNC_ON_SMP 245 PPC_ACQUIRE_BARRIER
241 : "=&r" (prev), "+m" (*(volatile unsigned int *)p) 246 : "=&r" (prev), "+m" (*(volatile unsigned int *)p)
242 : "r" (p), "r" (val) 247 : "r" (p), "r" (val)
243 : "cc", "memory"); 248 : "cc", "memory");
@@ -275,12 +280,12 @@ __xchg_u64(volatile void *p, unsigned long val)
275 unsigned long prev; 280 unsigned long prev;
276 281
277 __asm__ __volatile__( 282 __asm__ __volatile__(
278 LWSYNC_ON_SMP 283 PPC_RELEASE_BARRIER
279"1: ldarx %0,0,%2 \n" 284"1: ldarx %0,0,%2 \n"
280 PPC405_ERR77(0,%2) 285 PPC405_ERR77(0,%2)
281" stdcx. %3,0,%2 \n\ 286" stdcx. %3,0,%2 \n\
282 bne- 1b" 287 bne- 1b"
283 ISYNC_ON_SMP 288 PPC_ACQUIRE_BARRIER
284 : "=&r" (prev), "+m" (*(volatile unsigned long *)p) 289 : "=&r" (prev), "+m" (*(volatile unsigned long *)p)
285 : "r" (p), "r" (val) 290 : "r" (p), "r" (val)
286 : "cc", "memory"); 291 : "cc", "memory");
@@ -366,14 +371,14 @@ __cmpxchg_u32(volatile unsigned int *p, unsigned long old, unsigned long new)
366 unsigned int prev; 371 unsigned int prev;
367 372
368 __asm__ __volatile__ ( 373 __asm__ __volatile__ (
369 LWSYNC_ON_SMP 374 PPC_RELEASE_BARRIER
370"1: lwarx %0,0,%2 # __cmpxchg_u32\n\ 375"1: lwarx %0,0,%2 # __cmpxchg_u32\n\
371 cmpw 0,%0,%3\n\ 376 cmpw 0,%0,%3\n\
372 bne- 2f\n" 377 bne- 2f\n"
373 PPC405_ERR77(0,%2) 378 PPC405_ERR77(0,%2)
374" stwcx. %4,0,%2\n\ 379" stwcx. %4,0,%2\n\
375 bne- 1b" 380 bne- 1b"
376 ISYNC_ON_SMP 381 PPC_ACQUIRE_BARRIER
377 "\n\ 382 "\n\
3782:" 3832:"
379 : "=&r" (prev), "+m" (*p) 384 : "=&r" (prev), "+m" (*p)
@@ -412,13 +417,13 @@ __cmpxchg_u64(volatile unsigned long *p, unsigned long old, unsigned long new)
412 unsigned long prev; 417 unsigned long prev;
413 418
414 __asm__ __volatile__ ( 419 __asm__ __volatile__ (
415 LWSYNC_ON_SMP 420 PPC_RELEASE_BARRIER
416"1: ldarx %0,0,%2 # __cmpxchg_u64\n\ 421"1: ldarx %0,0,%2 # __cmpxchg_u64\n\
417 cmpd 0,%0,%3\n\ 422 cmpd 0,%0,%3\n\
418 bne- 2f\n\ 423 bne- 2f\n\
419 stdcx. %4,0,%2\n\ 424 stdcx. %4,0,%2\n\
420 bne- 1b" 425 bne- 1b"
421 ISYNC_ON_SMP 426 PPC_ACQUIRE_BARRIER
422 "\n\ 427 "\n\
4232:" 4282:"
424 : "=&r" (prev), "+m" (*p) 429 : "=&r" (prev), "+m" (*p)
diff --git a/arch/powerpc/include/asm/topology.h b/arch/powerpc/include/asm/topology.h
index bbf89701d7a4..8eaec310a25b 100644
--- a/arch/powerpc/include/asm/topology.h
+++ b/arch/powerpc/include/asm/topology.h
@@ -38,27 +38,33 @@ static inline int pcibus_to_node(struct pci_bus *bus)
38 cpumask_of_node(pcibus_to_node(bus))) 38 cpumask_of_node(pcibus_to_node(bus)))
39 39
40/* sched_domains SD_NODE_INIT for PPC64 machines */ 40/* sched_domains SD_NODE_INIT for PPC64 machines */
41#define SD_NODE_INIT (struct sched_domain) { \ 41#define SD_NODE_INIT (struct sched_domain) { \
42 .parent = NULL, \ 42 .min_interval = 8, \
43 .child = NULL, \ 43 .max_interval = 32, \
44 .groups = NULL, \ 44 .busy_factor = 32, \
45 .min_interval = 8, \ 45 .imbalance_pct = 125, \
46 .max_interval = 32, \ 46 .cache_nice_tries = 1, \
47 .busy_factor = 32, \ 47 .busy_idx = 3, \
48 .imbalance_pct = 125, \ 48 .idle_idx = 1, \
49 .cache_nice_tries = 1, \ 49 .newidle_idx = 0, \
50 .busy_idx = 3, \ 50 .wake_idx = 0, \
51 .idle_idx = 1, \ 51 .forkexec_idx = 0, \
52 .newidle_idx = 0, \ 52 \
53 .wake_idx = 0, \ 53 .flags = 1*SD_LOAD_BALANCE \
54 .flags = SD_LOAD_BALANCE \ 54 | 1*SD_BALANCE_NEWIDLE \
55 | SD_BALANCE_EXEC \ 55 | 1*SD_BALANCE_EXEC \
56 | SD_BALANCE_FORK \ 56 | 1*SD_BALANCE_FORK \
57 | SD_BALANCE_NEWIDLE \ 57 | 0*SD_BALANCE_WAKE \
58 | SD_SERIALIZE, \ 58 | 0*SD_WAKE_AFFINE \
59 .last_balance = jiffies, \ 59 | 0*SD_PREFER_LOCAL \
60 .balance_interval = 1, \ 60 | 0*SD_SHARE_CPUPOWER \
61 .nr_balance_failed = 0, \ 61 | 0*SD_POWERSAVINGS_BALANCE \
62 | 0*SD_SHARE_PKG_RESOURCES \
63 | 1*SD_SERIALIZE \
64 | 0*SD_PREFER_SIBLING \
65 , \
66 .last_balance = jiffies, \
67 .balance_interval = 1, \
62} 68}
63 69
64extern void __init dump_numa_cpu_topology(void); 70extern void __init dump_numa_cpu_topology(void);
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
index bdcb557d470a..07109d843787 100644
--- a/arch/powerpc/kernel/entry_64.S
+++ b/arch/powerpc/kernel/entry_64.S
@@ -791,9 +791,8 @@ _GLOBAL(enter_rtas)
791 791
792 li r9,1 792 li r9,1
793 rldicr r9,r9,MSR_SF_LG,(63-MSR_SF_LG) 793 rldicr r9,r9,MSR_SF_LG,(63-MSR_SF_LG)
794 ori r9,r9,MSR_IR|MSR_DR|MSR_FE0|MSR_FE1|MSR_FP 794 ori r9,r9,MSR_IR|MSR_DR|MSR_FE0|MSR_FE1|MSR_FP|MSR_RI
795 andc r6,r0,r9 795 andc r6,r0,r9
796 ori r6,r6,MSR_RI
797 sync /* disable interrupts so SRR0/1 */ 796 sync /* disable interrupts so SRR0/1 */
798 mtmsrd r0 /* don't get trashed */ 797 mtmsrd r0 /* don't get trashed */
799 798
diff --git a/arch/powerpc/kernel/firmware.c b/arch/powerpc/kernel/firmware.c
index 1679a70bbcad..6b1f4271eb53 100644
--- a/arch/powerpc/kernel/firmware.c
+++ b/arch/powerpc/kernel/firmware.c
@@ -17,5 +17,5 @@
17 17
18#include <asm/firmware.h> 18#include <asm/firmware.h>
19 19
20unsigned long powerpc_firmware_features; 20unsigned long powerpc_firmware_features __read_mostly;
21EXPORT_SYMBOL_GPL(powerpc_firmware_features); 21EXPORT_SYMBOL_GPL(powerpc_firmware_features);
diff --git a/arch/powerpc/kernel/head_fsl_booke.S b/arch/powerpc/kernel/head_fsl_booke.S
index 7f4bd7f3b6af..25793bb0e782 100644
--- a/arch/powerpc/kernel/head_fsl_booke.S
+++ b/arch/powerpc/kernel/head_fsl_booke.S
@@ -214,11 +214,11 @@ skpinv: addi r6,r6,1 /* Increment */
214 bl 1f /* Find our address */ 214 bl 1f /* Find our address */
2151: mflr r9 2151: mflr r9
216 rlwimi r7,r9,0,20,31 216 rlwimi r7,r9,0,20,31
217 addi r7,r7,24 217 addi r7,r7,(2f - 1b)
218 mtspr SPRN_SRR0,r7 218 mtspr SPRN_SRR0,r7
219 mtspr SPRN_SRR1,r6 219 mtspr SPRN_SRR1,r6
220 rfi 220 rfi
221 2212:
222/* 4. Clear out PIDs & Search info */ 222/* 4. Clear out PIDs & Search info */
223 li r6,0 223 li r6,0
224 mtspr SPRN_MAS6,r6 224 mtspr SPRN_MAS6,r6
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index 9040330b0530..64f6f2031c22 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -73,8 +73,10 @@
73#define CREATE_TRACE_POINTS 73#define CREATE_TRACE_POINTS
74#include <asm/trace.h> 74#include <asm/trace.h>
75 75
76DEFINE_PER_CPU_SHARED_ALIGNED(irq_cpustat_t, irq_stat);
77EXPORT_PER_CPU_SYMBOL(irq_stat);
78
76int __irq_offset_value; 79int __irq_offset_value;
77static int ppc_spurious_interrupts;
78 80
79#ifdef CONFIG_PPC32 81#ifdef CONFIG_PPC32
80EXPORT_SYMBOL(__irq_offset_value); 82EXPORT_SYMBOL(__irq_offset_value);
@@ -180,30 +182,64 @@ notrace void raw_local_irq_restore(unsigned long en)
180EXPORT_SYMBOL(raw_local_irq_restore); 182EXPORT_SYMBOL(raw_local_irq_restore);
181#endif /* CONFIG_PPC64 */ 183#endif /* CONFIG_PPC64 */
182 184
185static int show_other_interrupts(struct seq_file *p, int prec)
186{
187 int j;
188
189#if defined(CONFIG_PPC32) && defined(CONFIG_TAU_INT)
190 if (tau_initialized) {
191 seq_printf(p, "%*s: ", prec, "TAU");
192 for_each_online_cpu(j)
193 seq_printf(p, "%10u ", tau_interrupts(j));
194 seq_puts(p, " PowerPC Thermal Assist (cpu temp)\n");
195 }
196#endif /* CONFIG_PPC32 && CONFIG_TAU_INT */
197
198 seq_printf(p, "%*s: ", prec, "LOC");
199 for_each_online_cpu(j)
200 seq_printf(p, "%10u ", per_cpu(irq_stat, j).timer_irqs);
201 seq_printf(p, " Local timer interrupts\n");
202
203 seq_printf(p, "%*s: ", prec, "SPU");
204 for_each_online_cpu(j)
205 seq_printf(p, "%10u ", per_cpu(irq_stat, j).spurious_irqs);
206 seq_printf(p, " Spurious interrupts\n");
207
208 seq_printf(p, "%*s: ", prec, "CNT");
209 for_each_online_cpu(j)
210 seq_printf(p, "%10u ", per_cpu(irq_stat, j).pmu_irqs);
211 seq_printf(p, " Performance monitoring interrupts\n");
212
213 seq_printf(p, "%*s: ", prec, "MCE");
214 for_each_online_cpu(j)
215 seq_printf(p, "%10u ", per_cpu(irq_stat, j).mce_exceptions);
216 seq_printf(p, " Machine check exceptions\n");
217
218 return 0;
219}
220
183int show_interrupts(struct seq_file *p, void *v) 221int show_interrupts(struct seq_file *p, void *v)
184{ 222{
185 int i = *(loff_t *)v, j; 223 unsigned long flags, any_count = 0;
224 int i = *(loff_t *) v, j, prec;
186 struct irqaction *action; 225 struct irqaction *action;
187 struct irq_desc *desc; 226 struct irq_desc *desc;
188 unsigned long flags;
189 227
228 if (i > nr_irqs)
229 return 0;
230
231 for (prec = 3, j = 1000; prec < 10 && j <= nr_irqs; ++prec)
232 j *= 10;
233
234 if (i == nr_irqs)
235 return show_other_interrupts(p, prec);
236
237 /* print header */
190 if (i == 0) { 238 if (i == 0) {
191 seq_puts(p, " "); 239 seq_printf(p, "%*s", prec + 8, "");
192 for_each_online_cpu(j) 240 for_each_online_cpu(j)
193 seq_printf(p, "CPU%d ", j); 241 seq_printf(p, "CPU%-8d", j);
194 seq_putc(p, '\n'); 242 seq_putc(p, '\n');
195 } else if (i == nr_irqs) {
196#if defined(CONFIG_PPC32) && defined(CONFIG_TAU_INT)
197 if (tau_initialized){
198 seq_puts(p, "TAU: ");
199 for_each_online_cpu(j)
200 seq_printf(p, "%10u ", tau_interrupts(j));
201 seq_puts(p, " PowerPC Thermal Assist (cpu temp)\n");
202 }
203#endif /* CONFIG_PPC32 && CONFIG_TAU_INT*/
204 seq_printf(p, "BAD: %10u\n", ppc_spurious_interrupts);
205
206 return 0;
207 } 243 }
208 244
209 desc = irq_to_desc(i); 245 desc = irq_to_desc(i);
@@ -211,37 +247,48 @@ int show_interrupts(struct seq_file *p, void *v)
211 return 0; 247 return 0;
212 248
213 raw_spin_lock_irqsave(&desc->lock, flags); 249 raw_spin_lock_irqsave(&desc->lock, flags);
214 250 for_each_online_cpu(j)
251 any_count |= kstat_irqs_cpu(i, j);
215 action = desc->action; 252 action = desc->action;
216 if (!action || !action->handler) 253 if (!action && !any_count)
217 goto skip; 254 goto out;
218 255
219 seq_printf(p, "%3d: ", i); 256 seq_printf(p, "%*d: ", prec, i);
220#ifdef CONFIG_SMP
221 for_each_online_cpu(j) 257 for_each_online_cpu(j)
222 seq_printf(p, "%10u ", kstat_irqs_cpu(i, j)); 258 seq_printf(p, "%10u ", kstat_irqs_cpu(i, j));
223#else
224 seq_printf(p, "%10u ", kstat_irqs(i));
225#endif /* CONFIG_SMP */
226 259
227 if (desc->chip) 260 if (desc->chip)
228 seq_printf(p, " %s ", desc->chip->name); 261 seq_printf(p, " %-16s", desc->chip->name);
229 else 262 else
230 seq_puts(p, " None "); 263 seq_printf(p, " %-16s", "None");
264 seq_printf(p, " %-8s", (desc->status & IRQ_LEVEL) ? "Level" : "Edge");
231 265
232 seq_printf(p, "%s", (desc->status & IRQ_LEVEL) ? "Level " : "Edge "); 266 if (action) {
233 seq_printf(p, " %s", action->name); 267 seq_printf(p, " %s", action->name);
268 while ((action = action->next) != NULL)
269 seq_printf(p, ", %s", action->name);
270 }
234 271
235 for (action = action->next; action; action = action->next)
236 seq_printf(p, ", %s", action->name);
237 seq_putc(p, '\n'); 272 seq_putc(p, '\n');
238 273out:
239skip:
240 raw_spin_unlock_irqrestore(&desc->lock, flags); 274 raw_spin_unlock_irqrestore(&desc->lock, flags);
241
242 return 0; 275 return 0;
243} 276}
244 277
278/*
279 * /proc/stat helpers
280 */
281u64 arch_irq_stat_cpu(unsigned int cpu)
282{
283 u64 sum = per_cpu(irq_stat, cpu).timer_irqs;
284
285 sum += per_cpu(irq_stat, cpu).pmu_irqs;
286 sum += per_cpu(irq_stat, cpu).mce_exceptions;
287 sum += per_cpu(irq_stat, cpu).spurious_irqs;
288
289 return sum;
290}
291
245#ifdef CONFIG_HOTPLUG_CPU 292#ifdef CONFIG_HOTPLUG_CPU
246void fixup_irqs(cpumask_t map) 293void fixup_irqs(cpumask_t map)
247{ 294{
@@ -353,8 +400,7 @@ void do_IRQ(struct pt_regs *regs)
353 if (irq != NO_IRQ && irq != NO_IRQ_IGNORE) 400 if (irq != NO_IRQ && irq != NO_IRQ_IGNORE)
354 handle_one_irq(irq); 401 handle_one_irq(irq);
355 else if (irq != NO_IRQ_IGNORE) 402 else if (irq != NO_IRQ_IGNORE)
356 /* That's not SMP safe ... but who cares ? */ 403 __get_cpu_var(irq_stat).spurious_irqs++;
357 ppc_spurious_interrupts++;
358 404
359 irq_exit(); 405 irq_exit();
360 set_irq_regs(old_regs); 406 set_irq_regs(old_regs);
@@ -474,7 +520,7 @@ void do_softirq(void)
474 */ 520 */
475 521
476static LIST_HEAD(irq_hosts); 522static LIST_HEAD(irq_hosts);
477static DEFINE_SPINLOCK(irq_big_lock); 523static DEFINE_RAW_SPINLOCK(irq_big_lock);
478static unsigned int revmap_trees_allocated; 524static unsigned int revmap_trees_allocated;
479static DEFINE_MUTEX(revmap_trees_mutex); 525static DEFINE_MUTEX(revmap_trees_mutex);
480struct irq_map_entry irq_map[NR_IRQS]; 526struct irq_map_entry irq_map[NR_IRQS];
@@ -520,14 +566,14 @@ struct irq_host *irq_alloc_host(struct device_node *of_node,
520 if (host->ops->match == NULL) 566 if (host->ops->match == NULL)
521 host->ops->match = default_irq_host_match; 567 host->ops->match = default_irq_host_match;
522 568
523 spin_lock_irqsave(&irq_big_lock, flags); 569 raw_spin_lock_irqsave(&irq_big_lock, flags);
524 570
525 /* If it's a legacy controller, check for duplicates and 571 /* If it's a legacy controller, check for duplicates and
526 * mark it as allocated (we use irq 0 host pointer for that 572 * mark it as allocated (we use irq 0 host pointer for that
527 */ 573 */
528 if (revmap_type == IRQ_HOST_MAP_LEGACY) { 574 if (revmap_type == IRQ_HOST_MAP_LEGACY) {
529 if (irq_map[0].host != NULL) { 575 if (irq_map[0].host != NULL) {
530 spin_unlock_irqrestore(&irq_big_lock, flags); 576 raw_spin_unlock_irqrestore(&irq_big_lock, flags);
531 /* If we are early boot, we can't free the structure, 577 /* If we are early boot, we can't free the structure,
532 * too bad... 578 * too bad...
533 * this will be fixed once slab is made available early 579 * this will be fixed once slab is made available early
@@ -541,7 +587,7 @@ struct irq_host *irq_alloc_host(struct device_node *of_node,
541 } 587 }
542 588
543 list_add(&host->link, &irq_hosts); 589 list_add(&host->link, &irq_hosts);
544 spin_unlock_irqrestore(&irq_big_lock, flags); 590 raw_spin_unlock_irqrestore(&irq_big_lock, flags);
545 591
546 /* Additional setups per revmap type */ 592 /* Additional setups per revmap type */
547 switch(revmap_type) { 593 switch(revmap_type) {
@@ -592,13 +638,13 @@ struct irq_host *irq_find_host(struct device_node *node)
592 * the absence of a device node. This isn't a problem so far 638 * the absence of a device node. This isn't a problem so far
593 * yet though... 639 * yet though...
594 */ 640 */
595 spin_lock_irqsave(&irq_big_lock, flags); 641 raw_spin_lock_irqsave(&irq_big_lock, flags);
596 list_for_each_entry(h, &irq_hosts, link) 642 list_for_each_entry(h, &irq_hosts, link)
597 if (h->ops->match(h, node)) { 643 if (h->ops->match(h, node)) {
598 found = h; 644 found = h;
599 break; 645 break;
600 } 646 }
601 spin_unlock_irqrestore(&irq_big_lock, flags); 647 raw_spin_unlock_irqrestore(&irq_big_lock, flags);
602 return found; 648 return found;
603} 649}
604EXPORT_SYMBOL_GPL(irq_find_host); 650EXPORT_SYMBOL_GPL(irq_find_host);
@@ -967,7 +1013,7 @@ unsigned int irq_alloc_virt(struct irq_host *host,
967 if (count == 0 || count > (irq_virq_count - NUM_ISA_INTERRUPTS)) 1013 if (count == 0 || count > (irq_virq_count - NUM_ISA_INTERRUPTS))
968 return NO_IRQ; 1014 return NO_IRQ;
969 1015
970 spin_lock_irqsave(&irq_big_lock, flags); 1016 raw_spin_lock_irqsave(&irq_big_lock, flags);
971 1017
972 /* Use hint for 1 interrupt if any */ 1018 /* Use hint for 1 interrupt if any */
973 if (count == 1 && hint >= NUM_ISA_INTERRUPTS && 1019 if (count == 1 && hint >= NUM_ISA_INTERRUPTS &&
@@ -991,7 +1037,7 @@ unsigned int irq_alloc_virt(struct irq_host *host,
991 } 1037 }
992 } 1038 }
993 if (found == NO_IRQ) { 1039 if (found == NO_IRQ) {
994 spin_unlock_irqrestore(&irq_big_lock, flags); 1040 raw_spin_unlock_irqrestore(&irq_big_lock, flags);
995 return NO_IRQ; 1041 return NO_IRQ;
996 } 1042 }
997 hint_found: 1043 hint_found:
@@ -1000,7 +1046,7 @@ unsigned int irq_alloc_virt(struct irq_host *host,
1000 smp_wmb(); 1046 smp_wmb();
1001 irq_map[i].host = host; 1047 irq_map[i].host = host;
1002 } 1048 }
1003 spin_unlock_irqrestore(&irq_big_lock, flags); 1049 raw_spin_unlock_irqrestore(&irq_big_lock, flags);
1004 return found; 1050 return found;
1005} 1051}
1006 1052
@@ -1012,7 +1058,7 @@ void irq_free_virt(unsigned int virq, unsigned int count)
1012 WARN_ON (virq < NUM_ISA_INTERRUPTS); 1058 WARN_ON (virq < NUM_ISA_INTERRUPTS);
1013 WARN_ON (count == 0 || (virq + count) > irq_virq_count); 1059 WARN_ON (count == 0 || (virq + count) > irq_virq_count);
1014 1060
1015 spin_lock_irqsave(&irq_big_lock, flags); 1061 raw_spin_lock_irqsave(&irq_big_lock, flags);
1016 for (i = virq; i < (virq + count); i++) { 1062 for (i = virq; i < (virq + count); i++) {
1017 struct irq_host *host; 1063 struct irq_host *host;
1018 1064
@@ -1025,7 +1071,7 @@ void irq_free_virt(unsigned int virq, unsigned int count)
1025 smp_wmb(); 1071 smp_wmb();
1026 irq_map[i].host = NULL; 1072 irq_map[i].host = NULL;
1027 } 1073 }
1028 spin_unlock_irqrestore(&irq_big_lock, flags); 1074 raw_spin_unlock_irqrestore(&irq_big_lock, flags);
1029} 1075}
1030 1076
1031int arch_early_irq_init(void) 1077int arch_early_irq_init(void)
diff --git a/arch/powerpc/kernel/kgdb.c b/arch/powerpc/kernel/kgdb.c
index b6bd1eaa1c24..41bada0298c8 100644
--- a/arch/powerpc/kernel/kgdb.c
+++ b/arch/powerpc/kernel/kgdb.c
@@ -333,7 +333,7 @@ int kgdb_arch_handle_exception(int vector, int signo, int err_code,
333 atomic_set(&kgdb_cpu_doing_single_step, -1); 333 atomic_set(&kgdb_cpu_doing_single_step, -1);
334 /* set the trace bit if we're stepping */ 334 /* set the trace bit if we're stepping */
335 if (remcom_in_buffer[0] == 's') { 335 if (remcom_in_buffer[0] == 's') {
336#if defined(CONFIG_40x) || defined(CONFIG_BOOKE) 336#ifdef CONFIG_PPC_ADV_DEBUG_REGS
337 mtspr(SPRN_DBCR0, 337 mtspr(SPRN_DBCR0,
338 mfspr(SPRN_DBCR0) | DBCR0_IC | DBCR0_IDM); 338 mfspr(SPRN_DBCR0) | DBCR0_IC | DBCR0_IDM);
339 linux_regs->msr |= MSR_DE; 339 linux_regs->msr |= MSR_DE;
diff --git a/arch/powerpc/kernel/kprobes.c b/arch/powerpc/kernel/kprobes.c
index c9329786073b..3fd1af902112 100644
--- a/arch/powerpc/kernel/kprobes.c
+++ b/arch/powerpc/kernel/kprobes.c
@@ -36,7 +36,7 @@
36#include <asm/uaccess.h> 36#include <asm/uaccess.h>
37#include <asm/system.h> 37#include <asm/system.h>
38 38
39#ifdef CONFIG_BOOKE 39#ifdef CONFIG_PPC_ADV_DEBUG_REGS
40#define MSR_SINGLESTEP (MSR_DE) 40#define MSR_SINGLESTEP (MSR_DE)
41#else 41#else
42#define MSR_SINGLESTEP (MSR_SE) 42#define MSR_SINGLESTEP (MSR_SE)
@@ -110,7 +110,7 @@ static void __kprobes prepare_singlestep(struct kprobe *p, struct pt_regs *regs)
110 * like Decrementer or External Interrupt */ 110 * like Decrementer or External Interrupt */
111 regs->msr &= ~MSR_EE; 111 regs->msr &= ~MSR_EE;
112 regs->msr |= MSR_SINGLESTEP; 112 regs->msr |= MSR_SINGLESTEP;
113#ifdef CONFIG_BOOKE 113#ifdef CONFIG_PPC_ADV_DEBUG_REGS
114 regs->msr &= ~MSR_CE; 114 regs->msr &= ~MSR_CE;
115 mtspr(SPRN_DBCR0, mfspr(SPRN_DBCR0) | DBCR0_IC | DBCR0_IDM); 115 mtspr(SPRN_DBCR0, mfspr(SPRN_DBCR0) | DBCR0_IC | DBCR0_IDM);
116#endif 116#endif
diff --git a/arch/powerpc/kernel/lparcfg.c b/arch/powerpc/kernel/lparcfg.c
index 79a00bb9c64c..d09d1c615150 100644
--- a/arch/powerpc/kernel/lparcfg.c
+++ b/arch/powerpc/kernel/lparcfg.c
@@ -359,7 +359,7 @@ static void parse_system_parameter_string(struct seq_file *m)
359 359
360 unsigned char *local_buffer = kmalloc(SPLPAR_MAXLENGTH, GFP_KERNEL); 360 unsigned char *local_buffer = kmalloc(SPLPAR_MAXLENGTH, GFP_KERNEL);
361 if (!local_buffer) { 361 if (!local_buffer) {
362 printk(KERN_ERR "%s %s kmalloc failure at line %d \n", 362 printk(KERN_ERR "%s %s kmalloc failure at line %d\n",
363 __FILE__, __func__, __LINE__); 363 __FILE__, __func__, __LINE__);
364 return; 364 return;
365 } 365 }
@@ -383,13 +383,13 @@ static void parse_system_parameter_string(struct seq_file *m)
383 int idx, w_idx; 383 int idx, w_idx;
384 char *workbuffer = kzalloc(SPLPAR_MAXLENGTH, GFP_KERNEL); 384 char *workbuffer = kzalloc(SPLPAR_MAXLENGTH, GFP_KERNEL);
385 if (!workbuffer) { 385 if (!workbuffer) {
386 printk(KERN_ERR "%s %s kmalloc failure at line %d \n", 386 printk(KERN_ERR "%s %s kmalloc failure at line %d\n",
387 __FILE__, __func__, __LINE__); 387 __FILE__, __func__, __LINE__);
388 kfree(local_buffer); 388 kfree(local_buffer);
389 return; 389 return;
390 } 390 }
391#ifdef LPARCFG_DEBUG 391#ifdef LPARCFG_DEBUG
392 printk(KERN_INFO "success calling get-system-parameter \n"); 392 printk(KERN_INFO "success calling get-system-parameter\n");
393#endif 393#endif
394 splpar_strlen = local_buffer[0] * 256 + local_buffer[1]; 394 splpar_strlen = local_buffer[0] * 256 + local_buffer[1];
395 local_buffer += 2; /* step over strlen value */ 395 local_buffer += 2; /* step over strlen value */
@@ -440,7 +440,7 @@ static int lparcfg_count_active_processors(void)
440 440
441 while ((cpus_dn = of_find_node_by_type(cpus_dn, "cpu"))) { 441 while ((cpus_dn = of_find_node_by_type(cpus_dn, "cpu"))) {
442#ifdef LPARCFG_DEBUG 442#ifdef LPARCFG_DEBUG
443 printk(KERN_ERR "cpus_dn %p \n", cpus_dn); 443 printk(KERN_ERR "cpus_dn %p\n", cpus_dn);
444#endif 444#endif
445 count++; 445 count++;
446 } 446 }
@@ -725,7 +725,7 @@ static int lparcfg_data(struct seq_file *m, void *v)
725 const unsigned int *lp_index_ptr; 725 const unsigned int *lp_index_ptr;
726 unsigned int lp_index = 0; 726 unsigned int lp_index = 0;
727 727
728 seq_printf(m, "%s %s \n", MODULE_NAME, MODULE_VERS); 728 seq_printf(m, "%s %s\n", MODULE_NAME, MODULE_VERS);
729 729
730 rootdn = of_find_node_by_path("/"); 730 rootdn = of_find_node_by_path("/");
731 if (rootdn) { 731 if (rootdn) {
diff --git a/arch/powerpc/kernel/nvram_64.c b/arch/powerpc/kernel/nvram_64.c
index ad461e735aec..9cf197f01e94 100644
--- a/arch/powerpc/kernel/nvram_64.c
+++ b/arch/powerpc/kernel/nvram_64.c
@@ -338,8 +338,8 @@ static int __init nvram_create_os_partition(void)
338 338
339 rc = nvram_write_header(new_part); 339 rc = nvram_write_header(new_part);
340 if (rc <= 0) { 340 if (rc <= 0) {
341 printk(KERN_ERR "nvram_create_os_partition: nvram_write_header \ 341 printk(KERN_ERR "nvram_create_os_partition: nvram_write_header "
342 failed (%d)\n", rc); 342 "failed (%d)\n", rc);
343 return rc; 343 return rc;
344 } 344 }
345 345
@@ -349,7 +349,7 @@ static int __init nvram_create_os_partition(void)
349 rc = ppc_md.nvram_write((char *)&seq_init, sizeof(seq_init), &tmp_index); 349 rc = ppc_md.nvram_write((char *)&seq_init, sizeof(seq_init), &tmp_index);
350 if (rc <= 0) { 350 if (rc <= 0) {
351 printk(KERN_ERR "nvram_create_os_partition: nvram_write " 351 printk(KERN_ERR "nvram_create_os_partition: nvram_write "
352 "failed (%d)\n", rc); 352 "failed (%d)\n", rc);
353 return rc; 353 return rc;
354 } 354 }
355 355
diff --git a/arch/powerpc/kernel/of_platform.c b/arch/powerpc/kernel/of_platform.c
index 1a4fc0d11a03..666d08db319e 100644
--- a/arch/powerpc/kernel/of_platform.c
+++ b/arch/powerpc/kernel/of_platform.c
@@ -214,7 +214,7 @@ EXPORT_SYMBOL(of_find_device_by_node);
214static int of_dev_phandle_match(struct device *dev, void *data) 214static int of_dev_phandle_match(struct device *dev, void *data)
215{ 215{
216 phandle *ph = data; 216 phandle *ph = data;
217 return to_of_device(dev)->node->linux_phandle == *ph; 217 return to_of_device(dev)->node->phandle == *ph;
218} 218}
219 219
220struct of_device *of_find_device_by_phandle(phandle ph) 220struct of_device *of_find_device_by_phandle(phandle ph)
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index cadbed679fbb..2597f9545d8a 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -1047,10 +1047,8 @@ static void __devinit pcibios_fixup_bridge(struct pci_bus *bus)
1047 1047
1048 struct pci_dev *dev = bus->self; 1048 struct pci_dev *dev = bus->self;
1049 1049
1050 for (i = 0; i < PCI_BUS_NUM_RESOURCES; ++i) { 1050 pci_bus_for_each_resource(bus, res, i) {
1051 if ((res = bus->resource[i]) == NULL) 1051 if (!res || !res->flags)
1052 continue;
1053 if (!res->flags)
1054 continue; 1052 continue;
1055 if (i >= 3 && bus->self->transparent) 1053 if (i >= 3 && bus->self->transparent)
1056 continue; 1054 continue;
@@ -1181,21 +1179,20 @@ static int skip_isa_ioresource_align(struct pci_dev *dev)
1181 * but we want to try to avoid allocating at 0x2900-0x2bff 1179 * but we want to try to avoid allocating at 0x2900-0x2bff
1182 * which might have be mirrored at 0x0100-0x03ff.. 1180 * which might have be mirrored at 0x0100-0x03ff..
1183 */ 1181 */
1184void pcibios_align_resource(void *data, struct resource *res, 1182resource_size_t pcibios_align_resource(void *data, const struct resource *res,
1185 resource_size_t size, resource_size_t align) 1183 resource_size_t size, resource_size_t align)
1186{ 1184{
1187 struct pci_dev *dev = data; 1185 struct pci_dev *dev = data;
1186 resource_size_t start = res->start;
1188 1187
1189 if (res->flags & IORESOURCE_IO) { 1188 if (res->flags & IORESOURCE_IO) {
1190 resource_size_t start = res->start;
1191
1192 if (skip_isa_ioresource_align(dev)) 1189 if (skip_isa_ioresource_align(dev))
1193 return; 1190 return start;
1194 if (start & 0x300) { 1191 if (start & 0x300)
1195 start = (start + 0x3ff) & ~0x3ff; 1192 start = (start + 0x3ff) & ~0x3ff;
1196 res->start = start;
1197 }
1198 } 1193 }
1194
1195 return start;
1199} 1196}
1200EXPORT_SYMBOL(pcibios_align_resource); 1197EXPORT_SYMBOL(pcibios_align_resource);
1201 1198
@@ -1278,9 +1275,8 @@ void pcibios_allocate_bus_resources(struct pci_bus *bus)
1278 pr_debug("PCI: Allocating bus resources for %04x:%02x...\n", 1275 pr_debug("PCI: Allocating bus resources for %04x:%02x...\n",
1279 pci_domain_nr(bus), bus->number); 1276 pci_domain_nr(bus), bus->number);
1280 1277
1281 for (i = 0; i < PCI_BUS_NUM_RESOURCES; ++i) { 1278 pci_bus_for_each_resource(bus, res, i) {
1282 if ((res = bus->resource[i]) == NULL || !res->flags 1279 if (!res || !res->flags || res->start > res->end || res->parent)
1283 || res->start > res->end || res->parent)
1284 continue; 1280 continue;
1285 if (bus->parent == NULL) 1281 if (bus->parent == NULL)
1286 pr = (res->flags & IORESOURCE_IO) ? 1282 pr = (res->flags & IORESOURCE_IO) ?
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c
index ccf56ac92de5..d43fc65749c1 100644
--- a/arch/powerpc/kernel/pci_64.c
+++ b/arch/powerpc/kernel/pci_64.c
@@ -224,7 +224,7 @@ long sys_pciconfig_iobase(long which, unsigned long in_bus,
224 * G5 machines... So when something asks for bus 0 io base 224 * G5 machines... So when something asks for bus 0 io base
225 * (bus 0 is HT root), we return the AGP one instead. 225 * (bus 0 is HT root), we return the AGP one instead.
226 */ 226 */
227 if (in_bus == 0 && machine_is_compatible("MacRISC4")) { 227 if (in_bus == 0 && of_machine_is_compatible("MacRISC4")) {
228 struct device_node *agp; 228 struct device_node *agp;
229 229
230 agp = of_find_compatible_node(NULL, NULL, "u3-agp"); 230 agp = of_find_compatible_node(NULL, NULL, "u3-agp");
diff --git a/arch/powerpc/kernel/pci_of_scan.c b/arch/powerpc/kernel/pci_of_scan.c
index 4aa17401657b..cd11d5ca80df 100644
--- a/arch/powerpc/kernel/pci_of_scan.c
+++ b/arch/powerpc/kernel/pci_of_scan.c
@@ -304,7 +304,7 @@ static void __devinit __of_scan_bus(struct device_node *node,
304 int reglen, devfn; 304 int reglen, devfn;
305 struct pci_dev *dev; 305 struct pci_dev *dev;
306 306
307 pr_debug("of_scan_bus(%s) bus no %d... \n", 307 pr_debug("of_scan_bus(%s) bus no %d...\n",
308 node->full_name, bus->number); 308 node->full_name, bus->number);
309 309
310 /* Scan direct children */ 310 /* Scan direct children */
diff --git a/arch/powerpc/kernel/perf_callchain.c b/arch/powerpc/kernel/perf_callchain.c
index a3c11cac3d71..95ad9dad298e 100644
--- a/arch/powerpc/kernel/perf_callchain.c
+++ b/arch/powerpc/kernel/perf_callchain.c
@@ -495,9 +495,6 @@ struct perf_callchain_entry *perf_callchain(struct pt_regs *regs)
495 495
496 entry->nr = 0; 496 entry->nr = 0;
497 497
498 if (current->pid == 0) /* idle task? */
499 return entry;
500
501 if (!user_mode(regs)) { 498 if (!user_mode(regs)) {
502 perf_callchain_kernel(regs, entry); 499 perf_callchain_kernel(regs, entry);
503 if (current->mm) 500 if (current->mm)
diff --git a/arch/powerpc/kernel/perf_event.c b/arch/powerpc/kernel/perf_event.c
index 1eb85fbf53a5..b6cf8f1f4d35 100644
--- a/arch/powerpc/kernel/perf_event.c
+++ b/arch/powerpc/kernel/perf_event.c
@@ -718,10 +718,10 @@ static int collect_events(struct perf_event *group, int max_count,
718 return n; 718 return n;
719} 719}
720 720
721static void event_sched_in(struct perf_event *event, int cpu) 721static void event_sched_in(struct perf_event *event)
722{ 722{
723 event->state = PERF_EVENT_STATE_ACTIVE; 723 event->state = PERF_EVENT_STATE_ACTIVE;
724 event->oncpu = cpu; 724 event->oncpu = smp_processor_id();
725 event->tstamp_running += event->ctx->time - event->tstamp_stopped; 725 event->tstamp_running += event->ctx->time - event->tstamp_stopped;
726 if (is_software_event(event)) 726 if (is_software_event(event))
727 event->pmu->enable(event); 727 event->pmu->enable(event);
@@ -735,7 +735,7 @@ static void event_sched_in(struct perf_event *event, int cpu)
735 */ 735 */
736int hw_perf_group_sched_in(struct perf_event *group_leader, 736int hw_perf_group_sched_in(struct perf_event *group_leader,
737 struct perf_cpu_context *cpuctx, 737 struct perf_cpu_context *cpuctx,
738 struct perf_event_context *ctx, int cpu) 738 struct perf_event_context *ctx)
739{ 739{
740 struct cpu_hw_events *cpuhw; 740 struct cpu_hw_events *cpuhw;
741 long i, n, n0; 741 long i, n, n0;
@@ -766,10 +766,10 @@ int hw_perf_group_sched_in(struct perf_event *group_leader,
766 cpuhw->event[i]->hw.config = cpuhw->events[i]; 766 cpuhw->event[i]->hw.config = cpuhw->events[i];
767 cpuctx->active_oncpu += n; 767 cpuctx->active_oncpu += n;
768 n = 1; 768 n = 1;
769 event_sched_in(group_leader, cpu); 769 event_sched_in(group_leader);
770 list_for_each_entry(sub, &group_leader->sibling_list, group_entry) { 770 list_for_each_entry(sub, &group_leader->sibling_list, group_entry) {
771 if (sub->state != PERF_EVENT_STATE_OFF) { 771 if (sub->state != PERF_EVENT_STATE_OFF) {
772 event_sched_in(sub, cpu); 772 event_sched_in(sub);
773 ++n; 773 ++n;
774 } 774 }
775 } 775 }
diff --git a/arch/powerpc/kernel/pmc.c b/arch/powerpc/kernel/pmc.c
index 0516e2d3e02e..461499b43cff 100644
--- a/arch/powerpc/kernel/pmc.c
+++ b/arch/powerpc/kernel/pmc.c
@@ -37,7 +37,7 @@ static void dummy_perf(struct pt_regs *regs)
37} 37}
38 38
39 39
40static DEFINE_SPINLOCK(pmc_owner_lock); 40static DEFINE_RAW_SPINLOCK(pmc_owner_lock);
41static void *pmc_owner_caller; /* mostly for debugging */ 41static void *pmc_owner_caller; /* mostly for debugging */
42perf_irq_t perf_irq = dummy_perf; 42perf_irq_t perf_irq = dummy_perf;
43 43
@@ -45,7 +45,7 @@ int reserve_pmc_hardware(perf_irq_t new_perf_irq)
45{ 45{
46 int err = 0; 46 int err = 0;
47 47
48 spin_lock(&pmc_owner_lock); 48 raw_spin_lock(&pmc_owner_lock);
49 49
50 if (pmc_owner_caller) { 50 if (pmc_owner_caller) {
51 printk(KERN_WARNING "reserve_pmc_hardware: " 51 printk(KERN_WARNING "reserve_pmc_hardware: "
@@ -59,21 +59,21 @@ int reserve_pmc_hardware(perf_irq_t new_perf_irq)
59 perf_irq = new_perf_irq ? new_perf_irq : dummy_perf; 59 perf_irq = new_perf_irq ? new_perf_irq : dummy_perf;
60 60
61 out: 61 out:
62 spin_unlock(&pmc_owner_lock); 62 raw_spin_unlock(&pmc_owner_lock);
63 return err; 63 return err;
64} 64}
65EXPORT_SYMBOL_GPL(reserve_pmc_hardware); 65EXPORT_SYMBOL_GPL(reserve_pmc_hardware);
66 66
67void release_pmc_hardware(void) 67void release_pmc_hardware(void)
68{ 68{
69 spin_lock(&pmc_owner_lock); 69 raw_spin_lock(&pmc_owner_lock);
70 70
71 WARN_ON(! pmc_owner_caller); 71 WARN_ON(! pmc_owner_caller);
72 72
73 pmc_owner_caller = NULL; 73 pmc_owner_caller = NULL;
74 perf_irq = dummy_perf; 74 perf_irq = dummy_perf;
75 75
76 spin_unlock(&pmc_owner_lock); 76 raw_spin_unlock(&pmc_owner_lock);
77} 77}
78EXPORT_SYMBOL_GPL(release_pmc_hardware); 78EXPORT_SYMBOL_GPL(release_pmc_hardware);
79 79
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index 7b816daf3eba..e4d71ced97ef 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -245,6 +245,24 @@ void discard_lazy_cpu_state(void)
245} 245}
246#endif /* CONFIG_SMP */ 246#endif /* CONFIG_SMP */
247 247
248#ifdef CONFIG_PPC_ADV_DEBUG_REGS
249void do_send_trap(struct pt_regs *regs, unsigned long address,
250 unsigned long error_code, int signal_code, int breakpt)
251{
252 siginfo_t info;
253
254 if (notify_die(DIE_DABR_MATCH, "dabr_match", regs, error_code,
255 11, SIGSEGV) == NOTIFY_STOP)
256 return;
257
258 /* Deliver the signal to userspace */
259 info.si_signo = SIGTRAP;
260 info.si_errno = breakpt; /* breakpoint or watchpoint id */
261 info.si_code = signal_code;
262 info.si_addr = (void __user *)address;
263 force_sig_info(SIGTRAP, &info, current);
264}
265#else /* !CONFIG_PPC_ADV_DEBUG_REGS */
248void do_dabr(struct pt_regs *regs, unsigned long address, 266void do_dabr(struct pt_regs *regs, unsigned long address,
249 unsigned long error_code) 267 unsigned long error_code)
250{ 268{
@@ -257,12 +275,6 @@ void do_dabr(struct pt_regs *regs, unsigned long address,
257 if (debugger_dabr_match(regs)) 275 if (debugger_dabr_match(regs))
258 return; 276 return;
259 277
260 /* Clear the DAC and struct entries. One shot trigger */
261#if defined(CONFIG_BOOKE)
262 mtspr(SPRN_DBCR0, mfspr(SPRN_DBCR0) & ~(DBSR_DAC1R | DBSR_DAC1W
263 | DBCR0_IDM));
264#endif
265
266 /* Clear the DABR */ 278 /* Clear the DABR */
267 set_dabr(0); 279 set_dabr(0);
268 280
@@ -273,9 +285,82 @@ void do_dabr(struct pt_regs *regs, unsigned long address,
273 info.si_addr = (void __user *)address; 285 info.si_addr = (void __user *)address;
274 force_sig_info(SIGTRAP, &info, current); 286 force_sig_info(SIGTRAP, &info, current);
275} 287}
288#endif /* CONFIG_PPC_ADV_DEBUG_REGS */
276 289
277static DEFINE_PER_CPU(unsigned long, current_dabr); 290static DEFINE_PER_CPU(unsigned long, current_dabr);
278 291
292#ifdef CONFIG_PPC_ADV_DEBUG_REGS
293/*
294 * Set the debug registers back to their default "safe" values.
295 */
296static void set_debug_reg_defaults(struct thread_struct *thread)
297{
298 thread->iac1 = thread->iac2 = 0;
299#if CONFIG_PPC_ADV_DEBUG_IACS > 2
300 thread->iac3 = thread->iac4 = 0;
301#endif
302 thread->dac1 = thread->dac2 = 0;
303#if CONFIG_PPC_ADV_DEBUG_DVCS > 0
304 thread->dvc1 = thread->dvc2 = 0;
305#endif
306 thread->dbcr0 = 0;
307#ifdef CONFIG_BOOKE
308 /*
309 * Force User/Supervisor bits to b11 (user-only MSR[PR]=1)
310 */
311 thread->dbcr1 = DBCR1_IAC1US | DBCR1_IAC2US | \
312 DBCR1_IAC3US | DBCR1_IAC4US;
313 /*
314 * Force Data Address Compare User/Supervisor bits to be User-only
315 * (0b11 MSR[PR]=1) and set all other bits in DBCR2 register to be 0.
316 */
317 thread->dbcr2 = DBCR2_DAC1US | DBCR2_DAC2US;
318#else
319 thread->dbcr1 = 0;
320#endif
321}
322
323static void prime_debug_regs(struct thread_struct *thread)
324{
325 mtspr(SPRN_IAC1, thread->iac1);
326 mtspr(SPRN_IAC2, thread->iac2);
327#if CONFIG_PPC_ADV_DEBUG_IACS > 2
328 mtspr(SPRN_IAC3, thread->iac3);
329 mtspr(SPRN_IAC4, thread->iac4);
330#endif
331 mtspr(SPRN_DAC1, thread->dac1);
332 mtspr(SPRN_DAC2, thread->dac2);
333#if CONFIG_PPC_ADV_DEBUG_DVCS > 0
334 mtspr(SPRN_DVC1, thread->dvc1);
335 mtspr(SPRN_DVC2, thread->dvc2);
336#endif
337 mtspr(SPRN_DBCR0, thread->dbcr0);
338 mtspr(SPRN_DBCR1, thread->dbcr1);
339#ifdef CONFIG_BOOKE
340 mtspr(SPRN_DBCR2, thread->dbcr2);
341#endif
342}
343/*
344 * Unless neither the old or new thread are making use of the
345 * debug registers, set the debug registers from the values
346 * stored in the new thread.
347 */
348static void switch_booke_debug_regs(struct thread_struct *new_thread)
349{
350 if ((current->thread.dbcr0 & DBCR0_IDM)
351 || (new_thread->dbcr0 & DBCR0_IDM))
352 prime_debug_regs(new_thread);
353}
354#else /* !CONFIG_PPC_ADV_DEBUG_REGS */
355static void set_debug_reg_defaults(struct thread_struct *thread)
356{
357 if (thread->dabr) {
358 thread->dabr = 0;
359 set_dabr(0);
360 }
361}
362#endif /* CONFIG_PPC_ADV_DEBUG_REGS */
363
279int set_dabr(unsigned long dabr) 364int set_dabr(unsigned long dabr)
280{ 365{
281 __get_cpu_var(current_dabr) = dabr; 366 __get_cpu_var(current_dabr) = dabr;
@@ -284,7 +369,7 @@ int set_dabr(unsigned long dabr)
284 return ppc_md.set_dabr(dabr); 369 return ppc_md.set_dabr(dabr);
285 370
286 /* XXX should we have a CPU_FTR_HAS_DABR ? */ 371 /* XXX should we have a CPU_FTR_HAS_DABR ? */
287#if defined(CONFIG_BOOKE) 372#ifdef CONFIG_PPC_ADV_DEBUG_REGS
288 mtspr(SPRN_DAC1, dabr); 373 mtspr(SPRN_DAC1, dabr);
289#elif defined(CONFIG_PPC_BOOK3S) 374#elif defined(CONFIG_PPC_BOOK3S)
290 mtspr(SPRN_DABR, dabr); 375 mtspr(SPRN_DABR, dabr);
@@ -371,10 +456,8 @@ struct task_struct *__switch_to(struct task_struct *prev,
371 456
372#endif /* CONFIG_SMP */ 457#endif /* CONFIG_SMP */
373 458
374#if defined(CONFIG_BOOKE) 459#ifdef CONFIG_PPC_ADV_DEBUG_REGS
375 /* If new thread DAC (HW breakpoint) is the same then leave it */ 460 switch_booke_debug_regs(&new->thread);
376 if (new->thread.dabr)
377 set_dabr(new->thread.dabr);
378#else 461#else
379 if (unlikely(__get_cpu_var(current_dabr) != new->thread.dabr)) 462 if (unlikely(__get_cpu_var(current_dabr) != new->thread.dabr))
380 set_dabr(new->thread.dabr); 463 set_dabr(new->thread.dabr);
@@ -514,7 +597,7 @@ void show_regs(struct pt_regs * regs)
514 printk(" CR: %08lx XER: %08lx\n", regs->ccr, regs->xer); 597 printk(" CR: %08lx XER: %08lx\n", regs->ccr, regs->xer);
515 trap = TRAP(regs); 598 trap = TRAP(regs);
516 if (trap == 0x300 || trap == 0x600) 599 if (trap == 0x300 || trap == 0x600)
517#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE) 600#ifdef CONFIG_PPC_ADV_DEBUG_REGS
518 printk("DEAR: "REG", ESR: "REG"\n", regs->dar, regs->dsisr); 601 printk("DEAR: "REG", ESR: "REG"\n", regs->dar, regs->dsisr);
519#else 602#else
520 printk("DAR: "REG", DSISR: "REG"\n", regs->dar, regs->dsisr); 603 printk("DAR: "REG", DSISR: "REG"\n", regs->dar, regs->dsisr);
@@ -556,14 +639,7 @@ void flush_thread(void)
556{ 639{
557 discard_lazy_cpu_state(); 640 discard_lazy_cpu_state();
558 641
559 if (current->thread.dabr) { 642 set_debug_reg_defaults(&current->thread);
560 current->thread.dabr = 0;
561 set_dabr(0);
562
563#if defined(CONFIG_BOOKE)
564 current->thread.dbcr0 &= ~(DBSR_DAC1R | DBSR_DAC1W);
565#endif
566 }
567} 643}
568 644
569void 645void
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 4ec300862466..43238b2054b6 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -61,365 +61,12 @@
61#define DBG(fmt...) 61#define DBG(fmt...)
62#endif 62#endif
63 63
64
65static int __initdata dt_root_addr_cells;
66static int __initdata dt_root_size_cells;
67
68#ifdef CONFIG_PPC64 64#ifdef CONFIG_PPC64
69int __initdata iommu_is_off; 65int __initdata iommu_is_off;
70int __initdata iommu_force_on; 66int __initdata iommu_force_on;
71unsigned long tce_alloc_start, tce_alloc_end; 67unsigned long tce_alloc_start, tce_alloc_end;
72#endif 68#endif
73 69
74typedef u32 cell_t;
75
76#if 0
77static struct boot_param_header *initial_boot_params __initdata;
78#else
79struct boot_param_header *initial_boot_params;
80#endif
81
82extern struct device_node *allnodes; /* temporary while merging */
83
84extern rwlock_t devtree_lock; /* temporary while merging */
85
86/* export that to outside world */
87struct device_node *of_chosen;
88
89static inline char *find_flat_dt_string(u32 offset)
90{
91 return ((char *)initial_boot_params) +
92 initial_boot_params->off_dt_strings + offset;
93}
94
95/**
96 * This function is used to scan the flattened device-tree, it is
97 * used to extract the memory informations at boot before we can
98 * unflatten the tree
99 */
100int __init of_scan_flat_dt(int (*it)(unsigned long node,
101 const char *uname, int depth,
102 void *data),
103 void *data)
104{
105 unsigned long p = ((unsigned long)initial_boot_params) +
106 initial_boot_params->off_dt_struct;
107 int rc = 0;
108 int depth = -1;
109
110 do {
111 u32 tag = *((u32 *)p);
112 char *pathp;
113
114 p += 4;
115 if (tag == OF_DT_END_NODE) {
116 depth --;
117 continue;
118 }
119 if (tag == OF_DT_NOP)
120 continue;
121 if (tag == OF_DT_END)
122 break;
123 if (tag == OF_DT_PROP) {
124 u32 sz = *((u32 *)p);
125 p += 8;
126 if (initial_boot_params->version < 0x10)
127 p = _ALIGN(p, sz >= 8 ? 8 : 4);
128 p += sz;
129 p = _ALIGN(p, 4);
130 continue;
131 }
132 if (tag != OF_DT_BEGIN_NODE) {
133 printk(KERN_WARNING "Invalid tag %x scanning flattened"
134 " device tree !\n", tag);
135 return -EINVAL;
136 }
137 depth++;
138 pathp = (char *)p;
139 p = _ALIGN(p + strlen(pathp) + 1, 4);
140 if ((*pathp) == '/') {
141 char *lp, *np;
142 for (lp = NULL, np = pathp; *np; np++)
143 if ((*np) == '/')
144 lp = np+1;
145 if (lp != NULL)
146 pathp = lp;
147 }
148 rc = it(p, pathp, depth, data);
149 if (rc != 0)
150 break;
151 } while(1);
152
153 return rc;
154}
155
156unsigned long __init of_get_flat_dt_root(void)
157{
158 unsigned long p = ((unsigned long)initial_boot_params) +
159 initial_boot_params->off_dt_struct;
160
161 while(*((u32 *)p) == OF_DT_NOP)
162 p += 4;
163 BUG_ON (*((u32 *)p) != OF_DT_BEGIN_NODE);
164 p += 4;
165 return _ALIGN(p + strlen((char *)p) + 1, 4);
166}
167
168/**
169 * This function can be used within scan_flattened_dt callback to get
170 * access to properties
171 */
172void* __init of_get_flat_dt_prop(unsigned long node, const char *name,
173 unsigned long *size)
174{
175 unsigned long p = node;
176
177 do {
178 u32 tag = *((u32 *)p);
179 u32 sz, noff;
180 const char *nstr;
181
182 p += 4;
183 if (tag == OF_DT_NOP)
184 continue;
185 if (tag != OF_DT_PROP)
186 return NULL;
187
188 sz = *((u32 *)p);
189 noff = *((u32 *)(p + 4));
190 p += 8;
191 if (initial_boot_params->version < 0x10)
192 p = _ALIGN(p, sz >= 8 ? 8 : 4);
193
194 nstr = find_flat_dt_string(noff);
195 if (nstr == NULL) {
196 printk(KERN_WARNING "Can't find property index"
197 " name !\n");
198 return NULL;
199 }
200 if (strcmp(name, nstr) == 0) {
201 if (size)
202 *size = sz;
203 return (void *)p;
204 }
205 p += sz;
206 p = _ALIGN(p, 4);
207 } while(1);
208}
209
210int __init of_flat_dt_is_compatible(unsigned long node, const char *compat)
211{
212 const char* cp;
213 unsigned long cplen, l;
214
215 cp = of_get_flat_dt_prop(node, "compatible", &cplen);
216 if (cp == NULL)
217 return 0;
218 while (cplen > 0) {
219 if (strncasecmp(cp, compat, strlen(compat)) == 0)
220 return 1;
221 l = strlen(cp) + 1;
222 cp += l;
223 cplen -= l;
224 }
225
226 return 0;
227}
228
229static void *__init unflatten_dt_alloc(unsigned long *mem, unsigned long size,
230 unsigned long align)
231{
232 void *res;
233
234 *mem = _ALIGN(*mem, align);
235 res = (void *)*mem;
236 *mem += size;
237
238 return res;
239}
240
241static unsigned long __init unflatten_dt_node(unsigned long mem,
242 unsigned long *p,
243 struct device_node *dad,
244 struct device_node ***allnextpp,
245 unsigned long fpsize)
246{
247 struct device_node *np;
248 struct property *pp, **prev_pp = NULL;
249 char *pathp;
250 u32 tag;
251 unsigned int l, allocl;
252 int has_name = 0;
253 int new_format = 0;
254
255 tag = *((u32 *)(*p));
256 if (tag != OF_DT_BEGIN_NODE) {
257 printk("Weird tag at start of node: %x\n", tag);
258 return mem;
259 }
260 *p += 4;
261 pathp = (char *)*p;
262 l = allocl = strlen(pathp) + 1;
263 *p = _ALIGN(*p + l, 4);
264
265 /* version 0x10 has a more compact unit name here instead of the full
266 * path. we accumulate the full path size using "fpsize", we'll rebuild
267 * it later. We detect this because the first character of the name is
268 * not '/'.
269 */
270 if ((*pathp) != '/') {
271 new_format = 1;
272 if (fpsize == 0) {
273 /* root node: special case. fpsize accounts for path
274 * plus terminating zero. root node only has '/', so
275 * fpsize should be 2, but we want to avoid the first
276 * level nodes to have two '/' so we use fpsize 1 here
277 */
278 fpsize = 1;
279 allocl = 2;
280 } else {
281 /* account for '/' and path size minus terminal 0
282 * already in 'l'
283 */
284 fpsize += l;
285 allocl = fpsize;
286 }
287 }
288
289
290 np = unflatten_dt_alloc(&mem, sizeof(struct device_node) + allocl,
291 __alignof__(struct device_node));
292 if (allnextpp) {
293 memset(np, 0, sizeof(*np));
294 np->full_name = ((char*)np) + sizeof(struct device_node);
295 if (new_format) {
296 char *p = np->full_name;
297 /* rebuild full path for new format */
298 if (dad && dad->parent) {
299 strcpy(p, dad->full_name);
300#ifdef DEBUG
301 if ((strlen(p) + l + 1) != allocl) {
302 DBG("%s: p: %d, l: %d, a: %d\n",
303 pathp, (int)strlen(p), l, allocl);
304 }
305#endif
306 p += strlen(p);
307 }
308 *(p++) = '/';
309 memcpy(p, pathp, l);
310 } else
311 memcpy(np->full_name, pathp, l);
312 prev_pp = &np->properties;
313 **allnextpp = np;
314 *allnextpp = &np->allnext;
315 if (dad != NULL) {
316 np->parent = dad;
317 /* we temporarily use the next field as `last_child'*/
318 if (dad->next == 0)
319 dad->child = np;
320 else
321 dad->next->sibling = np;
322 dad->next = np;
323 }
324 kref_init(&np->kref);
325 }
326 while(1) {
327 u32 sz, noff;
328 char *pname;
329
330 tag = *((u32 *)(*p));
331 if (tag == OF_DT_NOP) {
332 *p += 4;
333 continue;
334 }
335 if (tag != OF_DT_PROP)
336 break;
337 *p += 4;
338 sz = *((u32 *)(*p));
339 noff = *((u32 *)((*p) + 4));
340 *p += 8;
341 if (initial_boot_params->version < 0x10)
342 *p = _ALIGN(*p, sz >= 8 ? 8 : 4);
343
344 pname = find_flat_dt_string(noff);
345 if (pname == NULL) {
346 printk("Can't find property name in list !\n");
347 break;
348 }
349 if (strcmp(pname, "name") == 0)
350 has_name = 1;
351 l = strlen(pname) + 1;
352 pp = unflatten_dt_alloc(&mem, sizeof(struct property),
353 __alignof__(struct property));
354 if (allnextpp) {
355 if (strcmp(pname, "linux,phandle") == 0) {
356 np->node = *((u32 *)*p);
357 if (np->linux_phandle == 0)
358 np->linux_phandle = np->node;
359 }
360 if (strcmp(pname, "ibm,phandle") == 0)
361 np->linux_phandle = *((u32 *)*p);
362 pp->name = pname;
363 pp->length = sz;
364 pp->value = (void *)*p;
365 *prev_pp = pp;
366 prev_pp = &pp->next;
367 }
368 *p = _ALIGN((*p) + sz, 4);
369 }
370 /* with version 0x10 we may not have the name property, recreate
371 * it here from the unit name if absent
372 */
373 if (!has_name) {
374 char *p = pathp, *ps = pathp, *pa = NULL;
375 int sz;
376
377 while (*p) {
378 if ((*p) == '@')
379 pa = p;
380 if ((*p) == '/')
381 ps = p + 1;
382 p++;
383 }
384 if (pa < ps)
385 pa = p;
386 sz = (pa - ps) + 1;
387 pp = unflatten_dt_alloc(&mem, sizeof(struct property) + sz,
388 __alignof__(struct property));
389 if (allnextpp) {
390 pp->name = "name";
391 pp->length = sz;
392 pp->value = pp + 1;
393 *prev_pp = pp;
394 prev_pp = &pp->next;
395 memcpy(pp->value, ps, sz - 1);
396 ((char *)pp->value)[sz - 1] = 0;
397 DBG("fixed up name for %s -> %s\n", pathp,
398 (char *)pp->value);
399 }
400 }
401 if (allnextpp) {
402 *prev_pp = NULL;
403 np->name = of_get_property(np, "name", NULL);
404 np->type = of_get_property(np, "device_type", NULL);
405
406 if (!np->name)
407 np->name = "<NULL>";
408 if (!np->type)
409 np->type = "<NULL>";
410 }
411 while (tag == OF_DT_BEGIN_NODE) {
412 mem = unflatten_dt_node(mem, p, np, allnextpp, fpsize);
413 tag = *((u32 *)(*p));
414 }
415 if (tag != OF_DT_END_NODE) {
416 printk("Weird tag at end of node: %x\n", tag);
417 return mem;
418 }
419 *p += 4;
420 return mem;
421}
422
423static int __init early_parse_mem(char *p) 70static int __init early_parse_mem(char *p)
424{ 71{
425 if (!p) 72 if (!p)
@@ -446,7 +93,7 @@ static void __init move_device_tree(void)
446 DBG("-> move_device_tree\n"); 93 DBG("-> move_device_tree\n");
447 94
448 start = __pa(initial_boot_params); 95 start = __pa(initial_boot_params);
449 size = initial_boot_params->totalsize; 96 size = be32_to_cpu(initial_boot_params->totalsize);
450 97
451 if ((memory_limit && (start + size) > memory_limit) || 98 if ((memory_limit && (start + size) > memory_limit) ||
452 overlaps_crashkernel(start, size)) { 99 overlaps_crashkernel(start, size)) {
@@ -459,54 +106,6 @@ static void __init move_device_tree(void)
459 DBG("<- move_device_tree\n"); 106 DBG("<- move_device_tree\n");
460} 107}
461 108
462/**
463 * unflattens the device-tree passed by the firmware, creating the
464 * tree of struct device_node. It also fills the "name" and "type"
465 * pointers of the nodes so the normal device-tree walking functions
466 * can be used (this used to be done by finish_device_tree)
467 */
468void __init unflatten_device_tree(void)
469{
470 unsigned long start, mem, size;
471 struct device_node **allnextp = &allnodes;
472
473 DBG(" -> unflatten_device_tree()\n");
474
475 /* First pass, scan for size */
476 start = ((unsigned long)initial_boot_params) +
477 initial_boot_params->off_dt_struct;
478 size = unflatten_dt_node(0, &start, NULL, NULL, 0);
479 size = (size | 3) + 1;
480
481 DBG(" size is %lx, allocating...\n", size);
482
483 /* Allocate memory for the expanded device tree */
484 mem = lmb_alloc(size + 4, __alignof__(struct device_node));
485 mem = (unsigned long) __va(mem);
486
487 ((u32 *)mem)[size / 4] = 0xdeadbeef;
488
489 DBG(" unflattening %lx...\n", mem);
490
491 /* Second pass, do actual unflattening */
492 start = ((unsigned long)initial_boot_params) +
493 initial_boot_params->off_dt_struct;
494 unflatten_dt_node(mem, &start, NULL, &allnextp, 0);
495 if (*((u32 *)start) != OF_DT_END)
496 printk(KERN_WARNING "Weird tag at end of tree: %08x\n", *((u32 *)start));
497 if (((u32 *)mem)[size / 4] != 0xdeadbeef)
498 printk(KERN_WARNING "End of tree marker overwritten: %08x\n",
499 ((u32 *)mem)[size / 4] );
500 *allnextp = NULL;
501
502 /* Get pointer to OF "/chosen" node for use everywhere */
503 of_chosen = of_find_node_by_path("/chosen");
504 if (of_chosen == NULL)
505 of_chosen = of_find_node_by_path("/chosen@0");
506
507 DBG(" <- unflatten_device_tree()\n");
508}
509
510/* 109/*
511 * ibm,pa-features is a per-cpu property that contains a string of 110 * ibm,pa-features is a per-cpu property that contains a string of
512 * attribute descriptors, each of which has a 2 byte header plus up 111 * attribute descriptors, each of which has a 2 byte header plus up
@@ -763,48 +362,9 @@ static int __init early_init_dt_scan_cpus(unsigned long node,
763 return 0; 362 return 0;
764} 363}
765 364
766#ifdef CONFIG_BLK_DEV_INITRD 365void __init early_init_dt_scan_chosen_arch(unsigned long node)
767static void __init early_init_dt_check_for_initrd(unsigned long node)
768{
769 unsigned long l;
770 u32 *prop;
771
772 DBG("Looking for initrd properties... ");
773
774 prop = of_get_flat_dt_prop(node, "linux,initrd-start", &l);
775 if (prop) {
776 initrd_start = (unsigned long)__va(of_read_ulong(prop, l/4));
777
778 prop = of_get_flat_dt_prop(node, "linux,initrd-end", &l);
779 if (prop) {
780 initrd_end = (unsigned long)
781 __va(of_read_ulong(prop, l/4));
782 initrd_below_start_ok = 1;
783 } else {
784 initrd_start = 0;
785 }
786 }
787
788 DBG("initrd_start=0x%lx initrd_end=0x%lx\n", initrd_start, initrd_end);
789}
790#else
791static inline void early_init_dt_check_for_initrd(unsigned long node)
792{
793}
794#endif /* CONFIG_BLK_DEV_INITRD */
795
796static int __init early_init_dt_scan_chosen(unsigned long node,
797 const char *uname, int depth, void *data)
798{ 366{
799 unsigned long *lprop; 367 unsigned long *lprop;
800 unsigned long l;
801 char *p;
802
803 DBG("search \"chosen\", depth: %d, uname: %s\n", depth, uname);
804
805 if (depth != 1 ||
806 (strcmp(uname, "chosen") != 0 && strcmp(uname, "chosen@0") != 0))
807 return 0;
808 368
809#ifdef CONFIG_PPC64 369#ifdef CONFIG_PPC64
810 /* check if iommu is forced on or off */ 370 /* check if iommu is forced on or off */
@@ -815,17 +375,17 @@ static int __init early_init_dt_scan_chosen(unsigned long node,
815#endif 375#endif
816 376
817 /* mem=x on the command line is the preferred mechanism */ 377 /* mem=x on the command line is the preferred mechanism */
818 lprop = of_get_flat_dt_prop(node, "linux,memory-limit", NULL); 378 lprop = of_get_flat_dt_prop(node, "linux,memory-limit", NULL);
819 if (lprop) 379 if (lprop)
820 memory_limit = *lprop; 380 memory_limit = *lprop;
821 381
822#ifdef CONFIG_PPC64 382#ifdef CONFIG_PPC64
823 lprop = of_get_flat_dt_prop(node, "linux,tce-alloc-start", NULL); 383 lprop = of_get_flat_dt_prop(node, "linux,tce-alloc-start", NULL);
824 if (lprop) 384 if (lprop)
825 tce_alloc_start = *lprop; 385 tce_alloc_start = *lprop;
826 lprop = of_get_flat_dt_prop(node, "linux,tce-alloc-end", NULL); 386 lprop = of_get_flat_dt_prop(node, "linux,tce-alloc-end", NULL);
827 if (lprop) 387 if (lprop)
828 tce_alloc_end = *lprop; 388 tce_alloc_end = *lprop;
829#endif 389#endif
830 390
831#ifdef CONFIG_KEXEC 391#ifdef CONFIG_KEXEC
@@ -837,51 +397,6 @@ static int __init early_init_dt_scan_chosen(unsigned long node,
837 if (lprop) 397 if (lprop)
838 crashk_res.end = crashk_res.start + *lprop - 1; 398 crashk_res.end = crashk_res.start + *lprop - 1;
839#endif 399#endif
840
841 early_init_dt_check_for_initrd(node);
842
843 /* Retreive command line */
844 p = of_get_flat_dt_prop(node, "bootargs", &l);
845 if (p != NULL && l > 0)
846 strlcpy(cmd_line, p, min((int)l, COMMAND_LINE_SIZE));
847
848#ifdef CONFIG_CMDLINE
849 if (p == NULL || l == 0 || (l == 1 && (*p) == 0))
850 strlcpy(cmd_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
851#endif /* CONFIG_CMDLINE */
852
853 DBG("Command line is: %s\n", cmd_line);
854
855 /* break now */
856 return 1;
857}
858
859static int __init early_init_dt_scan_root(unsigned long node,
860 const char *uname, int depth, void *data)
861{
862 u32 *prop;
863
864 if (depth != 0)
865 return 0;
866
867 prop = of_get_flat_dt_prop(node, "#size-cells", NULL);
868 dt_root_size_cells = (prop == NULL) ? 1 : *prop;
869 DBG("dt_root_size_cells = %x\n", dt_root_size_cells);
870
871 prop = of_get_flat_dt_prop(node, "#address-cells", NULL);
872 dt_root_addr_cells = (prop == NULL) ? 2 : *prop;
873 DBG("dt_root_addr_cells = %x\n", dt_root_addr_cells);
874
875 /* break now */
876 return 1;
877}
878
879static u64 __init dt_mem_next_cell(int s, cell_t **cellp)
880{
881 cell_t *p = *cellp;
882
883 *cellp = p + s;
884 return of_read_number(p, s);
885} 400}
886 401
887#ifdef CONFIG_PPC_PSERIES 402#ifdef CONFIG_PPC_PSERIES
@@ -893,22 +408,22 @@ static u64 __init dt_mem_next_cell(int s, cell_t **cellp)
893 */ 408 */
894static int __init early_init_dt_scan_drconf_memory(unsigned long node) 409static int __init early_init_dt_scan_drconf_memory(unsigned long node)
895{ 410{
896 cell_t *dm, *ls, *usm; 411 __be32 *dm, *ls, *usm;
897 unsigned long l, n, flags; 412 unsigned long l, n, flags;
898 u64 base, size, lmb_size; 413 u64 base, size, lmb_size;
899 unsigned int is_kexec_kdump = 0, rngs; 414 unsigned int is_kexec_kdump = 0, rngs;
900 415
901 ls = of_get_flat_dt_prop(node, "ibm,lmb-size", &l); 416 ls = of_get_flat_dt_prop(node, "ibm,lmb-size", &l);
902 if (ls == NULL || l < dt_root_size_cells * sizeof(cell_t)) 417 if (ls == NULL || l < dt_root_size_cells * sizeof(__be32))
903 return 0; 418 return 0;
904 lmb_size = dt_mem_next_cell(dt_root_size_cells, &ls); 419 lmb_size = dt_mem_next_cell(dt_root_size_cells, &ls);
905 420
906 dm = of_get_flat_dt_prop(node, "ibm,dynamic-memory", &l); 421 dm = of_get_flat_dt_prop(node, "ibm,dynamic-memory", &l);
907 if (dm == NULL || l < sizeof(cell_t)) 422 if (dm == NULL || l < sizeof(__be32))
908 return 0; 423 return 0;
909 424
910 n = *dm++; /* number of entries */ 425 n = *dm++; /* number of entries */
911 if (l < (n * (dt_root_addr_cells + 4) + 1) * sizeof(cell_t)) 426 if (l < (n * (dt_root_addr_cells + 4) + 1) * sizeof(__be32))
912 return 0; 427 return 0;
913 428
914 /* check if this is a kexec/kdump kernel. */ 429 /* check if this is a kexec/kdump kernel. */
@@ -963,65 +478,47 @@ static int __init early_init_dt_scan_drconf_memory(unsigned long node)
963#define early_init_dt_scan_drconf_memory(node) 0 478#define early_init_dt_scan_drconf_memory(node) 0
964#endif /* CONFIG_PPC_PSERIES */ 479#endif /* CONFIG_PPC_PSERIES */
965 480
966static int __init early_init_dt_scan_memory(unsigned long node, 481static int __init early_init_dt_scan_memory_ppc(unsigned long node,
967 const char *uname, int depth, void *data) 482 const char *uname,
483 int depth, void *data)
968{ 484{
969 char *type = of_get_flat_dt_prop(node, "device_type", NULL);
970 cell_t *reg, *endp;
971 unsigned long l;
972
973 /* Look for the ibm,dynamic-reconfiguration-memory node */
974 if (depth == 1 && 485 if (depth == 1 &&
975 strcmp(uname, "ibm,dynamic-reconfiguration-memory") == 0) 486 strcmp(uname, "ibm,dynamic-reconfiguration-memory") == 0)
976 return early_init_dt_scan_drconf_memory(node); 487 return early_init_dt_scan_drconf_memory(node);
488
489 return early_init_dt_scan_memory(node, uname, depth, data);
490}
977 491
978 /* We are scanning "memory" nodes only */ 492void __init early_init_dt_add_memory_arch(u64 base, u64 size)
979 if (type == NULL) { 493{
980 /* 494#if defined(CONFIG_PPC64)
981 * The longtrail doesn't have a device_type on the 495 if (iommu_is_off) {
982 * /memory node, so look for the node called /memory@0. 496 if (base >= 0x80000000ul)
983 */ 497 return;
984 if (depth != 1 || strcmp(uname, "memory@0") != 0) 498 if ((base + size) > 0x80000000ul)
985 return 0; 499 size = 0x80000000ul - base;
986 } else if (strcmp(type, "memory") != 0) 500 }
987 return 0; 501#endif
988
989 reg = of_get_flat_dt_prop(node, "linux,usable-memory", &l);
990 if (reg == NULL)
991 reg = of_get_flat_dt_prop(node, "reg", &l);
992 if (reg == NULL)
993 return 0;
994
995 endp = reg + (l / sizeof(cell_t));
996
997 DBG("memory scan node %s, reg size %ld, data: %x %x %x %x,\n",
998 uname, l, reg[0], reg[1], reg[2], reg[3]);
999
1000 while ((endp - reg) >= (dt_root_addr_cells + dt_root_size_cells)) {
1001 u64 base, size;
1002 502
1003 base = dt_mem_next_cell(dt_root_addr_cells, &reg); 503 lmb_add(base, size);
1004 size = dt_mem_next_cell(dt_root_size_cells, &reg);
1005 504
1006 if (size == 0) 505 memstart_addr = min((u64)memstart_addr, base);
1007 continue; 506}
1008 DBG(" - %llx , %llx\n", (unsigned long long)base,
1009 (unsigned long long)size);
1010#ifdef CONFIG_PPC64
1011 if (iommu_is_off) {
1012 if (base >= 0x80000000ul)
1013 continue;
1014 if ((base + size) > 0x80000000ul)
1015 size = 0x80000000ul - base;
1016 }
1017#endif
1018 lmb_add(base, size);
1019 507
1020 memstart_addr = min((u64)memstart_addr, base); 508u64 __init early_init_dt_alloc_memory_arch(u64 size, u64 align)
1021 } 509{
510 return lmb_alloc(size, align);
511}
1022 512
1023 return 0; 513#ifdef CONFIG_BLK_DEV_INITRD
514void __init early_init_dt_setup_initrd_arch(unsigned long start,
515 unsigned long end)
516{
517 initrd_start = (unsigned long)__va(start);
518 initrd_end = (unsigned long)__va(end);
519 initrd_below_start_ok = 1;
1024} 520}
521#endif
1025 522
1026static void __init early_reserve_mem(void) 523static void __init early_reserve_mem(void)
1027{ 524{
@@ -1186,7 +683,7 @@ void __init early_init_devtree(void *params)
1186 /* Scan memory nodes and rebuild LMBs */ 683 /* Scan memory nodes and rebuild LMBs */
1187 lmb_init(); 684 lmb_init();
1188 of_scan_flat_dt(early_init_dt_scan_root, NULL); 685 of_scan_flat_dt(early_init_dt_scan_root, NULL);
1189 of_scan_flat_dt(early_init_dt_scan_memory, NULL); 686 of_scan_flat_dt(early_init_dt_scan_memory_ppc, NULL);
1190 687
1191 /* Save command line for /proc/cmdline and then parse parameters */ 688 /* Save command line for /proc/cmdline and then parse parameters */
1192 strlcpy(boot_command_line, cmd_line, COMMAND_LINE_SIZE); 689 strlcpy(boot_command_line, cmd_line, COMMAND_LINE_SIZE);
@@ -1234,25 +731,6 @@ void __init early_init_devtree(void *params)
1234 DBG(" <- early_init_devtree()\n"); 731 DBG(" <- early_init_devtree()\n");
1235} 732}
1236 733
1237
1238/**
1239 * Indicates whether the root node has a given value in its
1240 * compatible property.
1241 */
1242int machine_is_compatible(const char *compat)
1243{
1244 struct device_node *root;
1245 int rc = 0;
1246
1247 root = of_find_node_by_path("/");
1248 if (root) {
1249 rc = of_device_is_compatible(root, compat);
1250 of_node_put(root);
1251 }
1252 return rc;
1253}
1254EXPORT_SYMBOL(machine_is_compatible);
1255
1256/******* 734/*******
1257 * 735 *
1258 * New implementation of the OF "find" APIs, return a refcounted 736 * New implementation of the OF "find" APIs, return a refcounted
@@ -1265,27 +743,6 @@ EXPORT_SYMBOL(machine_is_compatible);
1265 *******/ 743 *******/
1266 744
1267/** 745/**
1268 * of_find_node_by_phandle - Find a node given a phandle
1269 * @handle: phandle of the node to find
1270 *
1271 * Returns a node pointer with refcount incremented, use
1272 * of_node_put() on it when done.
1273 */
1274struct device_node *of_find_node_by_phandle(phandle handle)
1275{
1276 struct device_node *np;
1277
1278 read_lock(&devtree_lock);
1279 for (np = allnodes; np != 0; np = np->allnext)
1280 if (np->linux_phandle == handle)
1281 break;
1282 of_node_get(np);
1283 read_unlock(&devtree_lock);
1284 return np;
1285}
1286EXPORT_SYMBOL(of_find_node_by_phandle);
1287
1288/**
1289 * of_find_next_cache_node - Find a node's subsidiary cache 746 * of_find_next_cache_node - Find a node's subsidiary cache
1290 * @np: node of type "cpu" or "cache" 747 * @np: node of type "cpu" or "cache"
1291 * 748 *
@@ -1316,138 +773,6 @@ struct device_node *of_find_next_cache_node(struct device_node *np)
1316 return NULL; 773 return NULL;
1317} 774}
1318 775
1319/**
1320 * of_node_get - Increment refcount of a node
1321 * @node: Node to inc refcount, NULL is supported to
1322 * simplify writing of callers
1323 *
1324 * Returns node.
1325 */
1326struct device_node *of_node_get(struct device_node *node)
1327{
1328 if (node)
1329 kref_get(&node->kref);
1330 return node;
1331}
1332EXPORT_SYMBOL(of_node_get);
1333
1334static inline struct device_node * kref_to_device_node(struct kref *kref)
1335{
1336 return container_of(kref, struct device_node, kref);
1337}
1338
1339/**
1340 * of_node_release - release a dynamically allocated node
1341 * @kref: kref element of the node to be released
1342 *
1343 * In of_node_put() this function is passed to kref_put()
1344 * as the destructor.
1345 */
1346static void of_node_release(struct kref *kref)
1347{
1348 struct device_node *node = kref_to_device_node(kref);
1349 struct property *prop = node->properties;
1350
1351 /* We should never be releasing nodes that haven't been detached. */
1352 if (!of_node_check_flag(node, OF_DETACHED)) {
1353 printk("WARNING: Bad of_node_put() on %s\n", node->full_name);
1354 dump_stack();
1355 kref_init(&node->kref);
1356 return;
1357 }
1358
1359 if (!of_node_check_flag(node, OF_DYNAMIC))
1360 return;
1361
1362 while (prop) {
1363 struct property *next = prop->next;
1364 kfree(prop->name);
1365 kfree(prop->value);
1366 kfree(prop);
1367 prop = next;
1368
1369 if (!prop) {
1370 prop = node->deadprops;
1371 node->deadprops = NULL;
1372 }
1373 }
1374 kfree(node->full_name);
1375 kfree(node->data);
1376 kfree(node);
1377}
1378
1379/**
1380 * of_node_put - Decrement refcount of a node
1381 * @node: Node to dec refcount, NULL is supported to
1382 * simplify writing of callers
1383 *
1384 */
1385void of_node_put(struct device_node *node)
1386{
1387 if (node)
1388 kref_put(&node->kref, of_node_release);
1389}
1390EXPORT_SYMBOL(of_node_put);
1391
1392/*
1393 * Plug a device node into the tree and global list.
1394 */
1395void of_attach_node(struct device_node *np)
1396{
1397 unsigned long flags;
1398
1399 write_lock_irqsave(&devtree_lock, flags);
1400 np->sibling = np->parent->child;
1401 np->allnext = allnodes;
1402 np->parent->child = np;
1403 allnodes = np;
1404 write_unlock_irqrestore(&devtree_lock, flags);
1405}
1406
1407/*
1408 * "Unplug" a node from the device tree. The caller must hold
1409 * a reference to the node. The memory associated with the node
1410 * is not freed until its refcount goes to zero.
1411 */
1412void of_detach_node(struct device_node *np)
1413{
1414 struct device_node *parent;
1415 unsigned long flags;
1416
1417 write_lock_irqsave(&devtree_lock, flags);
1418
1419 parent = np->parent;
1420 if (!parent)
1421 goto out_unlock;
1422
1423 if (allnodes == np)
1424 allnodes = np->allnext;
1425 else {
1426 struct device_node *prev;
1427 for (prev = allnodes;
1428 prev->allnext != np;
1429 prev = prev->allnext)
1430 ;
1431 prev->allnext = np->allnext;
1432 }
1433
1434 if (parent->child == np)
1435 parent->child = np->sibling;
1436 else {
1437 struct device_node *prevsib;
1438 for (prevsib = np->parent->child;
1439 prevsib->sibling != np;
1440 prevsib = prevsib->sibling)
1441 ;
1442 prevsib->sibling = np->sibling;
1443 }
1444
1445 of_node_set_flag(np, OF_DETACHED);
1446
1447out_unlock:
1448 write_unlock_irqrestore(&devtree_lock, flags);
1449}
1450
1451#ifdef CONFIG_PPC_PSERIES 776#ifdef CONFIG_PPC_PSERIES
1452/* 777/*
1453 * Fix up the uninitialized fields in a new device node: 778 * Fix up the uninitialized fields in a new device node:
@@ -1479,9 +804,9 @@ static int of_finish_dynamic_node(struct device_node *node)
1479 if (machine_is(powermac)) 804 if (machine_is(powermac))
1480 return -ENODEV; 805 return -ENODEV;
1481 806
1482 /* fix up new node's linux_phandle field */ 807 /* fix up new node's phandle field */
1483 if ((ibm_phandle = of_get_property(node, "ibm,phandle", NULL))) 808 if ((ibm_phandle = of_get_property(node, "ibm,phandle", NULL)))
1484 node->linux_phandle = *ibm_phandle; 809 node->phandle = *ibm_phandle;
1485 810
1486out: 811out:
1487 of_node_put(parent); 812 of_node_put(parent);
@@ -1520,120 +845,6 @@ static int __init prom_reconfig_setup(void)
1520__initcall(prom_reconfig_setup); 845__initcall(prom_reconfig_setup);
1521#endif 846#endif
1522 847
1523/*
1524 * Add a property to a node
1525 */
1526int prom_add_property(struct device_node* np, struct property* prop)
1527{
1528 struct property **next;
1529 unsigned long flags;
1530
1531 prop->next = NULL;
1532 write_lock_irqsave(&devtree_lock, flags);
1533 next = &np->properties;
1534 while (*next) {
1535 if (strcmp(prop->name, (*next)->name) == 0) {
1536 /* duplicate ! don't insert it */
1537 write_unlock_irqrestore(&devtree_lock, flags);
1538 return -1;
1539 }
1540 next = &(*next)->next;
1541 }
1542 *next = prop;
1543 write_unlock_irqrestore(&devtree_lock, flags);
1544
1545#ifdef CONFIG_PROC_DEVICETREE
1546 /* try to add to proc as well if it was initialized */
1547 if (np->pde)
1548 proc_device_tree_add_prop(np->pde, prop);
1549#endif /* CONFIG_PROC_DEVICETREE */
1550
1551 return 0;
1552}
1553
1554/*
1555 * Remove a property from a node. Note that we don't actually
1556 * remove it, since we have given out who-knows-how-many pointers
1557 * to the data using get-property. Instead we just move the property
1558 * to the "dead properties" list, so it won't be found any more.
1559 */
1560int prom_remove_property(struct device_node *np, struct property *prop)
1561{
1562 struct property **next;
1563 unsigned long flags;
1564 int found = 0;
1565
1566 write_lock_irqsave(&devtree_lock, flags);
1567 next = &np->properties;
1568 while (*next) {
1569 if (*next == prop) {
1570 /* found the node */
1571 *next = prop->next;
1572 prop->next = np->deadprops;
1573 np->deadprops = prop;
1574 found = 1;
1575 break;
1576 }
1577 next = &(*next)->next;
1578 }
1579 write_unlock_irqrestore(&devtree_lock, flags);
1580
1581 if (!found)
1582 return -ENODEV;
1583
1584#ifdef CONFIG_PROC_DEVICETREE
1585 /* try to remove the proc node as well */
1586 if (np->pde)
1587 proc_device_tree_remove_prop(np->pde, prop);
1588#endif /* CONFIG_PROC_DEVICETREE */
1589
1590 return 0;
1591}
1592
1593/*
1594 * Update a property in a node. Note that we don't actually
1595 * remove it, since we have given out who-knows-how-many pointers
1596 * to the data using get-property. Instead we just move the property
1597 * to the "dead properties" list, and add the new property to the
1598 * property list
1599 */
1600int prom_update_property(struct device_node *np,
1601 struct property *newprop,
1602 struct property *oldprop)
1603{
1604 struct property **next;
1605 unsigned long flags;
1606 int found = 0;
1607
1608 write_lock_irqsave(&devtree_lock, flags);
1609 next = &np->properties;
1610 while (*next) {
1611 if (*next == oldprop) {
1612 /* found the node */
1613 newprop->next = oldprop->next;
1614 *next = newprop;
1615 oldprop->next = np->deadprops;
1616 np->deadprops = oldprop;
1617 found = 1;
1618 break;
1619 }
1620 next = &(*next)->next;
1621 }
1622 write_unlock_irqrestore(&devtree_lock, flags);
1623
1624 if (!found)
1625 return -ENODEV;
1626
1627#ifdef CONFIG_PROC_DEVICETREE
1628 /* try to add to proc as well if it was initialized */
1629 if (np->pde)
1630 proc_device_tree_update_prop(np->pde, newprop, oldprop);
1631#endif /* CONFIG_PROC_DEVICETREE */
1632
1633 return 0;
1634}
1635
1636
1637/* Find the device node for a given logical cpu number, also returns the cpu 848/* Find the device node for a given logical cpu number, also returns the cpu
1638 * local thread number (index in ibm,interrupt-server#s) if relevant and 849 * local thread number (index in ibm,interrupt-server#s) if relevant and
1639 * asked for (non NULL) 850 * asked for (non NULL)
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index bafac2e41ae1..5f306c4946e5 100644
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -654,6 +654,9 @@ static void __init early_cmdline_parse(void)
654#define OV5_CMO 0x00 654#define OV5_CMO 0x00
655#endif 655#endif
656 656
657/* Option Vector 6: IBM PAPR hints */
658#define OV6_LINUX 0x02 /* Linux is our OS */
659
657/* 660/*
658 * The architecture vector has an array of PVR mask/value pairs, 661 * The architecture vector has an array of PVR mask/value pairs,
659 * followed by # option vectors - 1, followed by the option vectors. 662 * followed by # option vectors - 1, followed by the option vectors.
@@ -665,7 +668,7 @@ static unsigned char ibm_architecture_vec[] = {
665 W(0xffffffff), W(0x0f000003), /* all 2.06-compliant */ 668 W(0xffffffff), W(0x0f000003), /* all 2.06-compliant */
666 W(0xffffffff), W(0x0f000002), /* all 2.05-compliant */ 669 W(0xffffffff), W(0x0f000002), /* all 2.05-compliant */
667 W(0xfffffffe), W(0x0f000001), /* all 2.04-compliant and earlier */ 670 W(0xfffffffe), W(0x0f000001), /* all 2.04-compliant and earlier */
668 5 - 1, /* 5 option vectors */ 671 6 - 1, /* 6 option vectors */
669 672
670 /* option vector 1: processor architectures supported */ 673 /* option vector 1: processor architectures supported */
671 3 - 2, /* length */ 674 3 - 2, /* length */
@@ -697,12 +700,29 @@ static unsigned char ibm_architecture_vec[] = {
697 0, /* don't halt */ 700 0, /* don't halt */
698 701
699 /* option vector 5: PAPR/OF options */ 702 /* option vector 5: PAPR/OF options */
700 5 - 2, /* length */ 703 13 - 2, /* length */
701 0, /* don't ignore, don't halt */ 704 0, /* don't ignore, don't halt */
702 OV5_LPAR | OV5_SPLPAR | OV5_LARGE_PAGES | OV5_DRCONF_MEMORY | 705 OV5_LPAR | OV5_SPLPAR | OV5_LARGE_PAGES | OV5_DRCONF_MEMORY |
703 OV5_DONATE_DEDICATE_CPU | OV5_MSI, 706 OV5_DONATE_DEDICATE_CPU | OV5_MSI,
704 0, 707 0,
705 OV5_CMO, 708 OV5_CMO,
709 0,
710 0,
711 0,
712 0,
713 /* WARNING: The offset of the "number of cores" field below
714 * must match by the macro below. Update the definition if
715 * the structure layout changes.
716 */
717#define IBM_ARCH_VEC_NRCORES_OFFSET 100
718 W(NR_CPUS), /* number of cores supported */
719
720 /* option vector 6: IBM PAPR hints */
721 4 - 2, /* length */
722 0,
723 0,
724 OV6_LINUX,
725
706}; 726};
707 727
708/* Old method - ELF header with PT_NOTE sections */ 728/* Old method - ELF header with PT_NOTE sections */
@@ -792,13 +812,70 @@ static struct fake_elf {
792 } 812 }
793}; 813};
794 814
815static int __init prom_count_smt_threads(void)
816{
817 phandle node;
818 char type[64];
819 unsigned int plen;
820
821 /* Pick up th first CPU node we can find */
822 for (node = 0; prom_next_node(&node); ) {
823 type[0] = 0;
824 prom_getprop(node, "device_type", type, sizeof(type));
825
826 if (strcmp(type, RELOC("cpu")))
827 continue;
828 /*
829 * There is an entry for each smt thread, each entry being
830 * 4 bytes long. All cpus should have the same number of
831 * smt threads, so return after finding the first.
832 */
833 plen = prom_getproplen(node, "ibm,ppc-interrupt-server#s");
834 if (plen == PROM_ERROR)
835 break;
836 plen >>= 2;
837 prom_debug("Found 0x%x smt threads per core\n", (unsigned long)plen);
838
839 /* Sanity check */
840 if (plen < 1 || plen > 64) {
841 prom_printf("Threads per core 0x%x out of bounds, assuming 1\n",
842 (unsigned long)plen);
843 return 1;
844 }
845 return plen;
846 }
847 prom_debug("No threads found, assuming 1 per core\n");
848
849 return 1;
850
851}
852
853
795static void __init prom_send_capabilities(void) 854static void __init prom_send_capabilities(void)
796{ 855{
797 ihandle elfloader, root; 856 ihandle elfloader, root;
798 prom_arg_t ret; 857 prom_arg_t ret;
858 u32 *cores;
799 859
800 root = call_prom("open", 1, 1, ADDR("/")); 860 root = call_prom("open", 1, 1, ADDR("/"));
801 if (root != 0) { 861 if (root != 0) {
862 /* We need to tell the FW about the number of cores we support.
863 *
864 * To do that, we count the number of threads on the first core
865 * (we assume this is the same for all cores) and use it to
866 * divide NR_CPUS.
867 */
868 cores = (u32 *)PTRRELOC(&ibm_architecture_vec[IBM_ARCH_VEC_NRCORES_OFFSET]);
869 if (*cores != NR_CPUS) {
870 prom_printf("WARNING ! "
871 "ibm_architecture_vec structure inconsistent: 0x%x !\n",
872 *cores);
873 } else {
874 *cores = NR_CPUS / prom_count_smt_threads();
875 prom_printf("Max number of cores passed to firmware: 0x%x\n",
876 (unsigned long)*cores);
877 }
878
802 /* try calling the ibm,client-architecture-support method */ 879 /* try calling the ibm,client-architecture-support method */
803 prom_printf("Calling ibm,client-architecture-support..."); 880 prom_printf("Calling ibm,client-architecture-support...");
804 if (call_prom_ret("call-method", 3, 2, &ret, 881 if (call_prom_ret("call-method", 3, 2, &ret,
diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c
index ef149880c145..d9b05866615f 100644
--- a/arch/powerpc/kernel/ptrace.c
+++ b/arch/powerpc/kernel/ptrace.c
@@ -46,7 +46,7 @@
46/* 46/*
47 * Set of msr bits that gdb can change on behalf of a process. 47 * Set of msr bits that gdb can change on behalf of a process.
48 */ 48 */
49#if defined(CONFIG_40x) || defined(CONFIG_BOOKE) 49#ifdef CONFIG_PPC_ADV_DEBUG_REGS
50#define MSR_DEBUGCHANGE 0 50#define MSR_DEBUGCHANGE 0
51#else 51#else
52#define MSR_DEBUGCHANGE (MSR_SE | MSR_BE) 52#define MSR_DEBUGCHANGE (MSR_SE | MSR_BE)
@@ -703,7 +703,7 @@ void user_enable_single_step(struct task_struct *task)
703 struct pt_regs *regs = task->thread.regs; 703 struct pt_regs *regs = task->thread.regs;
704 704
705 if (regs != NULL) { 705 if (regs != NULL) {
706#if defined(CONFIG_40x) || defined(CONFIG_BOOKE) 706#ifdef CONFIG_PPC_ADV_DEBUG_REGS
707 task->thread.dbcr0 &= ~DBCR0_BT; 707 task->thread.dbcr0 &= ~DBCR0_BT;
708 task->thread.dbcr0 |= DBCR0_IDM | DBCR0_IC; 708 task->thread.dbcr0 |= DBCR0_IDM | DBCR0_IC;
709 regs->msr |= MSR_DE; 709 regs->msr |= MSR_DE;
@@ -720,7 +720,7 @@ void user_enable_block_step(struct task_struct *task)
720 struct pt_regs *regs = task->thread.regs; 720 struct pt_regs *regs = task->thread.regs;
721 721
722 if (regs != NULL) { 722 if (regs != NULL) {
723#if defined(CONFIG_40x) || defined(CONFIG_BOOKE) 723#ifdef CONFIG_PPC_ADV_DEBUG_REGS
724 task->thread.dbcr0 &= ~DBCR0_IC; 724 task->thread.dbcr0 &= ~DBCR0_IC;
725 task->thread.dbcr0 = DBCR0_IDM | DBCR0_BT; 725 task->thread.dbcr0 = DBCR0_IDM | DBCR0_BT;
726 regs->msr |= MSR_DE; 726 regs->msr |= MSR_DE;
@@ -737,17 +737,25 @@ void user_disable_single_step(struct task_struct *task)
737 struct pt_regs *regs = task->thread.regs; 737 struct pt_regs *regs = task->thread.regs;
738 738
739 if (regs != NULL) { 739 if (regs != NULL) {
740#if defined(CONFIG_BOOKE) 740#ifdef CONFIG_PPC_ADV_DEBUG_REGS
741 /* If DAC don't clear DBCRO_IDM or MSR_DE */ 741 /*
742 if (task->thread.dabr) 742 * The logic to disable single stepping should be as
743 task->thread.dbcr0 &= ~(DBCR0_IC | DBCR0_BT); 743 * simple as turning off the Instruction Complete flag.
744 else { 744 * And, after doing so, if all debug flags are off, turn
745 task->thread.dbcr0 &= ~(DBCR0_IC | DBCR0_BT | DBCR0_IDM); 745 * off DBCR0(IDM) and MSR(DE) .... Torez
746 */
747 task->thread.dbcr0 &= ~DBCR0_IC;
748 /*
749 * Test to see if any of the DBCR_ACTIVE_EVENTS bits are set.
750 */
751 if (!DBCR_ACTIVE_EVENTS(task->thread.dbcr0,
752 task->thread.dbcr1)) {
753 /*
754 * All debug events were off.....
755 */
756 task->thread.dbcr0 &= ~DBCR0_IDM;
746 regs->msr &= ~MSR_DE; 757 regs->msr &= ~MSR_DE;
747 } 758 }
748#elif defined(CONFIG_40x)
749 task->thread.dbcr0 &= ~(DBCR0_IC | DBCR0_BT | DBCR0_IDM);
750 regs->msr &= ~MSR_DE;
751#else 759#else
752 regs->msr &= ~(MSR_SE | MSR_BE); 760 regs->msr &= ~(MSR_SE | MSR_BE);
753#endif 761#endif
@@ -769,8 +777,7 @@ int ptrace_set_debugreg(struct task_struct *task, unsigned long addr,
769 if ((data & ~0x7UL) >= TASK_SIZE) 777 if ((data & ~0x7UL) >= TASK_SIZE)
770 return -EIO; 778 return -EIO;
771 779
772#ifndef CONFIG_BOOKE 780#ifndef CONFIG_PPC_ADV_DEBUG_REGS
773
774 /* For processors using DABR (i.e. 970), the bottom 3 bits are flags. 781 /* For processors using DABR (i.e. 970), the bottom 3 bits are flags.
775 * It was assumed, on previous implementations, that 3 bits were 782 * It was assumed, on previous implementations, that 3 bits were
776 * passed together with the data address, fitting the design of the 783 * passed together with the data address, fitting the design of the
@@ -789,21 +796,22 @@ int ptrace_set_debugreg(struct task_struct *task, unsigned long addr,
789 796
790 /* Move contents to the DABR register */ 797 /* Move contents to the DABR register */
791 task->thread.dabr = data; 798 task->thread.dabr = data;
792 799#else /* CONFIG_PPC_ADV_DEBUG_REGS */
793#endif
794#if defined(CONFIG_BOOKE)
795
796 /* As described above, it was assumed 3 bits were passed with the data 800 /* As described above, it was assumed 3 bits were passed with the data
797 * address, but we will assume only the mode bits will be passed 801 * address, but we will assume only the mode bits will be passed
798 * as to not cause alignment restrictions for DAC-based processors. 802 * as to not cause alignment restrictions for DAC-based processors.
799 */ 803 */
800 804
801 /* DAC's hold the whole address without any mode flags */ 805 /* DAC's hold the whole address without any mode flags */
802 task->thread.dabr = data & ~0x3UL; 806 task->thread.dac1 = data & ~0x3UL;
803 807
804 if (task->thread.dabr == 0) { 808 if (task->thread.dac1 == 0) {
805 task->thread.dbcr0 &= ~(DBSR_DAC1R | DBSR_DAC1W | DBCR0_IDM); 809 dbcr_dac(task) &= ~(DBCR_DAC1R | DBCR_DAC1W);
806 task->thread.regs->msr &= ~MSR_DE; 810 if (!DBCR_ACTIVE_EVENTS(task->thread.dbcr0,
811 task->thread.dbcr1)) {
812 task->thread.regs->msr &= ~MSR_DE;
813 task->thread.dbcr0 &= ~DBCR0_IDM;
814 }
807 return 0; 815 return 0;
808 } 816 }
809 817
@@ -814,17 +822,17 @@ int ptrace_set_debugreg(struct task_struct *task, unsigned long addr,
814 822
815 /* Set the Internal Debugging flag (IDM bit 1) for the DBCR0 823 /* Set the Internal Debugging flag (IDM bit 1) for the DBCR0
816 register */ 824 register */
817 task->thread.dbcr0 = DBCR0_IDM; 825 task->thread.dbcr0 |= DBCR0_IDM;
818 826
819 /* Check for write and read flags and set DBCR0 827 /* Check for write and read flags and set DBCR0
820 accordingly */ 828 accordingly */
829 dbcr_dac(task) &= ~(DBCR_DAC1R|DBCR_DAC1W);
821 if (data & 0x1UL) 830 if (data & 0x1UL)
822 task->thread.dbcr0 |= DBSR_DAC1R; 831 dbcr_dac(task) |= DBCR_DAC1R;
823 if (data & 0x2UL) 832 if (data & 0x2UL)
824 task->thread.dbcr0 |= DBSR_DAC1W; 833 dbcr_dac(task) |= DBCR_DAC1W;
825
826 task->thread.regs->msr |= MSR_DE; 834 task->thread.regs->msr |= MSR_DE;
827#endif 835#endif /* CONFIG_PPC_ADV_DEBUG_REGS */
828 return 0; 836 return 0;
829} 837}
830 838
@@ -839,6 +847,394 @@ void ptrace_disable(struct task_struct *child)
839 user_disable_single_step(child); 847 user_disable_single_step(child);
840} 848}
841 849
850#ifdef CONFIG_PPC_ADV_DEBUG_REGS
851static long set_intruction_bp(struct task_struct *child,
852 struct ppc_hw_breakpoint *bp_info)
853{
854 int slot;
855 int slot1_in_use = ((child->thread.dbcr0 & DBCR0_IAC1) != 0);
856 int slot2_in_use = ((child->thread.dbcr0 & DBCR0_IAC2) != 0);
857 int slot3_in_use = ((child->thread.dbcr0 & DBCR0_IAC3) != 0);
858 int slot4_in_use = ((child->thread.dbcr0 & DBCR0_IAC4) != 0);
859
860 if (dbcr_iac_range(child) & DBCR_IAC12MODE)
861 slot2_in_use = 1;
862 if (dbcr_iac_range(child) & DBCR_IAC34MODE)
863 slot4_in_use = 1;
864
865 if (bp_info->addr >= TASK_SIZE)
866 return -EIO;
867
868 if (bp_info->addr_mode != PPC_BREAKPOINT_MODE_EXACT) {
869
870 /* Make sure range is valid. */
871 if (bp_info->addr2 >= TASK_SIZE)
872 return -EIO;
873
874 /* We need a pair of IAC regsisters */
875 if ((!slot1_in_use) && (!slot2_in_use)) {
876 slot = 1;
877 child->thread.iac1 = bp_info->addr;
878 child->thread.iac2 = bp_info->addr2;
879 child->thread.dbcr0 |= DBCR0_IAC1;
880 if (bp_info->addr_mode ==
881 PPC_BREAKPOINT_MODE_RANGE_EXCLUSIVE)
882 dbcr_iac_range(child) |= DBCR_IAC12X;
883 else
884 dbcr_iac_range(child) |= DBCR_IAC12I;
885#if CONFIG_PPC_ADV_DEBUG_IACS > 2
886 } else if ((!slot3_in_use) && (!slot4_in_use)) {
887 slot = 3;
888 child->thread.iac3 = bp_info->addr;
889 child->thread.iac4 = bp_info->addr2;
890 child->thread.dbcr0 |= DBCR0_IAC3;
891 if (bp_info->addr_mode ==
892 PPC_BREAKPOINT_MODE_RANGE_EXCLUSIVE)
893 dbcr_iac_range(child) |= DBCR_IAC34X;
894 else
895 dbcr_iac_range(child) |= DBCR_IAC34I;
896#endif
897 } else
898 return -ENOSPC;
899 } else {
900 /* We only need one. If possible leave a pair free in
901 * case a range is needed later
902 */
903 if (!slot1_in_use) {
904 /*
905 * Don't use iac1 if iac1-iac2 are free and either
906 * iac3 or iac4 (but not both) are free
907 */
908 if (slot2_in_use || (slot3_in_use == slot4_in_use)) {
909 slot = 1;
910 child->thread.iac1 = bp_info->addr;
911 child->thread.dbcr0 |= DBCR0_IAC1;
912 goto out;
913 }
914 }
915 if (!slot2_in_use) {
916 slot = 2;
917 child->thread.iac2 = bp_info->addr;
918 child->thread.dbcr0 |= DBCR0_IAC2;
919#if CONFIG_PPC_ADV_DEBUG_IACS > 2
920 } else if (!slot3_in_use) {
921 slot = 3;
922 child->thread.iac3 = bp_info->addr;
923 child->thread.dbcr0 |= DBCR0_IAC3;
924 } else if (!slot4_in_use) {
925 slot = 4;
926 child->thread.iac4 = bp_info->addr;
927 child->thread.dbcr0 |= DBCR0_IAC4;
928#endif
929 } else
930 return -ENOSPC;
931 }
932out:
933 child->thread.dbcr0 |= DBCR0_IDM;
934 child->thread.regs->msr |= MSR_DE;
935
936 return slot;
937}
938
939static int del_instruction_bp(struct task_struct *child, int slot)
940{
941 switch (slot) {
942 case 1:
943 if (child->thread.iac1 == 0)
944 return -ENOENT;
945
946 if (dbcr_iac_range(child) & DBCR_IAC12MODE) {
947 /* address range - clear slots 1 & 2 */
948 child->thread.iac2 = 0;
949 dbcr_iac_range(child) &= ~DBCR_IAC12MODE;
950 }
951 child->thread.iac1 = 0;
952 child->thread.dbcr0 &= ~DBCR0_IAC1;
953 break;
954 case 2:
955 if (child->thread.iac2 == 0)
956 return -ENOENT;
957
958 if (dbcr_iac_range(child) & DBCR_IAC12MODE)
959 /* used in a range */
960 return -EINVAL;
961 child->thread.iac2 = 0;
962 child->thread.dbcr0 &= ~DBCR0_IAC2;
963 break;
964#if CONFIG_PPC_ADV_DEBUG_IACS > 2
965 case 3:
966 if (child->thread.iac3 == 0)
967 return -ENOENT;
968
969 if (dbcr_iac_range(child) & DBCR_IAC34MODE) {
970 /* address range - clear slots 3 & 4 */
971 child->thread.iac4 = 0;
972 dbcr_iac_range(child) &= ~DBCR_IAC34MODE;
973 }
974 child->thread.iac3 = 0;
975 child->thread.dbcr0 &= ~DBCR0_IAC3;
976 break;
977 case 4:
978 if (child->thread.iac4 == 0)
979 return -ENOENT;
980
981 if (dbcr_iac_range(child) & DBCR_IAC34MODE)
982 /* Used in a range */
983 return -EINVAL;
984 child->thread.iac4 = 0;
985 child->thread.dbcr0 &= ~DBCR0_IAC4;
986 break;
987#endif
988 default:
989 return -EINVAL;
990 }
991 return 0;
992}
993
994static int set_dac(struct task_struct *child, struct ppc_hw_breakpoint *bp_info)
995{
996 int byte_enable =
997 (bp_info->condition_mode >> PPC_BREAKPOINT_CONDITION_BE_SHIFT)
998 & 0xf;
999 int condition_mode =
1000 bp_info->condition_mode & PPC_BREAKPOINT_CONDITION_MODE;
1001 int slot;
1002
1003 if (byte_enable && (condition_mode == 0))
1004 return -EINVAL;
1005
1006 if (bp_info->addr >= TASK_SIZE)
1007 return -EIO;
1008
1009 if ((dbcr_dac(child) & (DBCR_DAC1R | DBCR_DAC1W)) == 0) {
1010 slot = 1;
1011 if (bp_info->trigger_type & PPC_BREAKPOINT_TRIGGER_READ)
1012 dbcr_dac(child) |= DBCR_DAC1R;
1013 if (bp_info->trigger_type & PPC_BREAKPOINT_TRIGGER_WRITE)
1014 dbcr_dac(child) |= DBCR_DAC1W;
1015 child->thread.dac1 = (unsigned long)bp_info->addr;
1016#if CONFIG_PPC_ADV_DEBUG_DVCS > 0
1017 if (byte_enable) {
1018 child->thread.dvc1 =
1019 (unsigned long)bp_info->condition_value;
1020 child->thread.dbcr2 |=
1021 ((byte_enable << DBCR2_DVC1BE_SHIFT) |
1022 (condition_mode << DBCR2_DVC1M_SHIFT));
1023 }
1024#endif
1025#ifdef CONFIG_PPC_ADV_DEBUG_DAC_RANGE
1026 } else if (child->thread.dbcr2 & DBCR2_DAC12MODE) {
1027 /* Both dac1 and dac2 are part of a range */
1028 return -ENOSPC;
1029#endif
1030 } else if ((dbcr_dac(child) & (DBCR_DAC2R | DBCR_DAC2W)) == 0) {
1031 slot = 2;
1032 if (bp_info->trigger_type & PPC_BREAKPOINT_TRIGGER_READ)
1033 dbcr_dac(child) |= DBCR_DAC2R;
1034 if (bp_info->trigger_type & PPC_BREAKPOINT_TRIGGER_WRITE)
1035 dbcr_dac(child) |= DBCR_DAC2W;
1036 child->thread.dac2 = (unsigned long)bp_info->addr;
1037#if CONFIG_PPC_ADV_DEBUG_DVCS > 0
1038 if (byte_enable) {
1039 child->thread.dvc2 =
1040 (unsigned long)bp_info->condition_value;
1041 child->thread.dbcr2 |=
1042 ((byte_enable << DBCR2_DVC2BE_SHIFT) |
1043 (condition_mode << DBCR2_DVC2M_SHIFT));
1044 }
1045#endif
1046 } else
1047 return -ENOSPC;
1048 child->thread.dbcr0 |= DBCR0_IDM;
1049 child->thread.regs->msr |= MSR_DE;
1050
1051 return slot + 4;
1052}
1053
1054static int del_dac(struct task_struct *child, int slot)
1055{
1056 if (slot == 1) {
1057 if (child->thread.dac1 == 0)
1058 return -ENOENT;
1059
1060 child->thread.dac1 = 0;
1061 dbcr_dac(child) &= ~(DBCR_DAC1R | DBCR_DAC1W);
1062#ifdef CONFIG_PPC_ADV_DEBUG_DAC_RANGE
1063 if (child->thread.dbcr2 & DBCR2_DAC12MODE) {
1064 child->thread.dac2 = 0;
1065 child->thread.dbcr2 &= ~DBCR2_DAC12MODE;
1066 }
1067 child->thread.dbcr2 &= ~(DBCR2_DVC1M | DBCR2_DVC1BE);
1068#endif
1069#if CONFIG_PPC_ADV_DEBUG_DVCS > 0
1070 child->thread.dvc1 = 0;
1071#endif
1072 } else if (slot == 2) {
1073 if (child->thread.dac1 == 0)
1074 return -ENOENT;
1075
1076#ifdef CONFIG_PPC_ADV_DEBUG_DAC_RANGE
1077 if (child->thread.dbcr2 & DBCR2_DAC12MODE)
1078 /* Part of a range */
1079 return -EINVAL;
1080 child->thread.dbcr2 &= ~(DBCR2_DVC2M | DBCR2_DVC2BE);
1081#endif
1082#if CONFIG_PPC_ADV_DEBUG_DVCS > 0
1083 child->thread.dvc2 = 0;
1084#endif
1085 child->thread.dac2 = 0;
1086 dbcr_dac(child) &= ~(DBCR_DAC2R | DBCR_DAC2W);
1087 } else
1088 return -EINVAL;
1089
1090 return 0;
1091}
1092#endif /* CONFIG_PPC_ADV_DEBUG_REGS */
1093
1094#ifdef CONFIG_PPC_ADV_DEBUG_DAC_RANGE
1095static int set_dac_range(struct task_struct *child,
1096 struct ppc_hw_breakpoint *bp_info)
1097{
1098 int mode = bp_info->addr_mode & PPC_BREAKPOINT_MODE_MASK;
1099
1100 /* We don't allow range watchpoints to be used with DVC */
1101 if (bp_info->condition_mode)
1102 return -EINVAL;
1103
1104 /*
1105 * Best effort to verify the address range. The user/supervisor bits
1106 * prevent trapping in kernel space, but let's fail on an obvious bad
1107 * range. The simple test on the mask is not fool-proof, and any
1108 * exclusive range will spill over into kernel space.
1109 */
1110 if (bp_info->addr >= TASK_SIZE)
1111 return -EIO;
1112 if (mode == PPC_BREAKPOINT_MODE_MASK) {
1113 /*
1114 * dac2 is a bitmask. Don't allow a mask that makes a
1115 * kernel space address from a valid dac1 value
1116 */
1117 if (~((unsigned long)bp_info->addr2) >= TASK_SIZE)
1118 return -EIO;
1119 } else {
1120 /*
1121 * For range breakpoints, addr2 must also be a valid address
1122 */
1123 if (bp_info->addr2 >= TASK_SIZE)
1124 return -EIO;
1125 }
1126
1127 if (child->thread.dbcr0 &
1128 (DBCR0_DAC1R | DBCR0_DAC1W | DBCR0_DAC2R | DBCR0_DAC2W))
1129 return -ENOSPC;
1130
1131 if (bp_info->trigger_type & PPC_BREAKPOINT_TRIGGER_READ)
1132 child->thread.dbcr0 |= (DBCR0_DAC1R | DBCR0_IDM);
1133 if (bp_info->trigger_type & PPC_BREAKPOINT_TRIGGER_WRITE)
1134 child->thread.dbcr0 |= (DBCR0_DAC1W | DBCR0_IDM);
1135 child->thread.dac1 = bp_info->addr;
1136 child->thread.dac2 = bp_info->addr2;
1137 if (mode == PPC_BREAKPOINT_MODE_RANGE_INCLUSIVE)
1138 child->thread.dbcr2 |= DBCR2_DAC12M;
1139 else if (mode == PPC_BREAKPOINT_MODE_RANGE_EXCLUSIVE)
1140 child->thread.dbcr2 |= DBCR2_DAC12MX;
1141 else /* PPC_BREAKPOINT_MODE_MASK */
1142 child->thread.dbcr2 |= DBCR2_DAC12MM;
1143 child->thread.regs->msr |= MSR_DE;
1144
1145 return 5;
1146}
1147#endif /* CONFIG_PPC_ADV_DEBUG_DAC_RANGE */
1148
1149static long ppc_set_hwdebug(struct task_struct *child,
1150 struct ppc_hw_breakpoint *bp_info)
1151{
1152 if (bp_info->version != 1)
1153 return -ENOTSUPP;
1154#ifdef CONFIG_PPC_ADV_DEBUG_REGS
1155 /*
1156 * Check for invalid flags and combinations
1157 */
1158 if ((bp_info->trigger_type == 0) ||
1159 (bp_info->trigger_type & ~(PPC_BREAKPOINT_TRIGGER_EXECUTE |
1160 PPC_BREAKPOINT_TRIGGER_RW)) ||
1161 (bp_info->addr_mode & ~PPC_BREAKPOINT_MODE_MASK) ||
1162 (bp_info->condition_mode &
1163 ~(PPC_BREAKPOINT_CONDITION_MODE |
1164 PPC_BREAKPOINT_CONDITION_BE_ALL)))
1165 return -EINVAL;
1166#if CONFIG_PPC_ADV_DEBUG_DVCS == 0
1167 if (bp_info->condition_mode != PPC_BREAKPOINT_CONDITION_NONE)
1168 return -EINVAL;
1169#endif
1170
1171 if (bp_info->trigger_type & PPC_BREAKPOINT_TRIGGER_EXECUTE) {
1172 if ((bp_info->trigger_type != PPC_BREAKPOINT_TRIGGER_EXECUTE) ||
1173 (bp_info->condition_mode != PPC_BREAKPOINT_CONDITION_NONE))
1174 return -EINVAL;
1175 return set_intruction_bp(child, bp_info);
1176 }
1177 if (bp_info->addr_mode == PPC_BREAKPOINT_MODE_EXACT)
1178 return set_dac(child, bp_info);
1179
1180#ifdef CONFIG_PPC_ADV_DEBUG_DAC_RANGE
1181 return set_dac_range(child, bp_info);
1182#else
1183 return -EINVAL;
1184#endif
1185#else /* !CONFIG_PPC_ADV_DEBUG_DVCS */
1186 /*
1187 * We only support one data breakpoint
1188 */
1189 if (((bp_info->trigger_type & PPC_BREAKPOINT_TRIGGER_RW) == 0) ||
1190 ((bp_info->trigger_type & ~PPC_BREAKPOINT_TRIGGER_RW) != 0) ||
1191 (bp_info->trigger_type != PPC_BREAKPOINT_TRIGGER_WRITE) ||
1192 (bp_info->addr_mode != PPC_BREAKPOINT_MODE_EXACT) ||
1193 (bp_info->condition_mode != PPC_BREAKPOINT_CONDITION_NONE))
1194 return -EINVAL;
1195
1196 if (child->thread.dabr)
1197 return -ENOSPC;
1198
1199 if ((unsigned long)bp_info->addr >= TASK_SIZE)
1200 return -EIO;
1201
1202 child->thread.dabr = (unsigned long)bp_info->addr;
1203
1204 return 1;
1205#endif /* !CONFIG_PPC_ADV_DEBUG_DVCS */
1206}
1207
1208static long ppc_del_hwdebug(struct task_struct *child, long addr, long data)
1209{
1210#ifdef CONFIG_PPC_ADV_DEBUG_REGS
1211 int rc;
1212
1213 if (data <= 4)
1214 rc = del_instruction_bp(child, (int)data);
1215 else
1216 rc = del_dac(child, (int)data - 4);
1217
1218 if (!rc) {
1219 if (!DBCR_ACTIVE_EVENTS(child->thread.dbcr0,
1220 child->thread.dbcr1)) {
1221 child->thread.dbcr0 &= ~DBCR0_IDM;
1222 child->thread.regs->msr &= ~MSR_DE;
1223 }
1224 }
1225 return rc;
1226#else
1227 if (data != 1)
1228 return -EINVAL;
1229 if (child->thread.dabr == 0)
1230 return -ENOENT;
1231
1232 child->thread.dabr = 0;
1233
1234 return 0;
1235#endif
1236}
1237
842/* 1238/*
843 * Here are the old "legacy" powerpc specific getregs/setregs ptrace calls, 1239 * Here are the old "legacy" powerpc specific getregs/setregs ptrace calls,
844 * we mark them as obsolete now, they will be removed in a future version 1240 * we mark them as obsolete now, they will be removed in a future version
@@ -932,13 +1328,77 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
932 break; 1328 break;
933 } 1329 }
934 1330
1331 case PPC_PTRACE_GETHWDBGINFO: {
1332 struct ppc_debug_info dbginfo;
1333
1334 dbginfo.version = 1;
1335#ifdef CONFIG_PPC_ADV_DEBUG_REGS
1336 dbginfo.num_instruction_bps = CONFIG_PPC_ADV_DEBUG_IACS;
1337 dbginfo.num_data_bps = CONFIG_PPC_ADV_DEBUG_DACS;
1338 dbginfo.num_condition_regs = CONFIG_PPC_ADV_DEBUG_DVCS;
1339 dbginfo.data_bp_alignment = 4;
1340 dbginfo.sizeof_condition = 4;
1341 dbginfo.features = PPC_DEBUG_FEATURE_INSN_BP_RANGE |
1342 PPC_DEBUG_FEATURE_INSN_BP_MASK;
1343#ifdef CONFIG_PPC_ADV_DEBUG_DAC_RANGE
1344 dbginfo.features |=
1345 PPC_DEBUG_FEATURE_DATA_BP_RANGE |
1346 PPC_DEBUG_FEATURE_DATA_BP_MASK;
1347#endif
1348#else /* !CONFIG_PPC_ADV_DEBUG_REGS */
1349 dbginfo.num_instruction_bps = 0;
1350 dbginfo.num_data_bps = 1;
1351 dbginfo.num_condition_regs = 0;
1352#ifdef CONFIG_PPC64
1353 dbginfo.data_bp_alignment = 8;
1354#else
1355 dbginfo.data_bp_alignment = 4;
1356#endif
1357 dbginfo.sizeof_condition = 0;
1358 dbginfo.features = 0;
1359#endif /* CONFIG_PPC_ADV_DEBUG_REGS */
1360
1361 if (!access_ok(VERIFY_WRITE, data,
1362 sizeof(struct ppc_debug_info)))
1363 return -EFAULT;
1364 ret = __copy_to_user((struct ppc_debug_info __user *)data,
1365 &dbginfo, sizeof(struct ppc_debug_info)) ?
1366 -EFAULT : 0;
1367 break;
1368 }
1369
1370 case PPC_PTRACE_SETHWDEBUG: {
1371 struct ppc_hw_breakpoint bp_info;
1372
1373 if (!access_ok(VERIFY_READ, data,
1374 sizeof(struct ppc_hw_breakpoint)))
1375 return -EFAULT;
1376 ret = __copy_from_user(&bp_info,
1377 (struct ppc_hw_breakpoint __user *)data,
1378 sizeof(struct ppc_hw_breakpoint)) ?
1379 -EFAULT : 0;
1380 if (!ret)
1381 ret = ppc_set_hwdebug(child, &bp_info);
1382 break;
1383 }
1384
1385 case PPC_PTRACE_DELHWDEBUG: {
1386 ret = ppc_del_hwdebug(child, addr, data);
1387 break;
1388 }
1389
935 case PTRACE_GET_DEBUGREG: { 1390 case PTRACE_GET_DEBUGREG: {
936 ret = -EINVAL; 1391 ret = -EINVAL;
937 /* We only support one DABR and no IABRS at the moment */ 1392 /* We only support one DABR and no IABRS at the moment */
938 if (addr > 0) 1393 if (addr > 0)
939 break; 1394 break;
1395#ifdef CONFIG_PPC_ADV_DEBUG_REGS
1396 ret = put_user(child->thread.dac1,
1397 (unsigned long __user *)data);
1398#else
940 ret = put_user(child->thread.dabr, 1399 ret = put_user(child->thread.dabr,
941 (unsigned long __user *)data); 1400 (unsigned long __user *)data);
1401#endif
942 break; 1402 break;
943 } 1403 }
944 1404
diff --git a/arch/powerpc/kernel/signal.c b/arch/powerpc/kernel/signal.c
index 00b5078da9a3..a0afb555a7c9 100644
--- a/arch/powerpc/kernel/signal.c
+++ b/arch/powerpc/kernel/signal.c
@@ -140,17 +140,15 @@ static int do_signal_pending(sigset_t *oldset, struct pt_regs *regs)
140 return 0; /* no signals delivered */ 140 return 0; /* no signals delivered */
141 } 141 }
142 142
143#ifndef CONFIG_PPC_ADV_DEBUG_REGS
143 /* 144 /*
144 * Reenable the DABR before delivering the signal to 145 * Reenable the DABR before delivering the signal to
145 * user space. The DABR will have been cleared if it 146 * user space. The DABR will have been cleared if it
146 * triggered inside the kernel. 147 * triggered inside the kernel.
147 */ 148 */
148 if (current->thread.dabr) { 149 if (current->thread.dabr)
149 set_dabr(current->thread.dabr); 150 set_dabr(current->thread.dabr);
150#if defined(CONFIG_BOOKE)
151 mtspr(SPRN_DBCR0, current->thread.dbcr0);
152#endif 151#endif
153 }
154 152
155 if (is32) { 153 if (is32) {
156 if (ka.sa.sa_flags & SA_SIGINFO) 154 if (ka.sa.sa_flags & SA_SIGINFO)
diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c
index d670429a1608..266610119f66 100644
--- a/arch/powerpc/kernel/signal_32.c
+++ b/arch/powerpc/kernel/signal_32.c
@@ -1078,7 +1078,7 @@ int sys_debug_setcontext(struct ucontext __user *ctx,
1078 int i; 1078 int i;
1079 unsigned char tmp; 1079 unsigned char tmp;
1080 unsigned long new_msr = regs->msr; 1080 unsigned long new_msr = regs->msr;
1081#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE) 1081#ifdef CONFIG_PPC_ADV_DEBUG_REGS
1082 unsigned long new_dbcr0 = current->thread.dbcr0; 1082 unsigned long new_dbcr0 = current->thread.dbcr0;
1083#endif 1083#endif
1084 1084
@@ -1087,13 +1087,17 @@ int sys_debug_setcontext(struct ucontext __user *ctx,
1087 return -EFAULT; 1087 return -EFAULT;
1088 switch (op.dbg_type) { 1088 switch (op.dbg_type) {
1089 case SIG_DBG_SINGLE_STEPPING: 1089 case SIG_DBG_SINGLE_STEPPING:
1090#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE) 1090#ifdef CONFIG_PPC_ADV_DEBUG_REGS
1091 if (op.dbg_value) { 1091 if (op.dbg_value) {
1092 new_msr |= MSR_DE; 1092 new_msr |= MSR_DE;
1093 new_dbcr0 |= (DBCR0_IDM | DBCR0_IC); 1093 new_dbcr0 |= (DBCR0_IDM | DBCR0_IC);
1094 } else { 1094 } else {
1095 new_msr &= ~MSR_DE; 1095 new_dbcr0 &= ~DBCR0_IC;
1096 new_dbcr0 &= ~(DBCR0_IDM | DBCR0_IC); 1096 if (!DBCR_ACTIVE_EVENTS(new_dbcr0,
1097 current->thread.dbcr1)) {
1098 new_msr &= ~MSR_DE;
1099 new_dbcr0 &= ~DBCR0_IDM;
1100 }
1097 } 1101 }
1098#else 1102#else
1099 if (op.dbg_value) 1103 if (op.dbg_value)
@@ -1103,7 +1107,7 @@ int sys_debug_setcontext(struct ucontext __user *ctx,
1103#endif 1107#endif
1104 break; 1108 break;
1105 case SIG_DBG_BRANCH_TRACING: 1109 case SIG_DBG_BRANCH_TRACING:
1106#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE) 1110#ifdef CONFIG_PPC_ADV_DEBUG_REGS
1107 return -EINVAL; 1111 return -EINVAL;
1108#else 1112#else
1109 if (op.dbg_value) 1113 if (op.dbg_value)
@@ -1124,7 +1128,7 @@ int sys_debug_setcontext(struct ucontext __user *ctx,
1124 failure is a problem, anyway, and it's very unlikely unless 1128 failure is a problem, anyway, and it's very unlikely unless
1125 the user is really doing something wrong. */ 1129 the user is really doing something wrong. */
1126 regs->msr = new_msr; 1130 regs->msr = new_msr;
1127#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE) 1131#ifdef CONFIG_PPC_ADV_DEBUG_REGS
1128 current->thread.dbcr0 = new_dbcr0; 1132 current->thread.dbcr0 = new_dbcr0;
1129#endif 1133#endif
1130 1134
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index 6c6093d67f30..1b16b9a3e49a 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -265,8 +265,8 @@ void account_system_vtime(struct task_struct *tsk)
265 account_system_time(tsk, 0, delta, deltascaled); 265 account_system_time(tsk, 0, delta, deltascaled);
266 else 266 else
267 account_idle_time(delta); 267 account_idle_time(delta);
268 per_cpu(cputime_last_delta, smp_processor_id()) = delta; 268 __get_cpu_var(cputime_last_delta) = delta;
269 per_cpu(cputime_scaled_last_delta, smp_processor_id()) = deltascaled; 269 __get_cpu_var(cputime_scaled_last_delta) = deltascaled;
270 local_irq_restore(flags); 270 local_irq_restore(flags);
271} 271}
272EXPORT_SYMBOL_GPL(account_system_vtime); 272EXPORT_SYMBOL_GPL(account_system_vtime);
@@ -575,6 +575,8 @@ void timer_interrupt(struct pt_regs * regs)
575 575
576 trace_timer_interrupt_entry(regs); 576 trace_timer_interrupt_entry(regs);
577 577
578 __get_cpu_var(irq_stat).timer_irqs++;
579
578 /* Ensure a positive value is written to the decrementer, or else 580 /* Ensure a positive value is written to the decrementer, or else
579 * some CPUs will continuue to take decrementer exceptions */ 581 * some CPUs will continuue to take decrementer exceptions */
580 set_dec(DECREMENTER_MAX); 582 set_dec(DECREMENTER_MAX);
@@ -935,8 +937,8 @@ static void register_decrementer_clockevent(int cpu)
935 *dec = decrementer_clockevent; 937 *dec = decrementer_clockevent;
936 dec->cpumask = cpumask_of(cpu); 938 dec->cpumask = cpumask_of(cpu);
937 939
938 printk(KERN_DEBUG "clockevent: %s mult[%x] shift[%d] cpu[%d]\n", 940 printk_once(KERN_DEBUG "clockevent: %s mult[%x] shift[%d] cpu[%d]\n",
939 dec->name, dec->mult, dec->shift, cpu); 941 dec->name, dec->mult, dec->shift, cpu);
940 942
941 clockevents_register_device(dec); 943 clockevents_register_device(dec);
942} 944}
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index d069ff8a7e03..696626a2e835 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -60,13 +60,13 @@
60#endif 60#endif
61 61
62#if defined(CONFIG_DEBUGGER) || defined(CONFIG_KEXEC) 62#if defined(CONFIG_DEBUGGER) || defined(CONFIG_KEXEC)
63int (*__debugger)(struct pt_regs *regs); 63int (*__debugger)(struct pt_regs *regs) __read_mostly;
64int (*__debugger_ipi)(struct pt_regs *regs); 64int (*__debugger_ipi)(struct pt_regs *regs) __read_mostly;
65int (*__debugger_bpt)(struct pt_regs *regs); 65int (*__debugger_bpt)(struct pt_regs *regs) __read_mostly;
66int (*__debugger_sstep)(struct pt_regs *regs); 66int (*__debugger_sstep)(struct pt_regs *regs) __read_mostly;
67int (*__debugger_iabr_match)(struct pt_regs *regs); 67int (*__debugger_iabr_match)(struct pt_regs *regs) __read_mostly;
68int (*__debugger_dabr_match)(struct pt_regs *regs); 68int (*__debugger_dabr_match)(struct pt_regs *regs) __read_mostly;
69int (*__debugger_fault_handler)(struct pt_regs *regs); 69int (*__debugger_fault_handler)(struct pt_regs *regs) __read_mostly;
70 70
71EXPORT_SYMBOL(__debugger); 71EXPORT_SYMBOL(__debugger);
72EXPORT_SYMBOL(__debugger_ipi); 72EXPORT_SYMBOL(__debugger_ipi);
@@ -102,11 +102,11 @@ static inline void pmac_backlight_unblank(void) { }
102int die(const char *str, struct pt_regs *regs, long err) 102int die(const char *str, struct pt_regs *regs, long err)
103{ 103{
104 static struct { 104 static struct {
105 spinlock_t lock; 105 raw_spinlock_t lock;
106 u32 lock_owner; 106 u32 lock_owner;
107 int lock_owner_depth; 107 int lock_owner_depth;
108 } die = { 108 } die = {
109 .lock = __SPIN_LOCK_UNLOCKED(die.lock), 109 .lock = __RAW_SPIN_LOCK_UNLOCKED(die.lock),
110 .lock_owner = -1, 110 .lock_owner = -1,
111 .lock_owner_depth = 0 111 .lock_owner_depth = 0
112 }; 112 };
@@ -120,7 +120,7 @@ int die(const char *str, struct pt_regs *regs, long err)
120 120
121 if (die.lock_owner != raw_smp_processor_id()) { 121 if (die.lock_owner != raw_smp_processor_id()) {
122 console_verbose(); 122 console_verbose();
123 spin_lock_irqsave(&die.lock, flags); 123 raw_spin_lock_irqsave(&die.lock, flags);
124 die.lock_owner = smp_processor_id(); 124 die.lock_owner = smp_processor_id();
125 die.lock_owner_depth = 0; 125 die.lock_owner_depth = 0;
126 bust_spinlocks(1); 126 bust_spinlocks(1);
@@ -146,6 +146,11 @@ int die(const char *str, struct pt_regs *regs, long err)
146#endif 146#endif
147 printk("%s\n", ppc_md.name ? ppc_md.name : ""); 147 printk("%s\n", ppc_md.name ? ppc_md.name : "");
148 148
149 sysfs_printk_last_file();
150 if (notify_die(DIE_OOPS, str, regs, err, 255,
151 SIGSEGV) == NOTIFY_STOP)
152 return 1;
153
149 print_modules(); 154 print_modules();
150 show_regs(regs); 155 show_regs(regs);
151 } else { 156 } else {
@@ -155,7 +160,7 @@ int die(const char *str, struct pt_regs *regs, long err)
155 bust_spinlocks(0); 160 bust_spinlocks(0);
156 die.lock_owner = -1; 161 die.lock_owner = -1;
157 add_taint(TAINT_DIE); 162 add_taint(TAINT_DIE);
158 spin_unlock_irqrestore(&die.lock, flags); 163 raw_spin_unlock_irqrestore(&die.lock, flags);
159 164
160 if (kexec_should_crash(current) || 165 if (kexec_should_crash(current) ||
161 kexec_sr_activated(smp_processor_id())) 166 kexec_sr_activated(smp_processor_id()))
@@ -294,7 +299,7 @@ static inline int check_io_access(struct pt_regs *regs)
294 return 0; 299 return 0;
295} 300}
296 301
297#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE) 302#ifdef CONFIG_PPC_ADV_DEBUG_REGS
298/* On 4xx, the reason for the machine check or program exception 303/* On 4xx, the reason for the machine check or program exception
299 is in the ESR. */ 304 is in the ESR. */
300#define get_reason(regs) ((regs)->dsisr) 305#define get_reason(regs) ((regs)->dsisr)
@@ -478,6 +483,8 @@ void machine_check_exception(struct pt_regs *regs)
478{ 483{
479 int recover = 0; 484 int recover = 0;
480 485
486 __get_cpu_var(irq_stat).mce_exceptions++;
487
481 /* See if any machine dependent calls. In theory, we would want 488 /* See if any machine dependent calls. In theory, we would want
482 * to call the CPU first, and call the ppc_md. one if the CPU 489 * to call the CPU first, and call the ppc_md. one if the CPU
483 * one returns a positive number. However there is existing code 490 * one returns a positive number. However there is existing code
@@ -960,6 +967,8 @@ void vsx_unavailable_exception(struct pt_regs *regs)
960 967
961void performance_monitor_exception(struct pt_regs *regs) 968void performance_monitor_exception(struct pt_regs *regs)
962{ 969{
970 __get_cpu_var(irq_stat).pmu_irqs++;
971
963 perf_irq(regs); 972 perf_irq(regs);
964} 973}
965 974
@@ -1024,10 +1033,69 @@ void SoftwareEmulation(struct pt_regs *regs)
1024} 1033}
1025#endif /* CONFIG_8xx */ 1034#endif /* CONFIG_8xx */
1026 1035
1027#if defined(CONFIG_40x) || defined(CONFIG_BOOKE) 1036#ifdef CONFIG_PPC_ADV_DEBUG_REGS
1037static void handle_debug(struct pt_regs *regs, unsigned long debug_status)
1038{
1039 int changed = 0;
1040 /*
1041 * Determine the cause of the debug event, clear the
1042 * event flags and send a trap to the handler. Torez
1043 */
1044 if (debug_status & (DBSR_DAC1R | DBSR_DAC1W)) {
1045 dbcr_dac(current) &= ~(DBCR_DAC1R | DBCR_DAC1W);
1046#ifdef CONFIG_PPC_ADV_DEBUG_DAC_RANGE
1047 current->thread.dbcr2 &= ~DBCR2_DAC12MODE;
1048#endif
1049 do_send_trap(regs, mfspr(SPRN_DAC1), debug_status, TRAP_HWBKPT,
1050 5);
1051 changed |= 0x01;
1052 } else if (debug_status & (DBSR_DAC2R | DBSR_DAC2W)) {
1053 dbcr_dac(current) &= ~(DBCR_DAC2R | DBCR_DAC2W);
1054 do_send_trap(regs, mfspr(SPRN_DAC2), debug_status, TRAP_HWBKPT,
1055 6);
1056 changed |= 0x01;
1057 } else if (debug_status & DBSR_IAC1) {
1058 current->thread.dbcr0 &= ~DBCR0_IAC1;
1059 dbcr_iac_range(current) &= ~DBCR_IAC12MODE;
1060 do_send_trap(regs, mfspr(SPRN_IAC1), debug_status, TRAP_HWBKPT,
1061 1);
1062 changed |= 0x01;
1063 } else if (debug_status & DBSR_IAC2) {
1064 current->thread.dbcr0 &= ~DBCR0_IAC2;
1065 do_send_trap(regs, mfspr(SPRN_IAC2), debug_status, TRAP_HWBKPT,
1066 2);
1067 changed |= 0x01;
1068 } else if (debug_status & DBSR_IAC3) {
1069 current->thread.dbcr0 &= ~DBCR0_IAC3;
1070 dbcr_iac_range(current) &= ~DBCR_IAC34MODE;
1071 do_send_trap(regs, mfspr(SPRN_IAC3), debug_status, TRAP_HWBKPT,
1072 3);
1073 changed |= 0x01;
1074 } else if (debug_status & DBSR_IAC4) {
1075 current->thread.dbcr0 &= ~DBCR0_IAC4;
1076 do_send_trap(regs, mfspr(SPRN_IAC4), debug_status, TRAP_HWBKPT,
1077 4);
1078 changed |= 0x01;
1079 }
1080 /*
1081 * At the point this routine was called, the MSR(DE) was turned off.
1082 * Check all other debug flags and see if that bit needs to be turned
1083 * back on or not.
1084 */
1085 if (DBCR_ACTIVE_EVENTS(current->thread.dbcr0, current->thread.dbcr1))
1086 regs->msr |= MSR_DE;
1087 else
1088 /* Make sure the IDM flag is off */
1089 current->thread.dbcr0 &= ~DBCR0_IDM;
1090
1091 if (changed & 0x01)
1092 mtspr(SPRN_DBCR0, current->thread.dbcr0);
1093}
1028 1094
1029void __kprobes DebugException(struct pt_regs *regs, unsigned long debug_status) 1095void __kprobes DebugException(struct pt_regs *regs, unsigned long debug_status)
1030{ 1096{
1097 current->thread.dbsr = debug_status;
1098
1031 /* Hack alert: On BookE, Branch Taken stops on the branch itself, while 1099 /* Hack alert: On BookE, Branch Taken stops on the branch itself, while
1032 * on server, it stops on the target of the branch. In order to simulate 1100 * on server, it stops on the target of the branch. In order to simulate
1033 * the server behaviour, we thus restart right away with a single step 1101 * the server behaviour, we thus restart right away with a single step
@@ -1071,29 +1139,23 @@ void __kprobes DebugException(struct pt_regs *regs, unsigned long debug_status)
1071 if (debugger_sstep(regs)) 1139 if (debugger_sstep(regs))
1072 return; 1140 return;
1073 1141
1074 if (user_mode(regs))
1075 current->thread.dbcr0 &= ~(DBCR0_IC);
1076
1077 _exception(SIGTRAP, regs, TRAP_TRACE, regs->nip);
1078 } else if (debug_status & (DBSR_DAC1R | DBSR_DAC1W)) {
1079 regs->msr &= ~MSR_DE;
1080
1081 if (user_mode(regs)) { 1142 if (user_mode(regs)) {
1082 current->thread.dbcr0 &= ~(DBSR_DAC1R | DBSR_DAC1W | 1143 current->thread.dbcr0 &= ~DBCR0_IC;
1083 DBCR0_IDM); 1144#ifdef CONFIG_PPC_ADV_DEBUG_REGS
1084 } else { 1145 if (DBCR_ACTIVE_EVENTS(current->thread.dbcr0,
1085 /* Disable DAC interupts */ 1146 current->thread.dbcr1))
1086 mtspr(SPRN_DBCR0, mfspr(SPRN_DBCR0) & ~(DBSR_DAC1R | 1147 regs->msr |= MSR_DE;
1087 DBSR_DAC1W | DBCR0_IDM)); 1148 else
1088 1149 /* Make sure the IDM bit is off */
1089 /* Clear the DAC event */ 1150 current->thread.dbcr0 &= ~DBCR0_IDM;
1090 mtspr(SPRN_DBSR, (DBSR_DAC1R | DBSR_DAC1W)); 1151#endif
1091 } 1152 }
1092 /* Setup and send the trap to the handler */ 1153
1093 do_dabr(regs, mfspr(SPRN_DAC1), debug_status); 1154 _exception(SIGTRAP, regs, TRAP_TRACE, regs->nip);
1094 } 1155 } else
1156 handle_debug(regs, debug_status);
1095} 1157}
1096#endif /* CONFIG_4xx || CONFIG_BOOKE */ 1158#endif /* CONFIG_PPC_ADV_DEBUG_REGS */
1097 1159
1098#if !defined(CONFIG_TAU_INT) 1160#if !defined(CONFIG_TAU_INT)
1099void TAUException(struct pt_regs *regs) 1161void TAUException(struct pt_regs *regs)
diff --git a/arch/powerpc/lib/copypage_64.S b/arch/powerpc/lib/copypage_64.S
index e68beac0a171..4d4eeb900486 100644
--- a/arch/powerpc/lib/copypage_64.S
+++ b/arch/powerpc/lib/copypage_64.S
@@ -43,62 +43,62 @@ END_FTR_SECTION_IFSET(CPU_FTR_CP_USE_DCBTZ)
43 ld r7,16(r4) 43 ld r7,16(r4)
44 ldu r8,24(r4) 44 ldu r8,24(r4)
451: std r5,8(r3) 451: std r5,8(r3)
46 ld r9,8(r4)
47 std r6,16(r3) 46 std r6,16(r3)
47 ld r9,8(r4)
48 ld r10,16(r4) 48 ld r10,16(r4)
49 std r7,24(r3) 49 std r7,24(r3)
50 ld r11,24(r4)
51 std r8,32(r3) 50 std r8,32(r3)
51 ld r11,24(r4)
52 ld r12,32(r4) 52 ld r12,32(r4)
53 std r9,40(r3) 53 std r9,40(r3)
54 ld r5,40(r4)
55 std r10,48(r3) 54 std r10,48(r3)
55 ld r5,40(r4)
56 ld r6,48(r4) 56 ld r6,48(r4)
57 std r11,56(r3) 57 std r11,56(r3)
58 ld r7,56(r4)
59 std r12,64(r3) 58 std r12,64(r3)
59 ld r7,56(r4)
60 ld r8,64(r4) 60 ld r8,64(r4)
61 std r5,72(r3) 61 std r5,72(r3)
62 ld r9,72(r4)
63 std r6,80(r3) 62 std r6,80(r3)
63 ld r9,72(r4)
64 ld r10,80(r4) 64 ld r10,80(r4)
65 std r7,88(r3) 65 std r7,88(r3)
66 ld r11,88(r4)
67 std r8,96(r3) 66 std r8,96(r3)
67 ld r11,88(r4)
68 ld r12,96(r4) 68 ld r12,96(r4)
69 std r9,104(r3) 69 std r9,104(r3)
70 ld r5,104(r4)
71 std r10,112(r3) 70 std r10,112(r3)
71 ld r5,104(r4)
72 ld r6,112(r4) 72 ld r6,112(r4)
73 std r11,120(r3) 73 std r11,120(r3)
74 ld r7,120(r4)
75 stdu r12,128(r3) 74 stdu r12,128(r3)
75 ld r7,120(r4)
76 ldu r8,128(r4) 76 ldu r8,128(r4)
77 bdnz 1b 77 bdnz 1b
78 78
79 std r5,8(r3) 79 std r5,8(r3)
80 ld r9,8(r4)
81 std r6,16(r3) 80 std r6,16(r3)
81 ld r9,8(r4)
82 ld r10,16(r4) 82 ld r10,16(r4)
83 std r7,24(r3) 83 std r7,24(r3)
84 ld r11,24(r4)
85 std r8,32(r3) 84 std r8,32(r3)
85 ld r11,24(r4)
86 ld r12,32(r4) 86 ld r12,32(r4)
87 std r9,40(r3) 87 std r9,40(r3)
88 ld r5,40(r4)
89 std r10,48(r3) 88 std r10,48(r3)
89 ld r5,40(r4)
90 ld r6,48(r4) 90 ld r6,48(r4)
91 std r11,56(r3) 91 std r11,56(r3)
92 ld r7,56(r4)
93 std r12,64(r3) 92 std r12,64(r3)
93 ld r7,56(r4)
94 ld r8,64(r4) 94 ld r8,64(r4)
95 std r5,72(r3) 95 std r5,72(r3)
96 ld r9,72(r4)
97 std r6,80(r3) 96 std r6,80(r3)
97 ld r9,72(r4)
98 ld r10,80(r4) 98 ld r10,80(r4)
99 std r7,88(r3) 99 std r7,88(r3)
100 ld r11,88(r4)
101 std r8,96(r3) 100 std r8,96(r3)
101 ld r11,88(r4)
102 ld r12,96(r4) 102 ld r12,96(r4)
103 std r9,104(r3) 103 std r9,104(r3)
104 std r10,112(r3) 104 std r10,112(r3)
diff --git a/arch/powerpc/lib/copyuser_64.S b/arch/powerpc/lib/copyuser_64.S
index 693b14a778fa..578b625d6a3c 100644
--- a/arch/powerpc/lib/copyuser_64.S
+++ b/arch/powerpc/lib/copyuser_64.S
@@ -44,37 +44,55 @@ BEGIN_FTR_SECTION
44 andi. r0,r4,7 44 andi. r0,r4,7
45 bne .Lsrc_unaligned 45 bne .Lsrc_unaligned
46END_FTR_SECTION_IFCLR(CPU_FTR_UNALIGNED_LD_STD) 46END_FTR_SECTION_IFCLR(CPU_FTR_UNALIGNED_LD_STD)
47 srdi r7,r5,4 47 blt cr1,.Ldo_tail /* if < 16 bytes to copy */
4820: ld r9,0(r4) 48 srdi r0,r5,5
49 addi r4,r4,-8 49 cmpdi cr1,r0,0
50 mtctr r7 5020: ld r7,0(r4)
51 andi. r5,r5,7 51220: ld r6,8(r4)
52 bf cr7*4+0,22f 52 addi r4,r4,16
53 addi r3,r3,8 53 mtctr r0
54 addi r4,r4,8 54 andi. r0,r5,0x10
55 mr r8,r9 55 beq 22f
56 blt cr1,72f 56 addi r3,r3,16
5721: ld r9,8(r4) 57 addi r4,r4,-16
5870: std r8,8(r3) 58 mr r9,r7
5922: ldu r8,16(r4) 59 mr r8,r6
6071: stdu r9,16(r3) 60 beq cr1,72f
6121: ld r7,16(r4)
62221: ld r6,24(r4)
63 addi r4,r4,32
6470: std r9,0(r3)
65270: std r8,8(r3)
6622: ld r9,0(r4)
67222: ld r8,8(r4)
6871: std r7,16(r3)
69271: std r6,24(r3)
70 addi r3,r3,32
61 bdnz 21b 71 bdnz 21b
6272: std r8,8(r3) 7272: std r9,0(r3)
73272: std r8,8(r3)
74 andi. r5,r5,0xf
63 beq+ 3f 75 beq+ 3f
64 addi r3,r3,16 76 addi r4,r4,16
65.Ldo_tail: 77.Ldo_tail:
66 bf cr7*4+1,1f 78 addi r3,r3,16
6723: lwz r9,8(r4) 79 bf cr7*4+0,246f
80244: ld r9,0(r4)
81 addi r4,r4,8
82245: std r9,0(r3)
83 addi r3,r3,8
84246: bf cr7*4+1,1f
8523: lwz r9,0(r4)
68 addi r4,r4,4 86 addi r4,r4,4
6973: stw r9,0(r3) 8773: stw r9,0(r3)
70 addi r3,r3,4 88 addi r3,r3,4
711: bf cr7*4+2,2f 891: bf cr7*4+2,2f
7244: lhz r9,8(r4) 9044: lhz r9,0(r4)
73 addi r4,r4,2 91 addi r4,r4,2
7474: sth r9,0(r3) 9274: sth r9,0(r3)
75 addi r3,r3,2 93 addi r3,r3,2
762: bf cr7*4+3,3f 942: bf cr7*4+3,3f
7745: lbz r9,8(r4) 9545: lbz r9,0(r4)
7875: stb r9,0(r3) 9675: stb r9,0(r3)
793: li r3,0 973: li r3,0
80 blr 98 blr
@@ -220,7 +238,9 @@ END_FTR_SECTION_IFCLR(CPU_FTR_UNALIGNED_LD_STD)
220131: 238131:
221 addi r3,r3,8 239 addi r3,r3,8
222120: 240120:
241320:
223122: 242122:
243322:
224124: 244124:
225125: 245125:
226126: 246126:
@@ -229,9 +249,11 @@ END_FTR_SECTION_IFCLR(CPU_FTR_UNALIGNED_LD_STD)
229129: 249129:
230133: 250133:
231 addi r3,r3,8 251 addi r3,r3,8
232121:
233132: 252132:
234 addi r3,r3,8 253 addi r3,r3,8
254121:
255321:
256344:
235134: 257134:
236135: 258135:
237138: 259138:
@@ -303,18 +325,22 @@ END_FTR_SECTION_IFCLR(CPU_FTR_UNALIGNED_LD_STD)
303183: 325183:
304 add r3,r3,r7 326 add r3,r3,r7
305 b 1f 327 b 1f
328371:
306180: 329180:
307 addi r3,r3,8 330 addi r3,r3,8
308171: 331171:
309177: 332177:
310 addi r3,r3,8 333 addi r3,r3,8
311170: 334370:
312172: 335372:
313176: 336176:
314178: 337178:
315 addi r3,r3,4 338 addi r3,r3,4
316185: 339185:
317 addi r3,r3,4 340 addi r3,r3,4
341170:
342172:
343345:
318173: 344173:
319174: 345174:
320175: 346175:
@@ -341,11 +367,19 @@ END_FTR_SECTION_IFCLR(CPU_FTR_UNALIGNED_LD_STD)
341 .section __ex_table,"a" 367 .section __ex_table,"a"
342 .align 3 368 .align 3
343 .llong 20b,120b 369 .llong 20b,120b
370 .llong 220b,320b
344 .llong 21b,121b 371 .llong 21b,121b
372 .llong 221b,321b
345 .llong 70b,170b 373 .llong 70b,170b
374 .llong 270b,370b
346 .llong 22b,122b 375 .llong 22b,122b
376 .llong 222b,322b
347 .llong 71b,171b 377 .llong 71b,171b
378 .llong 271b,371b
348 .llong 72b,172b 379 .llong 72b,172b
380 .llong 272b,372b
381 .llong 244b,344b
382 .llong 245b,345b
349 .llong 23b,123b 383 .llong 23b,123b
350 .llong 73b,173b 384 .llong 73b,173b
351 .llong 44b,144b 385 .llong 44b,144b
diff --git a/arch/powerpc/lib/feature-fixups.c b/arch/powerpc/lib/feature-fixups.c
index 7e8865bcd683..e640175b65ae 100644
--- a/arch/powerpc/lib/feature-fixups.c
+++ b/arch/powerpc/lib/feature-fixups.c
@@ -112,7 +112,8 @@ void do_feature_fixups(unsigned long value, void *fixup_start, void *fixup_end)
112 112
113void do_lwsync_fixups(unsigned long value, void *fixup_start, void *fixup_end) 113void do_lwsync_fixups(unsigned long value, void *fixup_start, void *fixup_end)
114{ 114{
115 unsigned int *start, *end, *dest; 115 long *start, *end;
116 unsigned int *dest;
116 117
117 if (!(value & CPU_FTR_LWSYNC)) 118 if (!(value & CPU_FTR_LWSYNC))
118 return ; 119 return ;
diff --git a/arch/powerpc/mm/40x_mmu.c b/arch/powerpc/mm/40x_mmu.c
index 08dfa8e6d86f..65abfcfaaa9e 100644
--- a/arch/powerpc/mm/40x_mmu.c
+++ b/arch/powerpc/mm/40x_mmu.c
@@ -84,8 +84,8 @@ void __init MMU_init_hw(void)
84 * vectors and the kernel live in real-mode. 84 * vectors and the kernel live in real-mode.
85 */ 85 */
86 86
87 mtspr(SPRN_DCCR, 0xF0000000); /* 512 MB of data space at 0x0. */ 87 mtspr(SPRN_DCCR, 0xFFFF0000); /* 2GByte of data space at 0x0. */
88 mtspr(SPRN_ICCR, 0xF0000000); /* 512 MB of instr. space at 0x0. */ 88 mtspr(SPRN_ICCR, 0xFFFF0000); /* 2GByte of instr. space at 0x0. */
89} 89}
90 90
91#define LARGE_PAGE_SIZE_16M (1<<24) 91#define LARGE_PAGE_SIZE_16M (1<<24)
diff --git a/arch/powerpc/mm/hash_native_64.c b/arch/powerpc/mm/hash_native_64.c
index 056d23a1b105..784a400e0781 100644
--- a/arch/powerpc/mm/hash_native_64.c
+++ b/arch/powerpc/mm/hash_native_64.c
@@ -37,7 +37,7 @@
37 37
38#define HPTE_LOCK_BIT 3 38#define HPTE_LOCK_BIT 3
39 39
40static DEFINE_SPINLOCK(native_tlbie_lock); 40static DEFINE_RAW_SPINLOCK(native_tlbie_lock);
41 41
42static inline void __tlbie(unsigned long va, int psize, int ssize) 42static inline void __tlbie(unsigned long va, int psize, int ssize)
43{ 43{
@@ -104,7 +104,7 @@ static inline void tlbie(unsigned long va, int psize, int ssize, int local)
104 if (use_local) 104 if (use_local)
105 use_local = mmu_psize_defs[psize].tlbiel; 105 use_local = mmu_psize_defs[psize].tlbiel;
106 if (lock_tlbie && !use_local) 106 if (lock_tlbie && !use_local)
107 spin_lock(&native_tlbie_lock); 107 raw_spin_lock(&native_tlbie_lock);
108 asm volatile("ptesync": : :"memory"); 108 asm volatile("ptesync": : :"memory");
109 if (use_local) { 109 if (use_local) {
110 __tlbiel(va, psize, ssize); 110 __tlbiel(va, psize, ssize);
@@ -114,7 +114,7 @@ static inline void tlbie(unsigned long va, int psize, int ssize, int local)
114 asm volatile("eieio; tlbsync; ptesync": : :"memory"); 114 asm volatile("eieio; tlbsync; ptesync": : :"memory");
115 } 115 }
116 if (lock_tlbie && !use_local) 116 if (lock_tlbie && !use_local)
117 spin_unlock(&native_tlbie_lock); 117 raw_spin_unlock(&native_tlbie_lock);
118} 118}
119 119
120static inline void native_lock_hpte(struct hash_pte *hptep) 120static inline void native_lock_hpte(struct hash_pte *hptep)
@@ -122,7 +122,7 @@ static inline void native_lock_hpte(struct hash_pte *hptep)
122 unsigned long *word = &hptep->v; 122 unsigned long *word = &hptep->v;
123 123
124 while (1) { 124 while (1) {
125 if (!test_and_set_bit(HPTE_LOCK_BIT, word)) 125 if (!test_and_set_bit_lock(HPTE_LOCK_BIT, word))
126 break; 126 break;
127 while(test_bit(HPTE_LOCK_BIT, word)) 127 while(test_bit(HPTE_LOCK_BIT, word))
128 cpu_relax(); 128 cpu_relax();
@@ -133,8 +133,7 @@ static inline void native_unlock_hpte(struct hash_pte *hptep)
133{ 133{
134 unsigned long *word = &hptep->v; 134 unsigned long *word = &hptep->v;
135 135
136 asm volatile("lwsync":::"memory"); 136 clear_bit_unlock(HPTE_LOCK_BIT, word);
137 clear_bit(HPTE_LOCK_BIT, word);
138} 137}
139 138
140static long native_hpte_insert(unsigned long hpte_group, unsigned long va, 139static long native_hpte_insert(unsigned long hpte_group, unsigned long va,
@@ -434,7 +433,7 @@ static void native_hpte_clear(void)
434 /* we take the tlbie lock and hold it. Some hardware will 433 /* we take the tlbie lock and hold it. Some hardware will
435 * deadlock if we try to tlbie from two processors at once. 434 * deadlock if we try to tlbie from two processors at once.
436 */ 435 */
437 spin_lock(&native_tlbie_lock); 436 raw_spin_lock(&native_tlbie_lock);
438 437
439 slots = pteg_count * HPTES_PER_GROUP; 438 slots = pteg_count * HPTES_PER_GROUP;
440 439
@@ -458,7 +457,7 @@ static void native_hpte_clear(void)
458 } 457 }
459 458
460 asm volatile("eieio; tlbsync; ptesync":::"memory"); 459 asm volatile("eieio; tlbsync; ptesync":::"memory");
461 spin_unlock(&native_tlbie_lock); 460 raw_spin_unlock(&native_tlbie_lock);
462 local_irq_restore(flags); 461 local_irq_restore(flags);
463} 462}
464 463
@@ -521,7 +520,7 @@ static void native_flush_hash_range(unsigned long number, int local)
521 int lock_tlbie = !cpu_has_feature(CPU_FTR_LOCKLESS_TLBIE); 520 int lock_tlbie = !cpu_has_feature(CPU_FTR_LOCKLESS_TLBIE);
522 521
523 if (lock_tlbie) 522 if (lock_tlbie)
524 spin_lock(&native_tlbie_lock); 523 raw_spin_lock(&native_tlbie_lock);
525 524
526 asm volatile("ptesync":::"memory"); 525 asm volatile("ptesync":::"memory");
527 for (i = 0; i < number; i++) { 526 for (i = 0; i < number; i++) {
@@ -536,7 +535,7 @@ static void native_flush_hash_range(unsigned long number, int local)
536 asm volatile("eieio; tlbsync; ptesync":::"memory"); 535 asm volatile("eieio; tlbsync; ptesync":::"memory");
537 536
538 if (lock_tlbie) 537 if (lock_tlbie)
539 spin_unlock(&native_tlbie_lock); 538 raw_spin_unlock(&native_tlbie_lock);
540 } 539 }
541 540
542 local_irq_restore(flags); 541 local_irq_restore(flags);
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
index b9b152558f9c..311224cdb7ad 100644
--- a/arch/powerpc/mm/mem.c
+++ b/arch/powerpc/mm/mem.c
@@ -494,13 +494,13 @@ EXPORT_SYMBOL(flush_icache_user_range);
494 * This must always be called with the pte lock held. 494 * This must always be called with the pte lock held.
495 */ 495 */
496void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, 496void update_mmu_cache(struct vm_area_struct *vma, unsigned long address,
497 pte_t pte) 497 pte_t *ptep)
498{ 498{
499#ifdef CONFIG_PPC_STD_MMU 499#ifdef CONFIG_PPC_STD_MMU
500 unsigned long access = 0, trap; 500 unsigned long access = 0, trap;
501 501
502 /* We only want HPTEs for linux PTEs that have _PAGE_ACCESSED set */ 502 /* We only want HPTEs for linux PTEs that have _PAGE_ACCESSED set */
503 if (!pte_young(pte) || address >= TASK_SIZE) 503 if (!pte_young(*ptep) || address >= TASK_SIZE)
504 return; 504 return;
505 505
506 /* We try to figure out if we are coming from an instruction 506 /* We try to figure out if we are coming from an instruction
diff --git a/arch/powerpc/mm/mmu_context_hash64.c b/arch/powerpc/mm/mmu_context_hash64.c
index b910d37aea1a..51622daae09d 100644
--- a/arch/powerpc/mm/mmu_context_hash64.c
+++ b/arch/powerpc/mm/mmu_context_hash64.c
@@ -23,7 +23,7 @@
23#include <asm/mmu_context.h> 23#include <asm/mmu_context.h>
24 24
25static DEFINE_SPINLOCK(mmu_context_lock); 25static DEFINE_SPINLOCK(mmu_context_lock);
26static DEFINE_IDR(mmu_context_idr); 26static DEFINE_IDA(mmu_context_ida);
27 27
28/* 28/*
29 * The proto-VSID space has 2^35 - 1 segments available for user mappings. 29 * The proto-VSID space has 2^35 - 1 segments available for user mappings.
@@ -39,11 +39,11 @@ int __init_new_context(void)
39 int err; 39 int err;
40 40
41again: 41again:
42 if (!idr_pre_get(&mmu_context_idr, GFP_KERNEL)) 42 if (!ida_pre_get(&mmu_context_ida, GFP_KERNEL))
43 return -ENOMEM; 43 return -ENOMEM;
44 44
45 spin_lock(&mmu_context_lock); 45 spin_lock(&mmu_context_lock);
46 err = idr_get_new_above(&mmu_context_idr, NULL, 1, &index); 46 err = ida_get_new_above(&mmu_context_ida, 1, &index);
47 spin_unlock(&mmu_context_lock); 47 spin_unlock(&mmu_context_lock);
48 48
49 if (err == -EAGAIN) 49 if (err == -EAGAIN)
@@ -53,7 +53,7 @@ again:
53 53
54 if (index > MAX_CONTEXT) { 54 if (index > MAX_CONTEXT) {
55 spin_lock(&mmu_context_lock); 55 spin_lock(&mmu_context_lock);
56 idr_remove(&mmu_context_idr, index); 56 ida_remove(&mmu_context_ida, index);
57 spin_unlock(&mmu_context_lock); 57 spin_unlock(&mmu_context_lock);
58 return -ENOMEM; 58 return -ENOMEM;
59 } 59 }
@@ -85,7 +85,7 @@ int init_new_context(struct task_struct *tsk, struct mm_struct *mm)
85void __destroy_context(int context_id) 85void __destroy_context(int context_id)
86{ 86{
87 spin_lock(&mmu_context_lock); 87 spin_lock(&mmu_context_lock);
88 idr_remove(&mmu_context_idr, context_id); 88 ida_remove(&mmu_context_ida, context_id);
89 spin_unlock(&mmu_context_lock); 89 spin_unlock(&mmu_context_lock);
90} 90}
91EXPORT_SYMBOL_GPL(__destroy_context); 91EXPORT_SYMBOL_GPL(__destroy_context);
diff --git a/arch/powerpc/mm/mmu_context_nohash.c b/arch/powerpc/mm/mmu_context_nohash.c
index 1044a634b6d0..dbc692145ecb 100644
--- a/arch/powerpc/mm/mmu_context_nohash.c
+++ b/arch/powerpc/mm/mmu_context_nohash.c
@@ -56,7 +56,7 @@ static unsigned int next_context, nr_free_contexts;
56static unsigned long *context_map; 56static unsigned long *context_map;
57static unsigned long *stale_map[NR_CPUS]; 57static unsigned long *stale_map[NR_CPUS];
58static struct mm_struct **context_mm; 58static struct mm_struct **context_mm;
59static DEFINE_SPINLOCK(context_lock); 59static DEFINE_RAW_SPINLOCK(context_lock);
60 60
61#define CTX_MAP_SIZE \ 61#define CTX_MAP_SIZE \
62 (sizeof(unsigned long) * (last_context / BITS_PER_LONG + 1)) 62 (sizeof(unsigned long) * (last_context / BITS_PER_LONG + 1))
@@ -121,9 +121,9 @@ static unsigned int steal_context_smp(unsigned int id)
121 /* This will happen if you have more CPUs than available contexts, 121 /* This will happen if you have more CPUs than available contexts,
122 * all we can do here is wait a bit and try again 122 * all we can do here is wait a bit and try again
123 */ 123 */
124 spin_unlock(&context_lock); 124 raw_spin_unlock(&context_lock);
125 cpu_relax(); 125 cpu_relax();
126 spin_lock(&context_lock); 126 raw_spin_lock(&context_lock);
127 127
128 /* This will cause the caller to try again */ 128 /* This will cause the caller to try again */
129 return MMU_NO_CONTEXT; 129 return MMU_NO_CONTEXT;
@@ -194,7 +194,7 @@ void switch_mmu_context(struct mm_struct *prev, struct mm_struct *next)
194 unsigned long *map; 194 unsigned long *map;
195 195
196 /* No lockless fast path .. yet */ 196 /* No lockless fast path .. yet */
197 spin_lock(&context_lock); 197 raw_spin_lock(&context_lock);
198 198
199 pr_hard("[%d] activating context for mm @%p, active=%d, id=%d", 199 pr_hard("[%d] activating context for mm @%p, active=%d, id=%d",
200 cpu, next, next->context.active, next->context.id); 200 cpu, next, next->context.active, next->context.id);
@@ -278,7 +278,7 @@ void switch_mmu_context(struct mm_struct *prev, struct mm_struct *next)
278 /* Flick the MMU and release lock */ 278 /* Flick the MMU and release lock */
279 pr_hardcont(" -> %d\n", id); 279 pr_hardcont(" -> %d\n", id);
280 set_context(id, next->pgd); 280 set_context(id, next->pgd);
281 spin_unlock(&context_lock); 281 raw_spin_unlock(&context_lock);
282} 282}
283 283
284/* 284/*
@@ -307,7 +307,7 @@ void destroy_context(struct mm_struct *mm)
307 307
308 WARN_ON(mm->context.active != 0); 308 WARN_ON(mm->context.active != 0);
309 309
310 spin_lock_irqsave(&context_lock, flags); 310 raw_spin_lock_irqsave(&context_lock, flags);
311 id = mm->context.id; 311 id = mm->context.id;
312 if (id != MMU_NO_CONTEXT) { 312 if (id != MMU_NO_CONTEXT) {
313 __clear_bit(id, context_map); 313 __clear_bit(id, context_map);
@@ -318,7 +318,7 @@ void destroy_context(struct mm_struct *mm)
318 context_mm[id] = NULL; 318 context_mm[id] = NULL;
319 nr_free_contexts++; 319 nr_free_contexts++;
320 } 320 }
321 spin_unlock_irqrestore(&context_lock, flags); 321 raw_spin_unlock_irqrestore(&context_lock, flags);
322} 322}
323 323
324#ifdef CONFIG_SMP 324#ifdef CONFIG_SMP
diff --git a/arch/powerpc/mm/tlb_low_64e.S b/arch/powerpc/mm/tlb_low_64e.S
index f288279e679d..8b04c54e596f 100644
--- a/arch/powerpc/mm/tlb_low_64e.S
+++ b/arch/powerpc/mm/tlb_low_64e.S
@@ -1,5 +1,5 @@
1/* 1/*
2 * Low leve TLB miss handlers for Book3E 2 * Low level TLB miss handlers for Book3E
3 * 3 *
4 * Copyright (C) 2008-2009 4 * Copyright (C) 2008-2009
5 * Ben. Herrenschmidt (benh@kernel.crashing.org), IBM Corp. 5 * Ben. Herrenschmidt (benh@kernel.crashing.org), IBM Corp.
diff --git a/arch/powerpc/mm/tlb_nohash.c b/arch/powerpc/mm/tlb_nohash.c
index 2fbc680c2c71..e81d5d67f834 100644
--- a/arch/powerpc/mm/tlb_nohash.c
+++ b/arch/powerpc/mm/tlb_nohash.c
@@ -150,7 +150,7 @@ EXPORT_SYMBOL(local_flush_tlb_page);
150 */ 150 */
151#ifdef CONFIG_SMP 151#ifdef CONFIG_SMP
152 152
153static DEFINE_SPINLOCK(tlbivax_lock); 153static DEFINE_RAW_SPINLOCK(tlbivax_lock);
154 154
155static int mm_is_core_local(struct mm_struct *mm) 155static int mm_is_core_local(struct mm_struct *mm)
156{ 156{
@@ -232,10 +232,10 @@ void __flush_tlb_page(struct mm_struct *mm, unsigned long vmaddr,
232 if (mmu_has_feature(MMU_FTR_USE_TLBIVAX_BCAST)) { 232 if (mmu_has_feature(MMU_FTR_USE_TLBIVAX_BCAST)) {
233 int lock = mmu_has_feature(MMU_FTR_LOCK_BCAST_INVAL); 233 int lock = mmu_has_feature(MMU_FTR_LOCK_BCAST_INVAL);
234 if (lock) 234 if (lock)
235 spin_lock(&tlbivax_lock); 235 raw_spin_lock(&tlbivax_lock);
236 _tlbivax_bcast(vmaddr, pid, tsize, ind); 236 _tlbivax_bcast(vmaddr, pid, tsize, ind);
237 if (lock) 237 if (lock)
238 spin_unlock(&tlbivax_lock); 238 raw_spin_unlock(&tlbivax_lock);
239 goto bail; 239 goto bail;
240 } else { 240 } else {
241 struct tlb_flush_param p = { 241 struct tlb_flush_param p = {
diff --git a/arch/powerpc/platforms/512x/clock.c b/arch/powerpc/platforms/512x/clock.c
index 84544d072043..4c42246b86a7 100644
--- a/arch/powerpc/platforms/512x/clock.c
+++ b/arch/powerpc/platforms/512x/clock.c
@@ -698,8 +698,7 @@ static struct clk_interface mpc5121_clk_functions = {
698 .clk_get_parent = NULL, 698 .clk_get_parent = NULL,
699}; 699};
700 700
701static int 701int __init mpc5121_clk_init(void)
702mpc5121_clk_init(void)
703{ 702{
704 struct device_node *np; 703 struct device_node *np;
705 704
@@ -724,6 +723,3 @@ mpc5121_clk_init(void)
724 clk_functions = mpc5121_clk_functions; 723 clk_functions = mpc5121_clk_functions;
725 return 0; 724 return 0;
726} 725}
727
728
729arch_initcall(mpc5121_clk_init);
diff --git a/arch/powerpc/platforms/512x/mpc5121_ads.c b/arch/powerpc/platforms/512x/mpc5121_ads.c
index 441abc488851..ee6ae129c25c 100644
--- a/arch/powerpc/platforms/512x/mpc5121_ads.c
+++ b/arch/powerpc/platforms/512x/mpc5121_ads.c
@@ -64,8 +64,9 @@ define_machine(mpc5121_ads) {
64 .name = "MPC5121 ADS", 64 .name = "MPC5121 ADS",
65 .probe = mpc5121_ads_probe, 65 .probe = mpc5121_ads_probe,
66 .setup_arch = mpc5121_ads_setup_arch, 66 .setup_arch = mpc5121_ads_setup_arch,
67 .init = mpc512x_declare_of_platform_devices, 67 .init = mpc512x_init,
68 .init_IRQ = mpc5121_ads_init_IRQ, 68 .init_IRQ = mpc5121_ads_init_IRQ,
69 .get_irq = ipic_get_irq, 69 .get_irq = ipic_get_irq,
70 .calibrate_decr = generic_calibrate_decr, 70 .calibrate_decr = generic_calibrate_decr,
71 .restart = mpc512x_restart,
71}; 72};
diff --git a/arch/powerpc/platforms/512x/mpc5121_ads_cpld.c b/arch/powerpc/platforms/512x/mpc5121_ads_cpld.c
index da9b20a63769..4ecf4cf9a51b 100644
--- a/arch/powerpc/platforms/512x/mpc5121_ads_cpld.c
+++ b/arch/powerpc/platforms/512x/mpc5121_ads_cpld.c
@@ -79,7 +79,7 @@ cpld_unmask_irq(unsigned int irq)
79} 79}
80 80
81static struct irq_chip cpld_pic = { 81static struct irq_chip cpld_pic = {
82 .name = " CPLD PIC ", 82 .name = "CPLD PIC",
83 .mask = cpld_mask_irq, 83 .mask = cpld_mask_irq,
84 .ack = cpld_mask_irq, 84 .ack = cpld_mask_irq,
85 .unmask = cpld_unmask_irq, 85 .unmask = cpld_unmask_irq,
diff --git a/arch/powerpc/platforms/512x/mpc5121_generic.c b/arch/powerpc/platforms/512x/mpc5121_generic.c
index 2479de9e2d12..a6c0e3a2615d 100644
--- a/arch/powerpc/platforms/512x/mpc5121_generic.c
+++ b/arch/powerpc/platforms/512x/mpc5121_generic.c
@@ -51,8 +51,9 @@ static int __init mpc5121_generic_probe(void)
51define_machine(mpc5121_generic) { 51define_machine(mpc5121_generic) {
52 .name = "MPC5121 generic", 52 .name = "MPC5121 generic",
53 .probe = mpc5121_generic_probe, 53 .probe = mpc5121_generic_probe,
54 .init = mpc512x_declare_of_platform_devices, 54 .init = mpc512x_init,
55 .init_IRQ = mpc512x_init_IRQ, 55 .init_IRQ = mpc512x_init_IRQ,
56 .get_irq = ipic_get_irq, 56 .get_irq = ipic_get_irq,
57 .calibrate_decr = generic_calibrate_decr, 57 .calibrate_decr = generic_calibrate_decr,
58 .restart = mpc512x_restart,
58}; 59};
diff --git a/arch/powerpc/platforms/512x/mpc512x.h b/arch/powerpc/platforms/512x/mpc512x.h
index 22a5352407e0..b2daca0d1488 100644
--- a/arch/powerpc/platforms/512x/mpc512x.h
+++ b/arch/powerpc/platforms/512x/mpc512x.h
@@ -12,5 +12,8 @@
12#ifndef __MPC512X_H__ 12#ifndef __MPC512X_H__
13#define __MPC512X_H__ 13#define __MPC512X_H__
14extern void __init mpc512x_init_IRQ(void); 14extern void __init mpc512x_init_IRQ(void);
15extern void __init mpc512x_init(void);
16extern int __init mpc5121_clk_init(void);
15void __init mpc512x_declare_of_platform_devices(void); 17void __init mpc512x_declare_of_platform_devices(void);
18extern void mpc512x_restart(char *cmd);
16#endif /* __MPC512X_H__ */ 19#endif /* __MPC512X_H__ */
diff --git a/arch/powerpc/platforms/512x/mpc512x_shared.c b/arch/powerpc/platforms/512x/mpc512x_shared.c
index 434d683df5a0..b7f518a60f03 100644
--- a/arch/powerpc/platforms/512x/mpc512x_shared.c
+++ b/arch/powerpc/platforms/512x/mpc512x_shared.c
@@ -21,9 +21,38 @@
21#include <asm/ipic.h> 21#include <asm/ipic.h>
22#include <asm/prom.h> 22#include <asm/prom.h>
23#include <asm/time.h> 23#include <asm/time.h>
24#include <asm/mpc5121.h>
24 25
25#include "mpc512x.h" 26#include "mpc512x.h"
26 27
28static struct mpc512x_reset_module __iomem *reset_module_base;
29
30static void __init mpc512x_restart_init(void)
31{
32 struct device_node *np;
33
34 np = of_find_compatible_node(NULL, NULL, "fsl,mpc5121-reset");
35 if (!np)
36 return;
37
38 reset_module_base = of_iomap(np, 0);
39 of_node_put(np);
40}
41
42void mpc512x_restart(char *cmd)
43{
44 if (reset_module_base) {
45 /* Enable software reset "RSTE" */
46 out_be32(&reset_module_base->rpr, 0x52535445);
47 /* Set software hard reset */
48 out_be32(&reset_module_base->rcr, 0x2);
49 } else {
50 pr_err("Restart module not mapped.\n");
51 }
52 for (;;)
53 ;
54}
55
27void __init mpc512x_init_IRQ(void) 56void __init mpc512x_init_IRQ(void)
28{ 57{
29 struct device_node *np; 58 struct device_node *np;
@@ -53,8 +82,22 @@ static struct of_device_id __initdata of_bus_ids[] = {
53 82
54void __init mpc512x_declare_of_platform_devices(void) 83void __init mpc512x_declare_of_platform_devices(void)
55{ 84{
85 struct device_node *np;
86
56 if (of_platform_bus_probe(NULL, of_bus_ids, NULL)) 87 if (of_platform_bus_probe(NULL, of_bus_ids, NULL))
57 printk(KERN_ERR __FILE__ ": " 88 printk(KERN_ERR __FILE__ ": "
58 "Error while probing of_platform bus\n"); 89 "Error while probing of_platform bus\n");
90
91 np = of_find_compatible_node(NULL, NULL, "fsl,mpc5121-nfc");
92 if (np) {
93 of_platform_device_create(np, NULL, NULL);
94 of_node_put(np);
95 }
59} 96}
60 97
98void __init mpc512x_init(void)
99{
100 mpc512x_declare_of_platform_devices();
101 mpc5121_clk_init();
102 mpc512x_restart_init();
103}
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
index 21f61b8c445b..04d105d689f1 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
@@ -302,11 +302,14 @@ static struct of_device_id mpc85xx_ids[] = {
302 { .compatible = "gianfar", }, 302 { .compatible = "gianfar", },
303 { .compatible = "fsl,rapidio-delta", }, 303 { .compatible = "fsl,rapidio-delta", },
304 { .compatible = "fsl,mpc8548-guts", }, 304 { .compatible = "fsl,mpc8548-guts", },
305 { .compatible = "gpio-leds", },
305 {}, 306 {},
306}; 307};
307 308
308static int __init mpc85xx_publish_devices(void) 309static int __init mpc85xx_publish_devices(void)
309{ 310{
311 if (machine_is(mpc8568_mds))
312 simple_gpiochip_init("fsl,mpc8568mds-bcsr-gpio");
310 if (machine_is(mpc8569_mds)) 313 if (machine_is(mpc8569_mds))
311 simple_gpiochip_init("fsl,mpc8569mds-bcsr-gpio"); 314 simple_gpiochip_init("fsl,mpc8569mds-bcsr-gpio");
312 315
@@ -338,7 +341,8 @@ static void __init mpc85xx_mds_pic_init(void)
338 } 341 }
339 342
340 mpic = mpic_alloc(np, r.start, 343 mpic = mpic_alloc(np, r.start,
341 MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN, 344 MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN |
345 MPIC_BROKEN_FRR_NIRQS,
342 0, 256, " OpenPIC "); 346 0, 256, " OpenPIC ");
343 BUG_ON(mpic == NULL); 347 BUG_ON(mpic == NULL);
344 of_node_put(np); 348 of_node_put(np);
diff --git a/arch/powerpc/platforms/85xx/smp.c b/arch/powerpc/platforms/85xx/smp.c
index 04160a4cc699..a15f582300d8 100644
--- a/arch/powerpc/platforms/85xx/smp.c
+++ b/arch/powerpc/platforms/85xx/smp.c
@@ -46,6 +46,7 @@ smp_85xx_kick_cpu(int nr)
46 __iomem u32 *bptr_vaddr; 46 __iomem u32 *bptr_vaddr;
47 struct device_node *np; 47 struct device_node *np;
48 int n = 0; 48 int n = 0;
49 int ioremappable;
49 50
50 WARN_ON (nr < 0 || nr >= NR_CPUS); 51 WARN_ON (nr < 0 || nr >= NR_CPUS);
51 52
@@ -59,21 +60,37 @@ smp_85xx_kick_cpu(int nr)
59 return; 60 return;
60 } 61 }
61 62
63 /*
64 * A secondary core could be in a spinloop in the bootpage
65 * (0xfffff000), somewhere in highmem, or somewhere in lowmem.
66 * The bootpage and highmem can be accessed via ioremap(), but
67 * we need to directly access the spinloop if its in lowmem.
68 */
69 ioremappable = *cpu_rel_addr > virt_to_phys(high_memory);
70
62 /* Map the spin table */ 71 /* Map the spin table */
63 bptr_vaddr = ioremap(*cpu_rel_addr, SIZE_BOOT_ENTRY); 72 if (ioremappable)
73 bptr_vaddr = ioremap(*cpu_rel_addr, SIZE_BOOT_ENTRY);
74 else
75 bptr_vaddr = phys_to_virt(*cpu_rel_addr);
64 76
65 local_irq_save(flags); 77 local_irq_save(flags);
66 78
67 out_be32(bptr_vaddr + BOOT_ENTRY_PIR, nr); 79 out_be32(bptr_vaddr + BOOT_ENTRY_PIR, nr);
68 out_be32(bptr_vaddr + BOOT_ENTRY_ADDR_LOWER, __pa(__early_start)); 80 out_be32(bptr_vaddr + BOOT_ENTRY_ADDR_LOWER, __pa(__early_start));
69 81
82 if (!ioremappable)
83 flush_dcache_range((ulong)bptr_vaddr,
84 (ulong)(bptr_vaddr + SIZE_BOOT_ENTRY));
85
70 /* Wait a bit for the CPU to ack. */ 86 /* Wait a bit for the CPU to ack. */
71 while ((__secondary_hold_acknowledge != nr) && (++n < 1000)) 87 while ((__secondary_hold_acknowledge != nr) && (++n < 1000))
72 mdelay(1); 88 mdelay(1);
73 89
74 local_irq_restore(flags); 90 local_irq_restore(flags);
75 91
76 iounmap(bptr_vaddr); 92 if (ioremappable)
93 iounmap(bptr_vaddr);
77 94
78 pr_debug("waited %d msecs for CPU #%d.\n", n, nr); 95 pr_debug("waited %d msecs for CPU #%d.\n", n, nr);
79} 96}
diff --git a/arch/powerpc/platforms/85xx/socrates_fpga_pic.c b/arch/powerpc/platforms/85xx/socrates_fpga_pic.c
index e5da5f62b24a..42e87f08aa01 100644
--- a/arch/powerpc/platforms/85xx/socrates_fpga_pic.c
+++ b/arch/powerpc/platforms/85xx/socrates_fpga_pic.c
@@ -232,7 +232,7 @@ static int socrates_fpga_pic_set_type(unsigned int virq,
232} 232}
233 233
234static struct irq_chip socrates_fpga_pic_chip = { 234static struct irq_chip socrates_fpga_pic_chip = {
235 .name = " FPGA-PIC ", 235 .name = "FPGA-PIC",
236 .ack = socrates_fpga_pic_ack, 236 .ack = socrates_fpga_pic_ack,
237 .mask = socrates_fpga_pic_mask, 237 .mask = socrates_fpga_pic_mask,
238 .mask_ack = socrates_fpga_pic_mask_ack, 238 .mask_ack = socrates_fpga_pic_mask_ack,
diff --git a/arch/powerpc/platforms/85xx/stx_gp3.c b/arch/powerpc/platforms/85xx/stx_gp3.c
index f559918f3c6f..bc33d1859ae7 100644
--- a/arch/powerpc/platforms/85xx/stx_gp3.c
+++ b/arch/powerpc/platforms/85xx/stx_gp3.c
@@ -134,7 +134,7 @@ static void stx_gp3_show_cpuinfo(struct seq_file *m)
134 pvid = mfspr(SPRN_PVR); 134 pvid = mfspr(SPRN_PVR);
135 svid = mfspr(SPRN_SVR); 135 svid = mfspr(SPRN_SVR);
136 136
137 seq_printf(m, "Vendor\t\t: RPC Electronics STx \n"); 137 seq_printf(m, "Vendor\t\t: RPC Electronics STx\n");
138 seq_printf(m, "PVR\t\t: 0x%x\n", pvid); 138 seq_printf(m, "PVR\t\t: 0x%x\n", pvid);
139 seq_printf(m, "SVR\t\t: 0x%x\n", svid); 139 seq_printf(m, "SVR\t\t: 0x%x\n", svid);
140 140
diff --git a/arch/powerpc/platforms/85xx/xes_mpc85xx.c b/arch/powerpc/platforms/85xx/xes_mpc85xx.c
index 1b426050a2f9..0125604d096e 100644
--- a/arch/powerpc/platforms/85xx/xes_mpc85xx.c
+++ b/arch/powerpc/platforms/85xx/xes_mpc85xx.c
@@ -80,8 +80,8 @@ static void xes_mpc85xx_configure_l2(void __iomem *l2_base)
80 printk(KERN_INFO "xes_mpc85xx: Enabling L2 as cache\n"); 80 printk(KERN_INFO "xes_mpc85xx: Enabling L2 as cache\n");
81 81
82 ctl = MPC85xx_L2CTL_L2E | MPC85xx_L2CTL_L2I; 82 ctl = MPC85xx_L2CTL_L2E | MPC85xx_L2CTL_L2I;
83 if (machine_is_compatible("MPC8540") || 83 if (of_machine_is_compatible("MPC8540") ||
84 machine_is_compatible("MPC8560")) 84 of_machine_is_compatible("MPC8560"))
85 /* 85 /*
86 * Assume L2 SRAM is used fully for cache, so set 86 * Assume L2 SRAM is used fully for cache, so set
87 * L2BLKSZ (bits 4:5) to match L2SIZ (bits 2:3). 87 * L2BLKSZ (bits 4:5) to match L2SIZ (bits 2:3).
diff --git a/arch/powerpc/platforms/cell/beat_htab.c b/arch/powerpc/platforms/cell/beat_htab.c
index 35b1ec492715..2516c1cf8467 100644
--- a/arch/powerpc/platforms/cell/beat_htab.c
+++ b/arch/powerpc/platforms/cell/beat_htab.c
@@ -40,7 +40,7 @@
40#define DBG_LOW(fmt...) do { } while (0) 40#define DBG_LOW(fmt...) do { } while (0)
41#endif 41#endif
42 42
43static DEFINE_SPINLOCK(beat_htab_lock); 43static DEFINE_RAW_SPINLOCK(beat_htab_lock);
44 44
45static inline unsigned int beat_read_mask(unsigned hpte_group) 45static inline unsigned int beat_read_mask(unsigned hpte_group)
46{ 46{
@@ -114,18 +114,18 @@ static long beat_lpar_hpte_insert(unsigned long hpte_group,
114 if (rflags & _PAGE_NO_CACHE) 114 if (rflags & _PAGE_NO_CACHE)
115 hpte_r &= ~_PAGE_COHERENT; 115 hpte_r &= ~_PAGE_COHERENT;
116 116
117 spin_lock(&beat_htab_lock); 117 raw_spin_lock(&beat_htab_lock);
118 lpar_rc = beat_read_mask(hpte_group); 118 lpar_rc = beat_read_mask(hpte_group);
119 if (lpar_rc == 0) { 119 if (lpar_rc == 0) {
120 if (!(vflags & HPTE_V_BOLTED)) 120 if (!(vflags & HPTE_V_BOLTED))
121 DBG_LOW(" full\n"); 121 DBG_LOW(" full\n");
122 spin_unlock(&beat_htab_lock); 122 raw_spin_unlock(&beat_htab_lock);
123 return -1; 123 return -1;
124 } 124 }
125 125
126 lpar_rc = beat_insert_htab_entry(0, hpte_group, lpar_rc << 48, 126 lpar_rc = beat_insert_htab_entry(0, hpte_group, lpar_rc << 48,
127 hpte_v, hpte_r, &slot); 127 hpte_v, hpte_r, &slot);
128 spin_unlock(&beat_htab_lock); 128 raw_spin_unlock(&beat_htab_lock);
129 129
130 /* 130 /*
131 * Since we try and ioremap PHBs we don't own, the pte insert 131 * Since we try and ioremap PHBs we don't own, the pte insert
@@ -198,17 +198,17 @@ static long beat_lpar_hpte_updatepp(unsigned long slot,
198 "avpnv=%016lx, slot=%016lx, psize: %d, newpp %016lx ... ", 198 "avpnv=%016lx, slot=%016lx, psize: %d, newpp %016lx ... ",
199 want_v & HPTE_V_AVPN, slot, psize, newpp); 199 want_v & HPTE_V_AVPN, slot, psize, newpp);
200 200
201 spin_lock(&beat_htab_lock); 201 raw_spin_lock(&beat_htab_lock);
202 dummy0 = beat_lpar_hpte_getword0(slot); 202 dummy0 = beat_lpar_hpte_getword0(slot);
203 if ((dummy0 & ~0x7FUL) != (want_v & ~0x7FUL)) { 203 if ((dummy0 & ~0x7FUL) != (want_v & ~0x7FUL)) {
204 DBG_LOW("not found !\n"); 204 DBG_LOW("not found !\n");
205 spin_unlock(&beat_htab_lock); 205 raw_spin_unlock(&beat_htab_lock);
206 return -1; 206 return -1;
207 } 207 }
208 208
209 lpar_rc = beat_write_htab_entry(0, slot, 0, newpp, 0, 7, &dummy0, 209 lpar_rc = beat_write_htab_entry(0, slot, 0, newpp, 0, 7, &dummy0,
210 &dummy1); 210 &dummy1);
211 spin_unlock(&beat_htab_lock); 211 raw_spin_unlock(&beat_htab_lock);
212 if (lpar_rc != 0 || dummy0 == 0) { 212 if (lpar_rc != 0 || dummy0 == 0) {
213 DBG_LOW("not found !\n"); 213 DBG_LOW("not found !\n");
214 return -1; 214 return -1;
@@ -262,13 +262,13 @@ static void beat_lpar_hpte_updateboltedpp(unsigned long newpp,
262 vsid = get_kernel_vsid(ea, MMU_SEGSIZE_256M); 262 vsid = get_kernel_vsid(ea, MMU_SEGSIZE_256M);
263 va = (vsid << 28) | (ea & 0x0fffffff); 263 va = (vsid << 28) | (ea & 0x0fffffff);
264 264
265 spin_lock(&beat_htab_lock); 265 raw_spin_lock(&beat_htab_lock);
266 slot = beat_lpar_hpte_find(va, psize); 266 slot = beat_lpar_hpte_find(va, psize);
267 BUG_ON(slot == -1); 267 BUG_ON(slot == -1);
268 268
269 lpar_rc = beat_write_htab_entry(0, slot, 0, newpp, 0, 7, 269 lpar_rc = beat_write_htab_entry(0, slot, 0, newpp, 0, 7,
270 &dummy0, &dummy1); 270 &dummy0, &dummy1);
271 spin_unlock(&beat_htab_lock); 271 raw_spin_unlock(&beat_htab_lock);
272 272
273 BUG_ON(lpar_rc != 0); 273 BUG_ON(lpar_rc != 0);
274} 274}
@@ -285,18 +285,18 @@ static void beat_lpar_hpte_invalidate(unsigned long slot, unsigned long va,
285 slot, va, psize, local); 285 slot, va, psize, local);
286 want_v = hpte_encode_v(va, psize, MMU_SEGSIZE_256M); 286 want_v = hpte_encode_v(va, psize, MMU_SEGSIZE_256M);
287 287
288 spin_lock_irqsave(&beat_htab_lock, flags); 288 raw_spin_lock_irqsave(&beat_htab_lock, flags);
289 dummy1 = beat_lpar_hpte_getword0(slot); 289 dummy1 = beat_lpar_hpte_getword0(slot);
290 290
291 if ((dummy1 & ~0x7FUL) != (want_v & ~0x7FUL)) { 291 if ((dummy1 & ~0x7FUL) != (want_v & ~0x7FUL)) {
292 DBG_LOW("not found !\n"); 292 DBG_LOW("not found !\n");
293 spin_unlock_irqrestore(&beat_htab_lock, flags); 293 raw_spin_unlock_irqrestore(&beat_htab_lock, flags);
294 return; 294 return;
295 } 295 }
296 296
297 lpar_rc = beat_write_htab_entry(0, slot, 0, 0, HPTE_V_VALID, 0, 297 lpar_rc = beat_write_htab_entry(0, slot, 0, 0, HPTE_V_VALID, 0,
298 &dummy1, &dummy2); 298 &dummy1, &dummy2);
299 spin_unlock_irqrestore(&beat_htab_lock, flags); 299 raw_spin_unlock_irqrestore(&beat_htab_lock, flags);
300 300
301 BUG_ON(lpar_rc != 0); 301 BUG_ON(lpar_rc != 0);
302} 302}
diff --git a/arch/powerpc/platforms/cell/beat_interrupt.c b/arch/powerpc/platforms/cell/beat_interrupt.c
index 36052a9ebcda..682af97321a8 100644
--- a/arch/powerpc/platforms/cell/beat_interrupt.c
+++ b/arch/powerpc/platforms/cell/beat_interrupt.c
@@ -30,7 +30,7 @@
30#include "beat_wrapper.h" 30#include "beat_wrapper.h"
31 31
32#define MAX_IRQS NR_IRQS 32#define MAX_IRQS NR_IRQS
33static DEFINE_SPINLOCK(beatic_irq_mask_lock); 33static DEFINE_RAW_SPINLOCK(beatic_irq_mask_lock);
34static uint64_t beatic_irq_mask_enable[(MAX_IRQS+255)/64]; 34static uint64_t beatic_irq_mask_enable[(MAX_IRQS+255)/64];
35static uint64_t beatic_irq_mask_ack[(MAX_IRQS+255)/64]; 35static uint64_t beatic_irq_mask_ack[(MAX_IRQS+255)/64];
36 36
@@ -65,30 +65,30 @@ static void beatic_mask_irq(unsigned int irq_plug)
65{ 65{
66 unsigned long flags; 66 unsigned long flags;
67 67
68 spin_lock_irqsave(&beatic_irq_mask_lock, flags); 68 raw_spin_lock_irqsave(&beatic_irq_mask_lock, flags);
69 beatic_irq_mask_enable[irq_plug/64] &= ~(1UL << (63 - (irq_plug%64))); 69 beatic_irq_mask_enable[irq_plug/64] &= ~(1UL << (63 - (irq_plug%64)));
70 beatic_update_irq_mask(irq_plug); 70 beatic_update_irq_mask(irq_plug);
71 spin_unlock_irqrestore(&beatic_irq_mask_lock, flags); 71 raw_spin_unlock_irqrestore(&beatic_irq_mask_lock, flags);
72} 72}
73 73
74static void beatic_unmask_irq(unsigned int irq_plug) 74static void beatic_unmask_irq(unsigned int irq_plug)
75{ 75{
76 unsigned long flags; 76 unsigned long flags;
77 77
78 spin_lock_irqsave(&beatic_irq_mask_lock, flags); 78 raw_spin_lock_irqsave(&beatic_irq_mask_lock, flags);
79 beatic_irq_mask_enable[irq_plug/64] |= 1UL << (63 - (irq_plug%64)); 79 beatic_irq_mask_enable[irq_plug/64] |= 1UL << (63 - (irq_plug%64));
80 beatic_update_irq_mask(irq_plug); 80 beatic_update_irq_mask(irq_plug);
81 spin_unlock_irqrestore(&beatic_irq_mask_lock, flags); 81 raw_spin_unlock_irqrestore(&beatic_irq_mask_lock, flags);
82} 82}
83 83
84static void beatic_ack_irq(unsigned int irq_plug) 84static void beatic_ack_irq(unsigned int irq_plug)
85{ 85{
86 unsigned long flags; 86 unsigned long flags;
87 87
88 spin_lock_irqsave(&beatic_irq_mask_lock, flags); 88 raw_spin_lock_irqsave(&beatic_irq_mask_lock, flags);
89 beatic_irq_mask_ack[irq_plug/64] &= ~(1UL << (63 - (irq_plug%64))); 89 beatic_irq_mask_ack[irq_plug/64] &= ~(1UL << (63 - (irq_plug%64)));
90 beatic_update_irq_mask(irq_plug); 90 beatic_update_irq_mask(irq_plug);
91 spin_unlock_irqrestore(&beatic_irq_mask_lock, flags); 91 raw_spin_unlock_irqrestore(&beatic_irq_mask_lock, flags);
92} 92}
93 93
94static void beatic_end_irq(unsigned int irq_plug) 94static void beatic_end_irq(unsigned int irq_plug)
@@ -103,14 +103,14 @@ static void beatic_end_irq(unsigned int irq_plug)
103 103
104 printk(KERN_ERR "IRQ over-downcounted, plug %d\n", irq_plug); 104 printk(KERN_ERR "IRQ over-downcounted, plug %d\n", irq_plug);
105 } 105 }
106 spin_lock_irqsave(&beatic_irq_mask_lock, flags); 106 raw_spin_lock_irqsave(&beatic_irq_mask_lock, flags);
107 beatic_irq_mask_ack[irq_plug/64] |= 1UL << (63 - (irq_plug%64)); 107 beatic_irq_mask_ack[irq_plug/64] |= 1UL << (63 - (irq_plug%64));
108 beatic_update_irq_mask(irq_plug); 108 beatic_update_irq_mask(irq_plug);
109 spin_unlock_irqrestore(&beatic_irq_mask_lock, flags); 109 raw_spin_unlock_irqrestore(&beatic_irq_mask_lock, flags);
110} 110}
111 111
112static struct irq_chip beatic_pic = { 112static struct irq_chip beatic_pic = {
113 .name = " CELL-BEAT ", 113 .name = "CELL-BEAT",
114 .unmask = beatic_unmask_irq, 114 .unmask = beatic_unmask_irq,
115 .mask = beatic_mask_irq, 115 .mask = beatic_mask_irq,
116 .eoi = beatic_end_irq, 116 .eoi = beatic_end_irq,
diff --git a/arch/powerpc/platforms/cell/cbe_powerbutton.c b/arch/powerpc/platforms/cell/cbe_powerbutton.c
index dcddaa5fcb66..f75a4daa4ca2 100644
--- a/arch/powerpc/platforms/cell/cbe_powerbutton.c
+++ b/arch/powerpc/platforms/cell/cbe_powerbutton.c
@@ -48,7 +48,7 @@ static int __init cbe_powerbutton_init(void)
48 int ret = 0; 48 int ret = 0;
49 struct input_dev *dev; 49 struct input_dev *dev;
50 50
51 if (!machine_is_compatible("IBM,CBPLUS-1.0")) { 51 if (!of_machine_is_compatible("IBM,CBPLUS-1.0")) {
52 printk(KERN_ERR "%s: Not a cell blade.\n", __func__); 52 printk(KERN_ERR "%s: Not a cell blade.\n", __func__);
53 ret = -ENODEV; 53 ret = -ENODEV;
54 goto out; 54 goto out;
diff --git a/arch/powerpc/platforms/cell/interrupt.c b/arch/powerpc/platforms/cell/interrupt.c
index 6829cf7e2bda..10eb1a443626 100644
--- a/arch/powerpc/platforms/cell/interrupt.c
+++ b/arch/powerpc/platforms/cell/interrupt.c
@@ -88,7 +88,7 @@ static void iic_eoi(unsigned int irq)
88} 88}
89 89
90static struct irq_chip iic_chip = { 90static struct irq_chip iic_chip = {
91 .name = " CELL-IIC ", 91 .name = "CELL-IIC",
92 .mask = iic_mask, 92 .mask = iic_mask,
93 .unmask = iic_unmask, 93 .unmask = iic_unmask,
94 .eoi = iic_eoi, 94 .eoi = iic_eoi,
@@ -133,7 +133,7 @@ static void iic_ioexc_cascade(unsigned int irq, struct irq_desc *desc)
133 133
134 134
135static struct irq_chip iic_ioexc_chip = { 135static struct irq_chip iic_ioexc_chip = {
136 .name = " CELL-IOEX", 136 .name = "CELL-IOEX",
137 .mask = iic_mask, 137 .mask = iic_mask,
138 .unmask = iic_unmask, 138 .unmask = iic_unmask,
139 .eoi = iic_ioexc_eoi, 139 .eoi = iic_ioexc_eoi,
diff --git a/arch/powerpc/platforms/cell/ras.c b/arch/powerpc/platforms/cell/ras.c
index 5e0a191764fc..608fd2b584c9 100644
--- a/arch/powerpc/platforms/cell/ras.c
+++ b/arch/powerpc/platforms/cell/ras.c
@@ -255,7 +255,7 @@ static int __init cbe_sysreset_init(void)
255{ 255{
256 struct cbe_pmd_regs __iomem *regs; 256 struct cbe_pmd_regs __iomem *regs;
257 257
258 sysreset_hack = machine_is_compatible("IBM,CBPLUS-1.0"); 258 sysreset_hack = of_machine_is_compatible("IBM,CBPLUS-1.0");
259 if (!sysreset_hack) 259 if (!sysreset_hack)
260 return 0; 260 return 0;
261 261
diff --git a/arch/powerpc/platforms/cell/spider-pic.c b/arch/powerpc/platforms/cell/spider-pic.c
index 01244f254a11..5876e888e412 100644
--- a/arch/powerpc/platforms/cell/spider-pic.c
+++ b/arch/powerpc/platforms/cell/spider-pic.c
@@ -168,7 +168,7 @@ static int spider_set_irq_type(unsigned int virq, unsigned int type)
168} 168}
169 169
170static struct irq_chip spider_pic = { 170static struct irq_chip spider_pic = {
171 .name = " SPIDER ", 171 .name = "SPIDER",
172 .unmask = spider_unmask_irq, 172 .unmask = spider_unmask_irq,
173 .mask = spider_mask_irq, 173 .mask = spider_mask_irq,
174 .ack = spider_ack_irq, 174 .ack = spider_ack_irq,
diff --git a/arch/powerpc/platforms/cell/spu_manage.c b/arch/powerpc/platforms/cell/spu_manage.c
index 4c506c1463cd..891f18e337a2 100644
--- a/arch/powerpc/platforms/cell/spu_manage.c
+++ b/arch/powerpc/platforms/cell/spu_manage.c
@@ -457,7 +457,7 @@ neighbour_spu(int cbe, struct device_node *target, struct device_node *avoid)
457 continue; 457 continue;
458 vic_handles = of_get_property(spu_dn, "vicinity", &lenp); 458 vic_handles = of_get_property(spu_dn, "vicinity", &lenp);
459 for (i=0; i < (lenp / sizeof(phandle)); i++) { 459 for (i=0; i < (lenp / sizeof(phandle)); i++) {
460 if (vic_handles[i] == target->linux_phandle) 460 if (vic_handles[i] == target->phandle)
461 return spu; 461 return spu;
462 } 462 }
463 } 463 }
@@ -499,7 +499,7 @@ static void init_affinity_node(int cbe)
499 499
500 if (strcmp(name, "spe") == 0) { 500 if (strcmp(name, "spe") == 0) {
501 spu = devnode_spu(cbe, vic_dn); 501 spu = devnode_spu(cbe, vic_dn);
502 avoid_ph = last_spu_dn->linux_phandle; 502 avoid_ph = last_spu_dn->phandle;
503 } else { 503 } else {
504 /* 504 /*
505 * "mic-tm" and "bif0" nodes do not have 505 * "mic-tm" and "bif0" nodes do not have
@@ -514,7 +514,7 @@ static void init_affinity_node(int cbe)
514 last_spu->has_mem_affinity = 1; 514 last_spu->has_mem_affinity = 1;
515 spu->has_mem_affinity = 1; 515 spu->has_mem_affinity = 1;
516 } 516 }
517 avoid_ph = vic_dn->linux_phandle; 517 avoid_ph = vic_dn->phandle;
518 } 518 }
519 519
520 list_add_tail(&spu->aff_list, &last_spu->aff_list); 520 list_add_tail(&spu->aff_list, &last_spu->aff_list);
diff --git a/arch/powerpc/platforms/fsl_uli1575.c b/arch/powerpc/platforms/fsl_uli1575.c
index fd23a1d4b39d..8b0c2082a783 100644
--- a/arch/powerpc/platforms/fsl_uli1575.c
+++ b/arch/powerpc/platforms/fsl_uli1575.c
@@ -222,6 +222,7 @@ static void __devinit quirk_final_uli5249(struct pci_dev *dev)
222 int i; 222 int i;
223 u8 *dummy; 223 u8 *dummy;
224 struct pci_bus *bus = dev->bus; 224 struct pci_bus *bus = dev->bus;
225 struct resource *res;
225 resource_size_t end = 0; 226 resource_size_t end = 0;
226 227
227 for (i = PCI_BRIDGE_RESOURCES; i < PCI_BRIDGE_RESOURCES+3; i++) { 228 for (i = PCI_BRIDGE_RESOURCES; i < PCI_BRIDGE_RESOURCES+3; i++) {
@@ -230,13 +231,12 @@ static void __devinit quirk_final_uli5249(struct pci_dev *dev)
230 end = pci_resource_end(dev, i); 231 end = pci_resource_end(dev, i);
231 } 232 }
232 233
233 for (i = 0; i < PCI_BUS_NUM_RESOURCES; i++) { 234 pci_bus_for_each_resource(bus, res, i) {
234 if ((bus->resource[i]) && 235 if (res && res->flags & IORESOURCE_MEM) {
235 (bus->resource[i]->flags & IORESOURCE_MEM)) { 236 if (res->end == end)
236 if (bus->resource[i]->end == end) 237 dummy = ioremap(res->start, 0x4);
237 dummy = ioremap(bus->resource[i]->start, 0x4);
238 else 238 else
239 dummy = ioremap(bus->resource[i]->end - 3, 0x4); 239 dummy = ioremap(res->end - 3, 0x4);
240 if (dummy) { 240 if (dummy) {
241 in_8(dummy); 241 in_8(dummy);
242 iounmap(dummy); 242 iounmap(dummy);
diff --git a/arch/powerpc/platforms/iseries/irq.c b/arch/powerpc/platforms/iseries/irq.c
index 86c4b29eea89..ba446bf355a9 100644
--- a/arch/powerpc/platforms/iseries/irq.c
+++ b/arch/powerpc/platforms/iseries/irq.c
@@ -273,7 +273,7 @@ static void iseries_end_IRQ(unsigned int irq)
273} 273}
274 274
275static struct irq_chip iseries_pic = { 275static struct irq_chip iseries_pic = {
276 .name = "iSeries irq controller", 276 .name = "iSeries",
277 .startup = iseries_startup_IRQ, 277 .startup = iseries_startup_IRQ,
278 .shutdown = iseries_shutdown_IRQ, 278 .shutdown = iseries_shutdown_IRQ,
279 .unmask = iseries_enable_IRQ, 279 .unmask = iseries_enable_IRQ,
diff --git a/arch/powerpc/platforms/iseries/proc.c b/arch/powerpc/platforms/iseries/proc.c
index 91f4c6cd4b99..06763682db47 100644
--- a/arch/powerpc/platforms/iseries/proc.c
+++ b/arch/powerpc/platforms/iseries/proc.c
@@ -85,7 +85,7 @@ static int proc_titantod_show(struct seq_file *m, void *v)
85 85
86 seq_printf(m, " titan elapsed = %lu uSec\n", titan_usec); 86 seq_printf(m, " titan elapsed = %lu uSec\n", titan_usec);
87 seq_printf(m, " tb elapsed = %lu ticks\n", tb_ticks); 87 seq_printf(m, " tb elapsed = %lu ticks\n", tb_ticks);
88 seq_printf(m, " titan jiffies = %lu.%04lu \n", titan_jiffies, 88 seq_printf(m, " titan jiffies = %lu.%04lu\n", titan_jiffies,
89 titan_jiff_rem_usec); 89 titan_jiff_rem_usec);
90 seq_printf(m, " tb jiffies = %lu.%04lu\n", tb_jiffies, 90 seq_printf(m, " tb jiffies = %lu.%04lu\n", tb_jiffies,
91 tb_jiff_rem_usec); 91 tb_jiff_rem_usec);
diff --git a/arch/powerpc/platforms/iseries/setup.c b/arch/powerpc/platforms/iseries/setup.c
index a6cd3394feaa..b0863410517f 100644
--- a/arch/powerpc/platforms/iseries/setup.c
+++ b/arch/powerpc/platforms/iseries/setup.c
@@ -256,7 +256,7 @@ static unsigned long iSeries_process_mainstore_vpd(struct MemoryBlock *mb_array,
256 mem_blocks = iSeries_process_Condor_mainstore_vpd(mb_array, 256 mem_blocks = iSeries_process_Condor_mainstore_vpd(mb_array,
257 max_entries); 257 max_entries);
258 258
259 printk("Mainstore_VPD: numMemoryBlocks = %ld \n", mem_blocks); 259 printk("Mainstore_VPD: numMemoryBlocks = %ld\n", mem_blocks);
260 for (i = 0; i < mem_blocks; ++i) { 260 for (i = 0; i < mem_blocks; ++i) {
261 printk("Mainstore_VPD: block %3ld logical chunks %016lx - %016lx\n" 261 printk("Mainstore_VPD: block %3ld logical chunks %016lx - %016lx\n"
262 " abs chunks %016lx - %016lx\n", 262 " abs chunks %016lx - %016lx\n",
diff --git a/arch/powerpc/platforms/pasemi/cpufreq.c b/arch/powerpc/platforms/pasemi/cpufreq.c
index be2527a516ea..d35e0520abf0 100644
--- a/arch/powerpc/platforms/pasemi/cpufreq.c
+++ b/arch/powerpc/platforms/pasemi/cpufreq.c
@@ -304,8 +304,8 @@ static struct cpufreq_driver pas_cpufreq_driver = {
304 304
305static int __init pas_cpufreq_init(void) 305static int __init pas_cpufreq_init(void)
306{ 306{
307 if (!machine_is_compatible("PA6T-1682M") && 307 if (!of_machine_is_compatible("PA6T-1682M") &&
308 !machine_is_compatible("pasemi,pwrficient")) 308 !of_machine_is_compatible("pasemi,pwrficient"))
309 return -ENODEV; 309 return -ENODEV;
310 310
311 return cpufreq_register_driver(&pas_cpufreq_driver); 311 return cpufreq_register_driver(&pas_cpufreq_driver);
diff --git a/arch/powerpc/platforms/powermac/bootx_init.c b/arch/powerpc/platforms/powermac/bootx_init.c
index 9dd789a7370d..84d7fd9bcc69 100644
--- a/arch/powerpc/platforms/powermac/bootx_init.c
+++ b/arch/powerpc/platforms/powermac/bootx_init.c
@@ -539,7 +539,7 @@ void __init bootx_init(unsigned long r3, unsigned long r4)
539 if (model 539 if (model
540 && (strcmp(model, "iMac,1") == 0 540 && (strcmp(model, "iMac,1") == 0
541 || strcmp(model, "PowerMac1,1") == 0)) { 541 || strcmp(model, "PowerMac1,1") == 0)) {
542 bootx_printf("iMac,1 detected, shutting down USB \n"); 542 bootx_printf("iMac,1 detected, shutting down USB\n");
543 out_le32((unsigned __iomem *)0x80880008, 1); /* XXX */ 543 out_le32((unsigned __iomem *)0x80880008, 1); /* XXX */
544 } 544 }
545 } 545 }
@@ -554,7 +554,7 @@ void __init bootx_init(unsigned long r3, unsigned long r4)
554 } else 554 } else
555 space = bi->totalParamsSize; 555 space = bi->totalParamsSize;
556 556
557 bootx_printf("Total space used by parameters & ramdisk: 0x%x \n", space); 557 bootx_printf("Total space used by parameters & ramdisk: 0x%x\n", space);
558 558
559 /* New BootX will have flushed all TLBs and enters kernel with 559 /* New BootX will have flushed all TLBs and enters kernel with
560 * MMU switched OFF, so this should not be useful anymore. 560 * MMU switched OFF, so this should not be useful anymore.
diff --git a/arch/powerpc/platforms/powermac/cpufreq_32.c b/arch/powerpc/platforms/powermac/cpufreq_32.c
index 08d94e4cedd3..d4f127d18141 100644
--- a/arch/powerpc/platforms/powermac/cpufreq_32.c
+++ b/arch/powerpc/platforms/powermac/cpufreq_32.c
@@ -657,31 +657,31 @@ static int __init pmac_cpufreq_setup(void)
657 cur_freq = (*value) / 1000; 657 cur_freq = (*value) / 1000;
658 658
659 /* Check for 7447A based MacRISC3 */ 659 /* Check for 7447A based MacRISC3 */
660 if (machine_is_compatible("MacRISC3") && 660 if (of_machine_is_compatible("MacRISC3") &&
661 of_get_property(cpunode, "dynamic-power-step", NULL) && 661 of_get_property(cpunode, "dynamic-power-step", NULL) &&
662 PVR_VER(mfspr(SPRN_PVR)) == 0x8003) { 662 PVR_VER(mfspr(SPRN_PVR)) == 0x8003) {
663 pmac_cpufreq_init_7447A(cpunode); 663 pmac_cpufreq_init_7447A(cpunode);
664 /* Check for other MacRISC3 machines */ 664 /* Check for other MacRISC3 machines */
665 } else if (machine_is_compatible("PowerBook3,4") || 665 } else if (of_machine_is_compatible("PowerBook3,4") ||
666 machine_is_compatible("PowerBook3,5") || 666 of_machine_is_compatible("PowerBook3,5") ||
667 machine_is_compatible("MacRISC3")) { 667 of_machine_is_compatible("MacRISC3")) {
668 pmac_cpufreq_init_MacRISC3(cpunode); 668 pmac_cpufreq_init_MacRISC3(cpunode);
669 /* Else check for iBook2 500/600 */ 669 /* Else check for iBook2 500/600 */
670 } else if (machine_is_compatible("PowerBook4,1")) { 670 } else if (of_machine_is_compatible("PowerBook4,1")) {
671 hi_freq = cur_freq; 671 hi_freq = cur_freq;
672 low_freq = 400000; 672 low_freq = 400000;
673 set_speed_proc = pmu_set_cpu_speed; 673 set_speed_proc = pmu_set_cpu_speed;
674 is_pmu_based = 1; 674 is_pmu_based = 1;
675 } 675 }
676 /* Else check for TiPb 550 */ 676 /* Else check for TiPb 550 */
677 else if (machine_is_compatible("PowerBook3,3") && cur_freq == 550000) { 677 else if (of_machine_is_compatible("PowerBook3,3") && cur_freq == 550000) {
678 hi_freq = cur_freq; 678 hi_freq = cur_freq;
679 low_freq = 500000; 679 low_freq = 500000;
680 set_speed_proc = pmu_set_cpu_speed; 680 set_speed_proc = pmu_set_cpu_speed;
681 is_pmu_based = 1; 681 is_pmu_based = 1;
682 } 682 }
683 /* Else check for TiPb 400 & 500 */ 683 /* Else check for TiPb 400 & 500 */
684 else if (machine_is_compatible("PowerBook3,2")) { 684 else if (of_machine_is_compatible("PowerBook3,2")) {
685 /* We only know about the 400 MHz and the 500Mhz model 685 /* We only know about the 400 MHz and the 500Mhz model
686 * they both have 300 MHz as low frequency 686 * they both have 300 MHz as low frequency
687 */ 687 */
diff --git a/arch/powerpc/platforms/powermac/cpufreq_64.c b/arch/powerpc/platforms/powermac/cpufreq_64.c
index 708c75133377..3ed288e68ec4 100644
--- a/arch/powerpc/platforms/powermac/cpufreq_64.c
+++ b/arch/powerpc/platforms/powermac/cpufreq_64.c
@@ -398,11 +398,11 @@ static int __init g5_neo2_cpufreq_init(struct device_node *cpus)
398 int rc = -ENODEV; 398 int rc = -ENODEV;
399 399
400 /* Check supported platforms */ 400 /* Check supported platforms */
401 if (machine_is_compatible("PowerMac8,1") || 401 if (of_machine_is_compatible("PowerMac8,1") ||
402 machine_is_compatible("PowerMac8,2") || 402 of_machine_is_compatible("PowerMac8,2") ||
403 machine_is_compatible("PowerMac9,1")) 403 of_machine_is_compatible("PowerMac9,1"))
404 use_volts_smu = 1; 404 use_volts_smu = 1;
405 else if (machine_is_compatible("PowerMac11,2")) 405 else if (of_machine_is_compatible("PowerMac11,2"))
406 use_volts_vdnap = 1; 406 use_volts_vdnap = 1;
407 else 407 else
408 return -ENODEV; 408 return -ENODEV;
@@ -729,9 +729,9 @@ static int __init g5_cpufreq_init(void)
729 return -ENODEV; 729 return -ENODEV;
730 } 730 }
731 731
732 if (machine_is_compatible("PowerMac7,2") || 732 if (of_machine_is_compatible("PowerMac7,2") ||
733 machine_is_compatible("PowerMac7,3") || 733 of_machine_is_compatible("PowerMac7,3") ||
734 machine_is_compatible("RackMac3,1")) 734 of_machine_is_compatible("RackMac3,1"))
735 rc = g5_pm72_cpufreq_init(cpus); 735 rc = g5_pm72_cpufreq_init(cpus);
736#ifdef CONFIG_PMAC_SMU 736#ifdef CONFIG_PMAC_SMU
737 else 737 else
diff --git a/arch/powerpc/platforms/powermac/feature.c b/arch/powerpc/platforms/powermac/feature.c
index fbc9bbd74dbd..9e1b9fd75206 100644
--- a/arch/powerpc/platforms/powermac/feature.c
+++ b/arch/powerpc/platforms/powermac/feature.c
@@ -59,10 +59,10 @@ extern struct device_node *k2_skiplist[2];
59 * We use a single global lock to protect accesses. Each driver has 59 * We use a single global lock to protect accesses. Each driver has
60 * to take care of its own locking 60 * to take care of its own locking
61 */ 61 */
62DEFINE_SPINLOCK(feature_lock); 62DEFINE_RAW_SPINLOCK(feature_lock);
63 63
64#define LOCK(flags) spin_lock_irqsave(&feature_lock, flags); 64#define LOCK(flags) raw_spin_lock_irqsave(&feature_lock, flags);
65#define UNLOCK(flags) spin_unlock_irqrestore(&feature_lock, flags); 65#define UNLOCK(flags) raw_spin_unlock_irqrestore(&feature_lock, flags);
66 66
67 67
68/* 68/*
@@ -2426,7 +2426,7 @@ static int __init probe_motherboard(void)
2426 } 2426 }
2427 } 2427 }
2428 for(i=0; i<ARRAY_SIZE(pmac_mb_defs); i++) { 2428 for(i=0; i<ARRAY_SIZE(pmac_mb_defs); i++) {
2429 if (machine_is_compatible(pmac_mb_defs[i].model_string)) { 2429 if (of_machine_is_compatible(pmac_mb_defs[i].model_string)) {
2430 pmac_mb = pmac_mb_defs[i]; 2430 pmac_mb = pmac_mb_defs[i];
2431 goto found; 2431 goto found;
2432 } 2432 }
diff --git a/arch/powerpc/platforms/powermac/nvram.c b/arch/powerpc/platforms/powermac/nvram.c
index c6f0f9e738e5..80a5258d0364 100644
--- a/arch/powerpc/platforms/powermac/nvram.c
+++ b/arch/powerpc/platforms/powermac/nvram.c
@@ -80,7 +80,7 @@ static int is_core_99;
80static int core99_bank = 0; 80static int core99_bank = 0;
81static int nvram_partitions[3]; 81static int nvram_partitions[3];
82// XXX Turn that into a sem 82// XXX Turn that into a sem
83static DEFINE_SPINLOCK(nv_lock); 83static DEFINE_RAW_SPINLOCK(nv_lock);
84 84
85static int (*core99_write_bank)(int bank, u8* datas); 85static int (*core99_write_bank)(int bank, u8* datas);
86static int (*core99_erase_bank)(int bank); 86static int (*core99_erase_bank)(int bank);
@@ -165,10 +165,10 @@ static unsigned char indirect_nvram_read_byte(int addr)
165 unsigned char val; 165 unsigned char val;
166 unsigned long flags; 166 unsigned long flags;
167 167
168 spin_lock_irqsave(&nv_lock, flags); 168 raw_spin_lock_irqsave(&nv_lock, flags);
169 out_8(nvram_addr, addr >> 5); 169 out_8(nvram_addr, addr >> 5);
170 val = in_8(&nvram_data[(addr & 0x1f) << 4]); 170 val = in_8(&nvram_data[(addr & 0x1f) << 4]);
171 spin_unlock_irqrestore(&nv_lock, flags); 171 raw_spin_unlock_irqrestore(&nv_lock, flags);
172 172
173 return val; 173 return val;
174} 174}
@@ -177,10 +177,10 @@ static void indirect_nvram_write_byte(int addr, unsigned char val)
177{ 177{
178 unsigned long flags; 178 unsigned long flags;
179 179
180 spin_lock_irqsave(&nv_lock, flags); 180 raw_spin_lock_irqsave(&nv_lock, flags);
181 out_8(nvram_addr, addr >> 5); 181 out_8(nvram_addr, addr >> 5);
182 out_8(&nvram_data[(addr & 0x1f) << 4], val); 182 out_8(&nvram_data[(addr & 0x1f) << 4], val);
183 spin_unlock_irqrestore(&nv_lock, flags); 183 raw_spin_unlock_irqrestore(&nv_lock, flags);
184} 184}
185 185
186 186
@@ -481,7 +481,7 @@ static void core99_nvram_sync(void)
481 if (!is_core_99 || !nvram_data || !nvram_image) 481 if (!is_core_99 || !nvram_data || !nvram_image)
482 return; 482 return;
483 483
484 spin_lock_irqsave(&nv_lock, flags); 484 raw_spin_lock_irqsave(&nv_lock, flags);
485 if (!memcmp(nvram_image, (u8*)nvram_data + core99_bank*NVRAM_SIZE, 485 if (!memcmp(nvram_image, (u8*)nvram_data + core99_bank*NVRAM_SIZE,
486 NVRAM_SIZE)) 486 NVRAM_SIZE))
487 goto bail; 487 goto bail;
@@ -503,7 +503,7 @@ static void core99_nvram_sync(void)
503 if (core99_write_bank(core99_bank, nvram_image)) 503 if (core99_write_bank(core99_bank, nvram_image))
504 printk("nvram: Error writing bank %d\n", core99_bank); 504 printk("nvram: Error writing bank %d\n", core99_bank);
505 bail: 505 bail:
506 spin_unlock_irqrestore(&nv_lock, flags); 506 raw_spin_unlock_irqrestore(&nv_lock, flags);
507 507
508#ifdef DEBUG 508#ifdef DEBUG
509 mdelay(2000); 509 mdelay(2000);
diff --git a/arch/powerpc/platforms/powermac/pfunc_base.c b/arch/powerpc/platforms/powermac/pfunc_base.c
index db20de512f3e..f5e3cda6660e 100644
--- a/arch/powerpc/platforms/powermac/pfunc_base.c
+++ b/arch/powerpc/platforms/powermac/pfunc_base.c
@@ -50,13 +50,13 @@ static int macio_do_gpio_write(PMF_STD_ARGS, u8 value, u8 mask)
50 value = ~value; 50 value = ~value;
51 51
52 /* Toggle the GPIO */ 52 /* Toggle the GPIO */
53 spin_lock_irqsave(&feature_lock, flags); 53 raw_spin_lock_irqsave(&feature_lock, flags);
54 tmp = readb(addr); 54 tmp = readb(addr);
55 tmp = (tmp & ~mask) | (value & mask); 55 tmp = (tmp & ~mask) | (value & mask);
56 DBG("Do write 0x%02x to GPIO %s (%p)\n", 56 DBG("Do write 0x%02x to GPIO %s (%p)\n",
57 tmp, func->node->full_name, addr); 57 tmp, func->node->full_name, addr);
58 writeb(tmp, addr); 58 writeb(tmp, addr);
59 spin_unlock_irqrestore(&feature_lock, flags); 59 raw_spin_unlock_irqrestore(&feature_lock, flags);
60 60
61 return 0; 61 return 0;
62} 62}
@@ -145,9 +145,9 @@ static int macio_do_write_reg32(PMF_STD_ARGS, u32 offset, u32 value, u32 mask)
145 struct macio_chip *macio = func->driver_data; 145 struct macio_chip *macio = func->driver_data;
146 unsigned long flags; 146 unsigned long flags;
147 147
148 spin_lock_irqsave(&feature_lock, flags); 148 raw_spin_lock_irqsave(&feature_lock, flags);
149 MACIO_OUT32(offset, (MACIO_IN32(offset) & ~mask) | (value & mask)); 149 MACIO_OUT32(offset, (MACIO_IN32(offset) & ~mask) | (value & mask));
150 spin_unlock_irqrestore(&feature_lock, flags); 150 raw_spin_unlock_irqrestore(&feature_lock, flags);
151 return 0; 151 return 0;
152} 152}
153 153
@@ -168,9 +168,9 @@ static int macio_do_write_reg8(PMF_STD_ARGS, u32 offset, u8 value, u8 mask)
168 struct macio_chip *macio = func->driver_data; 168 struct macio_chip *macio = func->driver_data;
169 unsigned long flags; 169 unsigned long flags;
170 170
171 spin_lock_irqsave(&feature_lock, flags); 171 raw_spin_lock_irqsave(&feature_lock, flags);
172 MACIO_OUT8(offset, (MACIO_IN8(offset) & ~mask) | (value & mask)); 172 MACIO_OUT8(offset, (MACIO_IN8(offset) & ~mask) | (value & mask));
173 spin_unlock_irqrestore(&feature_lock, flags); 173 raw_spin_unlock_irqrestore(&feature_lock, flags);
174 return 0; 174 return 0;
175} 175}
176 176
@@ -223,12 +223,12 @@ static int macio_do_write_reg32_slm(PMF_STD_ARGS, u32 offset, u32 shift,
223 if (args == NULL || args->count == 0) 223 if (args == NULL || args->count == 0)
224 return -EINVAL; 224 return -EINVAL;
225 225
226 spin_lock_irqsave(&feature_lock, flags); 226 raw_spin_lock_irqsave(&feature_lock, flags);
227 tmp = MACIO_IN32(offset); 227 tmp = MACIO_IN32(offset);
228 val = args->u[0].v << shift; 228 val = args->u[0].v << shift;
229 tmp = (tmp & ~mask) | (val & mask); 229 tmp = (tmp & ~mask) | (val & mask);
230 MACIO_OUT32(offset, tmp); 230 MACIO_OUT32(offset, tmp);
231 spin_unlock_irqrestore(&feature_lock, flags); 231 raw_spin_unlock_irqrestore(&feature_lock, flags);
232 return 0; 232 return 0;
233} 233}
234 234
@@ -243,12 +243,12 @@ static int macio_do_write_reg8_slm(PMF_STD_ARGS, u32 offset, u32 shift,
243 if (args == NULL || args->count == 0) 243 if (args == NULL || args->count == 0)
244 return -EINVAL; 244 return -EINVAL;
245 245
246 spin_lock_irqsave(&feature_lock, flags); 246 raw_spin_lock_irqsave(&feature_lock, flags);
247 tmp = MACIO_IN8(offset); 247 tmp = MACIO_IN8(offset);
248 val = args->u[0].v << shift; 248 val = args->u[0].v << shift;
249 tmp = (tmp & ~mask) | (val & mask); 249 tmp = (tmp & ~mask) | (val & mask);
250 MACIO_OUT8(offset, tmp); 250 MACIO_OUT8(offset, tmp);
251 spin_unlock_irqrestore(&feature_lock, flags); 251 raw_spin_unlock_irqrestore(&feature_lock, flags);
252 return 0; 252 return 0;
253} 253}
254 254
@@ -278,12 +278,12 @@ static int unin_do_write_reg32(PMF_STD_ARGS, u32 offset, u32 value, u32 mask)
278{ 278{
279 unsigned long flags; 279 unsigned long flags;
280 280
281 spin_lock_irqsave(&feature_lock, flags); 281 raw_spin_lock_irqsave(&feature_lock, flags);
282 /* This is fairly bogus in darwin, but it should work for our needs 282 /* This is fairly bogus in darwin, but it should work for our needs
283 * implemeted that way: 283 * implemeted that way:
284 */ 284 */
285 UN_OUT(offset, (UN_IN(offset) & ~mask) | (value & mask)); 285 UN_OUT(offset, (UN_IN(offset) & ~mask) | (value & mask));
286 spin_unlock_irqrestore(&feature_lock, flags); 286 raw_spin_unlock_irqrestore(&feature_lock, flags);
287 return 0; 287 return 0;
288} 288}
289 289
diff --git a/arch/powerpc/platforms/powermac/pfunc_core.c b/arch/powerpc/platforms/powermac/pfunc_core.c
index 96d5ce50364e..ede49e78a8da 100644
--- a/arch/powerpc/platforms/powermac/pfunc_core.c
+++ b/arch/powerpc/platforms/powermac/pfunc_core.c
@@ -842,7 +842,7 @@ struct pmf_function *__pmf_find_function(struct device_node *target,
842 list_for_each_entry(func, &dev->functions, link) { 842 list_for_each_entry(func, &dev->functions, link) {
843 if (name && strcmp(name, func->name)) 843 if (name && strcmp(name, func->name))
844 continue; 844 continue;
845 if (func->phandle && target->node != func->phandle) 845 if (func->phandle && target->phandle != func->phandle)
846 continue; 846 continue;
847 if ((func->flags & flags) == 0) 847 if ((func->flags & flags) == 0)
848 continue; 848 continue;
diff --git a/arch/powerpc/platforms/powermac/pic.c b/arch/powerpc/platforms/powermac/pic.c
index 09e827296276..630a533d0e59 100644
--- a/arch/powerpc/platforms/powermac/pic.c
+++ b/arch/powerpc/platforms/powermac/pic.c
@@ -57,7 +57,7 @@ static int max_irqs;
57static int max_real_irqs; 57static int max_real_irqs;
58static u32 level_mask[4]; 58static u32 level_mask[4];
59 59
60static DEFINE_SPINLOCK(pmac_pic_lock); 60static DEFINE_RAW_SPINLOCK(pmac_pic_lock);
61 61
62#define NR_MASK_WORDS ((NR_IRQS + 31) / 32) 62#define NR_MASK_WORDS ((NR_IRQS + 31) / 32)
63static unsigned long ppc_lost_interrupts[NR_MASK_WORDS]; 63static unsigned long ppc_lost_interrupts[NR_MASK_WORDS];
@@ -85,7 +85,7 @@ static void pmac_mask_and_ack_irq(unsigned int virq)
85 int i = src >> 5; 85 int i = src >> 5;
86 unsigned long flags; 86 unsigned long flags;
87 87
88 spin_lock_irqsave(&pmac_pic_lock, flags); 88 raw_spin_lock_irqsave(&pmac_pic_lock, flags);
89 __clear_bit(src, ppc_cached_irq_mask); 89 __clear_bit(src, ppc_cached_irq_mask);
90 if (__test_and_clear_bit(src, ppc_lost_interrupts)) 90 if (__test_and_clear_bit(src, ppc_lost_interrupts))
91 atomic_dec(&ppc_n_lost_interrupts); 91 atomic_dec(&ppc_n_lost_interrupts);
@@ -97,7 +97,7 @@ static void pmac_mask_and_ack_irq(unsigned int virq)
97 mb(); 97 mb();
98 } while((in_le32(&pmac_irq_hw[i]->enable) & bit) 98 } while((in_le32(&pmac_irq_hw[i]->enable) & bit)
99 != (ppc_cached_irq_mask[i] & bit)); 99 != (ppc_cached_irq_mask[i] & bit));
100 spin_unlock_irqrestore(&pmac_pic_lock, flags); 100 raw_spin_unlock_irqrestore(&pmac_pic_lock, flags);
101} 101}
102 102
103static void pmac_ack_irq(unsigned int virq) 103static void pmac_ack_irq(unsigned int virq)
@@ -107,12 +107,12 @@ static void pmac_ack_irq(unsigned int virq)
107 int i = src >> 5; 107 int i = src >> 5;
108 unsigned long flags; 108 unsigned long flags;
109 109
110 spin_lock_irqsave(&pmac_pic_lock, flags); 110 raw_spin_lock_irqsave(&pmac_pic_lock, flags);
111 if (__test_and_clear_bit(src, ppc_lost_interrupts)) 111 if (__test_and_clear_bit(src, ppc_lost_interrupts))
112 atomic_dec(&ppc_n_lost_interrupts); 112 atomic_dec(&ppc_n_lost_interrupts);
113 out_le32(&pmac_irq_hw[i]->ack, bit); 113 out_le32(&pmac_irq_hw[i]->ack, bit);
114 (void)in_le32(&pmac_irq_hw[i]->ack); 114 (void)in_le32(&pmac_irq_hw[i]->ack);
115 spin_unlock_irqrestore(&pmac_pic_lock, flags); 115 raw_spin_unlock_irqrestore(&pmac_pic_lock, flags);
116} 116}
117 117
118static void __pmac_set_irq_mask(unsigned int irq_nr, int nokicklost) 118static void __pmac_set_irq_mask(unsigned int irq_nr, int nokicklost)
@@ -152,12 +152,12 @@ static unsigned int pmac_startup_irq(unsigned int virq)
152 unsigned long bit = 1UL << (src & 0x1f); 152 unsigned long bit = 1UL << (src & 0x1f);
153 int i = src >> 5; 153 int i = src >> 5;
154 154
155 spin_lock_irqsave(&pmac_pic_lock, flags); 155 raw_spin_lock_irqsave(&pmac_pic_lock, flags);
156 if ((irq_to_desc(virq)->status & IRQ_LEVEL) == 0) 156 if ((irq_to_desc(virq)->status & IRQ_LEVEL) == 0)
157 out_le32(&pmac_irq_hw[i]->ack, bit); 157 out_le32(&pmac_irq_hw[i]->ack, bit);
158 __set_bit(src, ppc_cached_irq_mask); 158 __set_bit(src, ppc_cached_irq_mask);
159 __pmac_set_irq_mask(src, 0); 159 __pmac_set_irq_mask(src, 0);
160 spin_unlock_irqrestore(&pmac_pic_lock, flags); 160 raw_spin_unlock_irqrestore(&pmac_pic_lock, flags);
161 161
162 return 0; 162 return 0;
163} 163}
@@ -167,10 +167,10 @@ static void pmac_mask_irq(unsigned int virq)
167 unsigned long flags; 167 unsigned long flags;
168 unsigned int src = irq_map[virq].hwirq; 168 unsigned int src = irq_map[virq].hwirq;
169 169
170 spin_lock_irqsave(&pmac_pic_lock, flags); 170 raw_spin_lock_irqsave(&pmac_pic_lock, flags);
171 __clear_bit(src, ppc_cached_irq_mask); 171 __clear_bit(src, ppc_cached_irq_mask);
172 __pmac_set_irq_mask(src, 1); 172 __pmac_set_irq_mask(src, 1);
173 spin_unlock_irqrestore(&pmac_pic_lock, flags); 173 raw_spin_unlock_irqrestore(&pmac_pic_lock, flags);
174} 174}
175 175
176static void pmac_unmask_irq(unsigned int virq) 176static void pmac_unmask_irq(unsigned int virq)
@@ -178,24 +178,24 @@ static void pmac_unmask_irq(unsigned int virq)
178 unsigned long flags; 178 unsigned long flags;
179 unsigned int src = irq_map[virq].hwirq; 179 unsigned int src = irq_map[virq].hwirq;
180 180
181 spin_lock_irqsave(&pmac_pic_lock, flags); 181 raw_spin_lock_irqsave(&pmac_pic_lock, flags);
182 __set_bit(src, ppc_cached_irq_mask); 182 __set_bit(src, ppc_cached_irq_mask);
183 __pmac_set_irq_mask(src, 0); 183 __pmac_set_irq_mask(src, 0);
184 spin_unlock_irqrestore(&pmac_pic_lock, flags); 184 raw_spin_unlock_irqrestore(&pmac_pic_lock, flags);
185} 185}
186 186
187static int pmac_retrigger(unsigned int virq) 187static int pmac_retrigger(unsigned int virq)
188{ 188{
189 unsigned long flags; 189 unsigned long flags;
190 190
191 spin_lock_irqsave(&pmac_pic_lock, flags); 191 raw_spin_lock_irqsave(&pmac_pic_lock, flags);
192 __pmac_retrigger(irq_map[virq].hwirq); 192 __pmac_retrigger(irq_map[virq].hwirq);
193 spin_unlock_irqrestore(&pmac_pic_lock, flags); 193 raw_spin_unlock_irqrestore(&pmac_pic_lock, flags);
194 return 1; 194 return 1;
195} 195}
196 196
197static struct irq_chip pmac_pic = { 197static struct irq_chip pmac_pic = {
198 .name = " PMAC-PIC ", 198 .name = "PMAC-PIC",
199 .startup = pmac_startup_irq, 199 .startup = pmac_startup_irq,
200 .mask = pmac_mask_irq, 200 .mask = pmac_mask_irq,
201 .ack = pmac_ack_irq, 201 .ack = pmac_ack_irq,
@@ -210,7 +210,7 @@ static irqreturn_t gatwick_action(int cpl, void *dev_id)
210 int irq, bits; 210 int irq, bits;
211 int rc = IRQ_NONE; 211 int rc = IRQ_NONE;
212 212
213 spin_lock_irqsave(&pmac_pic_lock, flags); 213 raw_spin_lock_irqsave(&pmac_pic_lock, flags);
214 for (irq = max_irqs; (irq -= 32) >= max_real_irqs; ) { 214 for (irq = max_irqs; (irq -= 32) >= max_real_irqs; ) {
215 int i = irq >> 5; 215 int i = irq >> 5;
216 bits = in_le32(&pmac_irq_hw[i]->event) | ppc_lost_interrupts[i]; 216 bits = in_le32(&pmac_irq_hw[i]->event) | ppc_lost_interrupts[i];
@@ -220,12 +220,12 @@ static irqreturn_t gatwick_action(int cpl, void *dev_id)
220 if (bits == 0) 220 if (bits == 0)
221 continue; 221 continue;
222 irq += __ilog2(bits); 222 irq += __ilog2(bits);
223 spin_unlock_irqrestore(&pmac_pic_lock, flags); 223 raw_spin_unlock_irqrestore(&pmac_pic_lock, flags);
224 generic_handle_irq(irq); 224 generic_handle_irq(irq);
225 spin_lock_irqsave(&pmac_pic_lock, flags); 225 raw_spin_lock_irqsave(&pmac_pic_lock, flags);
226 rc = IRQ_HANDLED; 226 rc = IRQ_HANDLED;
227 } 227 }
228 spin_unlock_irqrestore(&pmac_pic_lock, flags); 228 raw_spin_unlock_irqrestore(&pmac_pic_lock, flags);
229 return rc; 229 return rc;
230} 230}
231 231
@@ -244,7 +244,7 @@ static unsigned int pmac_pic_get_irq(void)
244 return NO_IRQ_IGNORE; /* ignore, already handled */ 244 return NO_IRQ_IGNORE; /* ignore, already handled */
245 } 245 }
246#endif /* CONFIG_SMP */ 246#endif /* CONFIG_SMP */
247 spin_lock_irqsave(&pmac_pic_lock, flags); 247 raw_spin_lock_irqsave(&pmac_pic_lock, flags);
248 for (irq = max_real_irqs; (irq -= 32) >= 0; ) { 248 for (irq = max_real_irqs; (irq -= 32) >= 0; ) {
249 int i = irq >> 5; 249 int i = irq >> 5;
250 bits = in_le32(&pmac_irq_hw[i]->event) | ppc_lost_interrupts[i]; 250 bits = in_le32(&pmac_irq_hw[i]->event) | ppc_lost_interrupts[i];
@@ -256,7 +256,7 @@ static unsigned int pmac_pic_get_irq(void)
256 irq += __ilog2(bits); 256 irq += __ilog2(bits);
257 break; 257 break;
258 } 258 }
259 spin_unlock_irqrestore(&pmac_pic_lock, flags); 259 raw_spin_unlock_irqrestore(&pmac_pic_lock, flags);
260 if (unlikely(irq < 0)) 260 if (unlikely(irq < 0))
261 return NO_IRQ; 261 return NO_IRQ;
262 return irq_linear_revmap(pmac_pic_host, irq); 262 return irq_linear_revmap(pmac_pic_host, irq);
diff --git a/arch/powerpc/platforms/powermac/smp.c b/arch/powerpc/platforms/powermac/smp.c
index b40c22d697f0..6898e8241cd0 100644
--- a/arch/powerpc/platforms/powermac/smp.c
+++ b/arch/powerpc/platforms/powermac/smp.c
@@ -693,9 +693,9 @@ static void __init smp_core99_setup(int ncpus)
693#ifdef CONFIG_PPC64 693#ifdef CONFIG_PPC64
694 694
695 /* i2c based HW sync on some G5s */ 695 /* i2c based HW sync on some G5s */
696 if (machine_is_compatible("PowerMac7,2") || 696 if (of_machine_is_compatible("PowerMac7,2") ||
697 machine_is_compatible("PowerMac7,3") || 697 of_machine_is_compatible("PowerMac7,3") ||
698 machine_is_compatible("RackMac3,1")) 698 of_machine_is_compatible("RackMac3,1"))
699 smp_core99_setup_i2c_hwsync(ncpus); 699 smp_core99_setup_i2c_hwsync(ncpus);
700 700
701 /* pfunc based HW sync on recent G5s */ 701 /* pfunc based HW sync on recent G5s */
@@ -713,7 +713,7 @@ static void __init smp_core99_setup(int ncpus)
713#else /* CONFIG_PPC64 */ 713#else /* CONFIG_PPC64 */
714 714
715 /* GPIO based HW sync on ppc32 Core99 */ 715 /* GPIO based HW sync on ppc32 Core99 */
716 if (pmac_tb_freeze == NULL && !machine_is_compatible("MacRISC4")) { 716 if (pmac_tb_freeze == NULL && !of_machine_is_compatible("MacRISC4")) {
717 struct device_node *cpu; 717 struct device_node *cpu;
718 const u32 *tbprop = NULL; 718 const u32 *tbprop = NULL;
719 719
@@ -750,7 +750,7 @@ static void __init smp_core99_setup(int ncpus)
750#endif 750#endif
751 751
752 /* 32 bits SMP can't NAP */ 752 /* 32 bits SMP can't NAP */
753 if (!machine_is_compatible("MacRISC4")) 753 if (!of_machine_is_compatible("MacRISC4"))
754 powersave_nap = 0; 754 powersave_nap = 0;
755} 755}
756 756
@@ -852,7 +852,7 @@ static void __devinit smp_core99_setup_cpu(int cpu_nr)
852 /* If we didn't start the second CPU, we must take 852 /* If we didn't start the second CPU, we must take
853 * it off the bus 853 * it off the bus
854 */ 854 */
855 if (machine_is_compatible("MacRISC4") && 855 if (of_machine_is_compatible("MacRISC4") &&
856 num_online_cpus() < 2) 856 num_online_cpus() < 2)
857 g5_phy_disable_cpu1(); 857 g5_phy_disable_cpu1();
858#endif /* CONFIG_PPC64 */ 858#endif /* CONFIG_PPC64 */
diff --git a/arch/powerpc/platforms/powermac/time.c b/arch/powerpc/platforms/powermac/time.c
index 1810e4226e56..48211ca134c3 100644
--- a/arch/powerpc/platforms/powermac/time.c
+++ b/arch/powerpc/platforms/powermac/time.c
@@ -317,9 +317,9 @@ void __init pmac_calibrate_decr(void)
317 * calibration. That's better since the VIA itself seems 317 * calibration. That's better since the VIA itself seems
318 * to be slightly off. --BenH 318 * to be slightly off. --BenH
319 */ 319 */
320 if (!machine_is_compatible("MacRISC2") && 320 if (!of_machine_is_compatible("MacRISC2") &&
321 !machine_is_compatible("MacRISC3") && 321 !of_machine_is_compatible("MacRISC3") &&
322 !machine_is_compatible("MacRISC4")) 322 !of_machine_is_compatible("MacRISC4"))
323 if (via_calibrate_decr()) 323 if (via_calibrate_decr())
324 return; 324 return;
325 325
@@ -328,7 +328,7 @@ void __init pmac_calibrate_decr(void)
328 * probably implement calibration based on the KL timer on these 328 * probably implement calibration based on the KL timer on these
329 * machines anyway... -BenH 329 * machines anyway... -BenH
330 */ 330 */
331 if (machine_is_compatible("PowerMac3,5")) 331 if (of_machine_is_compatible("PowerMac3,5"))
332 if (via_calibrate_decr()) 332 if (via_calibrate_decr())
333 return; 333 return;
334#endif 334#endif
diff --git a/arch/powerpc/platforms/powermac/udbg_scc.c b/arch/powerpc/platforms/powermac/udbg_scc.c
index 9490157da62e..d83135a9830e 100644
--- a/arch/powerpc/platforms/powermac/udbg_scc.c
+++ b/arch/powerpc/platforms/powermac/udbg_scc.c
@@ -132,9 +132,9 @@ void udbg_scc_init(int force_scc)
132 scc_inittab[1] = in_8(sccc); 132 scc_inittab[1] = in_8(sccc);
133 out_8(sccc, 12); 133 out_8(sccc, 12);
134 scc_inittab[3] = in_8(sccc); 134 scc_inittab[3] = in_8(sccc);
135 } else if (machine_is_compatible("RackMac1,1") 135 } else if (of_machine_is_compatible("RackMac1,1")
136 || machine_is_compatible("RackMac1,2") 136 || of_machine_is_compatible("RackMac1,2")
137 || machine_is_compatible("MacRISC4")) { 137 || of_machine_is_compatible("MacRISC4")) {
138 /* Xserves and G5s default to 57600 */ 138 /* Xserves and G5s default to 57600 */
139 scc_inittab[1] = 0; 139 scc_inittab[1] = 0;
140 scc_inittab[3] = 0; 140 scc_inittab[3] = 0;
diff --git a/arch/powerpc/platforms/pseries/eeh.c b/arch/powerpc/platforms/pseries/eeh.c
index ccd8dd03b8c9..7df7fbb7cacb 100644
--- a/arch/powerpc/platforms/pseries/eeh.c
+++ b/arch/powerpc/platforms/pseries/eeh.c
@@ -100,7 +100,7 @@ int eeh_subsystem_enabled;
100EXPORT_SYMBOL(eeh_subsystem_enabled); 100EXPORT_SYMBOL(eeh_subsystem_enabled);
101 101
102/* Lock to avoid races due to multiple reports of an error */ 102/* Lock to avoid races due to multiple reports of an error */
103static DEFINE_SPINLOCK(confirm_error_lock); 103static DEFINE_RAW_SPINLOCK(confirm_error_lock);
104 104
105/* Buffer for reporting slot-error-detail rtas calls. Its here 105/* Buffer for reporting slot-error-detail rtas calls. Its here
106 * in BSS, and not dynamically alloced, so that it ends up in 106 * in BSS, and not dynamically alloced, so that it ends up in
@@ -436,7 +436,7 @@ static void __eeh_clear_slot(struct device_node *parent, int mode_flag)
436void eeh_clear_slot (struct device_node *dn, int mode_flag) 436void eeh_clear_slot (struct device_node *dn, int mode_flag)
437{ 437{
438 unsigned long flags; 438 unsigned long flags;
439 spin_lock_irqsave(&confirm_error_lock, flags); 439 raw_spin_lock_irqsave(&confirm_error_lock, flags);
440 440
441 dn = find_device_pe (dn); 441 dn = find_device_pe (dn);
442 442
@@ -447,7 +447,7 @@ void eeh_clear_slot (struct device_node *dn, int mode_flag)
447 PCI_DN(dn)->eeh_mode &= ~mode_flag; 447 PCI_DN(dn)->eeh_mode &= ~mode_flag;
448 PCI_DN(dn)->eeh_check_count = 0; 448 PCI_DN(dn)->eeh_check_count = 0;
449 __eeh_clear_slot(dn, mode_flag); 449 __eeh_clear_slot(dn, mode_flag);
450 spin_unlock_irqrestore(&confirm_error_lock, flags); 450 raw_spin_unlock_irqrestore(&confirm_error_lock, flags);
451} 451}
452 452
453/** 453/**
@@ -491,7 +491,7 @@ int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev)
491 pdn->eeh_mode & EEH_MODE_NOCHECK) { 491 pdn->eeh_mode & EEH_MODE_NOCHECK) {
492 ignored_check++; 492 ignored_check++;
493 pr_debug("EEH: Ignored check (%x) for %s %s\n", 493 pr_debug("EEH: Ignored check (%x) for %s %s\n",
494 pdn->eeh_mode, pci_name (dev), dn->full_name); 494 pdn->eeh_mode, eeh_pci_name(dev), dn->full_name);
495 return 0; 495 return 0;
496 } 496 }
497 497
@@ -506,7 +506,7 @@ int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev)
506 * in one slot might report errors simultaneously, and we 506 * in one slot might report errors simultaneously, and we
507 * only want one error recovery routine running. 507 * only want one error recovery routine running.
508 */ 508 */
509 spin_lock_irqsave(&confirm_error_lock, flags); 509 raw_spin_lock_irqsave(&confirm_error_lock, flags);
510 rc = 1; 510 rc = 1;
511 if (pdn->eeh_mode & EEH_MODE_ISOLATED) { 511 if (pdn->eeh_mode & EEH_MODE_ISOLATED) {
512 pdn->eeh_check_count ++; 512 pdn->eeh_check_count ++;
@@ -515,7 +515,7 @@ int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev)
515 printk (KERN_ERR "EEH: %d reads ignored for recovering device at " 515 printk (KERN_ERR "EEH: %d reads ignored for recovering device at "
516 "location=%s driver=%s pci addr=%s\n", 516 "location=%s driver=%s pci addr=%s\n",
517 pdn->eeh_check_count, location, 517 pdn->eeh_check_count, location,
518 dev->driver->name, pci_name(dev)); 518 dev->driver->name, eeh_pci_name(dev));
519 printk (KERN_ERR "EEH: Might be infinite loop in %s driver\n", 519 printk (KERN_ERR "EEH: Might be infinite loop in %s driver\n",
520 dev->driver->name); 520 dev->driver->name);
521 dump_stack(); 521 dump_stack();
@@ -575,7 +575,7 @@ int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev)
575 * with other functions on this device, and functions under 575 * with other functions on this device, and functions under
576 * bridges. */ 576 * bridges. */
577 eeh_mark_slot (dn, EEH_MODE_ISOLATED); 577 eeh_mark_slot (dn, EEH_MODE_ISOLATED);
578 spin_unlock_irqrestore(&confirm_error_lock, flags); 578 raw_spin_unlock_irqrestore(&confirm_error_lock, flags);
579 579
580 eeh_send_failure_event (dn, dev); 580 eeh_send_failure_event (dn, dev);
581 581
@@ -586,7 +586,7 @@ int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev)
586 return 1; 586 return 1;
587 587
588dn_unlock: 588dn_unlock:
589 spin_unlock_irqrestore(&confirm_error_lock, flags); 589 raw_spin_unlock_irqrestore(&confirm_error_lock, flags);
590 return rc; 590 return rc;
591} 591}
592 592
@@ -1064,7 +1064,7 @@ void __init eeh_init(void)
1064 struct device_node *phb, *np; 1064 struct device_node *phb, *np;
1065 struct eeh_early_enable_info info; 1065 struct eeh_early_enable_info info;
1066 1066
1067 spin_lock_init(&confirm_error_lock); 1067 raw_spin_lock_init(&confirm_error_lock);
1068 spin_lock_init(&slot_errbuf_lock); 1068 spin_lock_init(&slot_errbuf_lock);
1069 1069
1070 np = of_find_node_by_path("/rtas"); 1070 np = of_find_node_by_path("/rtas");
diff --git a/arch/powerpc/platforms/pseries/eeh_driver.c b/arch/powerpc/platforms/pseries/eeh_driver.c
index ef8e45448480..b8d70f5d9aa9 100644
--- a/arch/powerpc/platforms/pseries/eeh_driver.c
+++ b/arch/powerpc/platforms/pseries/eeh_driver.c
@@ -337,7 +337,7 @@ struct pci_dn * handle_eeh_events (struct eeh_event *event)
337 location = location ? location : "unknown"; 337 location = location ? location : "unknown";
338 printk(KERN_ERR "EEH: Error: Cannot find partition endpoint " 338 printk(KERN_ERR "EEH: Error: Cannot find partition endpoint "
339 "for location=%s pci addr=%s\n", 339 "for location=%s pci addr=%s\n",
340 location, pci_name(event->dev)); 340 location, eeh_pci_name(event->dev));
341 return NULL; 341 return NULL;
342 } 342 }
343 343
@@ -368,7 +368,7 @@ struct pci_dn * handle_eeh_events (struct eeh_event *event)
368 pci_str = pci_name (frozen_pdn->pcidev); 368 pci_str = pci_name (frozen_pdn->pcidev);
369 drv_str = pcid_name (frozen_pdn->pcidev); 369 drv_str = pcid_name (frozen_pdn->pcidev);
370 } else { 370 } else {
371 pci_str = pci_name (event->dev); 371 pci_str = eeh_pci_name(event->dev);
372 drv_str = pcid_name (event->dev); 372 drv_str = pcid_name (event->dev);
373 } 373 }
374 374
@@ -478,9 +478,9 @@ excess_failures:
478 * due to actual, failed cards. 478 * due to actual, failed cards.
479 */ 479 */
480 printk(KERN_ERR 480 printk(KERN_ERR
481 "EEH: PCI device at location=%s driver=%s pci addr=%s \n" 481 "EEH: PCI device at location=%s driver=%s pci addr=%s\n"
482 "has failed %d times in the last hour " 482 "has failed %d times in the last hour "
483 "and has been permanently disabled. \n" 483 "and has been permanently disabled.\n"
484 "Please try reseating this device or replacing it.\n", 484 "Please try reseating this device or replacing it.\n",
485 location, drv_str, pci_str, frozen_pdn->eeh_freeze_count); 485 location, drv_str, pci_str, frozen_pdn->eeh_freeze_count);
486 goto perm_error; 486 goto perm_error;
@@ -488,7 +488,7 @@ excess_failures:
488hard_fail: 488hard_fail:
489 printk(KERN_ERR 489 printk(KERN_ERR
490 "EEH: Unable to recover from failure of PCI device " 490 "EEH: Unable to recover from failure of PCI device "
491 "at location=%s driver=%s pci addr=%s \n" 491 "at location=%s driver=%s pci addr=%s\n"
492 "Please try reseating this device or replacing it.\n", 492 "Please try reseating this device or replacing it.\n",
493 location, drv_str, pci_str); 493 location, drv_str, pci_str);
494 494
diff --git a/arch/powerpc/platforms/pseries/eeh_event.c b/arch/powerpc/platforms/pseries/eeh_event.c
index ddb80f5d850b..ec5df8f519c7 100644
--- a/arch/powerpc/platforms/pseries/eeh_event.c
+++ b/arch/powerpc/platforms/pseries/eeh_event.c
@@ -80,7 +80,7 @@ static int eeh_event_handler(void * dummy)
80 eeh_mark_slot(event->dn, EEH_MODE_RECOVERING); 80 eeh_mark_slot(event->dn, EEH_MODE_RECOVERING);
81 81
82 printk(KERN_INFO "EEH: Detected PCI bus error on device %s\n", 82 printk(KERN_INFO "EEH: Detected PCI bus error on device %s\n",
83 pci_name(event->dev)); 83 eeh_pci_name(event->dev));
84 84
85 pdn = handle_eeh_events(event); 85 pdn = handle_eeh_events(event);
86 86
diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c
index 6ea4698d9176..d1b124e44d77 100644
--- a/arch/powerpc/platforms/pseries/hotplug-cpu.c
+++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c
@@ -387,24 +387,12 @@ static char cede_parameters[CEDE_LATENCY_PARAM_MAX_LENGTH];
387 387
388static int parse_cede_parameters(void) 388static int parse_cede_parameters(void)
389{ 389{
390 int call_status;
391
392 memset(cede_parameters, 0, CEDE_LATENCY_PARAM_MAX_LENGTH); 390 memset(cede_parameters, 0, CEDE_LATENCY_PARAM_MAX_LENGTH);
393 call_status = rtas_call(rtas_token("ibm,get-system-parameter"), 3, 1, 391 return rtas_call(rtas_token("ibm,get-system-parameter"), 3, 1,
394 NULL, 392 NULL,
395 CEDE_LATENCY_TOKEN, 393 CEDE_LATENCY_TOKEN,
396 __pa(cede_parameters), 394 __pa(cede_parameters),
397 CEDE_LATENCY_PARAM_MAX_LENGTH); 395 CEDE_LATENCY_PARAM_MAX_LENGTH);
398
399 if (call_status != 0)
400 printk(KERN_INFO "CEDE_LATENCY: \
401 %s %s Error calling get-system-parameter(0x%x)\n",
402 __FILE__, __func__, call_status);
403 else
404 printk(KERN_INFO "CEDE_LATENCY: \
405 get-system-parameter successful.\n");
406
407 return call_status;
408} 396}
409 397
410static int __init pseries_cpu_hotplug_init(void) 398static int __init pseries_cpu_hotplug_init(void)
diff --git a/arch/powerpc/platforms/pseries/hvCall_inst.c b/arch/powerpc/platforms/pseries/hvCall_inst.c
index 2f58c71b7259..1fefae76e295 100644
--- a/arch/powerpc/platforms/pseries/hvCall_inst.c
+++ b/arch/powerpc/platforms/pseries/hvCall_inst.c
@@ -124,8 +124,8 @@ static void probe_hcall_exit(unsigned long opcode, unsigned long retval,
124 124
125 h = &__get_cpu_var(hcall_stats)[opcode / 4]; 125 h = &__get_cpu_var(hcall_stats)[opcode / 4];
126 h->num_calls++; 126 h->num_calls++;
127 h->tb_total = mftb() - h->tb_start; 127 h->tb_total += mftb() - h->tb_start;
128 h->purr_total = mfspr(SPRN_PURR) - h->purr_start; 128 h->purr_total += mfspr(SPRN_PURR) - h->purr_start;
129 129
130 put_cpu_var(hcall_stats); 130 put_cpu_var(hcall_stats);
131} 131}
diff --git a/arch/powerpc/platforms/pseries/pci_dlpar.c b/arch/powerpc/platforms/pseries/pci_dlpar.c
index b6fa3e4b51b5..4b7a062dee15 100644
--- a/arch/powerpc/platforms/pseries/pci_dlpar.c
+++ b/arch/powerpc/platforms/pseries/pci_dlpar.c
@@ -165,7 +165,7 @@ int remove_phb_dynamic(struct pci_controller *phb)
165 struct resource *res; 165 struct resource *res;
166 int rc, i; 166 int rc, i;
167 167
168 pr_debug("PCI: Removing PHB %04x:%02x... \n", 168 pr_debug("PCI: Removing PHB %04x:%02x...\n",
169 pci_domain_nr(b), b->number); 169 pci_domain_nr(b), b->number);
170 170
171 /* We cannot to remove a root bus that has children */ 171 /* We cannot to remove a root bus that has children */
diff --git a/arch/powerpc/platforms/pseries/phyp_dump.c b/arch/powerpc/platforms/pseries/phyp_dump.c
index 15eb6107bcd2..225a50ab14be 100644
--- a/arch/powerpc/platforms/pseries/phyp_dump.c
+++ b/arch/powerpc/platforms/pseries/phyp_dump.c
@@ -150,7 +150,7 @@ static void print_dump_header(const struct phyp_dump_header *ph)
150 printk(KERN_INFO "Max auto time= %d\n", ph->maxtime_to_auto); 150 printk(KERN_INFO "Max auto time= %d\n", ph->maxtime_to_auto);
151 151
152 /*set cpu state and hpte states as well scratch pad area */ 152 /*set cpu state and hpte states as well scratch pad area */
153 printk(KERN_INFO " CPU AREA \n"); 153 printk(KERN_INFO " CPU AREA\n");
154 printk(KERN_INFO "cpu dump_flags =%d\n", ph->cpu_data.dump_flags); 154 printk(KERN_INFO "cpu dump_flags =%d\n", ph->cpu_data.dump_flags);
155 printk(KERN_INFO "cpu source_type =%d\n", ph->cpu_data.source_type); 155 printk(KERN_INFO "cpu source_type =%d\n", ph->cpu_data.source_type);
156 printk(KERN_INFO "cpu error_flags =%d\n", ph->cpu_data.error_flags); 156 printk(KERN_INFO "cpu error_flags =%d\n", ph->cpu_data.error_flags);
@@ -161,7 +161,7 @@ static void print_dump_header(const struct phyp_dump_header *ph)
161 printk(KERN_INFO "cpu length_copied =%llx\n", 161 printk(KERN_INFO "cpu length_copied =%llx\n",
162 ph->cpu_data.length_copied); 162 ph->cpu_data.length_copied);
163 163
164 printk(KERN_INFO " HPTE AREA \n"); 164 printk(KERN_INFO " HPTE AREA\n");
165 printk(KERN_INFO "HPTE dump_flags =%d\n", ph->hpte_data.dump_flags); 165 printk(KERN_INFO "HPTE dump_flags =%d\n", ph->hpte_data.dump_flags);
166 printk(KERN_INFO "HPTE source_type =%d\n", ph->hpte_data.source_type); 166 printk(KERN_INFO "HPTE source_type =%d\n", ph->hpte_data.source_type);
167 printk(KERN_INFO "HPTE error_flags =%d\n", ph->hpte_data.error_flags); 167 printk(KERN_INFO "HPTE error_flags =%d\n", ph->hpte_data.error_flags);
@@ -172,7 +172,7 @@ static void print_dump_header(const struct phyp_dump_header *ph)
172 printk(KERN_INFO "HPTE length_copied =%llx\n", 172 printk(KERN_INFO "HPTE length_copied =%llx\n",
173 ph->hpte_data.length_copied); 173 ph->hpte_data.length_copied);
174 174
175 printk(KERN_INFO " SRSD AREA \n"); 175 printk(KERN_INFO " SRSD AREA\n");
176 printk(KERN_INFO "SRSD dump_flags =%d\n", ph->kernel_data.dump_flags); 176 printk(KERN_INFO "SRSD dump_flags =%d\n", ph->kernel_data.dump_flags);
177 printk(KERN_INFO "SRSD source_type =%d\n", ph->kernel_data.source_type); 177 printk(KERN_INFO "SRSD source_type =%d\n", ph->kernel_data.source_type);
178 printk(KERN_INFO "SRSD error_flags =%d\n", ph->kernel_data.error_flags); 178 printk(KERN_INFO "SRSD error_flags =%d\n", ph->kernel_data.error_flags);
diff --git a/arch/powerpc/platforms/pseries/smp.c b/arch/powerpc/platforms/pseries/smp.c
index b4886635972c..4e7f89a84561 100644
--- a/arch/powerpc/platforms/pseries/smp.c
+++ b/arch/powerpc/platforms/pseries/smp.c
@@ -144,8 +144,8 @@ static void __devinit smp_pSeries_kick_cpu(int nr)
144 hcpuid = get_hard_smp_processor_id(nr); 144 hcpuid = get_hard_smp_processor_id(nr);
145 rc = plpar_hcall_norets(H_PROD, hcpuid); 145 rc = plpar_hcall_norets(H_PROD, hcpuid);
146 if (rc != H_SUCCESS) 146 if (rc != H_SUCCESS)
147 printk(KERN_ERR "Error: Prod to wake up processor %d\ 147 printk(KERN_ERR "Error: Prod to wake up processor %d "
148 Ret= %ld\n", nr, rc); 148 "Ret= %ld\n", nr, rc);
149 } 149 }
150} 150}
151 151
diff --git a/arch/powerpc/platforms/pseries/xics.c b/arch/powerpc/platforms/pseries/xics.c
index f5f79196721c..4ca641042ec3 100644
--- a/arch/powerpc/platforms/pseries/xics.c
+++ b/arch/powerpc/platforms/pseries/xics.c
@@ -127,7 +127,7 @@ static inline unsigned int lpar_xirr_info_get(void)
127 127
128 lpar_rc = plpar_xirr(&return_value); 128 lpar_rc = plpar_xirr(&return_value);
129 if (lpar_rc != H_SUCCESS) 129 if (lpar_rc != H_SUCCESS)
130 panic(" bad return code xirr - rc = %lx \n", lpar_rc); 130 panic(" bad return code xirr - rc = %lx\n", lpar_rc);
131 return (unsigned int)return_value; 131 return (unsigned int)return_value;
132} 132}
133 133
@@ -424,7 +424,7 @@ static int xics_set_affinity(unsigned int virq, const struct cpumask *cpumask)
424} 424}
425 425
426static struct irq_chip xics_pic_direct = { 426static struct irq_chip xics_pic_direct = {
427 .name = " XICS ", 427 .name = "XICS",
428 .startup = xics_startup, 428 .startup = xics_startup,
429 .mask = xics_mask_irq, 429 .mask = xics_mask_irq,
430 .unmask = xics_unmask_irq, 430 .unmask = xics_unmask_irq,
@@ -433,7 +433,7 @@ static struct irq_chip xics_pic_direct = {
433}; 433};
434 434
435static struct irq_chip xics_pic_lpar = { 435static struct irq_chip xics_pic_lpar = {
436 .name = " XICS ", 436 .name = "XICS",
437 .startup = xics_startup, 437 .startup = xics_startup,
438 .mask = xics_mask_irq, 438 .mask = xics_mask_irq,
439 .unmask = xics_unmask_irq, 439 .unmask = xics_unmask_irq,
@@ -510,15 +510,13 @@ static void __init xics_init_host(void)
510/* 510/*
511 * XICS only has a single IPI, so encode the messages per CPU 511 * XICS only has a single IPI, so encode the messages per CPU
512 */ 512 */
513struct xics_ipi_struct { 513static DEFINE_PER_CPU_SHARED_ALIGNED(unsigned long, xics_ipi_message);
514 unsigned long value;
515 } ____cacheline_aligned;
516
517static struct xics_ipi_struct xics_ipi_message[NR_CPUS] __cacheline_aligned;
518 514
519static inline void smp_xics_do_message(int cpu, int msg) 515static inline void smp_xics_do_message(int cpu, int msg)
520{ 516{
521 set_bit(msg, &xics_ipi_message[cpu].value); 517 unsigned long *tgt = &per_cpu(xics_ipi_message, cpu);
518
519 set_bit(msg, tgt);
522 mb(); 520 mb();
523 if (firmware_has_feature(FW_FEATURE_LPAR)) 521 if (firmware_has_feature(FW_FEATURE_LPAR))
524 lpar_qirr_info(cpu, IPI_PRIORITY); 522 lpar_qirr_info(cpu, IPI_PRIORITY);
@@ -544,25 +542,23 @@ void smp_xics_message_pass(int target, int msg)
544 542
545static irqreturn_t xics_ipi_dispatch(int cpu) 543static irqreturn_t xics_ipi_dispatch(int cpu)
546{ 544{
545 unsigned long *tgt = &per_cpu(xics_ipi_message, cpu);
546
547 WARN_ON(cpu_is_offline(cpu)); 547 WARN_ON(cpu_is_offline(cpu));
548 548
549 mb(); /* order mmio clearing qirr */ 549 mb(); /* order mmio clearing qirr */
550 while (xics_ipi_message[cpu].value) { 550 while (*tgt) {
551 if (test_and_clear_bit(PPC_MSG_CALL_FUNCTION, 551 if (test_and_clear_bit(PPC_MSG_CALL_FUNCTION, tgt)) {
552 &xics_ipi_message[cpu].value)) {
553 smp_message_recv(PPC_MSG_CALL_FUNCTION); 552 smp_message_recv(PPC_MSG_CALL_FUNCTION);
554 } 553 }
555 if (test_and_clear_bit(PPC_MSG_RESCHEDULE, 554 if (test_and_clear_bit(PPC_MSG_RESCHEDULE, tgt)) {
556 &xics_ipi_message[cpu].value)) {
557 smp_message_recv(PPC_MSG_RESCHEDULE); 555 smp_message_recv(PPC_MSG_RESCHEDULE);
558 } 556 }
559 if (test_and_clear_bit(PPC_MSG_CALL_FUNC_SINGLE, 557 if (test_and_clear_bit(PPC_MSG_CALL_FUNC_SINGLE, tgt)) {
560 &xics_ipi_message[cpu].value)) {
561 smp_message_recv(PPC_MSG_CALL_FUNC_SINGLE); 558 smp_message_recv(PPC_MSG_CALL_FUNC_SINGLE);
562 } 559 }
563#if defined(CONFIG_DEBUGGER) || defined(CONFIG_KEXEC) 560#if defined(CONFIG_DEBUGGER) || defined(CONFIG_KEXEC)
564 if (test_and_clear_bit(PPC_MSG_DEBUGGER_BREAK, 561 if (test_and_clear_bit(PPC_MSG_DEBUGGER_BREAK, tgt)) {
565 &xics_ipi_message[cpu].value)) {
566 smp_message_recv(PPC_MSG_DEBUGGER_BREAK); 562 smp_message_recv(PPC_MSG_DEBUGGER_BREAK);
567 } 563 }
568#endif 564#endif
diff --git a/arch/powerpc/sysdev/cpm1.c b/arch/powerpc/sysdev/cpm1.c
index a4b41dbde128..ecad10d4e928 100644
--- a/arch/powerpc/sysdev/cpm1.c
+++ b/arch/powerpc/sysdev/cpm1.c
@@ -77,7 +77,7 @@ static void cpm_end_irq(unsigned int irq)
77} 77}
78 78
79static struct irq_chip cpm_pic = { 79static struct irq_chip cpm_pic = {
80 .name = " CPM PIC ", 80 .name = "CPM PIC",
81 .mask = cpm_mask_irq, 81 .mask = cpm_mask_irq,
82 .unmask = cpm_unmask_irq, 82 .unmask = cpm_unmask_irq,
83 .eoi = cpm_end_irq, 83 .eoi = cpm_end_irq,
diff --git a/arch/powerpc/sysdev/cpm2_pic.c b/arch/powerpc/sysdev/cpm2_pic.c
index 1709ac5aac7c..fcea4ff825dd 100644
--- a/arch/powerpc/sysdev/cpm2_pic.c
+++ b/arch/powerpc/sysdev/cpm2_pic.c
@@ -198,7 +198,7 @@ err_sense:
198} 198}
199 199
200static struct irq_chip cpm2_pic = { 200static struct irq_chip cpm2_pic = {
201 .name = " CPM2 SIU ", 201 .name = "CPM2 SIU",
202 .mask = cpm2_mask_irq, 202 .mask = cpm2_mask_irq,
203 .unmask = cpm2_unmask_irq, 203 .unmask = cpm2_unmask_irq,
204 .ack = cpm2_ack, 204 .ack = cpm2_ack,
diff --git a/arch/powerpc/sysdev/fsl_msi.c b/arch/powerpc/sysdev/fsl_msi.c
index c6e11b077108..e094367d7739 100644
--- a/arch/powerpc/sysdev/fsl_msi.c
+++ b/arch/powerpc/sysdev/fsl_msi.c
@@ -47,7 +47,7 @@ static struct irq_chip fsl_msi_chip = {
47 .mask = mask_msi_irq, 47 .mask = mask_msi_irq,
48 .unmask = unmask_msi_irq, 48 .unmask = unmask_msi_irq,
49 .ack = fsl_msi_end_irq, 49 .ack = fsl_msi_end_irq,
50 .name = " FSL-MSI ", 50 .name = "FSL-MSI",
51}; 51};
52 52
53static int fsl_msi_host_map(struct irq_host *h, unsigned int virq, 53static int fsl_msi_host_map(struct irq_host *h, unsigned int virq,
diff --git a/arch/powerpc/sysdev/grackle.c b/arch/powerpc/sysdev/grackle.c
index 5da37c2f22ee..cf27df6e508b 100644
--- a/arch/powerpc/sysdev/grackle.c
+++ b/arch/powerpc/sysdev/grackle.c
@@ -56,9 +56,9 @@ static inline void grackle_set_loop_snoop(struct pci_controller *bp, int enable)
56void __init setup_grackle(struct pci_controller *hose) 56void __init setup_grackle(struct pci_controller *hose)
57{ 57{
58 setup_indirect_pci(hose, 0xfec00000, 0xfee00000, 0); 58 setup_indirect_pci(hose, 0xfec00000, 0xfee00000, 0);
59 if (machine_is_compatible("PowerMac1,1")) 59 if (of_machine_is_compatible("PowerMac1,1"))
60 ppc_pci_add_flags(PPC_PCI_REASSIGN_ALL_BUS); 60 ppc_pci_add_flags(PPC_PCI_REASSIGN_ALL_BUS);
61 if (machine_is_compatible("AAPL,PowerBook1998")) 61 if (of_machine_is_compatible("AAPL,PowerBook1998"))
62 grackle_set_loop_snoop(hose, 1); 62 grackle_set_loop_snoop(hose, 1);
63#if 0 /* Disabled for now, HW problems ??? */ 63#if 0 /* Disabled for now, HW problems ??? */
64 grackle_set_stg(hose, 1); 64 grackle_set_stg(hose, 1);
diff --git a/arch/powerpc/sysdev/i8259.c b/arch/powerpc/sysdev/i8259.c
index 0a55db8a5a29..6323e70e6bf4 100644
--- a/arch/powerpc/sysdev/i8259.c
+++ b/arch/powerpc/sysdev/i8259.c
@@ -23,7 +23,7 @@ static unsigned char cached_8259[2] = { 0xff, 0xff };
23#define cached_A1 (cached_8259[0]) 23#define cached_A1 (cached_8259[0])
24#define cached_21 (cached_8259[1]) 24#define cached_21 (cached_8259[1])
25 25
26static DEFINE_SPINLOCK(i8259_lock); 26static DEFINE_RAW_SPINLOCK(i8259_lock);
27 27
28static struct irq_host *i8259_host; 28static struct irq_host *i8259_host;
29 29
@@ -42,7 +42,7 @@ unsigned int i8259_irq(void)
42 if (pci_intack) 42 if (pci_intack)
43 irq = readb(pci_intack); 43 irq = readb(pci_intack);
44 else { 44 else {
45 spin_lock(&i8259_lock); 45 raw_spin_lock(&i8259_lock);
46 lock = 1; 46 lock = 1;
47 47
48 /* Perform an interrupt acknowledge cycle on controller 1. */ 48 /* Perform an interrupt acknowledge cycle on controller 1. */
@@ -74,7 +74,7 @@ unsigned int i8259_irq(void)
74 irq = NO_IRQ; 74 irq = NO_IRQ;
75 75
76 if (lock) 76 if (lock)
77 spin_unlock(&i8259_lock); 77 raw_spin_unlock(&i8259_lock);
78 return irq; 78 return irq;
79} 79}
80 80
@@ -82,7 +82,7 @@ static void i8259_mask_and_ack_irq(unsigned int irq_nr)
82{ 82{
83 unsigned long flags; 83 unsigned long flags;
84 84
85 spin_lock_irqsave(&i8259_lock, flags); 85 raw_spin_lock_irqsave(&i8259_lock, flags);
86 if (irq_nr > 7) { 86 if (irq_nr > 7) {
87 cached_A1 |= 1 << (irq_nr-8); 87 cached_A1 |= 1 << (irq_nr-8);
88 inb(0xA1); /* DUMMY */ 88 inb(0xA1); /* DUMMY */
@@ -95,7 +95,7 @@ static void i8259_mask_and_ack_irq(unsigned int irq_nr)
95 outb(cached_21, 0x21); 95 outb(cached_21, 0x21);
96 outb(0x20, 0x20); /* Non-specific EOI */ 96 outb(0x20, 0x20); /* Non-specific EOI */
97 } 97 }
98 spin_unlock_irqrestore(&i8259_lock, flags); 98 raw_spin_unlock_irqrestore(&i8259_lock, flags);
99} 99}
100 100
101static void i8259_set_irq_mask(int irq_nr) 101static void i8259_set_irq_mask(int irq_nr)
@@ -110,13 +110,13 @@ static void i8259_mask_irq(unsigned int irq_nr)
110 110
111 pr_debug("i8259_mask_irq(%d)\n", irq_nr); 111 pr_debug("i8259_mask_irq(%d)\n", irq_nr);
112 112
113 spin_lock_irqsave(&i8259_lock, flags); 113 raw_spin_lock_irqsave(&i8259_lock, flags);
114 if (irq_nr < 8) 114 if (irq_nr < 8)
115 cached_21 |= 1 << irq_nr; 115 cached_21 |= 1 << irq_nr;
116 else 116 else
117 cached_A1 |= 1 << (irq_nr-8); 117 cached_A1 |= 1 << (irq_nr-8);
118 i8259_set_irq_mask(irq_nr); 118 i8259_set_irq_mask(irq_nr);
119 spin_unlock_irqrestore(&i8259_lock, flags); 119 raw_spin_unlock_irqrestore(&i8259_lock, flags);
120} 120}
121 121
122static void i8259_unmask_irq(unsigned int irq_nr) 122static void i8259_unmask_irq(unsigned int irq_nr)
@@ -125,17 +125,17 @@ static void i8259_unmask_irq(unsigned int irq_nr)
125 125
126 pr_debug("i8259_unmask_irq(%d)\n", irq_nr); 126 pr_debug("i8259_unmask_irq(%d)\n", irq_nr);
127 127
128 spin_lock_irqsave(&i8259_lock, flags); 128 raw_spin_lock_irqsave(&i8259_lock, flags);
129 if (irq_nr < 8) 129 if (irq_nr < 8)
130 cached_21 &= ~(1 << irq_nr); 130 cached_21 &= ~(1 << irq_nr);
131 else 131 else
132 cached_A1 &= ~(1 << (irq_nr-8)); 132 cached_A1 &= ~(1 << (irq_nr-8));
133 i8259_set_irq_mask(irq_nr); 133 i8259_set_irq_mask(irq_nr);
134 spin_unlock_irqrestore(&i8259_lock, flags); 134 raw_spin_unlock_irqrestore(&i8259_lock, flags);
135} 135}
136 136
137static struct irq_chip i8259_pic = { 137static struct irq_chip i8259_pic = {
138 .name = " i8259 ", 138 .name = "i8259",
139 .mask = i8259_mask_irq, 139 .mask = i8259_mask_irq,
140 .disable = i8259_mask_irq, 140 .disable = i8259_mask_irq,
141 .unmask = i8259_unmask_irq, 141 .unmask = i8259_unmask_irq,
@@ -241,7 +241,7 @@ void i8259_init(struct device_node *node, unsigned long intack_addr)
241 unsigned long flags; 241 unsigned long flags;
242 242
243 /* initialize the controller */ 243 /* initialize the controller */
244 spin_lock_irqsave(&i8259_lock, flags); 244 raw_spin_lock_irqsave(&i8259_lock, flags);
245 245
246 /* Mask all first */ 246 /* Mask all first */
247 outb(0xff, 0xA1); 247 outb(0xff, 0xA1);
@@ -273,7 +273,7 @@ void i8259_init(struct device_node *node, unsigned long intack_addr)
273 outb(cached_A1, 0xA1); 273 outb(cached_A1, 0xA1);
274 outb(cached_21, 0x21); 274 outb(cached_21, 0x21);
275 275
276 spin_unlock_irqrestore(&i8259_lock, flags); 276 raw_spin_unlock_irqrestore(&i8259_lock, flags);
277 277
278 /* create a legacy host */ 278 /* create a legacy host */
279 i8259_host = irq_alloc_host(node, IRQ_HOST_MAP_LEGACY, 279 i8259_host = irq_alloc_host(node, IRQ_HOST_MAP_LEGACY,
diff --git a/arch/powerpc/sysdev/ipic.c b/arch/powerpc/sysdev/ipic.c
index 28cdddd2f89e..d7b9b9c69287 100644
--- a/arch/powerpc/sysdev/ipic.c
+++ b/arch/powerpc/sysdev/ipic.c
@@ -32,7 +32,7 @@
32 32
33static struct ipic * primary_ipic; 33static struct ipic * primary_ipic;
34static struct irq_chip ipic_level_irq_chip, ipic_edge_irq_chip; 34static struct irq_chip ipic_level_irq_chip, ipic_edge_irq_chip;
35static DEFINE_SPINLOCK(ipic_lock); 35static DEFINE_RAW_SPINLOCK(ipic_lock);
36 36
37static struct ipic_info ipic_info[] = { 37static struct ipic_info ipic_info[] = {
38 [1] = { 38 [1] = {
@@ -530,13 +530,13 @@ static void ipic_unmask_irq(unsigned int virq)
530 unsigned long flags; 530 unsigned long flags;
531 u32 temp; 531 u32 temp;
532 532
533 spin_lock_irqsave(&ipic_lock, flags); 533 raw_spin_lock_irqsave(&ipic_lock, flags);
534 534
535 temp = ipic_read(ipic->regs, ipic_info[src].mask); 535 temp = ipic_read(ipic->regs, ipic_info[src].mask);
536 temp |= (1 << (31 - ipic_info[src].bit)); 536 temp |= (1 << (31 - ipic_info[src].bit));
537 ipic_write(ipic->regs, ipic_info[src].mask, temp); 537 ipic_write(ipic->regs, ipic_info[src].mask, temp);
538 538
539 spin_unlock_irqrestore(&ipic_lock, flags); 539 raw_spin_unlock_irqrestore(&ipic_lock, flags);
540} 540}
541 541
542static void ipic_mask_irq(unsigned int virq) 542static void ipic_mask_irq(unsigned int virq)
@@ -546,7 +546,7 @@ static void ipic_mask_irq(unsigned int virq)
546 unsigned long flags; 546 unsigned long flags;
547 u32 temp; 547 u32 temp;
548 548
549 spin_lock_irqsave(&ipic_lock, flags); 549 raw_spin_lock_irqsave(&ipic_lock, flags);
550 550
551 temp = ipic_read(ipic->regs, ipic_info[src].mask); 551 temp = ipic_read(ipic->regs, ipic_info[src].mask);
552 temp &= ~(1 << (31 - ipic_info[src].bit)); 552 temp &= ~(1 << (31 - ipic_info[src].bit));
@@ -556,7 +556,7 @@ static void ipic_mask_irq(unsigned int virq)
556 * for nearly all cases. */ 556 * for nearly all cases. */
557 mb(); 557 mb();
558 558
559 spin_unlock_irqrestore(&ipic_lock, flags); 559 raw_spin_unlock_irqrestore(&ipic_lock, flags);
560} 560}
561 561
562static void ipic_ack_irq(unsigned int virq) 562static void ipic_ack_irq(unsigned int virq)
@@ -566,7 +566,7 @@ static void ipic_ack_irq(unsigned int virq)
566 unsigned long flags; 566 unsigned long flags;
567 u32 temp; 567 u32 temp;
568 568
569 spin_lock_irqsave(&ipic_lock, flags); 569 raw_spin_lock_irqsave(&ipic_lock, flags);
570 570
571 temp = 1 << (31 - ipic_info[src].bit); 571 temp = 1 << (31 - ipic_info[src].bit);
572 ipic_write(ipic->regs, ipic_info[src].ack, temp); 572 ipic_write(ipic->regs, ipic_info[src].ack, temp);
@@ -575,7 +575,7 @@ static void ipic_ack_irq(unsigned int virq)
575 * for nearly all cases. */ 575 * for nearly all cases. */
576 mb(); 576 mb();
577 577
578 spin_unlock_irqrestore(&ipic_lock, flags); 578 raw_spin_unlock_irqrestore(&ipic_lock, flags);
579} 579}
580 580
581static void ipic_mask_irq_and_ack(unsigned int virq) 581static void ipic_mask_irq_and_ack(unsigned int virq)
@@ -585,7 +585,7 @@ static void ipic_mask_irq_and_ack(unsigned int virq)
585 unsigned long flags; 585 unsigned long flags;
586 u32 temp; 586 u32 temp;
587 587
588 spin_lock_irqsave(&ipic_lock, flags); 588 raw_spin_lock_irqsave(&ipic_lock, flags);
589 589
590 temp = ipic_read(ipic->regs, ipic_info[src].mask); 590 temp = ipic_read(ipic->regs, ipic_info[src].mask);
591 temp &= ~(1 << (31 - ipic_info[src].bit)); 591 temp &= ~(1 << (31 - ipic_info[src].bit));
@@ -598,7 +598,7 @@ static void ipic_mask_irq_and_ack(unsigned int virq)
598 * for nearly all cases. */ 598 * for nearly all cases. */
599 mb(); 599 mb();
600 600
601 spin_unlock_irqrestore(&ipic_lock, flags); 601 raw_spin_unlock_irqrestore(&ipic_lock, flags);
602} 602}
603 603
604static int ipic_set_irq_type(unsigned int virq, unsigned int flow_type) 604static int ipic_set_irq_type(unsigned int virq, unsigned int flow_type)
@@ -660,7 +660,7 @@ static int ipic_set_irq_type(unsigned int virq, unsigned int flow_type)
660 660
661/* level interrupts and edge interrupts have different ack operations */ 661/* level interrupts and edge interrupts have different ack operations */
662static struct irq_chip ipic_level_irq_chip = { 662static struct irq_chip ipic_level_irq_chip = {
663 .name = " IPIC ", 663 .name = "IPIC",
664 .unmask = ipic_unmask_irq, 664 .unmask = ipic_unmask_irq,
665 .mask = ipic_mask_irq, 665 .mask = ipic_mask_irq,
666 .mask_ack = ipic_mask_irq, 666 .mask_ack = ipic_mask_irq,
@@ -668,7 +668,7 @@ static struct irq_chip ipic_level_irq_chip = {
668}; 668};
669 669
670static struct irq_chip ipic_edge_irq_chip = { 670static struct irq_chip ipic_edge_irq_chip = {
671 .name = " IPIC ", 671 .name = "IPIC",
672 .unmask = ipic_unmask_irq, 672 .unmask = ipic_unmask_irq,
673 .mask = ipic_mask_irq, 673 .mask = ipic_mask_irq,
674 .mask_ack = ipic_mask_irq_and_ack, 674 .mask_ack = ipic_mask_irq_and_ack,
diff --git a/arch/powerpc/sysdev/mpc8xx_pic.c b/arch/powerpc/sysdev/mpc8xx_pic.c
index 69bd6f4dff83..8c27d261aba8 100644
--- a/arch/powerpc/sysdev/mpc8xx_pic.c
+++ b/arch/powerpc/sysdev/mpc8xx_pic.c
@@ -94,7 +94,7 @@ static int mpc8xx_set_irq_type(unsigned int virq, unsigned int flow_type)
94} 94}
95 95
96static struct irq_chip mpc8xx_pic = { 96static struct irq_chip mpc8xx_pic = {
97 .name = " MPC8XX SIU ", 97 .name = "MPC8XX SIU",
98 .unmask = mpc8xx_unmask_irq, 98 .unmask = mpc8xx_unmask_irq,
99 .mask = mpc8xx_mask_irq, 99 .mask = mpc8xx_mask_irq,
100 .ack = mpc8xx_ack, 100 .ack = mpc8xx_ack,
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index 470dc6c11d57..339e8a3e26d2 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -46,7 +46,7 @@
46 46
47static struct mpic *mpics; 47static struct mpic *mpics;
48static struct mpic *mpic_primary; 48static struct mpic *mpic_primary;
49static DEFINE_SPINLOCK(mpic_lock); 49static DEFINE_RAW_SPINLOCK(mpic_lock);
50 50
51#ifdef CONFIG_PPC32 /* XXX for now */ 51#ifdef CONFIG_PPC32 /* XXX for now */
52#ifdef CONFIG_IRQ_ALL_CPUS 52#ifdef CONFIG_IRQ_ALL_CPUS
@@ -347,10 +347,10 @@ static inline void mpic_ht_end_irq(struct mpic *mpic, unsigned int source)
347 unsigned int mask = 1U << (fixup->index & 0x1f); 347 unsigned int mask = 1U << (fixup->index & 0x1f);
348 writel(mask, fixup->applebase + soff); 348 writel(mask, fixup->applebase + soff);
349 } else { 349 } else {
350 spin_lock(&mpic->fixup_lock); 350 raw_spin_lock(&mpic->fixup_lock);
351 writeb(0x11 + 2 * fixup->index, fixup->base + 2); 351 writeb(0x11 + 2 * fixup->index, fixup->base + 2);
352 writel(fixup->data, fixup->base + 4); 352 writel(fixup->data, fixup->base + 4);
353 spin_unlock(&mpic->fixup_lock); 353 raw_spin_unlock(&mpic->fixup_lock);
354 } 354 }
355} 355}
356 356
@@ -366,7 +366,7 @@ static void mpic_startup_ht_interrupt(struct mpic *mpic, unsigned int source,
366 366
367 DBG("startup_ht_interrupt(0x%x, 0x%x) index: %d\n", 367 DBG("startup_ht_interrupt(0x%x, 0x%x) index: %d\n",
368 source, irqflags, fixup->index); 368 source, irqflags, fixup->index);
369 spin_lock_irqsave(&mpic->fixup_lock, flags); 369 raw_spin_lock_irqsave(&mpic->fixup_lock, flags);
370 /* Enable and configure */ 370 /* Enable and configure */
371 writeb(0x10 + 2 * fixup->index, fixup->base + 2); 371 writeb(0x10 + 2 * fixup->index, fixup->base + 2);
372 tmp = readl(fixup->base + 4); 372 tmp = readl(fixup->base + 4);
@@ -374,7 +374,7 @@ static void mpic_startup_ht_interrupt(struct mpic *mpic, unsigned int source,
374 if (irqflags & IRQ_LEVEL) 374 if (irqflags & IRQ_LEVEL)
375 tmp |= 0x22; 375 tmp |= 0x22;
376 writel(tmp, fixup->base + 4); 376 writel(tmp, fixup->base + 4);
377 spin_unlock_irqrestore(&mpic->fixup_lock, flags); 377 raw_spin_unlock_irqrestore(&mpic->fixup_lock, flags);
378 378
379#ifdef CONFIG_PM 379#ifdef CONFIG_PM
380 /* use the lowest bit inverted to the actual HW, 380 /* use the lowest bit inverted to the actual HW,
@@ -396,12 +396,12 @@ static void mpic_shutdown_ht_interrupt(struct mpic *mpic, unsigned int source,
396 DBG("shutdown_ht_interrupt(0x%x, 0x%x)\n", source, irqflags); 396 DBG("shutdown_ht_interrupt(0x%x, 0x%x)\n", source, irqflags);
397 397
398 /* Disable */ 398 /* Disable */
399 spin_lock_irqsave(&mpic->fixup_lock, flags); 399 raw_spin_lock_irqsave(&mpic->fixup_lock, flags);
400 writeb(0x10 + 2 * fixup->index, fixup->base + 2); 400 writeb(0x10 + 2 * fixup->index, fixup->base + 2);
401 tmp = readl(fixup->base + 4); 401 tmp = readl(fixup->base + 4);
402 tmp |= 1; 402 tmp |= 1;
403 writel(tmp, fixup->base + 4); 403 writel(tmp, fixup->base + 4);
404 spin_unlock_irqrestore(&mpic->fixup_lock, flags); 404 raw_spin_unlock_irqrestore(&mpic->fixup_lock, flags);
405 405
406#ifdef CONFIG_PM 406#ifdef CONFIG_PM
407 /* use the lowest bit inverted to the actual HW, 407 /* use the lowest bit inverted to the actual HW,
@@ -515,7 +515,7 @@ static void __init mpic_scan_ht_pics(struct mpic *mpic)
515 BUG_ON(mpic->fixups == NULL); 515 BUG_ON(mpic->fixups == NULL);
516 516
517 /* Init spinlock */ 517 /* Init spinlock */
518 spin_lock_init(&mpic->fixup_lock); 518 raw_spin_lock_init(&mpic->fixup_lock);
519 519
520 /* Map U3 config space. We assume all IO-APICs are on the primary bus 520 /* Map U3 config space. We assume all IO-APICs are on the primary bus
521 * so we only need to map 64kB. 521 * so we only need to map 64kB.
@@ -573,12 +573,12 @@ static int irq_choose_cpu(const cpumask_t *mask)
573 573
574 if (cpumask_equal(mask, cpu_all_mask)) { 574 if (cpumask_equal(mask, cpu_all_mask)) {
575 static int irq_rover; 575 static int irq_rover;
576 static DEFINE_SPINLOCK(irq_rover_lock); 576 static DEFINE_RAW_SPINLOCK(irq_rover_lock);
577 unsigned long flags; 577 unsigned long flags;
578 578
579 /* Round-robin distribution... */ 579 /* Round-robin distribution... */
580 do_round_robin: 580 do_round_robin:
581 spin_lock_irqsave(&irq_rover_lock, flags); 581 raw_spin_lock_irqsave(&irq_rover_lock, flags);
582 582
583 while (!cpu_online(irq_rover)) { 583 while (!cpu_online(irq_rover)) {
584 if (++irq_rover >= NR_CPUS) 584 if (++irq_rover >= NR_CPUS)
@@ -590,7 +590,7 @@ static int irq_choose_cpu(const cpumask_t *mask)
590 irq_rover = 0; 590 irq_rover = 0;
591 } while (!cpu_online(irq_rover)); 591 } while (!cpu_online(irq_rover));
592 592
593 spin_unlock_irqrestore(&irq_rover_lock, flags); 593 raw_spin_unlock_irqrestore(&irq_rover_lock, flags);
594 } else { 594 } else {
595 cpuid = cpumask_first_and(mask, cpu_online_mask); 595 cpuid = cpumask_first_and(mask, cpu_online_mask);
596 if (cpuid >= nr_cpu_ids) 596 if (cpuid >= nr_cpu_ids)
@@ -1368,14 +1368,14 @@ void __init mpic_set_serial_int(struct mpic *mpic, int enable)
1368 unsigned long flags; 1368 unsigned long flags;
1369 u32 v; 1369 u32 v;
1370 1370
1371 spin_lock_irqsave(&mpic_lock, flags); 1371 raw_spin_lock_irqsave(&mpic_lock, flags);
1372 v = mpic_read(mpic->gregs, MPIC_GREG_GLOBAL_CONF_1); 1372 v = mpic_read(mpic->gregs, MPIC_GREG_GLOBAL_CONF_1);
1373 if (enable) 1373 if (enable)
1374 v |= MPIC_GREG_GLOBAL_CONF_1_SIE; 1374 v |= MPIC_GREG_GLOBAL_CONF_1_SIE;
1375 else 1375 else
1376 v &= ~MPIC_GREG_GLOBAL_CONF_1_SIE; 1376 v &= ~MPIC_GREG_GLOBAL_CONF_1_SIE;
1377 mpic_write(mpic->gregs, MPIC_GREG_GLOBAL_CONF_1, v); 1377 mpic_write(mpic->gregs, MPIC_GREG_GLOBAL_CONF_1, v);
1378 spin_unlock_irqrestore(&mpic_lock, flags); 1378 raw_spin_unlock_irqrestore(&mpic_lock, flags);
1379} 1379}
1380 1380
1381void mpic_irq_set_priority(unsigned int irq, unsigned int pri) 1381void mpic_irq_set_priority(unsigned int irq, unsigned int pri)
@@ -1388,7 +1388,7 @@ void mpic_irq_set_priority(unsigned int irq, unsigned int pri)
1388 if (!mpic) 1388 if (!mpic)
1389 return; 1389 return;
1390 1390
1391 spin_lock_irqsave(&mpic_lock, flags); 1391 raw_spin_lock_irqsave(&mpic_lock, flags);
1392 if (mpic_is_ipi(mpic, irq)) { 1392 if (mpic_is_ipi(mpic, irq)) {
1393 reg = mpic_ipi_read(src - mpic->ipi_vecs[0]) & 1393 reg = mpic_ipi_read(src - mpic->ipi_vecs[0]) &
1394 ~MPIC_VECPRI_PRIORITY_MASK; 1394 ~MPIC_VECPRI_PRIORITY_MASK;
@@ -1400,7 +1400,7 @@ void mpic_irq_set_priority(unsigned int irq, unsigned int pri)
1400 mpic_irq_write(src, MPIC_INFO(IRQ_VECTOR_PRI), 1400 mpic_irq_write(src, MPIC_INFO(IRQ_VECTOR_PRI),
1401 reg | (pri << MPIC_VECPRI_PRIORITY_SHIFT)); 1401 reg | (pri << MPIC_VECPRI_PRIORITY_SHIFT));
1402 } 1402 }
1403 spin_unlock_irqrestore(&mpic_lock, flags); 1403 raw_spin_unlock_irqrestore(&mpic_lock, flags);
1404} 1404}
1405 1405
1406void mpic_setup_this_cpu(void) 1406void mpic_setup_this_cpu(void)
@@ -1415,7 +1415,7 @@ void mpic_setup_this_cpu(void)
1415 1415
1416 DBG("%s: setup_this_cpu(%d)\n", mpic->name, hard_smp_processor_id()); 1416 DBG("%s: setup_this_cpu(%d)\n", mpic->name, hard_smp_processor_id());
1417 1417
1418 spin_lock_irqsave(&mpic_lock, flags); 1418 raw_spin_lock_irqsave(&mpic_lock, flags);
1419 1419
1420 /* let the mpic know we want intrs. default affinity is 0xffffffff 1420 /* let the mpic know we want intrs. default affinity is 0xffffffff
1421 * until changed via /proc. That's how it's done on x86. If we want 1421 * until changed via /proc. That's how it's done on x86. If we want
@@ -1431,7 +1431,7 @@ void mpic_setup_this_cpu(void)
1431 /* Set current processor priority to 0 */ 1431 /* Set current processor priority to 0 */
1432 mpic_cpu_write(MPIC_INFO(CPU_CURRENT_TASK_PRI), 0); 1432 mpic_cpu_write(MPIC_INFO(CPU_CURRENT_TASK_PRI), 0);
1433 1433
1434 spin_unlock_irqrestore(&mpic_lock, flags); 1434 raw_spin_unlock_irqrestore(&mpic_lock, flags);
1435#endif /* CONFIG_SMP */ 1435#endif /* CONFIG_SMP */
1436} 1436}
1437 1437
@@ -1460,7 +1460,7 @@ void mpic_teardown_this_cpu(int secondary)
1460 BUG_ON(mpic == NULL); 1460 BUG_ON(mpic == NULL);
1461 1461
1462 DBG("%s: teardown_this_cpu(%d)\n", mpic->name, hard_smp_processor_id()); 1462 DBG("%s: teardown_this_cpu(%d)\n", mpic->name, hard_smp_processor_id());
1463 spin_lock_irqsave(&mpic_lock, flags); 1463 raw_spin_lock_irqsave(&mpic_lock, flags);
1464 1464
1465 /* let the mpic know we don't want intrs. */ 1465 /* let the mpic know we don't want intrs. */
1466 for (i = 0; i < mpic->num_sources ; i++) 1466 for (i = 0; i < mpic->num_sources ; i++)
@@ -1474,7 +1474,7 @@ void mpic_teardown_this_cpu(int secondary)
1474 */ 1474 */
1475 mpic_eoi(mpic); 1475 mpic_eoi(mpic);
1476 1476
1477 spin_unlock_irqrestore(&mpic_lock, flags); 1477 raw_spin_unlock_irqrestore(&mpic_lock, flags);
1478} 1478}
1479 1479
1480 1480
@@ -1575,7 +1575,7 @@ void mpic_request_ipis(void)
1575 int i; 1575 int i;
1576 BUG_ON(mpic == NULL); 1576 BUG_ON(mpic == NULL);
1577 1577
1578 printk(KERN_INFO "mpic: requesting IPIs ... \n"); 1578 printk(KERN_INFO "mpic: requesting IPIs...\n");
1579 1579
1580 for (i = 0; i < 4; i++) { 1580 for (i = 0; i < 4; i++) {
1581 unsigned int vipi = irq_create_mapping(mpic->irqhost, 1581 unsigned int vipi = irq_create_mapping(mpic->irqhost,
diff --git a/arch/powerpc/sysdev/mpic_pasemi_msi.c b/arch/powerpc/sysdev/mpic_pasemi_msi.c
index 0f6ab06f8474..3b6a9a43718f 100644
--- a/arch/powerpc/sysdev/mpic_pasemi_msi.c
+++ b/arch/powerpc/sysdev/mpic_pasemi_msi.c
@@ -60,7 +60,7 @@ static struct irq_chip mpic_pasemi_msi_chip = {
60 .eoi = mpic_end_irq, 60 .eoi = mpic_end_irq,
61 .set_type = mpic_set_irq_type, 61 .set_type = mpic_set_irq_type,
62 .set_affinity = mpic_set_affinity, 62 .set_affinity = mpic_set_affinity,
63 .name = "PASEMI-MSI ", 63 .name = "PASEMI-MSI",
64}; 64};
65 65
66static int pasemi_msi_check_device(struct pci_dev *pdev, int nvec, int type) 66static int pasemi_msi_check_device(struct pci_dev *pdev, int nvec, int type)
diff --git a/arch/powerpc/sysdev/mv64x60_dev.c b/arch/powerpc/sysdev/mv64x60_dev.c
index b6bd775d2e22..31acd3b1718b 100644
--- a/arch/powerpc/sysdev/mv64x60_dev.c
+++ b/arch/powerpc/sysdev/mv64x60_dev.c
@@ -16,6 +16,7 @@
16#include <linux/mv643xx.h> 16#include <linux/mv643xx.h>
17#include <linux/platform_device.h> 17#include <linux/platform_device.h>
18#include <linux/of_platform.h> 18#include <linux/of_platform.h>
19#include <linux/dma-mapping.h>
19 20
20#include <asm/prom.h> 21#include <asm/prom.h>
21 22
@@ -189,6 +190,7 @@ static int __init mv64x60_mpsc_device_setup(struct device_node *np, int id)
189 pdev = platform_device_alloc(MPSC_CTLR_NAME, port_number); 190 pdev = platform_device_alloc(MPSC_CTLR_NAME, port_number);
190 if (!pdev) 191 if (!pdev)
191 return -ENOMEM; 192 return -ENOMEM;
193 pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
192 194
193 err = platform_device_add_resources(pdev, r, 5); 195 err = platform_device_add_resources(pdev, r, 5);
194 if (err) 196 if (err)
@@ -302,6 +304,7 @@ static int __init mv64x60_eth_device_setup(struct device_node *np, int id,
302 if (!pdev) 304 if (!pdev)
303 return -ENOMEM; 305 return -ENOMEM;
304 306
307 pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
305 err = platform_device_add_resources(pdev, r, 1); 308 err = platform_device_add_resources(pdev, r, 1);
306 if (err) 309 if (err)
307 goto error; 310 goto error;
diff --git a/arch/powerpc/sysdev/ppc4xx_soc.c b/arch/powerpc/sysdev/ppc4xx_soc.c
index 5b32adc9a9b2..5c014350bf16 100644
--- a/arch/powerpc/sysdev/ppc4xx_soc.c
+++ b/arch/powerpc/sysdev/ppc4xx_soc.c
@@ -174,7 +174,8 @@ static int __init ppc4xx_l2c_probe(void)
174 | L2C_CFG_CPIM | L2C_CFG_TPIM | L2C_CFG_LIM | L2C_CFG_SMCM; 174 | L2C_CFG_CPIM | L2C_CFG_TPIM | L2C_CFG_LIM | L2C_CFG_SMCM;
175 175
176 /* Check for 460EX/GT special handling */ 176 /* Check for 460EX/GT special handling */
177 if (of_device_is_compatible(np, "ibm,l2-cache-460ex")) 177 if (of_device_is_compatible(np, "ibm,l2-cache-460ex") ||
178 of_device_is_compatible(np, "ibm,l2-cache-460gt"))
178 r |= L2C_CFG_RDBW; 179 r |= L2C_CFG_RDBW;
179 180
180 mtdcr(dcrbase_l2c + DCRN_L2C0_CFG, r); 181 mtdcr(dcrbase_l2c + DCRN_L2C0_CFG, r);
diff --git a/arch/powerpc/sysdev/qe_lib/qe_ic.c b/arch/powerpc/sysdev/qe_lib/qe_ic.c
index 2acc928d1920..d927da893ec4 100644
--- a/arch/powerpc/sysdev/qe_lib/qe_ic.c
+++ b/arch/powerpc/sysdev/qe_lib/qe_ic.c
@@ -237,7 +237,7 @@ static void qe_ic_mask_irq(unsigned int virq)
237} 237}
238 238
239static struct irq_chip qe_ic_irq_chip = { 239static struct irq_chip qe_ic_irq_chip = {
240 .name = " QEIC ", 240 .name = "QEIC",
241 .unmask = qe_ic_unmask_irq, 241 .unmask = qe_ic_unmask_irq,
242 .mask = qe_ic_mask_irq, 242 .mask = qe_ic_mask_irq,
243 .mask_ack = qe_ic_mask_irq, 243 .mask_ack = qe_ic_mask_irq,
@@ -256,7 +256,7 @@ static int qe_ic_host_map(struct irq_host *h, unsigned int virq,
256 struct irq_chip *chip; 256 struct irq_chip *chip;
257 257
258 if (qe_ic_info[hw].mask == 0) { 258 if (qe_ic_info[hw].mask == 0) {
259 printk(KERN_ERR "Can't map reserved IRQ \n"); 259 printk(KERN_ERR "Can't map reserved IRQ\n");
260 return -EINVAL; 260 return -EINVAL;
261 } 261 }
262 /* Default chip */ 262 /* Default chip */
diff --git a/arch/powerpc/sysdev/qe_lib/qe_io.c b/arch/powerpc/sysdev/qe_lib/qe_io.c
index 7c87460179ef..77e4934b88c5 100644
--- a/arch/powerpc/sysdev/qe_lib/qe_io.c
+++ b/arch/powerpc/sysdev/qe_lib/qe_io.c
@@ -157,13 +157,13 @@ int par_io_of_config(struct device_node *np)
157 const unsigned int *pio_map; 157 const unsigned int *pio_map;
158 158
159 if (par_io == NULL) { 159 if (par_io == NULL) {
160 printk(KERN_ERR "par_io not initialized \n"); 160 printk(KERN_ERR "par_io not initialized\n");
161 return -1; 161 return -1;
162 } 162 }
163 163
164 ph = of_get_property(np, "pio-handle", NULL); 164 ph = of_get_property(np, "pio-handle", NULL);
165 if (ph == NULL) { 165 if (ph == NULL) {
166 printk(KERN_ERR "pio-handle not available \n"); 166 printk(KERN_ERR "pio-handle not available\n");
167 return -1; 167 return -1;
168 } 168 }
169 169
@@ -171,12 +171,12 @@ int par_io_of_config(struct device_node *np)
171 171
172 pio_map = of_get_property(pio, "pio-map", &pio_map_len); 172 pio_map = of_get_property(pio, "pio-map", &pio_map_len);
173 if (pio_map == NULL) { 173 if (pio_map == NULL) {
174 printk(KERN_ERR "pio-map is not set! \n"); 174 printk(KERN_ERR "pio-map is not set!\n");
175 return -1; 175 return -1;
176 } 176 }
177 pio_map_len /= sizeof(unsigned int); 177 pio_map_len /= sizeof(unsigned int);
178 if ((pio_map_len % 6) != 0) { 178 if ((pio_map_len % 6) != 0) {
179 printk(KERN_ERR "pio-map format wrong! \n"); 179 printk(KERN_ERR "pio-map format wrong!\n");
180 return -1; 180 return -1;
181 } 181 }
182 182
diff --git a/arch/powerpc/sysdev/uic.c b/arch/powerpc/sysdev/uic.c
index 6f220a913e42..0038fb78f094 100644
--- a/arch/powerpc/sysdev/uic.c
+++ b/arch/powerpc/sysdev/uic.c
@@ -177,7 +177,7 @@ static int uic_set_irq_type(unsigned int virq, unsigned int flow_type)
177} 177}
178 178
179static struct irq_chip uic_irq_chip = { 179static struct irq_chip uic_irq_chip = {
180 .name = " UIC ", 180 .name = "UIC",
181 .unmask = uic_unmask_irq, 181 .unmask = uic_unmask_irq,
182 .mask = uic_mask_irq, 182 .mask = uic_mask_irq,
183 .mask_ack = uic_mask_ack_irq, 183 .mask_ack = uic_mask_ack_irq,
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index 4e6152c13764..8bad7d5f32af 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -61,7 +61,7 @@ static int xmon_owner;
61static int xmon_gate; 61static int xmon_gate;
62#endif /* CONFIG_SMP */ 62#endif /* CONFIG_SMP */
63 63
64static unsigned long in_xmon = 0; 64static unsigned long in_xmon __read_mostly = 0;
65 65
66static unsigned long adrs; 66static unsigned long adrs;
67static int size = 1; 67static int size = 1;
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index c80235206c01..0d8cd9bbe101 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -54,6 +54,9 @@ config GENERIC_BUG
54 depends on BUG 54 depends on BUG
55 default y 55 default y
56 56
57config GENERIC_BUG_RELATIVE_POINTERS
58 def_bool y
59
57config NO_IOMEM 60config NO_IOMEM
58 def_bool y 61 def_bool y
59 62
@@ -87,6 +90,7 @@ config S390
87 select HAVE_SYSCALL_TRACEPOINTS 90 select HAVE_SYSCALL_TRACEPOINTS
88 select HAVE_DYNAMIC_FTRACE 91 select HAVE_DYNAMIC_FTRACE
89 select HAVE_FUNCTION_GRAPH_TRACER 92 select HAVE_FUNCTION_GRAPH_TRACER
93 select HAVE_REGS_AND_STACK_ACCESS_API
90 select HAVE_DEFAULT_NO_SPIN_MUTEXES 94 select HAVE_DEFAULT_NO_SPIN_MUTEXES
91 select HAVE_OPROFILE 95 select HAVE_OPROFILE
92 select HAVE_KPROBES 96 select HAVE_KPROBES
@@ -95,6 +99,9 @@ config S390
95 select HAVE_ARCH_TRACEHOOK 99 select HAVE_ARCH_TRACEHOOK
96 select INIT_ALL_POSSIBLE 100 select INIT_ALL_POSSIBLE
97 select HAVE_PERF_EVENTS 101 select HAVE_PERF_EVENTS
102 select HAVE_KERNEL_GZIP
103 select HAVE_KERNEL_BZIP2
104 select HAVE_KERNEL_LZMA
98 select ARCH_INLINE_SPIN_TRYLOCK 105 select ARCH_INLINE_SPIN_TRYLOCK
99 select ARCH_INLINE_SPIN_TRYLOCK_BH 106 select ARCH_INLINE_SPIN_TRYLOCK_BH
100 select ARCH_INLINE_SPIN_LOCK 107 select ARCH_INLINE_SPIN_LOCK
diff --git a/arch/s390/Kconfig.debug b/arch/s390/Kconfig.debug
index 2283933a9a93..45e0c6199f36 100644
--- a/arch/s390/Kconfig.debug
+++ b/arch/s390/Kconfig.debug
@@ -6,4 +6,17 @@ config TRACE_IRQFLAGS_SUPPORT
6 6
7source "lib/Kconfig.debug" 7source "lib/Kconfig.debug"
8 8
9config DEBUG_STRICT_USER_COPY_CHECKS
10 bool "Strict user copy size checks"
11 ---help---
12 Enabling this option turns a certain set of sanity checks for user
13 copy operations into compile time warnings.
14
15 The copy_from_user() etc checks are there to help test if there
16 are sufficient security checks on the length argument of
17 the copy operation, by having gcc prove that the argument is
18 within bounds.
19
20 If unsure, or if you run an older (pre 4.4) gcc, say N.
21
9endmenu 22endmenu
diff --git a/arch/s390/Makefile b/arch/s390/Makefile
index fc8fb20e7fc0..0da10746e0e5 100644
--- a/arch/s390/Makefile
+++ b/arch/s390/Makefile
@@ -14,6 +14,7 @@
14# 14#
15 15
16ifndef CONFIG_64BIT 16ifndef CONFIG_64BIT
17LD_BFD := elf32-s390
17LDFLAGS := -m elf_s390 18LDFLAGS := -m elf_s390
18KBUILD_CFLAGS += -m31 19KBUILD_CFLAGS += -m31
19KBUILD_AFLAGS += -m31 20KBUILD_AFLAGS += -m31
@@ -21,6 +22,7 @@ UTS_MACHINE := s390
21STACK_SIZE := 8192 22STACK_SIZE := 8192
22CHECKFLAGS += -D__s390__ -msize-long 23CHECKFLAGS += -D__s390__ -msize-long
23else 24else
25LD_BFD := elf64-s390
24LDFLAGS := -m elf64_s390 26LDFLAGS := -m elf64_s390
25MODFLAGS += -fpic -D__PIC__ 27MODFLAGS += -fpic -D__PIC__
26KBUILD_CFLAGS += -m64 28KBUILD_CFLAGS += -m64
@@ -30,6 +32,8 @@ STACK_SIZE := 16384
30CHECKFLAGS += -D__s390__ -D__s390x__ 32CHECKFLAGS += -D__s390__ -D__s390x__
31endif 33endif
32 34
35export LD_BFD
36
33cflags-$(CONFIG_MARCH_G5) += $(call cc-option,-march=g5) 37cflags-$(CONFIG_MARCH_G5) += $(call cc-option,-march=g5)
34cflags-$(CONFIG_MARCH_Z900) += $(call cc-option,-march=z900) 38cflags-$(CONFIG_MARCH_Z900) += $(call cc-option,-march=z900)
35cflags-$(CONFIG_MARCH_Z990) += $(call cc-option,-march=z990) 39cflags-$(CONFIG_MARCH_Z990) += $(call cc-option,-march=z990)
@@ -85,7 +89,9 @@ KBUILD_AFLAGS += $(aflags-y)
85OBJCOPYFLAGS := -O binary 89OBJCOPYFLAGS := -O binary
86LDFLAGS_vmlinux := -e start 90LDFLAGS_vmlinux := -e start
87 91
88head-y := arch/s390/kernel/head.o arch/s390/kernel/init_task.o 92head-y := arch/s390/kernel/head.o
93head-y += arch/s390/kernel/$(if $(CONFIG_64BIT),head64.o,head31.o)
94head-y += arch/s390/kernel/init_task.o
89 95
90core-y += arch/s390/mm/ arch/s390/kernel/ arch/s390/crypto/ \ 96core-y += arch/s390/mm/ arch/s390/kernel/ arch/s390/crypto/ \
91 arch/s390/appldata/ arch/s390/hypfs/ arch/s390/kvm/ 97 arch/s390/appldata/ arch/s390/hypfs/ arch/s390/kvm/
@@ -99,12 +105,12 @@ drivers-$(CONFIG_OPROFILE) += arch/s390/oprofile/
99 105
100boot := arch/s390/boot 106boot := arch/s390/boot
101 107
102all: image 108all: image bzImage
103 109
104install: vmlinux 110install: vmlinux
105 $(Q)$(MAKE) $(build)=$(boot) $@ 111 $(Q)$(MAKE) $(build)=$(boot) $@
106 112
107image: vmlinux 113image bzImage: vmlinux
108 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ 114 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
109 115
110zfcpdump: 116zfcpdump:
@@ -116,4 +122,5 @@ archclean:
116# Don't use tabs in echo arguments 122# Don't use tabs in echo arguments
117define archhelp 123define archhelp
118 echo '* image - Kernel image for IPL ($(boot)/image)' 124 echo '* image - Kernel image for IPL ($(boot)/image)'
125 echo '* bzImage - Compressed kernel image for IPL ($(boot)/bzImage)'
119endef 126endef
diff --git a/arch/s390/boot/Makefile b/arch/s390/boot/Makefile
index 4d97eef36b8d..8800cf090694 100644
--- a/arch/s390/boot/Makefile
+++ b/arch/s390/boot/Makefile
@@ -9,10 +9,18 @@ COMPILE_VERSION := __linux_compile_version_id__`hostname | \
9EXTRA_CFLAGS := -DCOMPILE_VERSION=$(COMPILE_VERSION) -gstabs -I. 9EXTRA_CFLAGS := -DCOMPILE_VERSION=$(COMPILE_VERSION) -gstabs -I.
10 10
11targets := image 11targets := image
12targets += bzImage
13subdir- := compressed
12 14
13$(obj)/image: vmlinux FORCE 15$(obj)/image: vmlinux FORCE
14 $(call if_changed,objcopy) 16 $(call if_changed,objcopy)
15 17
18$(obj)/bzImage: $(obj)/compressed/vmlinux FORCE
19 $(call if_changed,objcopy)
20
21$(obj)/compressed/vmlinux: FORCE
22 $(Q)$(MAKE) $(build)=$(obj)/compressed $@
23
16install: $(CONFIGURE) $(obj)/image 24install: $(CONFIGURE) $(obj)/image
17 sh -x $(srctree)/$(obj)/install.sh $(KERNELRELEASE) $(obj)/image \ 25 sh -x $(srctree)/$(obj)/install.sh $(KERNELRELEASE) $(obj)/image \
18 System.map Kerntypes "$(INSTALL_PATH)" 26 System.map Kerntypes "$(INSTALL_PATH)"
diff --git a/arch/s390/boot/compressed/Makefile b/arch/s390/boot/compressed/Makefile
new file mode 100644
index 000000000000..6e4a67ad07e1
--- /dev/null
+++ b/arch/s390/boot/compressed/Makefile
@@ -0,0 +1,60 @@
1#
2# linux/arch/s390/boot/compressed/Makefile
3#
4# create a compressed vmlinux image from the original vmlinux
5#
6
7BITS := $(if $(CONFIG_64BIT),64,31)
8
9targets := vmlinux.lds vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 \
10 vmlinux.bin.lzma misc.o piggy.o sizes.h head$(BITS).o
11
12KBUILD_CFLAGS := -m$(BITS) -D__KERNEL__ $(LINUX_INCLUDE) -O2
13KBUILD_CFLAGS += $(cflags-y)
14KBUILD_CFLAGS += $(call cc-option,-mpacked-stack)
15KBUILD_CFLAGS += $(call cc-option,-ffreestanding)
16
17GCOV_PROFILE := n
18
19OBJECTS := $(addprefix $(objtree)/arch/s390/kernel/, head.o sclp.o ebcdic.o)
20OBJECTS += $(obj)/head$(BITS).o $(obj)/misc.o $(obj)/piggy.o
21
22LDFLAGS_vmlinux := --oformat $(LD_BFD) -e startup -T
23$(obj)/vmlinux: $(obj)/vmlinux.lds $(OBJECTS)
24 $(call if_changed,ld)
25 @:
26
27sed-sizes := -e 's/^\([0-9a-fA-F]*\) . \(__bss_start\|_end\)$$/\#define SZ\2 0x\1/p'
28
29quiet_cmd_sizes = GEN $@
30 cmd_sizes = $(NM) $< | sed -n $(sed-sizes) > $@
31
32$(obj)/sizes.h: vmlinux
33 $(call if_changed,sizes)
34
35AFLAGS_head$(BITS).o += -I$(obj)
36$(obj)/head$(BITS).o: $(obj)/sizes.h
37
38CFLAGS_misc.o += -I$(obj)
39$(obj)/misc.o: $(obj)/sizes.h
40
41OBJCOPYFLAGS_vmlinux.bin := -R .comment -S
42$(obj)/vmlinux.bin: vmlinux
43 $(call if_changed,objcopy)
44
45vmlinux.bin.all-y := $(obj)/vmlinux.bin
46
47suffix-$(CONFIG_KERNEL_GZIP) := gz
48suffix-$(CONFIG_KERNEL_BZIP2) := bz2
49suffix-$(CONFIG_KERNEL_LZMA) := lzma
50
51$(obj)/vmlinux.bin.gz: $(vmlinux.bin.all-y)
52 $(call if_changed,gzip)
53$(obj)/vmlinux.bin.bz2: $(vmlinux.bin.all-y)
54 $(call if_changed,bzip2)
55$(obj)/vmlinux.bin.lzma: $(vmlinux.bin.all-y)
56 $(call if_changed,lzma)
57
58LDFLAGS_piggy.o := -r --format binary --oformat $(LD_BFD) -T
59$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.$(suffix-y)
60 $(call if_changed,ld)
diff --git a/arch/s390/boot/compressed/head31.S b/arch/s390/boot/compressed/head31.S
new file mode 100644
index 000000000000..2a5523a32bcc
--- /dev/null
+++ b/arch/s390/boot/compressed/head31.S
@@ -0,0 +1,51 @@
1/*
2 * Startup glue code to uncompress the kernel
3 *
4 * Copyright IBM Corp. 2010
5 *
6 * Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com>
7 */
8
9#include <linux/init.h>
10#include <asm/asm-offsets.h>
11#include <asm/thread_info.h>
12#include <asm/page.h>
13#include "sizes.h"
14
15__HEAD
16 .globl startup_continue
17startup_continue:
18 basr %r13,0 # get base
19.LPG1:
20 # setup stack
21 l %r15,.Lstack-.LPG1(%r13)
22 ahi %r15,-96
23 l %r1,.Ldecompress-.LPG1(%r13)
24 basr %r14,%r1
25 # setup registers for memory mover & branch to target
26 lr %r4,%r2
27 l %r2,.Loffset-.LPG1(%r13)
28 la %r4,0(%r2,%r4)
29 l %r3,.Lmvsize-.LPG1(%r13)
30 lr %r5,%r3
31 # move the memory mover someplace safe
32 la %r1,0x200
33 mvc 0(mover_end-mover,%r1),mover-.LPG1(%r13)
34 # decompress image is started at 0x11000
35 lr %r6,%r2
36 br %r1
37mover:
38 mvcle %r2,%r4,0
39 jo mover
40 br %r6
41mover_end:
42
43 .align 8
44.Lstack:
45 .long 0x8000 + (1<<(PAGE_SHIFT+THREAD_ORDER))
46.Ldecompress:
47 .long decompress_kernel
48.Loffset:
49 .long 0x11000
50.Lmvsize:
51 .long SZ__bss_start
diff --git a/arch/s390/boot/compressed/head64.S b/arch/s390/boot/compressed/head64.S
new file mode 100644
index 000000000000..2982cb140550
--- /dev/null
+++ b/arch/s390/boot/compressed/head64.S
@@ -0,0 +1,48 @@
1/*
2 * Startup glue code to uncompress the kernel
3 *
4 * Copyright IBM Corp. 2010
5 *
6 * Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com>
7 */
8
9#include <linux/init.h>
10#include <asm/asm-offsets.h>
11#include <asm/thread_info.h>
12#include <asm/page.h>
13#include "sizes.h"
14
15__HEAD
16 .globl startup_continue
17startup_continue:
18 basr %r13,0 # get base
19.LPG1:
20 # setup stack
21 lg %r15,.Lstack-.LPG1(%r13)
22 aghi %r15,-160
23 brasl %r14,decompress_kernel
24 # setup registers for memory mover & branch to target
25 lgr %r4,%r2
26 lg %r2,.Loffset-.LPG1(%r13)
27 la %r4,0(%r2,%r4)
28 lg %r3,.Lmvsize-.LPG1(%r13)
29 lgr %r5,%r3
30 # move the memory mover someplace safe
31 la %r1,0x200
32 mvc 0(mover_end-mover,%r1),mover-.LPG1(%r13)
33 # decompress image is started at 0x11000
34 lgr %r6,%r2
35 br %r1
36mover:
37 mvcle %r2,%r4,0
38 jo mover
39 br %r6
40mover_end:
41
42 .align 8
43.Lstack:
44 .quad 0x8000 + (1<<(PAGE_SHIFT+THREAD_ORDER))
45.Loffset:
46 .quad 0x11000
47.Lmvsize:
48 .quad SZ__bss_start
diff --git a/arch/s390/boot/compressed/misc.c b/arch/s390/boot/compressed/misc.c
new file mode 100644
index 000000000000..a97d69525829
--- /dev/null
+++ b/arch/s390/boot/compressed/misc.c
@@ -0,0 +1,158 @@
1/*
2 * Definitions and wrapper functions for kernel decompressor
3 *
4 * Copyright IBM Corp. 2010
5 *
6 * Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com>
7 */
8
9#include <asm/uaccess.h>
10#include <asm/page.h>
11#include <asm/ipl.h>
12#include "sizes.h"
13
14/*
15 * gzip declarations
16 */
17#define STATIC static
18
19#undef memset
20#undef memcpy
21#undef memmove
22#define memzero(s, n) memset((s), 0, (n))
23
24/* Symbols defined by linker scripts */
25extern char input_data[];
26extern int input_len;
27extern int _text;
28extern int _end;
29
30static void error(char *m);
31
32static unsigned long free_mem_ptr;
33static unsigned long free_mem_end_ptr;
34
35#ifdef CONFIG_HAVE_KERNEL_BZIP2
36#define HEAP_SIZE 0x400000
37#else
38#define HEAP_SIZE 0x10000
39#endif
40
41#ifdef CONFIG_KERNEL_GZIP
42#include "../../../../lib/decompress_inflate.c"
43#endif
44
45#ifdef CONFIG_KERNEL_BZIP2
46#include "../../../../lib/decompress_bunzip2.c"
47#endif
48
49#ifdef CONFIG_KERNEL_LZMA
50#include "../../../../lib/decompress_unlzma.c"
51#endif
52
53extern _sclp_print_early(const char *);
54
55int puts(const char *s)
56{
57 _sclp_print_early(s);
58 return 0;
59}
60
61void *memset(void *s, int c, size_t n)
62{
63 char *xs;
64
65 if (c == 0)
66 return __builtin_memset(s, 0, n);
67
68 xs = (char *) s;
69 if (n > 0)
70 do {
71 *xs++ = c;
72 } while (--n > 0);
73 return s;
74}
75
76void *memcpy(void *__dest, __const void *__src, size_t __n)
77{
78 return __builtin_memcpy(__dest, __src, __n);
79}
80
81void *memmove(void *__dest, __const void *__src, size_t __n)
82{
83 char *d;
84 const char *s;
85
86 if (__dest <= __src)
87 return __builtin_memcpy(__dest, __src, __n);
88 d = __dest + __n;
89 s = __src + __n;
90 while (__n--)
91 *--d = *--s;
92 return __dest;
93}
94
95static void error(char *x)
96{
97 unsigned long long psw = 0x000a0000deadbeefULL;
98
99 puts("\n\n");
100 puts(x);
101 puts("\n\n -- System halted");
102
103 asm volatile("lpsw %0" : : "Q" (psw));
104}
105
106/*
107 * Safe guard the ipl parameter block against a memory area that will be
108 * overwritten. The validity check for the ipl parameter block is complex
109 * (see cio_get_iplinfo and ipl_save_parameters) but if the pointer to
110 * the ipl parameter block intersects with the passed memory area we can
111 * safely assume that we can read from that memory. In that case just copy
112 * the memory to IPL_PARMBLOCK_ORIGIN even if there is no ipl parameter
113 * block.
114 */
115static void check_ipl_parmblock(void *start, unsigned long size)
116{
117 void *src, *dst;
118
119 src = (void *)(unsigned long) S390_lowcore.ipl_parmblock_ptr;
120 if (src + PAGE_SIZE <= start || src >= start + size)
121 return;
122 dst = (void *) IPL_PARMBLOCK_ORIGIN;
123 memmove(dst, src, PAGE_SIZE);
124 S390_lowcore.ipl_parmblock_ptr = IPL_PARMBLOCK_ORIGIN;
125}
126
127unsigned long decompress_kernel(void)
128{
129 unsigned long output_addr;
130 unsigned char *output;
131
132 free_mem_ptr = (unsigned long)&_end;
133 free_mem_end_ptr = free_mem_ptr + HEAP_SIZE;
134 output = (unsigned char *) ((free_mem_end_ptr + 4095UL) & -4096UL);
135
136 check_ipl_parmblock((void *) 0, (unsigned long) output + SZ__bss_start);
137
138#ifdef CONFIG_BLK_DEV_INITRD
139 /*
140 * Move the initrd right behind the end of the decompressed
141 * kernel image.
142 */
143 if (INITRD_START && INITRD_SIZE &&
144 INITRD_START < (unsigned long) output + SZ__bss_start) {
145 check_ipl_parmblock(output + SZ__bss_start,
146 INITRD_START + INITRD_SIZE);
147 memmove(output + SZ__bss_start,
148 (void *) INITRD_START, INITRD_SIZE);
149 INITRD_START = (unsigned long) output + SZ__bss_start;
150 }
151#endif
152
153 puts("Uncompressing Linux... ");
154 decompress(input_data, input_len, NULL, NULL, output, NULL, error);
155 puts("Ok, booting the kernel.\n");
156 return (unsigned long) output;
157}
158
diff --git a/arch/s390/boot/compressed/vmlinux.lds.S b/arch/s390/boot/compressed/vmlinux.lds.S
new file mode 100644
index 000000000000..d80f79d8dd9c
--- /dev/null
+++ b/arch/s390/boot/compressed/vmlinux.lds.S
@@ -0,0 +1,55 @@
1#include <asm-generic/vmlinux.lds.h>
2
3#ifdef CONFIG_64BIT
4OUTPUT_FORMAT("elf64-s390", "elf64-s390", "elf64-s390")
5OUTPUT_ARCH(s390:64-bit)
6#else
7OUTPUT_FORMAT("elf32-s390", "elf32-s390", "elf32-s390")
8OUTPUT_ARCH(s390)
9#endif
10
11ENTRY(startup)
12
13SECTIONS
14{
15 /* Be careful parts of head_64.S assume startup_32 is at
16 * address 0.
17 */
18 . = 0;
19 .head.text : {
20 _head = . ;
21 HEAD_TEXT
22 _ehead = . ;
23 }
24 .rodata.compressed : {
25 *(.rodata.compressed)
26 }
27 .text : {
28 _text = .; /* Text */
29 *(.text)
30 *(.text.*)
31 _etext = . ;
32 }
33 .rodata : {
34 _rodata = . ;
35 *(.rodata) /* read-only data */
36 *(.rodata.*)
37 _erodata = . ;
38 }
39 .data : {
40 _data = . ;
41 *(.data)
42 *(.data.*)
43 _edata = . ;
44 }
45 . = ALIGN(256);
46 .bss : {
47 _bss = . ;
48 *(.bss)
49 *(.bss.*)
50 *(COMMON)
51 . = ALIGN(8); /* For convenience during zeroing */
52 _ebss = .;
53 }
54 _end = .;
55}
diff --git a/arch/s390/boot/compressed/vmlinux.scr b/arch/s390/boot/compressed/vmlinux.scr
new file mode 100644
index 000000000000..f02382ae5c48
--- /dev/null
+++ b/arch/s390/boot/compressed/vmlinux.scr
@@ -0,0 +1,10 @@
1SECTIONS
2{
3 .rodata.compressed : {
4 input_len = .;
5 LONG(input_data_end - input_data) input_data = .;
6 *(.data)
7 output_len = . - 4;
8 input_data_end = .;
9 }
10}
diff --git a/arch/s390/crypto/aes_s390.c b/arch/s390/crypto/aes_s390.c
index 6be4503201ac..58f46734465f 100644
--- a/arch/s390/crypto/aes_s390.c
+++ b/arch/s390/crypto/aes_s390.c
@@ -78,14 +78,14 @@ static int setkey_fallback_cip(struct crypto_tfm *tfm, const u8 *in_key,
78 struct s390_aes_ctx *sctx = crypto_tfm_ctx(tfm); 78 struct s390_aes_ctx *sctx = crypto_tfm_ctx(tfm);
79 int ret; 79 int ret;
80 80
81 sctx->fallback.blk->base.crt_flags &= ~CRYPTO_TFM_REQ_MASK; 81 sctx->fallback.cip->base.crt_flags &= ~CRYPTO_TFM_REQ_MASK;
82 sctx->fallback.blk->base.crt_flags |= (tfm->crt_flags & 82 sctx->fallback.cip->base.crt_flags |= (tfm->crt_flags &
83 CRYPTO_TFM_REQ_MASK); 83 CRYPTO_TFM_REQ_MASK);
84 84
85 ret = crypto_cipher_setkey(sctx->fallback.cip, in_key, key_len); 85 ret = crypto_cipher_setkey(sctx->fallback.cip, in_key, key_len);
86 if (ret) { 86 if (ret) {
87 tfm->crt_flags &= ~CRYPTO_TFM_RES_MASK; 87 tfm->crt_flags &= ~CRYPTO_TFM_RES_MASK;
88 tfm->crt_flags |= (sctx->fallback.blk->base.crt_flags & 88 tfm->crt_flags |= (sctx->fallback.cip->base.crt_flags &
89 CRYPTO_TFM_RES_MASK); 89 CRYPTO_TFM_RES_MASK);
90 } 90 }
91 return ret; 91 return ret;
diff --git a/arch/s390/defconfig b/arch/s390/defconfig
index b416aa11b91e..7ae71cc56973 100644
--- a/arch/s390/defconfig
+++ b/arch/s390/defconfig
@@ -36,6 +36,13 @@ CONFIG_LOCK_KERNEL=y
36CONFIG_INIT_ENV_ARG_LIMIT=32 36CONFIG_INIT_ENV_ARG_LIMIT=32
37CONFIG_LOCALVERSION="" 37CONFIG_LOCALVERSION=""
38CONFIG_LOCALVERSION_AUTO=y 38CONFIG_LOCALVERSION_AUTO=y
39CONFIG_HAVE_KERNEL_GZIP=y
40CONFIG_HAVE_KERNEL_BZIP2=y
41CONFIG_HAVE_KERNEL_LZMA=y
42CONFIG_KERNEL_GZIP=y
43# CONFIG_KERNEL_BZIP2 is not set
44# CONFIG_KERNEL_LZMA is not set
45# CONFIG_KERNEL_LZO is not set
39CONFIG_SWAP=y 46CONFIG_SWAP=y
40CONFIG_SYSVIPC=y 47CONFIG_SYSVIPC=y
41CONFIG_SYSVIPC_SYSCTL=y 48CONFIG_SYSVIPC_SYSCTL=y
diff --git a/arch/s390/hypfs/hypfs_diag.c b/arch/s390/hypfs/hypfs_diag.c
index 2b92d501425f..87cf523192e9 100644
--- a/arch/s390/hypfs/hypfs_diag.c
+++ b/arch/s390/hypfs/hypfs_diag.c
@@ -488,7 +488,7 @@ out:
488 488
489static int diag224(void *ptr) 489static int diag224(void *ptr)
490{ 490{
491 int rc = -ENOTSUPP; 491 int rc = -EOPNOTSUPP;
492 492
493 asm volatile( 493 asm volatile(
494 " diag %1,%2,0x224\n" 494 " diag %1,%2,0x224\n"
@@ -507,7 +507,7 @@ static int diag224_get_name_table(void)
507 return -ENOMEM; 507 return -ENOMEM;
508 if (diag224(diag224_cpu_names)) { 508 if (diag224(diag224_cpu_names)) {
509 kfree(diag224_cpu_names); 509 kfree(diag224_cpu_names);
510 return -ENOTSUPP; 510 return -EOPNOTSUPP;
511 } 511 }
512 EBCASC(diag224_cpu_names + 16, (*diag224_cpu_names + 1) * 16); 512 EBCASC(diag224_cpu_names + 16, (*diag224_cpu_names + 1) * 16);
513 return 0; 513 return 0;
diff --git a/arch/s390/include/asm/atomic.h b/arch/s390/include/asm/atomic.h
index 2a113d6a7dfd..451bfbb9db3d 100644
--- a/arch/s390/include/asm/atomic.h
+++ b/arch/s390/include/asm/atomic.h
@@ -18,8 +18,6 @@
18 18
19#define ATOMIC_INIT(i) { (i) } 19#define ATOMIC_INIT(i) { (i) }
20 20
21#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2)
22
23#define __CS_LOOP(ptr, op_val, op_string) ({ \ 21#define __CS_LOOP(ptr, op_val, op_string) ({ \
24 int old_val, new_val; \ 22 int old_val, new_val; \
25 asm volatile( \ 23 asm volatile( \
@@ -35,26 +33,6 @@
35 new_val; \ 33 new_val; \
36}) 34})
37 35
38#else /* __GNUC__ */
39
40#define __CS_LOOP(ptr, op_val, op_string) ({ \
41 int old_val, new_val; \
42 asm volatile( \
43 " l %0,0(%3)\n" \
44 "0: lr %1,%0\n" \
45 op_string " %1,%4\n" \
46 " cs %0,%1,0(%3)\n" \
47 " jl 0b" \
48 : "=&d" (old_val), "=&d" (new_val), \
49 "=m" (((atomic_t *)(ptr))->counter) \
50 : "a" (ptr), "d" (op_val), \
51 "m" (((atomic_t *)(ptr))->counter) \
52 : "cc", "memory"); \
53 new_val; \
54})
55
56#endif /* __GNUC__ */
57
58static inline int atomic_read(const atomic_t *v) 36static inline int atomic_read(const atomic_t *v)
59{ 37{
60 barrier(); 38 barrier();
@@ -101,19 +79,11 @@ static inline void atomic_set_mask(unsigned long mask, atomic_t *v)
101 79
102static inline int atomic_cmpxchg(atomic_t *v, int old, int new) 80static inline int atomic_cmpxchg(atomic_t *v, int old, int new)
103{ 81{
104#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2)
105 asm volatile( 82 asm volatile(
106 " cs %0,%2,%1" 83 " cs %0,%2,%1"
107 : "+d" (old), "=Q" (v->counter) 84 : "+d" (old), "=Q" (v->counter)
108 : "d" (new), "Q" (v->counter) 85 : "d" (new), "Q" (v->counter)
109 : "cc", "memory"); 86 : "cc", "memory");
110#else /* __GNUC__ */
111 asm volatile(
112 " cs %0,%3,0(%2)"
113 : "+d" (old), "=m" (v->counter)
114 : "a" (v), "d" (new), "m" (v->counter)
115 : "cc", "memory");
116#endif /* __GNUC__ */
117 return old; 87 return old;
118} 88}
119 89
@@ -140,8 +110,6 @@ static inline int atomic_add_unless(atomic_t *v, int a, int u)
140 110
141#ifdef CONFIG_64BIT 111#ifdef CONFIG_64BIT
142 112
143#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2)
144
145#define __CSG_LOOP(ptr, op_val, op_string) ({ \ 113#define __CSG_LOOP(ptr, op_val, op_string) ({ \
146 long long old_val, new_val; \ 114 long long old_val, new_val; \
147 asm volatile( \ 115 asm volatile( \
@@ -157,26 +125,6 @@ static inline int atomic_add_unless(atomic_t *v, int a, int u)
157 new_val; \ 125 new_val; \
158}) 126})
159 127
160#else /* __GNUC__ */
161
162#define __CSG_LOOP(ptr, op_val, op_string) ({ \
163 long long old_val, new_val; \
164 asm volatile( \
165 " lg %0,0(%3)\n" \
166 "0: lgr %1,%0\n" \
167 op_string " %1,%4\n" \
168 " csg %0,%1,0(%3)\n" \
169 " jl 0b" \
170 : "=&d" (old_val), "=&d" (new_val), \
171 "=m" (((atomic_t *)(ptr))->counter) \
172 : "a" (ptr), "d" (op_val), \
173 "m" (((atomic_t *)(ptr))->counter) \
174 : "cc", "memory"); \
175 new_val; \
176})
177
178#endif /* __GNUC__ */
179
180static inline long long atomic64_read(const atomic64_t *v) 128static inline long long atomic64_read(const atomic64_t *v)
181{ 129{
182 barrier(); 130 barrier();
@@ -214,19 +162,11 @@ static inline void atomic64_set_mask(unsigned long mask, atomic64_t *v)
214static inline long long atomic64_cmpxchg(atomic64_t *v, 162static inline long long atomic64_cmpxchg(atomic64_t *v,
215 long long old, long long new) 163 long long old, long long new)
216{ 164{
217#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2)
218 asm volatile( 165 asm volatile(
219 " csg %0,%2,%1" 166 " csg %0,%2,%1"
220 : "+d" (old), "=Q" (v->counter) 167 : "+d" (old), "=Q" (v->counter)
221 : "d" (new), "Q" (v->counter) 168 : "d" (new), "Q" (v->counter)
222 : "cc", "memory"); 169 : "cc", "memory");
223#else /* __GNUC__ */
224 asm volatile(
225 " csg %0,%3,0(%2)"
226 : "+d" (old), "=m" (v->counter)
227 : "a" (v), "d" (new), "m" (v->counter)
228 : "cc", "memory");
229#endif /* __GNUC__ */
230 return old; 170 return old;
231} 171}
232 172
@@ -243,10 +183,8 @@ static inline long long atomic64_read(const atomic64_t *v)
243 register_pair rp; 183 register_pair rp;
244 184
245 asm volatile( 185 asm volatile(
246 " lm %0,%N0,0(%1)" 186 " lm %0,%N0,%1"
247 : "=&d" (rp) 187 : "=&d" (rp) : "Q" (v->counter) );
248 : "a" (&v->counter), "m" (v->counter)
249 );
250 return rp.pair; 188 return rp.pair;
251} 189}
252 190
@@ -255,10 +193,8 @@ static inline void atomic64_set(atomic64_t *v, long long i)
255 register_pair rp = {.pair = i}; 193 register_pair rp = {.pair = i};
256 194
257 asm volatile( 195 asm volatile(
258 " stm %1,%N1,0(%2)" 196 " stm %1,%N1,%0"
259 : "=m" (v->counter) 197 : "=Q" (v->counter) : "d" (rp) );
260 : "d" (rp), "a" (&v->counter)
261 );
262} 198}
263 199
264static inline long long atomic64_xchg(atomic64_t *v, long long new) 200static inline long long atomic64_xchg(atomic64_t *v, long long new)
@@ -267,11 +203,11 @@ static inline long long atomic64_xchg(atomic64_t *v, long long new)
267 register_pair rp_old; 203 register_pair rp_old;
268 204
269 asm volatile( 205 asm volatile(
270 " lm %0,%N0,0(%2)\n" 206 " lm %0,%N0,%1\n"
271 "0: cds %0,%3,0(%2)\n" 207 "0: cds %0,%2,%1\n"
272 " jl 0b\n" 208 " jl 0b\n"
273 : "=&d" (rp_old), "+m" (v->counter) 209 : "=&d" (rp_old), "=Q" (v->counter)
274 : "a" (&v->counter), "d" (rp_new) 210 : "d" (rp_new), "Q" (v->counter)
275 : "cc"); 211 : "cc");
276 return rp_old.pair; 212 return rp_old.pair;
277} 213}
@@ -283,9 +219,9 @@ static inline long long atomic64_cmpxchg(atomic64_t *v,
283 register_pair rp_new = {.pair = new}; 219 register_pair rp_new = {.pair = new};
284 220
285 asm volatile( 221 asm volatile(
286 " cds %0,%3,0(%2)" 222 " cds %0,%2,%1"
287 : "+&d" (rp_old), "+m" (v->counter) 223 : "+&d" (rp_old), "=Q" (v->counter)
288 : "a" (&v->counter), "d" (rp_new) 224 : "d" (rp_new), "Q" (v->counter)
289 : "cc"); 225 : "cc");
290 return rp_old.pair; 226 return rp_old.pair;
291} 227}
diff --git a/arch/s390/include/asm/bitops.h b/arch/s390/include/asm/bitops.h
index b30606f6d523..2e05972c5085 100644
--- a/arch/s390/include/asm/bitops.h
+++ b/arch/s390/include/asm/bitops.h
@@ -71,8 +71,6 @@ extern const char _sb_findmap[];
71#define __BITOPS_AND "nr" 71#define __BITOPS_AND "nr"
72#define __BITOPS_XOR "xr" 72#define __BITOPS_XOR "xr"
73 73
74#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2)
75
76#define __BITOPS_LOOP(__old, __new, __addr, __val, __op_string) \ 74#define __BITOPS_LOOP(__old, __new, __addr, __val, __op_string) \
77 asm volatile( \ 75 asm volatile( \
78 " l %0,%2\n" \ 76 " l %0,%2\n" \
@@ -85,22 +83,6 @@ extern const char _sb_findmap[];
85 : "d" (__val), "Q" (*(unsigned long *) __addr) \ 83 : "d" (__val), "Q" (*(unsigned long *) __addr) \
86 : "cc"); 84 : "cc");
87 85
88#else /* __GNUC__ */
89
90#define __BITOPS_LOOP(__old, __new, __addr, __val, __op_string) \
91 asm volatile( \
92 " l %0,0(%4)\n" \
93 "0: lr %1,%0\n" \
94 __op_string " %1,%3\n" \
95 " cs %0,%1,0(%4)\n" \
96 " jl 0b" \
97 : "=&d" (__old), "=&d" (__new), \
98 "=m" (*(unsigned long *) __addr) \
99 : "d" (__val), "a" (__addr), \
100 "m" (*(unsigned long *) __addr) : "cc");
101
102#endif /* __GNUC__ */
103
104#else /* __s390x__ */ 86#else /* __s390x__ */
105 87
106#define __BITOPS_ALIGN 7 88#define __BITOPS_ALIGN 7
@@ -109,8 +91,6 @@ extern const char _sb_findmap[];
109#define __BITOPS_AND "ngr" 91#define __BITOPS_AND "ngr"
110#define __BITOPS_XOR "xgr" 92#define __BITOPS_XOR "xgr"
111 93
112#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2)
113
114#define __BITOPS_LOOP(__old, __new, __addr, __val, __op_string) \ 94#define __BITOPS_LOOP(__old, __new, __addr, __val, __op_string) \
115 asm volatile( \ 95 asm volatile( \
116 " lg %0,%2\n" \ 96 " lg %0,%2\n" \
@@ -123,23 +103,6 @@ extern const char _sb_findmap[];
123 : "d" (__val), "Q" (*(unsigned long *) __addr) \ 103 : "d" (__val), "Q" (*(unsigned long *) __addr) \
124 : "cc"); 104 : "cc");
125 105
126#else /* __GNUC__ */
127
128#define __BITOPS_LOOP(__old, __new, __addr, __val, __op_string) \
129 asm volatile( \
130 " lg %0,0(%4)\n" \
131 "0: lgr %1,%0\n" \
132 __op_string " %1,%3\n" \
133 " csg %0,%1,0(%4)\n" \
134 " jl 0b" \
135 : "=&d" (__old), "=&d" (__new), \
136 "=m" (*(unsigned long *) __addr) \
137 : "d" (__val), "a" (__addr), \
138 "m" (*(unsigned long *) __addr) : "cc");
139
140
141#endif /* __GNUC__ */
142
143#endif /* __s390x__ */ 106#endif /* __s390x__ */
144 107
145#define __BITOPS_WORDS(bits) (((bits)+__BITOPS_WORDSIZE-1)/__BITOPS_WORDSIZE) 108#define __BITOPS_WORDS(bits) (((bits)+__BITOPS_WORDSIZE-1)/__BITOPS_WORDSIZE)
@@ -261,9 +224,8 @@ static inline void __set_bit(unsigned long nr, volatile unsigned long *ptr)
261 224
262 addr = (unsigned long) ptr + ((nr ^ (__BITOPS_WORDSIZE - 8)) >> 3); 225 addr = (unsigned long) ptr + ((nr ^ (__BITOPS_WORDSIZE - 8)) >> 3);
263 asm volatile( 226 asm volatile(
264 " oc 0(1,%1),0(%2)" 227 " oc %O0(1,%R0),%1"
265 : "=m" (*(char *) addr) : "a" (addr), 228 : "=Q" (*(char *) addr) : "Q" (_oi_bitmap[nr & 7]) : "cc" );
266 "a" (_oi_bitmap + (nr & 7)), "m" (*(char *) addr) : "cc" );
267} 229}
268 230
269static inline void 231static inline void
@@ -290,9 +252,8 @@ __clear_bit(unsigned long nr, volatile unsigned long *ptr)
290 252
291 addr = (unsigned long) ptr + ((nr ^ (__BITOPS_WORDSIZE - 8)) >> 3); 253 addr = (unsigned long) ptr + ((nr ^ (__BITOPS_WORDSIZE - 8)) >> 3);
292 asm volatile( 254 asm volatile(
293 " nc 0(1,%1),0(%2)" 255 " nc %O0(1,%R0),%1"
294 : "=m" (*(char *) addr) : "a" (addr), 256 : "=Q" (*(char *) addr) : "Q" (_ni_bitmap[nr & 7]) : "cc" );
295 "a" (_ni_bitmap + (nr & 7)), "m" (*(char *) addr) : "cc");
296} 257}
297 258
298static inline void 259static inline void
@@ -318,9 +279,8 @@ static inline void __change_bit(unsigned long nr, volatile unsigned long *ptr)
318 279
319 addr = (unsigned long) ptr + ((nr ^ (__BITOPS_WORDSIZE - 8)) >> 3); 280 addr = (unsigned long) ptr + ((nr ^ (__BITOPS_WORDSIZE - 8)) >> 3);
320 asm volatile( 281 asm volatile(
321 " xc 0(1,%1),0(%2)" 282 " xc %O0(1,%R0),%1"
322 : "=m" (*(char *) addr) : "a" (addr), 283 : "=Q" (*(char *) addr) : "Q" (_oi_bitmap[nr & 7]) : "cc" );
323 "a" (_oi_bitmap + (nr & 7)), "m" (*(char *) addr) : "cc" );
324} 284}
325 285
326static inline void 286static inline void
@@ -349,10 +309,9 @@ test_and_set_bit_simple(unsigned long nr, volatile unsigned long *ptr)
349 addr = (unsigned long) ptr + ((nr ^ (__BITOPS_WORDSIZE - 8)) >> 3); 309 addr = (unsigned long) ptr + ((nr ^ (__BITOPS_WORDSIZE - 8)) >> 3);
350 ch = *(unsigned char *) addr; 310 ch = *(unsigned char *) addr;
351 asm volatile( 311 asm volatile(
352 " oc 0(1,%1),0(%2)" 312 " oc %O0(1,%R0),%1"
353 : "=m" (*(char *) addr) 313 : "=Q" (*(char *) addr) : "Q" (_oi_bitmap[nr & 7])
354 : "a" (addr), "a" (_oi_bitmap + (nr & 7)), 314 : "cc", "memory");
355 "m" (*(char *) addr) : "cc", "memory");
356 return (ch >> (nr & 7)) & 1; 315 return (ch >> (nr & 7)) & 1;
357} 316}
358#define __test_and_set_bit(X,Y) test_and_set_bit_simple(X,Y) 317#define __test_and_set_bit(X,Y) test_and_set_bit_simple(X,Y)
@@ -369,10 +328,9 @@ test_and_clear_bit_simple(unsigned long nr, volatile unsigned long *ptr)
369 addr = (unsigned long) ptr + ((nr ^ (__BITOPS_WORDSIZE - 8)) >> 3); 328 addr = (unsigned long) ptr + ((nr ^ (__BITOPS_WORDSIZE - 8)) >> 3);
370 ch = *(unsigned char *) addr; 329 ch = *(unsigned char *) addr;
371 asm volatile( 330 asm volatile(
372 " nc 0(1,%1),0(%2)" 331 " nc %O0(1,%R0),%1"
373 : "=m" (*(char *) addr) 332 : "=Q" (*(char *) addr) : "Q" (_ni_bitmap[nr & 7])
374 : "a" (addr), "a" (_ni_bitmap + (nr & 7)), 333 : "cc", "memory");
375 "m" (*(char *) addr) : "cc", "memory");
376 return (ch >> (nr & 7)) & 1; 334 return (ch >> (nr & 7)) & 1;
377} 335}
378#define __test_and_clear_bit(X,Y) test_and_clear_bit_simple(X,Y) 336#define __test_and_clear_bit(X,Y) test_and_clear_bit_simple(X,Y)
@@ -389,10 +347,9 @@ test_and_change_bit_simple(unsigned long nr, volatile unsigned long *ptr)
389 addr = (unsigned long) ptr + ((nr ^ (__BITOPS_WORDSIZE - 8)) >> 3); 347 addr = (unsigned long) ptr + ((nr ^ (__BITOPS_WORDSIZE - 8)) >> 3);
390 ch = *(unsigned char *) addr; 348 ch = *(unsigned char *) addr;
391 asm volatile( 349 asm volatile(
392 " xc 0(1,%1),0(%2)" 350 " xc %O0(1,%R0),%1"
393 : "=m" (*(char *) addr) 351 : "=Q" (*(char *) addr) : "Q" (_oi_bitmap[nr & 7])
394 : "a" (addr), "a" (_oi_bitmap + (nr & 7)), 352 : "cc", "memory");
395 "m" (*(char *) addr) : "cc", "memory");
396 return (ch >> (nr & 7)) & 1; 353 return (ch >> (nr & 7)) & 1;
397} 354}
398#define __test_and_change_bit(X,Y) test_and_change_bit_simple(X,Y) 355#define __test_and_change_bit(X,Y) test_and_change_bit_simple(X,Y)
@@ -591,11 +548,11 @@ static inline unsigned long __load_ulong_le(const unsigned long *p,
591 p = (unsigned long *)((unsigned long) p + offset); 548 p = (unsigned long *)((unsigned long) p + offset);
592#ifndef __s390x__ 549#ifndef __s390x__
593 asm volatile( 550 asm volatile(
594 " ic %0,0(%1)\n" 551 " ic %0,%O1(%R1)\n"
595 " icm %0,2,1(%1)\n" 552 " icm %0,2,%O1+1(%R1)\n"
596 " icm %0,4,2(%1)\n" 553 " icm %0,4,%O1+2(%R1)\n"
597 " icm %0,8,3(%1)" 554 " icm %0,8,%O1+3(%R1)"
598 : "=&d" (word) : "a" (p), "m" (*p) : "cc"); 555 : "=&d" (word) : "Q" (*p) : "cc");
599#else 556#else
600 asm volatile( 557 asm volatile(
601 " lrvg %0,%1" 558 " lrvg %0,%1"
diff --git a/arch/s390/include/asm/bug.h b/arch/s390/include/asm/bug.h
index b1066b9fb5f8..9beeb9db9b23 100644
--- a/arch/s390/include/asm/bug.h
+++ b/arch/s390/include/asm/bug.h
@@ -5,12 +5,6 @@
5 5
6#ifdef CONFIG_BUG 6#ifdef CONFIG_BUG
7 7
8#ifdef CONFIG_64BIT
9#define S390_LONG ".quad"
10#else
11#define S390_LONG ".long"
12#endif
13
14#ifdef CONFIG_DEBUG_BUGVERBOSE 8#ifdef CONFIG_DEBUG_BUGVERBOSE
15 9
16#define __EMIT_BUG(x) do { \ 10#define __EMIT_BUG(x) do { \
@@ -21,7 +15,7 @@
21 "2: .asciz \""__FILE__"\"\n" \ 15 "2: .asciz \""__FILE__"\"\n" \
22 ".previous\n" \ 16 ".previous\n" \
23 ".section __bug_table,\"a\"\n" \ 17 ".section __bug_table,\"a\"\n" \
24 "3:\t" S390_LONG "\t1b,2b\n" \ 18 "3: .long 1b-3b,2b-3b\n" \
25 " .short %0,%1\n" \ 19 " .short %0,%1\n" \
26 " .org 3b+%2\n" \ 20 " .org 3b+%2\n" \
27 ".previous\n" \ 21 ".previous\n" \
@@ -37,7 +31,7 @@
37 "0: j 0b+2\n" \ 31 "0: j 0b+2\n" \
38 "1:\n" \ 32 "1:\n" \
39 ".section __bug_table,\"a\"\n" \ 33 ".section __bug_table,\"a\"\n" \
40 "2:\t" S390_LONG "\t1b\n" \ 34 "2: .long 1b-2b\n" \
41 " .short %0\n" \ 35 " .short %0\n" \
42 " .org 2b+%1\n" \ 36 " .org 2b+%1\n" \
43 ".previous\n" \ 37 ".previous\n" \
diff --git a/arch/s390/include/asm/crw.h b/arch/s390/include/asm/crw.h
index 2185a6d619d3..749a97e61bea 100644
--- a/arch/s390/include/asm/crw.h
+++ b/arch/s390/include/asm/crw.h
@@ -32,6 +32,7 @@ typedef void (*crw_handler_t)(struct crw *, struct crw *, int);
32extern int crw_register_handler(int rsc, crw_handler_t handler); 32extern int crw_register_handler(int rsc, crw_handler_t handler);
33extern void crw_unregister_handler(int rsc); 33extern void crw_unregister_handler(int rsc);
34extern void crw_handle_channel_report(void); 34extern void crw_handle_channel_report(void);
35void crw_wait_for_channel_report(void);
35 36
36#define NR_RSCS 16 37#define NR_RSCS 16
37 38
diff --git a/arch/s390/include/asm/etr.h b/arch/s390/include/asm/etr.h
index 80ef58c61970..538e1b36a726 100644
--- a/arch/s390/include/asm/etr.h
+++ b/arch/s390/include/asm/etr.h
@@ -145,11 +145,11 @@ static inline int etr_setr(struct etr_eacr *ctrl)
145 int rc = -ENOSYS; 145 int rc = -ENOSYS;
146 146
147 asm volatile( 147 asm volatile(
148 " .insn s,0xb2160000,0(%2)\n" 148 " .insn s,0xb2160000,%1\n"
149 "0: la %0,0\n" 149 "0: la %0,0\n"
150 "1:\n" 150 "1:\n"
151 EX_TABLE(0b,1b) 151 EX_TABLE(0b,1b)
152 : "+d" (rc) : "m" (*ctrl), "a" (ctrl)); 152 : "+d" (rc) : "Q" (*ctrl));
153 return rc; 153 return rc;
154} 154}
155 155
@@ -159,11 +159,11 @@ static inline int etr_stetr(struct etr_aib *aib)
159 int rc = -ENOSYS; 159 int rc = -ENOSYS;
160 160
161 asm volatile( 161 asm volatile(
162 " .insn s,0xb2170000,0(%2)\n" 162 " .insn s,0xb2170000,%1\n"
163 "0: la %0,0\n" 163 "0: la %0,0\n"
164 "1:\n" 164 "1:\n"
165 EX_TABLE(0b,1b) 165 EX_TABLE(0b,1b)
166 : "+d" (rc) : "m" (*aib), "a" (aib)); 166 : "+d" (rc) : "Q" (*aib));
167 return rc; 167 return rc;
168} 168}
169 169
@@ -174,11 +174,11 @@ static inline int etr_steai(struct etr_aib *aib, unsigned int func)
174 int rc = -ENOSYS; 174 int rc = -ENOSYS;
175 175
176 asm volatile( 176 asm volatile(
177 " .insn s,0xb2b30000,0(%2)\n" 177 " .insn s,0xb2b30000,%1\n"
178 "0: la %0,0\n" 178 "0: la %0,0\n"
179 "1:\n" 179 "1:\n"
180 EX_TABLE(0b,1b) 180 EX_TABLE(0b,1b)
181 : "+d" (rc) : "m" (*aib), "a" (aib), "d" (reg0)); 181 : "+d" (rc) : "Q" (*aib), "d" (reg0));
182 return rc; 182 return rc;
183} 183}
184 184
diff --git a/arch/s390/include/asm/irqflags.h b/arch/s390/include/asm/irqflags.h
index c2fb432f576a..15b3ac253898 100644
--- a/arch/s390/include/asm/irqflags.h
+++ b/arch/s390/include/asm/irqflags.h
@@ -8,8 +8,6 @@
8 8
9#include <linux/types.h> 9#include <linux/types.h>
10 10
11#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2)
12
13/* store then or system mask. */ 11/* store then or system mask. */
14#define __raw_local_irq_stosm(__or) \ 12#define __raw_local_irq_stosm(__or) \
15({ \ 13({ \
@@ -36,40 +34,6 @@
36 asm volatile("ssm %0" : : "Q" (__mask) : "memory"); \ 34 asm volatile("ssm %0" : : "Q" (__mask) : "memory"); \
37}) 35})
38 36
39#else /* __GNUC__ */
40
41/* store then or system mask. */
42#define __raw_local_irq_stosm(__or) \
43({ \
44 unsigned long __mask; \
45 asm volatile( \
46 " stosm 0(%1),%2" \
47 : "=m" (__mask) \
48 : "a" (&__mask), "i" (__or) : "memory"); \
49 __mask; \
50})
51
52/* store then and system mask. */
53#define __raw_local_irq_stnsm(__and) \
54({ \
55 unsigned long __mask; \
56 asm volatile( \
57 " stnsm 0(%1),%2" \
58 : "=m" (__mask) \
59 : "a" (&__mask), "i" (__and) : "memory"); \
60 __mask; \
61})
62
63/* set system mask. */
64#define __raw_local_irq_ssm(__mask) \
65({ \
66 asm volatile( \
67 " ssm 0(%0)" \
68 : : "a" (&__mask), "m" (__mask) : "memory"); \
69})
70
71#endif /* __GNUC__ */
72
73/* interrupt control.. */ 37/* interrupt control.. */
74static inline unsigned long raw_local_irq_enable(void) 38static inline unsigned long raw_local_irq_enable(void)
75{ 39{
diff --git a/arch/s390/include/asm/lowcore.h b/arch/s390/include/asm/lowcore.h
index c25dfac7dd76..05527c040b7a 100644
--- a/arch/s390/include/asm/lowcore.h
+++ b/arch/s390/include/asm/lowcore.h
@@ -1,141 +1,16 @@
1/* 1/*
2 * include/asm-s390/lowcore.h 2 * Copyright IBM Corp. 1999,2010
3 * 3 * Author(s): Hartmut Penner <hp@de.ibm.com>,
4 * S390 version 4 * Martin Schwidefsky <schwidefsky@de.ibm.com>,
5 * Copyright (C) 1999,2000 IBM Deutschland Entwicklung GmbH, IBM Corporation 5 * Denis Joseph Barrow,
6 * Author(s): Hartmut Penner (hp@de.ibm.com),
7 * Martin Schwidefsky (schwidefsky@de.ibm.com),
8 * Denis Joseph Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com)
9 */ 6 */
10 7
11#ifndef _ASM_S390_LOWCORE_H 8#ifndef _ASM_S390_LOWCORE_H
12#define _ASM_S390_LOWCORE_H 9#define _ASM_S390_LOWCORE_H
13 10
14#define __LC_IPL_PARMBLOCK_PTR 0x0014
15#define __LC_EXT_PARAMS 0x0080
16#define __LC_CPU_ADDRESS 0x0084
17#define __LC_EXT_INT_CODE 0x0086
18
19#define __LC_SVC_ILC 0x0088
20#define __LC_SVC_INT_CODE 0x008a
21#define __LC_PGM_ILC 0x008c
22#define __LC_PGM_INT_CODE 0x008e
23
24#define __LC_PER_ATMID 0x0096
25#define __LC_PER_ADDRESS 0x0098
26#define __LC_PER_ACCESS_ID 0x00a1
27#define __LC_AR_MODE_ID 0x00a3
28
29#define __LC_SUBCHANNEL_ID 0x00b8
30#define __LC_SUBCHANNEL_NR 0x00ba
31#define __LC_IO_INT_PARM 0x00bc
32#define __LC_IO_INT_WORD 0x00c0
33#define __LC_STFL_FAC_LIST 0x00c8
34#define __LC_MCCK_CODE 0x00e8
35
36#define __LC_DUMP_REIPL 0x0e00
37
38#ifndef __s390x__
39#define __LC_EXT_OLD_PSW 0x0018
40#define __LC_SVC_OLD_PSW 0x0020
41#define __LC_PGM_OLD_PSW 0x0028
42#define __LC_MCK_OLD_PSW 0x0030
43#define __LC_IO_OLD_PSW 0x0038
44#define __LC_EXT_NEW_PSW 0x0058
45#define __LC_SVC_NEW_PSW 0x0060
46#define __LC_PGM_NEW_PSW 0x0068
47#define __LC_MCK_NEW_PSW 0x0070
48#define __LC_IO_NEW_PSW 0x0078
49#define __LC_SAVE_AREA 0x0200
50#define __LC_RETURN_PSW 0x0240
51#define __LC_RETURN_MCCK_PSW 0x0248
52#define __LC_SYNC_ENTER_TIMER 0x0250
53#define __LC_ASYNC_ENTER_TIMER 0x0258
54#define __LC_EXIT_TIMER 0x0260
55#define __LC_USER_TIMER 0x0268
56#define __LC_SYSTEM_TIMER 0x0270
57#define __LC_STEAL_TIMER 0x0278
58#define __LC_LAST_UPDATE_TIMER 0x0280
59#define __LC_LAST_UPDATE_CLOCK 0x0288
60#define __LC_CURRENT 0x0290
61#define __LC_THREAD_INFO 0x0294
62#define __LC_KERNEL_STACK 0x0298
63#define __LC_ASYNC_STACK 0x029c
64#define __LC_PANIC_STACK 0x02a0
65#define __LC_KERNEL_ASCE 0x02a4
66#define __LC_USER_ASCE 0x02a8
67#define __LC_USER_EXEC_ASCE 0x02ac
68#define __LC_CPUID 0x02b0
69#define __LC_INT_CLOCK 0x02c8
70#define __LC_MACHINE_FLAGS 0x02d8
71#define __LC_FTRACE_FUNC 0x02dc
72#define __LC_IRB 0x0300
73#define __LC_PFAULT_INTPARM 0x0080
74#define __LC_CPU_TIMER_SAVE_AREA 0x00d8
75#define __LC_CLOCK_COMP_SAVE_AREA 0x00e0
76#define __LC_PSW_SAVE_AREA 0x0100
77#define __LC_PREFIX_SAVE_AREA 0x0108
78#define __LC_AREGS_SAVE_AREA 0x0120
79#define __LC_FPREGS_SAVE_AREA 0x0160
80#define __LC_GPREGS_SAVE_AREA 0x0180
81#define __LC_CREGS_SAVE_AREA 0x01c0
82#else /* __s390x__ */
83#define __LC_LAST_BREAK 0x0110
84#define __LC_EXT_OLD_PSW 0x0130
85#define __LC_SVC_OLD_PSW 0x0140
86#define __LC_PGM_OLD_PSW 0x0150
87#define __LC_MCK_OLD_PSW 0x0160
88#define __LC_IO_OLD_PSW 0x0170
89#define __LC_RESTART_PSW 0x01a0
90#define __LC_EXT_NEW_PSW 0x01b0
91#define __LC_SVC_NEW_PSW 0x01c0
92#define __LC_PGM_NEW_PSW 0x01d0
93#define __LC_MCK_NEW_PSW 0x01e0
94#define __LC_IO_NEW_PSW 0x01f0
95#define __LC_SAVE_AREA 0x0200
96#define __LC_RETURN_PSW 0x0280
97#define __LC_RETURN_MCCK_PSW 0x0290
98#define __LC_SYNC_ENTER_TIMER 0x02a0
99#define __LC_ASYNC_ENTER_TIMER 0x02a8
100#define __LC_EXIT_TIMER 0x02b0
101#define __LC_USER_TIMER 0x02b8
102#define __LC_SYSTEM_TIMER 0x02c0
103#define __LC_STEAL_TIMER 0x02c8
104#define __LC_LAST_UPDATE_TIMER 0x02d0
105#define __LC_LAST_UPDATE_CLOCK 0x02d8
106#define __LC_CURRENT 0x02e0
107#define __LC_THREAD_INFO 0x02e8
108#define __LC_KERNEL_STACK 0x02f0
109#define __LC_ASYNC_STACK 0x02f8
110#define __LC_PANIC_STACK 0x0300
111#define __LC_KERNEL_ASCE 0x0308
112#define __LC_USER_ASCE 0x0310
113#define __LC_USER_EXEC_ASCE 0x0318
114#define __LC_CPUID 0x0320
115#define __LC_INT_CLOCK 0x0340
116#define __LC_VDSO_PER_CPU 0x0350
117#define __LC_MACHINE_FLAGS 0x0358
118#define __LC_FTRACE_FUNC 0x0360
119#define __LC_IRB 0x0380
120#define __LC_PASTE 0x03c0
121#define __LC_PFAULT_INTPARM 0x11b8
122#define __LC_FPREGS_SAVE_AREA 0x1200
123#define __LC_GPREGS_SAVE_AREA 0x1280
124#define __LC_PSW_SAVE_AREA 0x1300
125#define __LC_PREFIX_SAVE_AREA 0x1318
126#define __LC_FP_CREG_SAVE_AREA 0x131c
127#define __LC_TODREG_SAVE_AREA 0x1324
128#define __LC_CPU_TIMER_SAVE_AREA 0x1328
129#define __LC_CLOCK_COMP_SAVE_AREA 0x1331
130#define __LC_AREGS_SAVE_AREA 0x1340
131#define __LC_CREGS_SAVE_AREA 0x1380
132#endif /* __s390x__ */
133
134#ifndef __ASSEMBLY__
135
136#include <asm/cpu.h>
137#include <asm/ptrace.h>
138#include <linux/types.h> 11#include <linux/types.h>
12#include <asm/ptrace.h>
13#include <asm/cpu.h>
139 14
140void restart_int_handler(void); 15void restart_int_handler(void);
141void ext_int_handler(void); 16void ext_int_handler(void);
@@ -144,7 +19,12 @@ void pgm_check_handler(void);
144void mcck_int_handler(void); 19void mcck_int_handler(void);
145void io_int_handler(void); 20void io_int_handler(void);
146 21
147struct save_area_s390 { 22#ifdef CONFIG_32BIT
23
24#define LC_ORDER 0
25#define LC_PAGES 1
26
27struct save_area {
148 u32 ext_save; 28 u32 ext_save;
149 u64 timer; 29 u64 timer;
150 u64 clk_cmp; 30 u64 clk_cmp;
@@ -156,54 +36,13 @@ struct save_area_s390 {
156 u64 fp_regs[4]; 36 u64 fp_regs[4];
157 u32 gp_regs[16]; 37 u32 gp_regs[16];
158 u32 ctrl_regs[16]; 38 u32 ctrl_regs[16];
159} __attribute__((packed)); 39} __packed;
160 40
161struct save_area_s390x { 41struct _lowcore {
162 u64 fp_regs[16];
163 u64 gp_regs[16];
164 u8 psw[16];
165 u8 pad1[8];
166 u32 pref_reg;
167 u32 fp_ctrl_reg;
168 u8 pad2[4];
169 u32 tod_reg;
170 u64 timer;
171 u64 clk_cmp;
172 u8 pad3[8];
173 u32 acc_regs[16];
174 u64 ctrl_regs[16];
175} __attribute__((packed));
176
177union save_area {
178 struct save_area_s390 s390;
179 struct save_area_s390x s390x;
180};
181
182#define SAVE_AREA_BASE_S390 0xd4
183#define SAVE_AREA_BASE_S390X 0x1200
184
185#ifndef __s390x__
186#define SAVE_AREA_SIZE sizeof(struct save_area_s390)
187#define SAVE_AREA_BASE SAVE_AREA_BASE_S390
188#else
189#define SAVE_AREA_SIZE sizeof(struct save_area_s390x)
190#define SAVE_AREA_BASE SAVE_AREA_BASE_S390X
191#endif
192
193#ifndef __s390x__
194#define LC_ORDER 0
195#else
196#define LC_ORDER 1
197#endif
198
199#define LC_PAGES (1UL << LC_ORDER)
200
201struct _lowcore
202{
203#ifndef __s390x__
204 /* 0x0000 - 0x01ff: defined by architecture */
205 psw_t restart_psw; /* 0x0000 */ 42 psw_t restart_psw; /* 0x0000 */
206 __u32 ccw2[4]; /* 0x0008 */ 43 psw_t restart_old_psw; /* 0x0008 */
44 __u8 pad_0x0010[0x0014-0x0010]; /* 0x0010 */
45 __u32 ipl_parmblock_ptr; /* 0x0014 */
207 psw_t external_old_psw; /* 0x0018 */ 46 psw_t external_old_psw; /* 0x0018 */
208 psw_t svc_old_psw; /* 0x0020 */ 47 psw_t svc_old_psw; /* 0x0020 */
209 psw_t program_old_psw; /* 0x0028 */ 48 psw_t program_old_psw; /* 0x0028 */
@@ -229,7 +68,9 @@ struct _lowcore
229 __u32 monitor_code; /* 0x009c */ 68 __u32 monitor_code; /* 0x009c */
230 __u8 exc_access_id; /* 0x00a0 */ 69 __u8 exc_access_id; /* 0x00a0 */
231 __u8 per_access_id; /* 0x00a1 */ 70 __u8 per_access_id; /* 0x00a1 */
232 __u8 pad_0x00a2[0x00b8-0x00a2]; /* 0x00a2 */ 71 __u8 op_access_id; /* 0x00a2 */
72 __u8 ar_access_id; /* 0x00a3 */
73 __u8 pad_0x00a4[0x00b8-0x00a4]; /* 0x00a4 */
233 __u16 subchannel_id; /* 0x00b8 */ 74 __u16 subchannel_id; /* 0x00b8 */
234 __u16 subchannel_nr; /* 0x00ba */ 75 __u16 subchannel_nr; /* 0x00ba */
235 __u32 io_int_parm; /* 0x00bc */ 76 __u32 io_int_parm; /* 0x00bc */
@@ -245,8 +86,9 @@ struct _lowcore
245 __u32 external_damage_code; /* 0x00f4 */ 86 __u32 external_damage_code; /* 0x00f4 */
246 __u32 failing_storage_address; /* 0x00f8 */ 87 __u32 failing_storage_address; /* 0x00f8 */
247 __u8 pad_0x00fc[0x0100-0x00fc]; /* 0x00fc */ 88 __u8 pad_0x00fc[0x0100-0x00fc]; /* 0x00fc */
248 __u32 st_status_fixed_logout[4]; /* 0x0100 */ 89 psw_t psw_save_area; /* 0x0100 */
249 __u8 pad_0x0110[0x0120-0x0110]; /* 0x0110 */ 90 __u32 prefixreg_save_area; /* 0x0108 */
91 __u8 pad_0x010c[0x0120-0x010c]; /* 0x010c */
250 92
251 /* CPU register save area: defined by architecture */ 93 /* CPU register save area: defined by architecture */
252 __u32 access_regs_save_area[16]; /* 0x0120 */ 94 __u32 access_regs_save_area[16]; /* 0x0120 */
@@ -310,10 +152,32 @@ struct _lowcore
310 152
311 /* Align to the top 1k of prefix area */ 153 /* Align to the top 1k of prefix area */
312 __u8 pad_0x0e08[0x1000-0x0e08]; /* 0x0e08 */ 154 __u8 pad_0x0e08[0x1000-0x0e08]; /* 0x0e08 */
313#else /* !__s390x__ */ 155} __packed;
314 /* 0x0000 - 0x01ff: defined by architecture */ 156
315 __u32 ccw1[2]; /* 0x0000 */ 157#else /* CONFIG_32BIT */
316 __u32 ccw2[4]; /* 0x0008 */ 158
159#define LC_ORDER 1
160#define LC_PAGES 2
161
162struct save_area {
163 u64 fp_regs[16];
164 u64 gp_regs[16];
165 u8 psw[16];
166 u8 pad1[8];
167 u32 pref_reg;
168 u32 fp_ctrl_reg;
169 u8 pad2[4];
170 u32 tod_reg;
171 u64 timer;
172 u64 clk_cmp;
173 u8 pad3[8];
174 u32 acc_regs[16];
175 u64 ctrl_regs[16];
176} __packed;
177
178struct _lowcore {
179 __u8 pad_0x0000[0x0014-0x0000]; /* 0x0000 */
180 __u32 ipl_parmblock_ptr; /* 0x0014 */
317 __u8 pad_0x0018[0x0080-0x0018]; /* 0x0018 */ 181 __u8 pad_0x0018[0x0080-0x0018]; /* 0x0018 */
318 __u32 ext_params; /* 0x0080 */ 182 __u32 ext_params; /* 0x0080 */
319 __u16 cpu_addr; /* 0x0084 */ 183 __u16 cpu_addr; /* 0x0084 */
@@ -344,7 +208,9 @@ struct _lowcore
344 __u8 pad_0x00f0[0x00f4-0x00f0]; /* 0x00f0 */ 208 __u8 pad_0x00f0[0x00f4-0x00f0]; /* 0x00f0 */
345 __u32 external_damage_code; /* 0x00f4 */ 209 __u32 external_damage_code; /* 0x00f4 */
346 addr_t failing_storage_address; /* 0x00f8 */ 210 addr_t failing_storage_address; /* 0x00f8 */
347 __u8 pad_0x0100[0x0120-0x0100]; /* 0x0100 */ 211 __u8 pad_0x0100[0x0110-0x0100]; /* 0x0100 */
212 __u64 breaking_event_addr; /* 0x0110 */
213 __u8 pad_0x0118[0x0120-0x0118]; /* 0x0118 */
348 psw_t restart_old_psw; /* 0x0120 */ 214 psw_t restart_old_psw; /* 0x0120 */
349 psw_t external_old_psw; /* 0x0130 */ 215 psw_t external_old_psw; /* 0x0130 */
350 psw_t svc_old_psw; /* 0x0140 */ 216 psw_t svc_old_psw; /* 0x0140 */
@@ -425,7 +291,7 @@ struct _lowcore
425 /* CPU register save area: defined by architecture */ 291 /* CPU register save area: defined by architecture */
426 __u64 floating_pt_save_area[16]; /* 0x1200 */ 292 __u64 floating_pt_save_area[16]; /* 0x1200 */
427 __u64 gpregs_save_area[16]; /* 0x1280 */ 293 __u64 gpregs_save_area[16]; /* 0x1280 */
428 __u32 st_status_fixed_logout[4]; /* 0x1300 */ 294 psw_t psw_save_area; /* 0x1300 */
429 __u8 pad_0x1310[0x1318-0x1310]; /* 0x1310 */ 295 __u8 pad_0x1310[0x1318-0x1310]; /* 0x1310 */
430 __u32 prefixreg_save_area; /* 0x1318 */ 296 __u32 prefixreg_save_area; /* 0x1318 */
431 __u32 fpt_creg_save_area; /* 0x131c */ 297 __u32 fpt_creg_save_area; /* 0x131c */
@@ -439,10 +305,12 @@ struct _lowcore
439 305
440 /* align to the top of the prefix area */ 306 /* align to the top of the prefix area */
441 __u8 pad_0x1400[0x2000-0x1400]; /* 0x1400 */ 307 __u8 pad_0x1400[0x2000-0x1400]; /* 0x1400 */
442#endif /* !__s390x__ */ 308} __packed;
443} __attribute__((packed)); /* End structure*/ 309
310#endif /* CONFIG_32BIT */
444 311
445#define S390_lowcore (*((struct _lowcore *) 0)) 312#define S390_lowcore (*((struct _lowcore *) 0))
313
446extern struct _lowcore *lowcore_ptr[]; 314extern struct _lowcore *lowcore_ptr[];
447 315
448static inline void set_prefix(__u32 address) 316static inline void set_prefix(__u32 address)
@@ -458,6 +326,4 @@ static inline __u32 store_prefix(void)
458 return address; 326 return address;
459} 327}
460 328
461#endif 329#endif /* _ASM_S390_LOWCORE_H */
462
463#endif
diff --git a/arch/s390/include/asm/page.h b/arch/s390/include/asm/page.h
index 5e9daf5d7f22..af650fb47206 100644
--- a/arch/s390/include/asm/page.h
+++ b/arch/s390/include/asm/page.h
@@ -107,9 +107,6 @@ typedef pte_t *pgtable_t;
107#define __pgd(x) ((pgd_t) { (x) } ) 107#define __pgd(x) ((pgd_t) { (x) } )
108#define __pgprot(x) ((pgprot_t) { (x) } ) 108#define __pgprot(x) ((pgprot_t) { (x) } )
109 109
110/* default storage key used for all pages */
111extern unsigned int default_storage_key;
112
113static inline void 110static inline void
114page_set_storage_key(unsigned long addr, unsigned int skey) 111page_set_storage_key(unsigned long addr, unsigned int skey)
115{ 112{
diff --git a/arch/s390/include/asm/pgtable.h b/arch/s390/include/asm/pgtable.h
index e2fa79cf0614..9b5b9189c15e 100644
--- a/arch/s390/include/asm/pgtable.h
+++ b/arch/s390/include/asm/pgtable.h
@@ -43,7 +43,7 @@ extern void vmem_map_init(void);
43 * The S390 doesn't have any external MMU info: the kernel page 43 * The S390 doesn't have any external MMU info: the kernel page
44 * tables contain all the necessary information. 44 * tables contain all the necessary information.
45 */ 45 */
46#define update_mmu_cache(vma, address, pte) do { } while (0) 46#define update_mmu_cache(vma, address, ptep) do { } while (0)
47 47
48/* 48/*
49 * ZERO_PAGE is a global shared page that is always zero: used 49 * ZERO_PAGE is a global shared page that is always zero: used
diff --git a/arch/s390/include/asm/processor.h b/arch/s390/include/asm/processor.h
index b42715458312..73e259834e10 100644
--- a/arch/s390/include/asm/processor.h
+++ b/arch/s390/include/asm/processor.h
@@ -28,7 +28,7 @@
28 28
29static inline void get_cpu_id(struct cpuid *ptr) 29static inline void get_cpu_id(struct cpuid *ptr)
30{ 30{
31 asm volatile("stidp 0(%1)" : "=m" (*ptr) : "a" (ptr)); 31 asm volatile("stidp %0" : "=Q" (*ptr));
32} 32}
33 33
34extern void s390_adjust_jiffies(void); 34extern void s390_adjust_jiffies(void);
@@ -184,9 +184,9 @@ static inline void psw_set_key(unsigned int key)
184static inline void __load_psw(psw_t psw) 184static inline void __load_psw(psw_t psw)
185{ 185{
186#ifndef __s390x__ 186#ifndef __s390x__
187 asm volatile("lpsw 0(%0)" : : "a" (&psw), "m" (psw) : "cc"); 187 asm volatile("lpsw %0" : : "Q" (psw) : "cc");
188#else 188#else
189 asm volatile("lpswe 0(%0)" : : "a" (&psw), "m" (psw) : "cc"); 189 asm volatile("lpswe %0" : : "Q" (psw) : "cc");
190#endif 190#endif
191} 191}
192 192
@@ -206,17 +206,17 @@ static inline void __load_psw_mask (unsigned long mask)
206 asm volatile( 206 asm volatile(
207 " basr %0,0\n" 207 " basr %0,0\n"
208 "0: ahi %0,1f-0b\n" 208 "0: ahi %0,1f-0b\n"
209 " st %0,4(%1)\n" 209 " st %0,%O1+4(%R1)\n"
210 " lpsw 0(%1)\n" 210 " lpsw %1\n"
211 "1:" 211 "1:"
212 : "=&d" (addr) : "a" (&psw), "m" (psw) : "memory", "cc"); 212 : "=&d" (addr), "=Q" (psw) : "Q" (psw) : "memory", "cc");
213#else /* __s390x__ */ 213#else /* __s390x__ */
214 asm volatile( 214 asm volatile(
215 " larl %0,1f\n" 215 " larl %0,1f\n"
216 " stg %0,8(%1)\n" 216 " stg %0,%O1+8(%R1)\n"
217 " lpswe 0(%1)\n" 217 " lpswe %1\n"
218 "1:" 218 "1:"
219 : "=&d" (addr) : "a" (&psw), "m" (psw) : "memory", "cc"); 219 : "=&d" (addr), "=Q" (psw) : "Q" (psw) : "memory", "cc");
220#endif /* __s390x__ */ 220#endif /* __s390x__ */
221} 221}
222 222
diff --git a/arch/s390/include/asm/ptrace.h b/arch/s390/include/asm/ptrace.h
index 95dcf183a28d..dd2d913afcae 100644
--- a/arch/s390/include/asm/ptrace.h
+++ b/arch/s390/include/asm/ptrace.h
@@ -492,13 +492,24 @@ struct user_regs_struct
492struct task_struct; 492struct task_struct;
493extern void user_enable_single_step(struct task_struct *); 493extern void user_enable_single_step(struct task_struct *);
494extern void user_disable_single_step(struct task_struct *); 494extern void user_disable_single_step(struct task_struct *);
495extern void show_regs(struct pt_regs * regs);
495 496
496#define user_mode(regs) (((regs)->psw.mask & PSW_MASK_PSTATE) != 0) 497#define user_mode(regs) (((regs)->psw.mask & PSW_MASK_PSTATE) != 0)
497#define instruction_pointer(regs) ((regs)->psw.addr & PSW_ADDR_INSN) 498#define instruction_pointer(regs) ((regs)->psw.addr & PSW_ADDR_INSN)
498#define user_stack_pointer(regs)((regs)->gprs[15]) 499#define user_stack_pointer(regs)((regs)->gprs[15])
499#define regs_return_value(regs)((regs)->gprs[2]) 500#define regs_return_value(regs)((regs)->gprs[2])
500#define profile_pc(regs) instruction_pointer(regs) 501#define profile_pc(regs) instruction_pointer(regs)
501extern void show_regs(struct pt_regs * regs); 502
503int regs_query_register_offset(const char *name);
504const char *regs_query_register_name(unsigned int offset);
505unsigned long regs_get_register(struct pt_regs *regs, unsigned int offset);
506unsigned long regs_get_kernel_stack_nth(struct pt_regs *regs, unsigned int n);
507
508static inline unsigned long kernel_stack_pointer(struct pt_regs *regs)
509{
510 return regs->gprs[15] & PSW_ADDR_INSN;
511}
512
502#endif /* __KERNEL__ */ 513#endif /* __KERNEL__ */
503#endif /* __ASSEMBLY__ */ 514#endif /* __ASSEMBLY__ */
504 515
diff --git a/arch/s390/include/asm/qdio.h b/arch/s390/include/asm/qdio.h
index 79d849f014f0..c666bfe5e984 100644
--- a/arch/s390/include/asm/qdio.h
+++ b/arch/s390/include/asm/qdio.h
@@ -13,7 +13,8 @@
13#include <asm/cio.h> 13#include <asm/cio.h>
14#include <asm/ccwdev.h> 14#include <asm/ccwdev.h>
15 15
16#define QDIO_MAX_QUEUES_PER_IRQ 32 16/* only use 4 queues to save some cachelines */
17#define QDIO_MAX_QUEUES_PER_IRQ 4
17#define QDIO_MAX_BUFFERS_PER_Q 128 18#define QDIO_MAX_BUFFERS_PER_Q 128
18#define QDIO_MAX_BUFFERS_MASK (QDIO_MAX_BUFFERS_PER_Q - 1) 19#define QDIO_MAX_BUFFERS_MASK (QDIO_MAX_BUFFERS_PER_Q - 1)
19#define QDIO_MAX_ELEMENTS_PER_BUFFER 16 20#define QDIO_MAX_ELEMENTS_PER_BUFFER 16
diff --git a/arch/s390/include/asm/rwsem.h b/arch/s390/include/asm/rwsem.h
index 9d2a17971805..423fdda2322d 100644
--- a/arch/s390/include/asm/rwsem.h
+++ b/arch/s390/include/asm/rwsem.h
@@ -124,21 +124,21 @@ static inline void __down_read(struct rw_semaphore *sem)
124 124
125 asm volatile( 125 asm volatile(
126#ifndef __s390x__ 126#ifndef __s390x__
127 " l %0,0(%3)\n" 127 " l %0,%2\n"
128 "0: lr %1,%0\n" 128 "0: lr %1,%0\n"
129 " ahi %1,%5\n" 129 " ahi %1,%4\n"
130 " cs %0,%1,0(%3)\n" 130 " cs %0,%1,%2\n"
131 " jl 0b" 131 " jl 0b"
132#else /* __s390x__ */ 132#else /* __s390x__ */
133 " lg %0,0(%3)\n" 133 " lg %0,%2\n"
134 "0: lgr %1,%0\n" 134 "0: lgr %1,%0\n"
135 " aghi %1,%5\n" 135 " aghi %1,%4\n"
136 " csg %0,%1,0(%3)\n" 136 " csg %0,%1,%2\n"
137 " jl 0b" 137 " jl 0b"
138#endif /* __s390x__ */ 138#endif /* __s390x__ */
139 : "=&d" (old), "=&d" (new), "=m" (sem->count) 139 : "=&d" (old), "=&d" (new), "=Q" (sem->count)
140 : "a" (&sem->count), "m" (sem->count), 140 : "Q" (sem->count), "i" (RWSEM_ACTIVE_READ_BIAS)
141 "i" (RWSEM_ACTIVE_READ_BIAS) : "cc", "memory"); 141 : "cc", "memory");
142 if (old < 0) 142 if (old < 0)
143 rwsem_down_read_failed(sem); 143 rwsem_down_read_failed(sem);
144} 144}
@@ -152,25 +152,25 @@ static inline int __down_read_trylock(struct rw_semaphore *sem)
152 152
153 asm volatile( 153 asm volatile(
154#ifndef __s390x__ 154#ifndef __s390x__
155 " l %0,0(%3)\n" 155 " l %0,%2\n"
156 "0: ltr %1,%0\n" 156 "0: ltr %1,%0\n"
157 " jm 1f\n" 157 " jm 1f\n"
158 " ahi %1,%5\n" 158 " ahi %1,%4\n"
159 " cs %0,%1,0(%3)\n" 159 " cs %0,%1,%2\n"
160 " jl 0b\n" 160 " jl 0b\n"
161 "1:" 161 "1:"
162#else /* __s390x__ */ 162#else /* __s390x__ */
163 " lg %0,0(%3)\n" 163 " lg %0,%2\n"
164 "0: ltgr %1,%0\n" 164 "0: ltgr %1,%0\n"
165 " jm 1f\n" 165 " jm 1f\n"
166 " aghi %1,%5\n" 166 " aghi %1,%4\n"
167 " csg %0,%1,0(%3)\n" 167 " csg %0,%1,%2\n"
168 " jl 0b\n" 168 " jl 0b\n"
169 "1:" 169 "1:"
170#endif /* __s390x__ */ 170#endif /* __s390x__ */
171 : "=&d" (old), "=&d" (new), "=m" (sem->count) 171 : "=&d" (old), "=&d" (new), "=Q" (sem->count)
172 : "a" (&sem->count), "m" (sem->count), 172 : "Q" (sem->count), "i" (RWSEM_ACTIVE_READ_BIAS)
173 "i" (RWSEM_ACTIVE_READ_BIAS) : "cc", "memory"); 173 : "cc", "memory");
174 return old >= 0 ? 1 : 0; 174 return old >= 0 ? 1 : 0;
175} 175}
176 176
@@ -184,20 +184,20 @@ static inline void __down_write_nested(struct rw_semaphore *sem, int subclass)
184 tmp = RWSEM_ACTIVE_WRITE_BIAS; 184 tmp = RWSEM_ACTIVE_WRITE_BIAS;
185 asm volatile( 185 asm volatile(
186#ifndef __s390x__ 186#ifndef __s390x__
187 " l %0,0(%3)\n" 187 " l %0,%2\n"
188 "0: lr %1,%0\n" 188 "0: lr %1,%0\n"
189 " a %1,%5\n" 189 " a %1,%4\n"
190 " cs %0,%1,0(%3)\n" 190 " cs %0,%1,%2\n"
191 " jl 0b" 191 " jl 0b"
192#else /* __s390x__ */ 192#else /* __s390x__ */
193 " lg %0,0(%3)\n" 193 " lg %0,%2\n"
194 "0: lgr %1,%0\n" 194 "0: lgr %1,%0\n"
195 " ag %1,%5\n" 195 " ag %1,%4\n"
196 " csg %0,%1,0(%3)\n" 196 " csg %0,%1,%2\n"
197 " jl 0b" 197 " jl 0b"
198#endif /* __s390x__ */ 198#endif /* __s390x__ */
199 : "=&d" (old), "=&d" (new), "=m" (sem->count) 199 : "=&d" (old), "=&d" (new), "=Q" (sem->count)
200 : "a" (&sem->count), "m" (sem->count), "m" (tmp) 200 : "Q" (sem->count), "m" (tmp)
201 : "cc", "memory"); 201 : "cc", "memory");
202 if (old != 0) 202 if (old != 0)
203 rwsem_down_write_failed(sem); 203 rwsem_down_write_failed(sem);
@@ -217,22 +217,22 @@ static inline int __down_write_trylock(struct rw_semaphore *sem)
217 217
218 asm volatile( 218 asm volatile(
219#ifndef __s390x__ 219#ifndef __s390x__
220 " l %0,0(%2)\n" 220 " l %0,%1\n"
221 "0: ltr %0,%0\n" 221 "0: ltr %0,%0\n"
222 " jnz 1f\n" 222 " jnz 1f\n"
223 " cs %0,%4,0(%2)\n" 223 " cs %0,%3,%1\n"
224 " jl 0b\n" 224 " jl 0b\n"
225#else /* __s390x__ */ 225#else /* __s390x__ */
226 " lg %0,0(%2)\n" 226 " lg %0,%1\n"
227 "0: ltgr %0,%0\n" 227 "0: ltgr %0,%0\n"
228 " jnz 1f\n" 228 " jnz 1f\n"
229 " csg %0,%4,0(%2)\n" 229 " csg %0,%3,%1\n"
230 " jl 0b\n" 230 " jl 0b\n"
231#endif /* __s390x__ */ 231#endif /* __s390x__ */
232 "1:" 232 "1:"
233 : "=&d" (old), "=m" (sem->count) 233 : "=&d" (old), "=Q" (sem->count)
234 : "a" (&sem->count), "m" (sem->count), 234 : "Q" (sem->count), "d" (RWSEM_ACTIVE_WRITE_BIAS)
235 "d" (RWSEM_ACTIVE_WRITE_BIAS) : "cc", "memory"); 235 : "cc", "memory");
236 return (old == RWSEM_UNLOCKED_VALUE) ? 1 : 0; 236 return (old == RWSEM_UNLOCKED_VALUE) ? 1 : 0;
237} 237}
238 238
@@ -245,21 +245,20 @@ static inline void __up_read(struct rw_semaphore *sem)
245 245
246 asm volatile( 246 asm volatile(
247#ifndef __s390x__ 247#ifndef __s390x__
248 " l %0,0(%3)\n" 248 " l %0,%2\n"
249 "0: lr %1,%0\n" 249 "0: lr %1,%0\n"
250 " ahi %1,%5\n" 250 " ahi %1,%4\n"
251 " cs %0,%1,0(%3)\n" 251 " cs %0,%1,%2\n"
252 " jl 0b" 252 " jl 0b"
253#else /* __s390x__ */ 253#else /* __s390x__ */
254 " lg %0,0(%3)\n" 254 " lg %0,%2\n"
255 "0: lgr %1,%0\n" 255 "0: lgr %1,%0\n"
256 " aghi %1,%5\n" 256 " aghi %1,%4\n"
257 " csg %0,%1,0(%3)\n" 257 " csg %0,%1,%2\n"
258 " jl 0b" 258 " jl 0b"
259#endif /* __s390x__ */ 259#endif /* __s390x__ */
260 : "=&d" (old), "=&d" (new), "=m" (sem->count) 260 : "=&d" (old), "=&d" (new), "=Q" (sem->count)
261 : "a" (&sem->count), "m" (sem->count), 261 : "Q" (sem->count), "i" (-RWSEM_ACTIVE_READ_BIAS)
262 "i" (-RWSEM_ACTIVE_READ_BIAS)
263 : "cc", "memory"); 262 : "cc", "memory");
264 if (new < 0) 263 if (new < 0)
265 if ((new & RWSEM_ACTIVE_MASK) == 0) 264 if ((new & RWSEM_ACTIVE_MASK) == 0)
@@ -276,20 +275,20 @@ static inline void __up_write(struct rw_semaphore *sem)
276 tmp = -RWSEM_ACTIVE_WRITE_BIAS; 275 tmp = -RWSEM_ACTIVE_WRITE_BIAS;
277 asm volatile( 276 asm volatile(
278#ifndef __s390x__ 277#ifndef __s390x__
279 " l %0,0(%3)\n" 278 " l %0,%2\n"
280 "0: lr %1,%0\n" 279 "0: lr %1,%0\n"
281 " a %1,%5\n" 280 " a %1,%4\n"
282 " cs %0,%1,0(%3)\n" 281 " cs %0,%1,%2\n"
283 " jl 0b" 282 " jl 0b"
284#else /* __s390x__ */ 283#else /* __s390x__ */
285 " lg %0,0(%3)\n" 284 " lg %0,%2\n"
286 "0: lgr %1,%0\n" 285 "0: lgr %1,%0\n"
287 " ag %1,%5\n" 286 " ag %1,%4\n"
288 " csg %0,%1,0(%3)\n" 287 " csg %0,%1,%2\n"
289 " jl 0b" 288 " jl 0b"
290#endif /* __s390x__ */ 289#endif /* __s390x__ */
291 : "=&d" (old), "=&d" (new), "=m" (sem->count) 290 : "=&d" (old), "=&d" (new), "=Q" (sem->count)
292 : "a" (&sem->count), "m" (sem->count), "m" (tmp) 291 : "Q" (sem->count), "m" (tmp)
293 : "cc", "memory"); 292 : "cc", "memory");
294 if (new < 0) 293 if (new < 0)
295 if ((new & RWSEM_ACTIVE_MASK) == 0) 294 if ((new & RWSEM_ACTIVE_MASK) == 0)
@@ -306,20 +305,20 @@ static inline void __downgrade_write(struct rw_semaphore *sem)
306 tmp = -RWSEM_WAITING_BIAS; 305 tmp = -RWSEM_WAITING_BIAS;
307 asm volatile( 306 asm volatile(
308#ifndef __s390x__ 307#ifndef __s390x__
309 " l %0,0(%3)\n" 308 " l %0,%2\n"
310 "0: lr %1,%0\n" 309 "0: lr %1,%0\n"
311 " a %1,%5\n" 310 " a %1,%4\n"
312 " cs %0,%1,0(%3)\n" 311 " cs %0,%1,%2\n"
313 " jl 0b" 312 " jl 0b"
314#else /* __s390x__ */ 313#else /* __s390x__ */
315 " lg %0,0(%3)\n" 314 " lg %0,%2\n"
316 "0: lgr %1,%0\n" 315 "0: lgr %1,%0\n"
317 " ag %1,%5\n" 316 " ag %1,%4\n"
318 " csg %0,%1,0(%3)\n" 317 " csg %0,%1,%2\n"
319 " jl 0b" 318 " jl 0b"
320#endif /* __s390x__ */ 319#endif /* __s390x__ */
321 : "=&d" (old), "=&d" (new), "=m" (sem->count) 320 : "=&d" (old), "=&d" (new), "=Q" (sem->count)
322 : "a" (&sem->count), "m" (sem->count), "m" (tmp) 321 : "Q" (sem->count), "m" (tmp)
323 : "cc", "memory"); 322 : "cc", "memory");
324 if (new > 1) 323 if (new > 1)
325 rwsem_downgrade_wake(sem); 324 rwsem_downgrade_wake(sem);
@@ -334,20 +333,20 @@ static inline void rwsem_atomic_add(long delta, struct rw_semaphore *sem)
334 333
335 asm volatile( 334 asm volatile(
336#ifndef __s390x__ 335#ifndef __s390x__
337 " l %0,0(%3)\n" 336 " l %0,%2\n"
338 "0: lr %1,%0\n" 337 "0: lr %1,%0\n"
339 " ar %1,%5\n" 338 " ar %1,%4\n"
340 " cs %0,%1,0(%3)\n" 339 " cs %0,%1,%2\n"
341 " jl 0b" 340 " jl 0b"
342#else /* __s390x__ */ 341#else /* __s390x__ */
343 " lg %0,0(%3)\n" 342 " lg %0,%2\n"
344 "0: lgr %1,%0\n" 343 "0: lgr %1,%0\n"
345 " agr %1,%5\n" 344 " agr %1,%4\n"
346 " csg %0,%1,0(%3)\n" 345 " csg %0,%1,%2\n"
347 " jl 0b" 346 " jl 0b"
348#endif /* __s390x__ */ 347#endif /* __s390x__ */
349 : "=&d" (old), "=&d" (new), "=m" (sem->count) 348 : "=&d" (old), "=&d" (new), "=Q" (sem->count)
350 : "a" (&sem->count), "m" (sem->count), "d" (delta) 349 : "Q" (sem->count), "d" (delta)
351 : "cc", "memory"); 350 : "cc", "memory");
352} 351}
353 352
@@ -360,20 +359,20 @@ static inline long rwsem_atomic_update(long delta, struct rw_semaphore *sem)
360 359
361 asm volatile( 360 asm volatile(
362#ifndef __s390x__ 361#ifndef __s390x__
363 " l %0,0(%3)\n" 362 " l %0,%2\n"
364 "0: lr %1,%0\n" 363 "0: lr %1,%0\n"
365 " ar %1,%5\n" 364 " ar %1,%4\n"
366 " cs %0,%1,0(%3)\n" 365 " cs %0,%1,%2\n"
367 " jl 0b" 366 " jl 0b"
368#else /* __s390x__ */ 367#else /* __s390x__ */
369 " lg %0,0(%3)\n" 368 " lg %0,%2\n"
370 "0: lgr %1,%0\n" 369 "0: lgr %1,%0\n"
371 " agr %1,%5\n" 370 " agr %1,%4\n"
372 " csg %0,%1,0(%3)\n" 371 " csg %0,%1,%2\n"
373 " jl 0b" 372 " jl 0b"
374#endif /* __s390x__ */ 373#endif /* __s390x__ */
375 : "=&d" (old), "=&d" (new), "=m" (sem->count) 374 : "=&d" (old), "=&d" (new), "=Q" (sem->count)
376 : "a" (&sem->count), "m" (sem->count), "d" (delta) 375 : "Q" (sem->count), "d" (delta)
377 : "cc", "memory"); 376 : "cc", "memory");
378 return new; 377 return new;
379} 378}
diff --git a/arch/s390/include/asm/setup.h b/arch/s390/include/asm/setup.h
index 52a779c337e8..9ab6bd3a65d1 100644
--- a/arch/s390/include/asm/setup.h
+++ b/arch/s390/include/asm/setup.h
@@ -14,14 +14,14 @@
14 14
15#ifdef __KERNEL__ 15#ifdef __KERNEL__
16 16
17#include <asm/lowcore.h>
18#include <asm/types.h>
19
20#define PARMAREA 0x10400 17#define PARMAREA 0x10400
21#define MEMORY_CHUNKS 256 18#define MEMORY_CHUNKS 256
22 19
23#ifndef __ASSEMBLY__ 20#ifndef __ASSEMBLY__
24 21
22#include <asm/lowcore.h>
23#include <asm/types.h>
24
25#ifndef __s390x__ 25#ifndef __s390x__
26#define IPL_DEVICE (*(unsigned long *) (0x10404)) 26#define IPL_DEVICE (*(unsigned long *) (0x10404))
27#define INITRD_START (*(unsigned long *) (0x1040C)) 27#define INITRD_START (*(unsigned long *) (0x1040C))
@@ -71,9 +71,12 @@ extern unsigned int user_mode;
71#define MACHINE_FLAG_KVM (1UL << 9) 71#define MACHINE_FLAG_KVM (1UL << 9)
72#define MACHINE_FLAG_HPAGE (1UL << 10) 72#define MACHINE_FLAG_HPAGE (1UL << 10)
73#define MACHINE_FLAG_PFMF (1UL << 11) 73#define MACHINE_FLAG_PFMF (1UL << 11)
74#define MACHINE_FLAG_LPAR (1UL << 12)
74 75
75#define MACHINE_IS_VM (S390_lowcore.machine_flags & MACHINE_FLAG_VM) 76#define MACHINE_IS_VM (S390_lowcore.machine_flags & MACHINE_FLAG_VM)
76#define MACHINE_IS_KVM (S390_lowcore.machine_flags & MACHINE_FLAG_KVM) 77#define MACHINE_IS_KVM (S390_lowcore.machine_flags & MACHINE_FLAG_KVM)
78#define MACHINE_IS_LPAR (S390_lowcore.machine_flags & MACHINE_FLAG_LPAR)
79
77#define MACHINE_HAS_DIAG9C (S390_lowcore.machine_flags & MACHINE_FLAG_DIAG9C) 80#define MACHINE_HAS_DIAG9C (S390_lowcore.machine_flags & MACHINE_FLAG_DIAG9C)
78 81
79#ifndef __s390x__ 82#ifndef __s390x__
diff --git a/arch/s390/include/asm/sigp.h b/arch/s390/include/asm/sigp.h
index f72d611f7e13..e3bffd4e2d66 100644
--- a/arch/s390/include/asm/sigp.h
+++ b/arch/s390/include/asm/sigp.h
@@ -1,24 +1,19 @@
1/* 1/*
2 * include/asm-s390/sigp.h 2 * Routines and structures for signalling other processors.
3 * 3 *
4 * S390 version 4 * Copyright IBM Corp. 1999,2010
5 * Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation 5 * Author(s): Denis Joseph Barrow,
6 * Author(s): Denis Joseph Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com), 6 * Martin Schwidefsky <schwidefsky@de.ibm.com>,
7 * Martin Schwidefsky (schwidefsky@de.ibm.com) 7 * Heiko Carstens <heiko.carstens@de.ibm.com>,
8 * Heiko Carstens (heiko.carstens@de.ibm.com)
9 *
10 * sigp.h by D.J. Barrow (c) IBM 1999
11 * contains routines / structures for signalling other S/390 processors in an
12 * SMP configuration.
13 */ 8 */
14 9
15#ifndef __SIGP__ 10#ifndef __ASM_SIGP_H
16#define __SIGP__ 11#define __ASM_SIGP_H
17 12
18#include <asm/system.h> 13#include <asm/system.h>
19 14
20/* get real cpu address from logical cpu number */ 15/* Get real cpu address from logical cpu number. */
21extern int __cpu_logical_map[]; 16extern unsigned short __cpu_logical_map[];
22 17
23static inline int cpu_logical_map(int cpu) 18static inline int cpu_logical_map(int cpu)
24{ 19{
@@ -29,107 +24,108 @@ static inline int cpu_logical_map(int cpu)
29#endif 24#endif
30} 25}
31 26
32typedef enum 27enum {
33{ 28 sigp_sense = 1,
34 sigp_unassigned=0x0, 29 sigp_external_call = 2,
35 sigp_sense, 30 sigp_emergency_signal = 3,
36 sigp_external_call, 31 sigp_start = 4,
37 sigp_emergency_signal, 32 sigp_stop = 5,
38 sigp_start, 33 sigp_restart = 6,
39 sigp_stop, 34 sigp_stop_and_store_status = 9,
40 sigp_restart, 35 sigp_initial_cpu_reset = 11,
41 sigp_unassigned1, 36 sigp_cpu_reset = 12,
42 sigp_unassigned2, 37 sigp_set_prefix = 13,
43 sigp_stop_and_store_status, 38 sigp_store_status_at_address = 14,
44 sigp_unassigned3, 39 sigp_store_extended_status_at_address = 15,
45 sigp_initial_cpu_reset, 40 sigp_set_architecture = 18,
46 sigp_cpu_reset, 41 sigp_conditional_emergency_signal = 19,
47 sigp_set_prefix, 42 sigp_sense_running = 21,
48 sigp_store_status_at_address, 43};
49 sigp_store_extended_status_at_address 44
50} sigp_order_code; 45enum {
51 46 sigp_order_code_accepted = 0,
52typedef __u32 sigp_status_word; 47 sigp_status_stored = 1,
53 48 sigp_busy = 2,
54typedef enum 49 sigp_not_operational = 3,
55{ 50};
56 sigp_order_code_accepted=0,
57 sigp_status_stored,
58 sigp_busy,
59 sigp_not_operational
60} sigp_ccode;
61
62 51
63/* 52/*
64 * Definitions for the external call 53 * Definitions for external call.
65 */ 54 */
66 55enum {
67/* 'Bit' signals, asynchronous */ 56 ec_schedule = 0,
68typedef enum
69{
70 ec_schedule=0,
71 ec_call_function, 57 ec_call_function,
72 ec_call_function_single, 58 ec_call_function_single,
73 ec_bit_last 59};
74} ec_bit_sig;
75 60
76/* 61/*
77 * Signal processor 62 * Signal processor.
78 */ 63 */
79static inline sigp_ccode 64static inline int raw_sigp(u16 cpu, int order)
80signal_processor(__u16 cpu_addr, sigp_order_code order_code)
81{ 65{
82 register unsigned long reg1 asm ("1") = 0; 66 register unsigned long reg1 asm ("1") = 0;
83 sigp_ccode ccode; 67 int ccode;
84 68
85 asm volatile( 69 asm volatile(
86 " sigp %1,%2,0(%3)\n" 70 " sigp %1,%2,0(%3)\n"
87 " ipm %0\n" 71 " ipm %0\n"
88 " srl %0,28\n" 72 " srl %0,28\n"
89 : "=d" (ccode) 73 : "=d" (ccode)
90 : "d" (reg1), "d" (cpu_logical_map(cpu_addr)), 74 : "d" (reg1), "d" (cpu),
91 "a" (order_code) : "cc" , "memory"); 75 "a" (order) : "cc" , "memory");
92 return ccode; 76 return ccode;
93} 77}
94 78
95/* 79/*
96 * Signal processor with parameter 80 * Signal processor with parameter.
97 */ 81 */
98static inline sigp_ccode 82static inline int raw_sigp_p(u32 parameter, u16 cpu, int order)
99signal_processor_p(__u32 parameter, __u16 cpu_addr, sigp_order_code order_code)
100{ 83{
101 register unsigned int reg1 asm ("1") = parameter; 84 register unsigned int reg1 asm ("1") = parameter;
102 sigp_ccode ccode; 85 int ccode;
103 86
104 asm volatile( 87 asm volatile(
105 " sigp %1,%2,0(%3)\n" 88 " sigp %1,%2,0(%3)\n"
106 " ipm %0\n" 89 " ipm %0\n"
107 " srl %0,28\n" 90 " srl %0,28\n"
108 : "=d" (ccode) 91 : "=d" (ccode)
109 : "d" (reg1), "d" (cpu_logical_map(cpu_addr)), 92 : "d" (reg1), "d" (cpu),
110 "a" (order_code) : "cc" , "memory"); 93 "a" (order) : "cc" , "memory");
111 return ccode; 94 return ccode;
112} 95}
113 96
114/* 97/*
115 * Signal processor with parameter and return status 98 * Signal processor with parameter and return status.
116 */ 99 */
117static inline sigp_ccode 100static inline int raw_sigp_ps(u32 *status, u32 parm, u16 cpu, int order)
118signal_processor_ps(__u32 *statusptr, __u32 parameter, __u16 cpu_addr,
119 sigp_order_code order_code)
120{ 101{
121 register unsigned int reg1 asm ("1") = parameter; 102 register unsigned int reg1 asm ("1") = parm;
122 sigp_ccode ccode; 103 int ccode;
123 104
124 asm volatile( 105 asm volatile(
125 " sigp %1,%2,0(%3)\n" 106 " sigp %1,%2,0(%3)\n"
126 " ipm %0\n" 107 " ipm %0\n"
127 " srl %0,28\n" 108 " srl %0,28\n"
128 : "=d" (ccode), "+d" (reg1) 109 : "=d" (ccode), "+d" (reg1)
129 : "d" (cpu_logical_map(cpu_addr)), "a" (order_code) 110 : "d" (cpu), "a" (order)
130 : "cc" , "memory"); 111 : "cc" , "memory");
131 *statusptr = reg1; 112 *status = reg1;
132 return ccode; 113 return ccode;
133} 114}
134 115
135#endif /* __SIGP__ */ 116static inline int sigp(int cpu, int order)
117{
118 return raw_sigp(cpu_logical_map(cpu), order);
119}
120
121static inline int sigp_p(u32 parameter, int cpu, int order)
122{
123 return raw_sigp_p(parameter, cpu_logical_map(cpu), order);
124}
125
126static inline int sigp_ps(u32 *status, u32 parm, int cpu, int order)
127{
128 return raw_sigp_ps(status, parm, cpu_logical_map(cpu), order);
129}
130
131#endif /* __ASM_SIGP_H */
diff --git a/arch/s390/include/asm/smp.h b/arch/s390/include/asm/smp.h
index 2ab1141eeb50..edc03cb9cd79 100644
--- a/arch/s390/include/asm/smp.h
+++ b/arch/s390/include/asm/smp.h
@@ -29,7 +29,43 @@ extern int smp_cpu_polarization[];
29extern void arch_send_call_function_single_ipi(int cpu); 29extern void arch_send_call_function_single_ipi(int cpu);
30extern void arch_send_call_function_ipi_mask(const struct cpumask *mask); 30extern void arch_send_call_function_ipi_mask(const struct cpumask *mask);
31 31
32extern union save_area *zfcpdump_save_areas[NR_CPUS + 1]; 32extern struct save_area *zfcpdump_save_areas[NR_CPUS + 1];
33
34extern void smp_switch_to_ipl_cpu(void (*func)(void *), void *);
35extern void smp_switch_to_cpu(void (*)(void *), void *, unsigned long sp,
36 int from, int to);
37extern void smp_restart_cpu(void);
38
39/*
40 * returns 1 if (virtual) cpu is scheduled
41 * returns 0 otherwise
42 */
43static inline int smp_vcpu_scheduled(int cpu)
44{
45 u32 status;
46
47 switch (sigp_ps(&status, 0, cpu, sigp_sense_running)) {
48 case sigp_status_stored:
49 /* Check for running status */
50 if (status & 0x400)
51 return 0;
52 break;
53 case sigp_not_operational:
54 return 0;
55 default:
56 break;
57 }
58 return 1;
59}
60
61#else /* CONFIG_SMP */
62
63static inline void smp_switch_to_ipl_cpu(void (*func)(void *), void *data)
64{
65 func(data);
66}
67
68#define smp_vcpu_scheduled (1)
33 69
34#endif /* CONFIG_SMP */ 70#endif /* CONFIG_SMP */
35 71
diff --git a/arch/s390/include/asm/spinlock.h b/arch/s390/include/asm/spinlock.h
index a587907d77f3..56612fc8186e 100644
--- a/arch/s390/include/asm/spinlock.h
+++ b/arch/s390/include/asm/spinlock.h
@@ -13,8 +13,6 @@
13 13
14#include <linux/smp.h> 14#include <linux/smp.h>
15 15
16#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2)
17
18static inline int 16static inline int
19_raw_compare_and_swap(volatile unsigned int *lock, 17_raw_compare_and_swap(volatile unsigned int *lock,
20 unsigned int old, unsigned int new) 18 unsigned int old, unsigned int new)
@@ -27,22 +25,6 @@ _raw_compare_and_swap(volatile unsigned int *lock,
27 return old; 25 return old;
28} 26}
29 27
30#else /* __GNUC__ */
31
32static inline int
33_raw_compare_and_swap(volatile unsigned int *lock,
34 unsigned int old, unsigned int new)
35{
36 asm volatile(
37 " cs %0,%3,0(%4)"
38 : "=d" (old), "=m" (*lock)
39 : "0" (old), "d" (new), "a" (lock), "m" (*lock)
40 : "cc", "memory" );
41 return old;
42}
43
44#endif /* __GNUC__ */
45
46/* 28/*
47 * Simple spin lock operations. There are two variants, one clears IRQ's 29 * Simple spin lock operations. There are two variants, one clears IRQ's
48 * on the local processor, one does not. 30 * on the local processor, one does not.
diff --git a/arch/s390/include/asm/swab.h b/arch/s390/include/asm/swab.h
index eb18dc1f327b..6bdee21c077e 100644
--- a/arch/s390/include/asm/swab.h
+++ b/arch/s390/include/asm/swab.h
@@ -47,11 +47,11 @@ static inline __u32 __arch_swab32p(const __u32 *x)
47 47
48 asm volatile( 48 asm volatile(
49#ifndef __s390x__ 49#ifndef __s390x__
50 " icm %0,8,3(%1)\n" 50 " icm %0,8,%O1+3(%R1)\n"
51 " icm %0,4,2(%1)\n" 51 " icm %0,4,%O1+2(%R1)\n"
52 " icm %0,2,1(%1)\n" 52 " icm %0,2,%O1+1(%R1)\n"
53 " ic %0,0(%1)" 53 " ic %0,%1"
54 : "=&d" (result) : "a" (x), "m" (*x) : "cc"); 54 : "=&d" (result) : "Q" (*x) : "cc");
55#else /* __s390x__ */ 55#else /* __s390x__ */
56 " lrv %0,%1" 56 " lrv %0,%1"
57 : "=d" (result) : "m" (*x)); 57 : "=d" (result) : "m" (*x));
@@ -77,9 +77,9 @@ static inline __u16 __arch_swab16p(const __u16 *x)
77 77
78 asm volatile( 78 asm volatile(
79#ifndef __s390x__ 79#ifndef __s390x__
80 " icm %0,2,1(%1)\n" 80 " icm %0,2,%O+1(%R1)\n"
81 " ic %0,0(%1)\n" 81 " ic %0,%1\n"
82 : "=&d" (result) : "a" (x), "m" (*x) : "cc"); 82 : "=&d" (result) : "Q" (*x) : "cc");
83#else /* __s390x__ */ 83#else /* __s390x__ */
84 " lrvh %0,%1" 84 " lrvh %0,%1"
85 : "=d" (result) : "m" (*x)); 85 : "=d" (result) : "m" (*x));
diff --git a/arch/s390/include/asm/syscall.h b/arch/s390/include/asm/syscall.h
index e0a73d3eb837..8429686951f9 100644
--- a/arch/s390/include/asm/syscall.h
+++ b/arch/s390/include/asm/syscall.h
@@ -15,6 +15,13 @@
15#include <linux/sched.h> 15#include <linux/sched.h>
16#include <asm/ptrace.h> 16#include <asm/ptrace.h>
17 17
18/*
19 * The syscall table always contains 32 bit pointers since we know that the
20 * address of the function to be called is (way) below 4GB. So the "int"
21 * type here is what we want [need] for both 32 bit and 64 bit systems.
22 */
23extern const unsigned int sys_call_table[];
24
18static inline long syscall_get_nr(struct task_struct *task, 25static inline long syscall_get_nr(struct task_struct *task,
19 struct pt_regs *regs) 26 struct pt_regs *regs)
20{ 27{
diff --git a/arch/s390/include/asm/sysinfo.h b/arch/s390/include/asm/sysinfo.h
index 9d70057d828c..22bdb2a0ee5f 100644
--- a/arch/s390/include/asm/sysinfo.h
+++ b/arch/s390/include/asm/sysinfo.h
@@ -87,7 +87,8 @@ struct sysinfo_2_2_2 {
87 87
88struct sysinfo_3_2_2 { 88struct sysinfo_3_2_2 {
89 char reserved_0[31]; 89 char reserved_0[31];
90 unsigned char count; 90 unsigned char :4;
91 unsigned char count:4;
91 struct { 92 struct {
92 char reserved_0[4]; 93 char reserved_0[4];
93 unsigned short cpus_total; 94 unsigned short cpus_total;
diff --git a/arch/s390/include/asm/system.h b/arch/s390/include/asm/system.h
index 379661d2f81a..67ee6c3c6bb3 100644
--- a/arch/s390/include/asm/system.h
+++ b/arch/s390/include/asm/system.h
@@ -24,65 +24,65 @@ extern struct task_struct *__switch_to(void *, void *);
24static inline void save_fp_regs(s390_fp_regs *fpregs) 24static inline void save_fp_regs(s390_fp_regs *fpregs)
25{ 25{
26 asm volatile( 26 asm volatile(
27 " std 0,8(%1)\n" 27 " std 0,%O0+8(%R0)\n"
28 " std 2,24(%1)\n" 28 " std 2,%O0+24(%R0)\n"
29 " std 4,40(%1)\n" 29 " std 4,%O0+40(%R0)\n"
30 " std 6,56(%1)" 30 " std 6,%O0+56(%R0)"
31 : "=m" (*fpregs) : "a" (fpregs), "m" (*fpregs) : "memory"); 31 : "=Q" (*fpregs) : "Q" (*fpregs));
32 if (!MACHINE_HAS_IEEE) 32 if (!MACHINE_HAS_IEEE)
33 return; 33 return;
34 asm volatile( 34 asm volatile(
35 " stfpc 0(%1)\n" 35 " stfpc %0\n"
36 " std 1,16(%1)\n" 36 " std 1,%O0+16(%R0)\n"
37 " std 3,32(%1)\n" 37 " std 3,%O0+32(%R0)\n"
38 " std 5,48(%1)\n" 38 " std 5,%O0+48(%R0)\n"
39 " std 7,64(%1)\n" 39 " std 7,%O0+64(%R0)\n"
40 " std 8,72(%1)\n" 40 " std 8,%O0+72(%R0)\n"
41 " std 9,80(%1)\n" 41 " std 9,%O0+80(%R0)\n"
42 " std 10,88(%1)\n" 42 " std 10,%O0+88(%R0)\n"
43 " std 11,96(%1)\n" 43 " std 11,%O0+96(%R0)\n"
44 " std 12,104(%1)\n" 44 " std 12,%O0+104(%R0)\n"
45 " std 13,112(%1)\n" 45 " std 13,%O0+112(%R0)\n"
46 " std 14,120(%1)\n" 46 " std 14,%O0+120(%R0)\n"
47 " std 15,128(%1)\n" 47 " std 15,%O0+128(%R0)\n"
48 : "=m" (*fpregs) : "a" (fpregs), "m" (*fpregs) : "memory"); 48 : "=Q" (*fpregs) : "Q" (*fpregs));
49} 49}
50 50
51static inline void restore_fp_regs(s390_fp_regs *fpregs) 51static inline void restore_fp_regs(s390_fp_regs *fpregs)
52{ 52{
53 asm volatile( 53 asm volatile(
54 " ld 0,8(%0)\n" 54 " ld 0,%O0+8(%R0)\n"
55 " ld 2,24(%0)\n" 55 " ld 2,%O0+24(%R0)\n"
56 " ld 4,40(%0)\n" 56 " ld 4,%O0+40(%R0)\n"
57 " ld 6,56(%0)" 57 " ld 6,%O0+56(%R0)"
58 : : "a" (fpregs), "m" (*fpregs)); 58 : : "Q" (*fpregs));
59 if (!MACHINE_HAS_IEEE) 59 if (!MACHINE_HAS_IEEE)
60 return; 60 return;
61 asm volatile( 61 asm volatile(
62 " lfpc 0(%0)\n" 62 " lfpc %0\n"
63 " ld 1,16(%0)\n" 63 " ld 1,%O0+16(%R0)\n"
64 " ld 3,32(%0)\n" 64 " ld 3,%O0+32(%R0)\n"
65 " ld 5,48(%0)\n" 65 " ld 5,%O0+48(%R0)\n"
66 " ld 7,64(%0)\n" 66 " ld 7,%O0+64(%R0)\n"
67 " ld 8,72(%0)\n" 67 " ld 8,%O0+72(%R0)\n"
68 " ld 9,80(%0)\n" 68 " ld 9,%O0+80(%R0)\n"
69 " ld 10,88(%0)\n" 69 " ld 10,%O0+88(%R0)\n"
70 " ld 11,96(%0)\n" 70 " ld 11,%O0+96(%R0)\n"
71 " ld 12,104(%0)\n" 71 " ld 12,%O0+104(%R0)\n"
72 " ld 13,112(%0)\n" 72 " ld 13,%O0+112(%R0)\n"
73 " ld 14,120(%0)\n" 73 " ld 14,%O0+120(%R0)\n"
74 " ld 15,128(%0)\n" 74 " ld 15,%O0+128(%R0)\n"
75 : : "a" (fpregs), "m" (*fpregs)); 75 : : "Q" (*fpregs));
76} 76}
77 77
78static inline void save_access_regs(unsigned int *acrs) 78static inline void save_access_regs(unsigned int *acrs)
79{ 79{
80 asm volatile("stam 0,15,0(%0)" : : "a" (acrs) : "memory"); 80 asm volatile("stam 0,15,%0" : "=Q" (*acrs));
81} 81}
82 82
83static inline void restore_access_regs(unsigned int *acrs) 83static inline void restore_access_regs(unsigned int *acrs)
84{ 84{
85 asm volatile("lam 0,15,0(%0)" : : "a" (acrs)); 85 asm volatile("lam 0,15,%0" : : "Q" (*acrs));
86} 86}
87 87
88#define switch_to(prev,next,last) do { \ 88#define switch_to(prev,next,last) do { \
@@ -139,48 +139,48 @@ static inline unsigned long __xchg(unsigned long x, void * ptr, int size)
139 shift = (3 ^ (addr & 3)) << 3; 139 shift = (3 ^ (addr & 3)) << 3;
140 addr ^= addr & 3; 140 addr ^= addr & 3;
141 asm volatile( 141 asm volatile(
142 " l %0,0(%4)\n" 142 " l %0,%4\n"
143 "0: lr 0,%0\n" 143 "0: lr 0,%0\n"
144 " nr 0,%3\n" 144 " nr 0,%3\n"
145 " or 0,%2\n" 145 " or 0,%2\n"
146 " cs %0,0,0(%4)\n" 146 " cs %0,0,%4\n"
147 " jl 0b\n" 147 " jl 0b\n"
148 : "=&d" (old), "=m" (*(int *) addr) 148 : "=&d" (old), "=Q" (*(int *) addr)
149 : "d" (x << shift), "d" (~(255 << shift)), "a" (addr), 149 : "d" (x << shift), "d" (~(255 << shift)),
150 "m" (*(int *) addr) : "memory", "cc", "0"); 150 "Q" (*(int *) addr) : "memory", "cc", "0");
151 return old >> shift; 151 return old >> shift;
152 case 2: 152 case 2:
153 addr = (unsigned long) ptr; 153 addr = (unsigned long) ptr;
154 shift = (2 ^ (addr & 2)) << 3; 154 shift = (2 ^ (addr & 2)) << 3;
155 addr ^= addr & 2; 155 addr ^= addr & 2;
156 asm volatile( 156 asm volatile(
157 " l %0,0(%4)\n" 157 " l %0,%4\n"
158 "0: lr 0,%0\n" 158 "0: lr 0,%0\n"
159 " nr 0,%3\n" 159 " nr 0,%3\n"
160 " or 0,%2\n" 160 " or 0,%2\n"
161 " cs %0,0,0(%4)\n" 161 " cs %0,0,%4\n"
162 " jl 0b\n" 162 " jl 0b\n"
163 : "=&d" (old), "=m" (*(int *) addr) 163 : "=&d" (old), "=Q" (*(int *) addr)
164 : "d" (x << shift), "d" (~(65535 << shift)), "a" (addr), 164 : "d" (x << shift), "d" (~(65535 << shift)),
165 "m" (*(int *) addr) : "memory", "cc", "0"); 165 "Q" (*(int *) addr) : "memory", "cc", "0");
166 return old >> shift; 166 return old >> shift;
167 case 4: 167 case 4:
168 asm volatile( 168 asm volatile(
169 " l %0,0(%3)\n" 169 " l %0,%3\n"
170 "0: cs %0,%2,0(%3)\n" 170 "0: cs %0,%2,%3\n"
171 " jl 0b\n" 171 " jl 0b\n"
172 : "=&d" (old), "=m" (*(int *) ptr) 172 : "=&d" (old), "=Q" (*(int *) ptr)
173 : "d" (x), "a" (ptr), "m" (*(int *) ptr) 173 : "d" (x), "Q" (*(int *) ptr)
174 : "memory", "cc"); 174 : "memory", "cc");
175 return old; 175 return old;
176#ifdef __s390x__ 176#ifdef __s390x__
177 case 8: 177 case 8:
178 asm volatile( 178 asm volatile(
179 " lg %0,0(%3)\n" 179 " lg %0,%3\n"
180 "0: csg %0,%2,0(%3)\n" 180 "0: csg %0,%2,%3\n"
181 " jl 0b\n" 181 " jl 0b\n"
182 : "=&d" (old), "=m" (*(long *) ptr) 182 : "=&d" (old), "=m" (*(long *) ptr)
183 : "d" (x), "a" (ptr), "m" (*(long *) ptr) 183 : "d" (x), "Q" (*(long *) ptr)
184 : "memory", "cc"); 184 : "memory", "cc");
185 return old; 185 return old;
186#endif /* __s390x__ */ 186#endif /* __s390x__ */
@@ -215,20 +215,20 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
215 shift = (3 ^ (addr & 3)) << 3; 215 shift = (3 ^ (addr & 3)) << 3;
216 addr ^= addr & 3; 216 addr ^= addr & 3;
217 asm volatile( 217 asm volatile(
218 " l %0,0(%4)\n" 218 " l %0,%2\n"
219 "0: nr %0,%5\n" 219 "0: nr %0,%5\n"
220 " lr %1,%0\n" 220 " lr %1,%0\n"
221 " or %0,%2\n" 221 " or %0,%2\n"
222 " or %1,%3\n" 222 " or %1,%3\n"
223 " cs %0,%1,0(%4)\n" 223 " cs %0,%1,%2\n"
224 " jnl 1f\n" 224 " jnl 1f\n"
225 " xr %1,%0\n" 225 " xr %1,%0\n"
226 " nr %1,%5\n" 226 " nr %1,%5\n"
227 " jnz 0b\n" 227 " jnz 0b\n"
228 "1:" 228 "1:"
229 : "=&d" (prev), "=&d" (tmp) 229 : "=&d" (prev), "=&d" (tmp), "=Q" (*(int *) ptr)
230 : "d" (old << shift), "d" (new << shift), "a" (ptr), 230 : "d" (old << shift), "d" (new << shift),
231 "d" (~(255 << shift)) 231 "d" (~(255 << shift)), "Q" (*(int *) ptr)
232 : "memory", "cc"); 232 : "memory", "cc");
233 return prev >> shift; 233 return prev >> shift;
234 case 2: 234 case 2:
@@ -236,33 +236,35 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
236 shift = (2 ^ (addr & 2)) << 3; 236 shift = (2 ^ (addr & 2)) << 3;
237 addr ^= addr & 2; 237 addr ^= addr & 2;
238 asm volatile( 238 asm volatile(
239 " l %0,0(%4)\n" 239 " l %0,%2\n"
240 "0: nr %0,%5\n" 240 "0: nr %0,%5\n"
241 " lr %1,%0\n" 241 " lr %1,%0\n"
242 " or %0,%2\n" 242 " or %0,%2\n"
243 " or %1,%3\n" 243 " or %1,%3\n"
244 " cs %0,%1,0(%4)\n" 244 " cs %0,%1,%2\n"
245 " jnl 1f\n" 245 " jnl 1f\n"
246 " xr %1,%0\n" 246 " xr %1,%0\n"
247 " nr %1,%5\n" 247 " nr %1,%5\n"
248 " jnz 0b\n" 248 " jnz 0b\n"
249 "1:" 249 "1:"
250 : "=&d" (prev), "=&d" (tmp) 250 : "=&d" (prev), "=&d" (tmp), "=Q" (*(int *) ptr)
251 : "d" (old << shift), "d" (new << shift), "a" (ptr), 251 : "d" (old << shift), "d" (new << shift),
252 "d" (~(65535 << shift)) 252 "d" (~(65535 << shift)), "Q" (*(int *) ptr)
253 : "memory", "cc"); 253 : "memory", "cc");
254 return prev >> shift; 254 return prev >> shift;
255 case 4: 255 case 4:
256 asm volatile( 256 asm volatile(
257 " cs %0,%2,0(%3)\n" 257 " cs %0,%3,%1\n"
258 : "=&d" (prev) : "0" (old), "d" (new), "a" (ptr) 258 : "=&d" (prev), "=Q" (*(int *) ptr)
259 : "0" (old), "d" (new), "Q" (*(int *) ptr)
259 : "memory", "cc"); 260 : "memory", "cc");
260 return prev; 261 return prev;
261#ifdef __s390x__ 262#ifdef __s390x__
262 case 8: 263 case 8:
263 asm volatile( 264 asm volatile(
264 " csg %0,%2,0(%3)\n" 265 " csg %0,%3,%1\n"
265 : "=&d" (prev) : "0" (old), "d" (new), "a" (ptr) 266 : "=&d" (prev), "=Q" (*(long *) ptr)
267 : "0" (old), "d" (new), "Q" (*(long *) ptr)
266 : "memory", "cc"); 268 : "memory", "cc");
267 return prev; 269 return prev;
268#endif /* __s390x__ */ 270#endif /* __s390x__ */
@@ -302,17 +304,17 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
302#define __ctl_load(array, low, high) ({ \ 304#define __ctl_load(array, low, high) ({ \
303 typedef struct { char _[sizeof(array)]; } addrtype; \ 305 typedef struct { char _[sizeof(array)]; } addrtype; \
304 asm volatile( \ 306 asm volatile( \
305 " lctlg %1,%2,0(%0)\n" \ 307 " lctlg %1,%2,%0\n" \
306 : : "a" (&array), "i" (low), "i" (high), \ 308 : : "Q" (*(addrtype *)(&array)), \
307 "m" (*(addrtype *)(&array))); \ 309 "i" (low), "i" (high)); \
308 }) 310 })
309 311
310#define __ctl_store(array, low, high) ({ \ 312#define __ctl_store(array, low, high) ({ \
311 typedef struct { char _[sizeof(array)]; } addrtype; \ 313 typedef struct { char _[sizeof(array)]; } addrtype; \
312 asm volatile( \ 314 asm volatile( \
313 " stctg %2,%3,0(%1)\n" \ 315 " stctg %1,%2,%0\n" \
314 : "=m" (*(addrtype *)(&array)) \ 316 : "=Q" (*(addrtype *)(&array)) \
315 : "a" (&array), "i" (low), "i" (high)); \ 317 : "i" (low), "i" (high)); \
316 }) 318 })
317 319
318#else /* __s390x__ */ 320#else /* __s390x__ */
@@ -320,17 +322,17 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
320#define __ctl_load(array, low, high) ({ \ 322#define __ctl_load(array, low, high) ({ \
321 typedef struct { char _[sizeof(array)]; } addrtype; \ 323 typedef struct { char _[sizeof(array)]; } addrtype; \
322 asm volatile( \ 324 asm volatile( \
323 " lctl %1,%2,0(%0)\n" \ 325 " lctl %1,%2,%0\n" \
324 : : "a" (&array), "i" (low), "i" (high), \ 326 : : "Q" (*(addrtype *)(&array)), \
325 "m" (*(addrtype *)(&array))); \ 327 "i" (low), "i" (high)); \
326}) 328})
327 329
328#define __ctl_store(array, low, high) ({ \ 330#define __ctl_store(array, low, high) ({ \
329 typedef struct { char _[sizeof(array)]; } addrtype; \ 331 typedef struct { char _[sizeof(array)]; } addrtype; \
330 asm volatile( \ 332 asm volatile( \
331 " stctl %2,%3,0(%1)\n" \ 333 " stctl %1,%2,%0\n" \
332 : "=m" (*(addrtype *)(&array)) \ 334 : "=Q" (*(addrtype *)(&array)) \
333 : "a" (&array), "i" (low), "i" (high)); \ 335 : "i" (low), "i" (high)); \
334 }) 336 })
335 337
336#endif /* __s390x__ */ 338#endif /* __s390x__ */
diff --git a/arch/s390/include/asm/thread_info.h b/arch/s390/include/asm/thread_info.h
index 66069e736842..34f0873d6525 100644
--- a/arch/s390/include/asm/thread_info.h
+++ b/arch/s390/include/asm/thread_info.h
@@ -73,7 +73,7 @@ struct thread_info {
73/* how to get the thread information struct from C */ 73/* how to get the thread information struct from C */
74static inline struct thread_info *current_thread_info(void) 74static inline struct thread_info *current_thread_info(void)
75{ 75{
76 return (struct thread_info *)((*(unsigned long *) __LC_KERNEL_STACK)-THREAD_SIZE); 76 return (struct thread_info *)(S390_lowcore.kernel_stack - THREAD_SIZE);
77} 77}
78 78
79#define THREAD_SIZE_ORDER THREAD_ORDER 79#define THREAD_SIZE_ORDER THREAD_ORDER
diff --git a/arch/s390/include/asm/timex.h b/arch/s390/include/asm/timex.h
index 68d9fea34b4b..f174bdaa6b59 100644
--- a/arch/s390/include/asm/timex.h
+++ b/arch/s390/include/asm/timex.h
@@ -20,10 +20,10 @@ static inline int set_clock(__u64 time)
20 int cc; 20 int cc;
21 21
22 asm volatile( 22 asm volatile(
23 " sck 0(%2)\n" 23 " sck %1\n"
24 " ipm %0\n" 24 " ipm %0\n"
25 " srl %0,28\n" 25 " srl %0,28\n"
26 : "=d" (cc) : "m" (time), "a" (&time) : "cc"); 26 : "=d" (cc) : "Q" (time) : "cc");
27 return cc; 27 return cc;
28} 28}
29 29
@@ -32,21 +32,21 @@ static inline int store_clock(__u64 *time)
32 int cc; 32 int cc;
33 33
34 asm volatile( 34 asm volatile(
35 " stck 0(%2)\n" 35 " stck %1\n"
36 " ipm %0\n" 36 " ipm %0\n"
37 " srl %0,28\n" 37 " srl %0,28\n"
38 : "=d" (cc), "=m" (*time) : "a" (time) : "cc"); 38 : "=d" (cc), "=Q" (*time) : : "cc");
39 return cc; 39 return cc;
40} 40}
41 41
42static inline void set_clock_comparator(__u64 time) 42static inline void set_clock_comparator(__u64 time)
43{ 43{
44 asm volatile("sckc 0(%1)" : : "m" (time), "a" (&time)); 44 asm volatile("sckc %0" : : "Q" (time));
45} 45}
46 46
47static inline void store_clock_comparator(__u64 *time) 47static inline void store_clock_comparator(__u64 *time)
48{ 48{
49 asm volatile("stckc 0(%1)" : "=m" (*time) : "a" (time)); 49 asm volatile("stckc %0" : "=Q" (*time));
50} 50}
51 51
52#define CLOCK_TICK_RATE 1193180 /* Underlying HZ */ 52#define CLOCK_TICK_RATE 1193180 /* Underlying HZ */
@@ -57,11 +57,7 @@ static inline unsigned long long get_clock (void)
57{ 57{
58 unsigned long long clk; 58 unsigned long long clk;
59 59
60#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2)
61 asm volatile("stck %0" : "=Q" (clk) : : "cc"); 60 asm volatile("stck %0" : "=Q" (clk) : : "cc");
62#else /* __GNUC__ */
63 asm volatile("stck 0(%1)" : "=m" (clk) : "a" (&clk) : "cc");
64#endif /* __GNUC__ */
65 return clk; 61 return clk;
66} 62}
67 63
@@ -69,13 +65,7 @@ static inline unsigned long long get_clock_xt(void)
69{ 65{
70 unsigned char clk[16]; 66 unsigned char clk[16];
71 67
72#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2)
73 asm volatile("stcke %0" : "=Q" (clk) : : "cc"); 68 asm volatile("stcke %0" : "=Q" (clk) : : "cc");
74#else /* __GNUC__ */
75 asm volatile("stcke 0(%1)" : "=m" (clk)
76 : "a" (clk) : "cc");
77#endif /* __GNUC__ */
78
79 return *((unsigned long long *)&clk[1]); 69 return *((unsigned long long *)&clk[1]);
80} 70}
81 71
diff --git a/arch/s390/include/asm/uaccess.h b/arch/s390/include/asm/uaccess.h
index cbf0a8745bf4..d6b1ed0ec52b 100644
--- a/arch/s390/include/asm/uaccess.h
+++ b/arch/s390/include/asm/uaccess.h
@@ -265,6 +265,12 @@ __copy_from_user(void *to, const void __user *from, unsigned long n)
265 return uaccess.copy_from_user(n, from, to); 265 return uaccess.copy_from_user(n, from, to);
266} 266}
267 267
268extern void copy_from_user_overflow(void)
269#ifdef CONFIG_DEBUG_STRICT_USER_COPY_CHECKS
270__compiletime_warning("copy_from_user() buffer size is not provably correct")
271#endif
272;
273
268/** 274/**
269 * copy_from_user: - Copy a block of data from user space. 275 * copy_from_user: - Copy a block of data from user space.
270 * @to: Destination address, in kernel space. 276 * @to: Destination address, in kernel space.
@@ -284,7 +290,13 @@ __copy_from_user(void *to, const void __user *from, unsigned long n)
284static inline unsigned long __must_check 290static inline unsigned long __must_check
285copy_from_user(void *to, const void __user *from, unsigned long n) 291copy_from_user(void *to, const void __user *from, unsigned long n)
286{ 292{
293 unsigned int sz = __compiletime_object_size(to);
294
287 might_fault(); 295 might_fault();
296 if (unlikely(sz != -1 && sz < n)) {
297 copy_from_user_overflow();
298 return n;
299 }
288 if (access_ok(VERIFY_READ, from, n)) 300 if (access_ok(VERIFY_READ, from, n))
289 n = __copy_from_user(to, from, n); 301 n = __copy_from_user(to, from, n);
290 else 302 else
diff --git a/arch/s390/include/asm/vdso.h b/arch/s390/include/asm/vdso.h
index 7bdd7c8ebc91..4a76d9480cce 100644
--- a/arch/s390/include/asm/vdso.h
+++ b/arch/s390/include/asm/vdso.h
@@ -7,7 +7,7 @@
7#define VDSO32_LBASE 0 7#define VDSO32_LBASE 0
8#define VDSO64_LBASE 0 8#define VDSO64_LBASE 0
9 9
10#define VDSO_VERSION_STRING LINUX_2.6.26 10#define VDSO_VERSION_STRING LINUX_2.6.29
11 11
12#ifndef __ASSEMBLY__ 12#ifndef __ASSEMBLY__
13 13
diff --git a/arch/s390/kernel/Makefile b/arch/s390/kernel/Makefile
index 683f6381cc59..64230bc392fa 100644
--- a/arch/s390/kernel/Makefile
+++ b/arch/s390/kernel/Makefile
@@ -29,9 +29,12 @@ obj-y += $(if $(CONFIG_64BIT),entry64.o,entry.o)
29obj-y += $(if $(CONFIG_64BIT),reipl64.o,reipl.o) 29obj-y += $(if $(CONFIG_64BIT),reipl64.o,reipl.o)
30 30
31extra-y += head.o init_task.o vmlinux.lds 31extra-y += head.o init_task.o vmlinux.lds
32extra-y += $(if $(CONFIG_64BIT),head64.o,head31.o)
32 33
33obj-$(CONFIG_MODULES) += s390_ksyms.o module.o 34obj-$(CONFIG_MODULES) += s390_ksyms.o module.o
34obj-$(CONFIG_SMP) += smp.o topology.o 35obj-$(CONFIG_SMP) += smp.o topology.o
36obj-$(CONFIG_SMP) += $(if $(CONFIG_64BIT),switch_cpu64.o, \
37 switch_cpu.o)
35obj-$(CONFIG_HIBERNATION) += suspend.o swsusp_asm64.o 38obj-$(CONFIG_HIBERNATION) += suspend.o swsusp_asm64.o
36obj-$(CONFIG_AUDIT) += audit.o 39obj-$(CONFIG_AUDIT) += audit.o
37compat-obj-$(CONFIG_AUDIT) += compat_audit.o 40compat-obj-$(CONFIG_AUDIT) += compat_audit.o
diff --git a/arch/s390/kernel/asm-offsets.c b/arch/s390/kernel/asm-offsets.c
index 63e46433e81d..08db736dded0 100644
--- a/arch/s390/kernel/asm-offsets.c
+++ b/arch/s390/kernel/asm-offsets.c
@@ -4,18 +4,27 @@
4 * and format the required data. 4 * and format the required data.
5 */ 5 */
6 6
7#include <linux/sched.h> 7#define ASM_OFFSETS_C
8
8#include <linux/kbuild.h> 9#include <linux/kbuild.h>
10#include <linux/sched.h>
9#include <asm/vdso.h> 11#include <asm/vdso.h>
10#include <asm/sigp.h> 12#include <asm/sigp.h>
11 13
14/*
15 * Make sure that the compiler is new enough. We want a compiler that
16 * is known to work with the "Q" assembler constraint.
17 */
18#if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 3)
19#error Your compiler is too old; please use version 3.3.3 or newer
20#endif
21
12int main(void) 22int main(void)
13{ 23{
14 DEFINE(__THREAD_info, offsetof(struct task_struct, stack)); 24 DEFINE(__THREAD_info, offsetof(struct task_struct, stack));
15 DEFINE(__THREAD_ksp, offsetof(struct task_struct, thread.ksp)); 25 DEFINE(__THREAD_ksp, offsetof(struct task_struct, thread.ksp));
16 DEFINE(__THREAD_per, offsetof(struct task_struct, thread.per_info)); 26 DEFINE(__THREAD_per, offsetof(struct task_struct, thread.per_info));
17 DEFINE(__THREAD_mm_segment, 27 DEFINE(__THREAD_mm_segment, offsetof(struct task_struct, thread.mm_segment));
18 offsetof(struct task_struct, thread.mm_segment));
19 BLANK(); 28 BLANK();
20 DEFINE(__TASK_pid, offsetof(struct task_struct, pid)); 29 DEFINE(__TASK_pid, offsetof(struct task_struct, pid));
21 BLANK(); 30 BLANK();
@@ -52,18 +61,94 @@ int main(void)
52 DEFINE(__VDSO_WTOM_NSEC, offsetof(struct vdso_data, wtom_clock_nsec)); 61 DEFINE(__VDSO_WTOM_NSEC, offsetof(struct vdso_data, wtom_clock_nsec));
53 DEFINE(__VDSO_TIMEZONE, offsetof(struct vdso_data, tz_minuteswest)); 62 DEFINE(__VDSO_TIMEZONE, offsetof(struct vdso_data, tz_minuteswest));
54 DEFINE(__VDSO_ECTG_OK, offsetof(struct vdso_data, ectg_available)); 63 DEFINE(__VDSO_ECTG_OK, offsetof(struct vdso_data, ectg_available));
55 DEFINE(__VDSO_ECTG_BASE, 64 DEFINE(__VDSO_ECTG_BASE, offsetof(struct vdso_per_cpu_data, ectg_timer_base));
56 offsetof(struct vdso_per_cpu_data, ectg_timer_base)); 65 DEFINE(__VDSO_ECTG_USER, offsetof(struct vdso_per_cpu_data, ectg_user_time));
57 DEFINE(__VDSO_ECTG_USER,
58 offsetof(struct vdso_per_cpu_data, ectg_user_time));
59 /* constants used by the vdso */ 66 /* constants used by the vdso */
60 DEFINE(CLOCK_REALTIME, CLOCK_REALTIME); 67 DEFINE(CLOCK_REALTIME, CLOCK_REALTIME);
61 DEFINE(CLOCK_MONOTONIC, CLOCK_MONOTONIC); 68 DEFINE(CLOCK_MONOTONIC, CLOCK_MONOTONIC);
62 DEFINE(CLOCK_REALTIME_RES, MONOTONIC_RES_NSEC); 69 DEFINE(CLOCK_REALTIME_RES, MONOTONIC_RES_NSEC);
70 BLANK();
63 /* constants for SIGP */ 71 /* constants for SIGP */
64 DEFINE(__SIGP_STOP, sigp_stop); 72 DEFINE(__SIGP_STOP, sigp_stop);
65 DEFINE(__SIGP_RESTART, sigp_restart); 73 DEFINE(__SIGP_RESTART, sigp_restart);
66 DEFINE(__SIGP_SENSE, sigp_sense); 74 DEFINE(__SIGP_SENSE, sigp_sense);
67 DEFINE(__SIGP_INITIAL_CPU_RESET, sigp_initial_cpu_reset); 75 DEFINE(__SIGP_INITIAL_CPU_RESET, sigp_initial_cpu_reset);
76 BLANK();
77 /* lowcore offsets */
78 DEFINE(__LC_EXT_PARAMS, offsetof(struct _lowcore, ext_params));
79 DEFINE(__LC_CPU_ADDRESS, offsetof(struct _lowcore, cpu_addr));
80 DEFINE(__LC_EXT_INT_CODE, offsetof(struct _lowcore, ext_int_code));
81 DEFINE(__LC_SVC_ILC, offsetof(struct _lowcore, svc_ilc));
82 DEFINE(__LC_SVC_INT_CODE, offsetof(struct _lowcore, svc_code));
83 DEFINE(__LC_PGM_ILC, offsetof(struct _lowcore, pgm_ilc));
84 DEFINE(__LC_PGM_INT_CODE, offsetof(struct _lowcore, pgm_code));
85 DEFINE(__LC_PER_ATMID, offsetof(struct _lowcore, per_perc_atmid));
86 DEFINE(__LC_PER_ADDRESS, offsetof(struct _lowcore, per_address));
87 DEFINE(__LC_PER_ACCESS_ID, offsetof(struct _lowcore, per_access_id));
88 DEFINE(__LC_AR_MODE_ID, offsetof(struct _lowcore, ar_access_id));
89 DEFINE(__LC_SUBCHANNEL_ID, offsetof(struct _lowcore, subchannel_id));
90 DEFINE(__LC_SUBCHANNEL_NR, offsetof(struct _lowcore, subchannel_nr));
91 DEFINE(__LC_IO_INT_PARM, offsetof(struct _lowcore, io_int_parm));
92 DEFINE(__LC_IO_INT_WORD, offsetof(struct _lowcore, io_int_word));
93 DEFINE(__LC_STFL_FAC_LIST, offsetof(struct _lowcore, stfl_fac_list));
94 DEFINE(__LC_MCCK_CODE, offsetof(struct _lowcore, mcck_interruption_code));
95 DEFINE(__LC_DUMP_REIPL, offsetof(struct _lowcore, ipib));
96 BLANK();
97 DEFINE(__LC_RST_NEW_PSW, offsetof(struct _lowcore, restart_psw));
98 DEFINE(__LC_RST_OLD_PSW, offsetof(struct _lowcore, restart_old_psw));
99 DEFINE(__LC_EXT_OLD_PSW, offsetof(struct _lowcore, external_old_psw));
100 DEFINE(__LC_SVC_OLD_PSW, offsetof(struct _lowcore, svc_old_psw));
101 DEFINE(__LC_PGM_OLD_PSW, offsetof(struct _lowcore, program_old_psw));
102 DEFINE(__LC_MCK_OLD_PSW, offsetof(struct _lowcore, mcck_old_psw));
103 DEFINE(__LC_IO_OLD_PSW, offsetof(struct _lowcore, io_old_psw));
104 DEFINE(__LC_EXT_NEW_PSW, offsetof(struct _lowcore, external_new_psw));
105 DEFINE(__LC_SVC_NEW_PSW, offsetof(struct _lowcore, svc_new_psw));
106 DEFINE(__LC_PGM_NEW_PSW, offsetof(struct _lowcore, program_new_psw));
107 DEFINE(__LC_MCK_NEW_PSW, offsetof(struct _lowcore, mcck_new_psw));
108 DEFINE(__LC_IO_NEW_PSW, offsetof(struct _lowcore, io_new_psw));
109 DEFINE(__LC_SAVE_AREA, offsetof(struct _lowcore, save_area));
110 DEFINE(__LC_RETURN_PSW, offsetof(struct _lowcore, return_psw));
111 DEFINE(__LC_RETURN_MCCK_PSW, offsetof(struct _lowcore, return_mcck_psw));
112 DEFINE(__LC_SYNC_ENTER_TIMER, offsetof(struct _lowcore, sync_enter_timer));
113 DEFINE(__LC_ASYNC_ENTER_TIMER, offsetof(struct _lowcore, async_enter_timer));
114 DEFINE(__LC_EXIT_TIMER, offsetof(struct _lowcore, exit_timer));
115 DEFINE(__LC_USER_TIMER, offsetof(struct _lowcore, user_timer));
116 DEFINE(__LC_SYSTEM_TIMER, offsetof(struct _lowcore, system_timer));
117 DEFINE(__LC_STEAL_TIMER, offsetof(struct _lowcore, steal_timer));
118 DEFINE(__LC_LAST_UPDATE_TIMER, offsetof(struct _lowcore, last_update_timer));
119 DEFINE(__LC_LAST_UPDATE_CLOCK, offsetof(struct _lowcore, last_update_clock));
120 DEFINE(__LC_CURRENT, offsetof(struct _lowcore, current_task));
121 DEFINE(__LC_THREAD_INFO, offsetof(struct _lowcore, thread_info));
122 DEFINE(__LC_KERNEL_STACK, offsetof(struct _lowcore, kernel_stack));
123 DEFINE(__LC_ASYNC_STACK, offsetof(struct _lowcore, async_stack));
124 DEFINE(__LC_PANIC_STACK, offsetof(struct _lowcore, panic_stack));
125 DEFINE(__LC_KERNEL_ASCE, offsetof(struct _lowcore, kernel_asce));
126 DEFINE(__LC_USER_ASCE, offsetof(struct _lowcore, user_asce));
127 DEFINE(__LC_USER_EXEC_ASCE, offsetof(struct _lowcore, user_exec_asce));
128 DEFINE(__LC_CPUID, offsetof(struct _lowcore, cpu_id));
129 DEFINE(__LC_INT_CLOCK, offsetof(struct _lowcore, int_clock));
130 DEFINE(__LC_MACHINE_FLAGS, offsetof(struct _lowcore, machine_flags));
131 DEFINE(__LC_FTRACE_FUNC, offsetof(struct _lowcore, ftrace_func));
132 DEFINE(__LC_IRB, offsetof(struct _lowcore, irb));
133 DEFINE(__LC_CPU_TIMER_SAVE_AREA, offsetof(struct _lowcore, cpu_timer_save_area));
134 DEFINE(__LC_CLOCK_COMP_SAVE_AREA, offsetof(struct _lowcore, clock_comp_save_area));
135 DEFINE(__LC_PSW_SAVE_AREA, offsetof(struct _lowcore, psw_save_area));
136 DEFINE(__LC_PREFIX_SAVE_AREA, offsetof(struct _lowcore, prefixreg_save_area));
137 DEFINE(__LC_AREGS_SAVE_AREA, offsetof(struct _lowcore, access_regs_save_area));
138 DEFINE(__LC_FPREGS_SAVE_AREA, offsetof(struct _lowcore, floating_pt_save_area));
139 DEFINE(__LC_GPREGS_SAVE_AREA, offsetof(struct _lowcore, gpregs_save_area));
140 DEFINE(__LC_CREGS_SAVE_AREA, offsetof(struct _lowcore, cregs_save_area));
141#ifdef CONFIG_32BIT
142 DEFINE(__LC_PFAULT_INTPARM, offsetof(struct _lowcore, ext_params));
143 DEFINE(SAVE_AREA_BASE, offsetof(struct _lowcore, extended_save_area_addr));
144#else /* CONFIG_32BIT */
145 DEFINE(__LC_PFAULT_INTPARM, offsetof(struct _lowcore, ext_params2));
146 DEFINE(__LC_EXT_PARAMS2, offsetof(struct _lowcore, ext_params2));
147 DEFINE(SAVE_AREA_BASE, offsetof(struct _lowcore, floating_pt_save_area));
148 DEFINE(__LC_PASTE, offsetof(struct _lowcore, paste));
149 DEFINE(__LC_FP_CREG_SAVE_AREA, offsetof(struct _lowcore, fpt_creg_save_area));
150 DEFINE(__LC_LAST_BREAK, offsetof(struct _lowcore, breaking_event_addr));
151 DEFINE(__LC_VDSO_PER_CPU, offsetof(struct _lowcore, vdso_per_cpu_data));
152#endif /* CONFIG_32BIT */
68 return 0; 153 return 0;
69} 154}
diff --git a/arch/s390/kernel/base.S b/arch/s390/kernel/base.S
index dc7e5259770f..15e46ca94335 100644
--- a/arch/s390/kernel/base.S
+++ b/arch/s390/kernel/base.S
@@ -6,8 +6,8 @@
6 * Michael Holzheu <holzheu@de.ibm.com> 6 * Michael Holzheu <holzheu@de.ibm.com>
7 */ 7 */
8 8
9#include <asm/asm-offsets.h>
9#include <asm/ptrace.h> 10#include <asm/ptrace.h>
10#include <asm/lowcore.h>
11 11
12#ifdef CONFIG_64BIT 12#ifdef CONFIG_64BIT
13 13
diff --git a/arch/s390/kernel/dis.c b/arch/s390/kernel/dis.c
index db943a7ec513..b39b27d68b45 100644
--- a/arch/s390/kernel/dis.c
+++ b/arch/s390/kernel/dis.c
@@ -86,10 +86,17 @@ enum {
86 U4_12, /* 4 bit unsigned value starting at 12 */ 86 U4_12, /* 4 bit unsigned value starting at 12 */
87 U4_16, /* 4 bit unsigned value starting at 16 */ 87 U4_16, /* 4 bit unsigned value starting at 16 */
88 U4_20, /* 4 bit unsigned value starting at 20 */ 88 U4_20, /* 4 bit unsigned value starting at 20 */
89 U4_32, /* 4 bit unsigned value starting at 32 */
89 U8_8, /* 8 bit unsigned value starting at 8 */ 90 U8_8, /* 8 bit unsigned value starting at 8 */
90 U8_16, /* 8 bit unsigned value starting at 16 */ 91 U8_16, /* 8 bit unsigned value starting at 16 */
92 U8_24, /* 8 bit unsigned value starting at 24 */
93 U8_32, /* 8 bit unsigned value starting at 32 */
94 I8_8, /* 8 bit signed value starting at 8 */
95 I8_32, /* 8 bit signed value starting at 32 */
91 I16_16, /* 16 bit signed value starting at 16 */ 96 I16_16, /* 16 bit signed value starting at 16 */
97 I16_32, /* 32 bit signed value starting at 16 */
92 U16_16, /* 16 bit unsigned value starting at 16 */ 98 U16_16, /* 16 bit unsigned value starting at 16 */
99 U16_32, /* 32 bit unsigned value starting at 16 */
93 J16_16, /* PC relative jump offset at 16 */ 100 J16_16, /* PC relative jump offset at 16 */
94 J32_16, /* PC relative long offset at 16 */ 101 J32_16, /* PC relative long offset at 16 */
95 I32_16, /* 32 bit signed value starting at 16 */ 102 I32_16, /* 32 bit signed value starting at 16 */
@@ -104,21 +111,37 @@ enum {
104 */ 111 */
105enum { 112enum {
106 INSTR_INVALID, 113 INSTR_INVALID,
107 INSTR_E, INSTR_RIE_RRP, INSTR_RIL_RI, INSTR_RIL_RP, INSTR_RIL_RU, 114 INSTR_E,
108 INSTR_RIL_UP, INSTR_RI_RI, INSTR_RI_RP, INSTR_RI_RU, INSTR_RI_UP, 115 INSTR_RIE_R0IU, INSTR_RIE_R0UU, INSTR_RIE_RRP, INSTR_RIE_RRPU,
116 INSTR_RIE_RRUUU, INSTR_RIE_RUPI, INSTR_RIE_RUPU,
117 INSTR_RIL_RI, INSTR_RIL_RP, INSTR_RIL_RU, INSTR_RIL_UP,
118 INSTR_RIS_R0RDU, INSTR_RIS_R0UU, INSTR_RIS_RURDI, INSTR_RIS_RURDU,
119 INSTR_RI_RI, INSTR_RI_RP, INSTR_RI_RU, INSTR_RI_UP,
109 INSTR_RRE_00, INSTR_RRE_0R, INSTR_RRE_AA, INSTR_RRE_AR, INSTR_RRE_F0, 120 INSTR_RRE_00, INSTR_RRE_0R, INSTR_RRE_AA, INSTR_RRE_AR, INSTR_RRE_F0,
110 INSTR_RRE_FF, INSTR_RRE_R0, INSTR_RRE_RA, INSTR_RRE_RF, INSTR_RRE_RR, 121 INSTR_RRE_FF, INSTR_RRE_FR, INSTR_RRE_R0, INSTR_RRE_RA, INSTR_RRE_RF,
111 INSTR_RRE_RR_OPT, INSTR_RRF_F0FF, INSTR_RRF_FUFF, INSTR_RRF_M0RR, 122 INSTR_RRE_RR, INSTR_RRE_RR_OPT,
112 INSTR_RRF_R0RR, INSTR_RRF_RURR, INSTR_RRF_U0FF, INSTR_RRF_U0RF, 123 INSTR_RRF_0UFF, INSTR_RRF_F0FF, INSTR_RRF_F0FF2, INSTR_RRF_F0FR,
124 INSTR_RRF_FFRU, INSTR_RRF_FUFF, INSTR_RRF_M0RR, INSTR_RRF_R0RR,
125 INSTR_RRF_RURR, INSTR_RRF_U0FF, INSTR_RRF_U0RF, INSTR_RRF_U0RR,
126 INSTR_RRF_UUFF, INSTR_RRR_F0FF, INSTR_RRS_RRRDU,
113 INSTR_RR_FF, INSTR_RR_R0, INSTR_RR_RR, INSTR_RR_U0, INSTR_RR_UR, 127 INSTR_RR_FF, INSTR_RR_R0, INSTR_RR_RR, INSTR_RR_U0, INSTR_RR_UR,
114 INSTR_RSE_CCRD, INSTR_RSE_RRRD, INSTR_RSE_RURD, INSTR_RSI_RRP, 128 INSTR_RSE_CCRD, INSTR_RSE_RRRD, INSTR_RSE_RURD,
115 INSTR_RSL_R0RD, INSTR_RSY_AARD, INSTR_RSY_CCRD, INSTR_RSY_RRRD, 129 INSTR_RSI_RRP,
116 INSTR_RSY_RURD, INSTR_RS_AARD, INSTR_RS_CCRD, INSTR_RS_R0RD, 130 INSTR_RSL_R0RD,
117 INSTR_RS_RRRD, INSTR_RS_RURD, INSTR_RXE_FRRD, INSTR_RXE_RRRD, 131 INSTR_RSY_AARD, INSTR_RSY_CCRD, INSTR_RSY_RRRD, INSTR_RSY_RURD,
118 INSTR_RXF_FRRDF, INSTR_RXY_FRRD, INSTR_RXY_RRRD, INSTR_RX_FRRD, 132 INSTR_RS_AARD, INSTR_RS_CCRD, INSTR_RS_R0RD, INSTR_RS_RRRD,
119 INSTR_RX_RRRD, INSTR_RX_URRD, INSTR_SIY_URD, INSTR_SI_URD, 133 INSTR_RS_RURD,
120 INSTR_SSE_RDRD, INSTR_SSF_RRDRD, INSTR_SS_L0RDRD, INSTR_SS_LIRDRD, 134 INSTR_RXE_FRRD, INSTR_RXE_RRRD,
121 INSTR_SS_LLRDRD, INSTR_SS_RRRDRD, INSTR_SS_RRRDRD2, INSTR_SS_RRRDRD3, 135 INSTR_RXF_FRRDF,
136 INSTR_RXY_FRRD, INSTR_RXY_RRRD, INSTR_RXY_URRD,
137 INSTR_RX_FRRD, INSTR_RX_RRRD, INSTR_RX_URRD,
138 INSTR_SIL_RDI, INSTR_SIL_RDU,
139 INSTR_SIY_IRD, INSTR_SIY_URD,
140 INSTR_SI_URD,
141 INSTR_SSE_RDRD,
142 INSTR_SSF_RRDRD,
143 INSTR_SS_L0RDRD, INSTR_SS_LIRDRD, INSTR_SS_LLRDRD, INSTR_SS_RRRDRD,
144 INSTR_SS_RRRDRD2, INSTR_SS_RRRDRD3,
122 INSTR_S_00, INSTR_S_RD, 145 INSTR_S_00, INSTR_S_RD,
123}; 146};
124 147
@@ -129,7 +152,7 @@ struct operand {
129}; 152};
130 153
131struct insn { 154struct insn {
132 const char name[5]; 155 const char name[6];
133 unsigned char opfrag; 156 unsigned char opfrag;
134 unsigned char format; 157 unsigned char format;
135}; 158};
@@ -170,11 +193,16 @@ static const struct operand operands[] =
170 [U4_12] = { 4, 12, 0 }, 193 [U4_12] = { 4, 12, 0 },
171 [U4_16] = { 4, 16, 0 }, 194 [U4_16] = { 4, 16, 0 },
172 [U4_20] = { 4, 20, 0 }, 195 [U4_20] = { 4, 20, 0 },
196 [U4_32] = { 4, 32, 0 },
173 [U8_8] = { 8, 8, 0 }, 197 [U8_8] = { 8, 8, 0 },
174 [U8_16] = { 8, 16, 0 }, 198 [U8_16] = { 8, 16, 0 },
199 [U8_24] = { 8, 24, 0 },
200 [U8_32] = { 8, 32, 0 },
175 [I16_16] = { 16, 16, OPERAND_SIGNED }, 201 [I16_16] = { 16, 16, OPERAND_SIGNED },
176 [U16_16] = { 16, 16, 0 }, 202 [U16_16] = { 16, 16, 0 },
203 [U16_32] = { 16, 32, 0 },
177 [J16_16] = { 16, 16, OPERAND_PCREL }, 204 [J16_16] = { 16, 16, OPERAND_PCREL },
205 [I16_32] = { 16, 32, OPERAND_SIGNED },
178 [J32_16] = { 32, 16, OPERAND_PCREL }, 206 [J32_16] = { 32, 16, OPERAND_PCREL },
179 [I32_16] = { 32, 16, OPERAND_SIGNED }, 207 [I32_16] = { 32, 16, OPERAND_SIGNED },
180 [U32_16] = { 32, 16, 0 }, 208 [U32_16] = { 32, 16, 0 },
@@ -183,82 +211,93 @@ static const struct operand operands[] =
183}; 211};
184 212
185static const unsigned char formats[][7] = { 213static const unsigned char formats[][7] = {
186 [INSTR_E] = { 0xff, 0,0,0,0,0,0 }, /* e.g. pr */ 214 [INSTR_E] = { 0xff, 0,0,0,0,0,0 },
187 [INSTR_RIE_RRP] = { 0xff, R_8,R_12,J16_16,0,0,0 }, /* e.g. brxhg */ 215 [INSTR_RIE_R0UU] = { 0xff, R_8,U16_16,U4_32,0,0,0 },
188 [INSTR_RIL_RP] = { 0x0f, R_8,J32_16,0,0,0,0 }, /* e.g. brasl */ 216 [INSTR_RIE_RRPU] = { 0xff, R_8,R_12,U4_32,J16_16,0,0 },
189 [INSTR_RIL_UP] = { 0x0f, U4_8,J32_16,0,0,0,0 }, /* e.g. brcl */ 217 [INSTR_RIE_RRP] = { 0xff, R_8,R_12,J16_16,0,0,0 },
190 [INSTR_RIL_RI] = { 0x0f, R_8,I32_16,0,0,0,0 }, /* e.g. afi */ 218 [INSTR_RIE_RRUUU] = { 0xff, R_8,R_12,U8_16,U8_24,U8_32,0 },
191 [INSTR_RIL_RU] = { 0x0f, R_8,U32_16,0,0,0,0 }, /* e.g. alfi */ 219 [INSTR_RIE_RUPI] = { 0xff, R_8,I8_32,U4_12,J16_16,0,0 },
192 [INSTR_RI_RI] = { 0x0f, R_8,I16_16,0,0,0,0 }, /* e.g. ahi */ 220 [INSTR_RIL_RI] = { 0x0f, R_8,I32_16,0,0,0,0 },
193 [INSTR_RI_RP] = { 0x0f, R_8,J16_16,0,0,0,0 }, /* e.g. brct */ 221 [INSTR_RIL_RP] = { 0x0f, R_8,J32_16,0,0,0,0 },
194 [INSTR_RI_RU] = { 0x0f, R_8,U16_16,0,0,0,0 }, /* e.g. tml */ 222 [INSTR_RIL_RU] = { 0x0f, R_8,U32_16,0,0,0,0 },
195 [INSTR_RI_UP] = { 0x0f, U4_8,J16_16,0,0,0,0 }, /* e.g. brc */ 223 [INSTR_RIL_UP] = { 0x0f, U4_8,J32_16,0,0,0,0 },
196 [INSTR_RRE_00] = { 0xff, 0,0,0,0,0,0 }, /* e.g. palb */ 224 [INSTR_RIS_R0RDU] = { 0xff, R_8,U8_32,D_20,B_16,0,0 },
197 [INSTR_RRE_0R] = { 0xff, R_28,0,0,0,0,0 }, /* e.g. tb */ 225 [INSTR_RIS_RURDI] = { 0xff, R_8,I8_32,U4_12,D_20,B_16,0 },
198 [INSTR_RRE_AA] = { 0xff, A_24,A_28,0,0,0,0 }, /* e.g. cpya */ 226 [INSTR_RIS_RURDU] = { 0xff, R_8,U8_32,U4_12,D_20,B_16,0 },
199 [INSTR_RRE_AR] = { 0xff, A_24,R_28,0,0,0,0 }, /* e.g. sar */ 227 [INSTR_RI_RI] = { 0x0f, R_8,I16_16,0,0,0,0 },
200 [INSTR_RRE_F0] = { 0xff, F_24,0,0,0,0,0 }, /* e.g. sqer */ 228 [INSTR_RI_RP] = { 0x0f, R_8,J16_16,0,0,0,0 },
201 [INSTR_RRE_FF] = { 0xff, F_24,F_28,0,0,0,0 }, /* e.g. debr */ 229 [INSTR_RI_RU] = { 0x0f, R_8,U16_16,0,0,0,0 },
202 [INSTR_RRE_R0] = { 0xff, R_24,0,0,0,0,0 }, /* e.g. ipm */ 230 [INSTR_RI_UP] = { 0x0f, U4_8,J16_16,0,0,0,0 },
203 [INSTR_RRE_RA] = { 0xff, R_24,A_28,0,0,0,0 }, /* e.g. ear */ 231 [INSTR_RRE_00] = { 0xff, 0,0,0,0,0,0 },
204 [INSTR_RRE_RF] = { 0xff, R_24,F_28,0,0,0,0 }, /* e.g. cefbr */ 232 [INSTR_RRE_0R] = { 0xff, R_28,0,0,0,0,0 },
205 [INSTR_RRE_RR] = { 0xff, R_24,R_28,0,0,0,0 }, /* e.g. lura */ 233 [INSTR_RRE_AA] = { 0xff, A_24,A_28,0,0,0,0 },
206 [INSTR_RRE_RR_OPT]= { 0xff, R_24,RO_28,0,0,0,0 }, /* efpc, sfpc */ 234 [INSTR_RRE_AR] = { 0xff, A_24,R_28,0,0,0,0 },
207 [INSTR_RRF_F0FF] = { 0xff, F_16,F_24,F_28,0,0,0 }, /* e.g. madbr */ 235 [INSTR_RRE_F0] = { 0xff, F_24,0,0,0,0,0 },
208 [INSTR_RRF_FUFF] = { 0xff, F_24,F_16,F_28,U4_20,0,0 },/* e.g. didbr */ 236 [INSTR_RRE_FF] = { 0xff, F_24,F_28,0,0,0,0 },
209 [INSTR_RRF_RURR] = { 0xff, R_24,R_28,R_16,U4_20,0,0 },/* e.g. .insn */ 237 [INSTR_RRE_FR] = { 0xff, F_24,R_28,0,0,0,0 },
210 [INSTR_RRF_R0RR] = { 0xff, R_24,R_16,R_28,0,0,0 }, /* e.g. idte */ 238 [INSTR_RRE_R0] = { 0xff, R_24,0,0,0,0,0 },
211 [INSTR_RRF_U0FF] = { 0xff, F_24,U4_16,F_28,0,0,0 }, /* e.g. fixr */ 239 [INSTR_RRE_RA] = { 0xff, R_24,A_28,0,0,0,0 },
212 [INSTR_RRF_U0RF] = { 0xff, R_24,U4_16,F_28,0,0,0 }, /* e.g. cfebr */ 240 [INSTR_RRE_RF] = { 0xff, R_24,F_28,0,0,0,0 },
213 [INSTR_RRF_M0RR] = { 0xff, R_24,R_28,M_16,0,0,0 }, /* e.g. sske */ 241 [INSTR_RRE_RR] = { 0xff, R_24,R_28,0,0,0,0 },
214 [INSTR_RR_FF] = { 0xff, F_8,F_12,0,0,0,0 }, /* e.g. adr */ 242 [INSTR_RRE_RR_OPT]= { 0xff, R_24,RO_28,0,0,0,0 },
215 [INSTR_RR_R0] = { 0xff, R_8, 0,0,0,0,0 }, /* e.g. spm */ 243 [INSTR_RRF_0UFF] = { 0xff, F_24,F_28,U4_20,0,0,0 },
216 [INSTR_RR_RR] = { 0xff, R_8,R_12,0,0,0,0 }, /* e.g. lr */ 244 [INSTR_RRF_F0FF2] = { 0xff, F_24,F_16,F_28,0,0,0 },
217 [INSTR_RR_U0] = { 0xff, U8_8, 0,0,0,0,0 }, /* e.g. svc */ 245 [INSTR_RRF_F0FF] = { 0xff, F_16,F_24,F_28,0,0,0 },
218 [INSTR_RR_UR] = { 0xff, U4_8,R_12,0,0,0,0 }, /* e.g. bcr */ 246 [INSTR_RRF_F0FR] = { 0xff, F_24,F_16,R_28,0,0,0 },
219 [INSTR_RSE_RRRD] = { 0xff, R_8,R_12,D_20,B_16,0,0 }, /* e.g. lmh */ 247 [INSTR_RRF_FFRU] = { 0xff, F_24,F_16,R_28,U4_20,0,0 },
220 [INSTR_RSE_CCRD] = { 0xff, C_8,C_12,D_20,B_16,0,0 }, /* e.g. lmh */ 248 [INSTR_RRF_FUFF] = { 0xff, F_24,F_16,F_28,U4_20,0,0 },
221 [INSTR_RSE_RURD] = { 0xff, R_8,U4_12,D_20,B_16,0,0 }, /* e.g. icmh */ 249 [INSTR_RRF_M0RR] = { 0xff, R_24,R_28,M_16,0,0,0 },
222 [INSTR_RSL_R0RD] = { 0xff, R_8,D_20,B_16,0,0,0 }, /* e.g. tp */ 250 [INSTR_RRF_R0RR] = { 0xff, R_24,R_16,R_28,0,0,0 },
223 [INSTR_RSI_RRP] = { 0xff, R_8,R_12,J16_16,0,0,0 }, /* e.g. brxh */ 251 [INSTR_RRF_RURR] = { 0xff, R_24,R_28,R_16,U4_20,0,0 },
224 [INSTR_RSY_RRRD] = { 0xff, R_8,R_12,D20_20,B_16,0,0 },/* e.g. stmy */ 252 [INSTR_RRF_U0FF] = { 0xff, F_24,U4_16,F_28,0,0,0 },
253 [INSTR_RRF_U0RF] = { 0xff, R_24,U4_16,F_28,0,0,0 },
254 [INSTR_RRF_U0RR] = { 0xff, R_24,R_28,U4_16,0,0,0 },
255 [INSTR_RRF_UUFF] = { 0xff, F_24,U4_16,F_28,U4_20,0,0 },
256 [INSTR_RRR_F0FF] = { 0xff, F_24,F_28,F_16,0,0,0 },
257 [INSTR_RRS_RRRDU] = { 0xff, R_8,R_12,U4_32,D_20,B_16,0 },
258 [INSTR_RR_FF] = { 0xff, F_8,F_12,0,0,0,0 },
259 [INSTR_RR_R0] = { 0xff, R_8, 0,0,0,0,0 },
260 [INSTR_RR_RR] = { 0xff, R_8,R_12,0,0,0,0 },
261 [INSTR_RR_U0] = { 0xff, U8_8, 0,0,0,0,0 },
262 [INSTR_RR_UR] = { 0xff, U4_8,R_12,0,0,0,0 },
263 [INSTR_RSE_CCRD] = { 0xff, C_8,C_12,D_20,B_16,0,0 },
264 [INSTR_RSE_RRRD] = { 0xff, R_8,R_12,D_20,B_16,0,0 },
265 [INSTR_RSE_RURD] = { 0xff, R_8,U4_12,D_20,B_16,0,0 },
266 [INSTR_RSI_RRP] = { 0xff, R_8,R_12,J16_16,0,0,0 },
267 [INSTR_RSL_R0RD] = { 0xff, D_20,L4_8,B_16,0,0,0 },
268 [INSTR_RSY_AARD] = { 0xff, A_8,A_12,D20_20,B_16,0,0 },
269 [INSTR_RSY_CCRD] = { 0xff, C_8,C_12,D20_20,B_16,0,0 },
270 [INSTR_RSY_RRRD] = { 0xff, R_8,R_12,D20_20,B_16,0,0 },
225 [INSTR_RSY_RURD] = { 0xff, R_8,U4_12,D20_20,B_16,0,0 }, 271 [INSTR_RSY_RURD] = { 0xff, R_8,U4_12,D20_20,B_16,0,0 },
226 /* e.g. icmh */ 272 [INSTR_RS_AARD] = { 0xff, A_8,A_12,D_20,B_16,0,0 },
227 [INSTR_RSY_AARD] = { 0xff, A_8,A_12,D20_20,B_16,0,0 },/* e.g. lamy */ 273 [INSTR_RS_CCRD] = { 0xff, C_8,C_12,D_20,B_16,0,0 },
228 [INSTR_RSY_CCRD] = { 0xff, C_8,C_12,D20_20,B_16,0,0 },/* e.g. lamy */ 274 [INSTR_RS_R0RD] = { 0xff, R_8,D_20,B_16,0,0,0 },
229 [INSTR_RS_AARD] = { 0xff, A_8,A_12,D_20,B_16,0,0 }, /* e.g. lam */ 275 [INSTR_RS_RRRD] = { 0xff, R_8,R_12,D_20,B_16,0,0 },
230 [INSTR_RS_CCRD] = { 0xff, C_8,C_12,D_20,B_16,0,0 }, /* e.g. lctl */ 276 [INSTR_RS_RURD] = { 0xff, R_8,U4_12,D_20,B_16,0,0 },
231 [INSTR_RS_R0RD] = { 0xff, R_8,D_20,B_16,0,0,0 }, /* e.g. sll */ 277 [INSTR_RXE_FRRD] = { 0xff, F_8,D_20,X_12,B_16,0,0 },
232 [INSTR_RS_RRRD] = { 0xff, R_8,R_12,D_20,B_16,0,0 }, /* e.g. cs */ 278 [INSTR_RXE_RRRD] = { 0xff, R_8,D_20,X_12,B_16,0,0 },
233 [INSTR_RS_RURD] = { 0xff, R_8,U4_12,D_20,B_16,0,0 }, /* e.g. icm */
234 [INSTR_RXE_FRRD] = { 0xff, F_8,D_20,X_12,B_16,0,0 }, /* e.g. axbr */
235 [INSTR_RXE_RRRD] = { 0xff, R_8,D_20,X_12,B_16,0,0 }, /* e.g. lg */
236 [INSTR_RXF_FRRDF] = { 0xff, F_32,F_8,D_20,X_12,B_16,0 }, 279 [INSTR_RXF_FRRDF] = { 0xff, F_32,F_8,D_20,X_12,B_16,0 },
237 /* e.g. madb */ 280 [INSTR_RXY_FRRD] = { 0xff, F_8,D20_20,X_12,B_16,0,0 },
238 [INSTR_RXY_RRRD] = { 0xff, R_8,D20_20,X_12,B_16,0,0 },/* e.g. ly */ 281 [INSTR_RXY_RRRD] = { 0xff, R_8,D20_20,X_12,B_16,0,0 },
239 [INSTR_RXY_FRRD] = { 0xff, F_8,D20_20,X_12,B_16,0,0 },/* e.g. ley */ 282 [INSTR_RXY_URRD] = { 0xff, U4_8,D20_20,X_12,B_16,0,0 },
240 [INSTR_RX_FRRD] = { 0xff, F_8,D_20,X_12,B_16,0,0 }, /* e.g. ae */ 283 [INSTR_RX_FRRD] = { 0xff, F_8,D_20,X_12,B_16,0,0 },
241 [INSTR_RX_RRRD] = { 0xff, R_8,D_20,X_12,B_16,0,0 }, /* e.g. l */ 284 [INSTR_RX_RRRD] = { 0xff, R_8,D_20,X_12,B_16,0,0 },
242 [INSTR_RX_URRD] = { 0xff, U4_8,D_20,X_12,B_16,0,0 }, /* e.g. bc */ 285 [INSTR_RX_URRD] = { 0xff, U4_8,D_20,X_12,B_16,0,0 },
243 [INSTR_SI_URD] = { 0xff, D_20,B_16,U8_8,0,0,0 }, /* e.g. cli */ 286 [INSTR_SIL_RDI] = { 0xff, D_20,B_16,I16_32,0,0,0 },
244 [INSTR_SIY_URD] = { 0xff, D20_20,B_16,U8_8,0,0,0 }, /* e.g. tmy */ 287 [INSTR_SIL_RDU] = { 0xff, D_20,B_16,U16_32,0,0,0 },
245 [INSTR_SSE_RDRD] = { 0xff, D_20,B_16,D_36,B_32,0,0 }, /* e.g. mvsdk */ 288 [INSTR_SIY_IRD] = { 0xff, D20_20,B_16,I8_8,0,0,0 },
289 [INSTR_SIY_URD] = { 0xff, D20_20,B_16,U8_8,0,0,0 },
290 [INSTR_SI_URD] = { 0xff, D_20,B_16,U8_8,0,0,0 },
291 [INSTR_SSE_RDRD] = { 0xff, D_20,B_16,D_36,B_32,0,0 },
292 [INSTR_SSF_RRDRD] = { 0x00, D_20,B_16,D_36,B_32,R_8,0 },
246 [INSTR_SS_L0RDRD] = { 0xff, D_20,L8_8,B_16,D_36,B_32,0 }, 293 [INSTR_SS_L0RDRD] = { 0xff, D_20,L8_8,B_16,D_36,B_32,0 },
247 /* e.g. mvc */
248 [INSTR_SS_LIRDRD] = { 0xff, D_20,L4_8,B_16,D_36,B_32,U4_12 }, 294 [INSTR_SS_LIRDRD] = { 0xff, D_20,L4_8,B_16,D_36,B_32,U4_12 },
249 /* e.g. srp */
250 [INSTR_SS_LLRDRD] = { 0xff, D_20,L4_8,B_16,D_36,L4_12,B_32 }, 295 [INSTR_SS_LLRDRD] = { 0xff, D_20,L4_8,B_16,D_36,L4_12,B_32 },
251 /* e.g. pack */
252 [INSTR_SS_RRRDRD] = { 0xff, D_20,R_8,B_16,D_36,B_32,R_12 },
253 /* e.g. mvck */
254 [INSTR_SS_RRRDRD2]= { 0xff, R_8,D_20,B_16,R_12,D_36,B_32 }, 296 [INSTR_SS_RRRDRD2]= { 0xff, R_8,D_20,B_16,R_12,D_36,B_32 },
255 /* e.g. plo */
256 [INSTR_SS_RRRDRD3]= { 0xff, R_8,R_12,D_20,B_16,D_36,B_32 }, 297 [INSTR_SS_RRRDRD3]= { 0xff, R_8,R_12,D_20,B_16,D_36,B_32 },
257 /* e.g. lmd */ 298 [INSTR_SS_RRRDRD] = { 0xff, D_20,R_8,B_16,D_36,B_32,R_12 },
258 [INSTR_S_00] = { 0xff, 0,0,0,0,0,0 }, /* e.g. hsch */ 299 [INSTR_S_00] = { 0xff, 0,0,0,0,0,0 },
259 [INSTR_S_RD] = { 0xff, D_20,B_16,0,0,0,0 }, /* e.g. lpsw */ 300 [INSTR_S_RD] = { 0xff, D_20,B_16,0,0,0,0 },
260 [INSTR_SSF_RRDRD] = { 0x00, D_20,B_16,D_36,B_32,R_8,0 },
261 /* e.g. mvcos */
262}; 301};
263 302
264static struct insn opcode[] = { 303static struct insn opcode[] = {
@@ -454,6 +493,8 @@ static struct insn opcode[] = {
454static struct insn opcode_01[] = { 493static struct insn opcode_01[] = {
455#ifdef CONFIG_64BIT 494#ifdef CONFIG_64BIT
456 { "sam64", 0x0e, INSTR_E }, 495 { "sam64", 0x0e, INSTR_E },
496 { "pfpo", 0x0a, INSTR_E },
497 { "ptff", 0x04, INSTR_E },
457#endif 498#endif
458 { "pr", 0x01, INSTR_E }, 499 { "pr", 0x01, INSTR_E },
459 { "upt", 0x02, INSTR_E }, 500 { "upt", 0x02, INSTR_E },
@@ -519,6 +560,8 @@ static struct insn opcode_b2[] = {
519 { "cutfu", 0xa7, INSTR_RRF_M0RR }, 560 { "cutfu", 0xa7, INSTR_RRF_M0RR },
520 { "stfle", 0xb0, INSTR_S_RD }, 561 { "stfle", 0xb0, INSTR_S_RD },
521 { "lpswe", 0xb2, INSTR_S_RD }, 562 { "lpswe", 0xb2, INSTR_S_RD },
563 { "srnmt", 0xb9, INSTR_S_RD },
564 { "lfas", 0xbd, INSTR_S_RD },
522#endif 565#endif
523 { "stidp", 0x02, INSTR_S_RD }, 566 { "stidp", 0x02, INSTR_S_RD },
524 { "sck", 0x04, INSTR_S_RD }, 567 { "sck", 0x04, INSTR_S_RD },
@@ -589,7 +632,6 @@ static struct insn opcode_b2[] = {
589 { "clst", 0x5d, INSTR_RRE_RR }, 632 { "clst", 0x5d, INSTR_RRE_RR },
590 { "srst", 0x5e, INSTR_RRE_RR }, 633 { "srst", 0x5e, INSTR_RRE_RR },
591 { "cmpsc", 0x63, INSTR_RRE_RR }, 634 { "cmpsc", 0x63, INSTR_RRE_RR },
592 { "cmpsc", 0x63, INSTR_RRE_RR },
593 { "siga", 0x74, INSTR_S_RD }, 635 { "siga", 0x74, INSTR_S_RD },
594 { "xsch", 0x76, INSTR_S_00 }, 636 { "xsch", 0x76, INSTR_S_00 },
595 { "rp", 0x77, INSTR_S_RD }, 637 { "rp", 0x77, INSTR_S_RD },
@@ -630,6 +672,57 @@ static struct insn opcode_b3[] = {
630 { "cger", 0xc8, INSTR_RRF_U0RF }, 672 { "cger", 0xc8, INSTR_RRF_U0RF },
631 { "cgdr", 0xc9, INSTR_RRF_U0RF }, 673 { "cgdr", 0xc9, INSTR_RRF_U0RF },
632 { "cgxr", 0xca, INSTR_RRF_U0RF }, 674 { "cgxr", 0xca, INSTR_RRF_U0RF },
675 { "lpdfr", 0x70, INSTR_RRE_FF },
676 { "lndfr", 0x71, INSTR_RRE_FF },
677 { "cpsdr", 0x72, INSTR_RRF_F0FF2 },
678 { "lcdfr", 0x73, INSTR_RRE_FF },
679 { "ldgr", 0xc1, INSTR_RRE_FR },
680 { "lgdr", 0xcd, INSTR_RRE_RF },
681 { "adtr", 0xd2, INSTR_RRR_F0FF },
682 { "axtr", 0xda, INSTR_RRR_F0FF },
683 { "cdtr", 0xe4, INSTR_RRE_FF },
684 { "cxtr", 0xec, INSTR_RRE_FF },
685 { "kdtr", 0xe0, INSTR_RRE_FF },
686 { "kxtr", 0xe8, INSTR_RRE_FF },
687 { "cedtr", 0xf4, INSTR_RRE_FF },
688 { "cextr", 0xfc, INSTR_RRE_FF },
689 { "cdgtr", 0xf1, INSTR_RRE_FR },
690 { "cxgtr", 0xf9, INSTR_RRE_FR },
691 { "cdstr", 0xf3, INSTR_RRE_FR },
692 { "cxstr", 0xfb, INSTR_RRE_FR },
693 { "cdutr", 0xf2, INSTR_RRE_FR },
694 { "cxutr", 0xfa, INSTR_RRE_FR },
695 { "cgdtr", 0xe1, INSTR_RRF_U0RF },
696 { "cgxtr", 0xe9, INSTR_RRF_U0RF },
697 { "csdtr", 0xe3, INSTR_RRE_RF },
698 { "csxtr", 0xeb, INSTR_RRE_RF },
699 { "cudtr", 0xe2, INSTR_RRE_RF },
700 { "cuxtr", 0xea, INSTR_RRE_RF },
701 { "ddtr", 0xd1, INSTR_RRR_F0FF },
702 { "dxtr", 0xd9, INSTR_RRR_F0FF },
703 { "eedtr", 0xe5, INSTR_RRE_RF },
704 { "eextr", 0xed, INSTR_RRE_RF },
705 { "esdtr", 0xe7, INSTR_RRE_RF },
706 { "esxtr", 0xef, INSTR_RRE_RF },
707 { "iedtr", 0xf6, INSTR_RRF_F0FR },
708 { "iextr", 0xfe, INSTR_RRF_F0FR },
709 { "ltdtr", 0xd6, INSTR_RRE_FF },
710 { "ltxtr", 0xde, INSTR_RRE_FF },
711 { "fidtr", 0xd7, INSTR_RRF_UUFF },
712 { "fixtr", 0xdf, INSTR_RRF_UUFF },
713 { "ldetr", 0xd4, INSTR_RRF_0UFF },
714 { "lxdtr", 0xdc, INSTR_RRF_0UFF },
715 { "ledtr", 0xd5, INSTR_RRF_UUFF },
716 { "ldxtr", 0xdd, INSTR_RRF_UUFF },
717 { "mdtr", 0xd0, INSTR_RRR_F0FF },
718 { "mxtr", 0xd8, INSTR_RRR_F0FF },
719 { "qadtr", 0xf5, INSTR_RRF_FUFF },
720 { "qaxtr", 0xfd, INSTR_RRF_FUFF },
721 { "rrdtr", 0xf7, INSTR_RRF_FFRU },
722 { "rrxtr", 0xff, INSTR_RRF_FFRU },
723 { "sfasr", 0x85, INSTR_RRE_R0 },
724 { "sdtr", 0xd3, INSTR_RRR_F0FF },
725 { "sxtr", 0xdb, INSTR_RRR_F0FF },
633#endif 726#endif
634 { "lpebr", 0x00, INSTR_RRE_FF }, 727 { "lpebr", 0x00, INSTR_RRE_FF },
635 { "lnebr", 0x01, INSTR_RRE_FF }, 728 { "lnebr", 0x01, INSTR_RRE_FF },
@@ -780,6 +873,14 @@ static struct insn opcode_b9[] = {
780 { "cu24", 0xb1, INSTR_RRF_M0RR }, 873 { "cu24", 0xb1, INSTR_RRF_M0RR },
781 { "cu41", 0xb2, INSTR_RRF_M0RR }, 874 { "cu41", 0xb2, INSTR_RRF_M0RR },
782 { "cu42", 0xb3, INSTR_RRF_M0RR }, 875 { "cu42", 0xb3, INSTR_RRF_M0RR },
876 { "crt", 0x72, INSTR_RRF_U0RR },
877 { "cgrt", 0x60, INSTR_RRF_U0RR },
878 { "clrt", 0x73, INSTR_RRF_U0RR },
879 { "clgrt", 0x61, INSTR_RRF_U0RR },
880 { "ptf", 0xa2, INSTR_RRE_R0 },
881 { "pfmf", 0xaf, INSTR_RRE_RR },
882 { "trte", 0xbf, INSTR_RRF_M0RR },
883 { "trtre", 0xbd, INSTR_RRF_M0RR },
783#endif 884#endif
784 { "kmac", 0x1e, INSTR_RRE_RR }, 885 { "kmac", 0x1e, INSTR_RRE_RR },
785 { "lrvr", 0x1f, INSTR_RRE_RR }, 886 { "lrvr", 0x1f, INSTR_RRE_RR },
@@ -835,6 +936,43 @@ static struct insn opcode_c2[] = {
835 { "cfi", 0x0d, INSTR_RIL_RI }, 936 { "cfi", 0x0d, INSTR_RIL_RI },
836 { "clgfi", 0x0e, INSTR_RIL_RU }, 937 { "clgfi", 0x0e, INSTR_RIL_RU },
837 { "clfi", 0x0f, INSTR_RIL_RU }, 938 { "clfi", 0x0f, INSTR_RIL_RU },
939 { "msfi", 0x01, INSTR_RIL_RI },
940 { "msgfi", 0x00, INSTR_RIL_RI },
941#endif
942 { "", 0, INSTR_INVALID }
943};
944
945static struct insn opcode_c4[] = {
946#ifdef CONFIG_64BIT
947 { "lrl", 0x0d, INSTR_RIL_RP },
948 { "lgrl", 0x08, INSTR_RIL_RP },
949 { "lgfrl", 0x0c, INSTR_RIL_RP },
950 { "lhrl", 0x05, INSTR_RIL_RP },
951 { "lghrl", 0x04, INSTR_RIL_RP },
952 { "llgfrl", 0x0e, INSTR_RIL_RP },
953 { "llhrl", 0x02, INSTR_RIL_RP },
954 { "llghrl", 0x06, INSTR_RIL_RP },
955 { "strl", 0x0f, INSTR_RIL_RP },
956 { "stgrl", 0x0b, INSTR_RIL_RP },
957 { "sthrl", 0x07, INSTR_RIL_RP },
958#endif
959 { "", 0, INSTR_INVALID }
960};
961
962static struct insn opcode_c6[] = {
963#ifdef CONFIG_64BIT
964 { "crl", 0x0d, INSTR_RIL_RP },
965 { "cgrl", 0x08, INSTR_RIL_RP },
966 { "cgfrl", 0x0c, INSTR_RIL_RP },
967 { "chrl", 0x05, INSTR_RIL_RP },
968 { "cghrl", 0x04, INSTR_RIL_RP },
969 { "clrl", 0x0f, INSTR_RIL_RP },
970 { "clgrl", 0x0a, INSTR_RIL_RP },
971 { "clgfrl", 0x0e, INSTR_RIL_RP },
972 { "clhrl", 0x07, INSTR_RIL_RP },
973 { "clghrl", 0x06, INSTR_RIL_RP },
974 { "pfdrl", 0x02, INSTR_RIL_UP },
975 { "exrl", 0x00, INSTR_RIL_RP },
838#endif 976#endif
839 { "", 0, INSTR_INVALID } 977 { "", 0, INSTR_INVALID }
840}; 978};
@@ -842,6 +980,8 @@ static struct insn opcode_c2[] = {
842static struct insn opcode_c8[] = { 980static struct insn opcode_c8[] = {
843#ifdef CONFIG_64BIT 981#ifdef CONFIG_64BIT
844 { "mvcos", 0x00, INSTR_SSF_RRDRD }, 982 { "mvcos", 0x00, INSTR_SSF_RRDRD },
983 { "ectg", 0x01, INSTR_SSF_RRDRD },
984 { "csst", 0x02, INSTR_SSF_RRDRD },
845#endif 985#endif
846 { "", 0, INSTR_INVALID } 986 { "", 0, INSTR_INVALID }
847}; 987};
@@ -917,6 +1057,12 @@ static struct insn opcode_e3[] = {
917 { "llgh", 0x91, INSTR_RXY_RRRD }, 1057 { "llgh", 0x91, INSTR_RXY_RRRD },
918 { "llc", 0x94, INSTR_RXY_RRRD }, 1058 { "llc", 0x94, INSTR_RXY_RRRD },
919 { "llh", 0x95, INSTR_RXY_RRRD }, 1059 { "llh", 0x95, INSTR_RXY_RRRD },
1060 { "cgh", 0x34, INSTR_RXY_RRRD },
1061 { "laey", 0x75, INSTR_RXY_RRRD },
1062 { "ltgf", 0x32, INSTR_RXY_RRRD },
1063 { "mfy", 0x5c, INSTR_RXY_RRRD },
1064 { "mhy", 0x7c, INSTR_RXY_RRRD },
1065 { "pfd", 0x36, INSTR_RXY_URRD },
920#endif 1066#endif
921 { "lrv", 0x1e, INSTR_RXY_RRRD }, 1067 { "lrv", 0x1e, INSTR_RXY_RRRD },
922 { "lrvh", 0x1f, INSTR_RXY_RRRD }, 1068 { "lrvh", 0x1f, INSTR_RXY_RRRD },
@@ -931,6 +1077,15 @@ static struct insn opcode_e3[] = {
931static struct insn opcode_e5[] = { 1077static struct insn opcode_e5[] = {
932#ifdef CONFIG_64BIT 1078#ifdef CONFIG_64BIT
933 { "strag", 0x02, INSTR_SSE_RDRD }, 1079 { "strag", 0x02, INSTR_SSE_RDRD },
1080 { "chhsi", 0x54, INSTR_SIL_RDI },
1081 { "chsi", 0x5c, INSTR_SIL_RDI },
1082 { "cghsi", 0x58, INSTR_SIL_RDI },
1083 { "clhhsi", 0x55, INSTR_SIL_RDU },
1084 { "clfhsi", 0x5d, INSTR_SIL_RDU },
1085 { "clghsi", 0x59, INSTR_SIL_RDU },
1086 { "mvhhi", 0x44, INSTR_SIL_RDI },
1087 { "mvhi", 0x4c, INSTR_SIL_RDI },
1088 { "mvghi", 0x48, INSTR_SIL_RDI },
934#endif 1089#endif
935 { "lasp", 0x00, INSTR_SSE_RDRD }, 1090 { "lasp", 0x00, INSTR_SSE_RDRD },
936 { "tprot", 0x01, INSTR_SSE_RDRD }, 1091 { "tprot", 0x01, INSTR_SSE_RDRD },
@@ -977,6 +1132,11 @@ static struct insn opcode_eb[] = {
977 { "lmy", 0x98, INSTR_RSY_RRRD }, 1132 { "lmy", 0x98, INSTR_RSY_RRRD },
978 { "lamy", 0x9a, INSTR_RSY_AARD }, 1133 { "lamy", 0x9a, INSTR_RSY_AARD },
979 { "stamy", 0x9b, INSTR_RSY_AARD }, 1134 { "stamy", 0x9b, INSTR_RSY_AARD },
1135 { "asi", 0x6a, INSTR_SIY_IRD },
1136 { "agsi", 0x7a, INSTR_SIY_IRD },
1137 { "alsi", 0x6e, INSTR_SIY_IRD },
1138 { "algsi", 0x7e, INSTR_SIY_IRD },
1139 { "ecag", 0x4c, INSTR_RSY_RRRD },
980#endif 1140#endif
981 { "rll", 0x1d, INSTR_RSY_RRRD }, 1141 { "rll", 0x1d, INSTR_RSY_RRRD },
982 { "mvclu", 0x8e, INSTR_RSY_RRRD }, 1142 { "mvclu", 0x8e, INSTR_RSY_RRRD },
@@ -988,6 +1148,30 @@ static struct insn opcode_ec[] = {
988#ifdef CONFIG_64BIT 1148#ifdef CONFIG_64BIT
989 { "brxhg", 0x44, INSTR_RIE_RRP }, 1149 { "brxhg", 0x44, INSTR_RIE_RRP },
990 { "brxlg", 0x45, INSTR_RIE_RRP }, 1150 { "brxlg", 0x45, INSTR_RIE_RRP },
1151 { "crb", 0xf6, INSTR_RRS_RRRDU },
1152 { "cgrb", 0xe4, INSTR_RRS_RRRDU },
1153 { "crj", 0x76, INSTR_RIE_RRPU },
1154 { "cgrj", 0x64, INSTR_RIE_RRPU },
1155 { "cib", 0xfe, INSTR_RIS_RURDI },
1156 { "cgib", 0xfc, INSTR_RIS_RURDI },
1157 { "cij", 0x7e, INSTR_RIE_RUPI },
1158 { "cgij", 0x7c, INSTR_RIE_RUPI },
1159 { "cit", 0x72, INSTR_RIE_R0IU },
1160 { "cgit", 0x70, INSTR_RIE_R0IU },
1161 { "clrb", 0xf7, INSTR_RRS_RRRDU },
1162 { "clgrb", 0xe5, INSTR_RRS_RRRDU },
1163 { "clrj", 0x77, INSTR_RIE_RRPU },
1164 { "clgrj", 0x65, INSTR_RIE_RRPU },
1165 { "clib", 0xff, INSTR_RIS_RURDU },
1166 { "clgib", 0xfd, INSTR_RIS_RURDU },
1167 { "clij", 0x7f, INSTR_RIE_RUPU },
1168 { "clgij", 0x7d, INSTR_RIE_RUPU },
1169 { "clfit", 0x73, INSTR_RIE_R0UU },
1170 { "clgit", 0x71, INSTR_RIE_R0UU },
1171 { "rnsbg", 0x54, INSTR_RIE_RRUUU },
1172 { "rxsbg", 0x57, INSTR_RIE_RRUUU },
1173 { "rosbg", 0x56, INSTR_RIE_RRUUU },
1174 { "risbg", 0x55, INSTR_RIE_RRUUU },
991#endif 1175#endif
992 { "", 0, INSTR_INVALID } 1176 { "", 0, INSTR_INVALID }
993}; 1177};
@@ -1004,6 +1188,16 @@ static struct insn opcode_ed[] = {
1004 { "ldy", 0x65, INSTR_RXY_FRRD }, 1188 { "ldy", 0x65, INSTR_RXY_FRRD },
1005 { "stey", 0x66, INSTR_RXY_FRRD }, 1189 { "stey", 0x66, INSTR_RXY_FRRD },
1006 { "stdy", 0x67, INSTR_RXY_FRRD }, 1190 { "stdy", 0x67, INSTR_RXY_FRRD },
1191 { "sldt", 0x40, INSTR_RXF_FRRDF },
1192 { "slxt", 0x48, INSTR_RXF_FRRDF },
1193 { "srdt", 0x41, INSTR_RXF_FRRDF },
1194 { "srxt", 0x49, INSTR_RXF_FRRDF },
1195 { "tdcet", 0x50, INSTR_RXE_FRRD },
1196 { "tdcdt", 0x54, INSTR_RXE_FRRD },
1197 { "tdcxt", 0x58, INSTR_RXE_FRRD },
1198 { "tdget", 0x51, INSTR_RXE_FRRD },
1199 { "tdgdt", 0x55, INSTR_RXE_FRRD },
1200 { "tdgxt", 0x59, INSTR_RXE_FRRD },
1007#endif 1201#endif
1008 { "ldeb", 0x04, INSTR_RXE_FRRD }, 1202 { "ldeb", 0x04, INSTR_RXE_FRRD },
1009 { "lxdb", 0x05, INSTR_RXE_FRRD }, 1203 { "lxdb", 0x05, INSTR_RXE_FRRD },
@@ -1037,6 +1231,7 @@ static struct insn opcode_ed[] = {
1037 { "mae", 0x2e, INSTR_RXF_FRRDF }, 1231 { "mae", 0x2e, INSTR_RXF_FRRDF },
1038 { "mse", 0x2f, INSTR_RXF_FRRDF }, 1232 { "mse", 0x2f, INSTR_RXF_FRRDF },
1039 { "sqe", 0x34, INSTR_RXE_FRRD }, 1233 { "sqe", 0x34, INSTR_RXE_FRRD },
1234 { "sqd", 0x35, INSTR_RXE_FRRD },
1040 { "mee", 0x37, INSTR_RXE_FRRD }, 1235 { "mee", 0x37, INSTR_RXE_FRRD },
1041 { "mad", 0x3e, INSTR_RXF_FRRDF }, 1236 { "mad", 0x3e, INSTR_RXF_FRRDF },
1042 { "msd", 0x3f, INSTR_RXF_FRRDF }, 1237 { "msd", 0x3f, INSTR_RXF_FRRDF },
@@ -1117,6 +1312,12 @@ static struct insn *find_insn(unsigned char *code)
1117 case 0xc2: 1312 case 0xc2:
1118 table = opcode_c2; 1313 table = opcode_c2;
1119 break; 1314 break;
1315 case 0xc4:
1316 table = opcode_c4;
1317 break;
1318 case 0xc6:
1319 table = opcode_c6;
1320 break;
1120 case 0xc8: 1321 case 0xc8:
1121 table = opcode_c8; 1322 table = opcode_c8;
1122 break; 1323 break;
diff --git a/arch/s390/kernel/early.c b/arch/s390/kernel/early.c
index e49e9e0c69fd..31d618a443af 100644
--- a/arch/s390/kernel/early.c
+++ b/arch/s390/kernel/early.c
@@ -214,10 +214,13 @@ static __initdata struct sysinfo_3_2_2 vmms __aligned(PAGE_SIZE);
214 214
215static noinline __init void detect_machine_type(void) 215static noinline __init void detect_machine_type(void)
216{ 216{
217 /* No VM information? Looks like LPAR */ 217 /* Check current-configuration-level */
218 if (stsi(&vmms, 3, 2, 2) == -ENOSYS) 218 if ((stsi(NULL, 0, 0, 0) >> 28) <= 2) {
219 S390_lowcore.machine_flags |= MACHINE_FLAG_LPAR;
219 return; 220 return;
220 if (!vmms.count) 221 }
222 /* Get virtual-machine cpu information. */
223 if (stsi(&vmms, 3, 2, 2) == -ENOSYS || !vmms.count)
221 return; 224 return;
222 225
223 /* Running under KVM? If not we assume z/VM */ 226 /* Running under KVM? If not we assume z/VM */
@@ -402,8 +405,19 @@ static void __init append_to_cmdline(size_t (*ipl_data)(char *, size_t))
402 405
403static void __init setup_boot_command_line(void) 406static void __init setup_boot_command_line(void)
404{ 407{
408 int i;
409
410 /* convert arch command line to ascii */
411 for (i = 0; i < ARCH_COMMAND_LINE_SIZE; i++)
412 if (COMMAND_LINE[i] & 0x80)
413 break;
414 if (i < ARCH_COMMAND_LINE_SIZE)
415 EBCASC(COMMAND_LINE, ARCH_COMMAND_LINE_SIZE);
416 COMMAND_LINE[ARCH_COMMAND_LINE_SIZE-1] = 0;
417
405 /* copy arch command line */ 418 /* copy arch command line */
406 strlcpy(boot_command_line, COMMAND_LINE, ARCH_COMMAND_LINE_SIZE); 419 strlcpy(boot_command_line, strstrip(COMMAND_LINE),
420 ARCH_COMMAND_LINE_SIZE);
407 421
408 /* append IPL PARM data to the boot command line */ 422 /* append IPL PARM data to the boot command line */
409 if (MACHINE_IS_VM) 423 if (MACHINE_IS_VM)
diff --git a/arch/s390/kernel/entry.S b/arch/s390/kernel/entry.S
index e8ef21c51bbe..4348f9bc5393 100644
--- a/arch/s390/kernel/entry.S
+++ b/arch/s390/kernel/entry.S
@@ -13,7 +13,6 @@
13#include <linux/linkage.h> 13#include <linux/linkage.h>
14#include <linux/init.h> 14#include <linux/init.h>
15#include <asm/cache.h> 15#include <asm/cache.h>
16#include <asm/lowcore.h>
17#include <asm/errno.h> 16#include <asm/errno.h>
18#include <asm/ptrace.h> 17#include <asm/ptrace.h>
19#include <asm/thread_info.h> 18#include <asm/thread_info.h>
diff --git a/arch/s390/kernel/entry64.S b/arch/s390/kernel/entry64.S
index f33658f09dd7..29fd0f1e6ec4 100644
--- a/arch/s390/kernel/entry64.S
+++ b/arch/s390/kernel/entry64.S
@@ -9,11 +9,9 @@
9 * Heiko Carstens <heiko.carstens@de.ibm.com> 9 * Heiko Carstens <heiko.carstens@de.ibm.com>
10 */ 10 */
11 11
12#include <linux/sys.h>
13#include <linux/linkage.h> 12#include <linux/linkage.h>
14#include <linux/init.h> 13#include <linux/init.h>
15#include <asm/cache.h> 14#include <asm/cache.h>
16#include <asm/lowcore.h>
17#include <asm/errno.h> 15#include <asm/errno.h>
18#include <asm/ptrace.h> 16#include <asm/ptrace.h>
19#include <asm/thread_info.h> 17#include <asm/thread_info.h>
diff --git a/arch/s390/kernel/ftrace.c b/arch/s390/kernel/ftrace.c
index 5a82bc68193e..6a83d0581317 100644
--- a/arch/s390/kernel/ftrace.c
+++ b/arch/s390/kernel/ftrace.c
@@ -13,7 +13,7 @@
13#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <linux/types.h> 14#include <linux/types.h>
15#include <trace/syscall.h> 15#include <trace/syscall.h>
16#include <asm/lowcore.h> 16#include <asm/asm-offsets.h>
17 17
18#ifdef CONFIG_DYNAMIC_FTRACE 18#ifdef CONFIG_DYNAMIC_FTRACE
19 19
@@ -200,13 +200,3 @@ out:
200 return parent; 200 return parent;
201} 201}
202#endif /* CONFIG_FUNCTION_GRAPH_TRACER */ 202#endif /* CONFIG_FUNCTION_GRAPH_TRACER */
203
204#ifdef CONFIG_FTRACE_SYSCALLS
205
206extern unsigned int sys_call_table[];
207
208unsigned long __init arch_syscall_addr(int nr)
209{
210 return (unsigned long)sys_call_table[nr];
211}
212#endif
diff --git a/arch/s390/kernel/head.S b/arch/s390/kernel/head.S
index c52b4f7742fa..ca4a62bd862f 100644
--- a/arch/s390/kernel/head.S
+++ b/arch/s390/kernel/head.S
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright IBM Corp. 1999,2009 2 * Copyright IBM Corp. 1999,2010
3 * 3 *
4 * Author(s): Hartmut Penner <hp@de.ibm.com> 4 * Author(s): Hartmut Penner <hp@de.ibm.com>
5 * Martin Schwidefsky <schwidefsky@de.ibm.com> 5 * Martin Schwidefsky <schwidefsky@de.ibm.com>
@@ -22,12 +22,9 @@
22 */ 22 */
23 23
24#include <linux/init.h> 24#include <linux/init.h>
25#include <asm/setup.h>
26#include <asm/lowcore.h>
27#include <asm/asm-offsets.h> 25#include <asm/asm-offsets.h>
28#include <asm/thread_info.h> 26#include <asm/thread_info.h>
29#include <asm/page.h> 27#include <asm/page.h>
30#include <asm/cpu.h>
31 28
32#ifdef CONFIG_64BIT 29#ifdef CONFIG_64BIT
33#define ARCH_OFFSET 4 30#define ARCH_OFFSET 4
@@ -288,19 +285,7 @@ iplstart:
288 bz .Lagain1 # skip dateset trailer 285 bz .Lagain1 # skip dateset trailer
289 la %r5,0(%r4,%r2) 286 la %r5,0(%r4,%r2)
290 lr %r3,%r2 287 lr %r3,%r2
291.Lidebc: 288 la %r3,COMMAND_LINE-PARMAREA(%r12) # load adr. of command line
292 tm 0(%r5),0x80 # high order bit set ?
293 bo .Ldocv # yes -> convert from EBCDIC
294 ahi %r5,-1
295 bct %r3,.Lidebc
296 b .Lnocv
297.Ldocv:
298 l %r3,.Lcvtab
299 tr 0(256,%r4),0(%r3) # convert parameters to ascii
300 tr 256(256,%r4),0(%r3)
301 tr 512(256,%r4),0(%r3)
302 tr 768(122,%r4),0(%r3)
303.Lnocv: la %r3,COMMAND_LINE-PARMAREA(%r12) # load adr. of command line
304 mvc 0(256,%r3),0(%r4) 289 mvc 0(256,%r3),0(%r4)
305 mvc 256(256,%r3),256(%r4) 290 mvc 256(256,%r3),256(%r4)
306 mvc 512(256,%r3),512(%r4) 291 mvc 512(256,%r3),512(%r4)
@@ -384,7 +369,6 @@ iplstart:
384.Linitrd:.long _end + 0x400000 # default address of initrd 369.Linitrd:.long _end + 0x400000 # default address of initrd
385.Lparm: .long PARMAREA 370.Lparm: .long PARMAREA
386.Lstartup: .long startup 371.Lstartup: .long startup
387.Lcvtab:.long _ebcasc # ebcdic to ascii table
388.Lreset:.byte 0xc3,0xc8,0xc1,0xd5,0xc7,0xc5,0x40,0xd9,0xc4,0xd9,0x40 372.Lreset:.byte 0xc3,0xc8,0xc1,0xd5,0xc7,0xc5,0x40,0xd9,0xc4,0xd9,0x40
389 .byte 0xc1,0xd3,0xd3,0x40,0xd2,0xc5,0xc5,0xd7,0x40,0xd5,0xd6 373 .byte 0xc1,0xd3,0xd3,0x40,0xd2,0xc5,0xc5,0xd7,0x40,0xd5,0xd6
390 .byte 0xc8,0xd6,0xd3,0xc4 # "change rdr all keep nohold" 374 .byte 0xc8,0xd6,0xd3,0xc4 # "change rdr all keep nohold"
@@ -417,13 +401,10 @@ start:
417.sk8x8: 401.sk8x8:
418 mvc 0(240,%r8),0(%r9) # copy iplparms into buffer 402 mvc 0(240,%r8),0(%r9) # copy iplparms into buffer
419.gotr: 403.gotr:
420 l %r10,.tbl # EBCDIC to ASCII table
421 tr 0(240,%r8),0(%r10)
422 slr %r0,%r0 404 slr %r0,%r0
423 st %r0,INITRD_SIZE+ARCH_OFFSET-PARMAREA(%r11) 405 st %r0,INITRD_SIZE+ARCH_OFFSET-PARMAREA(%r11)
424 st %r0,INITRD_START+ARCH_OFFSET-PARMAREA(%r11) 406 st %r0,INITRD_START+ARCH_OFFSET-PARMAREA(%r11)
425 j startup # continue with startup 407 j startup # continue with startup
426.tbl: .long _ebcasc # translate table
427.cmd: .long COMMAND_LINE # address of command line buffer 408.cmd: .long COMMAND_LINE # address of command line buffer
428.parm: .long PARMAREA 409.parm: .long PARMAREA
429.lowcase: 410.lowcase:
@@ -467,16 +448,15 @@ start:
467# or linload or SALIPL 448# or linload or SALIPL
468# 449#
469 .org 0x10000 450 .org 0x10000
470startup:basr %r13,0 # get base 451 .globl startup
452startup:
453 basr %r13,0 # get base
471.LPG0: 454.LPG0:
472 xc 0x200(256),0x200 # partially clear lowcore 455 xc 0x200(256),0x200 # partially clear lowcore
473 xc 0x300(256),0x300 456 xc 0x300(256),0x300
474 l %r1,5f-.LPG0(%r13) 457 stck __LC_LAST_UPDATE_CLOCK
475 stck 0(%r1) 458 spt 5f-.LPG0(%r13)
476 spt 6f-.LPG0(%r13) 459 mvc __LC_LAST_UPDATE_TIMER(8),5f-.LPG0(%r13)
477 mvc __LC_LAST_UPDATE_CLOCK(8),0(%r1)
478 mvc __LC_LAST_UPDATE_TIMER(8),6f-.LPG0(%r13)
479 mvc __LC_EXIT_TIMER(8),5f-.LPG0(%r13)
480#ifndef CONFIG_MARCH_G5 460#ifndef CONFIG_MARCH_G5
481 # check capabilities against MARCH_{G5,Z900,Z990,Z9_109,Z10} 461 # check capabilities against MARCH_{G5,Z900,Z990,Z9_109,Z10}
482 xc __LC_STFL_FAC_LIST(8),__LC_STFL_FAC_LIST 462 xc __LC_STFL_FAC_LIST(8),__LC_STFL_FAC_LIST
@@ -494,7 +474,6 @@ startup:basr %r13,0 # get base
494 cl %r0,2f+12-.LPG0(%r13) 474 cl %r0,2f+12-.LPG0(%r13)
495 je 3f 475 je 3f
4961: l %r15,.Lstack-.LPG0(%r13) 4761: l %r15,.Lstack-.LPG0(%r13)
497 ahi %r15,1<<(PAGE_SHIFT+THREAD_ORDER) # init_task_union+THREAD_SIZE
498 ahi %r15,-96 477 ahi %r15,-96
499 la %r2,.Lals_string-.LPG0(%r13) 478 la %r2,.Lals_string-.LPG0(%r13)
500 l %r3,.Lsclp_print-.LPG0(%r13) 479 l %r3,.Lsclp_print-.LPG0(%r13)
@@ -505,7 +484,7 @@ startup:basr %r13,0 # get base
505.Lsclp_print: 484.Lsclp_print:
506 .long _sclp_print_early 485 .long _sclp_print_early
507.Lstack: 486.Lstack:
508 .long init_thread_union 487 .long 0x8000 + (1<<(PAGE_SHIFT+THREAD_ORDER))
509 .align 16 488 .align 16
5102: .long 0x000a0000,0x8badcccc 4892: .long 0x000a0000,0x8badcccc
511#if defined(CONFIG_64BIT) 490#if defined(CONFIG_64BIT)
@@ -532,13 +511,22 @@ startup:basr %r13,0 # get base
5323: 5113:
533#endif 512#endif
534 513
514#ifdef CONFIG_64BIT
515 mvi __LC_AR_MODE_ID,1 # set esame flag
516 slr %r0,%r0 # set cpuid to zero
517 lhi %r1,2 # mode 2 = esame (dump)
518 sigp %r1,%r0,0x12 # switch to esame mode
519 sam64 # switch to 64 bit mode
520 jg startup_continue
521#else
522 mvi __LC_AR_MODE_ID,0 # set ESA flag (mode 0)
535 l %r13,4f-.LPG0(%r13) 523 l %r13,4f-.LPG0(%r13)
536 b 0(%r13) 524 b 0(%r13)
537 .align 4 525 .align 8
5384: .long startup_continue 5264: .long startup_continue
5395: .long sched_clock_base_cc 527#endif
540 .align 8 528 .align 8
5416: .long 0x7fffffff,0xffffffff 5295: .long 0x7fffffff,0xffffffff
542 530
543# 531#
544# params at 10400 (setup.h) 532# params at 10400 (setup.h)
@@ -552,8 +540,4 @@ startup:basr %r13,0 # get base
552 .byte "root=/dev/ram0 ro" 540 .byte "root=/dev/ram0 ro"
553 .byte 0 541 .byte 0
554 542
555#ifdef CONFIG_64BIT 543 .org 0x11000
556#include "head64.S"
557#else
558#include "head31.S"
559#endif
diff --git a/arch/s390/kernel/head31.S b/arch/s390/kernel/head31.S
index 602b508cd4c4..1bbcc499d455 100644
--- a/arch/s390/kernel/head31.S
+++ b/arch/s390/kernel/head31.S
@@ -1,7 +1,7 @@
1/* 1/*
2 * arch/s390/kernel/head31.S 2 * arch/s390/kernel/head31.S
3 * 3 *
4 * Copyright (C) IBM Corp. 2005,2006 4 * Copyright (C) IBM Corp. 2005,2010
5 * 5 *
6 * Author(s): Hartmut Penner <hp@de.ibm.com> 6 * Author(s): Hartmut Penner <hp@de.ibm.com>
7 * Martin Schwidefsky <schwidefsky@de.ibm.com> 7 * Martin Schwidefsky <schwidefsky@de.ibm.com>
@@ -10,13 +10,19 @@
10 * 10 *
11 */ 11 */
12 12
13 .org 0x11000 13#include <linux/init.h>
14#include <asm/asm-offsets.h>
15#include <asm/thread_info.h>
16#include <asm/page.h>
14 17
18__HEAD
19 .globl startup_continue
15startup_continue: 20startup_continue:
16 basr %r13,0 # get base 21 basr %r13,0 # get base
17.LPG1: 22.LPG1:
18 23
19 mvi __LC_AR_MODE_ID,0 # set ESA flag (mode 0) 24 l %r1,.Lbase_cc-.LPG1(%r13)
25 mvc 0(8,%r1),__LC_LAST_UPDATE_CLOCK
20 lctl %c0,%c15,.Lctl-.LPG1(%r13) # load control registers 26 lctl %c0,%c15,.Lctl-.LPG1(%r13) # load control registers
21 l %r12,.Lparmaddr-.LPG1(%r13) # pointer to parameter area 27 l %r12,.Lparmaddr-.LPG1(%r13) # pointer to parameter area
22 # move IPL device to lowcore 28 # move IPL device to lowcore
@@ -69,10 +75,12 @@ startup_continue:
69.Lduald:.rept 8 75.Lduald:.rept 8
70 .long 0x80000000,0,0,0 # invalid access-list entries 76 .long 0x80000000,0,0,0 # invalid access-list entries
71 .endr 77 .endr
78.Lbase_cc:
79 .long sched_clock_base_cc
72 80
73 .org 0x12000
74 .globl _ehead 81 .globl _ehead
75_ehead: 82_ehead:
83
76#ifdef CONFIG_SHARED_KERNEL 84#ifdef CONFIG_SHARED_KERNEL
77 .org 0x100000 85 .org 0x100000
78#endif 86#endif
diff --git a/arch/s390/kernel/head64.S b/arch/s390/kernel/head64.S
index d984a2a380c3..39580e768658 100644
--- a/arch/s390/kernel/head64.S
+++ b/arch/s390/kernel/head64.S
@@ -1,7 +1,7 @@
1/* 1/*
2 * arch/s390/kernel/head64.S 2 * arch/s390/kernel/head64.S
3 * 3 *
4 * Copyright (C) IBM Corp. 1999,2006 4 * Copyright (C) IBM Corp. 1999,2010
5 * 5 *
6 * Author(s): Hartmut Penner <hp@de.ibm.com> 6 * Author(s): Hartmut Penner <hp@de.ibm.com>
7 * Martin Schwidefsky <schwidefsky@de.ibm.com> 7 * Martin Schwidefsky <schwidefsky@de.ibm.com>
@@ -10,80 +10,17 @@
10 * 10 *
11 */ 11 */
12 12
13 .org 0x11000 13#include <linux/init.h>
14#include <asm/asm-offsets.h>
15#include <asm/thread_info.h>
16#include <asm/page.h>
14 17
18__HEAD
19 .globl startup_continue
15startup_continue: 20startup_continue:
16 basr %r13,0 # get base 21 larl %r1,sched_clock_base_cc
17.LPG1: sll %r13,1 # remove high order bit 22 mvc 0(8,%r1),__LC_LAST_UPDATE_CLOCK
18 srl %r13,1 23 larl %r13,.LPG1 # get base
19
20#ifdef CONFIG_ZFCPDUMP
21
22 # check if we have been ipled using zfcp dump:
23
24 tm 0xb9,0x01 # test if subchannel is enabled
25 jno .nodump # subchannel disabled
26 l %r1,0xb8
27 la %r5,.Lipl_schib-.LPG1(%r13)
28 stsch 0(%r5) # get schib of subchannel
29 jne .nodump # schib not available
30 tm 5(%r5),0x01 # devno valid?
31 jno .nodump
32 tm 4(%r5),0x80 # qdio capable device?
33 jno .nodump
34 l %r2,20(%r0) # address of ipl parameter block
35 lhi %r3,0
36 ic %r3,0x148(%r2) # get opt field
37 chi %r3,0x20 # load with dump?
38 jne .nodump
39
40 # store all prefix registers in case of load with dump:
41
42 la %r7,0 # base register for 0 page
43 la %r8,0 # first cpu
44 l %r11,.Lpref_arr_ptr-.LPG1(%r13) # address of prefix array
45 ahi %r11,4 # skip boot cpu
46 lr %r12,%r11
47 ahi %r12,(CONFIG_NR_CPUS*4) # end of prefix array
48 stap .Lcurrent_cpu+2-.LPG1(%r13) # store current cpu addr
491:
50 cl %r8,.Lcurrent_cpu-.LPG1(%r13) # is ipl cpu ?
51 je 4f # if yes get next cpu
522:
53 lr %r9,%r7
54 sigp %r9,%r8,0x9 # stop & store status of cpu
55 brc 8,3f # accepted
56 brc 4,4f # status stored: next cpu
57 brc 2,2b # busy: try again
58 brc 1,4f # not op: next cpu
593:
60 mvc 0(4,%r11),264(%r7) # copy prefix register to prefix array
61 ahi %r11,4 # next element in prefix array
62 clr %r11,%r12
63 je 5f # no more space in prefix array
644:
65 ahi %r8,1 # next cpu (r8 += 1)
66 chi %r8,MAX_CPU_ADDRESS # is last possible cpu ?
67 jle 1b # jump if not last cpu
685:
69 lhi %r1,2 # mode 2 = esame (dump)
70 j 6f
71 .align 4
72.Lipl_schib:
73 .rept 13
74 .long 0
75 .endr
76.nodump:
77 lhi %r1,1 # mode 1 = esame (normal ipl)
786:
79#else
80 lhi %r1,1 # mode 1 = esame (normal ipl)
81#endif /* CONFIG_ZFCPDUMP */
82 mvi __LC_AR_MODE_ID,1 # set esame flag
83 slr %r0,%r0 # set cpuid to zero
84 sigp %r1,%r0,0x12 # switch to esame mode
85 sam64 # switch to 64 bit mode
86 llgfr %r13,%r13 # clear high-order half of base reg
87 lmh %r0,%r15,.Lzero64-.LPG1(%r13) # clear high-order half 24 lmh %r0,%r15,.Lzero64-.LPG1(%r13) # clear high-order half
88 lctlg %c0,%c15,.Lctl-.LPG1(%r13) # load control registers 25 lctlg %c0,%c15,.Lctl-.LPG1(%r13) # load control registers
89 lg %r12,.Lparmaddr-.LPG1(%r13) # pointer to parameter area 26 lg %r12,.Lparmaddr-.LPG1(%r13) # pointer to parameter area
@@ -108,6 +45,7 @@ startup_continue:
108 lpswe .Lentry-.LPG1(13) # jump to _stext in primary-space, 45 lpswe .Lentry-.LPG1(13) # jump to _stext in primary-space,
109 # virtual and never return ... 46 # virtual and never return ...
110 .align 16 47 .align 16
48.LPG1:
111.Lentry:.quad 0x0000000180000000,_stext 49.Lentry:.quad 0x0000000180000000,_stext
112.Lctl: .quad 0x04350002 # cr0: various things 50.Lctl: .quad 0x04350002 # cr0: various things
113 .quad 0 # cr1: primary space segment table 51 .quad 0 # cr1: primary space segment table
@@ -130,12 +68,6 @@ startup_continue:
130.Lscan2g:.quad 0x80000000 + 0x20000 - 8 # 2GB + 128K - 8 68.Lscan2g:.quad 0x80000000 + 0x20000 - 8 # 2GB + 128K - 8
131.Lnop: .long 0x07000700 69.Lnop: .long 0x07000700
132.Lzero64:.fill 16,4,0x0 70.Lzero64:.fill 16,4,0x0
133#ifdef CONFIG_ZFCPDUMP
134.Lcurrent_cpu:
135 .long 0x0
136.Lpref_arr_ptr:
137 .long zfcpdump_prefix_array
138#endif /* CONFIG_ZFCPDUMP */
139.Lparmaddr: 71.Lparmaddr:
140 .quad PARMAREA 72 .quad PARMAREA
141 .align 64 73 .align 64
@@ -146,9 +78,9 @@ startup_continue:
146 .long 0x80000000,0,0,0 # invalid access-list entries 78 .long 0x80000000,0,0,0 # invalid access-list entries
147 .endr 79 .endr
148 80
149 .org 0x12000
150 .globl _ehead 81 .globl _ehead
151_ehead: 82_ehead:
83
152#ifdef CONFIG_SHARED_KERNEL 84#ifdef CONFIG_SHARED_KERNEL
153 .org 0x100000 85 .org 0x100000
154#endif 86#endif
diff --git a/arch/s390/kernel/ipl.c b/arch/s390/kernel/ipl.c
index 4d73296fed74..7eedbbcb54aa 100644
--- a/arch/s390/kernel/ipl.c
+++ b/arch/s390/kernel/ipl.c
@@ -553,7 +553,7 @@ out:
553 return rc; 553 return rc;
554} 554}
555 555
556static void ipl_run(struct shutdown_trigger *trigger) 556static void __ipl_run(void *unused)
557{ 557{
558 diag308(DIAG308_IPL, NULL); 558 diag308(DIAG308_IPL, NULL);
559 if (MACHINE_IS_VM) 559 if (MACHINE_IS_VM)
@@ -562,6 +562,11 @@ static void ipl_run(struct shutdown_trigger *trigger)
562 reipl_ccw_dev(&ipl_info.data.ccw.dev_id); 562 reipl_ccw_dev(&ipl_info.data.ccw.dev_id);
563} 563}
564 564
565static void ipl_run(struct shutdown_trigger *trigger)
566{
567 smp_switch_to_ipl_cpu(__ipl_run, NULL);
568}
569
565static int __init ipl_init(void) 570static int __init ipl_init(void)
566{ 571{
567 int rc; 572 int rc;
@@ -1039,7 +1044,7 @@ static void get_ipl_string(char *dst, struct ipl_parameter_block *ipb,
1039 sprintf(dst + pos, " PARM %s", vmparm); 1044 sprintf(dst + pos, " PARM %s", vmparm);
1040} 1045}
1041 1046
1042static void reipl_run(struct shutdown_trigger *trigger) 1047static void __reipl_run(void *unused)
1043{ 1048{
1044 struct ccw_dev_id devid; 1049 struct ccw_dev_id devid;
1045 static char buf[128]; 1050 static char buf[128];
@@ -1087,6 +1092,11 @@ static void reipl_run(struct shutdown_trigger *trigger)
1087 disabled_wait((unsigned long) __builtin_return_address(0)); 1092 disabled_wait((unsigned long) __builtin_return_address(0));
1088} 1093}
1089 1094
1095static void reipl_run(struct shutdown_trigger *trigger)
1096{
1097 smp_switch_to_ipl_cpu(__reipl_run, NULL);
1098}
1099
1090static void reipl_block_ccw_init(struct ipl_parameter_block *ipb) 1100static void reipl_block_ccw_init(struct ipl_parameter_block *ipb)
1091{ 1101{
1092 ipb->hdr.len = IPL_PARM_BLK_CCW_LEN; 1102 ipb->hdr.len = IPL_PARM_BLK_CCW_LEN;
@@ -1369,20 +1379,18 @@ static struct kobj_attribute dump_type_attr =
1369 1379
1370static struct kset *dump_kset; 1380static struct kset *dump_kset;
1371 1381
1372static void dump_run(struct shutdown_trigger *trigger) 1382static void __dump_run(void *unused)
1373{ 1383{
1374 struct ccw_dev_id devid; 1384 struct ccw_dev_id devid;
1375 static char buf[100]; 1385 static char buf[100];
1376 1386
1377 switch (dump_method) { 1387 switch (dump_method) {
1378 case DUMP_METHOD_CCW_CIO: 1388 case DUMP_METHOD_CCW_CIO:
1379 smp_send_stop();
1380 devid.devno = dump_block_ccw->ipl_info.ccw.devno; 1389 devid.devno = dump_block_ccw->ipl_info.ccw.devno;
1381 devid.ssid = 0; 1390 devid.ssid = 0;
1382 reipl_ccw_dev(&devid); 1391 reipl_ccw_dev(&devid);
1383 break; 1392 break;
1384 case DUMP_METHOD_CCW_VM: 1393 case DUMP_METHOD_CCW_VM:
1385 smp_send_stop();
1386 sprintf(buf, "STORE STATUS"); 1394 sprintf(buf, "STORE STATUS");
1387 __cpcmd(buf, NULL, 0, NULL); 1395 __cpcmd(buf, NULL, 0, NULL);
1388 sprintf(buf, "IPL %X", dump_block_ccw->ipl_info.ccw.devno); 1396 sprintf(buf, "IPL %X", dump_block_ccw->ipl_info.ccw.devno);
@@ -1396,10 +1404,17 @@ static void dump_run(struct shutdown_trigger *trigger)
1396 diag308(DIAG308_SET, dump_block_fcp); 1404 diag308(DIAG308_SET, dump_block_fcp);
1397 diag308(DIAG308_DUMP, NULL); 1405 diag308(DIAG308_DUMP, NULL);
1398 break; 1406 break;
1399 case DUMP_METHOD_NONE: 1407 default:
1400 return; 1408 break;
1401 } 1409 }
1402 printk(KERN_EMERG "Dump failed!\n"); 1410}
1411
1412static void dump_run(struct shutdown_trigger *trigger)
1413{
1414 if (dump_method == DUMP_METHOD_NONE)
1415 return;
1416 smp_send_stop();
1417 smp_switch_to_ipl_cpu(__dump_run, NULL);
1403} 1418}
1404 1419
1405static int __init dump_ccw_init(void) 1420static int __init dump_ccw_init(void)
@@ -1577,7 +1592,7 @@ static void vmcmd_run(struct shutdown_trigger *trigger)
1577static int vmcmd_init(void) 1592static int vmcmd_init(void)
1578{ 1593{
1579 if (!MACHINE_IS_VM) 1594 if (!MACHINE_IS_VM)
1580 return -ENOTSUPP; 1595 return -EOPNOTSUPP;
1581 vmcmd_kset = kset_create_and_add("vmcmd", NULL, firmware_kobj); 1596 vmcmd_kset = kset_create_and_add("vmcmd", NULL, firmware_kobj);
1582 if (!vmcmd_kset) 1597 if (!vmcmd_kset)
1583 return -ENOMEM; 1598 return -ENOMEM;
@@ -1595,7 +1610,7 @@ static void stop_run(struct shutdown_trigger *trigger)
1595{ 1610{
1596 if (strcmp(trigger->name, ON_PANIC_STR) == 0) 1611 if (strcmp(trigger->name, ON_PANIC_STR) == 0)
1597 disabled_wait((unsigned long) __builtin_return_address(0)); 1612 disabled_wait((unsigned long) __builtin_return_address(0));
1598 while (signal_processor(smp_processor_id(), sigp_stop) == sigp_busy) 1613 while (sigp(smp_processor_id(), sigp_stop) == sigp_busy)
1599 cpu_relax(); 1614 cpu_relax();
1600 for (;;); 1615 for (;;);
1601} 1616}
@@ -1902,7 +1917,6 @@ void __init ipl_update_parameters(void)
1902void __init ipl_save_parameters(void) 1917void __init ipl_save_parameters(void)
1903{ 1918{
1904 struct cio_iplinfo iplinfo; 1919 struct cio_iplinfo iplinfo;
1905 unsigned int *ipl_ptr;
1906 void *src, *dst; 1920 void *src, *dst;
1907 1921
1908 if (cio_get_iplinfo(&iplinfo)) 1922 if (cio_get_iplinfo(&iplinfo))
@@ -1913,11 +1927,10 @@ void __init ipl_save_parameters(void)
1913 if (!iplinfo.is_qdio) 1927 if (!iplinfo.is_qdio)
1914 return; 1928 return;
1915 ipl_flags |= IPL_PARMBLOCK_VALID; 1929 ipl_flags |= IPL_PARMBLOCK_VALID;
1916 ipl_ptr = (unsigned int *)__LC_IPL_PARMBLOCK_PTR; 1930 src = (void *)(unsigned long)S390_lowcore.ipl_parmblock_ptr;
1917 src = (void *)(unsigned long)*ipl_ptr;
1918 dst = (void *)IPL_PARMBLOCK_ORIGIN; 1931 dst = (void *)IPL_PARMBLOCK_ORIGIN;
1919 memmove(dst, src, PAGE_SIZE); 1932 memmove(dst, src, PAGE_SIZE);
1920 *ipl_ptr = IPL_PARMBLOCK_ORIGIN; 1933 S390_lowcore.ipl_parmblock_ptr = IPL_PARMBLOCK_ORIGIN;
1921} 1934}
1922 1935
1923static LIST_HEAD(rcall); 1936static LIST_HEAD(rcall);
diff --git a/arch/s390/kernel/machine_kexec.c b/arch/s390/kernel/machine_kexec.c
index 131d7ee8b416..a922d51df6bf 100644
--- a/arch/s390/kernel/machine_kexec.c
+++ b/arch/s390/kernel/machine_kexec.c
@@ -54,11 +54,11 @@ void machine_shutdown(void)
54{ 54{
55} 55}
56 56
57void machine_kexec(struct kimage *image) 57static void __machine_kexec(void *data)
58{ 58{
59 relocate_kernel_t data_mover; 59 relocate_kernel_t data_mover;
60 struct kimage *image = data;
60 61
61 smp_send_stop();
62 pfault_fini(); 62 pfault_fini();
63 s390_reset_system(); 63 s390_reset_system();
64 64
@@ -68,3 +68,9 @@ void machine_kexec(struct kimage *image)
68 (*data_mover)(&image->head, image->start); 68 (*data_mover)(&image->head, image->start);
69 for (;;); 69 for (;;);
70} 70}
71
72void machine_kexec(struct kimage *image)
73{
74 smp_send_stop();
75 smp_switch_to_ipl_cpu(__machine_kexec, image);
76}
diff --git a/arch/s390/kernel/ptrace.c b/arch/s390/kernel/ptrace.c
index 7cf464234419..33fdc5a79764 100644
--- a/arch/s390/kernel/ptrace.c
+++ b/arch/s390/kernel/ptrace.c
@@ -992,3 +992,61 @@ const struct user_regset_view *task_user_regset_view(struct task_struct *task)
992#endif 992#endif
993 return &user_s390_view; 993 return &user_s390_view;
994} 994}
995
996static const char *gpr_names[NUM_GPRS] = {
997 "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
998 "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
999};
1000
1001unsigned long regs_get_register(struct pt_regs *regs, unsigned int offset)
1002{
1003 if (offset >= NUM_GPRS)
1004 return 0;
1005 return regs->gprs[offset];
1006}
1007
1008int regs_query_register_offset(const char *name)
1009{
1010 unsigned long offset;
1011
1012 if (!name || *name != 'r')
1013 return -EINVAL;
1014 if (strict_strtoul(name + 1, 10, &offset))
1015 return -EINVAL;
1016 if (offset >= NUM_GPRS)
1017 return -EINVAL;
1018 return offset;
1019}
1020
1021const char *regs_query_register_name(unsigned int offset)
1022{
1023 if (offset >= NUM_GPRS)
1024 return NULL;
1025 return gpr_names[offset];
1026}
1027
1028static int regs_within_kernel_stack(struct pt_regs *regs, unsigned long addr)
1029{
1030 unsigned long ksp = kernel_stack_pointer(regs);
1031
1032 return (addr & ~(THREAD_SIZE - 1)) == (ksp & ~(THREAD_SIZE - 1));
1033}
1034
1035/**
1036 * regs_get_kernel_stack_nth() - get Nth entry of the stack
1037 * @regs:pt_regs which contains kernel stack pointer.
1038 * @n:stack entry number.
1039 *
1040 * regs_get_kernel_stack_nth() returns @n th entry of the kernel stack which
1041 * is specifined by @regs. If the @n th entry is NOT in the kernel stack,
1042 * this returns 0.
1043 */
1044unsigned long regs_get_kernel_stack_nth(struct pt_regs *regs, unsigned int n)
1045{
1046 unsigned long addr;
1047
1048 addr = kernel_stack_pointer(regs) + n * sizeof(long);
1049 if (!regs_within_kernel_stack(regs, addr))
1050 return 0;
1051 return *(unsigned long *)addr;
1052}
diff --git a/arch/s390/kernel/reipl.S b/arch/s390/kernel/reipl.S
index 2f481cc3d1c9..cb899d9f8505 100644
--- a/arch/s390/kernel/reipl.S
+++ b/arch/s390/kernel/reipl.S
@@ -6,7 +6,7 @@
6 * Author(s): Holger Smolinski (Holger.Smolinski@de.ibm.com) 6 * Author(s): Holger Smolinski (Holger.Smolinski@de.ibm.com)
7 */ 7 */
8 8
9#include <asm/lowcore.h> 9#include <asm/asm-offsets.h>
10 10
11# 11#
12# do_reipl_asm 12# do_reipl_asm
diff --git a/arch/s390/kernel/reipl64.S b/arch/s390/kernel/reipl64.S
index 774147824c3d..5e73dee63baa 100644
--- a/arch/s390/kernel/reipl64.S
+++ b/arch/s390/kernel/reipl64.S
@@ -4,7 +4,7 @@
4 * Denis Joseph Barrow, 4 * Denis Joseph Barrow,
5 */ 5 */
6 6
7#include <asm/lowcore.h> 7#include <asm/asm-offsets.h>
8 8
9# 9#
10# do_reipl_asm 10# do_reipl_asm
diff --git a/arch/s390/kernel/sclp.S b/arch/s390/kernel/sclp.S
index e27ca63076d1..27af3bf3a009 100644
--- a/arch/s390/kernel/sclp.S
+++ b/arch/s390/kernel/sclp.S
@@ -9,8 +9,10 @@
9 */ 9 */
10 10
11LC_EXT_NEW_PSW = 0x58 # addr of ext int handler 11LC_EXT_NEW_PSW = 0x58 # addr of ext int handler
12LC_EXT_NEW_PSW_64 = 0x1b0 # addr of ext int handler 64 bit
12LC_EXT_INT_PARAM = 0x80 # addr of ext int parameter 13LC_EXT_INT_PARAM = 0x80 # addr of ext int parameter
13LC_EXT_INT_CODE = 0x86 # addr of ext int code 14LC_EXT_INT_CODE = 0x86 # addr of ext int code
15LC_AR_MODE_ID = 0xa3
14 16
15# 17#
16# Subroutine which waits synchronously until either an external interruption 18# Subroutine which waits synchronously until either an external interruption
@@ -30,8 +32,16 @@ _sclp_wait_int:
30.LbaseS1: 32.LbaseS1:
31 ahi %r15,-96 # create stack frame 33 ahi %r15,-96 # create stack frame
32 la %r8,LC_EXT_NEW_PSW # register int handler 34 la %r8,LC_EXT_NEW_PSW # register int handler
33 mvc .LoldpswS1-.LbaseS1(8,%r13),0(%r8) 35 la %r9,.LextpswS1-.LbaseS1(%r13)
34 mvc 0(8,%r8),.LextpswS1-.LbaseS1(%r13) 36#ifdef CONFIG_64BIT
37 tm LC_AR_MODE_ID,1
38 jno .Lesa1
39 la %r8,LC_EXT_NEW_PSW_64 # register int handler 64 bit
40 la %r9,.LextpswS1_64-.LbaseS1(%r13)
41.Lesa1:
42#endif
43 mvc .LoldpswS1-.LbaseS1(16,%r13),0(%r8)
44 mvc 0(16,%r8),0(%r9)
35 lhi %r6,0x0200 # cr mask for ext int (cr0.54) 45 lhi %r6,0x0200 # cr mask for ext int (cr0.54)
36 ltr %r2,%r2 46 ltr %r2,%r2
37 jz .LsetctS1 47 jz .LsetctS1
@@ -64,15 +74,19 @@ _sclp_wait_int:
64.LtimeoutS1: 74.LtimeoutS1:
65 lctl %c0,%c0,.LctlS1-.LbaseS1(%r13) # restore interrupt setting 75 lctl %c0,%c0,.LctlS1-.LbaseS1(%r13) # restore interrupt setting
66 # restore old handler 76 # restore old handler
67 mvc 0(8,%r8),.LoldpswS1-.LbaseS1(%r13) 77 mvc 0(16,%r8),.LoldpswS1-.LbaseS1(%r13)
68 lm %r6,%r15,120(%r15) # restore registers 78 lm %r6,%r15,120(%r15) # restore registers
69 br %r14 # return to caller 79 br %r14 # return to caller
70 80
71 .align 8 81 .align 8
72.LoldpswS1: 82.LoldpswS1:
73 .long 0, 0 # old ext int PSW 83 .long 0, 0, 0, 0 # old ext int PSW
74.LextpswS1: 84.LextpswS1:
75 .long 0x00080000, 0x80000000+.LwaitS1 # PSW to handle ext int 85 .long 0x00080000, 0x80000000+.LwaitS1 # PSW to handle ext int
86#ifdef CONFIG_64BIT
87.LextpswS1_64:
88 .quad 0x0000000180000000, .LwaitS1 # PSW to handle ext int, 64 bit
89#endif
76.LwaitpswS1: 90.LwaitpswS1:
77 .long 0x010a0000, 0x00000000+.LloopS1 # PSW to wait for ext int 91 .long 0x010a0000, 0x00000000+.LloopS1 # PSW to wait for ext int
78.LtimeS1: 92.LtimeS1:
@@ -250,6 +264,13 @@ _sclp_print:
250_sclp_print_early: 264_sclp_print_early:
251 stm %r6,%r15,24(%r15) # save registers 265 stm %r6,%r15,24(%r15) # save registers
252 ahi %r15,-96 # create stack frame 266 ahi %r15,-96 # create stack frame
267#ifdef CONFIG_64BIT
268 tm LC_AR_MODE_ID,1
269 jno .Lesa2
270 ahi %r15,-80
271 stmh %r6,%r15,96(%r15) # store upper register halves
272.Lesa2:
273#endif
253 lr %r10,%r2 # save string pointer 274 lr %r10,%r2 # save string pointer
254 lhi %r2,0 275 lhi %r2,0
255 bras %r14,_sclp_setup # enable console 276 bras %r14,_sclp_setup # enable console
@@ -262,6 +283,13 @@ _sclp_print_early:
262 lhi %r2,1 283 lhi %r2,1
263 bras %r14,_sclp_setup # disable console 284 bras %r14,_sclp_setup # disable console
264.LendS5: 285.LendS5:
286#ifdef CONFIG_64BIT
287 tm LC_AR_MODE_ID,1
288 jno .Lesa3
289 lmh %r6,%r15,96(%r15) # store upper register halves
290 ahi %r15,80
291.Lesa3:
292#endif
265 lm %r6,%r15,120(%r15) # restore registers 293 lm %r6,%r15,120(%r15) # restore registers
266 br %r14 294 br %r14
267 295
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index 8d8957b38ab3..77a63ae419f0 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -396,15 +396,12 @@ static void __init
396setup_lowcore(void) 396setup_lowcore(void)
397{ 397{
398 struct _lowcore *lc; 398 struct _lowcore *lc;
399 int lc_pages;
400 399
401 /* 400 /*
402 * Setup lowcore for boot cpu 401 * Setup lowcore for boot cpu
403 */ 402 */
404 lc_pages = sizeof(void *) == 8 ? 2 : 1; 403 BUILD_BUG_ON(sizeof(struct _lowcore) != LC_PAGES * 4096);
405 lc = (struct _lowcore *) 404 lc = __alloc_bootmem(LC_PAGES * PAGE_SIZE, LC_PAGES * PAGE_SIZE, 0);
406 __alloc_bootmem(lc_pages * PAGE_SIZE, lc_pages * PAGE_SIZE, 0);
407 memset(lc, 0, lc_pages * PAGE_SIZE);
408 lc->restart_psw.mask = PSW_BASE_BITS | PSW_DEFAULT_KEY; 405 lc->restart_psw.mask = PSW_BASE_BITS | PSW_DEFAULT_KEY;
409 lc->restart_psw.addr = 406 lc->restart_psw.addr =
410 PSW_ADDR_AMODE | (unsigned long) restart_int_handler; 407 PSW_ADDR_AMODE | (unsigned long) restart_int_handler;
@@ -804,7 +801,7 @@ setup_arch(char **cmdline_p)
804 if (MACHINE_IS_VM) 801 if (MACHINE_IS_VM)
805 pr_info("Linux is running as a z/VM " 802 pr_info("Linux is running as a z/VM "
806 "guest operating system in 31-bit mode\n"); 803 "guest operating system in 31-bit mode\n");
807 else 804 else if (MACHINE_IS_LPAR)
808 pr_info("Linux is running natively in 31-bit mode\n"); 805 pr_info("Linux is running natively in 31-bit mode\n");
809 if (MACHINE_HAS_IEEE) 806 if (MACHINE_HAS_IEEE)
810 pr_info("The hardware system has IEEE compatible " 807 pr_info("The hardware system has IEEE compatible "
@@ -818,7 +815,7 @@ setup_arch(char **cmdline_p)
818 "guest operating system in 64-bit mode\n"); 815 "guest operating system in 64-bit mode\n");
819 else if (MACHINE_IS_KVM) 816 else if (MACHINE_IS_KVM)
820 pr_info("Linux is running under KVM in 64-bit mode\n"); 817 pr_info("Linux is running under KVM in 64-bit mode\n");
821 else 818 else if (MACHINE_IS_LPAR)
822 pr_info("Linux is running natively in 64-bit mode\n"); 819 pr_info("Linux is running natively in 64-bit mode\n");
823#endif /* CONFIG_64BIT */ 820#endif /* CONFIG_64BIT */
824 821
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index 76a6fdd46c45..8b10127c00ad 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -36,6 +36,7 @@
36#include <linux/cpu.h> 36#include <linux/cpu.h>
37#include <linux/timex.h> 37#include <linux/timex.h>
38#include <linux/bootmem.h> 38#include <linux/bootmem.h>
39#include <asm/asm-offsets.h>
39#include <asm/ipl.h> 40#include <asm/ipl.h>
40#include <asm/setup.h> 41#include <asm/setup.h>
41#include <asm/sigp.h> 42#include <asm/sigp.h>
@@ -53,7 +54,7 @@
53#include "entry.h" 54#include "entry.h"
54 55
55/* logical cpu to cpu address */ 56/* logical cpu to cpu address */
56int __cpu_logical_map[NR_CPUS]; 57unsigned short __cpu_logical_map[NR_CPUS];
57 58
58static struct task_struct *current_set[NR_CPUS]; 59static struct task_struct *current_set[NR_CPUS];
59 60
@@ -72,13 +73,13 @@ static int cpu_management;
72 73
73static DEFINE_PER_CPU(struct cpu, cpu_devices); 74static DEFINE_PER_CPU(struct cpu, cpu_devices);
74 75
75static void smp_ext_bitcall(int, ec_bit_sig); 76static void smp_ext_bitcall(int, int);
76 77
77static int cpu_stopped(int cpu) 78static int raw_cpu_stopped(int cpu)
78{ 79{
79 __u32 status; 80 u32 status;
80 81
81 switch (signal_processor_ps(&status, 0, cpu, sigp_sense)) { 82 switch (raw_sigp_ps(&status, 0, cpu, sigp_sense)) {
82 case sigp_status_stored: 83 case sigp_status_stored:
83 /* Check for stopped and check stop state */ 84 /* Check for stopped and check stop state */
84 if (status & 0x50) 85 if (status & 0x50)
@@ -90,6 +91,44 @@ static int cpu_stopped(int cpu)
90 return 0; 91 return 0;
91} 92}
92 93
94static inline int cpu_stopped(int cpu)
95{
96 return raw_cpu_stopped(cpu_logical_map(cpu));
97}
98
99void smp_switch_to_ipl_cpu(void (*func)(void *), void *data)
100{
101 struct _lowcore *lc, *current_lc;
102 struct stack_frame *sf;
103 struct pt_regs *regs;
104 unsigned long sp;
105
106 if (smp_processor_id() == 0)
107 func(data);
108 __load_psw_mask(PSW_BASE_BITS | PSW_DEFAULT_KEY);
109 /* Disable lowcore protection */
110 __ctl_clear_bit(0, 28);
111 current_lc = lowcore_ptr[smp_processor_id()];
112 lc = lowcore_ptr[0];
113 if (!lc)
114 lc = current_lc;
115 lc->restart_psw.mask = PSW_BASE_BITS | PSW_DEFAULT_KEY;
116 lc->restart_psw.addr = PSW_ADDR_AMODE | (unsigned long) smp_restart_cpu;
117 if (!cpu_online(0))
118 smp_switch_to_cpu(func, data, 0, stap(), __cpu_logical_map[0]);
119 while (sigp(0, sigp_stop_and_store_status) == sigp_busy)
120 cpu_relax();
121 sp = lc->panic_stack;
122 sp -= sizeof(struct pt_regs);
123 regs = (struct pt_regs *) sp;
124 memcpy(&regs->gprs, &current_lc->gpregs_save_area, sizeof(regs->gprs));
125 regs->psw = lc->psw_save_area;
126 sp -= STACK_FRAME_OVERHEAD;
127 sf = (struct stack_frame *) sp;
128 sf->back_chain = regs->gprs[15];
129 smp_switch_to_cpu(func, data, sp, stap(), __cpu_logical_map[0]);
130}
131
93void smp_send_stop(void) 132void smp_send_stop(void)
94{ 133{
95 int cpu, rc; 134 int cpu, rc;
@@ -103,7 +142,7 @@ void smp_send_stop(void)
103 if (cpu == smp_processor_id()) 142 if (cpu == smp_processor_id())
104 continue; 143 continue;
105 do { 144 do {
106 rc = signal_processor(cpu, sigp_stop); 145 rc = sigp(cpu, sigp_stop);
107 } while (rc == sigp_busy); 146 } while (rc == sigp_busy);
108 147
109 while (!cpu_stopped(cpu)) 148 while (!cpu_stopped(cpu))
@@ -139,13 +178,13 @@ static void do_ext_call_interrupt(__u16 code)
139 * Send an external call sigp to another cpu and return without waiting 178 * Send an external call sigp to another cpu and return without waiting
140 * for its completion. 179 * for its completion.
141 */ 180 */
142static void smp_ext_bitcall(int cpu, ec_bit_sig sig) 181static void smp_ext_bitcall(int cpu, int sig)
143{ 182{
144 /* 183 /*
145 * Set signaling bit in lowcore of target cpu and kick it 184 * Set signaling bit in lowcore of target cpu and kick it
146 */ 185 */
147 set_bit(sig, (unsigned long *) &lowcore_ptr[cpu]->ext_call_fast); 186 set_bit(sig, (unsigned long *) &lowcore_ptr[cpu]->ext_call_fast);
148 while (signal_processor(cpu, sigp_emergency_signal) == sigp_busy) 187 while (sigp(cpu, sigp_emergency_signal) == sigp_busy)
149 udelay(10); 188 udelay(10);
150} 189}
151 190
@@ -239,24 +278,8 @@ void smp_ctl_clear_bit(int cr, int bit)
239} 278}
240EXPORT_SYMBOL(smp_ctl_clear_bit); 279EXPORT_SYMBOL(smp_ctl_clear_bit);
241 280
242/*
243 * In early ipl state a temp. logically cpu number is needed, so the sigp
244 * functions can be used to sense other cpus. Since NR_CPUS is >= 2 on
245 * CONFIG_SMP and the ipl cpu is logical cpu 0, it must be 1.
246 */
247#define CPU_INIT_NO 1
248
249#ifdef CONFIG_ZFCPDUMP 281#ifdef CONFIG_ZFCPDUMP
250 282
251/*
252 * zfcpdump_prefix_array holds prefix registers for the following scenario:
253 * 64 bit zfcpdump kernel and 31 bit kernel which is to be dumped. We have to
254 * save its prefix registers, since they get lost, when switching from 31 bit
255 * to 64 bit.
256 */
257unsigned int zfcpdump_prefix_array[NR_CPUS + 1] \
258 __attribute__((__section__(".data")));
259
260static void __init smp_get_save_area(unsigned int cpu, unsigned int phy_cpu) 283static void __init smp_get_save_area(unsigned int cpu, unsigned int phy_cpu)
261{ 284{
262 if (ipl_info.type != IPL_TYPE_FCP_DUMP) 285 if (ipl_info.type != IPL_TYPE_FCP_DUMP)
@@ -266,21 +289,15 @@ static void __init smp_get_save_area(unsigned int cpu, unsigned int phy_cpu)
266 "the dump\n", cpu, NR_CPUS - 1); 289 "the dump\n", cpu, NR_CPUS - 1);
267 return; 290 return;
268 } 291 }
269 zfcpdump_save_areas[cpu] = kmalloc(sizeof(union save_area), GFP_KERNEL); 292 zfcpdump_save_areas[cpu] = kmalloc(sizeof(struct save_area), GFP_KERNEL);
270 __cpu_logical_map[CPU_INIT_NO] = (__u16) phy_cpu; 293 while (raw_sigp(phy_cpu, sigp_stop_and_store_status) == sigp_busy)
271 while (signal_processor(CPU_INIT_NO, sigp_stop_and_store_status) ==
272 sigp_busy)
273 cpu_relax(); 294 cpu_relax();
274 memcpy(zfcpdump_save_areas[cpu], 295 memcpy(zfcpdump_save_areas[cpu],
275 (void *)(unsigned long) store_prefix() + SAVE_AREA_BASE, 296 (void *)(unsigned long) store_prefix() + SAVE_AREA_BASE,
276 SAVE_AREA_SIZE); 297 sizeof(struct save_area));
277#ifdef CONFIG_64BIT
278 /* copy original prefix register */
279 zfcpdump_save_areas[cpu]->s390x.pref_reg = zfcpdump_prefix_array[cpu];
280#endif
281} 298}
282 299
283union save_area *zfcpdump_save_areas[NR_CPUS + 1]; 300struct save_area *zfcpdump_save_areas[NR_CPUS + 1];
284EXPORT_SYMBOL_GPL(zfcpdump_save_areas); 301EXPORT_SYMBOL_GPL(zfcpdump_save_areas);
285 302
286#else 303#else
@@ -389,8 +406,7 @@ static void __init smp_detect_cpus(void)
389 for (cpu = 0; cpu <= MAX_CPU_ADDRESS; cpu++) { 406 for (cpu = 0; cpu <= MAX_CPU_ADDRESS; cpu++) {
390 if (cpu == boot_cpu_addr) 407 if (cpu == boot_cpu_addr)
391 continue; 408 continue;
392 __cpu_logical_map[CPU_INIT_NO] = cpu; 409 if (!raw_cpu_stopped(cpu))
393 if (!cpu_stopped(CPU_INIT_NO))
394 continue; 410 continue;
395 smp_get_save_area(c_cpus, cpu); 411 smp_get_save_area(c_cpus, cpu);
396 c_cpus++; 412 c_cpus++;
@@ -413,8 +429,7 @@ static void __init smp_detect_cpus(void)
413 cpu_addr = info->cpu[cpu].address; 429 cpu_addr = info->cpu[cpu].address;
414 if (cpu_addr == boot_cpu_addr) 430 if (cpu_addr == boot_cpu_addr)
415 continue; 431 continue;
416 __cpu_logical_map[CPU_INIT_NO] = cpu_addr; 432 if (!raw_cpu_stopped(cpu_addr)) {
417 if (!cpu_stopped(CPU_INIT_NO)) {
418 s_cpus++; 433 s_cpus++;
419 continue; 434 continue;
420 } 435 }
@@ -533,18 +548,18 @@ static void smp_free_lowcore(int cpu)
533/* Upping and downing of CPUs */ 548/* Upping and downing of CPUs */
534int __cpuinit __cpu_up(unsigned int cpu) 549int __cpuinit __cpu_up(unsigned int cpu)
535{ 550{
536 struct task_struct *idle;
537 struct _lowcore *cpu_lowcore; 551 struct _lowcore *cpu_lowcore;
552 struct task_struct *idle;
538 struct stack_frame *sf; 553 struct stack_frame *sf;
539 sigp_ccode ccode;
540 u32 lowcore; 554 u32 lowcore;
555 int ccode;
541 556
542 if (smp_cpu_state[cpu] != CPU_STATE_CONFIGURED) 557 if (smp_cpu_state[cpu] != CPU_STATE_CONFIGURED)
543 return -EIO; 558 return -EIO;
544 if (smp_alloc_lowcore(cpu)) 559 if (smp_alloc_lowcore(cpu))
545 return -ENOMEM; 560 return -ENOMEM;
546 do { 561 do {
547 ccode = signal_processor(cpu, sigp_initial_cpu_reset); 562 ccode = sigp(cpu, sigp_initial_cpu_reset);
548 if (ccode == sigp_busy) 563 if (ccode == sigp_busy)
549 udelay(10); 564 udelay(10);
550 if (ccode == sigp_not_operational) 565 if (ccode == sigp_not_operational)
@@ -552,7 +567,7 @@ int __cpuinit __cpu_up(unsigned int cpu)
552 } while (ccode == sigp_busy); 567 } while (ccode == sigp_busy);
553 568
554 lowcore = (u32)(unsigned long)lowcore_ptr[cpu]; 569 lowcore = (u32)(unsigned long)lowcore_ptr[cpu];
555 while (signal_processor_p(lowcore, cpu, sigp_set_prefix) == sigp_busy) 570 while (sigp_p(lowcore, cpu, sigp_set_prefix) == sigp_busy)
556 udelay(10); 571 udelay(10);
557 572
558 idle = current_set[cpu]; 573 idle = current_set[cpu];
@@ -578,7 +593,7 @@ int __cpuinit __cpu_up(unsigned int cpu)
578 cpu_lowcore->ftrace_func = S390_lowcore.ftrace_func; 593 cpu_lowcore->ftrace_func = S390_lowcore.ftrace_func;
579 eieio(); 594 eieio();
580 595
581 while (signal_processor(cpu, sigp_restart) == sigp_busy) 596 while (sigp(cpu, sigp_restart) == sigp_busy)
582 udelay(10); 597 udelay(10);
583 598
584 while (!cpu_online(cpu)) 599 while (!cpu_online(cpu))
@@ -640,7 +655,7 @@ void __cpu_die(unsigned int cpu)
640 /* Wait until target cpu is down */ 655 /* Wait until target cpu is down */
641 while (!cpu_stopped(cpu)) 656 while (!cpu_stopped(cpu))
642 cpu_relax(); 657 cpu_relax();
643 while (signal_processor_p(0, cpu, sigp_set_prefix) == sigp_busy) 658 while (sigp_p(0, cpu, sigp_set_prefix) == sigp_busy)
644 udelay(10); 659 udelay(10);
645 smp_free_lowcore(cpu); 660 smp_free_lowcore(cpu);
646 pr_info("Processor %d stopped\n", cpu); 661 pr_info("Processor %d stopped\n", cpu);
@@ -649,7 +664,7 @@ void __cpu_die(unsigned int cpu)
649void cpu_die(void) 664void cpu_die(void)
650{ 665{
651 idle_task_exit(); 666 idle_task_exit();
652 while (signal_processor(smp_processor_id(), sigp_stop) == sigp_busy) 667 while (sigp(smp_processor_id(), sigp_stop) == sigp_busy)
653 cpu_relax(); 668 cpu_relax();
654 for (;;); 669 for (;;);
655} 670}
@@ -765,7 +780,8 @@ static ssize_t cpu_configure_store(struct sys_device *dev,
765 get_online_cpus(); 780 get_online_cpus();
766 mutex_lock(&smp_cpu_state_mutex); 781 mutex_lock(&smp_cpu_state_mutex);
767 rc = -EBUSY; 782 rc = -EBUSY;
768 if (cpu_online(cpu)) 783 /* disallow configuration changes of online cpus and cpu 0 */
784 if (cpu_online(cpu) || cpu == 0)
769 goto out; 785 goto out;
770 rc = 0; 786 rc = 0;
771 switch (val) { 787 switch (val) {
diff --git a/arch/s390/kernel/switch_cpu.S b/arch/s390/kernel/switch_cpu.S
new file mode 100644
index 000000000000..469f11b574fa
--- /dev/null
+++ b/arch/s390/kernel/switch_cpu.S
@@ -0,0 +1,58 @@
1/*
2 * 31-bit switch cpu code
3 *
4 * Copyright IBM Corp. 2009
5 *
6 */
7
8#include <asm/asm-offsets.h>
9#include <asm/ptrace.h>
10
11# smp_switch_to_cpu switches to destination cpu and executes the passed function
12# Parameter: %r2 - function to call
13# %r3 - function parameter
14# %r4 - stack poiner
15# %r5 - current cpu
16# %r6 - destination cpu
17
18 .section .text
19 .align 4
20 .globl smp_switch_to_cpu
21smp_switch_to_cpu:
22 stm %r6,%r15,__SF_GPRS(%r15)
23 lr %r1,%r15
24 ahi %r15,-STACK_FRAME_OVERHEAD
25 st %r1,__SF_BACKCHAIN(%r15)
26 basr %r13,0
270: la %r1,.gprregs_addr-0b(%r13)
28 l %r1,0(%r1)
29 stm %r0,%r15,0(%r1)
301: sigp %r0,%r6,__SIGP_RESTART /* start destination CPU */
31 brc 2,1b /* busy, try again */
322: sigp %r0,%r5,__SIGP_STOP /* stop current CPU */
33 brc 2,2b /* busy, try again */
343: j 3b
35
36 .globl smp_restart_cpu
37smp_restart_cpu:
38 basr %r13,0
390: la %r1,.gprregs_addr-0b(%r13)
40 l %r1,0(%r1)
41 lm %r0,%r15,0(%r1)
421: sigp %r0,%r5,__SIGP_SENSE /* Wait for calling CPU */
43 brc 10,1b /* busy, accepted (status 0), running */
44 tmll %r0,0x40 /* Test if calling CPU is stopped */
45 jz 1b
46 ltr %r4,%r4 /* New stack ? */
47 jz 1f
48 lr %r15,%r4
491: basr %r14,%r2
50
51.gprregs_addr:
52 .long .gprregs
53
54 .section .data,"aw",@progbits
55.gprregs:
56 .rept 16
57 .long 0
58 .endr
diff --git a/arch/s390/kernel/switch_cpu64.S b/arch/s390/kernel/switch_cpu64.S
new file mode 100644
index 000000000000..d94aacc898cb
--- /dev/null
+++ b/arch/s390/kernel/switch_cpu64.S
@@ -0,0 +1,51 @@
1/*
2 * 64-bit switch cpu code
3 *
4 * Copyright IBM Corp. 2009
5 *
6 */
7
8#include <asm/asm-offsets.h>
9#include <asm/ptrace.h>
10
11# smp_switch_to_cpu switches to destination cpu and executes the passed function
12# Parameter: %r2 - function to call
13# %r3 - function parameter
14# %r4 - stack poiner
15# %r5 - current cpu
16# %r6 - destination cpu
17
18 .section .text
19 .align 4
20 .globl smp_switch_to_cpu
21smp_switch_to_cpu:
22 stmg %r6,%r15,__SF_GPRS(%r15)
23 lgr %r1,%r15
24 aghi %r15,-STACK_FRAME_OVERHEAD
25 stg %r1,__SF_BACKCHAIN(%r15)
26 larl %r1,.gprregs
27 stmg %r0,%r15,0(%r1)
281: sigp %r0,%r6,__SIGP_RESTART /* start destination CPU */
29 brc 2,1b /* busy, try again */
302: sigp %r0,%r5,__SIGP_STOP /* stop current CPU */
31 brc 2,2b /* busy, try again */
323: j 3b
33
34 .globl smp_restart_cpu
35smp_restart_cpu:
36 larl %r1,.gprregs
37 lmg %r0,%r15,0(%r1)
381: sigp %r0,%r5,__SIGP_SENSE /* Wait for calling CPU */
39 brc 10,1b /* busy, accepted (status 0), running */
40 tmll %r0,0x40 /* Test if calling CPU is stopped */
41 jz 1b
42 ltgr %r4,%r4 /* New stack ? */
43 jz 1f
44 lgr %r15,%r4
451: basr %r14,%r2
46
47 .section .data,"aw",@progbits
48.gprregs:
49 .rept 16
50 .quad 0
51 .endr
diff --git a/arch/s390/kernel/swsusp_asm64.S b/arch/s390/kernel/swsusp_asm64.S
index 0c26cc1898ec..b354427e03b7 100644
--- a/arch/s390/kernel/swsusp_asm64.S
+++ b/arch/s390/kernel/swsusp_asm64.S
@@ -176,7 +176,7 @@ pgm_check_entry:
176 cgr %r1,%r2 176 cgr %r1,%r2
177 je restore_registers /* r1 = r2 -> nothing to do */ 177 je restore_registers /* r1 = r2 -> nothing to do */
178 larl %r4,.Lrestart_suspend_psw /* Set new restart PSW */ 178 larl %r4,.Lrestart_suspend_psw /* Set new restart PSW */
179 mvc __LC_RESTART_PSW(16,%r0),0(%r4) 179 mvc __LC_RST_NEW_PSW(16,%r0),0(%r4)
1803: 1803:
181 sigp %r9,%r1,__SIGP_INITIAL_CPU_RESET 181 sigp %r9,%r1,__SIGP_INITIAL_CPU_RESET
182 brc 8,4f /* accepted */ 182 brc 8,4f /* accepted */
diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c
index 65065ac48ed3..a8f93f1705ad 100644
--- a/arch/s390/kernel/time.c
+++ b/arch/s390/kernel/time.c
@@ -51,14 +51,6 @@
51#define USECS_PER_JIFFY ((unsigned long) 1000000/HZ) 51#define USECS_PER_JIFFY ((unsigned long) 1000000/HZ)
52#define CLK_TICKS_PER_JIFFY ((unsigned long) USECS_PER_JIFFY << 12) 52#define CLK_TICKS_PER_JIFFY ((unsigned long) USECS_PER_JIFFY << 12)
53 53
54/*
55 * Create a small time difference between the timer interrupts
56 * on the different cpus to avoid lock contention.
57 */
58#define CPU_DEVIATION (smp_processor_id() << 12)
59
60#define TICK_SIZE tick
61
62u64 sched_clock_base_cc = -1; /* Force to data section. */ 54u64 sched_clock_base_cc = -1; /* Force to data section. */
63EXPORT_SYMBOL_GPL(sched_clock_base_cc); 55EXPORT_SYMBOL_GPL(sched_clock_base_cc);
64 56
diff --git a/arch/s390/kernel/vdso.c b/arch/s390/kernel/vdso.c
index 5f99e66c51c3..6bc9c197aa91 100644
--- a/arch/s390/kernel/vdso.c
+++ b/arch/s390/kernel/vdso.c
@@ -23,6 +23,7 @@
23#include <linux/security.h> 23#include <linux/security.h>
24#include <linux/bootmem.h> 24#include <linux/bootmem.h>
25#include <linux/compat.h> 25#include <linux/compat.h>
26#include <asm/asm-offsets.h>
26#include <asm/pgtable.h> 27#include <asm/pgtable.h>
27#include <asm/system.h> 28#include <asm/system.h>
28#include <asm/processor.h> 29#include <asm/processor.h>
diff --git a/arch/s390/kvm/diag.c b/arch/s390/kvm/diag.c
index 8300309698fa..9e4c84187cf5 100644
--- a/arch/s390/kvm/diag.c
+++ b/arch/s390/kvm/diag.c
@@ -39,7 +39,7 @@ static int __diag_ipl_functions(struct kvm_vcpu *vcpu)
39 vcpu->run->s390_reset_flags = 0; 39 vcpu->run->s390_reset_flags = 0;
40 break; 40 break;
41 default: 41 default:
42 return -ENOTSUPP; 42 return -EOPNOTSUPP;
43 } 43 }
44 44
45 atomic_clear_mask(CPUSTAT_RUNNING, &vcpu->arch.sie_block->cpuflags); 45 atomic_clear_mask(CPUSTAT_RUNNING, &vcpu->arch.sie_block->cpuflags);
@@ -62,6 +62,6 @@ int kvm_s390_handle_diag(struct kvm_vcpu *vcpu)
62 case 0x308: 62 case 0x308:
63 return __diag_ipl_functions(vcpu); 63 return __diag_ipl_functions(vcpu);
64 default: 64 default:
65 return -ENOTSUPP; 65 return -EOPNOTSUPP;
66 } 66 }
67} 67}
diff --git a/arch/s390/kvm/intercept.c b/arch/s390/kvm/intercept.c
index b40096494e46..3ddc30895e31 100644
--- a/arch/s390/kvm/intercept.c
+++ b/arch/s390/kvm/intercept.c
@@ -32,7 +32,7 @@ static int handle_lctlg(struct kvm_vcpu *vcpu)
32 32
33 vcpu->stat.instruction_lctlg++; 33 vcpu->stat.instruction_lctlg++;
34 if ((vcpu->arch.sie_block->ipb & 0xff) != 0x2f) 34 if ((vcpu->arch.sie_block->ipb & 0xff) != 0x2f)
35 return -ENOTSUPP; 35 return -EOPNOTSUPP;
36 36
37 useraddr = disp2; 37 useraddr = disp2;
38 if (base2) 38 if (base2)
@@ -138,7 +138,7 @@ static int handle_stop(struct kvm_vcpu *vcpu)
138 rc = __kvm_s390_vcpu_store_status(vcpu, 138 rc = __kvm_s390_vcpu_store_status(vcpu,
139 KVM_S390_STORE_STATUS_NOADDR); 139 KVM_S390_STORE_STATUS_NOADDR);
140 if (rc >= 0) 140 if (rc >= 0)
141 rc = -ENOTSUPP; 141 rc = -EOPNOTSUPP;
142 } 142 }
143 143
144 if (vcpu->arch.local_int.action_bits & ACTION_RELOADVCPU_ON_STOP) { 144 if (vcpu->arch.local_int.action_bits & ACTION_RELOADVCPU_ON_STOP) {
@@ -150,7 +150,7 @@ static int handle_stop(struct kvm_vcpu *vcpu)
150 if (vcpu->arch.local_int.action_bits & ACTION_STOP_ON_STOP) { 150 if (vcpu->arch.local_int.action_bits & ACTION_STOP_ON_STOP) {
151 vcpu->arch.local_int.action_bits &= ~ACTION_STOP_ON_STOP; 151 vcpu->arch.local_int.action_bits &= ~ACTION_STOP_ON_STOP;
152 VCPU_EVENT(vcpu, 3, "%s", "cpu stopped"); 152 VCPU_EVENT(vcpu, 3, "%s", "cpu stopped");
153 rc = -ENOTSUPP; 153 rc = -EOPNOTSUPP;
154 } 154 }
155 155
156 spin_unlock_bh(&vcpu->arch.local_int.lock); 156 spin_unlock_bh(&vcpu->arch.local_int.lock);
@@ -171,9 +171,9 @@ static int handle_validity(struct kvm_vcpu *vcpu)
171 2*PAGE_SIZE); 171 2*PAGE_SIZE);
172 if (rc) 172 if (rc)
173 /* user will receive sigsegv, exit to user */ 173 /* user will receive sigsegv, exit to user */
174 rc = -ENOTSUPP; 174 rc = -EOPNOTSUPP;
175 } else 175 } else
176 rc = -ENOTSUPP; 176 rc = -EOPNOTSUPP;
177 177
178 if (rc) 178 if (rc)
179 VCPU_EVENT(vcpu, 2, "unhandled validity intercept code %d", 179 VCPU_EVENT(vcpu, 2, "unhandled validity intercept code %d",
@@ -189,7 +189,7 @@ static int handle_instruction(struct kvm_vcpu *vcpu)
189 handler = instruction_handlers[vcpu->arch.sie_block->ipa >> 8]; 189 handler = instruction_handlers[vcpu->arch.sie_block->ipa >> 8];
190 if (handler) 190 if (handler)
191 return handler(vcpu); 191 return handler(vcpu);
192 return -ENOTSUPP; 192 return -EOPNOTSUPP;
193} 193}
194 194
195static int handle_prog(struct kvm_vcpu *vcpu) 195static int handle_prog(struct kvm_vcpu *vcpu)
@@ -206,7 +206,7 @@ static int handle_instruction_and_prog(struct kvm_vcpu *vcpu)
206 rc = handle_instruction(vcpu); 206 rc = handle_instruction(vcpu);
207 rc2 = handle_prog(vcpu); 207 rc2 = handle_prog(vcpu);
208 208
209 if (rc == -ENOTSUPP) 209 if (rc == -EOPNOTSUPP)
210 vcpu->arch.sie_block->icptcode = 0x04; 210 vcpu->arch.sie_block->icptcode = 0x04;
211 if (rc) 211 if (rc)
212 return rc; 212 return rc;
@@ -231,9 +231,9 @@ int kvm_handle_sie_intercept(struct kvm_vcpu *vcpu)
231 u8 code = vcpu->arch.sie_block->icptcode; 231 u8 code = vcpu->arch.sie_block->icptcode;
232 232
233 if (code & 3 || (code >> 2) >= ARRAY_SIZE(intercept_funcs)) 233 if (code & 3 || (code >> 2) >= ARRAY_SIZE(intercept_funcs))
234 return -ENOTSUPP; 234 return -EOPNOTSUPP;
235 func = intercept_funcs[code >> 2]; 235 func = intercept_funcs[code >> 2];
236 if (func) 236 if (func)
237 return func(vcpu); 237 return func(vcpu);
238 return -ENOTSUPP; 238 return -EOPNOTSUPP;
239} 239}
diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c
index 43486c2408e1..834774d8d5f3 100644
--- a/arch/s390/kvm/interrupt.c
+++ b/arch/s390/kvm/interrupt.c
@@ -10,12 +10,12 @@
10 * Author(s): Carsten Otte <cotte@de.ibm.com> 10 * Author(s): Carsten Otte <cotte@de.ibm.com>
11 */ 11 */
12 12
13#include <asm/lowcore.h>
14#include <asm/uaccess.h>
15#include <linux/hrtimer.h>
16#include <linux/interrupt.h> 13#include <linux/interrupt.h>
17#include <linux/kvm_host.h> 14#include <linux/kvm_host.h>
15#include <linux/hrtimer.h>
18#include <linux/signal.h> 16#include <linux/signal.h>
17#include <asm/asm-offsets.h>
18#include <asm/uaccess.h>
19#include "kvm-s390.h" 19#include "kvm-s390.h"
20#include "gaccess.h" 20#include "gaccess.h"
21 21
@@ -187,8 +187,8 @@ static void __do_deliver_interrupt(struct kvm_vcpu *vcpu,
187 if (rc == -EFAULT) 187 if (rc == -EFAULT)
188 exception = 1; 188 exception = 1;
189 189
190 rc = put_guest_u64(vcpu, __LC_PFAULT_INTPARM, 190 rc = put_guest_u64(vcpu, __LC_EXT_PARAMS2,
191 inti->ext.ext_params2); 191 inti->ext.ext_params2);
192 if (rc == -EFAULT) 192 if (rc == -EFAULT)
193 exception = 1; 193 exception = 1;
194 break; 194 break;
@@ -342,7 +342,7 @@ int kvm_s390_handle_wait(struct kvm_vcpu *vcpu)
342 if (psw_interrupts_disabled(vcpu)) { 342 if (psw_interrupts_disabled(vcpu)) {
343 VCPU_EVENT(vcpu, 3, "%s", "disabled wait"); 343 VCPU_EVENT(vcpu, 3, "%s", "disabled wait");
344 __unset_cpu_idle(vcpu); 344 __unset_cpu_idle(vcpu);
345 return -ENOTSUPP; /* disabled wait */ 345 return -EOPNOTSUPP; /* disabled wait */
346 } 346 }
347 347
348 if (psw_extint_disabled(vcpu) || 348 if (psw_extint_disabled(vcpu) ||
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index f8bcaefd7d34..3fa0a10e4668 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -23,6 +23,7 @@
23#include <linux/module.h> 23#include <linux/module.h>
24#include <linux/slab.h> 24#include <linux/slab.h>
25#include <linux/timer.h> 25#include <linux/timer.h>
26#include <asm/asm-offsets.h>
26#include <asm/lowcore.h> 27#include <asm/lowcore.h>
27#include <asm/pgtable.h> 28#include <asm/pgtable.h>
28#include <asm/nmi.h> 29#include <asm/nmi.h>
@@ -543,7 +544,7 @@ rerun_vcpu:
543 rc = -EINTR; 544 rc = -EINTR;
544 } 545 }
545 546
546 if (rc == -ENOTSUPP) { 547 if (rc == -EOPNOTSUPP) {
547 /* intercept cannot be handled in-kernel, prepare kvm-run */ 548 /* intercept cannot be handled in-kernel, prepare kvm-run */
548 kvm_run->exit_reason = KVM_EXIT_S390_SIEIC; 549 kvm_run->exit_reason = KVM_EXIT_S390_SIEIC;
549 kvm_run->s390_sieic.icptcode = vcpu->arch.sie_block->icptcode; 550 kvm_run->s390_sieic.icptcode = vcpu->arch.sie_block->icptcode;
@@ -603,45 +604,45 @@ int __kvm_s390_vcpu_store_status(struct kvm_vcpu *vcpu, unsigned long addr)
603 } else 604 } else
604 prefix = 0; 605 prefix = 0;
605 606
606 if (__guestcopy(vcpu, addr + offsetof(struct save_area_s390x, fp_regs), 607 if (__guestcopy(vcpu, addr + offsetof(struct save_area, fp_regs),
607 vcpu->arch.guest_fpregs.fprs, 128, prefix)) 608 vcpu->arch.guest_fpregs.fprs, 128, prefix))
608 return -EFAULT; 609 return -EFAULT;
609 610
610 if (__guestcopy(vcpu, addr + offsetof(struct save_area_s390x, gp_regs), 611 if (__guestcopy(vcpu, addr + offsetof(struct save_area, gp_regs),
611 vcpu->arch.guest_gprs, 128, prefix)) 612 vcpu->arch.guest_gprs, 128, prefix))
612 return -EFAULT; 613 return -EFAULT;
613 614
614 if (__guestcopy(vcpu, addr + offsetof(struct save_area_s390x, psw), 615 if (__guestcopy(vcpu, addr + offsetof(struct save_area, psw),
615 &vcpu->arch.sie_block->gpsw, 16, prefix)) 616 &vcpu->arch.sie_block->gpsw, 16, prefix))
616 return -EFAULT; 617 return -EFAULT;
617 618
618 if (__guestcopy(vcpu, addr + offsetof(struct save_area_s390x, pref_reg), 619 if (__guestcopy(vcpu, addr + offsetof(struct save_area, pref_reg),
619 &vcpu->arch.sie_block->prefix, 4, prefix)) 620 &vcpu->arch.sie_block->prefix, 4, prefix))
620 return -EFAULT; 621 return -EFAULT;
621 622
622 if (__guestcopy(vcpu, 623 if (__guestcopy(vcpu,
623 addr + offsetof(struct save_area_s390x, fp_ctrl_reg), 624 addr + offsetof(struct save_area, fp_ctrl_reg),
624 &vcpu->arch.guest_fpregs.fpc, 4, prefix)) 625 &vcpu->arch.guest_fpregs.fpc, 4, prefix))
625 return -EFAULT; 626 return -EFAULT;
626 627
627 if (__guestcopy(vcpu, addr + offsetof(struct save_area_s390x, tod_reg), 628 if (__guestcopy(vcpu, addr + offsetof(struct save_area, tod_reg),
628 &vcpu->arch.sie_block->todpr, 4, prefix)) 629 &vcpu->arch.sie_block->todpr, 4, prefix))
629 return -EFAULT; 630 return -EFAULT;
630 631
631 if (__guestcopy(vcpu, addr + offsetof(struct save_area_s390x, timer), 632 if (__guestcopy(vcpu, addr + offsetof(struct save_area, timer),
632 &vcpu->arch.sie_block->cputm, 8, prefix)) 633 &vcpu->arch.sie_block->cputm, 8, prefix))
633 return -EFAULT; 634 return -EFAULT;
634 635
635 if (__guestcopy(vcpu, addr + offsetof(struct save_area_s390x, clk_cmp), 636 if (__guestcopy(vcpu, addr + offsetof(struct save_area, clk_cmp),
636 &vcpu->arch.sie_block->ckc, 8, prefix)) 637 &vcpu->arch.sie_block->ckc, 8, prefix))
637 return -EFAULT; 638 return -EFAULT;
638 639
639 if (__guestcopy(vcpu, addr + offsetof(struct save_area_s390x, acc_regs), 640 if (__guestcopy(vcpu, addr + offsetof(struct save_area, acc_regs),
640 &vcpu->arch.guest_acrs, 64, prefix)) 641 &vcpu->arch.guest_acrs, 64, prefix))
641 return -EFAULT; 642 return -EFAULT;
642 643
643 if (__guestcopy(vcpu, 644 if (__guestcopy(vcpu,
644 addr + offsetof(struct save_area_s390x, ctrl_regs), 645 addr + offsetof(struct save_area, ctrl_regs),
645 &vcpu->arch.sie_block->gcr, 128, prefix)) 646 &vcpu->arch.sie_block->gcr, 128, prefix))
646 return -EFAULT; 647 return -EFAULT;
647 return 0; 648 return 0;
diff --git a/arch/s390/kvm/priv.c b/arch/s390/kvm/priv.c
index d426aac8095d..28c55677eb39 100644
--- a/arch/s390/kvm/priv.c
+++ b/arch/s390/kvm/priv.c
@@ -323,5 +323,5 @@ int kvm_s390_handle_b2(struct kvm_vcpu *vcpu)
323 else 323 else
324 return handler(vcpu); 324 return handler(vcpu);
325 } 325 }
326 return -ENOTSUPP; 326 return -EOPNOTSUPP;
327} 327}
diff --git a/arch/s390/kvm/sigp.c b/arch/s390/kvm/sigp.c
index 15ee1111de58..241a48459b66 100644
--- a/arch/s390/kvm/sigp.c
+++ b/arch/s390/kvm/sigp.c
@@ -172,7 +172,7 @@ static int __sigp_set_arch(struct kvm_vcpu *vcpu, u32 parameter)
172 rc = 0; /* order accepted */ 172 rc = 0; /* order accepted */
173 break; 173 break;
174 default: 174 default:
175 rc = -ENOTSUPP; 175 rc = -EOPNOTSUPP;
176 } 176 }
177 return rc; 177 return rc;
178} 178}
@@ -293,7 +293,7 @@ int kvm_s390_handle_sigp(struct kvm_vcpu *vcpu)
293 vcpu->stat.instruction_sigp_restart++; 293 vcpu->stat.instruction_sigp_restart++;
294 /* user space must know about restart */ 294 /* user space must know about restart */
295 default: 295 default:
296 return -ENOTSUPP; 296 return -EOPNOTSUPP;
297 } 297 }
298 298
299 if (rc < 0) 299 if (rc < 0)
diff --git a/arch/s390/lib/Makefile b/arch/s390/lib/Makefile
index 97975ec7a274..cd54a1c352af 100644
--- a/arch/s390/lib/Makefile
+++ b/arch/s390/lib/Makefile
@@ -2,7 +2,7 @@
2# Makefile for s390-specific library files.. 2# Makefile for s390-specific library files..
3# 3#
4 4
5lib-y += delay.o string.o uaccess_std.o uaccess_pt.o 5lib-y += delay.o string.o uaccess_std.o uaccess_pt.o usercopy.o
6obj-$(CONFIG_32BIT) += div64.o qrnnd.o ucmpdi2.o 6obj-$(CONFIG_32BIT) += div64.o qrnnd.o ucmpdi2.o
7lib-$(CONFIG_64BIT) += uaccess_mvcos.o 7lib-$(CONFIG_64BIT) += uaccess_mvcos.o
8lib-$(CONFIG_SMP) += spinlock.o 8lib-$(CONFIG_SMP) += spinlock.o
diff --git a/arch/s390/lib/spinlock.c b/arch/s390/lib/spinlock.c
index cff327f109a8..91754ffb9203 100644
--- a/arch/s390/lib/spinlock.c
+++ b/arch/s390/lib/spinlock.c
@@ -43,16 +43,24 @@ void arch_spin_lock_wait(arch_spinlock_t *lp)
43{ 43{
44 int count = spin_retry; 44 int count = spin_retry;
45 unsigned int cpu = ~smp_processor_id(); 45 unsigned int cpu = ~smp_processor_id();
46 unsigned int owner;
46 47
47 while (1) { 48 while (1) {
48 if (count-- <= 0) { 49 owner = lp->owner_cpu;
49 unsigned int owner = lp->owner_cpu; 50 if (!owner || smp_vcpu_scheduled(~owner)) {
50 if (owner != 0) 51 for (count = spin_retry; count > 0; count--) {
51 _raw_yield_cpu(~owner); 52 if (arch_spin_is_locked(lp))
52 count = spin_retry; 53 continue;
54 if (_raw_compare_and_swap(&lp->owner_cpu, 0,
55 cpu) == 0)
56 return;
57 }
58 if (MACHINE_IS_LPAR)
59 continue;
53 } 60 }
54 if (arch_spin_is_locked(lp)) 61 owner = lp->owner_cpu;
55 continue; 62 if (owner)
63 _raw_yield_cpu(~owner);
56 if (_raw_compare_and_swap(&lp->owner_cpu, 0, cpu) == 0) 64 if (_raw_compare_and_swap(&lp->owner_cpu, 0, cpu) == 0)
57 return; 65 return;
58 } 66 }
@@ -63,17 +71,27 @@ void arch_spin_lock_wait_flags(arch_spinlock_t *lp, unsigned long flags)
63{ 71{
64 int count = spin_retry; 72 int count = spin_retry;
65 unsigned int cpu = ~smp_processor_id(); 73 unsigned int cpu = ~smp_processor_id();
74 unsigned int owner;
66 75
67 local_irq_restore(flags); 76 local_irq_restore(flags);
68 while (1) { 77 while (1) {
69 if (count-- <= 0) { 78 owner = lp->owner_cpu;
70 unsigned int owner = lp->owner_cpu; 79 if (!owner || smp_vcpu_scheduled(~owner)) {
71 if (owner != 0) 80 for (count = spin_retry; count > 0; count--) {
72 _raw_yield_cpu(~owner); 81 if (arch_spin_is_locked(lp))
73 count = spin_retry; 82 continue;
83 local_irq_disable();
84 if (_raw_compare_and_swap(&lp->owner_cpu, 0,
85 cpu) == 0)
86 return;
87 local_irq_restore(flags);
88 }
89 if (MACHINE_IS_LPAR)
90 continue;
74 } 91 }
75 if (arch_spin_is_locked(lp)) 92 owner = lp->owner_cpu;
76 continue; 93 if (owner)
94 _raw_yield_cpu(~owner);
77 local_irq_disable(); 95 local_irq_disable();
78 if (_raw_compare_and_swap(&lp->owner_cpu, 0, cpu) == 0) 96 if (_raw_compare_and_swap(&lp->owner_cpu, 0, cpu) == 0)
79 return; 97 return;
@@ -100,8 +118,11 @@ EXPORT_SYMBOL(arch_spin_trylock_retry);
100void arch_spin_relax(arch_spinlock_t *lock) 118void arch_spin_relax(arch_spinlock_t *lock)
101{ 119{
102 unsigned int cpu = lock->owner_cpu; 120 unsigned int cpu = lock->owner_cpu;
103 if (cpu != 0) 121 if (cpu != 0) {
104 _raw_yield_cpu(~cpu); 122 if (MACHINE_IS_VM || MACHINE_IS_KVM ||
123 !smp_vcpu_scheduled(~cpu))
124 _raw_yield_cpu(~cpu);
125 }
105} 126}
106EXPORT_SYMBOL(arch_spin_relax); 127EXPORT_SYMBOL(arch_spin_relax);
107 128
diff --git a/arch/s390/lib/usercopy.c b/arch/s390/lib/usercopy.c
new file mode 100644
index 000000000000..14b363fec8a2
--- /dev/null
+++ b/arch/s390/lib/usercopy.c
@@ -0,0 +1,8 @@
1#include <linux/module.h>
2#include <linux/bug.h>
3
4void copy_from_user_overflow(void)
5{
6 WARN(1, "Buffer overflow detected!\n");
7}
8EXPORT_SYMBOL(copy_from_user_overflow);
diff --git a/arch/s390/mm/extmem.c b/arch/s390/mm/extmem.c
index 5c8457129603..6409fd57eb04 100644
--- a/arch/s390/mm/extmem.c
+++ b/arch/s390/mm/extmem.c
@@ -309,7 +309,7 @@ query_segment_type (struct dcss_segment *seg)
309 } 309 }
310#endif 310#endif
311 if (qout->segcnt > 6) { 311 if (qout->segcnt > 6) {
312 rc = -ENOTSUPP; 312 rc = -EOPNOTSUPP;
313 goto out_free; 313 goto out_free;
314 } 314 }
315 315
@@ -324,11 +324,11 @@ query_segment_type (struct dcss_segment *seg)
324 for (i=0; i<qout->segcnt; i++) { 324 for (i=0; i<qout->segcnt; i++) {
325 if (((qout->range[i].start & 0xff) != SEG_TYPE_EW) && 325 if (((qout->range[i].start & 0xff) != SEG_TYPE_EW) &&
326 ((qout->range[i].start & 0xff) != SEG_TYPE_EN)) { 326 ((qout->range[i].start & 0xff) != SEG_TYPE_EN)) {
327 rc = -ENOTSUPP; 327 rc = -EOPNOTSUPP;
328 goto out_free; 328 goto out_free;
329 } 329 }
330 if (start != qout->range[i].start >> PAGE_SHIFT) { 330 if (start != qout->range[i].start >> PAGE_SHIFT) {
331 rc = -ENOTSUPP; 331 rc = -EOPNOTSUPP;
332 goto out_free; 332 goto out_free;
333 } 333 }
334 start = (qout->range[i].end >> PAGE_SHIFT) + 1; 334 start = (qout->range[i].end >> PAGE_SHIFT) + 1;
@@ -357,7 +357,7 @@ query_segment_type (struct dcss_segment *seg)
357 * -ENOSYS : we are not running on VM 357 * -ENOSYS : we are not running on VM
358 * -EIO : could not perform query diagnose 358 * -EIO : could not perform query diagnose
359 * -ENOENT : no such segment 359 * -ENOENT : no such segment
360 * -ENOTSUPP: multi-part segment cannot be used with linux 360 * -EOPNOTSUPP: multi-part segment cannot be used with linux
361 * -ENOMEM : out of memory 361 * -ENOMEM : out of memory
362 * 0 .. 6 : type of segment as defined in include/asm-s390/extmem.h 362 * 0 .. 6 : type of segment as defined in include/asm-s390/extmem.h
363 */ 363 */
@@ -515,7 +515,7 @@ __segment_load (char *name, int do_nonshared, unsigned long *addr, unsigned long
515 * -ENOSYS : we are not running on VM 515 * -ENOSYS : we are not running on VM
516 * -EIO : could not perform query or load diagnose 516 * -EIO : could not perform query or load diagnose
517 * -ENOENT : no such segment 517 * -ENOENT : no such segment
518 * -ENOTSUPP: multi-part segment cannot be used with linux 518 * -EOPNOTSUPP: multi-part segment cannot be used with linux
519 * -ENOSPC : segment cannot be used (overlaps with storage) 519 * -ENOSPC : segment cannot be used (overlaps with storage)
520 * -EBUSY : segment can temporarily not be used (overlaps with dcss) 520 * -EBUSY : segment can temporarily not be used (overlaps with dcss)
521 * -ERANGE : segment cannot be used (exceeds kernel mapping range) 521 * -ERANGE : segment cannot be used (exceeds kernel mapping range)
@@ -742,7 +742,7 @@ void segment_warning(int rc, char *seg_name)
742 pr_err("Loading or querying DCSS %s resulted in a " 742 pr_err("Loading or querying DCSS %s resulted in a "
743 "hardware error\n", seg_name); 743 "hardware error\n", seg_name);
744 break; 744 break;
745 case -ENOTSUPP: 745 case -EOPNOTSUPP:
746 pr_err("DCSS %s has multiple page ranges and cannot be " 746 pr_err("DCSS %s has multiple page ranges and cannot be "
747 "loaded or queried\n", seg_name); 747 "loaded or queried\n", seg_name);
748 break; 748 break;
diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c
index fc102e70d9c2..3040d7c78fe0 100644
--- a/arch/s390/mm/fault.c
+++ b/arch/s390/mm/fault.c
@@ -30,6 +30,7 @@
30#include <linux/kprobes.h> 30#include <linux/kprobes.h>
31#include <linux/uaccess.h> 31#include <linux/uaccess.h>
32#include <linux/hugetlb.h> 32#include <linux/hugetlb.h>
33#include <asm/asm-offsets.h>
33#include <asm/system.h> 34#include <asm/system.h>
34#include <asm/pgtable.h> 35#include <asm/pgtable.h>
35#include <asm/s390_ext.h> 36#include <asm/s390_ext.h>
@@ -59,15 +60,13 @@ static inline int notify_page_fault(struct pt_regs *regs)
59{ 60{
60 int ret = 0; 61 int ret = 0;
61 62
62#ifdef CONFIG_KPROBES
63 /* kprobe_running() needs smp_processor_id() */ 63 /* kprobe_running() needs smp_processor_id() */
64 if (!user_mode(regs)) { 64 if (kprobes_built_in() && !user_mode(regs)) {
65 preempt_disable(); 65 preempt_disable();
66 if (kprobe_running() && kprobe_fault_handler(regs, 14)) 66 if (kprobe_running() && kprobe_fault_handler(regs, 14))
67 ret = 1; 67 ret = 1;
68 preempt_enable(); 68 preempt_enable();
69 } 69 }
70#endif
71 return ret; 70 return ret;
72} 71}
73 72
diff --git a/arch/s390/mm/init.c b/arch/s390/mm/init.c
index 765647952221..d5865e4024ce 100644
--- a/arch/s390/mm/init.c
+++ b/arch/s390/mm/init.c
@@ -143,33 +143,34 @@ void kernel_map_pages(struct page *page, int numpages, int enable)
143} 143}
144#endif 144#endif
145 145
146void free_initmem(void) 146void free_init_pages(char *what, unsigned long begin, unsigned long end)
147{ 147{
148 unsigned long addr; 148 unsigned long addr = begin;
149 149
150 addr = (unsigned long)(&__init_begin); 150 if (begin >= end)
151 for (; addr < (unsigned long)(&__init_end); addr += PAGE_SIZE) { 151 return;
152 for (; addr < end; addr += PAGE_SIZE) {
152 ClearPageReserved(virt_to_page(addr)); 153 ClearPageReserved(virt_to_page(addr));
153 init_page_count(virt_to_page(addr)); 154 init_page_count(virt_to_page(addr));
154 memset((void *)addr, POISON_FREE_INITMEM, PAGE_SIZE); 155 memset((void *)(addr & PAGE_MASK), POISON_FREE_INITMEM,
156 PAGE_SIZE);
155 free_page(addr); 157 free_page(addr);
156 totalram_pages++; 158 totalram_pages++;
157 } 159 }
158 printk ("Freeing unused kernel memory: %ldk freed\n", 160 printk(KERN_INFO "Freeing %s: %luk freed\n", what, (end - begin) >> 10);
159 ((unsigned long)&__init_end - (unsigned long)&__init_begin) >> 10); 161}
162
163void free_initmem(void)
164{
165 free_init_pages("unused kernel memory",
166 (unsigned long)&__init_begin,
167 (unsigned long)&__init_end);
160} 168}
161 169
162#ifdef CONFIG_BLK_DEV_INITRD 170#ifdef CONFIG_BLK_DEV_INITRD
163void free_initrd_mem(unsigned long start, unsigned long end) 171void free_initrd_mem(unsigned long start, unsigned long end)
164{ 172{
165 if (start < end) 173 free_init_pages("initrd memory", start, end);
166 printk ("Freeing initrd memory: %ldk freed\n", (end - start) >> 10);
167 for (; start < end; start += PAGE_SIZE) {
168 ClearPageReserved(virt_to_page(start));
169 init_page_count(virt_to_page(start));
170 free_page(start);
171 totalram_pages++;
172 }
173} 174}
174#endif 175#endif
175 176
diff --git a/arch/score/include/asm/pgtable.h b/arch/score/include/asm/pgtable.h
index 674934b40170..ccf38f06c57d 100644
--- a/arch/score/include/asm/pgtable.h
+++ b/arch/score/include/asm/pgtable.h
@@ -272,8 +272,9 @@ extern void __update_cache(struct vm_area_struct *vma,
272 unsigned long address, pte_t pte); 272 unsigned long address, pte_t pte);
273 273
274static inline void update_mmu_cache(struct vm_area_struct *vma, 274static inline void update_mmu_cache(struct vm_area_struct *vma,
275 unsigned long address, pte_t pte) 275 unsigned long address, pte_t *ptep)
276{ 276{
277 pte_t pte = *ptep;
277 __update_tlb(vma, address, pte); 278 __update_tlb(vma, address, pte);
278 __update_cache(vma, address, pte); 279 __update_cache(vma, address, pte);
279} 280}
diff --git a/arch/score/mm/init.c b/arch/score/mm/init.c
index dfaf458d6702..7f001bbedb00 100644
--- a/arch/score/mm/init.c
+++ b/arch/score/mm/init.c
@@ -59,7 +59,7 @@ static unsigned long setup_zero_page(void)
59} 59}
60 60
61#ifndef CONFIG_NEED_MULTIPLE_NODES 61#ifndef CONFIG_NEED_MULTIPLE_NODES
62static int __init page_is_ram(unsigned long pagenr) 62int page_is_ram(unsigned long pagenr)
63{ 63{
64 if (pagenr >= min_low_pfn && pagenr < max_low_pfn) 64 if (pagenr >= min_low_pfn && pagenr < max_low_pfn)
65 return 1; 65 return 1;
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
index 2121fbb2ff4c..05cef5061293 100644
--- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -13,7 +13,6 @@ config SUPERH
13 select HAVE_LMB 13 select HAVE_LMB
14 select HAVE_OPROFILE 14 select HAVE_OPROFILE
15 select HAVE_GENERIC_DMA_COHERENT 15 select HAVE_GENERIC_DMA_COHERENT
16 select HAVE_IOREMAP_PROT if MMU
17 select HAVE_ARCH_TRACEHOOK 16 select HAVE_ARCH_TRACEHOOK
18 select HAVE_DMA_API_DEBUG 17 select HAVE_DMA_API_DEBUG
19 select HAVE_DMA_ATTRS 18 select HAVE_DMA_ATTRS
@@ -22,6 +21,7 @@ config SUPERH
22 select HAVE_KERNEL_GZIP 21 select HAVE_KERNEL_GZIP
23 select HAVE_KERNEL_BZIP2 22 select HAVE_KERNEL_BZIP2
24 select HAVE_KERNEL_LZMA 23 select HAVE_KERNEL_LZMA
24 select HAVE_KERNEL_LZO
25 select HAVE_SYSCALL_TRACEPOINTS 25 select HAVE_SYSCALL_TRACEPOINTS
26 select RTC_LIB 26 select RTC_LIB
27 select GENERIC_ATOMIC64 27 select GENERIC_ATOMIC64
@@ -35,6 +35,7 @@ config SUPERH32
35 def_bool ARCH = "sh" 35 def_bool ARCH = "sh"
36 select HAVE_KPROBES 36 select HAVE_KPROBES
37 select HAVE_KRETPROBES 37 select HAVE_KRETPROBES
38 select HAVE_IOREMAP_PROT if MMU && !X2TLB
38 select HAVE_FUNCTION_TRACER 39 select HAVE_FUNCTION_TRACER
39 select HAVE_FTRACE_MCOUNT_RECORD 40 select HAVE_FTRACE_MCOUNT_RECORD
40 select HAVE_DYNAMIC_FTRACE 41 select HAVE_DYNAMIC_FTRACE
@@ -42,6 +43,8 @@ config SUPERH32
42 select HAVE_FTRACE_NMI_ENTER if DYNAMIC_FTRACE 43 select HAVE_FTRACE_NMI_ENTER if DYNAMIC_FTRACE
43 select HAVE_FUNCTION_GRAPH_TRACER 44 select HAVE_FUNCTION_GRAPH_TRACER
44 select HAVE_ARCH_KGDB 45 select HAVE_ARCH_KGDB
46 select HAVE_HW_BREAKPOINT
47 select PERF_EVENTS if HAVE_HW_BREAKPOINT
45 select ARCH_HIBERNATION_POSSIBLE if MMU 48 select ARCH_HIBERNATION_POSSIBLE if MMU
46 49
47config SUPERH64 50config SUPERH64
@@ -78,11 +81,12 @@ config GENERIC_HARDIRQS
78config GENERIC_HARDIRQS_NO__DO_IRQ 81config GENERIC_HARDIRQS_NO__DO_IRQ
79 def_bool y 82 def_bool y
80 83
81config GENERIC_IRQ_PROBE 84config IRQ_PER_CPU
82 def_bool y 85 def_bool y
83 86
84config IRQ_PER_CPU 87config SPARSE_IRQ
85 def_bool y 88 def_bool y
89 depends on SUPERH32
86 90
87config GENERIC_GPIO 91config GENERIC_GPIO
88 def_bool n 92 def_bool n
@@ -548,8 +552,7 @@ config SH_PCLK_FREQ
548 CPU_SUBTYPE_SH7203 || \ 552 CPU_SUBTYPE_SH7203 || \
549 CPU_SUBTYPE_SH7206 || \ 553 CPU_SUBTYPE_SH7206 || \
550 CPU_SUBTYPE_SH7263 || \ 554 CPU_SUBTYPE_SH7263 || \
551 CPU_SUBTYPE_MXG || \ 555 CPU_SUBTYPE_MXG
552 CPU_SUBTYPE_SH7786
553 default "60000000" if CPU_SUBTYPE_SH7751 || CPU_SUBTYPE_SH7751R 556 default "60000000" if CPU_SUBTYPE_SH7751 || CPU_SUBTYPE_SH7751R
554 default "66000000" if CPU_SUBTYPE_SH4_202 557 default "66000000" if CPU_SUBTYPE_SH4_202
555 default "50000000" 558 default "50000000"
@@ -563,7 +566,8 @@ config SH_CLK_CPG
563 566
564config SH_CLK_CPG_LEGACY 567config SH_CLK_CPG_LEGACY
565 depends on SH_CLK_CPG 568 depends on SH_CLK_CPG
566 def_bool y if !CPU_SUBTYPE_SH7785 && !ARCH_SHMOBILE 569 def_bool y if !CPU_SUBTYPE_SH7785 && !ARCH_SHMOBILE && \
570 !CPU_SUBTYPE_SH7786
567 571
568config SH_CLK_MD 572config SH_CLK_MD
569 int "CPU Mode Pin Setting" 573 int "CPU Mode Pin Setting"
@@ -725,18 +729,6 @@ config GUSA_RB
725 LLSC, this should be more efficient than the other alternative of 729 LLSC, this should be more efficient than the other alternative of
726 disabling interrupts around the atomic sequence. 730 disabling interrupts around the atomic sequence.
727 731
728config SPARSE_IRQ
729 bool "Support sparse irq numbering"
730 depends on EXPERIMENTAL
731 help
732 This enables support for sparse irqs. This is useful in general
733 as most CPUs have a fairly sparse array of IRQ vectors, which
734 the irq_desc then maps directly on to. Systems with a high
735 number of off-chip IRQs will want to treat this as
736 experimental until they have been independently verified.
737
738 If you don't know what to do here, say N.
739
740endmenu 732endmenu
741 733
742menu "Boot options" 734menu "Boot options"
@@ -822,11 +814,15 @@ config MAPLE
822config PCI 814config PCI
823 bool "PCI support" 815 bool "PCI support"
824 depends on SYS_SUPPORTS_PCI 816 depends on SYS_SUPPORTS_PCI
817 select PCI_DOMAINS
825 help 818 help
826 Find out whether you have a PCI motherboard. PCI is the name of a 819 Find out whether you have a PCI motherboard. PCI is the name of a
827 bus system, i.e. the way the CPU talks to the other stuff inside 820 bus system, i.e. the way the CPU talks to the other stuff inside
828 your box. If you have PCI, say Y, otherwise N. 821 your box. If you have PCI, say Y, otherwise N.
829 822
823config PCI_DOMAINS
824 bool
825
830source "drivers/pci/pcie/Kconfig" 826source "drivers/pci/pcie/Kconfig"
831 827
832source "drivers/pci/Kconfig" 828source "drivers/pci/Kconfig"
diff --git a/arch/sh/Kconfig.cpu b/arch/sh/Kconfig.cpu
index cd6e3ea598d5..ddf096c7d8bf 100644
--- a/arch/sh/Kconfig.cpu
+++ b/arch/sh/Kconfig.cpu
@@ -68,7 +68,8 @@ config SH_STORE_QUEUES
68 68
69config SPECULATIVE_EXECUTION 69config SPECULATIVE_EXECUTION
70 bool "Speculative subroutine return" 70 bool "Speculative subroutine return"
71 depends on CPU_SUBTYPE_SH7780 && EXPERIMENTAL 71 depends on EXPERIMENTAL
72 depends on CPU_SUBTYPE_SH7780 || CPU_SUBTYPE_SH7785 || CPU_SUBTYPE_SH7786
72 help 73 help
73 This enables support for a speculative instruction fetch for 74 This enables support for a speculative instruction fetch for
74 subroutine return. There are various pitfalls associated with 75 subroutine return. There are various pitfalls associated with
diff --git a/arch/sh/Makefile b/arch/sh/Makefile
index db91925c79d1..588579ac2e35 100644
--- a/arch/sh/Makefile
+++ b/arch/sh/Makefile
@@ -83,6 +83,7 @@ defaultimage-$(CONFIG_SH_AP325RXA) := uImage
83defaultimage-$(CONFIG_SH_7724_SOLUTION_ENGINE) := uImage 83defaultimage-$(CONFIG_SH_7724_SOLUTION_ENGINE) := uImage
84defaultimage-$(CONFIG_SH_7206_SOLUTION_ENGINE) := vmlinux 84defaultimage-$(CONFIG_SH_7206_SOLUTION_ENGINE) := vmlinux
85defaultimage-$(CONFIG_SH_7619_SOLUTION_ENGINE) := vmlinux 85defaultimage-$(CONFIG_SH_7619_SOLUTION_ENGINE) := vmlinux
86defaultimage-$(CONFIG_SH_SDK7786) := vmlinux.bin
86 87
87# Set some sensible Kbuild defaults 88# Set some sensible Kbuild defaults
88KBUILD_IMAGE := $(defaultimage-y) 89KBUILD_IMAGE := $(defaultimage-y)
@@ -143,11 +144,11 @@ machdir-$(CONFIG_SH_AP325RXA) += mach-ap325rxa
143machdir-$(CONFIG_SH_KFR2R09) += mach-kfr2r09 144machdir-$(CONFIG_SH_KFR2R09) += mach-kfr2r09
144machdir-$(CONFIG_SH_ECOVEC) += mach-ecovec24 145machdir-$(CONFIG_SH_ECOVEC) += mach-ecovec24
145machdir-$(CONFIG_SH_SDK7780) += mach-sdk7780 146machdir-$(CONFIG_SH_SDK7780) += mach-sdk7780
147machdir-$(CONFIG_SH_SDK7786) += mach-sdk7786
146machdir-$(CONFIG_SH_X3PROTO) += mach-x3proto 148machdir-$(CONFIG_SH_X3PROTO) += mach-x3proto
147machdir-$(CONFIG_SH_SH7763RDP) += mach-sh7763rdp 149machdir-$(CONFIG_SH_SH7763RDP) += mach-sh7763rdp
148machdir-$(CONFIG_SH_SH4202_MICRODEV) += mach-microdev 150machdir-$(CONFIG_SH_SH4202_MICRODEV) += mach-microdev
149machdir-$(CONFIG_SH_LANDISK) += mach-landisk 151machdir-$(CONFIG_SH_LANDISK) += mach-landisk
150machdir-$(CONFIG_SH_TITAN) += mach-titan
151machdir-$(CONFIG_SH_LBOX_RE2) += mach-lboxre2 152machdir-$(CONFIG_SH_LBOX_RE2) += mach-lboxre2
152machdir-$(CONFIG_SH_CAYMAN) += mach-cayman 153machdir-$(CONFIG_SH_CAYMAN) += mach-cayman
153machdir-$(CONFIG_SH_RSK) += mach-rsk 154machdir-$(CONFIG_SH_RSK) += mach-rsk
@@ -203,8 +204,9 @@ endif
203libs-$(CONFIG_SUPERH32) := arch/sh/lib/ $(libs-y) 204libs-$(CONFIG_SUPERH32) := arch/sh/lib/ $(libs-y)
204libs-$(CONFIG_SUPERH64) := arch/sh/lib64/ $(libs-y) 205libs-$(CONFIG_SUPERH64) := arch/sh/lib64/ $(libs-y)
205 206
206BOOT_TARGETS = uImage uImage.bz2 uImage.gz uImage.lzma uImage.srec uImage.bin \ 207BOOT_TARGETS = uImage uImage.bz2 uImage.gz uImage.lzma uImage.lzo \
207 zImage vmlinux.srec romImage 208 uImage.srec uImage.bin zImage vmlinux.bin vmlinux.srec \
209 romImage
208PHONY += $(BOOT_TARGETS) 210PHONY += $(BOOT_TARGETS)
209 211
210all: $(KBUILD_IMAGE) 212all: $(KBUILD_IMAGE)
@@ -225,10 +227,12 @@ define archhelp
225 @echo ' zImage - Compressed kernel image' 227 @echo ' zImage - Compressed kernel image'
226 @echo ' romImage - Compressed ROM image, if supported' 228 @echo ' romImage - Compressed ROM image, if supported'
227 @echo ' vmlinux.srec - Create an ELF S-record' 229 @echo ' vmlinux.srec - Create an ELF S-record'
230 @echo ' vmlinux.bin - Create an uncompressed binary image'
228 @echo '* uImage - Alias to bootable U-Boot image' 231 @echo '* uImage - Alias to bootable U-Boot image'
229 @echo ' uImage.srec - Create an S-record for U-Boot' 232 @echo ' uImage.srec - Create an S-record for U-Boot'
230 @echo ' uImage.bin - Kernel-only image for U-Boot (bin)' 233 @echo ' uImage.bin - Kernel-only image for U-Boot (bin)'
231 @echo '* uImage.gz - Kernel-only image for U-Boot (gzip)' 234 @echo '* uImage.gz - Kernel-only image for U-Boot (gzip)'
232 @echo ' uImage.bz2 - Kernel-only image for U-Boot (bzip2)' 235 @echo ' uImage.bz2 - Kernel-only image for U-Boot (bzip2)'
233 @echo ' uImage.lzma - Kernel-only image for U-Boot (lzma)' 236 @echo ' uImage.lzma - Kernel-only image for U-Boot (lzma)'
237 @echo ' uImage.lzo - Kernel-only image for U-Boot (lzo)'
234endef 238endef
diff --git a/arch/sh/boards/Kconfig b/arch/sh/boards/Kconfig
index aedd9deb5de2..938e87d51482 100644
--- a/arch/sh/boards/Kconfig
+++ b/arch/sh/boards/Kconfig
@@ -150,6 +150,14 @@ config SH_SDK7780
150 Select SDK7780 if configuring for a Renesas SH7780 SDK7780R3 150 Select SDK7780 if configuring for a Renesas SH7780 SDK7780R3
151 evaluation board. 151 evaluation board.
152 152
153config SH_SDK7786
154 bool "SDK7786"
155 depends on CPU_SUBTYPE_SH7786
156 select SYS_SUPPORTS_PCI
157 help
158 Select SDK7786 if configuring for a Renesas Technology Europe
159 SH7786-65nm board.
160
153config SH_HIGHLANDER 161config SH_HIGHLANDER
154 bool "Highlander" 162 bool "Highlander"
155 depends on CPU_SUBTYPE_SH7780 || CPU_SUBTYPE_SH7785 163 depends on CPU_SUBTYPE_SH7780 || CPU_SUBTYPE_SH7785
diff --git a/arch/sh/boards/Makefile b/arch/sh/boards/Makefile
index ce0f26381784..4f90f9b7a922 100644
--- a/arch/sh/boards/Makefile
+++ b/arch/sh/boards/Makefile
@@ -8,3 +8,4 @@ obj-$(CONFIG_SH_SHMIN) += board-shmin.o
8obj-$(CONFIG_SH_EDOSK7760) += board-edosk7760.o 8obj-$(CONFIG_SH_EDOSK7760) += board-edosk7760.o
9obj-$(CONFIG_SH_ESPT) += board-espt.o 9obj-$(CONFIG_SH_ESPT) += board-espt.o
10obj-$(CONFIG_SH_POLARIS) += board-polaris.o 10obj-$(CONFIG_SH_POLARIS) += board-polaris.o
11obj-$(CONFIG_SH_TITAN) += board-titan.o
diff --git a/arch/sh/boards/board-magicpanelr2.c b/arch/sh/boards/board-magicpanelr2.c
index 99ffc5f1c0dd..efba450a0518 100644
--- a/arch/sh/boards/board-magicpanelr2.c
+++ b/arch/sh/boards/board-magicpanelr2.c
@@ -23,7 +23,7 @@
23#include <asm/heartbeat.h> 23#include <asm/heartbeat.h>
24#include <cpu/sh7720.h> 24#include <cpu/sh7720.h>
25 25
26#define LAN9115_READY (ctrl_inl(0xA8000084UL) & 0x00000001UL) 26#define LAN9115_READY (__raw_readl(0xA8000084UL) & 0x00000001UL)
27 27
28/* Prefer cmdline over RedBoot */ 28/* Prefer cmdline over RedBoot */
29static const char *probes[] = { "cmdlinepart", "RedBoot", NULL }; 29static const char *probes[] = { "cmdlinepart", "RedBoot", NULL };
@@ -60,33 +60,33 @@ static void __init setup_chip_select(void)
60{ 60{
61 /* CS2: LAN (0x08000000 - 0x0bffffff) */ 61 /* CS2: LAN (0x08000000 - 0x0bffffff) */
62 /* no idle cycles, normal space, 8 bit data bus */ 62 /* no idle cycles, normal space, 8 bit data bus */
63 ctrl_outl(0x36db0400, CS2BCR); 63 __raw_writel(0x36db0400, CS2BCR);
64 /* (SW:1.5 WR:3 HW:1.5), ext. wait */ 64 /* (SW:1.5 WR:3 HW:1.5), ext. wait */
65 ctrl_outl(0x000003c0, CS2WCR); 65 __raw_writel(0x000003c0, CS2WCR);
66 66
67 /* CS4: CAN1 (0xb0000000 - 0xb3ffffff) */ 67 /* CS4: CAN1 (0xb0000000 - 0xb3ffffff) */
68 /* no idle cycles, normal space, 8 bit data bus */ 68 /* no idle cycles, normal space, 8 bit data bus */
69 ctrl_outl(0x00000200, CS4BCR); 69 __raw_writel(0x00000200, CS4BCR);
70 /* (SW:1.5 WR:3 HW:1.5), ext. wait */ 70 /* (SW:1.5 WR:3 HW:1.5), ext. wait */
71 ctrl_outl(0x00100981, CS4WCR); 71 __raw_writel(0x00100981, CS4WCR);
72 72
73 /* CS5a: CAN2 (0xb4000000 - 0xb5ffffff) */ 73 /* CS5a: CAN2 (0xb4000000 - 0xb5ffffff) */
74 /* no idle cycles, normal space, 8 bit data bus */ 74 /* no idle cycles, normal space, 8 bit data bus */
75 ctrl_outl(0x00000200, CS5ABCR); 75 __raw_writel(0x00000200, CS5ABCR);
76 /* (SW:1.5 WR:3 HW:1.5), ext. wait */ 76 /* (SW:1.5 WR:3 HW:1.5), ext. wait */
77 ctrl_outl(0x00100981, CS5AWCR); 77 __raw_writel(0x00100981, CS5AWCR);
78 78
79 /* CS5b: CAN3 (0xb6000000 - 0xb7ffffff) */ 79 /* CS5b: CAN3 (0xb6000000 - 0xb7ffffff) */
80 /* no idle cycles, normal space, 8 bit data bus */ 80 /* no idle cycles, normal space, 8 bit data bus */
81 ctrl_outl(0x00000200, CS5BBCR); 81 __raw_writel(0x00000200, CS5BBCR);
82 /* (SW:1.5 WR:3 HW:1.5), ext. wait */ 82 /* (SW:1.5 WR:3 HW:1.5), ext. wait */
83 ctrl_outl(0x00100981, CS5BWCR); 83 __raw_writel(0x00100981, CS5BWCR);
84 84
85 /* CS6a: Rotary (0xb8000000 - 0xb9ffffff) */ 85 /* CS6a: Rotary (0xb8000000 - 0xb9ffffff) */
86 /* no idle cycles, normal space, 8 bit data bus */ 86 /* no idle cycles, normal space, 8 bit data bus */
87 ctrl_outl(0x00000200, CS6ABCR); 87 __raw_writel(0x00000200, CS6ABCR);
88 /* (SW:1.5 WR:3 HW:1.5), no ext. wait */ 88 /* (SW:1.5 WR:3 HW:1.5), no ext. wait */
89 ctrl_outl(0x001009C1, CS6AWCR); 89 __raw_writel(0x001009C1, CS6AWCR);
90} 90}
91 91
92static void __init setup_port_multiplexing(void) 92static void __init setup_port_multiplexing(void)
@@ -94,71 +94,71 @@ static void __init setup_port_multiplexing(void)
94 /* A7 GPO(LED8); A6 GPO(LED7); A5 GPO(LED6); A4 GPO(LED5); 94 /* A7 GPO(LED8); A6 GPO(LED7); A5 GPO(LED6); A4 GPO(LED5);
95 * A3 GPO(LED4); A2 GPO(LED3); A1 GPO(LED2); A0 GPO(LED1); 95 * A3 GPO(LED4); A2 GPO(LED3); A1 GPO(LED2); A0 GPO(LED1);
96 */ 96 */
97 ctrl_outw(0x5555, PORT_PACR); /* 01 01 01 01 01 01 01 01 */ 97 __raw_writew(0x5555, PORT_PACR); /* 01 01 01 01 01 01 01 01 */
98 98
99 /* B7 GPO(RST4); B6 GPO(RST3); B5 GPO(RST2); B4 GPO(RST1); 99 /* B7 GPO(RST4); B6 GPO(RST3); B5 GPO(RST2); B4 GPO(RST1);
100 * B3 GPO(PB3); B2 GPO(PB2); B1 GPO(PB1); B0 GPO(PB0); 100 * B3 GPO(PB3); B2 GPO(PB2); B1 GPO(PB1); B0 GPO(PB0);
101 */ 101 */
102 ctrl_outw(0x5555, PORT_PBCR); /* 01 01 01 01 01 01 01 01 */ 102 __raw_writew(0x5555, PORT_PBCR); /* 01 01 01 01 01 01 01 01 */
103 103
104 /* C7 GPO(PC7); C6 GPO(PC6); C5 GPO(PC5); C4 GPO(PC4); 104 /* C7 GPO(PC7); C6 GPO(PC6); C5 GPO(PC5); C4 GPO(PC4);
105 * C3 LCD_DATA3; C2 LCD_DATA2; C1 LCD_DATA1; C0 LCD_DATA0; 105 * C3 LCD_DATA3; C2 LCD_DATA2; C1 LCD_DATA1; C0 LCD_DATA0;
106 */ 106 */
107 ctrl_outw(0x5500, PORT_PCCR); /* 01 01 01 01 00 00 00 00 */ 107 __raw_writew(0x5500, PORT_PCCR); /* 01 01 01 01 00 00 00 00 */
108 108
109 /* D7 GPO(PD7); D6 GPO(PD6); D5 GPO(PD5); D4 GPO(PD4); 109 /* D7 GPO(PD7); D6 GPO(PD6); D5 GPO(PD5); D4 GPO(PD4);
110 * D3 GPO(PD3); D2 GPO(PD2); D1 GPO(PD1); D0 GPO(PD0); 110 * D3 GPO(PD3); D2 GPO(PD2); D1 GPO(PD1); D0 GPO(PD0);
111 */ 111 */
112 ctrl_outw(0x5555, PORT_PDCR); /* 01 01 01 01 01 01 01 01 */ 112 __raw_writew(0x5555, PORT_PDCR); /* 01 01 01 01 01 01 01 01 */
113 113
114 /* E7 (x); E6 GPI(nu); E5 GPI(nu); E4 LCD_M_DISP; 114 /* E7 (x); E6 GPI(nu); E5 GPI(nu); E4 LCD_M_DISP;
115 * E3 LCD_CL1; E2 LCD_CL2; E1 LCD_DON; E0 LCD_FLM; 115 * E3 LCD_CL1; E2 LCD_CL2; E1 LCD_DON; E0 LCD_FLM;
116 */ 116 */
117 ctrl_outw(0x3C00, PORT_PECR); /* 00 11 11 00 00 00 00 00 */ 117 __raw_writew(0x3C00, PORT_PECR); /* 00 11 11 00 00 00 00 00 */
118 118
119 /* F7 (x); F6 DA1(VLCD); F5 DA0(nc); F4 AN3; 119 /* F7 (x); F6 DA1(VLCD); F5 DA0(nc); F4 AN3;
120 * F3 AN2(MID_AD); F2 AN1(EARTH_AD); F1 AN0(TEMP); F0 GPI+(nc); 120 * F3 AN2(MID_AD); F2 AN1(EARTH_AD); F1 AN0(TEMP); F0 GPI+(nc);
121 */ 121 */
122 ctrl_outw(0x0002, PORT_PFCR); /* 00 00 00 00 00 00 00 10 */ 122 __raw_writew(0x0002, PORT_PFCR); /* 00 00 00 00 00 00 00 10 */
123 123
124 /* G7 (x); G6 IRQ5(TOUCH_BUSY); G5 IRQ4(TOUCH_IRQ); G4 GPI(KEY2); 124 /* G7 (x); G6 IRQ5(TOUCH_BUSY); G5 IRQ4(TOUCH_IRQ); G4 GPI(KEY2);
125 * G3 GPI(KEY1); G2 GPO(LED11); G1 GPO(LED10); G0 GPO(LED9); 125 * G3 GPI(KEY1); G2 GPO(LED11); G1 GPO(LED10); G0 GPO(LED9);
126 */ 126 */
127 ctrl_outw(0x03D5, PORT_PGCR); /* 00 00 00 11 11 01 01 01 */ 127 __raw_writew(0x03D5, PORT_PGCR); /* 00 00 00 11 11 01 01 01 */
128 128
129 /* H7 (x); H6 /RAS(BRAS); H5 /CAS(BCAS); H4 CKE(BCKE); 129 /* H7 (x); H6 /RAS(BRAS); H5 /CAS(BCAS); H4 CKE(BCKE);
130 * H3 GPO(EARTH_OFF); H2 GPO(EARTH_TEST); H1 USB2_PWR; H0 USB1_PWR; 130 * H3 GPO(EARTH_OFF); H2 GPO(EARTH_TEST); H1 USB2_PWR; H0 USB1_PWR;
131 */ 131 */
132 ctrl_outw(0x0050, PORT_PHCR); /* 00 00 00 00 01 01 00 00 */ 132 __raw_writew(0x0050, PORT_PHCR); /* 00 00 00 00 01 01 00 00 */
133 133
134 /* J7 (x); J6 AUDCK; J5 ASEBRKAK; J4 AUDATA3; 134 /* J7 (x); J6 AUDCK; J5 ASEBRKAK; J4 AUDATA3;
135 * J3 AUDATA2; J2 AUDATA1; J1 AUDATA0; J0 AUDSYNC; 135 * J3 AUDATA2; J2 AUDATA1; J1 AUDATA0; J0 AUDSYNC;
136 */ 136 */
137 ctrl_outw(0x0000, PORT_PJCR); /* 00 00 00 00 00 00 00 00 */ 137 __raw_writew(0x0000, PORT_PJCR); /* 00 00 00 00 00 00 00 00 */
138 138
139 /* K7 (x); K6 (x); K5 (x); K4 (x); 139 /* K7 (x); K6 (x); K5 (x); K4 (x);
140 * K3 PINT7(/PWR2); K2 PINT6(/PWR1); K1 PINT5(nu); K0 PINT4(FLASH_READY) 140 * K3 PINT7(/PWR2); K2 PINT6(/PWR1); K1 PINT5(nu); K0 PINT4(FLASH_READY)
141 */ 141 */
142 ctrl_outw(0x00FF, PORT_PKCR); /* 00 00 00 00 11 11 11 11 */ 142 __raw_writew(0x00FF, PORT_PKCR); /* 00 00 00 00 11 11 11 11 */
143 143
144 /* L7 TRST; L6 TMS; L5 TDO; L4 TDI; 144 /* L7 TRST; L6 TMS; L5 TDO; L4 TDI;
145 * L3 TCK; L2 (x); L1 (x); L0 (x); 145 * L3 TCK; L2 (x); L1 (x); L0 (x);
146 */ 146 */
147 ctrl_outw(0x0000, PORT_PLCR); /* 00 00 00 00 00 00 00 00 */ 147 __raw_writew(0x0000, PORT_PLCR); /* 00 00 00 00 00 00 00 00 */
148 148
149 /* M7 GPO(CURRENT_SINK); M6 GPO(PWR_SWITCH); M5 GPO(LAN_SPEED); 149 /* M7 GPO(CURRENT_SINK); M6 GPO(PWR_SWITCH); M5 GPO(LAN_SPEED);
150 * M4 GPO(LAN_RESET); M3 GPO(BUZZER); M2 GPO(LCD_BL); 150 * M4 GPO(LAN_RESET); M3 GPO(BUZZER); M2 GPO(LCD_BL);
151 * M1 CS5B(CAN3_CS); M0 GPI+(nc); 151 * M1 CS5B(CAN3_CS); M0 GPI+(nc);
152 */ 152 */
153 ctrl_outw(0x5552, PORT_PMCR); /* 01 01 01 01 01 01 00 10 */ 153 __raw_writew(0x5552, PORT_PMCR); /* 01 01 01 01 01 01 00 10 */
154 154
155 /* CURRENT_SINK=off, PWR_SWITCH=off, LAN_SPEED=100MBit, 155 /* CURRENT_SINK=off, PWR_SWITCH=off, LAN_SPEED=100MBit,
156 * LAN_RESET=off, BUZZER=off, LCD_BL=off 156 * LAN_RESET=off, BUZZER=off, LCD_BL=off
157 */ 157 */
158#if CONFIG_SH_MAGIC_PANEL_R2_VERSION == 2 158#if CONFIG_SH_MAGIC_PANEL_R2_VERSION == 2
159 ctrl_outb(0x30, PORT_PMDR); 159 __raw_writeb(0x30, PORT_PMDR);
160#elif CONFIG_SH_MAGIC_PANEL_R2_VERSION == 3 160#elif CONFIG_SH_MAGIC_PANEL_R2_VERSION == 3
161 ctrl_outb(0xF0, PORT_PMDR); 161 __raw_writeb(0xF0, PORT_PMDR);
162#else 162#else
163#error Unknown revision of PLATFORM_MP_R2 163#error Unknown revision of PLATFORM_MP_R2
164#endif 164#endif
@@ -167,8 +167,8 @@ static void __init setup_port_multiplexing(void)
167 * P4 GPO(nu); P3 IRQ3(LAN_IRQ); P2 IRQ2(CAN3_IRQ); 167 * P4 GPO(nu); P3 IRQ3(LAN_IRQ); P2 IRQ2(CAN3_IRQ);
168 * P1 IRQ1(CAN2_IRQ); P0 IRQ0(CAN1_IRQ) 168 * P1 IRQ1(CAN2_IRQ); P0 IRQ0(CAN1_IRQ)
169 */ 169 */
170 ctrl_outw(0x0100, PORT_PPCR); /* 00 00 00 01 00 00 00 00 */ 170 __raw_writew(0x0100, PORT_PPCR); /* 00 00 00 01 00 00 00 00 */
171 ctrl_outb(0x10, PORT_PPDR); 171 __raw_writeb(0x10, PORT_PPDR);
172 172
173 /* R7 A25; R6 A24; R5 A23; R4 A22; 173 /* R7 A25; R6 A24; R5 A23; R4 A22;
174 * R3 A21; R2 A20; R1 A19; R0 A0; 174 * R3 A21; R2 A20; R1 A19; R0 A0;
@@ -185,22 +185,22 @@ static void __init setup_port_multiplexing(void)
185 /* S7 (x); S6 (x); S5 (x); S4 GPO(EEPROM_CS2); 185 /* S7 (x); S6 (x); S5 (x); S4 GPO(EEPROM_CS2);
186 * S3 GPO(EEPROM_CS1); S2 SIOF0_TXD; S1 SIOF0_RXD; S0 SIOF0_SCK; 186 * S3 GPO(EEPROM_CS1); S2 SIOF0_TXD; S1 SIOF0_RXD; S0 SIOF0_SCK;
187 */ 187 */
188 ctrl_outw(0x0140, PORT_PSCR); /* 00 00 00 01 01 00 00 00 */ 188 __raw_writew(0x0140, PORT_PSCR); /* 00 00 00 01 01 00 00 00 */
189 189
190 /* T7 (x); T6 (x); T5 (x); T4 COM1_CTS; 190 /* T7 (x); T6 (x); T5 (x); T4 COM1_CTS;
191 * T3 COM1_RTS; T2 COM1_TXD; T1 COM1_RXD; T0 GPO(WDOG) 191 * T3 COM1_RTS; T2 COM1_TXD; T1 COM1_RXD; T0 GPO(WDOG)
192 */ 192 */
193 ctrl_outw(0x0001, PORT_PTCR); /* 00 00 00 00 00 00 00 01 */ 193 __raw_writew(0x0001, PORT_PTCR); /* 00 00 00 00 00 00 00 01 */
194 194
195 /* U7 (x); U6 (x); U5 (x); U4 GPI+(/AC_FAULT); 195 /* U7 (x); U6 (x); U5 (x); U4 GPI+(/AC_FAULT);
196 * U3 GPO(TOUCH_CS); U2 TOUCH_TXD; U1 TOUCH_RXD; U0 TOUCH_SCK; 196 * U3 GPO(TOUCH_CS); U2 TOUCH_TXD; U1 TOUCH_RXD; U0 TOUCH_SCK;
197 */ 197 */
198 ctrl_outw(0x0240, PORT_PUCR); /* 00 00 00 10 01 00 00 00 */ 198 __raw_writew(0x0240, PORT_PUCR); /* 00 00 00 10 01 00 00 00 */
199 199
200 /* V7 (x); V6 (x); V5 (x); V4 GPO(MID2); 200 /* V7 (x); V6 (x); V5 (x); V4 GPO(MID2);
201 * V3 GPO(MID1); V2 CARD_TxD; V1 CARD_RxD; V0 GPI+(/BAT_FAULT); 201 * V3 GPO(MID1); V2 CARD_TxD; V1 CARD_RxD; V0 GPI+(/BAT_FAULT);
202 */ 202 */
203 ctrl_outw(0x0142, PORT_PVCR); /* 00 00 00 01 01 00 00 10 */ 203 __raw_writew(0x0142, PORT_PVCR); /* 00 00 00 01 01 00 00 10 */
204} 204}
205 205
206static void __init mpr2_setup(char **cmdline_p) 206static void __init mpr2_setup(char **cmdline_p)
@@ -209,24 +209,24 @@ static void __init mpr2_setup(char **cmdline_p)
209 * /PCC_CD1, /PCC_CD2, PCC_BVD1, PCC_BVD2, 209 * /PCC_CD1, /PCC_CD2, PCC_BVD1, PCC_BVD2,
210 * /IOIS16, IRQ4, IRQ5, USB1d_SUSPEND 210 * /IOIS16, IRQ4, IRQ5, USB1d_SUSPEND
211 */ 211 */
212 ctrl_outw(0xAABC, PORT_PSELA); 212 __raw_writew(0xAABC, PORT_PSELA);
213 /* set Pin Select Register B: 213 /* set Pin Select Register B:
214 * /SCIF0_RTS, /SCIF0_CTS, LCD_VCPWC, 214 * /SCIF0_RTS, /SCIF0_CTS, LCD_VCPWC,
215 * LCD_VEPWC, IIC_SDA, IIC_SCL, Reserved 215 * LCD_VEPWC, IIC_SDA, IIC_SCL, Reserved
216 */ 216 */
217 ctrl_outw(0x3C00, PORT_PSELB); 217 __raw_writew(0x3C00, PORT_PSELB);
218 /* set Pin Select Register C: 218 /* set Pin Select Register C:
219 * SIOF1_SCK, SIOF1_RxD, SCIF1_RxD, SCIF1_TxD, Reserved 219 * SIOF1_SCK, SIOF1_RxD, SCIF1_RxD, SCIF1_TxD, Reserved
220 */ 220 */
221 ctrl_outw(0x0000, PORT_PSELC); 221 __raw_writew(0x0000, PORT_PSELC);
222 /* set Pin Select Register D: Reserved, SIOF1_TxD, Reserved, SIOF1_MCLK, 222 /* set Pin Select Register D: Reserved, SIOF1_TxD, Reserved, SIOF1_MCLK,
223 * Reserved, SIOF1_SYNC, Reserved, SCIF1_SCK, Reserved 223 * Reserved, SIOF1_SYNC, Reserved, SCIF1_SCK, Reserved
224 */ 224 */
225 ctrl_outw(0x0000, PORT_PSELD); 225 __raw_writew(0x0000, PORT_PSELD);
226 /* set USB TxRx Control: Reserved, DRV, Reserved, USB_TRANS, USB_SEL */ 226 /* set USB TxRx Control: Reserved, DRV, Reserved, USB_TRANS, USB_SEL */
227 ctrl_outw(0x0101, PORT_UTRCTL); 227 __raw_writew(0x0101, PORT_UTRCTL);
228 /* set USB Clock Control: USSCS, USSTB, Reserved (HighByte always A5) */ 228 /* set USB Clock Control: USSCS, USSTB, Reserved (HighByte always A5) */
229 ctrl_outw(0xA5C0, PORT_UCLKCR_W); 229 __raw_writew(0xA5C0, PORT_UCLKCR_W);
230 230
231 setup_chip_select(); 231 setup_chip_select();
232 232
diff --git a/arch/sh/boards/board-polaris.c b/arch/sh/boards/board-polaris.c
index 62607eb51004..594866356c24 100644
--- a/arch/sh/boards/board-polaris.c
+++ b/arch/sh/boards/board-polaris.c
@@ -59,15 +59,12 @@ static unsigned char heartbeat_bit_pos[] = { 0, 1, 2, 3 };
59static struct heartbeat_data heartbeat_data = { 59static struct heartbeat_data heartbeat_data = {
60 .bit_pos = heartbeat_bit_pos, 60 .bit_pos = heartbeat_bit_pos,
61 .nr_bits = ARRAY_SIZE(heartbeat_bit_pos), 61 .nr_bits = ARRAY_SIZE(heartbeat_bit_pos),
62 .regsize = 8,
63}; 62};
64 63
65static struct resource heartbeat_resources[] = { 64static struct resource heartbeat_resource = {
66 [0] = { 65 .start = PORT_PCDR,
67 .start = PORT_PCDR, 66 .end = PORT_PCDR,
68 .end = PORT_PCDR, 67 .flags = IORESOURCE_MEM | IORESOURCE_MEM_8BIT,
69 .flags = IORESOURCE_MEM,
70 },
71}; 68};
72 69
73static struct platform_device heartbeat_device = { 70static struct platform_device heartbeat_device = {
@@ -76,8 +73,8 @@ static struct platform_device heartbeat_device = {
76 .dev = { 73 .dev = {
77 .platform_data = &heartbeat_data, 74 .platform_data = &heartbeat_data,
78 }, 75 },
79 .num_resources = ARRAY_SIZE(heartbeat_resources), 76 .num_resources = 1,
80 .resource = heartbeat_resources, 77 .resource = &heartbeat_resource,
81}; 78};
82 79
83static struct platform_device *polaris_devices[] __initdata = { 80static struct platform_device *polaris_devices[] __initdata = {
@@ -92,15 +89,15 @@ static int __init polaris_initialise(void)
92 printk(KERN_INFO "Configuring Polaris external bus\n"); 89 printk(KERN_INFO "Configuring Polaris external bus\n");
93 90
94 /* Configure area 5 with 2 wait states */ 91 /* Configure area 5 with 2 wait states */
95 wcr = ctrl_inw(WCR2); 92 wcr = __raw_readw(WCR2);
96 wcr &= (~AREA5_WAIT_CTRL); 93 wcr &= (~AREA5_WAIT_CTRL);
97 wcr |= (WAIT_STATES_10 << 10); 94 wcr |= (WAIT_STATES_10 << 10);
98 ctrl_outw(wcr, WCR2); 95 __raw_writew(wcr, WCR2);
99 96
100 /* Configure area 5 for 32-bit access */ 97 /* Configure area 5 for 32-bit access */
101 bcr_mask = ctrl_inw(BCR2); 98 bcr_mask = __raw_readw(BCR2);
102 bcr_mask |= 1 << 10; 99 bcr_mask |= 1 << 10;
103 ctrl_outw(bcr_mask, BCR2); 100 __raw_writew(bcr_mask, BCR2);
104 101
105 return platform_add_devices(polaris_devices, 102 return platform_add_devices(polaris_devices,
106 ARRAY_SIZE(polaris_devices)); 103 ARRAY_SIZE(polaris_devices));
@@ -131,13 +128,13 @@ static struct ipr_desc ipr_irq_desc = {
131static void __init init_polaris_irq(void) 128static void __init init_polaris_irq(void)
132{ 129{
133 /* Disable all interrupts */ 130 /* Disable all interrupts */
134 ctrl_outw(0, BCR_ILCRA); 131 __raw_writew(0, BCR_ILCRA);
135 ctrl_outw(0, BCR_ILCRB); 132 __raw_writew(0, BCR_ILCRB);
136 ctrl_outw(0, BCR_ILCRC); 133 __raw_writew(0, BCR_ILCRC);
137 ctrl_outw(0, BCR_ILCRD); 134 __raw_writew(0, BCR_ILCRD);
138 ctrl_outw(0, BCR_ILCRE); 135 __raw_writew(0, BCR_ILCRE);
139 ctrl_outw(0, BCR_ILCRF); 136 __raw_writew(0, BCR_ILCRF);
140 ctrl_outw(0, BCR_ILCRG); 137 __raw_writew(0, BCR_ILCRG);
141 138
142 register_ipr_controller(&ipr_irq_desc); 139 register_ipr_controller(&ipr_irq_desc);
143} 140}
diff --git a/arch/sh/boards/board-sh7785lcr.c b/arch/sh/boards/board-sh7785lcr.c
index e5a8a2fde39c..fe7e686c94ac 100644
--- a/arch/sh/boards/board-sh7785lcr.c
+++ b/arch/sh/boards/board-sh7785lcr.c
@@ -21,6 +21,7 @@
21#include <linux/i2c-algo-pca.h> 21#include <linux/i2c-algo-pca.h>
22#include <linux/usb/r8a66597.h> 22#include <linux/usb/r8a66597.h>
23#include <linux/irq.h> 23#include <linux/irq.h>
24#include <linux/io.h>
24#include <linux/clk.h> 25#include <linux/clk.h>
25#include <linux/errno.h> 26#include <linux/errno.h>
26#include <mach/sh7785lcr.h> 27#include <mach/sh7785lcr.h>
@@ -32,26 +33,17 @@
32 * NOTE: This board has 2 physical memory maps. 33 * NOTE: This board has 2 physical memory maps.
33 * Please look at include/asm-sh/sh7785lcr.h or hardware manual. 34 * Please look at include/asm-sh/sh7785lcr.h or hardware manual.
34 */ 35 */
35static struct resource heartbeat_resources[] = { 36static struct resource heartbeat_resource = {
36 [0] = { 37 .start = PLD_LEDCR,
37 .start = PLD_LEDCR, 38 .end = PLD_LEDCR,
38 .end = PLD_LEDCR, 39 .flags = IORESOURCE_MEM | IORESOURCE_MEM_8BIT,
39 .flags = IORESOURCE_MEM,
40 },
41};
42
43static struct heartbeat_data heartbeat_data = {
44 .regsize = 8,
45}; 40};
46 41
47static struct platform_device heartbeat_device = { 42static struct platform_device heartbeat_device = {
48 .name = "heartbeat", 43 .name = "heartbeat",
49 .id = -1, 44 .id = -1,
50 .dev = { 45 .num_resources = 1,
51 .platform_data = &heartbeat_data, 46 .resource = &heartbeat_resource,
52 },
53 .num_resources = ARRAY_SIZE(heartbeat_resources),
54 .resource = heartbeat_resources,
55}; 47};
56 48
57static struct mtd_partition nor_flash_partitions[] = { 49static struct mtd_partition nor_flash_partitions[] = {
@@ -341,8 +333,14 @@ static void __init sh7785lcr_setup(char **cmdline_p)
341 pm_power_off = sh7785lcr_power_off; 333 pm_power_off = sh7785lcr_power_off;
342 334
343 /* sm501 DRAM configuration */ 335 /* sm501 DRAM configuration */
344 sm501_reg = (void __iomem *)0xb3e00000 + SM501_DRAM_CONTROL; 336 sm501_reg = ioremap_nocache(SM107_REG_ADDR, SM501_DRAM_CONTROL);
345 writel(0x000307c2, sm501_reg); 337 if (!sm501_reg) {
338 printk(KERN_ERR "%s: ioremap error.\n", __func__);
339 return;
340 }
341
342 writel(0x000307c2, sm501_reg + SM501_DRAM_CONTROL);
343 iounmap(sm501_reg);
346} 344}
347 345
348/* Return the board specific boot mode pin configuration */ 346/* Return the board specific boot mode pin configuration */
diff --git a/arch/sh/boards/board-shmin.c b/arch/sh/boards/board-shmin.c
index b1dcbbc89188..325bed53b87e 100644
--- a/arch/sh/boards/board-shmin.c
+++ b/arch/sh/boards/board-shmin.c
@@ -17,8 +17,8 @@
17 17
18static void __init init_shmin_irq(void) 18static void __init init_shmin_irq(void)
19{ 19{
20 ctrl_outw(0x2a00, PFC_PHCR); // IRQ0-3=IRQ 20 __raw_writew(0x2a00, PFC_PHCR); // IRQ0-3=IRQ
21 ctrl_outw(0x0aaa, INTC_ICR1); // IRQ0-3=IRQ-mode,Low-active. 21 __raw_writew(0x0aaa, INTC_ICR1); // IRQ0-3=IRQ-mode,Low-active.
22 plat_irq_setup_pins(IRQ_MODE_IRQ); 22 plat_irq_setup_pins(IRQ_MODE_IRQ);
23} 23}
24 24
diff --git a/arch/sh/boards/mach-titan/setup.c b/arch/sh/boards/board-titan.c
index 81e7e0f03863..94c36c7bc0b3 100644
--- a/arch/sh/boards/mach-titan/setup.c
+++ b/arch/sh/boards/board-titan.c
@@ -19,26 +19,6 @@ static void __init init_titan_irq(void)
19} 19}
20 20
21static struct sh_machine_vector mv_titan __initmv = { 21static struct sh_machine_vector mv_titan __initmv = {
22 .mv_name = "Titan", 22 .mv_name = "Titan",
23 23 .mv_init_irq = init_titan_irq,
24 .mv_inb = titan_inb,
25 .mv_inw = titan_inw,
26 .mv_inl = titan_inl,
27 .mv_outb = titan_outb,
28 .mv_outw = titan_outw,
29 .mv_outl = titan_outl,
30
31 .mv_inb_p = titan_inb_p,
32 .mv_inw_p = titan_inw,
33 .mv_inl_p = titan_inl,
34 .mv_outb_p = titan_outb_p,
35 .mv_outw_p = titan_outw,
36 .mv_outl_p = titan_outl,
37
38 .mv_insl = titan_insl,
39 .mv_outsl = titan_outsl,
40
41 .mv_ioport_map = titan_ioport_map,
42
43 .mv_init_irq = init_titan_irq,
44}; 24};
diff --git a/arch/sh/boards/board-urquell.c b/arch/sh/boards/board-urquell.c
index 36b8bac9b124..a9bd6e3ee10b 100644
--- a/arch/sh/boards/board-urquell.c
+++ b/arch/sh/boards/board-urquell.c
@@ -2,7 +2,7 @@
2 * Renesas Technology Corp. SH7786 Urquell Support. 2 * Renesas Technology Corp. SH7786 Urquell Support.
3 * 3 *
4 * Copyright (C) 2008 Kuninori Morimoto <morimoto.kuninori@renesas.com> 4 * Copyright (C) 2008 Kuninori Morimoto <morimoto.kuninori@renesas.com>
5 * Copyright (C) 2009 Paul Mundt 5 * Copyright (C) 2009, 2010 Paul Mundt
6 * 6 *
7 * Based on board-sh7785lcr.c 7 * Based on board-sh7785lcr.c
8 * Copyright (C) 2008 Yoshihiro Shimoda 8 * Copyright (C) 2008 Yoshihiro Shimoda
@@ -19,6 +19,7 @@
19#include <linux/delay.h> 19#include <linux/delay.h>
20#include <linux/gpio.h> 20#include <linux/gpio.h>
21#include <linux/irq.h> 21#include <linux/irq.h>
22#include <linux/clk.h>
22#include <mach/urquell.h> 23#include <mach/urquell.h>
23#include <cpu/sh7786.h> 24#include <cpu/sh7786.h>
24#include <asm/heartbeat.h> 25#include <asm/heartbeat.h>
@@ -50,26 +51,17 @@
50 */ 51 */
51 52
52/* HeartBeat */ 53/* HeartBeat */
53static struct resource heartbeat_resources[] = { 54static struct resource heartbeat_resource = {
54 [0] = { 55 .start = BOARDREG(SLEDR),
55 .start = BOARDREG(SLEDR), 56 .end = BOARDREG(SLEDR),
56 .end = BOARDREG(SLEDR), 57 .flags = IORESOURCE_MEM | IORESOURCE_MEM_16BIT,
57 .flags = IORESOURCE_MEM,
58 },
59};
60
61static struct heartbeat_data heartbeat_data = {
62 .regsize = 16,
63}; 58};
64 59
65static struct platform_device heartbeat_device = { 60static struct platform_device heartbeat_device = {
66 .name = "heartbeat", 61 .name = "heartbeat",
67 .id = -1, 62 .id = -1,
68 .dev = { 63 .num_resources = 1,
69 .platform_data = &heartbeat_data, 64 .resource = &heartbeat_resource,
70 },
71 .num_resources = ARRAY_SIZE(heartbeat_resources),
72 .resource = heartbeat_resources,
73}; 65};
74 66
75/* LAN91C111 */ 67/* LAN91C111 */
@@ -184,6 +176,27 @@ static int urquell_mode_pins(void)
184 return __raw_readw(UBOARDREG(MDSWMR)); 176 return __raw_readw(UBOARDREG(MDSWMR));
185} 177}
186 178
179static int urquell_clk_init(void)
180{
181 struct clk *clk;
182 int ret;
183
184 /*
185 * Only handle the EXTAL case, anyone interfacing a crystal
186 * resonator will need to provide their own input clock.
187 */
188 if (test_mode_pin(MODE_PIN9))
189 return -EINVAL;
190
191 clk = clk_get(NULL, "extal");
192 if (!clk || IS_ERR(clk))
193 return PTR_ERR(clk);
194 ret = clk_set_rate(clk, 33333333);
195 clk_put(clk);
196
197 return ret;
198}
199
187/* Initialize the board */ 200/* Initialize the board */
188static void __init urquell_setup(char **cmdline_p) 201static void __init urquell_setup(char **cmdline_p)
189{ 202{
@@ -200,4 +213,5 @@ static struct sh_machine_vector mv_urquell __initmv = {
200 .mv_setup = urquell_setup, 213 .mv_setup = urquell_setup,
201 .mv_init_irq = urquell_init_irq, 214 .mv_init_irq = urquell_init_irq,
202 .mv_mode_pins = urquell_mode_pins, 215 .mv_mode_pins = urquell_mode_pins,
216 .mv_clk_init = urquell_clk_init,
203}; 217};
diff --git a/arch/sh/boards/mach-ap325rxa/setup.c b/arch/sh/boards/mach-ap325rxa/setup.c
index 1f5fa5c44f6d..57e37e284208 100644
--- a/arch/sh/boards/mach-ap325rxa/setup.c
+++ b/arch/sh/boards/mach-ap325rxa/setup.c
@@ -159,21 +159,21 @@ static void ap320_wvga_power_on(void *board_data)
159 msleep(100); 159 msleep(100);
160 160
161 /* ASD AP-320/325 LCD ON */ 161 /* ASD AP-320/325 LCD ON */
162 ctrl_outw(FPGA_LCDREG_VAL, FPGA_LCDREG); 162 __raw_writew(FPGA_LCDREG_VAL, FPGA_LCDREG);
163 163
164 /* backlight */ 164 /* backlight */
165 gpio_set_value(GPIO_PTS3, 0); 165 gpio_set_value(GPIO_PTS3, 0);
166 ctrl_outw(0x100, FPGA_BKLREG); 166 __raw_writew(0x100, FPGA_BKLREG);
167} 167}
168 168
169static void ap320_wvga_power_off(void *board_data) 169static void ap320_wvga_power_off(void *board_data)
170{ 170{
171 /* backlight */ 171 /* backlight */
172 ctrl_outw(0, FPGA_BKLREG); 172 __raw_writew(0, FPGA_BKLREG);
173 gpio_set_value(GPIO_PTS3, 1); 173 gpio_set_value(GPIO_PTS3, 1);
174 174
175 /* ASD AP-320/325 LCD OFF */ 175 /* ASD AP-320/325 LCD OFF */
176 ctrl_outw(0, FPGA_LCDREG); 176 __raw_writew(0, FPGA_LCDREG);
177} 177}
178 178
179static struct sh_mobile_lcdc_info lcdc_info = { 179static struct sh_mobile_lcdc_info lcdc_info = {
@@ -420,7 +420,7 @@ static struct resource sdhi0_cn3_resources[] = {
420 .flags = IORESOURCE_MEM, 420 .flags = IORESOURCE_MEM,
421 }, 421 },
422 [1] = { 422 [1] = {
423 .start = 101, 423 .start = 100,
424 .flags = IORESOURCE_IRQ, 424 .flags = IORESOURCE_IRQ,
425 }, 425 },
426}; 426};
@@ -443,7 +443,7 @@ static struct resource sdhi1_cn7_resources[] = {
443 .flags = IORESOURCE_MEM, 443 .flags = IORESOURCE_MEM,
444 }, 444 },
445 [1] = { 445 [1] = {
446 .start = 24, 446 .start = 23,
447 .flags = IORESOURCE_IRQ, 447 .flags = IORESOURCE_IRQ,
448 }, 448 },
449}; 449};
@@ -471,8 +471,8 @@ static struct i2c_board_info ap325rxa_i2c_camera[] = {
471}; 471};
472 472
473static struct ov772x_camera_info ov7725_info = { 473static struct ov772x_camera_info ov7725_info = {
474 .buswidth = SOCAM_DATAWIDTH_8, 474 .flags = OV772X_FLAG_VFLIP | OV772X_FLAG_HFLIP | \
475 .flags = OV772X_FLAG_VFLIP | OV772X_FLAG_HFLIP, 475 OV772X_FLAG_8BIT,
476 .edgectrl = OV772X_AUTO_EDGECTRL(0xf, 0), 476 .edgectrl = OV772X_AUTO_EDGECTRL(0xf, 0),
477}; 477};
478 478
@@ -595,7 +595,7 @@ static int __init ap325rxa_devices_setup(void)
595 gpio_request(GPIO_PTZ4, NULL); 595 gpio_request(GPIO_PTZ4, NULL);
596 gpio_direction_output(GPIO_PTZ4, 0); /* SADDR */ 596 gpio_direction_output(GPIO_PTZ4, 0); /* SADDR */
597 597
598 ctrl_outw(ctrl_inw(PORT_MSELCRB) & ~0x0001, PORT_MSELCRB); 598 __raw_writew(__raw_readw(PORT_MSELCRB) & ~0x0001, PORT_MSELCRB);
599 599
600 /* FLCTL */ 600 /* FLCTL */
601 gpio_request(GPIO_FN_FCE, NULL); 601 gpio_request(GPIO_FN_FCE, NULL);
@@ -613,9 +613,9 @@ static int __init ap325rxa_devices_setup(void)
613 gpio_request(GPIO_FN_FWE, NULL); 613 gpio_request(GPIO_FN_FWE, NULL);
614 gpio_request(GPIO_FN_FRB, NULL); 614 gpio_request(GPIO_FN_FRB, NULL);
615 615
616 ctrl_outw(0, PORT_HIZCRC); 616 __raw_writew(0, PORT_HIZCRC);
617 ctrl_outw(0xFFFF, PORT_DRVCRA); 617 __raw_writew(0xFFFF, PORT_DRVCRA);
618 ctrl_outw(0xFFFF, PORT_DRVCRB); 618 __raw_writew(0xFFFF, PORT_DRVCRB);
619 619
620 platform_resource_setup_memory(&ceu_device, "ceu", 4 << 20); 620 platform_resource_setup_memory(&ceu_device, "ceu", 4 << 20);
621 621
diff --git a/arch/sh/boards/mach-cayman/irq.c b/arch/sh/boards/mach-cayman/irq.c
index 33f770856319..1394b078db36 100644
--- a/arch/sh/boards/mach-cayman/irq.c
+++ b/arch/sh/boards/mach-cayman/irq.c
@@ -66,9 +66,9 @@ static void enable_cayman_irq(unsigned int irq)
66 reg = EPLD_MASK_BASE + ((irq / 8) << 2); 66 reg = EPLD_MASK_BASE + ((irq / 8) << 2);
67 bit = 1<<(irq % 8); 67 bit = 1<<(irq % 8);
68 local_irq_save(flags); 68 local_irq_save(flags);
69 mask = ctrl_inl(reg); 69 mask = __raw_readl(reg);
70 mask |= bit; 70 mask |= bit;
71 ctrl_outl(mask, reg); 71 __raw_writel(mask, reg);
72 local_irq_restore(flags); 72 local_irq_restore(flags);
73} 73}
74 74
@@ -83,9 +83,9 @@ void disable_cayman_irq(unsigned int irq)
83 reg = EPLD_MASK_BASE + ((irq / 8) << 2); 83 reg = EPLD_MASK_BASE + ((irq / 8) << 2);
84 bit = 1<<(irq % 8); 84 bit = 1<<(irq % 8);
85 local_irq_save(flags); 85 local_irq_save(flags);
86 mask = ctrl_inl(reg); 86 mask = __raw_readl(reg);
87 mask &= ~bit; 87 mask &= ~bit;
88 ctrl_outl(mask, reg); 88 __raw_writel(mask, reg);
89 local_irq_restore(flags); 89 local_irq_restore(flags);
90} 90}
91 91
@@ -109,8 +109,8 @@ int cayman_irq_demux(int evt)
109 unsigned long status; 109 unsigned long status;
110 int i; 110 int i;
111 111
112 status = ctrl_inl(EPLD_STATUS_BASE) & 112 status = __raw_readl(EPLD_STATUS_BASE) &
113 ctrl_inl(EPLD_MASK_BASE) & 0xff; 113 __raw_readl(EPLD_MASK_BASE) & 0xff;
114 if (status == 0) { 114 if (status == 0) {
115 irq = -1; 115 irq = -1;
116 } else { 116 } else {
@@ -126,8 +126,8 @@ int cayman_irq_demux(int evt)
126 unsigned long status; 126 unsigned long status;
127 int i; 127 int i;
128 128
129 status = ctrl_inl(EPLD_STATUS_BASE + 3 * sizeof(u32)) & 129 status = __raw_readl(EPLD_STATUS_BASE + 3 * sizeof(u32)) &
130 ctrl_inl(EPLD_MASK_BASE + 3 * sizeof(u32)) & 0xff; 130 __raw_readl(EPLD_MASK_BASE + 3 * sizeof(u32)) & 0xff;
131 if (status == 0) { 131 if (status == 0) {
132 irq = -1; 132 irq = -1;
133 } else { 133 } else {
diff --git a/arch/sh/boards/mach-dreamcast/irq.c b/arch/sh/boards/mach-dreamcast/irq.c
index f55fc8e795e9..d932667410ab 100644
--- a/arch/sh/boards/mach-dreamcast/irq.c
+++ b/arch/sh/boards/mach-dreamcast/irq.c
@@ -135,3 +135,30 @@ int systemasic_irq_demux(int irq)
135 /* Not reached */ 135 /* Not reached */
136 return irq; 136 return irq;
137} 137}
138
139void systemasic_irq_init(void)
140{
141 int i, nid = cpu_to_node(boot_cpu_data);
142
143 /* Assign all virtual IRQs to the System ASIC int. handler */
144 for (i = HW_EVENT_IRQ_BASE; i < HW_EVENT_IRQ_MAX; i++) {
145 unsigned int irq;
146
147 irq = create_irq_nr(i, nid);
148 if (unlikely(irq == 0)) {
149 pr_err("%s: failed hooking irq %d for systemasic\n",
150 __func__, i);
151 return;
152 }
153
154 if (unlikely(irq != i)) {
155 pr_err("%s: got irq %d but wanted %d, bailing.\n",
156 __func__, irq, i);
157 destroy_irq(irq);
158 return;
159 }
160
161 set_irq_chip_and_handler(i, &systemasic_int,
162 handle_level_irq);
163 }
164}
diff --git a/arch/sh/boards/mach-dreamcast/rtc.c b/arch/sh/boards/mach-dreamcast/rtc.c
index a7433685798d..061d65714fcc 100644
--- a/arch/sh/boards/mach-dreamcast/rtc.c
+++ b/arch/sh/boards/mach-dreamcast/rtc.c
@@ -35,11 +35,11 @@ static void aica_rtc_gettimeofday(struct timespec *ts)
35 unsigned long val1, val2; 35 unsigned long val1, val2;
36 36
37 do { 37 do {
38 val1 = ((ctrl_inl(AICA_RTC_SECS_H) & 0xffff) << 16) | 38 val1 = ((__raw_readl(AICA_RTC_SECS_H) & 0xffff) << 16) |
39 (ctrl_inl(AICA_RTC_SECS_L) & 0xffff); 39 (__raw_readl(AICA_RTC_SECS_L) & 0xffff);
40 40
41 val2 = ((ctrl_inl(AICA_RTC_SECS_H) & 0xffff) << 16) | 41 val2 = ((__raw_readl(AICA_RTC_SECS_H) & 0xffff) << 16) |
42 (ctrl_inl(AICA_RTC_SECS_L) & 0xffff); 42 (__raw_readl(AICA_RTC_SECS_L) & 0xffff);
43 } while (val1 != val2); 43 } while (val1 != val2);
44 44
45 ts->tv_sec = val1 - TWENTY_YEARS; 45 ts->tv_sec = val1 - TWENTY_YEARS;
@@ -60,14 +60,14 @@ static int aica_rtc_settimeofday(const time_t secs)
60 unsigned long adj = secs + TWENTY_YEARS; 60 unsigned long adj = secs + TWENTY_YEARS;
61 61
62 do { 62 do {
63 ctrl_outl((adj & 0xffff0000) >> 16, AICA_RTC_SECS_H); 63 __raw_writel((adj & 0xffff0000) >> 16, AICA_RTC_SECS_H);
64 ctrl_outl((adj & 0xffff), AICA_RTC_SECS_L); 64 __raw_writel((adj & 0xffff), AICA_RTC_SECS_L);
65 65
66 val1 = ((ctrl_inl(AICA_RTC_SECS_H) & 0xffff) << 16) | 66 val1 = ((__raw_readl(AICA_RTC_SECS_H) & 0xffff) << 16) |
67 (ctrl_inl(AICA_RTC_SECS_L) & 0xffff); 67 (__raw_readl(AICA_RTC_SECS_L) & 0xffff);
68 68
69 val2 = ((ctrl_inl(AICA_RTC_SECS_H) & 0xffff) << 16) | 69 val2 = ((__raw_readl(AICA_RTC_SECS_H) & 0xffff) << 16) |
70 (ctrl_inl(AICA_RTC_SECS_L) & 0xffff); 70 (__raw_readl(AICA_RTC_SECS_L) & 0xffff);
71 } while (val1 != val2); 71 } while (val1 != val2);
72 72
73 return 0; 73 return 0;
diff --git a/arch/sh/boards/mach-dreamcast/setup.c b/arch/sh/boards/mach-dreamcast/setup.c
index a4b7402d6176..ad1a4db72e04 100644
--- a/arch/sh/boards/mach-dreamcast/setup.c
+++ b/arch/sh/boards/mach-dreamcast/setup.c
@@ -28,25 +28,8 @@
28#include <asm/machvec.h> 28#include <asm/machvec.h>
29#include <mach/sysasic.h> 29#include <mach/sysasic.h>
30 30
31extern struct irq_chip systemasic_int;
32extern void aica_time_init(void);
33extern int systemasic_irq_demux(int);
34
35static void __init dreamcast_setup(char **cmdline_p) 31static void __init dreamcast_setup(char **cmdline_p)
36{ 32{
37 int i;
38
39 /* Mask all hardware events */
40 /* XXX */
41
42 /* Acknowledge any previous events */
43 /* XXX */
44
45 /* Assign all virtual IRQs to the System ASIC int. handler */
46 for (i = HW_EVENT_IRQ_BASE; i < HW_EVENT_IRQ_MAX; i++)
47 set_irq_chip_and_handler(i, &systemasic_int,
48 handle_level_irq);
49
50 board_time_init = aica_time_init; 33 board_time_init = aica_time_init;
51} 34}
52 35
@@ -54,4 +37,5 @@ static struct sh_machine_vector mv_dreamcast __initmv = {
54 .mv_name = "Sega Dreamcast", 37 .mv_name = "Sega Dreamcast",
55 .mv_setup = dreamcast_setup, 38 .mv_setup = dreamcast_setup,
56 .mv_irq_demux = systemasic_irq_demux, 39 .mv_irq_demux = systemasic_irq_demux,
40 .mv_init_irq = systemasic_irq_init,
57}; 41};
diff --git a/arch/sh/boards/mach-ecovec24/sdram.S b/arch/sh/boards/mach-ecovec24/sdram.S
index 833440044407..3963c6f23d52 100644
--- a/arch/sh/boards/mach-ecovec24/sdram.S
+++ b/arch/sh/boards/mach-ecovec24/sdram.S
@@ -37,6 +37,10 @@ ENTRY(ecovec24_sdram_enter_end)
37 .balign 4 37 .balign 4
38ENTRY(ecovec24_sdram_leave_start) 38ENTRY(ecovec24_sdram_leave_start)
39 39
40 mov.l @(SH_SLEEP_MODE, r5), r0
41 tst #SUSP_SH_RSTANDBY, r0
42 bf resume_rstandby
43
40 /* DBSC: put memory in auto-refresh mode */ 44 /* DBSC: put memory in auto-refresh mode */
41 45
42 ED 0xFD000040, 0x00000000 /* DBRFPDN0 */ 46 ED 0xFD000040, 0x00000000 /* DBRFPDN0 */
@@ -49,4 +53,59 @@ ENTRY(ecovec24_sdram_leave_start)
49 rts 53 rts
50 nop 54 nop
51 55
56resume_rstandby:
57
58 /* DBSC: re-initialize and put in auto-refresh */
59
60 ED 0xFD000108, 0x00000181 /* DBPDCNT0 */
61 ED 0xFD000020, 0x015B0002 /* DBCONF */
62 ED 0xFD000030, 0x03071502 /* DBTR0 */
63 ED 0xFD000034, 0x02020102 /* DBTR1 */
64 ED 0xFD000038, 0x01090405 /* DBTR2 */
65 ED 0xFD00003C, 0x00000002 /* DBTR3 */
66 ED 0xFD000008, 0x00000005 /* DBKIND */
67 ED 0xFD000040, 0x00000001 /* DBRFPDN0 */
68 ED 0xFD000040, 0x00000000 /* DBRFPDN0 */
69 ED 0xFD000018, 0x00000001 /* DBCKECNT */
70
71 mov #100,r0
72WAIT_400NS:
73 dt r0
74 bf WAIT_400NS
75
76 ED 0xFD000014, 0x00000002 /* DBCMDCNT (PALL) */
77 ED 0xFD000060, 0x00020000 /* DBMRCNT (EMR2) */
78 ED 0xFD000060, 0x00030000 /* DBMRCNT (EMR3) */
79 ED 0xFD000060, 0x00010004 /* DBMRCNT (EMR) */
80 ED 0xFD000060, 0x00000532 /* DBMRCNT (MRS) */
81 ED 0xFD000014, 0x00000002 /* DBCMDCNT (PALL) */
82 ED 0xFD000014, 0x00000004 /* DBCMDCNT (REF) */
83 ED 0xFD000014, 0x00000004 /* DBCMDCNT (REF) */
84 ED 0xFD000060, 0x00000432 /* DBMRCNT (MRS) */
85 ED 0xFD000060, 0x000103c0 /* DBMRCNT (EMR) */
86 ED 0xFD000060, 0x00010040 /* DBMRCNT (EMR) */
87
88 mov #100,r0
89WAIT_400NS_2:
90 dt r0
91 bf WAIT_400NS_2
92
93 ED 0xFD000010, 0x00000001 /* DBEN */
94 ED 0xFD000044, 0x0000050f /* DBRFPDN1 */
95 ED 0xFD000048, 0x236800e6 /* DBRFPDN2 */
96
97 mov.l DUMMY,r0
98 mov.l @r0, r1 /* force single dummy read */
99
100 ED 0xFD000014, 0x00000002 /* DBCMDCNT (PALL) */
101 ED 0xFD000014, 0x00000004 /* DBCMDCNT (REF) */
102 ED 0xFD000108, 0x00000080 /* DBPDCNT0 */
103 ED 0xFD000040, 0x00010000 /* DBRFPDN0 */
104
105 rts
106 nop
107
108 .balign 4
109DUMMY: .long 0xac400000
110
52ENTRY(ecovec24_sdram_leave_end) 111ENTRY(ecovec24_sdram_leave_end)
diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c
index 5c246289b4f0..39ed8722d11a 100644
--- a/arch/sh/boards/mach-ecovec24/setup.c
+++ b/arch/sh/boards/mach-ecovec24/setup.c
@@ -64,18 +64,16 @@
64 64
65/* Heartbeat */ 65/* Heartbeat */
66static unsigned char led_pos[] = { 0, 1, 2, 3 }; 66static unsigned char led_pos[] = { 0, 1, 2, 3 };
67
67static struct heartbeat_data heartbeat_data = { 68static struct heartbeat_data heartbeat_data = {
68 .regsize = 8,
69 .nr_bits = 4, 69 .nr_bits = 4,
70 .bit_pos = led_pos, 70 .bit_pos = led_pos,
71}; 71};
72 72
73static struct resource heartbeat_resources[] = { 73static struct resource heartbeat_resource = {
74 [0] = { 74 .start = 0xA405012C, /* PTG */
75 .start = 0xA405012C, /* PTG */ 75 .end = 0xA405012E - 1,
76 .end = 0xA405012E - 1, 76 .flags = IORESOURCE_MEM | IORESOURCE_MEM_8BIT,
77 .flags = IORESOURCE_MEM,
78 },
79}; 77};
80 78
81static struct platform_device heartbeat_device = { 79static struct platform_device heartbeat_device = {
@@ -84,8 +82,8 @@ static struct platform_device heartbeat_device = {
84 .dev = { 82 .dev = {
85 .platform_data = &heartbeat_data, 83 .platform_data = &heartbeat_data,
86 }, 84 },
87 .num_resources = ARRAY_SIZE(heartbeat_resources), 85 .num_resources = 1,
88 .resource = heartbeat_resources, 86 .resource = &heartbeat_resource,
89}; 87};
90 88
91/* MTD */ 89/* MTD */
@@ -455,7 +453,7 @@ static struct resource sdhi0_resources[] = {
455 .flags = IORESOURCE_MEM, 453 .flags = IORESOURCE_MEM,
456 }, 454 },
457 [1] = { 455 [1] = {
458 .start = 101, 456 .start = 100,
459 .flags = IORESOURCE_IRQ, 457 .flags = IORESOURCE_IRQ,
460 }, 458 },
461}; 459};
@@ -491,7 +489,7 @@ static struct resource sdhi1_resources[] = {
491 .flags = IORESOURCE_MEM, 489 .flags = IORESOURCE_MEM,
492 }, 490 },
493 [1] = { 491 [1] = {
494 .start = 24, 492 .start = 23,
495 .flags = IORESOURCE_IRQ, 493 .flags = IORESOURCE_IRQ,
496 }, 494 },
497}; 495};
@@ -698,13 +696,13 @@ static struct platform_device camera_devices[] = {
698#define FCLKBCR 0xa415000c 696#define FCLKBCR 0xa415000c
699static void fsimck_init(struct clk *clk) 697static void fsimck_init(struct clk *clk)
700{ 698{
701 u32 status = ctrl_inl(clk->enable_reg); 699 u32 status = __raw_readl(clk->enable_reg);
702 700
703 /* use external clock */ 701 /* use external clock */
704 status &= ~0x000000ff; 702 status &= ~0x000000ff;
705 status |= 0x00000080; 703 status |= 0x00000080;
706 704
707 ctrl_outl(status, clk->enable_reg); 705 __raw_writel(status, clk->enable_reg);
708} 706}
709 707
710static struct clk_ops fsimck_clk_ops = { 708static struct clk_ops fsimck_clk_ops = {
@@ -753,6 +751,26 @@ static struct platform_device fsi_device = {
753 }, 751 },
754}; 752};
755 753
754/* IrDA */
755static struct resource irda_resources[] = {
756 [0] = {
757 .name = "IrDA",
758 .start = 0xA45D0000,
759 .end = 0xA45D0049,
760 .flags = IORESOURCE_MEM,
761 },
762 [1] = {
763 .start = 20,
764 .flags = IORESOURCE_IRQ,
765 },
766};
767
768static struct platform_device irda_device = {
769 .name = "sh_sir",
770 .num_resources = ARRAY_SIZE(irda_resources),
771 .resource = irda_resources,
772};
773
756static struct platform_device *ecovec_devices[] __initdata = { 774static struct platform_device *ecovec_devices[] __initdata = {
757 &heartbeat_device, 775 &heartbeat_device,
758 &nor_flash_device, 776 &nor_flash_device,
@@ -773,8 +791,10 @@ static struct platform_device *ecovec_devices[] __initdata = {
773 &camera_devices[1], 791 &camera_devices[1],
774 &camera_devices[2], 792 &camera_devices[2],
775 &fsi_device, 793 &fsi_device,
794 &irda_device,
776}; 795};
777 796
797#ifdef CONFIG_I2C
778#define EEPROM_ADDR 0x50 798#define EEPROM_ADDR 0x50
779static u8 mac_read(struct i2c_adapter *a, u8 command) 799static u8 mac_read(struct i2c_adapter *a, u8 command)
780{ 800{
@@ -817,6 +837,12 @@ static void __init sh_eth_init(struct sh_eth_plat_data *pd)
817 msleep(10); 837 msleep(10);
818 } 838 }
819} 839}
840#else
841static void __init sh_eth_init(struct sh_eth_plat_data *pd)
842{
843 pr_err("unable to read sh_eth MAC address\n");
844}
845#endif
820 846
821#define PORT_HIZA 0xA4050158 847#define PORT_HIZA 0xA4050158
822#define IODRIVEA 0xA405018A 848#define IODRIVEA 0xA405018A
@@ -831,7 +857,8 @@ static int __init arch_setup(void)
831 struct clk *clk; 857 struct clk *clk;
832 858
833 /* register board specific self-refresh code */ 859 /* register board specific self-refresh code */
834 sh_mobile_register_self_refresh(SUSP_SH_STANDBY | SUSP_SH_SF, 860 sh_mobile_register_self_refresh(SUSP_SH_STANDBY | SUSP_SH_SF |
861 SUSP_SH_RSTANDBY,
835 &ecovec24_sdram_enter_start, 862 &ecovec24_sdram_enter_start,
836 &ecovec24_sdram_enter_end, 863 &ecovec24_sdram_enter_end,
837 &ecovec24_sdram_leave_start, 864 &ecovec24_sdram_leave_start,
@@ -855,7 +882,7 @@ static int __init arch_setup(void)
855 gpio_direction_output(GPIO_PTG1, 0); 882 gpio_direction_output(GPIO_PTG1, 0);
856 gpio_direction_output(GPIO_PTG2, 0); 883 gpio_direction_output(GPIO_PTG2, 0);
857 gpio_direction_output(GPIO_PTG3, 0); 884 gpio_direction_output(GPIO_PTG3, 0);
858 ctrl_outw((ctrl_inw(PORT_HIZA) & ~(0x1 << 1)) , PORT_HIZA); 885 __raw_writew((__raw_readw(PORT_HIZA) & ~(0x1 << 1)) , PORT_HIZA);
859 886
860 /* enable SH-Eth */ 887 /* enable SH-Eth */
861 gpio_request(GPIO_PTA1, NULL); 888 gpio_request(GPIO_PTA1, NULL);
@@ -875,16 +902,16 @@ static int __init arch_setup(void)
875 gpio_request(GPIO_FN_LNKSTA, NULL); 902 gpio_request(GPIO_FN_LNKSTA, NULL);
876 903
877 /* enable USB */ 904 /* enable USB */
878 ctrl_outw(0x0000, 0xA4D80000); 905 __raw_writew(0x0000, 0xA4D80000);
879 ctrl_outw(0x0000, 0xA4D90000); 906 __raw_writew(0x0000, 0xA4D90000);
880 gpio_request(GPIO_PTB3, NULL); 907 gpio_request(GPIO_PTB3, NULL);
881 gpio_request(GPIO_PTB4, NULL); 908 gpio_request(GPIO_PTB4, NULL);
882 gpio_request(GPIO_PTB5, NULL); 909 gpio_request(GPIO_PTB5, NULL);
883 gpio_direction_input(GPIO_PTB3); 910 gpio_direction_input(GPIO_PTB3);
884 gpio_direction_output(GPIO_PTB4, 0); 911 gpio_direction_output(GPIO_PTB4, 0);
885 gpio_direction_output(GPIO_PTB5, 0); 912 gpio_direction_output(GPIO_PTB5, 0);
886 ctrl_outw(0x0600, 0xa40501d4); 913 __raw_writew(0x0600, 0xa40501d4);
887 ctrl_outw(0x0600, 0xa4050192); 914 __raw_writew(0x0600, 0xa4050192);
888 915
889 if (gpio_get_value(GPIO_PTB3)) { 916 if (gpio_get_value(GPIO_PTB3)) {
890 printk(KERN_INFO "USB1 function is selected\n"); 917 printk(KERN_INFO "USB1 function is selected\n");
@@ -925,7 +952,7 @@ static int __init arch_setup(void)
925 gpio_request(GPIO_FN_LCDVSYN, NULL); 952 gpio_request(GPIO_FN_LCDVSYN, NULL);
926 gpio_request(GPIO_FN_LCDDON, NULL); 953 gpio_request(GPIO_FN_LCDDON, NULL);
927 gpio_request(GPIO_FN_LCDLCLK, NULL); 954 gpio_request(GPIO_FN_LCDLCLK, NULL);
928 ctrl_outw((ctrl_inw(PORT_HIZA) & ~0x0001), PORT_HIZA); 955 __raw_writew((__raw_readw(PORT_HIZA) & ~0x0001), PORT_HIZA);
929 956
930 gpio_request(GPIO_PTE6, NULL); 957 gpio_request(GPIO_PTE6, NULL);
931 gpio_request(GPIO_PTU1, NULL); 958 gpio_request(GPIO_PTU1, NULL);
@@ -937,7 +964,7 @@ static int __init arch_setup(void)
937 gpio_direction_output(GPIO_PTA2, 0); 964 gpio_direction_output(GPIO_PTA2, 0);
938 965
939 /* I/O buffer drive ability is high */ 966 /* I/O buffer drive ability is high */
940 ctrl_outw((ctrl_inw(IODRIVEA) & ~0x00c0) | 0x0080 , IODRIVEA); 967 __raw_writew((__raw_readw(IODRIVEA) & ~0x00c0) | 0x0080 , IODRIVEA);
941 968
942 if (gpio_get_value(GPIO_PTE6)) { 969 if (gpio_get_value(GPIO_PTE6)) {
943 /* DVI */ 970 /* DVI */
@@ -1069,7 +1096,7 @@ static int __init arch_setup(void)
1069 gpio_direction_output(GPIO_PTB7, 0); 1096 gpio_direction_output(GPIO_PTB7, 0);
1070 1097
1071 /* I/O buffer drive ability is high for SDHI1 */ 1098 /* I/O buffer drive ability is high for SDHI1 */
1072 ctrl_outw((ctrl_inw(IODRIVEA) & ~0x3000) | 0x2000 , IODRIVEA); 1099 __raw_writew((__raw_readw(IODRIVEA) & ~0x3000) | 0x2000 , IODRIVEA);
1073#else 1100#else
1074 /* enable MSIOF0 on CN11 (needs DS2.4 set to OFF) */ 1101 /* enable MSIOF0 on CN11 (needs DS2.4 set to OFF) */
1075 gpio_request(GPIO_FN_MSIOF0_TXD, NULL); 1102 gpio_request(GPIO_FN_MSIOF0_TXD, NULL);
@@ -1107,6 +1134,11 @@ static int __init arch_setup(void)
1107 gpio_request(GPIO_FN_FSIOBLRCK, NULL); 1134 gpio_request(GPIO_FN_FSIOBLRCK, NULL);
1108 gpio_request(GPIO_FN_CLKAUDIOBO, NULL); 1135 gpio_request(GPIO_FN_CLKAUDIOBO, NULL);
1109 1136
1137 /* set SPU2 clock to 83.4 MHz */
1138 clk = clk_get(NULL, "spu_clk");
1139 clk_set_rate(clk, clk_round_rate(clk, 83333333));
1140 clk_put(clk);
1141
1110 /* change parent of FSI B */ 1142 /* change parent of FSI B */
1111 clk = clk_get(NULL, "fsib_clk"); 1143 clk = clk_get(NULL, "fsib_clk");
1112 clk_register(&fsimckb_clk); 1144 clk_register(&fsimckb_clk);
@@ -1123,6 +1155,17 @@ static int __init arch_setup(void)
1123 gpio_request(GPIO_FN_INTC_IRQ1, NULL); 1155 gpio_request(GPIO_FN_INTC_IRQ1, NULL);
1124 gpio_direction_input(GPIO_FN_INTC_IRQ1); 1156 gpio_direction_input(GPIO_FN_INTC_IRQ1);
1125 1157
1158 /* set VPU clock to 166 MHz */
1159 clk = clk_get(NULL, "vpu_clk");
1160 clk_set_rate(clk, clk_round_rate(clk, 166000000));
1161 clk_put(clk);
1162
1163 /* enable IrDA */
1164 gpio_request(GPIO_FN_IRDA_OUT, NULL);
1165 gpio_request(GPIO_FN_IRDA_IN, NULL);
1166 gpio_request(GPIO_PTU5, NULL);
1167 gpio_direction_output(GPIO_PTU5, 0);
1168
1126 /* enable I2C device */ 1169 /* enable I2C device */
1127 i2c_register_board_info(0, i2c0_devices, 1170 i2c_register_board_info(0, i2c0_devices,
1128 ARRAY_SIZE(i2c0_devices)); 1171 ARRAY_SIZE(i2c0_devices));
diff --git a/arch/sh/boards/mach-highlander/irq-r7780mp.c b/arch/sh/boards/mach-highlander/irq-r7780mp.c
index 83c28bcd4d2a..9893fd3a1358 100644
--- a/arch/sh/boards/mach-highlander/irq-r7780mp.c
+++ b/arch/sh/boards/mach-highlander/irq-r7780mp.c
@@ -64,7 +64,7 @@ static DECLARE_INTC_DESC(intc_desc, "r7780mp", vectors,
64 64
65unsigned char * __init highlander_plat_irq_setup(void) 65unsigned char * __init highlander_plat_irq_setup(void)
66{ 66{
67 if ((ctrl_inw(0xa4000700) & 0xf000) == 0x2000) { 67 if ((__raw_readw(0xa4000700) & 0xf000) == 0x2000) {
68 printk(KERN_INFO "Using r7780mp interrupt controller.\n"); 68 printk(KERN_INFO "Using r7780mp interrupt controller.\n");
69 register_intc_controller(&intc_desc); 69 register_intc_controller(&intc_desc);
70 return irl2irq; 70 return irl2irq;
diff --git a/arch/sh/boards/mach-highlander/irq-r7780rp.c b/arch/sh/boards/mach-highlander/irq-r7780rp.c
index b721e86b5af4..0805b2151452 100644
--- a/arch/sh/boards/mach-highlander/irq-r7780rp.c
+++ b/arch/sh/boards/mach-highlander/irq-r7780rp.c
@@ -57,7 +57,7 @@ static DECLARE_INTC_DESC(intc_desc, "r7780rp", vectors,
57 57
58unsigned char * __init highlander_plat_irq_setup(void) 58unsigned char * __init highlander_plat_irq_setup(void)
59{ 59{
60 if (ctrl_inw(0xa5000600)) { 60 if (__raw_readw(0xa5000600)) {
61 printk(KERN_INFO "Using r7780rp interrupt controller.\n"); 61 printk(KERN_INFO "Using r7780rp interrupt controller.\n");
62 register_intc_controller(&intc_desc); 62 register_intc_controller(&intc_desc);
63 return irl2irq; 63 return irl2irq;
diff --git a/arch/sh/boards/mach-highlander/irq-r7785rp.c b/arch/sh/boards/mach-highlander/irq-r7785rp.c
index 3811b060a39b..558b24862776 100644
--- a/arch/sh/boards/mach-highlander/irq-r7785rp.c
+++ b/arch/sh/boards/mach-highlander/irq-r7785rp.c
@@ -66,20 +66,20 @@ static DECLARE_INTC_DESC(intc_desc, "r7785rp", vectors,
66 66
67unsigned char * __init highlander_plat_irq_setup(void) 67unsigned char * __init highlander_plat_irq_setup(void)
68{ 68{
69 if ((ctrl_inw(0xa4000158) & 0xf000) != 0x1000) 69 if ((__raw_readw(0xa4000158) & 0xf000) != 0x1000)
70 return NULL; 70 return NULL;
71 71
72 printk(KERN_INFO "Using r7785rp interrupt controller.\n"); 72 printk(KERN_INFO "Using r7785rp interrupt controller.\n");
73 73
74 ctrl_outw(0x0000, PA_IRLSSR1); /* FPGA IRLSSR1(CF_CD clear) */ 74 __raw_writew(0x0000, PA_IRLSSR1); /* FPGA IRLSSR1(CF_CD clear) */
75 75
76 /* Setup the FPGA IRL */ 76 /* Setup the FPGA IRL */
77 ctrl_outw(0x0000, PA_IRLPRA); /* FPGA IRLA */ 77 __raw_writew(0x0000, PA_IRLPRA); /* FPGA IRLA */
78 ctrl_outw(0xe598, PA_IRLPRB); /* FPGA IRLB */ 78 __raw_writew(0xe598, PA_IRLPRB); /* FPGA IRLB */
79 ctrl_outw(0x7060, PA_IRLPRC); /* FPGA IRLC */ 79 __raw_writew(0x7060, PA_IRLPRC); /* FPGA IRLC */
80 ctrl_outw(0x0000, PA_IRLPRD); /* FPGA IRLD */ 80 __raw_writew(0x0000, PA_IRLPRD); /* FPGA IRLD */
81 ctrl_outw(0x4321, PA_IRLPRE); /* FPGA IRLE */ 81 __raw_writew(0x4321, PA_IRLPRE); /* FPGA IRLE */
82 ctrl_outw(0xdcba, PA_IRLPRF); /* FPGA IRLF */ 82 __raw_writew(0xdcba, PA_IRLPRF); /* FPGA IRLF */
83 83
84 register_intc_controller(&intc_desc); 84 register_intc_controller(&intc_desc);
85 return irl2irq; 85 return irl2irq;
diff --git a/arch/sh/boards/mach-highlander/psw.c b/arch/sh/boards/mach-highlander/psw.c
index 37b1a2ee71a5..522786318d36 100644
--- a/arch/sh/boards/mach-highlander/psw.c
+++ b/arch/sh/boards/mach-highlander/psw.c
@@ -24,7 +24,7 @@ static irqreturn_t psw_irq_handler(int irq, void *arg)
24 unsigned int l, mask; 24 unsigned int l, mask;
25 int ret = 0; 25 int ret = 0;
26 26
27 l = ctrl_inw(PA_DBSW); 27 l = __raw_readw(PA_DBSW);
28 28
29 /* Nothing to do if there's no state change */ 29 /* Nothing to do if there's no state change */
30 if (psw->state) { 30 if (psw->state) {
@@ -45,7 +45,7 @@ static irqreturn_t psw_irq_handler(int irq, void *arg)
45out: 45out:
46 /* Clear the switch IRQs */ 46 /* Clear the switch IRQs */
47 l |= (0x7 << 12); 47 l |= (0x7 << 12);
48 ctrl_outw(l, PA_DBSW); 48 __raw_writew(l, PA_DBSW);
49 49
50 return IRQ_RETVAL(ret); 50 return IRQ_RETVAL(ret);
51} 51}
diff --git a/arch/sh/boards/mach-highlander/setup.c b/arch/sh/boards/mach-highlander/setup.c
index f663c14d8885..affd66747ba3 100644
--- a/arch/sh/boards/mach-highlander/setup.c
+++ b/arch/sh/boards/mach-highlander/setup.c
@@ -311,13 +311,13 @@ device_initcall(r7780rp_devices_setup);
311 */ 311 */
312static int ivdr_clk_enable(struct clk *clk) 312static int ivdr_clk_enable(struct clk *clk)
313{ 313{
314 ctrl_outw(ctrl_inw(PA_IVDRCTL) | (1 << IVDR_CK_ON), PA_IVDRCTL); 314 __raw_writew(__raw_readw(PA_IVDRCTL) | (1 << IVDR_CK_ON), PA_IVDRCTL);
315 return 0; 315 return 0;
316} 316}
317 317
318static void ivdr_clk_disable(struct clk *clk) 318static void ivdr_clk_disable(struct clk *clk)
319{ 319{
320 ctrl_outw(ctrl_inw(PA_IVDRCTL) & ~(1 << IVDR_CK_ON), PA_IVDRCTL); 320 __raw_writew(__raw_readw(PA_IVDRCTL) & ~(1 << IVDR_CK_ON), PA_IVDRCTL);
321} 321}
322 322
323static struct clk_ops ivdr_clk_ops = { 323static struct clk_ops ivdr_clk_ops = {
@@ -337,7 +337,7 @@ static struct clk *r7780rp_clocks[] = {
337static void r7780rp_power_off(void) 337static void r7780rp_power_off(void)
338{ 338{
339 if (mach_is_r7780mp() || mach_is_r7785rp()) 339 if (mach_is_r7780mp() || mach_is_r7785rp())
340 ctrl_outw(0x0001, PA_POFF); 340 __raw_writew(0x0001, PA_POFF);
341} 341}
342 342
343/* 343/*
@@ -345,7 +345,7 @@ static void r7780rp_power_off(void)
345 */ 345 */
346static void __init highlander_setup(char **cmdline_p) 346static void __init highlander_setup(char **cmdline_p)
347{ 347{
348 u16 ver = ctrl_inw(PA_VERREG); 348 u16 ver = __raw_readw(PA_VERREG);
349 int i; 349 int i;
350 350
351 printk(KERN_INFO "Renesas Solutions Highlander %s support.\n", 351 printk(KERN_INFO "Renesas Solutions Highlander %s support.\n",
@@ -370,12 +370,12 @@ static void __init highlander_setup(char **cmdline_p)
370 clk_enable(clk); 370 clk_enable(clk);
371 } 371 }
372 372
373 ctrl_outw(0x0000, PA_OBLED); /* Clear LED. */ 373 __raw_writew(0x0000, PA_OBLED); /* Clear LED. */
374 374
375 if (mach_is_r7780rp()) 375 if (mach_is_r7780rp())
376 ctrl_outw(0x0001, PA_SDPOW); /* SD Power ON */ 376 __raw_writew(0x0001, PA_SDPOW); /* SD Power ON */
377 377
378 ctrl_outw(ctrl_inw(PA_IVDRCTL) | 0x01, PA_IVDRCTL); /* Si13112 */ 378 __raw_writew(__raw_readw(PA_IVDRCTL) | 0x01, PA_IVDRCTL); /* Si13112 */
379 379
380 pm_power_off = r7780rp_power_off; 380 pm_power_off = r7780rp_power_off;
381} 381}
diff --git a/arch/sh/boards/mach-hp6xx/hp6xx_apm.c b/arch/sh/boards/mach-hp6xx/hp6xx_apm.c
index e85212faf40a..b49535c0ddd9 100644
--- a/arch/sh/boards/mach-hp6xx/hp6xx_apm.c
+++ b/arch/sh/boards/mach-hp6xx/hp6xx_apm.c
@@ -53,7 +53,7 @@ static void hp6x0_apm_get_power_status(struct apm_power_info *info)
53 info->ac_line_status = (battery > HP680_BATTERY_AC_ON) ? 53 info->ac_line_status = (battery > HP680_BATTERY_AC_ON) ?
54 APM_AC_ONLINE : APM_AC_OFFLINE; 54 APM_AC_ONLINE : APM_AC_OFFLINE;
55 55
56 pgdr = ctrl_inb(PGDR); 56 pgdr = __raw_readb(PGDR);
57 if (pgdr & PGDR_MAIN_BATTERY_OUT) { 57 if (pgdr & PGDR_MAIN_BATTERY_OUT) {
58 info->battery_status = APM_BATTERY_STATUS_NOT_PRESENT; 58 info->battery_status = APM_BATTERY_STATUS_NOT_PRESENT;
59 info->battery_flag = 0x80; 59 info->battery_flag = 0x80;
diff --git a/arch/sh/boards/mach-hp6xx/pm.c b/arch/sh/boards/mach-hp6xx/pm.c
index d936c1af7620..4499a3749d40 100644
--- a/arch/sh/boards/mach-hp6xx/pm.c
+++ b/arch/sh/boards/mach-hp6xx/pm.c
@@ -53,17 +53,17 @@ static void pm_enter(void)
53 sh_wdt_write_cnt(0); 53 sh_wdt_write_cnt(0);
54 54
55 /* disable PLL1 */ 55 /* disable PLL1 */
56 frqcr = ctrl_inw(FRQCR); 56 frqcr = __raw_readw(FRQCR);
57 frqcr &= ~(FRQCR_PLLEN | FRQCR_PSTBY); 57 frqcr &= ~(FRQCR_PLLEN | FRQCR_PSTBY);
58 ctrl_outw(frqcr, FRQCR); 58 __raw_writew(frqcr, FRQCR);
59 59
60 /* enable standby */ 60 /* enable standby */
61 stbcr = ctrl_inb(STBCR); 61 stbcr = __raw_readb(STBCR);
62 ctrl_outb(stbcr | STBCR_STBY | STBCR_MSTP2, STBCR); 62 __raw_writeb(stbcr | STBCR_STBY | STBCR_MSTP2, STBCR);
63 63
64 /* set self-refresh */ 64 /* set self-refresh */
65 mcr = ctrl_inw(MCR); 65 mcr = __raw_readw(MCR);
66 ctrl_outw(mcr & ~MCR_RFSH, MCR); 66 __raw_writew(mcr & ~MCR_RFSH, MCR);
67 67
68 /* set interrupt handler */ 68 /* set interrupt handler */
69 asm volatile("stc vbr, %0" : "=r" (vbr_old)); 69 asm volatile("stc vbr, %0" : "=r" (vbr_old));
@@ -73,8 +73,8 @@ static void pm_enter(void)
73 &wakeup_start, &wakeup_end - &wakeup_start); 73 &wakeup_start, &wakeup_end - &wakeup_start);
74 asm volatile("ldc %0, vbr" : : "r" (vbr_new)); 74 asm volatile("ldc %0, vbr" : : "r" (vbr_new));
75 75
76 ctrl_outw(0, RTCNT); 76 __raw_writew(0, RTCNT);
77 ctrl_outw(mcr | MCR_RFSH | MCR_RMODE, MCR); 77 __raw_writew(mcr | MCR_RFSH | MCR_RMODE, MCR);
78 78
79 cpu_sleep(); 79 cpu_sleep();
80 80
@@ -83,14 +83,14 @@ static void pm_enter(void)
83 free_page(vbr_new); 83 free_page(vbr_new);
84 84
85 /* enable PLL1 */ 85 /* enable PLL1 */
86 frqcr = ctrl_inw(FRQCR); 86 frqcr = __raw_readw(FRQCR);
87 frqcr |= FRQCR_PSTBY; 87 frqcr |= FRQCR_PSTBY;
88 ctrl_outw(frqcr, FRQCR); 88 __raw_writew(frqcr, FRQCR);
89 udelay(50); 89 udelay(50);
90 frqcr |= FRQCR_PLLEN; 90 frqcr |= FRQCR_PLLEN;
91 ctrl_outw(frqcr, FRQCR); 91 __raw_writew(frqcr, FRQCR);
92 92
93 ctrl_outb(stbcr, STBCR); 93 __raw_writeb(stbcr, STBCR);
94 94
95 clear_bl_bit(); 95 clear_bl_bit();
96} 96}
@@ -115,21 +115,21 @@ static int hp6x0_pm_enter(suspend_state_t state)
115 outw(hd64461_stbcr, HD64461_STBCR); 115 outw(hd64461_stbcr, HD64461_STBCR);
116#endif 116#endif
117 117
118 ctrl_outb(0x1f, DACR); 118 __raw_writeb(0x1f, DACR);
119 119
120 stbcr = ctrl_inb(STBCR); 120 stbcr = __raw_readb(STBCR);
121 ctrl_outb(0x01, STBCR); 121 __raw_writeb(0x01, STBCR);
122 122
123 stbcr2 = ctrl_inb(STBCR2); 123 stbcr2 = __raw_readb(STBCR2);
124 ctrl_outb(0x7f , STBCR2); 124 __raw_writeb(0x7f , STBCR2);
125 125
126 outw(0xf07f, HD64461_SCPUCR); 126 outw(0xf07f, HD64461_SCPUCR);
127 127
128 pm_enter(); 128 pm_enter();
129 129
130 outw(0, HD64461_SCPUCR); 130 outw(0, HD64461_SCPUCR);
131 ctrl_outb(stbcr, STBCR); 131 __raw_writeb(stbcr, STBCR);
132 ctrl_outb(stbcr2, STBCR2); 132 __raw_writeb(stbcr2, STBCR2);
133 133
134#ifdef CONFIG_HD64461_ENABLER 134#ifdef CONFIG_HD64461_ENABLER
135 hd64461_stbcr = inw(HD64461_STBCR); 135 hd64461_stbcr = inw(HD64461_STBCR);
diff --git a/arch/sh/boards/mach-hp6xx/setup.c b/arch/sh/boards/mach-hp6xx/setup.c
index e6dd5e96321e..8c9add5f4cfa 100644
--- a/arch/sh/boards/mach-hp6xx/setup.c
+++ b/arch/sh/boards/mach-hp6xx/setup.c
@@ -149,19 +149,19 @@ static void __init hp6xx_setup(char **cmdline_p)
149 149
150 sh_dac_output(0, DAC_SPEAKER_VOLUME); 150 sh_dac_output(0, DAC_SPEAKER_VOLUME);
151 sh_dac_disable(DAC_SPEAKER_VOLUME); 151 sh_dac_disable(DAC_SPEAKER_VOLUME);
152 v8 = ctrl_inb(DACR); 152 v8 = __raw_readb(DACR);
153 v8 &= ~DACR_DAE; 153 v8 &= ~DACR_DAE;
154 ctrl_outb(v8,DACR); 154 __raw_writeb(v8,DACR);
155 155
156 v8 = ctrl_inb(SCPDR); 156 v8 = __raw_readb(SCPDR);
157 v8 |= SCPDR_TS_SCAN_X | SCPDR_TS_SCAN_Y; 157 v8 |= SCPDR_TS_SCAN_X | SCPDR_TS_SCAN_Y;
158 v8 &= ~SCPDR_TS_SCAN_ENABLE; 158 v8 &= ~SCPDR_TS_SCAN_ENABLE;
159 ctrl_outb(v8, SCPDR); 159 __raw_writeb(v8, SCPDR);
160 160
161 v = ctrl_inw(SCPCR); 161 v = __raw_readw(SCPCR);
162 v &= ~SCPCR_TS_MASK; 162 v &= ~SCPCR_TS_MASK;
163 v |= SCPCR_TS_ENABLE; 163 v |= SCPCR_TS_ENABLE;
164 ctrl_outw(v, SCPCR); 164 __raw_writew(v, SCPCR);
165} 165}
166device_initcall(hp6xx_devices_setup); 166device_initcall(hp6xx_devices_setup);
167 167
diff --git a/arch/sh/boards/mach-kfr2r09/setup.c b/arch/sh/boards/mach-kfr2r09/setup.c
index 5d7b5d92475e..b2cd0ed8664e 100644
--- a/arch/sh/boards/mach-kfr2r09/setup.c
+++ b/arch/sh/boards/mach-kfr2r09/setup.c
@@ -282,7 +282,7 @@ static int camera_power(struct device *dev, int mode)
282 * use 1.8 V for VccQ_VIO 282 * use 1.8 V for VccQ_VIO
283 * use 2.85V for VccQ_SR 283 * use 2.85V for VccQ_SR
284 */ 284 */
285 ctrl_outw((ctrl_inw(DRVCRB) & ~0x0003) | 0x0001, DRVCRB); 285 __raw_writew((__raw_readw(DRVCRB) & ~0x0003) | 0x0001, DRVCRB);
286 286
287 /* reset clear */ 287 /* reset clear */
288 ret = gpio_request(GPIO_PTB4, NULL); 288 ret = gpio_request(GPIO_PTB4, NULL);
@@ -351,7 +351,7 @@ static struct resource kfr2r09_sh_sdhi0_resources[] = {
351 .flags = IORESOURCE_MEM, 351 .flags = IORESOURCE_MEM,
352 }, 352 },
353 [1] = { 353 [1] = {
354 .start = 101, 354 .start = 100,
355 .flags = IORESOURCE_IRQ, 355 .flags = IORESOURCE_IRQ,
356 }, 356 },
357}; 357};
@@ -492,13 +492,13 @@ static int kfr2r09_usb0_gadget_setup(void)
492 if (kfr2r09_usb0_gadget_i2c_setup() != 0) 492 if (kfr2r09_usb0_gadget_i2c_setup() != 0)
493 return -ENODEV; /* unable to configure using i2c */ 493 return -ENODEV; /* unable to configure using i2c */
494 494
495 ctrl_outw((ctrl_inw(PORT_MSELCRB) & ~0xc000) | 0x8000, PORT_MSELCRB); 495 __raw_writew((__raw_readw(PORT_MSELCRB) & ~0xc000) | 0x8000, PORT_MSELCRB);
496 gpio_request(GPIO_FN_PDSTATUS, NULL); /* R-standby disables USB clock */ 496 gpio_request(GPIO_FN_PDSTATUS, NULL); /* R-standby disables USB clock */
497 gpio_request(GPIO_PTV6, NULL); /* USBCLK_ON */ 497 gpio_request(GPIO_PTV6, NULL); /* USBCLK_ON */
498 gpio_direction_output(GPIO_PTV6, 1); /* USBCLK_ON = H */ 498 gpio_direction_output(GPIO_PTV6, 1); /* USBCLK_ON = H */
499 msleep(20); /* wait 20ms to let the clock settle */ 499 msleep(20); /* wait 20ms to let the clock settle */
500 clk_enable(clk_get(NULL, "usb0")); 500 clk_enable(clk_get(NULL, "usb0"));
501 ctrl_outw(0x0600, 0xa40501d4); 501 __raw_writew(0x0600, 0xa40501d4);
502 502
503 return 0; 503 return 0;
504} 504}
@@ -526,12 +526,12 @@ static int __init kfr2r09_devices_setup(void)
526 gpio_direction_output(GPIO_PTG3, 1); /* HPON_ON = H */ 526 gpio_direction_output(GPIO_PTG3, 1); /* HPON_ON = H */
527 527
528 /* setup NOR flash at CS0 */ 528 /* setup NOR flash at CS0 */
529 ctrl_outl(0x36db0400, BSC_CS0BCR); 529 __raw_writel(0x36db0400, BSC_CS0BCR);
530 ctrl_outl(0x00000500, BSC_CS0WCR); 530 __raw_writel(0x00000500, BSC_CS0WCR);
531 531
532 /* setup NAND flash at CS4 */ 532 /* setup NAND flash at CS4 */
533 ctrl_outl(0x36db0400, BSC_CS4BCR); 533 __raw_writel(0x36db0400, BSC_CS4BCR);
534 ctrl_outl(0x00000500, BSC_CS4WCR); 534 __raw_writel(0x00000500, BSC_CS4WCR);
535 535
536 /* setup KEYSC pins */ 536 /* setup KEYSC pins */
537 gpio_request(GPIO_FN_KEYOUT0, NULL); 537 gpio_request(GPIO_FN_KEYOUT0, NULL);
diff --git a/arch/sh/boards/mach-landisk/gio.c b/arch/sh/boards/mach-landisk/gio.c
index 528013188196..01e6abb769b9 100644
--- a/arch/sh/boards/mach-landisk/gio.c
+++ b/arch/sh/boards/mach-landisk/gio.c
@@ -76,39 +76,39 @@ static long gio_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
76 break; 76 break;
77 77
78 case GIODRV_IOCSGIODATA1: /* write byte */ 78 case GIODRV_IOCSGIODATA1: /* write byte */
79 ctrl_outb((unsigned char)(0x0ff & data), addr); 79 __raw_writeb((unsigned char)(0x0ff & data), addr);
80 break; 80 break;
81 81
82 case GIODRV_IOCSGIODATA2: /* write word */ 82 case GIODRV_IOCSGIODATA2: /* write word */
83 if (addr & 0x01) { 83 if (addr & 0x01) {
84 return -EFAULT; 84 return -EFAULT;
85 } 85 }
86 ctrl_outw((unsigned short int)(0x0ffff & data), addr); 86 __raw_writew((unsigned short int)(0x0ffff & data), addr);
87 break; 87 break;
88 88
89 case GIODRV_IOCSGIODATA4: /* write long */ 89 case GIODRV_IOCSGIODATA4: /* write long */
90 if (addr & 0x03) { 90 if (addr & 0x03) {
91 return -EFAULT; 91 return -EFAULT;
92 } 92 }
93 ctrl_outl(data, addr); 93 __raw_writel(data, addr);
94 break; 94 break;
95 95
96 case GIODRV_IOCGGIODATA1: /* read byte */ 96 case GIODRV_IOCGGIODATA1: /* read byte */
97 data = ctrl_inb(addr); 97 data = __raw_readb(addr);
98 break; 98 break;
99 99
100 case GIODRV_IOCGGIODATA2: /* read word */ 100 case GIODRV_IOCGGIODATA2: /* read word */
101 if (addr & 0x01) { 101 if (addr & 0x01) {
102 return -EFAULT; 102 return -EFAULT;
103 } 103 }
104 data = ctrl_inw(addr); 104 data = __raw_readw(addr);
105 break; 105 break;
106 106
107 case GIODRV_IOCGGIODATA4: /* read long */ 107 case GIODRV_IOCGGIODATA4: /* read long */
108 if (addr & 0x03) { 108 if (addr & 0x03) {
109 return -EFAULT; 109 return -EFAULT;
110 } 110 }
111 data = ctrl_inl(addr); 111 data = __raw_readl(addr);
112 break; 112 break;
113 default: 113 default:
114 return -EFAULT; 114 return -EFAULT;
diff --git a/arch/sh/boards/mach-landisk/irq.c b/arch/sh/boards/mach-landisk/irq.c
index 7b284cde1f58..96f38a4187d0 100644
--- a/arch/sh/boards/mach-landisk/irq.c
+++ b/arch/sh/boards/mach-landisk/irq.c
@@ -22,14 +22,14 @@ static void disable_landisk_irq(unsigned int irq)
22{ 22{
23 unsigned char mask = 0xff ^ (0x01 << (irq - 5)); 23 unsigned char mask = 0xff ^ (0x01 << (irq - 5));
24 24
25 ctrl_outb(ctrl_inb(PA_IMASK) & mask, PA_IMASK); 25 __raw_writeb(__raw_readb(PA_IMASK) & mask, PA_IMASK);
26} 26}
27 27
28static void enable_landisk_irq(unsigned int irq) 28static void enable_landisk_irq(unsigned int irq)
29{ 29{
30 unsigned char value = (0x01 << (irq - 5)); 30 unsigned char value = (0x01 << (irq - 5));
31 31
32 ctrl_outb(ctrl_inb(PA_IMASK) | value, PA_IMASK); 32 __raw_writeb(__raw_readb(PA_IMASK) | value, PA_IMASK);
33} 33}
34 34
35static struct irq_chip landisk_irq_chip __read_mostly = { 35static struct irq_chip landisk_irq_chip __read_mostly = {
@@ -52,5 +52,5 @@ void __init init_landisk_IRQ(void)
52 handle_level_irq, "level"); 52 handle_level_irq, "level");
53 enable_landisk_irq(i); 53 enable_landisk_irq(i);
54 } 54 }
55 ctrl_outb(0x00, PA_PWRINT_CLR); 55 __raw_writeb(0x00, PA_PWRINT_CLR);
56} 56}
diff --git a/arch/sh/boards/mach-landisk/psw.c b/arch/sh/boards/mach-landisk/psw.c
index e6b0efa098d1..bef83522f958 100644
--- a/arch/sh/boards/mach-landisk/psw.c
+++ b/arch/sh/boards/mach-landisk/psw.c
@@ -25,7 +25,7 @@ static irqreturn_t psw_irq_handler(int irq, void *arg)
25 unsigned int sw_value; 25 unsigned int sw_value;
26 int ret = 0; 26 int ret = 0;
27 27
28 sw_value = (0x0ff & (~ctrl_inb(PA_STATUS))); 28 sw_value = (0x0ff & (~__raw_readb(PA_STATUS)));
29 29
30 /* Nothing to do if there's no state change */ 30 /* Nothing to do if there's no state change */
31 if (psw->state) { 31 if (psw->state) {
@@ -42,7 +42,7 @@ static irqreturn_t psw_irq_handler(int irq, void *arg)
42 42
43out: 43out:
44 /* Clear the switch IRQs */ 44 /* Clear the switch IRQs */
45 ctrl_outb(0x00, PA_PWRINT_CLR); 45 __raw_writeb(0x00, PA_PWRINT_CLR);
46 46
47 return IRQ_RETVAL(ret); 47 return IRQ_RETVAL(ret);
48} 48}
diff --git a/arch/sh/boards/mach-landisk/setup.c b/arch/sh/boards/mach-landisk/setup.c
index db22ea2e6d49..50337acc18c5 100644
--- a/arch/sh/boards/mach-landisk/setup.c
+++ b/arch/sh/boards/mach-landisk/setup.c
@@ -25,7 +25,7 @@ void init_landisk_IRQ(void);
25 25
26static void landisk_power_off(void) 26static void landisk_power_off(void)
27{ 27{
28 ctrl_outb(0x01, PA_SHUTDOWN); 28 __raw_writeb(0x01, PA_SHUTDOWN);
29} 29}
30 30
31static struct resource cf_ide_resources[3]; 31static struct resource cf_ide_resources[3];
@@ -63,7 +63,7 @@ static int __init landisk_devices_setup(void)
63 /* open I/O area window */ 63 /* open I/O area window */
64 paddrbase = virt_to_phys((void *)PA_AREA5_IO); 64 paddrbase = virt_to_phys((void *)PA_AREA5_IO);
65 prot = PAGE_KERNEL_PCC(1, _PAGE_PCC_IO16); 65 prot = PAGE_KERNEL_PCC(1, _PAGE_PCC_IO16);
66 cf_ide_base = p3_ioremap(paddrbase, PAGE_SIZE, prot.pgprot); 66 cf_ide_base = ioremap_prot(paddrbase, PAGE_SIZE, pgprot_val(prot));
67 if (!cf_ide_base) { 67 if (!cf_ide_base) {
68 printk("allocate_cf_area : can't open CF I/O window!\n"); 68 printk("allocate_cf_area : can't open CF I/O window!\n");
69 return -ENOMEM; 69 return -ENOMEM;
@@ -88,7 +88,7 @@ __initcall(landisk_devices_setup);
88static void __init landisk_setup(char **cmdline_p) 88static void __init landisk_setup(char **cmdline_p)
89{ 89{
90 /* LED ON */ 90 /* LED ON */
91 ctrl_outb(ctrl_inb(PA_LED) | 0x03, PA_LED); 91 __raw_writeb(__raw_readb(PA_LED) | 0x03, PA_LED);
92 92
93 printk(KERN_INFO "I-O DATA DEVICE, INC. \"LANDISK Series\" support.\n"); 93 printk(KERN_INFO "I-O DATA DEVICE, INC. \"LANDISK Series\" support.\n");
94 pm_power_off = landisk_power_off; 94 pm_power_off = landisk_power_off;
diff --git a/arch/sh/boards/mach-lboxre2/setup.c b/arch/sh/boards/mach-lboxre2/setup.c
index 2b0b5818e1e4..79b4e0d77b71 100644
--- a/arch/sh/boards/mach-lboxre2/setup.c
+++ b/arch/sh/boards/mach-lboxre2/setup.c
@@ -56,8 +56,8 @@ static int __init lboxre2_devices_setup(void)
56 /* open I/O area window */ 56 /* open I/O area window */
57 paddrbase = virt_to_phys((void*)PA_AREA5_IO); 57 paddrbase = virt_to_phys((void*)PA_AREA5_IO);
58 psize = PAGE_SIZE; 58 psize = PAGE_SIZE;
59 prot = PAGE_KERNEL_PCC( 1 , _PAGE_PCC_IO16); 59 prot = PAGE_KERNEL_PCC(1, _PAGE_PCC_IO16);
60 cf0_io_base = (u32)p3_ioremap(paddrbase, psize, prot.pgprot); 60 cf0_io_base = (u32)ioremap_prot(paddrbase, psize, pgprot_val(prot));
61 if (!cf0_io_base) { 61 if (!cf0_io_base) {
62 printk(KERN_ERR "%s : can't open CF I/O window!\n" , __func__ ); 62 printk(KERN_ERR "%s : can't open CF I/O window!\n" , __func__ );
63 return -ENOMEM; 63 return -ENOMEM;
diff --git a/arch/sh/boards/mach-microdev/io.c b/arch/sh/boards/mach-microdev/io.c
index 52dd748211c7..2960c659020e 100644
--- a/arch/sh/boards/mach-microdev/io.c
+++ b/arch/sh/boards/mach-microdev/io.c
@@ -141,10 +141,10 @@ static inline void delay(void)
141#if defined(CONFIG_PCI) 141#if defined(CONFIG_PCI)
142 /* System board present, just make a dummy SRAM access. (CS0 will be 142 /* System board present, just make a dummy SRAM access. (CS0 will be
143 mapped to PCI memory, probably good to avoid it.) */ 143 mapped to PCI memory, probably good to avoid it.) */
144 ctrl_inw(0xa6800000); 144 __raw_readw(0xa6800000);
145#else 145#else
146 /* CS0 will be mapped to flash, ROM etc so safe to access it. */ 146 /* CS0 will be mapped to flash, ROM etc so safe to access it. */
147 ctrl_inw(0xa0000000); 147 __raw_readw(0xa0000000);
148#endif 148#endif
149} 149}
150 150
diff --git a/arch/sh/boards/mach-microdev/irq.c b/arch/sh/boards/mach-microdev/irq.c
index b551963579c1..a26d16669aa2 100644
--- a/arch/sh/boards/mach-microdev/irq.c
+++ b/arch/sh/boards/mach-microdev/irq.c
@@ -88,7 +88,7 @@ static void disable_microdev_irq(unsigned int irq)
88 fpgaIrq = fpgaIrqTable[irq].fpgaIrq; 88 fpgaIrq = fpgaIrqTable[irq].fpgaIrq;
89 89
90 /* disable interrupts on the FPGA INTC register */ 90 /* disable interrupts on the FPGA INTC register */
91 ctrl_outl(MICRODEV_FPGA_INTC_MASK(fpgaIrq), MICRODEV_FPGA_INTDSB_REG); 91 __raw_writel(MICRODEV_FPGA_INTC_MASK(fpgaIrq), MICRODEV_FPGA_INTDSB_REG);
92} 92}
93 93
94static void enable_microdev_irq(unsigned int irq) 94static void enable_microdev_irq(unsigned int irq)
@@ -107,13 +107,13 @@ static void enable_microdev_irq(unsigned int irq)
107 priorityReg = MICRODEV_FPGA_INTPRI_REG(fpgaIrq); 107 priorityReg = MICRODEV_FPGA_INTPRI_REG(fpgaIrq);
108 108
109 /* set priority for the interrupt */ 109 /* set priority for the interrupt */
110 priorities = ctrl_inl(priorityReg); 110 priorities = __raw_readl(priorityReg);
111 priorities &= ~MICRODEV_FPGA_INTPRI_MASK(fpgaIrq); 111 priorities &= ~MICRODEV_FPGA_INTPRI_MASK(fpgaIrq);
112 priorities |= MICRODEV_FPGA_INTPRI_LEVEL(fpgaIrq, pri); 112 priorities |= MICRODEV_FPGA_INTPRI_LEVEL(fpgaIrq, pri);
113 ctrl_outl(priorities, priorityReg); 113 __raw_writel(priorities, priorityReg);
114 114
115 /* enable interrupts on the FPGA INTC register */ 115 /* enable interrupts on the FPGA INTC register */
116 ctrl_outl(MICRODEV_FPGA_INTC_MASK(fpgaIrq), MICRODEV_FPGA_INTENB_REG); 116 __raw_writel(MICRODEV_FPGA_INTC_MASK(fpgaIrq), MICRODEV_FPGA_INTENB_REG);
117} 117}
118 118
119/* This function sets the desired irq handler to be a MicroDev type */ 119/* This function sets the desired irq handler to be a MicroDev type */
@@ -134,7 +134,7 @@ extern void __init init_microdev_irq(void)
134 int i; 134 int i;
135 135
136 /* disable interrupts on the FPGA INTC register */ 136 /* disable interrupts on the FPGA INTC register */
137 ctrl_outl(~0ul, MICRODEV_FPGA_INTDSB_REG); 137 __raw_writel(~0ul, MICRODEV_FPGA_INTDSB_REG);
138 138
139 for (i = 0; i < NUM_EXTERNAL_IRQS; i++) 139 for (i = 0; i < NUM_EXTERNAL_IRQS; i++)
140 make_microdev_irq(i); 140 make_microdev_irq(i);
diff --git a/arch/sh/boards/mach-migor/setup.c b/arch/sh/boards/mach-migor/setup.c
index 507c77be476d..be300aaca6fe 100644
--- a/arch/sh/boards/mach-migor/setup.c
+++ b/arch/sh/boards/mach-migor/setup.c
@@ -397,7 +397,7 @@ static struct resource sdhi_cn9_resources[] = {
397 .flags = IORESOURCE_MEM, 397 .flags = IORESOURCE_MEM,
398 }, 398 },
399 [1] = { 399 [1] = {
400 .start = 101, 400 .start = 100,
401 .flags = IORESOURCE_IRQ, 401 .flags = IORESOURCE_IRQ,
402 }, 402 },
403}; 403};
@@ -431,7 +431,7 @@ static struct i2c_board_info migor_i2c_camera[] = {
431}; 431};
432 432
433static struct ov772x_camera_info ov7725_info = { 433static struct ov772x_camera_info ov7725_info = {
434 .buswidth = SOCAM_DATAWIDTH_8, 434 .flags = OV772X_FLAG_8BIT,
435}; 435};
436 436
437static struct soc_camera_link ov7725_link = { 437static struct soc_camera_link ov7725_link = {
@@ -496,28 +496,16 @@ static int __init migor_devices_setup(void)
496 &migor_sdram_enter_end, 496 &migor_sdram_enter_end,
497 &migor_sdram_leave_start, 497 &migor_sdram_leave_start,
498 &migor_sdram_leave_end); 498 &migor_sdram_leave_end);
499#ifdef CONFIG_PM
500 /* Let D11 LED show STATUS0 */ 499 /* Let D11 LED show STATUS0 */
501 gpio_request(GPIO_FN_STATUS0, NULL); 500 gpio_request(GPIO_FN_STATUS0, NULL);
502 501
503 /* Lit D12 LED show PDSTATUS */ 502 /* Lit D12 LED show PDSTATUS */
504 gpio_request(GPIO_FN_PDSTATUS, NULL); 503 gpio_request(GPIO_FN_PDSTATUS, NULL);
505#else
506 /* Lit D11 LED */
507 gpio_request(GPIO_PTJ7, NULL);
508 gpio_direction_output(GPIO_PTJ7, 1);
509 gpio_export(GPIO_PTJ7, 0);
510
511 /* Lit D12 LED */
512 gpio_request(GPIO_PTJ5, NULL);
513 gpio_direction_output(GPIO_PTJ5, 1);
514 gpio_export(GPIO_PTJ5, 0);
515#endif
516 504
517 /* SMC91C111 - Enable IRQ0, Setup CS4 for 16-bit fast access */ 505 /* SMC91C111 - Enable IRQ0, Setup CS4 for 16-bit fast access */
518 gpio_request(GPIO_FN_IRQ0, NULL); 506 gpio_request(GPIO_FN_IRQ0, NULL);
519 ctrl_outl(0x00003400, BSC_CS4BCR); 507 __raw_writel(0x00003400, BSC_CS4BCR);
520 ctrl_outl(0x00110080, BSC_CS4WCR); 508 __raw_writel(0x00110080, BSC_CS4WCR);
521 509
522 /* KEYSC */ 510 /* KEYSC */
523 gpio_request(GPIO_FN_KEYOUT0, NULL); 511 gpio_request(GPIO_FN_KEYOUT0, NULL);
@@ -533,7 +521,7 @@ static int __init migor_devices_setup(void)
533 521
534 /* NAND Flash */ 522 /* NAND Flash */
535 gpio_request(GPIO_FN_CS6A_CE2B, NULL); 523 gpio_request(GPIO_FN_CS6A_CE2B, NULL);
536 ctrl_outl((ctrl_inl(BSC_CS6ABCR) & ~0x0600) | 0x0200, BSC_CS6ABCR); 524 __raw_writel((__raw_readl(BSC_CS6ABCR) & ~0x0600) | 0x0200, BSC_CS6ABCR);
537 gpio_request(GPIO_PTA1, NULL); 525 gpio_request(GPIO_PTA1, NULL);
538 gpio_direction_input(GPIO_PTA1); 526 gpio_direction_input(GPIO_PTA1);
539 527
@@ -627,7 +615,7 @@ static int __init migor_devices_setup(void)
627#else 615#else
628 gpio_direction_output(GPIO_PTT0, 1); 616 gpio_direction_output(GPIO_PTT0, 1);
629#endif 617#endif
630 ctrl_outw(ctrl_inw(PORT_MSELCRB) | 0x2000, PORT_MSELCRB); /* D15->D8 */ 618 __raw_writew(__raw_readw(PORT_MSELCRB) | 0x2000, PORT_MSELCRB); /* D15->D8 */
631 619
632 platform_resource_setup_memory(&migor_ceu_device, "ceu", 4 << 20); 620 platform_resource_setup_memory(&migor_ceu_device, "ceu", 4 << 20);
633 621
diff --git a/arch/sh/boards/mach-r2d/irq.c b/arch/sh/boards/mach-r2d/irq.c
index 78d7b27c80da..574f009c3c31 100644
--- a/arch/sh/boards/mach-r2d/irq.c
+++ b/arch/sh/boards/mach-r2d/irq.c
@@ -129,7 +129,7 @@ void __init init_rts7751r2d_IRQ(void)
129{ 129{
130 struct intc_desc *d; 130 struct intc_desc *d;
131 131
132 switch (ctrl_inw(PA_VERREG) & 0xf0) { 132 switch (__raw_readw(PA_VERREG) & 0xf0) {
133#ifdef CONFIG_RTS7751R2D_PLUS 133#ifdef CONFIG_RTS7751R2D_PLUS
134 case 0x10: 134 case 0x10:
135 printk(KERN_INFO "Using R2D-PLUS interrupt controller.\n"); 135 printk(KERN_INFO "Using R2D-PLUS interrupt controller.\n");
@@ -147,7 +147,7 @@ void __init init_rts7751r2d_IRQ(void)
147#endif 147#endif
148 default: 148 default:
149 printk(KERN_INFO "Unknown R2D interrupt controller 0x%04x\n", 149 printk(KERN_INFO "Unknown R2D interrupt controller 0x%04x\n",
150 ctrl_inw(PA_VERREG)); 150 __raw_readw(PA_VERREG));
151 return; 151 return;
152 } 152 }
153 153
diff --git a/arch/sh/boards/mach-r2d/setup.c b/arch/sh/boards/mach-r2d/setup.c
index a625ecb93e47..b84df6a3a93c 100644
--- a/arch/sh/boards/mach-r2d/setup.c
+++ b/arch/sh/boards/mach-r2d/setup.c
@@ -70,7 +70,7 @@ static struct spi_board_info spi_bus[] = {
70static void r2d_chip_select(struct sh_spi_info *spi, int cs, int state) 70static void r2d_chip_select(struct sh_spi_info *spi, int cs, int state)
71{ 71{
72 BUG_ON(cs != 0); /* Single Epson RTC-9701JE attached on CS0 */ 72 BUG_ON(cs != 0); /* Single Epson RTC-9701JE attached on CS0 */
73 ctrl_outw(state == BITBANG_CS_ACTIVE, PA_RTCCE); 73 __raw_writew(state == BITBANG_CS_ACTIVE, PA_RTCCE);
74} 74}
75 75
76static struct sh_spi_info spi_info = { 76static struct sh_spi_info spi_info = {
@@ -262,7 +262,7 @@ __initcall(rts7751r2d_devices_setup);
262 262
263static void rts7751r2d_power_off(void) 263static void rts7751r2d_power_off(void)
264{ 264{
265 ctrl_outw(0x0001, PA_POWOFF); 265 __raw_writew(0x0001, PA_POWOFF);
266} 266}
267 267
268/* 268/*
@@ -271,14 +271,14 @@ static void rts7751r2d_power_off(void)
271static void __init rts7751r2d_setup(char **cmdline_p) 271static void __init rts7751r2d_setup(char **cmdline_p)
272{ 272{
273 void __iomem *sm501_reg; 273 void __iomem *sm501_reg;
274 u16 ver = ctrl_inw(PA_VERREG); 274 u16 ver = __raw_readw(PA_VERREG);
275 275
276 printk(KERN_INFO "Renesas Technology Sales RTS7751R2D support.\n"); 276 printk(KERN_INFO "Renesas Technology Sales RTS7751R2D support.\n");
277 277
278 printk(KERN_INFO "FPGA version:%d (revision:%d)\n", 278 printk(KERN_INFO "FPGA version:%d (revision:%d)\n",
279 (ver >> 4) & 0xf, ver & 0xf); 279 (ver >> 4) & 0xf, ver & 0xf);
280 280
281 ctrl_outw(0x0000, PA_OUTPORT); 281 __raw_writew(0x0000, PA_OUTPORT);
282 pm_power_off = rts7751r2d_power_off; 282 pm_power_off = rts7751r2d_power_off;
283 283
284 /* sm501 dram configuration: 284 /* sm501 dram configuration:
diff --git a/arch/sh/boards/mach-rsk/devices-rsk7203.c b/arch/sh/boards/mach-rsk/devices-rsk7203.c
index c37617e63220..4fa08ba10253 100644
--- a/arch/sh/boards/mach-rsk/devices-rsk7203.c
+++ b/arch/sh/boards/mach-rsk/devices-rsk7203.c
@@ -96,7 +96,7 @@ static int __init rsk7203_devices_setup(void)
96 gpio_request(GPIO_FN_RXD0, NULL); 96 gpio_request(GPIO_FN_RXD0, NULL);
97 97
98 /* Setup LAN9118: CS1 in 16-bit Big Endian Mode, IRQ0 at Port B */ 98 /* Setup LAN9118: CS1 in 16-bit Big Endian Mode, IRQ0 at Port B */
99 ctrl_outl(0x36db0400, 0xfffc0008); /* CS1BCR */ 99 __raw_writel(0x36db0400, 0xfffc0008); /* CS1BCR */
100 gpio_request(GPIO_FN_IRQ0_PB, NULL); 100 gpio_request(GPIO_FN_IRQ0_PB, NULL);
101 101
102 return platform_add_devices(rsk7203_devices, 102 return platform_add_devices(rsk7203_devices,
diff --git a/arch/sh/boards/mach-sdk7780/irq.c b/arch/sh/boards/mach-sdk7780/irq.c
index 855558163c58..e5f7564f2511 100644
--- a/arch/sh/boards/mach-sdk7780/irq.c
+++ b/arch/sh/boards/mach-sdk7780/irq.c
@@ -37,9 +37,9 @@ void __init init_sdk7780_IRQ(void)
37{ 37{
38 printk(KERN_INFO "Using SDK7780 interrupt controller.\n"); 38 printk(KERN_INFO "Using SDK7780 interrupt controller.\n");
39 39
40 ctrl_outw(0xFFFF, FPGA_IRQ0MR); 40 __raw_writew(0xFFFF, FPGA_IRQ0MR);
41 /* Setup IRL 0-3 */ 41 /* Setup IRL 0-3 */
42 ctrl_outw(0x0003, FPGA_IMSR); 42 __raw_writew(0x0003, FPGA_IMSR);
43 plat_irq_setup_pins(IRQ_MODE_IRL3210); 43 plat_irq_setup_pins(IRQ_MODE_IRL3210);
44 44
45 register_intc_controller(&fpga_intc_desc); 45 register_intc_controller(&fpga_intc_desc);
diff --git a/arch/sh/boards/mach-sdk7780/setup.c b/arch/sh/boards/mach-sdk7780/setup.c
index aad94a78dc70..4da38db4b5fe 100644
--- a/arch/sh/boards/mach-sdk7780/setup.c
+++ b/arch/sh/boards/mach-sdk7780/setup.c
@@ -20,27 +20,18 @@
20 20
21#define GPIO_PECR 0xFFEA0008 21#define GPIO_PECR 0xFFEA0008
22 22
23//* Heartbeat */ 23/* Heartbeat */
24static struct heartbeat_data heartbeat_data = { 24static struct resource heartbeat_resource = {
25 .regsize = 16, 25 .start = PA_LED,
26}; 26 .end = PA_LED,
27 27 .flags = IORESOURCE_MEM | IORESOURCE_MEM_16BIT,
28static struct resource heartbeat_resources[] = {
29 [0] = {
30 .start = PA_LED,
31 .end = PA_LED,
32 .flags = IORESOURCE_MEM,
33 },
34}; 28};
35 29
36static struct platform_device heartbeat_device = { 30static struct platform_device heartbeat_device = {
37 .name = "heartbeat", 31 .name = "heartbeat",
38 .id = -1, 32 .id = -1,
39 .dev = { 33 .num_resources = 1,
40 .platform_data = &heartbeat_data, 34 .resource = &heartbeat_resource,
41 },
42 .num_resources = ARRAY_SIZE(heartbeat_resources),
43 .resource = heartbeat_resources,
44}; 35};
45 36
46/* SMC91x */ 37/* SMC91x */
@@ -83,8 +74,8 @@ device_initcall(sdk7780_devices_setup);
83 74
84static void __init sdk7780_setup(char **cmdline_p) 75static void __init sdk7780_setup(char **cmdline_p)
85{ 76{
86 u16 ver = ctrl_inw(FPGA_FPVERR); 77 u16 ver = __raw_readw(FPGA_FPVERR);
87 u16 dateStamp = ctrl_inw(FPGA_FPDATER); 78 u16 dateStamp = __raw_readw(FPGA_FPDATER);
88 79
89 printk(KERN_INFO "Renesas Technology Europe SDK7780 support.\n"); 80 printk(KERN_INFO "Renesas Technology Europe SDK7780 support.\n");
90 printk(KERN_INFO "Board version: %d (revision %d), " 81 printk(KERN_INFO "Board version: %d (revision %d), "
@@ -94,7 +85,7 @@ static void __init sdk7780_setup(char **cmdline_p)
94 dateStamp); 85 dateStamp);
95 86
96 /* Setup pin mux'ing for PCIC */ 87 /* Setup pin mux'ing for PCIC */
97 ctrl_outw(0x0000, GPIO_PECR); 88 __raw_writew(0x0000, GPIO_PECR);
98} 89}
99 90
100/* 91/*
diff --git a/arch/sh/boards/mach-sdk7786/Makefile b/arch/sh/boards/mach-sdk7786/Makefile
new file mode 100644
index 000000000000..a29f19e85b63
--- /dev/null
+++ b/arch/sh/boards/mach-sdk7786/Makefile
@@ -0,0 +1 @@
obj-y := setup.o fpga.o irq.o
diff --git a/arch/sh/boards/mach-sdk7786/fpga.c b/arch/sh/boards/mach-sdk7786/fpga.c
new file mode 100644
index 000000000000..3e4ec66a0417
--- /dev/null
+++ b/arch/sh/boards/mach-sdk7786/fpga.c
@@ -0,0 +1,72 @@
1/*
2 * SDK7786 FPGA Support.
3 *
4 * Copyright (C) 2010 Paul Mundt
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/io.h>
12#include <linux/bcd.h>
13#include <mach/fpga.h>
14#include <asm/sizes.h>
15
16#define FPGA_REGS_OFFSET 0x03fff800
17#define FPGA_REGS_SIZE 0x490
18
19/*
20 * The FPGA can be mapped in any of the generally available areas,
21 * so we attempt to scan for it using the fixed SRSTR read magic.
22 *
23 * Once the FPGA is located, the rest of the mapping data for the other
24 * components can be determined dynamically from its section mapping
25 * registers.
26 */
27static void __iomem *sdk7786_fpga_probe(void)
28{
29 unsigned long area;
30 void __iomem *base;
31
32 /*
33 * Iterate over all of the areas where the FPGA could be mapped.
34 * The possible range is anywhere from area 0 through 6, area 7
35 * is reserved.
36 */
37 for (area = PA_AREA0; area < PA_AREA7; area += SZ_64M) {
38 base = ioremap_nocache(area + FPGA_REGS_OFFSET, FPGA_REGS_SIZE);
39 if (!base) {
40 /* Failed to remap this area, move along. */
41 continue;
42 }
43
44 if (ioread16(base + SRSTR) == SRSTR_MAGIC)
45 return base; /* Found it! */
46
47 iounmap(base);
48 }
49
50 return NULL;
51}
52
53void __iomem *sdk7786_fpga_base;
54
55void __init sdk7786_fpga_init(void)
56{
57 u16 version, date;
58
59 sdk7786_fpga_base = sdk7786_fpga_probe();
60 if (unlikely(!sdk7786_fpga_base)) {
61 panic("FPGA detection failed.\n");
62 return;
63 }
64
65 version = fpga_read_reg(FPGAVR);
66 date = fpga_read_reg(FPGADR);
67
68 pr_info("\tFPGA version:\t%d.%d (built on %d/%d/%d)\n",
69 bcd2bin(version >> 8) & 0xf, bcd2bin(version & 0xf),
70 ((date >> 12) & 0xf) + 2000,
71 (date >> 8) & 0xf, bcd2bin(date & 0xff));
72}
diff --git a/arch/sh/boards/mach-sdk7786/irq.c b/arch/sh/boards/mach-sdk7786/irq.c
new file mode 100644
index 000000000000..46943a0da5b7
--- /dev/null
+++ b/arch/sh/boards/mach-sdk7786/irq.c
@@ -0,0 +1,48 @@
1/*
2 * SDK7786 FPGA IRQ Controller Support.
3 *
4 * Copyright (C) 2010 Matt Fleming
5 * Copyright (C) 2010 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#include <linux/irq.h>
12#include <mach/fpga.h>
13#include <mach/irq.h>
14
15enum {
16 ATA_IRQ_BIT = 1,
17 SPI_BUSY_BIT = 2,
18 LIRQ5_BIT = 3,
19 LIRQ6_BIT = 4,
20 LIRQ7_BIT = 5,
21 LIRQ8_BIT = 6,
22 KEY_IRQ_BIT = 7,
23 PEN_IRQ_BIT = 8,
24 ETH_IRQ_BIT = 9,
25 RTC_ALARM_BIT = 10,
26 CRYSTAL_FAIL_BIT = 12,
27 ETH_PME_BIT = 14,
28};
29
30void __init sdk7786_init_irq(void)
31{
32 unsigned int tmp;
33
34 /* Enable priority encoding for all IRLs */
35 fpga_write_reg(fpga_read_reg(INTMSR) | 0x0303, INTMSR);
36
37 /* Clear FPGA interrupt status registers */
38 fpga_write_reg(0x0000, INTASR);
39 fpga_write_reg(0x0000, INTBSR);
40
41 /* Unmask FPGA interrupts */
42 tmp = fpga_read_reg(INTAMR);
43 tmp &= ~(1 << ETH_IRQ_BIT);
44 fpga_write_reg(tmp, INTAMR);
45
46 plat_irq_setup_pins(IRQ_MODE_IRL7654_MASK);
47 plat_irq_setup_pins(IRQ_MODE_IRL3210_MASK);
48}
diff --git a/arch/sh/boards/mach-sdk7786/setup.c b/arch/sh/boards/mach-sdk7786/setup.c
new file mode 100644
index 000000000000..f094ea2ee783
--- /dev/null
+++ b/arch/sh/boards/mach-sdk7786/setup.c
@@ -0,0 +1,189 @@
1/*
2 * Renesas Technology Europe SDK7786 Support.
3 *
4 * Copyright (C) 2010 Matt Fleming
5 * Copyright (C) 2010 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#include <linux/init.h>
12#include <linux/platform_device.h>
13#include <linux/io.h>
14#include <linux/smsc911x.h>
15#include <linux/i2c.h>
16#include <linux/irq.h>
17#include <linux/clk.h>
18#include <mach/fpga.h>
19#include <mach/irq.h>
20#include <asm/machvec.h>
21#include <asm/heartbeat.h>
22#include <asm/sizes.h>
23#include <asm/reboot.h>
24
25static struct resource heartbeat_resource = {
26 .start = 0x07fff8b0,
27 .end = 0x07fff8b0 + sizeof(u16) - 1,
28 .flags = IORESOURCE_MEM | IORESOURCE_MEM_16BIT,
29};
30
31static struct platform_device heartbeat_device = {
32 .name = "heartbeat",
33 .id = -1,
34 .num_resources = 1,
35 .resource = &heartbeat_resource,
36};
37
38static struct resource smsc911x_resources[] = {
39 [0] = {
40 .name = "smsc911x-memory",
41 .start = 0x07ffff00,
42 .end = 0x07ffff00 + SZ_256 - 1,
43 .flags = IORESOURCE_MEM,
44 },
45 [1] = {
46 .name = "smsc911x-irq",
47 .start = evt2irq(0x2c0),
48 .end = evt2irq(0x2c0),
49 .flags = IORESOURCE_IRQ,
50 },
51};
52
53static struct smsc911x_platform_config smsc911x_config = {
54 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
55 .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
56 .flags = SMSC911X_USE_32BIT,
57 .phy_interface = PHY_INTERFACE_MODE_MII,
58};
59
60static struct platform_device smsc911x_device = {
61 .name = "smsc911x",
62 .id = -1,
63 .num_resources = ARRAY_SIZE(smsc911x_resources),
64 .resource = smsc911x_resources,
65 .dev = {
66 .platform_data = &smsc911x_config,
67 },
68};
69
70static struct resource smbus_fpga_resource = {
71 .start = 0x07fff9e0,
72 .end = 0x07fff9e0 + SZ_32 - 1,
73 .flags = IORESOURCE_MEM,
74};
75
76static struct platform_device smbus_fpga_device = {
77 .name = "i2c-sdk7786",
78 .id = 0,
79 .num_resources = 1,
80 .resource = &smbus_fpga_resource,
81};
82
83static struct resource smbus_pcie_resource = {
84 .start = 0x07fffc30,
85 .end = 0x07fffc30 + SZ_32 - 1,
86 .flags = IORESOURCE_MEM,
87};
88
89static struct platform_device smbus_pcie_device = {
90 .name = "i2c-sdk7786",
91 .id = 1,
92 .num_resources = 1,
93 .resource = &smbus_pcie_resource,
94};
95
96static struct i2c_board_info __initdata sdk7786_i2c_devices[] = {
97 {
98 I2C_BOARD_INFO("max6900", 0x68),
99 },
100};
101
102static struct platform_device *sh7786_devices[] __initdata = {
103 &heartbeat_device,
104 &smsc911x_device,
105 &smbus_fpga_device,
106 &smbus_pcie_device,
107};
108
109static int sdk7786_i2c_setup(void)
110{
111 unsigned int tmp;
112
113 /*
114 * Hand over I2C control to the FPGA.
115 */
116 tmp = fpga_read_reg(SBCR);
117 tmp &= ~SCBR_I2CCEN;
118 tmp |= SCBR_I2CMEN;
119 fpga_write_reg(tmp, SBCR);
120
121 return i2c_register_board_info(0, sdk7786_i2c_devices,
122 ARRAY_SIZE(sdk7786_i2c_devices));
123}
124
125static int __init sdk7786_devices_setup(void)
126{
127 int ret;
128
129 ret = platform_add_devices(sh7786_devices, ARRAY_SIZE(sh7786_devices));
130 if (unlikely(ret != 0))
131 return ret;
132
133 return sdk7786_i2c_setup();
134}
135__initcall(sdk7786_devices_setup);
136
137static int sdk7786_mode_pins(void)
138{
139 return fpga_read_reg(MODSWR);
140}
141
142static int sdk7786_clk_init(void)
143{
144 struct clk *clk;
145 int ret;
146
147 /*
148 * Only handle the EXTAL case, anyone interfacing a crystal
149 * resonator will need to provide their own input clock.
150 */
151 if (test_mode_pin(MODE_PIN9))
152 return -EINVAL;
153
154 clk = clk_get(NULL, "extal");
155 if (!clk || IS_ERR(clk))
156 return PTR_ERR(clk);
157 ret = clk_set_rate(clk, 33333333);
158 clk_put(clk);
159
160 return ret;
161}
162
163static void sdk7786_restart(char *cmd)
164{
165 fpga_write_reg(0xa5a5, SRSTR);
166}
167
168/* Initialize the board */
169static void __init sdk7786_setup(char **cmdline_p)
170{
171 pr_info("Renesas Technology Europe SDK7786 support:\n");
172
173 sdk7786_fpga_init();
174
175 pr_info("\tPCB revision:\t%d\n", fpga_read_reg(PCBRR) & 0xf);
176
177 machine_ops.restart = sdk7786_restart;
178}
179
180/*
181 * The Machine Vector
182 */
183static struct sh_machine_vector mv_sdk7786 __initmv = {
184 .mv_name = "SDK7786",
185 .mv_setup = sdk7786_setup,
186 .mv_mode_pins = sdk7786_mode_pins,
187 .mv_clk_init = sdk7786_clk_init,
188 .mv_init_irq = sdk7786_init_irq,
189};
diff --git a/arch/sh/boards/mach-se/7206/io.c b/arch/sh/boards/mach-se/7206/io.c
index 180455642a43..adadc77532ee 100644
--- a/arch/sh/boards/mach-se/7206/io.c
+++ b/arch/sh/boards/mach-se/7206/io.c
@@ -16,7 +16,7 @@
16 16
17static inline void delay(void) 17static inline void delay(void)
18{ 18{
19 ctrl_inw(0x20000000); /* P2 ROM Area */ 19 __raw_readw(0x20000000); /* P2 ROM Area */
20} 20}
21 21
22/* MS7750 requires special versions of in*, out* routines, since 22/* MS7750 requires special versions of in*, out* routines, since
diff --git a/arch/sh/boards/mach-se/7206/irq.c b/arch/sh/boards/mach-se/7206/irq.c
index aef7f052851a..8d82175d83ab 100644
--- a/arch/sh/boards/mach-se/7206/irq.c
+++ b/arch/sh/boards/mach-se/7206/irq.c
@@ -32,12 +32,12 @@ static void disable_se7206_irq(unsigned int irq)
32 unsigned short msk0,msk1; 32 unsigned short msk0,msk1;
33 33
34 /* Set the priority in IPR to 0 */ 34 /* Set the priority in IPR to 0 */
35 val = ctrl_inw(INTC_IPR01); 35 val = __raw_readw(INTC_IPR01);
36 val &= mask; 36 val &= mask;
37 ctrl_outw(val, INTC_IPR01); 37 __raw_writew(val, INTC_IPR01);
38 /* FPGA mask set */ 38 /* FPGA mask set */
39 msk0 = ctrl_inw(INTMSK0); 39 msk0 = __raw_readw(INTMSK0);
40 msk1 = ctrl_inw(INTMSK1); 40 msk1 = __raw_readw(INTMSK1);
41 41
42 switch (irq) { 42 switch (irq) {
43 case IRQ0_IRQ: 43 case IRQ0_IRQ:
@@ -51,8 +51,8 @@ static void disable_se7206_irq(unsigned int irq)
51 msk1 |= 0x00ff; 51 msk1 |= 0x00ff;
52 break; 52 break;
53 } 53 }
54 ctrl_outw(msk0, INTMSK0); 54 __raw_writew(msk0, INTMSK0);
55 ctrl_outw(msk1, INTMSK1); 55 __raw_writew(msk1, INTMSK1);
56} 56}
57 57
58static void enable_se7206_irq(unsigned int irq) 58static void enable_se7206_irq(unsigned int irq)
@@ -62,13 +62,13 @@ static void enable_se7206_irq(unsigned int irq)
62 unsigned short msk0,msk1; 62 unsigned short msk0,msk1;
63 63
64 /* Set priority in IPR back to original value */ 64 /* Set priority in IPR back to original value */
65 val = ctrl_inw(INTC_IPR01); 65 val = __raw_readw(INTC_IPR01);
66 val |= value; 66 val |= value;
67 ctrl_outw(val, INTC_IPR01); 67 __raw_writew(val, INTC_IPR01);
68 68
69 /* FPGA mask reset */ 69 /* FPGA mask reset */
70 msk0 = ctrl_inw(INTMSK0); 70 msk0 = __raw_readw(INTMSK0);
71 msk1 = ctrl_inw(INTMSK1); 71 msk1 = __raw_readw(INTMSK1);
72 72
73 switch (irq) { 73 switch (irq) {
74 case IRQ0_IRQ: 74 case IRQ0_IRQ:
@@ -82,19 +82,20 @@ static void enable_se7206_irq(unsigned int irq)
82 msk1 &= ~0x00ff; 82 msk1 &= ~0x00ff;
83 break; 83 break;
84 } 84 }
85 ctrl_outw(msk0, INTMSK0); 85 __raw_writew(msk0, INTMSK0);
86 ctrl_outw(msk1, INTMSK1); 86 __raw_writew(msk1, INTMSK1);
87} 87}
88 88
89static void eoi_se7206_irq(unsigned int irq) 89static void eoi_se7206_irq(unsigned int irq)
90{ 90{
91 unsigned short sts0,sts1; 91 unsigned short sts0,sts1;
92 struct irq_desc *desc = irq_to_desc(irq);
92 93
93 if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS))) 94 if (!(desc->status & (IRQ_DISABLED|IRQ_INPROGRESS)))
94 enable_se7206_irq(irq); 95 enable_se7206_irq(irq);
95 /* FPGA isr clear */ 96 /* FPGA isr clear */
96 sts0 = ctrl_inw(INTSTS0); 97 sts0 = __raw_readw(INTSTS0);
97 sts1 = ctrl_inw(INTSTS1); 98 sts1 = __raw_readw(INTSTS1);
98 99
99 switch (irq) { 100 switch (irq) {
100 case IRQ0_IRQ: 101 case IRQ0_IRQ:
@@ -108,8 +109,8 @@ static void eoi_se7206_irq(unsigned int irq)
108 sts1 &= ~0x00ff; 109 sts1 &= ~0x00ff;
109 break; 110 break;
110 } 111 }
111 ctrl_outw(sts0, INTSTS0); 112 __raw_writew(sts0, INTSTS0);
112 ctrl_outw(sts1, INTSTS1); 113 __raw_writew(sts1, INTSTS1);
113} 114}
114 115
115static struct irq_chip se7206_irq_chip __read_mostly = { 116static struct irq_chip se7206_irq_chip __read_mostly = {
@@ -136,11 +137,11 @@ void __init init_se7206_IRQ(void)
136 make_se7206_irq(IRQ0_IRQ); /* SMC91C111 */ 137 make_se7206_irq(IRQ0_IRQ); /* SMC91C111 */
137 make_se7206_irq(IRQ1_IRQ); /* ATA */ 138 make_se7206_irq(IRQ1_IRQ); /* ATA */
138 make_se7206_irq(IRQ3_IRQ); /* SLOT / PCM */ 139 make_se7206_irq(IRQ3_IRQ); /* SLOT / PCM */
139 ctrl_outw(inw(INTC_ICR1) | 0x000b ,INTC_ICR1 ) ; /* ICR1 */ 140 __raw_writew(inw(INTC_ICR1) | 0x000b ,INTC_ICR1 ) ; /* ICR1 */
140 141
141 /* FPGA System register setup*/ 142 /* FPGA System register setup*/
142 ctrl_outw(0x0000,INTSTS0); /* Clear INTSTS0 */ 143 __raw_writew(0x0000,INTSTS0); /* Clear INTSTS0 */
143 ctrl_outw(0x0000,INTSTS1); /* Clear INTSTS1 */ 144 __raw_writew(0x0000,INTSTS1); /* Clear INTSTS1 */
144 /* IRQ0=LAN, IRQ1=ATA, IRQ3=SLT,PCM */ 145 /* IRQ0=LAN, IRQ1=ATA, IRQ3=SLT,PCM */
145 ctrl_outw(0x0001,INTSEL); 146 __raw_writew(0x0001,INTSEL);
146} 147}
diff --git a/arch/sh/boards/mach-se/7206/setup.c b/arch/sh/boards/mach-se/7206/setup.c
index f5466384972e..8f5c65d43d1d 100644
--- a/arch/sh/boards/mach-se/7206/setup.c
+++ b/arch/sh/boards/mach-se/7206/setup.c
@@ -50,15 +50,12 @@ static unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 };
50static struct heartbeat_data heartbeat_data = { 50static struct heartbeat_data heartbeat_data = {
51 .bit_pos = heartbeat_bit_pos, 51 .bit_pos = heartbeat_bit_pos,
52 .nr_bits = ARRAY_SIZE(heartbeat_bit_pos), 52 .nr_bits = ARRAY_SIZE(heartbeat_bit_pos),
53 .regsize = 32,
54}; 53};
55 54
56static struct resource heartbeat_resources[] = { 55static struct resource heartbeat_resource = {
57 [0] = { 56 .start = PA_LED,
58 .start = PA_LED, 57 .end = PA_LED,
59 .end = PA_LED, 58 .flags = IORESOURCE_MEM | IORESOURCE_MEM_32BIT,
60 .flags = IORESOURCE_MEM,
61 },
62}; 59};
63 60
64static struct platform_device heartbeat_device = { 61static struct platform_device heartbeat_device = {
@@ -67,8 +64,8 @@ static struct platform_device heartbeat_device = {
67 .dev = { 64 .dev = {
68 .platform_data = &heartbeat_data, 65 .platform_data = &heartbeat_data,
69 }, 66 },
70 .num_resources = ARRAY_SIZE(heartbeat_resources), 67 .num_resources = 1,
71 .resource = heartbeat_resources, 68 .resource = &heartbeat_resource,
72}; 69};
73 70
74static struct platform_device *se7206_devices[] __initdata = { 71static struct platform_device *se7206_devices[] __initdata = {
diff --git a/arch/sh/boards/mach-se/7343/irq.c b/arch/sh/boards/mach-se/7343/irq.c
index 051c29d4eae0..d4305c26e9f7 100644
--- a/arch/sh/boards/mach-se/7343/irq.c
+++ b/arch/sh/boards/mach-se/7343/irq.c
@@ -16,16 +16,18 @@
16#include <linux/io.h> 16#include <linux/io.h>
17#include <mach-se/mach/se7343.h> 17#include <mach-se/mach/se7343.h>
18 18
19unsigned int se7343_fpga_irq[SE7343_FPGA_IRQ_NR] = { 0, };
20
19static void disable_se7343_irq(unsigned int irq) 21static void disable_se7343_irq(unsigned int irq)
20{ 22{
21 unsigned int bit = irq - SE7343_FPGA_IRQ_BASE; 23 unsigned int bit = (unsigned int)get_irq_chip_data(irq);
22 ctrl_outw(ctrl_inw(PA_CPLD_IMSK) | 1 << bit, PA_CPLD_IMSK); 24 __raw_writew(__raw_readw(PA_CPLD_IMSK) | 1 << bit, PA_CPLD_IMSK);
23} 25}
24 26
25static void enable_se7343_irq(unsigned int irq) 27static void enable_se7343_irq(unsigned int irq)
26{ 28{
27 unsigned int bit = irq - SE7343_FPGA_IRQ_BASE; 29 unsigned int bit = (unsigned int)get_irq_chip_data(irq);
28 ctrl_outw(ctrl_inw(PA_CPLD_IMSK) & ~(1 << bit), PA_CPLD_IMSK); 30 __raw_writew(__raw_readw(PA_CPLD_IMSK) & ~(1 << bit), PA_CPLD_IMSK);
29} 31}
30 32
31static struct irq_chip se7343_irq_chip __read_mostly = { 33static struct irq_chip se7343_irq_chip __read_mostly = {
@@ -37,19 +39,16 @@ static struct irq_chip se7343_irq_chip __read_mostly = {
37 39
38static void se7343_irq_demux(unsigned int irq, struct irq_desc *desc) 40static void se7343_irq_demux(unsigned int irq, struct irq_desc *desc)
39{ 41{
40 unsigned short intv = ctrl_inw(PA_CPLD_ST); 42 unsigned short intv = __raw_readw(PA_CPLD_ST);
41 struct irq_desc *ext_desc; 43 unsigned int ext_irq = 0;
42 unsigned int ext_irq = SE7343_FPGA_IRQ_BASE;
43 44
44 intv &= (1 << SE7343_FPGA_IRQ_NR) - 1; 45 intv &= (1 << SE7343_FPGA_IRQ_NR) - 1;
45 46
46 while (intv) { 47 for (; intv; intv >>= 1, ext_irq++) {
47 if (intv & 1) { 48 if (!(intv & 1))
48 ext_desc = irq_desc + ext_irq; 49 continue;
49 handle_level_irq(ext_irq, ext_desc); 50
50 } 51 generic_handle_irq(se7343_fpga_irq[ext_irq]);
51 intv >>= 1;
52 ext_irq++;
53 } 52 }
54} 53}
55 54
@@ -58,16 +57,24 @@ static void se7343_irq_demux(unsigned int irq, struct irq_desc *desc)
58 */ 57 */
59void __init init_7343se_IRQ(void) 58void __init init_7343se_IRQ(void)
60{ 59{
61 int i; 60 int i, irq;
61
62 __raw_writew(0, PA_CPLD_IMSK); /* disable all irqs */
63 __raw_writew(0x2000, 0xb03fffec); /* mrshpc irq enable */
62 64
63 ctrl_outw(0, PA_CPLD_IMSK); /* disable all irqs */ 65 for (i = 0; i < SE7343_FPGA_IRQ_NR; i++) {
64 ctrl_outw(0x2000, 0xb03fffec); /* mrshpc irq enable */ 66 irq = create_irq();
67 if (irq < 0)
68 return;
69 se7343_fpga_irq[i] = irq;
65 70
66 for (i = 0; i < SE7343_FPGA_IRQ_NR; i++) 71 set_irq_chip_and_handler_name(se7343_fpga_irq[i],
67 set_irq_chip_and_handler_name(SE7343_FPGA_IRQ_BASE + i,
68 &se7343_irq_chip, 72 &se7343_irq_chip,
69 handle_level_irq, "level"); 73 handle_level_irq, "level");
70 74
75 set_irq_chip_data(se7343_fpga_irq[i], (void *)i);
76 }
77
71 set_irq_chained_handler(IRQ0_IRQ, se7343_irq_demux); 78 set_irq_chained_handler(IRQ0_IRQ, se7343_irq_demux);
72 set_irq_type(IRQ0_IRQ, IRQ_TYPE_LEVEL_LOW); 79 set_irq_type(IRQ0_IRQ, IRQ_TYPE_LEVEL_LOW);
73 set_irq_chained_handler(IRQ1_IRQ, se7343_irq_demux); 80 set_irq_chained_handler(IRQ1_IRQ, se7343_irq_demux);
diff --git a/arch/sh/boards/mach-se/7343/setup.c b/arch/sh/boards/mach-se/7343/setup.c
index 4de56f35f419..d2370af56d77 100644
--- a/arch/sh/boards/mach-se/7343/setup.c
+++ b/arch/sh/boards/mach-se/7343/setup.c
@@ -11,26 +11,17 @@
11#include <asm/irq.h> 11#include <asm/irq.h>
12#include <asm/io.h> 12#include <asm/io.h>
13 13
14static struct resource heartbeat_resources[] = { 14static struct resource heartbeat_resource = {
15 [0] = { 15 .start = PA_LED,
16 .start = PA_LED, 16 .end = PA_LED,
17 .end = PA_LED, 17 .flags = IORESOURCE_MEM | IORESOURCE_MEM_16BIT,
18 .flags = IORESOURCE_MEM,
19 },
20};
21
22static struct heartbeat_data heartbeat_data = {
23 .regsize = 16,
24}; 18};
25 19
26static struct platform_device heartbeat_device = { 20static struct platform_device heartbeat_device = {
27 .name = "heartbeat", 21 .name = "heartbeat",
28 .id = -1, 22 .id = -1,
29 .dev = { 23 .num_resources = 1,
30 .platform_data = &heartbeat_data, 24 .resource = &heartbeat_resource,
31 },
32 .num_resources = ARRAY_SIZE(heartbeat_resources),
33 .resource = heartbeat_resources,
34}; 25};
35 26
36static struct mtd_partition nor_flash_partitions[] = { 27static struct mtd_partition nor_flash_partitions[] = {
@@ -82,7 +73,6 @@ static struct plat_serial8250_port serial_platform_data[] = {
82 .mapbase = 0x16000000, 73 .mapbase = 0x16000000,
83 .regshift = 1, 74 .regshift = 1,
84 .flags = ST16C2550C_FLAGS, 75 .flags = ST16C2550C_FLAGS,
85 .irq = UARTA_IRQ,
86 .uartclk = 7372800, 76 .uartclk = 7372800,
87 }, 77 },
88 [1] = { 78 [1] = {
@@ -90,7 +80,6 @@ static struct plat_serial8250_port serial_platform_data[] = {
90 .mapbase = 0x17000000, 80 .mapbase = 0x17000000,
91 .regshift = 1, 81 .regshift = 1,
92 .flags = ST16C2550C_FLAGS, 82 .flags = ST16C2550C_FLAGS,
93 .irq = UARTB_IRQ,
94 .uartclk = 7372800, 83 .uartclk = 7372800,
95 }, 84 },
96 { }, 85 { },
@@ -121,7 +110,7 @@ static struct resource usb_resources[] = {
121 .flags = IORESOURCE_MEM, 110 .flags = IORESOURCE_MEM,
122 }, 111 },
123 [2] = { 112 [2] = {
124 .start = USB_IRQ, 113 /* Filled in later */
125 .flags = IORESOURCE_IRQ, 114 .flags = IORESOURCE_IRQ,
126 }, 115 },
127}; 116};
@@ -138,8 +127,8 @@ static struct isp116x_platform_data usb_platform_data = {
138static struct platform_device usb_device = { 127static struct platform_device usb_device = {
139 .name = "isp116x-hcd", 128 .name = "isp116x-hcd",
140 .id = -1, 129 .id = -1,
141 .num_resources = ARRAY_SIZE(usb_resources), 130 .num_resources = ARRAY_SIZE(usb_resources),
142 .resource = usb_resources, 131 .resource = usb_resources,
143 .dev = { 132 .dev = {
144 .platform_data = &usb_platform_data, 133 .platform_data = &usb_platform_data,
145 }, 134 },
@@ -155,6 +144,13 @@ static struct platform_device *sh7343se_platform_devices[] __initdata = {
155 144
156static int __init sh7343se_devices_setup(void) 145static int __init sh7343se_devices_setup(void)
157{ 146{
147 /* Wire-up dynamic vectors */
148 serial_platform_data[0].irq = se7343_fpga_irq[SE7343_FPGA_IRQ_UARTA];
149 serial_platform_data[1].irq = se7343_fpga_irq[SE7343_FPGA_IRQ_UARTB];
150
151 usb_resources[2].start = usb_resources[2].end =
152 se7343_fpga_irq[SE7343_FPGA_IRQ_USB];
153
158 return platform_add_devices(sh7343se_platform_devices, 154 return platform_add_devices(sh7343se_platform_devices,
159 ARRAY_SIZE(sh7343se_platform_devices)); 155 ARRAY_SIZE(sh7343se_platform_devices));
160} 156}
@@ -165,10 +161,10 @@ device_initcall(sh7343se_devices_setup);
165 */ 161 */
166static void __init sh7343se_setup(char **cmdline_p) 162static void __init sh7343se_setup(char **cmdline_p)
167{ 163{
168 ctrl_outw(0xf900, FPGA_OUT); /* FPGA */ 164 __raw_writew(0xf900, FPGA_OUT); /* FPGA */
169 165
170 ctrl_outw(0x0002, PORT_PECR); /* PORT E 1 = IRQ5 */ 166 __raw_writew(0x0002, PORT_PECR); /* PORT E 1 = IRQ5 */
171 ctrl_outw(0x0020, PORT_PSELD); 167 __raw_writew(0x0020, PORT_PSELD);
172 168
173 printk(KERN_INFO "MS7343CP01 Setup...done\n"); 169 printk(KERN_INFO "MS7343CP01 Setup...done\n");
174} 170}
@@ -179,6 +175,5 @@ static void __init sh7343se_setup(char **cmdline_p)
179static struct sh_machine_vector mv_7343se __initmv = { 175static struct sh_machine_vector mv_7343se __initmv = {
180 .mv_name = "SolutionEngine 7343", 176 .mv_name = "SolutionEngine 7343",
181 .mv_setup = sh7343se_setup, 177 .mv_setup = sh7343se_setup,
182 .mv_nr_irqs = SE7343_FPGA_IRQ_BASE + SE7343_FPGA_IRQ_NR,
183 .mv_init_irq = init_7343se_IRQ, 178 .mv_init_irq = init_7343se_IRQ,
184}; 179};
diff --git a/arch/sh/boards/mach-se/770x/irq.c b/arch/sh/boards/mach-se/770x/irq.c
index ec1fea571b52..1028c17b81bc 100644
--- a/arch/sh/boards/mach-se/770x/irq.c
+++ b/arch/sh/boards/mach-se/770x/irq.c
@@ -96,13 +96,13 @@ static struct ipr_desc ipr_irq_desc = {
96void __init init_se_IRQ(void) 96void __init init_se_IRQ(void)
97{ 97{
98 /* Disable all interrupts */ 98 /* Disable all interrupts */
99 ctrl_outw(0, BCR_ILCRA); 99 __raw_writew(0, BCR_ILCRA);
100 ctrl_outw(0, BCR_ILCRB); 100 __raw_writew(0, BCR_ILCRB);
101 ctrl_outw(0, BCR_ILCRC); 101 __raw_writew(0, BCR_ILCRC);
102 ctrl_outw(0, BCR_ILCRD); 102 __raw_writew(0, BCR_ILCRD);
103 ctrl_outw(0, BCR_ILCRE); 103 __raw_writew(0, BCR_ILCRE);
104 ctrl_outw(0, BCR_ILCRF); 104 __raw_writew(0, BCR_ILCRF);
105 ctrl_outw(0, BCR_ILCRG); 105 __raw_writew(0, BCR_ILCRG);
106 106
107 register_ipr_controller(&ipr_irq_desc); 107 register_ipr_controller(&ipr_irq_desc);
108} 108}
diff --git a/arch/sh/boards/mach-se/770x/setup.c b/arch/sh/boards/mach-se/770x/setup.c
index 527eb6b12610..66d39d1b0901 100644
--- a/arch/sh/boards/mach-se/770x/setup.c
+++ b/arch/sh/boards/mach-se/770x/setup.c
@@ -93,15 +93,12 @@ static unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 };
93static struct heartbeat_data heartbeat_data = { 93static struct heartbeat_data heartbeat_data = {
94 .bit_pos = heartbeat_bit_pos, 94 .bit_pos = heartbeat_bit_pos,
95 .nr_bits = ARRAY_SIZE(heartbeat_bit_pos), 95 .nr_bits = ARRAY_SIZE(heartbeat_bit_pos),
96 .regsize = 16,
97}; 96};
98 97
99static struct resource heartbeat_resources[] = { 98static struct resource heartbeat_resource = {
100 [0] = { 99 .start = PA_LED,
101 .start = PA_LED, 100 .end = PA_LED,
102 .end = PA_LED, 101 .flags = IORESOURCE_MEM | IORESOURCE_MEM_16BIT,
103 .flags = IORESOURCE_MEM,
104 },
105}; 102};
106 103
107static struct platform_device heartbeat_device = { 104static struct platform_device heartbeat_device = {
@@ -110,8 +107,8 @@ static struct platform_device heartbeat_device = {
110 .dev = { 107 .dev = {
111 .platform_data = &heartbeat_data, 108 .platform_data = &heartbeat_data,
112 }, 109 },
113 .num_resources = ARRAY_SIZE(heartbeat_resources), 110 .num_resources = 1,
114 .resource = heartbeat_resources, 111 .resource = &heartbeat_resource,
115}; 112};
116 113
117#if defined(CONFIG_CPU_SUBTYPE_SH7710) ||\ 114#if defined(CONFIG_CPU_SUBTYPE_SH7710) ||\
diff --git a/arch/sh/boards/mach-se/7721/irq.c b/arch/sh/boards/mach-se/7721/irq.c
index b417acc4dad0..d85022ea3f12 100644
--- a/arch/sh/boards/mach-se/7721/irq.c
+++ b/arch/sh/boards/mach-se/7721/irq.c
@@ -38,7 +38,7 @@ static DECLARE_INTC_DESC(intc_desc, "SE7721", vectors,
38void __init init_se7721_IRQ(void) 38void __init init_se7721_IRQ(void)
39{ 39{
40 /* PPCR */ 40 /* PPCR */
41 ctrl_outw(ctrl_inw(0xa4050118) & ~0x00ff, 0xa4050118); 41 __raw_writew(__raw_readw(0xa4050118) & ~0x00ff, 0xa4050118);
42 42
43 register_intc_controller(&intc_desc); 43 register_intc_controller(&intc_desc);
44 intc_set_priority(MRSHPC_IRQ0, 0xf - MRSHPC_IRQ0); 44 intc_set_priority(MRSHPC_IRQ0, 0xf - MRSHPC_IRQ0);
diff --git a/arch/sh/boards/mach-se/7721/setup.c b/arch/sh/boards/mach-se/7721/setup.c
index 55af4c36b43a..7416ad7ee53a 100644
--- a/arch/sh/boards/mach-se/7721/setup.c
+++ b/arch/sh/boards/mach-se/7721/setup.c
@@ -23,15 +23,12 @@ static unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 };
23static struct heartbeat_data heartbeat_data = { 23static struct heartbeat_data heartbeat_data = {
24 .bit_pos = heartbeat_bit_pos, 24 .bit_pos = heartbeat_bit_pos,
25 .nr_bits = ARRAY_SIZE(heartbeat_bit_pos), 25 .nr_bits = ARRAY_SIZE(heartbeat_bit_pos),
26 .regsize = 16,
27}; 26};
28 27
29static struct resource heartbeat_resources[] = { 28static struct resource heartbeat_resource = {
30 [0] = { 29 .start = PA_LED,
31 .start = PA_LED, 30 .end = PA_LED,
32 .end = PA_LED, 31 .flags = IORESOURCE_MEM | IORESOURCE_MEM_16BIT,
33 .flags = IORESOURCE_MEM,
34 },
35}; 32};
36 33
37static struct platform_device heartbeat_device = { 34static struct platform_device heartbeat_device = {
@@ -40,8 +37,8 @@ static struct platform_device heartbeat_device = {
40 .dev = { 37 .dev = {
41 .platform_data = &heartbeat_data, 38 .platform_data = &heartbeat_data,
42 }, 39 },
43 .num_resources = ARRAY_SIZE(heartbeat_resources), 40 .num_resources = 1,
44 .resource = heartbeat_resources, 41 .resource = &heartbeat_resource,
45}; 42};
46 43
47static struct resource cf_ide_resources[] = { 44static struct resource cf_ide_resources[] = {
@@ -83,10 +80,10 @@ device_initcall(se7721_devices_setup);
83static void __init se7721_setup(char **cmdline_p) 80static void __init se7721_setup(char **cmdline_p)
84{ 81{
85 /* for USB */ 82 /* for USB */
86 ctrl_outw(0x0000, 0xA405010C); /* PGCR */ 83 __raw_writew(0x0000, 0xA405010C); /* PGCR */
87 ctrl_outw(0x0000, 0xA405010E); /* PHCR */ 84 __raw_writew(0x0000, 0xA405010E); /* PHCR */
88 ctrl_outw(0x00AA, 0xA4050118); /* PPCR */ 85 __raw_writew(0x00AA, 0xA4050118); /* PPCR */
89 ctrl_outw(0x0000, 0xA4050124); /* PSELA */ 86 __raw_writew(0x0000, 0xA4050124); /* PSELA */
90} 87}
91 88
92/* 89/*
diff --git a/arch/sh/boards/mach-se/7722/irq.c b/arch/sh/boards/mach-se/7722/irq.c
index b221b6842b0d..61605db04ee6 100644
--- a/arch/sh/boards/mach-se/7722/irq.c
+++ b/arch/sh/boards/mach-se/7722/irq.c
@@ -21,13 +21,13 @@ unsigned int se7722_fpga_irq[SE7722_FPGA_IRQ_NR] = { 0, };
21static void disable_se7722_irq(unsigned int irq) 21static void disable_se7722_irq(unsigned int irq)
22{ 22{
23 unsigned int bit = (unsigned int)get_irq_chip_data(irq); 23 unsigned int bit = (unsigned int)get_irq_chip_data(irq);
24 ctrl_outw(ctrl_inw(IRQ01_MASK) | 1 << bit, IRQ01_MASK); 24 __raw_writew(__raw_readw(IRQ01_MASK) | 1 << bit, IRQ01_MASK);
25} 25}
26 26
27static void enable_se7722_irq(unsigned int irq) 27static void enable_se7722_irq(unsigned int irq)
28{ 28{
29 unsigned int bit = (unsigned int)get_irq_chip_data(irq); 29 unsigned int bit = (unsigned int)get_irq_chip_data(irq);
30 ctrl_outw(ctrl_inw(IRQ01_MASK) & ~(1 << bit), IRQ01_MASK); 30 __raw_writew(__raw_readw(IRQ01_MASK) & ~(1 << bit), IRQ01_MASK);
31} 31}
32 32
33static struct irq_chip se7722_irq_chip __read_mostly = { 33static struct irq_chip se7722_irq_chip __read_mostly = {
@@ -39,7 +39,7 @@ static struct irq_chip se7722_irq_chip __read_mostly = {
39 39
40static void se7722_irq_demux(unsigned int irq, struct irq_desc *desc) 40static void se7722_irq_demux(unsigned int irq, struct irq_desc *desc)
41{ 41{
42 unsigned short intv = ctrl_inw(IRQ01_STS); 42 unsigned short intv = __raw_readw(IRQ01_STS);
43 unsigned int ext_irq = 0; 43 unsigned int ext_irq = 0;
44 44
45 intv &= (1 << SE7722_FPGA_IRQ_NR) - 1; 45 intv &= (1 << SE7722_FPGA_IRQ_NR) - 1;
@@ -59,8 +59,8 @@ void __init init_se7722_IRQ(void)
59{ 59{
60 int i, irq; 60 int i, irq;
61 61
62 ctrl_outw(0, IRQ01_MASK); /* disable all irqs */ 62 __raw_writew(0, IRQ01_MASK); /* disable all irqs */
63 ctrl_outw(0x2000, 0xb03fffec); /* mrshpc irq enable */ 63 __raw_writew(0x2000, 0xb03fffec); /* mrshpc irq enable */
64 64
65 for (i = 0; i < SE7722_FPGA_IRQ_NR; i++) { 65 for (i = 0; i < SE7722_FPGA_IRQ_NR; i++) {
66 irq = create_irq(); 66 irq = create_irq();
diff --git a/arch/sh/boards/mach-se/7722/setup.c b/arch/sh/boards/mach-se/7722/setup.c
index b1cb9425b600..80a4e571b310 100644
--- a/arch/sh/boards/mach-se/7722/setup.c
+++ b/arch/sh/boards/mach-se/7722/setup.c
@@ -25,26 +25,17 @@
25#include <cpu/sh7722.h> 25#include <cpu/sh7722.h>
26 26
27/* Heartbeat */ 27/* Heartbeat */
28static struct heartbeat_data heartbeat_data = { 28static struct resource heartbeat_resource = {
29 .regsize = 16, 29 .start = PA_LED,
30}; 30 .end = PA_LED,
31 31 .flags = IORESOURCE_MEM | IORESOURCE_MEM_16BIT,
32static struct resource heartbeat_resources[] = {
33 [0] = {
34 .start = PA_LED,
35 .end = PA_LED,
36 .flags = IORESOURCE_MEM,
37 },
38}; 32};
39 33
40static struct platform_device heartbeat_device = { 34static struct platform_device heartbeat_device = {
41 .name = "heartbeat", 35 .name = "heartbeat",
42 .id = -1, 36 .id = -1,
43 .dev = { 37 .num_resources = 1,
44 .platform_data = &heartbeat_data, 38 .resource = &heartbeat_resource,
45 },
46 .num_resources = ARRAY_SIZE(heartbeat_resources),
47 .resource = heartbeat_resources,
48}; 39};
49 40
50/* SMC91x */ 41/* SMC91x */
@@ -165,32 +156,32 @@ device_initcall(se7722_devices_setup);
165 156
166static void __init se7722_setup(char **cmdline_p) 157static void __init se7722_setup(char **cmdline_p)
167{ 158{
168 ctrl_outw(0x010D, FPGA_OUT); /* FPGA */ 159 __raw_writew(0x010D, FPGA_OUT); /* FPGA */
169 160
170 ctrl_outw(0x0000, PORT_PECR); /* PORT E 1 = IRQ5 ,E 0 = BS */ 161 __raw_writew(0x0000, PORT_PECR); /* PORT E 1 = IRQ5 ,E 0 = BS */
171 ctrl_outw(0x1000, PORT_PJCR); /* PORT J 1 = IRQ1,J 0 =IRQ0 */ 162 __raw_writew(0x1000, PORT_PJCR); /* PORT J 1 = IRQ1,J 0 =IRQ0 */
172 163
173 /* LCDC I/O */ 164 /* LCDC I/O */
174 ctrl_outw(0x0020, PORT_PSELD); 165 __raw_writew(0x0020, PORT_PSELD);
175 166
176 /* SIOF1*/ 167 /* SIOF1*/
177 ctrl_outw(0x0003, PORT_PSELB); 168 __raw_writew(0x0003, PORT_PSELB);
178 ctrl_outw(0xe000, PORT_PSELC); 169 __raw_writew(0xe000, PORT_PSELC);
179 ctrl_outw(0x0000, PORT_PKCR); 170 __raw_writew(0x0000, PORT_PKCR);
180 171
181 /* LCDC */ 172 /* LCDC */
182 ctrl_outw(0x4020, PORT_PHCR); 173 __raw_writew(0x4020, PORT_PHCR);
183 ctrl_outw(0x0000, PORT_PLCR); 174 __raw_writew(0x0000, PORT_PLCR);
184 ctrl_outw(0x0000, PORT_PMCR); 175 __raw_writew(0x0000, PORT_PMCR);
185 ctrl_outw(0x0002, PORT_PRCR); 176 __raw_writew(0x0002, PORT_PRCR);
186 ctrl_outw(0x0000, PORT_PXCR); /* LCDC,CS6A */ 177 __raw_writew(0x0000, PORT_PXCR); /* LCDC,CS6A */
187 178
188 /* KEYSC */ 179 /* KEYSC */
189 ctrl_outw(0x0A10, PORT_PSELA); /* BS,SHHID2 */ 180 __raw_writew(0x0A10, PORT_PSELA); /* BS,SHHID2 */
190 ctrl_outw(0x0000, PORT_PYCR); 181 __raw_writew(0x0000, PORT_PYCR);
191 ctrl_outw(0x0000, PORT_PZCR); 182 __raw_writew(0x0000, PORT_PZCR);
192 ctrl_outw(ctrl_inw(PORT_HIZCRA) & ~0x4000, PORT_HIZCRA); 183 __raw_writew(__raw_readw(PORT_HIZCRA) & ~0x4000, PORT_HIZCRA);
193 ctrl_outw(ctrl_inw(PORT_HIZCRC) & ~0xc000, PORT_HIZCRC); 184 __raw_writew(__raw_readw(PORT_HIZCRC) & ~0xc000, PORT_HIZCRC);
194} 185}
195 186
196/* 187/*
diff --git a/arch/sh/boards/mach-se/7724/irq.c b/arch/sh/boards/mach-se/7724/irq.c
index f76cf3b49f23..0942be2daef6 100644
--- a/arch/sh/boards/mach-se/7724/irq.c
+++ b/arch/sh/boards/mach-se/7724/irq.c
@@ -72,14 +72,14 @@ static void disable_se7724_irq(unsigned int irq)
72{ 72{
73 struct fpga_irq set = get_fpga_irq(fpga2irq(irq)); 73 struct fpga_irq set = get_fpga_irq(fpga2irq(irq));
74 unsigned int bit = irq - set.base; 74 unsigned int bit = irq - set.base;
75 ctrl_outw(ctrl_inw(set.mraddr) | 0x0001 << bit, set.mraddr); 75 __raw_writew(__raw_readw(set.mraddr) | 0x0001 << bit, set.mraddr);
76} 76}
77 77
78static void enable_se7724_irq(unsigned int irq) 78static void enable_se7724_irq(unsigned int irq)
79{ 79{
80 struct fpga_irq set = get_fpga_irq(fpga2irq(irq)); 80 struct fpga_irq set = get_fpga_irq(fpga2irq(irq));
81 unsigned int bit = irq - set.base; 81 unsigned int bit = irq - set.base;
82 ctrl_outw(ctrl_inw(set.mraddr) & ~(0x0001 << bit), set.mraddr); 82 __raw_writew(__raw_readw(set.mraddr) & ~(0x0001 << bit), set.mraddr);
83} 83}
84 84
85static struct irq_chip se7724_irq_chip __read_mostly = { 85static struct irq_chip se7724_irq_chip __read_mostly = {
@@ -92,19 +92,16 @@ static struct irq_chip se7724_irq_chip __read_mostly = {
92static void se7724_irq_demux(unsigned int irq, struct irq_desc *desc) 92static void se7724_irq_demux(unsigned int irq, struct irq_desc *desc)
93{ 93{
94 struct fpga_irq set = get_fpga_irq(irq); 94 struct fpga_irq set = get_fpga_irq(irq);
95 unsigned short intv = ctrl_inw(set.sraddr); 95 unsigned short intv = __raw_readw(set.sraddr);
96 struct irq_desc *ext_desc;
97 unsigned int ext_irq = set.base; 96 unsigned int ext_irq = set.base;
98 97
99 intv &= set.mask; 98 intv &= set.mask;
100 99
101 while (intv) { 100 for (; intv; intv >>= 1, ext_irq++) {
102 if (intv & 0x0001) { 101 if (!(intv & 1))
103 ext_desc = irq_desc + ext_irq; 102 continue;
104 handle_level_irq(ext_irq, ext_desc); 103
105 } 104 generic_handle_irq(ext_irq);
106 intv >>= 1;
107 ext_irq++;
108 } 105 }
109} 106}
110 107
@@ -113,20 +110,39 @@ static void se7724_irq_demux(unsigned int irq, struct irq_desc *desc)
113 */ 110 */
114void __init init_se7724_IRQ(void) 111void __init init_se7724_IRQ(void)
115{ 112{
116 int i; 113 int i, nid = cpu_to_node(boot_cpu_data);
117 114
118 ctrl_outw(0xffff, IRQ0_MR); /* mask all */ 115 __raw_writew(0xffff, IRQ0_MR); /* mask all */
119 ctrl_outw(0xffff, IRQ1_MR); /* mask all */ 116 __raw_writew(0xffff, IRQ1_MR); /* mask all */
120 ctrl_outw(0xffff, IRQ2_MR); /* mask all */ 117 __raw_writew(0xffff, IRQ2_MR); /* mask all */
121 ctrl_outw(0x0000, IRQ0_SR); /* clear irq */ 118 __raw_writew(0x0000, IRQ0_SR); /* clear irq */
122 ctrl_outw(0x0000, IRQ1_SR); /* clear irq */ 119 __raw_writew(0x0000, IRQ1_SR); /* clear irq */
123 ctrl_outw(0x0000, IRQ2_SR); /* clear irq */ 120 __raw_writew(0x0000, IRQ2_SR); /* clear irq */
124 ctrl_outw(0x002a, IRQ_MODE); /* set irq type */ 121 __raw_writew(0x002a, IRQ_MODE); /* set irq type */
125 122
126 for (i = 0; i < SE7724_FPGA_IRQ_NR; i++) 123 for (i = 0; i < SE7724_FPGA_IRQ_NR; i++) {
127 set_irq_chip_and_handler_name(SE7724_FPGA_IRQ_BASE + i, 124 int irq, wanted;
125
126 wanted = SE7724_FPGA_IRQ_BASE + i;
127
128 irq = create_irq_nr(wanted, nid);
129 if (unlikely(irq == 0)) {
130 pr_err("%s: failed hooking irq %d for FPGA\n",
131 __func__, wanted);
132 return;
133 }
134
135 if (unlikely(irq != wanted)) {
136 pr_err("%s: got irq %d but wanted %d, bailing.\n",
137 __func__, irq, wanted);
138 destroy_irq(irq);
139 return;
140 }
141
142 set_irq_chip_and_handler_name(irq,
128 &se7724_irq_chip, 143 &se7724_irq_chip,
129 handle_level_irq, "level"); 144 handle_level_irq, "level");
145 }
130 146
131 set_irq_chained_handler(IRQ0_IRQ, se7724_irq_demux); 147 set_irq_chained_handler(IRQ0_IRQ, se7724_irq_demux);
132 set_irq_type(IRQ0_IRQ, IRQ_TYPE_LEVEL_LOW); 148 set_irq_type(IRQ0_IRQ, IRQ_TYPE_LEVEL_LOW);
diff --git a/arch/sh/boards/mach-se/7724/sdram.S b/arch/sh/boards/mach-se/7724/sdram.S
index 9040167d5022..6fa4734d09c7 100644
--- a/arch/sh/boards/mach-se/7724/sdram.S
+++ b/arch/sh/boards/mach-se/7724/sdram.S
@@ -39,6 +39,10 @@ ENTRY(ms7724se_sdram_leave_start)
39 39
40 /* DBSC: put memory in auto-refresh mode */ 40 /* DBSC: put memory in auto-refresh mode */
41 41
42 mov.l @(SH_SLEEP_MODE, r5), r0
43 tst #SUSP_SH_RSTANDBY, r0
44 bf resume_rstandby
45
42 ED 0xFD000040, 0x00000000 /* DBRFPDN0 */ 46 ED 0xFD000040, 0x00000000 /* DBRFPDN0 */
43 WAIT 1 47 WAIT 1
44 ED 0xFD000014, 0x00000002 /* DBCMDCNT (PALL) */ 48 ED 0xFD000014, 0x00000002 /* DBCMDCNT (PALL) */
@@ -49,4 +53,79 @@ ENTRY(ms7724se_sdram_leave_start)
49 rts 53 rts
50 nop 54 nop
51 55
56resume_rstandby:
57
58 /* CPG: setup clocks before restarting external memory */
59
60 ED 0xA4150024, 0x00004000 /* PLLCR */
61
62 mov.l FRQCRA,r0
63 mov.l @r0,r3
64 mov.l KICK,r1
65 or r1, r3
66 mov.l r3, @r0
67
68 mov.l LSTATS,r0
69 mov #1,r1
70WAIT_LSTATS:
71 mov.l @r0,r3
72 tst r1,r3
73 bf WAIT_LSTATS
74
75 /* DBSC: re-initialize and put in auto-refresh */
76
77 ED 0xFD000108, 0x00000181 /* DBPDCNT0 */
78 ED 0xFD000020, 0x015B0002 /* DBCONF */
79 ED 0xFD000030, 0x03071502 /* DBTR0 */
80 ED 0xFD000034, 0x02020102 /* DBTR1 */
81 ED 0xFD000038, 0x01090405 /* DBTR2 */
82 ED 0xFD00003C, 0x00000002 /* DBTR3 */
83 ED 0xFD000008, 0x00000005 /* DBKIND */
84 ED 0xFD000040, 0x00000001 /* DBRFPDN0 */
85 ED 0xFD000040, 0x00000000 /* DBRFPDN0 */
86 ED 0xFD000018, 0x00000001 /* DBCKECNT */
87
88 mov #100,r0
89WAIT_400NS:
90 dt r0
91 bf WAIT_400NS
92
93 ED 0xFD000014, 0x00000002 /* DBCMDCNT (PALL) */
94 ED 0xFD000060, 0x00020000 /* DBMRCNT (EMR2) */
95 ED 0xFD000060, 0x00030000 /* DBMRCNT (EMR3) */
96 ED 0xFD000060, 0x00010004 /* DBMRCNT (EMR) */
97 ED 0xFD000060, 0x00000532 /* DBMRCNT (MRS) */
98 ED 0xFD000014, 0x00000002 /* DBCMDCNT (PALL) */
99 ED 0xFD000014, 0x00000004 /* DBCMDCNT (REF) */
100 ED 0xFD000014, 0x00000004 /* DBCMDCNT (REF) */
101 ED 0xFD000060, 0x00000432 /* DBMRCNT (MRS) */
102 ED 0xFD000060, 0x000103c0 /* DBMRCNT (EMR) */
103 ED 0xFD000060, 0x00010040 /* DBMRCNT (EMR) */
104
105 mov #100,r0
106WAIT_400NS_2:
107 dt r0
108 bf WAIT_400NS_2
109
110 ED 0xFD000010, 0x00000001 /* DBEN */
111 ED 0xFD000044, 0x0000050f /* DBRFPDN1 */
112 ED 0xFD000048, 0x236800e6 /* DBRFPDN2 */
113
114 mov.l DUMMY,r0
115 mov.l @r0, r1 /* force single dummy read */
116
117 ED 0xFD000014, 0x00000002 /* DBCMDCNT (PALL) */
118 ED 0xFD000014, 0x00000004 /* DBCMDCNT (REF) */
119 ED 0xFD000108, 0x00000080 /* DBPDCNT0 */
120 ED 0xFD000040, 0x00010000 /* DBRFPDN0 */
121
122 rts
123 nop
124
125 .balign 4
126DUMMY: .long 0xac400000
127FRQCRA: .long 0xa4150000
128KICK: .long 0x80000000
129LSTATS: .long 0xa4150060
130
52ENTRY(ms7724se_sdram_leave_end) 131ENTRY(ms7724se_sdram_leave_end)
diff --git a/arch/sh/boards/mach-se/7724/setup.c b/arch/sh/boards/mach-se/7724/setup.c
index 858ecb25d469..66cdbc3c7af9 100644
--- a/arch/sh/boards/mach-se/7724/setup.c
+++ b/arch/sh/boards/mach-se/7724/setup.c
@@ -53,26 +53,17 @@
53 */ 53 */
54 54
55/* Heartbeat */ 55/* Heartbeat */
56static struct heartbeat_data heartbeat_data = { 56static struct resource heartbeat_resource = {
57 .regsize = 16, 57 .start = PA_LED,
58}; 58 .end = PA_LED,
59 59 .flags = IORESOURCE_MEM | IORESOURCE_MEM_16BIT,
60static struct resource heartbeat_resources[] = {
61 [0] = {
62 .start = PA_LED,
63 .end = PA_LED,
64 .flags = IORESOURCE_MEM,
65 },
66}; 60};
67 61
68static struct platform_device heartbeat_device = { 62static struct platform_device heartbeat_device = {
69 .name = "heartbeat", 63 .name = "heartbeat",
70 .id = -1, 64 .id = -1,
71 .dev = { 65 .num_resources = 1,
72 .platform_data = &heartbeat_data, 66 .resource = &heartbeat_resource,
73 },
74 .num_resources = ARRAY_SIZE(heartbeat_resources),
75 .resource = heartbeat_resources,
76}; 67};
77 68
78/* LAN91C111 */ 69/* LAN91C111 */
@@ -265,12 +256,12 @@ static struct platform_device ceu1_device = {
265#define FCLKACR 0xa4150008 256#define FCLKACR 0xa4150008
266static void fsimck_init(struct clk *clk) 257static void fsimck_init(struct clk *clk)
267{ 258{
268 u32 status = ctrl_inl(clk->enable_reg); 259 u32 status = __raw_readl(clk->enable_reg);
269 260
270 /* use external clock */ 261 /* use external clock */
271 status &= ~0x000000ff; 262 status &= ~0x000000ff;
272 status |= 0x00000080; 263 status |= 0x00000080;
273 ctrl_outl(status, clk->enable_reg); 264 __raw_writel(status, clk->enable_reg);
274} 265}
275 266
276static struct clk_ops fsimck_clk_ops = { 267static struct clk_ops fsimck_clk_ops = {
@@ -322,7 +313,7 @@ static struct platform_device fsi_device = {
322/* KEYSC in SoC (Needs SW33-2 set to ON) */ 313/* KEYSC in SoC (Needs SW33-2 set to ON) */
323static struct sh_keysc_info keysc_info = { 314static struct sh_keysc_info keysc_info = {
324 .mode = SH_KEYSC_MODE_1, 315 .mode = SH_KEYSC_MODE_1,
325 .scan_timing = 10, 316 .scan_timing = 3,
326 .delay = 50, 317 .delay = 50,
327 .keycodes = { 318 .keycodes = {
328 KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, 319 KEY_1, KEY_2, KEY_3, KEY_4, KEY_5,
@@ -460,7 +451,7 @@ static struct resource sdhi0_cn7_resources[] = {
460 .flags = IORESOURCE_MEM, 451 .flags = IORESOURCE_MEM,
461 }, 452 },
462 [1] = { 453 [1] = {
463 .start = 101, 454 .start = 100,
464 .flags = IORESOURCE_IRQ, 455 .flags = IORESOURCE_IRQ,
465 }, 456 },
466}; 457};
@@ -483,7 +474,7 @@ static struct resource sdhi1_cn8_resources[] = {
483 .flags = IORESOURCE_MEM, 474 .flags = IORESOURCE_MEM,
484 }, 475 },
485 [1] = { 476 [1] = {
486 .start = 24, 477 .start = 23,
487 .flags = IORESOURCE_IRQ, 478 .flags = IORESOURCE_IRQ,
488 }, 479 },
489}; 480};
@@ -498,6 +489,26 @@ static struct platform_device sdhi1_cn8_device = {
498 }, 489 },
499}; 490};
500 491
492/* IrDA */
493static struct resource irda_resources[] = {
494 [0] = {
495 .name = "IrDA",
496 .start = 0xA45D0000,
497 .end = 0xA45D0049,
498 .flags = IORESOURCE_MEM,
499 },
500 [1] = {
501 .start = 20,
502 .flags = IORESOURCE_IRQ,
503 },
504};
505
506static struct platform_device irda_device = {
507 .name = "sh_sir",
508 .num_resources = ARRAY_SIZE(irda_resources),
509 .resource = irda_resources,
510};
511
501static struct platform_device *ms7724se_devices[] __initdata = { 512static struct platform_device *ms7724se_devices[] __initdata = {
502 &heartbeat_device, 513 &heartbeat_device,
503 &smc91x_eth_device, 514 &smc91x_eth_device,
@@ -512,6 +523,7 @@ static struct platform_device *ms7724se_devices[] __initdata = {
512 &fsi_device, 523 &fsi_device,
513 &sdhi0_cn7_device, 524 &sdhi0_cn7_device,
514 &sdhi1_cn8_device, 525 &sdhi1_cn8_device,
526 &irda_device,
515}; 527};
516 528
517/* I2C device */ 529/* I2C device */
@@ -531,7 +543,7 @@ static int __init sh_eth_is_eeprom_ready(void)
531 int t = 10000; 543 int t = 10000;
532 544
533 while (t--) { 545 while (t--) {
534 if (!ctrl_inw(EEPROM_STAT)) 546 if (!__raw_readw(EEPROM_STAT))
535 return 1; 547 return 1;
536 udelay(1); 548 udelay(1);
537 } 549 }
@@ -551,13 +563,13 @@ static void __init sh_eth_init(void)
551 563
552 /* read MAC addr from EEPROM */ 564 /* read MAC addr from EEPROM */
553 for (i = 0 ; i < 3 ; i++) { 565 for (i = 0 ; i < 3 ; i++) {
554 ctrl_outw(0x0, EEPROM_OP); /* read */ 566 __raw_writew(0x0, EEPROM_OP); /* read */
555 ctrl_outw(i*2, EEPROM_ADR); 567 __raw_writew(i*2, EEPROM_ADR);
556 ctrl_outw(0x1, EEPROM_STRT); 568 __raw_writew(0x1, EEPROM_STRT);
557 if (!sh_eth_is_eeprom_ready()) 569 if (!sh_eth_is_eeprom_ready())
558 return; 570 return;
559 571
560 mac = ctrl_inw(EEPROM_DATA); 572 mac = __raw_readw(EEPROM_DATA);
561 sh_eth_plat.mac_addr[i << 1] = mac & 0xff; 573 sh_eth_plat.mac_addr[i << 1] = mac & 0xff;
562 sh_eth_plat.mac_addr[(i << 1) + 1] = mac >> 8; 574 sh_eth_plat.mac_addr[(i << 1) + 1] = mac >> 8;
563 } 575 }
@@ -594,28 +606,29 @@ arch_initcall(arch_setup);
594 606
595static int __init devices_setup(void) 607static int __init devices_setup(void)
596{ 608{
597 u16 sw = ctrl_inw(SW4140); /* select camera, monitor */ 609 u16 sw = __raw_readw(SW4140); /* select camera, monitor */
598 struct clk *fsia_clk; 610 struct clk *clk;
599 611
600 /* register board specific self-refresh code */ 612 /* register board specific self-refresh code */
601 sh_mobile_register_self_refresh(SUSP_SH_STANDBY | SUSP_SH_SF, 613 sh_mobile_register_self_refresh(SUSP_SH_STANDBY | SUSP_SH_SF |
614 SUSP_SH_RSTANDBY,
602 &ms7724se_sdram_enter_start, 615 &ms7724se_sdram_enter_start,
603 &ms7724se_sdram_enter_end, 616 &ms7724se_sdram_enter_end,
604 &ms7724se_sdram_leave_start, 617 &ms7724se_sdram_leave_start,
605 &ms7724se_sdram_leave_end); 618 &ms7724se_sdram_leave_end);
606 /* Reset Release */ 619 /* Reset Release */
607 ctrl_outw(ctrl_inw(FPGA_OUT) & 620 __raw_writew(__raw_readw(FPGA_OUT) &
608 ~((1 << 1) | /* LAN */ 621 ~((1 << 1) | /* LAN */
609 (1 << 6) | /* VIDEO DAC */ 622 (1 << 6) | /* VIDEO DAC */
610 (1 << 7) | /* AK4643 */ 623 (1 << 7) | /* AK4643 */
624 (1 << 8) | /* IrDA */
611 (1 << 12) | /* USB0 */ 625 (1 << 12) | /* USB0 */
612 (1 << 14)), /* RMII */ 626 (1 << 14)), /* RMII */
613 FPGA_OUT); 627 FPGA_OUT);
614 628
615 /* turn on USB clocks, use external clock */ 629 /* turn on USB clocks, use external clock */
616 ctrl_outw((ctrl_inw(PORT_MSELCRB) & ~0xc000) | 0x8000, PORT_MSELCRB); 630 __raw_writew((__raw_readw(PORT_MSELCRB) & ~0xc000) | 0x8000, PORT_MSELCRB);
617 631
618#ifdef CONFIG_PM
619 /* Let LED9 show STATUS2 */ 632 /* Let LED9 show STATUS2 */
620 gpio_request(GPIO_FN_STATUS2, NULL); 633 gpio_request(GPIO_FN_STATUS2, NULL);
621 634
@@ -624,28 +637,12 @@ static int __init devices_setup(void)
624 637
625 /* Lit LED11 show PDSTATUS */ 638 /* Lit LED11 show PDSTATUS */
626 gpio_request(GPIO_FN_PDSTATUS, NULL); 639 gpio_request(GPIO_FN_PDSTATUS, NULL);
627#else
628 /* Lit LED9 */
629 gpio_request(GPIO_PTJ6, NULL);
630 gpio_direction_output(GPIO_PTJ6, 1);
631 gpio_export(GPIO_PTJ6, 0);
632
633 /* Lit LED10 */
634 gpio_request(GPIO_PTJ5, NULL);
635 gpio_direction_output(GPIO_PTJ5, 1);
636 gpio_export(GPIO_PTJ5, 0);
637
638 /* Lit LED11 */
639 gpio_request(GPIO_PTJ7, NULL);
640 gpio_direction_output(GPIO_PTJ7, 1);
641 gpio_export(GPIO_PTJ7, 0);
642#endif
643 640
644 /* enable USB0 port */ 641 /* enable USB0 port */
645 ctrl_outw(0x0600, 0xa40501d4); 642 __raw_writew(0x0600, 0xa40501d4);
646 643
647 /* enable USB1 port */ 644 /* enable USB1 port */
648 ctrl_outw(0x0600, 0xa4050192); 645 __raw_writew(0x0600, 0xa4050192);
649 646
650 /* enable IRQ 0,1,2 */ 647 /* enable IRQ 0,1,2 */
651 gpio_request(GPIO_FN_INTC_IRQ0, NULL); 648 gpio_request(GPIO_FN_INTC_IRQ0, NULL);
@@ -693,7 +690,7 @@ static int __init devices_setup(void)
693 gpio_request(GPIO_FN_LCDVCPWC, NULL); 690 gpio_request(GPIO_FN_LCDVCPWC, NULL);
694 gpio_request(GPIO_FN_LCDRD, NULL); 691 gpio_request(GPIO_FN_LCDRD, NULL);
695 gpio_request(GPIO_FN_LCDLCLK, NULL); 692 gpio_request(GPIO_FN_LCDLCLK, NULL);
696 ctrl_outw((ctrl_inw(PORT_HIZA) & ~0x0001), PORT_HIZA); 693 __raw_writew((__raw_readw(PORT_HIZA) & ~0x0001), PORT_HIZA);
697 694
698 /* enable CEU0 */ 695 /* enable CEU0 */
699 gpio_request(GPIO_FN_VIO0_D15, NULL); 696 gpio_request(GPIO_FN_VIO0_D15, NULL);
@@ -764,13 +761,18 @@ static int __init devices_setup(void)
764 gpio_request(GPIO_FN_CLKAUDIOBO, NULL); 761 gpio_request(GPIO_FN_CLKAUDIOBO, NULL);
765 gpio_request(GPIO_FN_FSIIASD, NULL); 762 gpio_request(GPIO_FN_FSIIASD, NULL);
766 763
764 /* set SPU2 clock to 83.4 MHz */
765 clk = clk_get(NULL, "spu_clk");
766 clk_set_rate(clk, clk_round_rate(clk, 83333333));
767 clk_put(clk);
768
767 /* change parent of FSI A */ 769 /* change parent of FSI A */
768 fsia_clk = clk_get(NULL, "fsia_clk"); 770 clk = clk_get(NULL, "fsia_clk");
769 clk_register(&fsimcka_clk); 771 clk_register(&fsimcka_clk);
770 clk_set_parent(fsia_clk, &fsimcka_clk); 772 clk_set_parent(clk, &fsimcka_clk);
771 clk_set_rate(fsia_clk, 11000); 773 clk_set_rate(clk, 11000);
772 clk_set_rate(&fsimcka_clk, 11000); 774 clk_set_rate(&fsimcka_clk, 11000);
773 clk_put(fsia_clk); 775 clk_put(clk);
774 776
775 /* SDHI0 connected to cn7 */ 777 /* SDHI0 connected to cn7 */
776 gpio_request(GPIO_FN_SDHI0CD, NULL); 778 gpio_request(GPIO_FN_SDHI0CD, NULL);
@@ -792,6 +794,10 @@ static int __init devices_setup(void)
792 gpio_request(GPIO_FN_SDHI1CMD, NULL); 794 gpio_request(GPIO_FN_SDHI1CMD, NULL);
793 gpio_request(GPIO_FN_SDHI1CLK, NULL); 795 gpio_request(GPIO_FN_SDHI1CLK, NULL);
794 796
797 /* enable IrDA */
798 gpio_request(GPIO_FN_IRDA_OUT, NULL);
799 gpio_request(GPIO_FN_IRDA_IN, NULL);
800
795 /* 801 /*
796 * enable SH-Eth 802 * enable SH-Eth
797 * 803 *
diff --git a/arch/sh/boards/mach-se/7780/irq.c b/arch/sh/boards/mach-se/7780/irq.c
index 121744c08714..d5c9edc172a3 100644
--- a/arch/sh/boards/mach-se/7780/irq.c
+++ b/arch/sh/boards/mach-se/7780/irq.c
@@ -24,30 +24,30 @@
24void __init init_se7780_IRQ(void) 24void __init init_se7780_IRQ(void)
25{ 25{
26 /* enable all interrupt at FPGA */ 26 /* enable all interrupt at FPGA */
27 ctrl_outw(0, FPGA_INTMSK1); 27 __raw_writew(0, FPGA_INTMSK1);
28 /* mask SM501 interrupt */ 28 /* mask SM501 interrupt */
29 ctrl_outw((ctrl_inw(FPGA_INTMSK1) | 0x0002), FPGA_INTMSK1); 29 __raw_writew((__raw_readw(FPGA_INTMSK1) | 0x0002), FPGA_INTMSK1);
30 /* enable all interrupt at FPGA */ 30 /* enable all interrupt at FPGA */
31 ctrl_outw(0, FPGA_INTMSK2); 31 __raw_writew(0, FPGA_INTMSK2);
32 32
33 /* set FPGA INTSEL register */ 33 /* set FPGA INTSEL register */
34 /* FPGA + 0x06 */ 34 /* FPGA + 0x06 */
35 ctrl_outw( ((IRQPIN_SM501 << IRQPOS_SM501) | 35 __raw_writew( ((IRQPIN_SM501 << IRQPOS_SM501) |
36 (IRQPIN_SMC91CX << IRQPOS_SMC91CX)), FPGA_INTSEL1); 36 (IRQPIN_SMC91CX << IRQPOS_SMC91CX)), FPGA_INTSEL1);
37 37
38 /* FPGA + 0x08 */ 38 /* FPGA + 0x08 */
39 ctrl_outw(((IRQPIN_EXTINT4 << IRQPOS_EXTINT4) | 39 __raw_writew(((IRQPIN_EXTINT4 << IRQPOS_EXTINT4) |
40 (IRQPIN_EXTINT3 << IRQPOS_EXTINT3) | 40 (IRQPIN_EXTINT3 << IRQPOS_EXTINT3) |
41 (IRQPIN_EXTINT2 << IRQPOS_EXTINT2) | 41 (IRQPIN_EXTINT2 << IRQPOS_EXTINT2) |
42 (IRQPIN_EXTINT1 << IRQPOS_EXTINT1)), FPGA_INTSEL2); 42 (IRQPIN_EXTINT1 << IRQPOS_EXTINT1)), FPGA_INTSEL2);
43 43
44 /* FPGA + 0x0A */ 44 /* FPGA + 0x0A */
45 ctrl_outw((IRQPIN_PCCPW << IRQPOS_PCCPW), FPGA_INTSEL3); 45 __raw_writew((IRQPIN_PCCPW << IRQPOS_PCCPW), FPGA_INTSEL3);
46 46
47 plat_irq_setup_pins(IRQ_MODE_IRQ); /* install handlers for IRQ0-7 */ 47 plat_irq_setup_pins(IRQ_MODE_IRQ); /* install handlers for IRQ0-7 */
48 48
49 /* ICR1: detect low level(for 2ndcut) */ 49 /* ICR1: detect low level(for 2ndcut) */
50 ctrl_outl(0xAAAA0000, INTC_ICR1); 50 __raw_writel(0xAAAA0000, INTC_ICR1);
51 51
52 /* 52 /*
53 * FPGA PCISEL register initialize 53 * FPGA PCISEL register initialize
@@ -63,6 +63,6 @@ void __init init_se7780_IRQ(void)
63 * INTD || INTD | INTC | -- | INTA 63 * INTD || INTD | INTC | -- | INTA
64 * ------------------------------------- 64 * -------------------------------------
65 */ 65 */
66 ctrl_outw(0x0013, FPGA_PCI_INTSEL1); 66 __raw_writew(0x0013, FPGA_PCI_INTSEL1);
67 ctrl_outw(0xE402, FPGA_PCI_INTSEL2); 67 __raw_writew(0xE402, FPGA_PCI_INTSEL2);
68} 68}
diff --git a/arch/sh/boards/mach-se/7780/setup.c b/arch/sh/boards/mach-se/7780/setup.c
index 1d3a867e94e3..6f7c207138e1 100644
--- a/arch/sh/boards/mach-se/7780/setup.c
+++ b/arch/sh/boards/mach-se/7780/setup.c
@@ -17,26 +17,17 @@
17#include <asm/heartbeat.h> 17#include <asm/heartbeat.h>
18 18
19/* Heartbeat */ 19/* Heartbeat */
20static struct heartbeat_data heartbeat_data = { 20static struct resource heartbeat_resource = {
21 .regsize = 16, 21 .start = PA_LED,
22}; 22 .end = PA_LED,
23 23 .flags = IORESOURCE_MEM | IORESOURCE_MEM_16BIT,
24static struct resource heartbeat_resources[] = {
25 [0] = {
26 .start = PA_LED,
27 .end = PA_LED,
28 .flags = IORESOURCE_MEM,
29 },
30}; 24};
31 25
32static struct platform_device heartbeat_device = { 26static struct platform_device heartbeat_device = {
33 .name = "heartbeat", 27 .name = "heartbeat",
34 .id = -1, 28 .id = -1,
35 .dev = { 29 .num_resources = 1,
36 .platform_data = &heartbeat_data, 30 .resource = &heartbeat_resource,
37 },
38 .num_resources = ARRAY_SIZE(heartbeat_resources),
39 .resource = heartbeat_resources,
40}; 31};
41 32
42/* SMC91x */ 33/* SMC91x */
@@ -84,14 +75,14 @@ device_initcall(se7780_devices_setup);
84static void __init se7780_setup(char **cmdline_p) 75static void __init se7780_setup(char **cmdline_p)
85{ 76{
86 /* "SH-Linux" on LED Display */ 77 /* "SH-Linux" on LED Display */
87 ctrl_outw( 'S' , PA_LED_DISP + (DISP_SEL0_ADDR << 1) ); 78 __raw_writew( 'S' , PA_LED_DISP + (DISP_SEL0_ADDR << 1) );
88 ctrl_outw( 'H' , PA_LED_DISP + (DISP_SEL1_ADDR << 1) ); 79 __raw_writew( 'H' , PA_LED_DISP + (DISP_SEL1_ADDR << 1) );
89 ctrl_outw( '-' , PA_LED_DISP + (DISP_SEL2_ADDR << 1) ); 80 __raw_writew( '-' , PA_LED_DISP + (DISP_SEL2_ADDR << 1) );
90 ctrl_outw( 'L' , PA_LED_DISP + (DISP_SEL3_ADDR << 1) ); 81 __raw_writew( 'L' , PA_LED_DISP + (DISP_SEL3_ADDR << 1) );
91 ctrl_outw( 'i' , PA_LED_DISP + (DISP_SEL4_ADDR << 1) ); 82 __raw_writew( 'i' , PA_LED_DISP + (DISP_SEL4_ADDR << 1) );
92 ctrl_outw( 'n' , PA_LED_DISP + (DISP_SEL5_ADDR << 1) ); 83 __raw_writew( 'n' , PA_LED_DISP + (DISP_SEL5_ADDR << 1) );
93 ctrl_outw( 'u' , PA_LED_DISP + (DISP_SEL6_ADDR << 1) ); 84 __raw_writew( 'u' , PA_LED_DISP + (DISP_SEL6_ADDR << 1) );
94 ctrl_outw( 'x' , PA_LED_DISP + (DISP_SEL7_ADDR << 1) ); 85 __raw_writew( 'x' , PA_LED_DISP + (DISP_SEL7_ADDR << 1) );
95 86
96 printk(KERN_INFO "Hitachi UL Solutions Engine 7780SE03 support.\n"); 87 printk(KERN_INFO "Hitachi UL Solutions Engine 7780SE03 support.\n");
97 88
@@ -102,15 +93,15 @@ static void __init se7780_setup(char **cmdline_p)
102 * REQ2/GNT2 -> Serial ATA 93 * REQ2/GNT2 -> Serial ATA
103 * REQ3/GNT3 -> PCI slot 94 * REQ3/GNT3 -> PCI slot
104 */ 95 */
105 ctrl_outw(0x0213, FPGA_REQSEL); 96 __raw_writew(0x0213, FPGA_REQSEL);
106 97
107 /* GPIO setting */ 98 /* GPIO setting */
108 ctrl_outw(0x0000, GPIO_PECR); 99 __raw_writew(0x0000, GPIO_PECR);
109 ctrl_outw(ctrl_inw(GPIO_PHCR)&0xfff3, GPIO_PHCR); 100 __raw_writew(__raw_readw(GPIO_PHCR)&0xfff3, GPIO_PHCR);
110 ctrl_outw(0x0c00, GPIO_PMSELR); 101 __raw_writew(0x0c00, GPIO_PMSELR);
111 102
112 /* iVDR Power ON */ 103 /* iVDR Power ON */
113 ctrl_outw(0x0001, FPGA_IVDRPW); 104 __raw_writew(0x0001, FPGA_IVDRPW);
114} 105}
115 106
116/* 107/*
diff --git a/arch/sh/boards/mach-sh03/rtc.c b/arch/sh/boards/mach-sh03/rtc.c
index a8b9f844ab5b..1b200990500c 100644
--- a/arch/sh/boards/mach-sh03/rtc.c
+++ b/arch/sh/boards/mach-sh03/rtc.c
@@ -44,15 +44,15 @@ unsigned long get_cmos_time(void)
44 spin_lock(&sh03_rtc_lock); 44 spin_lock(&sh03_rtc_lock);
45 again: 45 again:
46 do { 46 do {
47 sec = (ctrl_inb(RTC_SEC1) & 0xf) + (ctrl_inb(RTC_SEC10) & 0x7) * 10; 47 sec = (__raw_readb(RTC_SEC1) & 0xf) + (__raw_readb(RTC_SEC10) & 0x7) * 10;
48 min = (ctrl_inb(RTC_MIN1) & 0xf) + (ctrl_inb(RTC_MIN10) & 0xf) * 10; 48 min = (__raw_readb(RTC_MIN1) & 0xf) + (__raw_readb(RTC_MIN10) & 0xf) * 10;
49 hour = (ctrl_inb(RTC_HOU1) & 0xf) + (ctrl_inb(RTC_HOU10) & 0xf) * 10; 49 hour = (__raw_readb(RTC_HOU1) & 0xf) + (__raw_readb(RTC_HOU10) & 0xf) * 10;
50 day = (ctrl_inb(RTC_DAY1) & 0xf) + (ctrl_inb(RTC_DAY10) & 0xf) * 10; 50 day = (__raw_readb(RTC_DAY1) & 0xf) + (__raw_readb(RTC_DAY10) & 0xf) * 10;
51 mon = (ctrl_inb(RTC_MON1) & 0xf) + (ctrl_inb(RTC_MON10) & 0xf) * 10; 51 mon = (__raw_readb(RTC_MON1) & 0xf) + (__raw_readb(RTC_MON10) & 0xf) * 10;
52 year = (ctrl_inb(RTC_YEA1) & 0xf) + (ctrl_inb(RTC_YEA10) & 0xf) * 10 52 year = (__raw_readb(RTC_YEA1) & 0xf) + (__raw_readb(RTC_YEA10) & 0xf) * 10
53 + (ctrl_inb(RTC_YEA100 ) & 0xf) * 100 53 + (__raw_readb(RTC_YEA100 ) & 0xf) * 100
54 + (ctrl_inb(RTC_YEA1000) & 0xf) * 1000; 54 + (__raw_readb(RTC_YEA1000) & 0xf) * 1000;
55 } while (sec != (ctrl_inb(RTC_SEC1) & 0xf) + (ctrl_inb(RTC_SEC10) & 0x7) * 10); 55 } while (sec != (__raw_readb(RTC_SEC1) & 0xf) + (__raw_readb(RTC_SEC10) & 0x7) * 10);
56 if (year == 0 || mon < 1 || mon > 12 || day > 31 || day < 1 || 56 if (year == 0 || mon < 1 || mon > 12 || day > 31 || day < 1 ||
57 hour > 23 || min > 59 || sec > 59) { 57 hour > 23 || min > 59 || sec > 59) {
58 printk(KERN_ERR 58 printk(KERN_ERR
@@ -60,16 +60,16 @@ unsigned long get_cmos_time(void)
60 printk("year=%d, mon=%d, day=%d, hour=%d, min=%d, sec=%d\n", 60 printk("year=%d, mon=%d, day=%d, hour=%d, min=%d, sec=%d\n",
61 year, mon, day, hour, min, sec); 61 year, mon, day, hour, min, sec);
62 62
63 ctrl_outb(0, RTC_SEC1); ctrl_outb(0, RTC_SEC10); 63 __raw_writeb(0, RTC_SEC1); __raw_writeb(0, RTC_SEC10);
64 ctrl_outb(0, RTC_MIN1); ctrl_outb(0, RTC_MIN10); 64 __raw_writeb(0, RTC_MIN1); __raw_writeb(0, RTC_MIN10);
65 ctrl_outb(0, RTC_HOU1); ctrl_outb(0, RTC_HOU10); 65 __raw_writeb(0, RTC_HOU1); __raw_writeb(0, RTC_HOU10);
66 ctrl_outb(6, RTC_WEE1); 66 __raw_writeb(6, RTC_WEE1);
67 ctrl_outb(1, RTC_DAY1); ctrl_outb(0, RTC_DAY10); 67 __raw_writeb(1, RTC_DAY1); __raw_writeb(0, RTC_DAY10);
68 ctrl_outb(1, RTC_MON1); ctrl_outb(0, RTC_MON10); 68 __raw_writeb(1, RTC_MON1); __raw_writeb(0, RTC_MON10);
69 ctrl_outb(0, RTC_YEA1); ctrl_outb(0, RTC_YEA10); 69 __raw_writeb(0, RTC_YEA1); __raw_writeb(0, RTC_YEA10);
70 ctrl_outb(0, RTC_YEA100); 70 __raw_writeb(0, RTC_YEA100);
71 ctrl_outb(2, RTC_YEA1000); 71 __raw_writeb(2, RTC_YEA1000);
72 ctrl_outb(0, RTC_CTL); 72 __raw_writeb(0, RTC_CTL);
73 goto again; 73 goto again;
74 } 74 }
75 75
@@ -93,9 +93,9 @@ static int set_rtc_mmss(unsigned long nowtime)
93 /* gets recalled with irq locally disabled */ 93 /* gets recalled with irq locally disabled */
94 spin_lock(&sh03_rtc_lock); 94 spin_lock(&sh03_rtc_lock);
95 for (i = 0 ; i < 1000000 ; i++) /* may take up to 1 second... */ 95 for (i = 0 ; i < 1000000 ; i++) /* may take up to 1 second... */
96 if (!(ctrl_inb(RTC_CTL) & RTC_BUSY)) 96 if (!(__raw_readb(RTC_CTL) & RTC_BUSY))
97 break; 97 break;
98 cmos_minutes = (ctrl_inb(RTC_MIN1) & 0xf) + (ctrl_inb(RTC_MIN10) & 0xf) * 10; 98 cmos_minutes = (__raw_readb(RTC_MIN1) & 0xf) + (__raw_readb(RTC_MIN10) & 0xf) * 10;
99 real_seconds = nowtime % 60; 99 real_seconds = nowtime % 60;
100 real_minutes = nowtime / 60; 100 real_minutes = nowtime / 60;
101 if (((abs(real_minutes - cmos_minutes) + 15)/30) & 1) 101 if (((abs(real_minutes - cmos_minutes) + 15)/30) & 1)
@@ -103,10 +103,10 @@ static int set_rtc_mmss(unsigned long nowtime)
103 real_minutes %= 60; 103 real_minutes %= 60;
104 104
105 if (abs(real_minutes - cmos_minutes) < 30) { 105 if (abs(real_minutes - cmos_minutes) < 30) {
106 ctrl_outb(real_seconds % 10, RTC_SEC1); 106 __raw_writeb(real_seconds % 10, RTC_SEC1);
107 ctrl_outb(real_seconds / 10, RTC_SEC10); 107 __raw_writeb(real_seconds / 10, RTC_SEC10);
108 ctrl_outb(real_minutes % 10, RTC_MIN1); 108 __raw_writeb(real_minutes % 10, RTC_MIN1);
109 ctrl_outb(real_minutes / 10, RTC_MIN10); 109 __raw_writeb(real_minutes / 10, RTC_MIN10);
110 } else { 110 } else {
111 printk(KERN_WARNING 111 printk(KERN_WARNING
112 "set_rtc_mmss: can't update from %d to %d\n", 112 "set_rtc_mmss: can't update from %d to %d\n",
diff --git a/arch/sh/boards/mach-sh03/setup.c b/arch/sh/boards/mach-sh03/setup.c
index 74cfb4b8b03d..af4a0c012a96 100644
--- a/arch/sh/boards/mach-sh03/setup.c
+++ b/arch/sh/boards/mach-sh03/setup.c
@@ -82,7 +82,7 @@ static int __init sh03_devices_setup(void)
82 /* open I/O area window */ 82 /* open I/O area window */
83 paddrbase = virt_to_phys((void *)PA_AREA5_IO); 83 paddrbase = virt_to_phys((void *)PA_AREA5_IO);
84 prot = PAGE_KERNEL_PCC(1, _PAGE_PCC_IO16); 84 prot = PAGE_KERNEL_PCC(1, _PAGE_PCC_IO16);
85 cf_ide_base = p3_ioremap(paddrbase, PAGE_SIZE, prot.pgprot); 85 cf_ide_base = ioremap_prot(paddrbase, PAGE_SIZE, pgprot_val(prot));
86 if (!cf_ide_base) { 86 if (!cf_ide_base) {
87 printk("allocate_cf_area : can't open CF I/O window!\n"); 87 printk("allocate_cf_area : can't open CF I/O window!\n");
88 return -ENOMEM; 88 return -ENOMEM;
diff --git a/arch/sh/boards/mach-sh7763rdp/irq.c b/arch/sh/boards/mach-sh7763rdp/irq.c
index d8ebfa7d8c76..add698c8f2b4 100644
--- a/arch/sh/boards/mach-sh7763rdp/irq.c
+++ b/arch/sh/boards/mach-sh7763rdp/irq.c
@@ -28,18 +28,18 @@
28void __init init_sh7763rdp_IRQ(void) 28void __init init_sh7763rdp_IRQ(void)
29{ 29{
30 /* GPIO enabled */ 30 /* GPIO enabled */
31 ctrl_outl(1 << 25, INTC_INT2MSKCR); 31 __raw_writel(1 << 25, INTC_INT2MSKCR);
32 32
33 /* enable GPIO interrupts */ 33 /* enable GPIO interrupts */
34 ctrl_outl((ctrl_inl(INTC_INT2PRI7) & 0xFF00FFFF) | 0x000F0000, 34 __raw_writel((__raw_readl(INTC_INT2PRI7) & 0xFF00FFFF) | 0x000F0000,
35 INTC_INT2PRI7); 35 INTC_INT2PRI7);
36 36
37 /* USBH enabled */ 37 /* USBH enabled */
38 ctrl_outl(1 << 17, INTC_INT2MSKCR1); 38 __raw_writel(1 << 17, INTC_INT2MSKCR1);
39 39
40 /* GETHER enabled */ 40 /* GETHER enabled */
41 ctrl_outl(1 << 16, INTC_INT2MSKCR1); 41 __raw_writel(1 << 16, INTC_INT2MSKCR1);
42 42
43 /* DMAC enabled */ 43 /* DMAC enabled */
44 ctrl_outl(1 << 8, INTC_INT2MSKCR); 44 __raw_writel(1 << 8, INTC_INT2MSKCR);
45} 45}
diff --git a/arch/sh/boards/mach-sh7763rdp/setup.c b/arch/sh/boards/mach-sh7763rdp/setup.c
index 390534a0b35c..f64a6918224c 100644
--- a/arch/sh/boards/mach-sh7763rdp/setup.c
+++ b/arch/sh/boards/mach-sh7763rdp/setup.c
@@ -158,50 +158,50 @@ device_initcall(sh7763rdp_devices_setup);
158static void __init sh7763rdp_setup(char **cmdline_p) 158static void __init sh7763rdp_setup(char **cmdline_p)
159{ 159{
160 /* Board version check */ 160 /* Board version check */
161 if (ctrl_inw(CPLD_BOARD_ID_ERV_REG) == 0xECB1) 161 if (__raw_readw(CPLD_BOARD_ID_ERV_REG) == 0xECB1)
162 printk(KERN_INFO "RTE Standard Configuration\n"); 162 printk(KERN_INFO "RTE Standard Configuration\n");
163 else 163 else
164 printk(KERN_INFO "RTA Standard Configuration\n"); 164 printk(KERN_INFO "RTA Standard Configuration\n");
165 165
166 /* USB pin select bits (clear bit 5-2 to 0) */ 166 /* USB pin select bits (clear bit 5-2 to 0) */
167 ctrl_outw((ctrl_inw(PORT_PSEL2) & 0xFFC3), PORT_PSEL2); 167 __raw_writew((__raw_readw(PORT_PSEL2) & 0xFFC3), PORT_PSEL2);
168 /* USBH setup port I controls to other (clear bits 4-9 to 0) */ 168 /* USBH setup port I controls to other (clear bits 4-9 to 0) */
169 ctrl_outw(ctrl_inw(PORT_PICR) & 0xFC0F, PORT_PICR); 169 __raw_writew(__raw_readw(PORT_PICR) & 0xFC0F, PORT_PICR);
170 170
171 /* Select USB Host controller */ 171 /* Select USB Host controller */
172 ctrl_outw(0x00, USB_USBHSC); 172 __raw_writew(0x00, USB_USBHSC);
173 173
174 /* For LCD */ 174 /* For LCD */
175 /* set PTJ7-1, bits 15-2 of PJCR to 0 */ 175 /* set PTJ7-1, bits 15-2 of PJCR to 0 */
176 ctrl_outw(ctrl_inw(PORT_PJCR) & 0x0003, PORT_PJCR); 176 __raw_writew(__raw_readw(PORT_PJCR) & 0x0003, PORT_PJCR);
177 /* set PTI5, bits 11-10 of PICR to 0 */ 177 /* set PTI5, bits 11-10 of PICR to 0 */
178 ctrl_outw(ctrl_inw(PORT_PICR) & 0xF3FF, PORT_PICR); 178 __raw_writew(__raw_readw(PORT_PICR) & 0xF3FF, PORT_PICR);
179 ctrl_outw(0, PORT_PKCR); 179 __raw_writew(0, PORT_PKCR);
180 ctrl_outw(0, PORT_PLCR); 180 __raw_writew(0, PORT_PLCR);
181 /* set PSEL2 bits 14-8, 5-4, of PSEL2 to 0 */ 181 /* set PSEL2 bits 14-8, 5-4, of PSEL2 to 0 */
182 ctrl_outw((ctrl_inw(PORT_PSEL2) & 0x00C0), PORT_PSEL2); 182 __raw_writew((__raw_readw(PORT_PSEL2) & 0x00C0), PORT_PSEL2);
183 /* set PSEL3 bits 14-12, 6-4, 2-0 of PSEL3 to 0 */ 183 /* set PSEL3 bits 14-12, 6-4, 2-0 of PSEL3 to 0 */
184 ctrl_outw((ctrl_inw(PORT_PSEL3) & 0x0700), PORT_PSEL3); 184 __raw_writew((__raw_readw(PORT_PSEL3) & 0x0700), PORT_PSEL3);
185 185
186 /* For HAC */ 186 /* For HAC */
187 /* bit3-0 0100:HAC & SSI1 enable */ 187 /* bit3-0 0100:HAC & SSI1 enable */
188 ctrl_outw((ctrl_inw(PORT_PSEL1) & 0xFFF0) | 0x0004, PORT_PSEL1); 188 __raw_writew((__raw_readw(PORT_PSEL1) & 0xFFF0) | 0x0004, PORT_PSEL1);
189 /* bit14 1:SSI_HAC_CLK enable */ 189 /* bit14 1:SSI_HAC_CLK enable */
190 ctrl_outw(ctrl_inw(PORT_PSEL4) | 0x4000, PORT_PSEL4); 190 __raw_writew(__raw_readw(PORT_PSEL4) | 0x4000, PORT_PSEL4);
191 191
192 /* SH-Ether */ 192 /* SH-Ether */
193 ctrl_outw((ctrl_inw(PORT_PSEL1) & ~0xff00) | 0x2400, PORT_PSEL1); 193 __raw_writew((__raw_readw(PORT_PSEL1) & ~0xff00) | 0x2400, PORT_PSEL1);
194 ctrl_outw(0x0, PORT_PFCR); 194 __raw_writew(0x0, PORT_PFCR);
195 ctrl_outw(0x0, PORT_PFCR); 195 __raw_writew(0x0, PORT_PFCR);
196 ctrl_outw(0x0, PORT_PFCR); 196 __raw_writew(0x0, PORT_PFCR);
197 197
198 /* MMC */ 198 /* MMC */
199 /*selects SCIF and MMC other functions */ 199 /*selects SCIF and MMC other functions */
200 ctrl_outw(0x0001, PORT_PSEL0); 200 __raw_writew(0x0001, PORT_PSEL0);
201 /* MMC clock operates */ 201 /* MMC clock operates */
202 ctrl_outl(ctrl_inl(MSTPCR1) & ~0x8, MSTPCR1); 202 __raw_writel(__raw_readl(MSTPCR1) & ~0x8, MSTPCR1);
203 ctrl_outw(ctrl_inw(PORT_PACR) & ~0x3000, PORT_PACR); 203 __raw_writew(__raw_readw(PORT_PACR) & ~0x3000, PORT_PACR);
204 ctrl_outw(ctrl_inw(PORT_PCCR) & ~0xCFC3, PORT_PCCR); 204 __raw_writew(__raw_readw(PORT_PCCR) & ~0xCFC3, PORT_PCCR);
205} 205}
206 206
207static struct sh_machine_vector mv_sh7763rdp __initmv = { 207static struct sh_machine_vector mv_sh7763rdp __initmv = {
diff --git a/arch/sh/boards/mach-snapgear/setup.c b/arch/sh/boards/mach-snapgear/setup.c
index a3277a23cf14..331745dee379 100644
--- a/arch/sh/boards/mach-snapgear/setup.c
+++ b/arch/sh/boards/mach-snapgear/setup.c
@@ -30,7 +30,7 @@
30 30
31static irqreturn_t eraseconfig_interrupt(int irq, void *dev_id) 31static irqreturn_t eraseconfig_interrupt(int irq, void *dev_id)
32{ 32{
33 (void)ctrl_inb(0xb8000000); /* dummy read */ 33 (void)__raw_readb(0xb8000000); /* dummy read */
34 34
35 printk("SnapGear: erase switch interrupt!\n"); 35 printk("SnapGear: erase switch interrupt!\n");
36 36
diff --git a/arch/sh/boards/mach-systemh/irq.c b/arch/sh/boards/mach-systemh/irq.c
index 986a0e71d220..523aea5dc94e 100644
--- a/arch/sh/boards/mach-systemh/irq.c
+++ b/arch/sh/boards/mach-systemh/irq.c
@@ -41,13 +41,13 @@ static void disable_systemh_irq(unsigned int irq)
41 unsigned long val, mask = 0x01 << 1; 41 unsigned long val, mask = 0x01 << 1;
42 42
43 /* Clear the "irq"th bit in the mask and set it in the request */ 43 /* Clear the "irq"th bit in the mask and set it in the request */
44 val = ctrl_inl((unsigned long)systemh_irq_mask_register); 44 val = __raw_readl((unsigned long)systemh_irq_mask_register);
45 val &= ~mask; 45 val &= ~mask;
46 ctrl_outl(val, (unsigned long)systemh_irq_mask_register); 46 __raw_writel(val, (unsigned long)systemh_irq_mask_register);
47 47
48 val = ctrl_inl((unsigned long)systemh_irq_request_register); 48 val = __raw_readl((unsigned long)systemh_irq_request_register);
49 val |= mask; 49 val |= mask;
50 ctrl_outl(val, (unsigned long)systemh_irq_request_register); 50 __raw_writel(val, (unsigned long)systemh_irq_request_register);
51 } 51 }
52} 52}
53 53
@@ -57,9 +57,9 @@ static void enable_systemh_irq(unsigned int irq)
57 unsigned long val, mask = 0x01 << 1; 57 unsigned long val, mask = 0x01 << 1;
58 58
59 /* Set "irq"th bit in the mask register */ 59 /* Set "irq"th bit in the mask register */
60 val = ctrl_inl((unsigned long)systemh_irq_mask_register); 60 val = __raw_readl((unsigned long)systemh_irq_mask_register);
61 val |= mask; 61 val |= mask;
62 ctrl_outl(val, (unsigned long)systemh_irq_mask_register); 62 __raw_writel(val, (unsigned long)systemh_irq_mask_register);
63 } 63 }
64} 64}
65 65
diff --git a/arch/sh/boards/mach-titan/Makefile b/arch/sh/boards/mach-titan/Makefile
deleted file mode 100644
index 08d753700062..000000000000
--- a/arch/sh/boards/mach-titan/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
1#
2# Makefile for the Nimble Microsystems TITAN specific parts of the kernel
3#
4
5obj-y := setup.o io.o
diff --git a/arch/sh/boards/mach-titan/io.c b/arch/sh/boards/mach-titan/io.c
deleted file mode 100644
index 0130e9826aca..000000000000
--- a/arch/sh/boards/mach-titan/io.c
+++ /dev/null
@@ -1,108 +0,0 @@
1/*
2 * I/O routines for Titan
3 */
4#include <linux/pci.h>
5#include <asm/machvec.h>
6#include <asm/addrspace.h>
7#include <mach/titan.h>
8#include <asm/io.h>
9
10static inline unsigned int port2adr(unsigned int port)
11{
12 maybebadio((unsigned long)port);
13 return port;
14}
15
16u8 titan_inb(unsigned long port)
17{
18 if (PXSEG(port))
19 return ctrl_inb(port);
20 return ctrl_inw(port2adr(port)) & 0xff;
21}
22
23u8 titan_inb_p(unsigned long port)
24{
25 u8 v;
26
27 if (PXSEG(port))
28 v = ctrl_inb(port);
29 else
30 v = ctrl_inw(port2adr(port)) & 0xff;
31 ctrl_delay();
32 return v;
33}
34
35u16 titan_inw(unsigned long port)
36{
37 if (PXSEG(port))
38 return ctrl_inw(port);
39 else if (port >= 0x2000)
40 return ctrl_inw(port2adr(port));
41 else
42 maybebadio(port);
43 return 0;
44}
45
46u32 titan_inl(unsigned long port)
47{
48 if (PXSEG(port))
49 return ctrl_inl(port);
50 else if (port >= 0x2000)
51 return ctrl_inw(port2adr(port));
52 else
53 maybebadio(port);
54 return 0;
55}
56
57void titan_outb(u8 value, unsigned long port)
58{
59 if (PXSEG(port))
60 ctrl_outb(value, port);
61 else
62 ctrl_outw(value, port2adr(port));
63}
64
65void titan_outb_p(u8 value, unsigned long port)
66{
67 if (PXSEG(port))
68 ctrl_outb(value, port);
69 else
70 ctrl_outw(value, port2adr(port));
71 ctrl_delay();
72}
73
74void titan_outw(u16 value, unsigned long port)
75{
76 if (PXSEG(port))
77 ctrl_outw(value, port);
78 else if (port >= 0x2000)
79 ctrl_outw(value, port2adr(port));
80 else
81 maybebadio(port);
82}
83
84void titan_outl(u32 value, unsigned long port)
85{
86 if (PXSEG(port))
87 ctrl_outl(value, port);
88 else
89 maybebadio(port);
90}
91
92void titan_insl(unsigned long port, void *dst, unsigned long count)
93{
94 maybebadio(port);
95}
96
97void titan_outsl(unsigned long port, const void *src, unsigned long count)
98{
99 maybebadio(port);
100}
101
102void __iomem *titan_ioport_map(unsigned long port, unsigned int size)
103{
104 if (PXSEG(port))
105 return (void __iomem *)port;
106
107 return (void __iomem *)port2adr(port);
108}
diff --git a/arch/sh/boards/mach-x3proto/ilsel.c b/arch/sh/boards/mach-x3proto/ilsel.c
index b5c673c39337..5c9842704c60 100644
--- a/arch/sh/boards/mach-x3proto/ilsel.c
+++ b/arch/sh/boards/mach-x3proto/ilsel.c
@@ -70,10 +70,10 @@ static void __ilsel_enable(ilsel_source_t set, unsigned int bit)
70 pr_debug("%s: bit#%d: addr - 0x%08lx (shift %d, set %d)\n", 70 pr_debug("%s: bit#%d: addr - 0x%08lx (shift %d, set %d)\n",
71 __func__, bit, addr, shift, set); 71 __func__, bit, addr, shift, set);
72 72
73 tmp = ctrl_inw(addr); 73 tmp = __raw_readw(addr);
74 tmp &= ~(0xf << shift); 74 tmp &= ~(0xf << shift);
75 tmp |= set << shift; 75 tmp |= set << shift;
76 ctrl_outw(tmp, addr); 76 __raw_writew(tmp, addr);
77} 77}
78 78
79/** 79/**
@@ -142,9 +142,9 @@ void ilsel_disable(unsigned int irq)
142 142
143 addr = mk_ilsel_addr(irq); 143 addr = mk_ilsel_addr(irq);
144 144
145 tmp = ctrl_inw(addr); 145 tmp = __raw_readw(addr);
146 tmp &= ~(0xf << mk_ilsel_shift(irq)); 146 tmp &= ~(0xf << mk_ilsel_shift(irq));
147 ctrl_outw(tmp, addr); 147 __raw_writew(tmp, addr);
148 148
149 clear_bit(irq, &ilsel_level_map); 149 clear_bit(irq, &ilsel_level_map);
150} 150}
diff --git a/arch/sh/boards/mach-x3proto/setup.c b/arch/sh/boards/mach-x3proto/setup.c
index efe4cb9f8a77..e284592fd42a 100644
--- a/arch/sh/boards/mach-x3proto/setup.c
+++ b/arch/sh/boards/mach-x3proto/setup.c
@@ -149,7 +149,7 @@ static void __init x3proto_init_irq(void)
149 plat_irq_setup_pins(IRQ_MODE_IRL3210); 149 plat_irq_setup_pins(IRQ_MODE_IRL3210);
150 150
151 /* Set ICR0.LVLMODE */ 151 /* Set ICR0.LVLMODE */
152 ctrl_outl(ctrl_inl(0xfe410000) | (1 << 21), 0xfe410000); 152 __raw_writel(__raw_readl(0xfe410000) | (1 << 21), 0xfe410000);
153} 153}
154 154
155static struct sh_machine_vector mv_x3proto __initmv = { 155static struct sh_machine_vector mv_x3proto __initmv = {
diff --git a/arch/sh/boot/Makefile b/arch/sh/boot/Makefile
index cb8cf5572e79..1ce63624c9b9 100644
--- a/arch/sh/boot/Makefile
+++ b/arch/sh/boot/Makefile
@@ -21,12 +21,15 @@ CONFIG_ZERO_PAGE_OFFSET ?= 0x00001000
21CONFIG_ENTRY_OFFSET ?= 0x00001000 21CONFIG_ENTRY_OFFSET ?= 0x00001000
22 22
23suffix-y := bin 23suffix-y := bin
24suffix-$(CONFIG_KERNEL_GZIP) := gz 24suffix-$(CONFIG_KERNEL_GZIP) := gz
25suffix-$(CONFIG_KERNEL_BZIP2) := bz2 25suffix-$(CONFIG_KERNEL_BZIP2) := bz2
26suffix-$(CONFIG_KERNEL_LZMA) := lzma 26suffix-$(CONFIG_KERNEL_LZMA) := lzma
27 27suffix-$(CONFIG_KERNEL_LZO) := lzo
28targets := zImage vmlinux.srec romImage uImage uImage.srec uImage.gz uImage.bz2 uImage.lzma uImage.bin 28
29extra-y += vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma 29targets := zImage vmlinux.srec romImage uImage uImage.srec uImage.gz \
30 uImage.bz2 uImage.lzma uImage.lzo uImage.bin
31extra-y += vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma \
32 vmlinux.bin.lzo
30subdir- := compressed romimage 33subdir- := compressed romimage
31 34
32$(obj)/zImage: $(obj)/compressed/vmlinux FORCE 35$(obj)/zImage: $(obj)/compressed/vmlinux FORCE
@@ -43,15 +46,8 @@ $(obj)/romImage: $(obj)/romimage/vmlinux FORCE
43$(obj)/romimage/vmlinux: $(obj)/zImage FORCE 46$(obj)/romimage/vmlinux: $(obj)/zImage FORCE
44 $(Q)$(MAKE) $(build)=$(obj)/romimage $@ 47 $(Q)$(MAKE) $(build)=$(obj)/romimage $@
45 48
46KERNEL_MEMORY := 0x00000000 49KERNEL_MEMORY := $(shell /bin/bash -c 'printf "0x%08x" \
47ifeq ($(CONFIG_PMB_FIXED),y)
48KERNEL_MEMORY := $(shell /bin/bash -c 'printf "0x%08x" \
49 $$[$(CONFIG_MEMORY_START) & 0x1fffffff]') 50 $$[$(CONFIG_MEMORY_START) & 0x1fffffff]')
50endif
51ifeq ($(CONFIG_29BIT),y)
52KERNEL_MEMORY := $(shell /bin/bash -c 'printf "0x%08x" \
53 $$[$(CONFIG_MEMORY_START)]')
54endif
55 51
56KERNEL_LOAD := $(shell /bin/bash -c 'printf "0x%08x" \ 52KERNEL_LOAD := $(shell /bin/bash -c 'printf "0x%08x" \
57 $$[$(CONFIG_PAGE_OFFSET) + \ 53 $$[$(CONFIG_PAGE_OFFSET) + \
@@ -80,6 +76,9 @@ $(obj)/vmlinux.bin.bz2: $(obj)/vmlinux.bin FORCE
80$(obj)/vmlinux.bin.lzma: $(obj)/vmlinux.bin FORCE 76$(obj)/vmlinux.bin.lzma: $(obj)/vmlinux.bin FORCE
81 $(call if_changed,lzma) 77 $(call if_changed,lzma)
82 78
79$(obj)/vmlinux.bin.lzo: $(obj)/vmlinux.bin FORCE
80 $(call if_changed,lzo)
81
83$(obj)/uImage.bz2: $(obj)/vmlinux.bin.bz2 82$(obj)/uImage.bz2: $(obj)/vmlinux.bin.bz2
84 $(call if_changed,uimage,bzip2) 83 $(call if_changed,uimage,bzip2)
85 84
@@ -89,6 +88,9 @@ $(obj)/uImage.gz: $(obj)/vmlinux.bin.gz
89$(obj)/uImage.lzma: $(obj)/vmlinux.bin.lzma 88$(obj)/uImage.lzma: $(obj)/vmlinux.bin.lzma
90 $(call if_changed,uimage,lzma) 89 $(call if_changed,uimage,lzma)
91 90
91$(obj)/uImage.lzo: $(obj)/vmlinux.bin.lzo
92 $(call if_changed,uimage,lzo)
93
92$(obj)/uImage.bin: $(obj)/vmlinux.bin 94$(obj)/uImage.bin: $(obj)/vmlinux.bin
93 $(call if_changed,uimage,none) 95 $(call if_changed,uimage,none)
94 96
diff --git a/arch/sh/boot/compressed/Makefile b/arch/sh/boot/compressed/Makefile
index 6182eca5180a..5d660b90943b 100644
--- a/arch/sh/boot/compressed/Makefile
+++ b/arch/sh/boot/compressed/Makefile
@@ -6,14 +6,11 @@
6 6
7targets := vmlinux vmlinux.bin vmlinux.bin.gz \ 7targets := vmlinux vmlinux.bin vmlinux.bin.gz \
8 vmlinux.bin.bz2 vmlinux.bin.lzma \ 8 vmlinux.bin.bz2 vmlinux.bin.lzma \
9 vmlinux.bin.lzo \
9 head_$(BITS).o misc.o piggy.o 10 head_$(BITS).o misc.o piggy.o
10 11
11OBJECTS = $(obj)/head_$(BITS).o $(obj)/misc.o $(obj)/cache.o 12OBJECTS = $(obj)/head_$(BITS).o $(obj)/misc.o $(obj)/cache.o
12 13
13ifdef CONFIG_SH_STANDARD_BIOS
14OBJECTS += $(obj)/../../kernel/sh_bios.o
15endif
16
17# 14#
18# IMAGE_OFFSET is the load offset of the compression loader 15# IMAGE_OFFSET is the load offset of the compression loader
19# 16#
@@ -47,6 +44,8 @@ $(obj)/vmlinux.bin.bz2: $(vmlinux.bin.all-y) FORCE
47 $(call if_changed,bzip2) 44 $(call if_changed,bzip2)
48$(obj)/vmlinux.bin.lzma: $(vmlinux.bin.all-y) FORCE 45$(obj)/vmlinux.bin.lzma: $(vmlinux.bin.all-y) FORCE
49 $(call if_changed,lzma) 46 $(call if_changed,lzma)
47$(obj)/vmlinux.bin.lzo: $(vmlinux.bin.all-y) FORCE
48 $(call if_changed,lzo)
50 49
51OBJCOPYFLAGS += -R .empty_zero_page 50OBJCOPYFLAGS += -R .empty_zero_page
52 51
diff --git a/arch/sh/boot/compressed/misc.c b/arch/sh/boot/compressed/misc.c
index b51b1fc4baae..27140a6b365d 100644
--- a/arch/sh/boot/compressed/misc.c
+++ b/arch/sh/boot/compressed/misc.c
@@ -14,7 +14,6 @@
14#include <asm/uaccess.h> 14#include <asm/uaccess.h>
15#include <asm/addrspace.h> 15#include <asm/addrspace.h>
16#include <asm/page.h> 16#include <asm/page.h>
17#include <asm/sh_bios.h>
18 17
19/* 18/*
20 * gzip declarations 19 * gzip declarations
@@ -62,29 +61,15 @@ static unsigned long free_mem_end_ptr;
62#include "../../../../lib/decompress_unlzma.c" 61#include "../../../../lib/decompress_unlzma.c"
63#endif 62#endif
64 63
65#ifdef CONFIG_SH_STANDARD_BIOS 64#ifdef CONFIG_KERNEL_LZO
66size_t strlen(const char *s) 65#include "../../../../lib/decompress_unlzo.c"
67{ 66#endif
68 int i = 0;
69
70 while (*s++)
71 i++;
72 return i;
73}
74 67
75int puts(const char *s) 68int puts(const char *s)
76{ 69{
77 int len = strlen(s);
78 sh_bios_console_write(s, len);
79 return len;
80}
81#else
82int puts(const char *s)
83{
84 /* This should be updated to use the sh-sci routines */ 70 /* This should be updated to use the sh-sci routines */
85 return 0; 71 return 0;
86} 72}
87#endif
88 73
89void* memset(void* s, int c, size_t n) 74void* memset(void* s, int c, size_t n)
90{ 75{
@@ -132,7 +117,7 @@ void decompress_kernel(void)
132 output_addr = (CONFIG_MEMORY_START + 0x2000); 117 output_addr = (CONFIG_MEMORY_START + 0x2000);
133#else 118#else
134 output_addr = __pa((unsigned long)&_text+PAGE_SIZE); 119 output_addr = __pa((unsigned long)&_text+PAGE_SIZE);
135#ifdef CONFIG_29BIT 120#if defined(CONFIG_29BIT)
136 output_addr |= P2SEG; 121 output_addr |= P2SEG;
137#endif 122#endif
138#endif 123#endif
diff --git a/arch/sh/cchips/hd6446x/hd64461.c b/arch/sh/cchips/hd6446x/hd64461.c
index 50aa0c1f76ea..bcb31ae84a51 100644
--- a/arch/sh/cchips/hd6446x/hd64461.c
+++ b/arch/sh/cchips/hd6446x/hd64461.c
@@ -55,25 +55,22 @@ static struct irq_chip hd64461_irq_chip = {
55 55
56static void hd64461_irq_demux(unsigned int irq, struct irq_desc *desc) 56static void hd64461_irq_demux(unsigned int irq, struct irq_desc *desc)
57{ 57{
58 unsigned short intv = ctrl_inw(HD64461_NIRR); 58 unsigned short intv = __raw_readw(HD64461_NIRR);
59 struct irq_desc *ext_desc;
60 unsigned int ext_irq = HD64461_IRQBASE; 59 unsigned int ext_irq = HD64461_IRQBASE;
61 60
62 intv &= (1 << HD64461_IRQ_NUM) - 1; 61 intv &= (1 << HD64461_IRQ_NUM) - 1;
63 62
64 while (intv) { 63 for (; intv; intv >>= 1, ext_irq++) {
65 if (intv & 1) { 64 if (!(intv & 1))
66 ext_desc = irq_desc + ext_irq; 65 continue;
67 handle_level_irq(ext_irq, ext_desc); 66
68 } 67 generic_handle_irq(ext_irq);
69 intv >>= 1;
70 ext_irq++;
71 } 68 }
72} 69}
73 70
74int __init setup_hd64461(void) 71int __init setup_hd64461(void)
75{ 72{
76 int i; 73 int i, nid = cpu_to_node(boot_cpu_data);
77 74
78 if (!MACH_HD64461) 75 if (!MACH_HD64461)
79 return 0; 76 return 0;
@@ -90,9 +87,26 @@ int __init setup_hd64461(void)
90 __raw_writew(0xffff, HD64461_NIMR); 87 __raw_writew(0xffff, HD64461_NIMR);
91 88
92 /* IRQ 80 -> 95 belongs to HD64461 */ 89 /* IRQ 80 -> 95 belongs to HD64461 */
93 for (i = HD64461_IRQBASE; i < HD64461_IRQBASE + 16; i++) 90 for (i = HD64461_IRQBASE; i < HD64461_IRQBASE + 16; i++) {
91 unsigned int irq;
92
93 irq = create_irq_nr(i, nid);
94 if (unlikely(irq == 0)) {
95 pr_err("%s: failed hooking irq %d for HD64461\n",
96 __func__, i);
97 return -EBUSY;
98 }
99
100 if (unlikely(irq != i)) {
101 pr_err("%s: got irq %d but wanted %d, bailing.\n",
102 __func__, irq, i);
103 destroy_irq(irq);
104 return -EINVAL;
105 }
106
94 set_irq_chip_and_handler(i, &hd64461_irq_chip, 107 set_irq_chip_and_handler(i, &hd64461_irq_chip,
95 handle_level_irq); 108 handle_level_irq);
109 }
96 110
97 set_irq_chained_handler(CONFIG_HD64461_IRQ, hd64461_irq_demux); 111 set_irq_chained_handler(CONFIG_HD64461_IRQ, hd64461_irq_demux);
98 set_irq_type(CONFIG_HD64461_IRQ, IRQ_TYPE_LEVEL_LOW); 112 set_irq_type(CONFIG_HD64461_IRQ, IRQ_TYPE_LEVEL_LOW);
diff --git a/arch/sh/configs/sdk7786_defconfig b/arch/sh/configs/sdk7786_defconfig
new file mode 100644
index 000000000000..9b331eab968e
--- /dev/null
+++ b/arch/sh/configs/sdk7786_defconfig
@@ -0,0 +1,1754 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.33-rc7
4# Tue Feb 9 15:27:06 2010
5#
6CONFIG_SUPERH=y
7CONFIG_SUPERH32=y
8# CONFIG_SUPERH64 is not set
9CONFIG_ARCH_DEFCONFIG="arch/sh/configs/shx3_defconfig"
10CONFIG_RWSEM_GENERIC_SPINLOCK=y
11CONFIG_GENERIC_BUG=y
12CONFIG_GENERIC_FIND_NEXT_BIT=y
13CONFIG_GENERIC_HWEIGHT=y
14CONFIG_GENERIC_HARDIRQS=y
15CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
16CONFIG_IRQ_PER_CPU=y
17CONFIG_SPARSE_IRQ=y
18# CONFIG_GENERIC_GPIO is not set
19CONFIG_GENERIC_TIME=y
20CONFIG_GENERIC_CLOCKEVENTS=y
21# CONFIG_ARCH_SUSPEND_POSSIBLE is not set
22CONFIG_ARCH_HIBERNATION_POSSIBLE=y
23CONFIG_SYS_SUPPORTS_HUGETLBFS=y
24CONFIG_SYS_SUPPORTS_SMP=y
25CONFIG_SYS_SUPPORTS_NUMA=y
26CONFIG_SYS_SUPPORTS_PCI=y
27CONFIG_SYS_SUPPORTS_TMU=y
28CONFIG_STACKTRACE_SUPPORT=y
29CONFIG_LOCKDEP_SUPPORT=y
30CONFIG_HAVE_LATENCYTOP_SUPPORT=y
31# CONFIG_ARCH_HAS_ILOG2_U32 is not set
32# CONFIG_ARCH_HAS_ILOG2_U64 is not set
33CONFIG_ARCH_NO_VIRT_TO_BUS=y
34CONFIG_ARCH_HAS_DEFAULT_IDLE=y
35CONFIG_ARCH_HAS_CPU_IDLE_WAIT=y
36CONFIG_DMA_COHERENT=y
37# CONFIG_DMA_NONCOHERENT is not set
38CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
39CONFIG_CONSTRUCTORS=y
40
41#
42# General setup
43#
44CONFIG_EXPERIMENTAL=y
45CONFIG_BROKEN_ON_SMP=y
46CONFIG_LOCK_KERNEL=y
47CONFIG_INIT_ENV_ARG_LIMIT=32
48CONFIG_LOCALVERSION=""
49CONFIG_LOCALVERSION_AUTO=y
50CONFIG_HAVE_KERNEL_GZIP=y
51CONFIG_HAVE_KERNEL_BZIP2=y
52CONFIG_HAVE_KERNEL_LZMA=y
53CONFIG_HAVE_KERNEL_LZO=y
54CONFIG_KERNEL_GZIP=y
55# CONFIG_KERNEL_BZIP2 is not set
56# CONFIG_KERNEL_LZMA is not set
57# CONFIG_KERNEL_LZO is not set
58CONFIG_SWAP=y
59CONFIG_SYSVIPC=y
60CONFIG_SYSVIPC_SYSCTL=y
61CONFIG_POSIX_MQUEUE=y
62CONFIG_POSIX_MQUEUE_SYSCTL=y
63CONFIG_BSD_PROCESS_ACCT=y
64# CONFIG_BSD_PROCESS_ACCT_V3 is not set
65# CONFIG_TASKSTATS is not set
66# CONFIG_AUDIT is not set
67
68#
69# RCU Subsystem
70#
71CONFIG_TREE_RCU=y
72# CONFIG_TREE_PREEMPT_RCU is not set
73# CONFIG_TINY_RCU is not set
74CONFIG_RCU_TRACE=y
75CONFIG_RCU_FANOUT=32
76# CONFIG_RCU_FANOUT_EXACT is not set
77CONFIG_TREE_RCU_TRACE=y
78CONFIG_IKCONFIG=y
79CONFIG_IKCONFIG_PROC=y
80CONFIG_LOG_BUF_SHIFT=14
81CONFIG_GROUP_SCHED=y
82CONFIG_FAIR_GROUP_SCHED=y
83CONFIG_RT_GROUP_SCHED=y
84CONFIG_USER_SCHED=y
85# CONFIG_CGROUP_SCHED is not set
86CONFIG_CGROUPS=y
87# CONFIG_CGROUP_DEBUG is not set
88CONFIG_CGROUP_NS=y
89CONFIG_CGROUP_FREEZER=y
90CONFIG_CGROUP_DEVICE=y
91# CONFIG_CPUSETS is not set
92CONFIG_CGROUP_CPUACCT=y
93CONFIG_RESOURCE_COUNTERS=y
94CONFIG_CGROUP_MEM_RES_CTLR=y
95# CONFIG_CGROUP_MEM_RES_CTLR_SWAP is not set
96CONFIG_MM_OWNER=y
97# CONFIG_SYSFS_DEPRECATED_V2 is not set
98# CONFIG_RELAY is not set
99CONFIG_NAMESPACES=y
100CONFIG_UTS_NS=y
101CONFIG_IPC_NS=y
102CONFIG_USER_NS=y
103CONFIG_PID_NS=y
104CONFIG_NET_NS=y
105# CONFIG_BLK_DEV_INITRD is not set
106CONFIG_CC_OPTIMIZE_FOR_SIZE=y
107CONFIG_SYSCTL=y
108CONFIG_ANON_INODES=y
109CONFIG_EMBEDDED=y
110CONFIG_UID16=y
111CONFIG_SYSCTL_SYSCALL=y
112CONFIG_KALLSYMS=y
113CONFIG_KALLSYMS_ALL=y
114# CONFIG_KALLSYMS_EXTRA_PASS is not set
115CONFIG_HOTPLUG=y
116CONFIG_PRINTK=y
117CONFIG_BUG=y
118CONFIG_ELF_CORE=y
119CONFIG_BASE_FULL=y
120CONFIG_FUTEX=y
121CONFIG_EPOLL=y
122CONFIG_SIGNALFD=y
123CONFIG_TIMERFD=y
124CONFIG_EVENTFD=y
125CONFIG_SHMEM=y
126CONFIG_AIO=y
127CONFIG_HAVE_PERF_EVENTS=y
128CONFIG_PERF_USE_VMALLOC=y
129
130#
131# Kernel Performance Events And Counters
132#
133CONFIG_PERF_EVENTS=y
134CONFIG_EVENT_PROFILE=y
135# CONFIG_PERF_COUNTERS is not set
136# CONFIG_DEBUG_PERF_USE_VMALLOC is not set
137CONFIG_VM_EVENT_COUNTERS=y
138CONFIG_PCI_QUIRKS=y
139# CONFIG_COMPAT_BRK is not set
140CONFIG_SLAB=y
141# CONFIG_SLUB is not set
142# CONFIG_SLOB is not set
143CONFIG_PROFILING=y
144CONFIG_TRACEPOINTS=y
145# CONFIG_OPROFILE is not set
146CONFIG_HAVE_OPROFILE=y
147# CONFIG_KPROBES is not set
148CONFIG_HAVE_KPROBES=y
149CONFIG_HAVE_KRETPROBES=y
150CONFIG_HAVE_ARCH_TRACEHOOK=y
151CONFIG_HAVE_DMA_ATTRS=y
152CONFIG_HAVE_CLK=y
153CONFIG_HAVE_DMA_API_DEBUG=y
154CONFIG_HAVE_HW_BREAKPOINT=y
155
156#
157# GCOV-based kernel profiling
158#
159# CONFIG_GCOV_KERNEL is not set
160# CONFIG_SLOW_WORK is not set
161CONFIG_HAVE_GENERIC_DMA_COHERENT=y
162CONFIG_SLABINFO=y
163CONFIG_RT_MUTEXES=y
164CONFIG_BASE_SMALL=0
165CONFIG_MODULES=y
166# CONFIG_MODULE_FORCE_LOAD is not set
167CONFIG_MODULE_UNLOAD=y
168# CONFIG_MODULE_FORCE_UNLOAD is not set
169# CONFIG_MODVERSIONS is not set
170# CONFIG_MODULE_SRCVERSION_ALL is not set
171CONFIG_BLOCK=y
172# CONFIG_LBDAF is not set
173# CONFIG_BLK_DEV_BSG is not set
174# CONFIG_BLK_DEV_INTEGRITY is not set
175CONFIG_BLK_CGROUP=y
176# CONFIG_DEBUG_BLK_CGROUP is not set
177
178#
179# IO Schedulers
180#
181CONFIG_IOSCHED_NOOP=y
182CONFIG_IOSCHED_DEADLINE=y
183CONFIG_IOSCHED_CFQ=y
184CONFIG_CFQ_GROUP_IOSCHED=y
185# CONFIG_DEBUG_CFQ_IOSCHED is not set
186# CONFIG_DEFAULT_DEADLINE is not set
187CONFIG_DEFAULT_CFQ=y
188# CONFIG_DEFAULT_NOOP is not set
189CONFIG_DEFAULT_IOSCHED="cfq"
190# CONFIG_INLINE_SPIN_TRYLOCK is not set
191# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set
192# CONFIG_INLINE_SPIN_LOCK is not set
193# CONFIG_INLINE_SPIN_LOCK_BH is not set
194# CONFIG_INLINE_SPIN_LOCK_IRQ is not set
195# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set
196# CONFIG_INLINE_SPIN_UNLOCK is not set
197# CONFIG_INLINE_SPIN_UNLOCK_BH is not set
198# CONFIG_INLINE_SPIN_UNLOCK_IRQ is not set
199# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set
200# CONFIG_INLINE_READ_TRYLOCK is not set
201# CONFIG_INLINE_READ_LOCK is not set
202# CONFIG_INLINE_READ_LOCK_BH is not set
203# CONFIG_INLINE_READ_LOCK_IRQ is not set
204# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set
205# CONFIG_INLINE_READ_UNLOCK is not set
206# CONFIG_INLINE_READ_UNLOCK_BH is not set
207# CONFIG_INLINE_READ_UNLOCK_IRQ is not set
208# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set
209# CONFIG_INLINE_WRITE_TRYLOCK is not set
210# CONFIG_INLINE_WRITE_LOCK is not set
211# CONFIG_INLINE_WRITE_LOCK_BH is not set
212# CONFIG_INLINE_WRITE_LOCK_IRQ is not set
213# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set
214# CONFIG_INLINE_WRITE_UNLOCK is not set
215# CONFIG_INLINE_WRITE_UNLOCK_BH is not set
216# CONFIG_INLINE_WRITE_UNLOCK_IRQ is not set
217# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set
218# CONFIG_MUTEX_SPIN_ON_OWNER is not set
219CONFIG_FREEZER=y
220
221#
222# System type
223#
224CONFIG_CPU_SH4=y
225CONFIG_CPU_SH4A=y
226CONFIG_CPU_SHX3=y
227# CONFIG_CPU_SUBTYPE_SH7619 is not set
228# CONFIG_CPU_SUBTYPE_SH7201 is not set
229# CONFIG_CPU_SUBTYPE_SH7203 is not set
230# CONFIG_CPU_SUBTYPE_SH7206 is not set
231# CONFIG_CPU_SUBTYPE_SH7263 is not set
232# CONFIG_CPU_SUBTYPE_MXG is not set
233# CONFIG_CPU_SUBTYPE_SH7705 is not set
234# CONFIG_CPU_SUBTYPE_SH7706 is not set
235# CONFIG_CPU_SUBTYPE_SH7707 is not set
236# CONFIG_CPU_SUBTYPE_SH7708 is not set
237# CONFIG_CPU_SUBTYPE_SH7709 is not set
238# CONFIG_CPU_SUBTYPE_SH7710 is not set
239# CONFIG_CPU_SUBTYPE_SH7712 is not set
240# CONFIG_CPU_SUBTYPE_SH7720 is not set
241# CONFIG_CPU_SUBTYPE_SH7721 is not set
242# CONFIG_CPU_SUBTYPE_SH7750 is not set
243# CONFIG_CPU_SUBTYPE_SH7091 is not set
244# CONFIG_CPU_SUBTYPE_SH7750R is not set
245# CONFIG_CPU_SUBTYPE_SH7750S is not set
246# CONFIG_CPU_SUBTYPE_SH7751 is not set
247# CONFIG_CPU_SUBTYPE_SH7751R is not set
248# CONFIG_CPU_SUBTYPE_SH7760 is not set
249# CONFIG_CPU_SUBTYPE_SH4_202 is not set
250# CONFIG_CPU_SUBTYPE_SH7723 is not set
251# CONFIG_CPU_SUBTYPE_SH7724 is not set
252# CONFIG_CPU_SUBTYPE_SH7757 is not set
253# CONFIG_CPU_SUBTYPE_SH7763 is not set
254# CONFIG_CPU_SUBTYPE_SH7770 is not set
255# CONFIG_CPU_SUBTYPE_SH7780 is not set
256# CONFIG_CPU_SUBTYPE_SH7785 is not set
257CONFIG_CPU_SUBTYPE_SH7786=y
258# CONFIG_CPU_SUBTYPE_SHX3 is not set
259# CONFIG_CPU_SUBTYPE_SH7343 is not set
260# CONFIG_CPU_SUBTYPE_SH7722 is not set
261# CONFIG_CPU_SUBTYPE_SH7366 is not set
262
263#
264# Memory management options
265#
266CONFIG_QUICKLIST=y
267CONFIG_MMU=y
268CONFIG_PAGE_OFFSET=0x80000000
269CONFIG_FORCE_MAX_ZONEORDER=11
270CONFIG_MEMORY_START=0x60000000
271CONFIG_MEMORY_SIZE=0x20000000
272# CONFIG_29BIT is not set
273CONFIG_32BIT=y
274CONFIG_PMB=y
275# CONFIG_PMB_LEGACY is not set
276CONFIG_X2TLB=y
277CONFIG_VSYSCALL=y
278# CONFIG_NUMA is not set
279CONFIG_ARCH_FLATMEM_ENABLE=y
280CONFIG_ARCH_SPARSEMEM_ENABLE=y
281CONFIG_ARCH_SPARSEMEM_DEFAULT=y
282CONFIG_MAX_ACTIVE_REGIONS=1
283CONFIG_ARCH_POPULATES_NODE_MAP=y
284CONFIG_ARCH_SELECT_MEMORY_MODEL=y
285CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
286CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
287CONFIG_ARCH_MEMORY_PROBE=y
288CONFIG_IOREMAP_FIXED=y
289CONFIG_PAGE_SIZE_4KB=y
290# CONFIG_PAGE_SIZE_8KB is not set
291# CONFIG_PAGE_SIZE_16KB is not set
292# CONFIG_PAGE_SIZE_64KB is not set
293# CONFIG_HUGETLB_PAGE_SIZE_64K is not set
294# CONFIG_HUGETLB_PAGE_SIZE_256K is not set
295CONFIG_HUGETLB_PAGE_SIZE_1MB=y
296# CONFIG_HUGETLB_PAGE_SIZE_4MB is not set
297# CONFIG_HUGETLB_PAGE_SIZE_64MB is not set
298# CONFIG_HUGETLB_PAGE_SIZE_512MB is not set
299CONFIG_SELECT_MEMORY_MODEL=y
300# CONFIG_FLATMEM_MANUAL is not set
301# CONFIG_DISCONTIGMEM_MANUAL is not set
302CONFIG_SPARSEMEM_MANUAL=y
303CONFIG_SPARSEMEM=y
304CONFIG_HAVE_MEMORY_PRESENT=y
305CONFIG_SPARSEMEM_STATIC=y
306CONFIG_MEMORY_HOTPLUG=y
307CONFIG_MEMORY_HOTPLUG_SPARSE=y
308CONFIG_MEMORY_HOTREMOVE=y
309CONFIG_SPLIT_PTLOCK_CPUS=4
310CONFIG_MIGRATION=y
311# CONFIG_PHYS_ADDR_T_64BIT is not set
312CONFIG_ZONE_DMA_FLAG=0
313CONFIG_NR_QUICK=1
314CONFIG_KSM=y
315CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
316
317#
318# Cache configuration
319#
320CONFIG_CACHE_WRITEBACK=y
321# CONFIG_CACHE_WRITETHROUGH is not set
322# CONFIG_CACHE_OFF is not set
323
324#
325# Processor features
326#
327CONFIG_CPU_LITTLE_ENDIAN=y
328# CONFIG_CPU_BIG_ENDIAN is not set
329CONFIG_SH_FPU=y
330CONFIG_SH_STORE_QUEUES=y
331CONFIG_CPU_HAS_INTEVT=y
332CONFIG_CPU_HAS_SR_RB=y
333CONFIG_CPU_HAS_PTEAEX=y
334CONFIG_CPU_HAS_FPU=y
335
336#
337# Board support
338#
339CONFIG_SH_SDK7786=y
340# CONFIG_SH_URQUELL is not set
341
342#
343# Timer and clock configuration
344#
345CONFIG_SH_TIMER_TMU=y
346CONFIG_SH_CLK_CPG=y
347CONFIG_TICK_ONESHOT=y
348CONFIG_NO_HZ=y
349CONFIG_HIGH_RES_TIMERS=y
350CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
351
352#
353# CPU Frequency scaling
354#
355CONFIG_CPU_FREQ=y
356CONFIG_CPU_FREQ_TABLE=y
357# CONFIG_CPU_FREQ_DEBUG is not set
358CONFIG_CPU_FREQ_STAT=y
359# CONFIG_CPU_FREQ_STAT_DETAILS is not set
360CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
361# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
362# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
363# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
364# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
365CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
366CONFIG_CPU_FREQ_GOV_POWERSAVE=m
367CONFIG_CPU_FREQ_GOV_USERSPACE=m
368CONFIG_CPU_FREQ_GOV_ONDEMAND=m
369CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m
370CONFIG_SH_CPU_FREQ=y
371
372#
373# DMA support
374#
375# CONFIG_SH_DMA is not set
376
377#
378# Companion Chips
379#
380
381#
382# Additional SuperH Device Drivers
383#
384CONFIG_HEARTBEAT=y
385# CONFIG_PUSH_SWITCH is not set
386
387#
388# Kernel features
389#
390# CONFIG_HZ_100 is not set
391CONFIG_HZ_250=y
392# CONFIG_HZ_300 is not set
393# CONFIG_HZ_1000 is not set
394CONFIG_HZ=250
395CONFIG_SCHED_HRTICK=y
396CONFIG_KEXEC=y
397# CONFIG_CRASH_DUMP is not set
398CONFIG_SECCOMP=y
399# CONFIG_SMP is not set
400# CONFIG_PREEMPT_NONE is not set
401# CONFIG_PREEMPT_VOLUNTARY is not set
402CONFIG_PREEMPT=y
403CONFIG_GUSA=y
404
405#
406# Boot options
407#
408CONFIG_ZERO_PAGE_OFFSET=0x00001000
409CONFIG_BOOT_LINK_OFFSET=0x00800000
410CONFIG_ENTRY_OFFSET=0x00001000
411CONFIG_CMDLINE_OVERWRITE=y
412# CONFIG_CMDLINE_EXTEND is not set
413CONFIG_CMDLINE="console=ttySC1,115200 earlyprintk=sh-sci.1,115200 root=/dev/sda1 nmi_debug=state,debounce rootdelay=10"
414
415#
416# Bus options
417#
418CONFIG_PCI=y
419CONFIG_PCI_DOMAINS=y
420CONFIG_PCIEPORTBUS=y
421CONFIG_PCIEAER=y
422# CONFIG_PCIE_ECRC is not set
423CONFIG_PCIEAER_INJECT=y
424CONFIG_PCIEASPM=y
425CONFIG_PCIEASPM_DEBUG=y
426# CONFIG_ARCH_SUPPORTS_MSI is not set
427# CONFIG_PCI_LEGACY is not set
428CONFIG_PCI_DEBUG=y
429# CONFIG_PCI_STUB is not set
430# CONFIG_PCI_IOV is not set
431# CONFIG_PCCARD is not set
432# CONFIG_HOTPLUG_PCI is not set
433
434#
435# Executable file formats
436#
437CONFIG_BINFMT_ELF=y
438# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
439# CONFIG_HAVE_AOUT is not set
440CONFIG_BINFMT_MISC=y
441
442#
443# Power management options (EXPERIMENTAL)
444#
445CONFIG_PM=y
446CONFIG_PM_DEBUG=y
447CONFIG_PM_VERBOSE=y
448# CONFIG_HIBERNATION is not set
449CONFIG_PM_RUNTIME=y
450CONFIG_CPU_IDLE=y
451CONFIG_CPU_IDLE_GOV_LADDER=y
452CONFIG_CPU_IDLE_GOV_MENU=y
453CONFIG_NET=y
454
455#
456# Networking options
457#
458CONFIG_PACKET=y
459CONFIG_PACKET_MMAP=y
460CONFIG_UNIX=y
461CONFIG_XFRM=y
462# CONFIG_XFRM_USER is not set
463# CONFIG_XFRM_SUB_POLICY is not set
464# CONFIG_XFRM_MIGRATE is not set
465# CONFIG_XFRM_STATISTICS is not set
466CONFIG_NET_KEY=y
467# CONFIG_NET_KEY_MIGRATE is not set
468CONFIG_INET=y
469# CONFIG_IP_MULTICAST is not set
470# CONFIG_IP_ADVANCED_ROUTER is not set
471CONFIG_IP_FIB_HASH=y
472CONFIG_IP_PNP=y
473CONFIG_IP_PNP_DHCP=y
474# CONFIG_IP_PNP_BOOTP is not set
475# CONFIG_IP_PNP_RARP is not set
476# CONFIG_NET_IPIP is not set
477# CONFIG_NET_IPGRE is not set
478# CONFIG_ARPD is not set
479# CONFIG_SYN_COOKIES is not set
480# CONFIG_INET_AH is not set
481# CONFIG_INET_ESP is not set
482# CONFIG_INET_IPCOMP is not set
483# CONFIG_INET_XFRM_TUNNEL is not set
484# CONFIG_INET_TUNNEL is not set
485CONFIG_INET_XFRM_MODE_TRANSPORT=y
486CONFIG_INET_XFRM_MODE_TUNNEL=y
487CONFIG_INET_XFRM_MODE_BEET=y
488# CONFIG_INET_LRO is not set
489CONFIG_INET_DIAG=y
490CONFIG_INET_TCP_DIAG=y
491# CONFIG_TCP_CONG_ADVANCED is not set
492CONFIG_TCP_CONG_CUBIC=y
493CONFIG_DEFAULT_TCP_CONG="cubic"
494# CONFIG_TCP_MD5SIG is not set
495# CONFIG_IPV6 is not set
496# CONFIG_NETWORK_SECMARK is not set
497# CONFIG_NETFILTER is not set
498# CONFIG_IP_DCCP is not set
499# CONFIG_IP_SCTP is not set
500# CONFIG_RDS is not set
501# CONFIG_TIPC is not set
502# CONFIG_ATM is not set
503# CONFIG_BRIDGE is not set
504# CONFIG_NET_DSA is not set
505# CONFIG_VLAN_8021Q is not set
506# CONFIG_DECNET is not set
507# CONFIG_LLC2 is not set
508# CONFIG_IPX is not set
509# CONFIG_ATALK is not set
510# CONFIG_X25 is not set
511# CONFIG_LAPB is not set
512# CONFIG_ECONET is not set
513# CONFIG_WAN_ROUTER is not set
514# CONFIG_PHONET is not set
515# CONFIG_IEEE802154 is not set
516# CONFIG_NET_SCHED is not set
517# CONFIG_DCB is not set
518
519#
520# Network testing
521#
522# CONFIG_NET_PKTGEN is not set
523# CONFIG_NET_DROP_MONITOR is not set
524# CONFIG_HAMRADIO is not set
525# CONFIG_CAN is not set
526# CONFIG_IRDA is not set
527# CONFIG_BT is not set
528# CONFIG_AF_RXRPC is not set
529CONFIG_WIRELESS=y
530# CONFIG_CFG80211 is not set
531# CONFIG_LIB80211 is not set
532
533#
534# CFG80211 needs to be enabled for MAC80211
535#
536# CONFIG_WIMAX is not set
537# CONFIG_RFKILL is not set
538# CONFIG_NET_9P is not set
539
540#
541# Device Drivers
542#
543
544#
545# Generic Driver Options
546#
547CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
548# CONFIG_DEVTMPFS is not set
549CONFIG_STANDALONE=y
550CONFIG_PREVENT_FIRMWARE_BUILD=y
551# CONFIG_FW_LOADER is not set
552# CONFIG_DEBUG_DRIVER is not set
553# CONFIG_DEBUG_DEVRES is not set
554# CONFIG_SYS_HYPERVISOR is not set
555# CONFIG_CONNECTOR is not set
556# CONFIG_MTD is not set
557# CONFIG_PARPORT is not set
558CONFIG_BLK_DEV=y
559# CONFIG_BLK_CPQ_CISS_DA is not set
560# CONFIG_BLK_DEV_DAC960 is not set
561# CONFIG_BLK_DEV_UMEM is not set
562# CONFIG_BLK_DEV_COW_COMMON is not set
563# CONFIG_BLK_DEV_LOOP is not set
564
565#
566# DRBD disabled because PROC_FS, INET or CONNECTOR not selected
567#
568# CONFIG_BLK_DEV_NBD is not set
569# CONFIG_BLK_DEV_SX8 is not set
570# CONFIG_BLK_DEV_UB is not set
571CONFIG_BLK_DEV_RAM=y
572CONFIG_BLK_DEV_RAM_COUNT=16
573CONFIG_BLK_DEV_RAM_SIZE=4096
574# CONFIG_BLK_DEV_XIP is not set
575# CONFIG_CDROM_PKTCDVD is not set
576# CONFIG_ATA_OVER_ETH is not set
577# CONFIG_BLK_DEV_HD is not set
578CONFIG_MISC_DEVICES=y
579# CONFIG_AD525X_DPOT is not set
580# CONFIG_PHANTOM is not set
581# CONFIG_SGI_IOC4 is not set
582# CONFIG_TIFM_CORE is not set
583# CONFIG_ICS932S401 is not set
584# CONFIG_ENCLOSURE_SERVICES is not set
585# CONFIG_HP_ILO is not set
586# CONFIG_ISL29003 is not set
587# CONFIG_DS1682 is not set
588# CONFIG_TI_DAC7512 is not set
589# CONFIG_C2PORT is not set
590
591#
592# EEPROM support
593#
594# CONFIG_EEPROM_AT24 is not set
595# CONFIG_EEPROM_AT25 is not set
596# CONFIG_EEPROM_LEGACY is not set
597# CONFIG_EEPROM_MAX6875 is not set
598# CONFIG_EEPROM_93CX6 is not set
599# CONFIG_CB710_CORE is not set
600CONFIG_HAVE_IDE=y
601# CONFIG_IDE is not set
602
603#
604# SCSI device support
605#
606# CONFIG_RAID_ATTRS is not set
607CONFIG_SCSI=y
608CONFIG_SCSI_DMA=y
609# CONFIG_SCSI_TGT is not set
610# CONFIG_SCSI_NETLINK is not set
611CONFIG_SCSI_PROC_FS=y
612
613#
614# SCSI support type (disk, tape, CD-ROM)
615#
616CONFIG_BLK_DEV_SD=y
617# CONFIG_CHR_DEV_ST is not set
618# CONFIG_CHR_DEV_OSST is not set
619# CONFIG_BLK_DEV_SR is not set
620# CONFIG_CHR_DEV_SG is not set
621# CONFIG_CHR_DEV_SCH is not set
622# CONFIG_SCSI_MULTI_LUN is not set
623# CONFIG_SCSI_CONSTANTS is not set
624# CONFIG_SCSI_LOGGING is not set
625# CONFIG_SCSI_SCAN_ASYNC is not set
626CONFIG_SCSI_WAIT_SCAN=m
627
628#
629# SCSI Transports
630#
631# CONFIG_SCSI_SPI_ATTRS is not set
632# CONFIG_SCSI_FC_ATTRS is not set
633# CONFIG_SCSI_ISCSI_ATTRS is not set
634# CONFIG_SCSI_SAS_LIBSAS is not set
635# CONFIG_SCSI_SRP_ATTRS is not set
636CONFIG_SCSI_LOWLEVEL=y
637# CONFIG_ISCSI_TCP is not set
638# CONFIG_SCSI_BNX2_ISCSI is not set
639# CONFIG_BE2ISCSI is not set
640# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
641# CONFIG_SCSI_HPSA is not set
642# CONFIG_SCSI_3W_9XXX is not set
643# CONFIG_SCSI_3W_SAS is not set
644# CONFIG_SCSI_ACARD is not set
645# CONFIG_SCSI_AACRAID is not set
646# CONFIG_SCSI_AIC7XXX is not set
647# CONFIG_SCSI_AIC7XXX_OLD is not set
648# CONFIG_SCSI_AIC79XX is not set
649# CONFIG_SCSI_AIC94XX is not set
650# CONFIG_SCSI_MVSAS is not set
651# CONFIG_SCSI_ARCMSR is not set
652# CONFIG_MEGARAID_NEWGEN is not set
653# CONFIG_MEGARAID_LEGACY is not set
654# CONFIG_MEGARAID_SAS is not set
655# CONFIG_SCSI_MPT2SAS is not set
656# CONFIG_SCSI_HPTIOP is not set
657# CONFIG_LIBFC is not set
658# CONFIG_LIBFCOE is not set
659# CONFIG_FCOE is not set
660# CONFIG_SCSI_DMX3191D is not set
661# CONFIG_SCSI_FUTURE_DOMAIN is not set
662# CONFIG_SCSI_IPS is not set
663# CONFIG_SCSI_INITIO is not set
664# CONFIG_SCSI_INIA100 is not set
665# CONFIG_SCSI_STEX is not set
666# CONFIG_SCSI_SYM53C8XX_2 is not set
667# CONFIG_SCSI_IPR is not set
668# CONFIG_SCSI_QLOGIC_1280 is not set
669# CONFIG_SCSI_QLA_FC is not set
670# CONFIG_SCSI_QLA_ISCSI is not set
671# CONFIG_SCSI_LPFC is not set
672# CONFIG_SCSI_DC395x is not set
673# CONFIG_SCSI_DC390T is not set
674# CONFIG_SCSI_NSP32 is not set
675# CONFIG_SCSI_DEBUG is not set
676# CONFIG_SCSI_PMCRAID is not set
677# CONFIG_SCSI_PM8001 is not set
678# CONFIG_SCSI_SRP is not set
679# CONFIG_SCSI_BFA_FC is not set
680# CONFIG_SCSI_DH is not set
681# CONFIG_SCSI_OSD_INITIATOR is not set
682CONFIG_ATA=y
683# CONFIG_ATA_NONSTANDARD is not set
684CONFIG_ATA_VERBOSE_ERROR=y
685CONFIG_SATA_PMP=y
686# CONFIG_SATA_AHCI is not set
687CONFIG_SATA_SIL24=y
688CONFIG_ATA_SFF=y
689# CONFIG_SATA_SVW is not set
690# CONFIG_ATA_PIIX is not set
691# CONFIG_SATA_MV is not set
692# CONFIG_SATA_NV is not set
693# CONFIG_PDC_ADMA is not set
694# CONFIG_SATA_QSTOR is not set
695# CONFIG_SATA_PROMISE is not set
696# CONFIG_SATA_SX4 is not set
697# CONFIG_SATA_SIL is not set
698# CONFIG_SATA_SIS is not set
699# CONFIG_SATA_ULI is not set
700# CONFIG_SATA_VIA is not set
701# CONFIG_SATA_VITESSE is not set
702# CONFIG_SATA_INIC162X is not set
703# CONFIG_PATA_ALI is not set
704# CONFIG_PATA_AMD is not set
705# CONFIG_PATA_ARTOP is not set
706# CONFIG_PATA_ATP867X is not set
707# CONFIG_PATA_ATIIXP is not set
708# CONFIG_PATA_CMD640_PCI is not set
709# CONFIG_PATA_CMD64X is not set
710# CONFIG_PATA_CS5520 is not set
711# CONFIG_PATA_CS5530 is not set
712# CONFIG_PATA_CYPRESS is not set
713# CONFIG_PATA_EFAR is not set
714# CONFIG_ATA_GENERIC is not set
715# CONFIG_PATA_HPT366 is not set
716# CONFIG_PATA_HPT37X is not set
717# CONFIG_PATA_HPT3X2N is not set
718# CONFIG_PATA_HPT3X3 is not set
719# CONFIG_PATA_IT821X is not set
720# CONFIG_PATA_IT8213 is not set
721# CONFIG_PATA_JMICRON is not set
722# CONFIG_PATA_TRIFLEX is not set
723# CONFIG_PATA_MARVELL is not set
724# CONFIG_PATA_MPIIX is not set
725# CONFIG_PATA_OLDPIIX is not set
726# CONFIG_PATA_NETCELL is not set
727# CONFIG_PATA_NINJA32 is not set
728# CONFIG_PATA_NS87410 is not set
729# CONFIG_PATA_NS87415 is not set
730# CONFIG_PATA_OPTI is not set
731# CONFIG_PATA_OPTIDMA is not set
732# CONFIG_PATA_PDC2027X is not set
733# CONFIG_PATA_PDC_OLD is not set
734# CONFIG_PATA_RADISYS is not set
735# CONFIG_PATA_RDC is not set
736# CONFIG_PATA_RZ1000 is not set
737# CONFIG_PATA_SC1200 is not set
738# CONFIG_PATA_SERVERWORKS is not set
739# CONFIG_PATA_SIL680 is not set
740# CONFIG_PATA_SIS is not set
741# CONFIG_PATA_TOSHIBA is not set
742# CONFIG_PATA_VIA is not set
743# CONFIG_PATA_WINBOND is not set
744CONFIG_PATA_PLATFORM=y
745# CONFIG_PATA_SCH is not set
746# CONFIG_MD is not set
747# CONFIG_FUSION is not set
748
749#
750# IEEE 1394 (FireWire) support
751#
752
753#
754# You can enable one or both FireWire driver stacks.
755#
756
757#
758# The newer stack is recommended.
759#
760# CONFIG_FIREWIRE is not set
761# CONFIG_IEEE1394 is not set
762# CONFIG_I2O is not set
763CONFIG_NETDEVICES=y
764# CONFIG_DUMMY is not set
765# CONFIG_BONDING is not set
766# CONFIG_MACVLAN is not set
767# CONFIG_EQUALIZER is not set
768# CONFIG_TUN is not set
769# CONFIG_VETH is not set
770# CONFIG_ARCNET is not set
771CONFIG_PHYLIB=y
772
773#
774# MII PHY device drivers
775#
776# CONFIG_MARVELL_PHY is not set
777# CONFIG_DAVICOM_PHY is not set
778# CONFIG_QSEMI_PHY is not set
779# CONFIG_LXT_PHY is not set
780# CONFIG_CICADA_PHY is not set
781# CONFIG_VITESSE_PHY is not set
782# CONFIG_SMSC_PHY is not set
783# CONFIG_BROADCOM_PHY is not set
784# CONFIG_ICPLUS_PHY is not set
785# CONFIG_REALTEK_PHY is not set
786# CONFIG_NATIONAL_PHY is not set
787# CONFIG_STE10XP is not set
788# CONFIG_LSI_ET1011C_PHY is not set
789# CONFIG_FIXED_PHY is not set
790CONFIG_MDIO_BITBANG=y
791CONFIG_NET_ETHERNET=y
792CONFIG_MII=y
793# CONFIG_AX88796 is not set
794# CONFIG_STNIC is not set
795# CONFIG_HAPPYMEAL is not set
796# CONFIG_SUNGEM is not set
797# CONFIG_CASSINI is not set
798# CONFIG_NET_VENDOR_3COM is not set
799CONFIG_SMC91X=y
800# CONFIG_ENC28J60 is not set
801# CONFIG_ETHOC is not set
802# CONFIG_SMC911X is not set
803CONFIG_SMSC911X=y
804# CONFIG_DNET is not set
805# CONFIG_NET_TULIP is not set
806# CONFIG_HP100 is not set
807# CONFIG_IBM_NEW_EMAC_ZMII is not set
808# CONFIG_IBM_NEW_EMAC_RGMII is not set
809# CONFIG_IBM_NEW_EMAC_TAH is not set
810# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
811# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
812# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
813# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
814# CONFIG_NET_PCI is not set
815# CONFIG_B44 is not set
816# CONFIG_KS8842 is not set
817# CONFIG_KS8851 is not set
818# CONFIG_KS8851_MLL is not set
819# CONFIG_ATL2 is not set
820# CONFIG_NETDEV_1000 is not set
821# CONFIG_NETDEV_10000 is not set
822# CONFIG_TR is not set
823CONFIG_WLAN=y
824# CONFIG_ATMEL is not set
825# CONFIG_PRISM54 is not set
826# CONFIG_USB_ZD1201 is not set
827# CONFIG_HOSTAP is not set
828
829#
830# Enable WiMAX (Networking options) to see the WiMAX drivers
831#
832
833#
834# USB Network Adapters
835#
836# CONFIG_USB_CATC is not set
837# CONFIG_USB_KAWETH is not set
838# CONFIG_USB_PEGASUS is not set
839# CONFIG_USB_RTL8150 is not set
840# CONFIG_USB_USBNET is not set
841# CONFIG_WAN is not set
842# CONFIG_FDDI is not set
843# CONFIG_HIPPI is not set
844# CONFIG_PPP is not set
845# CONFIG_SLIP is not set
846# CONFIG_NET_FC is not set
847# CONFIG_NETCONSOLE is not set
848# CONFIG_NETPOLL is not set
849# CONFIG_NET_POLL_CONTROLLER is not set
850# CONFIG_VMXNET3 is not set
851# CONFIG_ISDN is not set
852# CONFIG_PHONE is not set
853
854#
855# Input device support
856#
857CONFIG_INPUT=y
858# CONFIG_INPUT_FF_MEMLESS is not set
859# CONFIG_INPUT_POLLDEV is not set
860# CONFIG_INPUT_SPARSEKMAP is not set
861
862#
863# Userland interfaces
864#
865CONFIG_INPUT_MOUSEDEV=y
866CONFIG_INPUT_MOUSEDEV_PSAUX=y
867CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
868CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
869# CONFIG_INPUT_JOYDEV is not set
870# CONFIG_INPUT_EVDEV is not set
871# CONFIG_INPUT_EVBUG is not set
872
873#
874# Input Device Drivers
875#
876CONFIG_INPUT_KEYBOARD=y
877# CONFIG_KEYBOARD_ADP5588 is not set
878CONFIG_KEYBOARD_ATKBD=y
879# CONFIG_QT2160 is not set
880# CONFIG_KEYBOARD_LKKBD is not set
881# CONFIG_KEYBOARD_MAX7359 is not set
882# CONFIG_KEYBOARD_NEWTON is not set
883# CONFIG_KEYBOARD_OPENCORES is not set
884# CONFIG_KEYBOARD_STOWAWAY is not set
885# CONFIG_KEYBOARD_SUNKBD is not set
886# CONFIG_KEYBOARD_SH_KEYSC is not set
887# CONFIG_KEYBOARD_XTKBD is not set
888CONFIG_INPUT_MOUSE=y
889CONFIG_MOUSE_PS2=y
890CONFIG_MOUSE_PS2_ALPS=y
891CONFIG_MOUSE_PS2_LOGIPS2PP=y
892CONFIG_MOUSE_PS2_SYNAPTICS=y
893CONFIG_MOUSE_PS2_TRACKPOINT=y
894# CONFIG_MOUSE_PS2_ELANTECH is not set
895# CONFIG_MOUSE_PS2_SENTELIC is not set
896# CONFIG_MOUSE_PS2_TOUCHKIT is not set
897# CONFIG_MOUSE_SERIAL is not set
898# CONFIG_MOUSE_APPLETOUCH is not set
899# CONFIG_MOUSE_BCM5974 is not set
900# CONFIG_MOUSE_VSXXXAA is not set
901# CONFIG_MOUSE_SYNAPTICS_I2C is not set
902# CONFIG_INPUT_JOYSTICK is not set
903# CONFIG_INPUT_TABLET is not set
904# CONFIG_INPUT_TOUCHSCREEN is not set
905# CONFIG_INPUT_MISC is not set
906
907#
908# Hardware I/O ports
909#
910CONFIG_SERIO=y
911CONFIG_SERIO_I8042=y
912CONFIG_SERIO_SERPORT=y
913# CONFIG_SERIO_PCIPS2 is not set
914CONFIG_SERIO_LIBPS2=y
915# CONFIG_SERIO_RAW is not set
916# CONFIG_SERIO_ALTERA_PS2 is not set
917# CONFIG_GAMEPORT is not set
918
919#
920# Character devices
921#
922CONFIG_VT=y
923CONFIG_CONSOLE_TRANSLATIONS=y
924CONFIG_VT_CONSOLE=y
925CONFIG_HW_CONSOLE=y
926# CONFIG_VT_HW_CONSOLE_BINDING is not set
927CONFIG_DEVKMEM=y
928# CONFIG_SERIAL_NONSTANDARD is not set
929# CONFIG_NOZOMI is not set
930
931#
932# Serial drivers
933#
934# CONFIG_SERIAL_8250 is not set
935
936#
937# Non-8250 serial port support
938#
939# CONFIG_SERIAL_MAX3100 is not set
940CONFIG_SERIAL_SH_SCI=y
941CONFIG_SERIAL_SH_SCI_NR_UARTS=6
942CONFIG_SERIAL_SH_SCI_CONSOLE=y
943CONFIG_SERIAL_CORE=y
944CONFIG_SERIAL_CORE_CONSOLE=y
945# CONFIG_SERIAL_JSM is not set
946CONFIG_UNIX98_PTYS=y
947# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
948# CONFIG_LEGACY_PTYS is not set
949# CONFIG_IPMI_HANDLER is not set
950# CONFIG_HW_RANDOM is not set
951# CONFIG_R3964 is not set
952# CONFIG_APPLICOM is not set
953# CONFIG_RAW_DRIVER is not set
954# CONFIG_TCG_TPM is not set
955CONFIG_DEVPORT=y
956CONFIG_I2C=y
957CONFIG_I2C_BOARDINFO=y
958# CONFIG_I2C_COMPAT is not set
959CONFIG_I2C_CHARDEV=y
960CONFIG_I2C_HELPER_AUTO=y
961
962#
963# I2C Hardware Bus support
964#
965
966#
967# PC SMBus host controller drivers
968#
969# CONFIG_I2C_ALI1535 is not set
970# CONFIG_I2C_ALI1563 is not set
971# CONFIG_I2C_ALI15X3 is not set
972# CONFIG_I2C_AMD756 is not set
973# CONFIG_I2C_AMD8111 is not set
974# CONFIG_I2C_I801 is not set
975# CONFIG_I2C_ISCH is not set
976# CONFIG_I2C_PIIX4 is not set
977# CONFIG_I2C_NFORCE2 is not set
978# CONFIG_I2C_SIS5595 is not set
979# CONFIG_I2C_SIS630 is not set
980# CONFIG_I2C_SIS96X is not set
981# CONFIG_I2C_VIA is not set
982# CONFIG_I2C_VIAPRO is not set
983
984#
985# I2C system bus drivers (mostly embedded / system-on-chip)
986#
987# CONFIG_I2C_DESIGNWARE is not set
988# CONFIG_I2C_OCORES is not set
989# CONFIG_I2C_SH_MOBILE is not set
990# CONFIG_I2C_SIMTEC is not set
991
992#
993# External I2C/SMBus adapter drivers
994#
995# CONFIG_I2C_PARPORT_LIGHT is not set
996# CONFIG_I2C_TAOS_EVM is not set
997# CONFIG_I2C_TINY_USB is not set
998
999#
1000# Other I2C/SMBus bus drivers
1001#
1002# CONFIG_I2C_PCA_PLATFORM is not set
1003# CONFIG_I2C_STUB is not set
1004
1005#
1006# Miscellaneous I2C Chip support
1007#
1008# CONFIG_SENSORS_TSL2550 is not set
1009# CONFIG_I2C_DEBUG_CORE is not set
1010# CONFIG_I2C_DEBUG_ALGO is not set
1011# CONFIG_I2C_DEBUG_BUS is not set
1012# CONFIG_I2C_DEBUG_CHIP is not set
1013CONFIG_SPI=y
1014# CONFIG_SPI_DEBUG is not set
1015CONFIG_SPI_MASTER=y
1016
1017#
1018# SPI Master Controller Drivers
1019#
1020# CONFIG_SPI_BITBANG is not set
1021# CONFIG_SPI_SH_MSIOF is not set
1022# CONFIG_SPI_SH_SCI is not set
1023# CONFIG_SPI_XILINX is not set
1024# CONFIG_SPI_DESIGNWARE is not set
1025
1026#
1027# SPI Protocol Masters
1028#
1029# CONFIG_SPI_SPIDEV is not set
1030# CONFIG_SPI_TLE62X0 is not set
1031
1032#
1033# PPS support
1034#
1035# CONFIG_PPS is not set
1036# CONFIG_W1 is not set
1037# CONFIG_POWER_SUPPLY is not set
1038# CONFIG_HWMON is not set
1039# CONFIG_THERMAL is not set
1040CONFIG_WATCHDOG=y
1041# CONFIG_WATCHDOG_NOWAYOUT is not set
1042
1043#
1044# Watchdog Device Drivers
1045#
1046# CONFIG_SOFT_WATCHDOG is not set
1047# CONFIG_ALIM7101_WDT is not set
1048# CONFIG_SH_WDT is not set
1049
1050#
1051# PCI-based Watchdog Cards
1052#
1053# CONFIG_PCIPCWATCHDOG is not set
1054# CONFIG_WDTPCI is not set
1055
1056#
1057# USB-based Watchdog Cards
1058#
1059# CONFIG_USBPCWATCHDOG is not set
1060CONFIG_SSB_POSSIBLE=y
1061
1062#
1063# Sonics Silicon Backplane
1064#
1065# CONFIG_SSB is not set
1066
1067#
1068# Multifunction device drivers
1069#
1070# CONFIG_MFD_CORE is not set
1071# CONFIG_MFD_SM501 is not set
1072# CONFIG_MFD_SH_MOBILE_SDHI is not set
1073# CONFIG_HTC_PASIC3 is not set
1074# CONFIG_TWL4030_CORE is not set
1075# CONFIG_MFD_TMIO is not set
1076# CONFIG_PMIC_DA903X is not set
1077# CONFIG_PMIC_ADP5520 is not set
1078# CONFIG_MFD_WM8400 is not set
1079# CONFIG_MFD_WM831X is not set
1080# CONFIG_MFD_WM8350_I2C is not set
1081# CONFIG_MFD_PCF50633 is not set
1082# CONFIG_MFD_MC13783 is not set
1083# CONFIG_AB3100_CORE is not set
1084# CONFIG_EZX_PCAP is not set
1085# CONFIG_MFD_88PM8607 is not set
1086# CONFIG_AB4500_CORE is not set
1087# CONFIG_REGULATOR is not set
1088# CONFIG_MEDIA_SUPPORT is not set
1089
1090#
1091# Graphics support
1092#
1093CONFIG_VGA_ARB=y
1094# CONFIG_DRM is not set
1095# CONFIG_VGASTATE is not set
1096CONFIG_VIDEO_OUTPUT_CONTROL=m
1097# CONFIG_FB is not set
1098# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
1099
1100#
1101# Display device support
1102#
1103# CONFIG_DISPLAY_SUPPORT is not set
1104
1105#
1106# Console display driver support
1107#
1108CONFIG_DUMMY_CONSOLE=y
1109# CONFIG_SOUND is not set
1110CONFIG_HID_SUPPORT=y
1111CONFIG_HID=y
1112# CONFIG_HIDRAW is not set
1113
1114#
1115# USB Input Devices
1116#
1117CONFIG_USB_HID=y
1118# CONFIG_HID_PID is not set
1119# CONFIG_USB_HIDDEV is not set
1120
1121#
1122# Special HID drivers
1123#
1124# CONFIG_HID_A4TECH is not set
1125# CONFIG_HID_APPLE is not set
1126# CONFIG_HID_BELKIN is not set
1127# CONFIG_HID_CHERRY is not set
1128# CONFIG_HID_CHICONY is not set
1129# CONFIG_HID_CYPRESS is not set
1130# CONFIG_HID_DRAGONRISE is not set
1131# CONFIG_HID_EZKEY is not set
1132# CONFIG_HID_KYE is not set
1133# CONFIG_HID_GYRATION is not set
1134# CONFIG_HID_TWINHAN is not set
1135# CONFIG_HID_KENSINGTON is not set
1136# CONFIG_HID_LOGITECH is not set
1137# CONFIG_HID_MICROSOFT is not set
1138# CONFIG_HID_MONTEREY is not set
1139# CONFIG_HID_NTRIG is not set
1140# CONFIG_HID_PANTHERLORD is not set
1141# CONFIG_HID_PETALYNX is not set
1142# CONFIG_HID_SAMSUNG is not set
1143# CONFIG_HID_SONY is not set
1144# CONFIG_HID_SUNPLUS is not set
1145# CONFIG_HID_GREENASIA is not set
1146# CONFIG_HID_SMARTJOYPLUS is not set
1147# CONFIG_HID_TOPSEED is not set
1148# CONFIG_HID_THRUSTMASTER is not set
1149# CONFIG_HID_ZEROPLUS is not set
1150CONFIG_USB_SUPPORT=y
1151CONFIG_USB_ARCH_HAS_HCD=y
1152CONFIG_USB_ARCH_HAS_OHCI=y
1153CONFIG_USB_ARCH_HAS_EHCI=y
1154CONFIG_USB=y
1155# CONFIG_USB_DEBUG is not set
1156# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
1157
1158#
1159# Miscellaneous USB options
1160#
1161# CONFIG_USB_DEVICEFS is not set
1162CONFIG_USB_DEVICE_CLASS=y
1163# CONFIG_USB_DYNAMIC_MINORS is not set
1164# CONFIG_USB_SUSPEND is not set
1165# CONFIG_USB_OTG is not set
1166# CONFIG_USB_OTG_WHITELIST is not set
1167# CONFIG_USB_OTG_BLACKLIST_HUB is not set
1168CONFIG_USB_MON=y
1169# CONFIG_USB_WUSB is not set
1170# CONFIG_USB_WUSB_CBAF is not set
1171
1172#
1173# USB Host Controller Drivers
1174#
1175# CONFIG_USB_C67X00_HCD is not set
1176# CONFIG_USB_XHCI_HCD is not set
1177# CONFIG_USB_EHCI_HCD is not set
1178# CONFIG_USB_OXU210HP_HCD is not set
1179# CONFIG_USB_ISP116X_HCD is not set
1180# CONFIG_USB_ISP1760_HCD is not set
1181# CONFIG_USB_ISP1362_HCD is not set
1182CONFIG_USB_OHCI_HCD=y
1183# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
1184# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
1185CONFIG_USB_OHCI_LITTLE_ENDIAN=y
1186# CONFIG_USB_UHCI_HCD is not set
1187# CONFIG_USB_SL811_HCD is not set
1188# CONFIG_USB_R8A66597_HCD is not set
1189# CONFIG_USB_WHCI_HCD is not set
1190# CONFIG_USB_HWA_HCD is not set
1191# CONFIG_USB_GADGET_MUSB_HDRC is not set
1192
1193#
1194# USB Device Class drivers
1195#
1196# CONFIG_USB_ACM is not set
1197# CONFIG_USB_PRINTER is not set
1198# CONFIG_USB_WDM is not set
1199# CONFIG_USB_TMC is not set
1200
1201#
1202# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
1203#
1204
1205#
1206# also be needed; see USB_STORAGE Help for more info
1207#
1208CONFIG_USB_STORAGE=y
1209# CONFIG_USB_STORAGE_DEBUG is not set
1210# CONFIG_USB_STORAGE_DATAFAB is not set
1211# CONFIG_USB_STORAGE_FREECOM is not set
1212# CONFIG_USB_STORAGE_ISD200 is not set
1213# CONFIG_USB_STORAGE_USBAT is not set
1214# CONFIG_USB_STORAGE_SDDR09 is not set
1215# CONFIG_USB_STORAGE_SDDR55 is not set
1216# CONFIG_USB_STORAGE_JUMPSHOT is not set
1217# CONFIG_USB_STORAGE_ALAUDA is not set
1218# CONFIG_USB_STORAGE_ONETOUCH is not set
1219# CONFIG_USB_STORAGE_KARMA is not set
1220# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
1221# CONFIG_USB_LIBUSUAL is not set
1222
1223#
1224# USB Imaging devices
1225#
1226# CONFIG_USB_MDC800 is not set
1227# CONFIG_USB_MICROTEK is not set
1228
1229#
1230# USB port drivers
1231#
1232# CONFIG_USB_SERIAL is not set
1233
1234#
1235# USB Miscellaneous drivers
1236#
1237# CONFIG_USB_EMI62 is not set
1238# CONFIG_USB_EMI26 is not set
1239# CONFIG_USB_ADUTUX is not set
1240# CONFIG_USB_SEVSEG is not set
1241# CONFIG_USB_RIO500 is not set
1242# CONFIG_USB_LEGOTOWER is not set
1243# CONFIG_USB_LCD is not set
1244# CONFIG_USB_BERRY_CHARGE is not set
1245# CONFIG_USB_LED is not set
1246# CONFIG_USB_CYPRESS_CY7C63 is not set
1247# CONFIG_USB_CYTHERM is not set
1248# CONFIG_USB_IDMOUSE is not set
1249# CONFIG_USB_FTDI_ELAN is not set
1250# CONFIG_USB_APPLEDISPLAY is not set
1251# CONFIG_USB_LD is not set
1252# CONFIG_USB_TRANCEVIBRATOR is not set
1253# CONFIG_USB_IOWARRIOR is not set
1254# CONFIG_USB_TEST is not set
1255# CONFIG_USB_ISIGHTFW is not set
1256# CONFIG_USB_VST is not set
1257CONFIG_USB_GADGET=y
1258# CONFIG_USB_GADGET_DEBUG is not set
1259# CONFIG_USB_GADGET_DEBUG_FILES is not set
1260# CONFIG_USB_GADGET_DEBUG_FS is not set
1261CONFIG_USB_GADGET_VBUS_DRAW=2
1262CONFIG_USB_GADGET_SELECTED=y
1263# CONFIG_USB_GADGET_AT91 is not set
1264# CONFIG_USB_GADGET_ATMEL_USBA is not set
1265# CONFIG_USB_GADGET_FSL_USB2 is not set
1266# CONFIG_USB_GADGET_LH7A40X is not set
1267# CONFIG_USB_GADGET_OMAP is not set
1268# CONFIG_USB_GADGET_PXA25X is not set
1269# CONFIG_USB_GADGET_R8A66597 is not set
1270# CONFIG_USB_GADGET_PXA27X is not set
1271# CONFIG_USB_GADGET_S3C_HSOTG is not set
1272# CONFIG_USB_GADGET_IMX is not set
1273# CONFIG_USB_GADGET_S3C2410 is not set
1274CONFIG_USB_GADGET_M66592=y
1275CONFIG_USB_M66592=y
1276# CONFIG_USB_GADGET_AMD5536UDC is not set
1277# CONFIG_USB_GADGET_FSL_QE is not set
1278# CONFIG_USB_GADGET_CI13XXX is not set
1279# CONFIG_USB_GADGET_NET2280 is not set
1280# CONFIG_USB_GADGET_GOKU is not set
1281# CONFIG_USB_GADGET_LANGWELL is not set
1282# CONFIG_USB_GADGET_DUMMY_HCD is not set
1283CONFIG_USB_GADGET_DUALSPEED=y
1284# CONFIG_USB_ZERO is not set
1285# CONFIG_USB_AUDIO is not set
1286# CONFIG_USB_ETH is not set
1287# CONFIG_USB_GADGETFS is not set
1288# CONFIG_USB_FILE_STORAGE is not set
1289# CONFIG_USB_MASS_STORAGE is not set
1290# CONFIG_USB_G_SERIAL is not set
1291# CONFIG_USB_MIDI_GADGET is not set
1292# CONFIG_USB_G_PRINTER is not set
1293# CONFIG_USB_CDC_COMPOSITE is not set
1294# CONFIG_USB_G_MULTI is not set
1295
1296#
1297# OTG and related infrastructure
1298#
1299# CONFIG_NOP_USB_XCEIV is not set
1300# CONFIG_UWB is not set
1301# CONFIG_MMC is not set
1302# CONFIG_MEMSTICK is not set
1303# CONFIG_NEW_LEDS is not set
1304# CONFIG_ACCESSIBILITY is not set
1305# CONFIG_INFINIBAND is not set
1306CONFIG_RTC_LIB=y
1307CONFIG_RTC_CLASS=y
1308CONFIG_RTC_HCTOSYS=y
1309CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
1310# CONFIG_RTC_DEBUG is not set
1311
1312#
1313# RTC interfaces
1314#
1315CONFIG_RTC_INTF_SYSFS=y
1316CONFIG_RTC_INTF_PROC=y
1317CONFIG_RTC_INTF_DEV=y
1318# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
1319# CONFIG_RTC_DRV_TEST is not set
1320
1321#
1322# I2C RTC drivers
1323#
1324# CONFIG_RTC_DRV_DS1307 is not set
1325# CONFIG_RTC_DRV_DS1374 is not set
1326# CONFIG_RTC_DRV_DS1672 is not set
1327CONFIG_RTC_DRV_MAX6900=y
1328# CONFIG_RTC_DRV_RS5C372 is not set
1329# CONFIG_RTC_DRV_ISL1208 is not set
1330# CONFIG_RTC_DRV_X1205 is not set
1331# CONFIG_RTC_DRV_PCF8563 is not set
1332# CONFIG_RTC_DRV_PCF8583 is not set
1333# CONFIG_RTC_DRV_M41T80 is not set
1334# CONFIG_RTC_DRV_BQ32K is not set
1335# CONFIG_RTC_DRV_S35390A is not set
1336# CONFIG_RTC_DRV_FM3130 is not set
1337# CONFIG_RTC_DRV_RX8581 is not set
1338# CONFIG_RTC_DRV_RX8025 is not set
1339
1340#
1341# SPI RTC drivers
1342#
1343# CONFIG_RTC_DRV_M41T94 is not set
1344# CONFIG_RTC_DRV_DS1305 is not set
1345# CONFIG_RTC_DRV_DS1390 is not set
1346# CONFIG_RTC_DRV_MAX6902 is not set
1347# CONFIG_RTC_DRV_R9701 is not set
1348# CONFIG_RTC_DRV_RS5C348 is not set
1349# CONFIG_RTC_DRV_DS3234 is not set
1350# CONFIG_RTC_DRV_PCF2123 is not set
1351
1352#
1353# Platform RTC drivers
1354#
1355# CONFIG_RTC_DRV_DS1286 is not set
1356# CONFIG_RTC_DRV_DS1511 is not set
1357# CONFIG_RTC_DRV_DS1553 is not set
1358# CONFIG_RTC_DRV_DS1742 is not set
1359# CONFIG_RTC_DRV_STK17TA8 is not set
1360# CONFIG_RTC_DRV_M48T86 is not set
1361# CONFIG_RTC_DRV_M48T35 is not set
1362# CONFIG_RTC_DRV_M48T59 is not set
1363# CONFIG_RTC_DRV_MSM6242 is not set
1364# CONFIG_RTC_DRV_BQ4802 is not set
1365# CONFIG_RTC_DRV_RP5C01 is not set
1366# CONFIG_RTC_DRV_V3020 is not set
1367
1368#
1369# on-CPU RTC drivers
1370#
1371CONFIG_RTC_DRV_SH=y
1372# CONFIG_RTC_DRV_GENERIC is not set
1373# CONFIG_DMADEVICES is not set
1374# CONFIG_AUXDISPLAY is not set
1375CONFIG_UIO=m
1376# CONFIG_UIO_CIF is not set
1377# CONFIG_UIO_PDRV is not set
1378# CONFIG_UIO_PDRV_GENIRQ is not set
1379# CONFIG_UIO_SMX is not set
1380# CONFIG_UIO_AEC is not set
1381# CONFIG_UIO_SERCOS3 is not set
1382# CONFIG_UIO_PCI_GENERIC is not set
1383
1384#
1385# TI VLYNQ
1386#
1387# CONFIG_STAGING is not set
1388
1389#
1390# File systems
1391#
1392CONFIG_EXT2_FS=y
1393# CONFIG_EXT2_FS_XATTR is not set
1394# CONFIG_EXT2_FS_XIP is not set
1395CONFIG_EXT3_FS=y
1396# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
1397CONFIG_EXT3_FS_XATTR=y
1398# CONFIG_EXT3_FS_POSIX_ACL is not set
1399# CONFIG_EXT3_FS_SECURITY is not set
1400# CONFIG_EXT4_FS is not set
1401CONFIG_JBD=y
1402# CONFIG_JBD_DEBUG is not set
1403CONFIG_FS_MBCACHE=y
1404# CONFIG_REISERFS_FS is not set
1405# CONFIG_JFS_FS is not set
1406# CONFIG_FS_POSIX_ACL is not set
1407# CONFIG_XFS_FS is not set
1408# CONFIG_OCFS2_FS is not set
1409# CONFIG_BTRFS_FS is not set
1410# CONFIG_NILFS2_FS is not set
1411CONFIG_FILE_LOCKING=y
1412CONFIG_FSNOTIFY=y
1413CONFIG_DNOTIFY=y
1414CONFIG_INOTIFY=y
1415CONFIG_INOTIFY_USER=y
1416# CONFIG_QUOTA is not set
1417# CONFIG_AUTOFS_FS is not set
1418# CONFIG_AUTOFS4_FS is not set
1419# CONFIG_FUSE_FS is not set
1420
1421#
1422# Caches
1423#
1424# CONFIG_FSCACHE is not set
1425
1426#
1427# CD-ROM/DVD Filesystems
1428#
1429# CONFIG_ISO9660_FS is not set
1430# CONFIG_UDF_FS is not set
1431
1432#
1433# DOS/FAT/NT Filesystems
1434#
1435# CONFIG_MSDOS_FS is not set
1436# CONFIG_VFAT_FS is not set
1437# CONFIG_NTFS_FS is not set
1438
1439#
1440# Pseudo filesystems
1441#
1442CONFIG_PROC_FS=y
1443CONFIG_PROC_KCORE=y
1444CONFIG_PROC_SYSCTL=y
1445CONFIG_PROC_PAGE_MONITOR=y
1446CONFIG_SYSFS=y
1447CONFIG_TMPFS=y
1448# CONFIG_TMPFS_POSIX_ACL is not set
1449CONFIG_HUGETLBFS=y
1450CONFIG_HUGETLB_PAGE=y
1451# CONFIG_CONFIGFS_FS is not set
1452CONFIG_MISC_FILESYSTEMS=y
1453# CONFIG_ADFS_FS is not set
1454# CONFIG_AFFS_FS is not set
1455# CONFIG_HFS_FS is not set
1456# CONFIG_HFSPLUS_FS is not set
1457# CONFIG_BEFS_FS is not set
1458# CONFIG_BFS_FS is not set
1459# CONFIG_EFS_FS is not set
1460# CONFIG_CRAMFS is not set
1461# CONFIG_SQUASHFS is not set
1462# CONFIG_VXFS_FS is not set
1463# CONFIG_MINIX_FS is not set
1464# CONFIG_OMFS_FS is not set
1465# CONFIG_HPFS_FS is not set
1466# CONFIG_QNX4FS_FS is not set
1467# CONFIG_ROMFS_FS is not set
1468# CONFIG_SYSV_FS is not set
1469# CONFIG_UFS_FS is not set
1470CONFIG_NETWORK_FILESYSTEMS=y
1471CONFIG_NFS_FS=y
1472CONFIG_NFS_V3=y
1473# CONFIG_NFS_V3_ACL is not set
1474# CONFIG_NFS_V4 is not set
1475CONFIG_ROOT_NFS=y
1476# CONFIG_NFSD is not set
1477CONFIG_LOCKD=y
1478CONFIG_LOCKD_V4=y
1479CONFIG_NFS_COMMON=y
1480CONFIG_SUNRPC=y
1481# CONFIG_RPCSEC_GSS_KRB5 is not set
1482# CONFIG_RPCSEC_GSS_SPKM3 is not set
1483# CONFIG_SMB_FS is not set
1484# CONFIG_CIFS is not set
1485# CONFIG_NCP_FS is not set
1486# CONFIG_CODA_FS is not set
1487# CONFIG_AFS_FS is not set
1488
1489#
1490# Partition Types
1491#
1492# CONFIG_PARTITION_ADVANCED is not set
1493CONFIG_MSDOS_PARTITION=y
1494CONFIG_NLS=y
1495CONFIG_NLS_DEFAULT="iso8859-1"
1496# CONFIG_NLS_CODEPAGE_437 is not set
1497# CONFIG_NLS_CODEPAGE_737 is not set
1498# CONFIG_NLS_CODEPAGE_775 is not set
1499# CONFIG_NLS_CODEPAGE_850 is not set
1500# CONFIG_NLS_CODEPAGE_852 is not set
1501# CONFIG_NLS_CODEPAGE_855 is not set
1502# CONFIG_NLS_CODEPAGE_857 is not set
1503# CONFIG_NLS_CODEPAGE_860 is not set
1504# CONFIG_NLS_CODEPAGE_861 is not set
1505# CONFIG_NLS_CODEPAGE_862 is not set
1506# CONFIG_NLS_CODEPAGE_863 is not set
1507# CONFIG_NLS_CODEPAGE_864 is not set
1508# CONFIG_NLS_CODEPAGE_865 is not set
1509# CONFIG_NLS_CODEPAGE_866 is not set
1510# CONFIG_NLS_CODEPAGE_869 is not set
1511# CONFIG_NLS_CODEPAGE_936 is not set
1512# CONFIG_NLS_CODEPAGE_950 is not set
1513# CONFIG_NLS_CODEPAGE_932 is not set
1514# CONFIG_NLS_CODEPAGE_949 is not set
1515# CONFIG_NLS_CODEPAGE_874 is not set
1516# CONFIG_NLS_ISO8859_8 is not set
1517# CONFIG_NLS_CODEPAGE_1250 is not set
1518# CONFIG_NLS_CODEPAGE_1251 is not set
1519# CONFIG_NLS_ASCII is not set
1520# CONFIG_NLS_ISO8859_1 is not set
1521# CONFIG_NLS_ISO8859_2 is not set
1522# CONFIG_NLS_ISO8859_3 is not set
1523# CONFIG_NLS_ISO8859_4 is not set
1524# CONFIG_NLS_ISO8859_5 is not set
1525# CONFIG_NLS_ISO8859_6 is not set
1526# CONFIG_NLS_ISO8859_7 is not set
1527# CONFIG_NLS_ISO8859_9 is not set
1528# CONFIG_NLS_ISO8859_13 is not set
1529# CONFIG_NLS_ISO8859_14 is not set
1530# CONFIG_NLS_ISO8859_15 is not set
1531# CONFIG_NLS_KOI8_R is not set
1532# CONFIG_NLS_KOI8_U is not set
1533# CONFIG_NLS_UTF8 is not set
1534# CONFIG_DLM is not set
1535
1536#
1537# Kernel hacking
1538#
1539CONFIG_TRACE_IRQFLAGS_SUPPORT=y
1540CONFIG_PRINTK_TIME=y
1541CONFIG_ENABLE_WARN_DEPRECATED=y
1542# CONFIG_ENABLE_MUST_CHECK is not set
1543CONFIG_FRAME_WARN=1024
1544CONFIG_MAGIC_SYSRQ=y
1545# CONFIG_STRIP_ASM_SYMS is not set
1546# CONFIG_UNUSED_SYMBOLS is not set
1547CONFIG_DEBUG_FS=y
1548# CONFIG_HEADERS_CHECK is not set
1549CONFIG_DEBUG_KERNEL=y
1550CONFIG_DEBUG_SHIRQ=y
1551CONFIG_DETECT_SOFTLOCKUP=y
1552# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
1553CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
1554CONFIG_DETECT_HUNG_TASK=y
1555# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
1556CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
1557CONFIG_SCHED_DEBUG=y
1558# CONFIG_SCHEDSTATS is not set
1559# CONFIG_TIMER_STATS is not set
1560# CONFIG_DEBUG_OBJECTS is not set
1561# CONFIG_DEBUG_SLAB is not set
1562CONFIG_DEBUG_PREEMPT=y
1563# CONFIG_DEBUG_RT_MUTEXES is not set
1564# CONFIG_RT_MUTEX_TESTER is not set
1565# CONFIG_DEBUG_SPINLOCK is not set
1566# CONFIG_DEBUG_MUTEXES is not set
1567# CONFIG_DEBUG_LOCK_ALLOC is not set
1568# CONFIG_PROVE_LOCKING is not set
1569# CONFIG_LOCK_STAT is not set
1570# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1571# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1572CONFIG_STACKTRACE=y
1573# CONFIG_DEBUG_KOBJECT is not set
1574CONFIG_DEBUG_BUGVERBOSE=y
1575# CONFIG_DEBUG_INFO is not set
1576CONFIG_DEBUG_VM=y
1577# CONFIG_DEBUG_WRITECOUNT is not set
1578# CONFIG_DEBUG_MEMORY_INIT is not set
1579# CONFIG_DEBUG_LIST is not set
1580# CONFIG_DEBUG_SG is not set
1581# CONFIG_DEBUG_NOTIFIERS is not set
1582# CONFIG_DEBUG_CREDENTIALS is not set
1583CONFIG_FRAME_POINTER=y
1584# CONFIG_RCU_TORTURE_TEST is not set
1585# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1586# CONFIG_BACKTRACE_SELF_TEST is not set
1587# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1588# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
1589# CONFIG_FAULT_INJECTION is not set
1590# CONFIG_LATENCYTOP is not set
1591# CONFIG_SYSCTL_SYSCALL_CHECK is not set
1592# CONFIG_PAGE_POISONING is not set
1593CONFIG_NOP_TRACER=y
1594CONFIG_HAVE_FUNCTION_TRACER=y
1595CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1596CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y
1597CONFIG_HAVE_DYNAMIC_FTRACE=y
1598CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1599CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
1600CONFIG_RING_BUFFER=y
1601CONFIG_EVENT_TRACING=y
1602CONFIG_CONTEXT_SWITCH_TRACER=y
1603CONFIG_TRACING=y
1604CONFIG_TRACING_SUPPORT=y
1605CONFIG_FTRACE=y
1606# CONFIG_FUNCTION_TRACER is not set
1607# CONFIG_IRQSOFF_TRACER is not set
1608# CONFIG_PREEMPT_TRACER is not set
1609# CONFIG_SCHED_TRACER is not set
1610# CONFIG_ENABLE_DEFAULT_TRACERS is not set
1611# CONFIG_FTRACE_SYSCALLS is not set
1612# CONFIG_BOOT_TRACER is not set
1613CONFIG_BRANCH_PROFILE_NONE=y
1614# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1615# CONFIG_PROFILE_ALL_BRANCHES is not set
1616CONFIG_KSYM_TRACER=y
1617# CONFIG_PROFILE_KSYM_TRACER is not set
1618# CONFIG_STACK_TRACER is not set
1619# CONFIG_KMEMTRACE is not set
1620# CONFIG_WORKQUEUE_TRACER is not set
1621# CONFIG_BLK_DEV_IO_TRACE is not set
1622# CONFIG_RING_BUFFER_BENCHMARK is not set
1623# CONFIG_DYNAMIC_DEBUG is not set
1624# CONFIG_DMA_API_DEBUG is not set
1625# CONFIG_SAMPLES is not set
1626CONFIG_HAVE_ARCH_KGDB=y
1627# CONFIG_KGDB is not set
1628# CONFIG_SH_STANDARD_BIOS is not set
1629# CONFIG_STACK_DEBUG is not set
1630CONFIG_DEBUG_STACK_USAGE=y
1631# CONFIG_4KSTACKS is not set
1632CONFIG_DUMP_CODE=y
1633CONFIG_DWARF_UNWINDER=y
1634# CONFIG_SH_NO_BSS_INIT is not set
1635
1636#
1637# Security options
1638#
1639# CONFIG_KEYS is not set
1640# CONFIG_SECURITY is not set
1641# CONFIG_SECURITYFS is not set
1642# CONFIG_DEFAULT_SECURITY_SELINUX is not set
1643# CONFIG_DEFAULT_SECURITY_SMACK is not set
1644# CONFIG_DEFAULT_SECURITY_TOMOYO is not set
1645CONFIG_DEFAULT_SECURITY_DAC=y
1646CONFIG_DEFAULT_SECURITY=""
1647CONFIG_CRYPTO=y
1648
1649#
1650# Crypto core or helper
1651#
1652# CONFIG_CRYPTO_MANAGER is not set
1653# CONFIG_CRYPTO_MANAGER2 is not set
1654# CONFIG_CRYPTO_GF128MUL is not set
1655# CONFIG_CRYPTO_NULL is not set
1656# CONFIG_CRYPTO_CRYPTD is not set
1657# CONFIG_CRYPTO_AUTHENC is not set
1658# CONFIG_CRYPTO_TEST is not set
1659
1660#
1661# Authenticated Encryption with Associated Data
1662#
1663# CONFIG_CRYPTO_CCM is not set
1664# CONFIG_CRYPTO_GCM is not set
1665# CONFIG_CRYPTO_SEQIV is not set
1666
1667#
1668# Block modes
1669#
1670# CONFIG_CRYPTO_CBC is not set
1671# CONFIG_CRYPTO_CTR is not set
1672# CONFIG_CRYPTO_CTS is not set
1673# CONFIG_CRYPTO_ECB is not set
1674# CONFIG_CRYPTO_LRW is not set
1675# CONFIG_CRYPTO_PCBC is not set
1676# CONFIG_CRYPTO_XTS is not set
1677
1678#
1679# Hash modes
1680#
1681# CONFIG_CRYPTO_HMAC is not set
1682# CONFIG_CRYPTO_XCBC is not set
1683# CONFIG_CRYPTO_VMAC is not set
1684
1685#
1686# Digest
1687#
1688# CONFIG_CRYPTO_CRC32C is not set
1689# CONFIG_CRYPTO_GHASH is not set
1690# CONFIG_CRYPTO_MD4 is not set
1691# CONFIG_CRYPTO_MD5 is not set
1692# CONFIG_CRYPTO_MICHAEL_MIC is not set
1693# CONFIG_CRYPTO_RMD128 is not set
1694# CONFIG_CRYPTO_RMD160 is not set
1695# CONFIG_CRYPTO_RMD256 is not set
1696# CONFIG_CRYPTO_RMD320 is not set
1697# CONFIG_CRYPTO_SHA1 is not set
1698# CONFIG_CRYPTO_SHA256 is not set
1699# CONFIG_CRYPTO_SHA512 is not set
1700# CONFIG_CRYPTO_TGR192 is not set
1701# CONFIG_CRYPTO_WP512 is not set
1702
1703#
1704# Ciphers
1705#
1706# CONFIG_CRYPTO_AES is not set
1707# CONFIG_CRYPTO_ANUBIS is not set
1708# CONFIG_CRYPTO_ARC4 is not set
1709# CONFIG_CRYPTO_BLOWFISH is not set
1710# CONFIG_CRYPTO_CAMELLIA is not set
1711# CONFIG_CRYPTO_CAST5 is not set
1712# CONFIG_CRYPTO_CAST6 is not set
1713# CONFIG_CRYPTO_DES is not set
1714# CONFIG_CRYPTO_FCRYPT is not set
1715# CONFIG_CRYPTO_KHAZAD is not set
1716# CONFIG_CRYPTO_SALSA20 is not set
1717# CONFIG_CRYPTO_SEED is not set
1718# CONFIG_CRYPTO_SERPENT is not set
1719# CONFIG_CRYPTO_TEA is not set
1720# CONFIG_CRYPTO_TWOFISH is not set
1721
1722#
1723# Compression
1724#
1725# CONFIG_CRYPTO_DEFLATE is not set
1726# CONFIG_CRYPTO_ZLIB is not set
1727# CONFIG_CRYPTO_LZO is not set
1728
1729#
1730# Random Number Generation
1731#
1732# CONFIG_CRYPTO_ANSI_CPRNG is not set
1733CONFIG_CRYPTO_HW=y
1734# CONFIG_CRYPTO_DEV_HIFN_795X is not set
1735CONFIG_BINARY_PRINTF=y
1736
1737#
1738# Library routines
1739#
1740CONFIG_BITREVERSE=y
1741CONFIG_GENERIC_FIND_LAST_BIT=y
1742# CONFIG_CRC_CCITT is not set
1743# CONFIG_CRC16 is not set
1744# CONFIG_CRC_T10DIF is not set
1745# CONFIG_CRC_ITU_T is not set
1746CONFIG_CRC32=y
1747# CONFIG_CRC7 is not set
1748# CONFIG_LIBCRC32C is not set
1749CONFIG_HAS_IOMEM=y
1750CONFIG_HAS_IOPORT=y
1751CONFIG_HAS_DMA=y
1752CONFIG_HAVE_LMB=y
1753CONFIG_NLATTR=y
1754CONFIG_GENERIC_ATOMIC64=y
diff --git a/arch/sh/drivers/dma/dma-pvr2.c b/arch/sh/drivers/dma/dma-pvr2.c
index 391cbe1c2956..3cee58e7f1e5 100644
--- a/arch/sh/drivers/dma/dma-pvr2.c
+++ b/arch/sh/drivers/dma/dma-pvr2.c
@@ -40,10 +40,10 @@ static irqreturn_t pvr2_dma_interrupt(int irq, void *dev_id)
40 40
41static int pvr2_request_dma(struct dma_channel *chan) 41static int pvr2_request_dma(struct dma_channel *chan)
42{ 42{
43 if (ctrl_inl(PVR2_DMA_MODE) != 0) 43 if (__raw_readl(PVR2_DMA_MODE) != 0)
44 return -EBUSY; 44 return -EBUSY;
45 45
46 ctrl_outl(0, PVR2_DMA_LMMODE0); 46 __raw_writel(0, PVR2_DMA_LMMODE0);
47 47
48 return 0; 48 return 0;
49} 49}
@@ -60,9 +60,9 @@ static int pvr2_xfer_dma(struct dma_channel *chan)
60 60
61 xfer_complete = 0; 61 xfer_complete = 0;
62 62
63 ctrl_outl(chan->dar, PVR2_DMA_ADDR); 63 __raw_writel(chan->dar, PVR2_DMA_ADDR);
64 ctrl_outl(chan->count, PVR2_DMA_COUNT); 64 __raw_writel(chan->count, PVR2_DMA_COUNT);
65 ctrl_outl(chan->mode & DMA_MODE_MASK, PVR2_DMA_MODE); 65 __raw_writel(chan->mode & DMA_MODE_MASK, PVR2_DMA_MODE);
66 66
67 return 0; 67 return 0;
68} 68}
diff --git a/arch/sh/drivers/dma/dma-sh.c b/arch/sh/drivers/dma/dma-sh.c
index 37fb5b8bbc3f..827208781ed5 100644
--- a/arch/sh/drivers/dma/dma-sh.c
+++ b/arch/sh/drivers/dma/dma-sh.c
@@ -52,11 +52,14 @@ static inline unsigned int get_dmte_irq(unsigned int chan)
52 * 52 *
53 * iterations to complete the transfer. 53 * iterations to complete the transfer.
54 */ 54 */
55static unsigned int ts_shift[] = TS_SHIFT;
55static inline unsigned int calc_xmit_shift(struct dma_channel *chan) 56static inline unsigned int calc_xmit_shift(struct dma_channel *chan)
56{ 57{
57 u32 chcr = ctrl_inl(dma_base_addr[chan->chan] + CHCR); 58 u32 chcr = __raw_readl(dma_base_addr[chan->chan] + CHCR);
59 int cnt = ((chcr & CHCR_TS_LOW_MASK) >> CHCR_TS_LOW_SHIFT) |
60 ((chcr & CHCR_TS_HIGH_MASK) >> CHCR_TS_HIGH_SHIFT);
58 61
59 return ts_shift[(chcr & CHCR_TS_MASK)>>CHCR_TS_SHIFT]; 62 return ts_shift[cnt];
60} 63}
61 64
62/* 65/*
@@ -70,13 +73,13 @@ static irqreturn_t dma_tei(int irq, void *dev_id)
70 struct dma_channel *chan = dev_id; 73 struct dma_channel *chan = dev_id;
71 u32 chcr; 74 u32 chcr;
72 75
73 chcr = ctrl_inl(dma_base_addr[chan->chan] + CHCR); 76 chcr = __raw_readl(dma_base_addr[chan->chan] + CHCR);
74 77
75 if (!(chcr & CHCR_TE)) 78 if (!(chcr & CHCR_TE))
76 return IRQ_NONE; 79 return IRQ_NONE;
77 80
78 chcr &= ~(CHCR_IE | CHCR_DE); 81 chcr &= ~(CHCR_IE | CHCR_DE);
79 ctrl_outl(chcr, (dma_base_addr[chan->chan] + CHCR)); 82 __raw_writel(chcr, (dma_base_addr[chan->chan] + CHCR));
80 83
81 wake_up(&chan->wait_queue); 84 wake_up(&chan->wait_queue);
82 85
@@ -115,7 +118,7 @@ sh_dmac_configure_channel(struct dma_channel *chan, unsigned long chcr)
115 chan->flags &= ~DMA_TEI_CAPABLE; 118 chan->flags &= ~DMA_TEI_CAPABLE;
116 } 119 }
117 120
118 ctrl_outl(chcr, (dma_base_addr[chan->chan] + CHCR)); 121 __raw_writel(chcr, (dma_base_addr[chan->chan] + CHCR));
119 122
120 chan->flags |= DMA_CONFIGURED; 123 chan->flags |= DMA_CONFIGURED;
121 return 0; 124 return 0;
@@ -126,13 +129,13 @@ static void sh_dmac_enable_dma(struct dma_channel *chan)
126 int irq; 129 int irq;
127 u32 chcr; 130 u32 chcr;
128 131
129 chcr = ctrl_inl(dma_base_addr[chan->chan] + CHCR); 132 chcr = __raw_readl(dma_base_addr[chan->chan] + CHCR);
130 chcr |= CHCR_DE; 133 chcr |= CHCR_DE;
131 134
132 if (chan->flags & DMA_TEI_CAPABLE) 135 if (chan->flags & DMA_TEI_CAPABLE)
133 chcr |= CHCR_IE; 136 chcr |= CHCR_IE;
134 137
135 ctrl_outl(chcr, (dma_base_addr[chan->chan] + CHCR)); 138 __raw_writel(chcr, (dma_base_addr[chan->chan] + CHCR));
136 139
137 if (chan->flags & DMA_TEI_CAPABLE) { 140 if (chan->flags & DMA_TEI_CAPABLE) {
138 irq = get_dmte_irq(chan->chan); 141 irq = get_dmte_irq(chan->chan);
@@ -150,9 +153,9 @@ static void sh_dmac_disable_dma(struct dma_channel *chan)
150 disable_irq(irq); 153 disable_irq(irq);
151 } 154 }
152 155
153 chcr = ctrl_inl(dma_base_addr[chan->chan] + CHCR); 156 chcr = __raw_readl(dma_base_addr[chan->chan] + CHCR);
154 chcr &= ~(CHCR_DE | CHCR_TE | CHCR_IE); 157 chcr &= ~(CHCR_DE | CHCR_TE | CHCR_IE);
155 ctrl_outl(chcr, (dma_base_addr[chan->chan] + CHCR)); 158 __raw_writel(chcr, (dma_base_addr[chan->chan] + CHCR));
156} 159}
157 160
158static int sh_dmac_xfer_dma(struct dma_channel *chan) 161static int sh_dmac_xfer_dma(struct dma_channel *chan)
@@ -183,12 +186,12 @@ static int sh_dmac_xfer_dma(struct dma_channel *chan)
183 */ 186 */
184 if (chan->sar || (mach_is_dreamcast() && 187 if (chan->sar || (mach_is_dreamcast() &&
185 chan->chan == PVR2_CASCADE_CHAN)) 188 chan->chan == PVR2_CASCADE_CHAN))
186 ctrl_outl(chan->sar, (dma_base_addr[chan->chan]+SAR)); 189 __raw_writel(chan->sar, (dma_base_addr[chan->chan]+SAR));
187 if (chan->dar || (mach_is_dreamcast() && 190 if (chan->dar || (mach_is_dreamcast() &&
188 chan->chan == PVR2_CASCADE_CHAN)) 191 chan->chan == PVR2_CASCADE_CHAN))
189 ctrl_outl(chan->dar, (dma_base_addr[chan->chan] + DAR)); 192 __raw_writel(chan->dar, (dma_base_addr[chan->chan] + DAR));
190 193
191 ctrl_outl(chan->count >> calc_xmit_shift(chan), 194 __raw_writel(chan->count >> calc_xmit_shift(chan),
192 (dma_base_addr[chan->chan] + TCR)); 195 (dma_base_addr[chan->chan] + TCR));
193 196
194 sh_dmac_enable_dma(chan); 197 sh_dmac_enable_dma(chan);
@@ -198,10 +201,10 @@ static int sh_dmac_xfer_dma(struct dma_channel *chan)
198 201
199static int sh_dmac_get_dma_residue(struct dma_channel *chan) 202static int sh_dmac_get_dma_residue(struct dma_channel *chan)
200{ 203{
201 if (!(ctrl_inl(dma_base_addr[chan->chan] + CHCR) & CHCR_DE)) 204 if (!(__raw_readl(dma_base_addr[chan->chan] + CHCR) & CHCR_DE))
202 return 0; 205 return 0;
203 206
204 return ctrl_inl(dma_base_addr[chan->chan] + TCR) 207 return __raw_readl(dma_base_addr[chan->chan] + TCR)
205 << calc_xmit_shift(chan); 208 << calc_xmit_shift(chan);
206} 209}
207 210
diff --git a/arch/sh/drivers/dma/dmabrg.c b/arch/sh/drivers/dma/dmabrg.c
index 5e22689c2fcf..72622e307613 100644
--- a/arch/sh/drivers/dma/dmabrg.c
+++ b/arch/sh/drivers/dma/dmabrg.c
@@ -86,8 +86,8 @@ static irqreturn_t dmabrg_irq(int irq, void *data)
86 unsigned long dcr; 86 unsigned long dcr;
87 unsigned int i; 87 unsigned int i;
88 88
89 dcr = ctrl_inl(DMABRGCR); 89 dcr = __raw_readl(DMABRGCR);
90 ctrl_outl(dcr & ~0x00ff0003, DMABRGCR); /* ack all */ 90 __raw_writel(dcr & ~0x00ff0003, DMABRGCR); /* ack all */
91 dcr &= dcr >> 8; /* ignore masked */ 91 dcr &= dcr >> 8; /* ignore masked */
92 92
93 /* USB stuff, get it out of the way first */ 93 /* USB stuff, get it out of the way first */
@@ -109,17 +109,17 @@ static irqreturn_t dmabrg_irq(int irq, void *data)
109static void dmabrg_disable_irq(unsigned int dmairq) 109static void dmabrg_disable_irq(unsigned int dmairq)
110{ 110{
111 unsigned long dcr; 111 unsigned long dcr;
112 dcr = ctrl_inl(DMABRGCR); 112 dcr = __raw_readl(DMABRGCR);
113 dcr &= ~(1 << ((dmairq > 1) ? dmairq + 22 : dmairq + 8)); 113 dcr &= ~(1 << ((dmairq > 1) ? dmairq + 22 : dmairq + 8));
114 ctrl_outl(dcr, DMABRGCR); 114 __raw_writel(dcr, DMABRGCR);
115} 115}
116 116
117static void dmabrg_enable_irq(unsigned int dmairq) 117static void dmabrg_enable_irq(unsigned int dmairq)
118{ 118{
119 unsigned long dcr; 119 unsigned long dcr;
120 dcr = ctrl_inl(DMABRGCR); 120 dcr = __raw_readl(DMABRGCR);
121 dcr |= (1 << ((dmairq > 1) ? dmairq + 22 : dmairq + 8)); 121 dcr |= (1 << ((dmairq > 1) ? dmairq + 22 : dmairq + 8));
122 ctrl_outl(dcr, DMABRGCR); 122 __raw_writel(dcr, DMABRGCR);
123} 123}
124 124
125int dmabrg_request_irq(unsigned int dmairq, void(*handler)(void*), 125int dmabrg_request_irq(unsigned int dmairq, void(*handler)(void*),
@@ -165,13 +165,13 @@ static int __init dmabrg_init(void)
165 printk(KERN_INFO "DMABRG: DMAC ch0 not reserved!\n"); 165 printk(KERN_INFO "DMABRG: DMAC ch0 not reserved!\n");
166#endif 166#endif
167 167
168 ctrl_outl(0, DMABRGCR); 168 __raw_writel(0, DMABRGCR);
169 ctrl_outl(0, DMACHCR0); 169 __raw_writel(0, DMACHCR0);
170 ctrl_outl(0x94000000, DMARSRA); /* enable DMABRG in DMAC 0 */ 170 __raw_writel(0x94000000, DMARSRA); /* enable DMABRG in DMAC 0 */
171 171
172 /* enable DMABRG mode, enable the DMAC */ 172 /* enable DMABRG mode, enable the DMAC */
173 or = ctrl_inl(DMAOR); 173 or = __raw_readl(DMAOR);
174 ctrl_outl(or | DMAOR_BRG | DMAOR_DMEN, DMAOR); 174 __raw_writel(or | DMAOR_BRG | DMAOR_DMEN, DMAOR);
175 175
176 ret = request_irq(DMABRGI0, dmabrg_irq, IRQF_DISABLED, 176 ret = request_irq(DMABRGI0, dmabrg_irq, IRQF_DISABLED,
177 "DMABRG USB address error", NULL); 177 "DMABRG USB address error", NULL);
diff --git a/arch/sh/drivers/heartbeat.c b/arch/sh/drivers/heartbeat.c
index a9339a6174fc..2acbc793032d 100644
--- a/arch/sh/drivers/heartbeat.c
+++ b/arch/sh/drivers/heartbeat.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Generic heartbeat driver for regular LED banks 2 * Generic heartbeat driver for regular LED banks
3 * 3 *
4 * Copyright (C) 2007 Paul Mundt 4 * Copyright (C) 2007 - 2010 Paul Mundt
5 * 5 *
6 * Most SH reference boards include a number of individual LEDs that can 6 * Most SH reference boards include a number of individual LEDs that can
7 * be independently controlled (either via a pre-defined hardware 7 * be independently controlled (either via a pre-defined hardware
@@ -27,7 +27,7 @@
27#include <asm/heartbeat.h> 27#include <asm/heartbeat.h>
28 28
29#define DRV_NAME "heartbeat" 29#define DRV_NAME "heartbeat"
30#define DRV_VERSION "0.1.1" 30#define DRV_VERSION "0.1.2"
31 31
32static unsigned char default_bit_pos[] = { 0, 1, 2, 3, 4, 5, 6, 7 }; 32static unsigned char default_bit_pos[] = { 0, 1, 2, 3, 4, 5, 6, 7 };
33 33
@@ -98,7 +98,7 @@ static int heartbeat_drv_probe(struct platform_device *pdev)
98 return -ENOMEM; 98 return -ENOMEM;
99 } 99 }
100 100
101 hd->base = ioremap_nocache(res->start, res->end - res->start + 1); 101 hd->base = ioremap_nocache(res->start, resource_size(res));
102 if (unlikely(!hd->base)) { 102 if (unlikely(!hd->base)) {
103 dev_err(&pdev->dev, "ioremap failed\n"); 103 dev_err(&pdev->dev, "ioremap failed\n");
104 104
@@ -117,8 +117,20 @@ static int heartbeat_drv_probe(struct platform_device *pdev)
117 for (i = 0; i < hd->nr_bits; i++) 117 for (i = 0; i < hd->nr_bits; i++)
118 hd->mask |= (1 << hd->bit_pos[i]); 118 hd->mask |= (1 << hd->bit_pos[i]);
119 119
120 if (!hd->regsize) 120 if (!hd->regsize) {
121 hd->regsize = 8; /* default access size */ 121 switch (res->flags & IORESOURCE_MEM_TYPE_MASK) {
122 case IORESOURCE_MEM_32BIT:
123 hd->regsize = 32;
124 break;
125 case IORESOURCE_MEM_16BIT:
126 hd->regsize = 16;
127 break;
128 case IORESOURCE_MEM_8BIT:
129 default:
130 hd->regsize = 8;
131 break;
132 }
133 }
122 134
123 setup_timer(&hd->timer, heartbeat_timer, (unsigned long)hd); 135 setup_timer(&hd->timer, heartbeat_timer, (unsigned long)hd);
124 platform_set_drvdata(pdev, hd); 136 platform_set_drvdata(pdev, hd);
diff --git a/arch/sh/drivers/pci/Makefile b/arch/sh/drivers/pci/Makefile
index 08af1f459756..4a59e6890876 100644
--- a/arch/sh/drivers/pci/Makefile
+++ b/arch/sh/drivers/pci/Makefile
@@ -1,14 +1,14 @@
1# 1#
2# Makefile for the PCI specific kernel interface routines under Linux. 2# Makefile for the PCI specific kernel interface routines under Linux.
3# 3#
4obj-y += pci.o 4obj-y += common.o pci.o
5 5
6obj-$(CONFIG_CPU_SUBTYPE_SH7751) += pci-sh7751.o ops-sh4.o 6obj-$(CONFIG_CPU_SUBTYPE_SH7751) += pci-sh7751.o ops-sh4.o
7obj-$(CONFIG_CPU_SUBTYPE_SH7751R) += pci-sh7751.o ops-sh4.o 7obj-$(CONFIG_CPU_SUBTYPE_SH7751R) += pci-sh7751.o ops-sh4.o
8obj-$(CONFIG_CPU_SUBTYPE_SH7763) += pci-sh7780.o ops-sh4.o 8obj-$(CONFIG_CPU_SUBTYPE_SH7763) += pci-sh7780.o ops-sh4.o
9obj-$(CONFIG_CPU_SUBTYPE_SH7780) += pci-sh7780.o ops-sh4.o 9obj-$(CONFIG_CPU_SUBTYPE_SH7780) += pci-sh7780.o ops-sh4.o
10obj-$(CONFIG_CPU_SUBTYPE_SH7785) += pci-sh7780.o ops-sh4.o 10obj-$(CONFIG_CPU_SUBTYPE_SH7785) += pci-sh7780.o ops-sh4.o
11obj-$(CONFIG_CPU_SUBTYPE_SH7786) += ops-sh7786.o 11obj-$(CONFIG_CPU_SUBTYPE_SH7786) += pcie-sh7786.o ops-sh7786.o
12obj-$(CONFIG_CPU_SH5) += pci-sh5.o ops-sh5.o 12obj-$(CONFIG_CPU_SH5) += pci-sh5.o ops-sh5.o
13 13
14obj-$(CONFIG_SH_DREAMCAST) += ops-dreamcast.o fixups-dreamcast.o \ 14obj-$(CONFIG_SH_DREAMCAST) += ops-dreamcast.o fixups-dreamcast.o \
@@ -25,4 +25,3 @@ obj-$(CONFIG_SH_TITAN) += fixups-titan.o
25obj-$(CONFIG_SH_LANDISK) += fixups-landisk.o 25obj-$(CONFIG_SH_LANDISK) += fixups-landisk.o
26obj-$(CONFIG_SH_LBOX_RE2) += fixups-rts7751r2d.o 26obj-$(CONFIG_SH_LBOX_RE2) += fixups-rts7751r2d.o
27obj-$(CONFIG_SH_CAYMAN) += fixups-cayman.o 27obj-$(CONFIG_SH_CAYMAN) += fixups-cayman.o
28obj-$(CONFIG_SH_URQUELL) += pcie-sh7786.o
diff --git a/arch/sh/drivers/pci/common.c b/arch/sh/drivers/pci/common.c
new file mode 100644
index 000000000000..dbf138199871
--- /dev/null
+++ b/arch/sh/drivers/pci/common.c
@@ -0,0 +1,162 @@
1#include <linux/pci.h>
2#include <linux/interrupt.h>
3#include <linux/timer.h>
4#include <linux/kernel.h>
5
6/*
7 * These functions are used early on before PCI scanning is done
8 * and all of the pci_dev and pci_bus structures have been created.
9 */
10static struct pci_dev *fake_pci_dev(struct pci_channel *hose,
11 int top_bus, int busnr, int devfn)
12{
13 static struct pci_dev dev;
14 static struct pci_bus bus;
15
16 dev.bus = &bus;
17 dev.sysdata = hose;
18 dev.devfn = devfn;
19 bus.number = busnr;
20 bus.sysdata = hose;
21 bus.ops = hose->pci_ops;
22
23 if(busnr != top_bus)
24 /* Fake a parent bus structure. */
25 bus.parent = &bus;
26 else
27 bus.parent = NULL;
28
29 return &dev;
30}
31
32#define EARLY_PCI_OP(rw, size, type) \
33int __init early_##rw##_config_##size(struct pci_channel *hose, \
34 int top_bus, int bus, int devfn, int offset, type value) \
35{ \
36 return pci_##rw##_config_##size( \
37 fake_pci_dev(hose, top_bus, bus, devfn), \
38 offset, value); \
39}
40
41EARLY_PCI_OP(read, byte, u8 *)
42EARLY_PCI_OP(read, word, u16 *)
43EARLY_PCI_OP(read, dword, u32 *)
44EARLY_PCI_OP(write, byte, u8)
45EARLY_PCI_OP(write, word, u16)
46EARLY_PCI_OP(write, dword, u32)
47
48int __init pci_is_66mhz_capable(struct pci_channel *hose,
49 int top_bus, int current_bus)
50{
51 u32 pci_devfn;
52 unsigned short vid;
53 int cap66 = -1;
54 u16 stat;
55
56 printk(KERN_INFO "PCI: Checking 66MHz capabilities...\n");
57
58 for (pci_devfn = 0; pci_devfn < 0xff; pci_devfn++) {
59 if (PCI_FUNC(pci_devfn))
60 continue;
61 if (early_read_config_word(hose, top_bus, current_bus,
62 pci_devfn, PCI_VENDOR_ID, &vid) !=
63 PCIBIOS_SUCCESSFUL)
64 continue;
65 if (vid == 0xffff)
66 continue;
67
68 /* check 66MHz capability */
69 if (cap66 < 0)
70 cap66 = 1;
71 if (cap66) {
72 early_read_config_word(hose, top_bus, current_bus,
73 pci_devfn, PCI_STATUS, &stat);
74 if (!(stat & PCI_STATUS_66MHZ)) {
75 printk(KERN_DEBUG
76 "PCI: %02x:%02x not 66MHz capable.\n",
77 current_bus, pci_devfn);
78 cap66 = 0;
79 break;
80 }
81 }
82 }
83
84 return cap66 > 0;
85}
86
87static void pcibios_enable_err(unsigned long __data)
88{
89 struct pci_channel *hose = (struct pci_channel *)__data;
90
91 del_timer(&hose->err_timer);
92 printk(KERN_DEBUG "PCI: re-enabling error IRQ.\n");
93 enable_irq(hose->err_irq);
94}
95
96static void pcibios_enable_serr(unsigned long __data)
97{
98 struct pci_channel *hose = (struct pci_channel *)__data;
99
100 del_timer(&hose->serr_timer);
101 printk(KERN_DEBUG "PCI: re-enabling system error IRQ.\n");
102 enable_irq(hose->serr_irq);
103}
104
105void pcibios_enable_timers(struct pci_channel *hose)
106{
107 if (hose->err_irq) {
108 init_timer(&hose->err_timer);
109 hose->err_timer.data = (unsigned long)hose;
110 hose->err_timer.function = pcibios_enable_err;
111 }
112
113 if (hose->serr_irq) {
114 init_timer(&hose->serr_timer);
115 hose->serr_timer.data = (unsigned long)hose;
116 hose->serr_timer.function = pcibios_enable_serr;
117 }
118}
119
120/*
121 * A simple handler for the regular PCI status errors, called from IRQ
122 * context.
123 */
124unsigned int pcibios_handle_status_errors(unsigned long addr,
125 unsigned int status,
126 struct pci_channel *hose)
127{
128 unsigned int cmd = 0;
129
130 if (status & PCI_STATUS_REC_MASTER_ABORT) {
131 printk(KERN_DEBUG "PCI: master abort, pc=0x%08lx\n", addr);
132 cmd |= PCI_STATUS_REC_MASTER_ABORT;
133 }
134
135 if (status & PCI_STATUS_REC_TARGET_ABORT) {
136 printk(KERN_DEBUG "PCI: target abort: ");
137 pcibios_report_status(PCI_STATUS_REC_TARGET_ABORT |
138 PCI_STATUS_SIG_TARGET_ABORT |
139 PCI_STATUS_REC_MASTER_ABORT, 1);
140 printk("\n");
141
142 cmd |= PCI_STATUS_REC_TARGET_ABORT;
143 }
144
145 if (status & (PCI_STATUS_PARITY | PCI_STATUS_DETECTED_PARITY)) {
146 printk(KERN_DEBUG "PCI: parity error detected: ");
147 pcibios_report_status(PCI_STATUS_PARITY |
148 PCI_STATUS_DETECTED_PARITY, 1);
149 printk("\n");
150
151 cmd |= PCI_STATUS_PARITY | PCI_STATUS_DETECTED_PARITY;
152
153 /* Now back off of the IRQ for awhile */
154 if (hose->err_irq) {
155 disable_irq_nosync(hose->err_irq);
156 hose->err_timer.expires = jiffies + HZ;
157 add_timer(&hose->err_timer);
158 }
159 }
160
161 return cmd;
162}
diff --git a/arch/sh/drivers/pci/fixups-dreamcast.c b/arch/sh/drivers/pci/fixups-dreamcast.c
index ed7f489936f1..942ef4f155f5 100644
--- a/arch/sh/drivers/pci/fixups-dreamcast.c
+++ b/arch/sh/drivers/pci/fixups-dreamcast.c
@@ -39,7 +39,7 @@ static void __init gapspci_fixup_resources(struct pci_dev *dev)
39 /* 39 /*
40 * We also assume that dev->devfn == 0 40 * We also assume that dev->devfn == 0
41 */ 41 */
42 dev->resource[1].start = p->io_resource->start + 0x100; 42 dev->resource[1].start = p->resources[0].start + 0x100;
43 dev->resource[1].end = dev->resource[1].start + 0x200 - 1; 43 dev->resource[1].end = dev->resource[1].start + 0x200 - 1;
44 44
45 /* 45 /*
diff --git a/arch/sh/drivers/pci/fixups-r7780rp.c b/arch/sh/drivers/pci/fixups-r7780rp.c
index 15ca65cb667e..08b2d8658a00 100644
--- a/arch/sh/drivers/pci/fixups-r7780rp.c
+++ b/arch/sh/drivers/pci/fixups-r7780rp.c
@@ -22,15 +22,3 @@ int __init pcibios_map_platform_irq(struct pci_dev *pdev, u8 slot, u8 pin)
22{ 22{
23 return irq_tab[slot]; 23 return irq_tab[slot];
24} 24}
25
26int pci_fixup_pcic(struct pci_channel *chan)
27{
28 pci_write_reg(chan, 0x000043ff, SH4_PCIINTM);
29 pci_write_reg(chan, 0x00000000, SH7780_PCIIBAR);
30 pci_write_reg(chan, 0x08000000, SH7780_PCICSCR0);
31 pci_write_reg(chan, 0x0000001b, SH7780_PCICSAR0);
32 pci_write_reg(chan, 0xfd000000, SH7780_PCICSCR1);
33 pci_write_reg(chan, 0x0000000f, SH7780_PCICSAR1);
34
35 return 0;
36}
diff --git a/arch/sh/drivers/pci/fixups-rts7751r2d.c b/arch/sh/drivers/pci/fixups-rts7751r2d.c
index 7898f14d6641..e248516118a9 100644
--- a/arch/sh/drivers/pci/fixups-rts7751r2d.c
+++ b/arch/sh/drivers/pci/fixups-rts7751r2d.c
@@ -43,7 +43,7 @@ int pci_fixup_pcic(struct pci_channel *chan)
43{ 43{
44 unsigned long bcr1, mcr; 44 unsigned long bcr1, mcr;
45 45
46 bcr1 = ctrl_inl(SH7751_BCR1); 46 bcr1 = __raw_readl(SH7751_BCR1);
47 bcr1 |= 0x40080000; /* Enable Bit 19 BREQEN, set PCIC to slave */ 47 bcr1 |= 0x40080000; /* Enable Bit 19 BREQEN, set PCIC to slave */
48 pci_write_reg(chan, bcr1, SH4_PCIBCR1); 48 pci_write_reg(chan, bcr1, SH4_PCIBCR1);
49 49
@@ -54,7 +54,7 @@ int pci_fixup_pcic(struct pci_channel *chan)
54 pci_write_reg(chan, 0xfb900047, SH7751_PCICONF1); 54 pci_write_reg(chan, 0xfb900047, SH7751_PCICONF1);
55 pci_write_reg(chan, 0xab000001, SH7751_PCICONF4); 55 pci_write_reg(chan, 0xab000001, SH7751_PCICONF4);
56 56
57 mcr = ctrl_inl(SH7751_MCR); 57 mcr = __raw_readl(SH7751_MCR);
58 mcr = (mcr & PCIMCR_MRSET_OFF) & PCIMCR_RFSH_OFF; 58 mcr = (mcr & PCIMCR_MRSET_OFF) & PCIMCR_RFSH_OFF;
59 pci_write_reg(chan, mcr, SH4_PCIMCR); 59 pci_write_reg(chan, mcr, SH4_PCIMCR);
60 60
diff --git a/arch/sh/drivers/pci/fixups-sdk7780.c b/arch/sh/drivers/pci/fixups-sdk7780.c
index 250b0edd7365..0930f988ac29 100644
--- a/arch/sh/drivers/pci/fixups-sdk7780.c
+++ b/arch/sh/drivers/pci/fixups-sdk7780.c
@@ -31,22 +31,3 @@ int __init pcibios_map_platform_irq(struct pci_dev *pdev, u8 slot, u8 pin)
31{ 31{
32 return sdk7780_irq_tab[pin-1][slot]; 32 return sdk7780_irq_tab[pin-1][slot];
33} 33}
34int pci_fixup_pcic(struct pci_channel *chan)
35{
36 /* Enable all interrupts, so we know what to fix */
37 pci_write_reg(chan, 0x0000C3FF, SH7780_PCIIMR);
38
39 /* Set up standard PCI config registers */
40 pci_write_reg(chan, 0x08000000, SH7780_PCIMBAR0); /* PCI */
41 pci_write_reg(chan, 0x08000000, SH4_PCILAR0); /* SHwy */
42 pci_write_reg(chan, 0x07F00001, SH4_PCILSR0); /* size 128M w/ MBAR */
43
44 pci_write_reg(chan, 0x00000000, SH7780_PCIMBAR1);
45 pci_write_reg(chan, 0x00000000, SH4_PCILAR1);
46 pci_write_reg(chan, 0x00000000, SH4_PCILSR1);
47
48 pci_write_reg(chan, 0xAB000801, SH7780_PCIIBAR);
49 pci_write_reg(chan, 0xA5000C01, SH4_PCICR);
50
51 return 0;
52}
diff --git a/arch/sh/drivers/pci/fixups-se7751.c b/arch/sh/drivers/pci/fixups-se7751.c
index 475fa9f0fe2c..a4c7d3a4efca 100644
--- a/arch/sh/drivers/pci/fixups-se7751.c
+++ b/arch/sh/drivers/pci/fixups-se7751.c
@@ -97,12 +97,12 @@ int pci_fixup_pcic(struct pci_channel *chan)
97 * meaning all calls go straight through... use BUG_ON to 97 * meaning all calls go straight through... use BUG_ON to
98 * catch erroneous assumption. 98 * catch erroneous assumption.
99 */ 99 */
100 BUG_ON(chan->mem_resource->start != SH7751_PCI_MEMORY_BASE); 100 BUG_ON(chan->resources[1].start != SH7751_PCI_MEMORY_BASE);
101 101
102 PCIC_WRITE(SH7751_PCIMBR, chan->mem_resource->start); 102 PCIC_WRITE(SH7751_PCIMBR, chan->resources[1].start);
103 103
104 /* Set IOBR for window containing area specified in pci.h */ 104 /* Set IOBR for window containing area specified in pci.h */
105 PCIC_WRITE(SH7751_PCIIOBR, (chan->io_resource->start & SH7751_PCIIOBR_MASK)); 105 PCIC_WRITE(SH7751_PCIIOBR, (chan->resources[0].start & SH7751_PCIIOBR_MASK));
106 106
107 /* All done, may as well say so... */ 107 /* All done, may as well say so... */
108 printk("SH7751 PCI: Finished initialization of the PCI controller\n"); 108 printk("SH7751 PCI: Finished initialization of the PCI controller\n");
diff --git a/arch/sh/drivers/pci/ops-sh4.c b/arch/sh/drivers/pci/ops-sh4.c
index 78bebebdc99c..0b81999fb88b 100644
--- a/arch/sh/drivers/pci/ops-sh4.c
+++ b/arch/sh/drivers/pci/ops-sh4.c
@@ -16,7 +16,7 @@
16 * Direct access to PCI hardware... 16 * Direct access to PCI hardware...
17 */ 17 */
18#define CONFIG_CMD(bus, devfn, where) \ 18#define CONFIG_CMD(bus, devfn, where) \
19 (P1SEG | (bus->number << 16) | (devfn << 8) | (where & ~3)) 19 (0x80000000 | (bus->number << 16) | (devfn << 8) | (where & ~3))
20 20
21static DEFINE_SPINLOCK(sh4_pci_lock); 21static DEFINE_SPINLOCK(sh4_pci_lock);
22 22
@@ -102,34 +102,6 @@ struct pci_ops sh4_pci_ops = {
102 .write = sh4_pci_write, 102 .write = sh4_pci_write,
103}; 103};
104 104
105/*
106 * Not really related to pci_ops, but it's common and not worth shoving
107 * somewhere else for now..
108 */
109int __init sh4_pci_check_direct(struct pci_channel *chan)
110{
111 /*
112 * Check if configuration works.
113 */
114 unsigned int tmp = pci_read_reg(chan, SH4_PCIPAR);
115
116 pci_write_reg(chan, P1SEG, SH4_PCIPAR);
117
118 if (pci_read_reg(chan, SH4_PCIPAR) == P1SEG) {
119 pci_write_reg(chan, tmp, SH4_PCIPAR);
120 printk(KERN_INFO "PCI: Using configuration type 1\n");
121 request_region(chan->reg_base + SH4_PCIPAR, 8,
122 "PCI conf1");
123 return 0;
124 }
125
126 pci_write_reg(chan, tmp, SH4_PCIPAR);
127
128 printk(KERN_ERR "PCI: %s failed\n", __func__);
129
130 return -EINVAL;
131}
132
133int __attribute__((weak)) pci_fixup_pcic(struct pci_channel *chan) 105int __attribute__((weak)) pci_fixup_pcic(struct pci_channel *chan)
134{ 106{
135 /* Nothing to do. */ 107 /* Nothing to do. */
diff --git a/arch/sh/drivers/pci/pci-dreamcast.c b/arch/sh/drivers/pci/pci-dreamcast.c
index 210f9d4af141..633694193af8 100644
--- a/arch/sh/drivers/pci/pci-dreamcast.c
+++ b/arch/sh/drivers/pci/pci-dreamcast.c
@@ -25,25 +25,25 @@
25#include <asm/irq.h> 25#include <asm/irq.h>
26#include <mach/pci.h> 26#include <mach/pci.h>
27 27
28static struct resource gapspci_io_resource = { 28static struct resource gapspci_resources[] = {
29 .name = "GAPSPCI IO", 29 {
30 .start = GAPSPCI_BBA_CONFIG, 30 .name = "GAPSPCI IO",
31 .end = GAPSPCI_BBA_CONFIG + GAPSPCI_BBA_CONFIG_SIZE - 1, 31 .start = GAPSPCI_BBA_CONFIG,
32 .flags = IORESOURCE_IO, 32 .end = GAPSPCI_BBA_CONFIG + GAPSPCI_BBA_CONFIG_SIZE - 1,
33}; 33 .flags = IORESOURCE_IO,
34 34 }, {
35static struct resource gapspci_mem_resource = { 35 .name = "GAPSPCI mem",
36 .name = "GAPSPCI mem", 36 .start = GAPSPCI_DMA_BASE,
37 .start = GAPSPCI_DMA_BASE, 37 .end = GAPSPCI_DMA_BASE + GAPSPCI_DMA_SIZE - 1,
38 .end = GAPSPCI_DMA_BASE + GAPSPCI_DMA_SIZE - 1, 38 .flags = IORESOURCE_MEM,
39 .flags = IORESOURCE_MEM, 39 },
40}; 40};
41 41
42static struct pci_channel dreamcast_pci_controller = { 42static struct pci_channel dreamcast_pci_controller = {
43 .pci_ops = &gapspci_pci_ops, 43 .pci_ops = &gapspci_pci_ops,
44 .io_resource = &gapspci_io_resource, 44 .resources = gapspci_resources,
45 .nr_resources = ARRAY_SIZE(gapspci_resources),
45 .io_offset = 0x00000000, 46 .io_offset = 0x00000000,
46 .mem_resource = &gapspci_mem_resource,
47 .mem_offset = 0x00000000, 47 .mem_offset = 0x00000000,
48}; 48};
49 49
@@ -95,8 +95,6 @@ static int __init gapspci_init(void)
95 outl(0x00002001, GAPSPCI_BBA_CONFIG+0x10); 95 outl(0x00002001, GAPSPCI_BBA_CONFIG+0x10);
96 outl(0x01000000, GAPSPCI_BBA_CONFIG+0x14); 96 outl(0x01000000, GAPSPCI_BBA_CONFIG+0x14);
97 97
98 register_pci_controller(&dreamcast_pci_controller); 98 return register_pci_controller(&dreamcast_pci_controller);
99
100 return 0;
101} 99}
102arch_initcall(gapspci_init); 100arch_initcall(gapspci_init);
diff --git a/arch/sh/drivers/pci/pci-sh4.h b/arch/sh/drivers/pci/pci-sh4.h
index 3d5296cde622..cbf763b3015e 100644
--- a/arch/sh/drivers/pci/pci-sh4.h
+++ b/arch/sh/drivers/pci/pci-sh4.h
@@ -49,6 +49,17 @@
49 #define SH4_PCIINT_MWPD 0x00000002 /* Master Write PERR Detect */ 49 #define SH4_PCIINT_MWPD 0x00000002 /* Master Write PERR Detect */
50 #define SH4_PCIINT_MRPD 0x00000001 /* Master Read PERR Detect */ 50 #define SH4_PCIINT_MRPD 0x00000001 /* Master Read PERR Detect */
51#define SH4_PCIINTM 0x118 /* PCI Interrupt Mask */ 51#define SH4_PCIINTM 0x118 /* PCI Interrupt Mask */
52 #define SH4_PCIINTM_TTADIM BIT(14) /* Target-target abort interrupt */
53 #define SH4_PCIINTM_TMTOIM BIT(9) /* Target retry timeout */
54 #define SH4_PCIINTM_MDEIM BIT(8) /* Master function disable error */
55 #define SH4_PCIINTM_APEDIM BIT(7) /* Address parity error detection */
56 #define SH4_PCIINTM_SDIM BIT(6) /* SERR detection */
57 #define SH4_PCIINTM_DPEITWM BIT(5) /* Data parity error for target write */
58 #define SH4_PCIINTM_PEDITRM BIT(4) /* PERR detection for target read */
59 #define SH4_PCIINTM_TADIMM BIT(3) /* Target abort for master */
60 #define SH4_PCIINTM_MADIMM BIT(2) /* Master abort for master */
61 #define SH4_PCIINTM_MWPDIM BIT(1) /* Master write data parity error */
62 #define SH4_PCIINTM_MRDPEIM BIT(0) /* Master read data parity error */
52#define SH4_PCIALR 0x11C /* Error Address Register */ 63#define SH4_PCIALR 0x11C /* Error Address Register */
53#define SH4_PCICLR 0x120 /* Error Command/Data */ 64#define SH4_PCICLR 0x120 /* Error Command/Data */
54 #define SH4_PCICLR_MPIO 0x80000000 65 #define SH4_PCICLR_MPIO 0x80000000
@@ -61,7 +72,7 @@
61#define SH4_PCIAINT 0x130 /* Arbiter Interrupt Register */ 72#define SH4_PCIAINT 0x130 /* Arbiter Interrupt Register */
62 #define SH4_PCIAINT_MBKN 0x00002000 /* Master Broken Interrupt */ 73 #define SH4_PCIAINT_MBKN 0x00002000 /* Master Broken Interrupt */
63 #define SH4_PCIAINT_TBTO 0x00001000 /* Target Bus Time Out */ 74 #define SH4_PCIAINT_TBTO 0x00001000 /* Target Bus Time Out */
64 #define SH4_PCIAINT_MBTO 0x00001000 /* Master Bus Time Out */ 75 #define SH4_PCIAINT_MBTO 0x00000800 /* Master Bus Time Out */
65 #define SH4_PCIAINT_TABT 0x00000008 /* Target Abort */ 76 #define SH4_PCIAINT_TABT 0x00000008 /* Target Abort */
66 #define SH4_PCIAINT_MABT 0x00000004 /* Master Abort */ 77 #define SH4_PCIAINT_MABT 0x00000004 /* Master Abort */
67 #define SH4_PCIAINT_RDPE 0x00000002 /* Read Data Parity Error */ 78 #define SH4_PCIAINT_RDPE 0x00000002 /* Read Data Parity Error */
@@ -151,7 +162,6 @@
151 162
152/* arch/sh/kernel/drivers/pci/ops-sh4.c */ 163/* arch/sh/kernel/drivers/pci/ops-sh4.c */
153extern struct pci_ops sh4_pci_ops; 164extern struct pci_ops sh4_pci_ops;
154int sh4_pci_check_direct(struct pci_channel *chan);
155int pci_fixup_pcic(struct pci_channel *chan); 165int pci_fixup_pcic(struct pci_channel *chan);
156 166
157struct sh4_pci_address_space { 167struct sh4_pci_address_space {
@@ -167,13 +177,13 @@ struct sh4_pci_address_map {
167static inline void pci_write_reg(struct pci_channel *chan, 177static inline void pci_write_reg(struct pci_channel *chan,
168 unsigned long val, unsigned long reg) 178 unsigned long val, unsigned long reg)
169{ 179{
170 ctrl_outl(val, chan->reg_base + reg); 180 __raw_writel(val, chan->reg_base + reg);
171} 181}
172 182
173static inline unsigned long pci_read_reg(struct pci_channel *chan, 183static inline unsigned long pci_read_reg(struct pci_channel *chan,
174 unsigned long reg) 184 unsigned long reg)
175{ 185{
176 return ctrl_inl(chan->reg_base + reg); 186 return __raw_readl(chan->reg_base + reg);
177} 187}
178 188
179#endif /* __PCI_SH4_H */ 189#endif /* __PCI_SH4_H */
diff --git a/arch/sh/drivers/pci/pci-sh5.c b/arch/sh/drivers/pci/pci-sh5.c
index 873ed2b44055..0bf296c78795 100644
--- a/arch/sh/drivers/pci/pci-sh5.c
+++ b/arch/sh/drivers/pci/pci-sh5.c
@@ -89,14 +89,13 @@ static irqreturn_t pcish5_serr_irq(int irq, void *dev_id)
89 return IRQ_NONE; 89 return IRQ_NONE;
90} 90}
91 91
92static struct resource sh5_io_resource = { /* place holder */ }; 92static struct resource sh5_pci_resources[2];
93static struct resource sh5_mem_resource = { /* place holder */ };
94 93
95static struct pci_channel sh5pci_controller = { 94static struct pci_channel sh5pci_controller = {
96 .pci_ops = &sh5_pci_ops, 95 .pci_ops = &sh5_pci_ops,
97 .mem_resource = &sh5_mem_resource, 96 .resources = sh5_pci_resources,
97 .nr_resources = ARRAY_SIZE(sh5_pci_resources),
98 .mem_offset = 0x00000000, 98 .mem_offset = 0x00000000,
99 .io_resource = &sh5_io_resource,
100 .io_offset = 0x00000000, 99 .io_offset = 0x00000000,
101}; 100};
102 101
@@ -210,14 +209,12 @@ static int __init sh5pci_init(void)
210 SH5PCI_WRITE(AINTM, ~0); 209 SH5PCI_WRITE(AINTM, ~0);
211 SH5PCI_WRITE(PINTM, ~0); 210 SH5PCI_WRITE(PINTM, ~0);
212 211
213 sh5_io_resource.start = PCI_IO_AREA; 212 sh5_pci_resources[0].start = PCI_IO_AREA;
214 sh5_io_resource.end = PCI_IO_AREA + 0x10000; 213 sh5_pci_resources[0].end = PCI_IO_AREA + 0x10000;
215 214
216 sh5_mem_resource.start = memStart; 215 sh5_pci_resources[1].start = memStart;
217 sh5_mem_resource.end = memStart + memSize; 216 sh5_pci_resources[1].end = memStart + memSize;
218 217
219 register_pci_controller(&sh5pci_controller); 218 return register_pci_controller(&sh5pci_controller);
220
221 return 0;
222} 219}
223arch_initcall(sh5pci_init); 220arch_initcall(sh5pci_init);
diff --git a/arch/sh/drivers/pci/pci-sh5.h b/arch/sh/drivers/pci/pci-sh5.h
index f277628221f3..3f01decb4307 100644
--- a/arch/sh/drivers/pci/pci-sh5.h
+++ b/arch/sh/drivers/pci/pci-sh5.h
@@ -86,14 +86,14 @@ extern unsigned long pcicr_virt;
86/* #define PCISH5_VCR_REG(x) ( SH5PCI_VCR_BASE (PCISH5_VCR_##x)) */ 86/* #define PCISH5_VCR_REG(x) ( SH5PCI_VCR_BASE (PCISH5_VCR_##x)) */
87 87
88/* Write I/O functions */ 88/* Write I/O functions */
89#define SH5PCI_WRITE(reg,val) ctrl_outl((u32)(val),PCISH5_ICR_REG(reg)) 89#define SH5PCI_WRITE(reg,val) __raw_writel((u32)(val),PCISH5_ICR_REG(reg))
90#define SH5PCI_WRITE_SHORT(reg,val) ctrl_outw((u16)(val),PCISH5_ICR_REG(reg)) 90#define SH5PCI_WRITE_SHORT(reg,val) __raw_writew((u16)(val),PCISH5_ICR_REG(reg))
91#define SH5PCI_WRITE_BYTE(reg,val) ctrl_outb((u8)(val),PCISH5_ICR_REG(reg)) 91#define SH5PCI_WRITE_BYTE(reg,val) __raw_writeb((u8)(val),PCISH5_ICR_REG(reg))
92 92
93/* Read I/O functions */ 93/* Read I/O functions */
94#define SH5PCI_READ(reg) ctrl_inl(PCISH5_ICR_REG(reg)) 94#define SH5PCI_READ(reg) __raw_readl(PCISH5_ICR_REG(reg))
95#define SH5PCI_READ_SHORT(reg) ctrl_inw(PCISH5_ICR_REG(reg)) 95#define SH5PCI_READ_SHORT(reg) __raw_readw(PCISH5_ICR_REG(reg))
96#define SH5PCI_READ_BYTE(reg) ctrl_inb(PCISH5_ICR_REG(reg)) 96#define SH5PCI_READ_BYTE(reg) __raw_readb(PCISH5_ICR_REG(reg))
97 97
98/* Set PCI config bits */ 98/* Set PCI config bits */
99#define SET_CONFIG_BITS(bus,devfn,where) ((((bus) << 16) | ((devfn) << 8) | ((where) & ~3)) | 0x80000000) 99#define SET_CONFIG_BITS(bus,devfn,where) ((((bus) << 16) | ((devfn) << 8) | ((where) & ~3)) | 0x80000000)
diff --git a/arch/sh/drivers/pci/pci-sh7751.c b/arch/sh/drivers/pci/pci-sh7751.c
index 70c1999a0ec4..17811e5d287b 100644
--- a/arch/sh/drivers/pci/pci-sh7751.c
+++ b/arch/sh/drivers/pci/pci-sh7751.c
@@ -44,25 +44,25 @@ static int __init __area_sdram_check(struct pci_channel *chan,
44 return 1; 44 return 1;
45} 45}
46 46
47static struct resource sh7751_io_resource = { 47static struct resource sh7751_pci_resources[] = {
48 .name = "SH7751_IO", 48 {
49 .start = SH7751_PCI_IO_BASE, 49 .name = "SH7751_IO",
50 .end = SH7751_PCI_IO_BASE + SH7751_PCI_IO_SIZE - 1, 50 .start = SH7751_PCI_IO_BASE,
51 .flags = IORESOURCE_IO 51 .end = SH7751_PCI_IO_BASE + SH7751_PCI_IO_SIZE - 1,
52}; 52 .flags = IORESOURCE_IO
53 53 }, {
54static struct resource sh7751_mem_resource = { 54 .name = "SH7751_mem",
55 .name = "SH7751_mem", 55 .start = SH7751_PCI_MEMORY_BASE,
56 .start = SH7751_PCI_MEMORY_BASE, 56 .end = SH7751_PCI_MEMORY_BASE + SH7751_PCI_MEM_SIZE - 1,
57 .end = SH7751_PCI_MEMORY_BASE + SH7751_PCI_MEM_SIZE - 1, 57 .flags = IORESOURCE_MEM
58 .flags = IORESOURCE_MEM 58 },
59}; 59};
60 60
61static struct pci_channel sh7751_pci_controller = { 61static struct pci_channel sh7751_pci_controller = {
62 .pci_ops = &sh4_pci_ops, 62 .pci_ops = &sh4_pci_ops,
63 .mem_resource = &sh7751_mem_resource, 63 .resources = sh7751_pci_resources,
64 .nr_resources = ARRAY_SIZE(sh7751_pci_resources),
64 .mem_offset = 0x00000000, 65 .mem_offset = 0x00000000,
65 .io_resource = &sh7751_io_resource,
66 .io_offset = 0x00000000, 66 .io_offset = 0x00000000,
67 .io_map_base = SH7751_PCI_IO_BASE, 67 .io_map_base = SH7751_PCI_IO_BASE,
68}; 68};
@@ -79,7 +79,6 @@ static int __init sh7751_pci_init(void)
79 struct pci_channel *chan = &sh7751_pci_controller; 79 struct pci_channel *chan = &sh7751_pci_controller;
80 unsigned int id; 80 unsigned int id;
81 u32 word, reg; 81 u32 word, reg;
82 int ret;
83 82
84 printk(KERN_NOTICE "PCI: Starting intialization.\n"); 83 printk(KERN_NOTICE "PCI: Starting intialization.\n");
85 84
@@ -93,13 +92,10 @@ static int __init sh7751_pci_init(void)
93 return -ENODEV; 92 return -ENODEV;
94 } 93 }
95 94
96 if ((ret = sh4_pci_check_direct(chan)) != 0)
97 return ret;
98
99 /* Set the BCR's to enable PCI access */ 95 /* Set the BCR's to enable PCI access */
100 reg = ctrl_inl(SH7751_BCR1); 96 reg = __raw_readl(SH7751_BCR1);
101 reg |= 0x80000; 97 reg |= 0x80000;
102 ctrl_outl(reg, SH7751_BCR1); 98 __raw_writel(reg, SH7751_BCR1);
103 99
104 /* Turn the clocks back on (not done in reset)*/ 100 /* Turn the clocks back on (not done in reset)*/
105 pci_write_reg(chan, 0, SH4_PCICLKR); 101 pci_write_reg(chan, 0, SH4_PCICLKR);
@@ -132,13 +128,13 @@ static int __init sh7751_pci_init(void)
132 /* Set the local 16MB PCI memory space window to 128 /* Set the local 16MB PCI memory space window to
133 * the lowest PCI mapped address 129 * the lowest PCI mapped address
134 */ 130 */
135 word = chan->mem_resource->start & SH4_PCIMBR_MASK; 131 word = chan->resources[1].start & SH4_PCIMBR_MASK;
136 pr_debug("PCI: Setting upper bits of Memory window to 0x%x\n", word); 132 pr_debug("PCI: Setting upper bits of Memory window to 0x%x\n", word);
137 pci_write_reg(chan, word , SH4_PCIMBR); 133 pci_write_reg(chan, word , SH4_PCIMBR);
138 134
139 /* Make sure the MSB's of IO window are set to access PCI space 135 /* Make sure the MSB's of IO window are set to access PCI space
140 * correctly */ 136 * correctly */
141 word = chan->io_resource->start & SH4_PCIIOBR_MASK; 137 word = chan->resources[0].start & SH4_PCIIOBR_MASK;
142 pr_debug("PCI: Setting upper bits of IO window to 0x%x\n", word); 138 pr_debug("PCI: Setting upper bits of IO window to 0x%x\n", word);
143 pci_write_reg(chan, word, SH4_PCIIOBR); 139 pci_write_reg(chan, word, SH4_PCIIOBR);
144 140
@@ -159,13 +155,13 @@ static int __init sh7751_pci_init(void)
159 return -1; 155 return -1;
160 156
161 /* configure the wait control registers */ 157 /* configure the wait control registers */
162 word = ctrl_inl(SH7751_WCR1); 158 word = __raw_readl(SH7751_WCR1);
163 pci_write_reg(chan, word, SH4_PCIWCR1); 159 pci_write_reg(chan, word, SH4_PCIWCR1);
164 word = ctrl_inl(SH7751_WCR2); 160 word = __raw_readl(SH7751_WCR2);
165 pci_write_reg(chan, word, SH4_PCIWCR2); 161 pci_write_reg(chan, word, SH4_PCIWCR2);
166 word = ctrl_inl(SH7751_WCR3); 162 word = __raw_readl(SH7751_WCR3);
167 pci_write_reg(chan, word, SH4_PCIWCR3); 163 pci_write_reg(chan, word, SH4_PCIWCR3);
168 word = ctrl_inl(SH7751_MCR); 164 word = __raw_readl(SH7751_MCR);
169 pci_write_reg(chan, word, SH4_PCIMCR); 165 pci_write_reg(chan, word, SH4_PCIMCR);
170 166
171 /* NOTE: I'm ignoring the PCI error IRQs for now.. 167 /* NOTE: I'm ignoring the PCI error IRQs for now..
@@ -180,8 +176,6 @@ static int __init sh7751_pci_init(void)
180 word = SH4_PCICR_PREFIX | SH4_PCICR_CFIN | SH4_PCICR_ARBM; 176 word = SH4_PCICR_PREFIX | SH4_PCICR_CFIN | SH4_PCICR_ARBM;
181 pci_write_reg(chan, word, SH4_PCICR); 177 pci_write_reg(chan, word, SH4_PCICR);
182 178
183 register_pci_controller(chan); 179 return register_pci_controller(chan);
184
185 return 0;
186} 180}
187arch_initcall(sh7751_pci_init); 181arch_initcall(sh7751_pci_init);
diff --git a/arch/sh/drivers/pci/pci-sh7780.c b/arch/sh/drivers/pci/pci-sh7780.c
index 323b92d565fe..ffdcbf10b95e 100644
--- a/arch/sh/drivers/pci/pci-sh7780.c
+++ b/arch/sh/drivers/pci/pci-sh7780.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Low-Level PCI Support for the SH7780 2 * Low-Level PCI Support for the SH7780
3 * 3 *
4 * Copyright (C) 2005 - 2009 Paul Mundt 4 * Copyright (C) 2005 - 2010 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
@@ -11,52 +11,240 @@
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/pci.h> 13#include <linux/pci.h>
14#include <linux/interrupt.h>
15#include <linux/timer.h>
16#include <linux/irq.h>
14#include <linux/errno.h> 17#include <linux/errno.h>
15#include <linux/delay.h> 18#include <linux/delay.h>
19#include <linux/log2.h>
16#include "pci-sh4.h" 20#include "pci-sh4.h"
21#include <asm/mmu.h>
22#include <asm/sizes.h>
17 23
18static struct resource sh7785_io_resource = { 24static struct resource sh7785_pci_resources[] = {
19 .name = "SH7785_IO", 25 {
20 .start = SH7780_PCI_IO_BASE, 26 .name = "PCI IO",
21 .end = SH7780_PCI_IO_BASE + SH7780_PCI_IO_SIZE - 1, 27 .start = 0x1000,
22 .flags = IORESOURCE_IO 28 .end = SZ_4M - 1,
23}; 29 .flags = IORESOURCE_IO,
24 30 }, {
25static struct resource sh7785_mem_resource = { 31 .name = "PCI MEM 0",
26 .name = "SH7785_mem", 32 .start = 0xfd000000,
27 .start = SH7780_PCI_MEMORY_BASE, 33 .end = 0xfd000000 + SZ_16M - 1,
28 .end = SH7780_PCI_MEMORY_BASE + SH7780_PCI_MEM_SIZE - 1, 34 .flags = IORESOURCE_MEM,
29 .flags = IORESOURCE_MEM 35 }, {
36 .name = "PCI MEM 1",
37 .start = 0x10000000,
38 .end = 0x10000000 + SZ_64M - 1,
39 .flags = IORESOURCE_MEM,
40 }, {
41 /*
42 * 32-bit only resources must be last.
43 */
44 .name = "PCI MEM 2",
45 .start = 0xc0000000,
46 .end = 0xc0000000 + SZ_512M - 1,
47 .flags = IORESOURCE_MEM | IORESOURCE_MEM_32BIT,
48 },
30}; 49};
31 50
32static struct pci_channel sh7780_pci_controller = { 51static struct pci_channel sh7780_pci_controller = {
33 .pci_ops = &sh4_pci_ops, 52 .pci_ops = &sh4_pci_ops,
34 .mem_resource = &sh7785_mem_resource, 53 .resources = sh7785_pci_resources,
35 .mem_offset = 0x00000000, 54 .nr_resources = ARRAY_SIZE(sh7785_pci_resources),
36 .io_resource = &sh7785_io_resource, 55 .io_offset = 0,
37 .io_offset = 0x00000000, 56 .mem_offset = 0,
38 .io_map_base = SH7780_PCI_IO_BASE, 57 .io_map_base = 0xfe200000,
58 .serr_irq = evt2irq(0xa00),
59 .err_irq = evt2irq(0xaa0),
39}; 60};
40 61
41static struct sh4_pci_address_map sh7780_pci_map = { 62struct pci_errors {
42 .window0 = { 63 unsigned int mask;
43#if defined(CONFIG_32BIT) 64 const char *str;
44 .base = SH7780_32BIT_DDR_BASE_ADDR, 65} pci_arbiter_errors[] = {
45 .size = 0x40000000, 66 { SH4_PCIAINT_MBKN, "master broken" },
46#else 67 { SH4_PCIAINT_TBTO, "target bus time out" },
47 .base = SH7780_CS0_BASE_ADDR, 68 { SH4_PCIAINT_MBTO, "master bus time out" },
48 .size = 0x20000000, 69 { SH4_PCIAINT_TABT, "target abort" },
49#endif 70 { SH4_PCIAINT_MABT, "master abort" },
50 }, 71 { SH4_PCIAINT_RDPE, "read data parity error" },
72 { SH4_PCIAINT_WDPE, "write data parity error" },
73}, pci_interrupt_errors[] = {
74 { SH4_PCIINT_MLCK, "master lock error" },
75 { SH4_PCIINT_TABT, "target-target abort" },
76 { SH4_PCIINT_TRET, "target retry time out" },
77 { SH4_PCIINT_MFDE, "master function disable erorr" },
78 { SH4_PCIINT_PRTY, "address parity error" },
79 { SH4_PCIINT_SERR, "SERR" },
80 { SH4_PCIINT_TWDP, "data parity error for target write" },
81 { SH4_PCIINT_TRDP, "PERR detected for target read" },
82 { SH4_PCIINT_MTABT, "target abort for master" },
83 { SH4_PCIINT_MMABT, "master abort for master" },
84 { SH4_PCIINT_MWPD, "master write data parity error" },
85 { SH4_PCIINT_MRPD, "master read data parity error" },
51}; 86};
52 87
88static irqreturn_t sh7780_pci_err_irq(int irq, void *dev_id)
89{
90 struct pci_channel *hose = dev_id;
91 unsigned long addr;
92 unsigned int status;
93 unsigned int cmd;
94 int i;
95
96 addr = __raw_readl(hose->reg_base + SH4_PCIALR);
97
98 /*
99 * Handle status errors.
100 */
101 status = __raw_readw(hose->reg_base + PCI_STATUS);
102 if (status & (PCI_STATUS_PARITY |
103 PCI_STATUS_DETECTED_PARITY |
104 PCI_STATUS_SIG_TARGET_ABORT |
105 PCI_STATUS_REC_TARGET_ABORT |
106 PCI_STATUS_REC_MASTER_ABORT)) {
107 cmd = pcibios_handle_status_errors(addr, status, hose);
108 if (likely(cmd))
109 __raw_writew(cmd, hose->reg_base + PCI_STATUS);
110 }
111
112 /*
113 * Handle arbiter errors.
114 */
115 status = __raw_readl(hose->reg_base + SH4_PCIAINT);
116 for (i = cmd = 0; i < ARRAY_SIZE(pci_arbiter_errors); i++) {
117 if (status & pci_arbiter_errors[i].mask) {
118 printk(KERN_DEBUG "PCI: %s, addr=%08lx\n",
119 pci_arbiter_errors[i].str, addr);
120 cmd |= pci_arbiter_errors[i].mask;
121 }
122 }
123 __raw_writel(cmd, hose->reg_base + SH4_PCIAINT);
124
125 /*
126 * Handle the remaining PCI errors.
127 */
128 status = __raw_readl(hose->reg_base + SH4_PCIINT);
129 for (i = cmd = 0; i < ARRAY_SIZE(pci_interrupt_errors); i++) {
130 if (status & pci_interrupt_errors[i].mask) {
131 printk(KERN_DEBUG "PCI: %s, addr=%08lx\n",
132 pci_interrupt_errors[i].str, addr);
133 cmd |= pci_interrupt_errors[i].mask;
134 }
135 }
136 __raw_writel(cmd, hose->reg_base + SH4_PCIINT);
137
138 return IRQ_HANDLED;
139}
140
141static irqreturn_t sh7780_pci_serr_irq(int irq, void *dev_id)
142{
143 struct pci_channel *hose = dev_id;
144
145 printk(KERN_DEBUG "PCI: system error received: ");
146 pcibios_report_status(PCI_STATUS_SIG_SYSTEM_ERROR, 1);
147 printk("\n");
148
149 /* Deassert SERR */
150 __raw_writel(SH4_PCIINTM_SDIM, hose->reg_base + SH4_PCIINTM);
151
152 /* Back off the IRQ for awhile */
153 disable_irq_nosync(irq);
154 hose->serr_timer.expires = jiffies + HZ;
155 add_timer(&hose->serr_timer);
156
157 return IRQ_HANDLED;
158}
159
160static int __init sh7780_pci_setup_irqs(struct pci_channel *hose)
161{
162 int ret;
163
164 /* Clear out PCI arbiter IRQs */
165 __raw_writel(0, hose->reg_base + SH4_PCIAINT);
166
167 /* Clear all error conditions */
168 __raw_writew(PCI_STATUS_DETECTED_PARITY | \
169 PCI_STATUS_SIG_SYSTEM_ERROR | \
170 PCI_STATUS_REC_MASTER_ABORT | \
171 PCI_STATUS_REC_TARGET_ABORT | \
172 PCI_STATUS_SIG_TARGET_ABORT | \
173 PCI_STATUS_PARITY, hose->reg_base + PCI_STATUS);
174
175 ret = request_irq(hose->serr_irq, sh7780_pci_serr_irq, IRQF_DISABLED,
176 "PCI SERR interrupt", hose);
177 if (unlikely(ret)) {
178 printk(KERN_ERR "PCI: Failed hooking SERR IRQ\n");
179 return ret;
180 }
181
182 /*
183 * The PCI ERR IRQ needs to be IRQF_SHARED since all of the power
184 * down IRQ vectors are routed through the ERR IRQ vector. We
185 * only request_irq() once as there is only a single masking
186 * source for multiple events.
187 */
188 ret = request_irq(hose->err_irq, sh7780_pci_err_irq, IRQF_SHARED,
189 "PCI ERR interrupt", hose);
190 if (unlikely(ret)) {
191 free_irq(hose->serr_irq, hose);
192 return ret;
193 }
194
195 /* Unmask all of the arbiter IRQs. */
196 __raw_writel(SH4_PCIAINT_MBKN | SH4_PCIAINT_TBTO | SH4_PCIAINT_MBTO | \
197 SH4_PCIAINT_TABT | SH4_PCIAINT_MABT | SH4_PCIAINT_RDPE | \
198 SH4_PCIAINT_WDPE, hose->reg_base + SH4_PCIAINTM);
199
200 /* Unmask all of the PCI IRQs */
201 __raw_writel(SH4_PCIINTM_TTADIM | SH4_PCIINTM_TMTOIM | \
202 SH4_PCIINTM_MDEIM | SH4_PCIINTM_APEDIM | \
203 SH4_PCIINTM_SDIM | SH4_PCIINTM_DPEITWM | \
204 SH4_PCIINTM_PEDITRM | SH4_PCIINTM_TADIMM | \
205 SH4_PCIINTM_MADIMM | SH4_PCIINTM_MWPDIM | \
206 SH4_PCIINTM_MRDPEIM, hose->reg_base + SH4_PCIINTM);
207
208 return ret;
209}
210
211static inline void __init sh7780_pci_teardown_irqs(struct pci_channel *hose)
212{
213 free_irq(hose->err_irq, hose);
214 free_irq(hose->serr_irq, hose);
215}
216
217static void __init sh7780_pci66_init(struct pci_channel *hose)
218{
219 unsigned int tmp;
220
221 if (!pci_is_66mhz_capable(hose, 0, 0))
222 return;
223
224 /* Enable register access */
225 tmp = __raw_readl(hose->reg_base + SH4_PCICR);
226 tmp |= SH4_PCICR_PREFIX;
227 __raw_writel(tmp, hose->reg_base + SH4_PCICR);
228
229 /* Enable 66MHz operation */
230 tmp = __raw_readw(hose->reg_base + PCI_STATUS);
231 tmp |= PCI_STATUS_66MHZ;
232 __raw_writew(tmp, hose->reg_base + PCI_STATUS);
233
234 /* Done */
235 tmp = __raw_readl(hose->reg_base + SH4_PCICR);
236 tmp |= SH4_PCICR_PREFIX | SH4_PCICR_CFIN;
237 __raw_writel(tmp, hose->reg_base + SH4_PCICR);
238}
239
53static int __init sh7780_pci_init(void) 240static int __init sh7780_pci_init(void)
54{ 241{
55 struct pci_channel *chan = &sh7780_pci_controller; 242 struct pci_channel *chan = &sh7780_pci_controller;
243 phys_addr_t memphys;
244 size_t memsize;
56 unsigned int id; 245 unsigned int id;
57 const char *type = NULL; 246 const char *type;
58 int ret; 247 int ret, i;
59 u32 word;
60 248
61 printk(KERN_NOTICE "PCI: Starting intialization.\n"); 249 printk(KERN_NOTICE "PCI: Starting intialization.\n");
62 250
@@ -65,17 +253,28 @@ static int __init sh7780_pci_init(void)
65 /* Enable CPU access to the PCIC registers. */ 253 /* Enable CPU access to the PCIC registers. */
66 __raw_writel(PCIECR_ENBL, PCIECR); 254 __raw_writel(PCIECR_ENBL, PCIECR);
67 255
68 id = __raw_readw(chan->reg_base + SH7780_PCIVID); 256 /* Reset */
69 if (id != SH7780_VENDOR_ID) { 257 __raw_writel(SH4_PCICR_PREFIX | SH4_PCICR_PRST,
258 chan->reg_base + SH4_PCICR);
259
260 /*
261 * Wait for it to come back up. The spec says to allow for up to
262 * 1 second after toggling the reset pin, but in practice 100ms
263 * is more than enough.
264 */
265 mdelay(100);
266
267 id = __raw_readw(chan->reg_base + PCI_VENDOR_ID);
268 if (id != PCI_VENDOR_ID_RENESAS) {
70 printk(KERN_ERR "PCI: Unknown vendor ID 0x%04x.\n", id); 269 printk(KERN_ERR "PCI: Unknown vendor ID 0x%04x.\n", id);
71 return -ENODEV; 270 return -ENODEV;
72 } 271 }
73 272
74 id = __raw_readw(chan->reg_base + SH7780_PCIDID); 273 id = __raw_readw(chan->reg_base + PCI_DEVICE_ID);
75 type = (id == SH7763_DEVICE_ID) ? "SH7763" : 274 type = (id == PCI_DEVICE_ID_RENESAS_SH7763) ? "SH7763" :
76 (id == SH7780_DEVICE_ID) ? "SH7780" : 275 (id == PCI_DEVICE_ID_RENESAS_SH7780) ? "SH7780" :
77 (id == SH7781_DEVICE_ID) ? "SH7781" : 276 (id == PCI_DEVICE_ID_RENESAS_SH7781) ? "SH7781" :
78 (id == SH7785_DEVICE_ID) ? "SH7785" : 277 (id == PCI_DEVICE_ID_RENESAS_SH7785) ? "SH7785" :
79 NULL; 278 NULL;
80 if (unlikely(!type)) { 279 if (unlikely(!type)) {
81 printk(KERN_ERR "PCI: Found an unsupported Renesas host " 280 printk(KERN_ERR "PCI: Found an unsupported Renesas host "
@@ -85,62 +284,119 @@ static int __init sh7780_pci_init(void)
85 284
86 printk(KERN_NOTICE "PCI: Found a Renesas %s host " 285 printk(KERN_NOTICE "PCI: Found a Renesas %s host "
87 "controller, revision %d.\n", type, 286 "controller, revision %d.\n", type,
88 __raw_readb(chan->reg_base + SH7780_PCIRID)); 287 __raw_readb(chan->reg_base + PCI_REVISION_ID));
89 288
90 if ((ret = sh4_pci_check_direct(chan)) != 0) 289 /*
290 * Now throw it in to register initialization mode and
291 * start the real work.
292 */
293 __raw_writel(SH4_PCICR_PREFIX, chan->reg_base + SH4_PCICR);
294
295 memphys = __pa(memory_start);
296 memsize = roundup_pow_of_two(memory_end - memory_start);
297
298 /*
299 * If there's more than 512MB of memory, we need to roll over to
300 * LAR1/LSR1.
301 */
302 if (memsize > SZ_512M) {
303 __raw_writel(memphys + SZ_512M, chan->reg_base + SH4_PCILAR1);
304 __raw_writel((((memsize - SZ_512M) - SZ_1M) & 0x1ff00000) | 1,
305 chan->reg_base + SH4_PCILSR1);
306 memsize = SZ_512M;
307 } else {
308 /*
309 * Otherwise just zero it out and disable it.
310 */
311 __raw_writel(0, chan->reg_base + SH4_PCILAR1);
312 __raw_writel(0, chan->reg_base + SH4_PCILSR1);
313 }
314
315 /*
316 * LAR0/LSR0 covers up to the first 512MB, which is enough to
317 * cover all of lowmem on most platforms.
318 */
319 __raw_writel(memphys, chan->reg_base + SH4_PCILAR0);
320 __raw_writel(((memsize - SZ_1M) & 0x1ff00000) | 1,
321 chan->reg_base + SH4_PCILSR0);
322
323 /*
324 * Hook up the ERR and SERR IRQs.
325 */
326 ret = sh7780_pci_setup_irqs(chan);
327 if (unlikely(ret))
91 return ret; 328 return ret;
92 329
93 /* 330 /*
94 * Set the class and sub-class codes. 331 * Disable the cache snoop controller for non-coherent DMA.
95 */ 332 */
96 __raw_writeb(PCI_CLASS_BRIDGE_HOST >> 8, 333 __raw_writel(0, chan->reg_base + SH7780_PCICSCR0);
97 chan->reg_base + SH7780_PCIBCC); 334 __raw_writel(0, chan->reg_base + SH7780_PCICSAR0);
98 __raw_writeb(PCI_CLASS_BRIDGE_HOST & 0xff, 335 __raw_writel(0, chan->reg_base + SH7780_PCICSCR1);
99 chan->reg_base + SH7780_PCISUB); 336 __raw_writel(0, chan->reg_base + SH7780_PCICSAR1);
100 337
101 /* 338 /*
102 * Set IO and Mem windows to local address 339 * Setup the memory BARs
103 * Make PCI and local address the same for easy 1 to 1 mapping
104 */ 340 */
105 pci_write_reg(chan, sh7780_pci_map.window0.size - 0xfffff, SH4_PCILSR0); 341 for (i = 1; i < chan->nr_resources; i++) {
106 /* Set the values on window 0 PCI config registers */ 342 struct resource *res = chan->resources + i;
107 pci_write_reg(chan, sh7780_pci_map.window0.base, SH4_PCILAR0); 343 resource_size_t size;
108 pci_write_reg(chan, sh7780_pci_map.window0.base, SH7780_PCIMBAR0);
109 344
110 pci_write_reg(chan, 0x0000380f, SH4_PCIAINTM); 345 if (unlikely(res->flags & IORESOURCE_IO))
346 continue;
111 347
112 /* Set up standard PCI config registers */ 348 /*
113 __raw_writew(0xFB00, chan->reg_base + SH7780_PCISTATUS); 349 * Make sure we're in the right physical addressing mode
114 __raw_writew(0x0047, chan->reg_base + SH7780_PCICMD); 350 * for dealing with the resource.
115 __raw_writew(0x1912, chan->reg_base + SH7780_PCISVID); 351 */
116 __raw_writew(0x0001, chan->reg_base + SH7780_PCISID); 352 if ((res->flags & IORESOURCE_MEM_32BIT) && __in_29bit_mode()) {
353 chan->nr_resources--;
354 continue;
355 }
117 356
118 __raw_writeb(0x00, chan->reg_base + SH7780_PCIPIF); 357 size = resource_size(res);
358
359 /*
360 * The MBMR mask is calculated in units of 256kB, which
361 * keeps things pretty simple.
362 */
363 __raw_writel(((roundup_pow_of_two(size) / SZ_256K) - 1) << 18,
364 chan->reg_base + SH7780_PCIMBMR(i - 1));
365 __raw_writel(res->start, chan->reg_base + SH7780_PCIMBR(i - 1));
366 }
119 367
120 /* Apply any last-minute PCIC fixups */ 368 /*
121 pci_fixup_pcic(chan); 369 * And I/O.
370 */
371 __raw_writel(0, chan->reg_base + PCI_BASE_ADDRESS_0);
372 __raw_writel(0, chan->reg_base + SH7780_PCIIOBR);
373 __raw_writel(0, chan->reg_base + SH7780_PCIIOBMR);
122 374
123 pci_write_reg(chan, 0xfd000000, SH7780_PCIMBR0); 375 __raw_writew(PCI_COMMAND_SERR | PCI_COMMAND_WAIT | \
124 pci_write_reg(chan, 0x00fc0000, SH7780_PCIMBMR0); 376 PCI_COMMAND_PARITY | PCI_COMMAND_MASTER | \
377 PCI_COMMAND_MEMORY, chan->reg_base + PCI_COMMAND);
125 378
126#ifdef CONFIG_32BIT 379 /*
127 pci_write_reg(chan, 0xc0000000, SH7780_PCIMBR2); 380 * Initialization mode complete, release the control register and
128 pci_write_reg(chan, 0x20000000 - SH7780_PCI_IO_SIZE, SH7780_PCIMBMR2); 381 * enable round robin mode to stop device overruns/starvation.
129#endif 382 */
383 __raw_writel(SH4_PCICR_PREFIX | SH4_PCICR_CFIN | SH4_PCICR_FTO,
384 chan->reg_base + SH4_PCICR);
130 385
131 /* Set IOBR for windows containing area specified in pci.h */ 386 ret = register_pci_controller(chan);
132 pci_write_reg(chan, chan->io_resource->start & ~(SH7780_PCI_IO_SIZE-1), 387 if (unlikely(ret))
133 SH7780_PCIIOBR); 388 goto err;
134 pci_write_reg(chan, ((SH7780_PCI_IO_SIZE-1) & (7<<18)),
135 SH7780_PCIIOBMR);
136 389
137 /* SH7780 init done, set central function init complete */ 390 sh7780_pci66_init(chan);
138 /* use round robin mode to stop a device starving/overruning */
139 word = SH4_PCICR_PREFIX | SH4_PCICR_CFIN | SH4_PCICR_FTO;
140 pci_write_reg(chan, word, SH4_PCICR);
141 391
142 register_pci_controller(chan); 392 printk(KERN_NOTICE "PCI: Running at %dMHz.\n",
393 (__raw_readw(chan->reg_base + PCI_STATUS) & PCI_STATUS_66MHZ) ?
394 66 : 33);
143 395
144 return 0; 396 return 0;
397
398err:
399 sh7780_pci_teardown_irqs(chan);
400 return ret;
145} 401}
146arch_initcall(sh7780_pci_init); 402arch_initcall(sh7780_pci_init);
diff --git a/arch/sh/drivers/pci/pci-sh7780.h b/arch/sh/drivers/pci/pci-sh7780.h
index 4a52478c97cf..205dcbefe275 100644
--- a/arch/sh/drivers/pci/pci-sh7780.h
+++ b/arch/sh/drivers/pci/pci-sh7780.h
@@ -12,12 +12,11 @@
12#ifndef _PCI_SH7780_H_ 12#ifndef _PCI_SH7780_H_
13#define _PCI_SH7780_H_ 13#define _PCI_SH7780_H_
14 14
15/* Platform Specific Values */ 15#define PCI_VENDOR_ID_RENESAS 0x1912
16#define SH7780_VENDOR_ID 0x1912 16#define PCI_DEVICE_ID_RENESAS_SH7781 0x0001
17#define SH7781_DEVICE_ID 0x0001 17#define PCI_DEVICE_ID_RENESAS_SH7780 0x0002
18#define SH7780_DEVICE_ID 0x0002 18#define PCI_DEVICE_ID_RENESAS_SH7763 0x0004
19#define SH7763_DEVICE_ID 0x0004 19#define PCI_DEVICE_ID_RENESAS_SH7785 0x0007
20#define SH7785_DEVICE_ID 0x0007
21 20
22/* SH7780 Control Registers */ 21/* SH7780 Control Registers */
23#define PCIECR 0xFE000008 22#define PCIECR 0xFE000008
@@ -27,44 +26,9 @@
27#define SH7780_PCI_CONFIG_BASE 0xFD000000 /* Config space base addr */ 26#define SH7780_PCI_CONFIG_BASE 0xFD000000 /* Config space base addr */
28#define SH7780_PCI_CONFIG_SIZE 0x01000000 /* Config space size */ 27#define SH7780_PCI_CONFIG_SIZE 0x01000000 /* Config space size */
29 28
30#define SH7780_PCI_MEMORY_BASE 0xFD000000 /* Memory space base addr */
31#define SH7780_PCI_MEM_SIZE 0x01000000 /* Size of Memory window */
32
33#define SH7780_PCI_IO_BASE 0xFE200000 /* IO space base address */
34#define SH7780_PCI_IO_SIZE 0x00400000 /* Size of IO window */
35
36#define SH7780_PCIREG_BASE 0xFE040000 /* PCI regs base address */ 29#define SH7780_PCIREG_BASE 0xFE040000 /* PCI regs base address */
37 30
38/* SH7780 PCI Config Registers */ 31/* SH7780 PCI Config Registers */
39#define SH7780_PCIVID 0x000 /* Vendor ID */
40#define SH7780_PCIDID 0x002 /* Device ID */
41#define SH7780_PCICMD 0x004 /* Command */
42#define SH7780_PCISTATUS 0x006 /* Status */
43#define SH7780_PCIRID 0x008 /* Revision ID */
44#define SH7780_PCIPIF 0x009 /* Program Interface */
45#define SH7780_PCISUB 0x00a /* Sub class code */
46#define SH7780_PCIBCC 0x00b /* Base class code */
47#define SH7780_PCICLS 0x00c /* Cache line size */
48#define SH7780_PCILTM 0x00d /* latency timer */
49#define SH7780_PCIHDR 0x00e /* Header type */
50#define SH7780_PCIBIST 0x00f /* BIST */
51#define SH7780_PCIIBAR 0x010 /* IO Base address */
52#define SH7780_PCIMBAR0 0x014 /* Memory base address0 */
53#define SH7780_PCIMBAR1 0x018 /* Memory base address1 */
54#define SH7780_PCISVID 0x02c /* Sub system vendor ID */
55#define SH7780_PCISID 0x02e /* Sub system ID */
56#define SH7780_PCICP 0x034
57#define SH7780_PCIINTLINE 0x03c /* Interrupt line */
58#define SH7780_PCIINTPIN 0x03d /* Interrupt pin */
59#define SH7780_PCIMINGNT 0x03e /* Minumum grand */
60#define SH7780_PCIMAXLAT 0x03f /* Maxmum latency */
61#define SH7780_PCICID 0x040
62#define SH7780_PCINIP 0x041
63#define SH7780_PCIPMC 0x042
64#define SH7780_PCIPMCSR 0x044
65#define SH7780_PCIPMCSR_BSE 0x046
66#define SH7780_PCICDD 0x047
67
68#define SH7780_PCIIR 0x114 /* PCI Interrupt Register */ 32#define SH7780_PCIIR 0x114 /* PCI Interrupt Register */
69#define SH7780_PCIIMR 0x118 /* PCI Interrupt Mask Register */ 33#define SH7780_PCIIMR 0x118 /* PCI Interrupt Mask Register */
70#define SH7780_PCIAIR 0x11C /* Error Address Register */ 34#define SH7780_PCIAIR 0x11C /* Error Address Register */
@@ -76,10 +40,8 @@
76#define SH7780_PCIPINT 0x1CC /* Power Mgmnt Int. Register */ 40#define SH7780_PCIPINT 0x1CC /* Power Mgmnt Int. Register */
77#define SH7780_PCIPINTM 0x1D0 /* Power Mgmnt Mask Register */ 41#define SH7780_PCIPINTM 0x1D0 /* Power Mgmnt Mask Register */
78 42
79#define SH7780_PCIMBR0 0x1E0 43#define SH7780_PCIMBR(x) (0x1E0 + ((x) * 8))
80#define SH7780_PCIMBMR0 0x1E4 44#define SH7780_PCIMBMR(x) (0x1E4 + ((x) * 8))
81#define SH7780_PCIMBR2 0x1F0
82#define SH7780_PCIMBMR2 0x1F4
83#define SH7780_PCIIOBR 0x1F8 45#define SH7780_PCIIOBR 0x1F8
84#define SH7780_PCIIOBMR 0x1FC 46#define SH7780_PCIIOBMR 0x1FC
85#define SH7780_PCICSCR0 0x210 /* Cache Snoop1 Cnt. Register */ 47#define SH7780_PCICSCR0 0x210 /* Cache Snoop1 Cnt. Register */
@@ -87,16 +49,4 @@
87#define SH7780_PCICSAR0 0x218 /* Cache Snoop1 Addr. Register */ 49#define SH7780_PCICSAR0 0x218 /* Cache Snoop1 Addr. Register */
88#define SH7780_PCICSAR1 0x21C /* Cache Snoop2 Addr. Register */ 50#define SH7780_PCICSAR1 0x21C /* Cache Snoop2 Addr. Register */
89 51
90/* General Memory Config Addresses */
91#define SH7780_CS0_BASE_ADDR 0x0
92#define SH7780_MEM_REGION_SIZE 0x04000000
93#define SH7780_CS1_BASE_ADDR (SH7780_CS0_BASE_ADDR + SH7780_MEM_REGION_SIZE)
94#define SH7780_CS2_BASE_ADDR (SH7780_CS1_BASE_ADDR + SH7780_MEM_REGION_SIZE)
95#define SH7780_CS3_BASE_ADDR (SH7780_CS2_BASE_ADDR + SH7780_MEM_REGION_SIZE)
96#define SH7780_CS4_BASE_ADDR (SH7780_CS3_BASE_ADDR + SH7780_MEM_REGION_SIZE)
97#define SH7780_CS5_BASE_ADDR (SH7780_CS4_BASE_ADDR + SH7780_MEM_REGION_SIZE)
98#define SH7780_CS6_BASE_ADDR (SH7780_CS5_BASE_ADDR + SH7780_MEM_REGION_SIZE)
99
100#define SH7780_32BIT_DDR_BASE_ADDR 0x40000000
101
102#endif /* _PCI_SH7780_H_ */ 52#endif /* _PCI_SH7780_H_ */
diff --git a/arch/sh/drivers/pci/pci.c b/arch/sh/drivers/pci/pci.c
index c481df639022..953af139e230 100644
--- a/arch/sh/drivers/pci/pci.c
+++ b/arch/sh/drivers/pci/pci.c
@@ -33,15 +33,22 @@ static int pci_initialized;
33static void __devinit pcibios_scanbus(struct pci_channel *hose) 33static void __devinit pcibios_scanbus(struct pci_channel *hose)
34{ 34{
35 static int next_busno; 35 static int next_busno;
36 static int need_domain_info;
36 struct pci_bus *bus; 37 struct pci_bus *bus;
37 38
38 bus = pci_scan_bus(next_busno, hose->pci_ops, hose); 39 bus = pci_scan_bus(next_busno, hose->pci_ops, hose);
40 hose->bus = bus;
41
42 need_domain_info = need_domain_info || hose->index;
43 hose->need_domain_info = need_domain_info;
39 if (bus) { 44 if (bus) {
40 next_busno = bus->subordinate + 1; 45 next_busno = bus->subordinate + 1;
41 /* Don't allow 8-bit bus number overflow inside the hose - 46 /* Don't allow 8-bit bus number overflow inside the hose -
42 reserve some space for bridges. */ 47 reserve some space for bridges. */
43 if (next_busno > 224) 48 if (next_busno > 224) {
44 next_busno = 0; 49 next_busno = 0;
50 need_domain_info = 1;
51 }
45 52
46 pci_bus_size_bridges(bus); 53 pci_bus_size_bridges(bus);
47 pci_bus_assign_resources(bus); 54 pci_bus_assign_resources(bus);
@@ -51,10 +58,21 @@ static void __devinit pcibios_scanbus(struct pci_channel *hose)
51 58
52static DEFINE_MUTEX(pci_scan_mutex); 59static DEFINE_MUTEX(pci_scan_mutex);
53 60
54void __devinit register_pci_controller(struct pci_channel *hose) 61int __devinit register_pci_controller(struct pci_channel *hose)
55{ 62{
56 request_resource(&iomem_resource, hose->mem_resource); 63 int i;
57 request_resource(&ioport_resource, hose->io_resource); 64
65 for (i = 0; i < hose->nr_resources; i++) {
66 struct resource *res = hose->resources + i;
67
68 if (res->flags & IORESOURCE_IO) {
69 if (request_resource(&ioport_resource, res) < 0)
70 goto out;
71 } else {
72 if (request_resource(&iomem_resource, res) < 0)
73 goto out;
74 }
75 }
58 76
59 *hose_tail = hose; 77 *hose_tail = hose;
60 hose_tail = &hose->next; 78 hose_tail = &hose->next;
@@ -68,6 +86,11 @@ void __devinit register_pci_controller(struct pci_channel *hose)
68 } 86 }
69 87
70 /* 88 /*
89 * Setup the ERR/PERR and SERR timers, if available.
90 */
91 pcibios_enable_timers(hose);
92
93 /*
71 * Scan the bus if it is register after the PCI subsystem 94 * Scan the bus if it is register after the PCI subsystem
72 * initialization. 95 * initialization.
73 */ 96 */
@@ -76,6 +99,15 @@ void __devinit register_pci_controller(struct pci_channel *hose)
76 pcibios_scanbus(hose); 99 pcibios_scanbus(hose);
77 mutex_unlock(&pci_scan_mutex); 100 mutex_unlock(&pci_scan_mutex);
78 } 101 }
102
103 return 0;
104
105out:
106 for (--i; i >= 0; i--)
107 release_resource(&hose->resources[i]);
108
109 printk(KERN_WARNING "Skipping PCI bus scan due to resource conflict\n");
110 return -1;
79} 111}
80 112
81static int __init pcibios_init(void) 113static int __init pcibios_init(void)
@@ -127,11 +159,13 @@ void __devinit pcibios_fixup_bus(struct pci_bus *bus)
127{ 159{
128 struct pci_dev *dev = bus->self; 160 struct pci_dev *dev = bus->self;
129 struct list_head *ln; 161 struct list_head *ln;
130 struct pci_channel *chan = bus->sysdata; 162 struct pci_channel *hose = bus->sysdata;
131 163
132 if (!dev) { 164 if (!dev) {
133 bus->resource[0] = chan->io_resource; 165 int i;
134 bus->resource[1] = chan->mem_resource; 166
167 for (i = 0; i < hose->nr_resources; i++)
168 bus->resource[i] = hose->resources + i;
135 } 169 }
136 170
137 for (ln = bus->devices.next; ln != &bus->devices; ln = ln->next) { 171 for (ln = bus->devices.next; ln != &bus->devices; ln = ln->next) {
@@ -148,34 +182,29 @@ void __devinit pcibios_fixup_bus(struct pci_bus *bus)
148 * addresses to be allocated in the 0x000-0x0ff region 182 * addresses to be allocated in the 0x000-0x0ff region
149 * modulo 0x400. 183 * modulo 0x400.
150 */ 184 */
151void pcibios_align_resource(void *data, struct resource *res, 185resource_size_t pcibios_align_resource(void *data, const struct resource *res,
152 resource_size_t size, resource_size_t align) 186 resource_size_t size, resource_size_t align)
153{ 187{
154 struct pci_dev *dev = data; 188 struct pci_dev *dev = data;
155 struct pci_channel *chan = dev->sysdata; 189 struct pci_channel *hose = dev->sysdata;
156 resource_size_t start = res->start; 190 resource_size_t start = res->start;
157 191
158 if (res->flags & IORESOURCE_IO) { 192 if (res->flags & IORESOURCE_IO) {
159 if (start < PCIBIOS_MIN_IO + chan->io_resource->start) 193 if (start < PCIBIOS_MIN_IO + hose->resources[0].start)
160 start = PCIBIOS_MIN_IO + chan->io_resource->start; 194 start = PCIBIOS_MIN_IO + hose->resources[0].start;
161 195
162 /* 196 /*
163 * Put everything into 0x00-0xff region modulo 0x400. 197 * Put everything into 0x00-0xff region modulo 0x400.
164 */ 198 */
165 if (start & 0x300) { 199 if (start & 0x300)
166 start = (start + 0x3ff) & ~0x3ff; 200 start = (start + 0x3ff) & ~0x3ff;
167 res->start = start;
168 }
169 } else if (res->flags & IORESOURCE_MEM) {
170 if (start < PCIBIOS_MIN_MEM + chan->mem_resource->start)
171 start = PCIBIOS_MIN_MEM + chan->mem_resource->start;
172 } 201 }
173 202
174 res->start = start; 203 return start;
175} 204}
176 205
177void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, 206void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
178 struct resource *res) 207 struct resource *res)
179{ 208{
180 struct pci_channel *hose = dev->sysdata; 209 struct pci_channel *hose = dev->sysdata;
181 unsigned long offset = 0; 210 unsigned long offset = 0;
@@ -189,9 +218,8 @@ void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
189 region->end = res->end - offset; 218 region->end = res->end - offset;
190} 219}
191 220
192void __devinit 221void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
193pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, 222 struct pci_bus_region *region)
194 struct pci_bus_region *region)
195{ 223{
196 struct pci_channel *hose = dev->sysdata; 224 struct pci_channel *hose = dev->sysdata;
197 unsigned long offset = 0; 225 unsigned long offset = 0;
@@ -274,6 +302,86 @@ char * __devinit pcibios_setup(char *str)
274 return str; 302 return str;
275} 303}
276 304
305static void __init
306pcibios_bus_report_status_early(struct pci_channel *hose,
307 int top_bus, int current_bus,
308 unsigned int status_mask, int warn)
309{
310 unsigned int pci_devfn;
311 u16 status;
312 int ret;
313
314 for (pci_devfn = 0; pci_devfn < 0xff; pci_devfn++) {
315 if (PCI_FUNC(pci_devfn))
316 continue;
317 ret = early_read_config_word(hose, top_bus, current_bus,
318 pci_devfn, PCI_STATUS, &status);
319 if (ret != PCIBIOS_SUCCESSFUL)
320 continue;
321 if (status == 0xffff)
322 continue;
323
324 early_write_config_word(hose, top_bus, current_bus,
325 pci_devfn, PCI_STATUS,
326 status & status_mask);
327 if (warn)
328 printk("(%02x:%02x: %04X) ", current_bus,
329 pci_devfn, status);
330 }
331}
332
333/*
334 * We can't use pci_find_device() here since we are
335 * called from interrupt context.
336 */
337static void __init_refok
338pcibios_bus_report_status(struct pci_bus *bus, unsigned int status_mask,
339 int warn)
340{
341 struct pci_dev *dev;
342
343 list_for_each_entry(dev, &bus->devices, bus_list) {
344 u16 status;
345
346 /*
347 * ignore host bridge - we handle
348 * that separately
349 */
350 if (dev->bus->number == 0 && dev->devfn == 0)
351 continue;
352
353 pci_read_config_word(dev, PCI_STATUS, &status);
354 if (status == 0xffff)
355 continue;
356
357 if ((status & status_mask) == 0)
358 continue;
359
360 /* clear the status errors */
361 pci_write_config_word(dev, PCI_STATUS, status & status_mask);
362
363 if (warn)
364 printk("(%s: %04X) ", pci_name(dev), status);
365 }
366
367 list_for_each_entry(dev, &bus->devices, bus_list)
368 if (dev->subordinate)
369 pcibios_bus_report_status(dev->subordinate, status_mask, warn);
370}
371
372void __init_refok pcibios_report_status(unsigned int status_mask, int warn)
373{
374 struct pci_channel *hose;
375
376 for (hose = hose_head; hose; hose = hose->next) {
377 if (unlikely(!hose->bus))
378 pcibios_bus_report_status_early(hose, hose_head->index,
379 hose->index, status_mask, warn);
380 else
381 pcibios_bus_report_status(hose->bus, status_mask, warn);
382 }
383}
384
277int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, 385int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
278 enum pci_mmap_state mmap_state, int write_combine) 386 enum pci_mmap_state mmap_state, int write_combine)
279{ 387{
@@ -302,9 +410,15 @@ static void __iomem *ioport_map_pci(struct pci_dev *dev,
302{ 410{
303 struct pci_channel *chan = dev->sysdata; 411 struct pci_channel *chan = dev->sysdata;
304 412
305 if (!chan->io_map_base) 413 if (unlikely(!chan->io_map_base)) {
306 chan->io_map_base = generic_io_base; 414 chan->io_map_base = generic_io_base;
307 415
416 if (pci_domains_supported)
417 panic("To avoid data corruption io_map_base MUST be "
418 "set with multiple PCI domains.");
419 }
420
421
308 return (void __iomem *)(chan->io_map_base + port); 422 return (void __iomem *)(chan->io_map_base + port);
309} 423}
310 424
@@ -321,20 +435,9 @@ void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen)
321 435
322 if (flags & IORESOURCE_IO) 436 if (flags & IORESOURCE_IO)
323 return ioport_map_pci(dev, start, len); 437 return ioport_map_pci(dev, start, len);
324
325 /*
326 * Presently the IORESOURCE_MEM case is a bit special, most
327 * SH7751 style PCI controllers have PCI memory at a fixed
328 * location in the address space where no remapping is desired.
329 * With the IORESOURCE_MEM case more care has to be taken
330 * to inhibit page table mapping for legacy cores, but this is
331 * punted off to __ioremap().
332 * -- PFM.
333 */
334 if (flags & IORESOURCE_MEM) { 438 if (flags & IORESOURCE_MEM) {
335 if (flags & IORESOURCE_CACHEABLE) 439 if (flags & IORESOURCE_CACHEABLE)
336 return ioremap(start, len); 440 return ioremap(start, len);
337
338 return ioremap_nocache(start, len); 441 return ioremap_nocache(start, len);
339 } 442 }
340 443
diff --git a/arch/sh/drivers/pci/pcie-sh7786.c b/arch/sh/drivers/pci/pcie-sh7786.c
index ac37ee879bab..ae91a2dd9183 100644
--- a/arch/sh/drivers/pci/pcie-sh7786.c
+++ b/arch/sh/drivers/pci/pcie-sh7786.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Low-Level PCI Express Support for the SH7786 2 * Low-Level PCI Express Support for the SH7786
3 * 3 *
4 * Copyright (C) 2009 Paul Mundt 4 * Copyright (C) 2009 - 2010 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
@@ -30,60 +30,84 @@ static struct sh7786_pcie_hwops {
30 int (*port_init_hw)(struct sh7786_pcie_port *port); 30 int (*port_init_hw)(struct sh7786_pcie_port *port);
31} *sh7786_pcie_hwops; 31} *sh7786_pcie_hwops;
32 32
33static struct resource sh7786_pci_32bit_mem_resources[] = { 33static struct resource sh7786_pci0_resources[] = {
34 { 34 {
35 .name = "pci0_mem", 35 .name = "PCIe0 IO",
36 .start = SH4A_PCIMEM_BASEA, 36 .start = 0xfd000000,
37 .end = SH4A_PCIMEM_BASEA + SZ_64M - 1, 37 .end = 0xfd000000 + SZ_8M - 1,
38 .flags = IORESOURCE_MEM, 38 .flags = IORESOURCE_IO,
39 }, { 39 }, {
40 .name = "pci1_mem", 40 .name = "PCIe0 MEM 0",
41 .start = SH4A_PCIMEM_BASEA1, 41 .start = 0xc0000000,
42 .end = SH4A_PCIMEM_BASEA1 + SZ_64M - 1, 42 .end = 0xc0000000 + SZ_512M - 1,
43 .flags = IORESOURCE_MEM, 43 .flags = IORESOURCE_MEM | IORESOURCE_MEM_32BIT,
44 }, { 44 }, {
45 .name = "pci2_mem", 45 .name = "PCIe0 MEM 1",
46 .start = SH4A_PCIMEM_BASEA2, 46 .start = 0x10000000,
47 .end = SH4A_PCIMEM_BASEA2 + SZ_64M - 1, 47 .end = 0x10000000 + SZ_64M - 1,
48 .flags = IORESOURCE_MEM, 48 .flags = IORESOURCE_MEM,
49 }, {
50 .name = "PCIe0 MEM 2",
51 .start = 0xfe100000,
52 .end = 0xfe100000 + SZ_1M - 1,
49 }, 53 },
50}; 54};
51 55
52static struct resource sh7786_pci_29bit_mem_resource = { 56static struct resource sh7786_pci1_resources[] = {
53 .start = SH4A_PCIMEM_BASE, 57 {
54 .end = SH4A_PCIMEM_BASE + SZ_64M - 1, 58 .name = "PCIe1 IO",
55 .flags = IORESOURCE_MEM, 59 .start = 0xfd800000,
60 .end = 0xfd800000 + SZ_8M - 1,
61 .flags = IORESOURCE_IO,
62 }, {
63 .name = "PCIe1 MEM 0",
64 .start = 0xa0000000,
65 .end = 0xa0000000 + SZ_512M - 1,
66 .flags = IORESOURCE_MEM | IORESOURCE_MEM_32BIT,
67 }, {
68 .name = "PCIe1 MEM 1",
69 .start = 0x30000000,
70 .end = 0x30000000 + SZ_256M - 1,
71 .flags = IORESOURCE_MEM | IORESOURCE_MEM_32BIT,
72 }, {
73 .name = "PCIe1 MEM 2",
74 .start = 0xfe300000,
75 .end = 0xfe300000 + SZ_1M - 1,
76 },
56}; 77};
57 78
58static struct resource sh7786_pci_io_resources[] = { 79static struct resource sh7786_pci2_resources[] = {
59 { 80 {
60 .name = "pci0_io", 81 .name = "PCIe2 IO",
61 .start = SH4A_PCIIO_BASE, 82 .start = 0xfc800000,
62 .end = SH4A_PCIIO_BASE + SZ_8M - 1, 83 .end = 0xfc800000 + SZ_4M - 1,
63 .flags = IORESOURCE_IO,
64 }, { 84 }, {
65 .name = "pci1_io", 85 .name = "PCIe2 MEM 0",
66 .start = SH4A_PCIIO_BASE1, 86 .start = 0x80000000,
67 .end = SH4A_PCIIO_BASE1 + SZ_8M - 1, 87 .end = 0x80000000 + SZ_512M - 1,
68 .flags = IORESOURCE_IO, 88 .flags = IORESOURCE_MEM | IORESOURCE_MEM_32BIT,
69 }, { 89 }, {
70 .name = "pci2_io", 90 .name = "PCIe2 MEM 1",
71 .start = SH4A_PCIIO_BASE2, 91 .start = 0x20000000,
72 .end = SH4A_PCIIO_BASE2 + SZ_4M - 1, 92 .end = 0x20000000 + SZ_256M - 1,
73 .flags = IORESOURCE_IO, 93 .flags = IORESOURCE_MEM | IORESOURCE_MEM_32BIT,
94 }, {
95 .name = "PCIe2 MEM 2",
96 .start = 0xfcd00000,
97 .end = 0xfcd00000 + SZ_1M - 1,
74 }, 98 },
75}; 99};
76 100
77extern struct pci_ops sh7786_pci_ops; 101extern struct pci_ops sh7786_pci_ops;
78 102
79#define DEFINE_CONTROLLER(start, idx) \ 103#define DEFINE_CONTROLLER(start, idx) \
80{ \ 104{ \
81 .pci_ops = &sh7786_pci_ops, \ 105 .pci_ops = &sh7786_pci_ops, \
82 .reg_base = start, \ 106 .resources = sh7786_pci##idx##_resources, \
83 /* mem_resource filled in at probe time */ \ 107 .nr_resources = ARRAY_SIZE(sh7786_pci##idx##_resources), \
84 .mem_offset = 0, \ 108 .reg_base = start, \
85 .io_resource = &sh7786_pci_io_resources[idx], \ 109 .mem_offset = 0, \
86 .io_offset = 0, \ 110 .io_offset = 0, \
87} 111}
88 112
89static struct pci_channel sh7786_pci_channels[] = { 113static struct pci_channel sh7786_pci_channels[] = {
@@ -180,7 +204,9 @@ static int pcie_init(struct sh7786_pcie_port *port)
180{ 204{
181 struct pci_channel *chan = port->hose; 205 struct pci_channel *chan = port->hose;
182 unsigned int data; 206 unsigned int data;
183 int ret; 207 phys_addr_t memphys;
208 size_t memsize;
209 int ret, i;
184 210
185 /* Begin initialization */ 211 /* Begin initialization */
186 pci_write_reg(chan, 0, SH4A_PCIETCTLR); 212 pci_write_reg(chan, 0, SH4A_PCIETCTLR);
@@ -203,15 +229,24 @@ static int pcie_init(struct sh7786_pcie_port *port)
203 data |= PCI_CAP_ID_EXP; 229 data |= PCI_CAP_ID_EXP;
204 pci_write_reg(chan, data, SH4A_PCIEEXPCAP0); 230 pci_write_reg(chan, data, SH4A_PCIEEXPCAP0);
205 231
206 /* Enable x4 link width and extended sync. */ 232 /* Enable data link layer active state reporting */
233 pci_write_reg(chan, PCI_EXP_LNKCAP_DLLLARC, SH4A_PCIEEXPCAP3);
234
235 /* Enable extended sync and ASPM L0s support */
207 data = pci_read_reg(chan, SH4A_PCIEEXPCAP4); 236 data = pci_read_reg(chan, SH4A_PCIEEXPCAP4);
208 data &= ~(PCI_EXP_LNKSTA_NLW << 16); 237 data &= ~PCI_EXP_LNKCTL_ASPMC;
209 data |= (1 << 22) | PCI_EXP_LNKCTL_ES; 238 data |= PCI_EXP_LNKCTL_ES | 1;
210 pci_write_reg(chan, data, SH4A_PCIEEXPCAP4); 239 pci_write_reg(chan, data, SH4A_PCIEEXPCAP4);
211 240
241 /* Write out the physical slot number */
242 data = pci_read_reg(chan, SH4A_PCIEEXPCAP5);
243 data &= ~PCI_EXP_SLTCAP_PSN;
244 data |= (port->index + 1) << 19;
245 pci_write_reg(chan, data, SH4A_PCIEEXPCAP5);
246
212 /* Set the completion timer timeout to the maximum 32ms. */ 247 /* Set the completion timer timeout to the maximum 32ms. */
213 data = pci_read_reg(chan, SH4A_PCIETLCTLR); 248 data = pci_read_reg(chan, SH4A_PCIETLCTLR);
214 data &= ~0xffff; 249 data &= ~0x3f00;
215 data |= 0x32 << 8; 250 data |= 0x32 << 8;
216 pci_write_reg(chan, data, SH4A_PCIETLCTLR); 251 pci_write_reg(chan, data, SH4A_PCIETLCTLR);
217 252
@@ -224,6 +259,33 @@ static int pcie_init(struct sh7786_pcie_port *port)
224 data |= (0xff << 16); 259 data |= (0xff << 16);
225 pci_write_reg(chan, data, SH4A_PCIEMACCTLR); 260 pci_write_reg(chan, data, SH4A_PCIEMACCTLR);
226 261
262 memphys = __pa(memory_start);
263 memsize = roundup_pow_of_two(memory_end - memory_start);
264
265 /*
266 * If there's more than 512MB of memory, we need to roll over to
267 * LAR1/LAMR1.
268 */
269 if (memsize > SZ_512M) {
270 __raw_writel(memphys + SZ_512M, chan->reg_base + SH4A_PCIELAR1);
271 __raw_writel(((memsize - SZ_512M) - SZ_256) | 1,
272 chan->reg_base + SH4A_PCIELAMR1);
273 memsize = SZ_512M;
274 } else {
275 /*
276 * Otherwise just zero it out and disable it.
277 */
278 __raw_writel(0, chan->reg_base + SH4A_PCIELAR1);
279 __raw_writel(0, chan->reg_base + SH4A_PCIELAMR1);
280 }
281
282 /*
283 * LAR0/LAMR0 covers up to the first 512MB, which is enough to
284 * cover all of lowmem on most platforms.
285 */
286 __raw_writel(memphys, chan->reg_base + SH4A_PCIELAR0);
287 __raw_writel((memsize - SZ_256) | 1, chan->reg_base + SH4A_PCIELAMR0);
288
227 /* Finish initialization */ 289 /* Finish initialization */
228 data = pci_read_reg(chan, SH4A_PCIETCTLR); 290 data = pci_read_reg(chan, SH4A_PCIETCTLR);
229 data |= 0x1; 291 data |= 0x1;
@@ -243,10 +305,14 @@ static int pcie_init(struct sh7786_pcie_port *port)
243 if (unlikely(ret != 0)) 305 if (unlikely(ret != 0))
244 return -ENODEV; 306 return -ENODEV;
245 307
246 pci_write_reg(chan, 0x00100007, SH4A_PCIEPCICONF1); 308 data = pci_read_reg(chan, SH4A_PCIEPCICONF1);
309 data &= ~(PCI_STATUS_DEVSEL_MASK << 16);
310 data |= PCI_COMMAND_IO | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER |
311 (PCI_STATUS_CAP_LIST | PCI_STATUS_DEVSEL_FAST) << 16;
312 pci_write_reg(chan, data, SH4A_PCIEPCICONF1);
313
247 pci_write_reg(chan, 0x80888000, SH4A_PCIETXVC0DCTLR); 314 pci_write_reg(chan, 0x80888000, SH4A_PCIETXVC0DCTLR);
248 pci_write_reg(chan, 0x00222000, SH4A_PCIERXVC0DCTLR); 315 pci_write_reg(chan, 0x00222000, SH4A_PCIERXVC0DCTLR);
249 pci_write_reg(chan, 0x000050A0, SH4A_PCIEEXPCAP2);
250 316
251 wmb(); 317 wmb();
252 318
@@ -254,15 +320,32 @@ static int pcie_init(struct sh7786_pcie_port *port)
254 printk(KERN_NOTICE "PCI: PCIe#%d link width %d\n", 320 printk(KERN_NOTICE "PCI: PCIe#%d link width %d\n",
255 port->index, (data >> 20) & 0x3f); 321 port->index, (data >> 20) & 0x3f);
256 322
257 pci_write_reg(chan, 0x007c0000, SH4A_PCIEPAMR0);
258 pci_write_reg(chan, 0x00000000, SH4A_PCIEPARH0);
259 pci_write_reg(chan, 0x00000000, SH4A_PCIEPARL0);
260 pci_write_reg(chan, 0x80000100, SH4A_PCIEPTCTLR0);
261 323
262 pci_write_reg(chan, 0x03fc0000, SH4A_PCIEPAMR2); 324 for (i = 0; i < chan->nr_resources; i++) {
263 pci_write_reg(chan, 0x00000000, SH4A_PCIEPARH2); 325 struct resource *res = chan->resources + i;
264 pci_write_reg(chan, 0x00000000, SH4A_PCIEPARL2); 326 resource_size_t size;
265 pci_write_reg(chan, 0x80000000, SH4A_PCIEPTCTLR2); 327 u32 enable_mask;
328
329 pci_write_reg(chan, 0x00000000, SH4A_PCIEPTCTLR(i));
330
331 size = resource_size(res);
332
333 /*
334 * The PAMR mask is calculated in units of 256kB, which
335 * keeps things pretty simple.
336 */
337 __raw_writel(((roundup_pow_of_two(size) / SZ_256K) - 1) << 18,
338 chan->reg_base + SH4A_PCIEPAMR(i));
339
340 pci_write_reg(chan, 0x00000000, SH4A_PCIEPARH(i));
341 pci_write_reg(chan, 0x00000000, SH4A_PCIEPARL(i));
342
343 enable_mask = MASK_PARE;
344 if (res->flags & IORESOURCE_IO)
345 enable_mask |= MASK_SPC;
346
347 pci_write_reg(chan, enable_mask, SH4A_PCIEPTCTLR(i));
348 }
266 349
267 return 0; 350 return 0;
268} 351}
@@ -296,9 +379,7 @@ static int __devinit sh7786_pcie_init_hw(struct sh7786_pcie_port *port)
296 if (unlikely(ret < 0)) 379 if (unlikely(ret < 0))
297 return ret; 380 return ret;
298 381
299 register_pci_controller(port->hose); 382 return register_pci_controller(port->hose);
300
301 return 0;
302} 383}
303 384
304static struct sh7786_pcie_hwops sh7786_65nm_pcie_hwops __initdata = { 385static struct sh7786_pcie_hwops sh7786_65nm_pcie_hwops __initdata = {
@@ -332,17 +413,7 @@ static int __init sh7786_pcie_init(void)
332 413
333 port->index = i; 414 port->index = i;
334 port->hose = sh7786_pci_channels + i; 415 port->hose = sh7786_pci_channels + i;
335 port->hose->io_map_base = port->hose->io_resource->start; 416 port->hose->io_map_base = port->hose->resources[0].start;
336
337 /*
338 * Check if we are booting in 29 or 32-bit mode
339 *
340 * 32-bit mode provides each controller with its own
341 * memory window, while 29-bit mode uses a shared one.
342 */
343 port->hose->mem_resource = test_mode_pin(MODE_PIN10) ?
344 &sh7786_pci_32bit_mem_resources[i] :
345 &sh7786_pci_29bit_mem_resource;
346 417
347 ret |= sh7786_pcie_hwops->port_init_hw(port); 418 ret |= sh7786_pcie_hwops->port_init_hw(port);
348 } 419 }
diff --git a/arch/sh/drivers/pci/pcie-sh7786.h b/arch/sh/drivers/pci/pcie-sh7786.h
index c655290a7750..90a6992576b0 100644
--- a/arch/sh/drivers/pci/pcie-sh7786.h
+++ b/arch/sh/drivers/pci/pcie-sh7786.h
@@ -30,47 +30,9 @@
30 * for other(Max Payload Size=4096B,PCIIO_SIZE=8M) 30 * for other(Max Payload Size=4096B,PCIIO_SIZE=8M)
31 */ 31 */
32 32
33/* PCI0-0: PCI I/O space */
34#define SH4A_PCIIO_BASE 0xFD000000 /* PCI I/O for controller 0 */
35#define SH4A_PCIIO_BASE1 0xFD800000 /* PCI I/O for controller 1 (Rev1.14)*/
36#define SH4A_PCIIO_BASE2 0xFC800000 /* PCI I/O for controller 2 (Rev1.171)*/
37
38#define SH4A_PCIIO_SIZE64 0x00010000 /* PLX allows only 64K */
39#define SH4A_PCIIO_SIZE 0x00800000 /* 8M */
40#define SH4A_PCIIO_SIZE2 0x00400000 /* 4M (Rev1.171)*/
41
42/* PCI0-1: PCI memory space 29-bit address */
43#define SH4A_PCIMEM_BASE 0x10000000
44#define SH4A_PCIMEM_SIZE 0x04000000 /* 64M */
45
46/* PCI0-2: PCI memory space 32-bit address */
47#define SH4A_PCIMEM_BASEA 0xC0000000 /* for controller 0 */
48#define SH4A_PCIMEM_BASEA1 0xA0000000 /* for controller 1 (Rev1.14)*/
49#define SH4A_PCIMEM_BASEA2 0x80000000 /* for controller 2 (Rev1.171)*/
50#define SH4A_PCIMEM_SIZEA 0x20000000 /* 512M */
51
52/* PCI0: PCI memory target transfer 32-bit address translation value(Rev1.11T)*/ 33/* PCI0: PCI memory target transfer 32-bit address translation value(Rev1.11T)*/
53#define SH4A_PCIBMSTR_TRANSLATION 0x20000000 34#define SH4A_PCIBMSTR_TRANSLATION 0x20000000
54 35
55#define SH4A_PCI_DEVICE_ID 0x0002
56#define SH4A_PCI_VENDOR_ID 0x1912
57
58// PCI compatible 000-03f
59#define PCI_CMD 0x004
60#define PCI_RID 0x008
61#define PCI_IBAR 0x010
62#define PCI_MBAR0 0x014
63#define PCI_MBAR1 0x018
64
65/* PCI power management/MSI/capablity 040-0ff */
66/* PCIE extended 100-fff */
67
68/* SH7786 device identification */ // Rev1.171
69#define SH4A_PVR (0xFF000030)
70#define SH4A_PVR_SHX3 (0x10400000)
71#define SH4A_PRR (0xFF000044)
72#define SH4A_PRR_SH7786 (0x00000400) // Rev1.171
73
74/* SPVCR0 */ 36/* SPVCR0 */
75#define SH4A_PCIEVCR0 (0x000000) /* R - 0x0000 0000 32 */ 37#define SH4A_PCIEVCR0 (0x000000) /* R - 0x0000 0000 32 */
76#define BITS_TOP_MB (24) 38#define BITS_TOP_MB (24)
@@ -350,23 +312,23 @@
350#define SH4A_PCIECSAR5 (0x0202B4) /* R/W R/W 0x0000 0000 32 */ 312#define SH4A_PCIECSAR5 (0x0202B4) /* R/W R/W 0x0000 0000 32 */
351#define SH4A_PCIESTCTLR5 (0x0202B8) /* R/W R/W 0x0000 0000 32 */ 313#define SH4A_PCIESTCTLR5 (0x0202B8) /* R/W R/W 0x0000 0000 32 */
352 314
353/* PCIEPARL0 */ 315/* PCIEPARL */
354#define SH4A_PCIEPARL0 (0x020400) /* R/W R/W 0x0000 0000 32 */ 316#define SH4A_PCIEPARL(x) (0x020400 + ((x) * 0x20)) /* R/W R/W 0x0000 0000 32 */
355#define BITS_PAL (18) 317#define BITS_PAL (18)
356#define MASK_PAL (0x3fff<<BITS_PAL) 318#define MASK_PAL (0x3fff<<BITS_PAL)
357 319
358/* PCIEPARH0 */ 320/* PCIEPARH */
359#define SH4A_PCIEPARH0 (0x020404) /* R/W R/W 0x0000 0000 32 */ 321#define SH4A_PCIEPARH(x) (0x020404 + ((x) * 0x20)) /* R/W R/W 0x0000 0000 32 */
360#define BITS_PAH (0) 322#define BITS_PAH (0)
361#define MASK_PAH (0xffffffff<<BITS_PAH) 323#define MASK_PAH (0xffffffff<<BITS_PAH)
362 324
363/* PCIEPAMR0 */ 325/* PCIEPAMR */
364#define SH4A_PCIEPAMR0 (0x020408) /* R/W R/W 0x0000 0000 32 */ 326#define SH4A_PCIEPAMR(x) (0x020408 + ((x) * 0x20)) /* R/W R/W 0x0000 0000 32 */
365#define BITS_PAM (18) 327#define BITS_PAM (18)
366#define MASK_PAM (0x3fff<<BITS_PAM) 328#define MASK_PAM (0x3fff<<BITS_PAM)
367 329
368/* PCIEPTCTLR0 */ 330/* PCIEPTCTLR */
369#define SH4A_PCIEPTCTLR0 (0x02040C) /* R/W R/W 0x0000 0000 32 */ 331#define SH4A_PCIEPTCTLR(x) (0x02040C + ((x) * 0x20))
370#define BITS_PARE (31) 332#define BITS_PARE (31)
371#define MASK_PARE (0x1<<BITS_PARE) 333#define MASK_PARE (0x1<<BITS_PARE)
372#define BITS_TC (20) 334#define BITS_TC (20)
@@ -378,26 +340,6 @@
378#define BITS_SPC (8) 340#define BITS_SPC (8)
379#define MASK_SPC (0x1<<BITS_SPC) 341#define MASK_SPC (0x1<<BITS_SPC)
380 342
381#define SH4A_PCIEPARL1 (0x020420) /* R/W R/W 0x0000 0000 32 */
382#define SH4A_PCIEPARH1 (0x020424) /* R/W R/W 0x0000 0000 32 */
383#define SH4A_PCIEPAMR1 (0x020428) /* R/W R/W 0x0000 0000 32 */
384#define SH4A_PCIEPTCTLR1 (0x02042C) /* R/W R/W 0x0000 0000 32 */
385#define SH4A_PCIEPARL2 (0x020440) /* R/W R/W 0x0000 0000 32 */
386#define SH4A_PCIEPARH2 (0x020444) /* R/W R/W 0x0000 0000 32 */
387#define SH4A_PCIEPAMR2 (0x020448) /* R/W R/W 0x0000 0000 32 */
388#define SH4A_PCIEPTCTLR2 (0x02044C) /* R/W R/W 0x0000 0000 32 */
389#define SH4A_PCIEPARL3 (0x020460) /* R/W R/W 0x0000 0000 32 */
390#define SH4A_PCIEPARH3 (0x020464) /* R/W R/W 0x0000 0000 32 */
391#define SH4A_PCIEPAMR3 (0x020468) /* R/W R/W 0x0000 0000 32 */
392#define SH4A_PCIEPTCTLR3 (0x02046C) /* R/W R/W 0x0000 0000 32 */
393#define SH4A_PCIEPARL4 (0x020480) /* R/W R/W 0x0000 0000 32 */
394#define SH4A_PCIEPARH4 (0x020484) /* R/W R/W 0x0000 0000 32 */
395#define SH4A_PCIEPAMR4 (0x020488) /* R/W R/W 0x0000 0000 32 */
396#define SH4A_PCIEPTCTLR4 (0x02048C) /* R/W R/W 0x0000 0000 32 */
397#define SH4A_PCIEPARL5 (0x0204A0) /* R/W R/W 0x0000 0000 32 */
398#define SH4A_PCIEPARH5 (0x0204A4) /* R/W R/W 0x0000 0000 32 */
399#define SH4A_PCIEPAMR5 (0x0204A8) /* R/W R/W 0x0000 0000 32 */
400#define SH4A_PCIEPTCTLR5 (0x0204AC) /* R/W R/W 0x0000 0000 32 */
401#define SH4A_PCIEDMAOR (0x021000) /* R/W R/W 0x0000 0000 32 */ 343#define SH4A_PCIEDMAOR (0x021000) /* R/W R/W 0x0000 0000 32 */
402#define SH4A_PCIEDMSAR0 (0x021100) /* R/W R/W 0x0000 0000 32 */ 344#define SH4A_PCIEDMSAR0 (0x021100) /* R/W R/W 0x0000 0000 32 */
403#define SH4A_PCIEDMSAHR0 (0x021104) /* R/W R/W 0x0000 0000 32 */ 345#define SH4A_PCIEDMSAHR0 (0x021104) /* R/W R/W 0x0000 0000 32 */
diff --git a/arch/sh/drivers/superhyway/ops-sh4-202.c b/arch/sh/drivers/superhyway/ops-sh4-202.c
index 3b14bf860db6..6da62e9475c4 100644
--- a/arch/sh/drivers/superhyway/ops-sh4-202.c
+++ b/arch/sh/drivers/superhyway/ops-sh4-202.c
@@ -134,8 +134,8 @@ static int sh4202_read_vcr(unsigned long base, struct superhyway_vcr_info *vcr)
134 * 134 *
135 * Do not trust the documentation, for it is evil. 135 * Do not trust the documentation, for it is evil.
136 */ 136 */
137 vcrh = ctrl_inl(base); 137 vcrh = __raw_readl(base);
138 vcrl = ctrl_inl(base + sizeof(u32)); 138 vcrl = __raw_readl(base + sizeof(u32));
139 139
140 tmp = ((u64)vcrh << 32) | vcrl; 140 tmp = ((u64)vcrh << 32) | vcrl;
141 memcpy(vcr, &tmp, sizeof(u64)); 141 memcpy(vcr, &tmp, sizeof(u64));
@@ -147,8 +147,8 @@ static int sh4202_write_vcr(unsigned long base, struct superhyway_vcr_info vcr)
147{ 147{
148 u64 tmp = *(u64 *)&vcr; 148 u64 tmp = *(u64 *)&vcr;
149 149
150 ctrl_outl((tmp >> 32) & 0xffffffff, base); 150 __raw_writel((tmp >> 32) & 0xffffffff, base);
151 ctrl_outl(tmp & 0xffffffff, base + sizeof(u32)); 151 __raw_writel(tmp & 0xffffffff, base + sizeof(u32));
152 152
153 return 0; 153 return 0;
154} 154}
diff --git a/arch/sh/include/asm/Kbuild b/arch/sh/include/asm/Kbuild
index e121c30f797d..46cb93477bcb 100644
--- a/arch/sh/include/asm/Kbuild
+++ b/arch/sh/include/asm/Kbuild
@@ -1,6 +1,8 @@
1include include/asm-generic/Kbuild.asm 1include include/asm-generic/Kbuild.asm
2 2
3header-y += cachectl.h cpu-features.h 3header-y += cachectl.h
4header-y += cpu-features.h
5header-y += hw_breakpoint.h
4 6
5unifdef-y += unistd_32.h 7unifdef-y += unistd_32.h
6unifdef-y += unistd_64.h 8unifdef-y += unistd_64.h
diff --git a/arch/sh/include/asm/addrspace.h b/arch/sh/include/asm/addrspace.h
index 99d6b3ecbe22..446b3831c214 100644
--- a/arch/sh/include/asm/addrspace.h
+++ b/arch/sh/include/asm/addrspace.h
@@ -28,7 +28,7 @@
28/* Returns the privileged segment base of a given address */ 28/* Returns the privileged segment base of a given address */
29#define PXSEG(a) (((unsigned long)(a)) & 0xe0000000) 29#define PXSEG(a) (((unsigned long)(a)) & 0xe0000000)
30 30
31#if defined(CONFIG_29BIT) || defined(CONFIG_PMB_FIXED) 31#ifdef CONFIG_29BIT
32/* 32/*
33 * Map an address to a certain privileged segment 33 * Map an address to a certain privileged segment
34 */ 34 */
@@ -40,7 +40,15 @@
40 ((__typeof__(a))(((unsigned long)(a) & 0x1fffffff) | P3SEG)) 40 ((__typeof__(a))(((unsigned long)(a) & 0x1fffffff) | P3SEG))
41#define P4SEGADDR(a) \ 41#define P4SEGADDR(a) \
42 ((__typeof__(a))(((unsigned long)(a) & 0x1fffffff) | P4SEG)) 42 ((__typeof__(a))(((unsigned long)(a) & 0x1fffffff) | P4SEG))
43#endif /* 29BIT || PMB_FIXED */ 43#else
44/*
45 * These will never work in 32-bit, don't even bother.
46 */
47#define P1SEGADDR(a) __futile_remapping_attempt
48#define P2SEGADDR(a) __futile_remapping_attempt
49#define P3SEGADDR(a) __futile_remapping_attempt
50#define P4SEGADDR(a) __futile_remapping_attempt
51#endif
44#endif /* P1SEG */ 52#endif /* P1SEG */
45 53
46/* Check if an address can be reached in 29 bits */ 54/* Check if an address can be reached in 29 bits */
@@ -57,11 +65,5 @@
57#define P3_ADDR_MAX P4SEG 65#define P3_ADDR_MAX P4SEG
58#endif 66#endif
59 67
60#ifndef __ASSEMBLY__
61#ifdef CONFIG_PMB
62extern int __in_29bit_mode(void);
63#endif /* CONFIG_PMB */
64#endif /* __ASSEMBLY__ */
65
66#endif /* __KERNEL__ */ 68#endif /* __KERNEL__ */
67#endif /* __ASM_SH_ADDRSPACE_H */ 69#endif /* __ASM_SH_ADDRSPACE_H */
diff --git a/arch/sh/include/asm/alignment.h b/arch/sh/include/asm/alignment.h
new file mode 100644
index 000000000000..b12efecf5294
--- /dev/null
+++ b/arch/sh/include/asm/alignment.h
@@ -0,0 +1,21 @@
1#ifndef __ASM_SH_ALIGNMENT_H
2#define __ASM_SH_ALIGNMENT_H
3
4#include <linux/types.h>
5
6extern void inc_unaligned_byte_access(void);
7extern void inc_unaligned_word_access(void);
8extern void inc_unaligned_dword_access(void);
9extern void inc_unaligned_multi_access(void);
10extern void inc_unaligned_user_access(void);
11extern void inc_unaligned_kernel_access(void);
12
13#define UM_WARN (1 << 0)
14#define UM_FIXUP (1 << 1)
15#define UM_SIGNAL (1 << 2)
16
17extern unsigned int unaligned_user_action(void);
18
19extern void unaligned_fixups_notify(struct task_struct *, insn_size_t, struct pt_regs *);
20
21#endif /* __ASM_SH_ALIGNMENT_H */
diff --git a/arch/sh/include/asm/atomic-grb.h b/arch/sh/include/asm/atomic-grb.h
index 4c5b7dbfcedb..a273c88578fc 100644
--- a/arch/sh/include/asm/atomic-grb.h
+++ b/arch/sh/include/asm/atomic-grb.h
@@ -120,50 +120,4 @@ static inline void atomic_set_mask(unsigned int mask, atomic_t *v)
120 : "memory" , "r0", "r1"); 120 : "memory" , "r0", "r1");
121} 121}
122 122
123static inline int atomic_cmpxchg(atomic_t *v, int old, int new)
124{
125 int ret;
126
127 __asm__ __volatile__ (
128 " .align 2 \n\t"
129 " mova 1f, r0 \n\t"
130 " nop \n\t"
131 " mov r15, r1 \n\t"
132 " mov #-8, r15 \n\t"
133 " mov.l @%1, %0 \n\t"
134 " cmp/eq %2, %0 \n\t"
135 " bf 1f \n\t"
136 " mov.l %3, @%1 \n\t"
137 "1: mov r1, r15 \n\t"
138 : "=&r" (ret)
139 : "r" (v), "r" (old), "r" (new)
140 : "memory" , "r0", "r1" , "t");
141
142 return ret;
143}
144
145static inline int atomic_add_unless(atomic_t *v, int a, int u)
146{
147 int ret;
148 unsigned long tmp;
149
150 __asm__ __volatile__ (
151 " .align 2 \n\t"
152 " mova 1f, r0 \n\t"
153 " nop \n\t"
154 " mov r15, r1 \n\t"
155 " mov #-12, r15 \n\t"
156 " mov.l @%2, %1 \n\t"
157 " mov %1, %0 \n\t"
158 " cmp/eq %4, %0 \n\t"
159 " bt/s 1f \n\t"
160 " add %3, %1 \n\t"
161 " mov.l %1, @%2 \n\t"
162 "1: mov r1, r15 \n\t"
163 : "=&r" (ret), "=&r" (tmp)
164 : "r" (v), "r" (a), "r" (u)
165 : "memory" , "r0", "r1" , "t");
166
167 return ret != u;
168}
169#endif /* __ASM_SH_ATOMIC_GRB_H */ 123#endif /* __ASM_SH_ATOMIC_GRB_H */
diff --git a/arch/sh/include/asm/atomic-llsc.h b/arch/sh/include/asm/atomic-llsc.h
index b040e1e08610..4b00b78e3f4f 100644
--- a/arch/sh/include/asm/atomic-llsc.h
+++ b/arch/sh/include/asm/atomic-llsc.h
@@ -104,31 +104,4 @@ static inline void atomic_set_mask(unsigned int mask, atomic_t *v)
104 : "t"); 104 : "t");
105} 105}
106 106
107#define atomic_cmpxchg(v, o, n) (cmpxchg(&((v)->counter), (o), (n)))
108
109/**
110 * atomic_add_unless - add unless the number is a given value
111 * @v: pointer of type atomic_t
112 * @a: the amount to add to v...
113 * @u: ...unless v is equal to u.
114 *
115 * Atomically adds @a to @v, so long as it was not @u.
116 * Returns non-zero if @v was not @u, and zero otherwise.
117 */
118static inline int atomic_add_unless(atomic_t *v, int a, int u)
119{
120 int c, old;
121 c = atomic_read(v);
122 for (;;) {
123 if (unlikely(c == (u)))
124 break;
125 old = atomic_cmpxchg((v), c, c + (a));
126 if (likely(old == c))
127 break;
128 c = old;
129 }
130
131 return c != (u);
132}
133
134#endif /* __ASM_SH_ATOMIC_LLSC_H */ 107#endif /* __ASM_SH_ATOMIC_LLSC_H */
diff --git a/arch/sh/include/asm/atomic.h b/arch/sh/include/asm/atomic.h
index b16388d71954..275a448ae8c2 100644
--- a/arch/sh/include/asm/atomic.h
+++ b/arch/sh/include/asm/atomic.h
@@ -25,58 +25,43 @@
25#endif 25#endif
26 26
27#define atomic_add_negative(a, v) (atomic_add_return((a), (v)) < 0) 27#define atomic_add_negative(a, v) (atomic_add_return((a), (v)) < 0)
28#define atomic_dec_return(v) atomic_sub_return(1, (v))
29#define atomic_inc_return(v) atomic_add_return(1, (v))
30#define atomic_inc_and_test(v) (atomic_inc_return(v) == 0)
31#define atomic_sub_and_test(i,v) (atomic_sub_return((i), (v)) == 0)
32#define atomic_dec_and_test(v) (atomic_sub_return(1, (v)) == 0)
33#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
28 34
29#define atomic_dec_return(v) atomic_sub_return(1,(v)) 35#define atomic_inc(v) atomic_add(1, (v))
30#define atomic_inc_return(v) atomic_add_return(1,(v)) 36#define atomic_dec(v) atomic_sub(1, (v))
31 37
32/* 38#define atomic_xchg(v, new) (xchg(&((v)->counter), new))
33 * atomic_inc_and_test - increment and test 39#define atomic_cmpxchg(v, o, n) (cmpxchg(&((v)->counter), (o), (n)))
40
41/**
42 * atomic_add_unless - add unless the number is a given value
34 * @v: pointer of type atomic_t 43 * @v: pointer of type atomic_t
44 * @a: the amount to add to v...
45 * @u: ...unless v is equal to u.
35 * 46 *
36 * Atomically increments @v by 1 47 * Atomically adds @a to @v, so long as it was not @u.
37 * and returns true if the result is zero, or false for all 48 * Returns non-zero if @v was not @u, and zero otherwise.
38 * other cases.
39 */ 49 */
40#define atomic_inc_and_test(v) (atomic_inc_return(v) == 0)
41
42#define atomic_sub_and_test(i,v) (atomic_sub_return((i), (v)) == 0)
43#define atomic_dec_and_test(v) (atomic_sub_return(1, (v)) == 0)
44
45#define atomic_inc(v) atomic_add(1,(v))
46#define atomic_dec(v) atomic_sub(1,(v))
47
48#if !defined(CONFIG_GUSA_RB) && !defined(CONFIG_CPU_SH4A)
49static inline int atomic_cmpxchg(atomic_t *v, int old, int new)
50{
51 int ret;
52 unsigned long flags;
53
54 local_irq_save(flags);
55 ret = v->counter;
56 if (likely(ret == old))
57 v->counter = new;
58 local_irq_restore(flags);
59
60 return ret;
61}
62
63static inline int atomic_add_unless(atomic_t *v, int a, int u) 50static inline int atomic_add_unless(atomic_t *v, int a, int u)
64{ 51{
65 int ret; 52 int c, old;
66 unsigned long flags; 53 c = atomic_read(v);
67 54 for (;;) {
68 local_irq_save(flags); 55 if (unlikely(c == (u)))
69 ret = v->counter; 56 break;
70 if (ret != u) 57 old = atomic_cmpxchg((v), c, c + (a));
71 v->counter += a; 58 if (likely(old == c))
72 local_irq_restore(flags); 59 break;
73 60 c = old;
74 return ret != u; 61 }
62
63 return c != (u);
75} 64}
76#endif /* !CONFIG_GUSA_RB && !CONFIG_CPU_SH4A */
77
78#define atomic_xchg(v, new) (xchg(&((v)->counter), new))
79#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
80 65
81#define smp_mb__before_atomic_dec() smp_mb() 66#define smp_mb__before_atomic_dec() smp_mb()
82#define smp_mb__after_atomic_dec() smp_mb() 67#define smp_mb__after_atomic_dec() smp_mb()
diff --git a/arch/sh/include/asm/cacheflush.h b/arch/sh/include/asm/cacheflush.h
index dda96eb3e7c0..da3ebec921a7 100644
--- a/arch/sh/include/asm/cacheflush.h
+++ b/arch/sh/include/asm/cacheflush.h
@@ -63,6 +63,14 @@ static inline void flush_anon_page(struct vm_area_struct *vma,
63 if (boot_cpu_data.dcache.n_aliases && PageAnon(page)) 63 if (boot_cpu_data.dcache.n_aliases && PageAnon(page))
64 __flush_anon_page(page, vmaddr); 64 __flush_anon_page(page, vmaddr);
65} 65}
66static inline void flush_kernel_vmap_range(void *addr, int size)
67{
68 __flush_wback_region(addr, size);
69}
70static inline void invalidate_kernel_vmap_range(void *addr, int size)
71{
72 __flush_invalidate_region(addr, size);
73}
66 74
67#define ARCH_HAS_FLUSH_KERNEL_DCACHE_PAGE 75#define ARCH_HAS_FLUSH_KERNEL_DCACHE_PAGE
68static inline void flush_kernel_dcache_page(struct page *page) 76static inline void flush_kernel_dcache_page(struct page *page)
diff --git a/arch/sh/include/asm/clock.h b/arch/sh/include/asm/clock.h
index 9fe7d7f8af40..11da4c5beb68 100644
--- a/arch/sh/include/asm/clock.h
+++ b/arch/sh/include/asm/clock.h
@@ -146,8 +146,17 @@ int sh_clk_mstp32_register(struct clk *clks, int nr);
146 .flags = _flags, \ 146 .flags = _flags, \
147} 147}
148 148
149struct clk_div4_table {
150 struct clk_div_mult_table *div_mult_table;
151 void (*kick)(struct clk *clk);
152};
153
149int sh_clk_div4_register(struct clk *clks, int nr, 154int sh_clk_div4_register(struct clk *clks, int nr,
150 struct clk_div_mult_table *table); 155 struct clk_div4_table *table);
156int sh_clk_div4_enable_register(struct clk *clks, int nr,
157 struct clk_div4_table *table);
158int sh_clk_div4_reparent_register(struct clk *clks, int nr,
159 struct clk_div4_table *table);
151 160
152#define SH_CLK_DIV6(_name, _parent, _reg, _flags) \ 161#define SH_CLK_DIV6(_name, _parent, _reg, _flags) \
153{ \ 162{ \
diff --git a/arch/sh/include/asm/cmpxchg-grb.h b/arch/sh/include/asm/cmpxchg-grb.h
index e2681abe764f..4676bf57693a 100644
--- a/arch/sh/include/asm/cmpxchg-grb.h
+++ b/arch/sh/include/asm/cmpxchg-grb.h
@@ -57,11 +57,10 @@ static inline unsigned long __cmpxchg_u32(volatile int *m, unsigned long old,
57 " mov.l @%1, %0 \n\t" /* load old value */ 57 " mov.l @%1, %0 \n\t" /* load old value */
58 " cmp/eq %0, %2 \n\t" 58 " cmp/eq %0, %2 \n\t"
59 " bf 1f \n\t" /* if not equal */ 59 " bf 1f \n\t" /* if not equal */
60 " mov.l %2, @%1 \n\t" /* store new value */ 60 " mov.l %3, @%1 \n\t" /* store new value */
61 "1: mov r1, r15 \n\t" /* LOGOUT */ 61 "1: mov r1, r15 \n\t" /* LOGOUT */
62 : "=&r" (retval), 62 : "=&r" (retval)
63 "+r" (m) 63 : "r" (m), "r" (old), "r" (new)
64 : "r" (new)
65 : "memory" , "r0", "r1", "t"); 64 : "memory" , "r0", "r1", "t");
66 65
67 return retval; 66 return retval;
diff --git a/arch/sh/include/asm/dma-mapping.h b/arch/sh/include/asm/dma-mapping.h
index 87ced133a363..bea3337a426a 100644
--- a/arch/sh/include/asm/dma-mapping.h
+++ b/arch/sh/include/asm/dma-mapping.h
@@ -89,8 +89,6 @@ static inline void dma_free_coherent(struct device *dev, size_t size,
89{ 89{
90 struct dma_map_ops *ops = get_dma_ops(dev); 90 struct dma_map_ops *ops = get_dma_ops(dev);
91 91
92 WARN_ON(irqs_disabled()); /* for portability */
93
94 if (dma_release_from_coherent(dev, get_order(size), vaddr)) 92 if (dma_release_from_coherent(dev, get_order(size), vaddr))
95 return; 93 return;
96 94
diff --git a/arch/sh/include/asm/dma-sh.h b/arch/sh/include/asm/dma-sh.h
index 78eed3e0bdf5..e934a2e66651 100644
--- a/arch/sh/include/asm/dma-sh.h
+++ b/arch/sh/include/asm/dma-sh.h
@@ -20,14 +20,14 @@
20 defined(CONFIG_CPU_SUBTYPE_SH7780) || \ 20 defined(CONFIG_CPU_SUBTYPE_SH7780) || \
21 defined(CONFIG_CPU_SUBTYPE_SH7785) 21 defined(CONFIG_CPU_SUBTYPE_SH7785)
22#define dmaor_read_reg(n) \ 22#define dmaor_read_reg(n) \
23 (n ? ctrl_inw(SH_DMAC_BASE1 + DMAOR) \ 23 (n ? __raw_readw(SH_DMAC_BASE1 + DMAOR) \
24 : ctrl_inw(SH_DMAC_BASE0 + DMAOR)) 24 : __raw_readw(SH_DMAC_BASE0 + DMAOR))
25#define dmaor_write_reg(n, data) \ 25#define dmaor_write_reg(n, data) \
26 (n ? ctrl_outw(data, SH_DMAC_BASE1 + DMAOR) \ 26 (n ? __raw_writew(data, SH_DMAC_BASE1 + DMAOR) \
27 : ctrl_outw(data, SH_DMAC_BASE0 + DMAOR)) 27 : __raw_writew(data, SH_DMAC_BASE0 + DMAOR))
28#else /* Other CPU */ 28#else /* Other CPU */
29#define dmaor_read_reg(n) ctrl_inw(SH_DMAC_BASE0 + DMAOR) 29#define dmaor_read_reg(n) __raw_readw(SH_DMAC_BASE0 + DMAOR)
30#define dmaor_write_reg(n, data) ctrl_outw(data, SH_DMAC_BASE0 + DMAOR) 30#define dmaor_write_reg(n, data) __raw_writew(data, SH_DMAC_BASE0 + DMAOR)
31#endif 31#endif
32 32
33static int dmte_irq_map[] __maybe_unused = { 33static int dmte_irq_map[] __maybe_unused = {
@@ -64,8 +64,10 @@ static int dmte_irq_map[] __maybe_unused = {
64#define ACK_L 0x00010000 64#define ACK_L 0x00010000
65#define DM_INC 0x00004000 65#define DM_INC 0x00004000
66#define DM_DEC 0x00008000 66#define DM_DEC 0x00008000
67#define DM_FIX 0x0000c000
67#define SM_INC 0x00001000 68#define SM_INC 0x00001000
68#define SM_DEC 0x00002000 69#define SM_DEC 0x00002000
70#define SM_FIX 0x00003000
69#define RS_IN 0x00000200 71#define RS_IN 0x00000200
70#define RS_OUT 0x00000300 72#define RS_OUT 0x00000300
71#define TS_BLK 0x00000040 73#define TS_BLK 0x00000040
@@ -83,7 +85,7 @@ static int dmte_irq_map[] __maybe_unused = {
83 * Define the default configuration for dual address memory-memory transfer. 85 * Define the default configuration for dual address memory-memory transfer.
84 * The 0x400 value represents auto-request, external->external. 86 * The 0x400 value represents auto-request, external->external.
85 */ 87 */
86#define RS_DUAL (DM_INC | SM_INC | 0x400 | TS_32) 88#define RS_DUAL (DM_INC | SM_INC | 0x400 | TS_INDEX2VAL(XMIT_SZ_32BIT))
87 89
88/* DMA base address */ 90/* DMA base address */
89static u32 dma_base_addr[] __maybe_unused = { 91static u32 dma_base_addr[] __maybe_unused = {
@@ -123,10 +125,47 @@ static u32 dma_base_addr[] __maybe_unused = {
123 */ 125 */
124#define SHDMA_MIX_IRQ (1 << 1) 126#define SHDMA_MIX_IRQ (1 << 1)
125#define SHDMA_DMAOR1 (1 << 2) 127#define SHDMA_DMAOR1 (1 << 2)
126#define SHDMA_DMAE1 (1 << 3) 128#define SHDMA_DMAE1 (1 << 3)
129
130enum sh_dmae_slave_chan_id {
131 SHDMA_SLAVE_SCIF0_TX,
132 SHDMA_SLAVE_SCIF0_RX,
133 SHDMA_SLAVE_SCIF1_TX,
134 SHDMA_SLAVE_SCIF1_RX,
135 SHDMA_SLAVE_SCIF2_TX,
136 SHDMA_SLAVE_SCIF2_RX,
137 SHDMA_SLAVE_SCIF3_TX,
138 SHDMA_SLAVE_SCIF3_RX,
139 SHDMA_SLAVE_SCIF4_TX,
140 SHDMA_SLAVE_SCIF4_RX,
141 SHDMA_SLAVE_SCIF5_TX,
142 SHDMA_SLAVE_SCIF5_RX,
143 SHDMA_SLAVE_SIUA_TX,
144 SHDMA_SLAVE_SIUA_RX,
145 SHDMA_SLAVE_SIUB_TX,
146 SHDMA_SLAVE_SIUB_RX,
147 SHDMA_SLAVE_NUMBER, /* Must stay last */
148};
149
150struct sh_dmae_slave_config {
151 enum sh_dmae_slave_chan_id slave_id;
152 dma_addr_t addr;
153 u32 chcr;
154 char mid_rid;
155};
127 156
128struct sh_dmae_pdata { 157struct sh_dmae_pdata {
129 unsigned int mode; 158 unsigned int mode;
159 struct sh_dmae_slave_config *config;
160 int config_num;
161};
162
163struct device;
164
165struct sh_dmae_slave {
166 enum sh_dmae_slave_chan_id slave_id; /* Set by the platform */
167 struct device *dma_dev; /* Set by the platform */
168 struct sh_dmae_slave_config *config; /* Set by the driver */
130}; 169};
131 170
132#endif /* __DMA_SH_H */ 171#endif /* __DMA_SH_H */
diff --git a/arch/sh/include/asm/dwarf.h b/arch/sh/include/asm/dwarf.h
index bdccbbfdc0bd..d62abd1d0c05 100644
--- a/arch/sh/include/asm/dwarf.h
+++ b/arch/sh/include/asm/dwarf.h
@@ -243,16 +243,13 @@ struct dwarf_cie {
243 243
244 unsigned long cie_pointer; 244 unsigned long cie_pointer;
245 245
246 struct list_head link;
247
248 unsigned long flags; 246 unsigned long flags;
249#define DWARF_CIE_Z_AUGMENTATION (1 << 0) 247#define DWARF_CIE_Z_AUGMENTATION (1 << 0)
250 248
251 /* 249 /* linked-list entry if this CIE is from a module */
252 * 'mod' will be non-NULL if this CIE came from a module's 250 struct list_head link;
253 * .eh_frame section. 251
254 */ 252 struct rb_node node;
255 struct module *mod;
256}; 253};
257 254
258/** 255/**
@@ -266,13 +263,11 @@ struct dwarf_fde {
266 unsigned long address_range; 263 unsigned long address_range;
267 unsigned char *instructions; 264 unsigned char *instructions;
268 unsigned char *end; 265 unsigned char *end;
266
267 /* linked-list entry if this FDE is from a module */
269 struct list_head link; 268 struct list_head link;
270 269
271 /* 270 struct rb_node node;
272 * 'mod' will be non-NULL if this FDE came from a module's
273 * .eh_frame section.
274 */
275 struct module *mod;
276}; 271};
277 272
278/** 273/**
diff --git a/arch/sh/include/asm/fixmap.h b/arch/sh/include/asm/fixmap.h
index 5ac1e40a511c..6e7cea453895 100644
--- a/arch/sh/include/asm/fixmap.h
+++ b/arch/sh/include/asm/fixmap.h
@@ -55,16 +55,29 @@ enum fixed_addresses {
55#define FIX_N_COLOURS 8 55#define FIX_N_COLOURS 8
56 FIX_CMAP_BEGIN, 56 FIX_CMAP_BEGIN,
57 FIX_CMAP_END = FIX_CMAP_BEGIN + (FIX_N_COLOURS * NR_CPUS) - 1, 57 FIX_CMAP_END = FIX_CMAP_BEGIN + (FIX_N_COLOURS * NR_CPUS) - 1,
58 FIX_UNCACHED, 58
59#ifdef CONFIG_HIGHMEM 59#ifdef CONFIG_HIGHMEM
60 FIX_KMAP_BEGIN, /* reserved pte's for temporary kernel mappings */ 60 FIX_KMAP_BEGIN, /* reserved pte's for temporary kernel mappings */
61 FIX_KMAP_END = FIX_KMAP_BEGIN+(KM_TYPE_NR*NR_CPUS)-1, 61 FIX_KMAP_END = FIX_KMAP_BEGIN+(KM_TYPE_NR*NR_CPUS)-1,
62#endif 62#endif
63
64#ifdef CONFIG_IOREMAP_FIXED
65 /*
66 * FIX_IOREMAP entries are useful for mapping physical address
67 * space before ioremap() is useable, e.g. really early in boot
68 * before kmalloc() is working.
69 */
70#define FIX_N_IOREMAPS 32
71 FIX_IOREMAP_BEGIN,
72 FIX_IOREMAP_END = FIX_IOREMAP_BEGIN + FIX_N_IOREMAPS,
73#endif
74
63 __end_of_fixed_addresses 75 __end_of_fixed_addresses
64}; 76};
65 77
66extern void __set_fixmap(enum fixed_addresses idx, 78extern void __set_fixmap(enum fixed_addresses idx,
67 unsigned long phys, pgprot_t flags); 79 unsigned long phys, pgprot_t flags);
80extern void __clear_fixmap(enum fixed_addresses idx, pgprot_t flags);
68 81
69#define set_fixmap(idx, phys) \ 82#define set_fixmap(idx, phys) \
70 __set_fixmap(idx, phys, PAGE_KERNEL) 83 __set_fixmap(idx, phys, PAGE_KERNEL)
diff --git a/arch/sh/include/asm/fpu.h b/arch/sh/include/asm/fpu.h
index fb6bbb9b1cc8..06c4281aab65 100644
--- a/arch/sh/include/asm/fpu.h
+++ b/arch/sh/include/asm/fpu.h
@@ -2,8 +2,8 @@
2#define __ASM_SH_FPU_H 2#define __ASM_SH_FPU_H
3 3
4#ifndef __ASSEMBLY__ 4#ifndef __ASSEMBLY__
5#include <linux/preempt.h> 5
6#include <asm/ptrace.h> 6struct task_struct;
7 7
8#ifdef CONFIG_SH_FPU 8#ifdef CONFIG_SH_FPU
9static inline void release_fpu(struct pt_regs *regs) 9static inline void release_fpu(struct pt_regs *regs)
@@ -16,22 +16,23 @@ static inline void grab_fpu(struct pt_regs *regs)
16 regs->sr &= ~SR_FD; 16 regs->sr &= ~SR_FD;
17} 17}
18 18
19struct task_struct;
20
21extern void save_fpu(struct task_struct *__tsk); 19extern void save_fpu(struct task_struct *__tsk);
22void fpu_state_restore(struct pt_regs *regs); 20extern void restore_fpu(struct task_struct *__tsk);
21extern void fpu_state_restore(struct pt_regs *regs);
22extern void __fpu_state_restore(void);
23#else 23#else
24 24#define save_fpu(tsk) do { } while (0)
25#define save_fpu(tsk) do { } while (0) 25#define restore_fpu(tsk) do { } while (0)
26#define release_fpu(regs) do { } while (0) 26#define release_fpu(regs) do { } while (0)
27#define grab_fpu(regs) do { } while (0) 27#define grab_fpu(regs) do { } while (0)
28#define fpu_state_restore(regs) do { } while (0) 28#define fpu_state_restore(regs) do { } while (0)
29 29#define __fpu_state_restore(regs) do { } while (0)
30#endif 30#endif
31 31
32struct user_regset; 32struct user_regset;
33 33
34extern int do_fpu_inst(unsigned short, struct pt_regs *); 34extern int do_fpu_inst(unsigned short, struct pt_regs *);
35extern int init_fpu(struct task_struct *);
35 36
36extern int fpregs_get(struct task_struct *target, 37extern int fpregs_get(struct task_struct *target,
37 const struct user_regset *regset, 38 const struct user_regset *regset,
@@ -65,18 +66,6 @@ static inline void clear_fpu(struct task_struct *tsk, struct pt_regs *regs)
65 preempt_enable(); 66 preempt_enable();
66} 67}
67 68
68static inline int init_fpu(struct task_struct *tsk)
69{
70 if (tsk_used_math(tsk)) {
71 if ((boot_cpu_data.flags & CPU_HAS_FPU) && tsk == current)
72 unlazy_fpu(tsk, task_pt_regs(tsk));
73 return 0;
74 }
75
76 set_stopped_child_used_math(tsk);
77 return 0;
78}
79
80#endif /* __ASSEMBLY__ */ 69#endif /* __ASSEMBLY__ */
81 70
82#endif /* __ASM_SH_FPU_H */ 71#endif /* __ASM_SH_FPU_H */
diff --git a/arch/sh/include/asm/hw_breakpoint.h b/arch/sh/include/asm/hw_breakpoint.h
new file mode 100644
index 000000000000..965dd780d51b
--- /dev/null
+++ b/arch/sh/include/asm/hw_breakpoint.h
@@ -0,0 +1,67 @@
1#ifndef __ASM_SH_HW_BREAKPOINT_H
2#define __ASM_SH_HW_BREAKPOINT_H
3
4#ifdef __KERNEL__
5#define __ARCH_HW_BREAKPOINT_H
6
7#include <linux/kdebug.h>
8#include <linux/types.h>
9
10struct arch_hw_breakpoint {
11 char *name; /* Contains name of the symbol to set bkpt */
12 unsigned long address;
13 u16 len;
14 u16 type;
15};
16
17enum {
18 SH_BREAKPOINT_READ = (1 << 1),
19 SH_BREAKPOINT_WRITE = (1 << 2),
20 SH_BREAKPOINT_RW = SH_BREAKPOINT_READ | SH_BREAKPOINT_WRITE,
21
22 SH_BREAKPOINT_LEN_1 = (1 << 12),
23 SH_BREAKPOINT_LEN_2 = (1 << 13),
24 SH_BREAKPOINT_LEN_4 = SH_BREAKPOINT_LEN_1 | SH_BREAKPOINT_LEN_2,
25 SH_BREAKPOINT_LEN_8 = (1 << 14),
26};
27
28struct sh_ubc {
29 const char *name;
30 unsigned int num_events;
31 unsigned int trap_nr;
32 void (*enable)(struct arch_hw_breakpoint *, int);
33 void (*disable)(struct arch_hw_breakpoint *, int);
34 void (*enable_all)(unsigned long);
35 void (*disable_all)(void);
36 unsigned long (*active_mask)(void);
37 unsigned long (*triggered_mask)(void);
38 void (*clear_triggered_mask)(unsigned long);
39 struct clk *clk; /* optional interface clock / MSTP bit */
40};
41
42struct perf_event;
43struct task_struct;
44struct pmu;
45
46/* Maximum number of UBC channels */
47#define HBP_NUM 2
48
49/* arch/sh/kernel/hw_breakpoint.c */
50extern int arch_check_va_in_userspace(unsigned long va, u16 hbp_len);
51extern int arch_validate_hwbkpt_settings(struct perf_event *bp,
52 struct task_struct *tsk);
53extern int hw_breakpoint_exceptions_notify(struct notifier_block *unused,
54 unsigned long val, void *data);
55
56int arch_install_hw_breakpoint(struct perf_event *bp);
57void arch_uninstall_hw_breakpoint(struct perf_event *bp);
58void hw_breakpoint_pmu_read(struct perf_event *bp);
59void hw_breakpoint_pmu_unthrottle(struct perf_event *bp);
60
61extern void arch_fill_perf_breakpoint(struct perf_event *bp);
62extern int register_sh_ubc(struct sh_ubc *);
63
64extern struct pmu perf_ops_bp;
65
66#endif /* __KERNEL__ */
67#endif /* __ASM_SH_HW_BREAKPOINT_H */
diff --git a/arch/sh/include/asm/io.h b/arch/sh/include/asm/io.h
index 026dd659a640..7dab7b23a5ec 100644
--- a/arch/sh/include/asm/io.h
+++ b/arch/sh/include/asm/io.h
@@ -22,6 +22,7 @@
22 * for old compat code for I/O offseting to SuperIOs, all of which are 22 * for old compat code for I/O offseting to SuperIOs, all of which are
23 * better handled through the machvec ioport mapping routines these days. 23 * better handled through the machvec ioport mapping routines these days.
24 */ 24 */
25#include <linux/errno.h>
25#include <asm/cache.h> 26#include <asm/cache.h>
26#include <asm/system.h> 27#include <asm/system.h>
27#include <asm/addrspace.h> 28#include <asm/addrspace.h>
@@ -79,16 +80,51 @@
79#define writel(v,a) ({ __raw_writel((v),(a)); mb(); }) 80#define writel(v,a) ({ __raw_writel((v),(a)); mb(); })
80#define writeq(v,a) ({ __raw_writeq((v),(a)); mb(); }) 81#define writeq(v,a) ({ __raw_writeq((v),(a)); mb(); })
81 82
82/* SuperH on-chip I/O functions */ 83/*
83#define ctrl_inb __raw_readb 84 * Legacy SuperH on-chip I/O functions
84#define ctrl_inw __raw_readw 85 *
85#define ctrl_inl __raw_readl 86 * These are all deprecated, all new (and especially cross-platform) code
86#define ctrl_inq __raw_readq 87 * should be using the __raw_xxx() routines directly.
88 */
89static inline u8 __deprecated ctrl_inb(unsigned long addr)
90{
91 return __raw_readb(addr);
92}
93
94static inline u16 __deprecated ctrl_inw(unsigned long addr)
95{
96 return __raw_readw(addr);
97}
98
99static inline u32 __deprecated ctrl_inl(unsigned long addr)
100{
101 return __raw_readl(addr);
102}
103
104static inline u64 __deprecated ctrl_inq(unsigned long addr)
105{
106 return __raw_readq(addr);
107}
108
109static inline void __deprecated ctrl_outb(u8 v, unsigned long addr)
110{
111 __raw_writeb(v, addr);
112}
113
114static inline void __deprecated ctrl_outw(u16 v, unsigned long addr)
115{
116 __raw_writew(v, addr);
117}
87 118
88#define ctrl_outb __raw_writeb 119static inline void __deprecated ctrl_outl(u32 v, unsigned long addr)
89#define ctrl_outw __raw_writew 120{
90#define ctrl_outl __raw_writel 121 __raw_writel(v, addr);
91#define ctrl_outq __raw_writeq 122}
123
124static inline void __deprecated ctrl_outq(u64 v, unsigned long addr)
125{
126 __raw_writeq(v, addr);
127}
92 128
93extern unsigned long generic_io_base; 129extern unsigned long generic_io_base;
94 130
@@ -97,6 +133,28 @@ static inline void ctrl_delay(void)
97 __raw_readw(generic_io_base); 133 __raw_readw(generic_io_base);
98} 134}
99 135
136#define __BUILD_UNCACHED_IO(bwlq, type) \
137static inline type read##bwlq##_uncached(unsigned long addr) \
138{ \
139 type ret; \
140 jump_to_uncached(); \
141 ret = __raw_read##bwlq(addr); \
142 back_to_cached(); \
143 return ret; \
144} \
145 \
146static inline void write##bwlq##_uncached(type v, unsigned long addr) \
147{ \
148 jump_to_uncached(); \
149 __raw_write##bwlq(v, addr); \
150 back_to_cached(); \
151}
152
153__BUILD_UNCACHED_IO(b, u8)
154__BUILD_UNCACHED_IO(w, u16)
155__BUILD_UNCACHED_IO(l, u32)
156__BUILD_UNCACHED_IO(q, u64)
157
100#define __BUILD_MEMORY_STRING(bwlq, type) \ 158#define __BUILD_MEMORY_STRING(bwlq, type) \
101 \ 159 \
102static inline void __raw_writes##bwlq(volatile void __iomem *mem, \ 160static inline void __raw_writes##bwlq(volatile void __iomem *mem, \
@@ -234,28 +292,21 @@ unsigned long long poke_real_address_q(unsigned long long addr,
234 */ 292 */
235#ifdef CONFIG_MMU 293#ifdef CONFIG_MMU
236void __iomem *__ioremap_caller(unsigned long offset, unsigned long size, 294void __iomem *__ioremap_caller(unsigned long offset, unsigned long size,
237 unsigned long flags, void *caller); 295 pgprot_t prot, void *caller);
238void __iounmap(void __iomem *addr); 296void __iounmap(void __iomem *addr);
239 297
240static inline void __iomem * 298static inline void __iomem *
241__ioremap(unsigned long offset, unsigned long size, unsigned long flags) 299__ioremap(unsigned long offset, unsigned long size, pgprot_t prot)
242{ 300{
243 return __ioremap_caller(offset, size, flags, __builtin_return_address(0)); 301 return __ioremap_caller(offset, size, prot, __builtin_return_address(0));
244} 302}
245 303
246static inline void __iomem * 304static inline void __iomem *
247__ioremap_mode(unsigned long offset, unsigned long size, unsigned long flags) 305__ioremap_29bit(unsigned long offset, unsigned long size, pgprot_t prot)
248{ 306{
249#if defined(CONFIG_SUPERH32) && !defined(CONFIG_PMB_FIXED) && !defined(CONFIG_PMB) 307#ifdef CONFIG_29BIT
250 unsigned long last_addr = offset + size - 1; 308 unsigned long last_addr = offset + size - 1;
251#endif
252 void __iomem *ret;
253 309
254 ret = __ioremap_trapped(offset, size);
255 if (ret)
256 return ret;
257
258#if defined(CONFIG_SUPERH32) && !defined(CONFIG_PMB_FIXED) && !defined(CONFIG_PMB)
259 /* 310 /*
260 * For P1 and P2 space this is trivial, as everything is already 311 * For P1 and P2 space this is trivial, as everything is already
261 * mapped. Uncached access for P1 addresses are done through P2. 312 * mapped. Uncached access for P1 addresses are done through P2.
@@ -263,7 +314,7 @@ __ioremap_mode(unsigned long offset, unsigned long size, unsigned long flags)
263 * mapping must be done by the PMB or by using page tables. 314 * mapping must be done by the PMB or by using page tables.
264 */ 315 */
265 if (likely(PXSEG(offset) < P3SEG && PXSEG(last_addr) < P3SEG)) { 316 if (likely(PXSEG(offset) < P3SEG && PXSEG(last_addr) < P3SEG)) {
266 if (unlikely(flags & _PAGE_CACHABLE)) 317 if (unlikely(pgprot_val(prot) & _PAGE_CACHABLE))
267 return (void __iomem *)P1SEGADDR(offset); 318 return (void __iomem *)P1SEGADDR(offset);
268 319
269 return (void __iomem *)P2SEGADDR(offset); 320 return (void __iomem *)P2SEGADDR(offset);
@@ -274,26 +325,70 @@ __ioremap_mode(unsigned long offset, unsigned long size, unsigned long flags)
274 return (void __iomem *)P4SEGADDR(offset); 325 return (void __iomem *)P4SEGADDR(offset);
275#endif 326#endif
276 327
277 return __ioremap(offset, size, flags); 328 return NULL;
329}
330
331static inline void __iomem *
332__ioremap_mode(unsigned long offset, unsigned long size, pgprot_t prot)
333{
334 void __iomem *ret;
335
336 ret = __ioremap_trapped(offset, size);
337 if (ret)
338 return ret;
339
340 ret = __ioremap_29bit(offset, size, prot);
341 if (ret)
342 return ret;
343
344 return __ioremap(offset, size, prot);
278} 345}
279#else 346#else
280#define __ioremap(offset, size, flags) ((void __iomem *)(offset)) 347#define __ioremap(offset, size, prot) ((void __iomem *)(offset))
281#define __ioremap_mode(offset, size, flags) ((void __iomem *)(offset)) 348#define __ioremap_mode(offset, size, prot) ((void __iomem *)(offset))
282#define __iounmap(addr) do { } while (0) 349#define __iounmap(addr) do { } while (0)
283#endif /* CONFIG_MMU */ 350#endif /* CONFIG_MMU */
284 351
285#define ioremap(offset, size) \ 352static inline void __iomem *
286 __ioremap_mode((offset), (size), 0) 353ioremap(unsigned long offset, unsigned long size)
287#define ioremap_nocache(offset, size) \ 354{
288 __ioremap_mode((offset), (size), 0) 355 return __ioremap_mode(offset, size, PAGE_KERNEL_NOCACHE);
289#define ioremap_cache(offset, size) \ 356}
290 __ioremap_mode((offset), (size), _PAGE_CACHABLE) 357
291#define p3_ioremap(offset, size, flags) \ 358static inline void __iomem *
292 __ioremap((offset), (size), (flags)) 359ioremap_cache(unsigned long offset, unsigned long size)
293#define ioremap_prot(offset, size, flags) \ 360{
294 __ioremap_mode((offset), (size), (flags)) 361 return __ioremap_mode(offset, size, PAGE_KERNEL);
295#define iounmap(addr) \ 362}
296 __iounmap((addr)) 363
364#ifdef CONFIG_HAVE_IOREMAP_PROT
365static inline void __iomem *
366ioremap_prot(resource_size_t offset, unsigned long size, unsigned long flags)
367{
368 return __ioremap_mode(offset, size, __pgprot(flags));
369}
370#endif
371
372#ifdef CONFIG_IOREMAP_FIXED
373extern void __iomem *ioremap_fixed(resource_size_t, unsigned long,
374 unsigned long, pgprot_t);
375extern int iounmap_fixed(void __iomem *);
376extern void ioremap_fixed_init(void);
377#else
378static inline void __iomem *
379ioremap_fixed(resource_size_t phys_addr, unsigned long offset,
380 unsigned long size, pgprot_t prot)
381{
382 BUG();
383 return NULL;
384}
385
386static inline void ioremap_fixed_init(void) { }
387static inline int iounmap_fixed(void __iomem *addr) { return -EINVAL; }
388#endif
389
390#define ioremap_nocache ioremap
391#define iounmap __iounmap
297 392
298#define maybebadio(port) \ 393#define maybebadio(port) \
299 printk(KERN_ERR "bad PC-like io %s:%u for port 0x%lx at 0x%08x\n", \ 394 printk(KERN_ERR "bad PC-like io %s:%u for port 0x%lx at 0x%08x\n", \
diff --git a/arch/sh/include/asm/kdebug.h b/arch/sh/include/asm/kdebug.h
index 985219f9759e..5f6d2e9ccb7c 100644
--- a/arch/sh/include/asm/kdebug.h
+++ b/arch/sh/include/asm/kdebug.h
@@ -6,6 +6,8 @@ enum die_val {
6 DIE_TRAP, 6 DIE_TRAP,
7 DIE_NMI, 7 DIE_NMI,
8 DIE_OOPS, 8 DIE_OOPS,
9 DIE_BREAKPOINT,
10 DIE_SSTEP,
9}; 11};
10 12
11#endif /* __ASM_SH_KDEBUG_H */ 13#endif /* __ASM_SH_KDEBUG_H */
diff --git a/arch/sh/include/asm/mmu.h b/arch/sh/include/asm/mmu.h
index c7426ad9926e..15a05b615ba7 100644
--- a/arch/sh/include/asm/mmu.h
+++ b/arch/sh/include/asm/mmu.h
@@ -11,7 +11,9 @@
11 11
12#define PMB_ADDR 0xf6100000 12#define PMB_ADDR 0xf6100000
13#define PMB_DATA 0xf7100000 13#define PMB_DATA 0xf7100000
14#define PMB_ENTRY_MAX 16 14
15#define NR_PMB_ENTRIES 16
16
15#define PMB_E_MASK 0x0000000f 17#define PMB_E_MASK 0x0000000f
16#define PMB_E_SHIFT 8 18#define PMB_E_SHIFT 8
17 19
@@ -25,11 +27,15 @@
25#define PMB_C 0x00000008 27#define PMB_C 0x00000008
26#define PMB_WT 0x00000001 28#define PMB_WT 0x00000001
27#define PMB_UB 0x00000200 29#define PMB_UB 0x00000200
30#define PMB_CACHE_MASK (PMB_C | PMB_WT | PMB_UB)
28#define PMB_V 0x00000100 31#define PMB_V 0x00000100
29 32
30#define PMB_NO_ENTRY (-1) 33#define PMB_NO_ENTRY (-1)
31 34
32#ifndef __ASSEMBLY__ 35#ifndef __ASSEMBLY__
36#include <linux/errno.h>
37#include <linux/threads.h>
38#include <asm/page.h>
33 39
34/* Default "unsigned long" context */ 40/* Default "unsigned long" context */
35typedef unsigned long mm_context_id_t[NR_CPUS]; 41typedef unsigned long mm_context_id_t[NR_CPUS];
@@ -47,29 +53,30 @@ typedef struct {
47#endif 53#endif
48} mm_context_t; 54} mm_context_t;
49 55
50struct pmb_entry; 56#ifdef CONFIG_PMB
51
52struct pmb_entry {
53 unsigned long vpn;
54 unsigned long ppn;
55 unsigned long flags;
56
57 /*
58 * 0 .. NR_PMB_ENTRIES for specific entry selection, or
59 * PMB_NO_ENTRY to search for a free one
60 */
61 int entry;
62
63 struct pmb_entry *next;
64 /* Adjacent entry link for contiguous multi-entry mappings */
65 struct pmb_entry *link;
66};
67
68/* arch/sh/mm/pmb.c */ 57/* arch/sh/mm/pmb.c */
69long pmb_remap(unsigned long virt, unsigned long phys, 58long pmb_remap(unsigned long virt, unsigned long phys,
70 unsigned long size, unsigned long flags); 59 unsigned long size, pgprot_t prot);
71void pmb_unmap(unsigned long addr); 60void pmb_unmap(unsigned long addr);
72int pmb_init(void); 61void pmb_init(void);
62bool __in_29bit_mode(void);
63#else
64static inline long pmb_remap(unsigned long virt, unsigned long phys,
65 unsigned long size, pgprot_t prot)
66{
67 return -EINVAL;
68}
69
70#define pmb_unmap(addr) do { } while (0)
71#define pmb_init(addr) do { } while (0)
72
73#ifdef CONFIG_29BIT
74#define __in_29bit_mode() (1)
75#else
76#define __in_29bit_mode() (0)
77#endif
78
79#endif /* CONFIG_PMB */
73#endif /* __ASSEMBLY__ */ 80#endif /* __ASSEMBLY__ */
74 81
75#endif /* __MMU_H */ 82#endif /* __MMU_H */
diff --git a/arch/sh/include/asm/mmu_context.h b/arch/sh/include/asm/mmu_context.h
index 41080b173a7a..384c7471a374 100644
--- a/arch/sh/include/asm/mmu_context.h
+++ b/arch/sh/include/asm/mmu_context.h
@@ -158,7 +158,7 @@ static inline void enable_mmu(void)
158 unsigned int cpu = smp_processor_id(); 158 unsigned int cpu = smp_processor_id();
159 159
160 /* Enable MMU */ 160 /* Enable MMU */
161 ctrl_outl(MMU_CONTROL_INIT, MMUCR); 161 __raw_writel(MMU_CONTROL_INIT, MMUCR);
162 ctrl_barrier(); 162 ctrl_barrier();
163 163
164 if (asid_cache(cpu) == NO_CONTEXT) 164 if (asid_cache(cpu) == NO_CONTEXT)
@@ -171,9 +171,9 @@ static inline void disable_mmu(void)
171{ 171{
172 unsigned long cr; 172 unsigned long cr;
173 173
174 cr = ctrl_inl(MMUCR); 174 cr = __raw_readl(MMUCR);
175 cr &= ~MMU_CONTROL_INIT; 175 cr &= ~MMU_CONTROL_INIT;
176 ctrl_outl(cr, MMUCR); 176 __raw_writel(cr, MMUCR);
177 177
178 ctrl_barrier(); 178 ctrl_barrier();
179} 179}
diff --git a/arch/sh/include/asm/mmu_context_32.h b/arch/sh/include/asm/mmu_context_32.h
index 8ef800c549ab..10e2e17210d2 100644
--- a/arch/sh/include/asm/mmu_context_32.h
+++ b/arch/sh/include/asm/mmu_context_32.h
@@ -49,11 +49,11 @@ static inline unsigned long get_asid(void)
49/* MMU_TTB is used for optimizing the fault handling. */ 49/* MMU_TTB is used for optimizing the fault handling. */
50static inline void set_TTB(pgd_t *pgd) 50static inline void set_TTB(pgd_t *pgd)
51{ 51{
52 ctrl_outl((unsigned long)pgd, MMU_TTB); 52 __raw_writel((unsigned long)pgd, MMU_TTB);
53} 53}
54 54
55static inline pgd_t *get_TTB(void) 55static inline pgd_t *get_TTB(void)
56{ 56{
57 return (pgd_t *)ctrl_inl(MMU_TTB); 57 return (pgd_t *)__raw_readl(MMU_TTB);
58} 58}
59#endif /* __ASM_SH_MMU_CONTEXT_32_H */ 59#endif /* __ASM_SH_MMU_CONTEXT_32_H */
diff --git a/arch/sh/include/asm/module.h b/arch/sh/include/asm/module.h
index 068bf1659750..b7927de86f9f 100644
--- a/arch/sh/include/asm/module.h
+++ b/arch/sh/include/asm/module.h
@@ -1,7 +1,22 @@
1#ifndef _ASM_SH_MODULE_H 1#ifndef _ASM_SH_MODULE_H
2#define _ASM_SH_MODULE_H 2#define _ASM_SH_MODULE_H
3 3
4#include <asm-generic/module.h> 4struct mod_arch_specific {
5#ifdef CONFIG_DWARF_UNWINDER
6 struct list_head fde_list;
7 struct list_head cie_list;
8#endif
9};
10
11#ifdef CONFIG_64BIT
12#define Elf_Shdr Elf64_Shdr
13#define Elf_Sym Elf64_Sym
14#define Elf_Ehdr Elf64_Ehdr
15#else
16#define Elf_Shdr Elf32_Shdr
17#define Elf_Sym Elf32_Sym
18#define Elf_Ehdr Elf32_Ehdr
19#endif
5 20
6#ifdef CONFIG_CPU_LITTLE_ENDIAN 21#ifdef CONFIG_CPU_LITTLE_ENDIAN
7# ifdef CONFIG_CPU_SH2 22# ifdef CONFIG_CPU_SH2
diff --git a/arch/sh/include/asm/page.h b/arch/sh/include/asm/page.h
index 81bffc0d6860..d71feb359304 100644
--- a/arch/sh/include/asm/page.h
+++ b/arch/sh/include/asm/page.h
@@ -45,6 +45,7 @@
45#endif 45#endif
46 46
47#ifndef __ASSEMBLY__ 47#ifndef __ASSEMBLY__
48#include <asm/uncached.h>
48 49
49extern unsigned long shm_align_mask; 50extern unsigned long shm_align_mask;
50extern unsigned long max_low_pfn, min_low_pfn; 51extern unsigned long max_low_pfn, min_low_pfn;
@@ -56,7 +57,6 @@ pages_do_alias(unsigned long addr1, unsigned long addr2)
56 return (addr1 ^ addr2) & shm_align_mask; 57 return (addr1 ^ addr2) & shm_align_mask;
57} 58}
58 59
59
60#define clear_page(page) memset((void *)(page), 0, PAGE_SIZE) 60#define clear_page(page) memset((void *)(page), 0, PAGE_SIZE)
61extern void copy_page(void *to, void *from); 61extern void copy_page(void *to, void *from);
62 62
@@ -88,7 +88,7 @@ typedef struct { unsigned long pgd; } pgd_t;
88#define __pte(x) ((pte_t) { (x) } ) 88#define __pte(x) ((pte_t) { (x) } )
89#else 89#else
90typedef struct { unsigned long long pte_low; } pte_t; 90typedef struct { unsigned long long pte_low; } pte_t;
91typedef struct { unsigned long pgprot; } pgprot_t; 91typedef struct { unsigned long long pgprot; } pgprot_t;
92typedef struct { unsigned long pgd; } pgd_t; 92typedef struct { unsigned long pgd; } pgd_t;
93#define pte_val(x) ((x).pte_low) 93#define pte_val(x) ((x).pte_low)
94#define __pte(x) ((pte_t) { (x) } ) 94#define __pte(x) ((pte_t) { (x) } )
@@ -127,12 +127,7 @@ typedef struct page *pgtable_t;
127 * is not visible (it is part of the PMB mapping) and so needs to be 127 * is not visible (it is part of the PMB mapping) and so needs to be
128 * added or subtracted as required. 128 * added or subtracted as required.
129 */ 129 */
130#if defined(CONFIG_PMB_FIXED) 130#ifdef CONFIG_PMB
131/* phys = virt - PAGE_OFFSET - (__MEMORY_START & 0xe0000000) */
132#define PMB_OFFSET (PAGE_OFFSET - PXSEG(__MEMORY_START))
133#define __pa(x) ((unsigned long)(x) - PMB_OFFSET)
134#define __va(x) ((void *)((unsigned long)(x) + PMB_OFFSET))
135#elif defined(CONFIG_32BIT)
136#define __pa(x) ((unsigned long)(x)-PAGE_OFFSET+__MEMORY_START) 131#define __pa(x) ((unsigned long)(x)-PAGE_OFFSET+__MEMORY_START)
137#define __va(x) ((void *)((unsigned long)(x)+PAGE_OFFSET-__MEMORY_START)) 132#define __va(x) ((void *)((unsigned long)(x)+PAGE_OFFSET-__MEMORY_START))
138#else 133#else
@@ -140,6 +135,14 @@ typedef struct page *pgtable_t;
140#define __va(x) ((void *)((unsigned long)(x)+PAGE_OFFSET)) 135#define __va(x) ((void *)((unsigned long)(x)+PAGE_OFFSET))
141#endif 136#endif
142 137
138#ifdef CONFIG_UNCACHED_MAPPING
139#define UNCAC_ADDR(addr) ((addr) - PAGE_OFFSET + uncached_start)
140#define CAC_ADDR(addr) ((addr) - uncached_start + PAGE_OFFSET)
141#else
142#define UNCAC_ADDR(addr) ((addr))
143#define CAC_ADDR(addr) ((addr))
144#endif
145
143#define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) 146#define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT)
144#define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT) 147#define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT)
145 148
diff --git a/arch/sh/include/asm/pci.h b/arch/sh/include/asm/pci.h
index 67f3999b544e..1042f7f0a48b 100644
--- a/arch/sh/include/asm/pci.h
+++ b/arch/sh/include/asm/pci.h
@@ -15,20 +15,49 @@
15 */ 15 */
16struct pci_channel { 16struct pci_channel {
17 struct pci_channel *next; 17 struct pci_channel *next;
18 struct pci_bus *bus;
18 19
19 struct pci_ops *pci_ops; 20 struct pci_ops *pci_ops;
20 struct resource *io_resource; 21
21 struct resource *mem_resource; 22 struct resource *resources;
23 unsigned int nr_resources;
22 24
23 unsigned long io_offset; 25 unsigned long io_offset;
24 unsigned long mem_offset; 26 unsigned long mem_offset;
25 27
26 unsigned long reg_base; 28 unsigned long reg_base;
27
28 unsigned long io_map_base; 29 unsigned long io_map_base;
30
31 unsigned int index;
32 unsigned int need_domain_info;
33
34 /* Optional error handling */
35 struct timer_list err_timer, serr_timer;
36 unsigned int err_irq, serr_irq;
29}; 37};
30 38
31extern void register_pci_controller(struct pci_channel *hose); 39/* arch/sh/drivers/pci/pci.c */
40extern int register_pci_controller(struct pci_channel *hose);
41extern void pcibios_report_status(unsigned int status_mask, int warn);
42
43/* arch/sh/drivers/pci/common.c */
44extern int early_read_config_byte(struct pci_channel *hose, int top_bus,
45 int bus, int devfn, int offset, u8 *value);
46extern int early_read_config_word(struct pci_channel *hose, int top_bus,
47 int bus, int devfn, int offset, u16 *value);
48extern int early_read_config_dword(struct pci_channel *hose, int top_bus,
49 int bus, int devfn, int offset, u32 *value);
50extern int early_write_config_byte(struct pci_channel *hose, int top_bus,
51 int bus, int devfn, int offset, u8 value);
52extern int early_write_config_word(struct pci_channel *hose, int top_bus,
53 int bus, int devfn, int offset, u16 value);
54extern int early_write_config_dword(struct pci_channel *hose, int top_bus,
55 int bus, int devfn, int offset, u32 value);
56extern void pcibios_enable_timers(struct pci_channel *hose);
57extern unsigned int pcibios_handle_status_errors(unsigned long addr,
58 unsigned int status, struct pci_channel *hose);
59extern int pci_is_66mhz_capable(struct pci_channel *hose,
60 int top_bus, int current_bus);
32 61
33extern unsigned long PCIBIOS_MIN_IO, PCIBIOS_MIN_MEM; 62extern unsigned long PCIBIOS_MIN_IO, PCIBIOS_MIN_MEM;
34 63
@@ -99,20 +128,6 @@ static inline void pci_dma_burst_advice(struct pci_dev *pdev,
99} 128}
100#endif 129#endif
101 130
102#ifdef CONFIG_SUPERH32
103/*
104 * If we're on an SH7751 or SH7780 PCI controller, PCI memory is mapped
105 * at the end of the address space in a special non-translatable area.
106 */
107#define PCI_MEM_FIXED_START 0xfd000000
108#define PCI_MEM_FIXED_END (PCI_MEM_FIXED_START + 0x01000000)
109
110#define is_pci_memory_fixed_range(s, e) \
111 ((s) >= PCI_MEM_FIXED_START && (e) < PCI_MEM_FIXED_END)
112#else
113#define is_pci_memory_fixed_range(s, e) (0)
114#endif
115
116/* Board-specific fixup routines. */ 131/* Board-specific fixup routines. */
117int pcibios_map_platform_irq(struct pci_dev *dev, u8 slot, u8 pin); 132int pcibios_map_platform_irq(struct pci_dev *dev, u8 slot, u8 pin);
118 133
@@ -122,6 +137,14 @@ extern void pcibios_resource_to_bus(struct pci_dev *dev,
122extern void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, 137extern void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
123 struct pci_bus_region *region); 138 struct pci_bus_region *region);
124 139
140#define pci_domain_nr(bus) ((struct pci_channel *)(bus)->sysdata)->index
141
142static inline int pci_proc_domain(struct pci_bus *bus)
143{
144 struct pci_channel *hose = bus->sysdata;
145 return hose->need_domain_info;
146}
147
125/* Chances are this interrupt is wired PC-style ... */ 148/* Chances are this interrupt is wired PC-style ... */
126static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) 149static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
127{ 150{
diff --git a/arch/sh/include/asm/pgalloc.h b/arch/sh/include/asm/pgalloc.h
index 63ca37bd9a95..8c00785c60d5 100644
--- a/arch/sh/include/asm/pgalloc.h
+++ b/arch/sh/include/asm/pgalloc.h
@@ -4,8 +4,16 @@
4#include <linux/quicklist.h> 4#include <linux/quicklist.h>
5#include <asm/page.h> 5#include <asm/page.h>
6 6
7#define QUICK_PGD 0 /* We preserve special mappings over free */ 7#define QUICK_PT 0 /* Other page table pages that are zero on free */
8#define QUICK_PT 1 /* Other page table pages that are zero on free */ 8
9extern pgd_t *pgd_alloc(struct mm_struct *);
10extern void pgd_free(struct mm_struct *mm, pgd_t *pgd);
11
12#if PAGETABLE_LEVELS > 2
13extern void pud_populate(struct mm_struct *mm, pud_t *pudp, pmd_t *pmd);
14extern pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address);
15extern void pmd_free(struct mm_struct *mm, pmd_t *pmd);
16#endif
9 17
10static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, 18static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd,
11 pte_t *pte) 19 pte_t *pte)
@@ -20,28 +28,9 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd,
20} 28}
21#define pmd_pgtable(pmd) pmd_page(pmd) 29#define pmd_pgtable(pmd) pmd_page(pmd)
22 30
23static inline void pgd_ctor(void *x)
24{
25 pgd_t *pgd = x;
26
27 memcpy(pgd + USER_PTRS_PER_PGD,
28 swapper_pg_dir + USER_PTRS_PER_PGD,
29 (PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t));
30}
31
32/* 31/*
33 * Allocate and free page tables. 32 * Allocate and free page tables.
34 */ 33 */
35static inline pgd_t *pgd_alloc(struct mm_struct *mm)
36{
37 return quicklist_alloc(QUICK_PGD, GFP_KERNEL | __GFP_REPEAT, pgd_ctor);
38}
39
40static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
41{
42 quicklist_free(QUICK_PGD, NULL, pgd);
43}
44
45static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, 34static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
46 unsigned long address) 35 unsigned long address)
47{ 36{
@@ -81,7 +70,6 @@ do { \
81 70
82static inline void check_pgt_cache(void) 71static inline void check_pgt_cache(void)
83{ 72{
84 quicklist_trim(QUICK_PGD, NULL, 25, 16);
85 quicklist_trim(QUICK_PT, NULL, 25, 16); 73 quicklist_trim(QUICK_PT, NULL, 25, 16);
86} 74}
87 75
diff --git a/arch/sh/include/asm/pgtable-2level.h b/arch/sh/include/asm/pgtable-2level.h
new file mode 100644
index 000000000000..19bd89db17e7
--- /dev/null
+++ b/arch/sh/include/asm/pgtable-2level.h
@@ -0,0 +1,23 @@
1#ifndef __ASM_SH_PGTABLE_2LEVEL_H
2#define __ASM_SH_PGTABLE_2LEVEL_H
3
4#include <asm-generic/pgtable-nopmd.h>
5
6/*
7 * traditional two-level paging structure
8 */
9#define PAGETABLE_LEVELS 2
10
11/* PTE bits */
12#define PTE_MAGNITUDE 2 /* 32-bit PTEs */
13
14#define PTE_SHIFT PAGE_SHIFT
15#define PTE_BITS (PTE_SHIFT - PTE_MAGNITUDE)
16
17/* PGD bits */
18#define PGDIR_SHIFT (PTE_SHIFT + PTE_BITS)
19
20#define PTRS_PER_PGD (PAGE_SIZE / (1 << PTE_MAGNITUDE))
21#define USER_PTRS_PER_PGD (TASK_SIZE/PGDIR_SIZE)
22
23#endif /* __ASM_SH_PGTABLE_2LEVEL_H */
diff --git a/arch/sh/include/asm/pgtable-3level.h b/arch/sh/include/asm/pgtable-3level.h
new file mode 100644
index 000000000000..249a985d9648
--- /dev/null
+++ b/arch/sh/include/asm/pgtable-3level.h
@@ -0,0 +1,56 @@
1#ifndef __ASM_SH_PGTABLE_3LEVEL_H
2#define __ASM_SH_PGTABLE_3LEVEL_H
3
4#include <asm-generic/pgtable-nopud.h>
5
6/*
7 * Some cores need a 3-level page table layout, for example when using
8 * 64-bit PTEs and 4K pages.
9 */
10#define PAGETABLE_LEVELS 3
11
12#define PTE_MAGNITUDE 3 /* 64-bit PTEs on SH-X2 TLB */
13
14/* PGD bits */
15#define PGDIR_SHIFT 30
16
17#define PTRS_PER_PGD 4
18#define USER_PTRS_PER_PGD 2
19
20/* PMD bits */
21#define PMD_SHIFT (PAGE_SHIFT + (PAGE_SHIFT - PTE_MAGNITUDE))
22#define PMD_SIZE (1UL << PMD_SHIFT)
23#define PMD_MASK (~(PMD_SIZE-1))
24
25#define PTRS_PER_PMD ((1 << PGDIR_SHIFT) / PMD_SIZE)
26
27#define pmd_ERROR(e) \
28 printk("%s:%d: bad pmd %016llx.\n", __FILE__, __LINE__, pmd_val(e))
29
30typedef struct { unsigned long long pmd; } pmd_t;
31#define pmd_val(x) ((x).pmd)
32#define __pmd(x) ((pmd_t) { (x) } )
33
34static inline unsigned long pud_page_vaddr(pud_t pud)
35{
36 return pud_val(pud);
37}
38
39#define pmd_index(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1))
40static inline pmd_t *pmd_offset(pud_t *pud, unsigned long address)
41{
42 return (pmd_t *)pud_page_vaddr(*pud) + pmd_index(address);
43}
44
45#define pud_none(x) (!pud_val(x))
46#define pud_present(x) (pud_val(x))
47#define pud_clear(xp) do { set_pud(xp, __pud(0)); } while (0)
48#define pud_bad(x) (pud_val(x) & ~PAGE_MASK)
49
50/*
51 * (puds are folded into pgds so this doesn't get actually called,
52 * but the define is needed for a generic inline function.)
53 */
54#define set_pud(pudptr, pudval) do { *(pudptr) = (pudval); } while(0)
55
56#endif /* __ASM_SH_PGTABLE_3LEVEL_H */
diff --git a/arch/sh/include/asm/pgtable.h b/arch/sh/include/asm/pgtable.h
index ba3046e4f06f..02f77450cd8f 100644
--- a/arch/sh/include/asm/pgtable.h
+++ b/arch/sh/include/asm/pgtable.h
@@ -12,7 +12,11 @@
12#ifndef __ASM_SH_PGTABLE_H 12#ifndef __ASM_SH_PGTABLE_H
13#define __ASM_SH_PGTABLE_H 13#define __ASM_SH_PGTABLE_H
14 14
15#include <asm-generic/pgtable-nopmd.h> 15#ifdef CONFIG_X2TLB
16#include <asm/pgtable-3level.h>
17#else
18#include <asm/pgtable-2level.h>
19#endif
16#include <asm/page.h> 20#include <asm/page.h>
17 21
18#ifndef __ASSEMBLY__ 22#ifndef __ASSEMBLY__
@@ -51,28 +55,12 @@ static inline unsigned long long neff_sign_extend(unsigned long val)
51#define NPHYS_SIGN (1LL << (NPHYS - 1)) 55#define NPHYS_SIGN (1LL << (NPHYS - 1))
52#define NPHYS_MASK (-1LL << NPHYS) 56#define NPHYS_MASK (-1LL << NPHYS)
53 57
54/*
55 * traditional two-level paging structure
56 */
57/* PTE bits */
58#if defined(CONFIG_X2TLB) || defined(CONFIG_SUPERH64)
59# define PTE_MAGNITUDE 3 /* 64-bit PTEs on extended mode SH-X2 TLB */
60#else
61# define PTE_MAGNITUDE 2 /* 32-bit PTEs */
62#endif
63#define PTE_SHIFT PAGE_SHIFT
64#define PTE_BITS (PTE_SHIFT - PTE_MAGNITUDE)
65
66/* PGD bits */
67#define PGDIR_SHIFT (PTE_SHIFT + PTE_BITS)
68#define PGDIR_SIZE (1UL << PGDIR_SHIFT) 58#define PGDIR_SIZE (1UL << PGDIR_SHIFT)
69#define PGDIR_MASK (~(PGDIR_SIZE-1)) 59#define PGDIR_MASK (~(PGDIR_SIZE-1))
70 60
71/* Entries per level */ 61/* Entries per level */
72#define PTRS_PER_PTE (PAGE_SIZE / (1 << PTE_MAGNITUDE)) 62#define PTRS_PER_PTE (PAGE_SIZE / (1 << PTE_MAGNITUDE))
73#define PTRS_PER_PGD (PAGE_SIZE / sizeof(pgd_t))
74 63
75#define USER_PTRS_PER_PGD (TASK_SIZE/PGDIR_SIZE)
76#define FIRST_USER_ADDRESS 0 64#define FIRST_USER_ADDRESS 0
77 65
78#define PHYS_ADDR_MASK29 0x1fffffff 66#define PHYS_ADDR_MASK29 0x1fffffff
@@ -153,9 +141,9 @@ typedef pte_t *pte_addr_t;
153#define pte_pfn(x) ((unsigned long)(((x).pte_low >> PAGE_SHIFT))) 141#define pte_pfn(x) ((unsigned long)(((x).pte_low >> PAGE_SHIFT)))
154 142
155/* 143/*
156 * No page table caches to initialise 144 * Initialise the page table caches
157 */ 145 */
158#define pgtable_cache_init() do { } while (0) 146extern void pgtable_cache_init(void);
159 147
160struct vm_area_struct; 148struct vm_area_struct;
161 149
@@ -165,8 +153,9 @@ extern void __update_tlb(struct vm_area_struct *vma,
165 unsigned long address, pte_t pte); 153 unsigned long address, pte_t pte);
166 154
167static inline void 155static inline void
168update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t pte) 156update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t *ptep)
169{ 157{
158 pte_t pte = *ptep;
170 __update_cache(vma, address, pte); 159 __update_cache(vma, address, pte);
171 __update_tlb(vma, address, pte); 160 __update_tlb(vma, address, pte);
172} 161}
diff --git a/arch/sh/include/asm/pgtable_32.h b/arch/sh/include/asm/pgtable_32.h
index 5003ee86f67b..e172d696e52b 100644
--- a/arch/sh/include/asm/pgtable_32.h
+++ b/arch/sh/include/asm/pgtable_32.h
@@ -71,6 +71,8 @@
71#define _PAGE_EXT_KERN_WRITE 0x1000 /* EPR4-bit: Kernel space writable */ 71#define _PAGE_EXT_KERN_WRITE 0x1000 /* EPR4-bit: Kernel space writable */
72#define _PAGE_EXT_KERN_READ 0x2000 /* EPR5-bit: Kernel space readable */ 72#define _PAGE_EXT_KERN_READ 0x2000 /* EPR5-bit: Kernel space readable */
73 73
74#define _PAGE_EXT_WIRED 0x4000 /* software: Wire TLB entry */
75
74/* Wrapper for extended mode pgprot twiddling */ 76/* Wrapper for extended mode pgprot twiddling */
75#define _PAGE_EXT(x) ((unsigned long long)(x) << 32) 77#define _PAGE_EXT(x) ((unsigned long long)(x) << 32)
76 78
@@ -141,12 +143,14 @@ static inline unsigned long copy_ptea_attributes(unsigned long x)
141# elif defined(CONFIG_HUGETLB_PAGE_SIZE_64MB) 143# elif defined(CONFIG_HUGETLB_PAGE_SIZE_64MB)
142# define _PAGE_SZHUGE (_PAGE_EXT_ESZ2 | _PAGE_EXT_ESZ3) 144# define _PAGE_SZHUGE (_PAGE_EXT_ESZ2 | _PAGE_EXT_ESZ3)
143# endif 145# endif
146# define _PAGE_WIRED (_PAGE_EXT(_PAGE_EXT_WIRED))
144#else 147#else
145# if defined(CONFIG_HUGETLB_PAGE_SIZE_64K) 148# if defined(CONFIG_HUGETLB_PAGE_SIZE_64K)
146# define _PAGE_SZHUGE (_PAGE_SZ1) 149# define _PAGE_SZHUGE (_PAGE_SZ1)
147# elif defined(CONFIG_HUGETLB_PAGE_SIZE_1MB) 150# elif defined(CONFIG_HUGETLB_PAGE_SIZE_1MB)
148# define _PAGE_SZHUGE (_PAGE_SZ0 | _PAGE_SZ1) 151# define _PAGE_SZHUGE (_PAGE_SZ0 | _PAGE_SZ1)
149# endif 152# endif
153# define _PAGE_WIRED (0)
150#endif 154#endif
151 155
152/* 156/*
diff --git a/arch/sh/include/asm/pgtable_64.h b/arch/sh/include/asm/pgtable_64.h
index 17cdbecc3adc..0ee46776dad6 100644
--- a/arch/sh/include/asm/pgtable_64.h
+++ b/arch/sh/include/asm/pgtable_64.h
@@ -43,11 +43,6 @@ static __inline__ void set_pte(pte_t *pteptr, pte_t pteval)
43} 43}
44#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval) 44#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval)
45 45
46static __inline__ void pmd_set(pmd_t *pmdp,pte_t *ptep)
47{
48 pmd_val(*pmdp) = (unsigned long) ptep;
49}
50
51/* 46/*
52 * PGD defines. Top level. 47 * PGD defines. Top level.
53 */ 48 */
@@ -128,8 +123,21 @@ static __inline__ void pmd_set(pmd_t *pmdp,pte_t *ptep)
128#define _PAGE_DIRTY 0x400 /* software: page accessed in write */ 123#define _PAGE_DIRTY 0x400 /* software: page accessed in write */
129#define _PAGE_ACCESSED 0x800 /* software: page referenced */ 124#define _PAGE_ACCESSED 0x800 /* software: page referenced */
130 125
126/* Wrapper for extended mode pgprot twiddling */
127#define _PAGE_EXT(x) ((unsigned long long)(x) << 32)
128
129/*
130 * We can use the sign-extended bits in the PTEL to get 32 bits of
131 * software flags. This works for now because no implementations uses
132 * anything above the PPN field.
133 */
134#define _PAGE_WIRED _PAGE_EXT(0x001) /* software: wire the tlb entry */
135
136#define _PAGE_CLEAR_FLAGS (_PAGE_PRESENT | _PAGE_FILE | _PAGE_SHARED | \
137 _PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_WIRED)
138
131/* Mask which drops software flags */ 139/* Mask which drops software flags */
132#define _PAGE_FLAGS_HARDWARE_MASK 0xfffffffffffff3dbLL 140#define _PAGE_FLAGS_HARDWARE_MASK (NEFF_MASK & ~(_PAGE_CLEAR_FLAGS))
133 141
134/* 142/*
135 * HugeTLB support 143 * HugeTLB support
@@ -203,12 +211,6 @@ static __inline__ void pmd_set(pmd_t *pmdp,pte_t *ptep)
203#define pgprot_writecombine(prot) __pgprot(pgprot_val(prot) & ~_PAGE_CACHABLE) 211#define pgprot_writecombine(prot) __pgprot(pgprot_val(prot) & ~_PAGE_CACHABLE)
204 212
205/* 213/*
206 * Handling allocation failures during page table setup.
207 */
208extern void __handle_bad_pmd_kernel(pmd_t * pmd);
209#define __handle_bad_pmd(x) __handle_bad_pmd_kernel(x)
210
211/*
212 * PTE level access routines. 214 * PTE level access routines.
213 * 215 *
214 * Note1: 216 * Note1:
diff --git a/arch/sh/include/asm/processor.h b/arch/sh/include/asm/processor.h
index 017e0c1807b2..9605e062840f 100644
--- a/arch/sh/include/asm/processor.h
+++ b/arch/sh/include/asm/processor.h
@@ -98,13 +98,34 @@ extern struct sh_cpuinfo cpu_data[];
98 98
99/* Forward decl */ 99/* Forward decl */
100struct seq_operations; 100struct seq_operations;
101struct task_struct;
101 102
102extern struct pt_regs fake_swapper_regs; 103extern struct pt_regs fake_swapper_regs;
103 104
105/* arch/sh/kernel/process.c */
106extern unsigned int xstate_size;
107extern void free_thread_xstate(struct task_struct *);
108extern struct kmem_cache *task_xstate_cachep;
109
110/* arch/sh/mm/alignment.c */
111extern int get_unalign_ctl(struct task_struct *, unsigned long addr);
112extern int set_unalign_ctl(struct task_struct *, unsigned int val);
113
114#define GET_UNALIGN_CTL(tsk, addr) get_unalign_ctl((tsk), (addr))
115#define SET_UNALIGN_CTL(tsk, val) set_unalign_ctl((tsk), (val))
116
117/* arch/sh/mm/init.c */
118extern unsigned int mem_init_done;
119
104/* arch/sh/kernel/setup.c */ 120/* arch/sh/kernel/setup.c */
105const char *get_cpu_subtype(struct sh_cpuinfo *c); 121const char *get_cpu_subtype(struct sh_cpuinfo *c);
106extern const struct seq_operations cpuinfo_op; 122extern const struct seq_operations cpuinfo_op;
107 123
124/* thread_struct flags */
125#define SH_THREAD_UAC_NOPRINT (1 << 0)
126#define SH_THREAD_UAC_SIGBUS (1 << 1)
127#define SH_THREAD_UAC_MASK (SH_THREAD_UAC_NOPRINT | SH_THREAD_UAC_SIGBUS)
128
108/* processor boot mode configuration */ 129/* processor boot mode configuration */
109#define MODE_PIN0 (1 << 0) 130#define MODE_PIN0 (1 << 0)
110#define MODE_PIN1 (1 << 1) 131#define MODE_PIN1 (1 << 1)
diff --git a/arch/sh/include/asm/processor_32.h b/arch/sh/include/asm/processor_32.h
index 1f3d6fab660c..572b4eb09493 100644
--- a/arch/sh/include/asm/processor_32.h
+++ b/arch/sh/include/asm/processor_32.h
@@ -14,6 +14,7 @@
14#include <asm/page.h> 14#include <asm/page.h>
15#include <asm/types.h> 15#include <asm/types.h>
16#include <asm/ptrace.h> 16#include <asm/ptrace.h>
17#include <asm/hw_breakpoint.h>
17 18
18/* 19/*
19 * Default implementation of macro that returns current 20 * Default implementation of macro that returns current
@@ -90,9 +91,9 @@ struct sh_fpu_soft_struct {
90 unsigned long entry_pc; 91 unsigned long entry_pc;
91}; 92};
92 93
93union sh_fpu_union { 94union thread_xstate {
94 struct sh_fpu_hard_struct hard; 95 struct sh_fpu_hard_struct hardfpu;
95 struct sh_fpu_soft_struct soft; 96 struct sh_fpu_soft_struct softfpu;
96}; 97};
97 98
98struct thread_struct { 99struct thread_struct {
@@ -100,38 +101,30 @@ struct thread_struct {
100 unsigned long sp; 101 unsigned long sp;
101 unsigned long pc; 102 unsigned long pc;
102 103
103 /* Hardware debugging registers */ 104 /* Various thread flags, see SH_THREAD_xxx */
104 unsigned long ubc_pc; 105 unsigned long flags;
105 106
106 /* floating point info */ 107 /* Save middle states of ptrace breakpoints */
107 union sh_fpu_union fpu; 108 struct perf_event *ptrace_bps[HBP_NUM];
108 109
109#ifdef CONFIG_SH_DSP 110#ifdef CONFIG_SH_DSP
110 /* Dsp status information */ 111 /* Dsp status information */
111 struct sh_dsp_struct dsp_status; 112 struct sh_dsp_struct dsp_status;
112#endif 113#endif
113};
114 114
115/* Count of active tasks with UBC settings */ 115 /* Extended processor state */
116extern int ubc_usercnt; 116 union thread_xstate *xstate;
117};
117 118
118#define INIT_THREAD { \ 119#define INIT_THREAD { \
119 .sp = sizeof(init_stack) + (long) &init_stack, \ 120 .sp = sizeof(init_stack) + (long) &init_stack, \
121 .flags = 0, \
120} 122}
121 123
122/*
123 * Do necessary setup to start up a newly executed thread.
124 */
125#define start_thread(_regs, new_pc, new_sp) \
126 set_fs(USER_DS); \
127 _regs->pr = 0; \
128 _regs->sr = SR_FD; /* User mode. */ \
129 _regs->pc = new_pc; \
130 _regs->regs[15] = new_sp
131
132/* Forward declaration, a strange C thing */ 124/* Forward declaration, a strange C thing */
133struct task_struct; 125struct task_struct;
134struct mm_struct; 126
127extern void start_thread(struct pt_regs *regs, unsigned long new_pc, unsigned long new_sp);
135 128
136/* Free all resources held by a thread. */ 129/* Free all resources held by a thread. */
137extern void release_thread(struct task_struct *); 130extern void release_thread(struct task_struct *);
diff --git a/arch/sh/include/asm/processor_64.h b/arch/sh/include/asm/processor_64.h
index 5727d31b0ccf..621bc4618c6b 100644
--- a/arch/sh/include/asm/processor_64.h
+++ b/arch/sh/include/asm/processor_64.h
@@ -87,26 +87,31 @@ struct sh_fpu_hard_struct {
87 /* long status; * software status information */ 87 /* long status; * software status information */
88}; 88};
89 89
90#if 0
91/* Dummy fpu emulator */ 90/* Dummy fpu emulator */
92struct sh_fpu_soft_struct { 91struct sh_fpu_soft_struct {
93 unsigned long long fp_regs[32]; 92 unsigned long fp_regs[64];
94 unsigned int fpscr; 93 unsigned int fpscr;
95 unsigned char lookahead; 94 unsigned char lookahead;
96 unsigned long entry_pc; 95 unsigned long entry_pc;
97}; 96};
98#endif
99 97
100union sh_fpu_union { 98union thread_xstate {
101 struct sh_fpu_hard_struct hard; 99 struct sh_fpu_hard_struct hardfpu;
102 /* 'hard' itself only produces 32 bit alignment, yet we need 100 struct sh_fpu_soft_struct softfpu;
103 to access it using 64 bit load/store as well. */ 101 /*
102 * The structure definitions only produce 32 bit alignment, yet we need
103 * to access them using 64 bit load/store as well.
104 */
104 unsigned long long alignment_dummy; 105 unsigned long long alignment_dummy;
105}; 106};
106 107
107struct thread_struct { 108struct thread_struct {
108 unsigned long sp; 109 unsigned long sp;
109 unsigned long pc; 110 unsigned long pc;
111
112 /* Various thread flags, see SH_THREAD_xxx */
113 unsigned long flags;
114
110 /* This stores the address of the pt_regs built during a context 115 /* This stores the address of the pt_regs built during a context
111 switch, or of the register save area built for a kernel mode 116 switch, or of the register save area built for a kernel mode
112 exception. It is used for backtracing the stack of a sleeping task 117 exception. It is used for backtracing the stack of a sleeping task
@@ -122,7 +127,7 @@ struct thread_struct {
122 /* Hardware debugging registers may come here */ 127 /* Hardware debugging registers may come here */
123 128
124 /* floating point info */ 129 /* floating point info */
125 union sh_fpu_union fpu; 130 union thread_xstate *xstate;
126}; 131};
127 132
128#define INIT_MMAP \ 133#define INIT_MMAP \
@@ -137,7 +142,7 @@ struct thread_struct {
137 .trap_no = 0, \ 142 .trap_no = 0, \
138 .error_code = 0, \ 143 .error_code = 0, \
139 .address = 0, \ 144 .address = 0, \
140 .fpu = { { { 0, } }, } \ 145 .flags = 0, \
141} 146}
142 147
143/* 148/*
diff --git a/arch/sh/include/asm/ptrace.h b/arch/sh/include/asm/ptrace.h
index 1dc12cb44a2d..e11b14ea2c43 100644
--- a/arch/sh/include/asm/ptrace.h
+++ b/arch/sh/include/asm/ptrace.h
@@ -102,13 +102,15 @@ struct pt_dspregs {
102#define PTRACE_GETDSPREGS 55 /* DSP registers */ 102#define PTRACE_GETDSPREGS 55 /* DSP registers */
103#define PTRACE_SETDSPREGS 56 103#define PTRACE_SETDSPREGS 56
104 104
105#define PT_TEXT_END_ADDR 240 105#define PT_TEXT_END_ADDR 240
106#define PT_TEXT_ADDR 244 /* &(struct user)->start_code */ 106#define PT_TEXT_ADDR 244 /* &(struct user)->start_code */
107#define PT_DATA_ADDR 248 /* &(struct user)->start_data */ 107#define PT_DATA_ADDR 248 /* &(struct user)->start_data */
108#define PT_TEXT_LEN 252 108#define PT_TEXT_LEN 252
109 109
110#ifdef __KERNEL__ 110#ifdef __KERNEL__
111#include <asm/addrspace.h> 111#include <asm/addrspace.h>
112#include <asm/page.h>
113#include <asm/system.h>
112 114
113#define user_mode(regs) (((regs)->sr & 0x40000000)==0) 115#define user_mode(regs) (((regs)->sr & 0x40000000)==0)
114#define instruction_pointer(regs) ((unsigned long)(regs)->pc) 116#define instruction_pointer(regs) ((unsigned long)(regs)->pc)
@@ -124,6 +126,12 @@ struct task_struct;
124extern void user_enable_single_step(struct task_struct *); 126extern void user_enable_single_step(struct task_struct *);
125extern void user_disable_single_step(struct task_struct *); 127extern void user_disable_single_step(struct task_struct *);
126 128
129struct perf_event;
130struct perf_sample_data;
131
132extern void ptrace_triggered(struct perf_event *bp, int nmi,
133 struct perf_sample_data *data, struct pt_regs *regs);
134
127#define task_pt_regs(task) \ 135#define task_pt_regs(task) \
128 ((struct pt_regs *) (task_stack_page(task) + THREAD_SIZE) - 1) 136 ((struct pt_regs *) (task_stack_page(task) + THREAD_SIZE) - 1)
129 137
@@ -131,10 +139,8 @@ static inline unsigned long profile_pc(struct pt_regs *regs)
131{ 139{
132 unsigned long pc = instruction_pointer(regs); 140 unsigned long pc = instruction_pointer(regs);
133 141
134#ifdef P2SEG 142 if (virt_addr_uncached(pc))
135 if (pc >= P2SEG && pc < P3SEG) 143 return CAC_ADDR(pc);
136 pc -= 0x20000000;
137#endif
138 144
139 return pc; 145 return pc;
140} 146}
diff --git a/arch/sh/include/asm/reboot.h b/arch/sh/include/asm/reboot.h
new file mode 100644
index 000000000000..b3da0c63fc3d
--- /dev/null
+++ b/arch/sh/include/asm/reboot.h
@@ -0,0 +1,21 @@
1#ifndef __ASM_SH_REBOOT_H
2#define __ASM_SH_REBOOT_H
3
4#include <linux/kdebug.h>
5
6struct pt_regs;
7
8struct machine_ops {
9 void (*restart)(char *cmd);
10 void (*halt)(void);
11 void (*power_off)(void);
12 void (*shutdown)(void);
13 void (*crash_shutdown)(struct pt_regs *);
14};
15
16extern struct machine_ops machine_ops;
17
18/* arch/sh/kernel/machine_kexec.c */
19void native_machine_crash_shutdown(struct pt_regs *regs);
20
21#endif /* __ASM_SH_REBOOT_H */
diff --git a/arch/sh/include/asm/setup.h b/arch/sh/include/asm/setup.h
index ce3743599b27..4758325bb24a 100644
--- a/arch/sh/include/asm/setup.h
+++ b/arch/sh/include/asm/setup.h
@@ -18,7 +18,6 @@
18/* ... */ 18/* ... */
19#define COMMAND_LINE ((char *) (PARAM+0x100)) 19#define COMMAND_LINE ((char *) (PARAM+0x100))
20 20
21int setup_early_printk(char *);
22void sh_mv_setup(void); 21void sh_mv_setup(void);
23 22
24#endif /* __KERNEL__ */ 23#endif /* __KERNEL__ */
diff --git a/arch/sh/include/asm/sh_bios.h b/arch/sh/include/asm/sh_bios.h
index d9c96d7cf6c7..95714c28422b 100644
--- a/arch/sh/include/asm/sh_bios.h
+++ b/arch/sh/include/asm/sh_bios.h
@@ -1,18 +1,27 @@
1#ifndef __ASM_SH_BIOS_H 1#ifndef __ASM_SH_BIOS_H
2#define __ASM_SH_BIOS_H 2#define __ASM_SH_BIOS_H
3 3
4#ifdef CONFIG_SH_STANDARD_BIOS
5
4/* 6/*
5 * Copyright (C) 2000 Greg Banks, Mitch Davis 7 * Copyright (C) 2000 Greg Banks, Mitch Davis
6 * C API to interface to the standard LinuxSH BIOS 8 * C API to interface to the standard LinuxSH BIOS
7 * usually from within the early stages of kernel boot. 9 * usually from within the early stages of kernel boot.
8 */ 10 */
9
10
11extern void sh_bios_console_write(const char *buf, unsigned int len); 11extern void sh_bios_console_write(const char *buf, unsigned int len);
12extern void sh_bios_char_out(char ch);
13extern void sh_bios_gdb_detach(void); 12extern void sh_bios_gdb_detach(void);
14 13
15extern void sh_bios_get_node_addr(unsigned char *node_addr); 14extern void sh_bios_get_node_addr(unsigned char *node_addr);
16extern void sh_bios_shutdown(unsigned int how); 15extern void sh_bios_shutdown(unsigned int how);
17 16
17extern void sh_bios_vbr_init(void);
18extern void sh_bios_vbr_reload(void);
19
20#else
21
22static inline void sh_bios_vbr_init(void) { }
23static inline void sh_bios_vbr_reload(void) { }
24
25#endif /* CONFIG_SH_STANDARD_BIOS */
26
18#endif /* __ASM_SH_BIOS_H */ 27#endif /* __ASM_SH_BIOS_H */
diff --git a/arch/sh/include/asm/siu.h b/arch/sh/include/asm/siu.h
new file mode 100644
index 000000000000..57565a3b551f
--- /dev/null
+++ b/arch/sh/include/asm/siu.h
@@ -0,0 +1,26 @@
1/*
2 * platform header for the SIU ASoC driver
3 *
4 * Copyright (C) 2009-2010 Guennadi Liakhovetski <g.liakhovetski@gmx.de>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef ASM_SIU_H
12#define ASM_SIU_H
13
14#include <asm/dma-sh.h>
15
16struct device;
17
18struct siu_platform {
19 struct device *dma_dev;
20 enum sh_dmae_slave_chan_id dma_slave_tx_a;
21 enum sh_dmae_slave_chan_id dma_slave_rx_a;
22 enum sh_dmae_slave_chan_id dma_slave_tx_b;
23 enum sh_dmae_slave_chan_id dma_slave_rx_b;
24};
25
26#endif /* ASM_SIU_H */
diff --git a/arch/sh/include/asm/suspend.h b/arch/sh/include/asm/suspend.h
index fe9c2a1ad047..64eb41a063e8 100644
--- a/arch/sh/include/asm/suspend.h
+++ b/arch/sh/include/asm/suspend.h
@@ -92,5 +92,6 @@ extern unsigned long sh_mobile_sleep_supported;
92#define SUSP_SH_USTANDBY (1 << 3) /* SH-Mobile U-standby mode */ 92#define SUSP_SH_USTANDBY (1 << 3) /* SH-Mobile U-standby mode */
93#define SUSP_SH_SF (1 << 4) /* Enable self-refresh */ 93#define SUSP_SH_SF (1 << 4) /* Enable self-refresh */
94#define SUSP_SH_MMU (1 << 5) /* Save/restore MMU and cache */ 94#define SUSP_SH_MMU (1 << 5) /* Save/restore MMU and cache */
95#define SUSP_SH_REGS (1 << 6) /* Save/restore registers */
95 96
96#endif /* _ASM_SH_SUSPEND_H */ 97#endif /* _ASM_SH_SUSPEND_H */
diff --git a/arch/sh/include/asm/syscall.h b/arch/sh/include/asm/syscall.h
index 6a381429ee9d..aa7777bdc370 100644
--- a/arch/sh/include/asm/syscall.h
+++ b/arch/sh/include/asm/syscall.h
@@ -1,6 +1,8 @@
1#ifndef __ASM_SH_SYSCALL_H 1#ifndef __ASM_SH_SYSCALL_H
2#define __ASM_SH_SYSCALL_H 2#define __ASM_SH_SYSCALL_H
3 3
4extern const unsigned long sys_call_table[];
5
4#ifdef CONFIG_SUPERH32 6#ifdef CONFIG_SUPERH32
5# include "syscall_32.h" 7# include "syscall_32.h"
6#else 8#else
diff --git a/arch/sh/include/asm/system.h b/arch/sh/include/asm/system.h
index c15415b4b169..0bd7a17d5e1a 100644
--- a/arch/sh/include/asm/system.h
+++ b/arch/sh/include/asm/system.h
@@ -10,7 +10,6 @@
10#include <linux/compiler.h> 10#include <linux/compiler.h>
11#include <linux/linkage.h> 11#include <linux/linkage.h>
12#include <asm/types.h> 12#include <asm/types.h>
13#include <asm/ptrace.h>
14 13
15#define AT_VECTOR_SIZE_ARCH 5 /* entries in ARCH_DLINFO */ 14#define AT_VECTOR_SIZE_ARCH 5 /* entries in ARCH_DLINFO */
16 15
@@ -32,7 +31,7 @@
32#define mb() __asm__ __volatile__ ("synco": : :"memory") 31#define mb() __asm__ __volatile__ ("synco": : :"memory")
33#define rmb() mb() 32#define rmb() mb()
34#define wmb() __asm__ __volatile__ ("synco": : :"memory") 33#define wmb() __asm__ __volatile__ ("synco": : :"memory")
35#define ctrl_barrier() __icbi(0xa8000000) 34#define ctrl_barrier() __icbi(PAGE_OFFSET)
36#define read_barrier_depends() do { } while(0) 35#define read_barrier_depends() do { } while(0)
37#else 36#else
38#define mb() __asm__ __volatile__ ("": : :"memory") 37#define mb() __asm__ __volatile__ ("": : :"memory")
@@ -114,6 +113,8 @@ static inline unsigned long __cmpxchg(volatile void * ptr, unsigned long old,
114 (unsigned long)_n_, sizeof(*(ptr))); \ 113 (unsigned long)_n_, sizeof(*(ptr))); \
115 }) 114 })
116 115
116struct pt_regs;
117
117extern void die(const char *str, struct pt_regs *regs, long err) __attribute__ ((noreturn)); 118extern void die(const char *str, struct pt_regs *regs, long err) __attribute__ ((noreturn));
118void free_initmem(void); 119void free_initmem(void);
119void free_initrd_mem(unsigned long start, unsigned long end); 120void free_initrd_mem(unsigned long start, unsigned long end);
@@ -137,14 +138,14 @@ extern unsigned int instruction_size(unsigned int insn);
137#endif 138#endif
138 139
139extern unsigned long cached_to_uncached; 140extern unsigned long cached_to_uncached;
141extern unsigned long uncached_size;
140 142
141extern struct dentry *sh_debugfs_root; 143extern struct dentry *sh_debugfs_root;
142 144
143void per_cpu_trap_init(void); 145void per_cpu_trap_init(void);
144void default_idle(void); 146void default_idle(void);
145void cpu_idle_wait(void); 147void cpu_idle_wait(void);
146 148void stop_this_cpu(void *);
147asmlinkage void break_point_trap(void);
148 149
149#ifdef CONFIG_SUPERH32 150#ifdef CONFIG_SUPERH32
150#define BUILD_TRAP_HANDLER(name) \ 151#define BUILD_TRAP_HANDLER(name) \
diff --git a/arch/sh/include/asm/system_32.h b/arch/sh/include/asm/system_32.h
index 06814f5b59c7..51296b36770e 100644
--- a/arch/sh/include/asm/system_32.h
+++ b/arch/sh/include/asm/system_32.h
@@ -2,6 +2,7 @@
2#define __ASM_SH_SYSTEM_32_H 2#define __ASM_SH_SYSTEM_32_H
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5#include <asm/mmu.h>
5 6
6#ifdef CONFIG_SH_DSP 7#ifdef CONFIG_SH_DSP
7 8
@@ -144,9 +145,6 @@ do { \
144 __restore_dsp(prev); \ 145 __restore_dsp(prev); \
145} while (0) 146} while (0)
146 147
147#define __uses_jump_to_uncached \
148 noinline __attribute__ ((__section__ (".uncached.text")))
149
150/* 148/*
151 * Jump to uncached area. 149 * Jump to uncached area.
152 * When handling TLB or caches, we need to do it from an uncached area. 150 * When handling TLB or caches, we need to do it from an uncached area.
@@ -216,6 +214,17 @@ static inline reg_size_t register_align(void *val)
216int handle_unaligned_access(insn_size_t instruction, struct pt_regs *regs, 214int handle_unaligned_access(insn_size_t instruction, struct pt_regs *regs,
217 struct mem_access *ma, int); 215 struct mem_access *ma, int);
218 216
217static inline void trigger_address_error(void)
218{
219 if (__in_29bit_mode())
220 __asm__ __volatile__ (
221 "ldc %0, sr\n\t"
222 "mov.l @%1, %0"
223 :
224 : "r" (0x10000000), "r" (0x80000001)
225 );
226}
227
219asmlinkage void do_address_error(struct pt_regs *regs, 228asmlinkage void do_address_error(struct pt_regs *regs,
220 unsigned long writeaccess, 229 unsigned long writeaccess,
221 unsigned long address); 230 unsigned long address);
diff --git a/arch/sh/include/asm/system_64.h b/arch/sh/include/asm/system_64.h
index ab1dd917ea87..36338646dfc8 100644
--- a/arch/sh/include/asm/system_64.h
+++ b/arch/sh/include/asm/system_64.h
@@ -18,6 +18,7 @@
18/* 18/*
19 * switch_to() should switch tasks to task nr n, first 19 * switch_to() should switch tasks to task nr n, first
20 */ 20 */
21struct thread_struct;
21struct task_struct *sh64_switch_to(struct task_struct *prev, 22struct task_struct *sh64_switch_to(struct task_struct *prev,
22 struct thread_struct *prev_thread, 23 struct thread_struct *prev_thread,
23 struct task_struct *next, 24 struct task_struct *next,
@@ -33,8 +34,6 @@ do { \
33 &next->thread); \ 34 &next->thread); \
34} while (0) 35} while (0)
35 36
36#define __uses_jump_to_uncached
37
38#define jump_to_uncached() do { } while (0) 37#define jump_to_uncached() do { } while (0)
39#define back_to_cached() do { } while (0) 38#define back_to_cached() do { } while (0)
40 39
@@ -48,6 +47,13 @@ static inline reg_size_t register_align(void *val)
48 return (unsigned long long)(signed long long)(signed long)val; 47 return (unsigned long long)(signed long long)(signed long)val;
49} 48}
50 49
50extern void phys_stext(void);
51
52static inline void trigger_address_error(void)
53{
54 phys_stext();
55}
56
51#define SR_BL_LL 0x0000000010000000LL 57#define SR_BL_LL 0x0000000010000000LL
52 58
53static inline void set_bl_bit(void) 59static inline void set_bl_bit(void)
diff --git a/arch/sh/include/asm/thread_info.h b/arch/sh/include/asm/thread_info.h
index 1f3d927e2265..55a36fef6875 100644
--- a/arch/sh/include/asm/thread_info.h
+++ b/arch/sh/include/asm/thread_info.h
@@ -93,14 +93,16 @@ static inline struct thread_info *current_thread_info(void)
93 93
94#define THREAD_SIZE_ORDER (THREAD_SHIFT - PAGE_SHIFT) 94#define THREAD_SIZE_ORDER (THREAD_SHIFT - PAGE_SHIFT)
95 95
96#else /* THREAD_SHIFT < PAGE_SHIFT */ 96#endif
97
98#define __HAVE_ARCH_THREAD_INFO_ALLOCATOR
99 97
100extern struct thread_info *alloc_thread_info(struct task_struct *tsk); 98extern struct thread_info *alloc_thread_info(struct task_struct *tsk);
101extern void free_thread_info(struct thread_info *ti); 99extern void free_thread_info(struct thread_info *ti);
100extern void arch_task_cache_init(void);
101#define arch_task_cache_init arch_task_cache_init
102extern int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src);
103extern void init_thread_xstate(void);
102 104
103#endif /* THREAD_SHIFT < PAGE_SHIFT */ 105#define __HAVE_ARCH_THREAD_INFO_ALLOCATOR
104 106
105#endif /* __ASSEMBLY__ */ 107#endif /* __ASSEMBLY__ */
106 108
diff --git a/arch/sh/include/asm/tlb.h b/arch/sh/include/asm/tlb.h
index da8fe7ab8728..75abb38dffd5 100644
--- a/arch/sh/include/asm/tlb.h
+++ b/arch/sh/include/asm/tlb.h
@@ -11,6 +11,7 @@
11#ifdef CONFIG_MMU 11#ifdef CONFIG_MMU
12#include <asm/pgalloc.h> 12#include <asm/pgalloc.h>
13#include <asm/tlbflush.h> 13#include <asm/tlbflush.h>
14#include <asm/mmu_context.h>
14 15
15/* 16/*
16 * TLB handling. This allows us to remove pages from the page 17 * TLB handling. This allows us to remove pages from the page
@@ -97,6 +98,22 @@ tlb_end_vma(struct mmu_gather *tlb, struct vm_area_struct *vma)
97 98
98#define tlb_migrate_finish(mm) do { } while (0) 99#define tlb_migrate_finish(mm) do { } while (0)
99 100
101#if defined(CONFIG_CPU_SH4) || defined(CONFIG_SUPERH64)
102extern void tlb_wire_entry(struct vm_area_struct *, unsigned long, pte_t);
103extern void tlb_unwire_entry(void);
104#else
105static inline void tlb_wire_entry(struct vm_area_struct *vma ,
106 unsigned long addr, pte_t pte)
107{
108 BUG();
109}
110
111static inline void tlb_unwire_entry(void)
112{
113 BUG();
114}
115#endif
116
100#else /* CONFIG_MMU */ 117#else /* CONFIG_MMU */
101 118
102#define tlb_start_vma(tlb, vma) do { } while (0) 119#define tlb_start_vma(tlb, vma) do { } while (0)
diff --git a/arch/sh/include/asm/ubc.h b/arch/sh/include/asm/ubc.h
deleted file mode 100644
index 9bf961684431..000000000000
--- a/arch/sh/include/asm/ubc.h
+++ /dev/null
@@ -1,64 +0,0 @@
1/*
2 * include/asm-sh/ubc.h
3 *
4 * Copyright (C) 1999 Niibe Yutaka
5 * Copyright (C) 2002, 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 __ASM_SH_UBC_H
12#define __ASM_SH_UBC_H
13#ifdef __KERNEL__
14
15#include <cpu/ubc.h>
16
17/* User Break Controller */
18#if defined(CONFIG_CPU_SUBTYPE_SH7707) || defined(CONFIG_CPU_SUBTYPE_SH7709)
19#define UBC_TYPE_SH7729 (current_cpu_data.type == CPU_SH7729)
20#else
21#define UBC_TYPE_SH7729 0
22#endif
23
24#define BAMR_ASID (1 << 2)
25#define BAMR_NONE 0
26#define BAMR_10 0x1
27#define BAMR_12 0x2
28#define BAMR_ALL 0x3
29#define BAMR_16 0x8
30#define BAMR_20 0x9
31
32#define BBR_INST (1 << 4)
33#define BBR_DATA (2 << 4)
34#define BBR_READ (1 << 2)
35#define BBR_WRITE (2 << 2)
36#define BBR_BYTE 0x1
37#define BBR_HALF 0x2
38#define BBR_LONG 0x3
39#define BBR_QUAD (1 << 6) /* SH7750 */
40#define BBR_CPU (1 << 6) /* SH7709A,SH7729 */
41#define BBR_DMA (2 << 6) /* SH7709A,SH7729 */
42
43#define BRCR_CMFA (1 << 15)
44#define BRCR_CMFB (1 << 14)
45
46#if defined CONFIG_CPU_SH2A
47#define BRCR_CMFCA (1 << 15)
48#define BRCR_CMFCB (1 << 14)
49#define BRCR_CMFDA (1 << 13)
50#define BRCR_CMFDB (1 << 12)
51#define BRCR_PCBB (1 << 6) /* 1: after execution */
52#define BRCR_PCBA (1 << 5) /* 1: after execution */
53#define BRCR_PCTE 0
54#else
55#define BRCR_PCTE (1 << 11)
56#define BRCR_PCBA (1 << 10) /* 1: after execution */
57#define BRCR_DBEB (1 << 7)
58#define BRCR_PCBB (1 << 6)
59#define BRCR_SEQ (1 << 3)
60#define BRCR_UBDE (1 << 0)
61#endif
62
63#endif /* __KERNEL__ */
64#endif /* __ASM_SH_UBC_H */
diff --git a/arch/sh/include/asm/uncached.h b/arch/sh/include/asm/uncached.h
new file mode 100644
index 000000000000..e3419f96626a
--- /dev/null
+++ b/arch/sh/include/asm/uncached.h
@@ -0,0 +1,18 @@
1#ifndef __ASM_SH_UNCACHED_H
2#define __ASM_SH_UNCACHED_H
3
4#include <linux/bug.h>
5
6#ifdef CONFIG_UNCACHED_MAPPING
7extern unsigned long uncached_start, uncached_end;
8
9extern int virt_addr_uncached(unsigned long kaddr);
10extern void uncached_init(void);
11extern void uncached_resize(unsigned long size);
12#else
13#define virt_addr_uncached(kaddr) (0)
14#define uncached_init() do { } while (0)
15#define uncached_resize(size) BUG()
16#endif
17
18#endif /* __ASM_SH_UNCACHED_H */
diff --git a/arch/sh/include/asm/vmlinux.lds.h b/arch/sh/include/asm/vmlinux.lds.h
index 244ec4ad9a79..d58ad493b3a6 100644
--- a/arch/sh/include/asm/vmlinux.lds.h
+++ b/arch/sh/include/asm/vmlinux.lds.h
@@ -14,4 +14,12 @@
14#define DWARF_EH_FRAME 14#define DWARF_EH_FRAME
15#endif 15#endif
16 16
17#ifdef CONFIG_SUPERH64
18#define EXTRA_TEXT \
19 *(.text64) \
20 *(.text..SHmedia32)
21#else
22#define EXTRA_TEXT
23#endif
24
17#endif /* __ASM_SH_VMLINUX_LDS_H */ 25#endif /* __ASM_SH_VMLINUX_LDS_H */
diff --git a/arch/sh/include/asm/watchdog.h b/arch/sh/include/asm/watchdog.h
index 19dfff5c8511..85a7aca7fb8f 100644
--- a/arch/sh/include/asm/watchdog.h
+++ b/arch/sh/include/asm/watchdog.h
@@ -70,7 +70,7 @@
70 */ 70 */
71static inline __u32 sh_wdt_read_cnt(void) 71static inline __u32 sh_wdt_read_cnt(void)
72{ 72{
73 return ctrl_inl(WTCNT_R); 73 return __raw_readl(WTCNT_R);
74} 74}
75 75
76/** 76/**
@@ -82,7 +82,7 @@ static inline __u32 sh_wdt_read_cnt(void)
82 */ 82 */
83static inline void sh_wdt_write_cnt(__u32 val) 83static inline void sh_wdt_write_cnt(__u32 val)
84{ 84{
85 ctrl_outl((WTCNT_HIGH << 24) | (__u32)val, WTCNT); 85 __raw_writel((WTCNT_HIGH << 24) | (__u32)val, WTCNT);
86} 86}
87 87
88/** 88/**
@@ -94,7 +94,7 @@ static inline void sh_wdt_write_cnt(__u32 val)
94 */ 94 */
95static inline void sh_wdt_write_bst(__u32 val) 95static inline void sh_wdt_write_bst(__u32 val)
96{ 96{
97 ctrl_outl((WTBST_HIGH << 24) | (__u32)val, WTBST); 97 __raw_writel((WTBST_HIGH << 24) | (__u32)val, WTBST);
98} 98}
99/** 99/**
100 * sh_wdt_read_csr - Read from Control/Status Register 100 * sh_wdt_read_csr - Read from Control/Status Register
@@ -103,7 +103,7 @@ static inline void sh_wdt_write_bst(__u32 val)
103 */ 103 */
104static inline __u32 sh_wdt_read_csr(void) 104static inline __u32 sh_wdt_read_csr(void)
105{ 105{
106 return ctrl_inl(WTCSR_R); 106 return __raw_readl(WTCSR_R);
107} 107}
108 108
109/** 109/**
@@ -115,7 +115,7 @@ static inline __u32 sh_wdt_read_csr(void)
115 */ 115 */
116static inline void sh_wdt_write_csr(__u32 val) 116static inline void sh_wdt_write_csr(__u32 val)
117{ 117{
118 ctrl_outl((WTCSR_HIGH << 24) | (__u32)val, WTCSR); 118 __raw_writel((WTCSR_HIGH << 24) | (__u32)val, WTCSR);
119} 119}
120#else 120#else
121/** 121/**
@@ -124,7 +124,7 @@ static inline void sh_wdt_write_csr(__u32 val)
124 */ 124 */
125static inline __u8 sh_wdt_read_cnt(void) 125static inline __u8 sh_wdt_read_cnt(void)
126{ 126{
127 return ctrl_inb(WTCNT_R); 127 return __raw_readb(WTCNT_R);
128} 128}
129 129
130/** 130/**
@@ -136,7 +136,7 @@ static inline __u8 sh_wdt_read_cnt(void)
136 */ 136 */
137static inline void sh_wdt_write_cnt(__u8 val) 137static inline void sh_wdt_write_cnt(__u8 val)
138{ 138{
139 ctrl_outw((WTCNT_HIGH << 8) | (__u16)val, WTCNT); 139 __raw_writew((WTCNT_HIGH << 8) | (__u16)val, WTCNT);
140} 140}
141 141
142/** 142/**
@@ -146,7 +146,7 @@ static inline void sh_wdt_write_cnt(__u8 val)
146 */ 146 */
147static inline __u8 sh_wdt_read_csr(void) 147static inline __u8 sh_wdt_read_csr(void)
148{ 148{
149 return ctrl_inb(WTCSR_R); 149 return __raw_readb(WTCSR_R);
150} 150}
151 151
152/** 152/**
@@ -158,7 +158,7 @@ static inline __u8 sh_wdt_read_csr(void)
158 */ 158 */
159static inline void sh_wdt_write_csr(__u8 val) 159static inline void sh_wdt_write_csr(__u8 val)
160{ 160{
161 ctrl_outw((WTCSR_HIGH << 8) | (__u16)val, WTCSR); 161 __raw_writew((WTCSR_HIGH << 8) | (__u16)val, WTCSR);
162} 162}
163#endif /* CONFIG_CPU_SUBTYPE_SH7785 || CONFIG_CPU_SUBTYPE_SH7780 */ 163#endif /* CONFIG_CPU_SUBTYPE_SH7785 || CONFIG_CPU_SUBTYPE_SH7780 */
164#endif /* __KERNEL__ */ 164#endif /* __KERNEL__ */
diff --git a/arch/sh/include/cpu-sh2/cpu/ubc.h b/arch/sh/include/cpu-sh2/cpu/ubc.h
deleted file mode 100644
index ba0e87f19c7a..000000000000
--- a/arch/sh/include/cpu-sh2/cpu/ubc.h
+++ /dev/null
@@ -1,32 +0,0 @@
1/*
2 * include/asm-sh/cpu-sh2/ubc.h
3 *
4 * Copyright (C) 2003 Paul Mundt
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#ifndef __ASM_CPU_SH2_UBC_H
11#define __ASM_CPU_SH2_UBC_H
12
13#define UBC_BARA 0xffffff40
14#define UBC_BAMRA 0xffffff44
15#define UBC_BBRA 0xffffff48
16#define UBC_BARB 0xffffff60
17#define UBC_BAMRB 0xffffff64
18#define UBC_BBRB 0xffffff68
19#define UBC_BDRB 0xffffff70
20#define UBC_BDMRB 0xffffff74
21#define UBC_BRCR 0xffffff78
22
23/*
24 * We don't have any ASID changes to make in the UBC on the SH-2.
25 *
26 * Make these purposely invalid to track misuse.
27 */
28#define UBC_BASRA 0x00000000
29#define UBC_BASRB 0x00000000
30
31#endif /* __ASM_CPU_SH2_UBC_H */
32
diff --git a/arch/sh/include/cpu-sh2/cpu/watchdog.h b/arch/sh/include/cpu-sh2/cpu/watchdog.h
index 393161c9c6d0..1eab8aa63a6d 100644
--- a/arch/sh/include/cpu-sh2/cpu/watchdog.h
+++ b/arch/sh/include/cpu-sh2/cpu/watchdog.h
@@ -44,7 +44,7 @@ static inline __u8 sh_wdt_read_rstcsr(void)
44 /* 44 /*
45 * Same read/write brain-damage as for WTCNT here.. 45 * Same read/write brain-damage as for WTCNT here..
46 */ 46 */
47 return ctrl_inb(RSTCSR_R); 47 return __raw_readb(RSTCSR_R);
48} 48}
49 49
50/** 50/**
@@ -62,7 +62,7 @@ static inline void sh_wdt_write_rstcsr(__u8 val)
62 * we can't presently touch the WOVF bit, since the upper byte 62 * we can't presently touch the WOVF bit, since the upper byte
63 * has to be swapped for this. So just leave it alone.. 63 * has to be swapped for this. So just leave it alone..
64 */ 64 */
65 ctrl_outw((WTCNT_HIGH << 8) | (__u16)val, RSTCSR); 65 __raw_writeb((WTCNT_HIGH << 8) | (__u16)val, RSTCSR);
66} 66}
67 67
68#endif /* __ASM_CPU_SH2_WATCHDOG_H */ 68#endif /* __ASM_CPU_SH2_WATCHDOG_H */
diff --git a/arch/sh/include/cpu-sh3/cpu/dac.h b/arch/sh/include/cpu-sh3/cpu/dac.h
index 05fda8316ebc..98f1d15f0ab5 100644
--- a/arch/sh/include/cpu-sh3/cpu/dac.h
+++ b/arch/sh/include/cpu-sh3/cpu/dac.h
@@ -17,25 +17,25 @@
17static __inline__ void sh_dac_enable(int channel) 17static __inline__ void sh_dac_enable(int channel)
18{ 18{
19 unsigned char v; 19 unsigned char v;
20 v = ctrl_inb(DACR); 20 v = __raw_readb(DACR);
21 if(channel) v |= DACR_DAOE1; 21 if(channel) v |= DACR_DAOE1;
22 else v |= DACR_DAOE0; 22 else v |= DACR_DAOE0;
23 ctrl_outb(v,DACR); 23 __raw_writeb(v,DACR);
24} 24}
25 25
26static __inline__ void sh_dac_disable(int channel) 26static __inline__ void sh_dac_disable(int channel)
27{ 27{
28 unsigned char v; 28 unsigned char v;
29 v = ctrl_inb(DACR); 29 v = __raw_readb(DACR);
30 if(channel) v &= ~DACR_DAOE1; 30 if(channel) v &= ~DACR_DAOE1;
31 else v &= ~DACR_DAOE0; 31 else v &= ~DACR_DAOE0;
32 ctrl_outb(v,DACR); 32 __raw_writeb(v,DACR);
33} 33}
34 34
35static __inline__ void sh_dac_output(u8 value, int channel) 35static __inline__ void sh_dac_output(u8 value, int channel)
36{ 36{
37 if(channel) ctrl_outb(value,DADR1); 37 if(channel) __raw_writeb(value,DADR1);
38 else ctrl_outb(value,DADR0); 38 else __raw_writeb(value,DADR0);
39} 39}
40 40
41#endif /* __ASM_CPU_SH3_DAC_H */ 41#endif /* __ASM_CPU_SH3_DAC_H */
diff --git a/arch/sh/include/cpu-sh3/cpu/dma.h b/arch/sh/include/cpu-sh3/cpu/dma.h
index 0ea15f3f2363..207811a7a650 100644
--- a/arch/sh/include/cpu-sh3/cpu/dma.h
+++ b/arch/sh/include/cpu-sh3/cpu/dma.h
@@ -20,8 +20,10 @@
20#define TS_32 0x00000010 20#define TS_32 0x00000010
21#define TS_128 0x00000018 21#define TS_128 0x00000018
22 22
23#define CHCR_TS_MASK 0x18 23#define CHCR_TS_LOW_MASK 0x18
24#define CHCR_TS_SHIFT 3 24#define CHCR_TS_LOW_SHIFT 3
25#define CHCR_TS_HIGH_MASK 0
26#define CHCR_TS_HIGH_SHIFT 0
25 27
26#define DMAOR_INIT DMAOR_DME 28#define DMAOR_INIT DMAOR_DME
27 29
@@ -36,11 +38,13 @@ enum {
36 XMIT_SZ_128BIT, 38 XMIT_SZ_128BIT,
37}; 39};
38 40
39static unsigned int ts_shift[] __maybe_unused = { 41#define TS_SHIFT { \
40 [XMIT_SZ_8BIT] = 0, 42 [XMIT_SZ_8BIT] = 0, \
41 [XMIT_SZ_16BIT] = 1, 43 [XMIT_SZ_16BIT] = 1, \
42 [XMIT_SZ_32BIT] = 2, 44 [XMIT_SZ_32BIT] = 2, \
43 [XMIT_SZ_128BIT] = 4, 45 [XMIT_SZ_128BIT] = 4, \
44}; 46}
47
48#define TS_INDEX2VAL(i) (((i) & 3) << CHCR_TS_LOW_SHIFT)
45 49
46#endif /* __ASM_CPU_SH3_DMA_H */ 50#endif /* __ASM_CPU_SH3_DMA_H */
diff --git a/arch/sh/include/cpu-sh3/cpu/ubc.h b/arch/sh/include/cpu-sh3/cpu/ubc.h
deleted file mode 100644
index 4e6381d5ff7a..000000000000
--- a/arch/sh/include/cpu-sh3/cpu/ubc.h
+++ /dev/null
@@ -1,42 +0,0 @@
1/*
2 * include/asm-sh/cpu-sh3/ubc.h
3 *
4 * Copyright (C) 1999 Niibe Yutaka
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 __ASM_CPU_SH3_UBC_H
12#define __ASM_CPU_SH3_UBC_H
13
14#if defined(CONFIG_CPU_SUBTYPE_SH7710) || \
15 defined(CONFIG_CPU_SUBTYPE_SH7720) || \
16 defined(CONFIG_CPU_SUBTYPE_SH7721)
17#define UBC_BARA 0xa4ffffb0
18#define UBC_BAMRA 0xa4ffffb4
19#define UBC_BBRA 0xa4ffffb8
20#define UBC_BASRA 0xffffffe4
21#define UBC_BARB 0xa4ffffa0
22#define UBC_BAMRB 0xa4ffffa4
23#define UBC_BBRB 0xa4ffffa8
24#define UBC_BASRB 0xffffffe8
25#define UBC_BDRB 0xa4ffff90
26#define UBC_BDMRB 0xa4ffff94
27#define UBC_BRCR 0xa4ffff98
28#else
29#define UBC_BARA 0xffffffb0
30#define UBC_BAMRA 0xffffffb4
31#define UBC_BBRA 0xffffffb8
32#define UBC_BASRA 0xffffffe4
33#define UBC_BARB 0xffffffa0
34#define UBC_BAMRB 0xffffffa4
35#define UBC_BBRB 0xffffffa8
36#define UBC_BASRB 0xffffffe8
37#define UBC_BDRB 0xffffff90
38#define UBC_BDMRB 0xffffff94
39#define UBC_BRCR 0xffffff98
40#endif
41
42#endif /* __ASM_CPU_SH3_UBC_H */
diff --git a/arch/sh/include/cpu-sh4/cpu/addrspace.h b/arch/sh/include/cpu-sh4/cpu/addrspace.h
index a3fa733c1c7d..d51da25da72c 100644
--- a/arch/sh/include/cpu-sh4/cpu/addrspace.h
+++ b/arch/sh/include/cpu-sh4/cpu/addrspace.h
@@ -28,6 +28,15 @@
28#define P4SEG_TLB_DATA 0xf7000000 28#define P4SEG_TLB_DATA 0xf7000000
29#define P4SEG_REG_BASE 0xff000000 29#define P4SEG_REG_BASE 0xff000000
30 30
31#define PA_AREA0 0x00000000
32#define PA_AREA1 0x04000000
33#define PA_AREA2 0x08000000
34#define PA_AREA3 0x0c000000
35#define PA_AREA4 0x10000000
36#define PA_AREA5 0x14000000
37#define PA_AREA6 0x18000000
38#define PA_AREA7 0x1c000000
39
31#define PA_AREA5_IO 0xb4000000 /* Area 5 IO Memory */ 40#define PA_AREA5_IO 0xb4000000 /* Area 5 IO Memory */
32#define PA_AREA6_IO 0xb8000000 /* Area 6 IO Memory */ 41#define PA_AREA6_IO 0xb8000000 /* Area 6 IO Memory */
33 42
diff --git a/arch/sh/include/cpu-sh4/cpu/dma-sh4a.h b/arch/sh/include/cpu-sh4/cpu/dma-sh4a.h
index c4ed660c14cf..e734ea47d8a0 100644
--- a/arch/sh/include/cpu-sh4/cpu/dma-sh4a.h
+++ b/arch/sh/include/cpu-sh4/cpu/dma-sh4a.h
@@ -2,22 +2,38 @@
2#define __ASM_SH_CPU_SH4_DMA_SH7780_H 2#define __ASM_SH_CPU_SH4_DMA_SH7780_H
3 3
4#if defined(CONFIG_CPU_SUBTYPE_SH7343) || \ 4#if defined(CONFIG_CPU_SUBTYPE_SH7343) || \
5 defined(CONFIG_CPU_SUBTYPE_SH7722) || \
6 defined(CONFIG_CPU_SUBTYPE_SH7730) 5 defined(CONFIG_CPU_SUBTYPE_SH7730)
7#define DMTE0_IRQ 48 6#define DMTE0_IRQ 48
8#define DMTE4_IRQ 76 7#define DMTE4_IRQ 76
9#define DMAE0_IRQ 78 /* DMA Error IRQ*/ 8#define DMAE0_IRQ 78 /* DMA Error IRQ*/
10#define SH_DMAC_BASE0 0xFE008020 9#define SH_DMAC_BASE0 0xFE008020
11#define SH_DMARS_BASE 0xFE009000 10#define SH_DMARS_BASE0 0xFE009000
11#define CHCR_TS_LOW_MASK 0x00000018
12#define CHCR_TS_LOW_SHIFT 3
13#define CHCR_TS_HIGH_MASK 0
14#define CHCR_TS_HIGH_SHIFT 0
15#elif defined(CONFIG_CPU_SUBTYPE_SH7722)
16#define DMTE0_IRQ 48
17#define DMTE4_IRQ 76
18#define DMAE0_IRQ 78 /* DMA Error IRQ*/
19#define SH_DMAC_BASE0 0xFE008020
20#define SH_DMARS_BASE0 0xFE009000
21#define CHCR_TS_LOW_MASK 0x00000018
22#define CHCR_TS_LOW_SHIFT 3
23#define CHCR_TS_HIGH_MASK 0x00300000
24#define CHCR_TS_HIGH_SHIFT 20
12#elif defined(CONFIG_CPU_SUBTYPE_SH7763) || \ 25#elif defined(CONFIG_CPU_SUBTYPE_SH7763) || \
13 defined(CONFIG_CPU_SUBTYPE_SH7764) 26 defined(CONFIG_CPU_SUBTYPE_SH7764)
14#define DMTE0_IRQ 34 27#define DMTE0_IRQ 34
15#define DMTE4_IRQ 44 28#define DMTE4_IRQ 44
16#define DMAE0_IRQ 38 29#define DMAE0_IRQ 38
17#define SH_DMAC_BASE0 0xFF608020 30#define SH_DMAC_BASE0 0xFF608020
18#define SH_DMARS_BASE 0xFF609000 31#define SH_DMARS_BASE0 0xFF609000
19#elif defined(CONFIG_CPU_SUBTYPE_SH7723) || \ 32#define CHCR_TS_LOW_MASK 0x00000018
20 defined(CONFIG_CPU_SUBTYPE_SH7724) 33#define CHCR_TS_LOW_SHIFT 3
34#define CHCR_TS_HIGH_MASK 0
35#define CHCR_TS_HIGH_SHIFT 0
36#elif defined(CONFIG_CPU_SUBTYPE_SH7723)
21#define DMTE0_IRQ 48 /* DMAC0A*/ 37#define DMTE0_IRQ 48 /* DMAC0A*/
22#define DMTE4_IRQ 76 /* DMAC0B */ 38#define DMTE4_IRQ 76 /* DMAC0B */
23#define DMTE6_IRQ 40 39#define DMTE6_IRQ 40
@@ -29,7 +45,29 @@
29#define DMAE1_IRQ 74 /* DMA Error IRQ*/ 45#define DMAE1_IRQ 74 /* DMA Error IRQ*/
30#define SH_DMAC_BASE0 0xFE008020 46#define SH_DMAC_BASE0 0xFE008020
31#define SH_DMAC_BASE1 0xFDC08020 47#define SH_DMAC_BASE1 0xFDC08020
32#define SH_DMARS_BASE 0xFDC09000 48#define SH_DMARS_BASE0 0xFDC09000
49#define CHCR_TS_LOW_MASK 0x00000018
50#define CHCR_TS_LOW_SHIFT 3
51#define CHCR_TS_HIGH_MASK 0
52#define CHCR_TS_HIGH_SHIFT 0
53#elif defined(CONFIG_CPU_SUBTYPE_SH7724)
54#define DMTE0_IRQ 48 /* DMAC0A*/
55#define DMTE4_IRQ 76 /* DMAC0B */
56#define DMTE6_IRQ 40
57#define DMTE8_IRQ 42 /* DMAC1A */
58#define DMTE9_IRQ 43
59#define DMTE10_IRQ 72 /* DMAC1B */
60#define DMTE11_IRQ 73
61#define DMAE0_IRQ 78 /* DMA Error IRQ*/
62#define DMAE1_IRQ 74 /* DMA Error IRQ*/
63#define SH_DMAC_BASE0 0xFE008020
64#define SH_DMAC_BASE1 0xFDC08020
65#define SH_DMARS_BASE0 0xFE009000
66#define SH_DMARS_BASE1 0xFDC09000
67#define CHCR_TS_LOW_MASK 0x00000018
68#define CHCR_TS_LOW_SHIFT 3
69#define CHCR_TS_HIGH_MASK 0x00600000
70#define CHCR_TS_HIGH_SHIFT 21
33#elif defined(CONFIG_CPU_SUBTYPE_SH7780) 71#elif defined(CONFIG_CPU_SUBTYPE_SH7780)
34#define DMTE0_IRQ 34 72#define DMTE0_IRQ 34
35#define DMTE4_IRQ 44 73#define DMTE4_IRQ 44
@@ -41,7 +79,11 @@
41#define DMAE0_IRQ 38 /* DMA Error IRQ */ 79#define DMAE0_IRQ 38 /* DMA Error IRQ */
42#define SH_DMAC_BASE0 0xFC808020 80#define SH_DMAC_BASE0 0xFC808020
43#define SH_DMAC_BASE1 0xFC818020 81#define SH_DMAC_BASE1 0xFC818020
44#define SH_DMARS_BASE 0xFC809000 82#define SH_DMARS_BASE0 0xFC809000
83#define CHCR_TS_LOW_MASK 0x00000018
84#define CHCR_TS_LOW_SHIFT 3
85#define CHCR_TS_HIGH_MASK 0
86#define CHCR_TS_HIGH_SHIFT 0
45#else /* SH7785 */ 87#else /* SH7785 */
46#define DMTE0_IRQ 33 88#define DMTE0_IRQ 33
47#define DMTE4_IRQ 37 89#define DMTE4_IRQ 37
@@ -54,18 +96,17 @@
54#define DMAE1_IRQ 58 /* DMA Error IRQ1 */ 96#define DMAE1_IRQ 58 /* DMA Error IRQ1 */
55#define SH_DMAC_BASE0 0xFC808020 97#define SH_DMAC_BASE0 0xFC808020
56#define SH_DMAC_BASE1 0xFCC08020 98#define SH_DMAC_BASE1 0xFCC08020
57#define SH_DMARS_BASE 0xFC809000 99#define SH_DMARS_BASE0 0xFC809000
100#define CHCR_TS_LOW_MASK 0x00000018
101#define CHCR_TS_LOW_SHIFT 3
102#define CHCR_TS_HIGH_MASK 0
103#define CHCR_TS_HIGH_SHIFT 0
58#endif 104#endif
59 105
60#define REQ_HE 0x000000C0 106#define REQ_HE 0x000000C0
61#define REQ_H 0x00000080 107#define REQ_H 0x00000080
62#define REQ_LE 0x00000040 108#define REQ_LE 0x00000040
63#define TM_BURST 0x0000020 109#define TM_BURST 0x00000020
64#define TS_8 0x00000000
65#define TS_16 0x00000008
66#define TS_32 0x00000010
67#define TS_16BLK 0x00000018
68#define TS_32BLK 0x00100000
69 110
70/* 111/*
71 * The SuperH DMAC supports a number of transmit sizes, we list them here, 112 * The SuperH DMAC supports a number of transmit sizes, we list them here,
@@ -74,22 +115,31 @@
74 * Defaults to a 64-bit transfer size. 115 * Defaults to a 64-bit transfer size.
75 */ 116 */
76enum { 117enum {
77 XMIT_SZ_8BIT, 118 XMIT_SZ_8BIT = 0,
78 XMIT_SZ_16BIT, 119 XMIT_SZ_16BIT = 1,
79 XMIT_SZ_32BIT, 120 XMIT_SZ_32BIT = 2,
80 XMIT_SZ_128BIT, 121 XMIT_SZ_64BIT = 7,
81 XMIT_SZ_256BIT, 122 XMIT_SZ_128BIT = 3,
123 XMIT_SZ_256BIT = 4,
124 XMIT_SZ_128BIT_BLK = 0xb,
125 XMIT_SZ_256BIT_BLK = 0xc,
82}; 126};
83 127
84/* 128/*
85 * The DMA count is defined as the number of bytes to transfer. 129 * The DMA count is defined as the number of bytes to transfer.
86 */ 130 */
87static unsigned int ts_shift[] __maybe_unused = { 131#define TS_SHIFT { \
88 [XMIT_SZ_8BIT] = 0, 132 [XMIT_SZ_8BIT] = 0, \
89 [XMIT_SZ_16BIT] = 1, 133 [XMIT_SZ_16BIT] = 1, \
90 [XMIT_SZ_32BIT] = 2, 134 [XMIT_SZ_32BIT] = 2, \
91 [XMIT_SZ_128BIT] = 4, 135 [XMIT_SZ_64BIT] = 3, \
92 [XMIT_SZ_256BIT] = 5, 136 [XMIT_SZ_128BIT] = 4, \
93}; 137 [XMIT_SZ_256BIT] = 5, \
138 [XMIT_SZ_128BIT_BLK] = 4, \
139 [XMIT_SZ_256BIT_BLK] = 5, \
140}
141
142#define TS_INDEX2VAL(i) ((((i) & 3) << CHCR_TS_LOW_SHIFT) | \
143 ((((i) >> 2) & 3) << CHCR_TS_HIGH_SHIFT))
94 144
95#endif /* __ASM_SH_CPU_SH4_DMA_SH7780_H */ 145#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 bcb30246e85c..114a369705bc 100644
--- a/arch/sh/include/cpu-sh4/cpu/dma.h
+++ b/arch/sh/include/cpu-sh4/cpu/dma.h
@@ -6,8 +6,6 @@
6#ifdef CONFIG_CPU_SH4A 6#ifdef CONFIG_CPU_SH4A
7 7
8#define DMAOR_INIT (DMAOR_DME) 8#define DMAOR_INIT (DMAOR_DME)
9#define CHCR_TS_MASK 0x18
10#define CHCR_TS_SHIFT 3
11 9
12#include <cpu/dma-sh4a.h> 10#include <cpu/dma-sh4a.h>
13#else /* CONFIG_CPU_SH4A */ 11#else /* CONFIG_CPU_SH4A */
@@ -29,8 +27,10 @@
29#define TS_32 0x00000030 27#define TS_32 0x00000030
30#define TS_64 0x00000000 28#define TS_64 0x00000000
31 29
32#define CHCR_TS_MASK 0x70 30#define CHCR_TS_LOW_MASK 0x70
33#define CHCR_TS_SHIFT 4 31#define CHCR_TS_LOW_SHIFT 4
32#define CHCR_TS_HIGH_MASK 0
33#define CHCR_TS_HIGH_SHIFT 0
34 34
35#define DMAOR_COD 0x00000008 35#define DMAOR_COD 0x00000008
36 36
@@ -41,23 +41,26 @@
41 * Defaults to a 64-bit transfer size. 41 * Defaults to a 64-bit transfer size.
42 */ 42 */
43enum { 43enum {
44 XMIT_SZ_64BIT, 44 XMIT_SZ_8BIT = 1,
45 XMIT_SZ_8BIT, 45 XMIT_SZ_16BIT = 2,
46 XMIT_SZ_16BIT, 46 XMIT_SZ_32BIT = 3,
47 XMIT_SZ_32BIT, 47 XMIT_SZ_64BIT = 0,
48 XMIT_SZ_256BIT, 48 XMIT_SZ_256BIT = 4,
49}; 49};
50 50
51/* 51/*
52 * The DMA count is defined as the number of bytes to transfer. 52 * The DMA count is defined as the number of bytes to transfer.
53 */ 53 */
54static unsigned int ts_shift[] __maybe_unused = { 54#define TS_SHIFT { \
55 [XMIT_SZ_64BIT] = 3, 55 [XMIT_SZ_8BIT] = 0, \
56 [XMIT_SZ_8BIT] = 0, 56 [XMIT_SZ_16BIT] = 1, \
57 [XMIT_SZ_16BIT] = 1, 57 [XMIT_SZ_32BIT] = 2, \
58 [XMIT_SZ_32BIT] = 2, 58 [XMIT_SZ_64BIT] = 3, \
59 [XMIT_SZ_256BIT] = 5, 59 [XMIT_SZ_256BIT] = 5, \
60}; 60}
61
62#define TS_INDEX2VAL(i) (((i) & 7) << CHCR_TS_LOW_SHIFT)
63
61#endif 64#endif
62 65
63#endif /* __ASM_CPU_SH4_DMA_H */ 66#endif /* __ASM_CPU_SH4_DMA_H */
diff --git a/arch/sh/include/cpu-sh4/cpu/mmu_context.h b/arch/sh/include/cpu-sh4/cpu/mmu_context.h
index 3ce7ef6c2978..03ea75c5315d 100644
--- a/arch/sh/include/cpu-sh4/cpu/mmu_context.h
+++ b/arch/sh/include/cpu-sh4/cpu/mmu_context.h
@@ -25,6 +25,10 @@
25 25
26#define MMUCR_TI (1<<2) 26#define MMUCR_TI (1<<2)
27 27
28#define MMUCR_URB 0x00FC0000
29#define MMUCR_URB_SHIFT 18
30#define MMUCR_URB_NENTRIES 64
31
28#if defined(CONFIG_32BIT) && defined(CONFIG_CPU_SUBTYPE_ST40) 32#if defined(CONFIG_32BIT) && defined(CONFIG_CPU_SUBTYPE_ST40)
29#define MMUCR_SE (1 << 4) 33#define MMUCR_SE (1 << 4)
30#else 34#else
diff --git a/arch/sh/include/cpu-sh4/cpu/sq.h b/arch/sh/include/cpu-sh4/cpu/sq.h
index 586d6491816a..74716ba2dc3c 100644
--- a/arch/sh/include/cpu-sh4/cpu/sq.h
+++ b/arch/sh/include/cpu-sh4/cpu/sq.h
@@ -12,6 +12,7 @@
12#define __ASM_CPU_SH4_SQ_H 12#define __ASM_CPU_SH4_SQ_H
13 13
14#include <asm/addrspace.h> 14#include <asm/addrspace.h>
15#include <asm/page.h>
15 16
16/* 17/*
17 * Store queues range from e0000000-e3fffffc, allowing approx. 64MB to be 18 * Store queues range from e0000000-e3fffffc, allowing approx. 64MB to be
@@ -28,7 +29,7 @@
28 29
29/* arch/sh/kernel/cpu/sh4/sq.c */ 30/* arch/sh/kernel/cpu/sh4/sq.c */
30unsigned long sq_remap(unsigned long phys, unsigned int size, 31unsigned long sq_remap(unsigned long phys, unsigned int size,
31 const char *name, unsigned long flags); 32 const char *name, pgprot_t prot);
32void sq_unmap(unsigned long vaddr); 33void sq_unmap(unsigned long vaddr);
33void sq_flush_range(unsigned long start, unsigned int len); 34void sq_flush_range(unsigned long start, unsigned int len);
34 35
diff --git a/arch/sh/include/cpu-sh4/cpu/ubc.h b/arch/sh/include/cpu-sh4/cpu/ubc.h
deleted file mode 100644
index c86e17050935..000000000000
--- a/arch/sh/include/cpu-sh4/cpu/ubc.h
+++ /dev/null
@@ -1,64 +0,0 @@
1/*
2 * include/asm-sh/cpu-sh4/ubc.h
3 *
4 * Copyright (C) 1999 Niibe Yutaka
5 * Copyright (C) 2003 Paul Mundt
6 * Copyright (C) 2006 Lineo Solutions Inc. support SH4A UBC
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#ifndef __ASM_CPU_SH4_UBC_H
13#define __ASM_CPU_SH4_UBC_H
14
15#if defined(CONFIG_CPU_SH4A)
16#define UBC_CBR0 0xff200000
17#define UBC_CRR0 0xff200004
18#define UBC_CAR0 0xff200008
19#define UBC_CAMR0 0xff20000c
20#define UBC_CBR1 0xff200020
21#define UBC_CRR1 0xff200024
22#define UBC_CAR1 0xff200028
23#define UBC_CAMR1 0xff20002c
24#define UBC_CDR1 0xff200030
25#define UBC_CDMR1 0xff200034
26#define UBC_CETR1 0xff200038
27#define UBC_CCMFR 0xff200600
28#define UBC_CBCR 0xff200620
29
30/* CBR */
31#define UBC_CBR_AIE (0x01<<30)
32#define UBC_CBR_ID_INST (0x01<<4)
33#define UBC_CBR_RW_READ (0x01<<1)
34#define UBC_CBR_CE (0x01)
35
36#define UBC_CBR_AIV_MASK (0x00FF0000)
37#define UBC_CBR_AIV_SHIFT (16)
38#define UBC_CBR_AIV_SET(asid) (((asid)<<UBC_CBR_AIV_SHIFT) & UBC_CBR_AIV_MASK)
39
40#define UBC_CBR_INIT 0x20000000
41
42/* CRR */
43#define UBC_CRR_RES (0x01<<13)
44#define UBC_CRR_PCB (0x01<<1)
45#define UBC_CRR_BIE (0x01)
46
47#define UBC_CRR_INIT 0x00002000
48
49#else /* CONFIG_CPU_SH4 */
50#define UBC_BARA 0xff200000
51#define UBC_BAMRA 0xff200004
52#define UBC_BBRA 0xff200008
53#define UBC_BASRA 0xff000014
54#define UBC_BARB 0xff20000c
55#define UBC_BAMRB 0xff200010
56#define UBC_BBRB 0xff200014
57#define UBC_BASRB 0xff000018
58#define UBC_BDRB 0xff200018
59#define UBC_BDMRB 0xff20001c
60#define UBC_BRCR 0xff200020
61#endif /* CONFIG_CPU_SH4 */
62
63#endif /* __ASM_CPU_SH4_UBC_H */
64
diff --git a/arch/sh/include/mach-common/mach/magicpanelr2.h b/arch/sh/include/mach-common/mach/magicpanelr2.h
index c644a77ee357..183a2f744251 100644
--- a/arch/sh/include/mach-common/mach/magicpanelr2.h
+++ b/arch/sh/include/mach-common/mach/magicpanelr2.h
@@ -19,12 +19,12 @@
19#include <asm/io_generic.h> 19#include <asm/io_generic.h>
20 20
21 21
22#define SETBITS_OUTB(mask, reg) ctrl_outb(ctrl_inb(reg) | mask, reg) 22#define SETBITS_OUTB(mask, reg) __raw_writeb(__raw_readb(reg) | mask, reg)
23#define SETBITS_OUTW(mask, reg) ctrl_outw(ctrl_inw(reg) | mask, reg) 23#define SETBITS_OUTW(mask, reg) __raw_writew(__raw_readw(reg) | mask, reg)
24#define SETBITS_OUTL(mask, reg) ctrl_outl(ctrl_inl(reg) | mask, reg) 24#define SETBITS_OUTL(mask, reg) __raw_writel(__raw_readl(reg) | mask, reg)
25#define CLRBITS_OUTB(mask, reg) ctrl_outb(ctrl_inb(reg) & ~mask, reg) 25#define CLRBITS_OUTB(mask, reg) __raw_writeb(__raw_readb(reg) & ~mask, reg)
26#define CLRBITS_OUTW(mask, reg) ctrl_outw(ctrl_inw(reg) & ~mask, reg) 26#define CLRBITS_OUTW(mask, reg) __raw_writew(__raw_readw(reg) & ~mask, reg)
27#define CLRBITS_OUTL(mask, reg) ctrl_outl(ctrl_inl(reg) & ~mask, reg) 27#define CLRBITS_OUTL(mask, reg) __raw_writel(__raw_readl(reg) & ~mask, reg)
28 28
29 29
30#define PA_LED PORT_PADR /* LED */ 30#define PA_LED PORT_PADR /* LED */
diff --git a/arch/sh/include/mach-dreamcast/mach/sysasic.h b/arch/sh/include/mach-dreamcast/mach/sysasic.h
index f33426608a87..58f710e1ebc2 100644
--- a/arch/sh/include/mach-dreamcast/mach/sysasic.h
+++ b/arch/sh/include/mach-dreamcast/mach/sysasic.h
@@ -39,5 +39,10 @@
39 39
40#define HW_EVENT_IRQ_MAX (HW_EVENT_IRQ_BASE + 95) 40#define HW_EVENT_IRQ_MAX (HW_EVENT_IRQ_BASE + 95)
41 41
42/* arch/sh/boards/mach-dreamcast/irq.c */
43extern int systemasic_irq_demux(int);
44extern void systemasic_irq_init(void);
45extern void aica_time_init(void);
46
42#endif /* __ASM_SH_DREAMCAST_SYSASIC_H */ 47#endif /* __ASM_SH_DREAMCAST_SYSASIC_H */
43 48
diff --git a/arch/sh/include/mach-sdk7786/mach/fpga.h b/arch/sh/include/mach-sdk7786/mach/fpga.h
new file mode 100644
index 000000000000..2120d67dec70
--- /dev/null
+++ b/arch/sh/include/mach-sdk7786/mach/fpga.h
@@ -0,0 +1,114 @@
1#ifndef __MACH_SDK7786_FPGA_H
2#define __MACH_SDK7786_FPGA_H
3
4#include <linux/io.h>
5#include <linux/types.h>
6#include <linux/bitops.h>
7
8#define SRSTR 0x000
9#define SRSTR_MAGIC 0x1971 /* Fixed magical read value */
10
11#define INTASR 0x010
12#define INTAMR 0x020
13#define MODSWR 0x030
14#define INTTESTR 0x040
15#define SYSSR 0x050
16#define NRGPR 0x060
17#define NMISR 0x070
18
19#define NMIMR 0x080
20#define NMIMR_MAN_NMIM BIT(0) /* Manual NMI mask */
21#define NMIMR_AUX_NMIM BIT(1) /* Auxiliary NMI mask */
22
23#define INTBSR 0x090
24#define INTBMR 0x0a0
25#define USRLEDR 0x0b0
26#define MAPSWR 0x0c0
27#define FPGAVR 0x0d0
28#define FPGADR 0x0e0
29#define PCBRR 0x0f0
30#define RSR 0x100
31#define EXTASR 0x110
32#define SPCAR 0x120
33#define INTMSR 0x130
34#define PCIECR 0x140
35#define FAER 0x150
36#define USRGPIR 0x160
37/* 0x170 reserved */
38#define LCLASR 0x180
39
40#define SBCR 0x190
41#define SCBR_I2CMEN BIT(0) /* FPGA I2C master enable */
42#define SCBR_I2CCEN BIT(1) /* CPU I2C master enable */
43
44#define PWRCR 0x1a0
45#define SPCBR 0x1b0
46#define SPICR 0x1c0
47#define SPIDR 0x1d0
48#define I2CCR 0x1e0
49#define I2CDR 0x1f0
50#define FPGACR 0x200
51#define IASELR1 0x210
52#define IASELR2 0x220
53#define IASELR3 0x230
54#define IASELR4 0x240
55#define IASELR5 0x250
56#define IASELR6 0x260
57#define IASELR7 0x270
58#define IASELR8 0x280
59#define IASELR9 0x290
60#define IASELR10 0x2a0
61#define IASELR11 0x2b0
62#define IASELR12 0x2c0
63#define IASELR13 0x2d0
64#define IASELR14 0x2e0
65#define IASELR15 0x2f0
66/* 0x300 reserved */
67#define IBSELR1 0x310
68#define IBSELR2 0x320
69#define IBSELR3 0x330
70#define IBSELR4 0x340
71#define IBSELR5 0x350
72#define IBSELR6 0x360
73#define IBSELR7 0x370
74#define IBSELR8 0x380
75#define IBSELR9 0x390
76#define IBSELR10 0x3a0
77#define IBSELR11 0x3b0
78#define IBSELR12 0x3c0
79#define IBSELR13 0x3d0
80#define IBSELR14 0x3e0
81#define IBSELR15 0x3f0
82#define USRACR 0x400
83#define BEEPR 0x410
84#define USRLCDR 0x420
85#define SMBCR 0x430
86#define SMBDR 0x440
87#define USBCR 0x450
88#define AMSR 0x460
89#define ACCR 0x470
90#define SDIFCR 0x480
91
92/* arch/sh/boards/mach-sdk7786/fpga.c */
93extern void __iomem *sdk7786_fpga_base;
94extern void sdk7786_fpga_init(void);
95
96#define SDK7786_FPGA_REGADDR(reg) (sdk7786_fpga_base + (reg))
97
98/*
99 * A convenience wrapper from register offset to internal I2C address,
100 * when the FPGA is in I2C slave mode.
101 */
102#define SDK7786_FPGA_I2CADDR(reg) ((reg) >> 3)
103
104static inline u16 fpga_read_reg(unsigned int reg)
105{
106 return ioread16(sdk7786_fpga_base + reg);
107}
108
109static inline void fpga_write_reg(u16 val, unsigned int reg)
110{
111 iowrite16(val, sdk7786_fpga_base + reg);
112}
113
114#endif /* __MACH_SDK7786_FPGA_H */
diff --git a/arch/sh/include/mach-sdk7786/mach/irq.h b/arch/sh/include/mach-sdk7786/mach/irq.h
new file mode 100644
index 000000000000..0f584635e6e5
--- /dev/null
+++ b/arch/sh/include/mach-sdk7786/mach/irq.h
@@ -0,0 +1,7 @@
1#ifndef __MACH_SDK7786_IRQ_H
2#define __MACH_SDK7786_IRQ_H
3
4/* arch/sh/boards/mach-sdk7786/irq.c */
5extern void sdk7786_init_irq(void);
6
7#endif /* __MACH_SDK7786_IRQ_H */
diff --git a/arch/sh/include/mach-se/mach/se7343.h b/arch/sh/include/mach-se/mach/se7343.h
index 749914b400fb..8d8170d6cc43 100644
--- a/arch/sh/include/mach-se/mach/se7343.h
+++ b/arch/sh/include/mach-se/mach/se7343.h
@@ -94,26 +94,26 @@
94 94
95#define PORT_DRVCR 0xA4050180 95#define PORT_DRVCR 0xA4050180
96 96
97#define PORT_PADR 0xA4050120 97#define PORT_PADR 0xA4050120
98#define PORT_PBDR 0xA4050122 98#define PORT_PBDR 0xA4050122
99#define PORT_PCDR 0xA4050124 99#define PORT_PCDR 0xA4050124
100#define PORT_PDDR 0xA4050126 100#define PORT_PDDR 0xA4050126
101#define PORT_PEDR 0xA4050128 101#define PORT_PEDR 0xA4050128
102#define PORT_PFDR 0xA405012A 102#define PORT_PFDR 0xA405012A
103#define PORT_PGDR 0xA405012C 103#define PORT_PGDR 0xA405012C
104#define PORT_PHDR 0xA405012E 104#define PORT_PHDR 0xA405012E
105#define PORT_PJDR 0xA4050130 105#define PORT_PJDR 0xA4050130
106#define PORT_PKDR 0xA4050132 106#define PORT_PKDR 0xA4050132
107#define PORT_PLDR 0xA4050134 107#define PORT_PLDR 0xA4050134
108#define PORT_PMDR 0xA4050136 108#define PORT_PMDR 0xA4050136
109#define PORT_PNDR 0xA4050138 109#define PORT_PNDR 0xA4050138
110#define PORT_PQDR 0xA405013A 110#define PORT_PQDR 0xA405013A
111#define PORT_PRDR 0xA405013C 111#define PORT_PRDR 0xA405013C
112#define PORT_PTDR 0xA4050160 112#define PORT_PTDR 0xA4050160
113#define PORT_PUDR 0xA4050162 113#define PORT_PUDR 0xA4050162
114#define PORT_PVDR 0xA4050164 114#define PORT_PVDR 0xA4050164
115#define PORT_PWDR 0xA4050166 115#define PORT_PWDR 0xA4050166
116#define PORT_PYDR 0xA4050168 116#define PORT_PYDR 0xA4050168
117 117
118#define FPGA_IN 0xb1400000 118#define FPGA_IN 0xb1400000
119#define FPGA_OUT 0xb1400002 119#define FPGA_OUT 0xb1400002
@@ -133,18 +133,10 @@
133#define SE7343_FPGA_IRQ_UARTB 11 133#define SE7343_FPGA_IRQ_UARTB 11
134 134
135#define SE7343_FPGA_IRQ_NR 12 135#define SE7343_FPGA_IRQ_NR 12
136#define SE7343_FPGA_IRQ_BASE 120
137
138#define MRSHPC_IRQ3 (SE7343_FPGA_IRQ_BASE + SE7343_FPGA_IRQ_MRSHPC3)
139#define MRSHPC_IRQ2 (SE7343_FPGA_IRQ_BASE + SE7343_FPGA_IRQ_MRSHPC2)
140#define MRSHPC_IRQ1 (SE7343_FPGA_IRQ_BASE + SE7343_FPGA_IRQ_MRSHPC1)
141#define MRSHPC_IRQ0 (SE7343_FPGA_IRQ_BASE + SE7343_FPGA_IRQ_MRSHPC0)
142#define SMC_IRQ (SE7343_FPGA_IRQ_BASE + SE7343_FPGA_IRQ_SMC)
143#define USB_IRQ (SE7343_FPGA_IRQ_BASE + SE7343_FPGA_IRQ_USB)
144#define UARTA_IRQ (SE7343_FPGA_IRQ_BASE + SE7343_FPGA_IRQ_UARTA)
145#define UARTB_IRQ (SE7343_FPGA_IRQ_BASE + SE7343_FPGA_IRQ_UARTB)
146 136
147/* arch/sh/boards/se/7343/irq.c */ 137/* arch/sh/boards/se/7343/irq.c */
138extern unsigned int se7343_fpga_irq[];
139
148void init_7343se_IRQ(void); 140void init_7343se_IRQ(void);
149 141
150#endif /* __ASM_SH_HITACHI_SE7343_H */ 142#endif /* __ASM_SH_HITACHI_SE7343_H */
diff --git a/arch/sh/kernel/Makefile b/arch/sh/kernel/Makefile
index 0d587da1ef12..02fd3ae8b0ee 100644
--- a/arch/sh/kernel/Makefile
+++ b/arch/sh/kernel/Makefile
@@ -13,8 +13,9 @@ CFLAGS_REMOVE_return_address.o = -pg
13 13
14obj-y := debugtraps.o dma-nommu.o dumpstack.o \ 14obj-y := debugtraps.o dma-nommu.o dumpstack.o \
15 idle.o io.o io_generic.o irq.o \ 15 idle.o io.o io_generic.o irq.o \
16 irq_$(BITS).o machvec.o nmi_debug.o process_$(BITS).o \ 16 irq_$(BITS).o machvec.o nmi_debug.o process.o \
17 ptrace_$(BITS).o return_address.o \ 17 process_$(BITS).o ptrace_$(BITS).o \
18 reboot.o return_address.o \
18 setup.o signal_$(BITS).o sys_sh.o sys_sh$(BITS).o \ 19 setup.o signal_$(BITS).o sys_sh.o sys_sh$(BITS).o \
19 syscalls_$(BITS).o time.o topology.o traps.o \ 20 syscalls_$(BITS).o time.o topology.o traps.o \
20 traps_$(BITS).o unwinder.o 21 traps_$(BITS).o unwinder.o
@@ -22,7 +23,7 @@ obj-y := debugtraps.o dma-nommu.o dumpstack.o \
22obj-y += cpu/ 23obj-y += cpu/
23obj-$(CONFIG_VSYSCALL) += vsyscall/ 24obj-$(CONFIG_VSYSCALL) += vsyscall/
24obj-$(CONFIG_SMP) += smp.o 25obj-$(CONFIG_SMP) += smp.o
25obj-$(CONFIG_SH_STANDARD_BIOS) += sh_bios.o early_printk.o 26obj-$(CONFIG_SH_STANDARD_BIOS) += sh_bios.o
26obj-$(CONFIG_KGDB) += kgdb.o 27obj-$(CONFIG_KGDB) += kgdb.o
27obj-$(CONFIG_SH_CPU_FREQ) += cpufreq.o 28obj-$(CONFIG_SH_CPU_FREQ) += cpufreq.o
28obj-$(CONFIG_MODULES) += sh_ksyms_$(BITS).o module.o 29obj-$(CONFIG_MODULES) += sh_ksyms_$(BITS).o module.o
@@ -39,6 +40,7 @@ obj-$(CONFIG_HIBERNATION) += swsusp.o
39obj-$(CONFIG_DWARF_UNWINDER) += dwarf.o 40obj-$(CONFIG_DWARF_UNWINDER) += dwarf.o
40obj-$(CONFIG_PERF_EVENTS) += perf_event.o perf_callchain.o 41obj-$(CONFIG_PERF_EVENTS) += perf_event.o perf_callchain.o
41 42
43obj-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o
42obj-$(CONFIG_GENERIC_CLOCKEVENTS_BROADCAST) += localtimer.o 44obj-$(CONFIG_GENERIC_CLOCKEVENTS_BROADCAST) += localtimer.o
43 45
44EXTRA_CFLAGS += -Werror 46EXTRA_CFLAGS += -Werror
diff --git a/arch/sh/kernel/cpu/Makefile b/arch/sh/kernel/cpu/Makefile
index d97c803719ec..0e48bc61c272 100644
--- a/arch/sh/kernel/cpu/Makefile
+++ b/arch/sh/kernel/cpu/Makefile
@@ -17,5 +17,7 @@ obj-$(CONFIG_ARCH_SHMOBILE) += shmobile/
17 17
18obj-$(CONFIG_SH_ADC) += adc.o 18obj-$(CONFIG_SH_ADC) += adc.o
19obj-$(CONFIG_SH_CLK_CPG) += clock-cpg.o 19obj-$(CONFIG_SH_CLK_CPG) += clock-cpg.o
20obj-$(CONFIG_SH_FPU) += fpu.o
21obj-$(CONFIG_SH_FPU_EMU) += fpu.o
20 22
21obj-y += irq/ init.o clock.o hwblk.o 23obj-y += irq/ init.o clock.o hwblk.o
diff --git a/arch/sh/kernel/cpu/adc.c b/arch/sh/kernel/cpu/adc.c
index da3d6877f93d..d307571d54b6 100644
--- a/arch/sh/kernel/cpu/adc.c
+++ b/arch/sh/kernel/cpu/adc.c
@@ -18,19 +18,19 @@ int adc_single(unsigned int channel)
18 18
19 off = (channel & 0x03) << 2; 19 off = (channel & 0x03) << 2;
20 20
21 csr = ctrl_inb(ADCSR); 21 csr = __raw_readb(ADCSR);
22 csr = channel | ADCSR_ADST | ADCSR_CKS; 22 csr = channel | ADCSR_ADST | ADCSR_CKS;
23 ctrl_outb(csr, ADCSR); 23 __raw_writeb(csr, ADCSR);
24 24
25 do { 25 do {
26 csr = ctrl_inb(ADCSR); 26 csr = __raw_readb(ADCSR);
27 } while ((csr & ADCSR_ADF) == 0); 27 } while ((csr & ADCSR_ADF) == 0);
28 28
29 csr &= ~(ADCSR_ADF | ADCSR_ADST); 29 csr &= ~(ADCSR_ADF | ADCSR_ADST);
30 ctrl_outb(csr, ADCSR); 30 __raw_writeb(csr, ADCSR);
31 31
32 return (((ctrl_inb(ADDRAH + off) << 8) | 32 return (((__raw_readb(ADDRAH + off) << 8) |
33 ctrl_inb(ADDRAL + off)) >> 6); 33 __raw_readb(ADDRAL + off)) >> 6);
34} 34}
35 35
36EXPORT_SYMBOL(adc_single); 36EXPORT_SYMBOL(adc_single);
diff --git a/arch/sh/kernel/cpu/clock-cpg.c b/arch/sh/kernel/cpu/clock-cpg.c
index 6dfe2cced3fc..eed5eaff96ba 100644
--- a/arch/sh/kernel/cpu/clock-cpg.c
+++ b/arch/sh/kernel/cpu/clock-cpg.c
@@ -149,7 +149,8 @@ int __init sh_clk_div6_register(struct clk *clks, int nr)
149 149
150static unsigned long sh_clk_div4_recalc(struct clk *clk) 150static unsigned long sh_clk_div4_recalc(struct clk *clk)
151{ 151{
152 struct clk_div_mult_table *table = clk->priv; 152 struct clk_div4_table *d4t = clk->priv;
153 struct clk_div_mult_table *table = d4t->div_mult_table;
153 unsigned int idx; 154 unsigned int idx;
154 155
155 clk_rate_table_build(clk, clk->freq_table, table->nr_divisors, 156 clk_rate_table_build(clk, clk->freq_table, table->nr_divisors,
@@ -160,17 +161,90 @@ static unsigned long sh_clk_div4_recalc(struct clk *clk)
160 return clk->freq_table[idx].frequency; 161 return clk->freq_table[idx].frequency;
161} 162}
162 163
164static int sh_clk_div4_set_parent(struct clk *clk, struct clk *parent)
165{
166 struct clk_div4_table *d4t = clk->priv;
167 struct clk_div_mult_table *table = d4t->div_mult_table;
168 u32 value;
169 int ret;
170
171 if (!strcmp("pll_clk", parent->name))
172 value = __raw_readl(clk->enable_reg) & ~(1 << 7);
173 else
174 value = __raw_readl(clk->enable_reg) | (1 << 7);
175
176 ret = clk_reparent(clk, parent);
177 if (ret < 0)
178 return ret;
179
180 __raw_writel(value, clk->enable_reg);
181
182 /* Rebiuld the frequency table */
183 clk_rate_table_build(clk, clk->freq_table, table->nr_divisors,
184 table, &clk->arch_flags);
185
186 return 0;
187}
188
189static int sh_clk_div4_set_rate(struct clk *clk, unsigned long rate, int algo_id)
190{
191 struct clk_div4_table *d4t = clk->priv;
192 unsigned long value;
193 int idx = clk_rate_table_find(clk, clk->freq_table, rate);
194 if (idx < 0)
195 return idx;
196
197 value = __raw_readl(clk->enable_reg);
198 value &= ~(0xf << clk->enable_bit);
199 value |= (idx << clk->enable_bit);
200 __raw_writel(value, clk->enable_reg);
201
202 if (d4t->kick)
203 d4t->kick(clk);
204
205 return 0;
206}
207
208static int sh_clk_div4_enable(struct clk *clk)
209{
210 __raw_writel(__raw_readl(clk->enable_reg) & ~(1 << 8), clk->enable_reg);
211 return 0;
212}
213
214static void sh_clk_div4_disable(struct clk *clk)
215{
216 __raw_writel(__raw_readl(clk->enable_reg) | (1 << 8), clk->enable_reg);
217}
218
163static struct clk_ops sh_clk_div4_clk_ops = { 219static struct clk_ops sh_clk_div4_clk_ops = {
164 .recalc = sh_clk_div4_recalc, 220 .recalc = sh_clk_div4_recalc,
221 .set_rate = sh_clk_div4_set_rate,
165 .round_rate = sh_clk_div_round_rate, 222 .round_rate = sh_clk_div_round_rate,
166}; 223};
167 224
168int __init sh_clk_div4_register(struct clk *clks, int nr, 225static struct clk_ops sh_clk_div4_enable_clk_ops = {
169 struct clk_div_mult_table *table) 226 .recalc = sh_clk_div4_recalc,
227 .set_rate = sh_clk_div4_set_rate,
228 .round_rate = sh_clk_div_round_rate,
229 .enable = sh_clk_div4_enable,
230 .disable = sh_clk_div4_disable,
231};
232
233static struct clk_ops sh_clk_div4_reparent_clk_ops = {
234 .recalc = sh_clk_div4_recalc,
235 .set_rate = sh_clk_div4_set_rate,
236 .round_rate = sh_clk_div_round_rate,
237 .enable = sh_clk_div4_enable,
238 .disable = sh_clk_div4_disable,
239 .set_parent = sh_clk_div4_set_parent,
240};
241
242static int __init sh_clk_div4_register_ops(struct clk *clks, int nr,
243 struct clk_div4_table *table, struct clk_ops *ops)
170{ 244{
171 struct clk *clkp; 245 struct clk *clkp;
172 void *freq_table; 246 void *freq_table;
173 int nr_divs = table->nr_divisors; 247 int nr_divs = table->div_mult_table->nr_divisors;
174 int freq_table_size = sizeof(struct cpufreq_frequency_table); 248 int freq_table_size = sizeof(struct cpufreq_frequency_table);
175 int ret = 0; 249 int ret = 0;
176 int k; 250 int k;
@@ -185,7 +259,7 @@ int __init sh_clk_div4_register(struct clk *clks, int nr,
185 for (k = 0; !ret && (k < nr); k++) { 259 for (k = 0; !ret && (k < nr); k++) {
186 clkp = clks + k; 260 clkp = clks + k;
187 261
188 clkp->ops = &sh_clk_div4_clk_ops; 262 clkp->ops = ops;
189 clkp->id = -1; 263 clkp->id = -1;
190 clkp->priv = table; 264 clkp->priv = table;
191 265
@@ -198,6 +272,26 @@ int __init sh_clk_div4_register(struct clk *clks, int nr,
198 return ret; 272 return ret;
199} 273}
200 274
275int __init sh_clk_div4_register(struct clk *clks, int nr,
276 struct clk_div4_table *table)
277{
278 return sh_clk_div4_register_ops(clks, nr, table, &sh_clk_div4_clk_ops);
279}
280
281int __init sh_clk_div4_enable_register(struct clk *clks, int nr,
282 struct clk_div4_table *table)
283{
284 return sh_clk_div4_register_ops(clks, nr, table,
285 &sh_clk_div4_enable_clk_ops);
286}
287
288int __init sh_clk_div4_reparent_register(struct clk *clks, int nr,
289 struct clk_div4_table *table)
290{
291 return sh_clk_div4_register_ops(clks, nr, table,
292 &sh_clk_div4_reparent_clk_ops);
293}
294
201#ifdef CONFIG_SH_CLK_CPG_LEGACY 295#ifdef CONFIG_SH_CLK_CPG_LEGACY
202static struct clk master_clk = { 296static struct clk master_clk = {
203 .name = "master_clk", 297 .name = "master_clk",
diff --git a/arch/sh/kernel/cpu/fpu.c b/arch/sh/kernel/cpu/fpu.c
new file mode 100644
index 000000000000..f059ed62cf57
--- /dev/null
+++ b/arch/sh/kernel/cpu/fpu.c
@@ -0,0 +1,84 @@
1#include <linux/sched.h>
2#include <asm/processor.h>
3#include <asm/fpu.h>
4
5int init_fpu(struct task_struct *tsk)
6{
7 if (tsk_used_math(tsk)) {
8 if ((boot_cpu_data.flags & CPU_HAS_FPU) && tsk == current)
9 unlazy_fpu(tsk, task_pt_regs(tsk));
10 return 0;
11 }
12
13 /*
14 * Memory allocation at the first usage of the FPU and other state.
15 */
16 if (!tsk->thread.xstate) {
17 tsk->thread.xstate = kmem_cache_alloc(task_xstate_cachep,
18 GFP_KERNEL);
19 if (!tsk->thread.xstate)
20 return -ENOMEM;
21 }
22
23 if (boot_cpu_data.flags & CPU_HAS_FPU) {
24 struct sh_fpu_hard_struct *fp = &tsk->thread.xstate->hardfpu;
25 memset(fp, 0, xstate_size);
26 fp->fpscr = FPSCR_INIT;
27 } else {
28 struct sh_fpu_soft_struct *fp = &tsk->thread.xstate->softfpu;
29 memset(fp, 0, xstate_size);
30 fp->fpscr = FPSCR_INIT;
31 }
32
33 set_stopped_child_used_math(tsk);
34 return 0;
35}
36
37#ifdef CONFIG_SH_FPU
38void __fpu_state_restore(void)
39{
40 struct task_struct *tsk = current;
41
42 restore_fpu(tsk);
43
44 task_thread_info(tsk)->status |= TS_USEDFPU;
45 tsk->fpu_counter++;
46}
47
48void fpu_state_restore(struct pt_regs *regs)
49{
50 struct task_struct *tsk = current;
51
52 if (unlikely(!user_mode(regs))) {
53 printk(KERN_ERR "BUG: FPU is used in kernel mode.\n");
54 BUG();
55 return;
56 }
57
58 if (!tsk_used_math(tsk)) {
59 local_irq_enable();
60 /*
61 * does a slab alloc which can sleep
62 */
63 if (init_fpu(tsk)) {
64 /*
65 * ran out of memory!
66 */
67 do_group_exit(SIGKILL);
68 return;
69 }
70 local_irq_disable();
71 }
72
73 grab_fpu(regs);
74
75 __fpu_state_restore();
76}
77
78BUILD_TRAP_HANDLER(fpu_state_restore)
79{
80 TRAP_HANDLER_DECL;
81
82 fpu_state_restore(regs);
83}
84#endif /* CONFIG_SH_FPU */
diff --git a/arch/sh/kernel/cpu/init.c b/arch/sh/kernel/cpu/init.c
index 89b4b76c0d76..c736422344eb 100644
--- a/arch/sh/kernel/cpu/init.c
+++ b/arch/sh/kernel/cpu/init.c
@@ -24,22 +24,32 @@
24#include <asm/elf.h> 24#include <asm/elf.h>
25#include <asm/io.h> 25#include <asm/io.h>
26#include <asm/smp.h> 26#include <asm/smp.h>
27#ifdef CONFIG_SUPERH32 27#include <asm/sh_bios.h>
28#include <asm/ubc.h> 28
29#ifdef CONFIG_SH_FPU
30#define cpu_has_fpu 1
31#else
32#define cpu_has_fpu 0
33#endif
34
35#ifdef CONFIG_SH_DSP
36#define cpu_has_dsp 1
37#else
38#define cpu_has_dsp 0
29#endif 39#endif
30 40
31/* 41/*
32 * Generic wrapper for command line arguments to disable on-chip 42 * Generic wrapper for command line arguments to disable on-chip
33 * peripherals (nofpu, nodsp, and so forth). 43 * peripherals (nofpu, nodsp, and so forth).
34 */ 44 */
35#define onchip_setup(x) \ 45#define onchip_setup(x) \
36static int x##_disabled __initdata = 0; \ 46static int x##_disabled __initdata = !cpu_has_##x; \
37 \ 47 \
38static int __init x##_setup(char *opts) \ 48static int __init x##_setup(char *opts) \
39{ \ 49{ \
40 x##_disabled = 1; \ 50 x##_disabled = 1; \
41 return 1; \ 51 return 1; \
42} \ 52} \
43__setup("no" __stringify(x), x##_setup); 53__setup("no" __stringify(x), x##_setup);
44 54
45onchip_setup(fpu); 55onchip_setup(fpu);
@@ -52,10 +62,10 @@ onchip_setup(dsp);
52static void __init speculative_execution_init(void) 62static void __init speculative_execution_init(void)
53{ 63{
54 /* Clear RABD */ 64 /* Clear RABD */
55 ctrl_outl(ctrl_inl(CPUOPM) & ~CPUOPM_RABD, CPUOPM); 65 __raw_writel(__raw_readl(CPUOPM) & ~CPUOPM_RABD, CPUOPM);
56 66
57 /* Flush the update */ 67 /* Flush the update */
58 (void)ctrl_inl(CPUOPM); 68 (void)__raw_readl(CPUOPM);
59 ctrl_barrier(); 69 ctrl_barrier();
60} 70}
61#else 71#else
@@ -89,7 +99,7 @@ static void __init expmask_init(void)
89#endif 99#endif
90 100
91/* 2nd-level cache init */ 101/* 2nd-level cache init */
92void __uses_jump_to_uncached __attribute__ ((weak)) l2_cache_init(void) 102void __attribute__ ((weak)) l2_cache_init(void)
93{ 103{
94} 104}
95 105
@@ -97,12 +107,12 @@ void __uses_jump_to_uncached __attribute__ ((weak)) l2_cache_init(void)
97 * Generic first-level cache init 107 * Generic first-level cache init
98 */ 108 */
99#ifdef CONFIG_SUPERH32 109#ifdef CONFIG_SUPERH32
100static void __uses_jump_to_uncached cache_init(void) 110static void cache_init(void)
101{ 111{
102 unsigned long ccr, flags; 112 unsigned long ccr, flags;
103 113
104 jump_to_uncached(); 114 jump_to_uncached();
105 ccr = ctrl_inl(CCR); 115 ccr = __raw_readl(CCR);
106 116
107 /* 117 /*
108 * At this point we don't know whether the cache is enabled or not - a 118 * At this point we don't know whether the cache is enabled or not - a
@@ -146,7 +156,7 @@ static void __uses_jump_to_uncached cache_init(void)
146 for (addr = addrstart; 156 for (addr = addrstart;
147 addr < addrstart + waysize; 157 addr < addrstart + waysize;
148 addr += current_cpu_data.dcache.linesz) 158 addr += current_cpu_data.dcache.linesz)
149 ctrl_outl(0, addr); 159 __raw_writel(0, addr);
150 160
151 addrstart += current_cpu_data.dcache.way_incr; 161 addrstart += current_cpu_data.dcache.way_incr;
152 } while (--ways); 162 } while (--ways);
@@ -179,7 +189,7 @@ static void __uses_jump_to_uncached cache_init(void)
179 189
180 l2_cache_init(); 190 l2_cache_init();
181 191
182 ctrl_outl(flags, CCR); 192 __raw_writel(flags, CCR);
183 back_to_cached(); 193 back_to_cached();
184} 194}
185#else 195#else
@@ -207,6 +217,18 @@ static void detect_cache_shape(void)
207 l2_cache_shape = -1; /* No S-cache */ 217 l2_cache_shape = -1; /* No S-cache */
208} 218}
209 219
220static void __init fpu_init(void)
221{
222 /* Disable the FPU */
223 if (fpu_disabled && (current_cpu_data.flags & CPU_HAS_FPU)) {
224 printk("FPU Disabled\n");
225 current_cpu_data.flags &= ~CPU_HAS_FPU;
226 }
227
228 disable_fpu();
229 clear_used_math();
230}
231
210#ifdef CONFIG_SH_DSP 232#ifdef CONFIG_SH_DSP
211static void __init release_dsp(void) 233static void __init release_dsp(void)
212{ 234{
@@ -244,28 +266,35 @@ static void __init dsp_init(void)
244 if (sr & SR_DSP) 266 if (sr & SR_DSP)
245 current_cpu_data.flags |= CPU_HAS_DSP; 267 current_cpu_data.flags |= CPU_HAS_DSP;
246 268
269 /* Disable the DSP */
270 if (dsp_disabled && (current_cpu_data.flags & CPU_HAS_DSP)) {
271 printk("DSP Disabled\n");
272 current_cpu_data.flags &= ~CPU_HAS_DSP;
273 }
274
247 /* Now that we've determined the DSP status, clear the DSP bit. */ 275 /* Now that we've determined the DSP status, clear the DSP bit. */
248 release_dsp(); 276 release_dsp();
249} 277}
278#else
279static inline void __init dsp_init(void) { }
250#endif /* CONFIG_SH_DSP */ 280#endif /* CONFIG_SH_DSP */
251 281
252/** 282/**
253 * sh_cpu_init 283 * sh_cpu_init
254 * 284 *
255 * This is our initial entry point for each CPU, and is invoked on the boot 285 * This is our initial entry point for each CPU, and is invoked on the
256 * CPU prior to calling start_kernel(). For SMP, a combination of this and 286 * boot CPU prior to calling start_kernel(). For SMP, a combination of
257 * start_secondary() will bring up each processor to a ready state prior 287 * this and start_secondary() will bring up each processor to a ready
258 * to hand forking the idle loop. 288 * state prior to hand forking the idle loop.
259 * 289 *
260 * We do all of the basic processor init here, including setting up the 290 * We do all of the basic processor init here, including setting up
261 * caches, FPU, DSP, kicking the UBC, etc. By the time start_kernel() is 291 * the caches, FPU, DSP, etc. By the time start_kernel() is hit (and
262 * hit (and subsequently platform_setup()) things like determining the 292 * subsequently platform_setup()) things like determining the CPU
263 * CPU subtype and initial configuration will all be done. 293 * subtype and initial configuration will all be done.
264 * 294 *
265 * Each processor family is still responsible for doing its own probing 295 * Each processor family is still responsible for doing its own probing
266 * and cache configuration in detect_cpu_and_cache_system(). 296 * and cache configuration in detect_cpu_and_cache_system().
267 */ 297 */
268
269asmlinkage void __init sh_cpu_init(void) 298asmlinkage void __init sh_cpu_init(void)
270{ 299{
271 current_thread_info()->cpu = hard_smp_processor_id(); 300 current_thread_info()->cpu = hard_smp_processor_id();
@@ -302,18 +331,8 @@ asmlinkage void __init sh_cpu_init(void)
302 detect_cache_shape(); 331 detect_cache_shape();
303 } 332 }
304 333
305 /* Disable the FPU */ 334 fpu_init();
306 if (fpu_disabled) { 335 dsp_init();
307 printk("FPU Disabled\n");
308 current_cpu_data.flags &= ~CPU_HAS_FPU;
309 }
310
311 /* FPU initialization */
312 disable_fpu();
313 if ((current_cpu_data.flags & CPU_HAS_FPU)) {
314 current_thread_info()->status &= ~TS_USEDFPU;
315 clear_used_math();
316 }
317 336
318 /* 337 /*
319 * Initialize the per-CPU ASID cache very early, since the 338 * Initialize the per-CPU ASID cache very early, since the
@@ -321,18 +340,24 @@ asmlinkage void __init sh_cpu_init(void)
321 */ 340 */
322 current_cpu_data.asid_cache = NO_CONTEXT; 341 current_cpu_data.asid_cache = NO_CONTEXT;
323 342
324#ifdef CONFIG_SH_DSP
325 /* Probe for DSP */
326 dsp_init();
327
328 /* Disable the DSP */
329 if (dsp_disabled) {
330 printk("DSP Disabled\n");
331 current_cpu_data.flags &= ~CPU_HAS_DSP;
332 release_dsp();
333 }
334#endif
335
336 speculative_execution_init(); 343 speculative_execution_init();
337 expmask_init(); 344 expmask_init();
345
346 /* Do the rest of the boot processor setup */
347 if (raw_smp_processor_id() == 0) {
348 /* Save off the BIOS VBR, if there is one */
349 sh_bios_vbr_init();
350
351 /*
352 * Setup VBR for boot CPU. Secondary CPUs do this through
353 * start_secondary().
354 */
355 per_cpu_trap_init();
356
357 /*
358 * Boot processor to setup the FP and extended state
359 * context info.
360 */
361 init_thread_xstate();
362 }
338} 363}
diff --git a/arch/sh/kernel/cpu/irq/intc-sh5.c b/arch/sh/kernel/cpu/irq/intc-sh5.c
index 06e7e2959b54..96a239583948 100644
--- a/arch/sh/kernel/cpu/irq/intc-sh5.c
+++ b/arch/sh/kernel/cpu/irq/intc-sh5.c
@@ -123,7 +123,7 @@ static void enable_intc_irq(unsigned int irq)
123 bitmask = 1 << (irq - 32); 123 bitmask = 1 << (irq - 32);
124 } 124 }
125 125
126 ctrl_outl(bitmask, reg); 126 __raw_writel(bitmask, reg);
127} 127}
128 128
129static void disable_intc_irq(unsigned int irq) 129static void disable_intc_irq(unsigned int irq)
@@ -139,7 +139,7 @@ static void disable_intc_irq(unsigned int irq)
139 bitmask = 1 << (irq - 32); 139 bitmask = 1 << (irq - 32);
140 } 140 }
141 141
142 ctrl_outl(bitmask, reg); 142 __raw_writel(bitmask, reg);
143} 143}
144 144
145static void mask_and_ack_intc(unsigned int irq) 145static void mask_and_ack_intc(unsigned int irq)
@@ -170,11 +170,11 @@ void __init plat_irq_setup(void)
170 170
171 171
172 /* Disable all interrupts and set all priorities to 0 to avoid trouble */ 172 /* Disable all interrupts and set all priorities to 0 to avoid trouble */
173 ctrl_outl(-1, INTC_INTDSB_0); 173 __raw_writel(-1, INTC_INTDSB_0);
174 ctrl_outl(-1, INTC_INTDSB_1); 174 __raw_writel(-1, INTC_INTDSB_1);
175 175
176 for (reg = INTC_INTPRI_0, i = 0; i < INTC_INTPRI_PREGS; i++, reg += 8) 176 for (reg = INTC_INTPRI_0, i = 0; i < INTC_INTPRI_PREGS; i++, reg += 8)
177 ctrl_outl( NO_PRIORITY, reg); 177 __raw_writel( NO_PRIORITY, reg);
178 178
179 179
180#ifdef CONFIG_SH_CAYMAN 180#ifdef CONFIG_SH_CAYMAN
@@ -199,7 +199,7 @@ void __init plat_irq_setup(void)
199 reg = INTC_ICR_SET; 199 reg = INTC_ICR_SET;
200 i = IRQ_IRL0; 200 i = IRQ_IRL0;
201 } 201 }
202 ctrl_outl(INTC_ICR_IRLM, reg); 202 __raw_writel(INTC_ICR_IRLM, reg);
203 203
204 /* Set interrupt priorities according to platform description */ 204 /* Set interrupt priorities according to platform description */
205 for (data = 0, reg = INTC_INTPRI_0; i < NR_INTC_IRQS; i++) { 205 for (data = 0, reg = INTC_INTPRI_0; i < NR_INTC_IRQS; i++) {
@@ -207,7 +207,7 @@ void __init plat_irq_setup(void)
207 ((i % INTC_INTPRI_PPREG) * 4); 207 ((i % INTC_INTPRI_PPREG) * 4);
208 if ((i % INTC_INTPRI_PPREG) == (INTC_INTPRI_PPREG - 1)) { 208 if ((i % INTC_INTPRI_PPREG) == (INTC_INTPRI_PPREG - 1)) {
209 /* Upon the 7th, set Priority Register */ 209 /* Upon the 7th, set Priority Register */
210 ctrl_outl(data, reg); 210 __raw_writel(data, reg);
211 data = 0; 211 data = 0;
212 reg += 8; 212 reg += 8;
213 } 213 }
diff --git a/arch/sh/kernel/cpu/sh2/clock-sh7619.c b/arch/sh/kernel/cpu/sh2/clock-sh7619.c
index 4fe863170e31..0c9f24d7a02f 100644
--- a/arch/sh/kernel/cpu/sh2/clock-sh7619.c
+++ b/arch/sh/kernel/cpu/sh2/clock-sh7619.c
@@ -31,7 +31,7 @@ static const int pfc_divisors[] = {1,2,0,4};
31 31
32static void master_clk_init(struct clk *clk) 32static void master_clk_init(struct clk *clk)
33{ 33{
34 clk->rate *= PLL2 * pll1rate[(ctrl_inw(FREQCR) >> 8) & 7]; 34 clk->rate *= PLL2 * pll1rate[(__raw_readw(FREQCR) >> 8) & 7];
35} 35}
36 36
37static struct clk_ops sh7619_master_clk_ops = { 37static struct clk_ops sh7619_master_clk_ops = {
@@ -40,7 +40,7 @@ static struct clk_ops sh7619_master_clk_ops = {
40 40
41static unsigned long module_clk_recalc(struct clk *clk) 41static unsigned long module_clk_recalc(struct clk *clk)
42{ 42{
43 int idx = (ctrl_inw(FREQCR) & 0x0007); 43 int idx = (__raw_readw(FREQCR) & 0x0007);
44 return clk->parent->rate / pfc_divisors[idx]; 44 return clk->parent->rate / pfc_divisors[idx];
45} 45}
46 46
@@ -50,7 +50,7 @@ static struct clk_ops sh7619_module_clk_ops = {
50 50
51static unsigned long bus_clk_recalc(struct clk *clk) 51static unsigned long bus_clk_recalc(struct clk *clk)
52{ 52{
53 return clk->parent->rate / pll1rate[(ctrl_inw(FREQCR) >> 8) & 7]; 53 return clk->parent->rate / pll1rate[(__raw_readw(FREQCR) >> 8) & 7];
54} 54}
55 55
56static struct clk_ops sh7619_bus_clk_ops = { 56static struct clk_ops sh7619_bus_clk_ops = {
diff --git a/arch/sh/kernel/cpu/sh2a/clock-sh7201.c b/arch/sh/kernel/cpu/sh2a/clock-sh7201.c
index 7814c76159a7..b26264dc2aef 100644
--- a/arch/sh/kernel/cpu/sh2a/clock-sh7201.c
+++ b/arch/sh/kernel/cpu/sh2a/clock-sh7201.c
@@ -34,7 +34,7 @@ static const int pfc_divisors[]={1,2,3,4,6,8,12};
34 34
35static void master_clk_init(struct clk *clk) 35static void master_clk_init(struct clk *clk)
36{ 36{
37 return 10000000 * PLL2 * pll1rate[(ctrl_inw(FREQCR) >> 8) & 0x0007]; 37 return 10000000 * PLL2 * pll1rate[(__raw_readw(FREQCR) >> 8) & 0x0007];
38} 38}
39 39
40static struct clk_ops sh7201_master_clk_ops = { 40static struct clk_ops sh7201_master_clk_ops = {
@@ -43,7 +43,7 @@ static struct clk_ops sh7201_master_clk_ops = {
43 43
44static unsigned long module_clk_recalc(struct clk *clk) 44static unsigned long module_clk_recalc(struct clk *clk)
45{ 45{
46 int idx = (ctrl_inw(FREQCR) & 0x0007); 46 int idx = (__raw_readw(FREQCR) & 0x0007);
47 return clk->parent->rate / pfc_divisors[idx]; 47 return clk->parent->rate / pfc_divisors[idx];
48} 48}
49 49
@@ -53,7 +53,7 @@ static struct clk_ops sh7201_module_clk_ops = {
53 53
54static unsigned long bus_clk_recalc(struct clk *clk) 54static unsigned long bus_clk_recalc(struct clk *clk)
55{ 55{
56 int idx = (ctrl_inw(FREQCR) & 0x0007); 56 int idx = (__raw_readw(FREQCR) & 0x0007);
57 return clk->parent->rate / pfc_divisors[idx]; 57 return clk->parent->rate / pfc_divisors[idx];
58} 58}
59 59
@@ -63,7 +63,7 @@ static struct clk_ops sh7201_bus_clk_ops = {
63 63
64static unsigned long cpu_clk_recalc(struct clk *clk) 64static unsigned long cpu_clk_recalc(struct clk *clk)
65{ 65{
66 int idx = ((ctrl_inw(FREQCR) >> 4) & 0x0007); 66 int idx = ((__raw_readw(FREQCR) >> 4) & 0x0007);
67 return clk->parent->rate / ifc_divisors[idx]; 67 return clk->parent->rate / ifc_divisors[idx];
68} 68}
69 69
diff --git a/arch/sh/kernel/cpu/sh2a/clock-sh7203.c b/arch/sh/kernel/cpu/sh2a/clock-sh7203.c
index 940986965102..7e75d8f79502 100644
--- a/arch/sh/kernel/cpu/sh2a/clock-sh7203.c
+++ b/arch/sh/kernel/cpu/sh2a/clock-sh7203.c
@@ -39,7 +39,7 @@ static const int pfc_divisors[]={1,2,3,4,6,8,12};
39 39
40static void master_clk_init(struct clk *clk) 40static void master_clk_init(struct clk *clk)
41{ 41{
42 clk->rate *= pll1rate[(ctrl_inw(FREQCR) >> 8) & 0x0003] * PLL2 ; 42 clk->rate *= pll1rate[(__raw_readw(FREQCR) >> 8) & 0x0003] * PLL2 ;
43} 43}
44 44
45static struct clk_ops sh7203_master_clk_ops = { 45static struct clk_ops sh7203_master_clk_ops = {
@@ -48,7 +48,7 @@ static struct clk_ops sh7203_master_clk_ops = {
48 48
49static unsigned long module_clk_recalc(struct clk *clk) 49static unsigned long module_clk_recalc(struct clk *clk)
50{ 50{
51 int idx = (ctrl_inw(FREQCR) & 0x0007); 51 int idx = (__raw_readw(FREQCR) & 0x0007);
52 return clk->parent->rate / pfc_divisors[idx]; 52 return clk->parent->rate / pfc_divisors[idx];
53} 53}
54 54
@@ -58,7 +58,7 @@ static struct clk_ops sh7203_module_clk_ops = {
58 58
59static unsigned long bus_clk_recalc(struct clk *clk) 59static unsigned long bus_clk_recalc(struct clk *clk)
60{ 60{
61 int idx = (ctrl_inw(FREQCR) & 0x0007); 61 int idx = (__raw_readw(FREQCR) & 0x0007);
62 return clk->parent->rate / pfc_divisors[idx-2]; 62 return clk->parent->rate / pfc_divisors[idx-2];
63} 63}
64 64
diff --git a/arch/sh/kernel/cpu/sh2a/clock-sh7206.c b/arch/sh/kernel/cpu/sh2a/clock-sh7206.c
index c2268bdeceeb..b27a5e2687ab 100644
--- a/arch/sh/kernel/cpu/sh2a/clock-sh7206.c
+++ b/arch/sh/kernel/cpu/sh2a/clock-sh7206.c
@@ -34,7 +34,7 @@ static const int pfc_divisors[]={1,2,3,4,6,8,12};
34 34
35static void master_clk_init(struct clk *clk) 35static void master_clk_init(struct clk *clk)
36{ 36{
37 clk->rate *= PLL2 * pll1rate[(ctrl_inw(FREQCR) >> 8) & 0x0007]; 37 clk->rate *= PLL2 * pll1rate[(__raw_readw(FREQCR) >> 8) & 0x0007];
38} 38}
39 39
40static struct clk_ops sh7206_master_clk_ops = { 40static struct clk_ops sh7206_master_clk_ops = {
@@ -43,7 +43,7 @@ static struct clk_ops sh7206_master_clk_ops = {
43 43
44static unsigned long module_clk_recalc(struct clk *clk) 44static unsigned long module_clk_recalc(struct clk *clk)
45{ 45{
46 int idx = (ctrl_inw(FREQCR) & 0x0007); 46 int idx = (__raw_readw(FREQCR) & 0x0007);
47 return clk->parent->rate / pfc_divisors[idx]; 47 return clk->parent->rate / pfc_divisors[idx];
48} 48}
49 49
@@ -53,7 +53,7 @@ static struct clk_ops sh7206_module_clk_ops = {
53 53
54static unsigned long bus_clk_recalc(struct clk *clk) 54static unsigned long bus_clk_recalc(struct clk *clk)
55{ 55{
56 return clk->parent->rate / pll1rate[(ctrl_inw(FREQCR) >> 8) & 0x0007]; 56 return clk->parent->rate / pll1rate[(__raw_readw(FREQCR) >> 8) & 0x0007];
57} 57}
58 58
59static struct clk_ops sh7206_bus_clk_ops = { 59static struct clk_ops sh7206_bus_clk_ops = {
@@ -62,7 +62,7 @@ static struct clk_ops sh7206_bus_clk_ops = {
62 62
63static unsigned long cpu_clk_recalc(struct clk *clk) 63static unsigned long cpu_clk_recalc(struct clk *clk)
64{ 64{
65 int idx = (ctrl_inw(FREQCR) & 0x0007); 65 int idx = (__raw_readw(FREQCR) & 0x0007);
66 return clk->parent->rate / ifc_divisors[idx]; 66 return clk->parent->rate / ifc_divisors[idx];
67} 67}
68 68
diff --git a/arch/sh/kernel/cpu/sh2a/fpu.c b/arch/sh/kernel/cpu/sh2a/fpu.c
index d395ce5740e7..488d24e0cdf0 100644
--- a/arch/sh/kernel/cpu/sh2a/fpu.c
+++ b/arch/sh/kernel/cpu/sh2a/fpu.c
@@ -26,8 +26,7 @@
26/* 26/*
27 * Save FPU registers onto task structure. 27 * Save FPU registers onto task structure.
28 */ 28 */
29void 29void save_fpu(struct task_struct *tsk)
30save_fpu(struct task_struct *tsk)
31{ 30{
32 unsigned long dummy; 31 unsigned long dummy;
33 32
@@ -52,7 +51,7 @@ save_fpu(struct task_struct *tsk)
52 "fmov.s fr0, @-%0\n\t" 51 "fmov.s fr0, @-%0\n\t"
53 "lds %3, fpscr\n\t" 52 "lds %3, fpscr\n\t"
54 : "=r" (dummy) 53 : "=r" (dummy)
55 : "0" ((char *)(&tsk->thread.fpu.hard.status)), 54 : "0" ((char *)(&tsk->thread.xstate->hardfpu.status)),
56 "r" (FPSCR_RCHG), 55 "r" (FPSCR_RCHG),
57 "r" (FPSCR_INIT) 56 "r" (FPSCR_INIT)
58 : "memory"); 57 : "memory");
@@ -60,8 +59,7 @@ save_fpu(struct task_struct *tsk)
60 disable_fpu(); 59 disable_fpu();
61} 60}
62 61
63static void 62void restore_fpu(struct task_struct *tsk)
64restore_fpu(struct task_struct *tsk)
65{ 63{
66 unsigned long dummy; 64 unsigned long dummy;
67 65
@@ -85,45 +83,12 @@ restore_fpu(struct task_struct *tsk)
85 "lds.l @%0+, fpscr\n\t" 83 "lds.l @%0+, fpscr\n\t"
86 "lds.l @%0+, fpul\n\t" 84 "lds.l @%0+, fpul\n\t"
87 : "=r" (dummy) 85 : "=r" (dummy)
88 : "0" (&tsk->thread.fpu), "r" (FPSCR_RCHG) 86 : "0" (tsk->thread.xstate), "r" (FPSCR_RCHG)
89 : "memory"); 87 : "memory");
90 disable_fpu(); 88 disable_fpu();
91} 89}
92 90
93/* 91/*
94 * Load the FPU with signalling NANS. This bit pattern we're using
95 * has the property that no matter wether considered as single or as
96 * double precission represents signaling NANS.
97 */
98
99static void
100fpu_init(void)
101{
102 enable_fpu();
103 asm volatile("lds %0, fpul\n\t"
104 "fsts fpul, fr0\n\t"
105 "fsts fpul, fr1\n\t"
106 "fsts fpul, fr2\n\t"
107 "fsts fpul, fr3\n\t"
108 "fsts fpul, fr4\n\t"
109 "fsts fpul, fr5\n\t"
110 "fsts fpul, fr6\n\t"
111 "fsts fpul, fr7\n\t"
112 "fsts fpul, fr8\n\t"
113 "fsts fpul, fr9\n\t"
114 "fsts fpul, fr10\n\t"
115 "fsts fpul, fr11\n\t"
116 "fsts fpul, fr12\n\t"
117 "fsts fpul, fr13\n\t"
118 "fsts fpul, fr14\n\t"
119 "fsts fpul, fr15\n\t"
120 "lds %2, fpscr\n\t"
121 : /* no output */
122 : "r" (0), "r" (FPSCR_RCHG), "r" (FPSCR_INIT));
123 disable_fpu();
124}
125
126/*
127 * Emulate arithmetic ops on denormalized number for some FPU insns. 92 * Emulate arithmetic ops on denormalized number for some FPU insns.
128 */ 93 */
129 94
@@ -490,9 +455,9 @@ ieee_fpe_handler (struct pt_regs *regs)
490 if ((finsn & 0xf1ff) == 0xf0ad) { /* fcnvsd */ 455 if ((finsn & 0xf1ff) == 0xf0ad) { /* fcnvsd */
491 struct task_struct *tsk = current; 456 struct task_struct *tsk = current;
492 457
493 if ((tsk->thread.fpu.hard.fpscr & FPSCR_FPU_ERROR)) { 458 if ((tsk->thread.xstate->hardfpu.fpscr & FPSCR_FPU_ERROR)) {
494 /* FPU error */ 459 /* FPU error */
495 denormal_to_double (&tsk->thread.fpu.hard, 460 denormal_to_double (&tsk->thread.xstate->hardfpu,
496 (finsn >> 8) & 0xf); 461 (finsn >> 8) & 0xf);
497 } else 462 } else
498 return 0; 463 return 0;
@@ -507,9 +472,9 @@ ieee_fpe_handler (struct pt_regs *regs)
507 472
508 n = (finsn >> 8) & 0xf; 473 n = (finsn >> 8) & 0xf;
509 m = (finsn >> 4) & 0xf; 474 m = (finsn >> 4) & 0xf;
510 hx = tsk->thread.fpu.hard.fp_regs[n]; 475 hx = tsk->thread.xstate->hardfpu.fp_regs[n];
511 hy = tsk->thread.fpu.hard.fp_regs[m]; 476 hy = tsk->thread.xstate->hardfpu.fp_regs[m];
512 fpscr = tsk->thread.fpu.hard.fpscr; 477 fpscr = tsk->thread.xstate->hardfpu.fpscr;
513 prec = fpscr & (1 << 19); 478 prec = fpscr & (1 << 19);
514 479
515 if ((fpscr & FPSCR_FPU_ERROR) 480 if ((fpscr & FPSCR_FPU_ERROR)
@@ -519,15 +484,15 @@ ieee_fpe_handler (struct pt_regs *regs)
519 484
520 /* FPU error because of denormal */ 485 /* FPU error because of denormal */
521 llx = ((long long) hx << 32) 486 llx = ((long long) hx << 32)
522 | tsk->thread.fpu.hard.fp_regs[n+1]; 487 | tsk->thread.xstate->hardfpu.fp_regs[n+1];
523 lly = ((long long) hy << 32) 488 lly = ((long long) hy << 32)
524 | tsk->thread.fpu.hard.fp_regs[m+1]; 489 | tsk->thread.xstate->hardfpu.fp_regs[m+1];
525 if ((hx & 0x7fffffff) >= 0x00100000) 490 if ((hx & 0x7fffffff) >= 0x00100000)
526 llx = denormal_muld(lly, llx); 491 llx = denormal_muld(lly, llx);
527 else 492 else
528 llx = denormal_muld(llx, lly); 493 llx = denormal_muld(llx, lly);
529 tsk->thread.fpu.hard.fp_regs[n] = llx >> 32; 494 tsk->thread.xstate->hardfpu.fp_regs[n] = llx >> 32;
530 tsk->thread.fpu.hard.fp_regs[n+1] = llx & 0xffffffff; 495 tsk->thread.xstate->hardfpu.fp_regs[n+1] = llx & 0xffffffff;
531 } else if ((fpscr & FPSCR_FPU_ERROR) 496 } else if ((fpscr & FPSCR_FPU_ERROR)
532 && (!prec && ((hx & 0x7fffffff) < 0x00800000 497 && (!prec && ((hx & 0x7fffffff) < 0x00800000
533 || (hy & 0x7fffffff) < 0x00800000))) { 498 || (hy & 0x7fffffff) < 0x00800000))) {
@@ -536,7 +501,7 @@ ieee_fpe_handler (struct pt_regs *regs)
536 hx = denormal_mulf(hy, hx); 501 hx = denormal_mulf(hy, hx);
537 else 502 else
538 hx = denormal_mulf(hx, hy); 503 hx = denormal_mulf(hx, hy);
539 tsk->thread.fpu.hard.fp_regs[n] = hx; 504 tsk->thread.xstate->hardfpu.fp_regs[n] = hx;
540 } else 505 } else
541 return 0; 506 return 0;
542 507
@@ -550,9 +515,9 @@ ieee_fpe_handler (struct pt_regs *regs)
550 515
551 n = (finsn >> 8) & 0xf; 516 n = (finsn >> 8) & 0xf;
552 m = (finsn >> 4) & 0xf; 517 m = (finsn >> 4) & 0xf;
553 hx = tsk->thread.fpu.hard.fp_regs[n]; 518 hx = tsk->thread.xstate->hardfpu.fp_regs[n];
554 hy = tsk->thread.fpu.hard.fp_regs[m]; 519 hy = tsk->thread.xstate->hardfpu.fp_regs[m];
555 fpscr = tsk->thread.fpu.hard.fpscr; 520 fpscr = tsk->thread.xstate->hardfpu.fpscr;
556 prec = fpscr & (1 << 19); 521 prec = fpscr & (1 << 19);
557 522
558 if ((fpscr & FPSCR_FPU_ERROR) 523 if ((fpscr & FPSCR_FPU_ERROR)
@@ -562,15 +527,15 @@ ieee_fpe_handler (struct pt_regs *regs)
562 527
563 /* FPU error because of denormal */ 528 /* FPU error because of denormal */
564 llx = ((long long) hx << 32) 529 llx = ((long long) hx << 32)
565 | tsk->thread.fpu.hard.fp_regs[n+1]; 530 | tsk->thread.xstate->hardfpu.fp_regs[n+1];
566 lly = ((long long) hy << 32) 531 lly = ((long long) hy << 32)
567 | tsk->thread.fpu.hard.fp_regs[m+1]; 532 | tsk->thread.xstate->hardfpu.fp_regs[m+1];
568 if ((finsn & 0xf00f) == 0xf000) 533 if ((finsn & 0xf00f) == 0xf000)
569 llx = denormal_addd(llx, lly); 534 llx = denormal_addd(llx, lly);
570 else 535 else
571 llx = denormal_addd(llx, lly ^ (1LL << 63)); 536 llx = denormal_addd(llx, lly ^ (1LL << 63));
572 tsk->thread.fpu.hard.fp_regs[n] = llx >> 32; 537 tsk->thread.xstate->hardfpu.fp_regs[n] = llx >> 32;
573 tsk->thread.fpu.hard.fp_regs[n+1] = llx & 0xffffffff; 538 tsk->thread.xstate->hardfpu.fp_regs[n+1] = llx & 0xffffffff;
574 } else if ((fpscr & FPSCR_FPU_ERROR) 539 } else if ((fpscr & FPSCR_FPU_ERROR)
575 && (!prec && ((hx & 0x7fffffff) < 0x00800000 540 && (!prec && ((hx & 0x7fffffff) < 0x00800000
576 || (hy & 0x7fffffff) < 0x00800000))) { 541 || (hy & 0x7fffffff) < 0x00800000))) {
@@ -579,7 +544,7 @@ ieee_fpe_handler (struct pt_regs *regs)
579 hx = denormal_addf(hx, hy); 544 hx = denormal_addf(hx, hy);
580 else 545 else
581 hx = denormal_addf(hx, hy ^ 0x80000000); 546 hx = denormal_addf(hx, hy ^ 0x80000000);
582 tsk->thread.fpu.hard.fp_regs[n] = hx; 547 tsk->thread.xstate->hardfpu.fp_regs[n] = hx;
583 } else 548 } else
584 return 0; 549 return 0;
585 550
@@ -597,7 +562,7 @@ BUILD_TRAP_HANDLER(fpu_error)
597 562
598 __unlazy_fpu(tsk, regs); 563 __unlazy_fpu(tsk, regs);
599 if (ieee_fpe_handler(regs)) { 564 if (ieee_fpe_handler(regs)) {
600 tsk->thread.fpu.hard.fpscr &= 565 tsk->thread.xstate->hardfpu.fpscr &=
601 ~(FPSCR_CAUSE_MASK | FPSCR_FLAG_MASK); 566 ~(FPSCR_CAUSE_MASK | FPSCR_FLAG_MASK);
602 grab_fpu(regs); 567 grab_fpu(regs);
603 restore_fpu(tsk); 568 restore_fpu(tsk);
@@ -607,33 +572,3 @@ BUILD_TRAP_HANDLER(fpu_error)
607 572
608 force_sig(SIGFPE, tsk); 573 force_sig(SIGFPE, tsk);
609} 574}
610
611void fpu_state_restore(struct pt_regs *regs)
612{
613 struct task_struct *tsk = current;
614
615 grab_fpu(regs);
616 if (unlikely(!user_mode(regs))) {
617 printk(KERN_ERR "BUG: FPU is used in kernel mode.\n");
618 BUG();
619 return;
620 }
621
622 if (likely(used_math())) {
623 /* Using the FPU again. */
624 restore_fpu(tsk);
625 } else {
626 /* First time FPU user. */
627 fpu_init();
628 set_used_math();
629 }
630 task_thread_info(tsk)->status |= TS_USEDFPU;
631 tsk->fpu_counter++;
632}
633
634BUILD_TRAP_HANDLER(fpu_state_restore)
635{
636 TRAP_HANDLER_DECL;
637
638 fpu_state_restore(regs);
639}
diff --git a/arch/sh/kernel/cpu/sh3/clock-sh3.c b/arch/sh/kernel/cpu/sh3/clock-sh3.c
index 27b8738f0b09..b78384afac09 100644
--- a/arch/sh/kernel/cpu/sh3/clock-sh3.c
+++ b/arch/sh/kernel/cpu/sh3/clock-sh3.c
@@ -28,7 +28,7 @@ static int pfc_divisors[] = { 1, 2, 3, 4, 6, 1, 1, 1 };
28 28
29static void master_clk_init(struct clk *clk) 29static void master_clk_init(struct clk *clk)
30{ 30{
31 int frqcr = ctrl_inw(FRQCR); 31 int frqcr = __raw_readw(FRQCR);
32 int idx = ((frqcr & 0x2000) >> 11) | (frqcr & 0x0003); 32 int idx = ((frqcr & 0x2000) >> 11) | (frqcr & 0x0003);
33 33
34 clk->rate *= pfc_divisors[idx]; 34 clk->rate *= pfc_divisors[idx];
@@ -40,7 +40,7 @@ static struct clk_ops sh3_master_clk_ops = {
40 40
41static unsigned long module_clk_recalc(struct clk *clk) 41static unsigned long module_clk_recalc(struct clk *clk)
42{ 42{
43 int frqcr = ctrl_inw(FRQCR); 43 int frqcr = __raw_readw(FRQCR);
44 int idx = ((frqcr & 0x2000) >> 11) | (frqcr & 0x0003); 44 int idx = ((frqcr & 0x2000) >> 11) | (frqcr & 0x0003);
45 45
46 return clk->parent->rate / pfc_divisors[idx]; 46 return clk->parent->rate / pfc_divisors[idx];
@@ -52,7 +52,7 @@ static struct clk_ops sh3_module_clk_ops = {
52 52
53static unsigned long bus_clk_recalc(struct clk *clk) 53static unsigned long bus_clk_recalc(struct clk *clk)
54{ 54{
55 int frqcr = ctrl_inw(FRQCR); 55 int frqcr = __raw_readw(FRQCR);
56 int idx = ((frqcr & 0x8000) >> 13) | ((frqcr & 0x0030) >> 4); 56 int idx = ((frqcr & 0x8000) >> 13) | ((frqcr & 0x0030) >> 4);
57 57
58 return clk->parent->rate / stc_multipliers[idx]; 58 return clk->parent->rate / stc_multipliers[idx];
@@ -64,7 +64,7 @@ static struct clk_ops sh3_bus_clk_ops = {
64 64
65static unsigned long cpu_clk_recalc(struct clk *clk) 65static unsigned long cpu_clk_recalc(struct clk *clk)
66{ 66{
67 int frqcr = ctrl_inw(FRQCR); 67 int frqcr = __raw_readw(FRQCR);
68 int idx = ((frqcr & 0x4000) >> 12) | ((frqcr & 0x000c) >> 2); 68 int idx = ((frqcr & 0x4000) >> 12) | ((frqcr & 0x000c) >> 2);
69 69
70 return clk->parent->rate / ifc_divisors[idx]; 70 return clk->parent->rate / ifc_divisors[idx];
diff --git a/arch/sh/kernel/cpu/sh3/clock-sh7705.c b/arch/sh/kernel/cpu/sh3/clock-sh7705.c
index 0ca8f2c3646c..0ecea1451c6f 100644
--- a/arch/sh/kernel/cpu/sh3/clock-sh7705.c
+++ b/arch/sh/kernel/cpu/sh3/clock-sh7705.c
@@ -32,7 +32,7 @@ static int pfc_divisors[] = { 1, 2, 3, 4, 6, 1, 1, 1 };
32 32
33static void master_clk_init(struct clk *clk) 33static void master_clk_init(struct clk *clk)
34{ 34{
35 clk->rate *= pfc_divisors[ctrl_inw(FRQCR) & 0x0003]; 35 clk->rate *= pfc_divisors[__raw_readw(FRQCR) & 0x0003];
36} 36}
37 37
38static struct clk_ops sh7705_master_clk_ops = { 38static struct clk_ops sh7705_master_clk_ops = {
@@ -41,7 +41,7 @@ static struct clk_ops sh7705_master_clk_ops = {
41 41
42static unsigned long module_clk_recalc(struct clk *clk) 42static unsigned long module_clk_recalc(struct clk *clk)
43{ 43{
44 int idx = ctrl_inw(FRQCR) & 0x0003; 44 int idx = __raw_readw(FRQCR) & 0x0003;
45 return clk->parent->rate / pfc_divisors[idx]; 45 return clk->parent->rate / pfc_divisors[idx];
46} 46}
47 47
@@ -51,7 +51,7 @@ static struct clk_ops sh7705_module_clk_ops = {
51 51
52static unsigned long bus_clk_recalc(struct clk *clk) 52static unsigned long bus_clk_recalc(struct clk *clk)
53{ 53{
54 int idx = (ctrl_inw(FRQCR) & 0x0300) >> 8; 54 int idx = (__raw_readw(FRQCR) & 0x0300) >> 8;
55 return clk->parent->rate / stc_multipliers[idx]; 55 return clk->parent->rate / stc_multipliers[idx];
56} 56}
57 57
@@ -61,7 +61,7 @@ static struct clk_ops sh7705_bus_clk_ops = {
61 61
62static unsigned long cpu_clk_recalc(struct clk *clk) 62static unsigned long cpu_clk_recalc(struct clk *clk)
63{ 63{
64 int idx = (ctrl_inw(FRQCR) & 0x0030) >> 4; 64 int idx = (__raw_readw(FRQCR) & 0x0030) >> 4;
65 return clk->parent->rate / ifc_divisors[idx]; 65 return clk->parent->rate / ifc_divisors[idx];
66} 66}
67 67
diff --git a/arch/sh/kernel/cpu/sh3/clock-sh7706.c b/arch/sh/kernel/cpu/sh3/clock-sh7706.c
index 4bf7887d310a..6f9ff8b57dd6 100644
--- a/arch/sh/kernel/cpu/sh3/clock-sh7706.c
+++ b/arch/sh/kernel/cpu/sh3/clock-sh7706.c
@@ -24,7 +24,7 @@ static int pfc_divisors[] = { 1, 2, 4, 1, 3, 6, 1, 1 };
24 24
25static void master_clk_init(struct clk *clk) 25static void master_clk_init(struct clk *clk)
26{ 26{
27 int frqcr = ctrl_inw(FRQCR); 27 int frqcr = __raw_readw(FRQCR);
28 int idx = ((frqcr & 0x2000) >> 11) | (frqcr & 0x0003); 28 int idx = ((frqcr & 0x2000) >> 11) | (frqcr & 0x0003);
29 29
30 clk->rate *= pfc_divisors[idx]; 30 clk->rate *= pfc_divisors[idx];
@@ -36,7 +36,7 @@ static struct clk_ops sh7706_master_clk_ops = {
36 36
37static unsigned long module_clk_recalc(struct clk *clk) 37static unsigned long module_clk_recalc(struct clk *clk)
38{ 38{
39 int frqcr = ctrl_inw(FRQCR); 39 int frqcr = __raw_readw(FRQCR);
40 int idx = ((frqcr & 0x2000) >> 11) | (frqcr & 0x0003); 40 int idx = ((frqcr & 0x2000) >> 11) | (frqcr & 0x0003);
41 41
42 return clk->parent->rate / pfc_divisors[idx]; 42 return clk->parent->rate / pfc_divisors[idx];
@@ -48,7 +48,7 @@ static struct clk_ops sh7706_module_clk_ops = {
48 48
49static unsigned long bus_clk_recalc(struct clk *clk) 49static unsigned long bus_clk_recalc(struct clk *clk)
50{ 50{
51 int frqcr = ctrl_inw(FRQCR); 51 int frqcr = __raw_readw(FRQCR);
52 int idx = ((frqcr & 0x8000) >> 13) | ((frqcr & 0x0030) >> 4); 52 int idx = ((frqcr & 0x8000) >> 13) | ((frqcr & 0x0030) >> 4);
53 53
54 return clk->parent->rate / stc_multipliers[idx]; 54 return clk->parent->rate / stc_multipliers[idx];
@@ -60,7 +60,7 @@ static struct clk_ops sh7706_bus_clk_ops = {
60 60
61static unsigned long cpu_clk_recalc(struct clk *clk) 61static unsigned long cpu_clk_recalc(struct clk *clk)
62{ 62{
63 int frqcr = ctrl_inw(FRQCR); 63 int frqcr = __raw_readw(FRQCR);
64 int idx = ((frqcr & 0x4000) >> 12) | ((frqcr & 0x000c) >> 2); 64 int idx = ((frqcr & 0x4000) >> 12) | ((frqcr & 0x000c) >> 2);
65 65
66 return clk->parent->rate / ifc_divisors[idx]; 66 return clk->parent->rate / ifc_divisors[idx];
diff --git a/arch/sh/kernel/cpu/sh3/clock-sh7709.c b/arch/sh/kernel/cpu/sh3/clock-sh7709.c
index e8749505bd2a..f302ba09e681 100644
--- a/arch/sh/kernel/cpu/sh3/clock-sh7709.c
+++ b/arch/sh/kernel/cpu/sh3/clock-sh7709.c
@@ -24,7 +24,7 @@ static int pfc_divisors[] = { 1, 2, 4, 1, 3, 6, 1, 1 };
24 24
25static void master_clk_init(struct clk *clk) 25static void master_clk_init(struct clk *clk)
26{ 26{
27 int frqcr = ctrl_inw(FRQCR); 27 int frqcr = __raw_readw(FRQCR);
28 int idx = ((frqcr & 0x2000) >> 11) | (frqcr & 0x0003); 28 int idx = ((frqcr & 0x2000) >> 11) | (frqcr & 0x0003);
29 29
30 clk->rate *= pfc_divisors[idx]; 30 clk->rate *= pfc_divisors[idx];
@@ -36,7 +36,7 @@ static struct clk_ops sh7709_master_clk_ops = {
36 36
37static unsigned long module_clk_recalc(struct clk *clk) 37static unsigned long module_clk_recalc(struct clk *clk)
38{ 38{
39 int frqcr = ctrl_inw(FRQCR); 39 int frqcr = __raw_readw(FRQCR);
40 int idx = ((frqcr & 0x2000) >> 11) | (frqcr & 0x0003); 40 int idx = ((frqcr & 0x2000) >> 11) | (frqcr & 0x0003);
41 41
42 return clk->parent->rate / pfc_divisors[idx]; 42 return clk->parent->rate / pfc_divisors[idx];
@@ -48,7 +48,7 @@ static struct clk_ops sh7709_module_clk_ops = {
48 48
49static unsigned long bus_clk_recalc(struct clk *clk) 49static unsigned long bus_clk_recalc(struct clk *clk)
50{ 50{
51 int frqcr = ctrl_inw(FRQCR); 51 int frqcr = __raw_readw(FRQCR);
52 int idx = (frqcr & 0x0080) ? 52 int idx = (frqcr & 0x0080) ?
53 ((frqcr & 0x8000) >> 13) | ((frqcr & 0x0030) >> 4) : 1; 53 ((frqcr & 0x8000) >> 13) | ((frqcr & 0x0030) >> 4) : 1;
54 54
@@ -61,7 +61,7 @@ static struct clk_ops sh7709_bus_clk_ops = {
61 61
62static unsigned long cpu_clk_recalc(struct clk *clk) 62static unsigned long cpu_clk_recalc(struct clk *clk)
63{ 63{
64 int frqcr = ctrl_inw(FRQCR); 64 int frqcr = __raw_readw(FRQCR);
65 int idx = ((frqcr & 0x4000) >> 12) | ((frqcr & 0x000c) >> 2); 65 int idx = ((frqcr & 0x4000) >> 12) | ((frqcr & 0x000c) >> 2);
66 66
67 return clk->parent->rate / ifc_divisors[idx]; 67 return clk->parent->rate / ifc_divisors[idx];
diff --git a/arch/sh/kernel/cpu/sh3/clock-sh7710.c b/arch/sh/kernel/cpu/sh3/clock-sh7710.c
index 030a58ba18a5..29a87d8946a4 100644
--- a/arch/sh/kernel/cpu/sh3/clock-sh7710.c
+++ b/arch/sh/kernel/cpu/sh3/clock-sh7710.c
@@ -26,7 +26,7 @@ static int md_table[] = { 1, 2, 3, 4, 6, 8, 12 };
26 26
27static void master_clk_init(struct clk *clk) 27static void master_clk_init(struct clk *clk)
28{ 28{
29 clk->rate *= md_table[ctrl_inw(FRQCR) & 0x0007]; 29 clk->rate *= md_table[__raw_readw(FRQCR) & 0x0007];
30} 30}
31 31
32static struct clk_ops sh7710_master_clk_ops = { 32static struct clk_ops sh7710_master_clk_ops = {
@@ -35,7 +35,7 @@ static struct clk_ops sh7710_master_clk_ops = {
35 35
36static unsigned long module_clk_recalc(struct clk *clk) 36static unsigned long module_clk_recalc(struct clk *clk)
37{ 37{
38 int idx = (ctrl_inw(FRQCR) & 0x0007); 38 int idx = (__raw_readw(FRQCR) & 0x0007);
39 return clk->parent->rate / md_table[idx]; 39 return clk->parent->rate / md_table[idx];
40} 40}
41 41
@@ -45,7 +45,7 @@ static struct clk_ops sh7710_module_clk_ops = {
45 45
46static unsigned long bus_clk_recalc(struct clk *clk) 46static unsigned long bus_clk_recalc(struct clk *clk)
47{ 47{
48 int idx = (ctrl_inw(FRQCR) & 0x0700) >> 8; 48 int idx = (__raw_readw(FRQCR) & 0x0700) >> 8;
49 return clk->parent->rate / md_table[idx]; 49 return clk->parent->rate / md_table[idx];
50} 50}
51 51
@@ -55,7 +55,7 @@ static struct clk_ops sh7710_bus_clk_ops = {
55 55
56static unsigned long cpu_clk_recalc(struct clk *clk) 56static unsigned long cpu_clk_recalc(struct clk *clk)
57{ 57{
58 int idx = (ctrl_inw(FRQCR) & 0x0070) >> 4; 58 int idx = (__raw_readw(FRQCR) & 0x0070) >> 4;
59 return clk->parent->rate / md_table[idx]; 59 return clk->parent->rate / md_table[idx];
60} 60}
61 61
diff --git a/arch/sh/kernel/cpu/sh3/clock-sh7712.c b/arch/sh/kernel/cpu/sh3/clock-sh7712.c
index 6428ee6c77ed..b0d0c5203996 100644
--- a/arch/sh/kernel/cpu/sh3/clock-sh7712.c
+++ b/arch/sh/kernel/cpu/sh3/clock-sh7712.c
@@ -23,7 +23,7 @@ static int divisors[] = { 1, 2, 3, 4, 6 };
23 23
24static void master_clk_init(struct clk *clk) 24static void master_clk_init(struct clk *clk)
25{ 25{
26 int frqcr = ctrl_inw(FRQCR); 26 int frqcr = __raw_readw(FRQCR);
27 int idx = (frqcr & 0x0300) >> 8; 27 int idx = (frqcr & 0x0300) >> 8;
28 28
29 clk->rate *= multipliers[idx]; 29 clk->rate *= multipliers[idx];
@@ -35,7 +35,7 @@ static struct clk_ops sh7712_master_clk_ops = {
35 35
36static unsigned long module_clk_recalc(struct clk *clk) 36static unsigned long module_clk_recalc(struct clk *clk)
37{ 37{
38 int frqcr = ctrl_inw(FRQCR); 38 int frqcr = __raw_readw(FRQCR);
39 int idx = frqcr & 0x0007; 39 int idx = frqcr & 0x0007;
40 40
41 return clk->parent->rate / divisors[idx]; 41 return clk->parent->rate / divisors[idx];
@@ -47,7 +47,7 @@ static struct clk_ops sh7712_module_clk_ops = {
47 47
48static unsigned long cpu_clk_recalc(struct clk *clk) 48static unsigned long cpu_clk_recalc(struct clk *clk)
49{ 49{
50 int frqcr = ctrl_inw(FRQCR); 50 int frqcr = __raw_readw(FRQCR);
51 int idx = (frqcr & 0x0030) >> 4; 51 int idx = (frqcr & 0x0030) >> 4;
52 52
53 return clk->parent->rate / divisors[idx]; 53 return clk->parent->rate / divisors[idx];
diff --git a/arch/sh/kernel/cpu/sh3/ex.S b/arch/sh/kernel/cpu/sh3/ex.S
index 46610c35c232..99b4d020179a 100644
--- a/arch/sh/kernel/cpu/sh3/ex.S
+++ b/arch/sh/kernel/cpu/sh3/ex.S
@@ -49,7 +49,7 @@ ENTRY(exception_handling_table)
49 .long exception_error ! reserved_instruction (filled by trap_init) /* 180 */ 49 .long exception_error ! reserved_instruction (filled by trap_init) /* 180 */
50 .long exception_error ! illegal_slot_instruction (filled by trap_init) /*1A0*/ 50 .long exception_error ! illegal_slot_instruction (filled by trap_init) /*1A0*/
51 .long nmi_trap_handler /* 1C0 */ ! Allow trap to debugger 51 .long nmi_trap_handler /* 1C0 */ ! Allow trap to debugger
52 .long break_point_trap /* 1E0 */ 52 .long breakpoint_trap_handler /* 1E0 */
53 53
54 /* 54 /*
55 * Pad the remainder of the table out, exceptions residing in far 55 * Pad the remainder of the table out, exceptions residing in far
diff --git a/arch/sh/kernel/cpu/sh3/probe.c b/arch/sh/kernel/cpu/sh3/probe.c
index f9c7df64eb01..295ec4c99e98 100644
--- a/arch/sh/kernel/cpu/sh3/probe.c
+++ b/arch/sh/kernel/cpu/sh3/probe.c
@@ -16,7 +16,7 @@
16#include <asm/cache.h> 16#include <asm/cache.h>
17#include <asm/io.h> 17#include <asm/io.h>
18 18
19int __uses_jump_to_uncached detect_cpu_and_cache_system(void) 19int detect_cpu_and_cache_system(void)
20{ 20{
21 unsigned long addr0, addr1, data0, data1, data2, data3; 21 unsigned long addr0, addr1, data0, data1, data2, data3;
22 22
@@ -30,23 +30,23 @@ int __uses_jump_to_uncached detect_cpu_and_cache_system(void)
30 addr1 = CACHE_OC_ADDRESS_ARRAY + (1 << 12); 30 addr1 = CACHE_OC_ADDRESS_ARRAY + (1 << 12);
31 31
32 /* First, write back & invalidate */ 32 /* First, write back & invalidate */
33 data0 = ctrl_inl(addr0); 33 data0 = __raw_readl(addr0);
34 ctrl_outl(data0&~(SH_CACHE_VALID|SH_CACHE_UPDATED), addr0); 34 __raw_writel(data0&~(SH_CACHE_VALID|SH_CACHE_UPDATED), addr0);
35 data1 = ctrl_inl(addr1); 35 data1 = __raw_readl(addr1);
36 ctrl_outl(data1&~(SH_CACHE_VALID|SH_CACHE_UPDATED), addr1); 36 __raw_writel(data1&~(SH_CACHE_VALID|SH_CACHE_UPDATED), addr1);
37 37
38 /* Next, check if there's shadow or not */ 38 /* Next, check if there's shadow or not */
39 data0 = ctrl_inl(addr0); 39 data0 = __raw_readl(addr0);
40 data0 ^= SH_CACHE_VALID; 40 data0 ^= SH_CACHE_VALID;
41 ctrl_outl(data0, addr0); 41 __raw_writel(data0, addr0);
42 data1 = ctrl_inl(addr1); 42 data1 = __raw_readl(addr1);
43 data2 = data1 ^ SH_CACHE_VALID; 43 data2 = data1 ^ SH_CACHE_VALID;
44 ctrl_outl(data2, addr1); 44 __raw_writel(data2, addr1);
45 data3 = ctrl_inl(addr0); 45 data3 = __raw_readl(addr0);
46 46
47 /* Lastly, invaliate them. */ 47 /* Lastly, invaliate them. */
48 ctrl_outl(data0&~SH_CACHE_VALID, addr0); 48 __raw_writel(data0&~SH_CACHE_VALID, addr0);
49 ctrl_outl(data2&~SH_CACHE_VALID, addr1); 49 __raw_writel(data2&~SH_CACHE_VALID, addr1);
50 50
51 back_to_cached(); 51 back_to_cached();
52 52
@@ -94,9 +94,9 @@ int __uses_jump_to_uncached detect_cpu_and_cache_system(void)
94 boot_cpu_data.dcache.way_incr = (1 << 13); 94 boot_cpu_data.dcache.way_incr = (1 << 13);
95 boot_cpu_data.dcache.entry_mask = 0x1ff0; 95 boot_cpu_data.dcache.entry_mask = 0x1ff0;
96 boot_cpu_data.dcache.sets = 512; 96 boot_cpu_data.dcache.sets = 512;
97 ctrl_outl(CCR_CACHE_32KB, CCR3_REG); 97 __raw_writel(CCR_CACHE_32KB, CCR3_REG);
98#else 98#else
99 ctrl_outl(CCR_CACHE_16KB, CCR3_REG); 99 __raw_writel(CCR_CACHE_16KB, CCR3_REG);
100#endif 100#endif
101#endif 101#endif
102 } 102 }
diff --git a/arch/sh/kernel/cpu/sh3/setup-sh3.c b/arch/sh/kernel/cpu/sh3/setup-sh3.c
index c98846857855..53be70b98116 100644
--- a/arch/sh/kernel/cpu/sh3/setup-sh3.c
+++ b/arch/sh/kernel/cpu/sh3/setup-sh3.c
@@ -58,7 +58,7 @@ static DECLARE_INTC_DESC_ACK(intc_desc_irq45, "sh3-irq45",
58void __init plat_irq_setup_pins(int mode) 58void __init plat_irq_setup_pins(int mode)
59{ 59{
60 if (mode == IRQ_MODE_IRQ) { 60 if (mode == IRQ_MODE_IRQ) {
61 ctrl_outw(ctrl_inw(INTC_ICR1) & ~INTC_ICR1_IRQLVL, INTC_ICR1); 61 __raw_writew(__raw_readw(INTC_ICR1) & ~INTC_ICR1_IRQLVL, INTC_ICR1);
62 register_intc_controller(&intc_desc_irq0123); 62 register_intc_controller(&intc_desc_irq0123);
63 return; 63 return;
64 } 64 }
diff --git a/arch/sh/kernel/cpu/sh4/clock-sh4-202.c b/arch/sh/kernel/cpu/sh4/clock-sh4-202.c
index 21421e34e7d5..6b80850294da 100644
--- a/arch/sh/kernel/cpu/sh4/clock-sh4-202.c
+++ b/arch/sh/kernel/cpu/sh4/clock-sh4-202.c
@@ -23,7 +23,7 @@ static int frqcr3_values[] = { 0, 1, 2, 3, 4, 5, 6 };
23 23
24static unsigned long emi_clk_recalc(struct clk *clk) 24static unsigned long emi_clk_recalc(struct clk *clk)
25{ 25{
26 int idx = ctrl_inl(CPG2_FRQCR3) & 0x0007; 26 int idx = __raw_readl(CPG2_FRQCR3) & 0x0007;
27 return clk->parent->rate / frqcr3_divisors[idx]; 27 return clk->parent->rate / frqcr3_divisors[idx];
28} 28}
29 29
@@ -52,7 +52,7 @@ static struct clk sh4202_emi_clk = {
52 52
53static unsigned long femi_clk_recalc(struct clk *clk) 53static unsigned long femi_clk_recalc(struct clk *clk)
54{ 54{
55 int idx = (ctrl_inl(CPG2_FRQCR3) >> 3) & 0x0007; 55 int idx = (__raw_readl(CPG2_FRQCR3) >> 3) & 0x0007;
56 return clk->parent->rate / frqcr3_divisors[idx]; 56 return clk->parent->rate / frqcr3_divisors[idx];
57} 57}
58 58
@@ -92,7 +92,7 @@ static void shoc_clk_init(struct clk *clk)
92 92
93static unsigned long shoc_clk_recalc(struct clk *clk) 93static unsigned long shoc_clk_recalc(struct clk *clk)
94{ 94{
95 int idx = (ctrl_inl(CPG2_FRQCR3) >> 6) & 0x0007; 95 int idx = (__raw_readl(CPG2_FRQCR3) >> 6) & 0x0007;
96 return clk->parent->rate / frqcr3_divisors[idx]; 96 return clk->parent->rate / frqcr3_divisors[idx];
97} 97}
98 98
@@ -122,10 +122,10 @@ static int shoc_clk_set_rate(struct clk *clk, unsigned long rate, int algo_id)
122 122
123 tmp = frqcr3_lookup(clk, rate); 123 tmp = frqcr3_lookup(clk, rate);
124 124
125 frqcr3 = ctrl_inl(CPG2_FRQCR3); 125 frqcr3 = __raw_readl(CPG2_FRQCR3);
126 frqcr3 &= ~(0x0007 << 6); 126 frqcr3 &= ~(0x0007 << 6);
127 frqcr3 |= tmp << 6; 127 frqcr3 |= tmp << 6;
128 ctrl_outl(frqcr3, CPG2_FRQCR3); 128 __raw_writel(frqcr3, CPG2_FRQCR3);
129 129
130 clk->rate = clk->parent->rate / frqcr3_divisors[tmp]; 130 clk->rate = clk->parent->rate / frqcr3_divisors[tmp];
131 131
diff --git a/arch/sh/kernel/cpu/sh4/clock-sh4.c b/arch/sh/kernel/cpu/sh4/clock-sh4.c
index 73294d9cd049..5add75c1f539 100644
--- a/arch/sh/kernel/cpu/sh4/clock-sh4.c
+++ b/arch/sh/kernel/cpu/sh4/clock-sh4.c
@@ -28,7 +28,7 @@ static int pfc_divisors[] = { 2, 3, 4, 6, 8, 2, 2, 2 };
28 28
29static void master_clk_init(struct clk *clk) 29static void master_clk_init(struct clk *clk)
30{ 30{
31 clk->rate *= pfc_divisors[ctrl_inw(FRQCR) & 0x0007]; 31 clk->rate *= pfc_divisors[__raw_readw(FRQCR) & 0x0007];
32} 32}
33 33
34static struct clk_ops sh4_master_clk_ops = { 34static struct clk_ops sh4_master_clk_ops = {
@@ -37,7 +37,7 @@ static struct clk_ops sh4_master_clk_ops = {
37 37
38static unsigned long module_clk_recalc(struct clk *clk) 38static unsigned long module_clk_recalc(struct clk *clk)
39{ 39{
40 int idx = (ctrl_inw(FRQCR) & 0x0007); 40 int idx = (__raw_readw(FRQCR) & 0x0007);
41 return clk->parent->rate / pfc_divisors[idx]; 41 return clk->parent->rate / pfc_divisors[idx];
42} 42}
43 43
@@ -47,7 +47,7 @@ static struct clk_ops sh4_module_clk_ops = {
47 47
48static unsigned long bus_clk_recalc(struct clk *clk) 48static unsigned long bus_clk_recalc(struct clk *clk)
49{ 49{
50 int idx = (ctrl_inw(FRQCR) >> 3) & 0x0007; 50 int idx = (__raw_readw(FRQCR) >> 3) & 0x0007;
51 return clk->parent->rate / bfc_divisors[idx]; 51 return clk->parent->rate / bfc_divisors[idx];
52} 52}
53 53
@@ -57,7 +57,7 @@ static struct clk_ops sh4_bus_clk_ops = {
57 57
58static unsigned long cpu_clk_recalc(struct clk *clk) 58static unsigned long cpu_clk_recalc(struct clk *clk)
59{ 59{
60 int idx = (ctrl_inw(FRQCR) >> 6) & 0x0007; 60 int idx = (__raw_readw(FRQCR) >> 6) & 0x0007;
61 return clk->parent->rate / ifc_divisors[idx]; 61 return clk->parent->rate / ifc_divisors[idx];
62} 62}
63 63
diff --git a/arch/sh/kernel/cpu/sh4/fpu.c b/arch/sh/kernel/cpu/sh4/fpu.c
index e97857aec8a0..447482d7f65e 100644
--- a/arch/sh/kernel/cpu/sh4/fpu.c
+++ b/arch/sh/kernel/cpu/sh4/fpu.c
@@ -85,14 +85,14 @@ void save_fpu(struct task_struct *tsk)
85 "fmov.s fr1, @-%0\n\t" 85 "fmov.s fr1, @-%0\n\t"
86 "fmov.s fr0, @-%0\n\t" 86 "fmov.s fr0, @-%0\n\t"
87 "lds %3, fpscr\n\t":"=r" (dummy) 87 "lds %3, fpscr\n\t":"=r" (dummy)
88 :"0"((char *)(&tsk->thread.fpu.hard.status)), 88 :"0"((char *)(&tsk->thread.xstate->hardfpu.status)),
89 "r"(FPSCR_RCHG), "r"(FPSCR_INIT) 89 "r"(FPSCR_RCHG), "r"(FPSCR_INIT)
90 :"memory"); 90 :"memory");
91 91
92 disable_fpu(); 92 disable_fpu();
93} 93}
94 94
95static void restore_fpu(struct task_struct *tsk) 95void restore_fpu(struct task_struct *tsk)
96{ 96{
97 unsigned long dummy; 97 unsigned long dummy;
98 98
@@ -135,62 +135,11 @@ static void restore_fpu(struct task_struct *tsk)
135 "lds.l @%0+, fpscr\n\t" 135 "lds.l @%0+, fpscr\n\t"
136 "lds.l @%0+, fpul\n\t" 136 "lds.l @%0+, fpul\n\t"
137 :"=r" (dummy) 137 :"=r" (dummy)
138 :"0"(&tsk->thread.fpu), "r"(FPSCR_RCHG) 138 :"0" (tsk->thread.xstate), "r" (FPSCR_RCHG)
139 :"memory"); 139 :"memory");
140 disable_fpu(); 140 disable_fpu();
141} 141}
142 142
143/*
144 * Load the FPU with signalling NANS. This bit pattern we're using
145 * has the property that no matter wether considered as single or as
146 * double precision represents signaling NANS.
147 */
148
149static void fpu_init(void)
150{
151 enable_fpu();
152 asm volatile ( "lds %0, fpul\n\t"
153 "lds %1, fpscr\n\t"
154 "fsts fpul, fr0\n\t"
155 "fsts fpul, fr1\n\t"
156 "fsts fpul, fr2\n\t"
157 "fsts fpul, fr3\n\t"
158 "fsts fpul, fr4\n\t"
159 "fsts fpul, fr5\n\t"
160 "fsts fpul, fr6\n\t"
161 "fsts fpul, fr7\n\t"
162 "fsts fpul, fr8\n\t"
163 "fsts fpul, fr9\n\t"
164 "fsts fpul, fr10\n\t"
165 "fsts fpul, fr11\n\t"
166 "fsts fpul, fr12\n\t"
167 "fsts fpul, fr13\n\t"
168 "fsts fpul, fr14\n\t"
169 "fsts fpul, fr15\n\t"
170 "frchg\n\t"
171 "fsts fpul, fr0\n\t"
172 "fsts fpul, fr1\n\t"
173 "fsts fpul, fr2\n\t"
174 "fsts fpul, fr3\n\t"
175 "fsts fpul, fr4\n\t"
176 "fsts fpul, fr5\n\t"
177 "fsts fpul, fr6\n\t"
178 "fsts fpul, fr7\n\t"
179 "fsts fpul, fr8\n\t"
180 "fsts fpul, fr9\n\t"
181 "fsts fpul, fr10\n\t"
182 "fsts fpul, fr11\n\t"
183 "fsts fpul, fr12\n\t"
184 "fsts fpul, fr13\n\t"
185 "fsts fpul, fr14\n\t"
186 "fsts fpul, fr15\n\t"
187 "frchg\n\t"
188 "lds %2, fpscr\n\t"
189 : /* no output */
190 :"r" (0), "r"(FPSCR_RCHG), "r"(FPSCR_INIT));
191 disable_fpu();
192}
193
194/** 143/**
195 * denormal_to_double - Given denormalized float number, 144 * denormal_to_double - Given denormalized float number,
196 * store double float 145 * store double float
@@ -282,9 +231,9 @@ static int ieee_fpe_handler(struct pt_regs *regs)
282 /* fcnvsd */ 231 /* fcnvsd */
283 struct task_struct *tsk = current; 232 struct task_struct *tsk = current;
284 233
285 if ((tsk->thread.fpu.hard.fpscr & FPSCR_CAUSE_ERROR)) 234 if ((tsk->thread.xstate->hardfpu.fpscr & FPSCR_CAUSE_ERROR))
286 /* FPU error */ 235 /* FPU error */
287 denormal_to_double(&tsk->thread.fpu.hard, 236 denormal_to_double(&tsk->thread.xstate->hardfpu,
288 (finsn >> 8) & 0xf); 237 (finsn >> 8) & 0xf);
289 else 238 else
290 return 0; 239 return 0;
@@ -300,9 +249,9 @@ static int ieee_fpe_handler(struct pt_regs *regs)
300 249
301 n = (finsn >> 8) & 0xf; 250 n = (finsn >> 8) & 0xf;
302 m = (finsn >> 4) & 0xf; 251 m = (finsn >> 4) & 0xf;
303 hx = tsk->thread.fpu.hard.fp_regs[n]; 252 hx = tsk->thread.xstate->hardfpu.fp_regs[n];
304 hy = tsk->thread.fpu.hard.fp_regs[m]; 253 hy = tsk->thread.xstate->hardfpu.fp_regs[m];
305 fpscr = tsk->thread.fpu.hard.fpscr; 254 fpscr = tsk->thread.xstate->hardfpu.fpscr;
306 prec = fpscr & FPSCR_DBL_PRECISION; 255 prec = fpscr & FPSCR_DBL_PRECISION;
307 256
308 if ((fpscr & FPSCR_CAUSE_ERROR) 257 if ((fpscr & FPSCR_CAUSE_ERROR)
@@ -312,18 +261,18 @@ static int ieee_fpe_handler(struct pt_regs *regs)
312 261
313 /* FPU error because of denormal (doubles) */ 262 /* FPU error because of denormal (doubles) */
314 llx = ((long long)hx << 32) 263 llx = ((long long)hx << 32)
315 | tsk->thread.fpu.hard.fp_regs[n + 1]; 264 | tsk->thread.xstate->hardfpu.fp_regs[n + 1];
316 lly = ((long long)hy << 32) 265 lly = ((long long)hy << 32)
317 | tsk->thread.fpu.hard.fp_regs[m + 1]; 266 | tsk->thread.xstate->hardfpu.fp_regs[m + 1];
318 llx = float64_mul(llx, lly); 267 llx = float64_mul(llx, lly);
319 tsk->thread.fpu.hard.fp_regs[n] = llx >> 32; 268 tsk->thread.xstate->hardfpu.fp_regs[n] = llx >> 32;
320 tsk->thread.fpu.hard.fp_regs[n + 1] = llx & 0xffffffff; 269 tsk->thread.xstate->hardfpu.fp_regs[n + 1] = llx & 0xffffffff;
321 } else if ((fpscr & FPSCR_CAUSE_ERROR) 270 } else if ((fpscr & FPSCR_CAUSE_ERROR)
322 && (!prec && ((hx & 0x7fffffff) < 0x00800000 271 && (!prec && ((hx & 0x7fffffff) < 0x00800000
323 || (hy & 0x7fffffff) < 0x00800000))) { 272 || (hy & 0x7fffffff) < 0x00800000))) {
324 /* FPU error because of denormal (floats) */ 273 /* FPU error because of denormal (floats) */
325 hx = float32_mul(hx, hy); 274 hx = float32_mul(hx, hy);
326 tsk->thread.fpu.hard.fp_regs[n] = hx; 275 tsk->thread.xstate->hardfpu.fp_regs[n] = hx;
327 } else 276 } else
328 return 0; 277 return 0;
329 278
@@ -338,9 +287,9 @@ static int ieee_fpe_handler(struct pt_regs *regs)
338 287
339 n = (finsn >> 8) & 0xf; 288 n = (finsn >> 8) & 0xf;
340 m = (finsn >> 4) & 0xf; 289 m = (finsn >> 4) & 0xf;
341 hx = tsk->thread.fpu.hard.fp_regs[n]; 290 hx = tsk->thread.xstate->hardfpu.fp_regs[n];
342 hy = tsk->thread.fpu.hard.fp_regs[m]; 291 hy = tsk->thread.xstate->hardfpu.fp_regs[m];
343 fpscr = tsk->thread.fpu.hard.fpscr; 292 fpscr = tsk->thread.xstate->hardfpu.fpscr;
344 prec = fpscr & FPSCR_DBL_PRECISION; 293 prec = fpscr & FPSCR_DBL_PRECISION;
345 294
346 if ((fpscr & FPSCR_CAUSE_ERROR) 295 if ((fpscr & FPSCR_CAUSE_ERROR)
@@ -350,15 +299,15 @@ static int ieee_fpe_handler(struct pt_regs *regs)
350 299
351 /* FPU error because of denormal (doubles) */ 300 /* FPU error because of denormal (doubles) */
352 llx = ((long long)hx << 32) 301 llx = ((long long)hx << 32)
353 | tsk->thread.fpu.hard.fp_regs[n + 1]; 302 | tsk->thread.xstate->hardfpu.fp_regs[n + 1];
354 lly = ((long long)hy << 32) 303 lly = ((long long)hy << 32)
355 | tsk->thread.fpu.hard.fp_regs[m + 1]; 304 | tsk->thread.xstate->hardfpu.fp_regs[m + 1];
356 if ((finsn & 0xf00f) == 0xf000) 305 if ((finsn & 0xf00f) == 0xf000)
357 llx = float64_add(llx, lly); 306 llx = float64_add(llx, lly);
358 else 307 else
359 llx = float64_sub(llx, lly); 308 llx = float64_sub(llx, lly);
360 tsk->thread.fpu.hard.fp_regs[n] = llx >> 32; 309 tsk->thread.xstate->hardfpu.fp_regs[n] = llx >> 32;
361 tsk->thread.fpu.hard.fp_regs[n + 1] = llx & 0xffffffff; 310 tsk->thread.xstate->hardfpu.fp_regs[n + 1] = llx & 0xffffffff;
362 } else if ((fpscr & FPSCR_CAUSE_ERROR) 311 } else if ((fpscr & FPSCR_CAUSE_ERROR)
363 && (!prec && ((hx & 0x7fffffff) < 0x00800000 312 && (!prec && ((hx & 0x7fffffff) < 0x00800000
364 || (hy & 0x7fffffff) < 0x00800000))) { 313 || (hy & 0x7fffffff) < 0x00800000))) {
@@ -367,7 +316,7 @@ static int ieee_fpe_handler(struct pt_regs *regs)
367 hx = float32_add(hx, hy); 316 hx = float32_add(hx, hy);
368 else 317 else
369 hx = float32_sub(hx, hy); 318 hx = float32_sub(hx, hy);
370 tsk->thread.fpu.hard.fp_regs[n] = hx; 319 tsk->thread.xstate->hardfpu.fp_regs[n] = hx;
371 } else 320 } else
372 return 0; 321 return 0;
373 322
@@ -382,9 +331,9 @@ static int ieee_fpe_handler(struct pt_regs *regs)
382 331
383 n = (finsn >> 8) & 0xf; 332 n = (finsn >> 8) & 0xf;
384 m = (finsn >> 4) & 0xf; 333 m = (finsn >> 4) & 0xf;
385 hx = tsk->thread.fpu.hard.fp_regs[n]; 334 hx = tsk->thread.xstate->hardfpu.fp_regs[n];
386 hy = tsk->thread.fpu.hard.fp_regs[m]; 335 hy = tsk->thread.xstate->hardfpu.fp_regs[m];
387 fpscr = tsk->thread.fpu.hard.fpscr; 336 fpscr = tsk->thread.xstate->hardfpu.fpscr;
388 prec = fpscr & FPSCR_DBL_PRECISION; 337 prec = fpscr & FPSCR_DBL_PRECISION;
389 338
390 if ((fpscr & FPSCR_CAUSE_ERROR) 339 if ((fpscr & FPSCR_CAUSE_ERROR)
@@ -394,20 +343,20 @@ static int ieee_fpe_handler(struct pt_regs *regs)
394 343
395 /* FPU error because of denormal (doubles) */ 344 /* FPU error because of denormal (doubles) */
396 llx = ((long long)hx << 32) 345 llx = ((long long)hx << 32)
397 | tsk->thread.fpu.hard.fp_regs[n + 1]; 346 | tsk->thread.xstate->hardfpu.fp_regs[n + 1];
398 lly = ((long long)hy << 32) 347 lly = ((long long)hy << 32)
399 | tsk->thread.fpu.hard.fp_regs[m + 1]; 348 | tsk->thread.xstate->hardfpu.fp_regs[m + 1];
400 349
401 llx = float64_div(llx, lly); 350 llx = float64_div(llx, lly);
402 351
403 tsk->thread.fpu.hard.fp_regs[n] = llx >> 32; 352 tsk->thread.xstate->hardfpu.fp_regs[n] = llx >> 32;
404 tsk->thread.fpu.hard.fp_regs[n + 1] = llx & 0xffffffff; 353 tsk->thread.xstate->hardfpu.fp_regs[n + 1] = llx & 0xffffffff;
405 } else if ((fpscr & FPSCR_CAUSE_ERROR) 354 } else if ((fpscr & FPSCR_CAUSE_ERROR)
406 && (!prec && ((hx & 0x7fffffff) < 0x00800000 355 && (!prec && ((hx & 0x7fffffff) < 0x00800000
407 || (hy & 0x7fffffff) < 0x00800000))) { 356 || (hy & 0x7fffffff) < 0x00800000))) {
408 /* FPU error because of denormal (floats) */ 357 /* FPU error because of denormal (floats) */
409 hx = float32_div(hx, hy); 358 hx = float32_div(hx, hy);
410 tsk->thread.fpu.hard.fp_regs[n] = hx; 359 tsk->thread.xstate->hardfpu.fp_regs[n] = hx;
411 } else 360 } else
412 return 0; 361 return 0;
413 362
@@ -420,17 +369,17 @@ static int ieee_fpe_handler(struct pt_regs *regs)
420 unsigned int hx; 369 unsigned int hx;
421 370
422 m = (finsn >> 8) & 0x7; 371 m = (finsn >> 8) & 0x7;
423 hx = tsk->thread.fpu.hard.fp_regs[m]; 372 hx = tsk->thread.xstate->hardfpu.fp_regs[m];
424 373
425 if ((tsk->thread.fpu.hard.fpscr & FPSCR_CAUSE_ERROR) 374 if ((tsk->thread.xstate->hardfpu.fpscr & FPSCR_CAUSE_ERROR)
426 && ((hx & 0x7fffffff) < 0x00100000)) { 375 && ((hx & 0x7fffffff) < 0x00100000)) {
427 /* subnormal double to float conversion */ 376 /* subnormal double to float conversion */
428 long long llx; 377 long long llx;
429 378
430 llx = ((long long)tsk->thread.fpu.hard.fp_regs[m] << 32) 379 llx = ((long long)tsk->thread.xstate->hardfpu.fp_regs[m] << 32)
431 | tsk->thread.fpu.hard.fp_regs[m + 1]; 380 | tsk->thread.xstate->hardfpu.fp_regs[m + 1];
432 381
433 tsk->thread.fpu.hard.fpul = float64_to_float32(llx); 382 tsk->thread.xstate->hardfpu.fpul = float64_to_float32(llx);
434 } else 383 } else
435 return 0; 384 return 0;
436 385
@@ -449,7 +398,7 @@ void float_raise(unsigned int flags)
449int float_rounding_mode(void) 398int float_rounding_mode(void)
450{ 399{
451 struct task_struct *tsk = current; 400 struct task_struct *tsk = current;
452 int roundingMode = FPSCR_ROUNDING_MODE(tsk->thread.fpu.hard.fpscr); 401 int roundingMode = FPSCR_ROUNDING_MODE(tsk->thread.xstate->hardfpu.fpscr);
453 return roundingMode; 402 return roundingMode;
454} 403}
455 404
@@ -461,16 +410,16 @@ BUILD_TRAP_HANDLER(fpu_error)
461 __unlazy_fpu(tsk, regs); 410 __unlazy_fpu(tsk, regs);
462 fpu_exception_flags = 0; 411 fpu_exception_flags = 0;
463 if (ieee_fpe_handler(regs)) { 412 if (ieee_fpe_handler(regs)) {
464 tsk->thread.fpu.hard.fpscr &= 413 tsk->thread.xstate->hardfpu.fpscr &=
465 ~(FPSCR_CAUSE_MASK | FPSCR_FLAG_MASK); 414 ~(FPSCR_CAUSE_MASK | FPSCR_FLAG_MASK);
466 tsk->thread.fpu.hard.fpscr |= fpu_exception_flags; 415 tsk->thread.xstate->hardfpu.fpscr |= fpu_exception_flags;
467 /* Set the FPSCR flag as well as cause bits - simply 416 /* Set the FPSCR flag as well as cause bits - simply
468 * replicate the cause */ 417 * replicate the cause */
469 tsk->thread.fpu.hard.fpscr |= (fpu_exception_flags >> 10); 418 tsk->thread.xstate->hardfpu.fpscr |= (fpu_exception_flags >> 10);
470 grab_fpu(regs); 419 grab_fpu(regs);
471 restore_fpu(tsk); 420 restore_fpu(tsk);
472 task_thread_info(tsk)->status |= TS_USEDFPU; 421 task_thread_info(tsk)->status |= TS_USEDFPU;
473 if ((((tsk->thread.fpu.hard.fpscr & FPSCR_ENABLE_MASK) >> 7) & 422 if ((((tsk->thread.xstate->hardfpu.fpscr & FPSCR_ENABLE_MASK) >> 7) &
474 (fpu_exception_flags >> 2)) == 0) { 423 (fpu_exception_flags >> 2)) == 0) {
475 return; 424 return;
476 } 425 }
@@ -478,33 +427,3 @@ BUILD_TRAP_HANDLER(fpu_error)
478 427
479 force_sig(SIGFPE, tsk); 428 force_sig(SIGFPE, tsk);
480} 429}
481
482void fpu_state_restore(struct pt_regs *regs)
483{
484 struct task_struct *tsk = current;
485
486 grab_fpu(regs);
487 if (unlikely(!user_mode(regs))) {
488 printk(KERN_ERR "BUG: FPU is used in kernel mode.\n");
489 BUG();
490 return;
491 }
492
493 if (likely(used_math())) {
494 /* Using the FPU again. */
495 restore_fpu(tsk);
496 } else {
497 /* First time FPU user. */
498 fpu_init();
499 set_used_math();
500 }
501 task_thread_info(tsk)->status |= TS_USEDFPU;
502 tsk->fpu_counter++;
503}
504
505BUILD_TRAP_HANDLER(fpu_state_restore)
506{
507 TRAP_HANDLER_DECL;
508
509 fpu_state_restore(regs);
510}
diff --git a/arch/sh/kernel/cpu/sh4/probe.c b/arch/sh/kernel/cpu/sh4/probe.c
index d36f0c45f55f..822977a06d84 100644
--- a/arch/sh/kernel/cpu/sh4/probe.c
+++ b/arch/sh/kernel/cpu/sh4/probe.c
@@ -28,9 +28,9 @@ int __init detect_cpu_and_cache_system(void)
28 [9] = (1 << 16) 28 [9] = (1 << 16)
29 }; 29 };
30 30
31 pvr = (ctrl_inl(CCN_PVR) >> 8) & 0xffffff; 31 pvr = (__raw_readl(CCN_PVR) >> 8) & 0xffffff;
32 prr = (ctrl_inl(CCN_PRR) >> 4) & 0xff; 32 prr = (__raw_readl(CCN_PRR) >> 4) & 0xff;
33 cvr = (ctrl_inl(CCN_CVR)); 33 cvr = (__raw_readl(CCN_CVR));
34 34
35 /* 35 /*
36 * Setup some sane SH-4 defaults for the icache 36 * Setup some sane SH-4 defaults for the icache
@@ -71,11 +71,11 @@ int __init detect_cpu_and_cache_system(void)
71 boot_cpu_data.dcache.ways = 4; 71 boot_cpu_data.dcache.ways = 4;
72 } else { 72 } else {
73 /* And some SH-4 defaults.. */ 73 /* And some SH-4 defaults.. */
74 boot_cpu_data.flags |= CPU_HAS_PTEA; 74 boot_cpu_data.flags |= CPU_HAS_PTEA | CPU_HAS_FPU;
75 boot_cpu_data.family = CPU_FAMILY_SH4; 75 boot_cpu_data.family = CPU_FAMILY_SH4;
76 } 76 }
77 77
78 /* FPU detection works for everyone */ 78 /* FPU detection works for almost everyone */
79 if ((cvr & 0x20000000)) 79 if ((cvr & 0x20000000))
80 boot_cpu_data.flags |= CPU_HAS_FPU; 80 boot_cpu_data.flags |= CPU_HAS_FPU;
81 81
@@ -124,6 +124,7 @@ int __init detect_cpu_and_cache_system(void)
124 boot_cpu_data.type = CPU_SH7785; 124 boot_cpu_data.type = CPU_SH7785;
125 break; 125 break;
126 case 0x4004: 126 case 0x4004:
127 case 0x4005:
127 boot_cpu_data.type = CPU_SH7786; 128 boot_cpu_data.type = CPU_SH7786;
128 boot_cpu_data.flags |= CPU_HAS_PTEAEX | CPU_HAS_L2_CACHE; 129 boot_cpu_data.flags |= CPU_HAS_PTEAEX | CPU_HAS_L2_CACHE;
129 break; 130 break;
@@ -160,6 +161,7 @@ int __init detect_cpu_and_cache_system(void)
160 break; 161 break;
161 case 0x700: 162 case 0x700:
162 boot_cpu_data.type = CPU_SH4_501; 163 boot_cpu_data.type = CPU_SH4_501;
164 boot_cpu_data.flags &= ~CPU_HAS_FPU;
163 boot_cpu_data.icache.ways = 2; 165 boot_cpu_data.icache.ways = 2;
164 boot_cpu_data.dcache.ways = 2; 166 boot_cpu_data.dcache.ways = 2;
165 break; 167 break;
@@ -227,7 +229,7 @@ int __init detect_cpu_and_cache_system(void)
227 * Size calculation is much more sensible 229 * Size calculation is much more sensible
228 * than it is for the L1. 230 * than it is for the L1.
229 * 231 *
230 * Sizes are 128KB, 258KB, 512KB, and 1MB. 232 * Sizes are 128KB, 256KB, 512KB, and 1MB.
231 */ 233 */
232 size = (cvr & 0xf) << 17; 234 size = (cvr & 0xf) << 17;
233 235
diff --git a/arch/sh/kernel/cpu/sh4/setup-sh4-202.c b/arch/sh/kernel/cpu/sh4/setup-sh4-202.c
index 4b733715cdb5..b9b7e10ad68f 100644
--- a/arch/sh/kernel/cpu/sh4/setup-sh4-202.c
+++ b/arch/sh/kernel/cpu/sh4/setup-sh4-202.c
@@ -198,7 +198,7 @@ void __init plat_irq_setup_pins(int mode)
198{ 198{
199 switch (mode) { 199 switch (mode) {
200 case IRQ_MODE_IRQ: /* individual interrupt mode for IRL3-0 */ 200 case IRQ_MODE_IRQ: /* individual interrupt mode for IRL3-0 */
201 ctrl_outw(ctrl_inw(INTC_ICR) | INTC_ICR_IRLM, INTC_ICR); 201 __raw_writew(__raw_readw(INTC_ICR) | INTC_ICR_IRLM, INTC_ICR);
202 register_intc_controller(&intc_desc_irlm); 202 register_intc_controller(&intc_desc_irlm);
203 break; 203 break;
204 default: 204 default:
diff --git a/arch/sh/kernel/cpu/sh4/setup-sh7750.c b/arch/sh/kernel/cpu/sh4/setup-sh7750.c
index b2a9df1af64c..ffd79e57254f 100644
--- a/arch/sh/kernel/cpu/sh4/setup-sh7750.c
+++ b/arch/sh/kernel/cpu/sh4/setup-sh7750.c
@@ -442,7 +442,7 @@ void __init plat_irq_setup_pins(int mode)
442 442
443 switch (mode) { 443 switch (mode) {
444 case IRQ_MODE_IRQ: /* individual interrupt mode for IRL3-0 */ 444 case IRQ_MODE_IRQ: /* individual interrupt mode for IRL3-0 */
445 ctrl_outw(ctrl_inw(INTC_ICR) | INTC_ICR_IRLM, INTC_ICR); 445 __raw_writew(__raw_readw(INTC_ICR) | INTC_ICR_IRLM, INTC_ICR);
446 register_intc_controller(&intc_desc_irlm); 446 register_intc_controller(&intc_desc_irlm);
447 break; 447 break;
448 default: 448 default:
diff --git a/arch/sh/kernel/cpu/sh4/setup-sh7760.c b/arch/sh/kernel/cpu/sh4/setup-sh7760.c
index 5b74cc0b43da..a16eb3656f4b 100644
--- a/arch/sh/kernel/cpu/sh4/setup-sh7760.c
+++ b/arch/sh/kernel/cpu/sh4/setup-sh7760.c
@@ -319,7 +319,7 @@ void __init plat_irq_setup_pins(int mode)
319{ 319{
320 switch (mode) { 320 switch (mode) {
321 case IRQ_MODE_IRQ: 321 case IRQ_MODE_IRQ:
322 ctrl_outw(ctrl_inw(INTC_ICR) | INTC_ICR_IRLM, INTC_ICR); 322 __raw_writew(__raw_readw(INTC_ICR) | INTC_ICR_IRLM, INTC_ICR);
323 register_intc_controller(&intc_desc_irq); 323 register_intc_controller(&intc_desc_irq);
324 break; 324 break;
325 default: 325 default:
diff --git a/arch/sh/kernel/cpu/sh4/sq.c b/arch/sh/kernel/cpu/sh4/sq.c
index 8a8a993f55ea..fc065f9da6e5 100644
--- a/arch/sh/kernel/cpu/sh4/sq.c
+++ b/arch/sh/kernel/cpu/sh4/sq.c
@@ -43,9 +43,9 @@ static unsigned long *sq_bitmap;
43 43
44#define store_queue_barrier() \ 44#define store_queue_barrier() \
45do { \ 45do { \
46 (void)ctrl_inl(P4SEG_STORE_QUE); \ 46 (void)__raw_readl(P4SEG_STORE_QUE); \
47 ctrl_outl(0, P4SEG_STORE_QUE + 0); \ 47 __raw_writel(0, P4SEG_STORE_QUE + 0); \
48 ctrl_outl(0, P4SEG_STORE_QUE + 8); \ 48 __raw_writel(0, P4SEG_STORE_QUE + 8); \
49} while (0); 49} while (0);
50 50
51/** 51/**
@@ -100,7 +100,7 @@ static inline void sq_mapping_list_del(struct sq_mapping *map)
100 spin_unlock_irq(&sq_mapping_lock); 100 spin_unlock_irq(&sq_mapping_lock);
101} 101}
102 102
103static int __sq_remap(struct sq_mapping *map, unsigned long flags) 103static int __sq_remap(struct sq_mapping *map, pgprot_t prot)
104{ 104{
105#if defined(CONFIG_MMU) 105#if defined(CONFIG_MMU)
106 struct vm_struct *vma; 106 struct vm_struct *vma;
@@ -113,7 +113,7 @@ static int __sq_remap(struct sq_mapping *map, unsigned long flags)
113 113
114 if (ioremap_page_range((unsigned long)vma->addr, 114 if (ioremap_page_range((unsigned long)vma->addr,
115 (unsigned long)vma->addr + map->size, 115 (unsigned long)vma->addr + map->size,
116 vma->phys_addr, __pgprot(flags))) { 116 vma->phys_addr, prot)) {
117 vunmap(vma->addr); 117 vunmap(vma->addr);
118 return -EAGAIN; 118 return -EAGAIN;
119 } 119 }
@@ -123,8 +123,8 @@ static int __sq_remap(struct sq_mapping *map, unsigned long flags)
123 * straightforward, as we can just load up each queue's QACR with 123 * straightforward, as we can just load up each queue's QACR with
124 * the physical address appropriately masked. 124 * the physical address appropriately masked.
125 */ 125 */
126 ctrl_outl(((map->addr >> 26) << 2) & 0x1c, SQ_QACR0); 126 __raw_writel(((map->addr >> 26) << 2) & 0x1c, SQ_QACR0);
127 ctrl_outl(((map->addr >> 26) << 2) & 0x1c, SQ_QACR1); 127 __raw_writel(((map->addr >> 26) << 2) & 0x1c, SQ_QACR1);
128#endif 128#endif
129 129
130 return 0; 130 return 0;
@@ -135,14 +135,14 @@ static int __sq_remap(struct sq_mapping *map, unsigned long flags)
135 * @phys: Physical address of mapping. 135 * @phys: Physical address of mapping.
136 * @size: Length of mapping. 136 * @size: Length of mapping.
137 * @name: User invoking mapping. 137 * @name: User invoking mapping.
138 * @flags: Protection flags. 138 * @prot: Protection bits.
139 * 139 *
140 * Remaps the physical address @phys through the next available store queue 140 * Remaps the physical address @phys through the next available store queue
141 * address of @size length. @name is logged at boot time as well as through 141 * address of @size length. @name is logged at boot time as well as through
142 * the sysfs interface. 142 * the sysfs interface.
143 */ 143 */
144unsigned long sq_remap(unsigned long phys, unsigned int size, 144unsigned long sq_remap(unsigned long phys, unsigned int size,
145 const char *name, unsigned long flags) 145 const char *name, pgprot_t prot)
146{ 146{
147 struct sq_mapping *map; 147 struct sq_mapping *map;
148 unsigned long end; 148 unsigned long end;
@@ -177,7 +177,7 @@ unsigned long sq_remap(unsigned long phys, unsigned int size,
177 177
178 map->sq_addr = P4SEG_STORE_QUE + (page << PAGE_SHIFT); 178 map->sq_addr = P4SEG_STORE_QUE + (page << PAGE_SHIFT);
179 179
180 ret = __sq_remap(map, pgprot_val(PAGE_KERNEL_NOCACHE) | flags); 180 ret = __sq_remap(map, prot);
181 if (unlikely(ret != 0)) 181 if (unlikely(ret != 0))
182 goto out; 182 goto out;
183 183
@@ -309,8 +309,7 @@ static ssize_t mapping_store(const char *buf, size_t count)
309 return -EIO; 309 return -EIO;
310 310
311 if (likely(len)) { 311 if (likely(len)) {
312 int ret = sq_remap(base, len, "Userspace", 312 int ret = sq_remap(base, len, "Userspace", PAGE_SHARED);
313 pgprot_val(PAGE_SHARED));
314 if (ret < 0) 313 if (ret < 0)
315 return ret; 314 return ret;
316 } else 315 } else
diff --git a/arch/sh/kernel/cpu/sh4a/Makefile b/arch/sh/kernel/cpu/sh4a/Makefile
index 33bab477d2e2..b144e8af89dc 100644
--- a/arch/sh/kernel/cpu/sh4a/Makefile
+++ b/arch/sh/kernel/cpu/sh4a/Makefile
@@ -41,7 +41,8 @@ pinmux-$(CONFIG_CPU_SUBTYPE_SH7757) := pinmux-sh7757.o
41pinmux-$(CONFIG_CPU_SUBTYPE_SH7785) := pinmux-sh7785.o 41pinmux-$(CONFIG_CPU_SUBTYPE_SH7785) := pinmux-sh7785.o
42pinmux-$(CONFIG_CPU_SUBTYPE_SH7786) := pinmux-sh7786.o 42pinmux-$(CONFIG_CPU_SUBTYPE_SH7786) := pinmux-sh7786.o
43 43
44obj-y += $(clock-y) 44obj-y += $(clock-y)
45obj-$(CONFIG_SMP) += $(smp-y) 45obj-$(CONFIG_SMP) += $(smp-y)
46obj-$(CONFIG_GENERIC_GPIO) += $(pinmux-y) 46obj-$(CONFIG_GENERIC_GPIO) += $(pinmux-y)
47obj-$(CONFIG_PERF_EVENTS) += perf_event.o 47obj-$(CONFIG_PERF_EVENTS) += perf_event.o
48obj-$(CONFIG_HAVE_HW_BREAKPOINT) += ubc.o
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7343.c b/arch/sh/kernel/cpu/sh4a/clock-sh7343.c
index 0ee3ee861252..2c16df37eda6 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7343.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7343.c
@@ -107,13 +107,17 @@ struct clk *main_clks[] = {
107static int multipliers[] = { 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; 107static int multipliers[] = { 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1 };
108static int divisors[] = { 1, 3, 2, 5, 3, 4, 5, 6, 8, 10, 12, 16, 20 }; 108static int divisors[] = { 1, 3, 2, 5, 3, 4, 5, 6, 8, 10, 12, 16, 20 };
109 109
110static struct clk_div_mult_table div4_table = { 110static struct clk_div_mult_table div4_div_mult_table = {
111 .divisors = divisors, 111 .divisors = divisors,
112 .nr_divisors = ARRAY_SIZE(divisors), 112 .nr_divisors = ARRAY_SIZE(divisors),
113 .multipliers = multipliers, 113 .multipliers = multipliers,
114 .nr_multipliers = ARRAY_SIZE(multipliers), 114 .nr_multipliers = ARRAY_SIZE(multipliers),
115}; 115};
116 116
117static struct clk_div4_table div4_table = {
118 .div_mult_table = &div4_div_mult_table,
119};
120
117enum { DIV4_I, DIV4_U, DIV4_SH, DIV4_B, DIV4_B3, DIV4_P, 121enum { DIV4_I, DIV4_U, DIV4_SH, DIV4_B, DIV4_B3, DIV4_P,
118 DIV4_SIUA, DIV4_SIUB, DIV4_NR }; 122 DIV4_SIUA, DIV4_SIUB, DIV4_NR };
119 123
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7366.c b/arch/sh/kernel/cpu/sh4a/clock-sh7366.c
index a95ebaba095c..91588d280cd8 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7366.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7366.c
@@ -110,13 +110,17 @@ struct clk *main_clks[] = {
110static int multipliers[] = { 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; 110static int multipliers[] = { 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1 };
111static int divisors[] = { 1, 3, 2, 5, 3, 4, 5, 6, 8, 10, 12, 16, 20 }; 111static int divisors[] = { 1, 3, 2, 5, 3, 4, 5, 6, 8, 10, 12, 16, 20 };
112 112
113static struct clk_div_mult_table div4_table = { 113static struct clk_div_mult_table div4_div_mult_table = {
114 .divisors = divisors, 114 .divisors = divisors,
115 .nr_divisors = ARRAY_SIZE(divisors), 115 .nr_divisors = ARRAY_SIZE(divisors),
116 .multipliers = multipliers, 116 .multipliers = multipliers,
117 .nr_multipliers = ARRAY_SIZE(multipliers), 117 .nr_multipliers = ARRAY_SIZE(multipliers),
118}; 118};
119 119
120static struct clk_div4_table div4_table = {
121 .div_mult_table = &div4_div_mult_table,
122};
123
120enum { DIV4_I, DIV4_U, DIV4_SH, DIV4_B, DIV4_B3, DIV4_P, 124enum { DIV4_I, DIV4_U, DIV4_SH, DIV4_B, DIV4_B3, DIV4_P,
121 DIV4_SIUA, DIV4_SIUB, DIV4_NR }; 125 DIV4_SIUA, DIV4_SIUB, DIV4_NR };
122 126
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7722.c b/arch/sh/kernel/cpu/sh4a/clock-sh7722.c
index ea38b554dc05..15db6d521c5c 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7722.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7722.c
@@ -110,19 +110,22 @@ struct clk *main_clks[] = {
110static int multipliers[] = { 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; 110static int multipliers[] = { 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1 };
111static int divisors[] = { 1, 3, 2, 5, 3, 4, 5, 6, 8, 10, 12, 16, 20 }; 111static int divisors[] = { 1, 3, 2, 5, 3, 4, 5, 6, 8, 10, 12, 16, 20 };
112 112
113static struct clk_div_mult_table div4_table = { 113static struct clk_div_mult_table div4_div_mult_table = {
114 .divisors = divisors, 114 .divisors = divisors,
115 .nr_divisors = ARRAY_SIZE(divisors), 115 .nr_divisors = ARRAY_SIZE(divisors),
116 .multipliers = multipliers, 116 .multipliers = multipliers,
117 .nr_multipliers = ARRAY_SIZE(multipliers), 117 .nr_multipliers = ARRAY_SIZE(multipliers),
118}; 118};
119 119
120enum { DIV4_I, DIV4_U, DIV4_SH, DIV4_B, DIV4_B3, DIV4_P, 120static struct clk_div4_table div4_table = {
121 DIV4_SIUA, DIV4_SIUB, DIV4_IRDA, DIV4_NR }; 121 .div_mult_table = &div4_div_mult_table,
122};
122 123
123#define DIV4(_str, _reg, _bit, _mask, _flags) \ 124#define DIV4(_str, _reg, _bit, _mask, _flags) \
124 SH_CLK_DIV4(_str, &pll_clk, _reg, _bit, _mask, _flags) 125 SH_CLK_DIV4(_str, &pll_clk, _reg, _bit, _mask, _flags)
125 126
127enum { DIV4_I, DIV4_U, DIV4_SH, DIV4_B, DIV4_B3, DIV4_P, DIV4_NR };
128
126struct clk div4_clks[DIV4_NR] = { 129struct clk div4_clks[DIV4_NR] = {
127 [DIV4_I] = DIV4("cpu_clk", FRQCR, 20, 0x1fef, CLK_ENABLE_ON_INIT), 130 [DIV4_I] = DIV4("cpu_clk", FRQCR, 20, 0x1fef, CLK_ENABLE_ON_INIT),
128 [DIV4_U] = DIV4("umem_clk", FRQCR, 16, 0x1fff, CLK_ENABLE_ON_INIT), 131 [DIV4_U] = DIV4("umem_clk", FRQCR, 16, 0x1fff, CLK_ENABLE_ON_INIT),
@@ -130,9 +133,19 @@ struct clk div4_clks[DIV4_NR] = {
130 [DIV4_B] = DIV4("bus_clk", FRQCR, 8, 0x1fff, CLK_ENABLE_ON_INIT), 133 [DIV4_B] = DIV4("bus_clk", FRQCR, 8, 0x1fff, CLK_ENABLE_ON_INIT),
131 [DIV4_B3] = DIV4("b3_clk", FRQCR, 4, 0x1fff, CLK_ENABLE_ON_INIT), 134 [DIV4_B3] = DIV4("b3_clk", FRQCR, 4, 0x1fff, CLK_ENABLE_ON_INIT),
132 [DIV4_P] = DIV4("peripheral_clk", FRQCR, 0, 0x1fff, 0), 135 [DIV4_P] = DIV4("peripheral_clk", FRQCR, 0, 0x1fff, 0),
136};
137
138enum { DIV4_IRDA, DIV4_ENABLE_NR };
139
140struct clk div4_enable_clks[DIV4_ENABLE_NR] = {
141 [DIV4_IRDA] = DIV4("irda_clk", IRDACLKCR, 0, 0x1fff, 0),
142};
143
144enum { DIV4_SIUA, DIV4_SIUB, DIV4_REPARENT_NR };
145
146struct clk div4_reparent_clks[DIV4_REPARENT_NR] = {
133 [DIV4_SIUA] = DIV4("siua_clk", SCLKACR, 0, 0x1fff, 0), 147 [DIV4_SIUA] = DIV4("siua_clk", SCLKACR, 0, 0x1fff, 0),
134 [DIV4_SIUB] = DIV4("siub_clk", SCLKBCR, 0, 0x1fff, 0), 148 [DIV4_SIUB] = DIV4("siub_clk", SCLKBCR, 0, 0x1fff, 0),
135 [DIV4_IRDA] = DIV4("irda_clk", IRDACLKCR, 0, 0x1fff, 0),
136}; 149};
137 150
138struct clk div6_clks[] = { 151struct clk div6_clks[] = {
@@ -189,6 +202,14 @@ int __init arch_clk_init(void)
189 ret = sh_clk_div4_register(div4_clks, DIV4_NR, &div4_table); 202 ret = sh_clk_div4_register(div4_clks, DIV4_NR, &div4_table);
190 203
191 if (!ret) 204 if (!ret)
205 ret = sh_clk_div4_enable_register(div4_enable_clks,
206 DIV4_ENABLE_NR, &div4_table);
207
208 if (!ret)
209 ret = sh_clk_div4_reparent_register(div4_reparent_clks,
210 DIV4_REPARENT_NR, &div4_table);
211
212 if (!ret)
192 ret = sh_clk_div6_register(div6_clks, ARRAY_SIZE(div6_clks)); 213 ret = sh_clk_div6_register(div6_clks, ARRAY_SIZE(div6_clks));
193 214
194 if (!ret) 215 if (!ret)
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7723.c b/arch/sh/kernel/cpu/sh4a/clock-sh7723.c
index 20a31c2255a8..50babe01fe44 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7723.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7723.c
@@ -110,15 +110,18 @@ struct clk *main_clks[] = {
110static int multipliers[] = { 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; 110static int multipliers[] = { 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1 };
111static int divisors[] = { 1, 3, 2, 5, 3, 4, 5, 6, 8, 10, 12, 16, 20 }; 111static int divisors[] = { 1, 3, 2, 5, 3, 4, 5, 6, 8, 10, 12, 16, 20 };
112 112
113static struct clk_div_mult_table div4_table = { 113static struct clk_div_mult_table div4_div_mult_table = {
114 .divisors = divisors, 114 .divisors = divisors,
115 .nr_divisors = ARRAY_SIZE(divisors), 115 .nr_divisors = ARRAY_SIZE(divisors),
116 .multipliers = multipliers, 116 .multipliers = multipliers,
117 .nr_multipliers = ARRAY_SIZE(multipliers), 117 .nr_multipliers = ARRAY_SIZE(multipliers),
118}; 118};
119 119
120enum { DIV4_I, DIV4_U, DIV4_SH, DIV4_B, DIV4_B3, DIV4_P, 120static struct clk_div4_table div4_table = {
121 DIV4_SIUA, DIV4_SIUB, DIV4_IRDA, DIV4_NR }; 121 .div_mult_table = &div4_div_mult_table,
122};
123
124enum { DIV4_I, DIV4_U, DIV4_SH, DIV4_B, DIV4_B3, DIV4_P, DIV4_NR };
122 125
123#define DIV4(_str, _reg, _bit, _mask, _flags) \ 126#define DIV4(_str, _reg, _bit, _mask, _flags) \
124 SH_CLK_DIV4(_str, &pll_clk, _reg, _bit, _mask, _flags) 127 SH_CLK_DIV4(_str, &pll_clk, _reg, _bit, _mask, _flags)
@@ -130,11 +133,20 @@ struct clk div4_clks[DIV4_NR] = {
130 [DIV4_B] = DIV4("bus_clk", FRQCR, 8, 0x0dbf, CLK_ENABLE_ON_INIT), 133 [DIV4_B] = DIV4("bus_clk", FRQCR, 8, 0x0dbf, CLK_ENABLE_ON_INIT),
131 [DIV4_B3] = DIV4("b3_clk", FRQCR, 4, 0x0db4, CLK_ENABLE_ON_INIT), 134 [DIV4_B3] = DIV4("b3_clk", FRQCR, 4, 0x0db4, CLK_ENABLE_ON_INIT),
132 [DIV4_P] = DIV4("peripheral_clk", FRQCR, 0, 0x0dbf, 0), 135 [DIV4_P] = DIV4("peripheral_clk", FRQCR, 0, 0x0dbf, 0),
133 [DIV4_SIUA] = DIV4("siua_clk", SCLKACR, 0, 0x0dbf, 0), 136};
134 [DIV4_SIUB] = DIV4("siub_clk", SCLKBCR, 0, 0x0dbf, 0), 137
138enum { DIV4_IRDA, DIV4_ENABLE_NR };
139
140struct clk div4_enable_clks[DIV4_ENABLE_NR] = {
135 [DIV4_IRDA] = DIV4("irda_clk", IRDACLKCR, 0, 0x0dbf, 0), 141 [DIV4_IRDA] = DIV4("irda_clk", IRDACLKCR, 0, 0x0dbf, 0),
136}; 142};
137 143
144enum { DIV4_SIUA, DIV4_SIUB, DIV4_REPARENT_NR };
145
146struct clk div4_reparent_clks[DIV4_REPARENT_NR] = {
147 [DIV4_SIUA] = DIV4("siua_clk", SCLKACR, 0, 0x0dbf, 0),
148 [DIV4_SIUB] = DIV4("siub_clk", SCLKBCR, 0, 0x0dbf, 0),
149};
138struct clk div6_clks[] = { 150struct clk div6_clks[] = {
139 SH_CLK_DIV6("video_clk", &pll_clk, VCLKCR, 0), 151 SH_CLK_DIV6("video_clk", &pll_clk, VCLKCR, 0),
140}; 152};
@@ -216,6 +228,14 @@ int __init arch_clk_init(void)
216 ret = sh_clk_div4_register(div4_clks, DIV4_NR, &div4_table); 228 ret = sh_clk_div4_register(div4_clks, DIV4_NR, &div4_table);
217 229
218 if (!ret) 230 if (!ret)
231 ret = sh_clk_div4_enable_register(div4_enable_clks,
232 DIV4_ENABLE_NR, &div4_table);
233
234 if (!ret)
235 ret = sh_clk_div4_reparent_register(div4_reparent_clks,
236 DIV4_REPARENT_NR, &div4_table);
237
238 if (!ret)
219 ret = sh_clk_div6_register(div6_clks, ARRAY_SIZE(div6_clks)); 239 ret = sh_clk_div6_register(div6_clks, ARRAY_SIZE(div6_clks));
220 240
221 if (!ret) 241 if (!ret)
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7724.c b/arch/sh/kernel/cpu/sh4a/clock-sh7724.c
index 9db743802f06..6707061fbf54 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7724.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7724.c
@@ -127,13 +127,28 @@ struct clk *main_clks[] = {
127 &div3_clk, 127 &div3_clk,
128}; 128};
129 129
130static void div4_kick(struct clk *clk)
131{
132 unsigned long value;
133
134 /* set KICK bit in FRQCRA to update hardware setting */
135 value = __raw_readl(FRQCRA);
136 value |= (1 << 31);
137 __raw_writel(value, FRQCRA);
138}
139
130static int divisors[] = { 2, 3, 4, 6, 8, 12, 16, 0, 24, 32, 36, 48, 0, 72 }; 140static int divisors[] = { 2, 3, 4, 6, 8, 12, 16, 0, 24, 32, 36, 48, 0, 72 };
131 141
132static struct clk_div_mult_table div4_table = { 142static struct clk_div_mult_table div4_div_mult_table = {
133 .divisors = divisors, 143 .divisors = divisors,
134 .nr_divisors = ARRAY_SIZE(divisors), 144 .nr_divisors = ARRAY_SIZE(divisors),
135}; 145};
136 146
147static struct clk_div4_table div4_table = {
148 .div_mult_table = &div4_div_mult_table,
149 .kick = div4_kick,
150};
151
137enum { DIV4_I, DIV4_SH, DIV4_B, DIV4_P, DIV4_M1, DIV4_NR }; 152enum { DIV4_I, DIV4_SH, DIV4_B, DIV4_P, DIV4_M1, DIV4_NR };
138 153
139#define DIV4(_str, _reg, _bit, _mask, _flags) \ 154#define DIV4(_str, _reg, _bit, _mask, _flags) \
@@ -144,7 +159,7 @@ struct clk div4_clks[DIV4_NR] = {
144 [DIV4_SH] = DIV4("shyway_clk", FRQCRA, 12, 0x2f7c, CLK_ENABLE_ON_INIT), 159 [DIV4_SH] = DIV4("shyway_clk", FRQCRA, 12, 0x2f7c, CLK_ENABLE_ON_INIT),
145 [DIV4_B] = DIV4("bus_clk", FRQCRA, 8, 0x2f7c, CLK_ENABLE_ON_INIT), 160 [DIV4_B] = DIV4("bus_clk", FRQCRA, 8, 0x2f7c, CLK_ENABLE_ON_INIT),
146 [DIV4_P] = DIV4("peripheral_clk", FRQCRA, 0, 0x2f7c, 0), 161 [DIV4_P] = DIV4("peripheral_clk", FRQCRA, 0, 0x2f7c, 0),
147 [DIV4_M1] = DIV4("vpu_clk", FRQCRB, 4, 0x2f7c, 0), 162 [DIV4_M1] = DIV4("vpu_clk", FRQCRB, 4, 0x2f7c, CLK_ENABLE_ON_INIT),
148}; 163};
149 164
150struct clk div6_clks[] = { 165struct clk div6_clks[] = {
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7757.c b/arch/sh/kernel/cpu/sh4a/clock-sh7757.c
index ddc235ca9664..86aae60677dc 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7757.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7757.c
@@ -35,7 +35,7 @@ static struct clk_ops sh7757_master_clk_ops = {
35 35
36static void module_clk_recalc(struct clk *clk) 36static void module_clk_recalc(struct clk *clk)
37{ 37{
38 int idx = ctrl_inl(FRQCR) & 0x0000000f; 38 int idx = __raw_readl(FRQCR) & 0x0000000f;
39 clk->rate = clk->parent->rate / p1fc_divisors[idx]; 39 clk->rate = clk->parent->rate / p1fc_divisors[idx];
40} 40}
41 41
@@ -45,7 +45,7 @@ static struct clk_ops sh7757_module_clk_ops = {
45 45
46static void bus_clk_recalc(struct clk *clk) 46static void bus_clk_recalc(struct clk *clk)
47{ 47{
48 int idx = (ctrl_inl(FRQCR) >> 8) & 0x0000000f; 48 int idx = (__raw_readl(FRQCR) >> 8) & 0x0000000f;
49 clk->rate = clk->parent->rate / bfc_divisors[idx]; 49 clk->rate = clk->parent->rate / bfc_divisors[idx];
50} 50}
51 51
@@ -55,7 +55,7 @@ static struct clk_ops sh7757_bus_clk_ops = {
55 55
56static void cpu_clk_recalc(struct clk *clk) 56static void cpu_clk_recalc(struct clk *clk)
57{ 57{
58 int idx = (ctrl_inl(FRQCR) >> 20) & 0x0000000f; 58 int idx = (__raw_readl(FRQCR) >> 20) & 0x0000000f;
59 clk->rate = clk->parent->rate / ifc_divisors[idx]; 59 clk->rate = clk->parent->rate / ifc_divisors[idx];
60} 60}
61 61
@@ -78,7 +78,7 @@ void __init arch_init_clk_ops(struct clk_ops **ops, int idx)
78 78
79static void shyway_clk_recalc(struct clk *clk) 79static void shyway_clk_recalc(struct clk *clk)
80{ 80{
81 int idx = (ctrl_inl(FRQCR) >> 12) & 0x0000000f; 81 int idx = (__raw_readl(FRQCR) >> 12) & 0x0000000f;
82 clk->rate = clk->parent->rate / sfc_divisors[idx]; 82 clk->rate = clk->parent->rate / sfc_divisors[idx];
83} 83}
84 84
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7763.c b/arch/sh/kernel/cpu/sh4a/clock-sh7763.c
index 370cd47642ef..9f401163e71e 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7763.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7763.c
@@ -22,7 +22,7 @@ static int cfc_divisors[] = { 1, 1, 4, 1, 1, 1, 1, 1 };
22 22
23static void master_clk_init(struct clk *clk) 23static void master_clk_init(struct clk *clk)
24{ 24{
25 clk->rate *= p0fc_divisors[(ctrl_inl(FRQCR) >> 4) & 0x07]; 25 clk->rate *= p0fc_divisors[(__raw_readl(FRQCR) >> 4) & 0x07];
26} 26}
27 27
28static struct clk_ops sh7763_master_clk_ops = { 28static struct clk_ops sh7763_master_clk_ops = {
@@ -31,7 +31,7 @@ static struct clk_ops sh7763_master_clk_ops = {
31 31
32static unsigned long module_clk_recalc(struct clk *clk) 32static unsigned long module_clk_recalc(struct clk *clk)
33{ 33{
34 int idx = ((ctrl_inl(FRQCR) >> 4) & 0x07); 34 int idx = ((__raw_readl(FRQCR) >> 4) & 0x07);
35 return clk->parent->rate / p0fc_divisors[idx]; 35 return clk->parent->rate / p0fc_divisors[idx];
36} 36}
37 37
@@ -41,7 +41,7 @@ static struct clk_ops sh7763_module_clk_ops = {
41 41
42static unsigned long bus_clk_recalc(struct clk *clk) 42static unsigned long bus_clk_recalc(struct clk *clk)
43{ 43{
44 int idx = ((ctrl_inl(FRQCR) >> 16) & 0x07); 44 int idx = ((__raw_readl(FRQCR) >> 16) & 0x07);
45 return clk->parent->rate / bfc_divisors[idx]; 45 return clk->parent->rate / bfc_divisors[idx];
46} 46}
47 47
@@ -68,7 +68,7 @@ void __init arch_init_clk_ops(struct clk_ops **ops, int idx)
68 68
69static unsigned long shyway_clk_recalc(struct clk *clk) 69static unsigned long shyway_clk_recalc(struct clk *clk)
70{ 70{
71 int idx = ((ctrl_inl(FRQCR) >> 20) & 0x07); 71 int idx = ((__raw_readl(FRQCR) >> 20) & 0x07);
72 return clk->parent->rate / cfc_divisors[idx]; 72 return clk->parent->rate / cfc_divisors[idx];
73} 73}
74 74
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7770.c b/arch/sh/kernel/cpu/sh4a/clock-sh7770.c
index e0b896769205..9e3354365d40 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7770.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7770.c
@@ -21,7 +21,7 @@ static int pfc_divisors[] = { 1, 8, 1,10,12,16, 1, 1 };
21 21
22static void master_clk_init(struct clk *clk) 22static void master_clk_init(struct clk *clk)
23{ 23{
24 clk->rate *= pfc_divisors[(ctrl_inl(FRQCR) >> 28) & 0x000f]; 24 clk->rate *= pfc_divisors[(__raw_readl(FRQCR) >> 28) & 0x000f];
25} 25}
26 26
27static struct clk_ops sh7770_master_clk_ops = { 27static struct clk_ops sh7770_master_clk_ops = {
@@ -30,7 +30,7 @@ static struct clk_ops sh7770_master_clk_ops = {
30 30
31static unsigned long module_clk_recalc(struct clk *clk) 31static unsigned long module_clk_recalc(struct clk *clk)
32{ 32{
33 int idx = ((ctrl_inl(FRQCR) >> 28) & 0x000f); 33 int idx = ((__raw_readl(FRQCR) >> 28) & 0x000f);
34 return clk->parent->rate / pfc_divisors[idx]; 34 return clk->parent->rate / pfc_divisors[idx];
35} 35}
36 36
@@ -40,7 +40,7 @@ static struct clk_ops sh7770_module_clk_ops = {
40 40
41static unsigned long bus_clk_recalc(struct clk *clk) 41static unsigned long bus_clk_recalc(struct clk *clk)
42{ 42{
43 int idx = (ctrl_inl(FRQCR) & 0x000f); 43 int idx = (__raw_readl(FRQCR) & 0x000f);
44 return clk->parent->rate / bfc_divisors[idx]; 44 return clk->parent->rate / bfc_divisors[idx];
45} 45}
46 46
@@ -50,7 +50,7 @@ static struct clk_ops sh7770_bus_clk_ops = {
50 50
51static unsigned long cpu_clk_recalc(struct clk *clk) 51static unsigned long cpu_clk_recalc(struct clk *clk)
52{ 52{
53 int idx = ((ctrl_inl(FRQCR) >> 24) & 0x000f); 53 int idx = ((__raw_readl(FRQCR) >> 24) & 0x000f);
54 return clk->parent->rate / ifc_divisors[idx]; 54 return clk->parent->rate / ifc_divisors[idx];
55} 55}
56 56
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7780.c b/arch/sh/kernel/cpu/sh4a/clock-sh7780.c
index a249d823578e..150963a6001e 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7780.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7780.c
@@ -22,7 +22,7 @@ static int cfc_divisors[] = { 1, 1, 4, 1, 6, 1, 1, 1 };
22 22
23static void master_clk_init(struct clk *clk) 23static void master_clk_init(struct clk *clk)
24{ 24{
25 clk->rate *= pfc_divisors[ctrl_inl(FRQCR) & 0x0003]; 25 clk->rate *= pfc_divisors[__raw_readl(FRQCR) & 0x0003];
26} 26}
27 27
28static struct clk_ops sh7780_master_clk_ops = { 28static struct clk_ops sh7780_master_clk_ops = {
@@ -31,7 +31,7 @@ static struct clk_ops sh7780_master_clk_ops = {
31 31
32static unsigned long module_clk_recalc(struct clk *clk) 32static unsigned long module_clk_recalc(struct clk *clk)
33{ 33{
34 int idx = (ctrl_inl(FRQCR) & 0x0003); 34 int idx = (__raw_readl(FRQCR) & 0x0003);
35 return clk->parent->rate / pfc_divisors[idx]; 35 return clk->parent->rate / pfc_divisors[idx];
36} 36}
37 37
@@ -41,7 +41,7 @@ static struct clk_ops sh7780_module_clk_ops = {
41 41
42static unsigned long bus_clk_recalc(struct clk *clk) 42static unsigned long bus_clk_recalc(struct clk *clk)
43{ 43{
44 int idx = ((ctrl_inl(FRQCR) >> 16) & 0x0007); 44 int idx = ((__raw_readl(FRQCR) >> 16) & 0x0007);
45 return clk->parent->rate / bfc_divisors[idx]; 45 return clk->parent->rate / bfc_divisors[idx];
46} 46}
47 47
@@ -51,7 +51,7 @@ static struct clk_ops sh7780_bus_clk_ops = {
51 51
52static unsigned long cpu_clk_recalc(struct clk *clk) 52static unsigned long cpu_clk_recalc(struct clk *clk)
53{ 53{
54 int idx = ((ctrl_inl(FRQCR) >> 24) & 0x0001); 54 int idx = ((__raw_readl(FRQCR) >> 24) & 0x0001);
55 return clk->parent->rate / ifc_divisors[idx]; 55 return clk->parent->rate / ifc_divisors[idx];
56} 56}
57 57
@@ -74,7 +74,7 @@ void __init arch_init_clk_ops(struct clk_ops **ops, int idx)
74 74
75static unsigned long shyway_clk_recalc(struct clk *clk) 75static unsigned long shyway_clk_recalc(struct clk *clk)
76{ 76{
77 int idx = ((ctrl_inl(FRQCR) >> 20) & 0x0007); 77 int idx = ((__raw_readl(FRQCR) >> 20) & 0x0007);
78 return clk->parent->rate / cfc_divisors[idx]; 78 return clk->parent->rate / cfc_divisors[idx];
79} 79}
80 80
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7785.c b/arch/sh/kernel/cpu/sh4a/clock-sh7785.c
index 73abfbf2f16d..d997f0a25b10 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7785.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7785.c
@@ -57,11 +57,15 @@ static struct clk *clks[] = {
57static unsigned int div2[] = { 1, 2, 4, 6, 8, 12, 16, 18, 57static unsigned int div2[] = { 1, 2, 4, 6, 8, 12, 16, 18,
58 24, 32, 36, 48 }; 58 24, 32, 36, 48 };
59 59
60static struct clk_div_mult_table div4_table = { 60static struct clk_div_mult_table div4_div_mult_table = {
61 .divisors = div2, 61 .divisors = div2,
62 .nr_divisors = ARRAY_SIZE(div2), 62 .nr_divisors = ARRAY_SIZE(div2),
63}; 63};
64 64
65static struct clk_div4_table div4_table = {
66 .div_mult_table = &div4_div_mult_table,
67};
68
65enum { DIV4_I, DIV4_U, DIV4_SH, DIV4_B, DIV4_DDR, DIV4_GA, 69enum { DIV4_I, DIV4_U, DIV4_SH, DIV4_B, DIV4_DDR, DIV4_GA,
66 DIV4_DU, DIV4_P, DIV4_NR }; 70 DIV4_DU, DIV4_P, DIV4_NR };
67 71
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7786.c b/arch/sh/kernel/cpu/sh4a/clock-sh7786.c
index a0e8869071ac..af69fd468703 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7786.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7786.c
@@ -3,11 +3,7 @@
3 * 3 *
4 * SH7786 support for the clock framework 4 * SH7786 support for the clock framework
5 * 5 *
6 * Copyright (C) 2008, 2009 Renesas Solutions Corp. 6 * Copyright (C) 2010 Paul Mundt
7 * Kuninori Morimoto <morimoto.kuninori@renesas.com>
8 *
9 * Based on SH7785
10 * Copyright (C) 2007 Paul Mundt
11 * 7 *
12 * 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
13 * 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
@@ -15,127 +11,127 @@
15 */ 11 */
16#include <linux/init.h> 12#include <linux/init.h>
17#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <linux/clk.h>
15#include <linux/io.h>
18#include <asm/clock.h> 16#include <asm/clock.h>
19#include <asm/freq.h> 17#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 18
30static void master_clk_init(struct clk *clk) 19/*
31{ 20 * Default rate for the root input clock, reset this with clk_set_rate()
32 clk->rate *= pfc_divisors[ctrl_inl(FRQMR1) & 0x000f]; 21 * from the platform code.
33} 22 */
34 23static struct clk extal_clk = {
35static struct clk_ops sh7786_master_clk_ops = { 24 .name = "extal",
36 .init = master_clk_init, 25 .id = -1,
26 .rate = 33333333,
37}; 27};
38 28
39static unsigned long module_clk_recalc(struct clk *clk) 29static unsigned long pll_recalc(struct clk *clk)
40{ 30{
41 int idx = (ctrl_inl(FRQMR1) & 0x000f); 31 int multiplier;
42 return clk->parent->rate / pfc_divisors[idx];
43}
44 32
45static struct clk_ops sh7786_module_clk_ops = { 33 /*
46 .recalc = module_clk_recalc, 34 * Clock modes 0, 1, and 2 use an x64 multiplier against PLL1,
47}; 35 * while modes 3, 4, and 5 use an x32.
36 */
37 multiplier = (sh_mv.mv_mode_pins() & 0xf) < 3 ? 64 : 32;
48 38
49static unsigned long bus_clk_recalc(struct clk *clk) 39 return clk->parent->rate * multiplier;
50{
51 int idx = ((ctrl_inl(FRQMR1) >> 16) & 0x000f);
52 return clk->parent->rate / bfc_divisors[idx];
53} 40}
54 41
55static struct clk_ops sh7786_bus_clk_ops = { 42static struct clk_ops pll_clk_ops = {
56 .recalc = bus_clk_recalc, 43 .recalc = pll_recalc,
57}; 44};
58 45
59static unsigned long cpu_clk_recalc(struct clk *clk) 46static struct clk pll_clk = {
60{ 47 .name = "pll_clk",
61 int idx = ((ctrl_inl(FRQMR1) >> 28) & 0x0003); 48 .id = -1,
62 return clk->parent->rate / ifc_divisors[idx]; 49 .ops = &pll_clk_ops,
63} 50 .parent = &extal_clk,
64 51 .flags = CLK_ENABLE_ON_INIT,
65static struct clk_ops sh7786_cpu_clk_ops = {
66 .recalc = cpu_clk_recalc,
67}; 52};
68 53
69static struct clk_ops *sh7786_clk_ops[] = { 54static struct clk *clks[] = {
70 &sh7786_master_clk_ops, 55 &extal_clk,
71 &sh7786_module_clk_ops, 56 &pll_clk,
72 &sh7786_bus_clk_ops,
73 &sh7786_cpu_clk_ops,
74}; 57};
75 58
76void __init arch_init_clk_ops(struct clk_ops **ops, int idx) 59static unsigned int div2[] = { 1, 2, 4, 6, 8, 12, 16, 18,
77{ 60 24, 32, 36, 48 };
78 if (idx < ARRAY_SIZE(sh7786_clk_ops))
79 *ops = sh7786_clk_ops[idx];
80}
81 61
82static unsigned long shyway_clk_recalc(struct clk *clk) 62static struct clk_div_mult_table div4_div_mult_table = {
83{ 63 .divisors = div2,
84 int idx = ((ctrl_inl(FRQMR1) >> 20) & 0x0003); 64 .nr_divisors = ARRAY_SIZE(div2),
85 return clk->parent->rate / sfc_divisors[idx];
86}
87
88static struct clk_ops sh7786_shyway_clk_ops = {
89 .recalc = shyway_clk_recalc,
90}; 65};
91 66
92static struct clk sh7786_shyway_clk = { 67static struct clk_div4_table div4_table = {
93 .name = "shyway_clk", 68 .div_mult_table = &div4_div_mult_table,
94 .flags = CLK_ENABLE_ON_INIT,
95 .ops = &sh7786_shyway_clk_ops,
96}; 69};
97 70
98static unsigned long ddr_clk_recalc(struct clk *clk) 71enum { DIV4_I, DIV4_SH, DIV4_B, DIV4_DDR, DIV4_DU, DIV4_P, DIV4_NR };
99{
100 int idx = ((ctrl_inl(FRQMR1) >> 12) & 0x0003);
101 return clk->parent->rate / mfc_divisors[idx];
102}
103 72
104static struct clk_ops sh7786_ddr_clk_ops = { 73#define DIV4(_str, _bit, _mask, _flags) \
105 .recalc = ddr_clk_recalc, 74 SH_CLK_DIV4(_str, &pll_clk, FRQMR1, _bit, _mask, _flags)
106};
107 75
108static struct clk sh7786_ddr_clk = { 76struct clk div4_clks[DIV4_NR] = {
109 .name = "ddr_clk", 77 [DIV4_P] = DIV4("peripheral_clk", 0, 0x0b40, 0),
110 .flags = CLK_ENABLE_ON_INIT, 78 [DIV4_DU] = DIV4("du_clk", 4, 0x0010, 0),
111 .ops = &sh7786_ddr_clk_ops, 79 [DIV4_DDR] = DIV4("ddr_clk", 12, 0x0002, CLK_ENABLE_ON_INIT),
80 [DIV4_B] = DIV4("bus_clk", 16, 0x0360, CLK_ENABLE_ON_INIT),
81 [DIV4_SH] = DIV4("shyway_clk", 20, 0x0002, CLK_ENABLE_ON_INIT),
82 [DIV4_I] = DIV4("cpu_clk", 28, 0x0006, CLK_ENABLE_ON_INIT),
112}; 83};
113 84
114/* 85#define MSTPCR0 0xffc40030
115 * Additional SH7786-specific on-chip clocks that aren't already part of the 86#define MSTPCR1 0xffc40034
116 * clock framework 87
117 */ 88static struct clk mstp_clks[] = {
118static struct clk *sh7786_onchip_clocks[] = { 89 /* MSTPCR0 */
119 &sh7786_shyway_clk, 90 SH_CLK_MSTP32("scif_fck", 5, &div4_clks[DIV4_P], MSTPCR0, 29, 0),
120 &sh7786_ddr_clk, 91 SH_CLK_MSTP32("scif_fck", 4, &div4_clks[DIV4_P], MSTPCR0, 28, 0),
92 SH_CLK_MSTP32("scif_fck", 3, &div4_clks[DIV4_P], MSTPCR0, 27, 0),
93 SH_CLK_MSTP32("scif_fck", 2, &div4_clks[DIV4_P], MSTPCR0, 26, 0),
94 SH_CLK_MSTP32("scif_fck", 1, &div4_clks[DIV4_P], MSTPCR0, 25, 0),
95 SH_CLK_MSTP32("scif_fck", 0, &div4_clks[DIV4_P], MSTPCR0, 24, 0),
96 SH_CLK_MSTP32("ssi_fck", 3, &div4_clks[DIV4_P], MSTPCR0, 23, 0),
97 SH_CLK_MSTP32("ssi_fck", 2, &div4_clks[DIV4_P], MSTPCR0, 22, 0),
98 SH_CLK_MSTP32("ssi_fck", 1, &div4_clks[DIV4_P], MSTPCR0, 21, 0),
99 SH_CLK_MSTP32("ssi_fck", 0, &div4_clks[DIV4_P], MSTPCR0, 20, 0),
100 SH_CLK_MSTP32("hac_fck", 1, &div4_clks[DIV4_P], MSTPCR0, 17, 0),
101 SH_CLK_MSTP32("hac_fck", 0, &div4_clks[DIV4_P], MSTPCR0, 16, 0),
102 SH_CLK_MSTP32("i2c_fck", 1, &div4_clks[DIV4_P], MSTPCR0, 15, 0),
103 SH_CLK_MSTP32("i2c_fck", 0, &div4_clks[DIV4_P], MSTPCR0, 14, 0),
104 SH_CLK_MSTP32("tmu9_11_fck", -1, &div4_clks[DIV4_P], MSTPCR0, 11, 0),
105 SH_CLK_MSTP32("tmu678_fck", -1, &div4_clks[DIV4_P], MSTPCR0, 10, 0),
106 SH_CLK_MSTP32("tmu345_fck", -1, &div4_clks[DIV4_P], MSTPCR0, 9, 0),
107 SH_CLK_MSTP32("tmu012_fck", -1, &div4_clks[DIV4_P], MSTPCR0, 8, 0),
108 SH_CLK_MSTP32("sdif_fck", 1, &div4_clks[DIV4_P], MSTPCR0, 5, 0),
109 SH_CLK_MSTP32("sdif_fck", 0, &div4_clks[DIV4_P], MSTPCR0, 4, 0),
110 SH_CLK_MSTP32("hspi_fck", -1, &div4_clks[DIV4_P], MSTPCR0, 2, 0),
111
112 /* MSTPCR1 */
113 SH_CLK_MSTP32("usb_fck", -1, NULL, MSTPCR1, 12, 0),
114 SH_CLK_MSTP32("pcie_fck", 2, NULL, MSTPCR1, 10, 0),
115 SH_CLK_MSTP32("pcie_fck", 1, NULL, MSTPCR1, 9, 0),
116 SH_CLK_MSTP32("pcie_fck", 0, NULL, MSTPCR1, 8, 0),
117 SH_CLK_MSTP32("dmac_11_6_fck", -1, NULL, MSTPCR1, 5, 0),
118 SH_CLK_MSTP32("dmac_5_0_fck", -1, NULL, MSTPCR1, 4, 0),
119 SH_CLK_MSTP32("du_fck", -1, NULL, MSTPCR1, 3, 0),
120 SH_CLK_MSTP32("ether_fck", -1, NULL, MSTPCR1, 2, 0),
121}; 121};
122 122
123int __init arch_clk_init(void) 123int __init arch_clk_init(void)
124{ 124{
125 struct clk *clk;
126 int i, ret = 0; 125 int i, ret = 0;
127 126
128 cpg_clk_init(); 127 for (i = 0; i < ARRAY_SIZE(clks); i++)
129 128 ret |= clk_register(clks[i]);
130 clk = clk_get(NULL, "master_clk");
131 for (i = 0; i < ARRAY_SIZE(sh7786_onchip_clocks); i++) {
132 struct clk *clkp = sh7786_onchip_clocks[i];
133
134 clkp->parent = clk;
135 ret |= clk_register(clkp);
136 }
137 129
138 clk_put(clk); 130 if (!ret)
131 ret = sh_clk_div4_register(div4_clks, ARRAY_SIZE(div4_clks),
132 &div4_table);
133 if (!ret)
134 ret = sh_clk_mstp32_register(mstp_clks, ARRAY_SIZE(mstp_clks));
139 135
140 return ret; 136 return ret;
141} 137}
diff --git a/arch/sh/kernel/cpu/sh4a/clock-shx3.c b/arch/sh/kernel/cpu/sh4a/clock-shx3.c
index 23c27d32d982..e75c57bdfa5e 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-shx3.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-shx3.c
@@ -33,7 +33,7 @@ static int cfc_divisors[] = { 1, 1, 4, 6 };
33 33
34static void master_clk_init(struct clk *clk) 34static void master_clk_init(struct clk *clk)
35{ 35{
36 clk->rate *= pfc_divisors[(ctrl_inl(FRQCR) >> PFC_POS) & PFC_MSK]; 36 clk->rate *= pfc_divisors[(__raw_readl(FRQCR) >> PFC_POS) & PFC_MSK];
37} 37}
38 38
39static struct clk_ops shx3_master_clk_ops = { 39static struct clk_ops shx3_master_clk_ops = {
@@ -42,7 +42,7 @@ static struct clk_ops shx3_master_clk_ops = {
42 42
43static unsigned long module_clk_recalc(struct clk *clk) 43static unsigned long module_clk_recalc(struct clk *clk)
44{ 44{
45 int idx = ((ctrl_inl(FRQCR) >> PFC_POS) & PFC_MSK); 45 int idx = ((__raw_readl(FRQCR) >> PFC_POS) & PFC_MSK);
46 return clk->parent->rate / pfc_divisors[idx]; 46 return clk->parent->rate / pfc_divisors[idx];
47} 47}
48 48
@@ -52,7 +52,7 @@ static struct clk_ops shx3_module_clk_ops = {
52 52
53static unsigned long bus_clk_recalc(struct clk *clk) 53static unsigned long bus_clk_recalc(struct clk *clk)
54{ 54{
55 int idx = ((ctrl_inl(FRQCR) >> BFC_POS) & BFC_MSK); 55 int idx = ((__raw_readl(FRQCR) >> BFC_POS) & BFC_MSK);
56 return clk->parent->rate / bfc_divisors[idx]; 56 return clk->parent->rate / bfc_divisors[idx];
57} 57}
58 58
@@ -62,7 +62,7 @@ static struct clk_ops shx3_bus_clk_ops = {
62 62
63static unsigned long cpu_clk_recalc(struct clk *clk) 63static unsigned long cpu_clk_recalc(struct clk *clk)
64{ 64{
65 int idx = ((ctrl_inl(FRQCR) >> IFC_POS) & IFC_MSK); 65 int idx = ((__raw_readl(FRQCR) >> IFC_POS) & IFC_MSK);
66 return clk->parent->rate / ifc_divisors[idx]; 66 return clk->parent->rate / ifc_divisors[idx];
67} 67}
68 68
@@ -85,7 +85,7 @@ void __init arch_init_clk_ops(struct clk_ops **ops, int idx)
85 85
86static unsigned long shyway_clk_recalc(struct clk *clk) 86static unsigned long shyway_clk_recalc(struct clk *clk)
87{ 87{
88 int idx = ((ctrl_inl(FRQCR) >> CFC_POS) & CFC_MSK); 88 int idx = ((__raw_readl(FRQCR) >> CFC_POS) & CFC_MSK);
89 return clk->parent->rate / cfc_divisors[idx]; 89 return clk->parent->rate / cfc_divisors[idx];
90} 90}
91 91
diff --git a/arch/sh/kernel/cpu/sh4a/pinmux-sh7722.c b/arch/sh/kernel/cpu/sh4a/pinmux-sh7722.c
index cb9d07bd59f8..0688a7502f86 100644
--- a/arch/sh/kernel/cpu/sh4a/pinmux-sh7722.c
+++ b/arch/sh/kernel/cpu/sh4a/pinmux-sh7722.c
@@ -278,6 +278,7 @@ enum {
278 HIZA8_LCDC, HIZA8_HIZ, 278 HIZA8_LCDC, HIZA8_HIZ,
279 HIZA7_LCDC, HIZA7_HIZ, 279 HIZA7_LCDC, HIZA7_HIZ,
280 HIZA6_LCDC, HIZA6_HIZ, 280 HIZA6_LCDC, HIZA6_HIZ,
281 HIZB4_SIUA, HIZB4_HIZ,
281 HIZB1_VIO, HIZB1_HIZ, 282 HIZB1_VIO, HIZB1_HIZ,
282 HIZB0_VIO, HIZB0_HIZ, 283 HIZB0_VIO, HIZB0_HIZ,
283 HIZC15_IRQ7, HIZC15_HIZ, 284 HIZC15_IRQ7, HIZC15_HIZ,
@@ -546,7 +547,7 @@ static pinmux_enum_t pinmux_data[] = {
546 PINMUX_DATA(VIO_VD2_MARK, PSE3_VIO, MSELB9_VIO2, 547 PINMUX_DATA(VIO_VD2_MARK, PSE3_VIO, MSELB9_VIO2,
547 HIZB0_VIO, FOE_VIO_VD2), 548 HIZB0_VIO, FOE_VIO_VD2),
548 PINMUX_DATA(VIO_HD2_MARK, PSE3_VIO, MSELB9_VIO2, 549 PINMUX_DATA(VIO_HD2_MARK, PSE3_VIO, MSELB9_VIO2,
549 HIZB1_VIO, HIZB1_VIO, FCE_VIO_HD2), 550 HIZB1_VIO, FCE_VIO_HD2),
550 PINMUX_DATA(VIO_CLK2_MARK, PSE3_VIO, MSELB9_VIO2, 551 PINMUX_DATA(VIO_CLK2_MARK, PSE3_VIO, MSELB9_VIO2,
551 HIZB1_VIO, FRB_VIO_CLK2), 552 HIZB1_VIO, FRB_VIO_CLK2),
552 553
@@ -658,14 +659,14 @@ static pinmux_enum_t pinmux_data[] = {
658 PINMUX_DATA(SDHICLK_MARK, SDHICLK), 659 PINMUX_DATA(SDHICLK_MARK, SDHICLK),
659 660
660 /* SIU - Port A */ 661 /* SIU - Port A */
661 PINMUX_DATA(SIUAOLR_MARK, PSC13_SIUAOLR, SIUAOLR_SIOF1_SYNC), 662 PINMUX_DATA(SIUAOLR_MARK, PSC13_SIUAOLR, HIZB4_SIUA, SIUAOLR_SIOF1_SYNC),
662 PINMUX_DATA(SIUAOBT_MARK, PSC14_SIUAOBT, SIUAOBT_SIOF1_SCK), 663 PINMUX_DATA(SIUAOBT_MARK, PSC14_SIUAOBT, HIZB4_SIUA, SIUAOBT_SIOF1_SCK),
663 PINMUX_DATA(SIUAISLD_MARK, PSC15_SIUAISLD, SIUAISLD_SIOF1_RXD), 664 PINMUX_DATA(SIUAISLD_MARK, PSC15_SIUAISLD, HIZB4_SIUA, SIUAISLD_SIOF1_RXD),
664 PINMUX_DATA(SIUAILR_MARK, PSC11_SIUAILR, SIUAILR_SIOF1_SS2), 665 PINMUX_DATA(SIUAILR_MARK, PSC11_SIUAILR, HIZB4_SIUA, SIUAILR_SIOF1_SS2),
665 PINMUX_DATA(SIUAIBT_MARK, PSC12_SIUAIBT, SIUAIBT_SIOF1_SS1), 666 PINMUX_DATA(SIUAIBT_MARK, PSC12_SIUAIBT, HIZB4_SIUA, SIUAIBT_SIOF1_SS1),
666 PINMUX_DATA(SIUAOSLD_MARK, PSB0_SIUAOSLD, SIUAOSLD_SIOF1_TXD), 667 PINMUX_DATA(SIUAOSLD_MARK, PSB0_SIUAOSLD, HIZB4_SIUA, SIUAOSLD_SIOF1_TXD),
667 PINMUX_DATA(SIUMCKA_MARK, PSE11_SIUMCKA_SIOF1_MCK, PSB1_SIUMCKA, PTK0), 668 PINMUX_DATA(SIUMCKA_MARK, PSE11_SIUMCKA_SIOF1_MCK, HIZB4_SIUA, PSB1_SIUMCKA, PTK0),
668 PINMUX_DATA(SIUFCKA_MARK, PSE11_SIUFCKA, PTK0), 669 PINMUX_DATA(SIUFCKA_MARK, PSE11_SIUFCKA, HIZB4_SIUA, PTK0),
669 670
670 /* SIU - Port B */ 671 /* SIU - Port B */
671 PINMUX_DATA(SIUBOLR_MARK, PSB11_SIUBOLR, SIOSTRB1_SIUBOLR), 672 PINMUX_DATA(SIUBOLR_MARK, PSB11_SIUBOLR, SIOSTRB1_SIUBOLR),
@@ -1612,7 +1613,7 @@ static struct pinmux_cfg_reg pinmux_config_regs[] = {
1612 0, 0, 1613 0, 0,
1613 0, 0, 1614 0, 0,
1614 0, 0, 1615 0, 0,
1615 0, 0, 1616 HIZB4_SIUA, HIZB4_HIZ,
1616 0, 0, 1617 0, 0,
1617 0, 0, 1618 0, 0,
1618 HIZB1_VIO, HIZB1_HIZ, 1619 HIZB1_VIO, HIZB1_HIZ,
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7722.c b/arch/sh/kernel/cpu/sh4a/setup-sh7722.c
index b5335b5e309c..ef3f97827808 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7722.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7722.c
@@ -446,6 +446,8 @@ void __init plat_early_device_setup(void)
446 446
447enum { 447enum {
448 UNUSED=0, 448 UNUSED=0,
449 ENABLED,
450 DISABLED,
449 451
450 /* interrupt sources */ 452 /* interrupt sources */
451 IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7, 453 IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7,
@@ -461,7 +463,6 @@ enum {
461 SCIF0, SCIF1, SCIF2, SIOF0, SIOF1, SIO, 463 SCIF0, SCIF1, SCIF2, SIOF0, SIOF1, SIO,
462 FLCTL_FLSTEI, FLCTL_FLENDI, FLCTL_FLTREQ0I, FLCTL_FLTREQ1I, 464 FLCTL_FLSTEI, FLCTL_FLENDI, FLCTL_FLTREQ0I, FLCTL_FLTREQ1I,
463 I2C_ALI, I2C_TACKI, I2C_WAITI, I2C_DTEI, 465 I2C_ALI, I2C_TACKI, I2C_WAITI, I2C_DTEI,
464 SDHI0, SDHI1, SDHI2, SDHI3,
465 CMT, TSIF, SIU, TWODG, 466 CMT, TSIF, SIU, TWODG,
466 TMU0, TMU1, TMU2, 467 TMU0, TMU1, TMU2,
467 IRDA, JPU, LCDC, 468 IRDA, JPU, LCDC,
@@ -494,8 +495,8 @@ static struct intc_vect vectors[] __initdata = {
494 INTC_VECT(FLCTL_FLTREQ0I, 0xdc0), INTC_VECT(FLCTL_FLTREQ1I, 0xde0), 495 INTC_VECT(FLCTL_FLTREQ0I, 0xdc0), INTC_VECT(FLCTL_FLTREQ1I, 0xde0),
495 INTC_VECT(I2C_ALI, 0xe00), INTC_VECT(I2C_TACKI, 0xe20), 496 INTC_VECT(I2C_ALI, 0xe00), INTC_VECT(I2C_TACKI, 0xe20),
496 INTC_VECT(I2C_WAITI, 0xe40), INTC_VECT(I2C_DTEI, 0xe60), 497 INTC_VECT(I2C_WAITI, 0xe40), INTC_VECT(I2C_DTEI, 0xe60),
497 INTC_VECT(SDHI0, 0xe80), INTC_VECT(SDHI1, 0xea0), 498 INTC_VECT(SDHI, 0xe80), INTC_VECT(SDHI, 0xea0),
498 INTC_VECT(SDHI2, 0xec0), INTC_VECT(SDHI3, 0xee0), 499 INTC_VECT(SDHI, 0xec0), INTC_VECT(SDHI, 0xee0),
499 INTC_VECT(CMT, 0xf00), INTC_VECT(TSIF, 0xf20), 500 INTC_VECT(CMT, 0xf00), INTC_VECT(TSIF, 0xf20),
500 INTC_VECT(SIU, 0xf80), INTC_VECT(TWODG, 0xfa0), 501 INTC_VECT(SIU, 0xf80), INTC_VECT(TWODG, 0xfa0),
501 INTC_VECT(TMU0, 0x400), INTC_VECT(TMU1, 0x420), 502 INTC_VECT(TMU0, 0x400), INTC_VECT(TMU1, 0x420),
@@ -513,7 +514,6 @@ static struct intc_group groups[] __initdata = {
513 INTC_GROUP(FLCTL, FLCTL_FLSTEI, FLCTL_FLENDI, 514 INTC_GROUP(FLCTL, FLCTL_FLSTEI, FLCTL_FLENDI,
514 FLCTL_FLTREQ0I, FLCTL_FLTREQ1I), 515 FLCTL_FLTREQ0I, FLCTL_FLTREQ1I),
515 INTC_GROUP(I2C, I2C_ALI, I2C_TACKI, I2C_WAITI, I2C_DTEI), 516 INTC_GROUP(I2C, I2C_ALI, I2C_TACKI, I2C_WAITI, I2C_DTEI),
516 INTC_GROUP(SDHI, SDHI0, SDHI1, SDHI2, SDHI3),
517}; 517};
518 518
519static struct intc_mask_reg mask_registers[] __initdata = { 519static struct intc_mask_reg mask_registers[] __initdata = {
@@ -535,7 +535,7 @@ static struct intc_mask_reg mask_registers[] __initdata = {
535 { I2C_DTEI, I2C_WAITI, I2C_TACKI, I2C_ALI, 535 { I2C_DTEI, I2C_WAITI, I2C_TACKI, I2C_ALI,
536 FLCTL_FLTREQ1I, FLCTL_FLTREQ0I, FLCTL_FLENDI, FLCTL_FLSTEI } }, 536 FLCTL_FLTREQ1I, FLCTL_FLTREQ0I, FLCTL_FLENDI, FLCTL_FLSTEI } },
537 { 0xa40800a0, 0xa40800e0, 8, /* IMR8 / IMCR8 */ 537 { 0xa40800a0, 0xa40800e0, 8, /* IMR8 / IMCR8 */
538 { SDHI3, SDHI2, SDHI1, SDHI0, 0, 0, TWODG, SIU } }, 538 { DISABLED, DISABLED, ENABLED, ENABLED, 0, 0, TWODG, SIU } },
539 { 0xa40800a4, 0xa40800e4, 8, /* IMR9 / IMCR9 */ 539 { 0xa40800a4, 0xa40800e4, 8, /* IMR9 / IMCR9 */
540 { 0, 0, 0, CMT, 0, USB_USBI1, USB_USBI0, } }, 540 { 0, 0, 0, CMT, 0, USB_USBI1, USB_USBI0, } },
541 { 0xa40800a8, 0xa40800e8, 8, /* IMR10 / IMCR10 */ 541 { 0xa40800a8, 0xa40800e8, 8, /* IMR10 / IMCR10 */
@@ -573,9 +573,13 @@ static struct intc_mask_reg ack_registers[] __initdata = {
573 { IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7 } }, 573 { IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7 } },
574}; 574};
575 575
576static DECLARE_INTC_DESC_ACK(intc_desc, "sh7722", vectors, groups, 576static struct intc_desc intc_desc __initdata = {
577 mask_registers, prio_registers, sense_registers, 577 .name = "sh7722",
578 ack_registers); 578 .force_enable = ENABLED,
579 .force_disable = DISABLED,
580 .hw = INTC_HW_DESC(vectors, groups, mask_registers,
581 prio_registers, sense_registers, ack_registers),
582};
579 583
580void __init plat_irq_setup(void) 584void __init plat_irq_setup(void)
581{ 585{
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7723.c b/arch/sh/kernel/cpu/sh4a/setup-sh7723.c
index 772b9265d0e4..85c61f624702 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7723.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7723.c
@@ -592,14 +592,17 @@ void __init plat_early_device_setup(void)
592#define RAMCR_CACHE_L2FC 0x0002 592#define RAMCR_CACHE_L2FC 0x0002
593#define RAMCR_CACHE_L2E 0x0001 593#define RAMCR_CACHE_L2E 0x0001
594#define L2_CACHE_ENABLE (RAMCR_CACHE_L2E|RAMCR_CACHE_L2FC) 594#define L2_CACHE_ENABLE (RAMCR_CACHE_L2E|RAMCR_CACHE_L2FC)
595void __uses_jump_to_uncached l2_cache_init(void) 595
596void l2_cache_init(void)
596{ 597{
597 /* Enable L2 cache */ 598 /* Enable L2 cache */
598 ctrl_outl(L2_CACHE_ENABLE, RAMCR); 599 __raw_writel(L2_CACHE_ENABLE, RAMCR);
599} 600}
600 601
601enum { 602enum {
602 UNUSED=0, 603 UNUSED=0,
604 ENABLED,
605 DISABLED,
603 606
604 /* interrupt sources */ 607 /* interrupt sources */
605 IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7, 608 IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7,
@@ -622,7 +625,6 @@ enum {
622 SCIFA_SCIFA1, 625 SCIFA_SCIFA1,
623 FLCTL_FLSTEI,FLCTL_FLTENDI,FLCTL_FLTREQ0I,FLCTL_FLTREQ1I, 626 FLCTL_FLSTEI,FLCTL_FLTENDI,FLCTL_FLTREQ0I,FLCTL_FLTREQ1I,
624 I2C_ALI,I2C_TACKI,I2C_WAITI,I2C_DTEI, 627 I2C_ALI,I2C_TACKI,I2C_WAITI,I2C_DTEI,
625 SDHI0_SDHII0,SDHI0_SDHII1,SDHI0_SDHII2,
626 CMT_CMTI, 628 CMT_CMTI,
627 TSIF_TSIFI, 629 TSIF_TSIFI,
628 SIU_SIUI, 630 SIU_SIUI,
@@ -630,7 +632,6 @@ enum {
630 TMU0_TUNI0, TMU0_TUNI1, TMU0_TUNI2, 632 TMU0_TUNI0, TMU0_TUNI1, TMU0_TUNI2,
631 IRDA_IRDAI, 633 IRDA_IRDAI,
632 ATAPI_ATAPII, 634 ATAPI_ATAPII,
633 SDHI1_SDHII0,SDHI1_SDHII1,SDHI1_SDHII2,
634 VEU2H1_VEU2HI, 635 VEU2H1_VEU2HI,
635 LCDC_LCDCI, 636 LCDC_LCDCI,
636 TMU1_TUNI0,TMU1_TUNI1,TMU1_TUNI2, 637 TMU1_TUNI0,TMU1_TUNI1,TMU1_TUNI2,
@@ -701,9 +702,9 @@ static struct intc_vect vectors[] __initdata = {
701 INTC_VECT(I2C_WAITI,0xE40), 702 INTC_VECT(I2C_WAITI,0xE40),
702 INTC_VECT(I2C_DTEI,0xE60), 703 INTC_VECT(I2C_DTEI,0xE60),
703 704
704 INTC_VECT(SDHI0_SDHII0,0xE80), 705 INTC_VECT(SDHI0, 0xE80),
705 INTC_VECT(SDHI0_SDHII1,0xEA0), 706 INTC_VECT(SDHI0, 0xEA0),
706 INTC_VECT(SDHI0_SDHII2,0xEC0), 707 INTC_VECT(SDHI0, 0xEC0),
707 708
708 INTC_VECT(CMT_CMTI,0xF00), 709 INTC_VECT(CMT_CMTI,0xF00),
709 INTC_VECT(TSIF_TSIFI,0xF20), 710 INTC_VECT(TSIF_TSIFI,0xF20),
@@ -717,9 +718,9 @@ static struct intc_vect vectors[] __initdata = {
717 INTC_VECT(IRDA_IRDAI,0x480), 718 INTC_VECT(IRDA_IRDAI,0x480),
718 INTC_VECT(ATAPI_ATAPII,0x4A0), 719 INTC_VECT(ATAPI_ATAPII,0x4A0),
719 720
720 INTC_VECT(SDHI1_SDHII0,0x4E0), 721 INTC_VECT(SDHI1, 0x4E0),
721 INTC_VECT(SDHI1_SDHII1,0x500), 722 INTC_VECT(SDHI1, 0x500),
722 INTC_VECT(SDHI1_SDHII2,0x520), 723 INTC_VECT(SDHI1, 0x520),
723 724
724 INTC_VECT(VEU2H1_VEU2HI,0x560), 725 INTC_VECT(VEU2H1_VEU2HI,0x560),
725 INTC_VECT(LCDC_LCDCI,0x580), 726 INTC_VECT(LCDC_LCDCI,0x580),
@@ -738,15 +739,14 @@ static struct intc_group groups[] __initdata = {
738 INTC_GROUP(FLCTL,FLCTL_FLSTEI,FLCTL_FLTENDI,FLCTL_FLTREQ0I,FLCTL_FLTREQ1I), 739 INTC_GROUP(FLCTL,FLCTL_FLSTEI,FLCTL_FLTENDI,FLCTL_FLTREQ0I,FLCTL_FLTREQ1I),
739 INTC_GROUP(I2C,I2C_ALI,I2C_TACKI,I2C_WAITI,I2C_DTEI), 740 INTC_GROUP(I2C,I2C_ALI,I2C_TACKI,I2C_WAITI,I2C_DTEI),
740 INTC_GROUP(_2DG, _2DG_TRI,_2DG_INI,_2DG_CEI), 741 INTC_GROUP(_2DG, _2DG_TRI,_2DG_INI,_2DG_CEI),
741 INTC_GROUP(SDHI1, SDHI1_SDHII0,SDHI1_SDHII1,SDHI1_SDHII2),
742 INTC_GROUP(RTC, RTC_ATI,RTC_PRI,RTC_CUI), 742 INTC_GROUP(RTC, RTC_ATI,RTC_PRI,RTC_CUI),
743 INTC_GROUP(DMAC1B, DMAC1B_DEI4,DMAC1B_DEI5,DMAC1B_DADERR), 743 INTC_GROUP(DMAC1B, DMAC1B_DEI4,DMAC1B_DEI5,DMAC1B_DADERR),
744 INTC_GROUP(SDHI0,SDHI0_SDHII0,SDHI0_SDHII1,SDHI0_SDHII2),
745}; 744};
746 745
747static struct intc_mask_reg mask_registers[] __initdata = { 746static struct intc_mask_reg mask_registers[] __initdata = {
748 { 0xa4080080, 0xa40800c0, 8, /* IMR0 / IMCR0 */ 747 { 0xa4080080, 0xa40800c0, 8, /* IMR0 / IMCR0 */
749 { 0, TMU1_TUNI2,TMU1_TUNI1,TMU1_TUNI0,0,SDHI1_SDHII2,SDHI1_SDHII1,SDHI1_SDHII0} }, 748 { 0, TMU1_TUNI2, TMU1_TUNI1, TMU1_TUNI0,
749 0, DISABLED, ENABLED, ENABLED } },
750 { 0xa4080084, 0xa40800c4, 8, /* IMR1 / IMCR1 */ 750 { 0xa4080084, 0xa40800c4, 8, /* IMR1 / IMCR1 */
751 { VIO_VOUI, VIO_VEU2HI,VIO_BEUI,VIO_CEUI,DMAC0A_DEI3,DMAC0A_DEI2,DMAC0A_DEI1,DMAC0A_DEI0 } }, 751 { VIO_VOUI, VIO_VEU2HI,VIO_BEUI,VIO_CEUI,DMAC0A_DEI3,DMAC0A_DEI2,DMAC0A_DEI1,DMAC0A_DEI0 } },
752 { 0xa4080088, 0xa40800c8, 8, /* IMR2 / IMCR2 */ 752 { 0xa4080088, 0xa40800c8, 8, /* IMR2 / IMCR2 */
@@ -763,7 +763,8 @@ static struct intc_mask_reg mask_registers[] __initdata = {
763 { I2C_DTEI, I2C_WAITI, I2C_TACKI, I2C_ALI, 763 { I2C_DTEI, I2C_WAITI, I2C_TACKI, I2C_ALI,
764 FLCTL_FLTREQ1I, FLCTL_FLTREQ0I, FLCTL_FLTENDI, FLCTL_FLSTEI } }, 764 FLCTL_FLTREQ1I, FLCTL_FLTREQ0I, FLCTL_FLTENDI, FLCTL_FLSTEI } },
765 { 0xa40800a0, 0xa40800e0, 8, /* IMR8 / IMCR8 */ 765 { 0xa40800a0, 0xa40800e0, 8, /* IMR8 / IMCR8 */
766 { 0,SDHI0_SDHII2,SDHI0_SDHII1,SDHI0_SDHII0,0,0,SCIFA_SCIFA2,SIU_SIUI } }, 766 { 0, DISABLED, ENABLED, ENABLED,
767 0, 0, SCIFA_SCIFA2, SIU_SIUI } },
767 { 0xa40800a4, 0xa40800e4, 8, /* IMR9 / IMCR9 */ 768 { 0xa40800a4, 0xa40800e4, 8, /* IMR9 / IMCR9 */
768 { 0, 0, 0, CMT_CMTI, 0, 0, USB_USI0,0 } }, 769 { 0, 0, 0, CMT_CMTI, 0, 0, USB_USI0,0 } },
769 { 0xa40800a8, 0xa40800e8, 8, /* IMR10 / IMCR10 */ 770 { 0xa40800a8, 0xa40800e8, 8, /* IMR10 / IMCR10 */
@@ -803,9 +804,13 @@ static struct intc_mask_reg ack_registers[] __initdata = {
803 { IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7 } }, 804 { IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7 } },
804}; 805};
805 806
806static DECLARE_INTC_DESC_ACK(intc_desc, "sh7723", vectors, groups, 807static struct intc_desc intc_desc __initdata = {
807 mask_registers, prio_registers, sense_registers, 808 .name = "sh7723",
808 ack_registers); 809 .force_enable = ENABLED,
810 .force_disable = DISABLED,
811 .hw = INTC_HW_DESC(vectors, groups, mask_registers,
812 prio_registers, sense_registers, ack_registers),
813};
809 814
810void __init plat_irq_setup(void) 815void __init plat_irq_setup(void)
811{ 816{
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7724.c b/arch/sh/kernel/cpu/sh4a/setup-sh7724.c
index d32f96c1cc15..31e3451f7e3d 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7724.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7724.c
@@ -714,14 +714,17 @@ void __init plat_early_device_setup(void)
714#define RAMCR_CACHE_L2FC 0x0002 714#define RAMCR_CACHE_L2FC 0x0002
715#define RAMCR_CACHE_L2E 0x0001 715#define RAMCR_CACHE_L2E 0x0001
716#define L2_CACHE_ENABLE (RAMCR_CACHE_L2E|RAMCR_CACHE_L2FC) 716#define L2_CACHE_ENABLE (RAMCR_CACHE_L2E|RAMCR_CACHE_L2FC)
717void __uses_jump_to_uncached l2_cache_init(void) 717
718void l2_cache_init(void)
718{ 719{
719 /* Enable L2 cache */ 720 /* Enable L2 cache */
720 ctrl_outl(L2_CACHE_ENABLE, RAMCR); 721 __raw_writel(L2_CACHE_ENABLE, RAMCR);
721} 722}
722 723
723enum { 724enum {
724 UNUSED = 0, 725 UNUSED = 0,
726 ENABLED,
727 DISABLED,
725 728
726 /* interrupt sources */ 729 /* interrupt sources */
727 IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7, 730 IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7,
@@ -750,14 +753,12 @@ enum {
750 ETHI, 753 ETHI,
751 I2C1_ALI, I2C1_TACKI, I2C1_WAITI, I2C1_DTEI, 754 I2C1_ALI, I2C1_TACKI, I2C1_WAITI, I2C1_DTEI,
752 I2C0_ALI, I2C0_TACKI, I2C0_WAITI, I2C0_DTEI, 755 I2C0_ALI, I2C0_TACKI, I2C0_WAITI, I2C0_DTEI,
753 SDHI0_SDHII0, SDHI0_SDHII1, SDHI0_SDHII2, SDHI0_SDHII3,
754 CMT, 756 CMT,
755 TSIF, 757 TSIF,
756 FSI, 758 FSI,
757 SCIFA5, 759 SCIFA5,
758 TMU0_TUNI0, TMU0_TUNI1, TMU0_TUNI2, 760 TMU0_TUNI0, TMU0_TUNI1, TMU0_TUNI2,
759 IRDA, 761 IRDA,
760 SDHI1_SDHII0, SDHI1_SDHII1, SDHI1_SDHII2,
761 JPU, 762 JPU,
762 _2DDMAC, 763 _2DDMAC,
763 MMC_MMC2I, MMC_MMC3I, 764 MMC_MMC2I, MMC_MMC3I,
@@ -839,10 +840,10 @@ static struct intc_vect vectors[] __initdata = {
839 INTC_VECT(I2C0_WAITI, 0xE40), 840 INTC_VECT(I2C0_WAITI, 0xE40),
840 INTC_VECT(I2C0_DTEI, 0xE60), 841 INTC_VECT(I2C0_DTEI, 0xE60),
841 842
842 INTC_VECT(SDHI0_SDHII0, 0xE80), 843 INTC_VECT(SDHI0, 0xE80),
843 INTC_VECT(SDHI0_SDHII1, 0xEA0), 844 INTC_VECT(SDHI0, 0xEA0),
844 INTC_VECT(SDHI0_SDHII2, 0xEC0), 845 INTC_VECT(SDHI0, 0xEC0),
845 INTC_VECT(SDHI0_SDHII3, 0xEE0), 846 INTC_VECT(SDHI0, 0xEE0),
846 847
847 INTC_VECT(CMT, 0xF00), 848 INTC_VECT(CMT, 0xF00),
848 INTC_VECT(TSIF, 0xF20), 849 INTC_VECT(TSIF, 0xF20),
@@ -855,9 +856,9 @@ static struct intc_vect vectors[] __initdata = {
855 856
856 INTC_VECT(IRDA, 0x480), 857 INTC_VECT(IRDA, 0x480),
857 858
858 INTC_VECT(SDHI1_SDHII0, 0x4E0), 859 INTC_VECT(SDHI1, 0x4E0),
859 INTC_VECT(SDHI1_SDHII1, 0x500), 860 INTC_VECT(SDHI1, 0x500),
860 INTC_VECT(SDHI1_SDHII2, 0x520), 861 INTC_VECT(SDHI1, 0x520),
861 862
862 INTC_VECT(JPU, 0x560), 863 INTC_VECT(JPU, 0x560),
863 INTC_VECT(_2DDMAC, 0x4A0), 864 INTC_VECT(_2DDMAC, 0x4A0),
@@ -883,8 +884,6 @@ static struct intc_group groups[] __initdata = {
883 INTC_GROUP(DMAC0B, DMAC0B_DEI4, DMAC0B_DEI5, DMAC0B_DADERR), 884 INTC_GROUP(DMAC0B, DMAC0B_DEI4, DMAC0B_DEI5, DMAC0B_DADERR),
884 INTC_GROUP(I2C0, I2C0_ALI, I2C0_TACKI, I2C0_WAITI, I2C0_DTEI), 885 INTC_GROUP(I2C0, I2C0_ALI, I2C0_TACKI, I2C0_WAITI, I2C0_DTEI),
885 INTC_GROUP(I2C1, I2C1_ALI, I2C1_TACKI, I2C1_WAITI, I2C1_DTEI), 886 INTC_GROUP(I2C1, I2C1_ALI, I2C1_TACKI, I2C1_WAITI, I2C1_DTEI),
886 INTC_GROUP(SDHI0, SDHI0_SDHII0, SDHI0_SDHII1, SDHI0_SDHII2, SDHI0_SDHII3),
887 INTC_GROUP(SDHI1, SDHI1_SDHII0, SDHI1_SDHII1, SDHI1_SDHII2),
888 INTC_GROUP(SPU, SPU_SPUI0, SPU_SPUI1), 887 INTC_GROUP(SPU, SPU_SPUI0, SPU_SPUI1),
889 INTC_GROUP(MMCIF, MMC_MMC2I, MMC_MMC3I), 888 INTC_GROUP(MMCIF, MMC_MMC2I, MMC_MMC3I),
890}; 889};
@@ -892,7 +891,7 @@ static struct intc_group groups[] __initdata = {
892static struct intc_mask_reg mask_registers[] __initdata = { 891static struct intc_mask_reg mask_registers[] __initdata = {
893 { 0xa4080080, 0xa40800c0, 8, /* IMR0 / IMCR0 */ 892 { 0xa4080080, 0xa40800c0, 8, /* IMR0 / IMCR0 */
894 { 0, TMU1_TUNI2, TMU1_TUNI1, TMU1_TUNI0, 893 { 0, TMU1_TUNI2, TMU1_TUNI1, TMU1_TUNI0,
895 0, SDHI1_SDHII2, SDHI1_SDHII1, SDHI1_SDHII0 } }, 894 0, DISABLED, ENABLED, ENABLED } },
896 { 0xa4080084, 0xa40800c4, 8, /* IMR1 / IMCR1 */ 895 { 0xa4080084, 0xa40800c4, 8, /* IMR1 / IMCR1 */
897 { VIO_VOU, VIO_VEU1, VIO_BEU0, VIO_CEU0, 896 { VIO_VOU, VIO_VEU1, VIO_BEU0, VIO_CEU0,
898 DMAC0A_DEI3, DMAC0A_DEI2, DMAC0A_DEI1, DMAC0A_DEI0 } }, 897 DMAC0A_DEI3, DMAC0A_DEI2, DMAC0A_DEI1, DMAC0A_DEI0 } },
@@ -914,7 +913,7 @@ static struct intc_mask_reg mask_registers[] __initdata = {
914 { I2C0_DTEI, I2C0_WAITI, I2C0_TACKI, I2C0_ALI, 913 { I2C0_DTEI, I2C0_WAITI, I2C0_TACKI, I2C0_ALI,
915 I2C1_DTEI, I2C1_WAITI, I2C1_TACKI, I2C1_ALI } }, 914 I2C1_DTEI, I2C1_WAITI, I2C1_TACKI, I2C1_ALI } },
916 { 0xa40800a0, 0xa40800e0, 8, /* IMR8 / IMCR8 */ 915 { 0xa40800a0, 0xa40800e0, 8, /* IMR8 / IMCR8 */
917 { SDHI0_SDHII3, SDHI0_SDHII2, SDHI0_SDHII1, SDHI0_SDHII0, 916 { DISABLED, DISABLED, ENABLED, ENABLED,
918 0, 0, SCIFA5, FSI } }, 917 0, 0, SCIFA5, FSI } },
919 { 0xa40800a4, 0xa40800e4, 8, /* IMR9 / IMCR9 */ 918 { 0xa40800a4, 0xa40800e4, 8, /* IMR9 / IMCR9 */
920 { 0, 0, 0, CMT, 0, USB1, USB0, 0 } }, 919 { 0, 0, 0, CMT, 0, USB1, USB0, 0 } },
@@ -961,9 +960,13 @@ static struct intc_mask_reg ack_registers[] __initdata = {
961 { IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7 } }, 960 { IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7 } },
962}; 961};
963 962
964static DECLARE_INTC_DESC_ACK(intc_desc, "sh7724", vectors, groups, 963static struct intc_desc intc_desc __initdata = {
965 mask_registers, prio_registers, sense_registers, 964 .name = "sh7724",
966 ack_registers); 965 .force_enable = ENABLED,
966 .force_disable = DISABLED,
967 .hw = INTC_HW_DESC(vectors, groups, mask_registers,
968 prio_registers, sense_registers, ack_registers),
969};
967 970
968void __init plat_irq_setup(void) 971void __init plat_irq_setup(void)
969{ 972{
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7757.c b/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
index 37e32efbbaa7..e75edf58796a 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
@@ -487,17 +487,17 @@ static DECLARE_INTC_DESC(intc_desc_irl4567, "sh7757-irl4567", vectors_irl4567,
487void __init plat_irq_setup(void) 487void __init plat_irq_setup(void)
488{ 488{
489 /* disable IRQ3-0 + IRQ7-4 */ 489 /* disable IRQ3-0 + IRQ7-4 */
490 ctrl_outl(0xff000000, INTC_INTMSK0); 490 __raw_writel(0xff000000, INTC_INTMSK0);
491 491
492 /* disable IRL3-0 + IRL7-4 */ 492 /* disable IRL3-0 + IRL7-4 */
493 ctrl_outl(0xc0000000, INTC_INTMSK1); 493 __raw_writel(0xc0000000, INTC_INTMSK1);
494 ctrl_outl(0xfffefffe, INTC_INTMSK2); 494 __raw_writel(0xfffefffe, INTC_INTMSK2);
495 495
496 /* select IRL mode for IRL3-0 + IRL7-4 */ 496 /* select IRL mode for IRL3-0 + IRL7-4 */
497 ctrl_outl(ctrl_inl(INTC_ICR0) & ~0x00c00000, INTC_ICR0); 497 __raw_writel(__raw_readl(INTC_ICR0) & ~0x00c00000, INTC_ICR0);
498 498
499 /* disable holding function, ie enable "SH-4 Mode" */ 499 /* disable holding function, ie enable "SH-4 Mode" */
500 ctrl_outl(ctrl_inl(INTC_ICR0) | 0x00200000, INTC_ICR0); 500 __raw_writel(__raw_readl(INTC_ICR0) | 0x00200000, INTC_ICR0);
501 501
502 register_intc_controller(&intc_desc); 502 register_intc_controller(&intc_desc);
503} 503}
@@ -507,32 +507,32 @@ void __init plat_irq_setup_pins(int mode)
507 switch (mode) { 507 switch (mode) {
508 case IRQ_MODE_IRQ7654: 508 case IRQ_MODE_IRQ7654:
509 /* select IRQ mode for IRL7-4 */ 509 /* select IRQ mode for IRL7-4 */
510 ctrl_outl(ctrl_inl(INTC_ICR0) | 0x00400000, INTC_ICR0); 510 __raw_writel(__raw_readl(INTC_ICR0) | 0x00400000, INTC_ICR0);
511 register_intc_controller(&intc_desc_irq4567); 511 register_intc_controller(&intc_desc_irq4567);
512 break; 512 break;
513 case IRQ_MODE_IRQ3210: 513 case IRQ_MODE_IRQ3210:
514 /* select IRQ mode for IRL3-0 */ 514 /* select IRQ mode for IRL3-0 */
515 ctrl_outl(ctrl_inl(INTC_ICR0) | 0x00800000, INTC_ICR0); 515 __raw_writel(__raw_readl(INTC_ICR0) | 0x00800000, INTC_ICR0);
516 register_intc_controller(&intc_desc_irq0123); 516 register_intc_controller(&intc_desc_irq0123);
517 break; 517 break;
518 case IRQ_MODE_IRL7654: 518 case IRQ_MODE_IRL7654:
519 /* enable IRL7-4 but don't provide any masking */ 519 /* enable IRL7-4 but don't provide any masking */
520 ctrl_outl(0x40000000, INTC_INTMSKCLR1); 520 __raw_writel(0x40000000, INTC_INTMSKCLR1);
521 ctrl_outl(0x0000fffe, INTC_INTMSKCLR2); 521 __raw_writel(0x0000fffe, INTC_INTMSKCLR2);
522 break; 522 break;
523 case IRQ_MODE_IRL3210: 523 case IRQ_MODE_IRL3210:
524 /* enable IRL0-3 but don't provide any masking */ 524 /* enable IRL0-3 but don't provide any masking */
525 ctrl_outl(0x80000000, INTC_INTMSKCLR1); 525 __raw_writel(0x80000000, INTC_INTMSKCLR1);
526 ctrl_outl(0xfffe0000, INTC_INTMSKCLR2); 526 __raw_writel(0xfffe0000, INTC_INTMSKCLR2);
527 break; 527 break;
528 case IRQ_MODE_IRL7654_MASK: 528 case IRQ_MODE_IRL7654_MASK:
529 /* enable IRL7-4 and mask using cpu intc controller */ 529 /* enable IRL7-4 and mask using cpu intc controller */
530 ctrl_outl(0x40000000, INTC_INTMSKCLR1); 530 __raw_writel(0x40000000, INTC_INTMSKCLR1);
531 register_intc_controller(&intc_desc_irl4567); 531 register_intc_controller(&intc_desc_irl4567);
532 break; 532 break;
533 case IRQ_MODE_IRL3210_MASK: 533 case IRQ_MODE_IRL3210_MASK:
534 /* enable IRL0-3 and mask using cpu intc controller */ 534 /* enable IRL0-3 and mask using cpu intc controller */
535 ctrl_outl(0x80000000, INTC_INTMSKCLR1); 535 __raw_writel(0x80000000, INTC_INTMSKCLR1);
536 register_intc_controller(&intc_desc_irl0123); 536 register_intc_controller(&intc_desc_irl0123);
537 break; 537 break;
538 default: 538 default:
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7763.c b/arch/sh/kernel/cpu/sh4a/setup-sh7763.c
index 6aba26fec416..7f6b0a5f7f82 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7763.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7763.c
@@ -538,11 +538,11 @@ static DECLARE_INTC_DESC(intc_irl3210_desc, "sh7763-irl3210", irl_vectors,
538void __init plat_irq_setup(void) 538void __init plat_irq_setup(void)
539{ 539{
540 /* disable IRQ7-0 */ 540 /* disable IRQ7-0 */
541 ctrl_outl(0xff000000, INTC_INTMSK0); 541 __raw_writel(0xff000000, INTC_INTMSK0);
542 542
543 /* disable IRL3-0 + IRL7-4 */ 543 /* disable IRL3-0 + IRL7-4 */
544 ctrl_outl(0xc0000000, INTC_INTMSK1); 544 __raw_writel(0xc0000000, INTC_INTMSK1);
545 ctrl_outl(0xfffefffe, INTC_INTMSK2); 545 __raw_writel(0xfffefffe, INTC_INTMSK2);
546 546
547 register_intc_controller(&intc_desc); 547 register_intc_controller(&intc_desc);
548} 548}
@@ -552,27 +552,27 @@ void __init plat_irq_setup_pins(int mode)
552 switch (mode) { 552 switch (mode) {
553 case IRQ_MODE_IRQ: 553 case IRQ_MODE_IRQ:
554 /* select IRQ mode for IRL3-0 + IRL7-4 */ 554 /* select IRQ mode for IRL3-0 + IRL7-4 */
555 ctrl_outl(ctrl_inl(INTC_ICR0) | 0x00c00000, INTC_ICR0); 555 __raw_writel(__raw_readl(INTC_ICR0) | 0x00c00000, INTC_ICR0);
556 register_intc_controller(&intc_irq_desc); 556 register_intc_controller(&intc_irq_desc);
557 break; 557 break;
558 case IRQ_MODE_IRL7654: 558 case IRQ_MODE_IRL7654:
559 /* enable IRL7-4 but don't provide any masking */ 559 /* enable IRL7-4 but don't provide any masking */
560 ctrl_outl(0x40000000, INTC_INTMSKCLR1); 560 __raw_writel(0x40000000, INTC_INTMSKCLR1);
561 ctrl_outl(0x0000fffe, INTC_INTMSKCLR2); 561 __raw_writel(0x0000fffe, INTC_INTMSKCLR2);
562 break; 562 break;
563 case IRQ_MODE_IRL3210: 563 case IRQ_MODE_IRL3210:
564 /* enable IRL0-3 but don't provide any masking */ 564 /* enable IRL0-3 but don't provide any masking */
565 ctrl_outl(0x80000000, INTC_INTMSKCLR1); 565 __raw_writel(0x80000000, INTC_INTMSKCLR1);
566 ctrl_outl(0xfffe0000, INTC_INTMSKCLR2); 566 __raw_writel(0xfffe0000, INTC_INTMSKCLR2);
567 break; 567 break;
568 case IRQ_MODE_IRL7654_MASK: 568 case IRQ_MODE_IRL7654_MASK:
569 /* enable IRL7-4 and mask using cpu intc controller */ 569 /* enable IRL7-4 and mask using cpu intc controller */
570 ctrl_outl(0x40000000, INTC_INTMSKCLR1); 570 __raw_writel(0x40000000, INTC_INTMSKCLR1);
571 register_intc_controller(&intc_irl7654_desc); 571 register_intc_controller(&intc_irl7654_desc);
572 break; 572 break;
573 case IRQ_MODE_IRL3210_MASK: 573 case IRQ_MODE_IRL3210_MASK:
574 /* enable IRL0-3 and mask using cpu intc controller */ 574 /* enable IRL0-3 and mask using cpu intc controller */
575 ctrl_outl(0x80000000, INTC_INTMSKCLR1); 575 __raw_writel(0x80000000, INTC_INTMSKCLR1);
576 register_intc_controller(&intc_irl3210_desc); 576 register_intc_controller(&intc_irl3210_desc);
577 break; 577 break;
578 default: 578 default:
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7770.c b/arch/sh/kernel/cpu/sh4a/setup-sh7770.c
index c1643bc9590d..86d681ecf90e 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7770.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7770.c
@@ -694,17 +694,17 @@ static DECLARE_INTC_DESC(intc_irl3210_desc, "sh7780-irl3210", irl_vectors,
694void __init plat_irq_setup(void) 694void __init plat_irq_setup(void)
695{ 695{
696 /* disable IRQ7-0 */ 696 /* disable IRQ7-0 */
697 ctrl_outl(0xff000000, INTC_INTMSK0); 697 __raw_writel(0xff000000, INTC_INTMSK0);
698 698
699 /* disable IRL3-0 + IRL7-4 */ 699 /* disable IRL3-0 + IRL7-4 */
700 ctrl_outl(0xc0000000, INTC_INTMSK1); 700 __raw_writel(0xc0000000, INTC_INTMSK1);
701 ctrl_outl(0xfffefffe, INTC_INTMSK2); 701 __raw_writel(0xfffefffe, INTC_INTMSK2);
702 702
703 /* select IRL mode for IRL3-0 + IRL7-4 */ 703 /* select IRL mode for IRL3-0 + IRL7-4 */
704 ctrl_outl(ctrl_inl(INTC_ICR0) & ~0x00c00000, INTC_ICR0); 704 __raw_writel(__raw_readl(INTC_ICR0) & ~0x00c00000, INTC_ICR0);
705 705
706 /* disable holding function, ie enable "SH-4 Mode" */ 706 /* disable holding function, ie enable "SH-4 Mode" */
707 ctrl_outl(ctrl_inl(INTC_ICR0) | 0x00200000, INTC_ICR0); 707 __raw_writel(__raw_readl(INTC_ICR0) | 0x00200000, INTC_ICR0);
708 708
709 register_intc_controller(&intc_desc); 709 register_intc_controller(&intc_desc);
710} 710}
@@ -714,27 +714,27 @@ void __init plat_irq_setup_pins(int mode)
714 switch (mode) { 714 switch (mode) {
715 case IRQ_MODE_IRQ: 715 case IRQ_MODE_IRQ:
716 /* select IRQ mode for IRL3-0 + IRL7-4 */ 716 /* select IRQ mode for IRL3-0 + IRL7-4 */
717 ctrl_outl(ctrl_inl(INTC_ICR0) | 0x00c00000, INTC_ICR0); 717 __raw_writel(__raw_readl(INTC_ICR0) | 0x00c00000, INTC_ICR0);
718 register_intc_controller(&intc_irq_desc); 718 register_intc_controller(&intc_irq_desc);
719 break; 719 break;
720 case IRQ_MODE_IRL7654: 720 case IRQ_MODE_IRL7654:
721 /* enable IRL7-4 but don't provide any masking */ 721 /* enable IRL7-4 but don't provide any masking */
722 ctrl_outl(0x40000000, INTC_INTMSKCLR1); 722 __raw_writel(0x40000000, INTC_INTMSKCLR1);
723 ctrl_outl(0x0000fffe, INTC_INTMSKCLR2); 723 __raw_writel(0x0000fffe, INTC_INTMSKCLR2);
724 break; 724 break;
725 case IRQ_MODE_IRL3210: 725 case IRQ_MODE_IRL3210:
726 /* enable IRL0-3 but don't provide any masking */ 726 /* enable IRL0-3 but don't provide any masking */
727 ctrl_outl(0x80000000, INTC_INTMSKCLR1); 727 __raw_writel(0x80000000, INTC_INTMSKCLR1);
728 ctrl_outl(0xfffe0000, INTC_INTMSKCLR2); 728 __raw_writel(0xfffe0000, INTC_INTMSKCLR2);
729 break; 729 break;
730 case IRQ_MODE_IRL7654_MASK: 730 case IRQ_MODE_IRL7654_MASK:
731 /* enable IRL7-4 and mask using cpu intc controller */ 731 /* enable IRL7-4 and mask using cpu intc controller */
732 ctrl_outl(0x40000000, INTC_INTMSKCLR1); 732 __raw_writel(0x40000000, INTC_INTMSKCLR1);
733 register_intc_controller(&intc_irl7654_desc); 733 register_intc_controller(&intc_irl7654_desc);
734 break; 734 break;
735 case IRQ_MODE_IRL3210_MASK: 735 case IRQ_MODE_IRL3210_MASK:
736 /* enable IRL0-3 and mask using cpu intc controller */ 736 /* enable IRL0-3 and mask using cpu intc controller */
737 ctrl_outl(0x80000000, INTC_INTMSKCLR1); 737 __raw_writel(0x80000000, INTC_INTMSKCLR1);
738 register_intc_controller(&intc_irl3210_desc); 738 register_intc_controller(&intc_irl3210_desc);
739 break; 739 break;
740 default: 740 default:
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7780.c b/arch/sh/kernel/cpu/sh4a/setup-sh7780.c
index c310558490d5..f8f21618d785 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7780.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7780.c
@@ -461,17 +461,17 @@ static DECLARE_INTC_DESC(intc_irl3210_desc, "sh7780-irl3210", irl_vectors,
461void __init plat_irq_setup(void) 461void __init plat_irq_setup(void)
462{ 462{
463 /* disable IRQ7-0 */ 463 /* disable IRQ7-0 */
464 ctrl_outl(0xff000000, INTC_INTMSK0); 464 __raw_writel(0xff000000, INTC_INTMSK0);
465 465
466 /* disable IRL3-0 + IRL7-4 */ 466 /* disable IRL3-0 + IRL7-4 */
467 ctrl_outl(0xc0000000, INTC_INTMSK1); 467 __raw_writel(0xc0000000, INTC_INTMSK1);
468 ctrl_outl(0xfffefffe, INTC_INTMSK2); 468 __raw_writel(0xfffefffe, INTC_INTMSK2);
469 469
470 /* select IRL mode for IRL3-0 + IRL7-4 */ 470 /* select IRL mode for IRL3-0 + IRL7-4 */
471 ctrl_outl(ctrl_inl(INTC_ICR0) & ~0x00c00000, INTC_ICR0); 471 __raw_writel(__raw_readl(INTC_ICR0) & ~0x00c00000, INTC_ICR0);
472 472
473 /* disable holding function, ie enable "SH-4 Mode" */ 473 /* disable holding function, ie enable "SH-4 Mode" */
474 ctrl_outl(ctrl_inl(INTC_ICR0) | 0x00200000, INTC_ICR0); 474 __raw_writel(__raw_readl(INTC_ICR0) | 0x00200000, INTC_ICR0);
475 475
476 register_intc_controller(&intc_desc); 476 register_intc_controller(&intc_desc);
477} 477}
@@ -481,27 +481,27 @@ void __init plat_irq_setup_pins(int mode)
481 switch (mode) { 481 switch (mode) {
482 case IRQ_MODE_IRQ: 482 case IRQ_MODE_IRQ:
483 /* select IRQ mode for IRL3-0 + IRL7-4 */ 483 /* select IRQ mode for IRL3-0 + IRL7-4 */
484 ctrl_outl(ctrl_inl(INTC_ICR0) | 0x00c00000, INTC_ICR0); 484 __raw_writel(__raw_readl(INTC_ICR0) | 0x00c00000, INTC_ICR0);
485 register_intc_controller(&intc_irq_desc); 485 register_intc_controller(&intc_irq_desc);
486 break; 486 break;
487 case IRQ_MODE_IRL7654: 487 case IRQ_MODE_IRL7654:
488 /* enable IRL7-4 but don't provide any masking */ 488 /* enable IRL7-4 but don't provide any masking */
489 ctrl_outl(0x40000000, INTC_INTMSKCLR1); 489 __raw_writel(0x40000000, INTC_INTMSKCLR1);
490 ctrl_outl(0x0000fffe, INTC_INTMSKCLR2); 490 __raw_writel(0x0000fffe, INTC_INTMSKCLR2);
491 break; 491 break;
492 case IRQ_MODE_IRL3210: 492 case IRQ_MODE_IRL3210:
493 /* enable IRL0-3 but don't provide any masking */ 493 /* enable IRL0-3 but don't provide any masking */
494 ctrl_outl(0x80000000, INTC_INTMSKCLR1); 494 __raw_writel(0x80000000, INTC_INTMSKCLR1);
495 ctrl_outl(0xfffe0000, INTC_INTMSKCLR2); 495 __raw_writel(0xfffe0000, INTC_INTMSKCLR2);
496 break; 496 break;
497 case IRQ_MODE_IRL7654_MASK: 497 case IRQ_MODE_IRL7654_MASK:
498 /* enable IRL7-4 and mask using cpu intc controller */ 498 /* enable IRL7-4 and mask using cpu intc controller */
499 ctrl_outl(0x40000000, INTC_INTMSKCLR1); 499 __raw_writel(0x40000000, INTC_INTMSKCLR1);
500 register_intc_controller(&intc_irl7654_desc); 500 register_intc_controller(&intc_irl7654_desc);
501 break; 501 break;
502 case IRQ_MODE_IRL3210_MASK: 502 case IRQ_MODE_IRL3210_MASK:
503 /* enable IRL0-3 and mask using cpu intc controller */ 503 /* enable IRL0-3 and mask using cpu intc controller */
504 ctrl_outl(0x80000000, INTC_INTMSKCLR1); 504 __raw_writel(0x80000000, INTC_INTMSKCLR1);
505 register_intc_controller(&intc_irl3210_desc); 505 register_intc_controller(&intc_irl3210_desc);
506 break; 506 break;
507 default: 507 default:
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7785.c b/arch/sh/kernel/cpu/sh4a/setup-sh7785.c
index f685b9b21999..23448d8c6711 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7785.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7785.c
@@ -541,17 +541,17 @@ static DECLARE_INTC_DESC(intc_desc_irl4567, "sh7785-irl4567", vectors_irl4567,
541void __init plat_irq_setup(void) 541void __init plat_irq_setup(void)
542{ 542{
543 /* disable IRQ3-0 + IRQ7-4 */ 543 /* disable IRQ3-0 + IRQ7-4 */
544 ctrl_outl(0xff000000, INTC_INTMSK0); 544 __raw_writel(0xff000000, INTC_INTMSK0);
545 545
546 /* disable IRL3-0 + IRL7-4 */ 546 /* disable IRL3-0 + IRL7-4 */
547 ctrl_outl(0xc0000000, INTC_INTMSK1); 547 __raw_writel(0xc0000000, INTC_INTMSK1);
548 ctrl_outl(0xfffefffe, INTC_INTMSK2); 548 __raw_writel(0xfffefffe, INTC_INTMSK2);
549 549
550 /* select IRL mode for IRL3-0 + IRL7-4 */ 550 /* select IRL mode for IRL3-0 + IRL7-4 */
551 ctrl_outl(ctrl_inl(INTC_ICR0) & ~0x00c00000, INTC_ICR0); 551 __raw_writel(__raw_readl(INTC_ICR0) & ~0x00c00000, INTC_ICR0);
552 552
553 /* disable holding function, ie enable "SH-4 Mode" */ 553 /* disable holding function, ie enable "SH-4 Mode" */
554 ctrl_outl(ctrl_inl(INTC_ICR0) | 0x00200000, INTC_ICR0); 554 __raw_writel(__raw_readl(INTC_ICR0) | 0x00200000, INTC_ICR0);
555 555
556 register_intc_controller(&intc_desc); 556 register_intc_controller(&intc_desc);
557} 557}
@@ -561,32 +561,32 @@ void __init plat_irq_setup_pins(int mode)
561 switch (mode) { 561 switch (mode) {
562 case IRQ_MODE_IRQ7654: 562 case IRQ_MODE_IRQ7654:
563 /* select IRQ mode for IRL7-4 */ 563 /* select IRQ mode for IRL7-4 */
564 ctrl_outl(ctrl_inl(INTC_ICR0) | 0x00400000, INTC_ICR0); 564 __raw_writel(__raw_readl(INTC_ICR0) | 0x00400000, INTC_ICR0);
565 register_intc_controller(&intc_desc_irq4567); 565 register_intc_controller(&intc_desc_irq4567);
566 break; 566 break;
567 case IRQ_MODE_IRQ3210: 567 case IRQ_MODE_IRQ3210:
568 /* select IRQ mode for IRL3-0 */ 568 /* select IRQ mode for IRL3-0 */
569 ctrl_outl(ctrl_inl(INTC_ICR0) | 0x00800000, INTC_ICR0); 569 __raw_writel(__raw_readl(INTC_ICR0) | 0x00800000, INTC_ICR0);
570 register_intc_controller(&intc_desc_irq0123); 570 register_intc_controller(&intc_desc_irq0123);
571 break; 571 break;
572 case IRQ_MODE_IRL7654: 572 case IRQ_MODE_IRL7654:
573 /* enable IRL7-4 but don't provide any masking */ 573 /* enable IRL7-4 but don't provide any masking */
574 ctrl_outl(0x40000000, INTC_INTMSKCLR1); 574 __raw_writel(0x40000000, INTC_INTMSKCLR1);
575 ctrl_outl(0x0000fffe, INTC_INTMSKCLR2); 575 __raw_writel(0x0000fffe, INTC_INTMSKCLR2);
576 break; 576 break;
577 case IRQ_MODE_IRL3210: 577 case IRQ_MODE_IRL3210:
578 /* enable IRL0-3 but don't provide any masking */ 578 /* enable IRL0-3 but don't provide any masking */
579 ctrl_outl(0x80000000, INTC_INTMSKCLR1); 579 __raw_writel(0x80000000, INTC_INTMSKCLR1);
580 ctrl_outl(0xfffe0000, INTC_INTMSKCLR2); 580 __raw_writel(0xfffe0000, INTC_INTMSKCLR2);
581 break; 581 break;
582 case IRQ_MODE_IRL7654_MASK: 582 case IRQ_MODE_IRL7654_MASK:
583 /* enable IRL7-4 and mask using cpu intc controller */ 583 /* enable IRL7-4 and mask using cpu intc controller */
584 ctrl_outl(0x40000000, INTC_INTMSKCLR1); 584 __raw_writel(0x40000000, INTC_INTMSKCLR1);
585 register_intc_controller(&intc_desc_irl4567); 585 register_intc_controller(&intc_desc_irl4567);
586 break; 586 break;
587 case IRQ_MODE_IRL3210_MASK: 587 case IRQ_MODE_IRL3210_MASK:
588 /* enable IRL0-3 and mask using cpu intc controller */ 588 /* enable IRL0-3 and mask using cpu intc controller */
589 ctrl_outl(0x80000000, INTC_INTMSKCLR1); 589 __raw_writel(0x80000000, INTC_INTMSKCLR1);
590 register_intc_controller(&intc_desc_irl0123); 590 register_intc_controller(&intc_desc_irl0123);
591 break; 591 break;
592 default: 592 default:
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7786.c b/arch/sh/kernel/cpu/sh4a/setup-sh7786.c
index 71673487ace0..7e585320710a 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7786.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7786.c
@@ -867,14 +867,14 @@ static DECLARE_INTC_DESC(intc_desc_irl4567, "sh7786-irl4567", vectors_irl4567,
867void __init plat_irq_setup(void) 867void __init plat_irq_setup(void)
868{ 868{
869 /* disable IRQ3-0 + IRQ7-4 */ 869 /* disable IRQ3-0 + IRQ7-4 */
870 ctrl_outl(0xff000000, INTC_INTMSK0); 870 __raw_writel(0xff000000, INTC_INTMSK0);
871 871
872 /* disable IRL3-0 + IRL7-4 */ 872 /* disable IRL3-0 + IRL7-4 */
873 ctrl_outl(0xc0000000, INTC_INTMSK1); 873 __raw_writel(0xc0000000, INTC_INTMSK1);
874 ctrl_outl(0xfffefffe, INTC_INTMSK2); 874 __raw_writel(0xfffefffe, INTC_INTMSK2);
875 875
876 /* select IRL mode for IRL3-0 + IRL7-4 */ 876 /* select IRL mode for IRL3-0 + IRL7-4 */
877 ctrl_outl(ctrl_inl(INTC_ICR0) & ~0x00c00000, INTC_ICR0); 877 __raw_writel(__raw_readl(INTC_ICR0) & ~0x00c00000, INTC_ICR0);
878 878
879 register_intc_controller(&intc_desc); 879 register_intc_controller(&intc_desc);
880} 880}
@@ -884,32 +884,32 @@ void __init plat_irq_setup_pins(int mode)
884 switch (mode) { 884 switch (mode) {
885 case IRQ_MODE_IRQ7654: 885 case IRQ_MODE_IRQ7654:
886 /* select IRQ mode for IRL7-4 */ 886 /* select IRQ mode for IRL7-4 */
887 ctrl_outl(ctrl_inl(INTC_ICR0) | 0x00400000, INTC_ICR0); 887 __raw_writel(__raw_readl(INTC_ICR0) | 0x00400000, INTC_ICR0);
888 register_intc_controller(&intc_desc_irq4567); 888 register_intc_controller(&intc_desc_irq4567);
889 break; 889 break;
890 case IRQ_MODE_IRQ3210: 890 case IRQ_MODE_IRQ3210:
891 /* select IRQ mode for IRL3-0 */ 891 /* select IRQ mode for IRL3-0 */
892 ctrl_outl(ctrl_inl(INTC_ICR0) | 0x00800000, INTC_ICR0); 892 __raw_writel(__raw_readl(INTC_ICR0) | 0x00800000, INTC_ICR0);
893 register_intc_controller(&intc_desc_irq0123); 893 register_intc_controller(&intc_desc_irq0123);
894 break; 894 break;
895 case IRQ_MODE_IRL7654: 895 case IRQ_MODE_IRL7654:
896 /* enable IRL7-4 but don't provide any masking */ 896 /* enable IRL7-4 but don't provide any masking */
897 ctrl_outl(0x40000000, INTC_INTMSKCLR1); 897 __raw_writel(0x40000000, INTC_INTMSKCLR1);
898 ctrl_outl(0x0000fffe, INTC_INTMSKCLR2); 898 __raw_writel(0x0000fffe, INTC_INTMSKCLR2);
899 break; 899 break;
900 case IRQ_MODE_IRL3210: 900 case IRQ_MODE_IRL3210:
901 /* enable IRL0-3 but don't provide any masking */ 901 /* enable IRL0-3 but don't provide any masking */
902 ctrl_outl(0x80000000, INTC_INTMSKCLR1); 902 __raw_writel(0x80000000, INTC_INTMSKCLR1);
903 ctrl_outl(0xfffe0000, INTC_INTMSKCLR2); 903 __raw_writel(0xfffe0000, INTC_INTMSKCLR2);
904 break; 904 break;
905 case IRQ_MODE_IRL7654_MASK: 905 case IRQ_MODE_IRL7654_MASK:
906 /* enable IRL7-4 and mask using cpu intc controller */ 906 /* enable IRL7-4 and mask using cpu intc controller */
907 ctrl_outl(0x40000000, INTC_INTMSKCLR1); 907 __raw_writel(0x40000000, INTC_INTMSKCLR1);
908 register_intc_controller(&intc_desc_irl4567); 908 register_intc_controller(&intc_desc_irl4567);
909 break; 909 break;
910 case IRQ_MODE_IRL3210_MASK: 910 case IRQ_MODE_IRL3210_MASK:
911 /* enable IRL0-3 and mask using cpu intc controller */ 911 /* enable IRL0-3 and mask using cpu intc controller */
912 ctrl_outl(0x80000000, INTC_INTMSKCLR1); 912 __raw_writel(0x80000000, INTC_INTMSKCLR1);
913 register_intc_controller(&intc_desc_irl0123); 913 register_intc_controller(&intc_desc_irl0123);
914 break; 914 break;
915 default: 915 default:
diff --git a/arch/sh/kernel/cpu/sh4a/smp-shx3.c b/arch/sh/kernel/cpu/sh4a/smp-shx3.c
index 5863e0c4d02f..11bf4c1e25c0 100644
--- a/arch/sh/kernel/cpu/sh4a/smp-shx3.c
+++ b/arch/sh/kernel/cpu/sh4a/smp-shx3.c
@@ -78,7 +78,10 @@ void __init plat_prepare_cpus(unsigned int max_cpus)
78 78
79void plat_start_cpu(unsigned int cpu, unsigned long entry_point) 79void plat_start_cpu(unsigned int cpu, unsigned long entry_point)
80{ 80{
81 __raw_writel(entry_point, RESET_REG(cpu)); 81 if (__in_29bit_mode())
82 __raw_writel(entry_point, RESET_REG(cpu));
83 else
84 __raw_writel(virt_to_phys(entry_point), RESET_REG(cpu));
82 85
83 if (!(__raw_readl(STBCR_REG(cpu)) & STBCR_MSTP)) 86 if (!(__raw_readl(STBCR_REG(cpu)) & STBCR_MSTP))
84 __raw_writel(STBCR_MSTP, STBCR_REG(cpu)); 87 __raw_writel(STBCR_MSTP, STBCR_REG(cpu));
diff --git a/arch/sh/kernel/cpu/sh4a/ubc.c b/arch/sh/kernel/cpu/sh4a/ubc.c
new file mode 100644
index 000000000000..efb2745bcb36
--- /dev/null
+++ b/arch/sh/kernel/cpu/sh4a/ubc.c
@@ -0,0 +1,133 @@
1/*
2 * arch/sh/kernel/cpu/sh4a/ubc.c
3 *
4 * On-chip UBC support for SH-4A CPUs.
5 *
6 * Copyright (C) 2009 - 2010 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/init.h>
13#include <linux/err.h>
14#include <linux/clk.h>
15#include <linux/io.h>
16#include <asm/hw_breakpoint.h>
17
18#define UBC_CBR(idx) (0xff200000 + (0x20 * idx))
19#define UBC_CRR(idx) (0xff200004 + (0x20 * idx))
20#define UBC_CAR(idx) (0xff200008 + (0x20 * idx))
21#define UBC_CAMR(idx) (0xff20000c + (0x20 * idx))
22
23#define UBC_CCMFR 0xff200600
24#define UBC_CBCR 0xff200620
25
26/* CRR */
27#define UBC_CRR_PCB (1 << 1)
28#define UBC_CRR_BIE (1 << 0)
29
30/* CBR */
31#define UBC_CBR_CE (1 << 0)
32
33static struct sh_ubc sh4a_ubc;
34
35static void sh4a_ubc_enable(struct arch_hw_breakpoint *info, int idx)
36{
37 __raw_writel(UBC_CBR_CE | info->len | info->type, UBC_CBR(idx));
38 __raw_writel(info->address, UBC_CAR(idx));
39}
40
41static void sh4a_ubc_disable(struct arch_hw_breakpoint *info, int idx)
42{
43 __raw_writel(0, UBC_CBR(idx));
44 __raw_writel(0, UBC_CAR(idx));
45}
46
47static void sh4a_ubc_enable_all(unsigned long mask)
48{
49 int i;
50
51 for (i = 0; i < sh4a_ubc.num_events; i++)
52 if (mask & (1 << i))
53 __raw_writel(__raw_readl(UBC_CBR(i)) | UBC_CBR_CE,
54 UBC_CBR(i));
55}
56
57static void sh4a_ubc_disable_all(void)
58{
59 int i;
60
61 for (i = 0; i < sh4a_ubc.num_events; i++)
62 __raw_writel(__raw_readl(UBC_CBR(i)) & ~UBC_CBR_CE,
63 UBC_CBR(i));
64}
65
66static unsigned long sh4a_ubc_active_mask(void)
67{
68 unsigned long active = 0;
69 int i;
70
71 for (i = 0; i < sh4a_ubc.num_events; i++)
72 if (__raw_readl(UBC_CBR(i)) & UBC_CBR_CE)
73 active |= (1 << i);
74
75 return active;
76}
77
78static unsigned long sh4a_ubc_triggered_mask(void)
79{
80 return __raw_readl(UBC_CCMFR);
81}
82
83static void sh4a_ubc_clear_triggered_mask(unsigned long mask)
84{
85 __raw_writel(__raw_readl(UBC_CCMFR) & ~mask, UBC_CCMFR);
86}
87
88static struct sh_ubc sh4a_ubc = {
89 .name = "SH-4A",
90 .num_events = 2,
91 .trap_nr = 0x1e0,
92 .enable = sh4a_ubc_enable,
93 .disable = sh4a_ubc_disable,
94 .enable_all = sh4a_ubc_enable_all,
95 .disable_all = sh4a_ubc_disable_all,
96 .active_mask = sh4a_ubc_active_mask,
97 .triggered_mask = sh4a_ubc_triggered_mask,
98 .clear_triggered_mask = sh4a_ubc_clear_triggered_mask,
99};
100
101static int __init sh4a_ubc_init(void)
102{
103 struct clk *ubc_iclk = clk_get(NULL, "ubc0");
104 int i;
105
106 /*
107 * The UBC MSTP bit is optional, as not all platforms will have
108 * it. Just ignore it if we can't find it.
109 */
110 if (IS_ERR(ubc_iclk))
111 ubc_iclk = NULL;
112
113 clk_enable(ubc_iclk);
114
115 __raw_writel(0, UBC_CBCR);
116
117 for (i = 0; i < sh4a_ubc.num_events; i++) {
118 __raw_writel(0, UBC_CAMR(i));
119 __raw_writel(0, UBC_CBR(i));
120
121 __raw_writel(UBC_CRR_BIE | UBC_CRR_PCB, UBC_CRR(i));
122
123 /* dummy read for write posting */
124 (void)__raw_readl(UBC_CRR(i));
125 }
126
127 clk_disable(ubc_iclk);
128
129 sh4a_ubc.clk = ubc_iclk;
130
131 return register_sh_ubc(&sh4a_ubc);
132}
133arch_initcall(sh4a_ubc_init);
diff --git a/arch/sh/kernel/cpu/sh5/clock-sh5.c b/arch/sh/kernel/cpu/sh5/clock-sh5.c
index 7f864ebc51d3..9cfc19b8dbe4 100644
--- a/arch/sh/kernel/cpu/sh5/clock-sh5.c
+++ b/arch/sh/kernel/cpu/sh5/clock-sh5.c
@@ -24,7 +24,7 @@ static unsigned long cprc_base;
24 24
25static void master_clk_init(struct clk *clk) 25static void master_clk_init(struct clk *clk)
26{ 26{
27 int idx = (ctrl_inl(cprc_base + 0x00) >> 6) & 0x0007; 27 int idx = (__raw_readl(cprc_base + 0x00) >> 6) & 0x0007;
28 clk->rate *= ifc_table[idx]; 28 clk->rate *= ifc_table[idx];
29} 29}
30 30
@@ -34,7 +34,7 @@ static struct clk_ops sh5_master_clk_ops = {
34 34
35static unsigned long module_clk_recalc(struct clk *clk) 35static unsigned long module_clk_recalc(struct clk *clk)
36{ 36{
37 int idx = (ctrl_inw(cprc_base) >> 12) & 0x0007; 37 int idx = (__raw_readw(cprc_base) >> 12) & 0x0007;
38 return clk->parent->rate / ifc_table[idx]; 38 return clk->parent->rate / ifc_table[idx];
39} 39}
40 40
@@ -44,7 +44,7 @@ static struct clk_ops sh5_module_clk_ops = {
44 44
45static unsigned long bus_clk_recalc(struct clk *clk) 45static unsigned long bus_clk_recalc(struct clk *clk)
46{ 46{
47 int idx = (ctrl_inw(cprc_base) >> 3) & 0x0007; 47 int idx = (__raw_readw(cprc_base) >> 3) & 0x0007;
48 return clk->parent->rate / ifc_table[idx]; 48 return clk->parent->rate / ifc_table[idx];
49} 49}
50 50
@@ -54,7 +54,7 @@ static struct clk_ops sh5_bus_clk_ops = {
54 54
55static unsigned long cpu_clk_recalc(struct clk *clk) 55static unsigned long cpu_clk_recalc(struct clk *clk)
56{ 56{
57 int idx = (ctrl_inw(cprc_base) & 0x0007); 57 int idx = (__raw_readw(cprc_base) & 0x0007);
58 return clk->parent->rate / ifc_table[idx]; 58 return clk->parent->rate / ifc_table[idx];
59} 59}
60 60
diff --git a/arch/sh/kernel/cpu/sh5/entry.S b/arch/sh/kernel/cpu/sh5/entry.S
index 8f13f73cb2cb..6b80295dd7a4 100644
--- a/arch/sh/kernel/cpu/sh5/entry.S
+++ b/arch/sh/kernel/cpu/sh5/entry.S
@@ -187,7 +187,7 @@ trap_jtable:
187 .rept 6 187 .rept 6
188 .long do_exception_error /* 0x880 - 0x920 */ 188 .long do_exception_error /* 0x880 - 0x920 */
189 .endr 189 .endr
190 .long do_software_break_point /* 0x940 */ 190 .long breakpoint_trap_handler /* 0x940 */
191 .long do_exception_error /* 0x960 */ 191 .long do_exception_error /* 0x960 */
192 .long do_single_step /* 0x980 */ 192 .long do_single_step /* 0x980 */
193 193
@@ -1124,7 +1124,7 @@ fpu_error_or_IRQA:
1124 pta its_IRQ, tr0 1124 pta its_IRQ, tr0
1125 beqi/l r4, EVENT_INTERRUPT, tr0 1125 beqi/l r4, EVENT_INTERRUPT, tr0
1126#ifdef CONFIG_SH_FPU 1126#ifdef CONFIG_SH_FPU
1127 movi do_fpu_state_restore, r6 1127 movi fpu_state_restore_trap_handler, r6
1128#else 1128#else
1129 movi do_exception_error, r6 1129 movi do_exception_error, r6
1130#endif 1130#endif
@@ -1135,7 +1135,7 @@ fpu_error_or_IRQB:
1135 pta its_IRQ, tr0 1135 pta its_IRQ, tr0
1136 beqi/l r4, EVENT_INTERRUPT, tr0 1136 beqi/l r4, EVENT_INTERRUPT, tr0
1137#ifdef CONFIG_SH_FPU 1137#ifdef CONFIG_SH_FPU
1138 movi do_fpu_state_restore, r6 1138 movi fpu_state_restore_trap_handler, r6
1139#else 1139#else
1140 movi do_exception_error, r6 1140 movi do_exception_error, r6
1141#endif 1141#endif
diff --git a/arch/sh/kernel/cpu/sh5/fpu.c b/arch/sh/kernel/cpu/sh5/fpu.c
index 4648ccee6c4d..4b3bb35e99f3 100644
--- a/arch/sh/kernel/cpu/sh5/fpu.c
+++ b/arch/sh/kernel/cpu/sh5/fpu.c
@@ -15,24 +15,6 @@
15#include <linux/sched.h> 15#include <linux/sched.h>
16#include <linux/signal.h> 16#include <linux/signal.h>
17#include <asm/processor.h> 17#include <asm/processor.h>
18#include <asm/user.h>
19#include <asm/io.h>
20#include <asm/fpu.h>
21
22/*
23 * Initially load the FPU with signalling NANS. This bit pattern
24 * has the property that no matter whether considered as single or as
25 * double precision, it still represents a signalling NAN.
26 */
27#define sNAN64 0xFFFFFFFFFFFFFFFFULL
28#define sNAN32 0xFFFFFFFFUL
29
30static union sh_fpu_union init_fpuregs = {
31 .hard = {
32 .fp_regs = { [0 ... 63] = sNAN32 },
33 .fpscr = FPSCR_INIT
34 }
35};
36 18
37void save_fpu(struct task_struct *tsk) 19void save_fpu(struct task_struct *tsk)
38{ 20{
@@ -72,12 +54,11 @@ void save_fpu(struct task_struct *tsk)
72 "fgetscr fr63\n\t" 54 "fgetscr fr63\n\t"
73 "fst.s %0, (32*8), fr63\n\t" 55 "fst.s %0, (32*8), fr63\n\t"
74 : /* no output */ 56 : /* no output */
75 : "r" (&tsk->thread.fpu.hard) 57 : "r" (&tsk->thread.xstate->hardfpu)
76 : "memory"); 58 : "memory");
77} 59}
78 60
79static inline void 61void restore_fpu(struct task_struct *tsk)
80fpload(struct sh_fpu_hard_struct *fpregs)
81{ 62{
82 asm volatile("fld.p %0, (0*8), fp0\n\t" 63 asm volatile("fld.p %0, (0*8), fp0\n\t"
83 "fld.p %0, (1*8), fp2\n\t" 64 "fld.p %0, (1*8), fp2\n\t"
@@ -116,16 +97,11 @@ fpload(struct sh_fpu_hard_struct *fpregs)
116 97
117 "fld.p %0, (31*8), fp62\n\t" 98 "fld.p %0, (31*8), fp62\n\t"
118 : /* no output */ 99 : /* no output */
119 : "r" (fpregs) ); 100 : "r" (&tsk->thread.xstate->hardfpu)
120} 101 : "memory");
121
122void fpinit(struct sh_fpu_hard_struct *fpregs)
123{
124 *fpregs = init_fpuregs.hard;
125} 102}
126 103
127asmlinkage void 104asmlinkage void do_fpu_error(unsigned long ex, struct pt_regs *regs)
128do_fpu_error(unsigned long ex, struct pt_regs *regs)
129{ 105{
130 struct task_struct *tsk = current; 106 struct task_struct *tsk = current;
131 107
@@ -133,35 +109,6 @@ do_fpu_error(unsigned long ex, struct pt_regs *regs)
133 109
134 tsk->thread.trap_no = 11; 110 tsk->thread.trap_no = 11;
135 tsk->thread.error_code = 0; 111 tsk->thread.error_code = 0;
136 force_sig(SIGFPE, tsk);
137}
138
139
140asmlinkage void
141do_fpu_state_restore(unsigned long ex, struct pt_regs *regs)
142{
143 void die(const char *str, struct pt_regs *regs, long err);
144
145 if (! user_mode(regs))
146 die("FPU used in kernel", regs, ex);
147 112
148 regs->sr &= ~SR_FD; 113 force_sig(SIGFPE, tsk);
149
150 if (last_task_used_math == current)
151 return;
152
153 enable_fpu();
154 if (last_task_used_math != NULL)
155 /* Other processes fpu state, save away */
156 save_fpu(last_task_used_math);
157
158 last_task_used_math = current;
159 if (used_math()) {
160 fpload(&current->thread.fpu.hard);
161 } else {
162 /* First time FPU user. */
163 fpload(&init_fpuregs.hard);
164 set_used_math();
165 }
166 disable_fpu();
167} 114}
diff --git a/arch/sh/kernel/cpu/shmobile/pm.c b/arch/sh/kernel/cpu/shmobile/pm.c
index ca029a44743c..e55968712706 100644
--- a/arch/sh/kernel/cpu/shmobile/pm.c
+++ b/arch/sh/kernel/cpu/shmobile/pm.c
@@ -33,7 +33,8 @@ ATOMIC_NOTIFIER_HEAD(sh_mobile_post_sleep_notifier_list);
33#define SUSP_MODE_SLEEP (SUSP_SH_SLEEP) 33#define SUSP_MODE_SLEEP (SUSP_SH_SLEEP)
34#define SUSP_MODE_SLEEP_SF (SUSP_SH_SLEEP | SUSP_SH_SF) 34#define SUSP_MODE_SLEEP_SF (SUSP_SH_SLEEP | SUSP_SH_SF)
35#define SUSP_MODE_STANDBY_SF (SUSP_SH_STANDBY | SUSP_SH_SF) 35#define SUSP_MODE_STANDBY_SF (SUSP_SH_STANDBY | SUSP_SH_SF)
36#define SUSP_MODE_RSTANDBY (SUSP_SH_RSTANDBY | SUSP_SH_MMU | SUSP_SH_SF) 36#define SUSP_MODE_RSTANDBY_SF \
37 (SUSP_SH_RSTANDBY | SUSP_SH_MMU | SUSP_SH_REGS | SUSP_SH_SF)
37 /* 38 /*
38 * U-standby mode is unsupported since it needs bootloader hacks 39 * U-standby mode is unsupported since it needs bootloader hacks
39 */ 40 */
diff --git a/arch/sh/kernel/cpu/shmobile/sleep.S b/arch/sh/kernel/cpu/shmobile/sleep.S
index e9dd7fa0abd2..e6aac65f5750 100644
--- a/arch/sh/kernel/cpu/shmobile/sleep.S
+++ b/arch/sh/kernel/cpu/shmobile/sleep.S
@@ -48,8 +48,48 @@ ENTRY(sh_mobile_sleep_enter_start)
48 stc sr, r0 48 stc sr, r0
49 mov.l r0, @(SH_SLEEP_SR, r5) 49 mov.l r0, @(SH_SLEEP_SR, r5)
50 50
51 /* save sp */ 51 /* save general purpose registers to stack if needed */
52 mov.l @(SH_SLEEP_MODE, r5), r0
53 tst #SUSP_SH_REGS, r0
54 bt skip_regs_save
55
56 sts.l pr, @-r15
57 mov.l r14, @-r15
58 mov.l r13, @-r15
59 mov.l r12, @-r15
60 mov.l r11, @-r15
61 mov.l r10, @-r15
62 mov.l r9, @-r15
63 mov.l r8, @-r15
64
65 /* make sure bank0 is selected, save low registers */
66 mov.l rb_bit, r9
67 not r9, r9
68 bsr set_sr
69 mov #0, r10
70
71 bsr save_low_regs
72 nop
73
74 /* switch to bank 1, save low registers */
75 mov.l rb_bit, r10
76 bsr set_sr
77 mov #-1, r9
78
79 bsr save_low_regs
80 nop
81
82 /* switch back to bank 0 */
83 mov.l rb_bit, r9
84 not r9, r9
85 bsr set_sr
86 mov #0, r10
87
88skip_regs_save:
89
90 /* save sp, also set to internal ram */
52 mov.l r15, @(SH_SLEEP_SP, r5) 91 mov.l r15, @(SH_SLEEP_SP, r5)
92 mov r5, r15
53 93
54 /* save stbcr */ 94 /* save stbcr */
55 bsr save_register 95 bsr save_register
@@ -60,7 +100,7 @@ ENTRY(sh_mobile_sleep_enter_start)
60 tst #SUSP_SH_MMU, r0 100 tst #SUSP_SH_MMU, r0
61 bt skip_mmu_save_disable 101 bt skip_mmu_save_disable
62 102
63 /* save mmu state */ 103 /* save mmu state */
64 bsr save_register 104 bsr save_register
65 mov #SH_SLEEP_REG_PTEH, r0 105 mov #SH_SLEEP_REG_PTEH, r0
66 106
@@ -177,6 +217,29 @@ get_register:
177 mov.l @(r0, r5), r0 217 mov.l @(r0, r5), r0
178 rts 218 rts
179 nop 219 nop
220
221set_sr:
222 stc sr, r8
223 and r9, r8
224 or r10, r8
225 ldc r8, sr
226 rts
227 nop
228
229save_low_regs:
230 mov.l r7, @-r15
231 mov.l r6, @-r15
232 mov.l r5, @-r15
233 mov.l r4, @-r15
234 mov.l r3, @-r15
235 mov.l r2, @-r15
236 mov.l r1, @-r15
237 rts
238 mov.l r0, @-r15
239
240 .balign 4
241rb_bit: .long 0x20000000 ! RB=1
242
180ENTRY(sh_mobile_sleep_enter_end) 243ENTRY(sh_mobile_sleep_enter_end)
181 244
182 .balign 4 245 .balign 4
@@ -270,6 +333,40 @@ skip_restore_sf:
270 icbi @r0 333 icbi @r0
271 334
272skip_restore_mmu: 335skip_restore_mmu:
336
337 /* restore general purpose registers if needed */
338 mov.l @(SH_SLEEP_MODE, r5), r0
339 tst #SUSP_SH_REGS, r0
340 bt skip_restore_regs
341
342 /* switch to bank 1, restore low registers */
343 mov.l _rb_bit, r10
344 bsr _set_sr
345 mov #-1, r9
346
347 bsr restore_low_regs
348 nop
349
350 /* switch to bank0, restore low registers */
351 mov.l _rb_bit, r9
352 not r9, r9
353 bsr _set_sr
354 mov #0, r10
355
356 bsr restore_low_regs
357 nop
358
359 /* restore the rest of the registers */
360 mov.l @r15+, r8
361 mov.l @r15+, r9
362 mov.l @r15+, r10
363 mov.l @r15+, r11
364 mov.l @r15+, r12
365 mov.l @r15+, r13
366 mov.l @r15+, r14
367 lds.l @r15+, pr
368
369skip_restore_regs:
273 rte 370 rte
274 nop 371 nop
275 372
@@ -283,6 +380,26 @@ restore_register:
283 rts 380 rts
284 nop 381 nop
285 382
383_set_sr:
384 stc sr, r8
385 and r9, r8
386 or r10, r8
387 ldc r8, sr
388 rts
389 nop
390
391restore_low_regs:
392 mov.l @r15+, r0
393 mov.l @r15+, r1
394 mov.l @r15+, r2
395 mov.l @r15+, r3
396 mov.l @r15+, r4
397 mov.l @r15+, r5
398 mov.l @r15+, r6
399 rts
400 mov.l @r15+, r7
401
286 .balign 4 402 .balign 4
403_rb_bit: .long 0x20000000 ! RB=1
2871: .long ~0x7ff 4041: .long ~0x7ff
288ENTRY(sh_mobile_sleep_resume_end) 405ENTRY(sh_mobile_sleep_resume_end)
diff --git a/arch/sh/kernel/debugtraps.S b/arch/sh/kernel/debugtraps.S
index 591741383ee6..7a1b46fec0f4 100644
--- a/arch/sh/kernel/debugtraps.S
+++ b/arch/sh/kernel/debugtraps.S
@@ -13,7 +13,6 @@
13#include <linux/linkage.h> 13#include <linux/linkage.h>
14 14
15#if !defined(CONFIG_KGDB) 15#if !defined(CONFIG_KGDB)
16#define breakpoint_trap_handler debug_trap_handler
17#define singlestep_trap_handler debug_trap_handler 16#define singlestep_trap_handler debug_trap_handler
18#endif 17#endif
19 18
diff --git a/arch/sh/kernel/dwarf.c b/arch/sh/kernel/dwarf.c
index e51168064e56..bd1c497280a6 100644
--- a/arch/sh/kernel/dwarf.c
+++ b/arch/sh/kernel/dwarf.c
@@ -39,10 +39,10 @@ static mempool_t *dwarf_frame_pool;
39static struct kmem_cache *dwarf_reg_cachep; 39static struct kmem_cache *dwarf_reg_cachep;
40static mempool_t *dwarf_reg_pool; 40static mempool_t *dwarf_reg_pool;
41 41
42static LIST_HEAD(dwarf_cie_list); 42static struct rb_root cie_root;
43static DEFINE_SPINLOCK(dwarf_cie_lock); 43static DEFINE_SPINLOCK(dwarf_cie_lock);
44 44
45static LIST_HEAD(dwarf_fde_list); 45static struct rb_root fde_root;
46static DEFINE_SPINLOCK(dwarf_fde_lock); 46static DEFINE_SPINLOCK(dwarf_fde_lock);
47 47
48static struct dwarf_cie *cached_cie; 48static struct dwarf_cie *cached_cie;
@@ -301,7 +301,8 @@ static inline int dwarf_entry_len(char *addr, unsigned long *len)
301 */ 301 */
302static struct dwarf_cie *dwarf_lookup_cie(unsigned long cie_ptr) 302static struct dwarf_cie *dwarf_lookup_cie(unsigned long cie_ptr)
303{ 303{
304 struct dwarf_cie *cie; 304 struct rb_node **rb_node = &cie_root.rb_node;
305 struct dwarf_cie *cie = NULL;
305 unsigned long flags; 306 unsigned long flags;
306 307
307 spin_lock_irqsave(&dwarf_cie_lock, flags); 308 spin_lock_irqsave(&dwarf_cie_lock, flags);
@@ -315,16 +316,24 @@ static struct dwarf_cie *dwarf_lookup_cie(unsigned long cie_ptr)
315 goto out; 316 goto out;
316 } 317 }
317 318
318 list_for_each_entry(cie, &dwarf_cie_list, link) { 319 while (*rb_node) {
319 if (cie->cie_pointer == cie_ptr) { 320 struct dwarf_cie *cie_tmp;
320 cached_cie = cie; 321
321 break; 322 cie_tmp = rb_entry(*rb_node, struct dwarf_cie, node);
323 BUG_ON(!cie_tmp);
324
325 if (cie_ptr == cie_tmp->cie_pointer) {
326 cie = cie_tmp;
327 cached_cie = cie_tmp;
328 goto out;
329 } else {
330 if (cie_ptr < cie_tmp->cie_pointer)
331 rb_node = &(*rb_node)->rb_left;
332 else
333 rb_node = &(*rb_node)->rb_right;
322 } 334 }
323 } 335 }
324 336
325 /* Couldn't find the entry in the list. */
326 if (&cie->link == &dwarf_cie_list)
327 cie = NULL;
328out: 337out:
329 spin_unlock_irqrestore(&dwarf_cie_lock, flags); 338 spin_unlock_irqrestore(&dwarf_cie_lock, flags);
330 return cie; 339 return cie;
@@ -336,25 +345,34 @@ out:
336 */ 345 */
337struct dwarf_fde *dwarf_lookup_fde(unsigned long pc) 346struct dwarf_fde *dwarf_lookup_fde(unsigned long pc)
338{ 347{
339 struct dwarf_fde *fde; 348 struct rb_node **rb_node = &fde_root.rb_node;
349 struct dwarf_fde *fde = NULL;
340 unsigned long flags; 350 unsigned long flags;
341 351
342 spin_lock_irqsave(&dwarf_fde_lock, flags); 352 spin_lock_irqsave(&dwarf_fde_lock, flags);
343 353
344 list_for_each_entry(fde, &dwarf_fde_list, link) { 354 while (*rb_node) {
345 unsigned long start, end; 355 struct dwarf_fde *fde_tmp;
356 unsigned long tmp_start, tmp_end;
346 357
347 start = fde->initial_location; 358 fde_tmp = rb_entry(*rb_node, struct dwarf_fde, node);
348 end = fde->initial_location + fde->address_range; 359 BUG_ON(!fde_tmp);
349 360
350 if (pc >= start && pc < end) 361 tmp_start = fde_tmp->initial_location;
351 break; 362 tmp_end = fde_tmp->initial_location + fde_tmp->address_range;
352 }
353 363
354 /* Couldn't find the entry in the list. */ 364 if (pc < tmp_start) {
355 if (&fde->link == &dwarf_fde_list) 365 rb_node = &(*rb_node)->rb_left;
356 fde = NULL; 366 } else {
367 if (pc < tmp_end) {
368 fde = fde_tmp;
369 goto out;
370 } else
371 rb_node = &(*rb_node)->rb_right;
372 }
373 }
357 374
375out:
358 spin_unlock_irqrestore(&dwarf_fde_lock, flags); 376 spin_unlock_irqrestore(&dwarf_fde_lock, flags);
359 377
360 return fde; 378 return fde;
@@ -552,8 +570,8 @@ extern void ret_from_irq(void);
552 * on the callstack. Each of the lower (older) stack frames are 570 * on the callstack. Each of the lower (older) stack frames are
553 * linked via the "prev" member. 571 * linked via the "prev" member.
554 */ 572 */
555struct dwarf_frame * dwarf_unwind_stack(unsigned long pc, 573struct dwarf_frame *dwarf_unwind_stack(unsigned long pc,
556 struct dwarf_frame *prev) 574 struct dwarf_frame *prev)
557{ 575{
558 struct dwarf_frame *frame; 576 struct dwarf_frame *frame;
559 struct dwarf_cie *cie; 577 struct dwarf_cie *cie;
@@ -708,6 +726,8 @@ bail:
708static int dwarf_parse_cie(void *entry, void *p, unsigned long len, 726static int dwarf_parse_cie(void *entry, void *p, unsigned long len,
709 unsigned char *end, struct module *mod) 727 unsigned char *end, struct module *mod)
710{ 728{
729 struct rb_node **rb_node = &cie_root.rb_node;
730 struct rb_node *parent;
711 struct dwarf_cie *cie; 731 struct dwarf_cie *cie;
712 unsigned long flags; 732 unsigned long flags;
713 int count; 733 int count;
@@ -802,11 +822,30 @@ static int dwarf_parse_cie(void *entry, void *p, unsigned long len,
802 cie->initial_instructions = p; 822 cie->initial_instructions = p;
803 cie->instructions_end = end; 823 cie->instructions_end = end;
804 824
805 cie->mod = mod;
806
807 /* Add to list */ 825 /* Add to list */
808 spin_lock_irqsave(&dwarf_cie_lock, flags); 826 spin_lock_irqsave(&dwarf_cie_lock, flags);
809 list_add_tail(&cie->link, &dwarf_cie_list); 827
828 while (*rb_node) {
829 struct dwarf_cie *cie_tmp;
830
831 cie_tmp = rb_entry(*rb_node, struct dwarf_cie, node);
832
833 parent = *rb_node;
834
835 if (cie->cie_pointer < cie_tmp->cie_pointer)
836 rb_node = &parent->rb_left;
837 else if (cie->cie_pointer >= cie_tmp->cie_pointer)
838 rb_node = &parent->rb_right;
839 else
840 WARN_ON(1);
841 }
842
843 rb_link_node(&cie->node, parent, rb_node);
844 rb_insert_color(&cie->node, &cie_root);
845
846 if (mod != NULL)
847 list_add_tail(&cie->link, &mod->arch.cie_list);
848
810 spin_unlock_irqrestore(&dwarf_cie_lock, flags); 849 spin_unlock_irqrestore(&dwarf_cie_lock, flags);
811 850
812 return 0; 851 return 0;
@@ -816,6 +855,8 @@ static int dwarf_parse_fde(void *entry, u32 entry_type,
816 void *start, unsigned long len, 855 void *start, unsigned long len,
817 unsigned char *end, struct module *mod) 856 unsigned char *end, struct module *mod)
818{ 857{
858 struct rb_node **rb_node = &fde_root.rb_node;
859 struct rb_node *parent;
819 struct dwarf_fde *fde; 860 struct dwarf_fde *fde;
820 struct dwarf_cie *cie; 861 struct dwarf_cie *cie;
821 unsigned long flags; 862 unsigned long flags;
@@ -863,11 +904,38 @@ static int dwarf_parse_fde(void *entry, u32 entry_type,
863 fde->instructions = p; 904 fde->instructions = p;
864 fde->end = end; 905 fde->end = end;
865 906
866 fde->mod = mod;
867
868 /* Add to list. */ 907 /* Add to list. */
869 spin_lock_irqsave(&dwarf_fde_lock, flags); 908 spin_lock_irqsave(&dwarf_fde_lock, flags);
870 list_add_tail(&fde->link, &dwarf_fde_list); 909
910 while (*rb_node) {
911 struct dwarf_fde *fde_tmp;
912 unsigned long tmp_start, tmp_end;
913 unsigned long start, end;
914
915 fde_tmp = rb_entry(*rb_node, struct dwarf_fde, node);
916
917 start = fde->initial_location;
918 end = fde->initial_location + fde->address_range;
919
920 tmp_start = fde_tmp->initial_location;
921 tmp_end = fde_tmp->initial_location + fde_tmp->address_range;
922
923 parent = *rb_node;
924
925 if (start < tmp_start)
926 rb_node = &parent->rb_left;
927 else if (start >= tmp_end)
928 rb_node = &parent->rb_right;
929 else
930 WARN_ON(1);
931 }
932
933 rb_link_node(&fde->node, parent, rb_node);
934 rb_insert_color(&fde->node, &fde_root);
935
936 if (mod != NULL)
937 list_add_tail(&fde->link, &mod->arch.fde_list);
938
871 spin_unlock_irqrestore(&dwarf_fde_lock, flags); 939 spin_unlock_irqrestore(&dwarf_fde_lock, flags);
872 940
873 return 0; 941 return 0;
@@ -912,19 +980,29 @@ static struct unwinder dwarf_unwinder = {
912 980
913static void dwarf_unwinder_cleanup(void) 981static void dwarf_unwinder_cleanup(void)
914{ 982{
915 struct dwarf_cie *cie, *cie_tmp; 983 struct rb_node **fde_rb_node = &fde_root.rb_node;
916 struct dwarf_fde *fde, *fde_tmp; 984 struct rb_node **cie_rb_node = &cie_root.rb_node;
917 985
918 /* 986 /*
919 * Deallocate all the memory allocated for the DWARF unwinder. 987 * Deallocate all the memory allocated for the DWARF unwinder.
920 * Traverse all the FDE/CIE lists and remove and free all the 988 * Traverse all the FDE/CIE lists and remove and free all the
921 * memory associated with those data structures. 989 * memory associated with those data structures.
922 */ 990 */
923 list_for_each_entry_safe(cie, cie_tmp, &dwarf_cie_list, link) 991 while (*fde_rb_node) {
924 kfree(cie); 992 struct dwarf_fde *fde;
925 993
926 list_for_each_entry_safe(fde, fde_tmp, &dwarf_fde_list, link) 994 fde = rb_entry(*fde_rb_node, struct dwarf_fde, node);
995 rb_erase(*fde_rb_node, &fde_root);
927 kfree(fde); 996 kfree(fde);
997 }
998
999 while (*cie_rb_node) {
1000 struct dwarf_cie *cie;
1001
1002 cie = rb_entry(*cie_rb_node, struct dwarf_cie, node);
1003 rb_erase(*cie_rb_node, &cie_root);
1004 kfree(cie);
1005 }
928 1006
929 kmem_cache_destroy(dwarf_reg_cachep); 1007 kmem_cache_destroy(dwarf_reg_cachep);
930 kmem_cache_destroy(dwarf_frame_cachep); 1008 kmem_cache_destroy(dwarf_frame_cachep);
@@ -1024,6 +1102,8 @@ int module_dwarf_finalize(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs,
1024 1102
1025 /* Did we find the .eh_frame section? */ 1103 /* Did we find the .eh_frame section? */
1026 if (i != hdr->e_shnum) { 1104 if (i != hdr->e_shnum) {
1105 INIT_LIST_HEAD(&me->arch.cie_list);
1106 INIT_LIST_HEAD(&me->arch.fde_list);
1027 err = dwarf_parse_section((char *)start, (char *)end, me); 1107 err = dwarf_parse_section((char *)start, (char *)end, me);
1028 if (err) { 1108 if (err) {
1029 printk(KERN_WARNING "%s: failed to parse DWARF info\n", 1109 printk(KERN_WARNING "%s: failed to parse DWARF info\n",
@@ -1044,38 +1124,26 @@ int module_dwarf_finalize(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs,
1044 */ 1124 */
1045void module_dwarf_cleanup(struct module *mod) 1125void module_dwarf_cleanup(struct module *mod)
1046{ 1126{
1047 struct dwarf_fde *fde; 1127 struct dwarf_fde *fde, *ftmp;
1048 struct dwarf_cie *cie; 1128 struct dwarf_cie *cie, *ctmp;
1049 unsigned long flags; 1129 unsigned long flags;
1050 1130
1051 spin_lock_irqsave(&dwarf_cie_lock, flags); 1131 spin_lock_irqsave(&dwarf_cie_lock, flags);
1052 1132
1053again_cie: 1133 list_for_each_entry_safe(cie, ctmp, &mod->arch.cie_list, link) {
1054 list_for_each_entry(cie, &dwarf_cie_list, link) {
1055 if (cie->mod == mod)
1056 break;
1057 }
1058
1059 if (&cie->link != &dwarf_cie_list) {
1060 list_del(&cie->link); 1134 list_del(&cie->link);
1135 rb_erase(&cie->node, &cie_root);
1061 kfree(cie); 1136 kfree(cie);
1062 goto again_cie;
1063 } 1137 }
1064 1138
1065 spin_unlock_irqrestore(&dwarf_cie_lock, flags); 1139 spin_unlock_irqrestore(&dwarf_cie_lock, flags);
1066 1140
1067 spin_lock_irqsave(&dwarf_fde_lock, flags); 1141 spin_lock_irqsave(&dwarf_fde_lock, flags);
1068 1142
1069again_fde: 1143 list_for_each_entry_safe(fde, ftmp, &mod->arch.fde_list, link) {
1070 list_for_each_entry(fde, &dwarf_fde_list, link) {
1071 if (fde->mod == mod)
1072 break;
1073 }
1074
1075 if (&fde->link != &dwarf_fde_list) {
1076 list_del(&fde->link); 1144 list_del(&fde->link);
1145 rb_erase(&fde->node, &fde_root);
1077 kfree(fde); 1146 kfree(fde);
1078 goto again_fde;
1079 } 1147 }
1080 1148
1081 spin_unlock_irqrestore(&dwarf_fde_lock, flags); 1149 spin_unlock_irqrestore(&dwarf_fde_lock, flags);
@@ -1094,8 +1162,6 @@ again_fde:
1094static int __init dwarf_unwinder_init(void) 1162static int __init dwarf_unwinder_init(void)
1095{ 1163{
1096 int err; 1164 int err;
1097 INIT_LIST_HEAD(&dwarf_cie_list);
1098 INIT_LIST_HEAD(&dwarf_fde_list);
1099 1165
1100 dwarf_frame_cachep = kmem_cache_create("dwarf_frames", 1166 dwarf_frame_cachep = kmem_cache_create("dwarf_frames",
1101 sizeof(struct dwarf_frame), 0, 1167 sizeof(struct dwarf_frame), 0,
diff --git a/arch/sh/kernel/early_printk.c b/arch/sh/kernel/early_printk.c
deleted file mode 100644
index f8bb50c6e050..000000000000
--- a/arch/sh/kernel/early_printk.c
+++ /dev/null
@@ -1,85 +0,0 @@
1/*
2 * arch/sh/kernel/early_printk.c
3 *
4 * Copyright (C) 1999, 2000 Niibe Yutaka
5 * Copyright (C) 2002 M. R. Brown
6 * Copyright (C) 2004 - 2007 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/console.h>
13#include <linux/tty.h>
14#include <linux/init.h>
15#include <linux/io.h>
16#include <linux/delay.h>
17
18#include <asm/sh_bios.h>
19
20/*
21 * Print a string through the BIOS
22 */
23static void sh_console_write(struct console *co, const char *s,
24 unsigned count)
25{
26 sh_bios_console_write(s, count);
27}
28
29/*
30 * Setup initial baud/bits/parity. We do two things here:
31 * - construct a cflag setting for the first rs_open()
32 * - initialize the serial port
33 * Return non-zero if we didn't find a serial port.
34 */
35static int __init sh_console_setup(struct console *co, char *options)
36{
37 int cflag = CREAD | HUPCL | CLOCAL;
38
39 /*
40 * Now construct a cflag setting.
41 * TODO: this is a totally bogus cflag, as we have
42 * no idea what serial settings the BIOS is using, or
43 * even if its using the serial port at all.
44 */
45 cflag |= B115200 | CS8 | /*no parity*/0;
46
47 co->cflag = cflag;
48
49 return 0;
50}
51
52static struct console bios_console = {
53 .name = "bios",
54 .write = sh_console_write,
55 .setup = sh_console_setup,
56 .flags = CON_PRINTBUFFER,
57 .index = -1,
58};
59
60static struct console *early_console;
61
62static int __init setup_early_printk(char *buf)
63{
64 int keep_early = 0;
65
66 if (!buf)
67 return 0;
68
69 if (strstr(buf, "keep"))
70 keep_early = 1;
71
72 if (!strncmp(buf, "bios", 4))
73 early_console = &bios_console;
74
75 if (likely(early_console)) {
76 if (keep_early)
77 early_console->flags &= ~CON_BOOT;
78 else
79 early_console->flags |= CON_BOOT;
80 register_console(early_console);
81 }
82
83 return 0;
84}
85early_param("earlyprintk", setup_early_printk);
diff --git a/arch/sh/kernel/ftrace.c b/arch/sh/kernel/ftrace.c
index a48cdedc73b5..30e13196d35b 100644
--- a/arch/sh/kernel/ftrace.c
+++ b/arch/sh/kernel/ftrace.c
@@ -399,12 +399,3 @@ void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr)
399 } 399 }
400} 400}
401#endif /* CONFIG_FUNCTION_GRAPH_TRACER */ 401#endif /* CONFIG_FUNCTION_GRAPH_TRACER */
402
403#ifdef CONFIG_FTRACE_SYSCALLS
404extern unsigned long *sys_call_table;
405
406unsigned long __init arch_syscall_addr(int nr)
407{
408 return (unsigned long)sys_call_table[nr];
409}
410#endif /* CONFIG_FTRACE_SYSCALLS */
diff --git a/arch/sh/kernel/head_32.S b/arch/sh/kernel/head_32.S
index 1151ecdffa71..fe0b743881b0 100644
--- a/arch/sh/kernel/head_32.S
+++ b/arch/sh/kernel/head_32.S
@@ -3,6 +3,7 @@
3 * arch/sh/kernel/head.S 3 * arch/sh/kernel/head.S
4 * 4 *
5 * Copyright (C) 1999, 2000 Niibe Yutaka & Kaz Kojima 5 * Copyright (C) 1999, 2000 Niibe Yutaka & Kaz Kojima
6 * Copyright (C) 2010 Matt Fleming
6 * 7 *
7 * 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
8 * 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
@@ -13,6 +14,8 @@
13#include <linux/init.h> 14#include <linux/init.h>
14#include <linux/linkage.h> 15#include <linux/linkage.h>
15#include <asm/thread_info.h> 16#include <asm/thread_info.h>
17#include <asm/mmu.h>
18#include <cpu/mmu_context.h>
16 19
17#ifdef CONFIG_CPU_SH4A 20#ifdef CONFIG_CPU_SH4A
18#define SYNCO() synco 21#define SYNCO() synco
@@ -33,7 +36,7 @@ ENTRY(empty_zero_page)
33 .long 1 /* LOADER_TYPE */ 36 .long 1 /* LOADER_TYPE */
34 .long 0x00000000 /* INITRD_START */ 37 .long 0x00000000 /* INITRD_START */
35 .long 0x00000000 /* INITRD_SIZE */ 38 .long 0x00000000 /* INITRD_SIZE */
36#if defined(CONFIG_32BIT) && defined(CONFIG_PMB_FIXED) 39#ifdef CONFIG_32BIT
37 .long 0x53453f00 + 32 /* "SE?" = 32 bit */ 40 .long 0x53453f00 + 32 /* "SE?" = 32 bit */
38#else 41#else
39 .long 0x53453f00 + 29 /* "SE?" = 29 bit */ 42 .long 0x53453f00 + 29 /* "SE?" = 29 bit */
@@ -82,6 +85,209 @@ ENTRY(_stext)
82 ldc r0, r7_bank ! ... and initial thread_info 85 ldc r0, r7_bank ! ... and initial thread_info
83#endif 86#endif
84 87
88#ifdef CONFIG_PMB
89/*
90 * Reconfigure the initial PMB mappings setup by the hardware.
91 *
92 * When we boot in 32-bit MMU mode there are 2 PMB entries already
93 * setup for us.
94 *
95 * Entry VPN PPN V SZ C UB WT
96 * ---------------------------------------------------------------
97 * 0 0x80000000 0x00000000 1 512MB 1 0 1
98 * 1 0xA0000000 0x00000000 1 512MB 0 0 0
99 *
100 * But we reprogram them here because we want complete control over
101 * our address space and the initial mappings may not map PAGE_OFFSET
102 * to __MEMORY_START (or even map all of our RAM).
103 *
104 * Once we've setup cached and uncached mappings we clear the rest of the
105 * PMB entries. This clearing also deals with the fact that PMB entries
106 * can persist across reboots. The PMB could have been left in any state
107 * when the reboot occurred, so to be safe we clear all entries and start
108 * with with a clean slate.
109 *
110 * The uncached mapping is constructed using the smallest possible
111 * mapping with a single unbufferable page. Only the kernel text needs to
112 * be covered via the uncached mapping so that certain functions can be
113 * run uncached.
114 *
115 * Drivers and the like that have previously abused the 1:1 identity
116 * mapping are unsupported in 32-bit mode and must specify their caching
117 * preference when page tables are constructed.
118 *
119 * This frees up the P2 space for more nefarious purposes.
120 *
121 * Register utilization is as follows:
122 *
123 * r0 = PMB_DATA data field
124 * r1 = PMB_DATA address field
125 * r2 = PMB_ADDR data field
126 * r3 = PMB_ADDR address field
127 * r4 = PMB_E_SHIFT
128 * r5 = remaining amount of RAM to map
129 * r6 = PMB mapping size we're trying to use
130 * r7 = cached_to_uncached
131 * r8 = scratch register
132 * r9 = scratch register
133 * r10 = number of PMB entries we've setup
134 */
135
136 mov.l .LMMUCR, r1 /* Flush the TLB */
137 mov.l @r1, r0
138 or #MMUCR_TI, r0
139 mov.l r0, @r1
140
141 mov.l .LMEMORY_SIZE, r5
142
143 mov #PMB_E_SHIFT, r0
144 mov #0x1, r4
145 shld r0, r4
146
147 mov.l .LFIRST_DATA_ENTRY, r0
148 mov.l .LPMB_DATA, r1
149 mov.l .LFIRST_ADDR_ENTRY, r2
150 mov.l .LPMB_ADDR, r3
151
152 /*
153 * First we need to walk the PMB and figure out if there are any
154 * existing mappings that match the initial mappings VPN/PPN.
155 * If these have already been established by the bootloader, we
156 * don't bother setting up new entries here, and let the late PMB
157 * initialization take care of things instead.
158 *
159 * Note that we may need to coalesce and merge entries in order
160 * to reclaim more available PMB slots, which is much more than
161 * we want to do at this early stage.
162 */
163 mov #0, r10
164 mov #NR_PMB_ENTRIES, r9
165
166 mov r1, r7 /* temporary PMB_DATA iter */
167
168.Lvalidate_existing_mappings:
169
170 mov.l @r7, r8
171 and r0, r8
172 cmp/eq r0, r8 /* Check for valid __MEMORY_START mappings */
173 bt .Lpmb_done
174
175 add #1, r10 /* Increment the loop counter */
176 cmp/eq r9, r10
177 bf/s .Lvalidate_existing_mappings
178 add r4, r7 /* Increment to the next PMB_DATA entry */
179
180 /*
181 * If we've fallen through, continue with setting up the initial
182 * mappings.
183 */
184
185 mov r5, r7 /* cached_to_uncached */
186 mov #0, r10
187
188#ifdef CONFIG_UNCACHED_MAPPING
189 /*
190 * Uncached mapping
191 */
192 mov #(PMB_SZ_16M >> 2), r9
193 shll2 r9
194
195 mov #(PMB_UB >> 8), r8
196 shll8 r8
197
198 or r0, r8
199 or r9, r8
200 mov.l r8, @r1
201 mov r2, r8
202 add r7, r8
203 mov.l r8, @r3
204
205 add r4, r1
206 add r4, r3
207 add #1, r10
208#endif
209
210/*
211 * Iterate over all of the available sizes from largest to
212 * smallest for constructing the cached mapping.
213 */
214#define __PMB_ITER_BY_SIZE(size) \
215.L##size: \
216 mov #(size >> 4), r6; \
217 shll16 r6; \
218 shll8 r6; \
219 \
220 cmp/hi r5, r6; \
221 bt 9999f; \
222 \
223 mov #(PMB_SZ_##size##M >> 2), r9; \
224 shll2 r9; \
225 \
226 /* \
227 * Cached mapping \
228 */ \
229 mov #PMB_C, r8; \
230 or r0, r8; \
231 or r9, r8; \
232 mov.l r8, @r1; \
233 mov.l r2, @r3; \
234 \
235 /* Increment to the next PMB_DATA entry */ \
236 add r4, r1; \
237 /* Increment to the next PMB_ADDR entry */ \
238 add r4, r3; \
239 /* Increment number of PMB entries */ \
240 add #1, r10; \
241 \
242 sub r6, r5; \
243 add r6, r0; \
244 add r6, r2; \
245 \
246 bra .L##size; \
2479999:
248
249 __PMB_ITER_BY_SIZE(512)
250 __PMB_ITER_BY_SIZE(128)
251 __PMB_ITER_BY_SIZE(64)
252 __PMB_ITER_BY_SIZE(16)
253
254#ifdef CONFIG_UNCACHED_MAPPING
255 /*
256 * Now that we can access it, update cached_to_uncached and
257 * uncached_size.
258 */
259 mov.l .Lcached_to_uncached, r0
260 mov.l r7, @r0
261
262 mov.l .Luncached_size, r0
263 mov #1, r7
264 shll16 r7
265 shll8 r7
266 mov.l r7, @r0
267#endif
268
269 /*
270 * Clear the remaining PMB entries.
271 *
272 * r3 = entry to begin clearing from
273 * r10 = number of entries we've setup so far
274 */
275 mov #0, r1
276 mov #NR_PMB_ENTRIES, r0
277
278.Lagain:
279 mov.l r1, @r3 /* Clear PMB_ADDR entry */
280 add #1, r10 /* Increment the loop counter */
281 cmp/eq r0, r10
282 bf/s .Lagain
283 add r4, r3 /* Increment to the next PMB_ADDR entry */
284
285 mov.l 6f, r0
286 icbi @r0
287
288.Lpmb_done:
289#endif /* CONFIG_PMB */
290
85#ifndef CONFIG_SH_NO_BSS_INIT 291#ifndef CONFIG_SH_NO_BSS_INIT
86 /* 292 /*
87 * Don't clear BSS if running on slow platforms such as an RTL simulation, 293 * Don't clear BSS if running on slow platforms such as an RTL simulation,
@@ -131,3 +337,16 @@ ENTRY(stack_start)
1315: .long start_kernel 3375: .long start_kernel
1326: .long sh_cpu_init 3386: .long sh_cpu_init
1337: .long init_thread_union 3397: .long init_thread_union
340
341#ifdef CONFIG_PMB
342.LPMB_ADDR: .long PMB_ADDR
343.LPMB_DATA: .long PMB_DATA
344.LFIRST_ADDR_ENTRY: .long PAGE_OFFSET | PMB_V
345.LFIRST_DATA_ENTRY: .long __MEMORY_START | PMB_V
346.LMMUCR: .long MMUCR
347.LMEMORY_SIZE: .long __MEMORY_SIZE
348#ifdef CONFIG_UNCACHED_MAPPING
349.Lcached_to_uncached: .long cached_to_uncached
350.Luncached_size: .long uncached_size
351#endif
352#endif
diff --git a/arch/sh/kernel/head_64.S b/arch/sh/kernel/head_64.S
index 3ea765844c74..defd851abefa 100644
--- a/arch/sh/kernel/head_64.S
+++ b/arch/sh/kernel/head_64.S
@@ -220,7 +220,6 @@ clear_DTLB:
220 add.l r22, r63, r22 /* Sign extend */ 220 add.l r22, r63, r22 /* Sign extend */
221 putcfg r21, 0, r22 /* Set MMUDR[0].PTEH */ 221 putcfg r21, 0, r22 /* Set MMUDR[0].PTEH */
222 222
223#ifdef CONFIG_EARLY_PRINTK
224 /* 223 /*
225 * Setup a DTLB translation for SCIF phys. 224 * Setup a DTLB translation for SCIF phys.
226 */ 225 */
@@ -231,7 +230,6 @@ clear_DTLB:
231 movi 0xfa03, r22 /* 0xfa030000, fixed SCIF virt */ 230 movi 0xfa03, r22 /* 0xfa030000, fixed SCIF virt */
232 shori 0x0003, r22 231 shori 0x0003, r22
233 putcfg r21, 0, r22 /* PTEH last */ 232 putcfg r21, 0, r22 /* PTEH last */
234#endif
235 233
236 /* 234 /*
237 * Set cache behaviours. 235 * Set cache behaviours.
diff --git a/arch/sh/kernel/hw_breakpoint.c b/arch/sh/kernel/hw_breakpoint.c
new file mode 100644
index 000000000000..e2f1753d275c
--- /dev/null
+++ b/arch/sh/kernel/hw_breakpoint.c
@@ -0,0 +1,463 @@
1/*
2 * arch/sh/kernel/hw_breakpoint.c
3 *
4 * Unified kernel/user-space hardware breakpoint facility for the on-chip UBC.
5 *
6 * Copyright (C) 2009 - 2010 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/init.h>
13#include <linux/perf_event.h>
14#include <linux/hw_breakpoint.h>
15#include <linux/percpu.h>
16#include <linux/kallsyms.h>
17#include <linux/notifier.h>
18#include <linux/kprobes.h>
19#include <linux/kdebug.h>
20#include <linux/io.h>
21#include <linux/clk.h>
22#include <asm/hw_breakpoint.h>
23#include <asm/mmu_context.h>
24#include <asm/ptrace.h>
25
26/*
27 * Stores the breakpoints currently in use on each breakpoint address
28 * register for each cpus
29 */
30static DEFINE_PER_CPU(struct perf_event *, bp_per_reg[HBP_NUM]);
31
32/*
33 * A dummy placeholder for early accesses until the CPUs get a chance to
34 * register their UBCs later in the boot process.
35 */
36static struct sh_ubc ubc_dummy = { .num_events = 0 };
37
38static struct sh_ubc *sh_ubc __read_mostly = &ubc_dummy;
39
40/*
41 * Install a perf counter breakpoint.
42 *
43 * We seek a free UBC channel and use it for this breakpoint.
44 *
45 * Atomic: we hold the counter->ctx->lock and we only handle variables
46 * and registers local to this cpu.
47 */
48int arch_install_hw_breakpoint(struct perf_event *bp)
49{
50 struct arch_hw_breakpoint *info = counter_arch_bp(bp);
51 int i;
52
53 for (i = 0; i < sh_ubc->num_events; i++) {
54 struct perf_event **slot = &__get_cpu_var(bp_per_reg[i]);
55
56 if (!*slot) {
57 *slot = bp;
58 break;
59 }
60 }
61
62 if (WARN_ONCE(i == sh_ubc->num_events, "Can't find any breakpoint slot"))
63 return -EBUSY;
64
65 clk_enable(sh_ubc->clk);
66 sh_ubc->enable(info, i);
67
68 return 0;
69}
70
71/*
72 * Uninstall the breakpoint contained in the given counter.
73 *
74 * First we search the debug address register it uses and then we disable
75 * it.
76 *
77 * Atomic: we hold the counter->ctx->lock and we only handle variables
78 * and registers local to this cpu.
79 */
80void arch_uninstall_hw_breakpoint(struct perf_event *bp)
81{
82 struct arch_hw_breakpoint *info = counter_arch_bp(bp);
83 int i;
84
85 for (i = 0; i < sh_ubc->num_events; i++) {
86 struct perf_event **slot = &__get_cpu_var(bp_per_reg[i]);
87
88 if (*slot == bp) {
89 *slot = NULL;
90 break;
91 }
92 }
93
94 if (WARN_ONCE(i == sh_ubc->num_events, "Can't find any breakpoint slot"))
95 return;
96
97 sh_ubc->disable(info, i);
98 clk_disable(sh_ubc->clk);
99}
100
101static int get_hbp_len(u16 hbp_len)
102{
103 unsigned int len_in_bytes = 0;
104
105 switch (hbp_len) {
106 case SH_BREAKPOINT_LEN_1:
107 len_in_bytes = 1;
108 break;
109 case SH_BREAKPOINT_LEN_2:
110 len_in_bytes = 2;
111 break;
112 case SH_BREAKPOINT_LEN_4:
113 len_in_bytes = 4;
114 break;
115 case SH_BREAKPOINT_LEN_8:
116 len_in_bytes = 8;
117 break;
118 }
119 return len_in_bytes;
120}
121
122/*
123 * Check for virtual address in user space.
124 */
125int arch_check_va_in_userspace(unsigned long va, u16 hbp_len)
126{
127 unsigned int len;
128
129 len = get_hbp_len(hbp_len);
130
131 return (va <= TASK_SIZE - len);
132}
133
134/*
135 * Check for virtual address in kernel space.
136 */
137static int arch_check_va_in_kernelspace(unsigned long va, u8 hbp_len)
138{
139 unsigned int len;
140
141 len = get_hbp_len(hbp_len);
142
143 return (va >= TASK_SIZE) && ((va + len - 1) >= TASK_SIZE);
144}
145
146/*
147 * Store a breakpoint's encoded address, length, and type.
148 */
149static int arch_store_info(struct perf_event *bp)
150{
151 struct arch_hw_breakpoint *info = counter_arch_bp(bp);
152
153 /*
154 * User-space requests will always have the address field populated
155 * For kernel-addresses, either the address or symbol name can be
156 * specified.
157 */
158 if (info->name)
159 info->address = (unsigned long)kallsyms_lookup_name(info->name);
160 if (info->address)
161 return 0;
162
163 return -EINVAL;
164}
165
166int arch_bp_generic_fields(int sh_len, int sh_type,
167 int *gen_len, int *gen_type)
168{
169 /* Len */
170 switch (sh_len) {
171 case SH_BREAKPOINT_LEN_1:
172 *gen_len = HW_BREAKPOINT_LEN_1;
173 break;
174 case SH_BREAKPOINT_LEN_2:
175 *gen_len = HW_BREAKPOINT_LEN_2;
176 break;
177 case SH_BREAKPOINT_LEN_4:
178 *gen_len = HW_BREAKPOINT_LEN_4;
179 break;
180 case SH_BREAKPOINT_LEN_8:
181 *gen_len = HW_BREAKPOINT_LEN_8;
182 break;
183 default:
184 return -EINVAL;
185 }
186
187 /* Type */
188 switch (sh_type) {
189 case SH_BREAKPOINT_READ:
190 *gen_type = HW_BREAKPOINT_R;
191 case SH_BREAKPOINT_WRITE:
192 *gen_type = HW_BREAKPOINT_W;
193 break;
194 case SH_BREAKPOINT_RW:
195 *gen_type = HW_BREAKPOINT_W | HW_BREAKPOINT_R;
196 break;
197 default:
198 return -EINVAL;
199 }
200
201 return 0;
202}
203
204static int arch_build_bp_info(struct perf_event *bp)
205{
206 struct arch_hw_breakpoint *info = counter_arch_bp(bp);
207
208 info->address = bp->attr.bp_addr;
209
210 /* Len */
211 switch (bp->attr.bp_len) {
212 case HW_BREAKPOINT_LEN_1:
213 info->len = SH_BREAKPOINT_LEN_1;
214 break;
215 case HW_BREAKPOINT_LEN_2:
216 info->len = SH_BREAKPOINT_LEN_2;
217 break;
218 case HW_BREAKPOINT_LEN_4:
219 info->len = SH_BREAKPOINT_LEN_4;
220 break;
221 case HW_BREAKPOINT_LEN_8:
222 info->len = SH_BREAKPOINT_LEN_8;
223 break;
224 default:
225 return -EINVAL;
226 }
227
228 /* Type */
229 switch (bp->attr.bp_type) {
230 case HW_BREAKPOINT_R:
231 info->type = SH_BREAKPOINT_READ;
232 break;
233 case HW_BREAKPOINT_W:
234 info->type = SH_BREAKPOINT_WRITE;
235 break;
236 case HW_BREAKPOINT_W | HW_BREAKPOINT_R:
237 info->type = SH_BREAKPOINT_RW;
238 break;
239 default:
240 return -EINVAL;
241 }
242
243 return 0;
244}
245
246/*
247 * Validate the arch-specific HW Breakpoint register settings
248 */
249int arch_validate_hwbkpt_settings(struct perf_event *bp,
250 struct task_struct *tsk)
251{
252 struct arch_hw_breakpoint *info = counter_arch_bp(bp);
253 unsigned int align;
254 int ret;
255
256 ret = arch_build_bp_info(bp);
257 if (ret)
258 return ret;
259
260 ret = -EINVAL;
261
262 switch (info->len) {
263 case SH_BREAKPOINT_LEN_1:
264 align = 0;
265 break;
266 case SH_BREAKPOINT_LEN_2:
267 align = 1;
268 break;
269 case SH_BREAKPOINT_LEN_4:
270 align = 3;
271 break;
272 case SH_BREAKPOINT_LEN_8:
273 align = 7;
274 break;
275 default:
276 return ret;
277 }
278
279 ret = arch_store_info(bp);
280
281 if (ret < 0)
282 return ret;
283
284 /*
285 * Check that the low-order bits of the address are appropriate
286 * for the alignment implied by len.
287 */
288 if (info->address & align)
289 return -EINVAL;
290
291 /* Check that the virtual address is in the proper range */
292 if (tsk) {
293 if (!arch_check_va_in_userspace(info->address, info->len))
294 return -EFAULT;
295 } else {
296 if (!arch_check_va_in_kernelspace(info->address, info->len))
297 return -EFAULT;
298 }
299
300 return 0;
301}
302
303/*
304 * Release the user breakpoints used by ptrace
305 */
306void flush_ptrace_hw_breakpoint(struct task_struct *tsk)
307{
308 int i;
309 struct thread_struct *t = &tsk->thread;
310
311 for (i = 0; i < sh_ubc->num_events; i++) {
312 unregister_hw_breakpoint(t->ptrace_bps[i]);
313 t->ptrace_bps[i] = NULL;
314 }
315}
316
317static int __kprobes hw_breakpoint_handler(struct die_args *args)
318{
319 int cpu, i, rc = NOTIFY_STOP;
320 struct perf_event *bp;
321 unsigned int cmf, resume_mask;
322
323 /*
324 * Do an early return if none of the channels triggered.
325 */
326 cmf = sh_ubc->triggered_mask();
327 if (unlikely(!cmf))
328 return NOTIFY_DONE;
329
330 /*
331 * By default, resume all of the active channels.
332 */
333 resume_mask = sh_ubc->active_mask();
334
335 /*
336 * Disable breakpoints during exception handling.
337 */
338 sh_ubc->disable_all();
339
340 cpu = get_cpu();
341 for (i = 0; i < sh_ubc->num_events; i++) {
342 unsigned long event_mask = (1 << i);
343
344 if (likely(!(cmf & event_mask)))
345 continue;
346
347 /*
348 * The counter may be concurrently released but that can only
349 * occur from a call_rcu() path. We can then safely fetch
350 * the breakpoint, use its callback, touch its counter
351 * while we are in an rcu_read_lock() path.
352 */
353 rcu_read_lock();
354
355 bp = per_cpu(bp_per_reg[i], cpu);
356 if (bp)
357 rc = NOTIFY_DONE;
358
359 /*
360 * Reset the condition match flag to denote completion of
361 * exception handling.
362 */
363 sh_ubc->clear_triggered_mask(event_mask);
364
365 /*
366 * bp can be NULL due to concurrent perf counter
367 * removing.
368 */
369 if (!bp) {
370 rcu_read_unlock();
371 break;
372 }
373
374 /*
375 * Don't restore the channel if the breakpoint is from
376 * ptrace, as it always operates in one-shot mode.
377 */
378 if (bp->overflow_handler == ptrace_triggered)
379 resume_mask &= ~(1 << i);
380
381 perf_bp_event(bp, args->regs);
382
383 /* Deliver the signal to userspace */
384 if (arch_check_va_in_userspace(bp->attr.bp_addr,
385 bp->attr.bp_len)) {
386 siginfo_t info;
387
388 info.si_signo = args->signr;
389 info.si_errno = notifier_to_errno(rc);
390 info.si_code = TRAP_HWBKPT;
391
392 force_sig_info(args->signr, &info, current);
393 }
394
395 rcu_read_unlock();
396 }
397
398 if (cmf == 0)
399 rc = NOTIFY_DONE;
400
401 sh_ubc->enable_all(resume_mask);
402
403 put_cpu();
404
405 return rc;
406}
407
408BUILD_TRAP_HANDLER(breakpoint)
409{
410 unsigned long ex = lookup_exception_vector();
411 TRAP_HANDLER_DECL;
412
413 notify_die(DIE_BREAKPOINT, "breakpoint", regs, 0, ex, SIGTRAP);
414}
415
416/*
417 * Handle debug exception notifications.
418 */
419int __kprobes hw_breakpoint_exceptions_notify(struct notifier_block *unused,
420 unsigned long val, void *data)
421{
422 struct die_args *args = data;
423
424 if (val != DIE_BREAKPOINT)
425 return NOTIFY_DONE;
426
427 /*
428 * If the breakpoint hasn't been triggered by the UBC, it's
429 * probably from a debugger, so don't do anything more here.
430 *
431 * This also permits the UBC interface clock to remain off for
432 * non-UBC breakpoints, as we don't need to check the triggered
433 * or active channel masks.
434 */
435 if (args->trapnr != sh_ubc->trap_nr)
436 return NOTIFY_DONE;
437
438 return hw_breakpoint_handler(data);
439}
440
441void hw_breakpoint_pmu_read(struct perf_event *bp)
442{
443 /* TODO */
444}
445
446void hw_breakpoint_pmu_unthrottle(struct perf_event *bp)
447{
448 /* TODO */
449}
450
451int register_sh_ubc(struct sh_ubc *ubc)
452{
453 /* Bail if it's already assigned */
454 if (sh_ubc != &ubc_dummy)
455 return -EBUSY;
456 sh_ubc = ubc;
457
458 pr_info("HW Breakpoints: %s UBC support registered\n", ubc->name);
459
460 WARN_ON(ubc->num_events > HBP_NUM);
461
462 return 0;
463}
diff --git a/arch/sh/kernel/idle.c b/arch/sh/kernel/idle.c
index 6b3d706deac1..0fd7b41f0a22 100644
--- a/arch/sh/kernel/idle.c
+++ b/arch/sh/kernel/idle.c
@@ -20,10 +20,9 @@
20#include <asm/system.h> 20#include <asm/system.h>
21#include <asm/atomic.h> 21#include <asm/atomic.h>
22 22
23static int hlt_counter;
24void (*pm_idle)(void) = NULL; 23void (*pm_idle)(void) = NULL;
25void (*pm_power_off)(void); 24
26EXPORT_SYMBOL(pm_power_off); 25static int hlt_counter;
27 26
28static int __init nohlt_setup(char *__unused) 27static int __init nohlt_setup(char *__unused)
29{ 28{
@@ -131,6 +130,15 @@ static void do_nothing(void *unused)
131{ 130{
132} 131}
133 132
133void stop_this_cpu(void *unused)
134{
135 local_irq_disable();
136 cpu_clear(smp_processor_id(), cpu_online_map);
137
138 for (;;)
139 cpu_sleep();
140}
141
134/* 142/*
135 * cpu_idle_wait - Used to ensure that all the CPUs discard old value of 143 * cpu_idle_wait - Used to ensure that all the CPUs discard old value of
136 * pm_idle and update to new pm_idle value. Required while changing pm_idle 144 * pm_idle and update to new pm_idle value. Required while changing pm_idle
diff --git a/arch/sh/kernel/io_trapped.c b/arch/sh/kernel/io_trapped.c
index 69be603aa2d7..4a8bb4eeb8ad 100644
--- a/arch/sh/kernel/io_trapped.c
+++ b/arch/sh/kernel/io_trapped.c
@@ -184,31 +184,31 @@ static unsigned long long copy_word(unsigned long src_addr, int src_len,
184 184
185 switch (src_len) { 185 switch (src_len) {
186 case 1: 186 case 1:
187 tmp = ctrl_inb(src_addr); 187 tmp = __raw_readb(src_addr);
188 break; 188 break;
189 case 2: 189 case 2:
190 tmp = ctrl_inw(src_addr); 190 tmp = __raw_readw(src_addr);
191 break; 191 break;
192 case 4: 192 case 4:
193 tmp = ctrl_inl(src_addr); 193 tmp = __raw_readl(src_addr);
194 break; 194 break;
195 case 8: 195 case 8:
196 tmp = ctrl_inq(src_addr); 196 tmp = __raw_readq(src_addr);
197 break; 197 break;
198 } 198 }
199 199
200 switch (dst_len) { 200 switch (dst_len) {
201 case 1: 201 case 1:
202 ctrl_outb(tmp, dst_addr); 202 __raw_writeb(tmp, dst_addr);
203 break; 203 break;
204 case 2: 204 case 2:
205 ctrl_outw(tmp, dst_addr); 205 __raw_writew(tmp, dst_addr);
206 break; 206 break;
207 case 4: 207 case 4:
208 ctrl_outl(tmp, dst_addr); 208 __raw_writel(tmp, dst_addr);
209 break; 209 break;
210 case 8: 210 case 8:
211 ctrl_outq(tmp, dst_addr); 211 __raw_writeq(tmp, dst_addr);
212 break; 212 break;
213 } 213 }
214 214
@@ -271,6 +271,8 @@ int handle_trapped_io(struct pt_regs *regs, unsigned long address)
271 insn_size_t instruction; 271 insn_size_t instruction;
272 int tmp; 272 int tmp;
273 273
274 if (trapped_io_disable)
275 return 0;
274 if (!lookup_tiop(address)) 276 if (!lookup_tiop(address))
275 return 0; 277 return 0;
276 278
diff --git a/arch/sh/kernel/kgdb.c b/arch/sh/kernel/kgdb.c
index 3e532d0d4a5c..70c69659b846 100644
--- a/arch/sh/kernel/kgdb.c
+++ b/arch/sh/kernel/kgdb.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * SuperH KGDB support 2 * SuperH KGDB support
3 * 3 *
4 * Copyright (C) 2008 Paul Mundt 4 * Copyright (C) 2008 - 2009 Paul Mundt
5 * 5 *
6 * Single stepping taken from the old stub by Henry Bell and Jeremy Siegel. 6 * Single stepping taken from the old stub by Henry Bell and Jeremy Siegel.
7 * 7 *
@@ -251,24 +251,60 @@ BUILD_TRAP_HANDLER(singlestep)
251 local_irq_restore(flags); 251 local_irq_restore(flags);
252} 252}
253 253
254static int __kgdb_notify(struct die_args *args, unsigned long cmd)
255{
256 int ret;
257
258 switch (cmd) {
259 case DIE_BREAKPOINT:
260 /*
261 * This means a user thread is single stepping
262 * a system call which should be ignored
263 */
264 if (test_thread_flag(TIF_SINGLESTEP))
265 return NOTIFY_DONE;
266
267 ret = kgdb_handle_exception(args->trapnr & 0xff, args->signr,
268 args->err, args->regs);
269 if (ret)
270 return NOTIFY_DONE;
271
272 break;
273 }
254 274
255BUILD_TRAP_HANDLER(breakpoint) 275 return NOTIFY_STOP;
276}
277
278static int
279kgdb_notify(struct notifier_block *self, unsigned long cmd, void *ptr)
256{ 280{
257 unsigned long flags; 281 unsigned long flags;
258 TRAP_HANDLER_DECL; 282 int ret;
259 283
260 local_irq_save(flags); 284 local_irq_save(flags);
261 kgdb_handle_exception(vec >> 2, SIGTRAP, 0, regs); 285 ret = __kgdb_notify(ptr, cmd);
262 local_irq_restore(flags); 286 local_irq_restore(flags);
287
288 return ret;
263} 289}
264 290
291static struct notifier_block kgdb_notifier = {
292 .notifier_call = kgdb_notify,
293
294 /*
295 * Lowest-prio notifier priority, we want to be notified last:
296 */
297 .priority = -INT_MAX,
298};
299
265int kgdb_arch_init(void) 300int kgdb_arch_init(void)
266{ 301{
267 return 0; 302 return register_die_notifier(&kgdb_notifier);
268} 303}
269 304
270void kgdb_arch_exit(void) 305void kgdb_arch_exit(void)
271{ 306{
307 unregister_die_notifier(&kgdb_notifier);
272} 308}
273 309
274struct kgdb_arch arch_kgdb_ops = { 310struct kgdb_arch arch_kgdb_ops = {
diff --git a/arch/sh/kernel/machine_kexec.c b/arch/sh/kernel/machine_kexec.c
index 76f280223ebd..7672141c841b 100644
--- a/arch/sh/kernel/machine_kexec.c
+++ b/arch/sh/kernel/machine_kexec.c
@@ -21,6 +21,8 @@
21#include <asm/mmu_context.h> 21#include <asm/mmu_context.h>
22#include <asm/io.h> 22#include <asm/io.h>
23#include <asm/cacheflush.h> 23#include <asm/cacheflush.h>
24#include <asm/sh_bios.h>
25#include <asm/reboot.h>
24 26
25typedef void (*relocate_new_kernel_t)(unsigned long indirection_page, 27typedef void (*relocate_new_kernel_t)(unsigned long indirection_page,
26 unsigned long reboot_code_buffer, 28 unsigned long reboot_code_buffer,
@@ -28,15 +30,11 @@ typedef void (*relocate_new_kernel_t)(unsigned long indirection_page,
28 30
29extern const unsigned char relocate_new_kernel[]; 31extern const unsigned char relocate_new_kernel[];
30extern const unsigned int relocate_new_kernel_size; 32extern const unsigned int relocate_new_kernel_size;
31extern void *gdb_vbr_vector;
32extern void *vbr_base; 33extern void *vbr_base;
33 34
34void machine_shutdown(void) 35void native_machine_crash_shutdown(struct pt_regs *regs)
35{
36}
37
38void machine_crash_shutdown(struct pt_regs *regs)
39{ 36{
37 /* Nothing to do for UP, but definitely broken for SMP.. */
40} 38}
41 39
42/* 40/*
@@ -117,11 +115,7 @@ void machine_kexec(struct kimage *image)
117 kexec_info(image); 115 kexec_info(image);
118 flush_cache_all(); 116 flush_cache_all();
119 117
120#if defined(CONFIG_SH_STANDARD_BIOS) 118 sh_bios_vbr_reload();
121 asm volatile("ldc %0, vbr" :
122 : "r" (((unsigned long) gdb_vbr_vector) - 0x100)
123 : "memory");
124#endif
125 119
126 /* now call it */ 120 /* now call it */
127 rnk = (relocate_new_kernel_t) reboot_code_buffer; 121 rnk = (relocate_new_kernel_t) reboot_code_buffer;
diff --git a/arch/sh/kernel/perf_callchain.c b/arch/sh/kernel/perf_callchain.c
index 24ea837eac5b..a9dd3abde28e 100644
--- a/arch/sh/kernel/perf_callchain.c
+++ b/arch/sh/kernel/perf_callchain.c
@@ -68,9 +68,6 @@ perf_do_callchain(struct pt_regs *regs, struct perf_callchain_entry *entry)
68 68
69 is_user = user_mode(regs); 69 is_user = user_mode(regs);
70 70
71 if (!current || current->pid == 0)
72 return;
73
74 if (is_user && current->state != TASK_RUNNING) 71 if (is_user && current->state != TASK_RUNNING)
75 return; 72 return;
76 73
diff --git a/arch/sh/kernel/process.c b/arch/sh/kernel/process.c
new file mode 100644
index 000000000000..81add9b9ea6e
--- /dev/null
+++ b/arch/sh/kernel/process.c
@@ -0,0 +1,100 @@
1#include <linux/mm.h>
2#include <linux/kernel.h>
3#include <linux/sched.h>
4
5struct kmem_cache *task_xstate_cachep = NULL;
6unsigned int xstate_size;
7
8int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src)
9{
10 *dst = *src;
11
12 if (src->thread.xstate) {
13 dst->thread.xstate = kmem_cache_alloc(task_xstate_cachep,
14 GFP_KERNEL);
15 if (!dst->thread.xstate)
16 return -ENOMEM;
17 memcpy(dst->thread.xstate, src->thread.xstate, xstate_size);
18 }
19
20 return 0;
21}
22
23void free_thread_xstate(struct task_struct *tsk)
24{
25 if (tsk->thread.xstate) {
26 kmem_cache_free(task_xstate_cachep, tsk->thread.xstate);
27 tsk->thread.xstate = NULL;
28 }
29}
30
31#if THREAD_SHIFT < PAGE_SHIFT
32static struct kmem_cache *thread_info_cache;
33
34struct thread_info *alloc_thread_info(struct task_struct *tsk)
35{
36 struct thread_info *ti;
37
38 ti = kmem_cache_alloc(thread_info_cache, GFP_KERNEL);
39 if (unlikely(ti == NULL))
40 return NULL;
41#ifdef CONFIG_DEBUG_STACK_USAGE
42 memset(ti, 0, THREAD_SIZE);
43#endif
44 return ti;
45}
46
47void free_thread_info(struct thread_info *ti)
48{
49 free_thread_xstate(ti->task);
50 kmem_cache_free(thread_info_cache, ti);
51}
52
53void thread_info_cache_init(void)
54{
55 thread_info_cache = kmem_cache_create("thread_info", THREAD_SIZE,
56 THREAD_SIZE, SLAB_PANIC, NULL);
57}
58#else
59struct thread_info *alloc_thread_info(struct task_struct *tsk)
60{
61#ifdef CONFIG_DEBUG_STACK_USAGE
62 gfp_t mask = GFP_KERNEL | __GFP_ZERO;
63#else
64 gfp_t mask = GFP_KERNEL;
65#endif
66 return (struct thread_info *)__get_free_pages(mask, THREAD_SIZE_ORDER);
67}
68
69void free_thread_info(struct thread_info *ti)
70{
71 free_thread_xstate(ti->task);
72 free_pages((unsigned long)ti, THREAD_SIZE_ORDER);
73}
74#endif /* THREAD_SHIFT < PAGE_SHIFT */
75
76void arch_task_cache_init(void)
77{
78 if (!xstate_size)
79 return;
80
81 task_xstate_cachep = kmem_cache_create("task_xstate", xstate_size,
82 __alignof__(union thread_xstate),
83 SLAB_PANIC | SLAB_NOTRACK, NULL);
84}
85
86#ifdef CONFIG_SH_FPU_EMU
87# define HAVE_SOFTFP 1
88#else
89# define HAVE_SOFTFP 0
90#endif
91
92void init_thread_xstate(void)
93{
94 if (boot_cpu_data.flags & CPU_HAS_FPU)
95 xstate_size = sizeof(struct sh_fpu_hard_struct);
96 else if (HAVE_SOFTFP)
97 xstate_size = sizeof(struct sh_fpu_soft_struct);
98 else
99 xstate_size = 0;
100}
diff --git a/arch/sh/kernel/process_32.c b/arch/sh/kernel/process_32.c
index d8af889366a4..3cb88f114d7a 100644
--- a/arch/sh/kernel/process_32.c
+++ b/arch/sh/kernel/process_32.c
@@ -16,65 +16,15 @@
16#include <linux/module.h> 16#include <linux/module.h>
17#include <linux/mm.h> 17#include <linux/mm.h>
18#include <linux/elfcore.h> 18#include <linux/elfcore.h>
19#include <linux/pm.h>
20#include <linux/kallsyms.h> 19#include <linux/kallsyms.h>
21#include <linux/kexec.h>
22#include <linux/kdebug.h>
23#include <linux/tick.h>
24#include <linux/reboot.h>
25#include <linux/fs.h> 20#include <linux/fs.h>
26#include <linux/ftrace.h> 21#include <linux/ftrace.h>
27#include <linux/preempt.h> 22#include <linux/hw_breakpoint.h>
28#include <asm/uaccess.h> 23#include <asm/uaccess.h>
29#include <asm/mmu_context.h> 24#include <asm/mmu_context.h>
30#include <asm/pgalloc.h>
31#include <asm/system.h> 25#include <asm/system.h>
32#include <asm/ubc.h>
33#include <asm/fpu.h> 26#include <asm/fpu.h>
34#include <asm/syscalls.h> 27#include <asm/syscalls.h>
35#include <asm/watchdog.h>
36
37int ubc_usercnt = 0;
38
39#ifdef CONFIG_32BIT
40static void watchdog_trigger_immediate(void)
41{
42 sh_wdt_write_cnt(0xFF);
43 sh_wdt_write_csr(0xC2);
44}
45
46void machine_restart(char * __unused)
47{
48 local_irq_disable();
49
50 /* Use watchdog timer to trigger reset */
51 watchdog_trigger_immediate();
52
53 while (1)
54 cpu_sleep();
55}
56#else
57void machine_restart(char * __unused)
58{
59 /* SR.BL=1 and invoke address error to let CPU reset (manual reset) */
60 asm volatile("ldc %0, sr\n\t"
61 "mov.l @%1, %0" : : "r" (0x10000000), "r" (0x80000001));
62}
63#endif
64
65void machine_halt(void)
66{
67 local_irq_disable();
68
69 while (1)
70 cpu_sleep();
71}
72
73void machine_power_off(void)
74{
75 if (pm_power_off)
76 pm_power_off();
77}
78 28
79void show_regs(struct pt_regs * regs) 29void show_regs(struct pt_regs * regs)
80{ 30{
@@ -91,7 +41,7 @@ void show_regs(struct pt_regs * regs)
91 printk("PC : %08lx SP : %08lx SR : %08lx ", 41 printk("PC : %08lx SP : %08lx SR : %08lx ",
92 regs->pc, regs->regs[15], regs->sr); 42 regs->pc, regs->regs[15], regs->sr);
93#ifdef CONFIG_MMU 43#ifdef CONFIG_MMU
94 printk("TEA : %08x\n", ctrl_inl(MMU_TEA)); 44 printk("TEA : %08x\n", __raw_readl(MMU_TEA));
95#else 45#else
96 printk("\n"); 46 printk("\n");
97#endif 47#endif
@@ -147,21 +97,34 @@ int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
147} 97}
148EXPORT_SYMBOL(kernel_thread); 98EXPORT_SYMBOL(kernel_thread);
149 99
100void start_thread(struct pt_regs *regs, unsigned long new_pc,
101 unsigned long new_sp)
102{
103 set_fs(USER_DS);
104
105 regs->pr = 0;
106 regs->sr = SR_FD;
107 regs->pc = new_pc;
108 regs->regs[15] = new_sp;
109
110 free_thread_xstate(current);
111}
112EXPORT_SYMBOL(start_thread);
113
150/* 114/*
151 * Free current thread data structures etc.. 115 * Free current thread data structures etc..
152 */ 116 */
153void exit_thread(void) 117void exit_thread(void)
154{ 118{
155 if (current->thread.ubc_pc) {
156 current->thread.ubc_pc = 0;
157 ubc_usercnt -= 1;
158 }
159} 119}
160 120
161void flush_thread(void) 121void flush_thread(void)
162{ 122{
163#if defined(CONFIG_SH_FPU)
164 struct task_struct *tsk = current; 123 struct task_struct *tsk = current;
124
125 flush_ptrace_hw_breakpoint(tsk);
126
127#if defined(CONFIG_SH_FPU)
165 /* Forget lazy FPU state */ 128 /* Forget lazy FPU state */
166 clear_fpu(tsk, task_pt_regs(tsk)); 129 clear_fpu(tsk, task_pt_regs(tsk));
167 clear_used_math(); 130 clear_used_math();
@@ -209,11 +172,10 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
209{ 172{
210 struct thread_info *ti = task_thread_info(p); 173 struct thread_info *ti = task_thread_info(p);
211 struct pt_regs *childregs; 174 struct pt_regs *childregs;
175
212#if defined(CONFIG_SH_DSP) 176#if defined(CONFIG_SH_DSP)
213 struct task_struct *tsk = current; 177 struct task_struct *tsk = current;
214#endif
215 178
216#if defined(CONFIG_SH_DSP)
217 if (is_dsp_enabled(tsk)) { 179 if (is_dsp_enabled(tsk)) {
218 /* We can use the __save_dsp or just copy the struct: 180 /* We can use the __save_dsp or just copy the struct:
219 * __save_dsp(p); 181 * __save_dsp(p);
@@ -244,53 +206,11 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
244 p->thread.sp = (unsigned long) childregs; 206 p->thread.sp = (unsigned long) childregs;
245 p->thread.pc = (unsigned long) ret_from_fork; 207 p->thread.pc = (unsigned long) ret_from_fork;
246 208
247 p->thread.ubc_pc = 0; 209 memset(p->thread.ptrace_bps, 0, sizeof(p->thread.ptrace_bps));
248 210
249 return 0; 211 return 0;
250} 212}
251 213
252/* Tracing by user break controller. */
253static void ubc_set_tracing(int asid, unsigned long pc)
254{
255#if defined(CONFIG_CPU_SH4A)
256 unsigned long val;
257
258 val = (UBC_CBR_ID_INST | UBC_CBR_RW_READ | UBC_CBR_CE);
259 val |= (UBC_CBR_AIE | UBC_CBR_AIV_SET(asid));
260
261 ctrl_outl(val, UBC_CBR0);
262 ctrl_outl(pc, UBC_CAR0);
263 ctrl_outl(0x0, UBC_CAMR0);
264 ctrl_outl(0x0, UBC_CBCR);
265
266 val = (UBC_CRR_RES | UBC_CRR_PCB | UBC_CRR_BIE);
267 ctrl_outl(val, UBC_CRR0);
268
269 /* Read UBC register that we wrote last, for checking update */
270 val = ctrl_inl(UBC_CRR0);
271
272#else /* CONFIG_CPU_SH4A */
273 ctrl_outl(pc, UBC_BARA);
274
275#ifdef CONFIG_MMU
276 ctrl_outb(asid, UBC_BASRA);
277#endif
278
279 ctrl_outl(0, UBC_BAMRA);
280
281 if (current_cpu_data.type == CPU_SH7729 ||
282 current_cpu_data.type == CPU_SH7710 ||
283 current_cpu_data.type == CPU_SH7712 ||
284 current_cpu_data.type == CPU_SH7203){
285 ctrl_outw(BBR_INST | BBR_READ | BBR_CPU, UBC_BBRA);
286 ctrl_outl(BRCR_PCBA | BRCR_PCTE, UBC_BRCR);
287 } else {
288 ctrl_outw(BBR_INST | BBR_READ, UBC_BBRA);
289 ctrl_outw(BRCR_PCBA, UBC_BRCR);
290 }
291#endif /* CONFIG_CPU_SH4A */
292}
293
294/* 214/*
295 * switch_to(x,y) should switch tasks from x to y. 215 * switch_to(x,y) should switch tasks from x to y.
296 * 216 *
@@ -304,7 +224,7 @@ __switch_to(struct task_struct *prev, struct task_struct *next)
304 224
305 /* we're going to use this soon, after a few expensive things */ 225 /* we're going to use this soon, after a few expensive things */
306 if (next->fpu_counter > 5) 226 if (next->fpu_counter > 5)
307 prefetch(&next_t->fpu.hard); 227 prefetch(next_t->xstate);
308 228
309#ifdef CONFIG_MMU 229#ifdef CONFIG_MMU
310 /* 230 /*
@@ -316,32 +236,13 @@ __switch_to(struct task_struct *prev, struct task_struct *next)
316 : "r" (task_thread_info(next))); 236 : "r" (task_thread_info(next)));
317#endif 237#endif
318 238
319 /* If no tasks are using the UBC, we're done */
320 if (ubc_usercnt == 0)
321 /* If no tasks are using the UBC, we're done */;
322 else if (next->thread.ubc_pc && next->mm) {
323 int asid = 0;
324#ifdef CONFIG_MMU
325 asid |= cpu_asid(smp_processor_id(), next->mm);
326#endif
327 ubc_set_tracing(asid, next->thread.ubc_pc);
328 } else {
329#if defined(CONFIG_CPU_SH4A)
330 ctrl_outl(UBC_CBR_INIT, UBC_CBR0);
331 ctrl_outl(UBC_CRR_INIT, UBC_CRR0);
332#else
333 ctrl_outw(0, UBC_BBRA);
334 ctrl_outw(0, UBC_BBRB);
335#endif
336 }
337
338 /* 239 /*
339 * If the task has used fpu the last 5 timeslices, just do a full 240 * If the task has used fpu the last 5 timeslices, just do a full
340 * restore of the math state immediately to avoid the trap; the 241 * restore of the math state immediately to avoid the trap; the
341 * chances of needing FPU soon are obviously high now 242 * chances of needing FPU soon are obviously high now
342 */ 243 */
343 if (next->fpu_counter > 5) 244 if (next->fpu_counter > 5)
344 fpu_state_restore(task_pt_regs(next)); 245 __fpu_state_restore();
345 246
346 return prev; 247 return prev;
347} 248}
@@ -434,20 +335,3 @@ unsigned long get_wchan(struct task_struct *p)
434 335
435 return pc; 336 return pc;
436} 337}
437
438asmlinkage void break_point_trap(void)
439{
440 /* Clear tracing. */
441#if defined(CONFIG_CPU_SH4A)
442 ctrl_outl(UBC_CBR_INIT, UBC_CBR0);
443 ctrl_outl(UBC_CRR_INIT, UBC_CRR0);
444#else
445 ctrl_outw(0, UBC_BBRA);
446 ctrl_outw(0, UBC_BBRB);
447 ctrl_outl(0, UBC_BRCR);
448#endif
449 current->thread.ubc_pc = 0;
450 ubc_usercnt -= 1;
451
452 force_sig(SIGTRAP, current);
453}
diff --git a/arch/sh/kernel/process_64.c b/arch/sh/kernel/process_64.c
index ec79faf6f021..c90957a459ac 100644
--- a/arch/sh/kernel/process_64.c
+++ b/arch/sh/kernel/process_64.c
@@ -32,30 +32,7 @@
32 32
33struct task_struct *last_task_used_math = NULL; 33struct task_struct *last_task_used_math = NULL;
34 34
35void machine_restart(char * __unused) 35void show_regs(struct pt_regs *regs)
36{
37 extern void phys_stext(void);
38
39 phys_stext();
40}
41
42void machine_halt(void)
43{
44 for (;;);
45}
46
47void machine_power_off(void)
48{
49 __asm__ __volatile__ (
50 "sleep\n\t"
51 "synci\n\t"
52 "nop;nop;nop;nop\n\t"
53 );
54
55 panic("Unexpected wakeup!\n");
56}
57
58void show_regs(struct pt_regs * regs)
59{ 36{
60 unsigned long long ah, al, bh, bl, ch, cl; 37 unsigned long long ah, al, bh, bl, ch, cl;
61 38
@@ -410,7 +387,7 @@ int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu)
410 regs->sr |= SR_FD; 387 regs->sr |= SR_FD;
411 } 388 }
412 389
413 memcpy(fpu, &tsk->thread.fpu.hard, sizeof(*fpu)); 390 memcpy(fpu, &tsk->thread.xstate->hardfpu, sizeof(*fpu));
414 } 391 }
415 392
416 return fpvalid; 393 return fpvalid;
diff --git a/arch/sh/kernel/ptrace_32.c b/arch/sh/kernel/ptrace_32.c
index 9be35f348093..c625cdab76dd 100644
--- a/arch/sh/kernel/ptrace_32.c
+++ b/arch/sh/kernel/ptrace_32.c
@@ -2,7 +2,7 @@
2 * SuperH process tracing 2 * SuperH process tracing
3 * 3 *
4 * Copyright (C) 1999, 2000 Kaz Kojima & Niibe Yutaka 4 * Copyright (C) 1999, 2000 Kaz Kojima & Niibe Yutaka
5 * Copyright (C) 2002 - 2008 Paul Mundt 5 * Copyright (C) 2002 - 2009 Paul Mundt
6 * 6 *
7 * Audit support by Yuichi Nakamura <ynakam@hitachisoft.jp> 7 * Audit support by Yuichi Nakamura <ynakam@hitachisoft.jp>
8 * 8 *
@@ -26,6 +26,7 @@
26#include <linux/tracehook.h> 26#include <linux/tracehook.h>
27#include <linux/elf.h> 27#include <linux/elf.h>
28#include <linux/regset.h> 28#include <linux/regset.h>
29#include <linux/hw_breakpoint.h>
29#include <asm/uaccess.h> 30#include <asm/uaccess.h>
30#include <asm/pgtable.h> 31#include <asm/pgtable.h>
31#include <asm/system.h> 32#include <asm/system.h>
@@ -63,33 +64,64 @@ static inline int put_stack_long(struct task_struct *task, int offset,
63 return 0; 64 return 0;
64} 65}
65 66
66void user_enable_single_step(struct task_struct *child) 67void ptrace_triggered(struct perf_event *bp, int nmi,
68 struct perf_sample_data *data, struct pt_regs *regs)
67{ 69{
68 /* Next scheduling will set up UBC */ 70 struct perf_event_attr attr;
69 if (child->thread.ubc_pc == 0) 71
70 ubc_usercnt += 1; 72 /*
73 * Disable the breakpoint request here since ptrace has defined a
74 * one-shot behaviour for breakpoint exceptions.
75 */
76 attr = bp->attr;
77 attr.disabled = true;
78 modify_user_hw_breakpoint(bp, &attr);
79}
80
81static int set_single_step(struct task_struct *tsk, unsigned long addr)
82{
83 struct thread_struct *thread = &tsk->thread;
84 struct perf_event *bp;
85 struct perf_event_attr attr;
86
87 bp = thread->ptrace_bps[0];
88 if (!bp) {
89 hw_breakpoint_init(&attr);
90
91 attr.bp_addr = addr;
92 attr.bp_len = HW_BREAKPOINT_LEN_2;
93 attr.bp_type = HW_BREAKPOINT_R;
94
95 bp = register_user_hw_breakpoint(&attr, ptrace_triggered, tsk);
96 if (IS_ERR(bp))
97 return PTR_ERR(bp);
98
99 thread->ptrace_bps[0] = bp;
100 } else {
101 int err;
102
103 attr = bp->attr;
104 attr.bp_addr = addr;
105 err = modify_user_hw_breakpoint(bp, &attr);
106 if (unlikely(err))
107 return err;
108 }
109
110 return 0;
111}
71 112
72 child->thread.ubc_pc = get_stack_long(child, 113void user_enable_single_step(struct task_struct *child)
73 offsetof(struct pt_regs, pc)); 114{
115 unsigned long pc = get_stack_long(child, offsetof(struct pt_regs, pc));
74 116
75 set_tsk_thread_flag(child, TIF_SINGLESTEP); 117 set_tsk_thread_flag(child, TIF_SINGLESTEP);
118
119 set_single_step(child, pc);
76} 120}
77 121
78void user_disable_single_step(struct task_struct *child) 122void user_disable_single_step(struct task_struct *child)
79{ 123{
80 clear_tsk_thread_flag(child, TIF_SINGLESTEP); 124 clear_tsk_thread_flag(child, TIF_SINGLESTEP);
81
82 /*
83 * Ensure the UBC is not programmed at the next context switch.
84 *
85 * Normally this is not needed but there are sequences such as
86 * singlestep, signal delivery, and continue that leave the
87 * ubc_pc non-zero leading to spurious SIGTRAPs.
88 */
89 if (child->thread.ubc_pc != 0) {
90 ubc_usercnt -= 1;
91 child->thread.ubc_pc = 0;
92 }
93} 125}
94 126
95/* 127/*
@@ -163,10 +195,10 @@ int fpregs_get(struct task_struct *target,
163 195
164 if ((boot_cpu_data.flags & CPU_HAS_FPU)) 196 if ((boot_cpu_data.flags & CPU_HAS_FPU))
165 return user_regset_copyout(&pos, &count, &kbuf, &ubuf, 197 return user_regset_copyout(&pos, &count, &kbuf, &ubuf,
166 &target->thread.fpu.hard, 0, -1); 198 &target->thread.xstate->hardfpu, 0, -1);
167 199
168 return user_regset_copyout(&pos, &count, &kbuf, &ubuf, 200 return user_regset_copyout(&pos, &count, &kbuf, &ubuf,
169 &target->thread.fpu.soft, 0, -1); 201 &target->thread.xstate->softfpu, 0, -1);
170} 202}
171 203
172static int fpregs_set(struct task_struct *target, 204static int fpregs_set(struct task_struct *target,
@@ -184,10 +216,10 @@ static int fpregs_set(struct task_struct *target,
184 216
185 if ((boot_cpu_data.flags & CPU_HAS_FPU)) 217 if ((boot_cpu_data.flags & CPU_HAS_FPU))
186 return user_regset_copyin(&pos, &count, &kbuf, &ubuf, 218 return user_regset_copyin(&pos, &count, &kbuf, &ubuf,
187 &target->thread.fpu.hard, 0, -1); 219 &target->thread.xstate->hardfpu, 0, -1);
188 220
189 return user_regset_copyin(&pos, &count, &kbuf, &ubuf, 221 return user_regset_copyin(&pos, &count, &kbuf, &ubuf,
190 &target->thread.fpu.soft, 0, -1); 222 &target->thread.xstate->softfpu, 0, -1);
191} 223}
192 224
193static int fpregs_active(struct task_struct *target, 225static int fpregs_active(struct task_struct *target,
@@ -333,7 +365,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
333 else 365 else
334 tmp = 0; 366 tmp = 0;
335 } else 367 } else
336 tmp = ((long *)&child->thread.fpu) 368 tmp = ((long *)child->thread.xstate)
337 [(addr - (long)&dummy->fpu) >> 2]; 369 [(addr - (long)&dummy->fpu) >> 2];
338 } else if (addr == (long) &dummy->u_fpvalid) 370 } else if (addr == (long) &dummy->u_fpvalid)
339 tmp = !!tsk_used_math(child); 371 tmp = !!tsk_used_math(child);
@@ -362,7 +394,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
362 else if (addr >= (long) &dummy->fpu && 394 else if (addr >= (long) &dummy->fpu &&
363 addr < (long) &dummy->u_fpvalid) { 395 addr < (long) &dummy->u_fpvalid) {
364 set_stopped_child_used_math(child); 396 set_stopped_child_used_math(child);
365 ((long *)&child->thread.fpu) 397 ((long *)child->thread.xstate)
366 [(addr - (long)&dummy->fpu) >> 2] = data; 398 [(addr - (long)&dummy->fpu) >> 2] = data;
367 ret = 0; 399 ret = 0;
368 } else if (addr == (long) &dummy->u_fpvalid) { 400 } else if (addr == (long) &dummy->u_fpvalid) {
diff --git a/arch/sh/kernel/ptrace_64.c b/arch/sh/kernel/ptrace_64.c
index 873ebdc4f98e..5fd644da7f02 100644
--- a/arch/sh/kernel/ptrace_64.c
+++ b/arch/sh/kernel/ptrace_64.c
@@ -88,7 +88,7 @@ get_fpu_long(struct task_struct *task, unsigned long addr)
88 regs->sr |= SR_FD; 88 regs->sr |= SR_FD;
89 } 89 }
90 90
91 tmp = ((long *)&task->thread.fpu)[addr / sizeof(unsigned long)]; 91 tmp = ((long *)task->thread.xstate)[addr / sizeof(unsigned long)];
92 return tmp; 92 return tmp;
93} 93}
94 94
@@ -114,8 +114,7 @@ put_fpu_long(struct task_struct *task, unsigned long addr, unsigned long data)
114 regs = (struct pt_regs*)((unsigned char *)task + THREAD_SIZE) - 1; 114 regs = (struct pt_regs*)((unsigned char *)task + THREAD_SIZE) - 1;
115 115
116 if (!tsk_used_math(task)) { 116 if (!tsk_used_math(task)) {
117 fpinit(&task->thread.fpu.hard); 117 init_fpu(task);
118 set_stopped_child_used_math(task);
119 } else if (last_task_used_math == task) { 118 } else if (last_task_used_math == task) {
120 enable_fpu(); 119 enable_fpu();
121 save_fpu(task); 120 save_fpu(task);
@@ -124,7 +123,7 @@ put_fpu_long(struct task_struct *task, unsigned long addr, unsigned long data)
124 regs->sr |= SR_FD; 123 regs->sr |= SR_FD;
125 } 124 }
126 125
127 ((long *)&task->thread.fpu)[addr / sizeof(unsigned long)] = data; 126 ((long *)task->thread.xstate)[addr / sizeof(unsigned long)] = data;
128 return 0; 127 return 0;
129} 128}
130 129
@@ -133,6 +132,8 @@ void user_enable_single_step(struct task_struct *child)
133 struct pt_regs *regs = child->thread.uregs; 132 struct pt_regs *regs = child->thread.uregs;
134 133
135 regs->sr |= SR_SSTEP; /* auto-resetting upon exception */ 134 regs->sr |= SR_SSTEP; /* auto-resetting upon exception */
135
136 set_tsk_thread_flag(child, TIF_SINGLESTEP);
136} 137}
137 138
138void user_disable_single_step(struct task_struct *child) 139void user_disable_single_step(struct task_struct *child)
@@ -140,6 +141,8 @@ void user_disable_single_step(struct task_struct *child)
140 struct pt_regs *regs = child->thread.uregs; 141 struct pt_regs *regs = child->thread.uregs;
141 142
142 regs->sr &= ~SR_SSTEP; 143 regs->sr &= ~SR_SSTEP;
144
145 clear_tsk_thread_flag(child, TIF_SINGLESTEP);
143} 146}
144 147
145static int genregs_get(struct task_struct *target, 148static int genregs_get(struct task_struct *target,
@@ -222,7 +225,7 @@ int fpregs_get(struct task_struct *target,
222 return ret; 225 return ret;
223 226
224 return user_regset_copyout(&pos, &count, &kbuf, &ubuf, 227 return user_regset_copyout(&pos, &count, &kbuf, &ubuf,
225 &target->thread.fpu.hard, 0, -1); 228 &target->thread.xstate->hardfpu, 0, -1);
226} 229}
227 230
228static int fpregs_set(struct task_struct *target, 231static int fpregs_set(struct task_struct *target,
@@ -239,7 +242,7 @@ static int fpregs_set(struct task_struct *target,
239 set_stopped_child_used_math(target); 242 set_stopped_child_used_math(target);
240 243
241 return user_regset_copyin(&pos, &count, &kbuf, &ubuf, 244 return user_regset_copyin(&pos, &count, &kbuf, &ubuf,
242 &target->thread.fpu.hard, 0, -1); 245 &target->thread.xstate->hardfpu, 0, -1);
243} 246}
244 247
245static int fpregs_active(struct task_struct *target, 248static int fpregs_active(struct task_struct *target,
@@ -454,6 +457,8 @@ asmlinkage long long do_syscall_trace_enter(struct pt_regs *regs)
454 457
455asmlinkage void do_syscall_trace_leave(struct pt_regs *regs) 458asmlinkage void do_syscall_trace_leave(struct pt_regs *regs)
456{ 459{
460 int step;
461
457 if (unlikely(current->audit_context)) 462 if (unlikely(current->audit_context))
458 audit_syscall_exit(AUDITSC_RESULT(regs->regs[9]), 463 audit_syscall_exit(AUDITSC_RESULT(regs->regs[9]),
459 regs->regs[9]); 464 regs->regs[9]);
@@ -461,8 +466,9 @@ asmlinkage void do_syscall_trace_leave(struct pt_regs *regs)
461 if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT))) 466 if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT)))
462 trace_sys_exit(regs, regs->regs[9]); 467 trace_sys_exit(regs, regs->regs[9]);
463 468
464 if (test_thread_flag(TIF_SYSCALL_TRACE)) 469 step = test_thread_flag(TIF_SINGLESTEP);
465 tracehook_report_syscall_exit(regs, 0); 470 if (step || test_thread_flag(TIF_SYSCALL_TRACE))
471 tracehook_report_syscall_exit(regs, step);
466} 472}
467 473
468/* Called with interrupts disabled */ 474/* Called with interrupts disabled */
@@ -479,9 +485,10 @@ asmlinkage void do_single_step(unsigned long long vec, struct pt_regs *regs)
479} 485}
480 486
481/* Called with interrupts disabled */ 487/* Called with interrupts disabled */
482asmlinkage void do_software_break_point(unsigned long long vec, 488BUILD_TRAP_HANDLER(breakpoint)
483 struct pt_regs *regs)
484{ 489{
490 TRAP_HANDLER_DECL;
491
485 /* We need to forward step the PC, to counteract the backstep done 492 /* We need to forward step the PC, to counteract the backstep done
486 in signal.c. */ 493 in signal.c. */
487 local_irq_enable(); 494 local_irq_enable();
diff --git a/arch/sh/kernel/reboot.c b/arch/sh/kernel/reboot.c
new file mode 100644
index 000000000000..b1fca66bb92e
--- /dev/null
+++ b/arch/sh/kernel/reboot.c
@@ -0,0 +1,98 @@
1#include <linux/pm.h>
2#include <linux/kexec.h>
3#include <linux/kernel.h>
4#include <linux/reboot.h>
5#include <linux/module.h>
6#ifdef CONFIG_SUPERH32
7#include <asm/watchdog.h>
8#endif
9#include <asm/addrspace.h>
10#include <asm/reboot.h>
11#include <asm/system.h>
12
13void (*pm_power_off)(void);
14EXPORT_SYMBOL(pm_power_off);
15
16#ifdef CONFIG_SUPERH32
17static void watchdog_trigger_immediate(void)
18{
19 sh_wdt_write_cnt(0xFF);
20 sh_wdt_write_csr(0xC2);
21}
22#endif
23
24static void native_machine_restart(char * __unused)
25{
26 local_irq_disable();
27
28 /* Address error with SR.BL=1 first. */
29 trigger_address_error();
30
31#ifdef CONFIG_SUPERH32
32 /* If that fails or is unsupported, go for the watchdog next. */
33 watchdog_trigger_immediate();
34#endif
35
36 /*
37 * Give up and sleep.
38 */
39 while (1)
40 cpu_sleep();
41}
42
43static void native_machine_shutdown(void)
44{
45 smp_send_stop();
46}
47
48static void native_machine_power_off(void)
49{
50 if (pm_power_off)
51 pm_power_off();
52}
53
54static void native_machine_halt(void)
55{
56 /* stop other cpus */
57 machine_shutdown();
58
59 /* stop this cpu */
60 stop_this_cpu(NULL);
61}
62
63struct machine_ops machine_ops = {
64 .power_off = native_machine_power_off,
65 .shutdown = native_machine_shutdown,
66 .restart = native_machine_restart,
67 .halt = native_machine_halt,
68#ifdef CONFIG_KEXEC
69 .crash_shutdown = native_machine_crash_shutdown,
70#endif
71};
72
73void machine_power_off(void)
74{
75 machine_ops.power_off();
76}
77
78void machine_shutdown(void)
79{
80 machine_ops.shutdown();
81}
82
83void machine_restart(char *cmd)
84{
85 machine_ops.restart(cmd);
86}
87
88void machine_halt(void)
89{
90 machine_ops.halt();
91}
92
93#ifdef CONFIG_KEXEC
94void machine_crash_shutdown(struct pt_regs *regs)
95{
96 machine_ops.crash_shutdown(regs);
97}
98#endif
diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c
index 8b0e69792cf4..3459e70eed72 100644
--- a/arch/sh/kernel/setup.c
+++ b/arch/sh/kernel/setup.c
@@ -421,6 +421,8 @@ void __init setup_arch(char **cmdline_p)
421 421
422 parse_early_param(); 422 parse_early_param();
423 423
424 uncached_init();
425
424 plat_early_device_setup(); 426 plat_early_device_setup();
425 427
426 /* Let earlyprintk output early console messages */ 428 /* Let earlyprintk output early console messages */
@@ -449,17 +451,15 @@ void __init setup_arch(char **cmdline_p)
449#ifdef CONFIG_DUMMY_CONSOLE 451#ifdef CONFIG_DUMMY_CONSOLE
450 conswitchp = &dummy_con; 452 conswitchp = &dummy_con;
451#endif 453#endif
454 paging_init();
455 pmb_init();
456
457 ioremap_fixed_init();
452 458
453 /* Perform the machine specific initialisation */ 459 /* Perform the machine specific initialisation */
454 if (likely(sh_mv.mv_setup)) 460 if (likely(sh_mv.mv_setup))
455 sh_mv.mv_setup(cmdline_p); 461 sh_mv.mv_setup(cmdline_p);
456 462
457 paging_init();
458
459#ifdef CONFIG_PMB_ENABLE
460 pmb_init();
461#endif
462
463#ifdef CONFIG_SMP 463#ifdef CONFIG_SMP
464 plat_smp_setup(); 464 plat_smp_setup();
465#endif 465#endif
diff --git a/arch/sh/kernel/sh_bios.c b/arch/sh/kernel/sh_bios.c
index c852f7805728..47475cca068a 100644
--- a/arch/sh/kernel/sh_bios.c
+++ b/arch/sh/kernel/sh_bios.c
@@ -1,19 +1,30 @@
1/* 1/*
2 * linux/arch/sh/kernel/sh_bios.c
3 * C interface for trapping into the standard LinuxSH BIOS. 2 * C interface for trapping into the standard LinuxSH BIOS.
4 * 3 *
5 * Copyright (C) 2000 Greg Banks, Mitch Davis 4 * Copyright (C) 2000 Greg Banks, Mitch Davis
5 * Copyright (C) 1999, 2000 Niibe Yutaka
6 * Copyright (C) 2002 M. R. Brown
7 * Copyright (C) 2004 - 2010 Paul Mundt
6 * 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.
7 */ 12 */
8#include <linux/module.h> 13#include <linux/module.h>
14#include <linux/console.h>
15#include <linux/tty.h>
16#include <linux/init.h>
17#include <linux/io.h>
18#include <linux/delay.h>
9#include <asm/sh_bios.h> 19#include <asm/sh_bios.h>
10 20
11#define BIOS_CALL_CONSOLE_WRITE 0 21#define BIOS_CALL_CONSOLE_WRITE 0
12#define BIOS_CALL_ETH_NODE_ADDR 10 22#define BIOS_CALL_ETH_NODE_ADDR 10
13#define BIOS_CALL_SHUTDOWN 11 23#define BIOS_CALL_SHUTDOWN 11
14#define BIOS_CALL_CHAR_OUT 0x1f /* TODO: hack */
15#define BIOS_CALL_GDB_DETACH 0xff 24#define BIOS_CALL_GDB_DETACH 0xff
16 25
26void *gdb_vbr_vector = NULL;
27
17static inline long sh_bios_call(long func, long arg0, long arg1, long arg2, 28static inline long sh_bios_call(long func, long arg0, long arg1, long arg2,
18 long arg3) 29 long arg3)
19{ 30{
@@ -23,6 +34,9 @@ static inline long sh_bios_call(long func, long arg0, long arg1, long arg2,
23 register long r6 __asm__("r6") = arg2; 34 register long r6 __asm__("r6") = arg2;
24 register long r7 __asm__("r7") = arg3; 35 register long r7 __asm__("r7") = arg3;
25 36
37 if (!gdb_vbr_vector)
38 return -ENOSYS;
39
26 __asm__ __volatile__("trapa #0x3f":"=z"(r0) 40 __asm__ __volatile__("trapa #0x3f":"=z"(r0)
27 :"0"(r0), "r"(r4), "r"(r5), "r"(r6), "r"(r7) 41 :"0"(r0), "r"(r4), "r"(r5), "r"(r6), "r"(r7)
28 :"memory"); 42 :"memory");
@@ -34,11 +48,6 @@ void sh_bios_console_write(const char *buf, unsigned int len)
34 sh_bios_call(BIOS_CALL_CONSOLE_WRITE, (long)buf, (long)len, 0, 0); 48 sh_bios_call(BIOS_CALL_CONSOLE_WRITE, (long)buf, (long)len, 0, 0);
35} 49}
36 50
37void sh_bios_char_out(char ch)
38{
39 sh_bios_call(BIOS_CALL_CHAR_OUT, ch, 0, 0, 0);
40}
41
42void sh_bios_gdb_detach(void) 51void sh_bios_gdb_detach(void)
43{ 52{
44 sh_bios_call(BIOS_CALL_GDB_DETACH, 0, 0, 0, 0); 53 sh_bios_call(BIOS_CALL_GDB_DETACH, 0, 0, 0, 0);
@@ -55,3 +64,109 @@ void sh_bios_shutdown(unsigned int how)
55{ 64{
56 sh_bios_call(BIOS_CALL_SHUTDOWN, how, 0, 0, 0); 65 sh_bios_call(BIOS_CALL_SHUTDOWN, how, 0, 0, 0);
57} 66}
67
68/*
69 * Read the old value of the VBR register to initialise the vector
70 * through which debug and BIOS traps are delegated by the Linux trap
71 * handler.
72 */
73void sh_bios_vbr_init(void)
74{
75 unsigned long vbr;
76
77 if (unlikely(gdb_vbr_vector))
78 return;
79
80 __asm__ __volatile__ ("stc vbr, %0" : "=r" (vbr));
81
82 if (vbr) {
83 gdb_vbr_vector = (void *)(vbr + 0x100);
84 printk(KERN_NOTICE "Setting GDB trap vector to %p\n",
85 gdb_vbr_vector);
86 } else
87 printk(KERN_NOTICE "SH-BIOS not detected\n");
88}
89
90/**
91 * sh_bios_vbr_reload - Re-load the system VBR from the BIOS vector.
92 *
93 * This can be used by save/restore code to reinitialize the system VBR
94 * from the fixed BIOS VBR. A no-op if no BIOS VBR is known.
95 */
96void sh_bios_vbr_reload(void)
97{
98 if (gdb_vbr_vector)
99 __asm__ __volatile__ (
100 "ldc %0, vbr"
101 :
102 : "r" (((unsigned long) gdb_vbr_vector) - 0x100)
103 : "memory"
104 );
105}
106
107/*
108 * Print a string through the BIOS
109 */
110static void sh_console_write(struct console *co, const char *s,
111 unsigned count)
112{
113 sh_bios_console_write(s, count);
114}
115
116/*
117 * Setup initial baud/bits/parity. We do two things here:
118 * - construct a cflag setting for the first rs_open()
119 * - initialize the serial port
120 * Return non-zero if we didn't find a serial port.
121 */
122static int __init sh_console_setup(struct console *co, char *options)
123{
124 int cflag = CREAD | HUPCL | CLOCAL;
125
126 /*
127 * Now construct a cflag setting.
128 * TODO: this is a totally bogus cflag, as we have
129 * no idea what serial settings the BIOS is using, or
130 * even if its using the serial port at all.
131 */
132 cflag |= B115200 | CS8 | /*no parity*/0;
133
134 co->cflag = cflag;
135
136 return 0;
137}
138
139static struct console bios_console = {
140 .name = "bios",
141 .write = sh_console_write,
142 .setup = sh_console_setup,
143 .flags = CON_PRINTBUFFER,
144 .index = -1,
145};
146
147static struct console *early_console;
148
149static int __init setup_early_printk(char *buf)
150{
151 int keep_early = 0;
152
153 if (!buf)
154 return 0;
155
156 if (strstr(buf, "keep"))
157 keep_early = 1;
158
159 if (!strncmp(buf, "bios", 4))
160 early_console = &bios_console;
161
162 if (likely(early_console)) {
163 if (keep_early)
164 early_console->flags &= ~CON_BOOT;
165 else
166 early_console->flags |= CON_BOOT;
167 register_console(early_console);
168 }
169
170 return 0;
171}
172early_param("earlyprintk", setup_early_printk);
diff --git a/arch/sh/kernel/signal_32.c b/arch/sh/kernel/signal_32.c
index 12815ce01ecd..579cd2ca358d 100644
--- a/arch/sh/kernel/signal_32.c
+++ b/arch/sh/kernel/signal_32.c
@@ -150,7 +150,7 @@ static inline int restore_sigcontext_fpu(struct sigcontext __user *sc)
150 return 0; 150 return 0;
151 151
152 set_used_math(); 152 set_used_math();
153 return __copy_from_user(&tsk->thread.fpu.hard, &sc->sc_fpregs[0], 153 return __copy_from_user(&tsk->thread.xstate->hardfpu, &sc->sc_fpregs[0],
154 sizeof(long)*(16*2+2)); 154 sizeof(long)*(16*2+2));
155} 155}
156 156
@@ -175,7 +175,7 @@ static inline int save_sigcontext_fpu(struct sigcontext __user *sc,
175 clear_used_math(); 175 clear_used_math();
176 176
177 unlazy_fpu(tsk, regs); 177 unlazy_fpu(tsk, regs);
178 return __copy_to_user(&sc->sc_fpregs[0], &tsk->thread.fpu.hard, 178 return __copy_to_user(&sc->sc_fpregs[0], &tsk->thread.xstate->hardfpu,
179 sizeof(long)*(16*2+2)); 179 sizeof(long)*(16*2+2));
180} 180}
181#endif /* CONFIG_SH_FPU */ 181#endif /* CONFIG_SH_FPU */
@@ -528,7 +528,7 @@ handle_syscall_restart(unsigned long save_r0, struct pt_regs *regs,
528 /* fallthrough */ 528 /* fallthrough */
529 case -ERESTARTNOINTR: 529 case -ERESTARTNOINTR:
530 regs->regs[0] = save_r0; 530 regs->regs[0] = save_r0;
531 regs->pc -= instruction_size(ctrl_inw(regs->pc - 4)); 531 regs->pc -= instruction_size(__raw_readw(regs->pc - 4));
532 break; 532 break;
533 } 533 }
534} 534}
@@ -626,9 +626,9 @@ no_signal:
626 regs->regs[0] == -ERESTARTSYS || 626 regs->regs[0] == -ERESTARTSYS ||
627 regs->regs[0] == -ERESTARTNOINTR) { 627 regs->regs[0] == -ERESTARTNOINTR) {
628 regs->regs[0] = save_r0; 628 regs->regs[0] = save_r0;
629 regs->pc -= instruction_size(ctrl_inw(regs->pc - 4)); 629 regs->pc -= instruction_size(__raw_readw(regs->pc - 4));
630 } else if (regs->regs[0] == -ERESTART_RESTARTBLOCK) { 630 } else if (regs->regs[0] == -ERESTART_RESTARTBLOCK) {
631 regs->pc -= instruction_size(ctrl_inw(regs->pc - 4)); 631 regs->pc -= instruction_size(__raw_readw(regs->pc - 4));
632 regs->regs[3] = __NR_restart_syscall; 632 regs->regs[3] = __NR_restart_syscall;
633 } 633 }
634 } 634 }
diff --git a/arch/sh/kernel/signal_64.c b/arch/sh/kernel/signal_64.c
index ce76dbdef294..5a9f1f10ebf4 100644
--- a/arch/sh/kernel/signal_64.c
+++ b/arch/sh/kernel/signal_64.c
@@ -118,7 +118,9 @@ static int do_signal(struct pt_regs *regs, sigset_t *oldset)
118 * clear the TS_RESTORE_SIGMASK flag. 118 * clear the TS_RESTORE_SIGMASK flag.
119 */ 119 */
120 current_thread_info()->status &= ~TS_RESTORE_SIGMASK; 120 current_thread_info()->status &= ~TS_RESTORE_SIGMASK;
121 tracehook_signal_handler(signr, &info, &ka, regs, 0); 121
122 tracehook_signal_handler(signr, &info, &ka, regs,
123 test_thread_flag(TIF_SINGLESTEP));
122 return 1; 124 return 1;
123 } 125 }
124 } 126 }
@@ -295,7 +297,7 @@ restore_sigcontext_fpu(struct pt_regs *regs, struct sigcontext __user *sc)
295 regs->sr |= SR_FD; 297 regs->sr |= SR_FD;
296 } 298 }
297 299
298 err |= __copy_from_user(&current->thread.fpu.hard, &sc->sc_fpregs[0], 300 err |= __copy_from_user(&current->thread.xstate->hardfpu, &sc->sc_fpregs[0],
299 (sizeof(long long) * 32) + (sizeof(int) * 1)); 301 (sizeof(long long) * 32) + (sizeof(int) * 1));
300 302
301 return err; 303 return err;
@@ -320,7 +322,7 @@ setup_sigcontext_fpu(struct pt_regs *regs, struct sigcontext __user *sc)
320 regs->sr |= SR_FD; 322 regs->sr |= SR_FD;
321 } 323 }
322 324
323 err |= __copy_to_user(&sc->sc_fpregs[0], &current->thread.fpu.hard, 325 err |= __copy_to_user(&sc->sc_fpregs[0], &current->thread.xstate->hardfpu,
324 (sizeof(long long) * 32) + (sizeof(int) * 1)); 326 (sizeof(long long) * 32) + (sizeof(int) * 1));
325 clear_used_math(); 327 clear_used_math();
326 328
diff --git a/arch/sh/kernel/smp.c b/arch/sh/kernel/smp.c
index 983e0792d5f3..e124cf7008df 100644
--- a/arch/sh/kernel/smp.c
+++ b/arch/sh/kernel/smp.c
@@ -161,15 +161,6 @@ void smp_send_reschedule(int cpu)
161 plat_send_ipi(cpu, SMP_MSG_RESCHEDULE); 161 plat_send_ipi(cpu, SMP_MSG_RESCHEDULE);
162} 162}
163 163
164static void stop_this_cpu(void *unused)
165{
166 cpu_clear(smp_processor_id(), cpu_online_map);
167 local_irq_disable();
168
169 for (;;)
170 cpu_relax();
171}
172
173void smp_send_stop(void) 164void smp_send_stop(void)
174{ 165{
175 smp_call_function(stop_this_cpu, 0, 0); 166 smp_call_function(stop_this_cpu, 0, 0);
diff --git a/arch/sh/kernel/traps.c b/arch/sh/kernel/traps.c
index 7b036339dc92..0830c2a9f712 100644
--- a/arch/sh/kernel/traps.c
+++ b/arch/sh/kernel/traps.c
@@ -58,7 +58,7 @@ BUILD_TRAP_HANDLER(debug)
58 TRAP_HANDLER_DECL; 58 TRAP_HANDLER_DECL;
59 59
60 /* Rewind */ 60 /* Rewind */
61 regs->pc -= instruction_size(ctrl_inw(regs->pc - 4)); 61 regs->pc -= instruction_size(__raw_readw(regs->pc - 4));
62 62
63 if (notify_die(DIE_TRAP, "debug trap", regs, 0, vec & 0xff, 63 if (notify_die(DIE_TRAP, "debug trap", regs, 0, vec & 0xff,
64 SIGTRAP) == NOTIFY_STOP) 64 SIGTRAP) == NOTIFY_STOP)
@@ -75,7 +75,7 @@ BUILD_TRAP_HANDLER(bug)
75 TRAP_HANDLER_DECL; 75 TRAP_HANDLER_DECL;
76 76
77 /* Rewind */ 77 /* Rewind */
78 regs->pc -= instruction_size(ctrl_inw(regs->pc - 4)); 78 regs->pc -= instruction_size(__raw_readw(regs->pc - 4));
79 79
80 if (notify_die(DIE_TRAP, "bug trap", regs, 0, TRAPA_BUG_OPCODE & 0xff, 80 if (notify_die(DIE_TRAP, "bug trap", regs, 0, TRAPA_BUG_OPCODE & 0xff,
81 SIGTRAP) == NOTIFY_STOP) 81 SIGTRAP) == NOTIFY_STOP)
diff --git a/arch/sh/kernel/traps_32.c b/arch/sh/kernel/traps_32.c
index 86639beac3a2..c3d86fa71ddf 100644
--- a/arch/sh/kernel/traps_32.c
+++ b/arch/sh/kernel/traps_32.c
@@ -24,11 +24,10 @@
24#include <linux/kdebug.h> 24#include <linux/kdebug.h>
25#include <linux/kexec.h> 25#include <linux/kexec.h>
26#include <linux/limits.h> 26#include <linux/limits.h>
27#include <linux/proc_fs.h>
28#include <linux/seq_file.h>
29#include <linux/sysfs.h> 27#include <linux/sysfs.h>
28#include <linux/uaccess.h>
30#include <asm/system.h> 29#include <asm/system.h>
31#include <asm/uaccess.h> 30#include <asm/alignment.h>
32#include <asm/fpu.h> 31#include <asm/fpu.h>
33#include <asm/kprobes.h> 32#include <asm/kprobes.h>
34 33
@@ -47,73 +46,6 @@
47#define TRAP_ILLEGAL_SLOT_INST 13 46#define TRAP_ILLEGAL_SLOT_INST 13
48#endif 47#endif
49 48
50static unsigned long se_user;
51static unsigned long se_sys;
52static unsigned long se_half;
53static unsigned long se_word;
54static unsigned long se_dword;
55static unsigned long se_multi;
56/* bitfield: 1: warn 2: fixup 4: signal -> combinations 2|4 && 1|2|4 are not
57 valid! */
58static int se_usermode = 3;
59/* 0: no warning 1: print a warning message, disabled by default */
60static int se_kernmode_warn;
61
62#ifdef CONFIG_PROC_FS
63static const char *se_usermode_action[] = {
64 "ignored",
65 "warn",
66 "fixup",
67 "fixup+warn",
68 "signal",
69 "signal+warn"
70};
71
72static int alignment_proc_show(struct seq_file *m, void *v)
73{
74 seq_printf(m, "User:\t\t%lu\n", se_user);
75 seq_printf(m, "System:\t\t%lu\n", se_sys);
76 seq_printf(m, "Half:\t\t%lu\n", se_half);
77 seq_printf(m, "Word:\t\t%lu\n", se_word);
78 seq_printf(m, "DWord:\t\t%lu\n", se_dword);
79 seq_printf(m, "Multi:\t\t%lu\n", se_multi);
80 seq_printf(m, "User faults:\t%i (%s)\n", se_usermode,
81 se_usermode_action[se_usermode]);
82 seq_printf(m, "Kernel faults:\t%i (fixup%s)\n", se_kernmode_warn,
83 se_kernmode_warn ? "+warn" : "");
84 return 0;
85}
86
87static int alignment_proc_open(struct inode *inode, struct file *file)
88{
89 return single_open(file, alignment_proc_show, NULL);
90}
91
92static ssize_t alignment_proc_write(struct file *file,
93 const char __user *buffer, size_t count, loff_t *pos)
94{
95 int *data = PDE(file->f_path.dentry->d_inode)->data;
96 char mode;
97
98 if (count > 0) {
99 if (get_user(mode, buffer))
100 return -EFAULT;
101 if (mode >= '0' && mode <= '5')
102 *data = mode - '0';
103 }
104 return count;
105}
106
107static const struct file_operations alignment_proc_fops = {
108 .owner = THIS_MODULE,
109 .open = alignment_proc_open,
110 .read = seq_read,
111 .llseek = seq_lseek,
112 .release = single_release,
113 .write = alignment_proc_write,
114};
115#endif
116
117static void dump_mem(const char *str, unsigned long bottom, unsigned long top) 49static void dump_mem(const char *str, unsigned long bottom, unsigned long top)
118{ 50{
119 unsigned long p; 51 unsigned long p;
@@ -265,10 +197,10 @@ static int handle_unaligned_ins(insn_size_t instruction, struct pt_regs *regs,
265 count = 1<<(instruction&3); 197 count = 1<<(instruction&3);
266 198
267 switch (count) { 199 switch (count) {
268 case 1: se_half += 1; break; 200 case 1: inc_unaligned_byte_access(); break;
269 case 2: se_word += 1; break; 201 case 2: inc_unaligned_word_access(); break;
270 case 4: se_dword += 1; break; 202 case 4: inc_unaligned_dword_access(); break;
271 case 8: se_multi += 1; break; /* ??? */ 203 case 8: inc_unaligned_multi_access(); break;
272 } 204 }
273 205
274 ret = -EFAULT; 206 ret = -EFAULT;
@@ -452,18 +384,8 @@ int handle_unaligned_access(insn_size_t instruction, struct pt_regs *regs,
452 rm = regs->regs[index]; 384 rm = regs->regs[index];
453 385
454 /* shout about fixups */ 386 /* shout about fixups */
455 if (!expected) { 387 if (!expected)
456 if (user_mode(regs) && (se_usermode & 1) && printk_ratelimit()) 388 unaligned_fixups_notify(current, instruction, regs);
457 pr_notice("Fixing up unaligned userspace access "
458 "in \"%s\" pid=%d pc=0x%p ins=0x%04hx\n",
459 current->comm, task_pid_nr(current),
460 (void *)regs->pc, instruction);
461 else if (se_kernmode_warn && printk_ratelimit())
462 pr_notice("Fixing up unaligned kernel access "
463 "in \"%s\" pid=%d pc=0x%p ins=0x%04hx\n",
464 current->comm, task_pid_nr(current),
465 (void *)regs->pc, instruction);
466 }
467 389
468 ret = -EFAULT; 390 ret = -EFAULT;
469 switch (instruction&0xF000) { 391 switch (instruction&0xF000) {
@@ -616,10 +538,10 @@ asmlinkage void do_address_error(struct pt_regs *regs,
616 538
617 if (user_mode(regs)) { 539 if (user_mode(regs)) {
618 int si_code = BUS_ADRERR; 540 int si_code = BUS_ADRERR;
541 unsigned int user_action;
619 542
620 local_irq_enable(); 543 local_irq_enable();
621 544 inc_unaligned_user_access();
622 se_user += 1;
623 545
624 set_fs(USER_DS); 546 set_fs(USER_DS);
625 if (copy_from_user(&instruction, (insn_size_t *)(regs->pc & ~1), 547 if (copy_from_user(&instruction, (insn_size_t *)(regs->pc & ~1),
@@ -630,16 +552,12 @@ asmlinkage void do_address_error(struct pt_regs *regs,
630 set_fs(oldfs); 552 set_fs(oldfs);
631 553
632 /* shout about userspace fixups */ 554 /* shout about userspace fixups */
633 if (se_usermode & 1) 555 unaligned_fixups_notify(current, instruction, regs);
634 printk(KERN_NOTICE "Unaligned userspace access "
635 "in \"%s\" pid=%d pc=0x%p ins=0x%04hx\n",
636 current->comm, current->pid, (void *)regs->pc,
637 instruction);
638 556
639 if (se_usermode & 2) 557 user_action = unaligned_user_action();
558 if (user_action & UM_FIXUP)
640 goto fixup; 559 goto fixup;
641 560 if (user_action & UM_SIGNAL)
642 if (se_usermode & 4)
643 goto uspace_segv; 561 goto uspace_segv;
644 else { 562 else {
645 /* ignore */ 563 /* ignore */
@@ -659,7 +577,7 @@ fixup:
659 &user_mem_access, 0); 577 &user_mem_access, 0);
660 set_fs(oldfs); 578 set_fs(oldfs);
661 579
662 if (tmp==0) 580 if (tmp == 0)
663 return; /* sorted */ 581 return; /* sorted */
664uspace_segv: 582uspace_segv:
665 printk(KERN_NOTICE "Sending SIGBUS to \"%s\" due to unaligned " 583 printk(KERN_NOTICE "Sending SIGBUS to \"%s\" due to unaligned "
@@ -672,7 +590,7 @@ uspace_segv:
672 info.si_addr = (void __user *)address; 590 info.si_addr = (void __user *)address;
673 force_sig_info(SIGBUS, &info, current); 591 force_sig_info(SIGBUS, &info, current);
674 } else { 592 } else {
675 se_sys += 1; 593 inc_unaligned_kernel_access();
676 594
677 if (regs->pc & 1) 595 if (regs->pc & 1)
678 die("unaligned program counter", regs, error_code); 596 die("unaligned program counter", regs, error_code);
@@ -687,11 +605,7 @@ uspace_segv:
687 die("insn faulting in do_address_error", regs, 0); 605 die("insn faulting in do_address_error", regs, 0);
688 } 606 }
689 607
690 if (se_kernmode_warn) 608 unaligned_fixups_notify(current, instruction, regs);
691 printk(KERN_NOTICE "Unaligned kernel access "
692 "on behalf of \"%s\" pid=%d pc=0x%p ins=0x%04hx\n",
693 current->comm, current->pid, (void *)regs->pc,
694 instruction);
695 609
696 handle_unaligned_access(instruction, regs, 610 handle_unaligned_access(instruction, regs,
697 &user_mem_access, 0); 611 &user_mem_access, 0);
@@ -876,35 +790,10 @@ asmlinkage void do_exception_error(unsigned long r4, unsigned long r5,
876 die_if_kernel("exception", regs, ex); 790 die_if_kernel("exception", regs, ex);
877} 791}
878 792
879#if defined(CONFIG_SH_STANDARD_BIOS)
880void *gdb_vbr_vector;
881
882static inline void __init gdb_vbr_init(void)
883{
884 register unsigned long vbr;
885
886 /*
887 * Read the old value of the VBR register to initialise
888 * the vector through which debug and BIOS traps are
889 * delegated by the Linux trap handler.
890 */
891 asm volatile("stc vbr, %0" : "=r" (vbr));
892
893 gdb_vbr_vector = (void *)(vbr + 0x100);
894 printk("Setting GDB trap vector to 0x%08lx\n",
895 (unsigned long)gdb_vbr_vector);
896}
897#endif
898
899void __cpuinit per_cpu_trap_init(void) 793void __cpuinit per_cpu_trap_init(void)
900{ 794{
901 extern void *vbr_base; 795 extern void *vbr_base;
902 796
903#ifdef CONFIG_SH_STANDARD_BIOS
904 if (raw_smp_processor_id() == 0)
905 gdb_vbr_init();
906#endif
907
908 /* NOTE: The VBR value should be at P1 797 /* NOTE: The VBR value should be at P1
909 (or P2, virtural "fixed" address space). 798 (or P2, virtural "fixed" address space).
910 It's definitely should not in physical address. */ 799 It's definitely should not in physical address. */
@@ -956,11 +845,8 @@ void __init trap_init(void)
956#endif 845#endif
957 846
958#ifdef TRAP_UBC 847#ifdef TRAP_UBC
959 set_exception_table_vec(TRAP_UBC, break_point_trap); 848 set_exception_table_vec(TRAP_UBC, breakpoint_trap_handler);
960#endif 849#endif
961
962 /* Setup VBR for boot cpu */
963 per_cpu_trap_init();
964} 850}
965 851
966void show_stack(struct task_struct *tsk, unsigned long *sp) 852void show_stack(struct task_struct *tsk, unsigned long *sp)
@@ -985,34 +871,3 @@ void dump_stack(void)
985 show_stack(NULL, NULL); 871 show_stack(NULL, NULL);
986} 872}
987EXPORT_SYMBOL(dump_stack); 873EXPORT_SYMBOL(dump_stack);
988
989#ifdef CONFIG_PROC_FS
990/*
991 * This needs to be done after sysctl_init, otherwise sys/ will be
992 * overwritten. Actually, this shouldn't be in sys/ at all since
993 * it isn't a sysctl, and it doesn't contain sysctl information.
994 * We now locate it in /proc/cpu/alignment instead.
995 */
996static int __init alignment_init(void)
997{
998 struct proc_dir_entry *dir, *res;
999
1000 dir = proc_mkdir("cpu", NULL);
1001 if (!dir)
1002 return -ENOMEM;
1003
1004 res = proc_create_data("alignment", S_IWUSR | S_IRUGO, dir,
1005 &alignment_proc_fops, &se_usermode);
1006 if (!res)
1007 return -ENOMEM;
1008
1009 res = proc_create_data("kernel_alignment", S_IWUSR | S_IRUGO, dir,
1010 &alignment_proc_fops, &se_kernmode_warn);
1011 if (!res)
1012 return -ENOMEM;
1013
1014 return 0;
1015}
1016
1017fs_initcall(alignment_init);
1018#endif
diff --git a/arch/sh/kernel/traps_64.c b/arch/sh/kernel/traps_64.c
index d86f5315a0c1..e3f92eb05ffd 100644
--- a/arch/sh/kernel/traps_64.c
+++ b/arch/sh/kernel/traps_64.c
@@ -611,19 +611,19 @@ static int misaligned_fpu_load(struct pt_regs *regs,
611 611
612 switch (width_shift) { 612 switch (width_shift) {
613 case 2: 613 case 2:
614 current->thread.fpu.hard.fp_regs[destreg] = buflo; 614 current->thread.xstate->hardfpu.fp_regs[destreg] = buflo;
615 break; 615 break;
616 case 3: 616 case 3:
617 if (do_paired_load) { 617 if (do_paired_load) {
618 current->thread.fpu.hard.fp_regs[destreg] = buflo; 618 current->thread.xstate->hardfpu.fp_regs[destreg] = buflo;
619 current->thread.fpu.hard.fp_regs[destreg+1] = bufhi; 619 current->thread.xstate->hardfpu.fp_regs[destreg+1] = bufhi;
620 } else { 620 } else {
621#if defined(CONFIG_CPU_LITTLE_ENDIAN) 621#if defined(CONFIG_CPU_LITTLE_ENDIAN)
622 current->thread.fpu.hard.fp_regs[destreg] = bufhi; 622 current->thread.xstate->hardfpu.fp_regs[destreg] = bufhi;
623 current->thread.fpu.hard.fp_regs[destreg+1] = buflo; 623 current->thread.xstate->hardfpu.fp_regs[destreg+1] = buflo;
624#else 624#else
625 current->thread.fpu.hard.fp_regs[destreg] = buflo; 625 current->thread.xstate->hardfpu.fp_regs[destreg] = buflo;
626 current->thread.fpu.hard.fp_regs[destreg+1] = bufhi; 626 current->thread.xstate->hardfpu.fp_regs[destreg+1] = bufhi;
627#endif 627#endif
628 } 628 }
629 break; 629 break;
@@ -681,19 +681,19 @@ static int misaligned_fpu_store(struct pt_regs *regs,
681 681
682 switch (width_shift) { 682 switch (width_shift) {
683 case 2: 683 case 2:
684 buflo = current->thread.fpu.hard.fp_regs[srcreg]; 684 buflo = current->thread.xstate->hardfpu.fp_regs[srcreg];
685 break; 685 break;
686 case 3: 686 case 3:
687 if (do_paired_load) { 687 if (do_paired_load) {
688 buflo = current->thread.fpu.hard.fp_regs[srcreg]; 688 buflo = current->thread.xstate->hardfpu.fp_regs[srcreg];
689 bufhi = current->thread.fpu.hard.fp_regs[srcreg+1]; 689 bufhi = current->thread.xstate->hardfpu.fp_regs[srcreg+1];
690 } else { 690 } else {
691#if defined(CONFIG_CPU_LITTLE_ENDIAN) 691#if defined(CONFIG_CPU_LITTLE_ENDIAN)
692 bufhi = current->thread.fpu.hard.fp_regs[srcreg]; 692 bufhi = current->thread.xstate->hardfpu.fp_regs[srcreg];
693 buflo = current->thread.fpu.hard.fp_regs[srcreg+1]; 693 buflo = current->thread.xstate->hardfpu.fp_regs[srcreg+1];
694#else 694#else
695 buflo = current->thread.fpu.hard.fp_regs[srcreg]; 695 buflo = current->thread.xstate->hardfpu.fp_regs[srcreg];
696 bufhi = current->thread.fpu.hard.fp_regs[srcreg+1]; 696 bufhi = current->thread.xstate->hardfpu.fp_regs[srcreg+1];
697#endif 697#endif
698 } 698 }
699 break; 699 break;
diff --git a/arch/sh/kernel/vmlinux.lds.S b/arch/sh/kernel/vmlinux.lds.S
index a1e4ec24f1f5..7f8a709c3ada 100644
--- a/arch/sh/kernel/vmlinux.lds.S
+++ b/arch/sh/kernel/vmlinux.lds.S
@@ -3,7 +3,7 @@
3 * Written by Niibe Yutaka and Paul Mundt 3 * Written by Niibe Yutaka and Paul Mundt
4 */ 4 */
5#ifdef CONFIG_SUPERH64 5#ifdef CONFIG_SUPERH64
6#define LOAD_OFFSET CONFIG_PAGE_OFFSET 6#define LOAD_OFFSET PAGE_OFFSET
7OUTPUT_ARCH(sh:sh5) 7OUTPUT_ARCH(sh:sh5)
8#else 8#else
9#define LOAD_OFFSET 0 9#define LOAD_OFFSET 0
@@ -14,17 +14,16 @@ OUTPUT_ARCH(sh)
14#include <asm/cache.h> 14#include <asm/cache.h>
15#include <asm/vmlinux.lds.h> 15#include <asm/vmlinux.lds.h>
16 16
17#ifdef CONFIG_PMB
18 #define MEMORY_OFFSET 0
19#else
20 #define MEMORY_OFFSET __MEMORY_START
21#endif
22
17ENTRY(_start) 23ENTRY(_start)
18SECTIONS 24SECTIONS
19{ 25{
20#ifdef CONFIG_PMB_FIXED 26 . = PAGE_OFFSET + MEMORY_OFFSET + CONFIG_ZERO_PAGE_OFFSET;
21 . = CONFIG_PAGE_OFFSET + (CONFIG_MEMORY_START & 0x1fffffff) +
22 CONFIG_ZERO_PAGE_OFFSET;
23#elif defined(CONFIG_32BIT)
24 . = CONFIG_PAGE_OFFSET + CONFIG_ZERO_PAGE_OFFSET;
25#else
26 . = CONFIG_PAGE_OFFSET + CONFIG_MEMORY_START + CONFIG_ZERO_PAGE_OFFSET;
27#endif
28 27
29 _text = .; /* Text and read-only data */ 28 _text = .; /* Text and read-only data */
30 29
@@ -35,12 +34,7 @@ SECTIONS
35 .text : AT(ADDR(.text) - LOAD_OFFSET) { 34 .text : AT(ADDR(.text) - LOAD_OFFSET) {
36 HEAD_TEXT 35 HEAD_TEXT
37 TEXT_TEXT 36 TEXT_TEXT
38 37 EXTRA_TEXT
39#ifdef CONFIG_SUPERH64
40 *(.text64)
41 *(.text..SHmedia32)
42#endif
43
44 SCHED_TEXT 38 SCHED_TEXT
45 LOCK_TEXT 39 LOCK_TEXT
46 KPROBES_TEXT 40 KPROBES_TEXT
@@ -51,24 +45,12 @@ SECTIONS
51 } = 0x0009 45 } = 0x0009
52 46
53 EXCEPTION_TABLE(16) 47 EXCEPTION_TABLE(16)
54
55 NOTES 48 NOTES
56 RO_DATA(PAGE_SIZE)
57
58 /*
59 * Code which must be executed uncached and the associated data
60 */
61 . = ALIGN(PAGE_SIZE);
62 .uncached : AT(ADDR(.uncached) - LOAD_OFFSET) {
63 __uncached_start = .;
64 *(.uncached.text)
65 *(.uncached.data)
66 __uncached_end = .;
67 }
68 49
50 _sdata = .;
51 RO_DATA(PAGE_SIZE)
69 RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE) 52 RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE)
70 53 _edata = .;
71 _edata = .; /* End of data section */
72 54
73 DWARF_EH_FRAME 55 DWARF_EH_FRAME
74 56
diff --git a/arch/sh/math-emu/math.c b/arch/sh/math-emu/math.c
index d6c15cae0912..1fcdb1220975 100644
--- a/arch/sh/math-emu/math.c
+++ b/arch/sh/math-emu/math.c
@@ -471,10 +471,10 @@ static int fpu_emulate(u16 code, struct sh_fpu_soft_struct *fregs, struct pt_reg
471 * denormal_to_double - Given denormalized float number, 471 * denormal_to_double - Given denormalized float number,
472 * store double float 472 * store double float
473 * 473 *
474 * @fpu: Pointer to sh_fpu_hard structure 474 * @fpu: Pointer to sh_fpu_soft structure
475 * @n: Index to FP register 475 * @n: Index to FP register
476 */ 476 */
477static void denormal_to_double(struct sh_fpu_hard_struct *fpu, int n) 477static void denormal_to_double(struct sh_fpu_soft_struct *fpu, int n)
478{ 478{
479 unsigned long du, dl; 479 unsigned long du, dl;
480 unsigned long x = fpu->fpul; 480 unsigned long x = fpu->fpul;
@@ -552,11 +552,11 @@ static int ieee_fpe_handler(struct pt_regs *regs)
552 if ((finsn & 0xf1ff) == 0xf0ad) { /* fcnvsd */ 552 if ((finsn & 0xf1ff) == 0xf0ad) { /* fcnvsd */
553 struct task_struct *tsk = current; 553 struct task_struct *tsk = current;
554 554
555 if ((tsk->thread.fpu.hard.fpscr & (1 << 17))) { 555 if ((tsk->thread.xstate->softfpu.fpscr & (1 << 17))) {
556 /* FPU error */ 556 /* FPU error */
557 denormal_to_double (&tsk->thread.fpu.hard, 557 denormal_to_double (&tsk->thread.xstate->softfpu,
558 (finsn >> 8) & 0xf); 558 (finsn >> 8) & 0xf);
559 tsk->thread.fpu.hard.fpscr &= 559 tsk->thread.xstate->softfpu.fpscr &=
560 ~(FPSCR_CAUSE_MASK | FPSCR_FLAG_MASK); 560 ~(FPSCR_CAUSE_MASK | FPSCR_FLAG_MASK);
561 task_thread_info(tsk)->status |= TS_USEDFPU; 561 task_thread_info(tsk)->status |= TS_USEDFPU;
562 } else { 562 } else {
@@ -617,7 +617,7 @@ static void fpu_init(struct sh_fpu_soft_struct *fpu)
617int do_fpu_inst(unsigned short inst, struct pt_regs *regs) 617int do_fpu_inst(unsigned short inst, struct pt_regs *regs)
618{ 618{
619 struct task_struct *tsk = current; 619 struct task_struct *tsk = current;
620 struct sh_fpu_soft_struct *fpu = &(tsk->thread.fpu.soft); 620 struct sh_fpu_soft_struct *fpu = &(tsk->thread.xstate->softfpu);
621 621
622 if (!(task_thread_info(tsk)->status & TS_USEDFPU)) { 622 if (!(task_thread_info(tsk)->status & TS_USEDFPU)) {
623 /* initialize once. */ 623 /* initialize once. */
diff --git a/arch/sh/mm/Kconfig b/arch/sh/mm/Kconfig
index 986a71b88ca3..1445ca6257df 100644
--- a/arch/sh/mm/Kconfig
+++ b/arch/sh/mm/Kconfig
@@ -75,52 +75,25 @@ config MEMORY_SIZE
75config 29BIT 75config 29BIT
76 def_bool !32BIT 76 def_bool !32BIT
77 depends on SUPERH32 77 depends on SUPERH32
78 select UNCACHED_MAPPING
78 79
79config 32BIT 80config 32BIT
80 bool 81 bool
81 default y if CPU_SH5 82 default y if CPU_SH5
82 83
83config PMB_ENABLE
84 bool "Support 32-bit physical addressing through PMB"
85 depends on MMU && EXPERIMENTAL && CPU_SH4A && !CPU_SH4AL_DSP
86 help
87 If you say Y here, physical addressing will be extended to
88 32-bits through the SH-4A PMB. If this is not set, legacy
89 29-bit physical addressing will be used.
90
91choice
92 prompt "PMB handling type"
93 depends on PMB_ENABLE
94 default PMB_FIXED
95
96config PMB 84config PMB
97 bool "PMB" 85 bool "Support 32-bit physical addressing through PMB"
98 depends on MMU && EXPERIMENTAL && CPU_SH4A && !CPU_SH4AL_DSP 86 depends on MMU && EXPERIMENTAL && CPU_SH4A && !CPU_SH4AL_DSP
87 select 32BIT
88 select UNCACHED_MAPPING
99 help 89 help
100 If you say Y here, physical addressing will be extended to 90 If you say Y here, physical addressing will be extended to
101 32-bits through the SH-4A PMB. If this is not set, legacy 91 32-bits through the SH-4A PMB. If this is not set, legacy
102 29-bit physical addressing will be used. 92 29-bit physical addressing will be used.
103 93
104config PMB_FIXED
105 bool "fixed PMB"
106 depends on MMU && EXPERIMENTAL && CPU_SH4A && !CPU_SH4AL_DSP
107 select 32BIT
108 help
109 If this option is enabled, fixed PMB mappings are inherited
110 from the boot loader, and the kernel does not attempt dynamic
111 management. This is the closest to legacy 29-bit physical mode,
112 and allows systems to support up to 512MiB of system memory.
113
114endchoice
115
116config X2TLB 94config X2TLB
117 bool "Enable extended TLB mode" 95 def_bool y
118 depends on (CPU_SHX2 || CPU_SHX3) && MMU && EXPERIMENTAL 96 depends on (CPU_SHX2 || CPU_SHX3) && MMU
119 help
120 Selecting this option will enable the extended mode of the SH-X2
121 TLB. For legacy SH-X behaviour and interoperability, say N. For
122 all of the fun new features and a willingless to submit bug reports,
123 say Y.
124 97
125config VSYSCALL 98config VSYSCALL
126 bool "Support vsyscall page" 99 bool "Support vsyscall page"
@@ -188,14 +161,19 @@ config ARCH_MEMORY_PROBE
188 def_bool y 161 def_bool y
189 depends on MEMORY_HOTPLUG 162 depends on MEMORY_HOTPLUG
190 163
164config IOREMAP_FIXED
165 def_bool y
166 depends on X2TLB || SUPERH64
167
168config UNCACHED_MAPPING
169 bool
170
191choice 171choice
192 prompt "Kernel page size" 172 prompt "Kernel page size"
193 default PAGE_SIZE_8KB if X2TLB
194 default PAGE_SIZE_4KB 173 default PAGE_SIZE_4KB
195 174
196config PAGE_SIZE_4KB 175config PAGE_SIZE_4KB
197 bool "4kB" 176 bool "4kB"
198 depends on !MMU || !X2TLB
199 help 177 help
200 This is the default page size used by all SuperH CPUs. 178 This is the default page size used by all SuperH CPUs.
201 179
diff --git a/arch/sh/mm/Makefile b/arch/sh/mm/Makefile
index 8a70535fa7ce..3dc8a8a63822 100644
--- a/arch/sh/mm/Makefile
+++ b/arch/sh/mm/Makefile
@@ -2,7 +2,7 @@
2# Makefile for the Linux SuperH-specific parts of the memory manager. 2# Makefile for the Linux SuperH-specific parts of the memory manager.
3# 3#
4 4
5obj-y := cache.o init.o consistent.o mmap.o 5obj-y := alignment.o cache.o init.o consistent.o mmap.o
6 6
7cacheops-$(CONFIG_CPU_SH2) := cache-sh2.o 7cacheops-$(CONFIG_CPU_SH2) := cache-sh2.o
8cacheops-$(CONFIG_CPU_SH2A) := cache-sh2a.o 8cacheops-$(CONFIG_CPU_SH2A) := cache-sh2a.o
@@ -15,7 +15,7 @@ obj-y += $(cacheops-y)
15 15
16mmu-y := nommu.o extable_32.o 16mmu-y := nommu.o extable_32.o
17mmu-$(CONFIG_MMU) := extable_$(BITS).o fault_$(BITS).o \ 17mmu-$(CONFIG_MMU) := extable_$(BITS).o fault_$(BITS).o \
18 ioremap_$(BITS).o kmap.o tlbflush_$(BITS).o 18 ioremap.o kmap.o pgtable.o tlbflush_$(BITS).o
19 19
20obj-y += $(mmu-y) 20obj-y += $(mmu-y)
21obj-$(CONFIG_DEBUG_FS) += asids-debugfs.o 21obj-$(CONFIG_DEBUG_FS) += asids-debugfs.o
@@ -26,15 +26,17 @@ endif
26 26
27ifdef CONFIG_MMU 27ifdef CONFIG_MMU
28tlb-$(CONFIG_CPU_SH3) := tlb-sh3.o 28tlb-$(CONFIG_CPU_SH3) := tlb-sh3.o
29tlb-$(CONFIG_CPU_SH4) := tlb-sh4.o 29tlb-$(CONFIG_CPU_SH4) := tlb-sh4.o tlb-urb.o
30tlb-$(CONFIG_CPU_SH5) := tlb-sh5.o 30tlb-$(CONFIG_CPU_SH5) := tlb-sh5.o
31tlb-$(CONFIG_CPU_HAS_PTEAEX) := tlb-pteaex.o 31tlb-$(CONFIG_CPU_HAS_PTEAEX) := tlb-pteaex.o tlb-urb.o
32obj-y += $(tlb-y) 32obj-y += $(tlb-y)
33endif 33endif
34 34
35obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o 35obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o
36obj-$(CONFIG_PMB_ENABLE) += pmb.o 36obj-$(CONFIG_PMB) += pmb.o
37obj-$(CONFIG_NUMA) += numa.o 37obj-$(CONFIG_NUMA) += numa.o
38obj-$(CONFIG_IOREMAP_FIXED) += ioremap_fixed.o
39obj-$(CONFIG_UNCACHED_MAPPING) += uncached.o
38 40
39# Special flags for fault_64.o. This puts restrictions on the number of 41# Special flags for fault_64.o. This puts restrictions on the number of
40# caller-save registers that the compiler can target when building this file. 42# caller-save registers that the compiler can target when building this file.
diff --git a/arch/sh/mm/alignment.c b/arch/sh/mm/alignment.c
new file mode 100644
index 000000000000..b2595b8548ee
--- /dev/null
+++ b/arch/sh/mm/alignment.c
@@ -0,0 +1,189 @@
1/*
2 * Alignment access counters and corresponding user-space interfaces.
3 *
4 * Copyright (C) 2009 ST Microelectronics
5 * Copyright (C) 2009 - 2010 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#include <linux/module.h>
12#include <linux/kernel.h>
13#include <linux/seq_file.h>
14#include <linux/proc_fs.h>
15#include <linux/uaccess.h>
16#include <asm/alignment.h>
17#include <asm/processor.h>
18
19static unsigned long se_user;
20static unsigned long se_sys;
21static unsigned long se_half;
22static unsigned long se_word;
23static unsigned long se_dword;
24static unsigned long se_multi;
25/* bitfield: 1: warn 2: fixup 4: signal -> combinations 2|4 && 1|2|4 are not
26 valid! */
27static int se_usermode = UM_WARN | UM_FIXUP;
28/* 0: no warning 1: print a warning message, disabled by default */
29static int se_kernmode_warn;
30
31core_param(alignment, se_usermode, int, 0600);
32
33void inc_unaligned_byte_access(void)
34{
35 se_half++;
36}
37
38void inc_unaligned_word_access(void)
39{
40 se_word++;
41}
42
43void inc_unaligned_dword_access(void)
44{
45 se_dword++;
46}
47
48void inc_unaligned_multi_access(void)
49{
50 se_multi++;
51}
52
53void inc_unaligned_user_access(void)
54{
55 se_user++;
56}
57
58void inc_unaligned_kernel_access(void)
59{
60 se_sys++;
61}
62
63/*
64 * This defaults to the global policy which can be set from the command
65 * line, while processes can overload their preferences via prctl().
66 */
67unsigned int unaligned_user_action(void)
68{
69 unsigned int action = se_usermode;
70
71 if (current->thread.flags & SH_THREAD_UAC_SIGBUS) {
72 action &= ~UM_FIXUP;
73 action |= UM_SIGNAL;
74 }
75
76 if (current->thread.flags & SH_THREAD_UAC_NOPRINT)
77 action &= ~UM_WARN;
78
79 return action;
80}
81
82int get_unalign_ctl(struct task_struct *tsk, unsigned long addr)
83{
84 return put_user(tsk->thread.flags & SH_THREAD_UAC_MASK,
85 (unsigned int __user *)addr);
86}
87
88int set_unalign_ctl(struct task_struct *tsk, unsigned int val)
89{
90 tsk->thread.flags = (tsk->thread.flags & ~SH_THREAD_UAC_MASK) |
91 (val & SH_THREAD_UAC_MASK);
92 return 0;
93}
94
95void unaligned_fixups_notify(struct task_struct *tsk, insn_size_t insn,
96 struct pt_regs *regs)
97{
98 if (user_mode(regs) && (se_usermode & UM_WARN) && printk_ratelimit())
99 pr_notice("Fixing up unaligned userspace access "
100 "in \"%s\" pid=%d pc=0x%p ins=0x%04hx\n",
101 tsk->comm, task_pid_nr(tsk),
102 (void *)instruction_pointer(regs), insn);
103 else if (se_kernmode_warn && printk_ratelimit())
104 pr_notice("Fixing up unaligned kernel access "
105 "in \"%s\" pid=%d pc=0x%p ins=0x%04hx\n",
106 tsk->comm, task_pid_nr(tsk),
107 (void *)instruction_pointer(regs), insn);
108}
109
110static const char *se_usermode_action[] = {
111 "ignored",
112 "warn",
113 "fixup",
114 "fixup+warn",
115 "signal",
116 "signal+warn"
117};
118
119static int alignment_proc_show(struct seq_file *m, void *v)
120{
121 seq_printf(m, "User:\t\t%lu\n", se_user);
122 seq_printf(m, "System:\t\t%lu\n", se_sys);
123 seq_printf(m, "Half:\t\t%lu\n", se_half);
124 seq_printf(m, "Word:\t\t%lu\n", se_word);
125 seq_printf(m, "DWord:\t\t%lu\n", se_dword);
126 seq_printf(m, "Multi:\t\t%lu\n", se_multi);
127 seq_printf(m, "User faults:\t%i (%s)\n", se_usermode,
128 se_usermode_action[se_usermode]);
129 seq_printf(m, "Kernel faults:\t%i (fixup%s)\n", se_kernmode_warn,
130 se_kernmode_warn ? "+warn" : "");
131 return 0;
132}
133
134static int alignment_proc_open(struct inode *inode, struct file *file)
135{
136 return single_open(file, alignment_proc_show, NULL);
137}
138
139static ssize_t alignment_proc_write(struct file *file,
140 const char __user *buffer, size_t count, loff_t *pos)
141{
142 int *data = PDE(file->f_path.dentry->d_inode)->data;
143 char mode;
144
145 if (count > 0) {
146 if (get_user(mode, buffer))
147 return -EFAULT;
148 if (mode >= '0' && mode <= '5')
149 *data = mode - '0';
150 }
151 return count;
152}
153
154static const struct file_operations alignment_proc_fops = {
155 .owner = THIS_MODULE,
156 .open = alignment_proc_open,
157 .read = seq_read,
158 .llseek = seq_lseek,
159 .release = single_release,
160 .write = alignment_proc_write,
161};
162
163/*
164 * This needs to be done after sysctl_init, otherwise sys/ will be
165 * overwritten. Actually, this shouldn't be in sys/ at all since
166 * it isn't a sysctl, and it doesn't contain sysctl information.
167 * We now locate it in /proc/cpu/alignment instead.
168 */
169static int __init alignment_init(void)
170{
171 struct proc_dir_entry *dir, *res;
172
173 dir = proc_mkdir("cpu", NULL);
174 if (!dir)
175 return -ENOMEM;
176
177 res = proc_create_data("alignment", S_IWUSR | S_IRUGO, dir,
178 &alignment_proc_fops, &se_usermode);
179 if (!res)
180 return -ENOMEM;
181
182 res = proc_create_data("kernel_alignment", S_IWUSR | S_IRUGO, dir,
183 &alignment_proc_fops, &se_kernmode_warn);
184 if (!res)
185 return -ENOMEM;
186
187 return 0;
188}
189fs_initcall(alignment_init);
diff --git a/arch/sh/mm/cache-debugfs.c b/arch/sh/mm/cache-debugfs.c
index 5ba067b26591..690ed010d002 100644
--- a/arch/sh/mm/cache-debugfs.c
+++ b/arch/sh/mm/cache-debugfs.c
@@ -22,8 +22,7 @@ enum cache_type {
22 CACHE_TYPE_UNIFIED, 22 CACHE_TYPE_UNIFIED,
23}; 23};
24 24
25static int __uses_jump_to_uncached cache_seq_show(struct seq_file *file, 25static int cache_seq_show(struct seq_file *file, void *iter)
26 void *iter)
27{ 26{
28 unsigned int cache_type = (unsigned int)file->private; 27 unsigned int cache_type = (unsigned int)file->private;
29 struct cache_info *cache; 28 struct cache_info *cache;
@@ -37,7 +36,7 @@ static int __uses_jump_to_uncached cache_seq_show(struct seq_file *file,
37 */ 36 */
38 jump_to_uncached(); 37 jump_to_uncached();
39 38
40 ccr = ctrl_inl(CCR); 39 ccr = __raw_readl(CCR);
41 if ((ccr & CCR_CACHE_ENABLE) == 0) { 40 if ((ccr & CCR_CACHE_ENABLE) == 0) {
42 back_to_cached(); 41 back_to_cached();
43 42
@@ -90,7 +89,7 @@ static int __uses_jump_to_uncached cache_seq_show(struct seq_file *file,
90 for (addr = addrstart, line = 0; 89 for (addr = addrstart, line = 0;
91 addr < addrstart + waysize; 90 addr < addrstart + waysize;
92 addr += cache->linesz, line++) { 91 addr += cache->linesz, line++) {
93 unsigned long data = ctrl_inl(addr); 92 unsigned long data = __raw_readl(addr);
94 93
95 /* Check the V bit, ignore invalid cachelines */ 94 /* Check the V bit, ignore invalid cachelines */
96 if ((data & 1) == 0) 95 if ((data & 1) == 0)
diff --git a/arch/sh/mm/cache-sh2.c b/arch/sh/mm/cache-sh2.c
index 699a71f46327..defcf719f2e8 100644
--- a/arch/sh/mm/cache-sh2.c
+++ b/arch/sh/mm/cache-sh2.c
@@ -28,10 +28,10 @@ static void sh2__flush_wback_region(void *start, int size)
28 unsigned long addr = CACHE_OC_ADDRESS_ARRAY | (v & 0x00000ff0); 28 unsigned long addr = CACHE_OC_ADDRESS_ARRAY | (v & 0x00000ff0);
29 int way; 29 int way;
30 for (way = 0; way < 4; way++) { 30 for (way = 0; way < 4; way++) {
31 unsigned long data = ctrl_inl(addr | (way << 12)); 31 unsigned long data = __raw_readl(addr | (way << 12));
32 if ((data & CACHE_PHYSADDR_MASK) == (v & CACHE_PHYSADDR_MASK)) { 32 if ((data & CACHE_PHYSADDR_MASK) == (v & CACHE_PHYSADDR_MASK)) {
33 data &= ~SH_CACHE_UPDATED; 33 data &= ~SH_CACHE_UPDATED;
34 ctrl_outl(data, addr | (way << 12)); 34 __raw_writel(data, addr | (way << 12));
35 } 35 }
36 } 36 }
37 } 37 }
@@ -47,7 +47,7 @@ static void sh2__flush_purge_region(void *start, int size)
47 & ~(L1_CACHE_BYTES-1); 47 & ~(L1_CACHE_BYTES-1);
48 48
49 for (v = begin; v < end; v+=L1_CACHE_BYTES) 49 for (v = begin; v < end; v+=L1_CACHE_BYTES)
50 ctrl_outl((v & CACHE_PHYSADDR_MASK), 50 __raw_writel((v & CACHE_PHYSADDR_MASK),
51 CACHE_OC_ADDRESS_ARRAY | (v & 0x00000ff0) | 0x00000008); 51 CACHE_OC_ADDRESS_ARRAY | (v & 0x00000ff0) | 0x00000008);
52} 52}
53 53
@@ -63,9 +63,9 @@ static void sh2__flush_invalidate_region(void *start, int size)
63 local_irq_save(flags); 63 local_irq_save(flags);
64 jump_to_uncached(); 64 jump_to_uncached();
65 65
66 ccr = ctrl_inl(CCR); 66 ccr = __raw_readl(CCR);
67 ccr |= CCR_CACHE_INVALIDATE; 67 ccr |= CCR_CACHE_INVALIDATE;
68 ctrl_outl(ccr, CCR); 68 __raw_writel(ccr, CCR);
69 69
70 back_to_cached(); 70 back_to_cached();
71 local_irq_restore(flags); 71 local_irq_restore(flags);
@@ -78,7 +78,7 @@ static void sh2__flush_invalidate_region(void *start, int size)
78 & ~(L1_CACHE_BYTES-1); 78 & ~(L1_CACHE_BYTES-1);
79 79
80 for (v = begin; v < end; v+=L1_CACHE_BYTES) 80 for (v = begin; v < end; v+=L1_CACHE_BYTES)
81 ctrl_outl((v & CACHE_PHYSADDR_MASK), 81 __raw_writel((v & CACHE_PHYSADDR_MASK),
82 CACHE_OC_ADDRESS_ARRAY | (v & 0x00000ff0) | 0x00000008); 82 CACHE_OC_ADDRESS_ARRAY | (v & 0x00000ff0) | 0x00000008);
83#endif 83#endif
84} 84}
diff --git a/arch/sh/mm/cache-sh2a.c b/arch/sh/mm/cache-sh2a.c
index 975899d83564..1f51225426a2 100644
--- a/arch/sh/mm/cache-sh2a.c
+++ b/arch/sh/mm/cache-sh2a.c
@@ -32,10 +32,10 @@ static void sh2a__flush_wback_region(void *start, int size)
32 unsigned long addr = CACHE_OC_ADDRESS_ARRAY | (v & 0x000007f0); 32 unsigned long addr = CACHE_OC_ADDRESS_ARRAY | (v & 0x000007f0);
33 int way; 33 int way;
34 for (way = 0; way < 4; way++) { 34 for (way = 0; way < 4; way++) {
35 unsigned long data = ctrl_inl(addr | (way << 11)); 35 unsigned long data = __raw_readl(addr | (way << 11));
36 if ((data & CACHE_PHYSADDR_MASK) == (v & CACHE_PHYSADDR_MASK)) { 36 if ((data & CACHE_PHYSADDR_MASK) == (v & CACHE_PHYSADDR_MASK)) {
37 data &= ~SH_CACHE_UPDATED; 37 data &= ~SH_CACHE_UPDATED;
38 ctrl_outl(data, addr | (way << 11)); 38 __raw_writel(data, addr | (way << 11));
39 } 39 }
40 } 40 }
41 } 41 }
@@ -58,7 +58,7 @@ static void sh2a__flush_purge_region(void *start, int size)
58 jump_to_uncached(); 58 jump_to_uncached();
59 59
60 for (v = begin; v < end; v+=L1_CACHE_BYTES) { 60 for (v = begin; v < end; v+=L1_CACHE_BYTES) {
61 ctrl_outl((v & CACHE_PHYSADDR_MASK), 61 __raw_writel((v & CACHE_PHYSADDR_MASK),
62 CACHE_OC_ADDRESS_ARRAY | (v & 0x000007f0) | 0x00000008); 62 CACHE_OC_ADDRESS_ARRAY | (v & 0x000007f0) | 0x00000008);
63 } 63 }
64 back_to_cached(); 64 back_to_cached();
@@ -78,17 +78,17 @@ static void sh2a__flush_invalidate_region(void *start, int size)
78 jump_to_uncached(); 78 jump_to_uncached();
79 79
80#ifdef CONFIG_CACHE_WRITEBACK 80#ifdef CONFIG_CACHE_WRITEBACK
81 ctrl_outl(ctrl_inl(CCR) | CCR_OCACHE_INVALIDATE, CCR); 81 __raw_writel(__raw_readl(CCR) | CCR_OCACHE_INVALIDATE, CCR);
82 /* I-cache invalidate */ 82 /* I-cache invalidate */
83 for (v = begin; v < end; v+=L1_CACHE_BYTES) { 83 for (v = begin; v < end; v+=L1_CACHE_BYTES) {
84 ctrl_outl((v & CACHE_PHYSADDR_MASK), 84 __raw_writel((v & CACHE_PHYSADDR_MASK),
85 CACHE_IC_ADDRESS_ARRAY | (v & 0x000007f0) | 0x00000008); 85 CACHE_IC_ADDRESS_ARRAY | (v & 0x000007f0) | 0x00000008);
86 } 86 }
87#else 87#else
88 for (v = begin; v < end; v+=L1_CACHE_BYTES) { 88 for (v = begin; v < end; v+=L1_CACHE_BYTES) {
89 ctrl_outl((v & CACHE_PHYSADDR_MASK), 89 __raw_writel((v & CACHE_PHYSADDR_MASK),
90 CACHE_IC_ADDRESS_ARRAY | (v & 0x000007f0) | 0x00000008); 90 CACHE_IC_ADDRESS_ARRAY | (v & 0x000007f0) | 0x00000008);
91 ctrl_outl((v & CACHE_PHYSADDR_MASK), 91 __raw_writel((v & CACHE_PHYSADDR_MASK),
92 CACHE_OC_ADDRESS_ARRAY | (v & 0x000007f0) | 0x00000008); 92 CACHE_OC_ADDRESS_ARRAY | (v & 0x000007f0) | 0x00000008);
93 } 93 }
94#endif 94#endif
@@ -115,14 +115,14 @@ static void sh2a_flush_icache_range(void *args)
115 int way; 115 int way;
116 /* O-Cache writeback */ 116 /* O-Cache writeback */
117 for (way = 0; way < 4; way++) { 117 for (way = 0; way < 4; way++) {
118 unsigned long data = ctrl_inl(CACHE_OC_ADDRESS_ARRAY | addr | (way << 11)); 118 unsigned long data = __raw_readl(CACHE_OC_ADDRESS_ARRAY | addr | (way << 11));
119 if ((data & CACHE_PHYSADDR_MASK) == (v & CACHE_PHYSADDR_MASK)) { 119 if ((data & CACHE_PHYSADDR_MASK) == (v & CACHE_PHYSADDR_MASK)) {
120 data &= ~SH_CACHE_UPDATED; 120 data &= ~SH_CACHE_UPDATED;
121 ctrl_outl(data, CACHE_OC_ADDRESS_ARRAY | addr | (way << 11)); 121 __raw_writel(data, CACHE_OC_ADDRESS_ARRAY | addr | (way << 11));
122 } 122 }
123 } 123 }
124 /* I-Cache invalidate */ 124 /* I-Cache invalidate */
125 ctrl_outl(addr, 125 __raw_writel(addr,
126 CACHE_IC_ADDRESS_ARRAY | addr | 0x00000008); 126 CACHE_IC_ADDRESS_ARRAY | addr | 0x00000008);
127 } 127 }
128 128
diff --git a/arch/sh/mm/cache-sh3.c b/arch/sh/mm/cache-sh3.c
index faef80c98134..e37523f65195 100644
--- a/arch/sh/mm/cache-sh3.c
+++ b/arch/sh/mm/cache-sh3.c
@@ -50,12 +50,12 @@ static void sh3__flush_wback_region(void *start, int size)
50 p = __pa(v); 50 p = __pa(v);
51 addr = addrstart | (v & current_cpu_data.dcache.entry_mask); 51 addr = addrstart | (v & current_cpu_data.dcache.entry_mask);
52 local_irq_save(flags); 52 local_irq_save(flags);
53 data = ctrl_inl(addr); 53 data = __raw_readl(addr);
54 54
55 if ((data & CACHE_PHYSADDR_MASK) == 55 if ((data & CACHE_PHYSADDR_MASK) ==
56 (p & CACHE_PHYSADDR_MASK)) { 56 (p & CACHE_PHYSADDR_MASK)) {
57 data &= ~SH_CACHE_UPDATED; 57 data &= ~SH_CACHE_UPDATED;
58 ctrl_outl(data, addr); 58 __raw_writel(data, addr);
59 local_irq_restore(flags); 59 local_irq_restore(flags);
60 break; 60 break;
61 } 61 }
@@ -86,7 +86,7 @@ static void sh3__flush_purge_region(void *start, int size)
86 data = (v & 0xfffffc00); /* _Virtual_ address, ~U, ~V */ 86 data = (v & 0xfffffc00); /* _Virtual_ address, ~U, ~V */
87 addr = CACHE_OC_ADDRESS_ARRAY | 87 addr = CACHE_OC_ADDRESS_ARRAY |
88 (v & current_cpu_data.dcache.entry_mask) | SH_CACHE_ASSOC; 88 (v & current_cpu_data.dcache.entry_mask) | SH_CACHE_ASSOC;
89 ctrl_outl(data, addr); 89 __raw_writel(data, addr);
90 } 90 }
91} 91}
92 92
diff --git a/arch/sh/mm/cache-sh4.c b/arch/sh/mm/cache-sh4.c
index 560ddb6bc8a7..2cfae81914aa 100644
--- a/arch/sh/mm/cache-sh4.c
+++ b/arch/sh/mm/cache-sh4.c
@@ -36,7 +36,7 @@ static void __flush_cache_one(unsigned long addr, unsigned long phys,
36 * Called from kernel/module.c:sys_init_module and routine for a.out format, 36 * Called from kernel/module.c:sys_init_module and routine for a.out format,
37 * signal handler code and kprobes code 37 * signal handler code and kprobes code
38 */ 38 */
39static void __uses_jump_to_uncached sh4_flush_icache_range(void *args) 39static void sh4_flush_icache_range(void *args)
40{ 40{
41 struct flusher_data *data = args; 41 struct flusher_data *data = args;
42 unsigned long start, end; 42 unsigned long start, end;
@@ -109,6 +109,7 @@ static inline void flush_cache_one(unsigned long start, unsigned long phys)
109static void sh4_flush_dcache_page(void *arg) 109static void sh4_flush_dcache_page(void *arg)
110{ 110{
111 struct page *page = arg; 111 struct page *page = arg;
112 unsigned long addr = (unsigned long)page_address(page);
112#ifndef CONFIG_SMP 113#ifndef CONFIG_SMP
113 struct address_space *mapping = page_mapping(page); 114 struct address_space *mapping = page_mapping(page);
114 115
@@ -116,22 +117,14 @@ static void sh4_flush_dcache_page(void *arg)
116 set_bit(PG_dcache_dirty, &page->flags); 117 set_bit(PG_dcache_dirty, &page->flags);
117 else 118 else
118#endif 119#endif
119 { 120 flush_cache_one(CACHE_OC_ADDRESS_ARRAY |
120 unsigned long phys = page_to_phys(page); 121 (addr & shm_align_mask), page_to_phys(page));
121 unsigned long addr = CACHE_OC_ADDRESS_ARRAY;
122 int i, n;
123
124 /* Loop all the D-cache */
125 n = boot_cpu_data.dcache.n_aliases;
126 for (i = 0; i < n; i++, addr += PAGE_SIZE)
127 flush_cache_one(addr, phys);
128 }
129 122
130 wmb(); 123 wmb();
131} 124}
132 125
133/* TODO: Selective icache invalidation through IC address array.. */ 126/* TODO: Selective icache invalidation through IC address array.. */
134static void __uses_jump_to_uncached flush_icache_all(void) 127static void flush_icache_all(void)
135{ 128{
136 unsigned long flags, ccr; 129 unsigned long flags, ccr;
137 130
@@ -139,9 +132,9 @@ static void __uses_jump_to_uncached flush_icache_all(void)
139 jump_to_uncached(); 132 jump_to_uncached();
140 133
141 /* Flush I-cache */ 134 /* Flush I-cache */
142 ccr = ctrl_inl(CCR); 135 ccr = __raw_readl(CCR);
143 ccr |= CCR_CACHE_ICI; 136 ccr |= CCR_CACHE_ICI;
144 ctrl_outl(ccr, CCR); 137 __raw_writel(ccr, CCR);
145 138
146 /* 139 /*
147 * back_to_cached() will take care of the barrier for us, don't add 140 * back_to_cached() will take care of the barrier for us, don't add
@@ -384,9 +377,9 @@ extern void __weak sh4__flush_region_init(void);
384void __init sh4_cache_init(void) 377void __init sh4_cache_init(void)
385{ 378{
386 printk("PVR=%08x CVR=%08x PRR=%08x\n", 379 printk("PVR=%08x CVR=%08x PRR=%08x\n",
387 ctrl_inl(CCN_PVR), 380 __raw_readl(CCN_PVR),
388 ctrl_inl(CCN_CVR), 381 __raw_readl(CCN_CVR),
389 ctrl_inl(CCN_PRR)); 382 __raw_readl(CCN_PRR));
390 383
391 local_flush_icache_range = sh4_flush_icache_range; 384 local_flush_icache_range = sh4_flush_icache_range;
392 local_flush_dcache_page = sh4_flush_dcache_page; 385 local_flush_dcache_page = sh4_flush_dcache_page;
diff --git a/arch/sh/mm/cache-sh7705.c b/arch/sh/mm/cache-sh7705.c
index f527fb70fce6..f498da1cce7a 100644
--- a/arch/sh/mm/cache-sh7705.c
+++ b/arch/sh/mm/cache-sh7705.c
@@ -48,10 +48,10 @@ static inline void cache_wback_all(void)
48 unsigned long data; 48 unsigned long data;
49 int v = SH_CACHE_UPDATED | SH_CACHE_VALID; 49 int v = SH_CACHE_UPDATED | SH_CACHE_VALID;
50 50
51 data = ctrl_inl(addr); 51 data = __raw_readl(addr);
52 52
53 if ((data & v) == v) 53 if ((data & v) == v)
54 ctrl_outl(data & ~v, addr); 54 __raw_writel(data & ~v, addr);
55 55
56 } 56 }
57 57
@@ -78,7 +78,7 @@ static void sh7705_flush_icache_range(void *args)
78/* 78/*
79 * Writeback&Invalidate the D-cache of the page 79 * Writeback&Invalidate the D-cache of the page
80 */ 80 */
81static void __uses_jump_to_uncached __flush_dcache_page(unsigned long phys) 81static void __flush_dcache_page(unsigned long phys)
82{ 82{
83 unsigned long ways, waysize, addrstart; 83 unsigned long ways, waysize, addrstart;
84 unsigned long flags; 84 unsigned long flags;
@@ -115,10 +115,10 @@ static void __uses_jump_to_uncached __flush_dcache_page(unsigned long phys)
115 addr += current_cpu_data.dcache.linesz) { 115 addr += current_cpu_data.dcache.linesz) {
116 unsigned long data; 116 unsigned long data;
117 117
118 data = ctrl_inl(addr) & (0x1ffffC00 | SH_CACHE_VALID); 118 data = __raw_readl(addr) & (0x1ffffC00 | SH_CACHE_VALID);
119 if (data == phys) { 119 if (data == phys) {
120 data &= ~(SH_CACHE_VALID | SH_CACHE_UPDATED); 120 data &= ~(SH_CACHE_VALID | SH_CACHE_UPDATED);
121 ctrl_outl(data, addr); 121 __raw_writel(data, addr);
122 } 122 }
123 } 123 }
124 124
@@ -144,7 +144,7 @@ static void sh7705_flush_dcache_page(void *arg)
144 __flush_dcache_page(__pa(page_address(page))); 144 __flush_dcache_page(__pa(page_address(page)));
145} 145}
146 146
147static void __uses_jump_to_uncached sh7705_flush_cache_all(void *args) 147static void sh7705_flush_cache_all(void *args)
148{ 148{
149 unsigned long flags; 149 unsigned long flags;
150 150
diff --git a/arch/sh/mm/cache.c b/arch/sh/mm/cache.c
index b8607fa7ae12..0f4095d7ac8b 100644
--- a/arch/sh/mm/cache.c
+++ b/arch/sh/mm/cache.c
@@ -2,7 +2,7 @@
2 * arch/sh/mm/cache.c 2 * arch/sh/mm/cache.c
3 * 3 *
4 * Copyright (C) 1999, 2000, 2002 Niibe Yutaka 4 * Copyright (C) 1999, 2000, 2002 Niibe Yutaka
5 * Copyright (C) 2002 - 2009 Paul Mundt 5 * Copyright (C) 2002 - 2010 Paul Mundt
6 * 6 *
7 * Released under the terms of the GNU GPL v2.0. 7 * Released under the terms of the GNU GPL v2.0.
8 */ 8 */
@@ -41,8 +41,17 @@ static inline void cacheop_on_each_cpu(void (*func) (void *info), void *info,
41 int wait) 41 int wait)
42{ 42{
43 preempt_disable(); 43 preempt_disable();
44 smp_call_function(func, info, wait); 44
45 /*
46 * It's possible that this gets called early on when IRQs are
47 * still disabled due to ioremapping by the boot CPU, so don't
48 * even attempt IPIs unless there are other CPUs online.
49 */
50 if (num_online_cpus() > 1)
51 smp_call_function(func, info, wait);
52
45 func(info); 53 func(info);
54
46 preempt_enable(); 55 preempt_enable();
47} 56}
48 57
diff --git a/arch/sh/mm/fault_32.c b/arch/sh/mm/fault_32.c
index 47530104e0ad..8bf79e3b7bdd 100644
--- a/arch/sh/mm/fault_32.c
+++ b/arch/sh/mm/fault_32.c
@@ -53,6 +53,9 @@ static inline pmd_t *vmalloc_sync_one(pgd_t *pgd, unsigned long address)
53 if (!pud_present(*pud_k)) 53 if (!pud_present(*pud_k))
54 return NULL; 54 return NULL;
55 55
56 if (!pud_present(*pud))
57 set_pud(pud, *pud_k);
58
56 pmd = pmd_offset(pud, address); 59 pmd = pmd_offset(pud, address);
57 pmd_k = pmd_offset(pud_k, address); 60 pmd_k = pmd_offset(pud_k, address);
58 if (!pmd_present(*pmd_k)) 61 if (!pmd_present(*pmd_k))
@@ -371,7 +374,7 @@ handle_tlbmiss(struct pt_regs *regs, unsigned long writeaccess,
371 local_flush_tlb_one(get_asid(), address & PAGE_MASK); 374 local_flush_tlb_one(get_asid(), address & PAGE_MASK);
372#endif 375#endif
373 376
374 update_mmu_cache(NULL, address, entry); 377 update_mmu_cache(NULL, address, pte);
375 378
376 return 0; 379 return 0;
377} 380}
diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c
index 432acd07e76a..68028e8f26ce 100644
--- a/arch/sh/mm/init.c
+++ b/arch/sh/mm/init.c
@@ -21,25 +21,13 @@
21#include <asm/cacheflush.h> 21#include <asm/cacheflush.h>
22#include <asm/sections.h> 22#include <asm/sections.h>
23#include <asm/cache.h> 23#include <asm/cache.h>
24#include <asm/sizes.h>
24 25
25DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); 26DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
26pgd_t swapper_pg_dir[PTRS_PER_PGD]; 27pgd_t swapper_pg_dir[PTRS_PER_PGD];
27 28
28#ifdef CONFIG_SUPERH32
29/*
30 * Handle trivial transitions between cached and uncached
31 * segments, making use of the 1:1 mapping relationship in
32 * 512MB lowmem.
33 *
34 * This is the offset of the uncached section from its cached alias.
35 * Default value only valid in 29 bit mode, in 32bit mode will be
36 * overridden in pmb_init.
37 */
38unsigned long cached_to_uncached = P2SEG - P1SEG;
39#endif
40
41#ifdef CONFIG_MMU 29#ifdef CONFIG_MMU
42static void set_pte_phys(unsigned long addr, unsigned long phys, pgprot_t prot) 30static pte_t *__get_pte_phys(unsigned long addr)
43{ 31{
44 pgd_t *pgd; 32 pgd_t *pgd;
45 pud_t *pud; 33 pud_t *pud;
@@ -49,22 +37,30 @@ static void set_pte_phys(unsigned long addr, unsigned long phys, pgprot_t prot)
49 pgd = pgd_offset_k(addr); 37 pgd = pgd_offset_k(addr);
50 if (pgd_none(*pgd)) { 38 if (pgd_none(*pgd)) {
51 pgd_ERROR(*pgd); 39 pgd_ERROR(*pgd);
52 return; 40 return NULL;
53 } 41 }
54 42
55 pud = pud_alloc(NULL, pgd, addr); 43 pud = pud_alloc(NULL, pgd, addr);
56 if (unlikely(!pud)) { 44 if (unlikely(!pud)) {
57 pud_ERROR(*pud); 45 pud_ERROR(*pud);
58 return; 46 return NULL;
59 } 47 }
60 48
61 pmd = pmd_alloc(NULL, pud, addr); 49 pmd = pmd_alloc(NULL, pud, addr);
62 if (unlikely(!pmd)) { 50 if (unlikely(!pmd)) {
63 pmd_ERROR(*pmd); 51 pmd_ERROR(*pmd);
64 return; 52 return NULL;
65 } 53 }
66 54
67 pte = pte_offset_kernel(pmd, addr); 55 pte = pte_offset_kernel(pmd, addr);
56 return pte;
57}
58
59static void set_pte_phys(unsigned long addr, unsigned long phys, pgprot_t prot)
60{
61 pte_t *pte;
62
63 pte = __get_pte_phys(addr);
68 if (!pte_none(*pte)) { 64 if (!pte_none(*pte)) {
69 pte_ERROR(*pte); 65 pte_ERROR(*pte);
70 return; 66 return;
@@ -72,23 +68,24 @@ static void set_pte_phys(unsigned long addr, unsigned long phys, pgprot_t prot)
72 68
73 set_pte(pte, pfn_pte(phys >> PAGE_SHIFT, prot)); 69 set_pte(pte, pfn_pte(phys >> PAGE_SHIFT, prot));
74 local_flush_tlb_one(get_asid(), addr); 70 local_flush_tlb_one(get_asid(), addr);
71
72 if (pgprot_val(prot) & _PAGE_WIRED)
73 tlb_wire_entry(NULL, addr, *pte);
74}
75
76static void clear_pte_phys(unsigned long addr, pgprot_t prot)
77{
78 pte_t *pte;
79
80 pte = __get_pte_phys(addr);
81
82 if (pgprot_val(prot) & _PAGE_WIRED)
83 tlb_unwire_entry();
84
85 set_pte(pte, pfn_pte(0, __pgprot(0)));
86 local_flush_tlb_one(get_asid(), addr);
75} 87}
76 88
77/*
78 * As a performance optimization, other platforms preserve the fixmap mapping
79 * across a context switch, we don't presently do this, but this could be done
80 * in a similar fashion as to the wired TLB interface that sh64 uses (by way
81 * of the memory mapped UTLB configuration) -- this unfortunately forces us to
82 * give up a TLB entry for each mapping we want to preserve. While this may be
83 * viable for a small number of fixmaps, it's not particularly useful for
84 * everything and needs to be carefully evaluated. (ie, we may want this for
85 * the vsyscall page).
86 *
87 * XXX: Perhaps add a _PAGE_WIRED flag or something similar that we can pass
88 * in at __set_fixmap() time to determine the appropriate behavior to follow.
89 *
90 * -- PFM.
91 */
92void __set_fixmap(enum fixed_addresses idx, unsigned long phys, pgprot_t prot) 89void __set_fixmap(enum fixed_addresses idx, unsigned long phys, pgprot_t prot)
93{ 90{
94 unsigned long address = __fix_to_virt(idx); 91 unsigned long address = __fix_to_virt(idx);
@@ -101,6 +98,18 @@ void __set_fixmap(enum fixed_addresses idx, unsigned long phys, pgprot_t prot)
101 set_pte_phys(address, phys, prot); 98 set_pte_phys(address, phys, prot);
102} 99}
103 100
101void __clear_fixmap(enum fixed_addresses idx, pgprot_t prot)
102{
103 unsigned long address = __fix_to_virt(idx);
104
105 if (idx >= __end_of_fixed_addresses) {
106 BUG();
107 return;
108 }
109
110 clear_pte_phys(address, prot);
111}
112
104void __init page_table_range_init(unsigned long start, unsigned long end, 113void __init page_table_range_init(unsigned long start, unsigned long end,
105 pgd_t *pgd_base) 114 pgd_t *pgd_base)
106{ 115{
@@ -120,7 +129,13 @@ void __init page_table_range_init(unsigned long start, unsigned long end,
120 for ( ; (i < PTRS_PER_PGD) && (vaddr != end); pgd++, i++) { 129 for ( ; (i < PTRS_PER_PGD) && (vaddr != end); pgd++, i++) {
121 pud = (pud_t *)pgd; 130 pud = (pud_t *)pgd;
122 for ( ; (j < PTRS_PER_PUD) && (vaddr != end); pud++, j++) { 131 for ( ; (j < PTRS_PER_PUD) && (vaddr != end); pud++, j++) {
132#ifdef __PAGETABLE_PMD_FOLDED
123 pmd = (pmd_t *)pud; 133 pmd = (pmd_t *)pud;
134#else
135 pmd = (pmd_t *)alloc_bootmem_low_pages(PAGE_SIZE);
136 pud_populate(&init_mm, pud, pmd);
137 pmd += k;
138#endif
124 for (; (k < PTRS_PER_PMD) && (vaddr != end); pmd++, k++) { 139 for (; (k < PTRS_PER_PMD) && (vaddr != end); pmd++, k++) {
125 if (pmd_none(*pmd)) { 140 if (pmd_none(*pmd)) {
126 pte = (pte_t *) alloc_bootmem_low_pages(PAGE_SIZE); 141 pte = (pte_t *) alloc_bootmem_low_pages(PAGE_SIZE);
@@ -182,9 +197,6 @@ void __init paging_init(void)
182 } 197 }
183 198
184 free_area_init_nodes(max_zone_pfns); 199 free_area_init_nodes(max_zone_pfns);
185
186 /* Set up the uncached fixmap */
187 set_fixmap_nocache(FIX_UNCACHED, __pa(&__uncached_start));
188} 200}
189 201
190/* 202/*
@@ -195,6 +207,8 @@ static void __init iommu_init(void)
195 no_iommu_init(); 207 no_iommu_init();
196} 208}
197 209
210unsigned int mem_init_done = 0;
211
198void __init mem_init(void) 212void __init mem_init(void)
199{ 213{
200 int codesize, datasize, initsize; 214 int codesize, datasize, initsize;
@@ -231,6 +245,8 @@ void __init mem_init(void)
231 memset(empty_zero_page, 0, PAGE_SIZE); 245 memset(empty_zero_page, 0, PAGE_SIZE);
232 __flush_wback_region(empty_zero_page, PAGE_SIZE); 246 __flush_wback_region(empty_zero_page, PAGE_SIZE);
233 247
248 vsyscall_init();
249
234 codesize = (unsigned long) &_etext - (unsigned long) &_text; 250 codesize = (unsigned long) &_etext - (unsigned long) &_text;
235 datasize = (unsigned long) &_edata - (unsigned long) &_etext; 251 datasize = (unsigned long) &_edata - (unsigned long) &_etext;
236 initsize = (unsigned long) &__init_end - (unsigned long) &__init_begin; 252 initsize = (unsigned long) &__init_end - (unsigned long) &__init_begin;
@@ -243,8 +259,48 @@ void __init mem_init(void)
243 datasize >> 10, 259 datasize >> 10,
244 initsize >> 10); 260 initsize >> 10);
245 261
246 /* Initialize the vDSO */ 262 printk(KERN_INFO "virtual kernel memory layout:\n"
247 vsyscall_init(); 263 " fixmap : 0x%08lx - 0x%08lx (%4ld kB)\n"
264#ifdef CONFIG_HIGHMEM
265 " pkmap : 0x%08lx - 0x%08lx (%4ld kB)\n"
266#endif
267 " vmalloc : 0x%08lx - 0x%08lx (%4ld MB)\n"
268 " lowmem : 0x%08lx - 0x%08lx (%4ld MB) (cached)\n"
269#ifdef CONFIG_UNCACHED_MAPPING
270 " : 0x%08lx - 0x%08lx (%4ld MB) (uncached)\n"
271#endif
272 " .init : 0x%08lx - 0x%08lx (%4ld kB)\n"
273 " .data : 0x%08lx - 0x%08lx (%4ld kB)\n"
274 " .text : 0x%08lx - 0x%08lx (%4ld kB)\n",
275 FIXADDR_START, FIXADDR_TOP,
276 (FIXADDR_TOP - FIXADDR_START) >> 10,
277
278#ifdef CONFIG_HIGHMEM
279 PKMAP_BASE, PKMAP_BASE+LAST_PKMAP*PAGE_SIZE,
280 (LAST_PKMAP*PAGE_SIZE) >> 10,
281#endif
282
283 (unsigned long)VMALLOC_START, VMALLOC_END,
284 (VMALLOC_END - VMALLOC_START) >> 20,
285
286 (unsigned long)memory_start, (unsigned long)high_memory,
287 ((unsigned long)high_memory - (unsigned long)memory_start) >> 20,
288
289#ifdef CONFIG_UNCACHED_MAPPING
290 uncached_start, uncached_end, uncached_size >> 20,
291#endif
292
293 (unsigned long)&__init_begin, (unsigned long)&__init_end,
294 ((unsigned long)&__init_end -
295 (unsigned long)&__init_begin) >> 10,
296
297 (unsigned long)&_etext, (unsigned long)&_edata,
298 ((unsigned long)&_edata - (unsigned long)&_etext) >> 10,
299
300 (unsigned long)&_text, (unsigned long)&_etext,
301 ((unsigned long)&_etext - (unsigned long)&_text) >> 10);
302
303 mem_init_done = 1;
248} 304}
249 305
250void free_initmem(void) 306void free_initmem(void)
@@ -277,35 +333,6 @@ void free_initrd_mem(unsigned long start, unsigned long end)
277} 333}
278#endif 334#endif
279 335
280#if THREAD_SHIFT < PAGE_SHIFT
281static struct kmem_cache *thread_info_cache;
282
283struct thread_info *alloc_thread_info(struct task_struct *tsk)
284{
285 struct thread_info *ti;
286
287 ti = kmem_cache_alloc(thread_info_cache, GFP_KERNEL);
288 if (unlikely(ti == NULL))
289 return NULL;
290#ifdef CONFIG_DEBUG_STACK_USAGE
291 memset(ti, 0, THREAD_SIZE);
292#endif
293 return ti;
294}
295
296void free_thread_info(struct thread_info *ti)
297{
298 kmem_cache_free(thread_info_cache, ti);
299}
300
301void thread_info_cache_init(void)
302{
303 thread_info_cache = kmem_cache_create("thread_info", THREAD_SIZE,
304 THREAD_SIZE, 0, NULL);
305 BUG_ON(thread_info_cache == NULL);
306}
307#endif /* THREAD_SHIFT < PAGE_SHIFT */
308
309#ifdef CONFIG_MEMORY_HOTPLUG 336#ifdef CONFIG_MEMORY_HOTPLUG
310int arch_add_memory(int nid, u64 start, u64 size) 337int arch_add_memory(int nid, u64 start, u64 size)
311{ 338{
@@ -336,10 +363,3 @@ EXPORT_SYMBOL_GPL(memory_add_physaddr_to_nid);
336#endif 363#endif
337 364
338#endif /* CONFIG_MEMORY_HOTPLUG */ 365#endif /* CONFIG_MEMORY_HOTPLUG */
339
340#ifdef CONFIG_PMB
341int __in_29bit_mode(void)
342{
343 return !(ctrl_inl(PMB_PASCR) & PASCR_SE);
344}
345#endif /* CONFIG_PMB */
diff --git a/arch/sh/mm/ioremap_32.c b/arch/sh/mm/ioremap.c
index 2141befb4f91..c68d2d7d00a9 100644
--- a/arch/sh/mm/ioremap_32.c
+++ b/arch/sh/mm/ioremap.c
@@ -1,13 +1,13 @@
1/* 1/*
2 * arch/sh/mm/ioremap.c 2 * arch/sh/mm/ioremap.c
3 * 3 *
4 * (C) Copyright 1995 1996 Linus Torvalds
5 * (C) Copyright 2005 - 2010 Paul Mundt
6 *
4 * Re-map IO memory to kernel address space so that we can access it. 7 * Re-map IO memory to kernel address space so that we can access it.
5 * This is needed for high PCI addresses that aren't mapped in the 8 * This is needed for high PCI addresses that aren't mapped in the
6 * 640k-1MB IO memory area on PC's 9 * 640k-1MB IO memory area on PC's
7 * 10 *
8 * (C) Copyright 1995 1996 Linus Torvalds
9 * (C) Copyright 2005, 2006 Paul Mundt
10 *
11 * This file is subject to the terms and conditions of the GNU General 11 * This file is subject to the terms and conditions of the GNU General
12 * Public License. See the file "COPYING" in the main directory of this 12 * Public License. See the file "COPYING" in the main directory of this
13 * archive for more details. 13 * archive for more details.
@@ -33,12 +33,12 @@
33 * have to convert them into an offset in a page-aligned mapping, but the 33 * have to convert them into an offset in a page-aligned mapping, but the
34 * caller shouldn't need to know that small detail. 34 * caller shouldn't need to know that small detail.
35 */ 35 */
36void __iomem *__ioremap_caller(unsigned long phys_addr, unsigned long size, 36void __iomem * __init_refok
37 unsigned long flags, void *caller) 37__ioremap_caller(unsigned long phys_addr, unsigned long size,
38 pgprot_t pgprot, void *caller)
38{ 39{
39 struct vm_struct *area; 40 struct vm_struct *area;
40 unsigned long offset, last_addr, addr, orig_addr; 41 unsigned long offset, last_addr, addr, orig_addr;
41 pgprot_t pgprot;
42 42
43 /* Don't allow wraparound or zero size */ 43 /* Don't allow wraparound or zero size */
44 last_addr = phys_addr + size - 1; 44 last_addr = phys_addr + size - 1;
@@ -46,18 +46,6 @@ void __iomem *__ioremap_caller(unsigned long phys_addr, unsigned long size,
46 return NULL; 46 return NULL;
47 47
48 /* 48 /*
49 * If we're in the fixed PCI memory range, mapping through page
50 * tables is not only pointless, but also fundamentally broken.
51 * Just return the physical address instead.
52 *
53 * For boards that map a small PCI memory aperture somewhere in
54 * P1/P2 space, ioremap() will already do the right thing,
55 * and we'll never get this far.
56 */
57 if (is_pci_memory_fixed_range(phys_addr, size))
58 return (void __iomem *)phys_addr;
59
60 /*
61 * Mappings have to be page-aligned 49 * Mappings have to be page-aligned
62 */ 50 */
63 offset = phys_addr & ~PAGE_MASK; 51 offset = phys_addr & ~PAGE_MASK;
@@ -65,6 +53,12 @@ void __iomem *__ioremap_caller(unsigned long phys_addr, unsigned long size,
65 size = PAGE_ALIGN(last_addr+1) - phys_addr; 53 size = PAGE_ALIGN(last_addr+1) - phys_addr;
66 54
67 /* 55 /*
56 * If we can't yet use the regular approach, go the fixmap route.
57 */
58 if (!mem_init_done)
59 return ioremap_fixed(phys_addr, offset, size, pgprot);
60
61 /*
68 * Ok, go for it.. 62 * Ok, go for it..
69 */ 63 */
70 area = get_vm_area_caller(size, VM_IOREMAP, caller); 64 area = get_vm_area_caller(size, VM_IOREMAP, caller);
@@ -84,8 +78,9 @@ void __iomem *__ioremap_caller(unsigned long phys_addr, unsigned long size,
84 * PMB entries are all pre-faulted. 78 * PMB entries are all pre-faulted.
85 */ 79 */
86 if (unlikely(phys_addr >= P1SEG)) { 80 if (unlikely(phys_addr >= P1SEG)) {
87 unsigned long mapped = pmb_remap(addr, phys_addr, size, flags); 81 unsigned long mapped;
88 82
83 mapped = pmb_remap(addr, phys_addr, size, pgprot);
89 if (likely(mapped)) { 84 if (likely(mapped)) {
90 addr += mapped; 85 addr += mapped;
91 phys_addr += mapped; 86 phys_addr += mapped;
@@ -94,7 +89,6 @@ void __iomem *__ioremap_caller(unsigned long phys_addr, unsigned long size,
94 } 89 }
95#endif 90#endif
96 91
97 pgprot = __pgprot(pgprot_val(PAGE_KERNEL_NOCACHE) | flags);
98 if (likely(size)) 92 if (likely(size))
99 if (ioremap_page_range(addr, addr + size, phys_addr, pgprot)) { 93 if (ioremap_page_range(addr, addr + size, phys_addr, pgprot)) {
100 vunmap((void *)orig_addr); 94 vunmap((void *)orig_addr);
@@ -105,15 +99,38 @@ void __iomem *__ioremap_caller(unsigned long phys_addr, unsigned long size,
105} 99}
106EXPORT_SYMBOL(__ioremap_caller); 100EXPORT_SYMBOL(__ioremap_caller);
107 101
102/*
103 * Simple checks for non-translatable mappings.
104 */
105static inline int iomapping_nontranslatable(unsigned long offset)
106{
107#ifdef CONFIG_29BIT
108 /*
109 * In 29-bit mode this includes the fixed P1/P2 areas, as well as
110 * parts of P3.
111 */
112 if (PXSEG(offset) < P3SEG || offset >= P3_ADDR_MAX)
113 return 1;
114#endif
115
116 return 0;
117}
118
108void __iounmap(void __iomem *addr) 119void __iounmap(void __iomem *addr)
109{ 120{
110 unsigned long vaddr = (unsigned long __force)addr; 121 unsigned long vaddr = (unsigned long __force)addr;
111 unsigned long seg = PXSEG(vaddr);
112 struct vm_struct *p; 122 struct vm_struct *p;
113 123
114 if (seg < P3SEG || vaddr >= P3_ADDR_MAX) 124 /*
125 * Nothing to do if there is no translatable mapping.
126 */
127 if (iomapping_nontranslatable(vaddr))
115 return; 128 return;
116 if (is_pci_memory_fixed_range(vaddr, 0)) 129
130 /*
131 * There's no VMA if it's from an early fixed mapping.
132 */
133 if (iounmap_fixed(addr) == 0)
117 return; 134 return;
118 135
119#ifdef CONFIG_PMB 136#ifdef CONFIG_PMB
diff --git a/arch/sh/mm/ioremap_64.c b/arch/sh/mm/ioremap_64.c
deleted file mode 100644
index ef434657d428..000000000000
--- a/arch/sh/mm/ioremap_64.c
+++ /dev/null
@@ -1,326 +0,0 @@
1/*
2 * arch/sh/mm/ioremap_64.c
3 *
4 * Copyright (C) 2000, 2001 Paolo Alberelli
5 * Copyright (C) 2003 - 2007 Paul Mundt
6 *
7 * Mostly derived from arch/sh/mm/ioremap.c which, in turn is mostly
8 * derived from arch/i386/mm/ioremap.c .
9 *
10 * (C) Copyright 1995 1996 Linus Torvalds
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/vmalloc.h>
17#include <linux/ioport.h>
18#include <linux/module.h>
19#include <linux/mm.h>
20#include <linux/io.h>
21#include <linux/bootmem.h>
22#include <linux/proc_fs.h>
23#include <linux/slab.h>
24#include <asm/page.h>
25#include <asm/pgalloc.h>
26#include <asm/addrspace.h>
27#include <asm/cacheflush.h>
28#include <asm/tlbflush.h>
29#include <asm/mmu.h>
30
31static struct resource shmedia_iomap = {
32 .name = "shmedia_iomap",
33 .start = IOBASE_VADDR + PAGE_SIZE,
34 .end = IOBASE_END - 1,
35};
36
37static void shmedia_mapioaddr(unsigned long pa, unsigned long va,
38 unsigned long flags);
39static void shmedia_unmapioaddr(unsigned long vaddr);
40static void __iomem *shmedia_ioremap(struct resource *res, u32 pa,
41 int sz, unsigned long flags);
42
43/*
44 * We have the same problem as the SPARC, so lets have the same comment:
45 * Our mini-allocator...
46 * Boy this is gross! We need it because we must map I/O for
47 * timers and interrupt controller before the kmalloc is available.
48 */
49
50#define XNMLN 15
51#define XNRES 10
52
53struct xresource {
54 struct resource xres; /* Must be first */
55 int xflag; /* 1 == used */
56 char xname[XNMLN+1];
57};
58
59static struct xresource xresv[XNRES];
60
61static struct xresource *xres_alloc(void)
62{
63 struct xresource *xrp;
64 int n;
65
66 xrp = xresv;
67 for (n = 0; n < XNRES; n++) {
68 if (xrp->xflag == 0) {
69 xrp->xflag = 1;
70 return xrp;
71 }
72 xrp++;
73 }
74 return NULL;
75}
76
77static void xres_free(struct xresource *xrp)
78{
79 xrp->xflag = 0;
80}
81
82static struct resource *shmedia_find_resource(struct resource *root,
83 unsigned long vaddr)
84{
85 struct resource *res;
86
87 for (res = root->child; res; res = res->sibling)
88 if (res->start <= vaddr && res->end >= vaddr)
89 return res;
90
91 return NULL;
92}
93
94static void __iomem *shmedia_alloc_io(unsigned long phys, unsigned long size,
95 const char *name, unsigned long flags)
96{
97 struct xresource *xres;
98 struct resource *res;
99 char *tack;
100 int tlen;
101
102 if (name == NULL)
103 name = "???";
104
105 xres = xres_alloc();
106 if (xres != 0) {
107 tack = xres->xname;
108 res = &xres->xres;
109 } else {
110 printk_once(KERN_NOTICE "%s: done with statics, "
111 "switching to kmalloc\n", __func__);
112 tlen = strlen(name);
113 tack = kmalloc(sizeof(struct resource) + tlen + 1, GFP_KERNEL);
114 if (!tack)
115 return NULL;
116 memset(tack, 0, sizeof(struct resource));
117 res = (struct resource *) tack;
118 tack += sizeof(struct resource);
119 }
120
121 strncpy(tack, name, XNMLN);
122 tack[XNMLN] = 0;
123 res->name = tack;
124
125 return shmedia_ioremap(res, phys, size, flags);
126}
127
128static void __iomem *shmedia_ioremap(struct resource *res, u32 pa, int sz,
129 unsigned long flags)
130{
131 unsigned long offset = ((unsigned long) pa) & (~PAGE_MASK);
132 unsigned long round_sz = (offset + sz + PAGE_SIZE-1) & PAGE_MASK;
133 unsigned long va;
134 unsigned int psz;
135
136 if (allocate_resource(&shmedia_iomap, res, round_sz,
137 shmedia_iomap.start, shmedia_iomap.end,
138 PAGE_SIZE, NULL, NULL) != 0) {
139 panic("alloc_io_res(%s): cannot occupy\n",
140 (res->name != NULL) ? res->name : "???");
141 }
142
143 va = res->start;
144 pa &= PAGE_MASK;
145
146 psz = (res->end - res->start + (PAGE_SIZE - 1)) / PAGE_SIZE;
147
148 for (psz = res->end - res->start + 1; psz != 0; psz -= PAGE_SIZE) {
149 shmedia_mapioaddr(pa, va, flags);
150 va += PAGE_SIZE;
151 pa += PAGE_SIZE;
152 }
153
154 return (void __iomem *)(unsigned long)(res->start + offset);
155}
156
157static void shmedia_free_io(struct resource *res)
158{
159 unsigned long len = res->end - res->start + 1;
160
161 BUG_ON((len & (PAGE_SIZE - 1)) != 0);
162
163 while (len) {
164 len -= PAGE_SIZE;
165 shmedia_unmapioaddr(res->start + len);
166 }
167
168 release_resource(res);
169}
170
171static __init_refok void *sh64_get_page(void)
172{
173 void *page;
174
175 if (slab_is_available())
176 page = (void *)get_zeroed_page(GFP_KERNEL);
177 else
178 page = alloc_bootmem_pages(PAGE_SIZE);
179
180 if (!page || ((unsigned long)page & ~PAGE_MASK))
181 panic("sh64_get_page: Out of memory already?\n");
182
183 return page;
184}
185
186static void shmedia_mapioaddr(unsigned long pa, unsigned long va,
187 unsigned long flags)
188{
189 pgd_t *pgdp;
190 pud_t *pudp;
191 pmd_t *pmdp;
192 pte_t *ptep, pte;
193 pgprot_t prot;
194
195 pr_debug("shmedia_mapiopage pa %08lx va %08lx\n", pa, va);
196
197 if (!flags)
198 flags = 1; /* 1 = CB0-1 device */
199
200 pgdp = pgd_offset_k(va);
201 if (pgd_none(*pgdp) || !pgd_present(*pgdp)) {
202 pudp = (pud_t *)sh64_get_page();
203 set_pgd(pgdp, __pgd((unsigned long)pudp | _KERNPG_TABLE));
204 }
205
206 pudp = pud_offset(pgdp, va);
207 if (pud_none(*pudp) || !pud_present(*pudp)) {
208 pmdp = (pmd_t *)sh64_get_page();
209 set_pud(pudp, __pud((unsigned long)pmdp | _KERNPG_TABLE));
210 }
211
212 pmdp = pmd_offset(pudp, va);
213 if (pmd_none(*pmdp) || !pmd_present(*pmdp)) {
214 ptep = (pte_t *)sh64_get_page();
215 set_pmd(pmdp, __pmd((unsigned long)ptep + _PAGE_TABLE));
216 }
217
218 prot = __pgprot(_PAGE_PRESENT | _PAGE_READ | _PAGE_WRITE |
219 _PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_SHARED | flags);
220
221 pte = pfn_pte(pa >> PAGE_SHIFT, prot);
222 ptep = pte_offset_kernel(pmdp, va);
223
224 if (!pte_none(*ptep) &&
225 pte_val(*ptep) != pte_val(pte))
226 pte_ERROR(*ptep);
227
228 set_pte(ptep, pte);
229
230 flush_tlb_kernel_range(va, PAGE_SIZE);
231}
232
233static void shmedia_unmapioaddr(unsigned long vaddr)
234{
235 pgd_t *pgdp;
236 pud_t *pudp;
237 pmd_t *pmdp;
238 pte_t *ptep;
239
240 pgdp = pgd_offset_k(vaddr);
241 if (pgd_none(*pgdp) || pgd_bad(*pgdp))
242 return;
243
244 pudp = pud_offset(pgdp, vaddr);
245 if (pud_none(*pudp) || pud_bad(*pudp))
246 return;
247
248 pmdp = pmd_offset(pudp, vaddr);
249 if (pmd_none(*pmdp) || pmd_bad(*pmdp))
250 return;
251
252 ptep = pte_offset_kernel(pmdp, vaddr);
253
254 if (pte_none(*ptep) || !pte_present(*ptep))
255 return;
256
257 clear_page((void *)ptep);
258 pte_clear(&init_mm, vaddr, ptep);
259}
260
261void __iomem *__ioremap_caller(unsigned long offset, unsigned long size,
262 unsigned long flags, void *caller)
263{
264 char name[14];
265
266 sprintf(name, "phys_%08x", (u32)offset);
267 return shmedia_alloc_io(offset, size, name, flags);
268}
269EXPORT_SYMBOL(__ioremap_caller);
270
271void __iounmap(void __iomem *virtual)
272{
273 unsigned long vaddr = (unsigned long)virtual & PAGE_MASK;
274 struct resource *res;
275 unsigned int psz;
276
277 res = shmedia_find_resource(&shmedia_iomap, vaddr);
278 if (!res) {
279 printk(KERN_ERR "%s: Failed to free 0x%08lx\n",
280 __func__, vaddr);
281 return;
282 }
283
284 psz = (res->end - res->start + (PAGE_SIZE - 1)) / PAGE_SIZE;
285
286 shmedia_free_io(res);
287
288 if ((char *)res >= (char *)xresv &&
289 (char *)res < (char *)&xresv[XNRES]) {
290 xres_free((struct xresource *)res);
291 } else {
292 kfree(res);
293 }
294}
295EXPORT_SYMBOL(__iounmap);
296
297static int
298ioremap_proc_info(char *buf, char **start, off_t fpos, int length, int *eof,
299 void *data)
300{
301 char *p = buf, *e = buf + length;
302 struct resource *r;
303 const char *nm;
304
305 for (r = ((struct resource *)data)->child; r != NULL; r = r->sibling) {
306 if (p + 32 >= e) /* Better than nothing */
307 break;
308 nm = r->name;
309 if (nm == NULL)
310 nm = "???";
311
312 p += sprintf(p, "%08lx-%08lx: %s\n",
313 (unsigned long)r->start,
314 (unsigned long)r->end, nm);
315 }
316
317 return p-buf;
318}
319
320static int __init register_proc_onchip(void)
321{
322 create_proc_read_entry("io_map", 0, 0, ioremap_proc_info,
323 &shmedia_iomap);
324 return 0;
325}
326late_initcall(register_proc_onchip);
diff --git a/arch/sh/mm/ioremap_fixed.c b/arch/sh/mm/ioremap_fixed.c
new file mode 100644
index 000000000000..0b78b1e20ef1
--- /dev/null
+++ b/arch/sh/mm/ioremap_fixed.c
@@ -0,0 +1,128 @@
1/*
2 * Re-map IO memory to kernel address space so that we can access it.
3 *
4 * These functions should only be used when it is necessary to map a
5 * physical address space into the kernel address space before ioremap()
6 * can be used, e.g. early in boot before paging_init().
7 *
8 * Copyright (C) 2009 Matt Fleming
9 */
10
11#include <linux/vmalloc.h>
12#include <linux/ioport.h>
13#include <linux/module.h>
14#include <linux/mm.h>
15#include <linux/io.h>
16#include <linux/bootmem.h>
17#include <linux/proc_fs.h>
18#include <linux/slab.h>
19#include <asm/fixmap.h>
20#include <asm/page.h>
21#include <asm/pgalloc.h>
22#include <asm/addrspace.h>
23#include <asm/cacheflush.h>
24#include <asm/tlbflush.h>
25#include <asm/mmu.h>
26#include <asm/mmu_context.h>
27
28struct ioremap_map {
29 void __iomem *addr;
30 unsigned long size;
31 unsigned long fixmap_addr;
32};
33
34static struct ioremap_map ioremap_maps[FIX_N_IOREMAPS];
35
36void __init ioremap_fixed_init(void)
37{
38 struct ioremap_map *map;
39 int i;
40
41 for (i = 0; i < FIX_N_IOREMAPS; i++) {
42 map = &ioremap_maps[i];
43 map->fixmap_addr = __fix_to_virt(FIX_IOREMAP_BEGIN + i);
44 }
45}
46
47void __init __iomem *
48ioremap_fixed(resource_size_t phys_addr, unsigned long offset,
49 unsigned long size, pgprot_t prot)
50{
51 enum fixed_addresses idx0, idx;
52 struct ioremap_map *map;
53 unsigned int nrpages;
54 int i, slot;
55
56 slot = -1;
57 for (i = 0; i < FIX_N_IOREMAPS; i++) {
58 map = &ioremap_maps[i];
59 if (!map->addr) {
60 map->size = size;
61 slot = i;
62 break;
63 }
64 }
65
66 if (slot < 0)
67 return NULL;
68
69 /*
70 * Mappings have to fit in the FIX_IOREMAP area.
71 */
72 nrpages = size >> PAGE_SHIFT;
73 if (nrpages > FIX_N_IOREMAPS)
74 return NULL;
75
76 /*
77 * Ok, go for it..
78 */
79 idx0 = FIX_IOREMAP_BEGIN + slot;
80 idx = idx0;
81 while (nrpages > 0) {
82 pgprot_val(prot) |= _PAGE_WIRED;
83 __set_fixmap(idx, phys_addr, prot);
84 phys_addr += PAGE_SIZE;
85 idx++;
86 --nrpages;
87 }
88
89 map->addr = (void __iomem *)(offset + map->fixmap_addr);
90 return map->addr;
91}
92
93int iounmap_fixed(void __iomem *addr)
94{
95 enum fixed_addresses idx;
96 struct ioremap_map *map;
97 unsigned int nrpages;
98 int i, slot;
99
100 slot = -1;
101 for (i = 0; i < FIX_N_IOREMAPS; i++) {
102 map = &ioremap_maps[i];
103 if (map->addr == addr) {
104 slot = i;
105 break;
106 }
107 }
108
109 /*
110 * If we don't match, it's not for us.
111 */
112 if (slot < 0)
113 return -EINVAL;
114
115 nrpages = map->size >> PAGE_SHIFT;
116
117 idx = FIX_IOREMAP_BEGIN + slot + nrpages - 1;
118 while (nrpages > 0) {
119 __clear_fixmap(idx, __pgprot(_PAGE_WIRED));
120 --idx;
121 --nrpages;
122 }
123
124 map->size = 0;
125 map->addr = NULL;
126
127 return 0;
128}
diff --git a/arch/sh/mm/nommu.c b/arch/sh/mm/nommu.c
index ac16c05917ef..7694f50c9034 100644
--- a/arch/sh/mm/nommu.c
+++ b/arch/sh/mm/nommu.c
@@ -94,3 +94,7 @@ void __init page_table_range_init(unsigned long start, unsigned long end,
94void __set_fixmap(enum fixed_addresses idx, unsigned long phys, pgprot_t prot) 94void __set_fixmap(enum fixed_addresses idx, unsigned long phys, pgprot_t prot)
95{ 95{
96} 96}
97
98void pgtable_cache_init(void)
99{
100}
diff --git a/arch/sh/mm/pgtable.c b/arch/sh/mm/pgtable.c
new file mode 100644
index 000000000000..6f21fb1d8726
--- /dev/null
+++ b/arch/sh/mm/pgtable.c
@@ -0,0 +1,56 @@
1#include <linux/mm.h>
2
3#define PGALLOC_GFP GFP_KERNEL | __GFP_REPEAT | __GFP_ZERO
4
5static struct kmem_cache *pgd_cachep;
6#if PAGETABLE_LEVELS > 2
7static struct kmem_cache *pmd_cachep;
8#endif
9
10void pgd_ctor(void *x)
11{
12 pgd_t *pgd = x;
13
14 memcpy(pgd + USER_PTRS_PER_PGD,
15 swapper_pg_dir + USER_PTRS_PER_PGD,
16 (PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t));
17}
18
19void pgtable_cache_init(void)
20{
21 pgd_cachep = kmem_cache_create("pgd_cache",
22 PTRS_PER_PGD * (1<<PTE_MAGNITUDE),
23 PAGE_SIZE, SLAB_PANIC, pgd_ctor);
24#if PAGETABLE_LEVELS > 2
25 pmd_cachep = kmem_cache_create("pmd_cache",
26 PTRS_PER_PMD * (1<<PTE_MAGNITUDE),
27 PAGE_SIZE, SLAB_PANIC, NULL);
28#endif
29}
30
31pgd_t *pgd_alloc(struct mm_struct *mm)
32{
33 return kmem_cache_alloc(pgd_cachep, PGALLOC_GFP);
34}
35
36void pgd_free(struct mm_struct *mm, pgd_t *pgd)
37{
38 kmem_cache_free(pgd_cachep, pgd);
39}
40
41#if PAGETABLE_LEVELS > 2
42void pud_populate(struct mm_struct *mm, pud_t *pud, pmd_t *pmd)
43{
44 set_pud(pud, __pud((unsigned long)pmd));
45}
46
47pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address)
48{
49 return kmem_cache_alloc(pmd_cachep, PGALLOC_GFP);
50}
51
52void pmd_free(struct mm_struct *mm, pmd_t *pmd)
53{
54 kmem_cache_free(pmd_cachep, pmd);
55}
56#endif /* PAGETABLE_LEVELS > 2 */
diff --git a/arch/sh/mm/pmb.c b/arch/sh/mm/pmb.c
index 280f6a166035..198bcff5e96f 100644
--- a/arch/sh/mm/pmb.c
+++ b/arch/sh/mm/pmb.c
@@ -3,11 +3,8 @@
3 * 3 *
4 * Privileged Space Mapping Buffer (PMB) Support. 4 * Privileged Space Mapping Buffer (PMB) Support.
5 * 5 *
6 * Copyright (C) 2005, 2006, 2007 Paul Mundt 6 * Copyright (C) 2005 - 2010 Paul Mundt
7 * 7 * Copyright (C) 2010 Matt Fleming
8 * P1/P2 Section mapping definitions from map32.h, which was:
9 *
10 * Copyright 2003 (c) Lineo Solutions,Inc.
11 * 8 *
12 * This file is subject to the terms and conditions of the GNU General Public 9 * 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 10 * License. See the file "COPYING" in the main directory of this archive
@@ -24,47 +21,67 @@
24#include <linux/fs.h> 21#include <linux/fs.h>
25#include <linux/seq_file.h> 22#include <linux/seq_file.h>
26#include <linux/err.h> 23#include <linux/err.h>
24#include <linux/io.h>
25#include <linux/spinlock.h>
26#include <linux/rwlock.h>
27#include <asm/sizes.h>
27#include <asm/system.h> 28#include <asm/system.h>
28#include <asm/uaccess.h> 29#include <asm/uaccess.h>
29#include <asm/pgtable.h> 30#include <asm/pgtable.h>
31#include <asm/page.h>
30#include <asm/mmu.h> 32#include <asm/mmu.h>
31#include <asm/io.h>
32#include <asm/mmu_context.h> 33#include <asm/mmu_context.h>
33 34
34#define NR_PMB_ENTRIES 16 35struct pmb_entry;
36
37struct pmb_entry {
38 unsigned long vpn;
39 unsigned long ppn;
40 unsigned long flags;
41 unsigned long size;
35 42
36static void __pmb_unmap(struct pmb_entry *); 43 spinlock_t lock;
44
45 /*
46 * 0 .. NR_PMB_ENTRIES for specific entry selection, or
47 * PMB_NO_ENTRY to search for a free one
48 */
49 int entry;
37 50
51 /* Adjacent entry link for contiguous multi-entry mappings */
52 struct pmb_entry *link;
53};
54
55static void pmb_unmap_entry(struct pmb_entry *, int depth);
56
57static DEFINE_RWLOCK(pmb_rwlock);
38static struct pmb_entry pmb_entry_list[NR_PMB_ENTRIES]; 58static struct pmb_entry pmb_entry_list[NR_PMB_ENTRIES];
39static unsigned long pmb_map; 59static DECLARE_BITMAP(pmb_map, NR_PMB_ENTRIES);
40 60
41static inline unsigned long mk_pmb_entry(unsigned int entry) 61static __always_inline unsigned long mk_pmb_entry(unsigned int entry)
42{ 62{
43 return (entry & PMB_E_MASK) << PMB_E_SHIFT; 63 return (entry & PMB_E_MASK) << PMB_E_SHIFT;
44} 64}
45 65
46static inline unsigned long mk_pmb_addr(unsigned int entry) 66static __always_inline unsigned long mk_pmb_addr(unsigned int entry)
47{ 67{
48 return mk_pmb_entry(entry) | PMB_ADDR; 68 return mk_pmb_entry(entry) | PMB_ADDR;
49} 69}
50 70
51static inline unsigned long mk_pmb_data(unsigned int entry) 71static __always_inline unsigned long mk_pmb_data(unsigned int entry)
52{ 72{
53 return mk_pmb_entry(entry) | PMB_DATA; 73 return mk_pmb_entry(entry) | PMB_DATA;
54} 74}
55 75
56static int pmb_alloc_entry(void) 76static int pmb_alloc_entry(void)
57{ 77{
58 unsigned int pos; 78 int pos;
59
60repeat:
61 pos = find_first_zero_bit(&pmb_map, NR_PMB_ENTRIES);
62
63 if (unlikely(pos > NR_PMB_ENTRIES))
64 return -ENOSPC;
65 79
66 if (test_and_set_bit(pos, &pmb_map)) 80 pos = find_first_zero_bit(pmb_map, NR_PMB_ENTRIES);
67 goto repeat; 81 if (pos >= 0 && pos < NR_PMB_ENTRIES)
82 __set_bit(pos, pmb_map);
83 else
84 pos = -ENOSPC;
68 85
69 return pos; 86 return pos;
70} 87}
@@ -73,21 +90,34 @@ static struct pmb_entry *pmb_alloc(unsigned long vpn, unsigned long ppn,
73 unsigned long flags, int entry) 90 unsigned long flags, int entry)
74{ 91{
75 struct pmb_entry *pmbe; 92 struct pmb_entry *pmbe;
93 unsigned long irqflags;
94 void *ret = NULL;
76 int pos; 95 int pos;
77 96
97 write_lock_irqsave(&pmb_rwlock, irqflags);
98
78 if (entry == PMB_NO_ENTRY) { 99 if (entry == PMB_NO_ENTRY) {
79 pos = pmb_alloc_entry(); 100 pos = pmb_alloc_entry();
80 if (pos < 0) 101 if (unlikely(pos < 0)) {
81 return ERR_PTR(pos); 102 ret = ERR_PTR(pos);
103 goto out;
104 }
82 } else { 105 } else {
83 if (test_bit(entry, &pmb_map)) 106 if (__test_and_set_bit(entry, pmb_map)) {
84 return ERR_PTR(-ENOSPC); 107 ret = ERR_PTR(-ENOSPC);
108 goto out;
109 }
110
85 pos = entry; 111 pos = entry;
86 } 112 }
87 113
114 write_unlock_irqrestore(&pmb_rwlock, irqflags);
115
88 pmbe = &pmb_entry_list[pos]; 116 pmbe = &pmb_entry_list[pos];
89 if (!pmbe) 117
90 return ERR_PTR(-ENOMEM); 118 memset(pmbe, 0, sizeof(struct pmb_entry));
119
120 spin_lock_init(&pmbe->lock);
91 121
92 pmbe->vpn = vpn; 122 pmbe->vpn = vpn;
93 pmbe->ppn = ppn; 123 pmbe->ppn = ppn;
@@ -95,101 +125,113 @@ static struct pmb_entry *pmb_alloc(unsigned long vpn, unsigned long ppn,
95 pmbe->entry = pos; 125 pmbe->entry = pos;
96 126
97 return pmbe; 127 return pmbe;
128
129out:
130 write_unlock_irqrestore(&pmb_rwlock, irqflags);
131 return ret;
98} 132}
99 133
100static void pmb_free(struct pmb_entry *pmbe) 134static void pmb_free(struct pmb_entry *pmbe)
101{ 135{
102 int pos = pmbe->entry; 136 __clear_bit(pmbe->entry, pmb_map);
103
104 pmbe->vpn = 0;
105 pmbe->ppn = 0;
106 pmbe->flags = 0;
107 pmbe->entry = 0;
108 137
109 clear_bit(pos, &pmb_map); 138 pmbe->entry = PMB_NO_ENTRY;
139 pmbe->link = NULL;
110} 140}
111 141
112/* 142/*
113 * Must be in P2 for __set_pmb_entry() 143 * Ensure that the PMB entries match our cache configuration.
144 *
145 * When we are in 32-bit address extended mode, CCR.CB becomes
146 * invalid, so care must be taken to manually adjust cacheable
147 * translations.
114 */ 148 */
115static void __set_pmb_entry(unsigned long vpn, unsigned long ppn, 149static __always_inline unsigned long pmb_cache_flags(void)
116 unsigned long flags, int pos)
117{ 150{
118 ctrl_outl(vpn | PMB_V, mk_pmb_addr(pos)); 151 unsigned long flags = 0;
119 152
120#ifdef CONFIG_CACHE_WRITETHROUGH 153#if defined(CONFIG_CACHE_WRITETHROUGH)
121 /* 154 flags |= PMB_C | PMB_WT | PMB_UB;
122 * When we are in 32-bit address extended mode, CCR.CB becomes 155#elif defined(CONFIG_CACHE_WRITEBACK)
123 * invalid, so care must be taken to manually adjust cacheable 156 flags |= PMB_C;
124 * translations.
125 */
126 if (likely(flags & PMB_C))
127 flags |= PMB_WT;
128#endif 157#endif
129 158
130 ctrl_outl(ppn | flags | PMB_V, mk_pmb_data(pos)); 159 return flags;
131} 160}
132 161
133static void __uses_jump_to_uncached set_pmb_entry(struct pmb_entry *pmbe) 162/*
163 * Must be run uncached.
164 */
165static void __set_pmb_entry(struct pmb_entry *pmbe)
134{ 166{
135 jump_to_uncached(); 167 writel_uncached(pmbe->vpn | PMB_V, mk_pmb_addr(pmbe->entry));
136 __set_pmb_entry(pmbe->vpn, pmbe->ppn, pmbe->flags, pmbe->entry); 168 writel_uncached(pmbe->ppn | pmbe->flags | PMB_V,
137 back_to_cached(); 169 mk_pmb_data(pmbe->entry));
138} 170}
139 171
140static void __uses_jump_to_uncached clear_pmb_entry(struct pmb_entry *pmbe) 172static void __clear_pmb_entry(struct pmb_entry *pmbe)
141{ 173{
142 unsigned int entry = pmbe->entry; 174 unsigned long addr, data;
143 unsigned long addr; 175 unsigned long addr_val, data_val;
144 176
145 if (unlikely(entry >= NR_PMB_ENTRIES)) 177 addr = mk_pmb_addr(pmbe->entry);
146 return; 178 data = mk_pmb_data(pmbe->entry);
147 179
148 jump_to_uncached(); 180 addr_val = __raw_readl(addr);
181 data_val = __raw_readl(data);
149 182
150 /* Clear V-bit */ 183 /* Clear V-bit */
151 addr = mk_pmb_addr(entry); 184 writel_uncached(addr_val & ~PMB_V, addr);
152 ctrl_outl(ctrl_inl(addr) & ~PMB_V, addr); 185 writel_uncached(data_val & ~PMB_V, data);
186}
153 187
154 addr = mk_pmb_data(entry); 188static void set_pmb_entry(struct pmb_entry *pmbe)
155 ctrl_outl(ctrl_inl(addr) & ~PMB_V, addr); 189{
190 unsigned long flags;
156 191
157 back_to_cached(); 192 spin_lock_irqsave(&pmbe->lock, flags);
193 __set_pmb_entry(pmbe);
194 spin_unlock_irqrestore(&pmbe->lock, flags);
158} 195}
159 196
160
161static struct { 197static struct {
162 unsigned long size; 198 unsigned long size;
163 int flag; 199 int flag;
164} pmb_sizes[] = { 200} pmb_sizes[] = {
165 { .size = 0x20000000, .flag = PMB_SZ_512M, }, 201 { .size = SZ_512M, .flag = PMB_SZ_512M, },
166 { .size = 0x08000000, .flag = PMB_SZ_128M, }, 202 { .size = SZ_128M, .flag = PMB_SZ_128M, },
167 { .size = 0x04000000, .flag = PMB_SZ_64M, }, 203 { .size = SZ_64M, .flag = PMB_SZ_64M, },
168 { .size = 0x01000000, .flag = PMB_SZ_16M, }, 204 { .size = SZ_16M, .flag = PMB_SZ_16M, },
169}; 205};
170 206
171long pmb_remap(unsigned long vaddr, unsigned long phys, 207long pmb_remap(unsigned long vaddr, unsigned long phys,
172 unsigned long size, unsigned long flags) 208 unsigned long size, pgprot_t prot)
173{ 209{
174 struct pmb_entry *pmbp, *pmbe; 210 struct pmb_entry *pmbp, *pmbe;
175 unsigned long wanted; 211 unsigned long wanted;
176 int pmb_flags, i; 212 int pmb_flags, i;
177 long err; 213 long err;
214 u64 flags;
215
216 flags = pgprot_val(prot);
217
218 pmb_flags = PMB_WT | PMB_UB;
178 219
179 /* Convert typical pgprot value to the PMB equivalent */ 220 /* Convert typical pgprot value to the PMB equivalent */
180 if (flags & _PAGE_CACHABLE) { 221 if (flags & _PAGE_CACHABLE) {
181 if (flags & _PAGE_WT) 222 pmb_flags |= PMB_C;
182 pmb_flags = PMB_WT; 223
183 else 224 if ((flags & _PAGE_WT) == 0)
184 pmb_flags = PMB_C; 225 pmb_flags &= ~(PMB_WT | PMB_UB);
185 } else 226 }
186 pmb_flags = PMB_WT | PMB_UB;
187 227
188 pmbp = NULL; 228 pmbp = NULL;
189 wanted = size; 229 wanted = size;
190 230
191again: 231again:
192 for (i = 0; i < ARRAY_SIZE(pmb_sizes); i++) { 232 for (i = 0; i < ARRAY_SIZE(pmb_sizes); i++) {
233 unsigned long flags;
234
193 if (size < pmb_sizes[i].size) 235 if (size < pmb_sizes[i].size)
194 continue; 236 continue;
195 237
@@ -200,18 +242,25 @@ again:
200 goto out; 242 goto out;
201 } 243 }
202 244
203 set_pmb_entry(pmbe); 245 spin_lock_irqsave(&pmbe->lock, flags);
246
247 __set_pmb_entry(pmbe);
204 248
205 phys += pmb_sizes[i].size; 249 phys += pmb_sizes[i].size;
206 vaddr += pmb_sizes[i].size; 250 vaddr += pmb_sizes[i].size;
207 size -= pmb_sizes[i].size; 251 size -= pmb_sizes[i].size;
208 252
253 pmbe->size = pmb_sizes[i].size;
254
209 /* 255 /*
210 * Link adjacent entries that span multiple PMB entries 256 * Link adjacent entries that span multiple PMB entries
211 * for easier tear-down. 257 * for easier tear-down.
212 */ 258 */
213 if (likely(pmbp)) 259 if (likely(pmbp)) {
260 spin_lock(&pmbp->lock);
214 pmbp->link = pmbe; 261 pmbp->link = pmbe;
262 spin_unlock(&pmbp->lock);
263 }
215 264
216 pmbp = pmbe; 265 pmbp = pmbe;
217 266
@@ -221,16 +270,17 @@ again:
221 * pmb_sizes[i].size again. 270 * pmb_sizes[i].size again.
222 */ 271 */
223 i--; 272 i--;
273
274 spin_unlock_irqrestore(&pmbe->lock, flags);
224 } 275 }
225 276
226 if (size >= 0x1000000) 277 if (size >= SZ_16M)
227 goto again; 278 goto again;
228 279
229 return wanted - size; 280 return wanted - size;
230 281
231out: 282out:
232 if (pmbp) 283 pmb_unmap_entry(pmbp, NR_PMB_ENTRIES);
233 __pmb_unmap(pmbp);
234 284
235 return err; 285 return err;
236} 286}
@@ -240,24 +290,52 @@ void pmb_unmap(unsigned long addr)
240 struct pmb_entry *pmbe = NULL; 290 struct pmb_entry *pmbe = NULL;
241 int i; 291 int i;
242 292
293 read_lock(&pmb_rwlock);
294
243 for (i = 0; i < ARRAY_SIZE(pmb_entry_list); i++) { 295 for (i = 0; i < ARRAY_SIZE(pmb_entry_list); i++) {
244 if (test_bit(i, &pmb_map)) { 296 if (test_bit(i, pmb_map)) {
245 pmbe = &pmb_entry_list[i]; 297 pmbe = &pmb_entry_list[i];
246 if (pmbe->vpn == addr) 298 if (pmbe->vpn == addr)
247 break; 299 break;
248 } 300 }
249 } 301 }
250 302
251 if (unlikely(!pmbe)) 303 read_unlock(&pmb_rwlock);
252 return;
253 304
254 __pmb_unmap(pmbe); 305 pmb_unmap_entry(pmbe, NR_PMB_ENTRIES);
255} 306}
256 307
257static void __pmb_unmap(struct pmb_entry *pmbe) 308static bool pmb_can_merge(struct pmb_entry *a, struct pmb_entry *b)
258{ 309{
259 BUG_ON(!test_bit(pmbe->entry, &pmb_map)); 310 return (b->vpn == (a->vpn + a->size)) &&
311 (b->ppn == (a->ppn + a->size)) &&
312 (b->flags == a->flags);
313}
260 314
315static bool pmb_size_valid(unsigned long size)
316{
317 int i;
318
319 for (i = 0; i < ARRAY_SIZE(pmb_sizes); i++)
320 if (pmb_sizes[i].size == size)
321 return true;
322
323 return false;
324}
325
326static int pmb_size_to_flags(unsigned long size)
327{
328 int i;
329
330 for (i = 0; i < ARRAY_SIZE(pmb_sizes); i++)
331 if (pmb_sizes[i].size == size)
332 return pmb_sizes[i].flag;
333
334 return 0;
335}
336
337static void __pmb_unmap_entry(struct pmb_entry *pmbe, int depth)
338{
261 do { 339 do {
262 struct pmb_entry *pmblink = pmbe; 340 struct pmb_entry *pmblink = pmbe;
263 341
@@ -268,102 +346,312 @@ static void __pmb_unmap(struct pmb_entry *pmbe)
268 * this entry in pmb_alloc() (even if we haven't filled 346 * this entry in pmb_alloc() (even if we haven't filled
269 * it yet). 347 * it yet).
270 * 348 *
271 * Therefore, calling clear_pmb_entry() is safe as no 349 * Therefore, calling __clear_pmb_entry() is safe as no
272 * other mapping can be using that slot. 350 * other mapping can be using that slot.
273 */ 351 */
274 clear_pmb_entry(pmbe); 352 __clear_pmb_entry(pmbe);
275 353
276 pmbe = pmblink->link; 354 pmbe = pmblink->link;
277 355
278 pmb_free(pmblink); 356 pmb_free(pmblink);
279 } while (pmbe); 357 } while (pmbe && --depth);
358}
359
360static void pmb_unmap_entry(struct pmb_entry *pmbe, int depth)
361{
362 unsigned long flags;
363
364 if (unlikely(!pmbe))
365 return;
366
367 write_lock_irqsave(&pmb_rwlock, flags);
368 __pmb_unmap_entry(pmbe, depth);
369 write_unlock_irqrestore(&pmb_rwlock, flags);
370}
371
372static __always_inline unsigned int pmb_ppn_in_range(unsigned long ppn)
373{
374 return ppn >= __pa(memory_start) && ppn < __pa(memory_end);
280} 375}
281 376
282#ifdef CONFIG_PMB 377static void __init pmb_notify(void)
283int __uses_jump_to_uncached pmb_init(void)
284{ 378{
285 unsigned int i; 379 int i;
286 long size, ret;
287 380
288 jump_to_uncached(); 381 pr_info("PMB: boot mappings:\n");
382
383 read_lock(&pmb_rwlock);
384
385 for (i = 0; i < ARRAY_SIZE(pmb_entry_list); i++) {
386 struct pmb_entry *pmbe;
387
388 if (!test_bit(i, pmb_map))
389 continue;
390
391 pmbe = &pmb_entry_list[i];
392
393 pr_info(" 0x%08lx -> 0x%08lx [ %4ldMB %2scached ]\n",
394 pmbe->vpn >> PAGE_SHIFT, pmbe->ppn >> PAGE_SHIFT,
395 pmbe->size >> 20, (pmbe->flags & PMB_C) ? "" : "un");
396 }
397
398 read_unlock(&pmb_rwlock);
399}
400
401/*
402 * Sync our software copy of the PMB mappings with those in hardware. The
403 * mappings in the hardware PMB were either set up by the bootloader or
404 * very early on by the kernel.
405 */
406static void __init pmb_synchronize(void)
407{
408 struct pmb_entry *pmbp = NULL;
409 int i, j;
289 410
290 /* 411 /*
291 * Insert PMB entries for the P1 and P2 areas so that, after 412 * Run through the initial boot mappings, log the established
292 * we've switched the MMU to 32-bit mode, the semantics of P1 413 * ones, and blow away anything that falls outside of the valid
293 * and P2 are the same as in 29-bit mode, e.g. 414 * PPN range. Specifically, we only care about existing mappings
415 * that impact the cached/uncached sections.
294 * 416 *
295 * P1 - provides a cached window onto physical memory 417 * Note that touching these can be a bit of a minefield; the boot
296 * P2 - provides an uncached window onto physical memory 418 * loader can establish multi-page mappings with the same caching
419 * attributes, so we need to ensure that we aren't modifying a
420 * mapping that we're presently executing from, or may execute
421 * from in the case of straddling page boundaries.
422 *
423 * In the future we will have to tidy up after the boot loader by
424 * jumping between the cached and uncached mappings and tearing
425 * down alternating mappings while executing from the other.
297 */ 426 */
298 size = __MEMORY_START + __MEMORY_SIZE; 427 for (i = 0; i < NR_PMB_ENTRIES; i++) {
428 unsigned long addr, data;
429 unsigned long addr_val, data_val;
430 unsigned long ppn, vpn, flags;
431 unsigned long irqflags;
432 unsigned int size;
433 struct pmb_entry *pmbe;
299 434
300 ret = pmb_remap(P1SEG, 0x00000000, size, PMB_C); 435 addr = mk_pmb_addr(i);
301 BUG_ON(ret != size); 436 data = mk_pmb_data(i);
302 437
303 ret = pmb_remap(P2SEG, 0x00000000, size, PMB_WT | PMB_UB); 438 addr_val = __raw_readl(addr);
304 BUG_ON(ret != size); 439 data_val = __raw_readl(data);
305 440
306 ctrl_outl(0, PMB_IRMCR); 441 /*
442 * Skip over any bogus entries
443 */
444 if (!(data_val & PMB_V) || !(addr_val & PMB_V))
445 continue;
307 446
308 /* PMB.SE and UB[7] */ 447 ppn = data_val & PMB_PFN_MASK;
309 ctrl_outl(PASCR_SE | (1 << 7), PMB_PASCR); 448 vpn = addr_val & PMB_PFN_MASK;
310 449
311 /* Flush out the TLB */ 450 /*
312 i = ctrl_inl(MMUCR); 451 * Only preserve in-range mappings.
313 i |= MMUCR_TI; 452 */
314 ctrl_outl(i, MMUCR); 453 if (!pmb_ppn_in_range(ppn)) {
454 /*
455 * Invalidate anything out of bounds.
456 */
457 writel_uncached(addr_val & ~PMB_V, addr);
458 writel_uncached(data_val & ~PMB_V, data);
459 continue;
460 }
315 461
316 back_to_cached(); 462 /*
463 * Update the caching attributes if necessary
464 */
465 if (data_val & PMB_C) {
466 data_val &= ~PMB_CACHE_MASK;
467 data_val |= pmb_cache_flags();
317 468
318 return 0; 469 writel_uncached(data_val, data);
470 }
471
472 size = data_val & PMB_SZ_MASK;
473 flags = size | (data_val & PMB_CACHE_MASK);
474
475 pmbe = pmb_alloc(vpn, ppn, flags, i);
476 if (IS_ERR(pmbe)) {
477 WARN_ON_ONCE(1);
478 continue;
479 }
480
481 spin_lock_irqsave(&pmbe->lock, irqflags);
482
483 for (j = 0; j < ARRAY_SIZE(pmb_sizes); j++)
484 if (pmb_sizes[j].flag == size)
485 pmbe->size = pmb_sizes[j].size;
486
487 if (pmbp) {
488 spin_lock(&pmbp->lock);
489
490 /*
491 * Compare the previous entry against the current one to
492 * see if the entries span a contiguous mapping. If so,
493 * setup the entry links accordingly. Compound mappings
494 * are later coalesced.
495 */
496 if (pmb_can_merge(pmbp, pmbe))
497 pmbp->link = pmbe;
498
499 spin_unlock(&pmbp->lock);
500 }
501
502 pmbp = pmbe;
503
504 spin_unlock_irqrestore(&pmbe->lock, irqflags);
505 }
506}
507
508static void __init pmb_merge(struct pmb_entry *head)
509{
510 unsigned long span, newsize;
511 struct pmb_entry *tail;
512 int i = 1, depth = 0;
513
514 span = newsize = head->size;
515
516 tail = head->link;
517 while (tail) {
518 span += tail->size;
519
520 if (pmb_size_valid(span)) {
521 newsize = span;
522 depth = i;
523 }
524
525 /* This is the end of the line.. */
526 if (!tail->link)
527 break;
528
529 tail = tail->link;
530 i++;
531 }
532
533 /*
534 * The merged page size must be valid.
535 */
536 if (!pmb_size_valid(newsize))
537 return;
538
539 head->flags &= ~PMB_SZ_MASK;
540 head->flags |= pmb_size_to_flags(newsize);
541
542 head->size = newsize;
543
544 __pmb_unmap_entry(head->link, depth);
545 __set_pmb_entry(head);
319} 546}
320#else 547
321int __uses_jump_to_uncached pmb_init(void) 548static void __init pmb_coalesce(void)
322{ 549{
550 unsigned long flags;
323 int i; 551 int i;
324 unsigned long addr, data;
325 552
326 jump_to_uncached(); 553 write_lock_irqsave(&pmb_rwlock, flags);
327 554
328 for (i = 0; i < PMB_ENTRY_MAX; i++) { 555 for (i = 0; i < ARRAY_SIZE(pmb_entry_list); i++) {
329 struct pmb_entry *pmbe; 556 struct pmb_entry *pmbe;
330 unsigned long vpn, ppn, flags;
331 557
332 addr = PMB_DATA + (i << PMB_E_SHIFT); 558 if (!test_bit(i, pmb_map))
333 data = ctrl_inl(addr);
334 if (!(data & PMB_V))
335 continue; 559 continue;
336 560
337 if (data & PMB_C) { 561 pmbe = &pmb_entry_list[i];
338#if defined(CONFIG_CACHE_WRITETHROUGH)
339 data |= PMB_WT;
340#elif defined(CONFIG_CACHE_WRITEBACK)
341 data &= ~PMB_WT;
342#else
343 data &= ~(PMB_C | PMB_WT);
344#endif
345 }
346 ctrl_outl(data, addr);
347 562
348 ppn = data & PMB_PFN_MASK; 563 /*
564 * We're only interested in compound mappings
565 */
566 if (!pmbe->link)
567 continue;
349 568
350 flags = data & (PMB_C | PMB_WT | PMB_UB); 569 /*
351 flags |= data & PMB_SZ_MASK; 570 * Nothing to do if it already uses the largest possible
571 * page size.
572 */
573 if (pmbe->size == SZ_512M)
574 continue;
352 575
353 addr = PMB_ADDR + (i << PMB_E_SHIFT); 576 pmb_merge(pmbe);
354 data = ctrl_inl(addr); 577 }
355 578
356 vpn = data & PMB_PFN_MASK; 579 write_unlock_irqrestore(&pmb_rwlock, flags);
580}
357 581
358 pmbe = pmb_alloc(vpn, ppn, flags, i); 582#ifdef CONFIG_UNCACHED_MAPPING
359 WARN_ON(IS_ERR(pmbe)); 583static void __init pmb_resize(void)
584{
585 int i;
586
587 /*
588 * If the uncached mapping was constructed by the kernel, it will
589 * already be a reasonable size.
590 */
591 if (uncached_size == SZ_16M)
592 return;
593
594 read_lock(&pmb_rwlock);
595
596 for (i = 0; i < ARRAY_SIZE(pmb_entry_list); i++) {
597 struct pmb_entry *pmbe;
598 unsigned long flags;
599
600 if (!test_bit(i, pmb_map))
601 continue;
602
603 pmbe = &pmb_entry_list[i];
604
605 if (pmbe->vpn != uncached_start)
606 continue;
607
608 /*
609 * Found it, now resize it.
610 */
611 spin_lock_irqsave(&pmbe->lock, flags);
612
613 pmbe->size = SZ_16M;
614 pmbe->flags &= ~PMB_SZ_MASK;
615 pmbe->flags |= pmb_size_to_flags(pmbe->size);
616
617 uncached_resize(pmbe->size);
618
619 __set_pmb_entry(pmbe);
620
621 spin_unlock_irqrestore(&pmbe->lock, flags);
360 } 622 }
361 623
362 back_to_cached(); 624 read_lock(&pmb_rwlock);
625}
626#endif
627
628void __init pmb_init(void)
629{
630 /* Synchronize software state */
631 pmb_synchronize();
363 632
364 return 0; 633 /* Attempt to combine compound mappings */
634 pmb_coalesce();
635
636#ifdef CONFIG_UNCACHED_MAPPING
637 /* Resize initial mappings, if necessary */
638 pmb_resize();
639#endif
640
641 /* Log them */
642 pmb_notify();
643
644 writel_uncached(0, PMB_IRMCR);
645
646 /* Flush out the TLB */
647 __raw_writel(__raw_readl(MMUCR) | MMUCR_TI, MMUCR);
648 ctrl_barrier();
649}
650
651bool __in_29bit_mode(void)
652{
653 return (__raw_readl(PMB_PASCR) & PASCR_SE) == 0;
365} 654}
366#endif /* CONFIG_PMB */
367 655
368static int pmb_seq_show(struct seq_file *file, void *iter) 656static int pmb_seq_show(struct seq_file *file, void *iter)
369{ 657{
@@ -378,8 +666,8 @@ static int pmb_seq_show(struct seq_file *file, void *iter)
378 unsigned int size; 666 unsigned int size;
379 char *sz_str = NULL; 667 char *sz_str = NULL;
380 668
381 addr = ctrl_inl(mk_pmb_addr(i)); 669 addr = __raw_readl(mk_pmb_addr(i));
382 data = ctrl_inl(mk_pmb_data(i)); 670 data = __raw_readl(mk_pmb_data(i));
383 671
384 size = data & PMB_SZ_MASK; 672 size = data & PMB_SZ_MASK;
385 sz_str = (size == PMB_SZ_16M) ? " 16MB": 673 sz_str = (size == PMB_SZ_16M) ? " 16MB":
@@ -437,14 +725,21 @@ static int pmb_sysdev_suspend(struct sys_device *dev, pm_message_t state)
437 if (state.event == PM_EVENT_ON && 725 if (state.event == PM_EVENT_ON &&
438 prev_state.event == PM_EVENT_FREEZE) { 726 prev_state.event == PM_EVENT_FREEZE) {
439 struct pmb_entry *pmbe; 727 struct pmb_entry *pmbe;
728
729 read_lock(&pmb_rwlock);
730
440 for (i = 0; i < ARRAY_SIZE(pmb_entry_list); i++) { 731 for (i = 0; i < ARRAY_SIZE(pmb_entry_list); i++) {
441 if (test_bit(i, &pmb_map)) { 732 if (test_bit(i, pmb_map)) {
442 pmbe = &pmb_entry_list[i]; 733 pmbe = &pmb_entry_list[i];
443 set_pmb_entry(pmbe); 734 set_pmb_entry(pmbe);
444 } 735 }
445 } 736 }
737
738 read_unlock(&pmb_rwlock);
446 } 739 }
740
447 prev_state = state; 741 prev_state = state;
742
448 return 0; 743 return 0;
449} 744}
450 745
@@ -462,6 +757,5 @@ static int __init pmb_sysdev_init(void)
462{ 757{
463 return sysdev_driver_register(&cpu_sysdev_class, &pmb_sysdev_driver); 758 return sysdev_driver_register(&cpu_sysdev_class, &pmb_sysdev_driver);
464} 759}
465
466subsys_initcall(pmb_sysdev_init); 760subsys_initcall(pmb_sysdev_init);
467#endif 761#endif
diff --git a/arch/sh/mm/tlb-pteaex.c b/arch/sh/mm/tlb-pteaex.c
index 409b7c2b4b9d..32dc674c550c 100644
--- a/arch/sh/mm/tlb-pteaex.c
+++ b/arch/sh/mm/tlb-pteaex.c
@@ -68,8 +68,7 @@ void __update_tlb(struct vm_area_struct *vma, unsigned long address, pte_t pte)
68 * in extended mode, the legacy 8-bit ASID field in address array 1 has 68 * in extended mode, the legacy 8-bit ASID field in address array 1 has
69 * undefined behaviour. 69 * undefined behaviour.
70 */ 70 */
71void __uses_jump_to_uncached local_flush_tlb_one(unsigned long asid, 71void local_flush_tlb_one(unsigned long asid, unsigned long page)
72 unsigned long page)
73{ 72{
74 jump_to_uncached(); 73 jump_to_uncached();
75 __raw_writel(page, MMU_UTLB_ADDRESS_ARRAY | MMU_PAGE_ASSOC_BIT); 74 __raw_writel(page, MMU_UTLB_ADDRESS_ARRAY | MMU_PAGE_ASSOC_BIT);
diff --git a/arch/sh/mm/tlb-sh3.c b/arch/sh/mm/tlb-sh3.c
index ace8e6d2f59d..4f5f7cbdd508 100644
--- a/arch/sh/mm/tlb-sh3.c
+++ b/arch/sh/mm/tlb-sh3.c
@@ -41,14 +41,14 @@ void __update_tlb(struct vm_area_struct *vma, unsigned long address, pte_t pte)
41 41
42 /* Set PTEH register */ 42 /* Set PTEH register */
43 vpn = (address & MMU_VPN_MASK) | get_asid(); 43 vpn = (address & MMU_VPN_MASK) | get_asid();
44 ctrl_outl(vpn, MMU_PTEH); 44 __raw_writel(vpn, MMU_PTEH);
45 45
46 pteval = pte_val(pte); 46 pteval = pte_val(pte);
47 47
48 /* Set PTEL register */ 48 /* Set PTEL register */
49 pteval &= _PAGE_FLAGS_HARDWARE_MASK; /* drop software flags */ 49 pteval &= _PAGE_FLAGS_HARDWARE_MASK; /* drop software flags */
50 /* conveniently, we want all the software flags to be 0 anyway */ 50 /* conveniently, we want all the software flags to be 0 anyway */
51 ctrl_outl(pteval, MMU_PTEL); 51 __raw_writel(pteval, MMU_PTEL);
52 52
53 /* Load the TLB */ 53 /* Load the TLB */
54 asm volatile("ldtlb": /* no output */ : /* no input */ : "memory"); 54 asm volatile("ldtlb": /* no output */ : /* no input */ : "memory");
@@ -75,5 +75,5 @@ void local_flush_tlb_one(unsigned long asid, unsigned long page)
75 } 75 }
76 76
77 for (i = 0; i < ways; i++) 77 for (i = 0; i < ways; i++)
78 ctrl_outl(data, addr + (i << 8)); 78 __raw_writel(data, addr + (i << 8));
79} 79}
diff --git a/arch/sh/mm/tlb-sh4.c b/arch/sh/mm/tlb-sh4.c
index 8cf550e2570f..ccac77f504a8 100644
--- a/arch/sh/mm/tlb-sh4.c
+++ b/arch/sh/mm/tlb-sh4.c
@@ -29,7 +29,7 @@ void __update_tlb(struct vm_area_struct *vma, unsigned long address, pte_t pte)
29 29
30 /* Set PTEH register */ 30 /* Set PTEH register */
31 vpn = (address & MMU_VPN_MASK) | get_asid(); 31 vpn = (address & MMU_VPN_MASK) | get_asid();
32 ctrl_outl(vpn, MMU_PTEH); 32 __raw_writel(vpn, MMU_PTEH);
33 33
34 pteval = pte.pte_low; 34 pteval = pte.pte_low;
35 35
@@ -41,13 +41,13 @@ void __update_tlb(struct vm_area_struct *vma, unsigned long address, pte_t pte)
41 * the protection bits (with the exception of the compat-mode SZ 41 * the protection bits (with the exception of the compat-mode SZ
42 * and PR bits, which are cleared) being written out in PTEL. 42 * and PR bits, which are cleared) being written out in PTEL.
43 */ 43 */
44 ctrl_outl(pte.pte_high, MMU_PTEA); 44 __raw_writel(pte.pte_high, MMU_PTEA);
45#else 45#else
46 if (cpu_data->flags & CPU_HAS_PTEA) { 46 if (cpu_data->flags & CPU_HAS_PTEA) {
47 /* The last 3 bits and the first one of pteval contains 47 /* The last 3 bits and the first one of pteval contains
48 * the PTEA timing control and space attribute bits 48 * the PTEA timing control and space attribute bits
49 */ 49 */
50 ctrl_outl(copy_ptea_attributes(pteval), MMU_PTEA); 50 __raw_writel(copy_ptea_attributes(pteval), MMU_PTEA);
51 } 51 }
52#endif 52#endif
53 53
@@ -57,15 +57,14 @@ void __update_tlb(struct vm_area_struct *vma, unsigned long address, pte_t pte)
57 pteval |= _PAGE_WT; 57 pteval |= _PAGE_WT;
58#endif 58#endif
59 /* conveniently, we want all the software flags to be 0 anyway */ 59 /* conveniently, we want all the software flags to be 0 anyway */
60 ctrl_outl(pteval, MMU_PTEL); 60 __raw_writel(pteval, MMU_PTEL);
61 61
62 /* Load the TLB */ 62 /* Load the TLB */
63 asm volatile("ldtlb": /* no output */ : /* no input */ : "memory"); 63 asm volatile("ldtlb": /* no output */ : /* no input */ : "memory");
64 local_irq_restore(flags); 64 local_irq_restore(flags);
65} 65}
66 66
67void __uses_jump_to_uncached local_flush_tlb_one(unsigned long asid, 67void local_flush_tlb_one(unsigned long asid, unsigned long page)
68 unsigned long page)
69{ 68{
70 unsigned long addr, data; 69 unsigned long addr, data;
71 70
@@ -78,6 +77,6 @@ void __uses_jump_to_uncached local_flush_tlb_one(unsigned long asid,
78 addr = MMU_UTLB_ADDRESS_ARRAY | MMU_PAGE_ASSOC_BIT; 77 addr = MMU_UTLB_ADDRESS_ARRAY | MMU_PAGE_ASSOC_BIT;
79 data = page | asid; /* VALID bit is off */ 78 data = page | asid; /* VALID bit is off */
80 jump_to_uncached(); 79 jump_to_uncached();
81 ctrl_outl(data, addr); 80 __raw_writel(data, addr);
82 back_to_cached(); 81 back_to_cached();
83} 82}
diff --git a/arch/sh/mm/tlb-sh5.c b/arch/sh/mm/tlb-sh5.c
index fdb64e41ec50..f27dbe1c1599 100644
--- a/arch/sh/mm/tlb-sh5.c
+++ b/arch/sh/mm/tlb-sh5.c
@@ -143,3 +143,42 @@ void sh64_setup_tlb_slot(unsigned long long config_addr, unsigned long eaddr,
143 */ 143 */
144void sh64_teardown_tlb_slot(unsigned long long config_addr) 144void sh64_teardown_tlb_slot(unsigned long long config_addr)
145 __attribute__ ((alias("__flush_tlb_slot"))); 145 __attribute__ ((alias("__flush_tlb_slot")));
146
147static int dtlb_entry;
148static unsigned long long dtlb_entries[64];
149
150void tlb_wire_entry(struct vm_area_struct *vma, unsigned long addr, pte_t pte)
151{
152 unsigned long long entry;
153 unsigned long paddr, flags;
154
155 BUG_ON(dtlb_entry == ARRAY_SIZE(dtlb_entries));
156
157 local_irq_save(flags);
158
159 entry = sh64_get_wired_dtlb_entry();
160 dtlb_entries[dtlb_entry++] = entry;
161
162 paddr = pte_val(pte) & _PAGE_FLAGS_HARDWARE_MASK;
163 paddr &= ~PAGE_MASK;
164
165 sh64_setup_tlb_slot(entry, addr, get_asid(), paddr);
166
167 local_irq_restore(flags);
168}
169
170void tlb_unwire_entry(void)
171{
172 unsigned long long entry;
173 unsigned long flags;
174
175 BUG_ON(!dtlb_entry);
176
177 local_irq_save(flags);
178 entry = dtlb_entries[dtlb_entry--];
179
180 sh64_teardown_tlb_slot(entry);
181 sh64_put_wired_dtlb_entry(entry);
182
183 local_irq_restore(flags);
184}
diff --git a/arch/sh/mm/tlb-urb.c b/arch/sh/mm/tlb-urb.c
new file mode 100644
index 000000000000..bb5b9098956d
--- /dev/null
+++ b/arch/sh/mm/tlb-urb.c
@@ -0,0 +1,81 @@
1/*
2 * arch/sh/mm/tlb-urb.c
3 *
4 * TLB entry wiring helpers for URB-equipped parts.
5 *
6 * Copyright (C) 2010 Matt Fleming
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/mm.h>
13#include <linux/io.h>
14#include <asm/tlb.h>
15#include <asm/mmu_context.h>
16
17/*
18 * Load the entry for 'addr' into the TLB and wire the entry.
19 */
20void tlb_wire_entry(struct vm_area_struct *vma, unsigned long addr, pte_t pte)
21{
22 unsigned long status, flags;
23 int urb;
24
25 local_irq_save(flags);
26
27 /* Load the entry into the TLB */
28 __update_tlb(vma, addr, pte);
29
30 /* ... and wire it up. */
31 status = __raw_readl(MMUCR);
32 urb = (status & MMUCR_URB) >> MMUCR_URB_SHIFT;
33 status &= ~MMUCR_URB;
34
35 /*
36 * Make sure we're not trying to wire the last TLB entry slot.
37 */
38 BUG_ON(!--urb);
39
40 urb = urb % MMUCR_URB_NENTRIES;
41
42 status |= (urb << MMUCR_URB_SHIFT);
43 __raw_writel(status, MMUCR);
44 ctrl_barrier();
45
46 local_irq_restore(flags);
47}
48
49/*
50 * Unwire the last wired TLB entry.
51 *
52 * It should also be noted that it is not possible to wire and unwire
53 * TLB entries in an arbitrary order. If you wire TLB entry N, followed
54 * by entry N+1, you must unwire entry N+1 first, then entry N. In this
55 * respect, it works like a stack or LIFO queue.
56 */
57void tlb_unwire_entry(void)
58{
59 unsigned long status, flags;
60 int urb;
61
62 local_irq_save(flags);
63
64 status = __raw_readl(MMUCR);
65 urb = (status & MMUCR_URB) >> MMUCR_URB_SHIFT;
66 status &= ~MMUCR_URB;
67
68 /*
69 * Make sure we're not trying to unwire a TLB entry when none
70 * have been wired.
71 */
72 BUG_ON(urb++ == MMUCR_URB_NENTRIES);
73
74 urb = urb % MMUCR_URB_NENTRIES;
75
76 status |= (urb << MMUCR_URB_SHIFT);
77 __raw_writel(status, MMUCR);
78 ctrl_barrier();
79
80 local_irq_restore(flags);
81}
diff --git a/arch/sh/mm/tlbflush_32.c b/arch/sh/mm/tlbflush_32.c
index 6f45c1f8a7fe..004bb3f25b5f 100644
--- a/arch/sh/mm/tlbflush_32.c
+++ b/arch/sh/mm/tlbflush_32.c
@@ -132,9 +132,9 @@ void local_flush_tlb_all(void)
132 * It's same position, bit #2. 132 * It's same position, bit #2.
133 */ 133 */
134 local_irq_save(flags); 134 local_irq_save(flags);
135 status = ctrl_inl(MMUCR); 135 status = __raw_readl(MMUCR);
136 status |= 0x04; 136 status |= 0x04;
137 ctrl_outl(status, MMUCR); 137 __raw_writel(status, MMUCR);
138 ctrl_barrier(); 138 ctrl_barrier();
139 local_irq_restore(flags); 139 local_irq_restore(flags);
140} 140}
diff --git a/arch/sh/mm/tlbflush_64.c b/arch/sh/mm/tlbflush_64.c
index de0b0e881823..706da1d3a67a 100644
--- a/arch/sh/mm/tlbflush_64.c
+++ b/arch/sh/mm/tlbflush_64.c
@@ -36,7 +36,7 @@ extern void die(const char *,struct pt_regs *,long);
36 36
37static inline void print_prots(pgprot_t prot) 37static inline void print_prots(pgprot_t prot)
38{ 38{
39 printk("prot is 0x%08lx\n",pgprot_val(prot)); 39 printk("prot is 0x%016llx\n",pgprot_val(prot));
40 40
41 printk("%s %s %s %s %s\n",PPROT(_PAGE_SHARED),PPROT(_PAGE_READ), 41 printk("%s %s %s %s %s\n",PPROT(_PAGE_SHARED),PPROT(_PAGE_READ),
42 PPROT(_PAGE_EXECUTE),PPROT(_PAGE_WRITE),PPROT(_PAGE_USER)); 42 PPROT(_PAGE_EXECUTE),PPROT(_PAGE_WRITE),PPROT(_PAGE_USER));
diff --git a/arch/sh/mm/uncached.c b/arch/sh/mm/uncached.c
new file mode 100644
index 000000000000..cf20a5c5136a
--- /dev/null
+++ b/arch/sh/mm/uncached.c
@@ -0,0 +1,34 @@
1#include <linux/init.h>
2#include <asm/sizes.h>
3#include <asm/page.h>
4
5/*
6 * This is the offset of the uncached section from its cached alias.
7 *
8 * Legacy platforms handle trivial transitions between cached and
9 * uncached segments by making use of the 1:1 mapping relationship in
10 * 512MB lowmem, others via a special uncached mapping.
11 *
12 * Default value only valid in 29 bit mode, in 32bit mode this will be
13 * updated by the early PMB initialization code.
14 */
15unsigned long cached_to_uncached = SZ_512M;
16unsigned long uncached_size = SZ_512M;
17unsigned long uncached_start, uncached_end;
18
19int virt_addr_uncached(unsigned long kaddr)
20{
21 return (kaddr >= uncached_start) && (kaddr < uncached_end);
22}
23
24void __init uncached_init(void)
25{
26 uncached_start = memory_end;
27 uncached_end = uncached_start + uncached_size;
28}
29
30void __init uncached_resize(unsigned long size)
31{
32 uncached_size = size;
33 uncached_end = uncached_start + uncached_size;
34}
diff --git a/arch/sh/tools/mach-types b/arch/sh/tools/mach-types
index 6639b25d8d57..b25aa554ee5e 100644
--- a/arch/sh/tools/mach-types
+++ b/arch/sh/tools/mach-types
@@ -32,6 +32,7 @@ DREAMCAST SH_DREAMCAST
32SNAPGEAR SH_SECUREEDGE5410 32SNAPGEAR SH_SECUREEDGE5410
33EDOSK7705 SH_EDOSK7705 33EDOSK7705 SH_EDOSK7705
34EDOSK7760 SH_EDOSK7760 34EDOSK7760 SH_EDOSK7760
35SDK7786 SH_SDK7786
35SH4202_MICRODEV SH_SH4202_MICRODEV 36SH4202_MICRODEV SH_SH4202_MICRODEV
36SH03 SH_SH03 37SH03 SH_SH03
37LANDISK SH_LANDISK 38LANDISK SH_LANDISK
diff --git a/arch/sparc/include/asm/pgtable_32.h b/arch/sparc/include/asm/pgtable_32.h
index e0cabe790ec1..77f906d8cc21 100644
--- a/arch/sparc/include/asm/pgtable_32.h
+++ b/arch/sparc/include/asm/pgtable_32.h
@@ -330,9 +330,9 @@ BTFIXUPDEF_CALL(void, mmu_info, struct seq_file *)
330#define FAULT_CODE_WRITE 0x2 330#define FAULT_CODE_WRITE 0x2
331#define FAULT_CODE_USER 0x4 331#define FAULT_CODE_USER 0x4
332 332
333BTFIXUPDEF_CALL(void, update_mmu_cache, struct vm_area_struct *, unsigned long, pte_t) 333BTFIXUPDEF_CALL(void, update_mmu_cache, struct vm_area_struct *, unsigned long, pte_t *)
334 334
335#define update_mmu_cache(vma,addr,pte) BTFIXUP_CALL(update_mmu_cache)(vma,addr,pte) 335#define update_mmu_cache(vma,addr,ptep) BTFIXUP_CALL(update_mmu_cache)(vma,addr,ptep)
336 336
337BTFIXUPDEF_CALL(void, sparc_mapiorange, unsigned int, unsigned long, 337BTFIXUPDEF_CALL(void, sparc_mapiorange, unsigned int, unsigned long,
338 unsigned long, unsigned int) 338 unsigned long, unsigned int)
diff --git a/arch/sparc/include/asm/pgtable_64.h b/arch/sparc/include/asm/pgtable_64.h
index f3cb790fa2ae..f5b5fa76c02d 100644
--- a/arch/sparc/include/asm/pgtable_64.h
+++ b/arch/sparc/include/asm/pgtable_64.h
@@ -706,7 +706,7 @@ extern unsigned long find_ecache_flush_span(unsigned long size);
706#define mmu_unlockarea(vaddr, len) do { } while(0) 706#define mmu_unlockarea(vaddr, len) do { } while(0)
707 707
708struct vm_area_struct; 708struct vm_area_struct;
709extern void update_mmu_cache(struct vm_area_struct *, unsigned long, pte_t); 709extern void update_mmu_cache(struct vm_area_struct *, unsigned long, pte_t *);
710 710
711/* Encode and de-code a swap entry */ 711/* Encode and de-code a swap entry */
712#define __swp_type(entry) (((entry).val >> PAGE_SHIFT) & 0xffUL) 712#define __swp_type(entry) (((entry).val >> PAGE_SHIFT) & 0xffUL)
diff --git a/arch/sparc/include/asm/stat.h b/arch/sparc/include/asm/stat.h
index 55db5eca08e2..39327d6a57eb 100644
--- a/arch/sparc/include/asm/stat.h
+++ b/arch/sparc/include/asm/stat.h
@@ -53,8 +53,8 @@ struct stat {
53 ino_t st_ino; 53 ino_t st_ino;
54 mode_t st_mode; 54 mode_t st_mode;
55 short st_nlink; 55 short st_nlink;
56 uid_t st_uid; 56 uid16_t st_uid;
57 gid_t st_gid; 57 gid16_t st_gid;
58 unsigned short st_rdev; 58 unsigned short st_rdev;
59 off_t st_size; 59 off_t st_size;
60 time_t st_atime; 60 time_t st_atime;
diff --git a/arch/sparc/include/asm/syscall.h b/arch/sparc/include/asm/syscall.h
index 7486c605e23c..025a02ad2e31 100644
--- a/arch/sparc/include/asm/syscall.h
+++ b/arch/sparc/include/asm/syscall.h
@@ -5,6 +5,13 @@
5#include <linux/sched.h> 5#include <linux/sched.h>
6#include <asm/ptrace.h> 6#include <asm/ptrace.h>
7 7
8/*
9 * The syscall table always contains 32 bit pointers since we know that the
10 * address of the function to be called is (way) below 4GB. So the "int"
11 * type here is what we want [need] for both 32 bit and 64 bit systems.
12 */
13extern const unsigned int sys_call_table[];
14
8/* The system call number is given by the user in %g1 */ 15/* The system call number is given by the user in %g1 */
9static inline long syscall_get_nr(struct task_struct *task, 16static inline long syscall_get_nr(struct task_struct *task,
10 struct pt_regs *regs) 17 struct pt_regs *regs)
diff --git a/arch/sparc/kernel/devices.c b/arch/sparc/kernel/devices.c
index b171ae8de90d..b062de9424a4 100644
--- a/arch/sparc/kernel/devices.c
+++ b/arch/sparc/kernel/devices.c
@@ -59,7 +59,7 @@ static int __cpu_find_by(int (*compare)(int, int, void *), void *compare_arg,
59 59
60 cur_inst = 0; 60 cur_inst = 0;
61 for_each_node_by_type(dp, "cpu") { 61 for_each_node_by_type(dp, "cpu") {
62 int err = check_cpu_node(dp->node, &cur_inst, 62 int err = check_cpu_node(dp->phandle, &cur_inst,
63 compare, compare_arg, 63 compare, compare_arg,
64 prom_node, mid); 64 prom_node, mid);
65 if (!err) { 65 if (!err) {
diff --git a/arch/sparc/kernel/ftrace.c b/arch/sparc/kernel/ftrace.c
index 29973daa9930..9103a56b39e8 100644
--- a/arch/sparc/kernel/ftrace.c
+++ b/arch/sparc/kernel/ftrace.c
@@ -91,14 +91,3 @@ int __init ftrace_dyn_arch_init(void *data)
91 return 0; 91 return 0;
92} 92}
93#endif 93#endif
94
95#ifdef CONFIG_FTRACE_SYSCALLS
96
97extern unsigned int sys_call_table[];
98
99unsigned long __init arch_syscall_addr(int nr)
100{
101 return (unsigned long)sys_call_table[nr];
102}
103
104#endif
diff --git a/arch/sparc/kernel/kstack.h b/arch/sparc/kernel/kstack.h
index 4248d969272f..5247283d1c03 100644
--- a/arch/sparc/kernel/kstack.h
+++ b/arch/sparc/kernel/kstack.h
@@ -11,6 +11,10 @@ static inline bool kstack_valid(struct thread_info *tp, unsigned long sp)
11{ 11{
12 unsigned long base = (unsigned long) tp; 12 unsigned long base = (unsigned long) tp;
13 13
14 /* Stack pointer must be 16-byte aligned. */
15 if (sp & (16UL - 1))
16 return false;
17
14 if (sp >= (base + sizeof(struct thread_info)) && 18 if (sp >= (base + sizeof(struct thread_info)) &&
15 sp <= (base + THREAD_SIZE - sizeof(struct sparc_stackf))) 19 sp <= (base + THREAD_SIZE - sizeof(struct sparc_stackf)))
16 return true; 20 return true;
diff --git a/arch/sparc/kernel/of_device_32.c b/arch/sparc/kernel/of_device_32.c
index 4c26eb59e742..da527b33ebc7 100644
--- a/arch/sparc/kernel/of_device_32.c
+++ b/arch/sparc/kernel/of_device_32.c
@@ -105,7 +105,7 @@ static unsigned long of_bus_sbus_get_flags(const u32 *addr, unsigned long flags)
105 105
106static int of_bus_ambapp_match(struct device_node *np) 106static int of_bus_ambapp_match(struct device_node *np)
107{ 107{
108 return !strcmp(np->name, "ambapp"); 108 return !strcmp(np->type, "ambapp");
109} 109}
110 110
111static void of_bus_ambapp_count_cells(struct device_node *child, 111static void of_bus_ambapp_count_cells(struct device_node *child,
@@ -433,7 +433,7 @@ build_resources:
433 if (!parent) 433 if (!parent)
434 dev_set_name(&op->dev, "root"); 434 dev_set_name(&op->dev, "root");
435 else 435 else
436 dev_set_name(&op->dev, "%08x", dp->node); 436 dev_set_name(&op->dev, "%08x", dp->phandle);
437 437
438 if (of_device_register(op)) { 438 if (of_device_register(op)) {
439 printk("%s: Could not register of device.\n", 439 printk("%s: Could not register of device.\n",
diff --git a/arch/sparc/kernel/of_device_64.c b/arch/sparc/kernel/of_device_64.c
index 0a6f2d1798d1..b3d4cb5d21b3 100644
--- a/arch/sparc/kernel/of_device_64.c
+++ b/arch/sparc/kernel/of_device_64.c
@@ -676,7 +676,7 @@ static struct of_device * __init scan_one_device(struct device_node *dp,
676 if (!parent) 676 if (!parent)
677 dev_set_name(&op->dev, "root"); 677 dev_set_name(&op->dev, "root");
678 else 678 else
679 dev_set_name(&op->dev, "%08x", dp->node); 679 dev_set_name(&op->dev, "%08x", dp->phandle);
680 680
681 if (of_device_register(op)) { 681 if (of_device_register(op)) {
682 printk("%s: Could not register of device.\n", 682 printk("%s: Could not register of device.\n",
diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel/pci.c
index 539e83f8e087..37b66c60abe3 100644
--- a/arch/sparc/kernel/pci.c
+++ b/arch/sparc/kernel/pci.c
@@ -247,6 +247,7 @@ static struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm,
247 struct pci_bus *bus, int devfn) 247 struct pci_bus *bus, int devfn)
248{ 248{
249 struct dev_archdata *sd; 249 struct dev_archdata *sd;
250 struct pci_slot *slot;
250 struct of_device *op; 251 struct of_device *op;
251 struct pci_dev *dev; 252 struct pci_dev *dev;
252 const char *type; 253 const char *type;
@@ -286,6 +287,11 @@ static struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm,
286 dev->dev.bus = &pci_bus_type; 287 dev->dev.bus = &pci_bus_type;
287 dev->devfn = devfn; 288 dev->devfn = devfn;
288 dev->multifunction = 0; /* maybe a lie? */ 289 dev->multifunction = 0; /* maybe a lie? */
290 set_pcie_port_type(dev);
291
292 list_for_each_entry(slot, &dev->bus->slots, list)
293 if (PCI_SLOT(dev->devfn) == slot->number)
294 dev->slot = slot;
289 295
290 dev->vendor = of_getintprop_default(node, "vendor-id", 0xffff); 296 dev->vendor = of_getintprop_default(node, "vendor-id", 0xffff);
291 dev->device = of_getintprop_default(node, "device-id", 0xffff); 297 dev->device = of_getintprop_default(node, "device-id", 0xffff);
@@ -322,6 +328,7 @@ static struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm,
322 328
323 dev->current_state = 4; /* unknown power state */ 329 dev->current_state = 4; /* unknown power state */
324 dev->error_state = pci_channel_io_normal; 330 dev->error_state = pci_channel_io_normal;
331 dev->dma_mask = 0xffffffff;
325 332
326 if (!strcmp(node->name, "pci")) { 333 if (!strcmp(node->name, "pci")) {
327 /* a PCI-PCI bridge */ 334 /* a PCI-PCI bridge */
@@ -715,9 +722,10 @@ void pcibios_update_irq(struct pci_dev *pdev, int irq)
715{ 722{
716} 723}
717 724
718void pcibios_align_resource(void *data, struct resource *res, 725resource_size_t pcibios_align_resource(void *data, const struct resource *res,
719 resource_size_t size, resource_size_t align) 726 resource_size_t size, resource_size_t align)
720{ 727{
728 return res->start;
721} 729}
722 730
723int pcibios_enable_device(struct pci_dev *dev, int mask) 731int pcibios_enable_device(struct pci_dev *dev, int mask)
diff --git a/arch/sparc/kernel/pcic.c b/arch/sparc/kernel/pcic.c
index 4e2724ec2bb6..75e88c00bca3 100644
--- a/arch/sparc/kernel/pcic.c
+++ b/arch/sparc/kernel/pcic.c
@@ -768,9 +768,10 @@ char * __devinit pcibios_setup(char *str)
768 return str; 768 return str;
769} 769}
770 770
771void pcibios_align_resource(void *data, struct resource *res, 771resource_size_t pcibios_align_resource(void *data, const struct resource *res,
772 resource_size_t size, resource_size_t align) 772 resource_size_t size, resource_size_t align)
773{ 773{
774 return res->start;
774} 775}
775 776
776int pcibios_enable_device(struct pci_dev *pdev, int mask) 777int pcibios_enable_device(struct pci_dev *pdev, int mask)
diff --git a/arch/sparc/kernel/perf_event.c b/arch/sparc/kernel/perf_event.c
index e856456ec02f..9f2b2bac8b2b 100644
--- a/arch/sparc/kernel/perf_event.c
+++ b/arch/sparc/kernel/perf_event.c
@@ -980,10 +980,10 @@ static int collect_events(struct perf_event *group, int max_count,
980 return n; 980 return n;
981} 981}
982 982
983static void event_sched_in(struct perf_event *event, int cpu) 983static void event_sched_in(struct perf_event *event)
984{ 984{
985 event->state = PERF_EVENT_STATE_ACTIVE; 985 event->state = PERF_EVENT_STATE_ACTIVE;
986 event->oncpu = cpu; 986 event->oncpu = smp_processor_id();
987 event->tstamp_running += event->ctx->time - event->tstamp_stopped; 987 event->tstamp_running += event->ctx->time - event->tstamp_stopped;
988 if (is_software_event(event)) 988 if (is_software_event(event))
989 event->pmu->enable(event); 989 event->pmu->enable(event);
@@ -991,7 +991,7 @@ static void event_sched_in(struct perf_event *event, int cpu)
991 991
992int hw_perf_group_sched_in(struct perf_event *group_leader, 992int hw_perf_group_sched_in(struct perf_event *group_leader,
993 struct perf_cpu_context *cpuctx, 993 struct perf_cpu_context *cpuctx,
994 struct perf_event_context *ctx, int cpu) 994 struct perf_event_context *ctx)
995{ 995{
996 struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); 996 struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
997 struct perf_event *sub; 997 struct perf_event *sub;
@@ -1015,10 +1015,10 @@ int hw_perf_group_sched_in(struct perf_event *group_leader,
1015 1015
1016 cpuctx->active_oncpu += n; 1016 cpuctx->active_oncpu += n;
1017 n = 1; 1017 n = 1;
1018 event_sched_in(group_leader, cpu); 1018 event_sched_in(group_leader);
1019 list_for_each_entry(sub, &group_leader->sibling_list, group_entry) { 1019 list_for_each_entry(sub, &group_leader->sibling_list, group_entry) {
1020 if (sub->state != PERF_EVENT_STATE_OFF) { 1020 if (sub->state != PERF_EVENT_STATE_OFF) {
1021 event_sched_in(sub, cpu); 1021 event_sched_in(sub);
1022 n++; 1022 n++;
1023 } 1023 }
1024 } 1024 }
diff --git a/arch/sparc/kernel/prom.h b/arch/sparc/kernel/prom.h
index 453397fe5e14..a8591ef2636d 100644
--- a/arch/sparc/kernel/prom.h
+++ b/arch/sparc/kernel/prom.h
@@ -4,9 +4,6 @@
4#include <linux/spinlock.h> 4#include <linux/spinlock.h>
5#include <asm/prom.h> 5#include <asm/prom.h>
6 6
7extern struct device_node *allnodes; /* temporary while merging */
8extern rwlock_t devtree_lock; /* temporary while merging */
9
10extern void * prom_early_alloc(unsigned long size); 7extern void * prom_early_alloc(unsigned long size);
11extern void irq_trans_init(struct device_node *dp); 8extern void irq_trans_init(struct device_node *dp);
12 9
diff --git a/arch/sparc/kernel/prom_common.c b/arch/sparc/kernel/prom_common.c
index d80a65d9e893..57ac9e28be0c 100644
--- a/arch/sparc/kernel/prom_common.c
+++ b/arch/sparc/kernel/prom_common.c
@@ -37,18 +37,6 @@ EXPORT_SYMBOL(of_console_path);
37char *of_console_options; 37char *of_console_options;
38EXPORT_SYMBOL(of_console_options); 38EXPORT_SYMBOL(of_console_options);
39 39
40struct device_node *of_find_node_by_phandle(phandle handle)
41{
42 struct device_node *np;
43
44 for (np = allnodes; np; np = np->allnext)
45 if (np->node == handle)
46 break;
47
48 return np;
49}
50EXPORT_SYMBOL(of_find_node_by_phandle);
51
52int of_getintprop_default(struct device_node *np, const char *name, int def) 40int of_getintprop_default(struct device_node *np, const char *name, int def)
53{ 41{
54 struct property *prop; 42 struct property *prop;
@@ -89,7 +77,7 @@ int of_set_property(struct device_node *dp, const char *name, void *val, int len
89 void *old_val = prop->value; 77 void *old_val = prop->value;
90 int ret; 78 int ret;
91 79
92 ret = prom_setprop(dp->node, name, val, len); 80 ret = prom_setprop(dp->phandle, name, val, len);
93 81
94 err = -EINVAL; 82 err = -EINVAL;
95 if (ret >= 0) { 83 if (ret >= 0) {
@@ -236,7 +224,7 @@ static struct device_node * __init prom_create_node(phandle node,
236 224
237 dp->name = get_one_property(node, "name"); 225 dp->name = get_one_property(node, "name");
238 dp->type = get_one_property(node, "device_type"); 226 dp->type = get_one_property(node, "device_type");
239 dp->node = node; 227 dp->phandle = node;
240 228
241 dp->properties = build_prop_list(node); 229 dp->properties = build_prop_list(node);
242 230
@@ -313,7 +301,7 @@ void __init prom_build_devicetree(void)
313 301
314 nextp = &allnodes->allnext; 302 nextp = &allnodes->allnext;
315 allnodes->child = prom_build_tree(allnodes, 303 allnodes->child = prom_build_tree(allnodes,
316 prom_getchild(allnodes->node), 304 prom_getchild(allnodes->phandle),
317 &nextp); 305 &nextp);
318 of_console_init(); 306 of_console_init();
319 307
diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c
index aa36223497b9..eb14844a0021 100644
--- a/arch/sparc/kernel/smp_64.c
+++ b/arch/sparc/kernel/smp_64.c
@@ -370,7 +370,7 @@ static int __cpuinit smp_boot_one_cpu(unsigned int cpu)
370 } else { 370 } else {
371 struct device_node *dp = of_find_node_by_cpuid(cpu); 371 struct device_node *dp = of_find_node_by_cpuid(cpu);
372 372
373 prom_startcpu(dp->node, entry, cookie); 373 prom_startcpu(dp->phandle, entry, cookie);
374 } 374 }
375 375
376 for (timeout = 0; timeout < 50000; timeout++) { 376 for (timeout = 0; timeout < 50000; timeout++) {
diff --git a/arch/sparc/kernel/tsb.S b/arch/sparc/kernel/tsb.S
index 8c91d9b29a2f..db15d123f054 100644
--- a/arch/sparc/kernel/tsb.S
+++ b/arch/sparc/kernel/tsb.S
@@ -191,10 +191,12 @@ tsb_dtlb_load:
191 191
192tsb_itlb_load: 192tsb_itlb_load:
193 /* Executable bit must be set. */ 193 /* Executable bit must be set. */
194661: andcc %g5, _PAGE_EXEC_4U, %g0 194661: sethi %hi(_PAGE_EXEC_4U), %g4
195 .section .sun4v_1insn_patch, "ax" 195 andcc %g5, %g4, %g0
196 .section .sun4v_2insn_patch, "ax"
196 .word 661b 197 .word 661b
197 andcc %g5, _PAGE_EXEC_4V, %g0 198 andcc %g5, _PAGE_EXEC_4V, %g0
199 nop
198 .previous 200 .previous
199 201
200 be,pn %xcc, tsb_do_fault 202 be,pn %xcc, tsb_do_fault
diff --git a/arch/sparc/mm/fault_32.c b/arch/sparc/mm/fault_32.c
index a3413acb8f12..3fa09ba3845f 100644
--- a/arch/sparc/mm/fault_32.c
+++ b/arch/sparc/mm/fault_32.c
@@ -378,7 +378,7 @@ asmlinkage void do_sun4c_fault(struct pt_regs *regs, int text_fault, int write,
378 unsigned long address) 378 unsigned long address)
379{ 379{
380 extern void sun4c_update_mmu_cache(struct vm_area_struct *, 380 extern void sun4c_update_mmu_cache(struct vm_area_struct *,
381 unsigned long,pte_t); 381 unsigned long,pte_t *);
382 extern pte_t *sun4c_pte_offset_kernel(pmd_t *,unsigned long); 382 extern pte_t *sun4c_pte_offset_kernel(pmd_t *,unsigned long);
383 struct task_struct *tsk = current; 383 struct task_struct *tsk = current;
384 struct mm_struct *mm = tsk->mm; 384 struct mm_struct *mm = tsk->mm;
@@ -455,7 +455,7 @@ asmlinkage void do_sun4c_fault(struct pt_regs *regs, int text_fault, int write,
455 * on the CPU and doing a shrink_mmap() on this vma. 455 * on the CPU and doing a shrink_mmap() on this vma.
456 */ 456 */
457 sun4c_update_mmu_cache (find_vma(current->mm, address), address, 457 sun4c_update_mmu_cache (find_vma(current->mm, address), address,
458 *ptep); 458 ptep);
459 else 459 else
460 do_sparc_fault(regs, text_fault, write, address); 460 do_sparc_fault(regs, text_fault, write, address);
461} 461}
diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c
index 1886d37d411b..9245a822a2f1 100644
--- a/arch/sparc/mm/init_64.c
+++ b/arch/sparc/mm/init_64.c
@@ -289,12 +289,13 @@ static void flush_dcache(unsigned long pfn)
289 } 289 }
290} 290}
291 291
292void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t pte) 292void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t *ptep)
293{ 293{
294 struct mm_struct *mm; 294 struct mm_struct *mm;
295 struct tsb *tsb; 295 struct tsb *tsb;
296 unsigned long tag, flags; 296 unsigned long tag, flags;
297 unsigned long tsb_index, tsb_hash_shift; 297 unsigned long tsb_index, tsb_hash_shift;
298 pte_t pte = *ptep;
298 299
299 if (tlb_type != hypervisor) { 300 if (tlb_type != hypervisor) {
300 unsigned long pfn = pte_pfn(pte); 301 unsigned long pfn = pte_pfn(pte);
diff --git a/arch/sparc/mm/nosun4c.c b/arch/sparc/mm/nosun4c.c
index 196263f895b7..4e62c27147c4 100644
--- a/arch/sparc/mm/nosun4c.c
+++ b/arch/sparc/mm/nosun4c.c
@@ -62,7 +62,7 @@ pte_t *sun4c_pte_offset_kernel(pmd_t *dir, unsigned long address)
62 return NULL; 62 return NULL;
63} 63}
64 64
65void sun4c_update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t pte) 65void sun4c_update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t *ptep)
66{ 66{
67} 67}
68 68
diff --git a/arch/sparc/mm/srmmu.c b/arch/sparc/mm/srmmu.c
index 367321a030dd..df49b200ca4c 100644
--- a/arch/sparc/mm/srmmu.c
+++ b/arch/sparc/mm/srmmu.c
@@ -694,7 +694,7 @@ extern void tsunami_setup_blockops(void);
694 * The following code is a deadwood that may be necessary when 694 * The following code is a deadwood that may be necessary when
695 * we start to make precise page flushes again. --zaitcev 695 * we start to make precise page flushes again. --zaitcev
696 */ 696 */
697static void swift_update_mmu_cache(struct vm_area_struct * vma, unsigned long address, pte_t pte) 697static void swift_update_mmu_cache(struct vm_area_struct * vma, unsigned long address, pte_t *ptep)
698{ 698{
699#if 0 699#if 0
700 static unsigned long last; 700 static unsigned long last;
@@ -703,10 +703,10 @@ static void swift_update_mmu_cache(struct vm_area_struct * vma, unsigned long ad
703 703
704 if (address == last) { 704 if (address == last) {
705 val = srmmu_hwprobe(address); 705 val = srmmu_hwprobe(address);
706 if (val != 0 && pte_val(pte) != val) { 706 if (val != 0 && pte_val(*ptep) != val) {
707 printk("swift_update_mmu_cache: " 707 printk("swift_update_mmu_cache: "
708 "addr %lx put %08x probed %08x from %p\n", 708 "addr %lx put %08x probed %08x from %p\n",
709 address, pte_val(pte), val, 709 address, pte_val(*ptep), val,
710 __builtin_return_address(0)); 710 __builtin_return_address(0));
711 srmmu_flush_whole_tlb(); 711 srmmu_flush_whole_tlb();
712 } 712 }
diff --git a/arch/sparc/mm/sun4c.c b/arch/sparc/mm/sun4c.c
index a89baf0d875a..18652534b91a 100644
--- a/arch/sparc/mm/sun4c.c
+++ b/arch/sparc/mm/sun4c.c
@@ -1887,7 +1887,7 @@ static void sun4c_check_pgt_cache(int low, int high)
1887/* An experiment, turn off by default for now... -DaveM */ 1887/* An experiment, turn off by default for now... -DaveM */
1888#define SUN4C_PRELOAD_PSEG 1888#define SUN4C_PRELOAD_PSEG
1889 1889
1890void sun4c_update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t pte) 1890void sun4c_update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t *ptep)
1891{ 1891{
1892 unsigned long flags; 1892 unsigned long flags;
1893 int pseg; 1893 int pseg;
@@ -1929,7 +1929,7 @@ void sun4c_update_mmu_cache(struct vm_area_struct *vma, unsigned long address, p
1929 start += PAGE_SIZE; 1929 start += PAGE_SIZE;
1930 } 1930 }
1931#ifndef SUN4C_PRELOAD_PSEG 1931#ifndef SUN4C_PRELOAD_PSEG
1932 sun4c_put_pte(address, pte_val(pte)); 1932 sun4c_put_pte(address, pte_val(*ptep));
1933#endif 1933#endif
1934 local_irq_restore(flags); 1934 local_irq_restore(flags);
1935 return; 1935 return;
@@ -1940,7 +1940,7 @@ void sun4c_update_mmu_cache(struct vm_area_struct *vma, unsigned long address, p
1940 add_lru(entry); 1940 add_lru(entry);
1941 } 1941 }
1942 1942
1943 sun4c_put_pte(address, pte_val(pte)); 1943 sun4c_put_pte(address, pte_val(*ptep));
1944 local_irq_restore(flags); 1944 local_irq_restore(flags);
1945} 1945}
1946 1946
diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c
index 5ff554677f40..c1ff6903b622 100644
--- a/arch/um/drivers/ubd_kern.c
+++ b/arch/um/drivers/ubd_kern.c
@@ -747,7 +747,7 @@ static int ubd_open_dev(struct ubd *ubd_dev)
747 ubd_dev->fd = fd; 747 ubd_dev->fd = fd;
748 748
749 if(ubd_dev->cow.file != NULL){ 749 if(ubd_dev->cow.file != NULL){
750 blk_queue_max_sectors(ubd_dev->queue, 8 * sizeof(long)); 750 blk_queue_max_hw_sectors(ubd_dev->queue, 8 * sizeof(long));
751 751
752 err = -ENOMEM; 752 err = -ENOMEM;
753 ubd_dev->cow.bitmap = vmalloc(ubd_dev->cow.bitmap_len); 753 ubd_dev->cow.bitmap = vmalloc(ubd_dev->cow.bitmap_len);
@@ -849,7 +849,7 @@ static int ubd_add(int n, char **error_out)
849 } 849 }
850 ubd_dev->queue->queuedata = ubd_dev; 850 ubd_dev->queue->queuedata = ubd_dev;
851 851
852 blk_queue_max_hw_segments(ubd_dev->queue, MAX_SG); 852 blk_queue_max_segments(ubd_dev->queue, MAX_SG);
853 err = ubd_disk_register(UBD_MAJOR, ubd_dev->size, n, &ubd_gendisk[n]); 853 err = ubd_disk_register(UBD_MAJOR, ubd_dev->size, n, &ubd_gendisk[n]);
854 if(err){ 854 if(err){
855 *error_out = "Failed to register device"; 855 *error_out = "Failed to register device";
diff --git a/arch/um/include/asm/pgtable.h b/arch/um/include/asm/pgtable.h
index 9ce3f165111a..a9f7251b4a8d 100644
--- a/arch/um/include/asm/pgtable.h
+++ b/arch/um/include/asm/pgtable.h
@@ -345,7 +345,7 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
345struct mm_struct; 345struct mm_struct;
346extern pte_t *virt_to_pte(struct mm_struct *mm, unsigned long addr); 346extern pte_t *virt_to_pte(struct mm_struct *mm, unsigned long addr);
347 347
348#define update_mmu_cache(vma,address,pte) do ; while (0) 348#define update_mmu_cache(vma,address,ptep) do ; while (0)
349 349
350/* Encode and de-code a swap entry */ 350/* Encode and de-code a swap entry */
351#define __swp_type(x) (((x).val >> 4) & 0x3f) 351#define __swp_type(x) (((x).val >> 4) & 0x3f)
diff --git a/arch/um/sys-x86_64/Makefile b/arch/um/sys-x86_64/Makefile
index 2201e9c20e4a..c1ea9eb04466 100644
--- a/arch/um/sys-x86_64/Makefile
+++ b/arch/um/sys-x86_64/Makefile
@@ -8,7 +8,8 @@ obj-y = bug.o bugs.o delay.o fault.o ldt.o mem.o ptrace.o ptrace_user.o \
8 setjmp.o signal.o stub.o stub_segv.o syscalls.o syscall_table.o \ 8 setjmp.o signal.o stub.o stub_segv.o syscalls.o syscall_table.o \
9 sysrq.o ksyms.o tls.o 9 sysrq.o ksyms.o tls.o
10 10
11subarch-obj-y = lib/csum-partial_64.o lib/memcpy_64.o lib/thunk_64.o 11subarch-obj-y = lib/csum-partial_64.o lib/memcpy_64.o lib/thunk_64.o \
12 lib/rwsem_64.o
12subarch-obj-$(CONFIG_MODULES) += kernel/module.o 13subarch-obj-$(CONFIG_MODULES) += kernel/module.o
13 14
14ldt-y = ../sys-i386/ldt.o 15ldt-y = ../sys-i386/ldt.o
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index eb4092568f9e..0896008f7509 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -45,6 +45,7 @@ config X86
45 select HAVE_GENERIC_DMA_COHERENT if X86_32 45 select HAVE_GENERIC_DMA_COHERENT if X86_32
46 select HAVE_EFFICIENT_UNALIGNED_ACCESS 46 select HAVE_EFFICIENT_UNALIGNED_ACCESS
47 select USER_STACKTRACE_SUPPORT 47 select USER_STACKTRACE_SUPPORT
48 select HAVE_REGS_AND_STACK_ACCESS_API
48 select HAVE_DMA_API_DEBUG 49 select HAVE_DMA_API_DEBUG
49 select HAVE_KERNEL_GZIP 50 select HAVE_KERNEL_GZIP
50 select HAVE_KERNEL_BZIP2 51 select HAVE_KERNEL_BZIP2
diff --git a/arch/x86/Kconfig.cpu b/arch/x86/Kconfig.cpu
index f20ddf84a893..a19829374e6a 100644
--- a/arch/x86/Kconfig.cpu
+++ b/arch/x86/Kconfig.cpu
@@ -319,7 +319,7 @@ config X86_L1_CACHE_SHIFT
319 319
320config X86_XADD 320config X86_XADD
321 def_bool y 321 def_bool y
322 depends on X86_32 && !M386 322 depends on X86_64 || !M386
323 323
324config X86_PPRO_FENCE 324config X86_PPRO_FENCE
325 bool "PentiumPro memory ordering errata workaround" 325 bool "PentiumPro memory ordering errata workaround"
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index 78b32be55e9e..0a43dc515e4c 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -135,9 +135,7 @@ drivers-$(CONFIG_OPROFILE) += arch/x86/oprofile/
135# suspend and hibernation support 135# suspend and hibernation support
136drivers-$(CONFIG_PM) += arch/x86/power/ 136drivers-$(CONFIG_PM) += arch/x86/power/
137 137
138ifeq ($(CONFIG_X86_32),y)
139drivers-$(CONFIG_FB) += arch/x86/video/ 138drivers-$(CONFIG_FB) += arch/x86/video/
140endif
141 139
142#### 140####
143# boot loader support. Several targets are kept for legacy purposes 141# boot loader support. Several targets are kept for legacy purposes
diff --git a/arch/x86/boot/compressed/misc.c b/arch/x86/boot/compressed/misc.c
index 3b22fe8ab91b..51e240779a44 100644
--- a/arch/x86/boot/compressed/misc.c
+++ b/arch/x86/boot/compressed/misc.c
@@ -19,11 +19,6 @@
19#define _ASM_X86_DESC_H 1 19#define _ASM_X86_DESC_H 1
20#endif 20#endif
21 21
22#ifdef CONFIG_X86_64
23#define _LINUX_STRING_H_ 1
24#define __LINUX_BITMAP_H 1
25#endif
26
27#include <linux/linkage.h> 22#include <linux/linkage.h>
28#include <linux/screen_info.h> 23#include <linux/screen_info.h>
29#include <linux/elf.h> 24#include <linux/elf.h>
@@ -131,8 +126,8 @@ static void error(char *m);
131static struct boot_params *real_mode; /* Pointer to real-mode data */ 126static struct boot_params *real_mode; /* Pointer to real-mode data */
132static int quiet; 127static int quiet;
133 128
134static void *memset(void *s, int c, unsigned n); 129void *memset(void *s, int c, size_t n);
135void *memcpy(void *dest, const void *src, unsigned n); 130void *memcpy(void *dest, const void *src, size_t n);
136 131
137static void __putstr(int, const char *); 132static void __putstr(int, const char *);
138#define putstr(__x) __putstr(0, __x) 133#define putstr(__x) __putstr(0, __x)
@@ -185,11 +180,9 @@ static void __putstr(int error, const char *s)
185 return; 180 return;
186#endif 181#endif
187 182
188#ifdef CONFIG_X86_32
189 if (real_mode->screen_info.orig_video_mode == 0 && 183 if (real_mode->screen_info.orig_video_mode == 0 &&
190 lines == 0 && cols == 0) 184 lines == 0 && cols == 0)
191 return; 185 return;
192#endif
193 186
194 x = real_mode->screen_info.orig_x; 187 x = real_mode->screen_info.orig_x;
195 y = real_mode->screen_info.orig_y; 188 y = real_mode->screen_info.orig_y;
@@ -223,7 +216,7 @@ static void __putstr(int error, const char *s)
223 outb(0xff & (pos >> 1), vidport+1); 216 outb(0xff & (pos >> 1), vidport+1);
224} 217}
225 218
226static void *memset(void *s, int c, unsigned n) 219void *memset(void *s, int c, size_t n)
227{ 220{
228 int i; 221 int i;
229 char *ss = s; 222 char *ss = s;
@@ -233,7 +226,7 @@ static void *memset(void *s, int c, unsigned n)
233 return s; 226 return s;
234} 227}
235 228
236void *memcpy(void *dest, const void *src, unsigned n) 229void *memcpy(void *dest, const void *src, size_t n)
237{ 230{
238 int i; 231 int i;
239 const char *s = src; 232 const char *s = src;
diff --git a/arch/x86/boot/mkcpustr.c b/arch/x86/boot/mkcpustr.c
index 8ef60f20b371..919257f526f2 100644
--- a/arch/x86/boot/mkcpustr.c
+++ b/arch/x86/boot/mkcpustr.c
@@ -22,7 +22,7 @@ int main(void)
22 int i, j; 22 int i, j;
23 const char *str; 23 const char *str;
24 24
25 printf("static const char x86_cap_strs[] = \n"); 25 printf("static const char x86_cap_strs[] =\n");
26 26
27 for (i = 0; i < NCAPINTS; i++) { 27 for (i = 0; i < NCAPINTS; i++) {
28 for (j = 0; j < 32; j++) { 28 for (j = 0; j < 32; j++) {
diff --git a/arch/x86/boot/video-vga.c b/arch/x86/boot/video-vga.c
index 819caa1f2008..ed7aeff786b2 100644
--- a/arch/x86/boot/video-vga.c
+++ b/arch/x86/boot/video-vga.c
@@ -42,22 +42,15 @@ static u8 vga_set_basic_mode(void)
42{ 42{
43 struct biosregs ireg, oreg; 43 struct biosregs ireg, oreg;
44 u16 ax; 44 u16 ax;
45 u8 rows;
46 u8 mode; 45 u8 mode;
47 46
48 initregs(&ireg); 47 initregs(&ireg);
49 48
49 /* Query current mode */
50 ax = 0x0f00; 50 ax = 0x0f00;
51 intcall(0x10, &ireg, &oreg); 51 intcall(0x10, &ireg, &oreg);
52 mode = oreg.al; 52 mode = oreg.al;
53 53
54 set_fs(0);
55 rows = rdfs8(0x484); /* rows minus one */
56
57 if ((oreg.ax == 0x5003 || oreg.ax == 0x5007) &&
58 (rows == 0 || rows == 24))
59 return mode;
60
61 if (mode != 3 && mode != 7) 54 if (mode != 3 && mode != 7)
62 mode = 3; 55 mode = 3;
63 56
diff --git a/arch/x86/boot/video.c b/arch/x86/boot/video.c
index f767164cd5df..43eda284d27f 100644
--- a/arch/x86/boot/video.c
+++ b/arch/x86/boot/video.c
@@ -298,11 +298,18 @@ static void restore_screen(void)
298 } 298 }
299 299
300 /* Restore cursor position */ 300 /* Restore cursor position */
301 if (saved.curx >= xs)
302 saved.curx = xs-1;
303 if (saved.cury >= ys)
304 saved.cury = ys-1;
305
301 initregs(&ireg); 306 initregs(&ireg);
302 ireg.ah = 0x02; /* Set cursor position */ 307 ireg.ah = 0x02; /* Set cursor position */
303 ireg.dh = saved.cury; 308 ireg.dh = saved.cury;
304 ireg.dl = saved.curx; 309 ireg.dl = saved.curx;
305 intcall(0x10, &ireg, NULL); 310 intcall(0x10, &ireg, NULL);
311
312 store_cursor_position();
306} 313}
307 314
308void set_video(void) 315void set_video(void)
diff --git a/arch/x86/ia32/ia32_aout.c b/arch/x86/ia32/ia32_aout.c
index f9f472462753..9046e4af66ce 100644
--- a/arch/x86/ia32/ia32_aout.c
+++ b/arch/x86/ia32/ia32_aout.c
@@ -297,7 +297,7 @@ static int load_aout_binary(struct linux_binprm *bprm, struct pt_regs *regs)
297 * size limits imposed on them by creating programs with large 297 * size limits imposed on them by creating programs with large
298 * arrays in the data or bss. 298 * arrays in the data or bss.
299 */ 299 */
300 rlim = current->signal->rlim[RLIMIT_DATA].rlim_cur; 300 rlim = rlimit(RLIMIT_DATA);
301 if (rlim >= RLIM_INFINITY) 301 if (rlim >= RLIM_INFINITY)
302 rlim = ~0; 302 rlim = ~0;
303 if (ex.a_data + ex.a_bss > rlim) 303 if (ex.a_data + ex.a_bss > rlim)
diff --git a/arch/x86/include/asm/alternative.h b/arch/x86/include/asm/alternative.h
index 69b74a7b877f..f1e253ceba4b 100644
--- a/arch/x86/include/asm/alternative.h
+++ b/arch/x86/include/asm/alternative.h
@@ -65,12 +65,17 @@ extern void alternatives_smp_module_add(struct module *mod, char *name,
65 void *text, void *text_end); 65 void *text, void *text_end);
66extern void alternatives_smp_module_del(struct module *mod); 66extern void alternatives_smp_module_del(struct module *mod);
67extern void alternatives_smp_switch(int smp); 67extern void alternatives_smp_switch(int smp);
68extern int alternatives_text_reserved(void *start, void *end);
68#else 69#else
69static inline void alternatives_smp_module_add(struct module *mod, char *name, 70static inline void alternatives_smp_module_add(struct module *mod, char *name,
70 void *locks, void *locks_end, 71 void *locks, void *locks_end,
71 void *text, void *text_end) {} 72 void *text, void *text_end) {}
72static inline void alternatives_smp_module_del(struct module *mod) {} 73static inline void alternatives_smp_module_del(struct module *mod) {}
73static inline void alternatives_smp_switch(int smp) {} 74static inline void alternatives_smp_switch(int smp) {}
75static inline int alternatives_text_reserved(void *start, void *end)
76{
77 return 0;
78}
74#endif /* CONFIG_SMP */ 79#endif /* CONFIG_SMP */
75 80
76/* alternative assembly primitive: */ 81/* alternative assembly primitive: */
@@ -125,11 +130,16 @@ static inline void alternatives_smp_switch(int smp) {}
125 asm volatile (ALTERNATIVE(oldinstr, newinstr, feature) \ 130 asm volatile (ALTERNATIVE(oldinstr, newinstr, feature) \
126 : output : "i" (0), ## input) 131 : output : "i" (0), ## input)
127 132
133/* Like alternative_io, but for replacing a direct call with another one. */
134#define alternative_call(oldfunc, newfunc, feature, output, input...) \
135 asm volatile (ALTERNATIVE("call %P[old]", "call %P[new]", feature) \
136 : output : [old] "i" (oldfunc), [new] "i" (newfunc), ## input)
137
128/* 138/*
129 * use this macro(s) if you need more than one output parameter 139 * use this macro(s) if you need more than one output parameter
130 * in alternative_io 140 * in alternative_io
131 */ 141 */
132#define ASM_OUTPUT2(a, b) a, b 142#define ASM_OUTPUT2(a...) a
133 143
134struct paravirt_patch_site; 144struct paravirt_patch_site;
135#ifdef CONFIG_PARAVIRT 145#ifdef CONFIG_PARAVIRT
diff --git a/arch/x86/include/asm/atomic.h b/arch/x86/include/asm/atomic.h
index 4e1b8873c474..8f8217b9bdac 100644
--- a/arch/x86/include/asm/atomic.h
+++ b/arch/x86/include/asm/atomic.h
@@ -1,5 +1,300 @@
1#ifndef _ASM_X86_ATOMIC_H
2#define _ASM_X86_ATOMIC_H
3
4#include <linux/compiler.h>
5#include <linux/types.h>
6#include <asm/processor.h>
7#include <asm/alternative.h>
8#include <asm/cmpxchg.h>
9
10/*
11 * Atomic operations that C can't guarantee us. Useful for
12 * resource counting etc..
13 */
14
15#define ATOMIC_INIT(i) { (i) }
16
17/**
18 * atomic_read - read atomic variable
19 * @v: pointer of type atomic_t
20 *
21 * Atomically reads the value of @v.
22 */
23static inline int atomic_read(const atomic_t *v)
24{
25 return v->counter;
26}
27
28/**
29 * atomic_set - set atomic variable
30 * @v: pointer of type atomic_t
31 * @i: required value
32 *
33 * Atomically sets the value of @v to @i.
34 */
35static inline void atomic_set(atomic_t *v, int i)
36{
37 v->counter = i;
38}
39
40/**
41 * atomic_add - add integer to atomic variable
42 * @i: integer value to add
43 * @v: pointer of type atomic_t
44 *
45 * Atomically adds @i to @v.
46 */
47static inline void atomic_add(int i, atomic_t *v)
48{
49 asm volatile(LOCK_PREFIX "addl %1,%0"
50 : "+m" (v->counter)
51 : "ir" (i));
52}
53
54/**
55 * atomic_sub - subtract integer from atomic variable
56 * @i: integer value to subtract
57 * @v: pointer of type atomic_t
58 *
59 * Atomically subtracts @i from @v.
60 */
61static inline void atomic_sub(int i, atomic_t *v)
62{
63 asm volatile(LOCK_PREFIX "subl %1,%0"
64 : "+m" (v->counter)
65 : "ir" (i));
66}
67
68/**
69 * atomic_sub_and_test - subtract value from variable and test result
70 * @i: integer value to subtract
71 * @v: pointer of type atomic_t
72 *
73 * Atomically subtracts @i from @v and returns
74 * true if the result is zero, or false for all
75 * other cases.
76 */
77static inline int atomic_sub_and_test(int i, atomic_t *v)
78{
79 unsigned char c;
80
81 asm volatile(LOCK_PREFIX "subl %2,%0; sete %1"
82 : "+m" (v->counter), "=qm" (c)
83 : "ir" (i) : "memory");
84 return c;
85}
86
87/**
88 * atomic_inc - increment atomic variable
89 * @v: pointer of type atomic_t
90 *
91 * Atomically increments @v by 1.
92 */
93static inline void atomic_inc(atomic_t *v)
94{
95 asm volatile(LOCK_PREFIX "incl %0"
96 : "+m" (v->counter));
97}
98
99/**
100 * atomic_dec - decrement atomic variable
101 * @v: pointer of type atomic_t
102 *
103 * Atomically decrements @v by 1.
104 */
105static inline void atomic_dec(atomic_t *v)
106{
107 asm volatile(LOCK_PREFIX "decl %0"
108 : "+m" (v->counter));
109}
110
111/**
112 * atomic_dec_and_test - decrement and test
113 * @v: pointer of type atomic_t
114 *
115 * Atomically decrements @v by 1 and
116 * returns true if the result is 0, or false for all other
117 * cases.
118 */
119static inline int atomic_dec_and_test(atomic_t *v)
120{
121 unsigned char c;
122
123 asm volatile(LOCK_PREFIX "decl %0; sete %1"
124 : "+m" (v->counter), "=qm" (c)
125 : : "memory");
126 return c != 0;
127}
128
129/**
130 * atomic_inc_and_test - increment and test
131 * @v: pointer of type atomic_t
132 *
133 * Atomically increments @v by 1
134 * and returns true if the result is zero, or false for all
135 * other cases.
136 */
137static inline int atomic_inc_and_test(atomic_t *v)
138{
139 unsigned char c;
140
141 asm volatile(LOCK_PREFIX "incl %0; sete %1"
142 : "+m" (v->counter), "=qm" (c)
143 : : "memory");
144 return c != 0;
145}
146
147/**
148 * atomic_add_negative - add and test if negative
149 * @i: integer value to add
150 * @v: pointer of type atomic_t
151 *
152 * Atomically adds @i to @v and returns true
153 * if the result is negative, or false when
154 * result is greater than or equal to zero.
155 */
156static inline int atomic_add_negative(int i, atomic_t *v)
157{
158 unsigned char c;
159
160 asm volatile(LOCK_PREFIX "addl %2,%0; sets %1"
161 : "+m" (v->counter), "=qm" (c)
162 : "ir" (i) : "memory");
163 return c;
164}
165
166/**
167 * atomic_add_return - add integer and return
168 * @i: integer value to add
169 * @v: pointer of type atomic_t
170 *
171 * Atomically adds @i to @v and returns @i + @v
172 */
173static inline int atomic_add_return(int i, atomic_t *v)
174{
175 int __i;
176#ifdef CONFIG_M386
177 unsigned long flags;
178 if (unlikely(boot_cpu_data.x86 <= 3))
179 goto no_xadd;
180#endif
181 /* Modern 486+ processor */
182 __i = i;
183 asm volatile(LOCK_PREFIX "xaddl %0, %1"
184 : "+r" (i), "+m" (v->counter)
185 : : "memory");
186 return i + __i;
187
188#ifdef CONFIG_M386
189no_xadd: /* Legacy 386 processor */
190 raw_local_irq_save(flags);
191 __i = atomic_read(v);
192 atomic_set(v, i + __i);
193 raw_local_irq_restore(flags);
194 return i + __i;
195#endif
196}
197
198/**
199 * atomic_sub_return - subtract integer and return
200 * @v: pointer of type atomic_t
201 * @i: integer value to subtract
202 *
203 * Atomically subtracts @i from @v and returns @v - @i
204 */
205static inline int atomic_sub_return(int i, atomic_t *v)
206{
207 return atomic_add_return(-i, v);
208}
209
210#define atomic_inc_return(v) (atomic_add_return(1, v))
211#define atomic_dec_return(v) (atomic_sub_return(1, v))
212
213static inline int atomic_cmpxchg(atomic_t *v, int old, int new)
214{
215 return cmpxchg(&v->counter, old, new);
216}
217
218static inline int atomic_xchg(atomic_t *v, int new)
219{
220 return xchg(&v->counter, new);
221}
222
223/**
224 * atomic_add_unless - add unless the number is already a given value
225 * @v: pointer of type atomic_t
226 * @a: the amount to add to v...
227 * @u: ...unless v is equal to u.
228 *
229 * Atomically adds @a to @v, so long as @v was not already @u.
230 * Returns non-zero if @v was not @u, and zero otherwise.
231 */
232static inline int atomic_add_unless(atomic_t *v, int a, int u)
233{
234 int c, old;
235 c = atomic_read(v);
236 for (;;) {
237 if (unlikely(c == (u)))
238 break;
239 old = atomic_cmpxchg((v), c, c + (a));
240 if (likely(old == c))
241 break;
242 c = old;
243 }
244 return c != (u);
245}
246
247#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
248
249/**
250 * atomic_inc_short - increment of a short integer
251 * @v: pointer to type int
252 *
253 * Atomically adds 1 to @v
254 * Returns the new value of @u
255 */
256static inline short int atomic_inc_short(short int *v)
257{
258 asm(LOCK_PREFIX "addw $1, %0" : "+m" (*v));
259 return *v;
260}
261
262#ifdef CONFIG_X86_64
263/**
264 * atomic_or_long - OR of two long integers
265 * @v1: pointer to type unsigned long
266 * @v2: pointer to type unsigned long
267 *
268 * Atomically ORs @v1 and @v2
269 * Returns the result of the OR
270 */
271static inline void atomic_or_long(unsigned long *v1, unsigned long v2)
272{
273 asm(LOCK_PREFIX "orq %1, %0" : "+m" (*v1) : "r" (v2));
274}
275#endif
276
277/* These are x86-specific, used by some header files */
278#define atomic_clear_mask(mask, addr) \
279 asm volatile(LOCK_PREFIX "andl %0,%1" \
280 : : "r" (~(mask)), "m" (*(addr)) : "memory")
281
282#define atomic_set_mask(mask, addr) \
283 asm volatile(LOCK_PREFIX "orl %0,%1" \
284 : : "r" ((unsigned)(mask)), "m" (*(addr)) \
285 : "memory")
286
287/* Atomic operations are already serializing on x86 */
288#define smp_mb__before_atomic_dec() barrier()
289#define smp_mb__after_atomic_dec() barrier()
290#define smp_mb__before_atomic_inc() barrier()
291#define smp_mb__after_atomic_inc() barrier()
292
1#ifdef CONFIG_X86_32 293#ifdef CONFIG_X86_32
2# include "atomic_32.h" 294# include "atomic64_32.h"
3#else 295#else
4# include "atomic_64.h" 296# include "atomic64_64.h"
5#endif 297#endif
298
299#include <asm-generic/atomic-long.h>
300#endif /* _ASM_X86_ATOMIC_H */
diff --git a/arch/x86/include/asm/atomic64_32.h b/arch/x86/include/asm/atomic64_32.h
new file mode 100644
index 000000000000..03027bf28de5
--- /dev/null
+++ b/arch/x86/include/asm/atomic64_32.h
@@ -0,0 +1,160 @@
1#ifndef _ASM_X86_ATOMIC64_32_H
2#define _ASM_X86_ATOMIC64_32_H
3
4#include <linux/compiler.h>
5#include <linux/types.h>
6#include <asm/processor.h>
7//#include <asm/cmpxchg.h>
8
9/* An 64bit atomic type */
10
11typedef struct {
12 u64 __aligned(8) counter;
13} atomic64_t;
14
15#define ATOMIC64_INIT(val) { (val) }
16
17extern u64 atomic64_cmpxchg(atomic64_t *ptr, u64 old_val, u64 new_val);
18
19/**
20 * atomic64_xchg - xchg atomic64 variable
21 * @ptr: pointer to type atomic64_t
22 * @new_val: value to assign
23 *
24 * Atomically xchgs the value of @ptr to @new_val and returns
25 * the old value.
26 */
27extern u64 atomic64_xchg(atomic64_t *ptr, u64 new_val);
28
29/**
30 * atomic64_set - set atomic64 variable
31 * @ptr: pointer to type atomic64_t
32 * @new_val: value to assign
33 *
34 * Atomically sets the value of @ptr to @new_val.
35 */
36extern void atomic64_set(atomic64_t *ptr, u64 new_val);
37
38/**
39 * atomic64_read - read atomic64 variable
40 * @ptr: pointer to type atomic64_t
41 *
42 * Atomically reads the value of @ptr and returns it.
43 */
44static inline u64 atomic64_read(atomic64_t *ptr)
45{
46 u64 res;
47
48 /*
49 * Note, we inline this atomic64_t primitive because
50 * it only clobbers EAX/EDX and leaves the others
51 * untouched. We also (somewhat subtly) rely on the
52 * fact that cmpxchg8b returns the current 64-bit value
53 * of the memory location we are touching:
54 */
55 asm volatile(
56 "mov %%ebx, %%eax\n\t"
57 "mov %%ecx, %%edx\n\t"
58 LOCK_PREFIX "cmpxchg8b %1\n"
59 : "=&A" (res)
60 : "m" (*ptr)
61 );
62
63 return res;
64}
65
66extern u64 atomic64_read(atomic64_t *ptr);
67
68/**
69 * atomic64_add_return - add and return
70 * @delta: integer value to add
71 * @ptr: pointer to type atomic64_t
72 *
73 * Atomically adds @delta to @ptr and returns @delta + *@ptr
74 */
75extern u64 atomic64_add_return(u64 delta, atomic64_t *ptr);
76
77/*
78 * Other variants with different arithmetic operators:
79 */
80extern u64 atomic64_sub_return(u64 delta, atomic64_t *ptr);
81extern u64 atomic64_inc_return(atomic64_t *ptr);
82extern u64 atomic64_dec_return(atomic64_t *ptr);
83
84/**
85 * atomic64_add - add integer to atomic64 variable
86 * @delta: integer value to add
87 * @ptr: pointer to type atomic64_t
88 *
89 * Atomically adds @delta to @ptr.
90 */
91extern void atomic64_add(u64 delta, atomic64_t *ptr);
92
93/**
94 * atomic64_sub - subtract the atomic64 variable
95 * @delta: integer value to subtract
96 * @ptr: pointer to type atomic64_t
97 *
98 * Atomically subtracts @delta from @ptr.
99 */
100extern void atomic64_sub(u64 delta, atomic64_t *ptr);
101
102/**
103 * atomic64_sub_and_test - subtract value from variable and test result
104 * @delta: integer value to subtract
105 * @ptr: pointer to type atomic64_t
106 *
107 * Atomically subtracts @delta from @ptr and returns
108 * true if the result is zero, or false for all
109 * other cases.
110 */
111extern int atomic64_sub_and_test(u64 delta, atomic64_t *ptr);
112
113/**
114 * atomic64_inc - increment atomic64 variable
115 * @ptr: pointer to type atomic64_t
116 *
117 * Atomically increments @ptr by 1.
118 */
119extern void atomic64_inc(atomic64_t *ptr);
120
121/**
122 * atomic64_dec - decrement atomic64 variable
123 * @ptr: pointer to type atomic64_t
124 *
125 * Atomically decrements @ptr by 1.
126 */
127extern void atomic64_dec(atomic64_t *ptr);
128
129/**
130 * atomic64_dec_and_test - decrement and test
131 * @ptr: pointer to type atomic64_t
132 *
133 * Atomically decrements @ptr by 1 and
134 * returns true if the result is 0, or false for all other
135 * cases.
136 */
137extern int atomic64_dec_and_test(atomic64_t *ptr);
138
139/**
140 * atomic64_inc_and_test - increment and test
141 * @ptr: pointer to type atomic64_t
142 *
143 * Atomically increments @ptr by 1
144 * and returns true if the result is zero, or false for all
145 * other cases.
146 */
147extern int atomic64_inc_and_test(atomic64_t *ptr);
148
149/**
150 * atomic64_add_negative - add and test if negative
151 * @delta: integer value to add
152 * @ptr: pointer to type atomic64_t
153 *
154 * Atomically adds @delta to @ptr and returns true
155 * if the result is negative, or false when
156 * result is greater than or equal to zero.
157 */
158extern int atomic64_add_negative(u64 delta, atomic64_t *ptr);
159
160#endif /* _ASM_X86_ATOMIC64_32_H */
diff --git a/arch/x86/include/asm/atomic64_64.h b/arch/x86/include/asm/atomic64_64.h
new file mode 100644
index 000000000000..51c5b4056929
--- /dev/null
+++ b/arch/x86/include/asm/atomic64_64.h
@@ -0,0 +1,224 @@
1#ifndef _ASM_X86_ATOMIC64_64_H
2#define _ASM_X86_ATOMIC64_64_H
3
4#include <linux/types.h>
5#include <asm/alternative.h>
6#include <asm/cmpxchg.h>
7
8/* The 64-bit atomic type */
9
10#define ATOMIC64_INIT(i) { (i) }
11
12/**
13 * atomic64_read - read atomic64 variable
14 * @v: pointer of type atomic64_t
15 *
16 * Atomically reads the value of @v.
17 * Doesn't imply a read memory barrier.
18 */
19static inline long atomic64_read(const atomic64_t *v)
20{
21 return v->counter;
22}
23
24/**
25 * atomic64_set - set atomic64 variable
26 * @v: pointer to type atomic64_t
27 * @i: required value
28 *
29 * Atomically sets the value of @v to @i.
30 */
31static inline void atomic64_set(atomic64_t *v, long i)
32{
33 v->counter = i;
34}
35
36/**
37 * atomic64_add - add integer to atomic64 variable
38 * @i: integer value to add
39 * @v: pointer to type atomic64_t
40 *
41 * Atomically adds @i to @v.
42 */
43static inline void atomic64_add(long i, atomic64_t *v)
44{
45 asm volatile(LOCK_PREFIX "addq %1,%0"
46 : "=m" (v->counter)
47 : "er" (i), "m" (v->counter));
48}
49
50/**
51 * atomic64_sub - subtract the atomic64 variable
52 * @i: integer value to subtract
53 * @v: pointer to type atomic64_t
54 *
55 * Atomically subtracts @i from @v.
56 */
57static inline void atomic64_sub(long i, atomic64_t *v)
58{
59 asm volatile(LOCK_PREFIX "subq %1,%0"
60 : "=m" (v->counter)
61 : "er" (i), "m" (v->counter));
62}
63
64/**
65 * atomic64_sub_and_test - subtract value from variable and test result
66 * @i: integer value to subtract
67 * @v: pointer to type atomic64_t
68 *
69 * Atomically subtracts @i from @v and returns
70 * true if the result is zero, or false for all
71 * other cases.
72 */
73static inline int atomic64_sub_and_test(long i, atomic64_t *v)
74{
75 unsigned char c;
76
77 asm volatile(LOCK_PREFIX "subq %2,%0; sete %1"
78 : "=m" (v->counter), "=qm" (c)
79 : "er" (i), "m" (v->counter) : "memory");
80 return c;
81}
82
83/**
84 * atomic64_inc - increment atomic64 variable
85 * @v: pointer to type atomic64_t
86 *
87 * Atomically increments @v by 1.
88 */
89static inline void atomic64_inc(atomic64_t *v)
90{
91 asm volatile(LOCK_PREFIX "incq %0"
92 : "=m" (v->counter)
93 : "m" (v->counter));
94}
95
96/**
97 * atomic64_dec - decrement atomic64 variable
98 * @v: pointer to type atomic64_t
99 *
100 * Atomically decrements @v by 1.
101 */
102static inline void atomic64_dec(atomic64_t *v)
103{
104 asm volatile(LOCK_PREFIX "decq %0"
105 : "=m" (v->counter)
106 : "m" (v->counter));
107}
108
109/**
110 * atomic64_dec_and_test - decrement and test
111 * @v: pointer to type atomic64_t
112 *
113 * Atomically decrements @v by 1 and
114 * returns true if the result is 0, or false for all other
115 * cases.
116 */
117static inline int atomic64_dec_and_test(atomic64_t *v)
118{
119 unsigned char c;
120
121 asm volatile(LOCK_PREFIX "decq %0; sete %1"
122 : "=m" (v->counter), "=qm" (c)
123 : "m" (v->counter) : "memory");
124 return c != 0;
125}
126
127/**
128 * atomic64_inc_and_test - increment and test
129 * @v: pointer to type atomic64_t
130 *
131 * Atomically increments @v by 1
132 * and returns true if the result is zero, or false for all
133 * other cases.
134 */
135static inline int atomic64_inc_and_test(atomic64_t *v)
136{
137 unsigned char c;
138
139 asm volatile(LOCK_PREFIX "incq %0; sete %1"
140 : "=m" (v->counter), "=qm" (c)
141 : "m" (v->counter) : "memory");
142 return c != 0;
143}
144
145/**
146 * atomic64_add_negative - add and test if negative
147 * @i: integer value to add
148 * @v: pointer to type atomic64_t
149 *
150 * Atomically adds @i to @v and returns true
151 * if the result is negative, or false when
152 * result is greater than or equal to zero.
153 */
154static inline int atomic64_add_negative(long i, atomic64_t *v)
155{
156 unsigned char c;
157
158 asm volatile(LOCK_PREFIX "addq %2,%0; sets %1"
159 : "=m" (v->counter), "=qm" (c)
160 : "er" (i), "m" (v->counter) : "memory");
161 return c;
162}
163
164/**
165 * atomic64_add_return - add and return
166 * @i: integer value to add
167 * @v: pointer to type atomic64_t
168 *
169 * Atomically adds @i to @v and returns @i + @v
170 */
171static inline long atomic64_add_return(long i, atomic64_t *v)
172{
173 long __i = i;
174 asm volatile(LOCK_PREFIX "xaddq %0, %1;"
175 : "+r" (i), "+m" (v->counter)
176 : : "memory");
177 return i + __i;
178}
179
180static inline long atomic64_sub_return(long i, atomic64_t *v)
181{
182 return atomic64_add_return(-i, v);
183}
184
185#define atomic64_inc_return(v) (atomic64_add_return(1, (v)))
186#define atomic64_dec_return(v) (atomic64_sub_return(1, (v)))
187
188static inline long atomic64_cmpxchg(atomic64_t *v, long old, long new)
189{
190 return cmpxchg(&v->counter, old, new);
191}
192
193static inline long atomic64_xchg(atomic64_t *v, long new)
194{
195 return xchg(&v->counter, new);
196}
197
198/**
199 * atomic64_add_unless - add unless the number is a given value
200 * @v: pointer of type atomic64_t
201 * @a: the amount to add to v...
202 * @u: ...unless v is equal to u.
203 *
204 * Atomically adds @a to @v, so long as it was not @u.
205 * Returns non-zero if @v was not @u, and zero otherwise.
206 */
207static inline int atomic64_add_unless(atomic64_t *v, long a, long u)
208{
209 long c, old;
210 c = atomic64_read(v);
211 for (;;) {
212 if (unlikely(c == (u)))
213 break;
214 old = atomic64_cmpxchg((v), c, c + (a));
215 if (likely(old == c))
216 break;
217 c = old;
218 }
219 return c != (u);
220}
221
222#define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0)
223
224#endif /* _ASM_X86_ATOMIC64_64_H */
diff --git a/arch/x86/include/asm/atomic_32.h b/arch/x86/include/asm/atomic_32.h
deleted file mode 100644
index dc5a667ff791..000000000000
--- a/arch/x86/include/asm/atomic_32.h
+++ /dev/null
@@ -1,415 +0,0 @@
1#ifndef _ASM_X86_ATOMIC_32_H
2#define _ASM_X86_ATOMIC_32_H
3
4#include <linux/compiler.h>
5#include <linux/types.h>
6#include <asm/processor.h>
7#include <asm/cmpxchg.h>
8
9/*
10 * Atomic operations that C can't guarantee us. Useful for
11 * resource counting etc..
12 */
13
14#define ATOMIC_INIT(i) { (i) }
15
16/**
17 * atomic_read - read atomic variable
18 * @v: pointer of type atomic_t
19 *
20 * Atomically reads the value of @v.
21 */
22static inline int atomic_read(const atomic_t *v)
23{
24 return v->counter;
25}
26
27/**
28 * atomic_set - set atomic variable
29 * @v: pointer of type atomic_t
30 * @i: required value
31 *
32 * Atomically sets the value of @v to @i.
33 */
34static inline void atomic_set(atomic_t *v, int i)
35{
36 v->counter = i;
37}
38
39/**
40 * atomic_add - add integer to atomic variable
41 * @i: integer value to add
42 * @v: pointer of type atomic_t
43 *
44 * Atomically adds @i to @v.
45 */
46static inline void atomic_add(int i, atomic_t *v)
47{
48 asm volatile(LOCK_PREFIX "addl %1,%0"
49 : "+m" (v->counter)
50 : "ir" (i));
51}
52
53/**
54 * atomic_sub - subtract integer from atomic variable
55 * @i: integer value to subtract
56 * @v: pointer of type atomic_t
57 *
58 * Atomically subtracts @i from @v.
59 */
60static inline void atomic_sub(int i, atomic_t *v)
61{
62 asm volatile(LOCK_PREFIX "subl %1,%0"
63 : "+m" (v->counter)
64 : "ir" (i));
65}
66
67/**
68 * atomic_sub_and_test - subtract value from variable and test result
69 * @i: integer value to subtract
70 * @v: pointer of type atomic_t
71 *
72 * Atomically subtracts @i from @v and returns
73 * true if the result is zero, or false for all
74 * other cases.
75 */
76static inline int atomic_sub_and_test(int i, atomic_t *v)
77{
78 unsigned char c;
79
80 asm volatile(LOCK_PREFIX "subl %2,%0; sete %1"
81 : "+m" (v->counter), "=qm" (c)
82 : "ir" (i) : "memory");
83 return c;
84}
85
86/**
87 * atomic_inc - increment atomic variable
88 * @v: pointer of type atomic_t
89 *
90 * Atomically increments @v by 1.
91 */
92static inline void atomic_inc(atomic_t *v)
93{
94 asm volatile(LOCK_PREFIX "incl %0"
95 : "+m" (v->counter));
96}
97
98/**
99 * atomic_dec - decrement atomic variable
100 * @v: pointer of type atomic_t
101 *
102 * Atomically decrements @v by 1.
103 */
104static inline void atomic_dec(atomic_t *v)
105{
106 asm volatile(LOCK_PREFIX "decl %0"
107 : "+m" (v->counter));
108}
109
110/**
111 * atomic_dec_and_test - decrement and test
112 * @v: pointer of type atomic_t
113 *
114 * Atomically decrements @v by 1 and
115 * returns true if the result is 0, or false for all other
116 * cases.
117 */
118static inline int atomic_dec_and_test(atomic_t *v)
119{
120 unsigned char c;
121
122 asm volatile(LOCK_PREFIX "decl %0; sete %1"
123 : "+m" (v->counter), "=qm" (c)
124 : : "memory");
125 return c != 0;
126}
127
128/**
129 * atomic_inc_and_test - increment and test
130 * @v: pointer of type atomic_t
131 *
132 * Atomically increments @v by 1
133 * and returns true if the result is zero, or false for all
134 * other cases.
135 */
136static inline int atomic_inc_and_test(atomic_t *v)
137{
138 unsigned char c;
139
140 asm volatile(LOCK_PREFIX "incl %0; sete %1"
141 : "+m" (v->counter), "=qm" (c)
142 : : "memory");
143 return c != 0;
144}
145
146/**
147 * atomic_add_negative - add and test if negative
148 * @v: pointer of type atomic_t
149 * @i: integer value to add
150 *
151 * Atomically adds @i to @v and returns true
152 * if the result is negative, or false when
153 * result is greater than or equal to zero.
154 */
155static inline int atomic_add_negative(int i, atomic_t *v)
156{
157 unsigned char c;
158
159 asm volatile(LOCK_PREFIX "addl %2,%0; sets %1"
160 : "+m" (v->counter), "=qm" (c)
161 : "ir" (i) : "memory");
162 return c;
163}
164
165/**
166 * atomic_add_return - add integer and return
167 * @v: pointer of type atomic_t
168 * @i: integer value to add
169 *
170 * Atomically adds @i to @v and returns @i + @v
171 */
172static inline int atomic_add_return(int i, atomic_t *v)
173{
174 int __i;
175#ifdef CONFIG_M386
176 unsigned long flags;
177 if (unlikely(boot_cpu_data.x86 <= 3))
178 goto no_xadd;
179#endif
180 /* Modern 486+ processor */
181 __i = i;
182 asm volatile(LOCK_PREFIX "xaddl %0, %1"
183 : "+r" (i), "+m" (v->counter)
184 : : "memory");
185 return i + __i;
186
187#ifdef CONFIG_M386
188no_xadd: /* Legacy 386 processor */
189 local_irq_save(flags);
190 __i = atomic_read(v);
191 atomic_set(v, i + __i);
192 local_irq_restore(flags);
193 return i + __i;
194#endif
195}
196
197/**
198 * atomic_sub_return - subtract integer and return
199 * @v: pointer of type atomic_t
200 * @i: integer value to subtract
201 *
202 * Atomically subtracts @i from @v and returns @v - @i
203 */
204static inline int atomic_sub_return(int i, atomic_t *v)
205{
206 return atomic_add_return(-i, v);
207}
208
209static inline int atomic_cmpxchg(atomic_t *v, int old, int new)
210{
211 return cmpxchg(&v->counter, old, new);
212}
213
214static inline int atomic_xchg(atomic_t *v, int new)
215{
216 return xchg(&v->counter, new);
217}
218
219/**
220 * atomic_add_unless - add unless the number is already a given value
221 * @v: pointer of type atomic_t
222 * @a: the amount to add to v...
223 * @u: ...unless v is equal to u.
224 *
225 * Atomically adds @a to @v, so long as @v was not already @u.
226 * Returns non-zero if @v was not @u, and zero otherwise.
227 */
228static inline int atomic_add_unless(atomic_t *v, int a, int u)
229{
230 int c, old;
231 c = atomic_read(v);
232 for (;;) {
233 if (unlikely(c == (u)))
234 break;
235 old = atomic_cmpxchg((v), c, c + (a));
236 if (likely(old == c))
237 break;
238 c = old;
239 }
240 return c != (u);
241}
242
243#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
244
245#define atomic_inc_return(v) (atomic_add_return(1, v))
246#define atomic_dec_return(v) (atomic_sub_return(1, v))
247
248/* These are x86-specific, used by some header files */
249#define atomic_clear_mask(mask, addr) \
250 asm volatile(LOCK_PREFIX "andl %0,%1" \
251 : : "r" (~(mask)), "m" (*(addr)) : "memory")
252
253#define atomic_set_mask(mask, addr) \
254 asm volatile(LOCK_PREFIX "orl %0,%1" \
255 : : "r" (mask), "m" (*(addr)) : "memory")
256
257/* Atomic operations are already serializing on x86 */
258#define smp_mb__before_atomic_dec() barrier()
259#define smp_mb__after_atomic_dec() barrier()
260#define smp_mb__before_atomic_inc() barrier()
261#define smp_mb__after_atomic_inc() barrier()
262
263/* An 64bit atomic type */
264
265typedef struct {
266 u64 __aligned(8) counter;
267} atomic64_t;
268
269#define ATOMIC64_INIT(val) { (val) }
270
271extern u64 atomic64_cmpxchg(atomic64_t *ptr, u64 old_val, u64 new_val);
272
273/**
274 * atomic64_xchg - xchg atomic64 variable
275 * @ptr: pointer to type atomic64_t
276 * @new_val: value to assign
277 *
278 * Atomically xchgs the value of @ptr to @new_val and returns
279 * the old value.
280 */
281extern u64 atomic64_xchg(atomic64_t *ptr, u64 new_val);
282
283/**
284 * atomic64_set - set atomic64 variable
285 * @ptr: pointer to type atomic64_t
286 * @new_val: value to assign
287 *
288 * Atomically sets the value of @ptr to @new_val.
289 */
290extern void atomic64_set(atomic64_t *ptr, u64 new_val);
291
292/**
293 * atomic64_read - read atomic64 variable
294 * @ptr: pointer to type atomic64_t
295 *
296 * Atomically reads the value of @ptr and returns it.
297 */
298static inline u64 atomic64_read(atomic64_t *ptr)
299{
300 u64 res;
301
302 /*
303 * Note, we inline this atomic64_t primitive because
304 * it only clobbers EAX/EDX and leaves the others
305 * untouched. We also (somewhat subtly) rely on the
306 * fact that cmpxchg8b returns the current 64-bit value
307 * of the memory location we are touching:
308 */
309 asm volatile(
310 "mov %%ebx, %%eax\n\t"
311 "mov %%ecx, %%edx\n\t"
312 LOCK_PREFIX "cmpxchg8b %1\n"
313 : "=&A" (res)
314 : "m" (*ptr)
315 );
316
317 return res;
318}
319
320extern u64 atomic64_read(atomic64_t *ptr);
321
322/**
323 * atomic64_add_return - add and return
324 * @delta: integer value to add
325 * @ptr: pointer to type atomic64_t
326 *
327 * Atomically adds @delta to @ptr and returns @delta + *@ptr
328 */
329extern u64 atomic64_add_return(u64 delta, atomic64_t *ptr);
330
331/*
332 * Other variants with different arithmetic operators:
333 */
334extern u64 atomic64_sub_return(u64 delta, atomic64_t *ptr);
335extern u64 atomic64_inc_return(atomic64_t *ptr);
336extern u64 atomic64_dec_return(atomic64_t *ptr);
337
338/**
339 * atomic64_add - add integer to atomic64 variable
340 * @delta: integer value to add
341 * @ptr: pointer to type atomic64_t
342 *
343 * Atomically adds @delta to @ptr.
344 */
345extern void atomic64_add(u64 delta, atomic64_t *ptr);
346
347/**
348 * atomic64_sub - subtract the atomic64 variable
349 * @delta: integer value to subtract
350 * @ptr: pointer to type atomic64_t
351 *
352 * Atomically subtracts @delta from @ptr.
353 */
354extern void atomic64_sub(u64 delta, atomic64_t *ptr);
355
356/**
357 * atomic64_sub_and_test - subtract value from variable and test result
358 * @delta: integer value to subtract
359 * @ptr: pointer to type atomic64_t
360 *
361 * Atomically subtracts @delta from @ptr and returns
362 * true if the result is zero, or false for all
363 * other cases.
364 */
365extern int atomic64_sub_and_test(u64 delta, atomic64_t *ptr);
366
367/**
368 * atomic64_inc - increment atomic64 variable
369 * @ptr: pointer to type atomic64_t
370 *
371 * Atomically increments @ptr by 1.
372 */
373extern void atomic64_inc(atomic64_t *ptr);
374
375/**
376 * atomic64_dec - decrement atomic64 variable
377 * @ptr: pointer to type atomic64_t
378 *
379 * Atomically decrements @ptr by 1.
380 */
381extern void atomic64_dec(atomic64_t *ptr);
382
383/**
384 * atomic64_dec_and_test - decrement and test
385 * @ptr: pointer to type atomic64_t
386 *
387 * Atomically decrements @ptr by 1 and
388 * returns true if the result is 0, or false for all other
389 * cases.
390 */
391extern int atomic64_dec_and_test(atomic64_t *ptr);
392
393/**
394 * atomic64_inc_and_test - increment and test
395 * @ptr: pointer to type atomic64_t
396 *
397 * Atomically increments @ptr by 1
398 * and returns true if the result is zero, or false for all
399 * other cases.
400 */
401extern int atomic64_inc_and_test(atomic64_t *ptr);
402
403/**
404 * atomic64_add_negative - add and test if negative
405 * @delta: integer value to add
406 * @ptr: pointer to type atomic64_t
407 *
408 * Atomically adds @delta to @ptr and returns true
409 * if the result is negative, or false when
410 * result is greater than or equal to zero.
411 */
412extern int atomic64_add_negative(u64 delta, atomic64_t *ptr);
413
414#include <asm-generic/atomic-long.h>
415#endif /* _ASM_X86_ATOMIC_32_H */
diff --git a/arch/x86/include/asm/atomic_64.h b/arch/x86/include/asm/atomic_64.h
deleted file mode 100644
index d605dc268e79..000000000000
--- a/arch/x86/include/asm/atomic_64.h
+++ /dev/null
@@ -1,485 +0,0 @@
1#ifndef _ASM_X86_ATOMIC_64_H
2#define _ASM_X86_ATOMIC_64_H
3
4#include <linux/types.h>
5#include <asm/alternative.h>
6#include <asm/cmpxchg.h>
7
8/*
9 * Atomic operations that C can't guarantee us. Useful for
10 * resource counting etc..
11 */
12
13#define ATOMIC_INIT(i) { (i) }
14
15/**
16 * atomic_read - read atomic variable
17 * @v: pointer of type atomic_t
18 *
19 * Atomically reads the value of @v.
20 */
21static inline int atomic_read(const atomic_t *v)
22{
23 return v->counter;
24}
25
26/**
27 * atomic_set - set atomic variable
28 * @v: pointer of type atomic_t
29 * @i: required value
30 *
31 * Atomically sets the value of @v to @i.
32 */
33static inline void atomic_set(atomic_t *v, int i)
34{
35 v->counter = i;
36}
37
38/**
39 * atomic_add - add integer to atomic variable
40 * @i: integer value to add
41 * @v: pointer of type atomic_t
42 *
43 * Atomically adds @i to @v.
44 */
45static inline void atomic_add(int i, atomic_t *v)
46{
47 asm volatile(LOCK_PREFIX "addl %1,%0"
48 : "=m" (v->counter)
49 : "ir" (i), "m" (v->counter));
50}
51
52/**
53 * atomic_sub - subtract the atomic variable
54 * @i: integer value to subtract
55 * @v: pointer of type atomic_t
56 *
57 * Atomically subtracts @i from @v.
58 */
59static inline void atomic_sub(int i, atomic_t *v)
60{
61 asm volatile(LOCK_PREFIX "subl %1,%0"
62 : "=m" (v->counter)
63 : "ir" (i), "m" (v->counter));
64}
65
66/**
67 * atomic_sub_and_test - subtract value from variable and test result
68 * @i: integer value to subtract
69 * @v: pointer of type atomic_t
70 *
71 * Atomically subtracts @i from @v and returns
72 * true if the result is zero, or false for all
73 * other cases.
74 */
75static inline int atomic_sub_and_test(int i, atomic_t *v)
76{
77 unsigned char c;
78
79 asm volatile(LOCK_PREFIX "subl %2,%0; sete %1"
80 : "=m" (v->counter), "=qm" (c)
81 : "ir" (i), "m" (v->counter) : "memory");
82 return c;
83}
84
85/**
86 * atomic_inc - increment atomic variable
87 * @v: pointer of type atomic_t
88 *
89 * Atomically increments @v by 1.
90 */
91static inline void atomic_inc(atomic_t *v)
92{
93 asm volatile(LOCK_PREFIX "incl %0"
94 : "=m" (v->counter)
95 : "m" (v->counter));
96}
97
98/**
99 * atomic_dec - decrement atomic variable
100 * @v: pointer of type atomic_t
101 *
102 * Atomically decrements @v by 1.
103 */
104static inline void atomic_dec(atomic_t *v)
105{
106 asm volatile(LOCK_PREFIX "decl %0"
107 : "=m" (v->counter)
108 : "m" (v->counter));
109}
110
111/**
112 * atomic_dec_and_test - decrement and test
113 * @v: pointer of type atomic_t
114 *
115 * Atomically decrements @v by 1 and
116 * returns true if the result is 0, or false for all other
117 * cases.
118 */
119static inline int atomic_dec_and_test(atomic_t *v)
120{
121 unsigned char c;
122
123 asm volatile(LOCK_PREFIX "decl %0; sete %1"
124 : "=m" (v->counter), "=qm" (c)
125 : "m" (v->counter) : "memory");
126 return c != 0;
127}
128
129/**
130 * atomic_inc_and_test - increment and test
131 * @v: pointer of type atomic_t
132 *
133 * Atomically increments @v by 1
134 * and returns true if the result is zero, or false for all
135 * other cases.
136 */
137static inline int atomic_inc_and_test(atomic_t *v)
138{
139 unsigned char c;
140
141 asm volatile(LOCK_PREFIX "incl %0; sete %1"
142 : "=m" (v->counter), "=qm" (c)
143 : "m" (v->counter) : "memory");
144 return c != 0;
145}
146
147/**
148 * atomic_add_negative - add and test if negative
149 * @i: integer value to add
150 * @v: pointer of type atomic_t
151 *
152 * Atomically adds @i to @v and returns true
153 * if the result is negative, or false when
154 * result is greater than or equal to zero.
155 */
156static inline int atomic_add_negative(int i, atomic_t *v)
157{
158 unsigned char c;
159
160 asm volatile(LOCK_PREFIX "addl %2,%0; sets %1"
161 : "=m" (v->counter), "=qm" (c)
162 : "ir" (i), "m" (v->counter) : "memory");
163 return c;
164}
165
166/**
167 * atomic_add_return - add and return
168 * @i: integer value to add
169 * @v: pointer of type atomic_t
170 *
171 * Atomically adds @i to @v and returns @i + @v
172 */
173static inline int atomic_add_return(int i, atomic_t *v)
174{
175 int __i = i;
176 asm volatile(LOCK_PREFIX "xaddl %0, %1"
177 : "+r" (i), "+m" (v->counter)
178 : : "memory");
179 return i + __i;
180}
181
182static inline int atomic_sub_return(int i, atomic_t *v)
183{
184 return atomic_add_return(-i, v);
185}
186
187#define atomic_inc_return(v) (atomic_add_return(1, v))
188#define atomic_dec_return(v) (atomic_sub_return(1, v))
189
190/* The 64-bit atomic type */
191
192#define ATOMIC64_INIT(i) { (i) }
193
194/**
195 * atomic64_read - read atomic64 variable
196 * @v: pointer of type atomic64_t
197 *
198 * Atomically reads the value of @v.
199 * Doesn't imply a read memory barrier.
200 */
201static inline long atomic64_read(const atomic64_t *v)
202{
203 return v->counter;
204}
205
206/**
207 * atomic64_set - set atomic64 variable
208 * @v: pointer to type atomic64_t
209 * @i: required value
210 *
211 * Atomically sets the value of @v to @i.
212 */
213static inline void atomic64_set(atomic64_t *v, long i)
214{
215 v->counter = i;
216}
217
218/**
219 * atomic64_add - add integer to atomic64 variable
220 * @i: integer value to add
221 * @v: pointer to type atomic64_t
222 *
223 * Atomically adds @i to @v.
224 */
225static inline void atomic64_add(long i, atomic64_t *v)
226{
227 asm volatile(LOCK_PREFIX "addq %1,%0"
228 : "=m" (v->counter)
229 : "er" (i), "m" (v->counter));
230}
231
232/**
233 * atomic64_sub - subtract the atomic64 variable
234 * @i: integer value to subtract
235 * @v: pointer to type atomic64_t
236 *
237 * Atomically subtracts @i from @v.
238 */
239static inline void atomic64_sub(long i, atomic64_t *v)
240{
241 asm volatile(LOCK_PREFIX "subq %1,%0"
242 : "=m" (v->counter)
243 : "er" (i), "m" (v->counter));
244}
245
246/**
247 * atomic64_sub_and_test - subtract value from variable and test result
248 * @i: integer value to subtract
249 * @v: pointer to type atomic64_t
250 *
251 * Atomically subtracts @i from @v and returns
252 * true if the result is zero, or false for all
253 * other cases.
254 */
255static inline int atomic64_sub_and_test(long i, atomic64_t *v)
256{
257 unsigned char c;
258
259 asm volatile(LOCK_PREFIX "subq %2,%0; sete %1"
260 : "=m" (v->counter), "=qm" (c)
261 : "er" (i), "m" (v->counter) : "memory");
262 return c;
263}
264
265/**
266 * atomic64_inc - increment atomic64 variable
267 * @v: pointer to type atomic64_t
268 *
269 * Atomically increments @v by 1.
270 */
271static inline void atomic64_inc(atomic64_t *v)
272{
273 asm volatile(LOCK_PREFIX "incq %0"
274 : "=m" (v->counter)
275 : "m" (v->counter));
276}
277
278/**
279 * atomic64_dec - decrement atomic64 variable
280 * @v: pointer to type atomic64_t
281 *
282 * Atomically decrements @v by 1.
283 */
284static inline void atomic64_dec(atomic64_t *v)
285{
286 asm volatile(LOCK_PREFIX "decq %0"
287 : "=m" (v->counter)
288 : "m" (v->counter));
289}
290
291/**
292 * atomic64_dec_and_test - decrement and test
293 * @v: pointer to type atomic64_t
294 *
295 * Atomically decrements @v by 1 and
296 * returns true if the result is 0, or false for all other
297 * cases.
298 */
299static inline int atomic64_dec_and_test(atomic64_t *v)
300{
301 unsigned char c;
302
303 asm volatile(LOCK_PREFIX "decq %0; sete %1"
304 : "=m" (v->counter), "=qm" (c)
305 : "m" (v->counter) : "memory");
306 return c != 0;
307}
308
309/**
310 * atomic64_inc_and_test - increment and test
311 * @v: pointer to type atomic64_t
312 *
313 * Atomically increments @v by 1
314 * and returns true if the result is zero, or false for all
315 * other cases.
316 */
317static inline int atomic64_inc_and_test(atomic64_t *v)
318{
319 unsigned char c;
320
321 asm volatile(LOCK_PREFIX "incq %0; sete %1"
322 : "=m" (v->counter), "=qm" (c)
323 : "m" (v->counter) : "memory");
324 return c != 0;
325}
326
327/**
328 * atomic64_add_negative - add and test if negative
329 * @i: integer value to add
330 * @v: pointer to type atomic64_t
331 *
332 * Atomically adds @i to @v and returns true
333 * if the result is negative, or false when
334 * result is greater than or equal to zero.
335 */
336static inline int atomic64_add_negative(long i, atomic64_t *v)
337{
338 unsigned char c;
339
340 asm volatile(LOCK_PREFIX "addq %2,%0; sets %1"
341 : "=m" (v->counter), "=qm" (c)
342 : "er" (i), "m" (v->counter) : "memory");
343 return c;
344}
345
346/**
347 * atomic64_add_return - add and return
348 * @i: integer value to add
349 * @v: pointer to type atomic64_t
350 *
351 * Atomically adds @i to @v and returns @i + @v
352 */
353static inline long atomic64_add_return(long i, atomic64_t *v)
354{
355 long __i = i;
356 asm volatile(LOCK_PREFIX "xaddq %0, %1;"
357 : "+r" (i), "+m" (v->counter)
358 : : "memory");
359 return i + __i;
360}
361
362static inline long atomic64_sub_return(long i, atomic64_t *v)
363{
364 return atomic64_add_return(-i, v);
365}
366
367#define atomic64_inc_return(v) (atomic64_add_return(1, (v)))
368#define atomic64_dec_return(v) (atomic64_sub_return(1, (v)))
369
370static inline long atomic64_cmpxchg(atomic64_t *v, long old, long new)
371{
372 return cmpxchg(&v->counter, old, new);
373}
374
375static inline long atomic64_xchg(atomic64_t *v, long new)
376{
377 return xchg(&v->counter, new);
378}
379
380static inline long atomic_cmpxchg(atomic_t *v, int old, int new)
381{
382 return cmpxchg(&v->counter, old, new);
383}
384
385static inline long atomic_xchg(atomic_t *v, int new)
386{
387 return xchg(&v->counter, new);
388}
389
390/**
391 * atomic_add_unless - add unless the number is a given value
392 * @v: pointer of type atomic_t
393 * @a: the amount to add to v...
394 * @u: ...unless v is equal to u.
395 *
396 * Atomically adds @a to @v, so long as it was not @u.
397 * Returns non-zero if @v was not @u, and zero otherwise.
398 */
399static inline int atomic_add_unless(atomic_t *v, int a, int u)
400{
401 int c, old;
402 c = atomic_read(v);
403 for (;;) {
404 if (unlikely(c == (u)))
405 break;
406 old = atomic_cmpxchg((v), c, c + (a));
407 if (likely(old == c))
408 break;
409 c = old;
410 }
411 return c != (u);
412}
413
414#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
415
416/**
417 * atomic64_add_unless - add unless the number is a given value
418 * @v: pointer of type atomic64_t
419 * @a: the amount to add to v...
420 * @u: ...unless v is equal to u.
421 *
422 * Atomically adds @a to @v, so long as it was not @u.
423 * Returns non-zero if @v was not @u, and zero otherwise.
424 */
425static inline int atomic64_add_unless(atomic64_t *v, long a, long u)
426{
427 long c, old;
428 c = atomic64_read(v);
429 for (;;) {
430 if (unlikely(c == (u)))
431 break;
432 old = atomic64_cmpxchg((v), c, c + (a));
433 if (likely(old == c))
434 break;
435 c = old;
436 }
437 return c != (u);
438}
439
440/**
441 * atomic_inc_short - increment of a short integer
442 * @v: pointer to type int
443 *
444 * Atomically adds 1 to @v
445 * Returns the new value of @u
446 */
447static inline short int atomic_inc_short(short int *v)
448{
449 asm(LOCK_PREFIX "addw $1, %0" : "+m" (*v));
450 return *v;
451}
452
453/**
454 * atomic_or_long - OR of two long integers
455 * @v1: pointer to type unsigned long
456 * @v2: pointer to type unsigned long
457 *
458 * Atomically ORs @v1 and @v2
459 * Returns the result of the OR
460 */
461static inline void atomic_or_long(unsigned long *v1, unsigned long v2)
462{
463 asm(LOCK_PREFIX "orq %1, %0" : "+m" (*v1) : "r" (v2));
464}
465
466#define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0)
467
468/* These are x86-specific, used by some header files */
469#define atomic_clear_mask(mask, addr) \
470 asm volatile(LOCK_PREFIX "andl %0,%1" \
471 : : "r" (~(mask)), "m" (*(addr)) : "memory")
472
473#define atomic_set_mask(mask, addr) \
474 asm volatile(LOCK_PREFIX "orl %0,%1" \
475 : : "r" ((unsigned)(mask)), "m" (*(addr)) \
476 : "memory")
477
478/* Atomic operations are already serializing on x86 */
479#define smp_mb__before_atomic_dec() barrier()
480#define smp_mb__after_atomic_dec() barrier()
481#define smp_mb__before_atomic_inc() barrier()
482#define smp_mb__after_atomic_inc() barrier()
483
484#include <asm-generic/atomic-long.h>
485#endif /* _ASM_X86_ATOMIC_64_H */
diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h
index 637e1ec963c3..0cd82d068613 100644
--- a/arch/x86/include/asm/cpufeature.h
+++ b/arch/x86/include/asm/cpufeature.h
@@ -168,6 +168,10 @@
168#define X86_FEATURE_FLEXPRIORITY (8*32+ 2) /* Intel FlexPriority */ 168#define X86_FEATURE_FLEXPRIORITY (8*32+ 2) /* Intel FlexPriority */
169#define X86_FEATURE_EPT (8*32+ 3) /* Intel Extended Page Table */ 169#define X86_FEATURE_EPT (8*32+ 3) /* Intel Extended Page Table */
170#define X86_FEATURE_VPID (8*32+ 4) /* Intel Virtual Processor ID */ 170#define X86_FEATURE_VPID (8*32+ 4) /* Intel Virtual Processor ID */
171#define X86_FEATURE_NPT (8*32+5) /* AMD Nested Page Table support */
172#define X86_FEATURE_LBRV (8*32+6) /* AMD LBR Virtualization support */
173#define X86_FEATURE_SVML (8*32+7) /* "svm_lock" AMD SVM locking MSR */
174#define X86_FEATURE_NRIPS (8*32+8) /* "nrip_save" AMD SVM next_rip save */
171 175
172#if defined(__KERNEL__) && !defined(__ASSEMBLY__) 176#if defined(__KERNEL__) && !defined(__ASSEMBLY__)
173 177
diff --git a/arch/x86/include/asm/debugreg.h b/arch/x86/include/asm/debugreg.h
index 8240f76b531e..b81002f23614 100644
--- a/arch/x86/include/asm/debugreg.h
+++ b/arch/x86/include/asm/debugreg.h
@@ -14,6 +14,9 @@
14 which debugging register was responsible for the trap. The other bits 14 which debugging register was responsible for the trap. The other bits
15 are either reserved or not of interest to us. */ 15 are either reserved or not of interest to us. */
16 16
17/* Define reserved bits in DR6 which are always set to 1 */
18#define DR6_RESERVED (0xFFFF0FF0)
19
17#define DR_TRAP0 (0x1) /* db0 */ 20#define DR_TRAP0 (0x1) /* db0 */
18#define DR_TRAP1 (0x2) /* db1 */ 21#define DR_TRAP1 (0x2) /* db1 */
19#define DR_TRAP2 (0x4) /* db2 */ 22#define DR_TRAP2 (0x4) /* db2 */
diff --git a/arch/x86/include/asm/elf.h b/arch/x86/include/asm/elf.h
index 1994d3f58443..f2ad2163109d 100644
--- a/arch/x86/include/asm/elf.h
+++ b/arch/x86/include/asm/elf.h
@@ -170,10 +170,7 @@ static inline void elf_common_init(struct thread_struct *t,
170} 170}
171 171
172#define ELF_PLAT_INIT(_r, load_addr) \ 172#define ELF_PLAT_INIT(_r, load_addr) \
173do { \ 173 elf_common_init(&current->thread, _r, 0)
174 elf_common_init(&current->thread, _r, 0); \
175 clear_thread_flag(TIF_IA32); \
176} while (0)
177 174
178#define COMPAT_ELF_PLAT_INIT(regs, load_addr) \ 175#define COMPAT_ELF_PLAT_INIT(regs, load_addr) \
179 elf_common_init(&current->thread, regs, __USER_DS) 176 elf_common_init(&current->thread, regs, __USER_DS)
diff --git a/arch/x86/include/asm/fb.h b/arch/x86/include/asm/fb.h
index 53018464aea6..2519d0679d99 100644
--- a/arch/x86/include/asm/fb.h
+++ b/arch/x86/include/asm/fb.h
@@ -12,10 +12,6 @@ static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma,
12 pgprot_val(vma->vm_page_prot) |= _PAGE_PCD; 12 pgprot_val(vma->vm_page_prot) |= _PAGE_PCD;
13} 13}
14 14
15#ifdef CONFIG_X86_32
16extern int fb_is_primary_device(struct fb_info *info); 15extern int fb_is_primary_device(struct fb_info *info);
17#else
18static inline int fb_is_primary_device(struct fb_info *info) { return 0; }
19#endif
20 16
21#endif /* _ASM_X86_FB_H */ 17#endif /* _ASM_X86_FB_H */
diff --git a/arch/x86/include/asm/fixmap.h b/arch/x86/include/asm/fixmap.h
index 14f9890eb495..635f03bb4995 100644
--- a/arch/x86/include/asm/fixmap.h
+++ b/arch/x86/include/asm/fixmap.h
@@ -118,14 +118,20 @@ enum fixed_addresses {
118 * 256 temporary boot-time mappings, used by early_ioremap(), 118 * 256 temporary boot-time mappings, used by early_ioremap(),
119 * before ioremap() is functional. 119 * before ioremap() is functional.
120 * 120 *
121 * We round it up to the next 256 pages boundary so that we 121 * If necessary we round it up to the next 256 pages boundary so
122 * can have a single pgd entry and a single pte table: 122 * that we can have a single pgd entry and a single pte table:
123 */ 123 */
124#define NR_FIX_BTMAPS 64 124#define NR_FIX_BTMAPS 64
125#define FIX_BTMAPS_SLOTS 4 125#define FIX_BTMAPS_SLOTS 4
126 FIX_BTMAP_END = __end_of_permanent_fixed_addresses + 256 - 126#define TOTAL_FIX_BTMAPS (NR_FIX_BTMAPS * FIX_BTMAPS_SLOTS)
127 (__end_of_permanent_fixed_addresses & 255), 127 FIX_BTMAP_END =
128 FIX_BTMAP_BEGIN = FIX_BTMAP_END + NR_FIX_BTMAPS*FIX_BTMAPS_SLOTS - 1, 128 (__end_of_permanent_fixed_addresses ^
129 (__end_of_permanent_fixed_addresses + TOTAL_FIX_BTMAPS - 1)) &
130 -PTRS_PER_PTE
131 ? __end_of_permanent_fixed_addresses + TOTAL_FIX_BTMAPS -
132 (__end_of_permanent_fixed_addresses & (TOTAL_FIX_BTMAPS - 1))
133 : __end_of_permanent_fixed_addresses,
134 FIX_BTMAP_BEGIN = FIX_BTMAP_END + TOTAL_FIX_BTMAPS - 1,
129#ifdef CONFIG_PROVIDE_OHCI1394_DMA_INIT 135#ifdef CONFIG_PROVIDE_OHCI1394_DMA_INIT
130 FIX_OHCI1394_BASE, 136 FIX_OHCI1394_BASE,
131#endif 137#endif
diff --git a/arch/x86/include/asm/i387.h b/arch/x86/include/asm/i387.h
index ebfb8a9e11f7..da2930924501 100644
--- a/arch/x86/include/asm/i387.h
+++ b/arch/x86/include/asm/i387.h
@@ -33,8 +33,16 @@ extern void init_thread_xstate(void);
33extern int dump_fpu(struct pt_regs *, struct user_i387_struct *); 33extern int dump_fpu(struct pt_regs *, struct user_i387_struct *);
34 34
35extern user_regset_active_fn fpregs_active, xfpregs_active; 35extern user_regset_active_fn fpregs_active, xfpregs_active;
36extern user_regset_get_fn fpregs_get, xfpregs_get, fpregs_soft_get; 36extern user_regset_get_fn fpregs_get, xfpregs_get, fpregs_soft_get,
37extern user_regset_set_fn fpregs_set, xfpregs_set, fpregs_soft_set; 37 xstateregs_get;
38extern user_regset_set_fn fpregs_set, xfpregs_set, fpregs_soft_set,
39 xstateregs_set;
40
41/*
42 * xstateregs_active == fpregs_active. Please refer to the comment
43 * at the definition of fpregs_active.
44 */
45#define xstateregs_active fpregs_active
38 46
39extern struct _fpx_sw_bytes fx_sw_reserved; 47extern struct _fpx_sw_bytes fx_sw_reserved;
40#ifdef CONFIG_IA32_EMULATION 48#ifdef CONFIG_IA32_EMULATION
diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h
index 73739322b6d0..a1dcfa3ab17d 100644
--- a/arch/x86/include/asm/io.h
+++ b/arch/x86/include/asm/io.h
@@ -1,8 +1,42 @@
1#ifndef _ASM_X86_IO_H 1#ifndef _ASM_X86_IO_H
2#define _ASM_X86_IO_H 2#define _ASM_X86_IO_H
3 3
4/*
5 * This file contains the definitions for the x86 IO instructions
6 * inb/inw/inl/outb/outw/outl and the "string versions" of the same
7 * (insb/insw/insl/outsb/outsw/outsl). You can also use "pausing"
8 * versions of the single-IO instructions (inb_p/inw_p/..).
9 *
10 * This file is not meant to be obfuscating: it's just complicated
11 * to (a) handle it all in a way that makes gcc able to optimize it
12 * as well as possible and (b) trying to avoid writing the same thing
13 * over and over again with slight variations and possibly making a
14 * mistake somewhere.
15 */
16
17/*
18 * Thanks to James van Artsdalen for a better timing-fix than
19 * the two short jumps: using outb's to a nonexistent port seems
20 * to guarantee better timings even on fast machines.
21 *
22 * On the other hand, I'd like to be sure of a non-existent port:
23 * I feel a bit unsafe about using 0x80 (should be safe, though)
24 *
25 * Linus
26 */
27
28 /*
29 * Bit simplified and optimized by Jan Hubicka
30 * Support of BIGMEM added by Gerhard Wichert, Siemens AG, July 1999.
31 *
32 * isa_memset_io, isa_memcpy_fromio, isa_memcpy_toio added,
33 * isa_read[wl] and isa_write[wl] fixed
34 * - Arnaldo Carvalho de Melo <acme@conectiva.com.br>
35 */
36
4#define ARCH_HAS_IOREMAP_WC 37#define ARCH_HAS_IOREMAP_WC
5 38
39#include <linux/string.h>
6#include <linux/compiler.h> 40#include <linux/compiler.h>
7#include <asm-generic/int-ll64.h> 41#include <asm-generic/int-ll64.h>
8#include <asm/page.h> 42#include <asm/page.h>
@@ -173,11 +207,126 @@ static inline void __iomem *ioremap(resource_size_t offset, unsigned long size)
173extern void iounmap(volatile void __iomem *addr); 207extern void iounmap(volatile void __iomem *addr);
174 208
175 209
176#ifdef CONFIG_X86_32 210#ifdef __KERNEL__
177# include "io_32.h" 211
212#include <asm-generic/iomap.h>
213
214#include <linux/vmalloc.h>
215
216/*
217 * Convert a virtual cached pointer to an uncached pointer
218 */
219#define xlate_dev_kmem_ptr(p) p
220
221static inline void
222memset_io(volatile void __iomem *addr, unsigned char val, size_t count)
223{
224 memset((void __force *)addr, val, count);
225}
226
227static inline void
228memcpy_fromio(void *dst, const volatile void __iomem *src, size_t count)
229{
230 memcpy(dst, (const void __force *)src, count);
231}
232
233static inline void
234memcpy_toio(volatile void __iomem *dst, const void *src, size_t count)
235{
236 memcpy((void __force *)dst, src, count);
237}
238
239/*
240 * ISA space is 'always mapped' on a typical x86 system, no need to
241 * explicitly ioremap() it. The fact that the ISA IO space is mapped
242 * to PAGE_OFFSET is pure coincidence - it does not mean ISA values
243 * are physical addresses. The following constant pointer can be
244 * used as the IO-area pointer (it can be iounmapped as well, so the
245 * analogy with PCI is quite large):
246 */
247#define __ISA_IO_base ((char __iomem *)(PAGE_OFFSET))
248
249/*
250 * Cache management
251 *
252 * This needed for two cases
253 * 1. Out of order aware processors
254 * 2. Accidentally out of order processors (PPro errata #51)
255 */
256
257static inline void flush_write_buffers(void)
258{
259#if defined(CONFIG_X86_OOSTORE) || defined(CONFIG_X86_PPRO_FENCE)
260 asm volatile("lock; addl $0,0(%%esp)": : :"memory");
261#endif
262}
263
264#endif /* __KERNEL__ */
265
266extern void native_io_delay(void);
267
268extern int io_delay_type;
269extern void io_delay_init(void);
270
271#if defined(CONFIG_PARAVIRT)
272#include <asm/paravirt.h>
178#else 273#else
179# include "io_64.h" 274
275static inline void slow_down_io(void)
276{
277 native_io_delay();
278#ifdef REALLY_SLOW_IO
279 native_io_delay();
280 native_io_delay();
281 native_io_delay();
180#endif 282#endif
283}
284
285#endif
286
287#define BUILDIO(bwl, bw, type) \
288static inline void out##bwl(unsigned type value, int port) \
289{ \
290 asm volatile("out" #bwl " %" #bw "0, %w1" \
291 : : "a"(value), "Nd"(port)); \
292} \
293 \
294static inline unsigned type in##bwl(int port) \
295{ \
296 unsigned type value; \
297 asm volatile("in" #bwl " %w1, %" #bw "0" \
298 : "=a"(value) : "Nd"(port)); \
299 return value; \
300} \
301 \
302static inline void out##bwl##_p(unsigned type value, int port) \
303{ \
304 out##bwl(value, port); \
305 slow_down_io(); \
306} \
307 \
308static inline unsigned type in##bwl##_p(int port) \
309{ \
310 unsigned type value = in##bwl(port); \
311 slow_down_io(); \
312 return value; \
313} \
314 \
315static inline void outs##bwl(int port, const void *addr, unsigned long count) \
316{ \
317 asm volatile("rep; outs" #bwl \
318 : "+S"(addr), "+c"(count) : "d"(port)); \
319} \
320 \
321static inline void ins##bwl(int port, void *addr, unsigned long count) \
322{ \
323 asm volatile("rep; ins" #bwl \
324 : "+D"(addr), "+c"(count) : "d"(port)); \
325}
326
327BUILDIO(b, b, char)
328BUILDIO(w, w, short)
329BUILDIO(l, , int)
181 330
182extern void *xlate_dev_mem_ptr(unsigned long phys); 331extern void *xlate_dev_mem_ptr(unsigned long phys);
183extern void unxlate_dev_mem_ptr(unsigned long phys, void *addr); 332extern void unxlate_dev_mem_ptr(unsigned long phys, void *addr);
diff --git a/arch/x86/include/asm/io_32.h b/arch/x86/include/asm/io_32.h
deleted file mode 100644
index a299900f5920..000000000000
--- a/arch/x86/include/asm/io_32.h
+++ /dev/null
@@ -1,196 +0,0 @@
1#ifndef _ASM_X86_IO_32_H
2#define _ASM_X86_IO_32_H
3
4#include <linux/string.h>
5#include <linux/compiler.h>
6
7/*
8 * This file contains the definitions for the x86 IO instructions
9 * inb/inw/inl/outb/outw/outl and the "string versions" of the same
10 * (insb/insw/insl/outsb/outsw/outsl). You can also use "pausing"
11 * versions of the single-IO instructions (inb_p/inw_p/..).
12 *
13 * This file is not meant to be obfuscating: it's just complicated
14 * to (a) handle it all in a way that makes gcc able to optimize it
15 * as well as possible and (b) trying to avoid writing the same thing
16 * over and over again with slight variations and possibly making a
17 * mistake somewhere.
18 */
19
20/*
21 * Thanks to James van Artsdalen for a better timing-fix than
22 * the two short jumps: using outb's to a nonexistent port seems
23 * to guarantee better timings even on fast machines.
24 *
25 * On the other hand, I'd like to be sure of a non-existent port:
26 * I feel a bit unsafe about using 0x80 (should be safe, though)
27 *
28 * Linus
29 */
30
31 /*
32 * Bit simplified and optimized by Jan Hubicka
33 * Support of BIGMEM added by Gerhard Wichert, Siemens AG, July 1999.
34 *
35 * isa_memset_io, isa_memcpy_fromio, isa_memcpy_toio added,
36 * isa_read[wl] and isa_write[wl] fixed
37 * - Arnaldo Carvalho de Melo <acme@conectiva.com.br>
38 */
39
40#define XQUAD_PORTIO_BASE 0xfe400000
41#define XQUAD_PORTIO_QUAD 0x40000 /* 256k per quad. */
42
43#ifdef __KERNEL__
44
45#include <asm-generic/iomap.h>
46
47#include <linux/vmalloc.h>
48
49/*
50 * Convert a virtual cached pointer to an uncached pointer
51 */
52#define xlate_dev_kmem_ptr(p) p
53
54static inline void
55memset_io(volatile void __iomem *addr, unsigned char val, int count)
56{
57 memset((void __force *)addr, val, count);
58}
59
60static inline void
61memcpy_fromio(void *dst, const volatile void __iomem *src, int count)
62{
63 __memcpy(dst, (const void __force *)src, count);
64}
65
66static inline void
67memcpy_toio(volatile void __iomem *dst, const void *src, int count)
68{
69 __memcpy((void __force *)dst, src, count);
70}
71
72/*
73 * ISA space is 'always mapped' on a typical x86 system, no need to
74 * explicitly ioremap() it. The fact that the ISA IO space is mapped
75 * to PAGE_OFFSET is pure coincidence - it does not mean ISA values
76 * are physical addresses. The following constant pointer can be
77 * used as the IO-area pointer (it can be iounmapped as well, so the
78 * analogy with PCI is quite large):
79 */
80#define __ISA_IO_base ((char __iomem *)(PAGE_OFFSET))
81
82/*
83 * Cache management
84 *
85 * This needed for two cases
86 * 1. Out of order aware processors
87 * 2. Accidentally out of order processors (PPro errata #51)
88 */
89
90#if defined(CONFIG_X86_OOSTORE) || defined(CONFIG_X86_PPRO_FENCE)
91
92static inline void flush_write_buffers(void)
93{
94 asm volatile("lock; addl $0,0(%%esp)": : :"memory");
95}
96
97#else
98
99#define flush_write_buffers() do { } while (0)
100
101#endif
102
103#endif /* __KERNEL__ */
104
105extern void native_io_delay(void);
106
107extern int io_delay_type;
108extern void io_delay_init(void);
109
110#if defined(CONFIG_PARAVIRT)
111#include <asm/paravirt.h>
112#else
113
114static inline void slow_down_io(void)
115{
116 native_io_delay();
117#ifdef REALLY_SLOW_IO
118 native_io_delay();
119 native_io_delay();
120 native_io_delay();
121#endif
122}
123
124#endif
125
126#define __BUILDIO(bwl, bw, type) \
127static inline void out##bwl(unsigned type value, int port) \
128{ \
129 out##bwl##_local(value, port); \
130} \
131 \
132static inline unsigned type in##bwl(int port) \
133{ \
134 return in##bwl##_local(port); \
135}
136
137#define BUILDIO(bwl, bw, type) \
138static inline void out##bwl##_local(unsigned type value, int port) \
139{ \
140 asm volatile("out" #bwl " %" #bw "0, %w1" \
141 : : "a"(value), "Nd"(port)); \
142} \
143 \
144static inline unsigned type in##bwl##_local(int port) \
145{ \
146 unsigned type value; \
147 asm volatile("in" #bwl " %w1, %" #bw "0" \
148 : "=a"(value) : "Nd"(port)); \
149 return value; \
150} \
151 \
152static inline void out##bwl##_local_p(unsigned type value, int port) \
153{ \
154 out##bwl##_local(value, port); \
155 slow_down_io(); \
156} \
157 \
158static inline unsigned type in##bwl##_local_p(int port) \
159{ \
160 unsigned type value = in##bwl##_local(port); \
161 slow_down_io(); \
162 return value; \
163} \
164 \
165__BUILDIO(bwl, bw, type) \
166 \
167static inline void out##bwl##_p(unsigned type value, int port) \
168{ \
169 out##bwl(value, port); \
170 slow_down_io(); \
171} \
172 \
173static inline unsigned type in##bwl##_p(int port) \
174{ \
175 unsigned type value = in##bwl(port); \
176 slow_down_io(); \
177 return value; \
178} \
179 \
180static inline void outs##bwl(int port, const void *addr, unsigned long count) \
181{ \
182 asm volatile("rep; outs" #bwl \
183 : "+S"(addr), "+c"(count) : "d"(port)); \
184} \
185 \
186static inline void ins##bwl(int port, void *addr, unsigned long count) \
187{ \
188 asm volatile("rep; ins" #bwl \
189 : "+D"(addr), "+c"(count) : "d"(port)); \
190}
191
192BUILDIO(b, b, char)
193BUILDIO(w, w, short)
194BUILDIO(l, , int)
195
196#endif /* _ASM_X86_IO_32_H */
diff --git a/arch/x86/include/asm/io_64.h b/arch/x86/include/asm/io_64.h
deleted file mode 100644
index 244067893af4..000000000000
--- a/arch/x86/include/asm/io_64.h
+++ /dev/null
@@ -1,181 +0,0 @@
1#ifndef _ASM_X86_IO_64_H
2#define _ASM_X86_IO_64_H
3
4
5/*
6 * This file contains the definitions for the x86 IO instructions
7 * inb/inw/inl/outb/outw/outl and the "string versions" of the same
8 * (insb/insw/insl/outsb/outsw/outsl). You can also use "pausing"
9 * versions of the single-IO instructions (inb_p/inw_p/..).
10 *
11 * This file is not meant to be obfuscating: it's just complicated
12 * to (a) handle it all in a way that makes gcc able to optimize it
13 * as well as possible and (b) trying to avoid writing the same thing
14 * over and over again with slight variations and possibly making a
15 * mistake somewhere.
16 */
17
18/*
19 * Thanks to James van Artsdalen for a better timing-fix than
20 * the two short jumps: using outb's to a nonexistent port seems
21 * to guarantee better timings even on fast machines.
22 *
23 * On the other hand, I'd like to be sure of a non-existent port:
24 * I feel a bit unsafe about using 0x80 (should be safe, though)
25 *
26 * Linus
27 */
28
29 /*
30 * Bit simplified and optimized by Jan Hubicka
31 * Support of BIGMEM added by Gerhard Wichert, Siemens AG, July 1999.
32 *
33 * isa_memset_io, isa_memcpy_fromio, isa_memcpy_toio added,
34 * isa_read[wl] and isa_write[wl] fixed
35 * - Arnaldo Carvalho de Melo <acme@conectiva.com.br>
36 */
37
38extern void native_io_delay(void);
39
40extern int io_delay_type;
41extern void io_delay_init(void);
42
43#if defined(CONFIG_PARAVIRT)
44#include <asm/paravirt.h>
45#else
46
47static inline void slow_down_io(void)
48{
49 native_io_delay();
50#ifdef REALLY_SLOW_IO
51 native_io_delay();
52 native_io_delay();
53 native_io_delay();
54#endif
55}
56#endif
57
58/*
59 * Talk about misusing macros..
60 */
61#define __OUT1(s, x) \
62static inline void out##s(unsigned x value, unsigned short port) {
63
64#define __OUT2(s, s1, s2) \
65asm volatile ("out" #s " %" s1 "0,%" s2 "1"
66
67#ifndef REALLY_SLOW_IO
68#define REALLY_SLOW_IO
69#define UNSET_REALLY_SLOW_IO
70#endif
71
72#define __OUT(s, s1, x) \
73 __OUT1(s, x) __OUT2(s, s1, "w") : : "a" (value), "Nd" (port)); \
74 } \
75 __OUT1(s##_p, x) __OUT2(s, s1, "w") : : "a" (value), "Nd" (port)); \
76 slow_down_io(); \
77}
78
79#define __IN1(s) \
80static inline RETURN_TYPE in##s(unsigned short port) \
81{ \
82 RETURN_TYPE _v;
83
84#define __IN2(s, s1, s2) \
85 asm volatile ("in" #s " %" s2 "1,%" s1 "0"
86
87#define __IN(s, s1, i...) \
88 __IN1(s) __IN2(s, s1, "w") : "=a" (_v) : "Nd" (port), ##i); \
89 return _v; \
90 } \
91 __IN1(s##_p) __IN2(s, s1, "w") : "=a" (_v) : "Nd" (port), ##i); \
92 slow_down_io(); \
93 return _v; }
94
95#ifdef UNSET_REALLY_SLOW_IO
96#undef REALLY_SLOW_IO
97#endif
98
99#define __INS(s) \
100static inline void ins##s(unsigned short port, void *addr, \
101 unsigned long count) \
102{ \
103 asm volatile ("rep ; ins" #s \
104 : "=D" (addr), "=c" (count) \
105 : "d" (port), "0" (addr), "1" (count)); \
106}
107
108#define __OUTS(s) \
109static inline void outs##s(unsigned short port, const void *addr, \
110 unsigned long count) \
111{ \
112 asm volatile ("rep ; outs" #s \
113 : "=S" (addr), "=c" (count) \
114 : "d" (port), "0" (addr), "1" (count)); \
115}
116
117#define RETURN_TYPE unsigned char
118__IN(b, "")
119#undef RETURN_TYPE
120#define RETURN_TYPE unsigned short
121__IN(w, "")
122#undef RETURN_TYPE
123#define RETURN_TYPE unsigned int
124__IN(l, "")
125#undef RETURN_TYPE
126
127__OUT(b, "b", char)
128__OUT(w, "w", short)
129__OUT(l, , int)
130
131__INS(b)
132__INS(w)
133__INS(l)
134
135__OUTS(b)
136__OUTS(w)
137__OUTS(l)
138
139#if defined(__KERNEL__) && defined(__x86_64__)
140
141#include <linux/vmalloc.h>
142
143#include <asm-generic/iomap.h>
144
145void __memcpy_fromio(void *, unsigned long, unsigned);
146void __memcpy_toio(unsigned long, const void *, unsigned);
147
148static inline void memcpy_fromio(void *to, const volatile void __iomem *from,
149 unsigned len)
150{
151 __memcpy_fromio(to, (unsigned long)from, len);
152}
153
154static inline void memcpy_toio(volatile void __iomem *to, const void *from,
155 unsigned len)
156{
157 __memcpy_toio((unsigned long)to, from, len);
158}
159
160void memset_io(volatile void __iomem *a, int b, size_t c);
161
162/*
163 * ISA space is 'always mapped' on a typical x86 system, no need to
164 * explicitly ioremap() it. The fact that the ISA IO space is mapped
165 * to PAGE_OFFSET is pure coincidence - it does not mean ISA values
166 * are physical addresses. The following constant pointer can be
167 * used as the IO-area pointer (it can be iounmapped as well, so the
168 * analogy with PCI is quite large):
169 */
170#define __ISA_IO_base ((char __iomem *)(PAGE_OFFSET))
171
172#define flush_write_buffers()
173
174/*
175 * Convert a virtual cached pointer to an uncached pointer
176 */
177#define xlate_dev_kmem_ptr(p) p
178
179#endif /* __KERNEL__ */
180
181#endif /* _ASM_X86_IO_64_H */
diff --git a/arch/x86/include/asm/mmzone_64.h b/arch/x86/include/asm/mmzone_64.h
index a29f48c2a322..288b96f815a6 100644
--- a/arch/x86/include/asm/mmzone_64.h
+++ b/arch/x86/include/asm/mmzone_64.h
@@ -39,11 +39,5 @@ static inline __attribute__((pure)) int phys_to_nid(unsigned long addr)
39#define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn) 39#define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn)
40#define node_end_pfn(nid) (NODE_DATA(nid)->node_start_pfn + \ 40#define node_end_pfn(nid) (NODE_DATA(nid)->node_start_pfn + \
41 NODE_DATA(nid)->node_spanned_pages) 41 NODE_DATA(nid)->node_spanned_pages)
42
43#ifdef CONFIG_NUMA_EMU
44#define FAKE_NODE_MIN_SIZE (64 * 1024 * 1024)
45#define FAKE_NODE_MIN_HASH_MASK (~(FAKE_NODE_MIN_SIZE - 1UL))
46#endif
47
48#endif 42#endif
49#endif /* _ASM_X86_MMZONE_64_H */ 43#endif /* _ASM_X86_MMZONE_64_H */
diff --git a/arch/x86/include/asm/nmi.h b/arch/x86/include/asm/nmi.h
index 139d4c1a33a7..93da9c3f3341 100644
--- a/arch/x86/include/asm/nmi.h
+++ b/arch/x86/include/asm/nmi.h
@@ -19,7 +19,6 @@ extern void die_nmi(char *str, struct pt_regs *regs, int do_panic);
19extern int check_nmi_watchdog(void); 19extern int check_nmi_watchdog(void);
20extern int nmi_watchdog_enabled; 20extern int nmi_watchdog_enabled;
21extern int avail_to_resrv_perfctr_nmi_bit(unsigned int); 21extern int avail_to_resrv_perfctr_nmi_bit(unsigned int);
22extern int avail_to_resrv_perfctr_nmi(unsigned int);
23extern int reserve_perfctr_nmi(unsigned int); 22extern int reserve_perfctr_nmi(unsigned int);
24extern void release_perfctr_nmi(unsigned int); 23extern void release_perfctr_nmi(unsigned int);
25extern int reserve_evntsel_nmi(unsigned int); 24extern int reserve_evntsel_nmi(unsigned int);
diff --git a/arch/x86/include/asm/numa_64.h b/arch/x86/include/asm/numa_64.h
index c4ae822e415f..823e070e7c26 100644
--- a/arch/x86/include/asm/numa_64.h
+++ b/arch/x86/include/asm/numa_64.h
@@ -36,6 +36,11 @@ extern void __cpuinit numa_set_node(int cpu, int node);
36extern void __cpuinit numa_clear_node(int cpu); 36extern void __cpuinit numa_clear_node(int cpu);
37extern void __cpuinit numa_add_cpu(int cpu); 37extern void __cpuinit numa_add_cpu(int cpu);
38extern void __cpuinit numa_remove_cpu(int cpu); 38extern void __cpuinit numa_remove_cpu(int cpu);
39
40#ifdef CONFIG_NUMA_EMU
41#define FAKE_NODE_MIN_SIZE ((u64)64 << 20)
42#define FAKE_NODE_MIN_HASH_MASK (~(FAKE_NODE_MIN_SIZE - 1UL))
43#endif /* CONFIG_NUMA_EMU */
39#else 44#else
40static inline void init_cpu_to_node(void) { } 45static inline void init_cpu_to_node(void) { }
41static inline void numa_set_node(int cpu, int node) { } 46static inline void numa_set_node(int cpu, int node) { }
diff --git a/arch/x86/include/asm/numaq.h b/arch/x86/include/asm/numaq.h
index 9f0a5f5d29ec..13370b95ea94 100644
--- a/arch/x86/include/asm/numaq.h
+++ b/arch/x86/include/asm/numaq.h
@@ -33,6 +33,10 @@ extern int get_memcfg_numaq(void);
33 33
34extern void *xquad_portio; 34extern void *xquad_portio;
35 35
36#define XQUAD_PORTIO_BASE 0xfe400000
37#define XQUAD_PORTIO_QUAD 0x40000 /* 256k per quad. */
38#define XQUAD_PORT_ADDR(port, quad) (xquad_portio + (XQUAD_PORTIO_QUAD*quad) + port)
39
36/* 40/*
37 * SYS_CFG_DATA_PRIV_ADDR, struct eachquadmem, and struct sys_cfg_data are the 41 * SYS_CFG_DATA_PRIV_ADDR, struct eachquadmem, and struct sys_cfg_data are the
38 */ 42 */
diff --git a/arch/x86/include/asm/page_types.h b/arch/x86/include/asm/page_types.h
index 642fe34b36a2..a667f24c7254 100644
--- a/arch/x86/include/asm/page_types.h
+++ b/arch/x86/include/asm/page_types.h
@@ -40,7 +40,6 @@
40 40
41#ifndef __ASSEMBLY__ 41#ifndef __ASSEMBLY__
42 42
43extern int page_is_ram(unsigned long pagenr);
44extern int devmem_is_allowed(unsigned long pagenr); 43extern int devmem_is_allowed(unsigned long pagenr);
45 44
46extern unsigned long max_low_pfn_mapped; 45extern unsigned long max_low_pfn_mapped;
diff --git a/arch/x86/include/asm/pci_x86.h b/arch/x86/include/asm/pci_x86.h
index b4bf9a942ed0..05b58ccb2e82 100644
--- a/arch/x86/include/asm/pci_x86.h
+++ b/arch/x86/include/asm/pci_x86.h
@@ -29,6 +29,7 @@
29#define PCI_CHECK_ENABLE_AMD_MMCONF 0x20000 29#define PCI_CHECK_ENABLE_AMD_MMCONF 0x20000
30#define PCI_HAS_IO_ECS 0x40000 30#define PCI_HAS_IO_ECS 0x40000
31#define PCI_NOASSIGN_ROMS 0x80000 31#define PCI_NOASSIGN_ROMS 0x80000
32#define PCI_ROOT_NO_CRS 0x100000
32 33
33extern unsigned int pci_probe; 34extern unsigned int pci_probe;
34extern unsigned long pirq_table_addr; 35extern unsigned long pirq_table_addr;
diff --git a/arch/x86/include/asm/perf_event.h b/arch/x86/include/asm/perf_event.h
index 1380367dabd9..befd172c82ad 100644
--- a/arch/x86/include/asm/perf_event.h
+++ b/arch/x86/include/asm/perf_event.h
@@ -27,7 +27,14 @@
27/* 27/*
28 * Includes eventsel and unit mask as well: 28 * Includes eventsel and unit mask as well:
29 */ 29 */
30#define ARCH_PERFMON_EVENT_MASK 0xffff 30
31
32#define INTEL_ARCH_EVTSEL_MASK 0x000000FFULL
33#define INTEL_ARCH_UNIT_MASK 0x0000FF00ULL
34#define INTEL_ARCH_EDGE_MASK 0x00040000ULL
35#define INTEL_ARCH_INV_MASK 0x00800000ULL
36#define INTEL_ARCH_CNT_MASK 0xFF000000ULL
37#define INTEL_ARCH_EVENT_MASK (INTEL_ARCH_UNIT_MASK|INTEL_ARCH_EVTSEL_MASK)
31 38
32/* 39/*
33 * filter mask to validate fixed counter events. 40 * filter mask to validate fixed counter events.
@@ -38,7 +45,12 @@
38 * The other filters are supported by fixed counters. 45 * The other filters are supported by fixed counters.
39 * The any-thread option is supported starting with v3. 46 * The any-thread option is supported starting with v3.
40 */ 47 */
41#define ARCH_PERFMON_EVENT_FILTER_MASK 0xff840000 48#define INTEL_ARCH_FIXED_MASK \
49 (INTEL_ARCH_CNT_MASK| \
50 INTEL_ARCH_INV_MASK| \
51 INTEL_ARCH_EDGE_MASK|\
52 INTEL_ARCH_UNIT_MASK|\
53 INTEL_ARCH_EVTSEL_MASK)
42 54
43#define ARCH_PERFMON_UNHALTED_CORE_CYCLES_SEL 0x3c 55#define ARCH_PERFMON_UNHALTED_CORE_CYCLES_SEL 0x3c
44#define ARCH_PERFMON_UNHALTED_CORE_CYCLES_UMASK (0x00 << 8) 56#define ARCH_PERFMON_UNHALTED_CORE_CYCLES_UMASK (0x00 << 8)
diff --git a/arch/x86/include/asm/pgalloc.h b/arch/x86/include/asm/pgalloc.h
index 0e8c2a0fd922..271de94c3810 100644
--- a/arch/x86/include/asm/pgalloc.h
+++ b/arch/x86/include/asm/pgalloc.h
@@ -23,6 +23,11 @@ static inline void paravirt_release_pud(unsigned long pfn) {}
23#endif 23#endif
24 24
25/* 25/*
26 * Flags to use when allocating a user page table page.
27 */
28extern gfp_t __userpte_alloc_gfp;
29
30/*
26 * Allocate and free page tables. 31 * Allocate and free page tables.
27 */ 32 */
28extern pgd_t *pgd_alloc(struct mm_struct *); 33extern pgd_t *pgd_alloc(struct mm_struct *);
diff --git a/arch/x86/include/asm/pgtable_32.h b/arch/x86/include/asm/pgtable_32.h
index 01fd9461d323..a28668396508 100644
--- a/arch/x86/include/asm/pgtable_32.h
+++ b/arch/x86/include/asm/pgtable_32.h
@@ -80,7 +80,7 @@ do { \
80 * The i386 doesn't have any external MMU info: the kernel page 80 * The i386 doesn't have any external MMU info: the kernel page
81 * tables contain all the necessary information. 81 * tables contain all the necessary information.
82 */ 82 */
83#define update_mmu_cache(vma, address, pte) do { } while (0) 83#define update_mmu_cache(vma, address, ptep) do { } while (0)
84 84
85#endif /* !__ASSEMBLY__ */ 85#endif /* !__ASSEMBLY__ */
86 86
diff --git a/arch/x86/include/asm/pgtable_64.h b/arch/x86/include/asm/pgtable_64.h
index c57a30117149..181be528c612 100644
--- a/arch/x86/include/asm/pgtable_64.h
+++ b/arch/x86/include/asm/pgtable_64.h
@@ -129,7 +129,7 @@ static inline int pgd_large(pgd_t pgd) { return 0; }
129#define pte_unmap(pte) /* NOP */ 129#define pte_unmap(pte) /* NOP */
130#define pte_unmap_nested(pte) /* NOP */ 130#define pte_unmap_nested(pte) /* NOP */
131 131
132#define update_mmu_cache(vma, address, pte) do { } while (0) 132#define update_mmu_cache(vma, address, ptep) do { } while (0)
133 133
134/* Encode and de-code a swap entry */ 134/* Encode and de-code a swap entry */
135#if _PAGE_BIT_FILE < _PAGE_BIT_PROTNONE 135#if _PAGE_BIT_FILE < _PAGE_BIT_PROTNONE
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
index fc801bab1b3b..b753ea59703a 100644
--- a/arch/x86/include/asm/processor.h
+++ b/arch/x86/include/asm/processor.h
@@ -450,6 +450,8 @@ struct thread_struct {
450 struct perf_event *ptrace_bps[HBP_NUM]; 450 struct perf_event *ptrace_bps[HBP_NUM];
451 /* Debug status used for traps, single steps, etc... */ 451 /* Debug status used for traps, single steps, etc... */
452 unsigned long debugreg6; 452 unsigned long debugreg6;
453 /* Keep track of the exact dr7 value set by the user */
454 unsigned long ptrace_dr7;
453 /* Fault info: */ 455 /* Fault info: */
454 unsigned long cr2; 456 unsigned long cr2;
455 unsigned long trap_no; 457 unsigned long trap_no;
diff --git a/arch/x86/include/asm/ptrace.h b/arch/x86/include/asm/ptrace.h
index 9d369f680321..20102808b191 100644
--- a/arch/x86/include/asm/ptrace.h
+++ b/arch/x86/include/asm/ptrace.h
@@ -274,10 +274,6 @@ static inline unsigned long regs_get_kernel_stack_nth(struct pt_regs *regs,
274 return 0; 274 return 0;
275} 275}
276 276
277/* Get Nth argument at function call */
278extern unsigned long regs_get_argument_nth(struct pt_regs *regs,
279 unsigned int n);
280
281/* 277/*
282 * These are defined as per linux/ptrace.h, which see. 278 * These are defined as per linux/ptrace.h, which see.
283 */ 279 */
diff --git a/arch/x86/include/asm/rwsem.h b/arch/x86/include/asm/rwsem.h
index ca7517d33776..606ede126972 100644
--- a/arch/x86/include/asm/rwsem.h
+++ b/arch/x86/include/asm/rwsem.h
@@ -41,6 +41,7 @@
41#include <linux/list.h> 41#include <linux/list.h>
42#include <linux/spinlock.h> 42#include <linux/spinlock.h>
43#include <linux/lockdep.h> 43#include <linux/lockdep.h>
44#include <asm/asm.h>
44 45
45struct rwsem_waiter; 46struct rwsem_waiter;
46 47
@@ -55,17 +56,28 @@ extern asmregparm struct rw_semaphore *
55 56
56/* 57/*
57 * the semaphore definition 58 * the semaphore definition
59 *
60 * The bias values and the counter type limits the number of
61 * potential readers/writers to 32767 for 32 bits and 2147483647
62 * for 64 bits.
58 */ 63 */
59 64
60#define RWSEM_UNLOCKED_VALUE 0x00000000 65#ifdef CONFIG_X86_64
61#define RWSEM_ACTIVE_BIAS 0x00000001 66# define RWSEM_ACTIVE_MASK 0xffffffffL
62#define RWSEM_ACTIVE_MASK 0x0000ffff 67#else
63#define RWSEM_WAITING_BIAS (-0x00010000) 68# define RWSEM_ACTIVE_MASK 0x0000ffffL
69#endif
70
71#define RWSEM_UNLOCKED_VALUE 0x00000000L
72#define RWSEM_ACTIVE_BIAS 0x00000001L
73#define RWSEM_WAITING_BIAS (-RWSEM_ACTIVE_MASK-1)
64#define RWSEM_ACTIVE_READ_BIAS RWSEM_ACTIVE_BIAS 74#define RWSEM_ACTIVE_READ_BIAS RWSEM_ACTIVE_BIAS
65#define RWSEM_ACTIVE_WRITE_BIAS (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS) 75#define RWSEM_ACTIVE_WRITE_BIAS (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS)
66 76
77typedef signed long rwsem_count_t;
78
67struct rw_semaphore { 79struct rw_semaphore {
68 signed long count; 80 rwsem_count_t count;
69 spinlock_t wait_lock; 81 spinlock_t wait_lock;
70 struct list_head wait_list; 82 struct list_head wait_list;
71#ifdef CONFIG_DEBUG_LOCK_ALLOC 83#ifdef CONFIG_DEBUG_LOCK_ALLOC
@@ -105,7 +117,7 @@ do { \
105static inline void __down_read(struct rw_semaphore *sem) 117static inline void __down_read(struct rw_semaphore *sem)
106{ 118{
107 asm volatile("# beginning down_read\n\t" 119 asm volatile("# beginning down_read\n\t"
108 LOCK_PREFIX " incl (%%eax)\n\t" 120 LOCK_PREFIX _ASM_INC "(%1)\n\t"
109 /* adds 0x00000001, returns the old value */ 121 /* adds 0x00000001, returns the old value */
110 " jns 1f\n" 122 " jns 1f\n"
111 " call call_rwsem_down_read_failed\n" 123 " call call_rwsem_down_read_failed\n"
@@ -121,14 +133,14 @@ static inline void __down_read(struct rw_semaphore *sem)
121 */ 133 */
122static inline int __down_read_trylock(struct rw_semaphore *sem) 134static inline int __down_read_trylock(struct rw_semaphore *sem)
123{ 135{
124 __s32 result, tmp; 136 rwsem_count_t result, tmp;
125 asm volatile("# beginning __down_read_trylock\n\t" 137 asm volatile("# beginning __down_read_trylock\n\t"
126 " movl %0,%1\n\t" 138 " mov %0,%1\n\t"
127 "1:\n\t" 139 "1:\n\t"
128 " movl %1,%2\n\t" 140 " mov %1,%2\n\t"
129 " addl %3,%2\n\t" 141 " add %3,%2\n\t"
130 " jle 2f\n\t" 142 " jle 2f\n\t"
131 LOCK_PREFIX " cmpxchgl %2,%0\n\t" 143 LOCK_PREFIX " cmpxchg %2,%0\n\t"
132 " jnz 1b\n\t" 144 " jnz 1b\n\t"
133 "2:\n\t" 145 "2:\n\t"
134 "# ending __down_read_trylock\n\t" 146 "# ending __down_read_trylock\n\t"
@@ -143,13 +155,13 @@ static inline int __down_read_trylock(struct rw_semaphore *sem)
143 */ 155 */
144static inline void __down_write_nested(struct rw_semaphore *sem, int subclass) 156static inline void __down_write_nested(struct rw_semaphore *sem, int subclass)
145{ 157{
146 int tmp; 158 rwsem_count_t tmp;
147 159
148 tmp = RWSEM_ACTIVE_WRITE_BIAS; 160 tmp = RWSEM_ACTIVE_WRITE_BIAS;
149 asm volatile("# beginning down_write\n\t" 161 asm volatile("# beginning down_write\n\t"
150 LOCK_PREFIX " xadd %%edx,(%%eax)\n\t" 162 LOCK_PREFIX " xadd %1,(%2)\n\t"
151 /* subtract 0x0000ffff, returns the old value */ 163 /* subtract 0x0000ffff, returns the old value */
152 " testl %%edx,%%edx\n\t" 164 " test %1,%1\n\t"
153 /* was the count 0 before? */ 165 /* was the count 0 before? */
154 " jz 1f\n" 166 " jz 1f\n"
155 " call call_rwsem_down_write_failed\n" 167 " call call_rwsem_down_write_failed\n"
@@ -170,9 +182,9 @@ static inline void __down_write(struct rw_semaphore *sem)
170 */ 182 */
171static inline int __down_write_trylock(struct rw_semaphore *sem) 183static inline int __down_write_trylock(struct rw_semaphore *sem)
172{ 184{
173 signed long ret = cmpxchg(&sem->count, 185 rwsem_count_t ret = cmpxchg(&sem->count,
174 RWSEM_UNLOCKED_VALUE, 186 RWSEM_UNLOCKED_VALUE,
175 RWSEM_ACTIVE_WRITE_BIAS); 187 RWSEM_ACTIVE_WRITE_BIAS);
176 if (ret == RWSEM_UNLOCKED_VALUE) 188 if (ret == RWSEM_UNLOCKED_VALUE)
177 return 1; 189 return 1;
178 return 0; 190 return 0;
@@ -183,9 +195,9 @@ static inline int __down_write_trylock(struct rw_semaphore *sem)
183 */ 195 */
184static inline void __up_read(struct rw_semaphore *sem) 196static inline void __up_read(struct rw_semaphore *sem)
185{ 197{
186 __s32 tmp = -RWSEM_ACTIVE_READ_BIAS; 198 rwsem_count_t tmp = -RWSEM_ACTIVE_READ_BIAS;
187 asm volatile("# beginning __up_read\n\t" 199 asm volatile("# beginning __up_read\n\t"
188 LOCK_PREFIX " xadd %%edx,(%%eax)\n\t" 200 LOCK_PREFIX " xadd %1,(%2)\n\t"
189 /* subtracts 1, returns the old value */ 201 /* subtracts 1, returns the old value */
190 " jns 1f\n\t" 202 " jns 1f\n\t"
191 " call call_rwsem_wake\n" 203 " call call_rwsem_wake\n"
@@ -201,18 +213,18 @@ static inline void __up_read(struct rw_semaphore *sem)
201 */ 213 */
202static inline void __up_write(struct rw_semaphore *sem) 214static inline void __up_write(struct rw_semaphore *sem)
203{ 215{
216 rwsem_count_t tmp;
204 asm volatile("# beginning __up_write\n\t" 217 asm volatile("# beginning __up_write\n\t"
205 " movl %2,%%edx\n\t" 218 LOCK_PREFIX " xadd %1,(%2)\n\t"
206 LOCK_PREFIX " xaddl %%edx,(%%eax)\n\t"
207 /* tries to transition 219 /* tries to transition
208 0xffff0001 -> 0x00000000 */ 220 0xffff0001 -> 0x00000000 */
209 " jz 1f\n" 221 " jz 1f\n"
210 " call call_rwsem_wake\n" 222 " call call_rwsem_wake\n"
211 "1:\n\t" 223 "1:\n\t"
212 "# ending __up_write\n" 224 "# ending __up_write\n"
213 : "+m" (sem->count) 225 : "+m" (sem->count), "=d" (tmp)
214 : "a" (sem), "i" (-RWSEM_ACTIVE_WRITE_BIAS) 226 : "a" (sem), "1" (-RWSEM_ACTIVE_WRITE_BIAS)
215 : "memory", "cc", "edx"); 227 : "memory", "cc");
216} 228}
217 229
218/* 230/*
@@ -221,33 +233,38 @@ static inline void __up_write(struct rw_semaphore *sem)
221static inline void __downgrade_write(struct rw_semaphore *sem) 233static inline void __downgrade_write(struct rw_semaphore *sem)
222{ 234{
223 asm volatile("# beginning __downgrade_write\n\t" 235 asm volatile("# beginning __downgrade_write\n\t"
224 LOCK_PREFIX " addl %2,(%%eax)\n\t" 236 LOCK_PREFIX _ASM_ADD "%2,(%1)\n\t"
225 /* transitions 0xZZZZ0001 -> 0xYYYY0001 */ 237 /*
238 * transitions 0xZZZZ0001 -> 0xYYYY0001 (i386)
239 * 0xZZZZZZZZ00000001 -> 0xYYYYYYYY00000001 (x86_64)
240 */
226 " jns 1f\n\t" 241 " jns 1f\n\t"
227 " call call_rwsem_downgrade_wake\n" 242 " call call_rwsem_downgrade_wake\n"
228 "1:\n\t" 243 "1:\n\t"
229 "# ending __downgrade_write\n" 244 "# ending __downgrade_write\n"
230 : "+m" (sem->count) 245 : "+m" (sem->count)
231 : "a" (sem), "i" (-RWSEM_WAITING_BIAS) 246 : "a" (sem), "er" (-RWSEM_WAITING_BIAS)
232 : "memory", "cc"); 247 : "memory", "cc");
233} 248}
234 249
235/* 250/*
236 * implement atomic add functionality 251 * implement atomic add functionality
237 */ 252 */
238static inline void rwsem_atomic_add(int delta, struct rw_semaphore *sem) 253static inline void rwsem_atomic_add(rwsem_count_t delta,
254 struct rw_semaphore *sem)
239{ 255{
240 asm volatile(LOCK_PREFIX "addl %1,%0" 256 asm volatile(LOCK_PREFIX _ASM_ADD "%1,%0"
241 : "+m" (sem->count) 257 : "+m" (sem->count)
242 : "ir" (delta)); 258 : "er" (delta));
243} 259}
244 260
245/* 261/*
246 * implement exchange and add functionality 262 * implement exchange and add functionality
247 */ 263 */
248static inline int rwsem_atomic_update(int delta, struct rw_semaphore *sem) 264static inline rwsem_count_t rwsem_atomic_update(rwsem_count_t delta,
265 struct rw_semaphore *sem)
249{ 266{
250 int tmp = delta; 267 rwsem_count_t tmp = delta;
251 268
252 asm volatile(LOCK_PREFIX "xadd %0,%1" 269 asm volatile(LOCK_PREFIX "xadd %0,%1"
253 : "+r" (tmp), "+m" (sem->count) 270 : "+r" (tmp), "+m" (sem->count)
diff --git a/arch/x86/include/asm/smp.h b/arch/x86/include/asm/smp.h
index 1e796782cd7b..4cfc90824068 100644
--- a/arch/x86/include/asm/smp.h
+++ b/arch/x86/include/asm/smp.h
@@ -135,6 +135,8 @@ int native_cpu_disable(void);
135void native_cpu_die(unsigned int cpu); 135void native_cpu_die(unsigned int cpu);
136void native_play_dead(void); 136void native_play_dead(void);
137void play_dead_common(void); 137void play_dead_common(void);
138void wbinvd_on_cpu(int cpu);
139int wbinvd_on_all_cpus(void);
138 140
139void native_send_call_func_ipi(const struct cpumask *mask); 141void native_send_call_func_ipi(const struct cpumask *mask);
140void native_send_call_func_single_ipi(int cpu); 142void native_send_call_func_single_ipi(int cpu);
@@ -147,6 +149,13 @@ static inline int num_booting_cpus(void)
147{ 149{
148 return cpumask_weight(cpu_callout_mask); 150 return cpumask_weight(cpu_callout_mask);
149} 151}
152#else /* !CONFIG_SMP */
153#define wbinvd_on_cpu(cpu) wbinvd()
154static inline int wbinvd_on_all_cpus(void)
155{
156 wbinvd();
157 return 0;
158}
150#endif /* CONFIG_SMP */ 159#endif /* CONFIG_SMP */
151 160
152extern unsigned disabled_cpus __cpuinitdata; 161extern unsigned disabled_cpus __cpuinitdata;
diff --git a/arch/x86/include/asm/stacktrace.h b/arch/x86/include/asm/stacktrace.h
index 35e89122a42f..4dab78edbad9 100644
--- a/arch/x86/include/asm/stacktrace.h
+++ b/arch/x86/include/asm/stacktrace.h
@@ -3,8 +3,6 @@
3 3
4extern int kstack_depth_to_print; 4extern int kstack_depth_to_print;
5 5
6int x86_is_stack_id(int id, char *name);
7
8struct thread_info; 6struct thread_info;
9struct stacktrace_ops; 7struct stacktrace_ops;
10 8
diff --git a/arch/x86/include/asm/syscall.h b/arch/x86/include/asm/syscall.h
index 8d33bc5462d1..c4a348f7bd43 100644
--- a/arch/x86/include/asm/syscall.h
+++ b/arch/x86/include/asm/syscall.h
@@ -16,6 +16,8 @@
16#include <linux/sched.h> 16#include <linux/sched.h>
17#include <linux/err.h> 17#include <linux/err.h>
18 18
19extern const unsigned long sys_call_table[];
20
19/* 21/*
20 * Only the low 32 bits of orig_ax are meaningful, so we return int. 22 * Only the low 32 bits of orig_ax are meaningful, so we return int.
21 * This importantly ignores the high bits on 64-bit, so comparisons 23 * This importantly ignores the high bits on 64-bit, so comparisons
diff --git a/arch/x86/include/asm/uaccess_64.h b/arch/x86/include/asm/uaccess_64.h
index 535e421498f6..316708d5af92 100644
--- a/arch/x86/include/asm/uaccess_64.h
+++ b/arch/x86/include/asm/uaccess_64.h
@@ -8,6 +8,8 @@
8#include <linux/errno.h> 8#include <linux/errno.h>
9#include <linux/prefetch.h> 9#include <linux/prefetch.h>
10#include <linux/lockdep.h> 10#include <linux/lockdep.h>
11#include <asm/alternative.h>
12#include <asm/cpufeature.h>
11#include <asm/page.h> 13#include <asm/page.h>
12 14
13/* 15/*
@@ -16,7 +18,24 @@
16 18
17/* Handles exceptions in both to and from, but doesn't do access_ok */ 19/* Handles exceptions in both to and from, but doesn't do access_ok */
18__must_check unsigned long 20__must_check unsigned long
19copy_user_generic(void *to, const void *from, unsigned len); 21copy_user_generic_string(void *to, const void *from, unsigned len);
22__must_check unsigned long
23copy_user_generic_unrolled(void *to, const void *from, unsigned len);
24
25static __always_inline __must_check unsigned long
26copy_user_generic(void *to, const void *from, unsigned len)
27{
28 unsigned ret;
29
30 alternative_call(copy_user_generic_unrolled,
31 copy_user_generic_string,
32 X86_FEATURE_REP_GOOD,
33 ASM_OUTPUT2("=a" (ret), "=D" (to), "=S" (from),
34 "=d" (len)),
35 "1" (to), "2" (from), "3" (len)
36 : "memory", "rcx", "r8", "r9", "r10", "r11");
37 return ret;
38}
20 39
21__must_check unsigned long 40__must_check unsigned long
22_copy_to_user(void __user *to, const void *from, unsigned len); 41_copy_to_user(void __user *to, const void *from, unsigned len);
diff --git a/arch/x86/include/asm/user.h b/arch/x86/include/asm/user.h
index 999873b22e7f..24532c7da3d6 100644
--- a/arch/x86/include/asm/user.h
+++ b/arch/x86/include/asm/user.h
@@ -1,5 +1,63 @@
1#ifndef _ASM_X86_USER_H
2#define _ASM_X86_USER_H
3
1#ifdef CONFIG_X86_32 4#ifdef CONFIG_X86_32
2# include "user_32.h" 5# include "user_32.h"
3#else 6#else
4# include "user_64.h" 7# include "user_64.h"
5#endif 8#endif
9
10#include <asm/types.h>
11
12struct user_ymmh_regs {
13 /* 16 * 16 bytes for each YMMH-reg */
14 __u32 ymmh_space[64];
15};
16
17struct user_xsave_hdr {
18 __u64 xstate_bv;
19 __u64 reserved1[2];
20 __u64 reserved2[5];
21};
22
23/*
24 * The structure layout of user_xstateregs, used for exporting the
25 * extended register state through ptrace and core-dump (NT_X86_XSTATE note)
26 * interfaces will be same as the memory layout of xsave used by the processor
27 * (except for the bytes 464..511, which can be used by the software) and hence
28 * the size of this structure varies depending on the features supported by the
29 * processor and OS. The size of the structure that users need to use can be
30 * obtained by doing:
31 * cpuid_count(0xd, 0, &eax, &ptrace_xstateregs_struct_size, &ecx, &edx);
32 * i.e., cpuid.(eax=0xd,ecx=0).ebx will be the size that user (debuggers, etc.)
33 * need to use.
34 *
35 * For now, only the first 8 bytes of the software usable bytes[464..471] will
36 * be used and will be set to OS enabled xstate mask (which is same as the
37 * 64bit mask returned by the xgetbv's xCR0). Users (analyzing core dump
38 * remotely, etc.) can use this mask as well as the mask saved in the
39 * xstate_hdr bytes and interpret what states the processor/OS supports
40 * and what states are in modified/initialized conditions for the
41 * particular process/thread.
42 *
43 * Also when the user modifies certain state FP/SSE/etc through the
44 * ptrace interface, they must ensure that the xsave_hdr.xstate_bv
45 * bytes[512..519] of the memory layout are updated correspondingly.
46 * i.e., for example when FP state is modified to a non-init state,
47 * xsave_hdr.xstate_bv's bit 0 must be set to '1', when SSE is modified to
48 * non-init state, xsave_hdr.xstate_bv's bit 1 must to be set to '1', etc.
49 */
50#define USER_XSTATE_FX_SW_WORDS 6
51#define USER_XSTATE_XCR0_WORD 0
52
53struct user_xstateregs {
54 struct {
55 __u64 fpx_space[58];
56 __u64 xstate_fx_sw[USER_XSTATE_FX_SW_WORDS];
57 } i387;
58 struct user_xsave_hdr xsave_hdr;
59 struct user_ymmh_regs ymmh;
60 /* further processor state extensions go here */
61};
62
63#endif /* _ASM_X86_USER_H */
diff --git a/arch/x86/include/asm/uv/bios.h b/arch/x86/include/asm/uv/bios.h
index 2751f3075d8b..71605c7d5c5c 100644
--- a/arch/x86/include/asm/uv/bios.h
+++ b/arch/x86/include/asm/uv/bios.h
@@ -18,8 +18,8 @@
18 * along with this program; if not, write to the Free Software 18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 * 20 *
21 * Copyright (c) 2008 Silicon Graphics, Inc. All Rights Reserved. 21 * Copyright (c) 2008-2009 Silicon Graphics, Inc. All Rights Reserved.
22 * Copyright (c) Russ Anderson 22 * Copyright (c) Russ Anderson <rja@sgi.com>
23 */ 23 */
24 24
25#include <linux/rtc.h> 25#include <linux/rtc.h>
@@ -36,7 +36,8 @@ enum uv_bios_cmd {
36 UV_BIOS_WATCHLIST_ALLOC, 36 UV_BIOS_WATCHLIST_ALLOC,
37 UV_BIOS_WATCHLIST_FREE, 37 UV_BIOS_WATCHLIST_FREE,
38 UV_BIOS_MEMPROTECT, 38 UV_BIOS_MEMPROTECT,
39 UV_BIOS_GET_PARTITION_ADDR 39 UV_BIOS_GET_PARTITION_ADDR,
40 UV_BIOS_SET_LEGACY_VGA_TARGET
40}; 41};
41 42
42/* 43/*
@@ -89,13 +90,14 @@ extern s64 uv_bios_call(enum uv_bios_cmd, u64, u64, u64, u64, u64);
89extern s64 uv_bios_call_irqsave(enum uv_bios_cmd, u64, u64, u64, u64, u64); 90extern s64 uv_bios_call_irqsave(enum uv_bios_cmd, u64, u64, u64, u64, u64);
90extern s64 uv_bios_call_reentrant(enum uv_bios_cmd, u64, u64, u64, u64, u64); 91extern s64 uv_bios_call_reentrant(enum uv_bios_cmd, u64, u64, u64, u64, u64);
91 92
92extern s64 uv_bios_get_sn_info(int, int *, long *, long *, long *); 93extern s64 uv_bios_get_sn_info(int, int *, long *, long *, long *, long *);
93extern s64 uv_bios_freq_base(u64, u64 *); 94extern s64 uv_bios_freq_base(u64, u64 *);
94extern int uv_bios_mq_watchlist_alloc(unsigned long, unsigned int, 95extern int uv_bios_mq_watchlist_alloc(unsigned long, unsigned int,
95 unsigned long *); 96 unsigned long *);
96extern int uv_bios_mq_watchlist_free(int, int); 97extern int uv_bios_mq_watchlist_free(int, int);
97extern s64 uv_bios_change_memprotect(u64, u64, enum uv_memprotect); 98extern s64 uv_bios_change_memprotect(u64, u64, enum uv_memprotect);
98extern s64 uv_bios_reserved_page_pa(u64, u64 *, u64 *, u64 *); 99extern s64 uv_bios_reserved_page_pa(u64, u64 *, u64 *, u64 *);
100extern int uv_bios_set_legacy_vga_target(bool decode, int domain, int bus);
99 101
100extern void uv_bios_init(void); 102extern void uv_bios_init(void);
101 103
@@ -104,6 +106,7 @@ extern int uv_type;
104extern long sn_partition_id; 106extern long sn_partition_id;
105extern long sn_coherency_id; 107extern long sn_coherency_id;
106extern long sn_region_size; 108extern long sn_region_size;
109extern long system_serial_number;
107#define partition_coherence_id() (sn_coherency_id) 110#define partition_coherence_id() (sn_coherency_id)
108 111
109extern struct kobject *sgi_uv_kobj; /* /sys/firmware/sgi_uv */ 112extern struct kobject *sgi_uv_kobj; /* /sys/firmware/sgi_uv */
diff --git a/arch/x86/include/asm/uv/uv.h b/arch/x86/include/asm/uv/uv.h
index c0a01b5d985b..3bb9491b7659 100644
--- a/arch/x86/include/asm/uv/uv.h
+++ b/arch/x86/include/asm/uv/uv.h
@@ -11,6 +11,7 @@ struct mm_struct;
11extern enum uv_system_type get_uv_system_type(void); 11extern enum uv_system_type get_uv_system_type(void);
12extern int is_uv_system(void); 12extern int is_uv_system(void);
13extern void uv_cpu_init(void); 13extern void uv_cpu_init(void);
14extern void uv_nmi_init(void);
14extern void uv_system_init(void); 15extern void uv_system_init(void);
15extern const struct cpumask *uv_flush_tlb_others(const struct cpumask *cpumask, 16extern const struct cpumask *uv_flush_tlb_others(const struct cpumask *cpumask,
16 struct mm_struct *mm, 17 struct mm_struct *mm,
diff --git a/arch/x86/include/asm/uv/uv_hub.h b/arch/x86/include/asm/uv/uv_hub.h
index 40be813fefb1..14cc74ba5d23 100644
--- a/arch/x86/include/asm/uv/uv_hub.h
+++ b/arch/x86/include/asm/uv/uv_hub.h
@@ -329,7 +329,8 @@ static inline unsigned long uv_read_global_mmr64(int pnode, unsigned long offset
329 */ 329 */
330static inline unsigned long uv_global_gru_mmr_address(int pnode, unsigned long offset) 330static inline unsigned long uv_global_gru_mmr_address(int pnode, unsigned long offset)
331{ 331{
332 return UV_GLOBAL_GRU_MMR_BASE | offset | (pnode << uv_hub_info->m_val); 332 return UV_GLOBAL_GRU_MMR_BASE | offset |
333 ((unsigned long)pnode << uv_hub_info->m_val);
333} 334}
334 335
335static inline void uv_write_global_mmr8(int pnode, unsigned long offset, unsigned char val) 336static inline void uv_write_global_mmr8(int pnode, unsigned long offset, unsigned char val)
diff --git a/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_init.h
index ea0e8ea15e15..60cc35269083 100644
--- a/arch/x86/include/asm/x86_init.h
+++ b/arch/x86/include/asm/x86_init.h
@@ -126,6 +126,7 @@ struct x86_cpuinit_ops {
126 * @get_wallclock: get time from HW clock like RTC etc. 126 * @get_wallclock: get time from HW clock like RTC etc.
127 * @set_wallclock: set time back to HW clock 127 * @set_wallclock: set time back to HW clock
128 * @is_untracked_pat_range exclude from PAT logic 128 * @is_untracked_pat_range exclude from PAT logic
129 * @nmi_init enable NMI on cpus
129 */ 130 */
130struct x86_platform_ops { 131struct x86_platform_ops {
131 unsigned long (*calibrate_tsc)(void); 132 unsigned long (*calibrate_tsc)(void);
@@ -133,6 +134,7 @@ struct x86_platform_ops {
133 int (*set_wallclock)(unsigned long nowtime); 134 int (*set_wallclock)(unsigned long nowtime);
134 void (*iommu_shutdown)(void); 135 void (*iommu_shutdown)(void);
135 bool (*is_untracked_pat_range)(u64 start, u64 end); 136 bool (*is_untracked_pat_range)(u64 start, u64 end);
137 void (*nmi_init)(void);
136}; 138};
137 139
138extern struct x86_init_ops x86_init; 140extern struct x86_init_ops x86_init;
diff --git a/arch/x86/include/asm/xsave.h b/arch/x86/include/asm/xsave.h
index 727acc152344..ddc04ccad03b 100644
--- a/arch/x86/include/asm/xsave.h
+++ b/arch/x86/include/asm/xsave.h
@@ -27,9 +27,11 @@
27extern unsigned int xstate_size; 27extern unsigned int xstate_size;
28extern u64 pcntxt_mask; 28extern u64 pcntxt_mask;
29extern struct xsave_struct *init_xstate_buf; 29extern struct xsave_struct *init_xstate_buf;
30extern u64 xstate_fx_sw_bytes[USER_XSTATE_FX_SW_WORDS];
30 31
31extern void xsave_cntxt_init(void); 32extern void xsave_cntxt_init(void);
32extern void xsave_init(void); 33extern void xsave_init(void);
34extern void update_regset_xstate_info(unsigned int size, u64 xstate_mask);
33extern int init_fpu(struct task_struct *child); 35extern int init_fpu(struct task_struct *child);
34extern int check_for_xstate(struct i387_fxsave_struct __user *buf, 36extern int check_for_xstate(struct i387_fxsave_struct __user *buf,
35 void __user *fpstate, 37 void __user *fpstate,
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
index 0acbcdfa5ca4..f95703098f8d 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -49,6 +49,7 @@ EXPORT_SYMBOL(acpi_disabled);
49 49
50#ifdef CONFIG_X86_64 50#ifdef CONFIG_X86_64
51# include <asm/proto.h> 51# include <asm/proto.h>
52# include <asm/numa_64.h>
52#endif /* X86 */ 53#endif /* X86 */
53 54
54#define BAD_MADT_ENTRY(entry, end) ( \ 55#define BAD_MADT_ENTRY(entry, end) ( \
@@ -482,6 +483,25 @@ int acpi_register_gsi(struct device *dev, u32 gsi, int trigger, int polarity)
482 */ 483 */
483#ifdef CONFIG_ACPI_HOTPLUG_CPU 484#ifdef CONFIG_ACPI_HOTPLUG_CPU
484 485
486static void acpi_map_cpu2node(acpi_handle handle, int cpu, int physid)
487{
488#ifdef CONFIG_ACPI_NUMA
489 int nid;
490
491 nid = acpi_get_node(handle);
492 if (nid == -1 || !node_online(nid))
493 return;
494#ifdef CONFIG_X86_64
495 apicid_to_node[physid] = nid;
496 numa_set_node(cpu, nid);
497#else /* CONFIG_X86_32 */
498 apicid_2_node[physid] = nid;
499 cpu_to_node_map[cpu] = nid;
500#endif
501
502#endif
503}
504
485static int __cpuinit _acpi_map_lsapic(acpi_handle handle, int *pcpu) 505static int __cpuinit _acpi_map_lsapic(acpi_handle handle, int *pcpu)
486{ 506{
487 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; 507 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
@@ -540,6 +560,7 @@ static int __cpuinit _acpi_map_lsapic(acpi_handle handle, int *pcpu)
540 } 560 }
541 561
542 cpu = cpumask_first(new_map); 562 cpu = cpumask_first(new_map);
563 acpi_map_cpu2node(handle, cpu, physid);
543 564
544 *pcpu = cpu; 565 *pcpu = cpu;
545 retval = 0; 566 retval = 0;
@@ -1344,14 +1365,6 @@ static struct dmi_system_id __initdata acpi_dmi_table[] = {
1344 }, 1365 },
1345 { 1366 {
1346 .callback = force_acpi_ht, 1367 .callback = force_acpi_ht,
1347 .ident = "ASUS P2B-DS",
1348 .matches = {
1349 DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
1350 DMI_MATCH(DMI_BOARD_NAME, "P2B-DS"),
1351 },
1352 },
1353 {
1354 .callback = force_acpi_ht,
1355 .ident = "ASUS CUR-DLS", 1368 .ident = "ASUS CUR-DLS",
1356 .matches = { 1369 .matches = {
1357 DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."), 1370 DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c
index de7353c0ce9c..e6ea0342c8f8 100644
--- a/arch/x86/kernel/alternative.c
+++ b/arch/x86/kernel/alternative.c
@@ -205,7 +205,7 @@ void __init_or_module apply_alternatives(struct alt_instr *start,
205 struct alt_instr *end) 205 struct alt_instr *end)
206{ 206{
207 struct alt_instr *a; 207 struct alt_instr *a;
208 char insnbuf[MAX_PATCH_LEN]; 208 u8 insnbuf[MAX_PATCH_LEN];
209 209
210 DPRINTK("%s: alt table %p -> %p\n", __func__, start, end); 210 DPRINTK("%s: alt table %p -> %p\n", __func__, start, end);
211 for (a = start; a < end; a++) { 211 for (a = start; a < end; a++) {
@@ -223,6 +223,8 @@ void __init_or_module apply_alternatives(struct alt_instr *start,
223 } 223 }
224#endif 224#endif
225 memcpy(insnbuf, a->replacement, a->replacementlen); 225 memcpy(insnbuf, a->replacement, a->replacementlen);
226 if (*insnbuf == 0xe8 && a->replacementlen == 5)
227 *(s32 *)(insnbuf + 1) += a->replacement - a->instr;
226 add_nops(insnbuf + a->replacementlen, 228 add_nops(insnbuf + a->replacementlen,
227 a->instrlen - a->replacementlen); 229 a->instrlen - a->replacementlen);
228 text_poke_early(instr, insnbuf, a->instrlen); 230 text_poke_early(instr, insnbuf, a->instrlen);
@@ -390,6 +392,24 @@ void alternatives_smp_switch(int smp)
390 mutex_unlock(&smp_alt); 392 mutex_unlock(&smp_alt);
391} 393}
392 394
395/* Return 1 if the address range is reserved for smp-alternatives */
396int alternatives_text_reserved(void *start, void *end)
397{
398 struct smp_alt_module *mod;
399 u8 **ptr;
400 u8 *text_start = start;
401 u8 *text_end = end;
402
403 list_for_each_entry(mod, &smp_alt_modules, next) {
404 if (mod->text > text_end || mod->text_end < text_start)
405 continue;
406 for (ptr = mod->locks; ptr < mod->locks_end; ptr++)
407 if (text_start <= *ptr && text_end >= *ptr)
408 return 1;
409 }
410
411 return 0;
412}
393#endif 413#endif
394 414
395#ifdef CONFIG_PARAVIRT 415#ifdef CONFIG_PARAVIRT
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index dfca210f6a10..6e29b2a77aa8 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -581,7 +581,7 @@ calibrate_by_pmtimer(long deltapm, long *delta, long *deltatsc)
581 res = (((u64)(*deltatsc)) * pm_100ms); 581 res = (((u64)(*deltatsc)) * pm_100ms);
582 do_div(res, deltapm); 582 do_div(res, deltapm);
583 apic_printk(APIC_VERBOSE, "TSC delta adjusted to " 583 apic_printk(APIC_VERBOSE, "TSC delta adjusted to "
584 "PM-Timer: %lu (%ld) \n", 584 "PM-Timer: %lu (%ld)\n",
585 (unsigned long)res, *deltatsc); 585 (unsigned long)res, *deltatsc);
586 *deltatsc = (long)res; 586 *deltatsc = (long)res;
587 } 587 }
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index 53243ca7816d..6bdd2c7ead75 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -1647,7 +1647,7 @@ __apicdebuginit(void) print_IO_APIC(void)
1647 printk(KERN_DEBUG ".... IRQ redirection table:\n"); 1647 printk(KERN_DEBUG ".... IRQ redirection table:\n");
1648 1648
1649 printk(KERN_DEBUG " NR Dst Mask Trig IRR Pol" 1649 printk(KERN_DEBUG " NR Dst Mask Trig IRR Pol"
1650 " Stat Dmod Deli Vect: \n"); 1650 " Stat Dmod Deli Vect:\n");
1651 1651
1652 for (i = 0; i <= reg_01.bits.entries; i++) { 1652 for (i = 0; i <= reg_01.bits.entries; i++) {
1653 struct IO_APIC_route_entry entry; 1653 struct IO_APIC_route_entry entry;
diff --git a/arch/x86/kernel/apic/numaq_32.c b/arch/x86/kernel/apic/numaq_32.c
index 98c4665f251c..47dd856708e5 100644
--- a/arch/x86/kernel/apic/numaq_32.c
+++ b/arch/x86/kernel/apic/numaq_32.c
@@ -225,7 +225,7 @@ static void __init smp_read_mpc_oem(struct mpc_table *mpc)
225 225
226 mpc_record = 0; 226 mpc_record = 0;
227 printk(KERN_INFO 227 printk(KERN_INFO
228 "Found an OEM MPC table at %8p - parsing it ... \n", oemtable); 228 "Found an OEM MPC table at %8p - parsing it...\n", oemtable);
229 229
230 if (memcmp(oemtable->signature, MPC_OEM_SIGNATURE, 4)) { 230 if (memcmp(oemtable->signature, MPC_OEM_SIGNATURE, 4)) {
231 printk(KERN_WARNING 231 printk(KERN_WARNING
diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c
index 21db3cbea7dc..3740c8a4eae7 100644
--- a/arch/x86/kernel/apic/x2apic_uv_x.c
+++ b/arch/x86/kernel/apic/x2apic_uv_x.c
@@ -5,7 +5,7 @@
5 * 5 *
6 * SGI UV APIC functions (note: not an Intel compatible APIC) 6 * SGI UV APIC functions (note: not an Intel compatible APIC)
7 * 7 *
8 * Copyright (C) 2007-2008 Silicon Graphics, Inc. All rights reserved. 8 * Copyright (C) 2007-2009 Silicon Graphics, Inc. All rights reserved.
9 */ 9 */
10#include <linux/cpumask.h> 10#include <linux/cpumask.h>
11#include <linux/hardirq.h> 11#include <linux/hardirq.h>
@@ -20,6 +20,8 @@
20#include <linux/cpu.h> 20#include <linux/cpu.h>
21#include <linux/init.h> 21#include <linux/init.h>
22#include <linux/io.h> 22#include <linux/io.h>
23#include <linux/pci.h>
24#include <linux/kdebug.h>
23 25
24#include <asm/uv/uv_mmrs.h> 26#include <asm/uv/uv_mmrs.h>
25#include <asm/uv/uv_hub.h> 27#include <asm/uv/uv_hub.h>
@@ -34,10 +36,13 @@
34 36
35DEFINE_PER_CPU(int, x2apic_extra_bits); 37DEFINE_PER_CPU(int, x2apic_extra_bits);
36 38
39#define PR_DEVEL(fmt, args...) pr_devel("%s: " fmt, __func__, args)
40
37static enum uv_system_type uv_system_type; 41static enum uv_system_type uv_system_type;
38static u64 gru_start_paddr, gru_end_paddr; 42static u64 gru_start_paddr, gru_end_paddr;
39int uv_min_hub_revision_id; 43int uv_min_hub_revision_id;
40EXPORT_SYMBOL_GPL(uv_min_hub_revision_id); 44EXPORT_SYMBOL_GPL(uv_min_hub_revision_id);
45static DEFINE_SPINLOCK(uv_nmi_lock);
41 46
42static inline bool is_GRU_range(u64 start, u64 end) 47static inline bool is_GRU_range(u64 start, u64 end)
43{ 48{
@@ -71,6 +76,7 @@ static int __init uv_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
71 if (!strcmp(oem_id, "SGI")) { 76 if (!strcmp(oem_id, "SGI")) {
72 nodeid = early_get_nodeid(); 77 nodeid = early_get_nodeid();
73 x86_platform.is_untracked_pat_range = uv_is_untracked_pat_range; 78 x86_platform.is_untracked_pat_range = uv_is_untracked_pat_range;
79 x86_platform.nmi_init = uv_nmi_init;
74 if (!strcmp(oem_table_id, "UVL")) 80 if (!strcmp(oem_table_id, "UVL"))
75 uv_system_type = UV_LEGACY_APIC; 81 uv_system_type = UV_LEGACY_APIC;
76 else if (!strcmp(oem_table_id, "UVX")) 82 else if (!strcmp(oem_table_id, "UVX"))
@@ -482,7 +488,7 @@ static void uv_heartbeat(unsigned long ignored)
482 488
483static void __cpuinit uv_heartbeat_enable(int cpu) 489static void __cpuinit uv_heartbeat_enable(int cpu)
484{ 490{
485 if (!uv_cpu_hub_info(cpu)->scir.enabled) { 491 while (!uv_cpu_hub_info(cpu)->scir.enabled) {
486 struct timer_list *timer = &uv_cpu_hub_info(cpu)->scir.timer; 492 struct timer_list *timer = &uv_cpu_hub_info(cpu)->scir.timer;
487 493
488 uv_set_cpu_scir_bits(cpu, SCIR_CPU_HEARTBEAT|SCIR_CPU_ACTIVITY); 494 uv_set_cpu_scir_bits(cpu, SCIR_CPU_HEARTBEAT|SCIR_CPU_ACTIVITY);
@@ -490,11 +496,10 @@ static void __cpuinit uv_heartbeat_enable(int cpu)
490 timer->expires = jiffies + SCIR_CPU_HB_INTERVAL; 496 timer->expires = jiffies + SCIR_CPU_HB_INTERVAL;
491 add_timer_on(timer, cpu); 497 add_timer_on(timer, cpu);
492 uv_cpu_hub_info(cpu)->scir.enabled = 1; 498 uv_cpu_hub_info(cpu)->scir.enabled = 1;
493 }
494 499
495 /* check boot cpu */ 500 /* also ensure that boot cpu is enabled */
496 if (!uv_cpu_hub_info(0)->scir.enabled) 501 cpu = 0;
497 uv_heartbeat_enable(0); 502 }
498} 503}
499 504
500#ifdef CONFIG_HOTPLUG_CPU 505#ifdef CONFIG_HOTPLUG_CPU
@@ -553,6 +558,30 @@ late_initcall(uv_init_heartbeat);
553 558
554#endif /* !CONFIG_HOTPLUG_CPU */ 559#endif /* !CONFIG_HOTPLUG_CPU */
555 560
561/* Direct Legacy VGA I/O traffic to designated IOH */
562int uv_set_vga_state(struct pci_dev *pdev, bool decode,
563 unsigned int command_bits, bool change_bridge)
564{
565 int domain, bus, rc;
566
567 PR_DEVEL("devfn %x decode %d cmd %x chg_brdg %d\n",
568 pdev->devfn, decode, command_bits, change_bridge);
569
570 if (!change_bridge)
571 return 0;
572
573 if ((command_bits & PCI_COMMAND_IO) == 0)
574 return 0;
575
576 domain = pci_domain_nr(pdev->bus);
577 bus = pdev->bus->number;
578
579 rc = uv_bios_set_legacy_vga_target(decode, domain, bus);
580 PR_DEVEL("vga decode %d %x:%x, rc: %d\n", decode, domain, bus, rc);
581
582 return rc;
583}
584
556/* 585/*
557 * Called on each cpu to initialize the per_cpu UV data area. 586 * Called on each cpu to initialize the per_cpu UV data area.
558 * FIXME: hotplug not supported yet 587 * FIXME: hotplug not supported yet
@@ -569,6 +598,46 @@ void __cpuinit uv_cpu_init(void)
569 set_x2apic_extra_bits(uv_hub_info->pnode); 598 set_x2apic_extra_bits(uv_hub_info->pnode);
570} 599}
571 600
601/*
602 * When NMI is received, print a stack trace.
603 */
604int uv_handle_nmi(struct notifier_block *self, unsigned long reason, void *data)
605{
606 if (reason != DIE_NMI_IPI)
607 return NOTIFY_OK;
608 /*
609 * Use a lock so only one cpu prints at a time
610 * to prevent intermixed output.
611 */
612 spin_lock(&uv_nmi_lock);
613 pr_info("NMI stack dump cpu %u:\n", smp_processor_id());
614 dump_stack();
615 spin_unlock(&uv_nmi_lock);
616
617 return NOTIFY_STOP;
618}
619
620static struct notifier_block uv_dump_stack_nmi_nb = {
621 .notifier_call = uv_handle_nmi
622};
623
624void uv_register_nmi_notifier(void)
625{
626 if (register_die_notifier(&uv_dump_stack_nmi_nb))
627 printk(KERN_WARNING "UV NMI handler failed to register\n");
628}
629
630void uv_nmi_init(void)
631{
632 unsigned int value;
633
634 /*
635 * Unmask NMI on all cpus
636 */
637 value = apic_read(APIC_LVT1) | APIC_DM_NMI;
638 value &= ~APIC_LVT_MASKED;
639 apic_write(APIC_LVT1, value);
640}
572 641
573void __init uv_system_init(void) 642void __init uv_system_init(void)
574{ 643{
@@ -634,8 +703,8 @@ void __init uv_system_init(void)
634 } 703 }
635 704
636 uv_bios_init(); 705 uv_bios_init();
637 uv_bios_get_sn_info(0, &uv_type, &sn_partition_id, 706 uv_bios_get_sn_info(0, &uv_type, &sn_partition_id, &sn_coherency_id,
638 &sn_coherency_id, &sn_region_size); 707 &sn_region_size, &system_serial_number);
639 uv_rtc_init(); 708 uv_rtc_init();
640 709
641 for_each_present_cpu(cpu) { 710 for_each_present_cpu(cpu) {
@@ -690,5 +759,9 @@ void __init uv_system_init(void)
690 759
691 uv_cpu_init(); 760 uv_cpu_init();
692 uv_scir_register_cpu_notifier(); 761 uv_scir_register_cpu_notifier();
762 uv_register_nmi_notifier();
693 proc_mkdir("sgi_uv", NULL); 763 proc_mkdir("sgi_uv", NULL);
764
765 /* register Legacy VGA I/O redirection handler */
766 pci_register_set_vga_state(uv_set_vga_state);
694} 767}
diff --git a/arch/x86/kernel/apm_32.c b/arch/x86/kernel/apm_32.c
index b5b6b23bce53..031aa887b0eb 100644
--- a/arch/x86/kernel/apm_32.c
+++ b/arch/x86/kernel/apm_32.c
@@ -1992,8 +1992,8 @@ static int __init apm_is_horked_d850md(const struct dmi_system_id *d)
1992 apm_info.disabled = 1; 1992 apm_info.disabled = 1;
1993 printk(KERN_INFO "%s machine detected. " 1993 printk(KERN_INFO "%s machine detected. "
1994 "Disabling APM.\n", d->ident); 1994 "Disabling APM.\n", d->ident);
1995 printk(KERN_INFO "This bug is fixed in bios P15 which is available for \n"); 1995 printk(KERN_INFO "This bug is fixed in bios P15 which is available for\n");
1996 printk(KERN_INFO "download from support.intel.com \n"); 1996 printk(KERN_INFO "download from support.intel.com\n");
1997 } 1997 }
1998 return 0; 1998 return 0;
1999} 1999}
diff --git a/arch/x86/kernel/bios_uv.c b/arch/x86/kernel/bios_uv.c
index b0206a211b09..8bc57baaa9ad 100644
--- a/arch/x86/kernel/bios_uv.c
+++ b/arch/x86/kernel/bios_uv.c
@@ -15,8 +15,8 @@
15 * along with this program; if not, write to the Free Software 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 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 * 17 *
18 * Copyright (c) 2008 Silicon Graphics, Inc. All Rights Reserved. 18 * Copyright (c) 2008-2009 Silicon Graphics, Inc. All Rights Reserved.
19 * Copyright (c) Russ Anderson 19 * Copyright (c) Russ Anderson <rja@sgi.com>
20 */ 20 */
21 21
22#include <linux/efi.h> 22#include <linux/efi.h>
@@ -30,6 +30,7 @@ static struct uv_systab uv_systab;
30s64 uv_bios_call(enum uv_bios_cmd which, u64 a1, u64 a2, u64 a3, u64 a4, u64 a5) 30s64 uv_bios_call(enum uv_bios_cmd which, u64 a1, u64 a2, u64 a3, u64 a4, u64 a5)
31{ 31{
32 struct uv_systab *tab = &uv_systab; 32 struct uv_systab *tab = &uv_systab;
33 s64 ret;
33 34
34 if (!tab->function) 35 if (!tab->function)
35 /* 36 /*
@@ -37,9 +38,11 @@ s64 uv_bios_call(enum uv_bios_cmd which, u64 a1, u64 a2, u64 a3, u64 a4, u64 a5)
37 */ 38 */
38 return BIOS_STATUS_UNIMPLEMENTED; 39 return BIOS_STATUS_UNIMPLEMENTED;
39 40
40 return efi_call6((void *)__va(tab->function), 41 ret = efi_call6((void *)__va(tab->function), (u64)which,
41 (u64)which, a1, a2, a3, a4, a5); 42 a1, a2, a3, a4, a5);
43 return ret;
42} 44}
45EXPORT_SYMBOL_GPL(uv_bios_call);
43 46
44s64 uv_bios_call_irqsave(enum uv_bios_cmd which, u64 a1, u64 a2, u64 a3, 47s64 uv_bios_call_irqsave(enum uv_bios_cmd which, u64 a1, u64 a2, u64 a3,
45 u64 a4, u64 a5) 48 u64 a4, u64 a5)
@@ -73,11 +76,14 @@ long sn_coherency_id;
73EXPORT_SYMBOL_GPL(sn_coherency_id); 76EXPORT_SYMBOL_GPL(sn_coherency_id);
74long sn_region_size; 77long sn_region_size;
75EXPORT_SYMBOL_GPL(sn_region_size); 78EXPORT_SYMBOL_GPL(sn_region_size);
79long system_serial_number;
80EXPORT_SYMBOL_GPL(system_serial_number);
76int uv_type; 81int uv_type;
82EXPORT_SYMBOL_GPL(uv_type);
77 83
78 84
79s64 uv_bios_get_sn_info(int fc, int *uvtype, long *partid, long *coher, 85s64 uv_bios_get_sn_info(int fc, int *uvtype, long *partid, long *coher,
80 long *region) 86 long *region, long *ssn)
81{ 87{
82 s64 ret; 88 s64 ret;
83 u64 v0, v1; 89 u64 v0, v1;
@@ -97,8 +103,11 @@ s64 uv_bios_get_sn_info(int fc, int *uvtype, long *partid, long *coher,
97 *coher = part.coherence_id; 103 *coher = part.coherence_id;
98 if (region) 104 if (region)
99 *region = part.region_size; 105 *region = part.region_size;
106 if (ssn)
107 *ssn = v1;
100 return ret; 108 return ret;
101} 109}
110EXPORT_SYMBOL_GPL(uv_bios_get_sn_info);
102 111
103int 112int
104uv_bios_mq_watchlist_alloc(unsigned long addr, unsigned int mq_size, 113uv_bios_mq_watchlist_alloc(unsigned long addr, unsigned int mq_size,
@@ -154,6 +163,25 @@ s64 uv_bios_freq_base(u64 clock_type, u64 *ticks_per_second)
154} 163}
155EXPORT_SYMBOL_GPL(uv_bios_freq_base); 164EXPORT_SYMBOL_GPL(uv_bios_freq_base);
156 165
166/*
167 * uv_bios_set_legacy_vga_target - Set Legacy VGA I/O Target
168 * @decode: true to enable target, false to disable target
169 * @domain: PCI domain number
170 * @bus: PCI bus number
171 *
172 * Returns:
173 * 0: Success
174 * -EINVAL: Invalid domain or bus number
175 * -ENOSYS: Capability not available
176 * -EBUSY: Legacy VGA I/O cannot be retargeted at this time
177 */
178int uv_bios_set_legacy_vga_target(bool decode, int domain, int bus)
179{
180 return uv_bios_call(UV_BIOS_SET_LEGACY_VGA_TARGET,
181 (u64)decode, (u64)domain, (u64)bus, 0, 0);
182}
183EXPORT_SYMBOL_GPL(uv_bios_set_legacy_vga_target);
184
157 185
158#ifdef CONFIG_EFI 186#ifdef CONFIG_EFI
159void uv_bios_init(void) 187void uv_bios_init(void)
@@ -185,4 +213,3 @@ void uv_bios_init(void)
185 213
186void uv_bios_init(void) { } 214void uv_bios_init(void) { }
187#endif 215#endif
188
diff --git a/arch/x86/kernel/cpu/addon_cpuid_features.c b/arch/x86/kernel/cpu/addon_cpuid_features.c
index 468489b57aae..97ad79cdf688 100644
--- a/arch/x86/kernel/cpu/addon_cpuid_features.c
+++ b/arch/x86/kernel/cpu/addon_cpuid_features.c
@@ -32,6 +32,10 @@ void __cpuinit init_scattered_cpuid_features(struct cpuinfo_x86 *c)
32 static const struct cpuid_bit __cpuinitconst cpuid_bits[] = { 32 static const struct cpuid_bit __cpuinitconst cpuid_bits[] = {
33 { X86_FEATURE_IDA, CR_EAX, 1, 0x00000006 }, 33 { X86_FEATURE_IDA, CR_EAX, 1, 0x00000006 },
34 { X86_FEATURE_ARAT, CR_EAX, 2, 0x00000006 }, 34 { X86_FEATURE_ARAT, CR_EAX, 2, 0x00000006 },
35 { X86_FEATURE_NPT, CR_EDX, 0, 0x8000000a },
36 { X86_FEATURE_LBRV, CR_EDX, 1, 0x8000000a },
37 { X86_FEATURE_SVML, CR_EDX, 2, 0x8000000a },
38 { X86_FEATURE_NRIPS, CR_EDX, 3, 0x8000000a },
35 { 0, 0, 0, 0 } 39 { 0, 0, 0, 0 }
36 }; 40 };
37 41
diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c
index fc6c8ef92dcc..eddb1bdd1b8f 100644
--- a/arch/x86/kernel/cpu/intel_cacheinfo.c
+++ b/arch/x86/kernel/cpu/intel_cacheinfo.c
@@ -18,6 +18,7 @@
18#include <asm/processor.h> 18#include <asm/processor.h>
19#include <linux/smp.h> 19#include <linux/smp.h>
20#include <asm/k8.h> 20#include <asm/k8.h>
21#include <asm/smp.h>
21 22
22#define LVL_1_INST 1 23#define LVL_1_INST 1
23#define LVL_1_DATA 2 24#define LVL_1_DATA 2
@@ -31,6 +32,8 @@ struct _cache_table {
31 short size; 32 short size;
32}; 33};
33 34
35#define MB(x) ((x) * 1024)
36
34/* All the cache descriptor types we care about (no TLB or 37/* All the cache descriptor types we care about (no TLB or
35 trace cache entries) */ 38 trace cache entries) */
36 39
@@ -44,9 +47,9 @@ static const struct _cache_table __cpuinitconst cache_table[] =
44 { 0x0d, LVL_1_DATA, 16 }, /* 4-way set assoc, 64 byte line size */ 47 { 0x0d, LVL_1_DATA, 16 }, /* 4-way set assoc, 64 byte line size */
45 { 0x21, LVL_2, 256 }, /* 8-way set assoc, 64 byte line size */ 48 { 0x21, LVL_2, 256 }, /* 8-way set assoc, 64 byte line size */
46 { 0x22, LVL_3, 512 }, /* 4-way set assoc, sectored cache, 64 byte line size */ 49 { 0x22, LVL_3, 512 }, /* 4-way set assoc, sectored cache, 64 byte line size */
47 { 0x23, LVL_3, 1024 }, /* 8-way set assoc, sectored cache, 64 byte line size */ 50 { 0x23, LVL_3, MB(1) }, /* 8-way set assoc, sectored cache, 64 byte line size */
48 { 0x25, LVL_3, 2048 }, /* 8-way set assoc, sectored cache, 64 byte line size */ 51 { 0x25, LVL_3, MB(2) }, /* 8-way set assoc, sectored cache, 64 byte line size */
49 { 0x29, LVL_3, 4096 }, /* 8-way set assoc, sectored cache, 64 byte line size */ 52 { 0x29, LVL_3, MB(4) }, /* 8-way set assoc, sectored cache, 64 byte line size */
50 { 0x2c, LVL_1_DATA, 32 }, /* 8-way set assoc, 64 byte line size */ 53 { 0x2c, LVL_1_DATA, 32 }, /* 8-way set assoc, 64 byte line size */
51 { 0x30, LVL_1_INST, 32 }, /* 8-way set assoc, 64 byte line size */ 54 { 0x30, LVL_1_INST, 32 }, /* 8-way set assoc, 64 byte line size */
52 { 0x39, LVL_2, 128 }, /* 4-way set assoc, sectored cache, 64 byte line size */ 55 { 0x39, LVL_2, 128 }, /* 4-way set assoc, sectored cache, 64 byte line size */
@@ -59,16 +62,16 @@ static const struct _cache_table __cpuinitconst cache_table[] =
59 { 0x41, LVL_2, 128 }, /* 4-way set assoc, 32 byte line size */ 62 { 0x41, LVL_2, 128 }, /* 4-way set assoc, 32 byte line size */
60 { 0x42, LVL_2, 256 }, /* 4-way set assoc, 32 byte line size */ 63 { 0x42, LVL_2, 256 }, /* 4-way set assoc, 32 byte line size */
61 { 0x43, LVL_2, 512 }, /* 4-way set assoc, 32 byte line size */ 64 { 0x43, LVL_2, 512 }, /* 4-way set assoc, 32 byte line size */
62 { 0x44, LVL_2, 1024 }, /* 4-way set assoc, 32 byte line size */ 65 { 0x44, LVL_2, MB(1) }, /* 4-way set assoc, 32 byte line size */
63 { 0x45, LVL_2, 2048 }, /* 4-way set assoc, 32 byte line size */ 66 { 0x45, LVL_2, MB(2) }, /* 4-way set assoc, 32 byte line size */
64 { 0x46, LVL_3, 4096 }, /* 4-way set assoc, 64 byte line size */ 67 { 0x46, LVL_3, MB(4) }, /* 4-way set assoc, 64 byte line size */
65 { 0x47, LVL_3, 8192 }, /* 8-way set assoc, 64 byte line size */ 68 { 0x47, LVL_3, MB(8) }, /* 8-way set assoc, 64 byte line size */
66 { 0x49, LVL_3, 4096 }, /* 16-way set assoc, 64 byte line size */ 69 { 0x49, LVL_3, MB(4) }, /* 16-way set assoc, 64 byte line size */
67 { 0x4a, LVL_3, 6144 }, /* 12-way set assoc, 64 byte line size */ 70 { 0x4a, LVL_3, MB(6) }, /* 12-way set assoc, 64 byte line size */
68 { 0x4b, LVL_3, 8192 }, /* 16-way set assoc, 64 byte line size */ 71 { 0x4b, LVL_3, MB(8) }, /* 16-way set assoc, 64 byte line size */
69 { 0x4c, LVL_3, 12288 }, /* 12-way set assoc, 64 byte line size */ 72 { 0x4c, LVL_3, MB(12) }, /* 12-way set assoc, 64 byte line size */
70 { 0x4d, LVL_3, 16384 }, /* 16-way set assoc, 64 byte line size */ 73 { 0x4d, LVL_3, MB(16) }, /* 16-way set assoc, 64 byte line size */
71 { 0x4e, LVL_2, 6144 }, /* 24-way set assoc, 64 byte line size */ 74 { 0x4e, LVL_2, MB(6) }, /* 24-way set assoc, 64 byte line size */
72 { 0x60, LVL_1_DATA, 16 }, /* 8-way set assoc, sectored cache, 64 byte line size */ 75 { 0x60, LVL_1_DATA, 16 }, /* 8-way set assoc, sectored cache, 64 byte line size */
73 { 0x66, LVL_1_DATA, 8 }, /* 4-way set assoc, sectored cache, 64 byte line size */ 76 { 0x66, LVL_1_DATA, 8 }, /* 4-way set assoc, sectored cache, 64 byte line size */
74 { 0x67, LVL_1_DATA, 16 }, /* 4-way set assoc, sectored cache, 64 byte line size */ 77 { 0x67, LVL_1_DATA, 16 }, /* 4-way set assoc, sectored cache, 64 byte line size */
@@ -77,34 +80,34 @@ static const struct _cache_table __cpuinitconst cache_table[] =
77 { 0x71, LVL_TRACE, 16 }, /* 8-way set assoc */ 80 { 0x71, LVL_TRACE, 16 }, /* 8-way set assoc */
78 { 0x72, LVL_TRACE, 32 }, /* 8-way set assoc */ 81 { 0x72, LVL_TRACE, 32 }, /* 8-way set assoc */
79 { 0x73, LVL_TRACE, 64 }, /* 8-way set assoc */ 82 { 0x73, LVL_TRACE, 64 }, /* 8-way set assoc */
80 { 0x78, LVL_2, 1024 }, /* 4-way set assoc, 64 byte line size */ 83 { 0x78, LVL_2, MB(1) }, /* 4-way set assoc, 64 byte line size */
81 { 0x79, LVL_2, 128 }, /* 8-way set assoc, sectored cache, 64 byte line size */ 84 { 0x79, LVL_2, 128 }, /* 8-way set assoc, sectored cache, 64 byte line size */
82 { 0x7a, LVL_2, 256 }, /* 8-way set assoc, sectored cache, 64 byte line size */ 85 { 0x7a, LVL_2, 256 }, /* 8-way set assoc, sectored cache, 64 byte line size */
83 { 0x7b, LVL_2, 512 }, /* 8-way set assoc, sectored cache, 64 byte line size */ 86 { 0x7b, LVL_2, 512 }, /* 8-way set assoc, sectored cache, 64 byte line size */
84 { 0x7c, LVL_2, 1024 }, /* 8-way set assoc, sectored cache, 64 byte line size */ 87 { 0x7c, LVL_2, MB(1) }, /* 8-way set assoc, sectored cache, 64 byte line size */
85 { 0x7d, LVL_2, 2048 }, /* 8-way set assoc, 64 byte line size */ 88 { 0x7d, LVL_2, MB(2) }, /* 8-way set assoc, 64 byte line size */
86 { 0x7f, LVL_2, 512 }, /* 2-way set assoc, 64 byte line size */ 89 { 0x7f, LVL_2, 512 }, /* 2-way set assoc, 64 byte line size */
87 { 0x82, LVL_2, 256 }, /* 8-way set assoc, 32 byte line size */ 90 { 0x82, LVL_2, 256 }, /* 8-way set assoc, 32 byte line size */
88 { 0x83, LVL_2, 512 }, /* 8-way set assoc, 32 byte line size */ 91 { 0x83, LVL_2, 512 }, /* 8-way set assoc, 32 byte line size */
89 { 0x84, LVL_2, 1024 }, /* 8-way set assoc, 32 byte line size */ 92 { 0x84, LVL_2, MB(1) }, /* 8-way set assoc, 32 byte line size */
90 { 0x85, LVL_2, 2048 }, /* 8-way set assoc, 32 byte line size */ 93 { 0x85, LVL_2, MB(2) }, /* 8-way set assoc, 32 byte line size */
91 { 0x86, LVL_2, 512 }, /* 4-way set assoc, 64 byte line size */ 94 { 0x86, LVL_2, 512 }, /* 4-way set assoc, 64 byte line size */
92 { 0x87, LVL_2, 1024 }, /* 8-way set assoc, 64 byte line size */ 95 { 0x87, LVL_2, MB(1) }, /* 8-way set assoc, 64 byte line size */
93 { 0xd0, LVL_3, 512 }, /* 4-way set assoc, 64 byte line size */ 96 { 0xd0, LVL_3, 512 }, /* 4-way set assoc, 64 byte line size */
94 { 0xd1, LVL_3, 1024 }, /* 4-way set assoc, 64 byte line size */ 97 { 0xd1, LVL_3, MB(1) }, /* 4-way set assoc, 64 byte line size */
95 { 0xd2, LVL_3, 2048 }, /* 4-way set assoc, 64 byte line size */ 98 { 0xd2, LVL_3, MB(2) }, /* 4-way set assoc, 64 byte line size */
96 { 0xd6, LVL_3, 1024 }, /* 8-way set assoc, 64 byte line size */ 99 { 0xd6, LVL_3, MB(1) }, /* 8-way set assoc, 64 byte line size */
97 { 0xd7, LVL_3, 2048 }, /* 8-way set assoc, 64 byte line size */ 100 { 0xd7, LVL_3, MB(2) }, /* 8-way set assoc, 64 byte line size */
98 { 0xd8, LVL_3, 4096 }, /* 12-way set assoc, 64 byte line size */ 101 { 0xd8, LVL_3, MB(4) }, /* 12-way set assoc, 64 byte line size */
99 { 0xdc, LVL_3, 2048 }, /* 12-way set assoc, 64 byte line size */ 102 { 0xdc, LVL_3, MB(2) }, /* 12-way set assoc, 64 byte line size */
100 { 0xdd, LVL_3, 4096 }, /* 12-way set assoc, 64 byte line size */ 103 { 0xdd, LVL_3, MB(4) }, /* 12-way set assoc, 64 byte line size */
101 { 0xde, LVL_3, 8192 }, /* 12-way set assoc, 64 byte line size */ 104 { 0xde, LVL_3, MB(8) }, /* 12-way set assoc, 64 byte line size */
102 { 0xe2, LVL_3, 2048 }, /* 16-way set assoc, 64 byte line size */ 105 { 0xe2, LVL_3, MB(2) }, /* 16-way set assoc, 64 byte line size */
103 { 0xe3, LVL_3, 4096 }, /* 16-way set assoc, 64 byte line size */ 106 { 0xe3, LVL_3, MB(4) }, /* 16-way set assoc, 64 byte line size */
104 { 0xe4, LVL_3, 8192 }, /* 16-way set assoc, 64 byte line size */ 107 { 0xe4, LVL_3, MB(8) }, /* 16-way set assoc, 64 byte line size */
105 { 0xea, LVL_3, 12288 }, /* 24-way set assoc, 64 byte line size */ 108 { 0xea, LVL_3, MB(12) }, /* 24-way set assoc, 64 byte line size */
106 { 0xeb, LVL_3, 18432 }, /* 24-way set assoc, 64 byte line size */ 109 { 0xeb, LVL_3, MB(18) }, /* 24-way set assoc, 64 byte line size */
107 { 0xec, LVL_3, 24576 }, /* 24-way set assoc, 64 byte line size */ 110 { 0xec, LVL_3, MB(24) }, /* 24-way set assoc, 64 byte line size */
108 { 0x00, 0, 0} 111 { 0x00, 0, 0}
109}; 112};
110 113
@@ -150,7 +153,8 @@ struct _cpuid4_info {
150 union _cpuid4_leaf_ebx ebx; 153 union _cpuid4_leaf_ebx ebx;
151 union _cpuid4_leaf_ecx ecx; 154 union _cpuid4_leaf_ecx ecx;
152 unsigned long size; 155 unsigned long size;
153 unsigned long can_disable; 156 bool can_disable;
157 unsigned int l3_indices;
154 DECLARE_BITMAP(shared_cpu_map, NR_CPUS); 158 DECLARE_BITMAP(shared_cpu_map, NR_CPUS);
155}; 159};
156 160
@@ -160,7 +164,8 @@ struct _cpuid4_info_regs {
160 union _cpuid4_leaf_ebx ebx; 164 union _cpuid4_leaf_ebx ebx;
161 union _cpuid4_leaf_ecx ecx; 165 union _cpuid4_leaf_ecx ecx;
162 unsigned long size; 166 unsigned long size;
163 unsigned long can_disable; 167 bool can_disable;
168 unsigned int l3_indices;
164}; 169};
165 170
166unsigned short num_cache_leaves; 171unsigned short num_cache_leaves;
@@ -290,6 +295,36 @@ amd_cpuid4(int leaf, union _cpuid4_leaf_eax *eax,
290 (ebx->split.ways_of_associativity + 1) - 1; 295 (ebx->split.ways_of_associativity + 1) - 1;
291} 296}
292 297
298struct _cache_attr {
299 struct attribute attr;
300 ssize_t (*show)(struct _cpuid4_info *, char *);
301 ssize_t (*store)(struct _cpuid4_info *, const char *, size_t count);
302};
303
304#ifdef CONFIG_CPU_SUP_AMD
305static unsigned int __cpuinit amd_calc_l3_indices(void)
306{
307 /*
308 * We're called over smp_call_function_single() and therefore
309 * are on the correct cpu.
310 */
311 int cpu = smp_processor_id();
312 int node = cpu_to_node(cpu);
313 struct pci_dev *dev = node_to_k8_nb_misc(node);
314 unsigned int sc0, sc1, sc2, sc3;
315 u32 val = 0;
316
317 pci_read_config_dword(dev, 0x1C4, &val);
318
319 /* calculate subcache sizes */
320 sc0 = !(val & BIT(0));
321 sc1 = !(val & BIT(4));
322 sc2 = !(val & BIT(8)) + !(val & BIT(9));
323 sc3 = !(val & BIT(12)) + !(val & BIT(13));
324
325 return (max(max(max(sc0, sc1), sc2), sc3) << 10) - 1;
326}
327
293static void __cpuinit 328static void __cpuinit
294amd_check_l3_disable(int index, struct _cpuid4_info_regs *this_leaf) 329amd_check_l3_disable(int index, struct _cpuid4_info_regs *this_leaf)
295{ 330{
@@ -299,12 +334,103 @@ amd_check_l3_disable(int index, struct _cpuid4_info_regs *this_leaf)
299 if (boot_cpu_data.x86 == 0x11) 334 if (boot_cpu_data.x86 == 0x11)
300 return; 335 return;
301 336
302 /* see erratum #382 */ 337 /* see errata #382 and #388 */
303 if ((boot_cpu_data.x86 == 0x10) && (boot_cpu_data.x86_model < 0x8)) 338 if ((boot_cpu_data.x86 == 0x10) &&
339 ((boot_cpu_data.x86_model < 0x8) ||
340 (boot_cpu_data.x86_mask < 0x1)))
304 return; 341 return;
305 342
306 this_leaf->can_disable = 1; 343 this_leaf->can_disable = true;
344 this_leaf->l3_indices = amd_calc_l3_indices();
345}
346
347static ssize_t show_cache_disable(struct _cpuid4_info *this_leaf, char *buf,
348 unsigned int index)
349{
350 int cpu = cpumask_first(to_cpumask(this_leaf->shared_cpu_map));
351 int node = amd_get_nb_id(cpu);
352 struct pci_dev *dev = node_to_k8_nb_misc(node);
353 unsigned int reg = 0;
354
355 if (!this_leaf->can_disable)
356 return -EINVAL;
357
358 if (!dev)
359 return -EINVAL;
360
361 pci_read_config_dword(dev, 0x1BC + index * 4, &reg);
362 return sprintf(buf, "0x%08x\n", reg);
363}
364
365#define SHOW_CACHE_DISABLE(index) \
366static ssize_t \
367show_cache_disable_##index(struct _cpuid4_info *this_leaf, char *buf) \
368{ \
369 return show_cache_disable(this_leaf, buf, index); \
307} 370}
371SHOW_CACHE_DISABLE(0)
372SHOW_CACHE_DISABLE(1)
373
374static ssize_t store_cache_disable(struct _cpuid4_info *this_leaf,
375 const char *buf, size_t count, unsigned int index)
376{
377 int cpu = cpumask_first(to_cpumask(this_leaf->shared_cpu_map));
378 int node = amd_get_nb_id(cpu);
379 struct pci_dev *dev = node_to_k8_nb_misc(node);
380 unsigned long val = 0;
381
382#define SUBCACHE_MASK (3UL << 20)
383#define SUBCACHE_INDEX 0xfff
384
385 if (!this_leaf->can_disable)
386 return -EINVAL;
387
388 if (!capable(CAP_SYS_ADMIN))
389 return -EPERM;
390
391 if (!dev)
392 return -EINVAL;
393
394 if (strict_strtoul(buf, 10, &val) < 0)
395 return -EINVAL;
396
397 /* do not allow writes outside of allowed bits */
398 if ((val & ~(SUBCACHE_MASK | SUBCACHE_INDEX)) ||
399 ((val & SUBCACHE_INDEX) > this_leaf->l3_indices))
400 return -EINVAL;
401
402 val |= BIT(30);
403 pci_write_config_dword(dev, 0x1BC + index * 4, val);
404 /*
405 * We need to WBINVD on a core on the node containing the L3 cache which
406 * indices we disable therefore a simple wbinvd() is not sufficient.
407 */
408 wbinvd_on_cpu(cpu);
409 pci_write_config_dword(dev, 0x1BC + index * 4, val | BIT(31));
410 return count;
411}
412
413#define STORE_CACHE_DISABLE(index) \
414static ssize_t \
415store_cache_disable_##index(struct _cpuid4_info *this_leaf, \
416 const char *buf, size_t count) \
417{ \
418 return store_cache_disable(this_leaf, buf, count, index); \
419}
420STORE_CACHE_DISABLE(0)
421STORE_CACHE_DISABLE(1)
422
423static struct _cache_attr cache_disable_0 = __ATTR(cache_disable_0, 0644,
424 show_cache_disable_0, store_cache_disable_0);
425static struct _cache_attr cache_disable_1 = __ATTR(cache_disable_1, 0644,
426 show_cache_disable_1, store_cache_disable_1);
427
428#else /* CONFIG_CPU_SUP_AMD */
429static void __cpuinit
430amd_check_l3_disable(int index, struct _cpuid4_info_regs *this_leaf)
431{
432};
433#endif /* CONFIG_CPU_SUP_AMD */
308 434
309static int 435static int
310__cpuinit cpuid4_cache_lookup_regs(int index, 436__cpuinit cpuid4_cache_lookup_regs(int index,
@@ -711,82 +837,6 @@ static ssize_t show_type(struct _cpuid4_info *this_leaf, char *buf)
711#define to_object(k) container_of(k, struct _index_kobject, kobj) 837#define to_object(k) container_of(k, struct _index_kobject, kobj)
712#define to_attr(a) container_of(a, struct _cache_attr, attr) 838#define to_attr(a) container_of(a, struct _cache_attr, attr)
713 839
714static ssize_t show_cache_disable(struct _cpuid4_info *this_leaf, char *buf,
715 unsigned int index)
716{
717 int cpu = cpumask_first(to_cpumask(this_leaf->shared_cpu_map));
718 int node = cpu_to_node(cpu);
719 struct pci_dev *dev = node_to_k8_nb_misc(node);
720 unsigned int reg = 0;
721
722 if (!this_leaf->can_disable)
723 return -EINVAL;
724
725 if (!dev)
726 return -EINVAL;
727
728 pci_read_config_dword(dev, 0x1BC + index * 4, &reg);
729 return sprintf(buf, "%x\n", reg);
730}
731
732#define SHOW_CACHE_DISABLE(index) \
733static ssize_t \
734show_cache_disable_##index(struct _cpuid4_info *this_leaf, char *buf) \
735{ \
736 return show_cache_disable(this_leaf, buf, index); \
737}
738SHOW_CACHE_DISABLE(0)
739SHOW_CACHE_DISABLE(1)
740
741static ssize_t store_cache_disable(struct _cpuid4_info *this_leaf,
742 const char *buf, size_t count, unsigned int index)
743{
744 int cpu = cpumask_first(to_cpumask(this_leaf->shared_cpu_map));
745 int node = cpu_to_node(cpu);
746 struct pci_dev *dev = node_to_k8_nb_misc(node);
747 unsigned long val = 0;
748 unsigned int scrubber = 0;
749
750 if (!this_leaf->can_disable)
751 return -EINVAL;
752
753 if (!capable(CAP_SYS_ADMIN))
754 return -EPERM;
755
756 if (!dev)
757 return -EINVAL;
758
759 if (strict_strtoul(buf, 10, &val) < 0)
760 return -EINVAL;
761
762 val |= 0xc0000000;
763
764 pci_read_config_dword(dev, 0x58, &scrubber);
765 scrubber &= ~0x1f000000;
766 pci_write_config_dword(dev, 0x58, scrubber);
767
768 pci_write_config_dword(dev, 0x1BC + index * 4, val & ~0x40000000);
769 wbinvd();
770 pci_write_config_dword(dev, 0x1BC + index * 4, val);
771 return count;
772}
773
774#define STORE_CACHE_DISABLE(index) \
775static ssize_t \
776store_cache_disable_##index(struct _cpuid4_info *this_leaf, \
777 const char *buf, size_t count) \
778{ \
779 return store_cache_disable(this_leaf, buf, count, index); \
780}
781STORE_CACHE_DISABLE(0)
782STORE_CACHE_DISABLE(1)
783
784struct _cache_attr {
785 struct attribute attr;
786 ssize_t (*show)(struct _cpuid4_info *, char *);
787 ssize_t (*store)(struct _cpuid4_info *, const char *, size_t count);
788};
789
790#define define_one_ro(_name) \ 840#define define_one_ro(_name) \
791static struct _cache_attr _name = \ 841static struct _cache_attr _name = \
792 __ATTR(_name, 0444, show_##_name, NULL) 842 __ATTR(_name, 0444, show_##_name, NULL)
@@ -801,23 +851,28 @@ define_one_ro(size);
801define_one_ro(shared_cpu_map); 851define_one_ro(shared_cpu_map);
802define_one_ro(shared_cpu_list); 852define_one_ro(shared_cpu_list);
803 853
804static struct _cache_attr cache_disable_0 = __ATTR(cache_disable_0, 0644, 854#define DEFAULT_SYSFS_CACHE_ATTRS \
805 show_cache_disable_0, store_cache_disable_0); 855 &type.attr, \
806static struct _cache_attr cache_disable_1 = __ATTR(cache_disable_1, 0644, 856 &level.attr, \
807 show_cache_disable_1, store_cache_disable_1); 857 &coherency_line_size.attr, \
858 &physical_line_partition.attr, \
859 &ways_of_associativity.attr, \
860 &number_of_sets.attr, \
861 &size.attr, \
862 &shared_cpu_map.attr, \
863 &shared_cpu_list.attr
808 864
809static struct attribute *default_attrs[] = { 865static struct attribute *default_attrs[] = {
810 &type.attr, 866 DEFAULT_SYSFS_CACHE_ATTRS,
811 &level.attr, 867 NULL
812 &coherency_line_size.attr, 868};
813 &physical_line_partition.attr, 869
814 &ways_of_associativity.attr, 870static struct attribute *default_l3_attrs[] = {
815 &number_of_sets.attr, 871 DEFAULT_SYSFS_CACHE_ATTRS,
816 &size.attr, 872#ifdef CONFIG_CPU_SUP_AMD
817 &shared_cpu_map.attr,
818 &shared_cpu_list.attr,
819 &cache_disable_0.attr, 873 &cache_disable_0.attr,
820 &cache_disable_1.attr, 874 &cache_disable_1.attr,
875#endif
821 NULL 876 NULL
822}; 877};
823 878
@@ -908,6 +963,7 @@ static int __cpuinit cache_add_dev(struct sys_device * sys_dev)
908 unsigned int cpu = sys_dev->id; 963 unsigned int cpu = sys_dev->id;
909 unsigned long i, j; 964 unsigned long i, j;
910 struct _index_kobject *this_object; 965 struct _index_kobject *this_object;
966 struct _cpuid4_info *this_leaf;
911 int retval; 967 int retval;
912 968
913 retval = cpuid4_cache_sysfs_init(cpu); 969 retval = cpuid4_cache_sysfs_init(cpu);
@@ -926,6 +982,14 @@ static int __cpuinit cache_add_dev(struct sys_device * sys_dev)
926 this_object = INDEX_KOBJECT_PTR(cpu, i); 982 this_object = INDEX_KOBJECT_PTR(cpu, i);
927 this_object->cpu = cpu; 983 this_object->cpu = cpu;
928 this_object->index = i; 984 this_object->index = i;
985
986 this_leaf = CPUID4_INFO_IDX(cpu, i);
987
988 if (this_leaf->can_disable)
989 ktype_cache.default_attrs = default_l3_attrs;
990 else
991 ktype_cache.default_attrs = default_attrs;
992
929 retval = kobject_init_and_add(&(this_object->kobj), 993 retval = kobject_init_and_add(&(this_object->kobj),
930 &ktype_cache, 994 &ktype_cache,
931 per_cpu(ici_cache_kobject, cpu), 995 per_cpu(ici_cache_kobject, cpu),
diff --git a/arch/x86/kernel/cpu/mtrr/Makefile b/arch/x86/kernel/cpu/mtrr/Makefile
index f4361b56f8e9..ad9e5ed81181 100644
--- a/arch/x86/kernel/cpu/mtrr/Makefile
+++ b/arch/x86/kernel/cpu/mtrr/Makefile
@@ -1,3 +1,3 @@
1obj-y := main.o if.o generic.o state.o cleanup.o 1obj-y := main.o if.o generic.o cleanup.o
2obj-$(CONFIG_X86_32) += amd.o cyrix.o centaur.o 2obj-$(CONFIG_X86_32) += amd.o cyrix.o centaur.o
3 3
diff --git a/arch/x86/kernel/cpu/mtrr/amd.c b/arch/x86/kernel/cpu/mtrr/amd.c
index 33af14110dfd..92ba9cd31c9a 100644
--- a/arch/x86/kernel/cpu/mtrr/amd.c
+++ b/arch/x86/kernel/cpu/mtrr/amd.c
@@ -108,7 +108,7 @@ amd_validate_add_page(unsigned long base, unsigned long size, unsigned int type)
108 return 0; 108 return 0;
109} 109}
110 110
111static struct mtrr_ops amd_mtrr_ops = { 111static const struct mtrr_ops amd_mtrr_ops = {
112 .vendor = X86_VENDOR_AMD, 112 .vendor = X86_VENDOR_AMD,
113 .set = amd_set_mtrr, 113 .set = amd_set_mtrr,
114 .get = amd_get_mtrr, 114 .get = amd_get_mtrr,
diff --git a/arch/x86/kernel/cpu/mtrr/centaur.c b/arch/x86/kernel/cpu/mtrr/centaur.c
index de89f14eff3a..316fe3e60a97 100644
--- a/arch/x86/kernel/cpu/mtrr/centaur.c
+++ b/arch/x86/kernel/cpu/mtrr/centaur.c
@@ -110,7 +110,7 @@ centaur_validate_add_page(unsigned long base, unsigned long size, unsigned int t
110 return 0; 110 return 0;
111} 111}
112 112
113static struct mtrr_ops centaur_mtrr_ops = { 113static const struct mtrr_ops centaur_mtrr_ops = {
114 .vendor = X86_VENDOR_CENTAUR, 114 .vendor = X86_VENDOR_CENTAUR,
115 .set = centaur_set_mcr, 115 .set = centaur_set_mcr,
116 .get = centaur_get_mcr, 116 .get = centaur_get_mcr,
diff --git a/arch/x86/kernel/cpu/mtrr/cyrix.c b/arch/x86/kernel/cpu/mtrr/cyrix.c
index 228d982ce09c..68a3343e5798 100644
--- a/arch/x86/kernel/cpu/mtrr/cyrix.c
+++ b/arch/x86/kernel/cpu/mtrr/cyrix.c
@@ -265,7 +265,7 @@ static void cyrix_set_all(void)
265 post_set(); 265 post_set();
266} 266}
267 267
268static struct mtrr_ops cyrix_mtrr_ops = { 268static const struct mtrr_ops cyrix_mtrr_ops = {
269 .vendor = X86_VENDOR_CYRIX, 269 .vendor = X86_VENDOR_CYRIX,
270 .set_all = cyrix_set_all, 270 .set_all = cyrix_set_all,
271 .set = cyrix_set_arr, 271 .set = cyrix_set_arr,
diff --git a/arch/x86/kernel/cpu/mtrr/generic.c b/arch/x86/kernel/cpu/mtrr/generic.c
index 55da0c5f68dd..9aa5dc76ff4a 100644
--- a/arch/x86/kernel/cpu/mtrr/generic.c
+++ b/arch/x86/kernel/cpu/mtrr/generic.c
@@ -464,7 +464,7 @@ static void generic_get_mtrr(unsigned int reg, unsigned long *base,
464 tmp |= ~((1<<(hi - 1)) - 1); 464 tmp |= ~((1<<(hi - 1)) - 1);
465 465
466 if (tmp != mask_lo) { 466 if (tmp != mask_lo) {
467 WARN_ONCE(1, KERN_INFO "mtrr: your BIOS has set up an incorrect mask, fixing it up.\n"); 467 printk(KERN_WARNING "mtrr: your BIOS has configured an incorrect mask, fixing it.\n");
468 mask_lo = tmp; 468 mask_lo = tmp;
469 } 469 }
470 } 470 }
@@ -570,7 +570,7 @@ static unsigned long set_mtrr_state(void)
570 570
571 571
572static unsigned long cr4; 572static unsigned long cr4;
573static DEFINE_SPINLOCK(set_atomicity_lock); 573static DEFINE_RAW_SPINLOCK(set_atomicity_lock);
574 574
575/* 575/*
576 * Since we are disabling the cache don't allow any interrupts, 576 * Since we are disabling the cache don't allow any interrupts,
@@ -590,7 +590,7 @@ static void prepare_set(void) __acquires(set_atomicity_lock)
590 * changes to the way the kernel boots 590 * changes to the way the kernel boots
591 */ 591 */
592 592
593 spin_lock(&set_atomicity_lock); 593 raw_spin_lock(&set_atomicity_lock);
594 594
595 /* Enter the no-fill (CD=1, NW=0) cache mode and flush caches. */ 595 /* Enter the no-fill (CD=1, NW=0) cache mode and flush caches. */
596 cr0 = read_cr0() | X86_CR0_CD; 596 cr0 = read_cr0() | X86_CR0_CD;
@@ -627,7 +627,7 @@ static void post_set(void) __releases(set_atomicity_lock)
627 /* Restore value of CR4 */ 627 /* Restore value of CR4 */
628 if (cpu_has_pge) 628 if (cpu_has_pge)
629 write_cr4(cr4); 629 write_cr4(cr4);
630 spin_unlock(&set_atomicity_lock); 630 raw_spin_unlock(&set_atomicity_lock);
631} 631}
632 632
633static void generic_set_all(void) 633static void generic_set_all(void)
@@ -752,7 +752,7 @@ int positive_have_wrcomb(void)
752/* 752/*
753 * Generic structure... 753 * Generic structure...
754 */ 754 */
755struct mtrr_ops generic_mtrr_ops = { 755const struct mtrr_ops generic_mtrr_ops = {
756 .use_intel_if = 1, 756 .use_intel_if = 1,
757 .set_all = generic_set_all, 757 .set_all = generic_set_all,
758 .get = generic_get_mtrr, 758 .get = generic_get_mtrr,
diff --git a/arch/x86/kernel/cpu/mtrr/main.c b/arch/x86/kernel/cpu/mtrr/main.c
index 84e83de54575..fe4622e8c837 100644
--- a/arch/x86/kernel/cpu/mtrr/main.c
+++ b/arch/x86/kernel/cpu/mtrr/main.c
@@ -60,14 +60,14 @@ static DEFINE_MUTEX(mtrr_mutex);
60u64 size_or_mask, size_and_mask; 60u64 size_or_mask, size_and_mask;
61static bool mtrr_aps_delayed_init; 61static bool mtrr_aps_delayed_init;
62 62
63static struct mtrr_ops *mtrr_ops[X86_VENDOR_NUM]; 63static const struct mtrr_ops *mtrr_ops[X86_VENDOR_NUM];
64 64
65struct mtrr_ops *mtrr_if; 65const struct mtrr_ops *mtrr_if;
66 66
67static void set_mtrr(unsigned int reg, unsigned long base, 67static void set_mtrr(unsigned int reg, unsigned long base,
68 unsigned long size, mtrr_type type); 68 unsigned long size, mtrr_type type);
69 69
70void set_mtrr_ops(struct mtrr_ops *ops) 70void set_mtrr_ops(const struct mtrr_ops *ops)
71{ 71{
72 if (ops->vendor && ops->vendor < X86_VENDOR_NUM) 72 if (ops->vendor && ops->vendor < X86_VENDOR_NUM)
73 mtrr_ops[ops->vendor] = ops; 73 mtrr_ops[ops->vendor] = ops;
diff --git a/arch/x86/kernel/cpu/mtrr/mtrr.h b/arch/x86/kernel/cpu/mtrr/mtrr.h
index a501dee9a87a..df5e41f31a27 100644
--- a/arch/x86/kernel/cpu/mtrr/mtrr.h
+++ b/arch/x86/kernel/cpu/mtrr/mtrr.h
@@ -32,7 +32,7 @@ extern int generic_get_free_region(unsigned long base, unsigned long size,
32extern int generic_validate_add_page(unsigned long base, unsigned long size, 32extern int generic_validate_add_page(unsigned long base, unsigned long size,
33 unsigned int type); 33 unsigned int type);
34 34
35extern struct mtrr_ops generic_mtrr_ops; 35extern const struct mtrr_ops generic_mtrr_ops;
36 36
37extern int positive_have_wrcomb(void); 37extern int positive_have_wrcomb(void);
38 38
@@ -53,10 +53,10 @@ void fill_mtrr_var_range(unsigned int index,
53 u32 base_lo, u32 base_hi, u32 mask_lo, u32 mask_hi); 53 u32 base_lo, u32 base_hi, u32 mask_lo, u32 mask_hi);
54void get_mtrr_state(void); 54void get_mtrr_state(void);
55 55
56extern void set_mtrr_ops(struct mtrr_ops *ops); 56extern void set_mtrr_ops(const struct mtrr_ops *ops);
57 57
58extern u64 size_or_mask, size_and_mask; 58extern u64 size_or_mask, size_and_mask;
59extern struct mtrr_ops *mtrr_if; 59extern const struct mtrr_ops *mtrr_if;
60 60
61#define is_cpu(vnd) (mtrr_if && mtrr_if->vendor == X86_VENDOR_##vnd) 61#define is_cpu(vnd) (mtrr_if && mtrr_if->vendor == X86_VENDOR_##vnd)
62#define use_intel() (mtrr_if && mtrr_if->use_intel_if == 1) 62#define use_intel() (mtrr_if && mtrr_if->use_intel_if == 1)
diff --git a/arch/x86/kernel/cpu/mtrr/state.c b/arch/x86/kernel/cpu/mtrr/state.c
deleted file mode 100644
index dfc80b4e6b0d..000000000000
--- a/arch/x86/kernel/cpu/mtrr/state.c
+++ /dev/null
@@ -1,94 +0,0 @@
1#include <linux/init.h>
2#include <linux/io.h>
3#include <linux/mm.h>
4
5#include <asm/processor-cyrix.h>
6#include <asm/processor-flags.h>
7#include <asm/mtrr.h>
8#include <asm/msr.h>
9
10#include "mtrr.h"
11
12/* Put the processor into a state where MTRRs can be safely set */
13void set_mtrr_prepare_save(struct set_mtrr_context *ctxt)
14{
15 unsigned int cr0;
16
17 /* Disable interrupts locally */
18 local_irq_save(ctxt->flags);
19
20 if (use_intel() || is_cpu(CYRIX)) {
21
22 /* Save value of CR4 and clear Page Global Enable (bit 7) */
23 if (cpu_has_pge) {
24 ctxt->cr4val = read_cr4();
25 write_cr4(ctxt->cr4val & ~X86_CR4_PGE);
26 }
27
28 /*
29 * Disable and flush caches. Note that wbinvd flushes the TLBs
30 * as a side-effect
31 */
32 cr0 = read_cr0() | X86_CR0_CD;
33 wbinvd();
34 write_cr0(cr0);
35 wbinvd();
36
37 if (use_intel()) {
38 /* Save MTRR state */
39 rdmsr(MSR_MTRRdefType, ctxt->deftype_lo, ctxt->deftype_hi);
40 } else {
41 /*
42 * Cyrix ARRs -
43 * everything else were excluded at the top
44 */
45 ctxt->ccr3 = getCx86(CX86_CCR3);
46 }
47 }
48}
49
50void set_mtrr_cache_disable(struct set_mtrr_context *ctxt)
51{
52 if (use_intel()) {
53 /* Disable MTRRs, and set the default type to uncached */
54 mtrr_wrmsr(MSR_MTRRdefType, ctxt->deftype_lo & 0xf300UL,
55 ctxt->deftype_hi);
56 } else {
57 if (is_cpu(CYRIX)) {
58 /* Cyrix ARRs - everything else were excluded at the top */
59 setCx86(CX86_CCR3, (ctxt->ccr3 & 0x0f) | 0x10);
60 }
61 }
62}
63
64/* Restore the processor after a set_mtrr_prepare */
65void set_mtrr_done(struct set_mtrr_context *ctxt)
66{
67 if (use_intel() || is_cpu(CYRIX)) {
68
69 /* Flush caches and TLBs */
70 wbinvd();
71
72 /* Restore MTRRdefType */
73 if (use_intel()) {
74 /* Intel (P6) standard MTRRs */
75 mtrr_wrmsr(MSR_MTRRdefType, ctxt->deftype_lo,
76 ctxt->deftype_hi);
77 } else {
78 /*
79 * Cyrix ARRs -
80 * everything else was excluded at the top
81 */
82 setCx86(CX86_CCR3, ctxt->ccr3);
83 }
84
85 /* Enable caches */
86 write_cr0(read_cr0() & 0xbfffffff);
87
88 /* Restore value of CR4 */
89 if (cpu_has_pge)
90 write_cr4(ctxt->cr4val);
91 }
92 /* Re-enable interrupts locally (if enabled previously) */
93 local_irq_restore(ctxt->flags);
94}
diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c
index 8c1c07073ccc..641ccb9dddbc 100644
--- a/arch/x86/kernel/cpu/perf_event.c
+++ b/arch/x86/kernel/cpu/perf_event.c
@@ -7,6 +7,7 @@
7 * Copyright (C) 2009 Advanced Micro Devices, Inc., Robert Richter 7 * Copyright (C) 2009 Advanced Micro Devices, Inc., Robert Richter
8 * Copyright (C) 2008-2009 Red Hat, Inc., Peter Zijlstra <pzijlstr@redhat.com> 8 * Copyright (C) 2008-2009 Red Hat, Inc., Peter Zijlstra <pzijlstr@redhat.com>
9 * Copyright (C) 2009 Intel Corporation, <markus.t.metzger@intel.com> 9 * Copyright (C) 2009 Intel Corporation, <markus.t.metzger@intel.com>
10 * Copyright (C) 2009 Google, Inc., Stephane Eranian
10 * 11 *
11 * For licencing details see kernel-base/COPYING 12 * For licencing details see kernel-base/COPYING
12 */ 13 */
@@ -22,6 +23,7 @@
22#include <linux/uaccess.h> 23#include <linux/uaccess.h>
23#include <linux/highmem.h> 24#include <linux/highmem.h>
24#include <linux/cpu.h> 25#include <linux/cpu.h>
26#include <linux/bitops.h>
25 27
26#include <asm/apic.h> 28#include <asm/apic.h>
27#include <asm/stacktrace.h> 29#include <asm/stacktrace.h>
@@ -68,26 +70,59 @@ struct debug_store {
68 u64 pebs_event_reset[MAX_PEBS_EVENTS]; 70 u64 pebs_event_reset[MAX_PEBS_EVENTS];
69}; 71};
70 72
73struct event_constraint {
74 union {
75 unsigned long idxmsk[BITS_TO_LONGS(X86_PMC_IDX_MAX)];
76 u64 idxmsk64[1];
77 };
78 int code;
79 int cmask;
80 int weight;
81};
82
83struct amd_nb {
84 int nb_id; /* NorthBridge id */
85 int refcnt; /* reference count */
86 struct perf_event *owners[X86_PMC_IDX_MAX];
87 struct event_constraint event_constraints[X86_PMC_IDX_MAX];
88};
89
71struct cpu_hw_events { 90struct cpu_hw_events {
72 struct perf_event *events[X86_PMC_IDX_MAX]; 91 struct perf_event *events[X86_PMC_IDX_MAX]; /* in counter order */
73 unsigned long used_mask[BITS_TO_LONGS(X86_PMC_IDX_MAX)];
74 unsigned long active_mask[BITS_TO_LONGS(X86_PMC_IDX_MAX)]; 92 unsigned long active_mask[BITS_TO_LONGS(X86_PMC_IDX_MAX)];
75 unsigned long interrupts; 93 unsigned long interrupts;
76 int enabled; 94 int enabled;
77 struct debug_store *ds; 95 struct debug_store *ds;
78};
79 96
80struct event_constraint { 97 int n_events;
81 unsigned long idxmsk[BITS_TO_LONGS(X86_PMC_IDX_MAX)]; 98 int n_added;
82 int code; 99 int assign[X86_PMC_IDX_MAX]; /* event to counter assignment */
100 u64 tags[X86_PMC_IDX_MAX];
101 struct perf_event *event_list[X86_PMC_IDX_MAX]; /* in enabled order */
102 struct amd_nb *amd_nb;
83}; 103};
84 104
85#define EVENT_CONSTRAINT(c, m) { .code = (c), .idxmsk[0] = (m) } 105#define __EVENT_CONSTRAINT(c, n, m, w) {\
86#define EVENT_CONSTRAINT_END { .code = 0, .idxmsk[0] = 0 } 106 { .idxmsk64[0] = (n) }, \
107 .code = (c), \
108 .cmask = (m), \
109 .weight = (w), \
110}
111
112#define EVENT_CONSTRAINT(c, n, m) \
113 __EVENT_CONSTRAINT(c, n, m, HWEIGHT(n))
87 114
88#define for_each_event_constraint(e, c) \ 115#define INTEL_EVENT_CONSTRAINT(c, n) \
89 for ((e) = (c); (e)->idxmsk[0]; (e)++) 116 EVENT_CONSTRAINT(c, n, INTEL_ARCH_EVTSEL_MASK)
90 117
118#define FIXED_EVENT_CONSTRAINT(c, n) \
119 EVENT_CONSTRAINT(c, n, INTEL_ARCH_FIXED_MASK)
120
121#define EVENT_CONSTRAINT_END \
122 EVENT_CONSTRAINT(0, 0, 0)
123
124#define for_each_event_constraint(e, c) \
125 for ((e) = (c); (e)->cmask; (e)++)
91 126
92/* 127/*
93 * struct x86_pmu - generic x86 pmu 128 * struct x86_pmu - generic x86 pmu
@@ -114,8 +149,14 @@ struct x86_pmu {
114 u64 intel_ctrl; 149 u64 intel_ctrl;
115 void (*enable_bts)(u64 config); 150 void (*enable_bts)(u64 config);
116 void (*disable_bts)(void); 151 void (*disable_bts)(void);
117 int (*get_event_idx)(struct cpu_hw_events *cpuc, 152
118 struct hw_perf_event *hwc); 153 struct event_constraint *
154 (*get_event_constraints)(struct cpu_hw_events *cpuc,
155 struct perf_event *event);
156
157 void (*put_event_constraints)(struct cpu_hw_events *cpuc,
158 struct perf_event *event);
159 struct event_constraint *event_constraints;
119}; 160};
120 161
121static struct x86_pmu x86_pmu __read_mostly; 162static struct x86_pmu x86_pmu __read_mostly;
@@ -124,111 +165,8 @@ static DEFINE_PER_CPU(struct cpu_hw_events, cpu_hw_events) = {
124 .enabled = 1, 165 .enabled = 1,
125}; 166};
126 167
127static const struct event_constraint *event_constraints; 168static int x86_perf_event_set_period(struct perf_event *event,
128 169 struct hw_perf_event *hwc, int idx);
129/*
130 * Not sure about some of these
131 */
132static const u64 p6_perfmon_event_map[] =
133{
134 [PERF_COUNT_HW_CPU_CYCLES] = 0x0079,
135 [PERF_COUNT_HW_INSTRUCTIONS] = 0x00c0,
136 [PERF_COUNT_HW_CACHE_REFERENCES] = 0x0f2e,
137 [PERF_COUNT_HW_CACHE_MISSES] = 0x012e,
138 [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = 0x00c4,
139 [PERF_COUNT_HW_BRANCH_MISSES] = 0x00c5,
140 [PERF_COUNT_HW_BUS_CYCLES] = 0x0062,
141};
142
143static u64 p6_pmu_event_map(int hw_event)
144{
145 return p6_perfmon_event_map[hw_event];
146}
147
148/*
149 * Event setting that is specified not to count anything.
150 * We use this to effectively disable a counter.
151 *
152 * L2_RQSTS with 0 MESI unit mask.
153 */
154#define P6_NOP_EVENT 0x0000002EULL
155
156static u64 p6_pmu_raw_event(u64 hw_event)
157{
158#define P6_EVNTSEL_EVENT_MASK 0x000000FFULL
159#define P6_EVNTSEL_UNIT_MASK 0x0000FF00ULL
160#define P6_EVNTSEL_EDGE_MASK 0x00040000ULL
161#define P6_EVNTSEL_INV_MASK 0x00800000ULL
162#define P6_EVNTSEL_REG_MASK 0xFF000000ULL
163
164#define P6_EVNTSEL_MASK \
165 (P6_EVNTSEL_EVENT_MASK | \
166 P6_EVNTSEL_UNIT_MASK | \
167 P6_EVNTSEL_EDGE_MASK | \
168 P6_EVNTSEL_INV_MASK | \
169 P6_EVNTSEL_REG_MASK)
170
171 return hw_event & P6_EVNTSEL_MASK;
172}
173
174static const struct event_constraint intel_p6_event_constraints[] =
175{
176 EVENT_CONSTRAINT(0xc1, 0x1), /* FLOPS */
177 EVENT_CONSTRAINT(0x10, 0x1), /* FP_COMP_OPS_EXE */
178 EVENT_CONSTRAINT(0x11, 0x1), /* FP_ASSIST */
179 EVENT_CONSTRAINT(0x12, 0x2), /* MUL */
180 EVENT_CONSTRAINT(0x13, 0x2), /* DIV */
181 EVENT_CONSTRAINT(0x14, 0x1), /* CYCLES_DIV_BUSY */
182 EVENT_CONSTRAINT_END
183};
184
185/*
186 * Intel PerfMon v3. Used on Core2 and later.
187 */
188static const u64 intel_perfmon_event_map[] =
189{
190 [PERF_COUNT_HW_CPU_CYCLES] = 0x003c,
191 [PERF_COUNT_HW_INSTRUCTIONS] = 0x00c0,
192 [PERF_COUNT_HW_CACHE_REFERENCES] = 0x4f2e,
193 [PERF_COUNT_HW_CACHE_MISSES] = 0x412e,
194 [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = 0x00c4,
195 [PERF_COUNT_HW_BRANCH_MISSES] = 0x00c5,
196 [PERF_COUNT_HW_BUS_CYCLES] = 0x013c,
197};
198
199static const struct event_constraint intel_core_event_constraints[] =
200{
201 EVENT_CONSTRAINT(0x10, 0x1), /* FP_COMP_OPS_EXE */
202 EVENT_CONSTRAINT(0x11, 0x2), /* FP_ASSIST */
203 EVENT_CONSTRAINT(0x12, 0x2), /* MUL */
204 EVENT_CONSTRAINT(0x13, 0x2), /* DIV */
205 EVENT_CONSTRAINT(0x14, 0x1), /* CYCLES_DIV_BUSY */
206 EVENT_CONSTRAINT(0x18, 0x1), /* IDLE_DURING_DIV */
207 EVENT_CONSTRAINT(0x19, 0x2), /* DELAYED_BYPASS */
208 EVENT_CONSTRAINT(0xa1, 0x1), /* RS_UOPS_DISPATCH_CYCLES */
209 EVENT_CONSTRAINT(0xcb, 0x1), /* MEM_LOAD_RETIRED */
210 EVENT_CONSTRAINT_END
211};
212
213static const struct event_constraint intel_nehalem_event_constraints[] =
214{
215 EVENT_CONSTRAINT(0x40, 0x3), /* L1D_CACHE_LD */
216 EVENT_CONSTRAINT(0x41, 0x3), /* L1D_CACHE_ST */
217 EVENT_CONSTRAINT(0x42, 0x3), /* L1D_CACHE_LOCK */
218 EVENT_CONSTRAINT(0x43, 0x3), /* L1D_ALL_REF */
219 EVENT_CONSTRAINT(0x4e, 0x3), /* L1D_PREFETCH */
220 EVENT_CONSTRAINT(0x4c, 0x3), /* LOAD_HIT_PRE */
221 EVENT_CONSTRAINT(0x51, 0x3), /* L1D */
222 EVENT_CONSTRAINT(0x52, 0x3), /* L1D_CACHE_PREFETCH_LOCK_FB_HIT */
223 EVENT_CONSTRAINT(0x53, 0x3), /* L1D_CACHE_LOCK_FB_HIT */
224 EVENT_CONSTRAINT(0xc5, 0x3), /* CACHE_LOCK_CYCLES */
225 EVENT_CONSTRAINT_END
226};
227
228static u64 intel_pmu_event_map(int hw_event)
229{
230 return intel_perfmon_event_map[hw_event];
231}
232 170
233/* 171/*
234 * Generalized hw caching related hw_event table, filled 172 * Generalized hw caching related hw_event table, filled
@@ -245,424 +183,6 @@ static u64 __read_mostly hw_cache_event_ids
245 [PERF_COUNT_HW_CACHE_OP_MAX] 183 [PERF_COUNT_HW_CACHE_OP_MAX]
246 [PERF_COUNT_HW_CACHE_RESULT_MAX]; 184 [PERF_COUNT_HW_CACHE_RESULT_MAX];
247 185
248static __initconst u64 nehalem_hw_cache_event_ids
249 [PERF_COUNT_HW_CACHE_MAX]
250 [PERF_COUNT_HW_CACHE_OP_MAX]
251 [PERF_COUNT_HW_CACHE_RESULT_MAX] =
252{
253 [ C(L1D) ] = {
254 [ C(OP_READ) ] = {
255 [ C(RESULT_ACCESS) ] = 0x0f40, /* L1D_CACHE_LD.MESI */
256 [ C(RESULT_MISS) ] = 0x0140, /* L1D_CACHE_LD.I_STATE */
257 },
258 [ C(OP_WRITE) ] = {
259 [ C(RESULT_ACCESS) ] = 0x0f41, /* L1D_CACHE_ST.MESI */
260 [ C(RESULT_MISS) ] = 0x0141, /* L1D_CACHE_ST.I_STATE */
261 },
262 [ C(OP_PREFETCH) ] = {
263 [ C(RESULT_ACCESS) ] = 0x014e, /* L1D_PREFETCH.REQUESTS */
264 [ C(RESULT_MISS) ] = 0x024e, /* L1D_PREFETCH.MISS */
265 },
266 },
267 [ C(L1I ) ] = {
268 [ C(OP_READ) ] = {
269 [ C(RESULT_ACCESS) ] = 0x0380, /* L1I.READS */
270 [ C(RESULT_MISS) ] = 0x0280, /* L1I.MISSES */
271 },
272 [ C(OP_WRITE) ] = {
273 [ C(RESULT_ACCESS) ] = -1,
274 [ C(RESULT_MISS) ] = -1,
275 },
276 [ C(OP_PREFETCH) ] = {
277 [ C(RESULT_ACCESS) ] = 0x0,
278 [ C(RESULT_MISS) ] = 0x0,
279 },
280 },
281 [ C(LL ) ] = {
282 [ C(OP_READ) ] = {
283 [ C(RESULT_ACCESS) ] = 0x0324, /* L2_RQSTS.LOADS */
284 [ C(RESULT_MISS) ] = 0x0224, /* L2_RQSTS.LD_MISS */
285 },
286 [ C(OP_WRITE) ] = {
287 [ C(RESULT_ACCESS) ] = 0x0c24, /* L2_RQSTS.RFOS */
288 [ C(RESULT_MISS) ] = 0x0824, /* L2_RQSTS.RFO_MISS */
289 },
290 [ C(OP_PREFETCH) ] = {
291 [ C(RESULT_ACCESS) ] = 0x4f2e, /* LLC Reference */
292 [ C(RESULT_MISS) ] = 0x412e, /* LLC Misses */
293 },
294 },
295 [ C(DTLB) ] = {
296 [ C(OP_READ) ] = {
297 [ C(RESULT_ACCESS) ] = 0x0f40, /* L1D_CACHE_LD.MESI (alias) */
298 [ C(RESULT_MISS) ] = 0x0108, /* DTLB_LOAD_MISSES.ANY */
299 },
300 [ C(OP_WRITE) ] = {
301 [ C(RESULT_ACCESS) ] = 0x0f41, /* L1D_CACHE_ST.MESI (alias) */
302 [ C(RESULT_MISS) ] = 0x010c, /* MEM_STORE_RETIRED.DTLB_MISS */
303 },
304 [ C(OP_PREFETCH) ] = {
305 [ C(RESULT_ACCESS) ] = 0x0,
306 [ C(RESULT_MISS) ] = 0x0,
307 },
308 },
309 [ C(ITLB) ] = {
310 [ C(OP_READ) ] = {
311 [ C(RESULT_ACCESS) ] = 0x01c0, /* INST_RETIRED.ANY_P */
312 [ C(RESULT_MISS) ] = 0x20c8, /* ITLB_MISS_RETIRED */
313 },
314 [ C(OP_WRITE) ] = {
315 [ C(RESULT_ACCESS) ] = -1,
316 [ C(RESULT_MISS) ] = -1,
317 },
318 [ C(OP_PREFETCH) ] = {
319 [ C(RESULT_ACCESS) ] = -1,
320 [ C(RESULT_MISS) ] = -1,
321 },
322 },
323 [ C(BPU ) ] = {
324 [ C(OP_READ) ] = {
325 [ C(RESULT_ACCESS) ] = 0x00c4, /* BR_INST_RETIRED.ALL_BRANCHES */
326 [ C(RESULT_MISS) ] = 0x03e8, /* BPU_CLEARS.ANY */
327 },
328 [ C(OP_WRITE) ] = {
329 [ C(RESULT_ACCESS) ] = -1,
330 [ C(RESULT_MISS) ] = -1,
331 },
332 [ C(OP_PREFETCH) ] = {
333 [ C(RESULT_ACCESS) ] = -1,
334 [ C(RESULT_MISS) ] = -1,
335 },
336 },
337};
338
339static __initconst u64 core2_hw_cache_event_ids
340 [PERF_COUNT_HW_CACHE_MAX]
341 [PERF_COUNT_HW_CACHE_OP_MAX]
342 [PERF_COUNT_HW_CACHE_RESULT_MAX] =
343{
344 [ C(L1D) ] = {
345 [ C(OP_READ) ] = {
346 [ C(RESULT_ACCESS) ] = 0x0f40, /* L1D_CACHE_LD.MESI */
347 [ C(RESULT_MISS) ] = 0x0140, /* L1D_CACHE_LD.I_STATE */
348 },
349 [ C(OP_WRITE) ] = {
350 [ C(RESULT_ACCESS) ] = 0x0f41, /* L1D_CACHE_ST.MESI */
351 [ C(RESULT_MISS) ] = 0x0141, /* L1D_CACHE_ST.I_STATE */
352 },
353 [ C(OP_PREFETCH) ] = {
354 [ C(RESULT_ACCESS) ] = 0x104e, /* L1D_PREFETCH.REQUESTS */
355 [ C(RESULT_MISS) ] = 0,
356 },
357 },
358 [ C(L1I ) ] = {
359 [ C(OP_READ) ] = {
360 [ C(RESULT_ACCESS) ] = 0x0080, /* L1I.READS */
361 [ C(RESULT_MISS) ] = 0x0081, /* L1I.MISSES */
362 },
363 [ C(OP_WRITE) ] = {
364 [ C(RESULT_ACCESS) ] = -1,
365 [ C(RESULT_MISS) ] = -1,
366 },
367 [ C(OP_PREFETCH) ] = {
368 [ C(RESULT_ACCESS) ] = 0,
369 [ C(RESULT_MISS) ] = 0,
370 },
371 },
372 [ C(LL ) ] = {
373 [ C(OP_READ) ] = {
374 [ C(RESULT_ACCESS) ] = 0x4f29, /* L2_LD.MESI */
375 [ C(RESULT_MISS) ] = 0x4129, /* L2_LD.ISTATE */
376 },
377 [ C(OP_WRITE) ] = {
378 [ C(RESULT_ACCESS) ] = 0x4f2A, /* L2_ST.MESI */
379 [ C(RESULT_MISS) ] = 0x412A, /* L2_ST.ISTATE */
380 },
381 [ C(OP_PREFETCH) ] = {
382 [ C(RESULT_ACCESS) ] = 0,
383 [ C(RESULT_MISS) ] = 0,
384 },
385 },
386 [ C(DTLB) ] = {
387 [ C(OP_READ) ] = {
388 [ C(RESULT_ACCESS) ] = 0x0f40, /* L1D_CACHE_LD.MESI (alias) */
389 [ C(RESULT_MISS) ] = 0x0208, /* DTLB_MISSES.MISS_LD */
390 },
391 [ C(OP_WRITE) ] = {
392 [ C(RESULT_ACCESS) ] = 0x0f41, /* L1D_CACHE_ST.MESI (alias) */
393 [ C(RESULT_MISS) ] = 0x0808, /* DTLB_MISSES.MISS_ST */
394 },
395 [ C(OP_PREFETCH) ] = {
396 [ C(RESULT_ACCESS) ] = 0,
397 [ C(RESULT_MISS) ] = 0,
398 },
399 },
400 [ C(ITLB) ] = {
401 [ C(OP_READ) ] = {
402 [ C(RESULT_ACCESS) ] = 0x00c0, /* INST_RETIRED.ANY_P */
403 [ C(RESULT_MISS) ] = 0x1282, /* ITLBMISSES */
404 },
405 [ C(OP_WRITE) ] = {
406 [ C(RESULT_ACCESS) ] = -1,
407 [ C(RESULT_MISS) ] = -1,
408 },
409 [ C(OP_PREFETCH) ] = {
410 [ C(RESULT_ACCESS) ] = -1,
411 [ C(RESULT_MISS) ] = -1,
412 },
413 },
414 [ C(BPU ) ] = {
415 [ C(OP_READ) ] = {
416 [ C(RESULT_ACCESS) ] = 0x00c4, /* BR_INST_RETIRED.ANY */
417 [ C(RESULT_MISS) ] = 0x00c5, /* BP_INST_RETIRED.MISPRED */
418 },
419 [ C(OP_WRITE) ] = {
420 [ C(RESULT_ACCESS) ] = -1,
421 [ C(RESULT_MISS) ] = -1,
422 },
423 [ C(OP_PREFETCH) ] = {
424 [ C(RESULT_ACCESS) ] = -1,
425 [ C(RESULT_MISS) ] = -1,
426 },
427 },
428};
429
430static __initconst u64 atom_hw_cache_event_ids
431 [PERF_COUNT_HW_CACHE_MAX]
432 [PERF_COUNT_HW_CACHE_OP_MAX]
433 [PERF_COUNT_HW_CACHE_RESULT_MAX] =
434{
435 [ C(L1D) ] = {
436 [ C(OP_READ) ] = {
437 [ C(RESULT_ACCESS) ] = 0x2140, /* L1D_CACHE.LD */
438 [ C(RESULT_MISS) ] = 0,
439 },
440 [ C(OP_WRITE) ] = {
441 [ C(RESULT_ACCESS) ] = 0x2240, /* L1D_CACHE.ST */
442 [ C(RESULT_MISS) ] = 0,
443 },
444 [ C(OP_PREFETCH) ] = {
445 [ C(RESULT_ACCESS) ] = 0x0,
446 [ C(RESULT_MISS) ] = 0,
447 },
448 },
449 [ C(L1I ) ] = {
450 [ C(OP_READ) ] = {
451 [ C(RESULT_ACCESS) ] = 0x0380, /* L1I.READS */
452 [ C(RESULT_MISS) ] = 0x0280, /* L1I.MISSES */
453 },
454 [ C(OP_WRITE) ] = {
455 [ C(RESULT_ACCESS) ] = -1,
456 [ C(RESULT_MISS) ] = -1,
457 },
458 [ C(OP_PREFETCH) ] = {
459 [ C(RESULT_ACCESS) ] = 0,
460 [ C(RESULT_MISS) ] = 0,
461 },
462 },
463 [ C(LL ) ] = {
464 [ C(OP_READ) ] = {
465 [ C(RESULT_ACCESS) ] = 0x4f29, /* L2_LD.MESI */
466 [ C(RESULT_MISS) ] = 0x4129, /* L2_LD.ISTATE */
467 },
468 [ C(OP_WRITE) ] = {
469 [ C(RESULT_ACCESS) ] = 0x4f2A, /* L2_ST.MESI */
470 [ C(RESULT_MISS) ] = 0x412A, /* L2_ST.ISTATE */
471 },
472 [ C(OP_PREFETCH) ] = {
473 [ C(RESULT_ACCESS) ] = 0,
474 [ C(RESULT_MISS) ] = 0,
475 },
476 },
477 [ C(DTLB) ] = {
478 [ C(OP_READ) ] = {
479 [ C(RESULT_ACCESS) ] = 0x2140, /* L1D_CACHE_LD.MESI (alias) */
480 [ C(RESULT_MISS) ] = 0x0508, /* DTLB_MISSES.MISS_LD */
481 },
482 [ C(OP_WRITE) ] = {
483 [ C(RESULT_ACCESS) ] = 0x2240, /* L1D_CACHE_ST.MESI (alias) */
484 [ C(RESULT_MISS) ] = 0x0608, /* DTLB_MISSES.MISS_ST */
485 },
486 [ C(OP_PREFETCH) ] = {
487 [ C(RESULT_ACCESS) ] = 0,
488 [ C(RESULT_MISS) ] = 0,
489 },
490 },
491 [ C(ITLB) ] = {
492 [ C(OP_READ) ] = {
493 [ C(RESULT_ACCESS) ] = 0x00c0, /* INST_RETIRED.ANY_P */
494 [ C(RESULT_MISS) ] = 0x0282, /* ITLB.MISSES */
495 },
496 [ C(OP_WRITE) ] = {
497 [ C(RESULT_ACCESS) ] = -1,
498 [ C(RESULT_MISS) ] = -1,
499 },
500 [ C(OP_PREFETCH) ] = {
501 [ C(RESULT_ACCESS) ] = -1,
502 [ C(RESULT_MISS) ] = -1,
503 },
504 },
505 [ C(BPU ) ] = {
506 [ C(OP_READ) ] = {
507 [ C(RESULT_ACCESS) ] = 0x00c4, /* BR_INST_RETIRED.ANY */
508 [ C(RESULT_MISS) ] = 0x00c5, /* BP_INST_RETIRED.MISPRED */
509 },
510 [ C(OP_WRITE) ] = {
511 [ C(RESULT_ACCESS) ] = -1,
512 [ C(RESULT_MISS) ] = -1,
513 },
514 [ C(OP_PREFETCH) ] = {
515 [ C(RESULT_ACCESS) ] = -1,
516 [ C(RESULT_MISS) ] = -1,
517 },
518 },
519};
520
521static u64 intel_pmu_raw_event(u64 hw_event)
522{
523#define CORE_EVNTSEL_EVENT_MASK 0x000000FFULL
524#define CORE_EVNTSEL_UNIT_MASK 0x0000FF00ULL
525#define CORE_EVNTSEL_EDGE_MASK 0x00040000ULL
526#define CORE_EVNTSEL_INV_MASK 0x00800000ULL
527#define CORE_EVNTSEL_REG_MASK 0xFF000000ULL
528
529#define CORE_EVNTSEL_MASK \
530 (CORE_EVNTSEL_EVENT_MASK | \
531 CORE_EVNTSEL_UNIT_MASK | \
532 CORE_EVNTSEL_EDGE_MASK | \
533 CORE_EVNTSEL_INV_MASK | \
534 CORE_EVNTSEL_REG_MASK)
535
536 return hw_event & CORE_EVNTSEL_MASK;
537}
538
539static __initconst u64 amd_hw_cache_event_ids
540 [PERF_COUNT_HW_CACHE_MAX]
541 [PERF_COUNT_HW_CACHE_OP_MAX]
542 [PERF_COUNT_HW_CACHE_RESULT_MAX] =
543{
544 [ C(L1D) ] = {
545 [ C(OP_READ) ] = {
546 [ C(RESULT_ACCESS) ] = 0x0040, /* Data Cache Accesses */
547 [ C(RESULT_MISS) ] = 0x0041, /* Data Cache Misses */
548 },
549 [ C(OP_WRITE) ] = {
550 [ C(RESULT_ACCESS) ] = 0x0142, /* Data Cache Refills :system */
551 [ C(RESULT_MISS) ] = 0,
552 },
553 [ C(OP_PREFETCH) ] = {
554 [ C(RESULT_ACCESS) ] = 0x0267, /* Data Prefetcher :attempts */
555 [ C(RESULT_MISS) ] = 0x0167, /* Data Prefetcher :cancelled */
556 },
557 },
558 [ C(L1I ) ] = {
559 [ C(OP_READ) ] = {
560 [ C(RESULT_ACCESS) ] = 0x0080, /* Instruction cache fetches */
561 [ C(RESULT_MISS) ] = 0x0081, /* Instruction cache misses */
562 },
563 [ C(OP_WRITE) ] = {
564 [ C(RESULT_ACCESS) ] = -1,
565 [ C(RESULT_MISS) ] = -1,
566 },
567 [ C(OP_PREFETCH) ] = {
568 [ C(RESULT_ACCESS) ] = 0x014B, /* Prefetch Instructions :Load */
569 [ C(RESULT_MISS) ] = 0,
570 },
571 },
572 [ C(LL ) ] = {
573 [ C(OP_READ) ] = {
574 [ C(RESULT_ACCESS) ] = 0x037D, /* Requests to L2 Cache :IC+DC */
575 [ C(RESULT_MISS) ] = 0x037E, /* L2 Cache Misses : IC+DC */
576 },
577 [ C(OP_WRITE) ] = {
578 [ C(RESULT_ACCESS) ] = 0x017F, /* L2 Fill/Writeback */
579 [ C(RESULT_MISS) ] = 0,
580 },
581 [ C(OP_PREFETCH) ] = {
582 [ C(RESULT_ACCESS) ] = 0,
583 [ C(RESULT_MISS) ] = 0,
584 },
585 },
586 [ C(DTLB) ] = {
587 [ C(OP_READ) ] = {
588 [ C(RESULT_ACCESS) ] = 0x0040, /* Data Cache Accesses */
589 [ C(RESULT_MISS) ] = 0x0046, /* L1 DTLB and L2 DLTB Miss */
590 },
591 [ C(OP_WRITE) ] = {
592 [ C(RESULT_ACCESS) ] = 0,
593 [ C(RESULT_MISS) ] = 0,
594 },
595 [ C(OP_PREFETCH) ] = {
596 [ C(RESULT_ACCESS) ] = 0,
597 [ C(RESULT_MISS) ] = 0,
598 },
599 },
600 [ C(ITLB) ] = {
601 [ C(OP_READ) ] = {
602 [ C(RESULT_ACCESS) ] = 0x0080, /* Instruction fecthes */
603 [ C(RESULT_MISS) ] = 0x0085, /* Instr. fetch ITLB misses */
604 },
605 [ C(OP_WRITE) ] = {
606 [ C(RESULT_ACCESS) ] = -1,
607 [ C(RESULT_MISS) ] = -1,
608 },
609 [ C(OP_PREFETCH) ] = {
610 [ C(RESULT_ACCESS) ] = -1,
611 [ C(RESULT_MISS) ] = -1,
612 },
613 },
614 [ C(BPU ) ] = {
615 [ C(OP_READ) ] = {
616 [ C(RESULT_ACCESS) ] = 0x00c2, /* Retired Branch Instr. */
617 [ C(RESULT_MISS) ] = 0x00c3, /* Retired Mispredicted BI */
618 },
619 [ C(OP_WRITE) ] = {
620 [ C(RESULT_ACCESS) ] = -1,
621 [ C(RESULT_MISS) ] = -1,
622 },
623 [ C(OP_PREFETCH) ] = {
624 [ C(RESULT_ACCESS) ] = -1,
625 [ C(RESULT_MISS) ] = -1,
626 },
627 },
628};
629
630/*
631 * AMD Performance Monitor K7 and later.
632 */
633static const u64 amd_perfmon_event_map[] =
634{
635 [PERF_COUNT_HW_CPU_CYCLES] = 0x0076,
636 [PERF_COUNT_HW_INSTRUCTIONS] = 0x00c0,
637 [PERF_COUNT_HW_CACHE_REFERENCES] = 0x0080,
638 [PERF_COUNT_HW_CACHE_MISSES] = 0x0081,
639 [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = 0x00c4,
640 [PERF_COUNT_HW_BRANCH_MISSES] = 0x00c5,
641};
642
643static u64 amd_pmu_event_map(int hw_event)
644{
645 return amd_perfmon_event_map[hw_event];
646}
647
648static u64 amd_pmu_raw_event(u64 hw_event)
649{
650#define K7_EVNTSEL_EVENT_MASK 0x7000000FFULL
651#define K7_EVNTSEL_UNIT_MASK 0x00000FF00ULL
652#define K7_EVNTSEL_EDGE_MASK 0x000040000ULL
653#define K7_EVNTSEL_INV_MASK 0x000800000ULL
654#define K7_EVNTSEL_REG_MASK 0x0FF000000ULL
655
656#define K7_EVNTSEL_MASK \
657 (K7_EVNTSEL_EVENT_MASK | \
658 K7_EVNTSEL_UNIT_MASK | \
659 K7_EVNTSEL_EDGE_MASK | \
660 K7_EVNTSEL_INV_MASK | \
661 K7_EVNTSEL_REG_MASK)
662
663 return hw_event & K7_EVNTSEL_MASK;
664}
665
666/* 186/*
667 * Propagate event elapsed time into the generic event. 187 * Propagate event elapsed time into the generic event.
668 * Can only be executed on the CPU where the event is active. 188 * Can only be executed on the CPU where the event is active.
@@ -914,42 +434,6 @@ set_ext_hw_attr(struct hw_perf_event *hwc, struct perf_event_attr *attr)
914 return 0; 434 return 0;
915} 435}
916 436
917static void intel_pmu_enable_bts(u64 config)
918{
919 unsigned long debugctlmsr;
920
921 debugctlmsr = get_debugctlmsr();
922
923 debugctlmsr |= X86_DEBUGCTL_TR;
924 debugctlmsr |= X86_DEBUGCTL_BTS;
925 debugctlmsr |= X86_DEBUGCTL_BTINT;
926
927 if (!(config & ARCH_PERFMON_EVENTSEL_OS))
928 debugctlmsr |= X86_DEBUGCTL_BTS_OFF_OS;
929
930 if (!(config & ARCH_PERFMON_EVENTSEL_USR))
931 debugctlmsr |= X86_DEBUGCTL_BTS_OFF_USR;
932
933 update_debugctlmsr(debugctlmsr);
934}
935
936static void intel_pmu_disable_bts(void)
937{
938 struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
939 unsigned long debugctlmsr;
940
941 if (!cpuc->ds)
942 return;
943
944 debugctlmsr = get_debugctlmsr();
945
946 debugctlmsr &=
947 ~(X86_DEBUGCTL_TR | X86_DEBUGCTL_BTS | X86_DEBUGCTL_BTINT |
948 X86_DEBUGCTL_BTS_OFF_OS | X86_DEBUGCTL_BTS_OFF_USR);
949
950 update_debugctlmsr(debugctlmsr);
951}
952
953/* 437/*
954 * Setup the hardware configuration for a given attr_type 438 * Setup the hardware configuration for a given attr_type
955 */ 439 */
@@ -988,6 +472,8 @@ static int __hw_perf_event_init(struct perf_event *event)
988 hwc->config = ARCH_PERFMON_EVENTSEL_INT; 472 hwc->config = ARCH_PERFMON_EVENTSEL_INT;
989 473
990 hwc->idx = -1; 474 hwc->idx = -1;
475 hwc->last_cpu = -1;
476 hwc->last_tag = ~0ULL;
991 477
992 /* 478 /*
993 * Count user and OS events unless requested not to. 479 * Count user and OS events unless requested not to.
@@ -1056,216 +542,323 @@ static int __hw_perf_event_init(struct perf_event *event)
1056 return 0; 542 return 0;
1057} 543}
1058 544
1059static void p6_pmu_disable_all(void) 545static void x86_pmu_disable_all(void)
1060{ 546{
1061 struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); 547 struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
1062 u64 val; 548 int idx;
1063
1064 if (!cpuc->enabled)
1065 return;
1066 549
1067 cpuc->enabled = 0; 550 for (idx = 0; idx < x86_pmu.num_events; idx++) {
1068 barrier(); 551 u64 val;
1069 552
1070 /* p6 only has one enable register */ 553 if (!test_bit(idx, cpuc->active_mask))
1071 rdmsrl(MSR_P6_EVNTSEL0, val); 554 continue;
1072 val &= ~ARCH_PERFMON_EVENTSEL0_ENABLE; 555 rdmsrl(x86_pmu.eventsel + idx, val);
1073 wrmsrl(MSR_P6_EVNTSEL0, val); 556 if (!(val & ARCH_PERFMON_EVENTSEL0_ENABLE))
557 continue;
558 val &= ~ARCH_PERFMON_EVENTSEL0_ENABLE;
559 wrmsrl(x86_pmu.eventsel + idx, val);
560 }
1074} 561}
1075 562
1076static void intel_pmu_disable_all(void) 563void hw_perf_disable(void)
1077{ 564{
1078 struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); 565 struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
1079 566
567 if (!x86_pmu_initialized())
568 return;
569
1080 if (!cpuc->enabled) 570 if (!cpuc->enabled)
1081 return; 571 return;
1082 572
573 cpuc->n_added = 0;
1083 cpuc->enabled = 0; 574 cpuc->enabled = 0;
1084 barrier(); 575 barrier();
1085 576
1086 wrmsrl(MSR_CORE_PERF_GLOBAL_CTRL, 0); 577 x86_pmu.disable_all();
1087
1088 if (test_bit(X86_PMC_IDX_FIXED_BTS, cpuc->active_mask))
1089 intel_pmu_disable_bts();
1090} 578}
1091 579
1092static void amd_pmu_disable_all(void) 580static void x86_pmu_enable_all(void)
1093{ 581{
1094 struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); 582 struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
1095 int idx; 583 int idx;
1096 584
1097 if (!cpuc->enabled)
1098 return;
1099
1100 cpuc->enabled = 0;
1101 /*
1102 * ensure we write the disable before we start disabling the
1103 * events proper, so that amd_pmu_enable_event() does the
1104 * right thing.
1105 */
1106 barrier();
1107
1108 for (idx = 0; idx < x86_pmu.num_events; idx++) { 585 for (idx = 0; idx < x86_pmu.num_events; idx++) {
586 struct perf_event *event = cpuc->events[idx];
1109 u64 val; 587 u64 val;
1110 588
1111 if (!test_bit(idx, cpuc->active_mask)) 589 if (!test_bit(idx, cpuc->active_mask))
1112 continue; 590 continue;
1113 rdmsrl(MSR_K7_EVNTSEL0 + idx, val); 591
1114 if (!(val & ARCH_PERFMON_EVENTSEL0_ENABLE)) 592 val = event->hw.config;
1115 continue; 593 val |= ARCH_PERFMON_EVENTSEL0_ENABLE;
1116 val &= ~ARCH_PERFMON_EVENTSEL0_ENABLE; 594 wrmsrl(x86_pmu.eventsel + idx, val);
1117 wrmsrl(MSR_K7_EVNTSEL0 + idx, val);
1118 } 595 }
1119} 596}
1120 597
1121void hw_perf_disable(void) 598static const struct pmu pmu;
599
600static inline int is_x86_event(struct perf_event *event)
1122{ 601{
1123 if (!x86_pmu_initialized()) 602 return event->pmu == &pmu;
1124 return;
1125 return x86_pmu.disable_all();
1126} 603}
1127 604
1128static void p6_pmu_enable_all(void) 605static int x86_schedule_events(struct cpu_hw_events *cpuc, int n, int *assign)
1129{ 606{
1130 struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); 607 struct event_constraint *c, *constraints[X86_PMC_IDX_MAX];
1131 unsigned long val; 608 unsigned long used_mask[BITS_TO_LONGS(X86_PMC_IDX_MAX)];
609 int i, j, w, wmax, num = 0;
610 struct hw_perf_event *hwc;
1132 611
1133 if (cpuc->enabled) 612 bitmap_zero(used_mask, X86_PMC_IDX_MAX);
1134 return;
1135 613
1136 cpuc->enabled = 1; 614 for (i = 0; i < n; i++) {
1137 barrier(); 615 constraints[i] =
616 x86_pmu.get_event_constraints(cpuc, cpuc->event_list[i]);
617 }
1138 618
1139 /* p6 only has one enable register */ 619 /*
1140 rdmsrl(MSR_P6_EVNTSEL0, val); 620 * fastpath, try to reuse previous register
1141 val |= ARCH_PERFMON_EVENTSEL0_ENABLE; 621 */
1142 wrmsrl(MSR_P6_EVNTSEL0, val); 622 for (i = 0; i < n; i++) {
1143} 623 hwc = &cpuc->event_list[i]->hw;
624 c = constraints[i];
1144 625
1145static void intel_pmu_enable_all(void) 626 /* never assigned */
1146{ 627 if (hwc->idx == -1)
1147 struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); 628 break;
1148 629
1149 if (cpuc->enabled) 630 /* constraint still honored */
1150 return; 631 if (!test_bit(hwc->idx, c->idxmsk))
632 break;
1151 633
1152 cpuc->enabled = 1; 634 /* not already used */
1153 barrier(); 635 if (test_bit(hwc->idx, used_mask))
636 break;
637
638 set_bit(hwc->idx, used_mask);
639 if (assign)
640 assign[i] = hwc->idx;
641 }
642 if (i == n)
643 goto done;
644
645 /*
646 * begin slow path
647 */
648
649 bitmap_zero(used_mask, X86_PMC_IDX_MAX);
650
651 /*
652 * weight = number of possible counters
653 *
654 * 1 = most constrained, only works on one counter
655 * wmax = least constrained, works on any counter
656 *
657 * assign events to counters starting with most
658 * constrained events.
659 */
660 wmax = x86_pmu.num_events;
661
662 /*
663 * when fixed event counters are present,
664 * wmax is incremented by 1 to account
665 * for one more choice
666 */
667 if (x86_pmu.num_events_fixed)
668 wmax++;
1154 669
1155 wrmsrl(MSR_CORE_PERF_GLOBAL_CTRL, x86_pmu.intel_ctrl); 670 for (w = 1, num = n; num && w <= wmax; w++) {
671 /* for each event */
672 for (i = 0; num && i < n; i++) {
673 c = constraints[i];
674 hwc = &cpuc->event_list[i]->hw;
1156 675
1157 if (test_bit(X86_PMC_IDX_FIXED_BTS, cpuc->active_mask)) { 676 if (c->weight != w)
1158 struct perf_event *event = 677 continue;
1159 cpuc->events[X86_PMC_IDX_FIXED_BTS];
1160 678
1161 if (WARN_ON_ONCE(!event)) 679 for_each_bit(j, c->idxmsk, X86_PMC_IDX_MAX) {
1162 return; 680 if (!test_bit(j, used_mask))
681 break;
682 }
683
684 if (j == X86_PMC_IDX_MAX)
685 break;
686
687 set_bit(j, used_mask);
1163 688
1164 intel_pmu_enable_bts(event->hw.config); 689 if (assign)
690 assign[i] = j;
691 num--;
692 }
693 }
694done:
695 /*
696 * scheduling failed or is just a simulation,
697 * free resources if necessary
698 */
699 if (!assign || num) {
700 for (i = 0; i < n; i++) {
701 if (x86_pmu.put_event_constraints)
702 x86_pmu.put_event_constraints(cpuc, cpuc->event_list[i]);
703 }
1165 } 704 }
705 return num ? -ENOSPC : 0;
1166} 706}
1167 707
1168static void amd_pmu_enable_all(void) 708/*
709 * dogrp: true if must collect siblings events (group)
710 * returns total number of events and error code
711 */
712static int collect_events(struct cpu_hw_events *cpuc, struct perf_event *leader, bool dogrp)
1169{ 713{
1170 struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); 714 struct perf_event *event;
1171 int idx; 715 int n, max_count;
1172 716
1173 if (cpuc->enabled) 717 max_count = x86_pmu.num_events + x86_pmu.num_events_fixed;
1174 return;
1175 718
1176 cpuc->enabled = 1; 719 /* current number of events already accepted */
1177 barrier(); 720 n = cpuc->n_events;
1178 721
1179 for (idx = 0; idx < x86_pmu.num_events; idx++) { 722 if (is_x86_event(leader)) {
1180 struct perf_event *event = cpuc->events[idx]; 723 if (n >= max_count)
1181 u64 val; 724 return -ENOSPC;
725 cpuc->event_list[n] = leader;
726 n++;
727 }
728 if (!dogrp)
729 return n;
1182 730
1183 if (!test_bit(idx, cpuc->active_mask)) 731 list_for_each_entry(event, &leader->sibling_list, group_entry) {
732 if (!is_x86_event(event) ||
733 event->state <= PERF_EVENT_STATE_OFF)
1184 continue; 734 continue;
1185 735
1186 val = event->hw.config; 736 if (n >= max_count)
1187 val |= ARCH_PERFMON_EVENTSEL0_ENABLE; 737 return -ENOSPC;
1188 wrmsrl(MSR_K7_EVNTSEL0 + idx, val);
1189 }
1190}
1191 738
1192void hw_perf_enable(void) 739 cpuc->event_list[n] = event;
1193{ 740 n++;
1194 if (!x86_pmu_initialized()) 741 }
1195 return; 742 return n;
1196 x86_pmu.enable_all();
1197} 743}
1198 744
1199static inline u64 intel_pmu_get_status(void) 745static inline void x86_assign_hw_event(struct perf_event *event,
746 struct cpu_hw_events *cpuc, int i)
1200{ 747{
1201 u64 status; 748 struct hw_perf_event *hwc = &event->hw;
1202 749
1203 rdmsrl(MSR_CORE_PERF_GLOBAL_STATUS, status); 750 hwc->idx = cpuc->assign[i];
751 hwc->last_cpu = smp_processor_id();
752 hwc->last_tag = ++cpuc->tags[i];
1204 753
1205 return status; 754 if (hwc->idx == X86_PMC_IDX_FIXED_BTS) {
755 hwc->config_base = 0;
756 hwc->event_base = 0;
757 } else if (hwc->idx >= X86_PMC_IDX_FIXED) {
758 hwc->config_base = MSR_ARCH_PERFMON_FIXED_CTR_CTRL;
759 /*
760 * We set it so that event_base + idx in wrmsr/rdmsr maps to
761 * MSR_ARCH_PERFMON_FIXED_CTR0 ... CTR2:
762 */
763 hwc->event_base =
764 MSR_ARCH_PERFMON_FIXED_CTR0 - X86_PMC_IDX_FIXED;
765 } else {
766 hwc->config_base = x86_pmu.eventsel;
767 hwc->event_base = x86_pmu.perfctr;
768 }
1206} 769}
1207 770
1208static inline void intel_pmu_ack_status(u64 ack) 771static inline int match_prev_assignment(struct hw_perf_event *hwc,
772 struct cpu_hw_events *cpuc,
773 int i)
1209{ 774{
1210 wrmsrl(MSR_CORE_PERF_GLOBAL_OVF_CTRL, ack); 775 return hwc->idx == cpuc->assign[i] &&
776 hwc->last_cpu == smp_processor_id() &&
777 hwc->last_tag == cpuc->tags[i];
1211} 778}
1212 779
1213static inline void x86_pmu_enable_event(struct hw_perf_event *hwc, int idx) 780static void x86_pmu_stop(struct perf_event *event);
1214{
1215 (void)checking_wrmsrl(hwc->config_base + idx,
1216 hwc->config | ARCH_PERFMON_EVENTSEL0_ENABLE);
1217}
1218 781
1219static inline void x86_pmu_disable_event(struct hw_perf_event *hwc, int idx) 782void hw_perf_enable(void)
1220{ 783{
1221 (void)checking_wrmsrl(hwc->config_base + idx, hwc->config); 784 struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
1222} 785 struct perf_event *event;
786 struct hw_perf_event *hwc;
787 int i;
1223 788
1224static inline void 789 if (!x86_pmu_initialized())
1225intel_pmu_disable_fixed(struct hw_perf_event *hwc, int __idx) 790 return;
1226{
1227 int idx = __idx - X86_PMC_IDX_FIXED;
1228 u64 ctrl_val, mask;
1229 791
1230 mask = 0xfULL << (idx * 4); 792 if (cpuc->enabled)
793 return;
1231 794
1232 rdmsrl(hwc->config_base, ctrl_val); 795 if (cpuc->n_added) {
1233 ctrl_val &= ~mask; 796 /*
1234 (void)checking_wrmsrl(hwc->config_base, ctrl_val); 797 * apply assignment obtained either from
1235} 798 * hw_perf_group_sched_in() or x86_pmu_enable()
799 *
800 * step1: save events moving to new counters
801 * step2: reprogram moved events into new counters
802 */
803 for (i = 0; i < cpuc->n_events; i++) {
1236 804
1237static inline void 805 event = cpuc->event_list[i];
1238p6_pmu_disable_event(struct hw_perf_event *hwc, int idx) 806 hwc = &event->hw;
1239{
1240 struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
1241 u64 val = P6_NOP_EVENT;
1242 807
1243 if (cpuc->enabled) 808 /*
1244 val |= ARCH_PERFMON_EVENTSEL0_ENABLE; 809 * we can avoid reprogramming counter if:
810 * - assigned same counter as last time
811 * - running on same CPU as last time
812 * - no other event has used the counter since
813 */
814 if (hwc->idx == -1 ||
815 match_prev_assignment(hwc, cpuc, i))
816 continue;
1245 817
1246 (void)checking_wrmsrl(hwc->config_base + idx, val); 818 x86_pmu_stop(event);
1247}
1248 819
1249static inline void 820 hwc->idx = -1;
1250intel_pmu_disable_event(struct hw_perf_event *hwc, int idx) 821 }
1251{
1252 if (unlikely(idx == X86_PMC_IDX_FIXED_BTS)) {
1253 intel_pmu_disable_bts();
1254 return;
1255 }
1256 822
1257 if (unlikely(hwc->config_base == MSR_ARCH_PERFMON_FIXED_CTR_CTRL)) { 823 for (i = 0; i < cpuc->n_events; i++) {
1258 intel_pmu_disable_fixed(hwc, idx); 824
1259 return; 825 event = cpuc->event_list[i];
826 hwc = &event->hw;
827
828 if (hwc->idx == -1) {
829 x86_assign_hw_event(event, cpuc, i);
830 x86_perf_event_set_period(event, hwc, hwc->idx);
831 }
832 /*
833 * need to mark as active because x86_pmu_disable()
834 * clear active_mask and events[] yet it preserves
835 * idx
836 */
837 set_bit(hwc->idx, cpuc->active_mask);
838 cpuc->events[hwc->idx] = event;
839
840 x86_pmu.enable(hwc, hwc->idx);
841 perf_event_update_userpage(event);
842 }
843 cpuc->n_added = 0;
844 perf_events_lapic_init();
1260 } 845 }
1261 846
1262 x86_pmu_disable_event(hwc, idx); 847 cpuc->enabled = 1;
848 barrier();
849
850 x86_pmu.enable_all();
851}
852
853static inline void __x86_pmu_enable_event(struct hw_perf_event *hwc, int idx)
854{
855 (void)checking_wrmsrl(hwc->config_base + idx,
856 hwc->config | ARCH_PERFMON_EVENTSEL0_ENABLE);
1263} 857}
1264 858
1265static inline void 859static inline void x86_pmu_disable_event(struct hw_perf_event *hwc, int idx)
1266amd_pmu_disable_event(struct hw_perf_event *hwc, int idx)
1267{ 860{
1268 x86_pmu_disable_event(hwc, idx); 861 (void)checking_wrmsrl(hwc->config_base + idx, hwc->config);
1269} 862}
1270 863
1271static DEFINE_PER_CPU(u64 [X86_PMC_IDX_MAX], pmc_prev_left); 864static DEFINE_PER_CPU(u64 [X86_PMC_IDX_MAX], pmc_prev_left);
@@ -1326,220 +919,60 @@ x86_perf_event_set_period(struct perf_event *event,
1326 return ret; 919 return ret;
1327} 920}
1328 921
1329static inline void 922static void x86_pmu_enable_event(struct hw_perf_event *hwc, int idx)
1330intel_pmu_enable_fixed(struct hw_perf_event *hwc, int __idx)
1331{
1332 int idx = __idx - X86_PMC_IDX_FIXED;
1333 u64 ctrl_val, bits, mask;
1334 int err;
1335
1336 /*
1337 * Enable IRQ generation (0x8),
1338 * and enable ring-3 counting (0x2) and ring-0 counting (0x1)
1339 * if requested:
1340 */
1341 bits = 0x8ULL;
1342 if (hwc->config & ARCH_PERFMON_EVENTSEL_USR)
1343 bits |= 0x2;
1344 if (hwc->config & ARCH_PERFMON_EVENTSEL_OS)
1345 bits |= 0x1;
1346
1347 /*
1348 * ANY bit is supported in v3 and up
1349 */
1350 if (x86_pmu.version > 2 && hwc->config & ARCH_PERFMON_EVENTSEL_ANY)
1351 bits |= 0x4;
1352
1353 bits <<= (idx * 4);
1354 mask = 0xfULL << (idx * 4);
1355
1356 rdmsrl(hwc->config_base, ctrl_val);
1357 ctrl_val &= ~mask;
1358 ctrl_val |= bits;
1359 err = checking_wrmsrl(hwc->config_base, ctrl_val);
1360}
1361
1362static void p6_pmu_enable_event(struct hw_perf_event *hwc, int idx)
1363{ 923{
1364 struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); 924 struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
1365 u64 val;
1366
1367 val = hwc->config;
1368 if (cpuc->enabled) 925 if (cpuc->enabled)
1369 val |= ARCH_PERFMON_EVENTSEL0_ENABLE; 926 __x86_pmu_enable_event(hwc, idx);
1370
1371 (void)checking_wrmsrl(hwc->config_base + idx, val);
1372} 927}
1373 928
1374 929/*
1375static void intel_pmu_enable_event(struct hw_perf_event *hwc, int idx) 930 * activate a single event
1376{ 931 *
1377 if (unlikely(idx == X86_PMC_IDX_FIXED_BTS)) { 932 * The event is added to the group of enabled events
1378 if (!__get_cpu_var(cpu_hw_events).enabled) 933 * but only if it can be scehduled with existing events.
1379 return; 934 *
1380 935 * Called with PMU disabled. If successful and return value 1,
1381 intel_pmu_enable_bts(hwc->config); 936 * then guaranteed to call perf_enable() and hw_perf_enable()
1382 return; 937 */
1383 } 938static int x86_pmu_enable(struct perf_event *event)
1384
1385 if (unlikely(hwc->config_base == MSR_ARCH_PERFMON_FIXED_CTR_CTRL)) {
1386 intel_pmu_enable_fixed(hwc, idx);
1387 return;
1388 }
1389
1390 x86_pmu_enable_event(hwc, idx);
1391}
1392
1393static void amd_pmu_enable_event(struct hw_perf_event *hwc, int idx)
1394{ 939{
1395 struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); 940 struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
941 struct hw_perf_event *hwc;
942 int assign[X86_PMC_IDX_MAX];
943 int n, n0, ret;
1396 944
1397 if (cpuc->enabled) 945 hwc = &event->hw;
1398 x86_pmu_enable_event(hwc, idx);
1399}
1400
1401static int fixed_mode_idx(struct hw_perf_event *hwc)
1402{
1403 unsigned int hw_event;
1404
1405 hw_event = hwc->config & ARCH_PERFMON_EVENT_MASK;
1406
1407 if (unlikely((hw_event ==
1408 x86_pmu.event_map(PERF_COUNT_HW_BRANCH_INSTRUCTIONS)) &&
1409 (hwc->sample_period == 1)))
1410 return X86_PMC_IDX_FIXED_BTS;
1411 946
1412 if (!x86_pmu.num_events_fixed) 947 n0 = cpuc->n_events;
1413 return -1; 948 n = collect_events(cpuc, event, false);
949 if (n < 0)
950 return n;
1414 951
952 ret = x86_schedule_events(cpuc, n, assign);
953 if (ret)
954 return ret;
1415 /* 955 /*
1416 * fixed counters do not take all possible filters 956 * copy new assignment, now we know it is possible
957 * will be used by hw_perf_enable()
1417 */ 958 */
1418 if (hwc->config & ARCH_PERFMON_EVENT_FILTER_MASK) 959 memcpy(cpuc->assign, assign, n*sizeof(int));
1419 return -1;
1420 960
1421 if (unlikely(hw_event == x86_pmu.event_map(PERF_COUNT_HW_INSTRUCTIONS))) 961 cpuc->n_events = n;
1422 return X86_PMC_IDX_FIXED_INSTRUCTIONS; 962 cpuc->n_added = n - n0;
1423 if (unlikely(hw_event == x86_pmu.event_map(PERF_COUNT_HW_CPU_CYCLES)))
1424 return X86_PMC_IDX_FIXED_CPU_CYCLES;
1425 if (unlikely(hw_event == x86_pmu.event_map(PERF_COUNT_HW_BUS_CYCLES)))
1426 return X86_PMC_IDX_FIXED_BUS_CYCLES;
1427 963
1428 return -1; 964 return 0;
1429}
1430
1431/*
1432 * generic counter allocator: get next free counter
1433 */
1434static int
1435gen_get_event_idx(struct cpu_hw_events *cpuc, struct hw_perf_event *hwc)
1436{
1437 int idx;
1438
1439 idx = find_first_zero_bit(cpuc->used_mask, x86_pmu.num_events);
1440 return idx == x86_pmu.num_events ? -1 : idx;
1441}
1442
1443/*
1444 * intel-specific counter allocator: check event constraints
1445 */
1446static int
1447intel_get_event_idx(struct cpu_hw_events *cpuc, struct hw_perf_event *hwc)
1448{
1449 const struct event_constraint *event_constraint;
1450 int i, code;
1451
1452 if (!event_constraints)
1453 goto skip;
1454
1455 code = hwc->config & CORE_EVNTSEL_EVENT_MASK;
1456
1457 for_each_event_constraint(event_constraint, event_constraints) {
1458 if (code == event_constraint->code) {
1459 for_each_bit(i, event_constraint->idxmsk, X86_PMC_IDX_MAX) {
1460 if (!test_and_set_bit(i, cpuc->used_mask))
1461 return i;
1462 }
1463 return -1;
1464 }
1465 }
1466skip:
1467 return gen_get_event_idx(cpuc, hwc);
1468}
1469
1470static int
1471x86_schedule_event(struct cpu_hw_events *cpuc, struct hw_perf_event *hwc)
1472{
1473 int idx;
1474
1475 idx = fixed_mode_idx(hwc);
1476 if (idx == X86_PMC_IDX_FIXED_BTS) {
1477 /* BTS is already occupied. */
1478 if (test_and_set_bit(idx, cpuc->used_mask))
1479 return -EAGAIN;
1480
1481 hwc->config_base = 0;
1482 hwc->event_base = 0;
1483 hwc->idx = idx;
1484 } else if (idx >= 0) {
1485 /*
1486 * Try to get the fixed event, if that is already taken
1487 * then try to get a generic event:
1488 */
1489 if (test_and_set_bit(idx, cpuc->used_mask))
1490 goto try_generic;
1491
1492 hwc->config_base = MSR_ARCH_PERFMON_FIXED_CTR_CTRL;
1493 /*
1494 * We set it so that event_base + idx in wrmsr/rdmsr maps to
1495 * MSR_ARCH_PERFMON_FIXED_CTR0 ... CTR2:
1496 */
1497 hwc->event_base =
1498 MSR_ARCH_PERFMON_FIXED_CTR0 - X86_PMC_IDX_FIXED;
1499 hwc->idx = idx;
1500 } else {
1501 idx = hwc->idx;
1502 /* Try to get the previous generic event again */
1503 if (idx == -1 || test_and_set_bit(idx, cpuc->used_mask)) {
1504try_generic:
1505 idx = x86_pmu.get_event_idx(cpuc, hwc);
1506 if (idx == -1)
1507 return -EAGAIN;
1508
1509 set_bit(idx, cpuc->used_mask);
1510 hwc->idx = idx;
1511 }
1512 hwc->config_base = x86_pmu.eventsel;
1513 hwc->event_base = x86_pmu.perfctr;
1514 }
1515
1516 return idx;
1517} 965}
1518 966
1519/* 967static int x86_pmu_start(struct perf_event *event)
1520 * Find a PMC slot for the freshly enabled / scheduled in event:
1521 */
1522static int x86_pmu_enable(struct perf_event *event)
1523{ 968{
1524 struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
1525 struct hw_perf_event *hwc = &event->hw; 969 struct hw_perf_event *hwc = &event->hw;
1526 int idx;
1527
1528 idx = x86_schedule_event(cpuc, hwc);
1529 if (idx < 0)
1530 return idx;
1531 970
1532 perf_events_lapic_init(); 971 if (hwc->idx == -1)
1533 972 return -EAGAIN;
1534 x86_pmu.disable(hwc, idx);
1535 973
1536 cpuc->events[idx] = event; 974 x86_perf_event_set_period(event, hwc, hwc->idx);
1537 set_bit(idx, cpuc->active_mask); 975 x86_pmu.enable(hwc, hwc->idx);
1538
1539 x86_perf_event_set_period(event, hwc, idx);
1540 x86_pmu.enable(hwc, idx);
1541
1542 perf_event_update_userpage(event);
1543 976
1544 return 0; 977 return 0;
1545} 978}
@@ -1583,7 +1016,7 @@ void perf_event_print_debug(void)
1583 pr_info("CPU#%d: overflow: %016llx\n", cpu, overflow); 1016 pr_info("CPU#%d: overflow: %016llx\n", cpu, overflow);
1584 pr_info("CPU#%d: fixed: %016llx\n", cpu, fixed); 1017 pr_info("CPU#%d: fixed: %016llx\n", cpu, fixed);
1585 } 1018 }
1586 pr_info("CPU#%d: used: %016llx\n", cpu, *(u64 *)cpuc->used_mask); 1019 pr_info("CPU#%d: active: %016llx\n", cpu, *(u64 *)cpuc->active_mask);
1587 1020
1588 for (idx = 0; idx < x86_pmu.num_events; idx++) { 1021 for (idx = 0; idx < x86_pmu.num_events; idx++) {
1589 rdmsrl(x86_pmu.eventsel + idx, pmc_ctrl); 1022 rdmsrl(x86_pmu.eventsel + idx, pmc_ctrl);
@@ -1607,67 +1040,7 @@ void perf_event_print_debug(void)
1607 local_irq_restore(flags); 1040 local_irq_restore(flags);
1608} 1041}
1609 1042
1610static void intel_pmu_drain_bts_buffer(struct cpu_hw_events *cpuc) 1043static void x86_pmu_stop(struct perf_event *event)
1611{
1612 struct debug_store *ds = cpuc->ds;
1613 struct bts_record {
1614 u64 from;
1615 u64 to;
1616 u64 flags;
1617 };
1618 struct perf_event *event = cpuc->events[X86_PMC_IDX_FIXED_BTS];
1619 struct bts_record *at, *top;
1620 struct perf_output_handle handle;
1621 struct perf_event_header header;
1622 struct perf_sample_data data;
1623 struct pt_regs regs;
1624
1625 if (!event)
1626 return;
1627
1628 if (!ds)
1629 return;
1630
1631 at = (struct bts_record *)(unsigned long)ds->bts_buffer_base;
1632 top = (struct bts_record *)(unsigned long)ds->bts_index;
1633
1634 if (top <= at)
1635 return;
1636
1637 ds->bts_index = ds->bts_buffer_base;
1638
1639
1640 data.period = event->hw.last_period;
1641 data.addr = 0;
1642 data.raw = NULL;
1643 regs.ip = 0;
1644
1645 /*
1646 * Prepare a generic sample, i.e. fill in the invariant fields.
1647 * We will overwrite the from and to address before we output
1648 * the sample.
1649 */
1650 perf_prepare_sample(&header, &data, event, &regs);
1651
1652 if (perf_output_begin(&handle, event,
1653 header.size * (top - at), 1, 1))
1654 return;
1655
1656 for (; at < top; at++) {
1657 data.ip = at->from;
1658 data.addr = at->to;
1659
1660 perf_output_sample(&handle, &header, &data, event);
1661 }
1662
1663 perf_output_end(&handle);
1664
1665 /* There's new data available. */
1666 event->hw.interrupts++;
1667 event->pending_kill = POLL_IN;
1668}
1669
1670static void x86_pmu_disable(struct perf_event *event)
1671{ 1044{
1672 struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); 1045 struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
1673 struct hw_perf_event *hwc = &event->hw; 1046 struct hw_perf_event *hwc = &event->hw;
@@ -1681,183 +1054,38 @@ static void x86_pmu_disable(struct perf_event *event)
1681 x86_pmu.disable(hwc, idx); 1054 x86_pmu.disable(hwc, idx);
1682 1055
1683 /* 1056 /*
1684 * Make sure the cleared pointer becomes visible before we
1685 * (potentially) free the event:
1686 */
1687 barrier();
1688
1689 /*
1690 * Drain the remaining delta count out of a event 1057 * Drain the remaining delta count out of a event
1691 * that we are disabling: 1058 * that we are disabling:
1692 */ 1059 */
1693 x86_perf_event_update(event, hwc, idx); 1060 x86_perf_event_update(event, hwc, idx);
1694 1061
1695 /* Drain the remaining BTS records. */
1696 if (unlikely(idx == X86_PMC_IDX_FIXED_BTS))
1697 intel_pmu_drain_bts_buffer(cpuc);
1698
1699 cpuc->events[idx] = NULL; 1062 cpuc->events[idx] = NULL;
1700 clear_bit(idx, cpuc->used_mask);
1701
1702 perf_event_update_userpage(event);
1703}
1704
1705/*
1706 * Save and restart an expired event. Called by NMI contexts,
1707 * so it has to be careful about preempting normal event ops:
1708 */
1709static int intel_pmu_save_and_restart(struct perf_event *event)
1710{
1711 struct hw_perf_event *hwc = &event->hw;
1712 int idx = hwc->idx;
1713 int ret;
1714
1715 x86_perf_event_update(event, hwc, idx);
1716 ret = x86_perf_event_set_period(event, hwc, idx);
1717
1718 if (event->state == PERF_EVENT_STATE_ACTIVE)
1719 intel_pmu_enable_event(hwc, idx);
1720
1721 return ret;
1722} 1063}
1723 1064
1724static void intel_pmu_reset(void) 1065static void x86_pmu_disable(struct perf_event *event)
1725{
1726 struct debug_store *ds = __get_cpu_var(cpu_hw_events).ds;
1727 unsigned long flags;
1728 int idx;
1729
1730 if (!x86_pmu.num_events)
1731 return;
1732
1733 local_irq_save(flags);
1734
1735 printk("clearing PMU state on CPU#%d\n", smp_processor_id());
1736
1737 for (idx = 0; idx < x86_pmu.num_events; idx++) {
1738 checking_wrmsrl(x86_pmu.eventsel + idx, 0ull);
1739 checking_wrmsrl(x86_pmu.perfctr + idx, 0ull);
1740 }
1741 for (idx = 0; idx < x86_pmu.num_events_fixed; idx++) {
1742 checking_wrmsrl(MSR_ARCH_PERFMON_FIXED_CTR0 + idx, 0ull);
1743 }
1744 if (ds)
1745 ds->bts_index = ds->bts_buffer_base;
1746
1747 local_irq_restore(flags);
1748}
1749
1750static int p6_pmu_handle_irq(struct pt_regs *regs)
1751{
1752 struct perf_sample_data data;
1753 struct cpu_hw_events *cpuc;
1754 struct perf_event *event;
1755 struct hw_perf_event *hwc;
1756 int idx, handled = 0;
1757 u64 val;
1758
1759 data.addr = 0;
1760 data.raw = NULL;
1761
1762 cpuc = &__get_cpu_var(cpu_hw_events);
1763
1764 for (idx = 0; idx < x86_pmu.num_events; idx++) {
1765 if (!test_bit(idx, cpuc->active_mask))
1766 continue;
1767
1768 event = cpuc->events[idx];
1769 hwc = &event->hw;
1770
1771 val = x86_perf_event_update(event, hwc, idx);
1772 if (val & (1ULL << (x86_pmu.event_bits - 1)))
1773 continue;
1774
1775 /*
1776 * event overflow
1777 */
1778 handled = 1;
1779 data.period = event->hw.last_period;
1780
1781 if (!x86_perf_event_set_period(event, hwc, idx))
1782 continue;
1783
1784 if (perf_event_overflow(event, 1, &data, regs))
1785 p6_pmu_disable_event(hwc, idx);
1786 }
1787
1788 if (handled)
1789 inc_irq_stat(apic_perf_irqs);
1790
1791 return handled;
1792}
1793
1794/*
1795 * This handler is triggered by the local APIC, so the APIC IRQ handling
1796 * rules apply:
1797 */
1798static int intel_pmu_handle_irq(struct pt_regs *regs)
1799{ 1066{
1800 struct perf_sample_data data; 1067 struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
1801 struct cpu_hw_events *cpuc; 1068 int i;
1802 int bit, loops;
1803 u64 ack, status;
1804
1805 data.addr = 0;
1806 data.raw = NULL;
1807
1808 cpuc = &__get_cpu_var(cpu_hw_events);
1809
1810 perf_disable();
1811 intel_pmu_drain_bts_buffer(cpuc);
1812 status = intel_pmu_get_status();
1813 if (!status) {
1814 perf_enable();
1815 return 0;
1816 }
1817
1818 loops = 0;
1819again:
1820 if (++loops > 100) {
1821 WARN_ONCE(1, "perfevents: irq loop stuck!\n");
1822 perf_event_print_debug();
1823 intel_pmu_reset();
1824 perf_enable();
1825 return 1;
1826 }
1827 1069
1828 inc_irq_stat(apic_perf_irqs); 1070 x86_pmu_stop(event);
1829 ack = status;
1830 for_each_bit(bit, (unsigned long *)&status, X86_PMC_IDX_MAX) {
1831 struct perf_event *event = cpuc->events[bit];
1832 1071
1833 clear_bit(bit, (unsigned long *) &status); 1072 for (i = 0; i < cpuc->n_events; i++) {
1834 if (!test_bit(bit, cpuc->active_mask)) 1073 if (event == cpuc->event_list[i]) {
1835 continue;
1836 1074
1837 if (!intel_pmu_save_and_restart(event)) 1075 if (x86_pmu.put_event_constraints)
1838 continue; 1076 x86_pmu.put_event_constraints(cpuc, event);
1839 1077
1840 data.period = event->hw.last_period; 1078 while (++i < cpuc->n_events)
1079 cpuc->event_list[i-1] = cpuc->event_list[i];
1841 1080
1842 if (perf_event_overflow(event, 1, &data, regs)) 1081 --cpuc->n_events;
1843 intel_pmu_disable_event(&event->hw, bit); 1082 break;
1083 }
1844 } 1084 }
1845 1085 perf_event_update_userpage(event);
1846 intel_pmu_ack_status(ack);
1847
1848 /*
1849 * Repeat if there is more work to be done:
1850 */
1851 status = intel_pmu_get_status();
1852 if (status)
1853 goto again;
1854
1855 perf_enable();
1856
1857 return 1;
1858} 1086}
1859 1087
1860static int amd_pmu_handle_irq(struct pt_regs *regs) 1088static int x86_pmu_handle_irq(struct pt_regs *regs)
1861{ 1089{
1862 struct perf_sample_data data; 1090 struct perf_sample_data data;
1863 struct cpu_hw_events *cpuc; 1091 struct cpu_hw_events *cpuc;
@@ -1892,7 +1120,7 @@ static int amd_pmu_handle_irq(struct pt_regs *regs)
1892 continue; 1120 continue;
1893 1121
1894 if (perf_event_overflow(event, 1, &data, regs)) 1122 if (perf_event_overflow(event, 1, &data, regs))
1895 amd_pmu_disable_event(hwc, idx); 1123 x86_pmu.disable(hwc, idx);
1896 } 1124 }
1897 1125
1898 if (handled) 1126 if (handled)
@@ -1975,194 +1203,137 @@ static __read_mostly struct notifier_block perf_event_nmi_notifier = {
1975 .priority = 1 1203 .priority = 1
1976}; 1204};
1977 1205
1978static __initconst struct x86_pmu p6_pmu = { 1206static struct event_constraint unconstrained;
1979 .name = "p6", 1207static struct event_constraint emptyconstraint;
1980 .handle_irq = p6_pmu_handle_irq,
1981 .disable_all = p6_pmu_disable_all,
1982 .enable_all = p6_pmu_enable_all,
1983 .enable = p6_pmu_enable_event,
1984 .disable = p6_pmu_disable_event,
1985 .eventsel = MSR_P6_EVNTSEL0,
1986 .perfctr = MSR_P6_PERFCTR0,
1987 .event_map = p6_pmu_event_map,
1988 .raw_event = p6_pmu_raw_event,
1989 .max_events = ARRAY_SIZE(p6_perfmon_event_map),
1990 .apic = 1,
1991 .max_period = (1ULL << 31) - 1,
1992 .version = 0,
1993 .num_events = 2,
1994 /*
1995 * Events have 40 bits implemented. However they are designed such
1996 * that bits [32-39] are sign extensions of bit 31. As such the
1997 * effective width of a event for P6-like PMU is 32 bits only.
1998 *
1999 * See IA-32 Intel Architecture Software developer manual Vol 3B
2000 */
2001 .event_bits = 32,
2002 .event_mask = (1ULL << 32) - 1,
2003 .get_event_idx = intel_get_event_idx,
2004};
2005 1208
2006static __initconst struct x86_pmu intel_pmu = { 1209static struct event_constraint *
2007 .name = "Intel", 1210x86_get_event_constraints(struct cpu_hw_events *cpuc, struct perf_event *event)
2008 .handle_irq = intel_pmu_handle_irq, 1211{
2009 .disable_all = intel_pmu_disable_all, 1212 struct event_constraint *c;
2010 .enable_all = intel_pmu_enable_all,
2011 .enable = intel_pmu_enable_event,
2012 .disable = intel_pmu_disable_event,
2013 .eventsel = MSR_ARCH_PERFMON_EVENTSEL0,
2014 .perfctr = MSR_ARCH_PERFMON_PERFCTR0,
2015 .event_map = intel_pmu_event_map,
2016 .raw_event = intel_pmu_raw_event,
2017 .max_events = ARRAY_SIZE(intel_perfmon_event_map),
2018 .apic = 1,
2019 /*
2020 * Intel PMCs cannot be accessed sanely above 32 bit width,
2021 * so we install an artificial 1<<31 period regardless of
2022 * the generic event period:
2023 */
2024 .max_period = (1ULL << 31) - 1,
2025 .enable_bts = intel_pmu_enable_bts,
2026 .disable_bts = intel_pmu_disable_bts,
2027 .get_event_idx = intel_get_event_idx,
2028};
2029 1213
2030static __initconst struct x86_pmu amd_pmu = { 1214 if (x86_pmu.event_constraints) {
2031 .name = "AMD", 1215 for_each_event_constraint(c, x86_pmu.event_constraints) {
2032 .handle_irq = amd_pmu_handle_irq, 1216 if ((event->hw.config & c->cmask) == c->code)
2033 .disable_all = amd_pmu_disable_all, 1217 return c;
2034 .enable_all = amd_pmu_enable_all, 1218 }
2035 .enable = amd_pmu_enable_event, 1219 }
2036 .disable = amd_pmu_disable_event, 1220
2037 .eventsel = MSR_K7_EVNTSEL0, 1221 return &unconstrained;
2038 .perfctr = MSR_K7_PERFCTR0, 1222}
2039 .event_map = amd_pmu_event_map,
2040 .raw_event = amd_pmu_raw_event,
2041 .max_events = ARRAY_SIZE(amd_perfmon_event_map),
2042 .num_events = 4,
2043 .event_bits = 48,
2044 .event_mask = (1ULL << 48) - 1,
2045 .apic = 1,
2046 /* use highest bit to detect overflow */
2047 .max_period = (1ULL << 47) - 1,
2048 .get_event_idx = gen_get_event_idx,
2049};
2050 1223
2051static __init int p6_pmu_init(void) 1224static int x86_event_sched_in(struct perf_event *event,
1225 struct perf_cpu_context *cpuctx)
2052{ 1226{
2053 switch (boot_cpu_data.x86_model) { 1227 int ret = 0;
2054 case 1:
2055 case 3: /* Pentium Pro */
2056 case 5:
2057 case 6: /* Pentium II */
2058 case 7:
2059 case 8:
2060 case 11: /* Pentium III */
2061 event_constraints = intel_p6_event_constraints;
2062 break;
2063 case 9:
2064 case 13:
2065 /* Pentium M */
2066 event_constraints = intel_p6_event_constraints;
2067 break;
2068 default:
2069 pr_cont("unsupported p6 CPU model %d ",
2070 boot_cpu_data.x86_model);
2071 return -ENODEV;
2072 }
2073 1228
2074 x86_pmu = p6_pmu; 1229 event->state = PERF_EVENT_STATE_ACTIVE;
1230 event->oncpu = smp_processor_id();
1231 event->tstamp_running += event->ctx->time - event->tstamp_stopped;
2075 1232
2076 return 0; 1233 if (!is_x86_event(event))
1234 ret = event->pmu->enable(event);
1235
1236 if (!ret && !is_software_event(event))
1237 cpuctx->active_oncpu++;
1238
1239 if (!ret && event->attr.exclusive)
1240 cpuctx->exclusive = 1;
1241
1242 return ret;
2077} 1243}
2078 1244
2079static __init int intel_pmu_init(void) 1245static void x86_event_sched_out(struct perf_event *event,
1246 struct perf_cpu_context *cpuctx)
2080{ 1247{
2081 union cpuid10_edx edx; 1248 event->state = PERF_EVENT_STATE_INACTIVE;
2082 union cpuid10_eax eax; 1249 event->oncpu = -1;
2083 unsigned int unused;
2084 unsigned int ebx;
2085 int version;
2086
2087 if (!cpu_has(&boot_cpu_data, X86_FEATURE_ARCH_PERFMON)) {
2088 /* check for P6 processor family */
2089 if (boot_cpu_data.x86 == 6) {
2090 return p6_pmu_init();
2091 } else {
2092 return -ENODEV;
2093 }
2094 }
2095 1250
2096 /* 1251 if (!is_x86_event(event))
2097 * Check whether the Architectural PerfMon supports 1252 event->pmu->disable(event);
2098 * Branch Misses Retired hw_event or not.
2099 */
2100 cpuid(10, &eax.full, &ebx, &unused, &edx.full);
2101 if (eax.split.mask_length <= ARCH_PERFMON_BRANCH_MISSES_RETIRED)
2102 return -ENODEV;
2103 1253
2104 version = eax.split.version_id; 1254 event->tstamp_running -= event->ctx->time - event->tstamp_stopped;
2105 if (version < 2)
2106 return -ENODEV;
2107 1255
2108 x86_pmu = intel_pmu; 1256 if (!is_software_event(event))
2109 x86_pmu.version = version; 1257 cpuctx->active_oncpu--;
2110 x86_pmu.num_events = eax.split.num_events;
2111 x86_pmu.event_bits = eax.split.bit_width;
2112 x86_pmu.event_mask = (1ULL << eax.split.bit_width) - 1;
2113 1258
2114 /* 1259 if (event->attr.exclusive || !cpuctx->active_oncpu)
2115 * Quirk: v2 perfmon does not report fixed-purpose events, so 1260 cpuctx->exclusive = 0;
2116 * assume at least 3 events: 1261}
2117 */
2118 x86_pmu.num_events_fixed = max((int)edx.split.num_events_fixed, 3);
2119 1262
1263/*
1264 * Called to enable a whole group of events.
1265 * Returns 1 if the group was enabled, or -EAGAIN if it could not be.
1266 * Assumes the caller has disabled interrupts and has
1267 * frozen the PMU with hw_perf_save_disable.
1268 *
1269 * called with PMU disabled. If successful and return value 1,
1270 * then guaranteed to call perf_enable() and hw_perf_enable()
1271 */
1272int hw_perf_group_sched_in(struct perf_event *leader,
1273 struct perf_cpu_context *cpuctx,
1274 struct perf_event_context *ctx)
1275{
1276 struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
1277 struct perf_event *sub;
1278 int assign[X86_PMC_IDX_MAX];
1279 int n0, n1, ret;
1280
1281 /* n0 = total number of events */
1282 n0 = collect_events(cpuc, leader, true);
1283 if (n0 < 0)
1284 return n0;
1285
1286 ret = x86_schedule_events(cpuc, n0, assign);
1287 if (ret)
1288 return ret;
1289
1290 ret = x86_event_sched_in(leader, cpuctx);
1291 if (ret)
1292 return ret;
1293
1294 n1 = 1;
1295 list_for_each_entry(sub, &leader->sibling_list, group_entry) {
1296 if (sub->state > PERF_EVENT_STATE_OFF) {
1297 ret = x86_event_sched_in(sub, cpuctx);
1298 if (ret)
1299 goto undo;
1300 ++n1;
1301 }
1302 }
2120 /* 1303 /*
2121 * Install the hw-cache-events table: 1304 * copy new assignment, now we know it is possible
1305 * will be used by hw_perf_enable()
2122 */ 1306 */
2123 switch (boot_cpu_data.x86_model) { 1307 memcpy(cpuc->assign, assign, n0*sizeof(int));
2124 case 15: /* original 65 nm celeron/pentium/core2/xeon, "Merom"/"Conroe" */
2125 case 22: /* single-core 65 nm celeron/core2solo "Merom-L"/"Conroe-L" */
2126 case 23: /* current 45 nm celeron/core2/xeon "Penryn"/"Wolfdale" */
2127 case 29: /* six-core 45 nm xeon "Dunnington" */
2128 memcpy(hw_cache_event_ids, core2_hw_cache_event_ids,
2129 sizeof(hw_cache_event_ids));
2130
2131 pr_cont("Core2 events, ");
2132 event_constraints = intel_core_event_constraints;
2133 break;
2134 default:
2135 case 26:
2136 memcpy(hw_cache_event_ids, nehalem_hw_cache_event_ids,
2137 sizeof(hw_cache_event_ids));
2138 1308
2139 event_constraints = intel_nehalem_event_constraints; 1309 cpuc->n_events = n0;
2140 pr_cont("Nehalem/Corei7 events, "); 1310 cpuc->n_added = n1;
2141 break; 1311 ctx->nr_active += n1;
2142 case 28:
2143 memcpy(hw_cache_event_ids, atom_hw_cache_event_ids,
2144 sizeof(hw_cache_event_ids));
2145 1312
2146 pr_cont("Atom events, "); 1313 /*
2147 break; 1314 * 1 means successful and events are active
1315 * This is not quite true because we defer
1316 * actual activation until hw_perf_enable() but
1317 * this way we* ensure caller won't try to enable
1318 * individual events
1319 */
1320 return 1;
1321undo:
1322 x86_event_sched_out(leader, cpuctx);
1323 n0 = 1;
1324 list_for_each_entry(sub, &leader->sibling_list, group_entry) {
1325 if (sub->state == PERF_EVENT_STATE_ACTIVE) {
1326 x86_event_sched_out(sub, cpuctx);
1327 if (++n0 == n1)
1328 break;
1329 }
2148 } 1330 }
2149 return 0; 1331 return ret;
2150} 1332}
2151 1333
2152static __init int amd_pmu_init(void) 1334#include "perf_event_amd.c"
2153{ 1335#include "perf_event_p6.c"
2154 /* Performance-monitoring supported from K7 and later: */ 1336#include "perf_event_intel.c"
2155 if (boot_cpu_data.x86 < 6)
2156 return -ENODEV;
2157
2158 x86_pmu = amd_pmu;
2159
2160 /* Events are common for all AMDs */
2161 memcpy(hw_cache_event_ids, amd_hw_cache_event_ids,
2162 sizeof(hw_cache_event_ids));
2163
2164 return 0;
2165}
2166 1337
2167static void __init pmu_check_apic(void) 1338static void __init pmu_check_apic(void)
2168{ 1339{
@@ -2220,6 +1391,10 @@ void __init init_hw_perf_events(void)
2220 perf_events_lapic_init(); 1391 perf_events_lapic_init();
2221 register_die_notifier(&perf_event_nmi_notifier); 1392 register_die_notifier(&perf_event_nmi_notifier);
2222 1393
1394 unconstrained = (struct event_constraint)
1395 __EVENT_CONSTRAINT(0, (1ULL << x86_pmu.num_events) - 1,
1396 0, x86_pmu.num_events);
1397
2223 pr_info("... version: %d\n", x86_pmu.version); 1398 pr_info("... version: %d\n", x86_pmu.version);
2224 pr_info("... bit width: %d\n", x86_pmu.event_bits); 1399 pr_info("... bit width: %d\n", x86_pmu.event_bits);
2225 pr_info("... generic registers: %d\n", x86_pmu.num_events); 1400 pr_info("... generic registers: %d\n", x86_pmu.num_events);
@@ -2237,50 +1412,79 @@ static inline void x86_pmu_read(struct perf_event *event)
2237static const struct pmu pmu = { 1412static const struct pmu pmu = {
2238 .enable = x86_pmu_enable, 1413 .enable = x86_pmu_enable,
2239 .disable = x86_pmu_disable, 1414 .disable = x86_pmu_disable,
1415 .start = x86_pmu_start,
1416 .stop = x86_pmu_stop,
2240 .read = x86_pmu_read, 1417 .read = x86_pmu_read,
2241 .unthrottle = x86_pmu_unthrottle, 1418 .unthrottle = x86_pmu_unthrottle,
2242}; 1419};
2243 1420
2244static int 1421/*
2245validate_event(struct cpu_hw_events *cpuc, struct perf_event *event) 1422 * validate a single event group
2246{ 1423 *
2247 struct hw_perf_event fake_event = event->hw; 1424 * validation include:
2248 1425 * - check events are compatible which each other
2249 if (event->pmu && event->pmu != &pmu) 1426 * - events do not compete for the same counter
2250 return 0; 1427 * - number of events <= number of counters
2251 1428 *
2252 return x86_schedule_event(cpuc, &fake_event) >= 0; 1429 * validation ensures the group can be loaded onto the
2253} 1430 * PMU if it was the only group available.
2254 1431 */
2255static int validate_group(struct perf_event *event) 1432static int validate_group(struct perf_event *event)
2256{ 1433{
2257 struct perf_event *sibling, *leader = event->group_leader; 1434 struct perf_event *leader = event->group_leader;
2258 struct cpu_hw_events fake_pmu; 1435 struct cpu_hw_events *fake_cpuc;
1436 int ret, n;
2259 1437
2260 memset(&fake_pmu, 0, sizeof(fake_pmu)); 1438 ret = -ENOMEM;
1439 fake_cpuc = kmalloc(sizeof(*fake_cpuc), GFP_KERNEL | __GFP_ZERO);
1440 if (!fake_cpuc)
1441 goto out;
1442
1443 /*
1444 * the event is not yet connected with its
1445 * siblings therefore we must first collect
1446 * existing siblings, then add the new event
1447 * before we can simulate the scheduling
1448 */
1449 ret = -ENOSPC;
1450 n = collect_events(fake_cpuc, leader, true);
1451 if (n < 0)
1452 goto out_free;
2261 1453
2262 if (!validate_event(&fake_pmu, leader)) 1454 fake_cpuc->n_events = n;
2263 return -ENOSPC; 1455 n = collect_events(fake_cpuc, event, false);
1456 if (n < 0)
1457 goto out_free;
2264 1458
2265 list_for_each_entry(sibling, &leader->sibling_list, group_entry) { 1459 fake_cpuc->n_events = n;
2266 if (!validate_event(&fake_pmu, sibling))
2267 return -ENOSPC;
2268 }
2269 1460
2270 if (!validate_event(&fake_pmu, event)) 1461 ret = x86_schedule_events(fake_cpuc, n, NULL);
2271 return -ENOSPC;
2272 1462
2273 return 0; 1463out_free:
1464 kfree(fake_cpuc);
1465out:
1466 return ret;
2274} 1467}
2275 1468
2276const struct pmu *hw_perf_event_init(struct perf_event *event) 1469const struct pmu *hw_perf_event_init(struct perf_event *event)
2277{ 1470{
1471 const struct pmu *tmp;
2278 int err; 1472 int err;
2279 1473
2280 err = __hw_perf_event_init(event); 1474 err = __hw_perf_event_init(event);
2281 if (!err) { 1475 if (!err) {
1476 /*
1477 * we temporarily connect event to its pmu
1478 * such that validate_group() can classify
1479 * it as an x86 event using is_x86_event()
1480 */
1481 tmp = event->pmu;
1482 event->pmu = &pmu;
1483
2282 if (event->group_leader != event) 1484 if (event->group_leader != event)
2283 err = validate_group(event); 1485 err = validate_group(event);
1486
1487 event->pmu = tmp;
2284 } 1488 }
2285 if (err) { 1489 if (err) {
2286 if (event->destroy) 1490 if (event->destroy)
@@ -2304,7 +1508,6 @@ void callchain_store(struct perf_callchain_entry *entry, u64 ip)
2304 1508
2305static DEFINE_PER_CPU(struct perf_callchain_entry, pmc_irq_entry); 1509static DEFINE_PER_CPU(struct perf_callchain_entry, pmc_irq_entry);
2306static DEFINE_PER_CPU(struct perf_callchain_entry, pmc_nmi_entry); 1510static DEFINE_PER_CPU(struct perf_callchain_entry, pmc_nmi_entry);
2307static DEFINE_PER_CPU(int, in_ignored_frame);
2308 1511
2309 1512
2310static void 1513static void
@@ -2320,10 +1523,6 @@ static void backtrace_warning(void *data, char *msg)
2320 1523
2321static int backtrace_stack(void *data, char *name) 1524static int backtrace_stack(void *data, char *name)
2322{ 1525{
2323 per_cpu(in_ignored_frame, smp_processor_id()) =
2324 x86_is_stack_id(NMI_STACK, name) ||
2325 x86_is_stack_id(DEBUG_STACK, name);
2326
2327 return 0; 1526 return 0;
2328} 1527}
2329 1528
@@ -2331,9 +1530,6 @@ static void backtrace_address(void *data, unsigned long addr, int reliable)
2331{ 1530{
2332 struct perf_callchain_entry *entry = data; 1531 struct perf_callchain_entry *entry = data;
2333 1532
2334 if (per_cpu(in_ignored_frame, smp_processor_id()))
2335 return;
2336
2337 if (reliable) 1533 if (reliable)
2338 callchain_store(entry, addr); 1534 callchain_store(entry, addr);
2339} 1535}
@@ -2440,9 +1636,6 @@ perf_do_callchain(struct pt_regs *regs, struct perf_callchain_entry *entry)
2440 1636
2441 is_user = user_mode(regs); 1637 is_user = user_mode(regs);
2442 1638
2443 if (!current || current->pid == 0)
2444 return;
2445
2446 if (is_user && current->state != TASK_RUNNING) 1639 if (is_user && current->state != TASK_RUNNING)
2447 return; 1640 return;
2448 1641
@@ -2472,4 +1665,25 @@ struct perf_callchain_entry *perf_callchain(struct pt_regs *regs)
2472void hw_perf_event_setup_online(int cpu) 1665void hw_perf_event_setup_online(int cpu)
2473{ 1666{
2474 init_debug_store_on_cpu(cpu); 1667 init_debug_store_on_cpu(cpu);
1668
1669 switch (boot_cpu_data.x86_vendor) {
1670 case X86_VENDOR_AMD:
1671 amd_pmu_cpu_online(cpu);
1672 break;
1673 default:
1674 return;
1675 }
1676}
1677
1678void hw_perf_event_setup_offline(int cpu)
1679{
1680 init_debug_store_on_cpu(cpu);
1681
1682 switch (boot_cpu_data.x86_vendor) {
1683 case X86_VENDOR_AMD:
1684 amd_pmu_cpu_offline(cpu);
1685 break;
1686 default:
1687 return;
1688 }
2475} 1689}
diff --git a/arch/x86/kernel/cpu/perf_event_amd.c b/arch/x86/kernel/cpu/perf_event_amd.c
new file mode 100644
index 000000000000..8f3dbfda3c4f
--- /dev/null
+++ b/arch/x86/kernel/cpu/perf_event_amd.c
@@ -0,0 +1,416 @@
1#ifdef CONFIG_CPU_SUP_AMD
2
3static DEFINE_RAW_SPINLOCK(amd_nb_lock);
4
5static __initconst u64 amd_hw_cache_event_ids
6 [PERF_COUNT_HW_CACHE_MAX]
7 [PERF_COUNT_HW_CACHE_OP_MAX]
8 [PERF_COUNT_HW_CACHE_RESULT_MAX] =
9{
10 [ C(L1D) ] = {
11 [ C(OP_READ) ] = {
12 [ C(RESULT_ACCESS) ] = 0x0040, /* Data Cache Accesses */
13 [ C(RESULT_MISS) ] = 0x0041, /* Data Cache Misses */
14 },
15 [ C(OP_WRITE) ] = {
16 [ C(RESULT_ACCESS) ] = 0x0142, /* Data Cache Refills :system */
17 [ C(RESULT_MISS) ] = 0,
18 },
19 [ C(OP_PREFETCH) ] = {
20 [ C(RESULT_ACCESS) ] = 0x0267, /* Data Prefetcher :attempts */
21 [ C(RESULT_MISS) ] = 0x0167, /* Data Prefetcher :cancelled */
22 },
23 },
24 [ C(L1I ) ] = {
25 [ C(OP_READ) ] = {
26 [ C(RESULT_ACCESS) ] = 0x0080, /* Instruction cache fetches */
27 [ C(RESULT_MISS) ] = 0x0081, /* Instruction cache misses */
28 },
29 [ C(OP_WRITE) ] = {
30 [ C(RESULT_ACCESS) ] = -1,
31 [ C(RESULT_MISS) ] = -1,
32 },
33 [ C(OP_PREFETCH) ] = {
34 [ C(RESULT_ACCESS) ] = 0x014B, /* Prefetch Instructions :Load */
35 [ C(RESULT_MISS) ] = 0,
36 },
37 },
38 [ C(LL ) ] = {
39 [ C(OP_READ) ] = {
40 [ C(RESULT_ACCESS) ] = 0x037D, /* Requests to L2 Cache :IC+DC */
41 [ C(RESULT_MISS) ] = 0x037E, /* L2 Cache Misses : IC+DC */
42 },
43 [ C(OP_WRITE) ] = {
44 [ C(RESULT_ACCESS) ] = 0x017F, /* L2 Fill/Writeback */
45 [ C(RESULT_MISS) ] = 0,
46 },
47 [ C(OP_PREFETCH) ] = {
48 [ C(RESULT_ACCESS) ] = 0,
49 [ C(RESULT_MISS) ] = 0,
50 },
51 },
52 [ C(DTLB) ] = {
53 [ C(OP_READ) ] = {
54 [ C(RESULT_ACCESS) ] = 0x0040, /* Data Cache Accesses */
55 [ C(RESULT_MISS) ] = 0x0046, /* L1 DTLB and L2 DLTB Miss */
56 },
57 [ C(OP_WRITE) ] = {
58 [ C(RESULT_ACCESS) ] = 0,
59 [ C(RESULT_MISS) ] = 0,
60 },
61 [ C(OP_PREFETCH) ] = {
62 [ C(RESULT_ACCESS) ] = 0,
63 [ C(RESULT_MISS) ] = 0,
64 },
65 },
66 [ C(ITLB) ] = {
67 [ C(OP_READ) ] = {
68 [ C(RESULT_ACCESS) ] = 0x0080, /* Instruction fecthes */
69 [ C(RESULT_MISS) ] = 0x0085, /* Instr. fetch ITLB misses */
70 },
71 [ C(OP_WRITE) ] = {
72 [ C(RESULT_ACCESS) ] = -1,
73 [ C(RESULT_MISS) ] = -1,
74 },
75 [ C(OP_PREFETCH) ] = {
76 [ C(RESULT_ACCESS) ] = -1,
77 [ C(RESULT_MISS) ] = -1,
78 },
79 },
80 [ C(BPU ) ] = {
81 [ C(OP_READ) ] = {
82 [ C(RESULT_ACCESS) ] = 0x00c2, /* Retired Branch Instr. */
83 [ C(RESULT_MISS) ] = 0x00c3, /* Retired Mispredicted BI */
84 },
85 [ C(OP_WRITE) ] = {
86 [ C(RESULT_ACCESS) ] = -1,
87 [ C(RESULT_MISS) ] = -1,
88 },
89 [ C(OP_PREFETCH) ] = {
90 [ C(RESULT_ACCESS) ] = -1,
91 [ C(RESULT_MISS) ] = -1,
92 },
93 },
94};
95
96/*
97 * AMD Performance Monitor K7 and later.
98 */
99static const u64 amd_perfmon_event_map[] =
100{
101 [PERF_COUNT_HW_CPU_CYCLES] = 0x0076,
102 [PERF_COUNT_HW_INSTRUCTIONS] = 0x00c0,
103 [PERF_COUNT_HW_CACHE_REFERENCES] = 0x0080,
104 [PERF_COUNT_HW_CACHE_MISSES] = 0x0081,
105 [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = 0x00c4,
106 [PERF_COUNT_HW_BRANCH_MISSES] = 0x00c5,
107};
108
109static u64 amd_pmu_event_map(int hw_event)
110{
111 return amd_perfmon_event_map[hw_event];
112}
113
114static u64 amd_pmu_raw_event(u64 hw_event)
115{
116#define K7_EVNTSEL_EVENT_MASK 0xF000000FFULL
117#define K7_EVNTSEL_UNIT_MASK 0x00000FF00ULL
118#define K7_EVNTSEL_EDGE_MASK 0x000040000ULL
119#define K7_EVNTSEL_INV_MASK 0x000800000ULL
120#define K7_EVNTSEL_REG_MASK 0x0FF000000ULL
121
122#define K7_EVNTSEL_MASK \
123 (K7_EVNTSEL_EVENT_MASK | \
124 K7_EVNTSEL_UNIT_MASK | \
125 K7_EVNTSEL_EDGE_MASK | \
126 K7_EVNTSEL_INV_MASK | \
127 K7_EVNTSEL_REG_MASK)
128
129 return hw_event & K7_EVNTSEL_MASK;
130}
131
132/*
133 * AMD64 events are detected based on their event codes.
134 */
135static inline int amd_is_nb_event(struct hw_perf_event *hwc)
136{
137 return (hwc->config & 0xe0) == 0xe0;
138}
139
140static void amd_put_event_constraints(struct cpu_hw_events *cpuc,
141 struct perf_event *event)
142{
143 struct hw_perf_event *hwc = &event->hw;
144 struct amd_nb *nb = cpuc->amd_nb;
145 int i;
146
147 /*
148 * only care about NB events
149 */
150 if (!(nb && amd_is_nb_event(hwc)))
151 return;
152
153 /*
154 * need to scan whole list because event may not have
155 * been assigned during scheduling
156 *
157 * no race condition possible because event can only
158 * be removed on one CPU at a time AND PMU is disabled
159 * when we come here
160 */
161 for (i = 0; i < x86_pmu.num_events; i++) {
162 if (nb->owners[i] == event) {
163 cmpxchg(nb->owners+i, event, NULL);
164 break;
165 }
166 }
167}
168
169 /*
170 * AMD64 NorthBridge events need special treatment because
171 * counter access needs to be synchronized across all cores
172 * of a package. Refer to BKDG section 3.12
173 *
174 * NB events are events measuring L3 cache, Hypertransport
175 * traffic. They are identified by an event code >= 0xe00.
176 * They measure events on the NorthBride which is shared
177 * by all cores on a package. NB events are counted on a
178 * shared set of counters. When a NB event is programmed
179 * in a counter, the data actually comes from a shared
180 * counter. Thus, access to those counters needs to be
181 * synchronized.
182 *
183 * We implement the synchronization such that no two cores
184 * can be measuring NB events using the same counters. Thus,
185 * we maintain a per-NB allocation table. The available slot
186 * is propagated using the event_constraint structure.
187 *
188 * We provide only one choice for each NB event based on
189 * the fact that only NB events have restrictions. Consequently,
190 * if a counter is available, there is a guarantee the NB event
191 * will be assigned to it. If no slot is available, an empty
192 * constraint is returned and scheduling will eventually fail
193 * for this event.
194 *
195 * Note that all cores attached the same NB compete for the same
196 * counters to host NB events, this is why we use atomic ops. Some
197 * multi-chip CPUs may have more than one NB.
198 *
199 * Given that resources are allocated (cmpxchg), they must be
200 * eventually freed for others to use. This is accomplished by
201 * calling amd_put_event_constraints().
202 *
203 * Non NB events are not impacted by this restriction.
204 */
205static struct event_constraint *
206amd_get_event_constraints(struct cpu_hw_events *cpuc, struct perf_event *event)
207{
208 struct hw_perf_event *hwc = &event->hw;
209 struct amd_nb *nb = cpuc->amd_nb;
210 struct perf_event *old = NULL;
211 int max = x86_pmu.num_events;
212 int i, j, k = -1;
213
214 /*
215 * if not NB event or no NB, then no constraints
216 */
217 if (!(nb && amd_is_nb_event(hwc)))
218 return &unconstrained;
219
220 /*
221 * detect if already present, if so reuse
222 *
223 * cannot merge with actual allocation
224 * because of possible holes
225 *
226 * event can already be present yet not assigned (in hwc->idx)
227 * because of successive calls to x86_schedule_events() from
228 * hw_perf_group_sched_in() without hw_perf_enable()
229 */
230 for (i = 0; i < max; i++) {
231 /*
232 * keep track of first free slot
233 */
234 if (k == -1 && !nb->owners[i])
235 k = i;
236
237 /* already present, reuse */
238 if (nb->owners[i] == event)
239 goto done;
240 }
241 /*
242 * not present, so grab a new slot
243 * starting either at:
244 */
245 if (hwc->idx != -1) {
246 /* previous assignment */
247 i = hwc->idx;
248 } else if (k != -1) {
249 /* start from free slot found */
250 i = k;
251 } else {
252 /*
253 * event not found, no slot found in
254 * first pass, try again from the
255 * beginning
256 */
257 i = 0;
258 }
259 j = i;
260 do {
261 old = cmpxchg(nb->owners+i, NULL, event);
262 if (!old)
263 break;
264 if (++i == max)
265 i = 0;
266 } while (i != j);
267done:
268 if (!old)
269 return &nb->event_constraints[i];
270
271 return &emptyconstraint;
272}
273
274static __initconst struct x86_pmu amd_pmu = {
275 .name = "AMD",
276 .handle_irq = x86_pmu_handle_irq,
277 .disable_all = x86_pmu_disable_all,
278 .enable_all = x86_pmu_enable_all,
279 .enable = x86_pmu_enable_event,
280 .disable = x86_pmu_disable_event,
281 .eventsel = MSR_K7_EVNTSEL0,
282 .perfctr = MSR_K7_PERFCTR0,
283 .event_map = amd_pmu_event_map,
284 .raw_event = amd_pmu_raw_event,
285 .max_events = ARRAY_SIZE(amd_perfmon_event_map),
286 .num_events = 4,
287 .event_bits = 48,
288 .event_mask = (1ULL << 48) - 1,
289 .apic = 1,
290 /* use highest bit to detect overflow */
291 .max_period = (1ULL << 47) - 1,
292 .get_event_constraints = amd_get_event_constraints,
293 .put_event_constraints = amd_put_event_constraints
294};
295
296static struct amd_nb *amd_alloc_nb(int cpu, int nb_id)
297{
298 struct amd_nb *nb;
299 int i;
300
301 nb = kmalloc(sizeof(struct amd_nb), GFP_KERNEL);
302 if (!nb)
303 return NULL;
304
305 memset(nb, 0, sizeof(*nb));
306 nb->nb_id = nb_id;
307
308 /*
309 * initialize all possible NB constraints
310 */
311 for (i = 0; i < x86_pmu.num_events; i++) {
312 set_bit(i, nb->event_constraints[i].idxmsk);
313 nb->event_constraints[i].weight = 1;
314 }
315 return nb;
316}
317
318static void amd_pmu_cpu_online(int cpu)
319{
320 struct cpu_hw_events *cpu1, *cpu2;
321 struct amd_nb *nb = NULL;
322 int i, nb_id;
323
324 if (boot_cpu_data.x86_max_cores < 2)
325 return;
326
327 /*
328 * function may be called too early in the
329 * boot process, in which case nb_id is bogus
330 */
331 nb_id = amd_get_nb_id(cpu);
332 if (nb_id == BAD_APICID)
333 return;
334
335 cpu1 = &per_cpu(cpu_hw_events, cpu);
336 cpu1->amd_nb = NULL;
337
338 raw_spin_lock(&amd_nb_lock);
339
340 for_each_online_cpu(i) {
341 cpu2 = &per_cpu(cpu_hw_events, i);
342 nb = cpu2->amd_nb;
343 if (!nb)
344 continue;
345 if (nb->nb_id == nb_id)
346 goto found;
347 }
348
349 nb = amd_alloc_nb(cpu, nb_id);
350 if (!nb) {
351 pr_err("perf_events: failed NB allocation for CPU%d\n", cpu);
352 raw_spin_unlock(&amd_nb_lock);
353 return;
354 }
355found:
356 nb->refcnt++;
357 cpu1->amd_nb = nb;
358
359 raw_spin_unlock(&amd_nb_lock);
360}
361
362static void amd_pmu_cpu_offline(int cpu)
363{
364 struct cpu_hw_events *cpuhw;
365
366 if (boot_cpu_data.x86_max_cores < 2)
367 return;
368
369 cpuhw = &per_cpu(cpu_hw_events, cpu);
370
371 raw_spin_lock(&amd_nb_lock);
372
373 if (--cpuhw->amd_nb->refcnt == 0)
374 kfree(cpuhw->amd_nb);
375
376 cpuhw->amd_nb = NULL;
377
378 raw_spin_unlock(&amd_nb_lock);
379}
380
381static __init int amd_pmu_init(void)
382{
383 /* Performance-monitoring supported from K7 and later: */
384 if (boot_cpu_data.x86 < 6)
385 return -ENODEV;
386
387 x86_pmu = amd_pmu;
388
389 /* Events are common for all AMDs */
390 memcpy(hw_cache_event_ids, amd_hw_cache_event_ids,
391 sizeof(hw_cache_event_ids));
392
393 /*
394 * explicitly initialize the boot cpu, other cpus will get
395 * the cpu hotplug callbacks from smp_init()
396 */
397 amd_pmu_cpu_online(smp_processor_id());
398 return 0;
399}
400
401#else /* CONFIG_CPU_SUP_AMD */
402
403static int amd_pmu_init(void)
404{
405 return 0;
406}
407
408static void amd_pmu_cpu_online(int cpu)
409{
410}
411
412static void amd_pmu_cpu_offline(int cpu)
413{
414}
415
416#endif
diff --git a/arch/x86/kernel/cpu/perf_event_intel.c b/arch/x86/kernel/cpu/perf_event_intel.c
new file mode 100644
index 000000000000..cf6590cf4a5f
--- /dev/null
+++ b/arch/x86/kernel/cpu/perf_event_intel.c
@@ -0,0 +1,971 @@
1#ifdef CONFIG_CPU_SUP_INTEL
2
3/*
4 * Intel PerfMon v3. Used on Core2 and later.
5 */
6static const u64 intel_perfmon_event_map[] =
7{
8 [PERF_COUNT_HW_CPU_CYCLES] = 0x003c,
9 [PERF_COUNT_HW_INSTRUCTIONS] = 0x00c0,
10 [PERF_COUNT_HW_CACHE_REFERENCES] = 0x4f2e,
11 [PERF_COUNT_HW_CACHE_MISSES] = 0x412e,
12 [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = 0x00c4,
13 [PERF_COUNT_HW_BRANCH_MISSES] = 0x00c5,
14 [PERF_COUNT_HW_BUS_CYCLES] = 0x013c,
15};
16
17static struct event_constraint intel_core_event_constraints[] =
18{
19 INTEL_EVENT_CONSTRAINT(0x11, 0x2), /* FP_ASSIST */
20 INTEL_EVENT_CONSTRAINT(0x12, 0x2), /* MUL */
21 INTEL_EVENT_CONSTRAINT(0x13, 0x2), /* DIV */
22 INTEL_EVENT_CONSTRAINT(0x14, 0x1), /* CYCLES_DIV_BUSY */
23 INTEL_EVENT_CONSTRAINT(0x19, 0x2), /* DELAYED_BYPASS */
24 INTEL_EVENT_CONSTRAINT(0xc1, 0x1), /* FP_COMP_INSTR_RET */
25 EVENT_CONSTRAINT_END
26};
27
28static struct event_constraint intel_core2_event_constraints[] =
29{
30 FIXED_EVENT_CONSTRAINT(0xc0, (0x3|(1ULL<<32))), /* INSTRUCTIONS_RETIRED */
31 FIXED_EVENT_CONSTRAINT(0x3c, (0x3|(1ULL<<33))), /* UNHALTED_CORE_CYCLES */
32 INTEL_EVENT_CONSTRAINT(0x10, 0x1), /* FP_COMP_OPS_EXE */
33 INTEL_EVENT_CONSTRAINT(0x11, 0x2), /* FP_ASSIST */
34 INTEL_EVENT_CONSTRAINT(0x12, 0x2), /* MUL */
35 INTEL_EVENT_CONSTRAINT(0x13, 0x2), /* DIV */
36 INTEL_EVENT_CONSTRAINT(0x14, 0x1), /* CYCLES_DIV_BUSY */
37 INTEL_EVENT_CONSTRAINT(0x18, 0x1), /* IDLE_DURING_DIV */
38 INTEL_EVENT_CONSTRAINT(0x19, 0x2), /* DELAYED_BYPASS */
39 INTEL_EVENT_CONSTRAINT(0xa1, 0x1), /* RS_UOPS_DISPATCH_CYCLES */
40 INTEL_EVENT_CONSTRAINT(0xcb, 0x1), /* MEM_LOAD_RETIRED */
41 EVENT_CONSTRAINT_END
42};
43
44static struct event_constraint intel_nehalem_event_constraints[] =
45{
46 FIXED_EVENT_CONSTRAINT(0xc0, (0xf|(1ULL<<32))), /* INSTRUCTIONS_RETIRED */
47 FIXED_EVENT_CONSTRAINT(0x3c, (0xf|(1ULL<<33))), /* UNHALTED_CORE_CYCLES */
48 INTEL_EVENT_CONSTRAINT(0x40, 0x3), /* L1D_CACHE_LD */
49 INTEL_EVENT_CONSTRAINT(0x41, 0x3), /* L1D_CACHE_ST */
50 INTEL_EVENT_CONSTRAINT(0x42, 0x3), /* L1D_CACHE_LOCK */
51 INTEL_EVENT_CONSTRAINT(0x43, 0x3), /* L1D_ALL_REF */
52 INTEL_EVENT_CONSTRAINT(0x48, 0x3), /* L1D_PEND_MISS */
53 INTEL_EVENT_CONSTRAINT(0x4e, 0x3), /* L1D_PREFETCH */
54 INTEL_EVENT_CONSTRAINT(0x51, 0x3), /* L1D */
55 INTEL_EVENT_CONSTRAINT(0x63, 0x3), /* CACHE_LOCK_CYCLES */
56 EVENT_CONSTRAINT_END
57};
58
59static struct event_constraint intel_westmere_event_constraints[] =
60{
61 FIXED_EVENT_CONSTRAINT(0xc0, (0xf|(1ULL<<32))), /* INSTRUCTIONS_RETIRED */
62 FIXED_EVENT_CONSTRAINT(0x3c, (0xf|(1ULL<<33))), /* UNHALTED_CORE_CYCLES */
63 INTEL_EVENT_CONSTRAINT(0x51, 0x3), /* L1D */
64 INTEL_EVENT_CONSTRAINT(0x60, 0x1), /* OFFCORE_REQUESTS_OUTSTANDING */
65 INTEL_EVENT_CONSTRAINT(0x63, 0x3), /* CACHE_LOCK_CYCLES */
66 EVENT_CONSTRAINT_END
67};
68
69static struct event_constraint intel_gen_event_constraints[] =
70{
71 FIXED_EVENT_CONSTRAINT(0xc0, (0x3|(1ULL<<32))), /* INSTRUCTIONS_RETIRED */
72 FIXED_EVENT_CONSTRAINT(0x3c, (0x3|(1ULL<<33))), /* UNHALTED_CORE_CYCLES */
73 EVENT_CONSTRAINT_END
74};
75
76static u64 intel_pmu_event_map(int hw_event)
77{
78 return intel_perfmon_event_map[hw_event];
79}
80
81static __initconst u64 westmere_hw_cache_event_ids
82 [PERF_COUNT_HW_CACHE_MAX]
83 [PERF_COUNT_HW_CACHE_OP_MAX]
84 [PERF_COUNT_HW_CACHE_RESULT_MAX] =
85{
86 [ C(L1D) ] = {
87 [ C(OP_READ) ] = {
88 [ C(RESULT_ACCESS) ] = 0x010b, /* MEM_INST_RETIRED.LOADS */
89 [ C(RESULT_MISS) ] = 0x0151, /* L1D.REPL */
90 },
91 [ C(OP_WRITE) ] = {
92 [ C(RESULT_ACCESS) ] = 0x020b, /* MEM_INST_RETURED.STORES */
93 [ C(RESULT_MISS) ] = 0x0251, /* L1D.M_REPL */
94 },
95 [ C(OP_PREFETCH) ] = {
96 [ C(RESULT_ACCESS) ] = 0x014e, /* L1D_PREFETCH.REQUESTS */
97 [ C(RESULT_MISS) ] = 0x024e, /* L1D_PREFETCH.MISS */
98 },
99 },
100 [ C(L1I ) ] = {
101 [ C(OP_READ) ] = {
102 [ C(RESULT_ACCESS) ] = 0x0380, /* L1I.READS */
103 [ C(RESULT_MISS) ] = 0x0280, /* L1I.MISSES */
104 },
105 [ C(OP_WRITE) ] = {
106 [ C(RESULT_ACCESS) ] = -1,
107 [ C(RESULT_MISS) ] = -1,
108 },
109 [ C(OP_PREFETCH) ] = {
110 [ C(RESULT_ACCESS) ] = 0x0,
111 [ C(RESULT_MISS) ] = 0x0,
112 },
113 },
114 [ C(LL ) ] = {
115 [ C(OP_READ) ] = {
116 [ C(RESULT_ACCESS) ] = 0x0324, /* L2_RQSTS.LOADS */
117 [ C(RESULT_MISS) ] = 0x0224, /* L2_RQSTS.LD_MISS */
118 },
119 [ C(OP_WRITE) ] = {
120 [ C(RESULT_ACCESS) ] = 0x0c24, /* L2_RQSTS.RFOS */
121 [ C(RESULT_MISS) ] = 0x0824, /* L2_RQSTS.RFO_MISS */
122 },
123 [ C(OP_PREFETCH) ] = {
124 [ C(RESULT_ACCESS) ] = 0x4f2e, /* LLC Reference */
125 [ C(RESULT_MISS) ] = 0x412e, /* LLC Misses */
126 },
127 },
128 [ C(DTLB) ] = {
129 [ C(OP_READ) ] = {
130 [ C(RESULT_ACCESS) ] = 0x010b, /* MEM_INST_RETIRED.LOADS */
131 [ C(RESULT_MISS) ] = 0x0108, /* DTLB_LOAD_MISSES.ANY */
132 },
133 [ C(OP_WRITE) ] = {
134 [ C(RESULT_ACCESS) ] = 0x020b, /* MEM_INST_RETURED.STORES */
135 [ C(RESULT_MISS) ] = 0x010c, /* MEM_STORE_RETIRED.DTLB_MISS */
136 },
137 [ C(OP_PREFETCH) ] = {
138 [ C(RESULT_ACCESS) ] = 0x0,
139 [ C(RESULT_MISS) ] = 0x0,
140 },
141 },
142 [ C(ITLB) ] = {
143 [ C(OP_READ) ] = {
144 [ C(RESULT_ACCESS) ] = 0x01c0, /* INST_RETIRED.ANY_P */
145 [ C(RESULT_MISS) ] = 0x0185, /* ITLB_MISSES.ANY */
146 },
147 [ C(OP_WRITE) ] = {
148 [ C(RESULT_ACCESS) ] = -1,
149 [ C(RESULT_MISS) ] = -1,
150 },
151 [ C(OP_PREFETCH) ] = {
152 [ C(RESULT_ACCESS) ] = -1,
153 [ C(RESULT_MISS) ] = -1,
154 },
155 },
156 [ C(BPU ) ] = {
157 [ C(OP_READ) ] = {
158 [ C(RESULT_ACCESS) ] = 0x00c4, /* BR_INST_RETIRED.ALL_BRANCHES */
159 [ C(RESULT_MISS) ] = 0x03e8, /* BPU_CLEARS.ANY */
160 },
161 [ C(OP_WRITE) ] = {
162 [ C(RESULT_ACCESS) ] = -1,
163 [ C(RESULT_MISS) ] = -1,
164 },
165 [ C(OP_PREFETCH) ] = {
166 [ C(RESULT_ACCESS) ] = -1,
167 [ C(RESULT_MISS) ] = -1,
168 },
169 },
170};
171
172static __initconst u64 nehalem_hw_cache_event_ids
173 [PERF_COUNT_HW_CACHE_MAX]
174 [PERF_COUNT_HW_CACHE_OP_MAX]
175 [PERF_COUNT_HW_CACHE_RESULT_MAX] =
176{
177 [ C(L1D) ] = {
178 [ C(OP_READ) ] = {
179 [ C(RESULT_ACCESS) ] = 0x0f40, /* L1D_CACHE_LD.MESI */
180 [ C(RESULT_MISS) ] = 0x0140, /* L1D_CACHE_LD.I_STATE */
181 },
182 [ C(OP_WRITE) ] = {
183 [ C(RESULT_ACCESS) ] = 0x0f41, /* L1D_CACHE_ST.MESI */
184 [ C(RESULT_MISS) ] = 0x0141, /* L1D_CACHE_ST.I_STATE */
185 },
186 [ C(OP_PREFETCH) ] = {
187 [ C(RESULT_ACCESS) ] = 0x014e, /* L1D_PREFETCH.REQUESTS */
188 [ C(RESULT_MISS) ] = 0x024e, /* L1D_PREFETCH.MISS */
189 },
190 },
191 [ C(L1I ) ] = {
192 [ C(OP_READ) ] = {
193 [ C(RESULT_ACCESS) ] = 0x0380, /* L1I.READS */
194 [ C(RESULT_MISS) ] = 0x0280, /* L1I.MISSES */
195 },
196 [ C(OP_WRITE) ] = {
197 [ C(RESULT_ACCESS) ] = -1,
198 [ C(RESULT_MISS) ] = -1,
199 },
200 [ C(OP_PREFETCH) ] = {
201 [ C(RESULT_ACCESS) ] = 0x0,
202 [ C(RESULT_MISS) ] = 0x0,
203 },
204 },
205 [ C(LL ) ] = {
206 [ C(OP_READ) ] = {
207 [ C(RESULT_ACCESS) ] = 0x0324, /* L2_RQSTS.LOADS */
208 [ C(RESULT_MISS) ] = 0x0224, /* L2_RQSTS.LD_MISS */
209 },
210 [ C(OP_WRITE) ] = {
211 [ C(RESULT_ACCESS) ] = 0x0c24, /* L2_RQSTS.RFOS */
212 [ C(RESULT_MISS) ] = 0x0824, /* L2_RQSTS.RFO_MISS */
213 },
214 [ C(OP_PREFETCH) ] = {
215 [ C(RESULT_ACCESS) ] = 0x4f2e, /* LLC Reference */
216 [ C(RESULT_MISS) ] = 0x412e, /* LLC Misses */
217 },
218 },
219 [ C(DTLB) ] = {
220 [ C(OP_READ) ] = {
221 [ C(RESULT_ACCESS) ] = 0x0f40, /* L1D_CACHE_LD.MESI (alias) */
222 [ C(RESULT_MISS) ] = 0x0108, /* DTLB_LOAD_MISSES.ANY */
223 },
224 [ C(OP_WRITE) ] = {
225 [ C(RESULT_ACCESS) ] = 0x0f41, /* L1D_CACHE_ST.MESI (alias) */
226 [ C(RESULT_MISS) ] = 0x010c, /* MEM_STORE_RETIRED.DTLB_MISS */
227 },
228 [ C(OP_PREFETCH) ] = {
229 [ C(RESULT_ACCESS) ] = 0x0,
230 [ C(RESULT_MISS) ] = 0x0,
231 },
232 },
233 [ C(ITLB) ] = {
234 [ C(OP_READ) ] = {
235 [ C(RESULT_ACCESS) ] = 0x01c0, /* INST_RETIRED.ANY_P */
236 [ C(RESULT_MISS) ] = 0x20c8, /* ITLB_MISS_RETIRED */
237 },
238 [ C(OP_WRITE) ] = {
239 [ C(RESULT_ACCESS) ] = -1,
240 [ C(RESULT_MISS) ] = -1,
241 },
242 [ C(OP_PREFETCH) ] = {
243 [ C(RESULT_ACCESS) ] = -1,
244 [ C(RESULT_MISS) ] = -1,
245 },
246 },
247 [ C(BPU ) ] = {
248 [ C(OP_READ) ] = {
249 [ C(RESULT_ACCESS) ] = 0x00c4, /* BR_INST_RETIRED.ALL_BRANCHES */
250 [ C(RESULT_MISS) ] = 0x03e8, /* BPU_CLEARS.ANY */
251 },
252 [ C(OP_WRITE) ] = {
253 [ C(RESULT_ACCESS) ] = -1,
254 [ C(RESULT_MISS) ] = -1,
255 },
256 [ C(OP_PREFETCH) ] = {
257 [ C(RESULT_ACCESS) ] = -1,
258 [ C(RESULT_MISS) ] = -1,
259 },
260 },
261};
262
263static __initconst u64 core2_hw_cache_event_ids
264 [PERF_COUNT_HW_CACHE_MAX]
265 [PERF_COUNT_HW_CACHE_OP_MAX]
266 [PERF_COUNT_HW_CACHE_RESULT_MAX] =
267{
268 [ C(L1D) ] = {
269 [ C(OP_READ) ] = {
270 [ C(RESULT_ACCESS) ] = 0x0f40, /* L1D_CACHE_LD.MESI */
271 [ C(RESULT_MISS) ] = 0x0140, /* L1D_CACHE_LD.I_STATE */
272 },
273 [ C(OP_WRITE) ] = {
274 [ C(RESULT_ACCESS) ] = 0x0f41, /* L1D_CACHE_ST.MESI */
275 [ C(RESULT_MISS) ] = 0x0141, /* L1D_CACHE_ST.I_STATE */
276 },
277 [ C(OP_PREFETCH) ] = {
278 [ C(RESULT_ACCESS) ] = 0x104e, /* L1D_PREFETCH.REQUESTS */
279 [ C(RESULT_MISS) ] = 0,
280 },
281 },
282 [ C(L1I ) ] = {
283 [ C(OP_READ) ] = {
284 [ C(RESULT_ACCESS) ] = 0x0080, /* L1I.READS */
285 [ C(RESULT_MISS) ] = 0x0081, /* L1I.MISSES */
286 },
287 [ C(OP_WRITE) ] = {
288 [ C(RESULT_ACCESS) ] = -1,
289 [ C(RESULT_MISS) ] = -1,
290 },
291 [ C(OP_PREFETCH) ] = {
292 [ C(RESULT_ACCESS) ] = 0,
293 [ C(RESULT_MISS) ] = 0,
294 },
295 },
296 [ C(LL ) ] = {
297 [ C(OP_READ) ] = {
298 [ C(RESULT_ACCESS) ] = 0x4f29, /* L2_LD.MESI */
299 [ C(RESULT_MISS) ] = 0x4129, /* L2_LD.ISTATE */
300 },
301 [ C(OP_WRITE) ] = {
302 [ C(RESULT_ACCESS) ] = 0x4f2A, /* L2_ST.MESI */
303 [ C(RESULT_MISS) ] = 0x412A, /* L2_ST.ISTATE */
304 },
305 [ C(OP_PREFETCH) ] = {
306 [ C(RESULT_ACCESS) ] = 0,
307 [ C(RESULT_MISS) ] = 0,
308 },
309 },
310 [ C(DTLB) ] = {
311 [ C(OP_READ) ] = {
312 [ C(RESULT_ACCESS) ] = 0x0f40, /* L1D_CACHE_LD.MESI (alias) */
313 [ C(RESULT_MISS) ] = 0x0208, /* DTLB_MISSES.MISS_LD */
314 },
315 [ C(OP_WRITE) ] = {
316 [ C(RESULT_ACCESS) ] = 0x0f41, /* L1D_CACHE_ST.MESI (alias) */
317 [ C(RESULT_MISS) ] = 0x0808, /* DTLB_MISSES.MISS_ST */
318 },
319 [ C(OP_PREFETCH) ] = {
320 [ C(RESULT_ACCESS) ] = 0,
321 [ C(RESULT_MISS) ] = 0,
322 },
323 },
324 [ C(ITLB) ] = {
325 [ C(OP_READ) ] = {
326 [ C(RESULT_ACCESS) ] = 0x00c0, /* INST_RETIRED.ANY_P */
327 [ C(RESULT_MISS) ] = 0x1282, /* ITLBMISSES */
328 },
329 [ C(OP_WRITE) ] = {
330 [ C(RESULT_ACCESS) ] = -1,
331 [ C(RESULT_MISS) ] = -1,
332 },
333 [ C(OP_PREFETCH) ] = {
334 [ C(RESULT_ACCESS) ] = -1,
335 [ C(RESULT_MISS) ] = -1,
336 },
337 },
338 [ C(BPU ) ] = {
339 [ C(OP_READ) ] = {
340 [ C(RESULT_ACCESS) ] = 0x00c4, /* BR_INST_RETIRED.ANY */
341 [ C(RESULT_MISS) ] = 0x00c5, /* BP_INST_RETIRED.MISPRED */
342 },
343 [ C(OP_WRITE) ] = {
344 [ C(RESULT_ACCESS) ] = -1,
345 [ C(RESULT_MISS) ] = -1,
346 },
347 [ C(OP_PREFETCH) ] = {
348 [ C(RESULT_ACCESS) ] = -1,
349 [ C(RESULT_MISS) ] = -1,
350 },
351 },
352};
353
354static __initconst u64 atom_hw_cache_event_ids
355 [PERF_COUNT_HW_CACHE_MAX]
356 [PERF_COUNT_HW_CACHE_OP_MAX]
357 [PERF_COUNT_HW_CACHE_RESULT_MAX] =
358{
359 [ C(L1D) ] = {
360 [ C(OP_READ) ] = {
361 [ C(RESULT_ACCESS) ] = 0x2140, /* L1D_CACHE.LD */
362 [ C(RESULT_MISS) ] = 0,
363 },
364 [ C(OP_WRITE) ] = {
365 [ C(RESULT_ACCESS) ] = 0x2240, /* L1D_CACHE.ST */
366 [ C(RESULT_MISS) ] = 0,
367 },
368 [ C(OP_PREFETCH) ] = {
369 [ C(RESULT_ACCESS) ] = 0x0,
370 [ C(RESULT_MISS) ] = 0,
371 },
372 },
373 [ C(L1I ) ] = {
374 [ C(OP_READ) ] = {
375 [ C(RESULT_ACCESS) ] = 0x0380, /* L1I.READS */
376 [ C(RESULT_MISS) ] = 0x0280, /* L1I.MISSES */
377 },
378 [ C(OP_WRITE) ] = {
379 [ C(RESULT_ACCESS) ] = -1,
380 [ C(RESULT_MISS) ] = -1,
381 },
382 [ C(OP_PREFETCH) ] = {
383 [ C(RESULT_ACCESS) ] = 0,
384 [ C(RESULT_MISS) ] = 0,
385 },
386 },
387 [ C(LL ) ] = {
388 [ C(OP_READ) ] = {
389 [ C(RESULT_ACCESS) ] = 0x4f29, /* L2_LD.MESI */
390 [ C(RESULT_MISS) ] = 0x4129, /* L2_LD.ISTATE */
391 },
392 [ C(OP_WRITE) ] = {
393 [ C(RESULT_ACCESS) ] = 0x4f2A, /* L2_ST.MESI */
394 [ C(RESULT_MISS) ] = 0x412A, /* L2_ST.ISTATE */
395 },
396 [ C(OP_PREFETCH) ] = {
397 [ C(RESULT_ACCESS) ] = 0,
398 [ C(RESULT_MISS) ] = 0,
399 },
400 },
401 [ C(DTLB) ] = {
402 [ C(OP_READ) ] = {
403 [ C(RESULT_ACCESS) ] = 0x2140, /* L1D_CACHE_LD.MESI (alias) */
404 [ C(RESULT_MISS) ] = 0x0508, /* DTLB_MISSES.MISS_LD */
405 },
406 [ C(OP_WRITE) ] = {
407 [ C(RESULT_ACCESS) ] = 0x2240, /* L1D_CACHE_ST.MESI (alias) */
408 [ C(RESULT_MISS) ] = 0x0608, /* DTLB_MISSES.MISS_ST */
409 },
410 [ C(OP_PREFETCH) ] = {
411 [ C(RESULT_ACCESS) ] = 0,
412 [ C(RESULT_MISS) ] = 0,
413 },
414 },
415 [ C(ITLB) ] = {
416 [ C(OP_READ) ] = {
417 [ C(RESULT_ACCESS) ] = 0x00c0, /* INST_RETIRED.ANY_P */
418 [ C(RESULT_MISS) ] = 0x0282, /* ITLB.MISSES */
419 },
420 [ C(OP_WRITE) ] = {
421 [ C(RESULT_ACCESS) ] = -1,
422 [ C(RESULT_MISS) ] = -1,
423 },
424 [ C(OP_PREFETCH) ] = {
425 [ C(RESULT_ACCESS) ] = -1,
426 [ C(RESULT_MISS) ] = -1,
427 },
428 },
429 [ C(BPU ) ] = {
430 [ C(OP_READ) ] = {
431 [ C(RESULT_ACCESS) ] = 0x00c4, /* BR_INST_RETIRED.ANY */
432 [ C(RESULT_MISS) ] = 0x00c5, /* BP_INST_RETIRED.MISPRED */
433 },
434 [ C(OP_WRITE) ] = {
435 [ C(RESULT_ACCESS) ] = -1,
436 [ C(RESULT_MISS) ] = -1,
437 },
438 [ C(OP_PREFETCH) ] = {
439 [ C(RESULT_ACCESS) ] = -1,
440 [ C(RESULT_MISS) ] = -1,
441 },
442 },
443};
444
445static u64 intel_pmu_raw_event(u64 hw_event)
446{
447#define CORE_EVNTSEL_EVENT_MASK 0x000000FFULL
448#define CORE_EVNTSEL_UNIT_MASK 0x0000FF00ULL
449#define CORE_EVNTSEL_EDGE_MASK 0x00040000ULL
450#define CORE_EVNTSEL_INV_MASK 0x00800000ULL
451#define CORE_EVNTSEL_REG_MASK 0xFF000000ULL
452
453#define CORE_EVNTSEL_MASK \
454 (INTEL_ARCH_EVTSEL_MASK | \
455 INTEL_ARCH_UNIT_MASK | \
456 INTEL_ARCH_EDGE_MASK | \
457 INTEL_ARCH_INV_MASK | \
458 INTEL_ARCH_CNT_MASK)
459
460 return hw_event & CORE_EVNTSEL_MASK;
461}
462
463static void intel_pmu_enable_bts(u64 config)
464{
465 unsigned long debugctlmsr;
466
467 debugctlmsr = get_debugctlmsr();
468
469 debugctlmsr |= X86_DEBUGCTL_TR;
470 debugctlmsr |= X86_DEBUGCTL_BTS;
471 debugctlmsr |= X86_DEBUGCTL_BTINT;
472
473 if (!(config & ARCH_PERFMON_EVENTSEL_OS))
474 debugctlmsr |= X86_DEBUGCTL_BTS_OFF_OS;
475
476 if (!(config & ARCH_PERFMON_EVENTSEL_USR))
477 debugctlmsr |= X86_DEBUGCTL_BTS_OFF_USR;
478
479 update_debugctlmsr(debugctlmsr);
480}
481
482static void intel_pmu_disable_bts(void)
483{
484 struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
485 unsigned long debugctlmsr;
486
487 if (!cpuc->ds)
488 return;
489
490 debugctlmsr = get_debugctlmsr();
491
492 debugctlmsr &=
493 ~(X86_DEBUGCTL_TR | X86_DEBUGCTL_BTS | X86_DEBUGCTL_BTINT |
494 X86_DEBUGCTL_BTS_OFF_OS | X86_DEBUGCTL_BTS_OFF_USR);
495
496 update_debugctlmsr(debugctlmsr);
497}
498
499static void intel_pmu_disable_all(void)
500{
501 struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
502
503 wrmsrl(MSR_CORE_PERF_GLOBAL_CTRL, 0);
504
505 if (test_bit(X86_PMC_IDX_FIXED_BTS, cpuc->active_mask))
506 intel_pmu_disable_bts();
507}
508
509static void intel_pmu_enable_all(void)
510{
511 struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
512
513 wrmsrl(MSR_CORE_PERF_GLOBAL_CTRL, x86_pmu.intel_ctrl);
514
515 if (test_bit(X86_PMC_IDX_FIXED_BTS, cpuc->active_mask)) {
516 struct perf_event *event =
517 cpuc->events[X86_PMC_IDX_FIXED_BTS];
518
519 if (WARN_ON_ONCE(!event))
520 return;
521
522 intel_pmu_enable_bts(event->hw.config);
523 }
524}
525
526static inline u64 intel_pmu_get_status(void)
527{
528 u64 status;
529
530 rdmsrl(MSR_CORE_PERF_GLOBAL_STATUS, status);
531
532 return status;
533}
534
535static inline void intel_pmu_ack_status(u64 ack)
536{
537 wrmsrl(MSR_CORE_PERF_GLOBAL_OVF_CTRL, ack);
538}
539
540static inline void
541intel_pmu_disable_fixed(struct hw_perf_event *hwc, int __idx)
542{
543 int idx = __idx - X86_PMC_IDX_FIXED;
544 u64 ctrl_val, mask;
545
546 mask = 0xfULL << (idx * 4);
547
548 rdmsrl(hwc->config_base, ctrl_val);
549 ctrl_val &= ~mask;
550 (void)checking_wrmsrl(hwc->config_base, ctrl_val);
551}
552
553static void intel_pmu_drain_bts_buffer(void)
554{
555 struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
556 struct debug_store *ds = cpuc->ds;
557 struct bts_record {
558 u64 from;
559 u64 to;
560 u64 flags;
561 };
562 struct perf_event *event = cpuc->events[X86_PMC_IDX_FIXED_BTS];
563 struct bts_record *at, *top;
564 struct perf_output_handle handle;
565 struct perf_event_header header;
566 struct perf_sample_data data;
567 struct pt_regs regs;
568
569 if (!event)
570 return;
571
572 if (!ds)
573 return;
574
575 at = (struct bts_record *)(unsigned long)ds->bts_buffer_base;
576 top = (struct bts_record *)(unsigned long)ds->bts_index;
577
578 if (top <= at)
579 return;
580
581 ds->bts_index = ds->bts_buffer_base;
582
583
584 data.period = event->hw.last_period;
585 data.addr = 0;
586 data.raw = NULL;
587 regs.ip = 0;
588
589 /*
590 * Prepare a generic sample, i.e. fill in the invariant fields.
591 * We will overwrite the from and to address before we output
592 * the sample.
593 */
594 perf_prepare_sample(&header, &data, event, &regs);
595
596 if (perf_output_begin(&handle, event,
597 header.size * (top - at), 1, 1))
598 return;
599
600 for (; at < top; at++) {
601 data.ip = at->from;
602 data.addr = at->to;
603
604 perf_output_sample(&handle, &header, &data, event);
605 }
606
607 perf_output_end(&handle);
608
609 /* There's new data available. */
610 event->hw.interrupts++;
611 event->pending_kill = POLL_IN;
612}
613
614static inline void
615intel_pmu_disable_event(struct hw_perf_event *hwc, int idx)
616{
617 if (unlikely(idx == X86_PMC_IDX_FIXED_BTS)) {
618 intel_pmu_disable_bts();
619 intel_pmu_drain_bts_buffer();
620 return;
621 }
622
623 if (unlikely(hwc->config_base == MSR_ARCH_PERFMON_FIXED_CTR_CTRL)) {
624 intel_pmu_disable_fixed(hwc, idx);
625 return;
626 }
627
628 x86_pmu_disable_event(hwc, idx);
629}
630
631static inline void
632intel_pmu_enable_fixed(struct hw_perf_event *hwc, int __idx)
633{
634 int idx = __idx - X86_PMC_IDX_FIXED;
635 u64 ctrl_val, bits, mask;
636 int err;
637
638 /*
639 * Enable IRQ generation (0x8),
640 * and enable ring-3 counting (0x2) and ring-0 counting (0x1)
641 * if requested:
642 */
643 bits = 0x8ULL;
644 if (hwc->config & ARCH_PERFMON_EVENTSEL_USR)
645 bits |= 0x2;
646 if (hwc->config & ARCH_PERFMON_EVENTSEL_OS)
647 bits |= 0x1;
648
649 /*
650 * ANY bit is supported in v3 and up
651 */
652 if (x86_pmu.version > 2 && hwc->config & ARCH_PERFMON_EVENTSEL_ANY)
653 bits |= 0x4;
654
655 bits <<= (idx * 4);
656 mask = 0xfULL << (idx * 4);
657
658 rdmsrl(hwc->config_base, ctrl_val);
659 ctrl_val &= ~mask;
660 ctrl_val |= bits;
661 err = checking_wrmsrl(hwc->config_base, ctrl_val);
662}
663
664static void intel_pmu_enable_event(struct hw_perf_event *hwc, int idx)
665{
666 if (unlikely(idx == X86_PMC_IDX_FIXED_BTS)) {
667 if (!__get_cpu_var(cpu_hw_events).enabled)
668 return;
669
670 intel_pmu_enable_bts(hwc->config);
671 return;
672 }
673
674 if (unlikely(hwc->config_base == MSR_ARCH_PERFMON_FIXED_CTR_CTRL)) {
675 intel_pmu_enable_fixed(hwc, idx);
676 return;
677 }
678
679 __x86_pmu_enable_event(hwc, idx);
680}
681
682/*
683 * Save and restart an expired event. Called by NMI contexts,
684 * so it has to be careful about preempting normal event ops:
685 */
686static int intel_pmu_save_and_restart(struct perf_event *event)
687{
688 struct hw_perf_event *hwc = &event->hw;
689 int idx = hwc->idx;
690 int ret;
691
692 x86_perf_event_update(event, hwc, idx);
693 ret = x86_perf_event_set_period(event, hwc, idx);
694
695 return ret;
696}
697
698static void intel_pmu_reset(void)
699{
700 struct debug_store *ds = __get_cpu_var(cpu_hw_events).ds;
701 unsigned long flags;
702 int idx;
703
704 if (!x86_pmu.num_events)
705 return;
706
707 local_irq_save(flags);
708
709 printk("clearing PMU state on CPU#%d\n", smp_processor_id());
710
711 for (idx = 0; idx < x86_pmu.num_events; idx++) {
712 checking_wrmsrl(x86_pmu.eventsel + idx, 0ull);
713 checking_wrmsrl(x86_pmu.perfctr + idx, 0ull);
714 }
715 for (idx = 0; idx < x86_pmu.num_events_fixed; idx++) {
716 checking_wrmsrl(MSR_ARCH_PERFMON_FIXED_CTR0 + idx, 0ull);
717 }
718 if (ds)
719 ds->bts_index = ds->bts_buffer_base;
720
721 local_irq_restore(flags);
722}
723
724/*
725 * This handler is triggered by the local APIC, so the APIC IRQ handling
726 * rules apply:
727 */
728static int intel_pmu_handle_irq(struct pt_regs *regs)
729{
730 struct perf_sample_data data;
731 struct cpu_hw_events *cpuc;
732 int bit, loops;
733 u64 ack, status;
734
735 data.addr = 0;
736 data.raw = NULL;
737
738 cpuc = &__get_cpu_var(cpu_hw_events);
739
740 perf_disable();
741 intel_pmu_drain_bts_buffer();
742 status = intel_pmu_get_status();
743 if (!status) {
744 perf_enable();
745 return 0;
746 }
747
748 loops = 0;
749again:
750 if (++loops > 100) {
751 WARN_ONCE(1, "perfevents: irq loop stuck!\n");
752 perf_event_print_debug();
753 intel_pmu_reset();
754 perf_enable();
755 return 1;
756 }
757
758 inc_irq_stat(apic_perf_irqs);
759 ack = status;
760 for_each_bit(bit, (unsigned long *)&status, X86_PMC_IDX_MAX) {
761 struct perf_event *event = cpuc->events[bit];
762
763 clear_bit(bit, (unsigned long *) &status);
764 if (!test_bit(bit, cpuc->active_mask))
765 continue;
766
767 if (!intel_pmu_save_and_restart(event))
768 continue;
769
770 data.period = event->hw.last_period;
771
772 if (perf_event_overflow(event, 1, &data, regs))
773 intel_pmu_disable_event(&event->hw, bit);
774 }
775
776 intel_pmu_ack_status(ack);
777
778 /*
779 * Repeat if there is more work to be done:
780 */
781 status = intel_pmu_get_status();
782 if (status)
783 goto again;
784
785 perf_enable();
786
787 return 1;
788}
789
790static struct event_constraint bts_constraint =
791 EVENT_CONSTRAINT(0, 1ULL << X86_PMC_IDX_FIXED_BTS, 0);
792
793static struct event_constraint *
794intel_special_constraints(struct perf_event *event)
795{
796 unsigned int hw_event;
797
798 hw_event = event->hw.config & INTEL_ARCH_EVENT_MASK;
799
800 if (unlikely((hw_event ==
801 x86_pmu.event_map(PERF_COUNT_HW_BRANCH_INSTRUCTIONS)) &&
802 (event->hw.sample_period == 1))) {
803
804 return &bts_constraint;
805 }
806 return NULL;
807}
808
809static struct event_constraint *
810intel_get_event_constraints(struct cpu_hw_events *cpuc, struct perf_event *event)
811{
812 struct event_constraint *c;
813
814 c = intel_special_constraints(event);
815 if (c)
816 return c;
817
818 return x86_get_event_constraints(cpuc, event);
819}
820
821static __initconst struct x86_pmu core_pmu = {
822 .name = "core",
823 .handle_irq = x86_pmu_handle_irq,
824 .disable_all = x86_pmu_disable_all,
825 .enable_all = x86_pmu_enable_all,
826 .enable = x86_pmu_enable_event,
827 .disable = x86_pmu_disable_event,
828 .eventsel = MSR_ARCH_PERFMON_EVENTSEL0,
829 .perfctr = MSR_ARCH_PERFMON_PERFCTR0,
830 .event_map = intel_pmu_event_map,
831 .raw_event = intel_pmu_raw_event,
832 .max_events = ARRAY_SIZE(intel_perfmon_event_map),
833 .apic = 1,
834 /*
835 * Intel PMCs cannot be accessed sanely above 32 bit width,
836 * so we install an artificial 1<<31 period regardless of
837 * the generic event period:
838 */
839 .max_period = (1ULL << 31) - 1,
840 .get_event_constraints = intel_get_event_constraints,
841 .event_constraints = intel_core_event_constraints,
842};
843
844static __initconst struct x86_pmu intel_pmu = {
845 .name = "Intel",
846 .handle_irq = intel_pmu_handle_irq,
847 .disable_all = intel_pmu_disable_all,
848 .enable_all = intel_pmu_enable_all,
849 .enable = intel_pmu_enable_event,
850 .disable = intel_pmu_disable_event,
851 .eventsel = MSR_ARCH_PERFMON_EVENTSEL0,
852 .perfctr = MSR_ARCH_PERFMON_PERFCTR0,
853 .event_map = intel_pmu_event_map,
854 .raw_event = intel_pmu_raw_event,
855 .max_events = ARRAY_SIZE(intel_perfmon_event_map),
856 .apic = 1,
857 /*
858 * Intel PMCs cannot be accessed sanely above 32 bit width,
859 * so we install an artificial 1<<31 period regardless of
860 * the generic event period:
861 */
862 .max_period = (1ULL << 31) - 1,
863 .enable_bts = intel_pmu_enable_bts,
864 .disable_bts = intel_pmu_disable_bts,
865 .get_event_constraints = intel_get_event_constraints
866};
867
868static __init int intel_pmu_init(void)
869{
870 union cpuid10_edx edx;
871 union cpuid10_eax eax;
872 unsigned int unused;
873 unsigned int ebx;
874 int version;
875
876 if (!cpu_has(&boot_cpu_data, X86_FEATURE_ARCH_PERFMON)) {
877 /* check for P6 processor family */
878 if (boot_cpu_data.x86 == 6) {
879 return p6_pmu_init();
880 } else {
881 return -ENODEV;
882 }
883 }
884
885 /*
886 * Check whether the Architectural PerfMon supports
887 * Branch Misses Retired hw_event or not.
888 */
889 cpuid(10, &eax.full, &ebx, &unused, &edx.full);
890 if (eax.split.mask_length <= ARCH_PERFMON_BRANCH_MISSES_RETIRED)
891 return -ENODEV;
892
893 version = eax.split.version_id;
894 if (version < 2)
895 x86_pmu = core_pmu;
896 else
897 x86_pmu = intel_pmu;
898
899 x86_pmu.version = version;
900 x86_pmu.num_events = eax.split.num_events;
901 x86_pmu.event_bits = eax.split.bit_width;
902 x86_pmu.event_mask = (1ULL << eax.split.bit_width) - 1;
903
904 /*
905 * Quirk: v2 perfmon does not report fixed-purpose events, so
906 * assume at least 3 events:
907 */
908 if (version > 1)
909 x86_pmu.num_events_fixed = max((int)edx.split.num_events_fixed, 3);
910
911 /*
912 * Install the hw-cache-events table:
913 */
914 switch (boot_cpu_data.x86_model) {
915 case 14: /* 65 nm core solo/duo, "Yonah" */
916 pr_cont("Core events, ");
917 break;
918
919 case 15: /* original 65 nm celeron/pentium/core2/xeon, "Merom"/"Conroe" */
920 case 22: /* single-core 65 nm celeron/core2solo "Merom-L"/"Conroe-L" */
921 case 23: /* current 45 nm celeron/core2/xeon "Penryn"/"Wolfdale" */
922 case 29: /* six-core 45 nm xeon "Dunnington" */
923 memcpy(hw_cache_event_ids, core2_hw_cache_event_ids,
924 sizeof(hw_cache_event_ids));
925
926 x86_pmu.event_constraints = intel_core2_event_constraints;
927 pr_cont("Core2 events, ");
928 break;
929
930 case 26: /* 45 nm nehalem, "Bloomfield" */
931 case 30: /* 45 nm nehalem, "Lynnfield" */
932 memcpy(hw_cache_event_ids, nehalem_hw_cache_event_ids,
933 sizeof(hw_cache_event_ids));
934
935 x86_pmu.event_constraints = intel_nehalem_event_constraints;
936 pr_cont("Nehalem/Corei7 events, ");
937 break;
938 case 28:
939 memcpy(hw_cache_event_ids, atom_hw_cache_event_ids,
940 sizeof(hw_cache_event_ids));
941
942 x86_pmu.event_constraints = intel_gen_event_constraints;
943 pr_cont("Atom events, ");
944 break;
945
946 case 37: /* 32 nm nehalem, "Clarkdale" */
947 case 44: /* 32 nm nehalem, "Gulftown" */
948 memcpy(hw_cache_event_ids, westmere_hw_cache_event_ids,
949 sizeof(hw_cache_event_ids));
950
951 x86_pmu.event_constraints = intel_westmere_event_constraints;
952 pr_cont("Westmere events, ");
953 break;
954 default:
955 /*
956 * default constraints for v2 and up
957 */
958 x86_pmu.event_constraints = intel_gen_event_constraints;
959 pr_cont("generic architected perfmon, ");
960 }
961 return 0;
962}
963
964#else /* CONFIG_CPU_SUP_INTEL */
965
966static int intel_pmu_init(void)
967{
968 return 0;
969}
970
971#endif /* CONFIG_CPU_SUP_INTEL */
diff --git a/arch/x86/kernel/cpu/perf_event_p6.c b/arch/x86/kernel/cpu/perf_event_p6.c
new file mode 100644
index 000000000000..1ca5ba078afd
--- /dev/null
+++ b/arch/x86/kernel/cpu/perf_event_p6.c
@@ -0,0 +1,157 @@
1#ifdef CONFIG_CPU_SUP_INTEL
2
3/*
4 * Not sure about some of these
5 */
6static const u64 p6_perfmon_event_map[] =
7{
8 [PERF_COUNT_HW_CPU_CYCLES] = 0x0079,
9 [PERF_COUNT_HW_INSTRUCTIONS] = 0x00c0,
10 [PERF_COUNT_HW_CACHE_REFERENCES] = 0x0f2e,
11 [PERF_COUNT_HW_CACHE_MISSES] = 0x012e,
12 [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = 0x00c4,
13 [PERF_COUNT_HW_BRANCH_MISSES] = 0x00c5,
14 [PERF_COUNT_HW_BUS_CYCLES] = 0x0062,
15};
16
17static u64 p6_pmu_event_map(int hw_event)
18{
19 return p6_perfmon_event_map[hw_event];
20}
21
22/*
23 * Event setting that is specified not to count anything.
24 * We use this to effectively disable a counter.
25 *
26 * L2_RQSTS with 0 MESI unit mask.
27 */
28#define P6_NOP_EVENT 0x0000002EULL
29
30static u64 p6_pmu_raw_event(u64 hw_event)
31{
32#define P6_EVNTSEL_EVENT_MASK 0x000000FFULL
33#define P6_EVNTSEL_UNIT_MASK 0x0000FF00ULL
34#define P6_EVNTSEL_EDGE_MASK 0x00040000ULL
35#define P6_EVNTSEL_INV_MASK 0x00800000ULL
36#define P6_EVNTSEL_REG_MASK 0xFF000000ULL
37
38#define P6_EVNTSEL_MASK \
39 (P6_EVNTSEL_EVENT_MASK | \
40 P6_EVNTSEL_UNIT_MASK | \
41 P6_EVNTSEL_EDGE_MASK | \
42 P6_EVNTSEL_INV_MASK | \
43 P6_EVNTSEL_REG_MASK)
44
45 return hw_event & P6_EVNTSEL_MASK;
46}
47
48static struct event_constraint p6_event_constraints[] =
49{
50 INTEL_EVENT_CONSTRAINT(0xc1, 0x1), /* FLOPS */
51 INTEL_EVENT_CONSTRAINT(0x10, 0x1), /* FP_COMP_OPS_EXE */
52 INTEL_EVENT_CONSTRAINT(0x11, 0x1), /* FP_ASSIST */
53 INTEL_EVENT_CONSTRAINT(0x12, 0x2), /* MUL */
54 INTEL_EVENT_CONSTRAINT(0x13, 0x2), /* DIV */
55 INTEL_EVENT_CONSTRAINT(0x14, 0x1), /* CYCLES_DIV_BUSY */
56 EVENT_CONSTRAINT_END
57};
58
59static void p6_pmu_disable_all(void)
60{
61 u64 val;
62
63 /* p6 only has one enable register */
64 rdmsrl(MSR_P6_EVNTSEL0, val);
65 val &= ~ARCH_PERFMON_EVENTSEL0_ENABLE;
66 wrmsrl(MSR_P6_EVNTSEL0, val);
67}
68
69static void p6_pmu_enable_all(void)
70{
71 unsigned long val;
72
73 /* p6 only has one enable register */
74 rdmsrl(MSR_P6_EVNTSEL0, val);
75 val |= ARCH_PERFMON_EVENTSEL0_ENABLE;
76 wrmsrl(MSR_P6_EVNTSEL0, val);
77}
78
79static inline void
80p6_pmu_disable_event(struct hw_perf_event *hwc, int idx)
81{
82 struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
83 u64 val = P6_NOP_EVENT;
84
85 if (cpuc->enabled)
86 val |= ARCH_PERFMON_EVENTSEL0_ENABLE;
87
88 (void)checking_wrmsrl(hwc->config_base + idx, val);
89}
90
91static void p6_pmu_enable_event(struct hw_perf_event *hwc, int idx)
92{
93 struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
94 u64 val;
95
96 val = hwc->config;
97 if (cpuc->enabled)
98 val |= ARCH_PERFMON_EVENTSEL0_ENABLE;
99
100 (void)checking_wrmsrl(hwc->config_base + idx, val);
101}
102
103static __initconst struct x86_pmu p6_pmu = {
104 .name = "p6",
105 .handle_irq = x86_pmu_handle_irq,
106 .disable_all = p6_pmu_disable_all,
107 .enable_all = p6_pmu_enable_all,
108 .enable = p6_pmu_enable_event,
109 .disable = p6_pmu_disable_event,
110 .eventsel = MSR_P6_EVNTSEL0,
111 .perfctr = MSR_P6_PERFCTR0,
112 .event_map = p6_pmu_event_map,
113 .raw_event = p6_pmu_raw_event,
114 .max_events = ARRAY_SIZE(p6_perfmon_event_map),
115 .apic = 1,
116 .max_period = (1ULL << 31) - 1,
117 .version = 0,
118 .num_events = 2,
119 /*
120 * Events have 40 bits implemented. However they are designed such
121 * that bits [32-39] are sign extensions of bit 31. As such the
122 * effective width of a event for P6-like PMU is 32 bits only.
123 *
124 * See IA-32 Intel Architecture Software developer manual Vol 3B
125 */
126 .event_bits = 32,
127 .event_mask = (1ULL << 32) - 1,
128 .get_event_constraints = x86_get_event_constraints,
129 .event_constraints = p6_event_constraints,
130};
131
132static __init int p6_pmu_init(void)
133{
134 switch (boot_cpu_data.x86_model) {
135 case 1:
136 case 3: /* Pentium Pro */
137 case 5:
138 case 6: /* Pentium II */
139 case 7:
140 case 8:
141 case 11: /* Pentium III */
142 case 9:
143 case 13:
144 /* Pentium M */
145 break;
146 default:
147 pr_cont("unsupported p6 CPU model %d ",
148 boot_cpu_data.x86_model);
149 return -ENODEV;
150 }
151
152 x86_pmu = p6_pmu;
153
154 return 0;
155}
156
157#endif /* CONFIG_CPU_SUP_INTEL */
diff --git a/arch/x86/kernel/cpu/perfctr-watchdog.c b/arch/x86/kernel/cpu/perfctr-watchdog.c
index 898df9719afb..74f4e85a5727 100644
--- a/arch/x86/kernel/cpu/perfctr-watchdog.c
+++ b/arch/x86/kernel/cpu/perfctr-watchdog.c
@@ -115,17 +115,6 @@ int avail_to_resrv_perfctr_nmi_bit(unsigned int counter)
115 115
116 return !test_bit(counter, perfctr_nmi_owner); 116 return !test_bit(counter, perfctr_nmi_owner);
117} 117}
118
119/* checks the an msr for availability */
120int avail_to_resrv_perfctr_nmi(unsigned int msr)
121{
122 unsigned int counter;
123
124 counter = nmi_perfctr_msr_to_bit(msr);
125 BUG_ON(counter > NMI_MAX_COUNTER_BITS);
126
127 return !test_bit(counter, perfctr_nmi_owner);
128}
129EXPORT_SYMBOL(avail_to_resrv_perfctr_nmi_bit); 118EXPORT_SYMBOL(avail_to_resrv_perfctr_nmi_bit);
130 119
131int reserve_perfctr_nmi(unsigned int msr) 120int reserve_perfctr_nmi(unsigned int msr)
diff --git a/arch/x86/kernel/dumpstack_32.c b/arch/x86/kernel/dumpstack_32.c
index ae775ca47b25..11540a189d93 100644
--- a/arch/x86/kernel/dumpstack_32.c
+++ b/arch/x86/kernel/dumpstack_32.c
@@ -18,11 +18,6 @@
18 18
19#include "dumpstack.h" 19#include "dumpstack.h"
20 20
21/* Just a stub for now */
22int x86_is_stack_id(int id, char *name)
23{
24 return 0;
25}
26 21
27void dump_trace(struct task_struct *task, struct pt_regs *regs, 22void dump_trace(struct task_struct *task, struct pt_regs *regs,
28 unsigned long *stack, unsigned long bp, 23 unsigned long *stack, unsigned long bp,
diff --git a/arch/x86/kernel/dumpstack_64.c b/arch/x86/kernel/dumpstack_64.c
index 0ad9597073f5..dce99abb4496 100644
--- a/arch/x86/kernel/dumpstack_64.c
+++ b/arch/x86/kernel/dumpstack_64.c
@@ -33,11 +33,6 @@ static char x86_stack_ids[][8] = {
33#endif 33#endif
34}; 34};
35 35
36int x86_is_stack_id(int id, char *name)
37{
38 return x86_stack_ids[id - 1] == name;
39}
40
41static unsigned long *in_exception_stack(unsigned cpu, unsigned long stack, 36static unsigned long *in_exception_stack(unsigned cpu, unsigned long stack,
42 unsigned *usedp, char **idp) 37 unsigned *usedp, char **idp)
43{ 38{
@@ -291,6 +286,7 @@ void show_registers(struct pt_regs *regs)
291 286
292 sp = regs->sp; 287 sp = regs->sp;
293 printk("CPU %d ", cpu); 288 printk("CPU %d ", cpu);
289 print_modules();
294 __show_regs(regs, 1); 290 __show_regs(regs, 1);
295 printk("Process %s (pid: %d, threadinfo %p, task %p)\n", 291 printk("Process %s (pid: %d, threadinfo %p, task %p)\n",
296 cur->comm, cur->pid, task_thread_info(cur), cur); 292 cur->comm, cur->pid, task_thread_info(cur), cur);
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index a1a7876cadcb..a966b753e496 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -517,11 +517,19 @@ u64 __init e820_remove_range(u64 start, u64 size, unsigned old_type,
517 int checktype) 517 int checktype)
518{ 518{
519 int i; 519 int i;
520 u64 end;
520 u64 real_removed_size = 0; 521 u64 real_removed_size = 0;
521 522
522 if (size > (ULLONG_MAX - start)) 523 if (size > (ULLONG_MAX - start))
523 size = ULLONG_MAX - start; 524 size = ULLONG_MAX - start;
524 525
526 end = start + size;
527 printk(KERN_DEBUG "e820 remove range: %016Lx - %016Lx ",
528 (unsigned long long) start,
529 (unsigned long long) end);
530 e820_print_type(old_type);
531 printk(KERN_CONT "\n");
532
525 for (i = 0; i < e820.nr_map; i++) { 533 for (i = 0; i < e820.nr_map; i++) {
526 struct e820entry *ei = &e820.map[i]; 534 struct e820entry *ei = &e820.map[i];
527 u64 final_start, final_end; 535 u64 final_start, final_end;
diff --git a/arch/x86/kernel/efi.c b/arch/x86/kernel/efi.c
index cdcfb122f256..c2fa9b8b497e 100644
--- a/arch/x86/kernel/efi.c
+++ b/arch/x86/kernel/efi.c
@@ -362,7 +362,7 @@ void __init efi_init(void)
362 printk(KERN_ERR PFX "Could not map the firmware vendor!\n"); 362 printk(KERN_ERR PFX "Could not map the firmware vendor!\n");
363 early_iounmap(tmp, 2); 363 early_iounmap(tmp, 2);
364 364
365 printk(KERN_INFO "EFI v%u.%.02u by %s \n", 365 printk(KERN_INFO "EFI v%u.%.02u by %s\n",
366 efi.systab->hdr.revision >> 16, 366 efi.systab->hdr.revision >> 16,
367 efi.systab->hdr.revision & 0xffff, vendor); 367 efi.systab->hdr.revision & 0xffff, vendor);
368 368
diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c
index 309689245431..cd37469b54ee 100644
--- a/arch/x86/kernel/ftrace.c
+++ b/arch/x86/kernel/ftrace.c
@@ -30,14 +30,32 @@
30 30
31#ifdef CONFIG_DYNAMIC_FTRACE 31#ifdef CONFIG_DYNAMIC_FTRACE
32 32
33/*
34 * modifying_code is set to notify NMIs that they need to use
35 * memory barriers when entering or exiting. But we don't want
36 * to burden NMIs with unnecessary memory barriers when code
37 * modification is not being done (which is most of the time).
38 *
39 * A mutex is already held when ftrace_arch_code_modify_prepare
40 * and post_process are called. No locks need to be taken here.
41 *
42 * Stop machine will make sure currently running NMIs are done
43 * and new NMIs will see the updated variable before we need
44 * to worry about NMIs doing memory barriers.
45 */
46static int modifying_code __read_mostly;
47static DEFINE_PER_CPU(int, save_modifying_code);
48
33int ftrace_arch_code_modify_prepare(void) 49int ftrace_arch_code_modify_prepare(void)
34{ 50{
35 set_kernel_text_rw(); 51 set_kernel_text_rw();
52 modifying_code = 1;
36 return 0; 53 return 0;
37} 54}
38 55
39int ftrace_arch_code_modify_post_process(void) 56int ftrace_arch_code_modify_post_process(void)
40{ 57{
58 modifying_code = 0;
41 set_kernel_text_ro(); 59 set_kernel_text_ro();
42 return 0; 60 return 0;
43} 61}
@@ -149,6 +167,11 @@ static void ftrace_mod_code(void)
149 167
150void ftrace_nmi_enter(void) 168void ftrace_nmi_enter(void)
151{ 169{
170 __get_cpu_var(save_modifying_code) = modifying_code;
171
172 if (!__get_cpu_var(save_modifying_code))
173 return;
174
152 if (atomic_inc_return(&nmi_running) & MOD_CODE_WRITE_FLAG) { 175 if (atomic_inc_return(&nmi_running) & MOD_CODE_WRITE_FLAG) {
153 smp_rmb(); 176 smp_rmb();
154 ftrace_mod_code(); 177 ftrace_mod_code();
@@ -160,6 +183,9 @@ void ftrace_nmi_enter(void)
160 183
161void ftrace_nmi_exit(void) 184void ftrace_nmi_exit(void)
162{ 185{
186 if (!__get_cpu_var(save_modifying_code))
187 return;
188
163 /* Finish all executions before clearing nmi_running */ 189 /* Finish all executions before clearing nmi_running */
164 smp_mb(); 190 smp_mb();
165 atomic_dec(&nmi_running); 191 atomic_dec(&nmi_running);
@@ -484,13 +510,3 @@ void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr,
484 } 510 }
485} 511}
486#endif /* CONFIG_FUNCTION_GRAPH_TRACER */ 512#endif /* CONFIG_FUNCTION_GRAPH_TRACER */
487
488#ifdef CONFIG_FTRACE_SYSCALLS
489
490extern unsigned long *sys_call_table;
491
492unsigned long __init arch_syscall_addr(int nr)
493{
494 return (unsigned long)(&sys_call_table)[nr];
495}
496#endif
diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c
index ad80a1c718c6..ee4fa1bfcb33 100644
--- a/arch/x86/kernel/hpet.c
+++ b/arch/x86/kernel/hpet.c
@@ -266,7 +266,7 @@ static void hpet_resume_device(void)
266 force_hpet_resume(); 266 force_hpet_resume();
267} 267}
268 268
269static void hpet_resume_counter(void) 269static void hpet_resume_counter(struct clocksource *cs)
270{ 270{
271 hpet_resume_device(); 271 hpet_resume_device();
272 hpet_restart_counter(); 272 hpet_restart_counter();
diff --git a/arch/x86/kernel/hw_breakpoint.c b/arch/x86/kernel/hw_breakpoint.c
index 05d5fec64a94..dca2802c666f 100644
--- a/arch/x86/kernel/hw_breakpoint.c
+++ b/arch/x86/kernel/hw_breakpoint.c
@@ -212,25 +212,6 @@ static int arch_check_va_in_kernelspace(unsigned long va, u8 hbp_len)
212 return (va >= TASK_SIZE) && ((va + len - 1) >= TASK_SIZE); 212 return (va >= TASK_SIZE) && ((va + len - 1) >= TASK_SIZE);
213} 213}
214 214
215/*
216 * Store a breakpoint's encoded address, length, and type.
217 */
218static int arch_store_info(struct perf_event *bp)
219{
220 struct arch_hw_breakpoint *info = counter_arch_bp(bp);
221 /*
222 * For kernel-addresses, either the address or symbol name can be
223 * specified.
224 */
225 if (info->name)
226 info->address = (unsigned long)
227 kallsyms_lookup_name(info->name);
228 if (info->address)
229 return 0;
230
231 return -EINVAL;
232}
233
234int arch_bp_generic_fields(int x86_len, int x86_type, 215int arch_bp_generic_fields(int x86_len, int x86_type,
235 int *gen_len, int *gen_type) 216 int *gen_len, int *gen_type)
236{ 217{
@@ -362,10 +343,13 @@ int arch_validate_hwbkpt_settings(struct perf_event *bp,
362 return ret; 343 return ret;
363 } 344 }
364 345
365 ret = arch_store_info(bp); 346 /*
366 347 * For kernel-addresses, either the address or symbol name can be
367 if (ret < 0) 348 * specified.
368 return ret; 349 */
350 if (info->name)
351 info->address = (unsigned long)
352 kallsyms_lookup_name(info->name);
369 /* 353 /*
370 * Check that the low-order bits of the address are appropriate 354 * Check that the low-order bits of the address are appropriate
371 * for the alignment implied by len. 355 * for the alignment implied by len.
@@ -502,8 +486,6 @@ static int __kprobes hw_breakpoint_handler(struct die_args *args)
502 rcu_read_lock(); 486 rcu_read_lock();
503 487
504 bp = per_cpu(bp_per_reg[i], cpu); 488 bp = per_cpu(bp_per_reg[i], cpu);
505 if (bp)
506 rc = NOTIFY_DONE;
507 /* 489 /*
508 * Reset the 'i'th TRAP bit in dr6 to denote completion of 490 * Reset the 'i'th TRAP bit in dr6 to denote completion of
509 * exception handling 491 * exception handling
@@ -522,7 +504,13 @@ static int __kprobes hw_breakpoint_handler(struct die_args *args)
522 504
523 rcu_read_unlock(); 505 rcu_read_unlock();
524 } 506 }
525 if (dr6 & (~DR_TRAP_BITS)) 507 /*
508 * Further processing in do_debug() is needed for a) user-space
509 * breakpoints (to generate signals) and b) when the system has
510 * taken exception due to multiple causes
511 */
512 if ((current->thread.debugreg6 & DR_TRAP_BITS) ||
513 (dr6 & (~DR_TRAP_BITS)))
526 rc = NOTIFY_DONE; 514 rc = NOTIFY_DONE;
527 515
528 set_debugreg(dr7, 7); 516 set_debugreg(dr7, 7);
diff --git a/arch/x86/kernel/i387.c b/arch/x86/kernel/i387.c
index f2f8540a7f3d..c01a2b846d47 100644
--- a/arch/x86/kernel/i387.c
+++ b/arch/x86/kernel/i387.c
@@ -164,6 +164,11 @@ int init_fpu(struct task_struct *tsk)
164 return 0; 164 return 0;
165} 165}
166 166
167/*
168 * The xstateregs_active() routine is the same as the fpregs_active() routine,
169 * as the "regset->n" for the xstate regset will be updated based on the feature
170 * capabilites supported by the xsave.
171 */
167int fpregs_active(struct task_struct *target, const struct user_regset *regset) 172int fpregs_active(struct task_struct *target, const struct user_regset *regset)
168{ 173{
169 return tsk_used_math(target) ? regset->n : 0; 174 return tsk_used_math(target) ? regset->n : 0;
@@ -204,8 +209,6 @@ int xfpregs_set(struct task_struct *target, const struct user_regset *regset,
204 if (ret) 209 if (ret)
205 return ret; 210 return ret;
206 211
207 set_stopped_child_used_math(target);
208
209 ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, 212 ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
210 &target->thread.xstate->fxsave, 0, -1); 213 &target->thread.xstate->fxsave, 0, -1);
211 214
@@ -224,6 +227,68 @@ int xfpregs_set(struct task_struct *target, const struct user_regset *regset,
224 return ret; 227 return ret;
225} 228}
226 229
230int xstateregs_get(struct task_struct *target, const struct user_regset *regset,
231 unsigned int pos, unsigned int count,
232 void *kbuf, void __user *ubuf)
233{
234 int ret;
235
236 if (!cpu_has_xsave)
237 return -ENODEV;
238
239 ret = init_fpu(target);
240 if (ret)
241 return ret;
242
243 /*
244 * Copy the 48bytes defined by the software first into the xstate
245 * memory layout in the thread struct, so that we can copy the entire
246 * xstateregs to the user using one user_regset_copyout().
247 */
248 memcpy(&target->thread.xstate->fxsave.sw_reserved,
249 xstate_fx_sw_bytes, sizeof(xstate_fx_sw_bytes));
250
251 /*
252 * Copy the xstate memory layout.
253 */
254 ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf,
255 &target->thread.xstate->xsave, 0, -1);
256 return ret;
257}
258
259int xstateregs_set(struct task_struct *target, const struct user_regset *regset,
260 unsigned int pos, unsigned int count,
261 const void *kbuf, const void __user *ubuf)
262{
263 int ret;
264 struct xsave_hdr_struct *xsave_hdr;
265
266 if (!cpu_has_xsave)
267 return -ENODEV;
268
269 ret = init_fpu(target);
270 if (ret)
271 return ret;
272
273 ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
274 &target->thread.xstate->xsave, 0, -1);
275
276 /*
277 * mxcsr reserved bits must be masked to zero for security reasons.
278 */
279 target->thread.xstate->fxsave.mxcsr &= mxcsr_feature_mask;
280
281 xsave_hdr = &target->thread.xstate->xsave.xsave_hdr;
282
283 xsave_hdr->xstate_bv &= pcntxt_mask;
284 /*
285 * These bits must be zero.
286 */
287 xsave_hdr->reserved1[0] = xsave_hdr->reserved1[1] = 0;
288
289 return ret;
290}
291
227#if defined CONFIG_X86_32 || defined CONFIG_IA32_EMULATION 292#if defined CONFIG_X86_32 || defined CONFIG_IA32_EMULATION
228 293
229/* 294/*
@@ -404,8 +469,6 @@ int fpregs_set(struct task_struct *target, const struct user_regset *regset,
404 if (ret) 469 if (ret)
405 return ret; 470 return ret;
406 471
407 set_stopped_child_used_math(target);
408
409 if (!HAVE_HWFP) 472 if (!HAVE_HWFP)
410 return fpregs_soft_set(target, regset, pos, count, kbuf, ubuf); 473 return fpregs_soft_set(target, regset, pos, count, kbuf, ubuf);
411 474
diff --git a/arch/x86/kernel/kprobes.c b/arch/x86/kernel/kprobes.c
index 5b8c7505b3bc..5de9f4a9c3fd 100644
--- a/arch/x86/kernel/kprobes.c
+++ b/arch/x86/kernel/kprobes.c
@@ -337,6 +337,9 @@ static void __kprobes arch_copy_kprobe(struct kprobe *p)
337 337
338int __kprobes arch_prepare_kprobe(struct kprobe *p) 338int __kprobes arch_prepare_kprobe(struct kprobe *p)
339{ 339{
340 if (alternatives_text_reserved(p->addr, p->addr))
341 return -EINVAL;
342
340 if (!can_probe((unsigned long)p->addr)) 343 if (!can_probe((unsigned long)p->addr))
341 return -EILSEQ; 344 return -EILSEQ;
342 /* insn: must be on special executable page on x86. */ 345 /* insn: must be on special executable page on x86. */
@@ -429,7 +432,7 @@ void __kprobes arch_prepare_kretprobe(struct kretprobe_instance *ri,
429static void __kprobes setup_singlestep(struct kprobe *p, struct pt_regs *regs, 432static void __kprobes setup_singlestep(struct kprobe *p, struct pt_regs *regs,
430 struct kprobe_ctlblk *kcb) 433 struct kprobe_ctlblk *kcb)
431{ 434{
432#if !defined(CONFIG_PREEMPT) || defined(CONFIG_FREEZER) 435#if !defined(CONFIG_PREEMPT)
433 if (p->ainsn.boostable == 1 && !p->post_handler) { 436 if (p->ainsn.boostable == 1 && !p->post_handler) {
434 /* Boost up -- we can execute copied instructions directly */ 437 /* Boost up -- we can execute copied instructions directly */
435 reset_current_kprobe(); 438 reset_current_kprobe();
diff --git a/arch/x86/kernel/microcode_intel.c b/arch/x86/kernel/microcode_intel.c
index ebd193e476ca..85a343e28937 100644
--- a/arch/x86/kernel/microcode_intel.c
+++ b/arch/x86/kernel/microcode_intel.c
@@ -328,7 +328,7 @@ static int apply_microcode(int cpu)
328 cpu_num, mc_intel->hdr.rev); 328 cpu_num, mc_intel->hdr.rev);
329 return -1; 329 return -1;
330 } 330 }
331 pr_info("CPU%d updated to revision 0x%x, date = %04x-%02x-%02x \n", 331 pr_info("CPU%d updated to revision 0x%x, date = %04x-%02x-%02x\n",
332 cpu_num, val[1], 332 cpu_num, val[1],
333 mc_intel->hdr.date & 0xffff, 333 mc_intel->hdr.date & 0xffff,
334 mc_intel->hdr.date >> 24, 334 mc_intel->hdr.date >> 24,
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
index c9b3522b6b46..02d678065d7d 100644
--- a/arch/x86/kernel/process.c
+++ b/arch/x86/kernel/process.c
@@ -92,6 +92,13 @@ void exit_thread(void)
92 } 92 }
93} 93}
94 94
95void show_regs(struct pt_regs *regs)
96{
97 show_registers(regs);
98 show_trace(NULL, regs, (unsigned long *)kernel_stack_pointer(regs),
99 regs->bp);
100}
101
95void show_regs_common(void) 102void show_regs_common(void)
96{ 103{
97 const char *board, *product; 104 const char *board, *product;
diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c
index 37ad1e046aae..f6c62667e30c 100644
--- a/arch/x86/kernel/process_32.c
+++ b/arch/x86/kernel/process_32.c
@@ -174,12 +174,6 @@ void __show_regs(struct pt_regs *regs, int all)
174 d6, d7); 174 d6, d7);
175} 175}
176 176
177void show_regs(struct pt_regs *regs)
178{
179 show_registers(regs);
180 show_trace(NULL, regs, &regs->sp, regs->bp);
181}
182
183void release_thread(struct task_struct *dead_task) 177void release_thread(struct task_struct *dead_task)
184{ 178{
185 BUG_ON(dead_task->mm); 179 BUG_ON(dead_task->mm);
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
index 41a26a82470a..dc9690b4c4cc 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -211,12 +211,6 @@ void __show_regs(struct pt_regs *regs, int all)
211 printk(KERN_DEFAULT "DR3: %016lx DR6: %016lx DR7: %016lx\n", d3, d6, d7); 211 printk(KERN_DEFAULT "DR3: %016lx DR6: %016lx DR7: %016lx\n", d3, d6, d7);
212} 212}
213 213
214void show_regs(struct pt_regs *regs)
215{
216 show_registers(regs);
217 show_trace(NULL, regs, (void *)(regs + 1), regs->bp);
218}
219
220void release_thread(struct task_struct *dead_task) 214void release_thread(struct task_struct *dead_task)
221{ 215{
222 if (dead_task->mm) { 216 if (dead_task->mm) {
@@ -527,6 +521,7 @@ void set_personality_ia32(void)
527 521
528 /* Make sure to be in 32bit mode */ 522 /* Make sure to be in 32bit mode */
529 set_thread_flag(TIF_IA32); 523 set_thread_flag(TIF_IA32);
524 current->personality |= force_personality32;
530 525
531 /* Prepare the first "return" to user space */ 526 /* Prepare the first "return" to user space */
532 current_thread_info()->status |= TS_COMPAT; 527 current_thread_info()->status |= TS_COMPAT;
diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c
index 017d937639fe..2d96aab82a48 100644
--- a/arch/x86/kernel/ptrace.c
+++ b/arch/x86/kernel/ptrace.c
@@ -48,6 +48,7 @@ enum x86_regset {
48 REGSET_FP, 48 REGSET_FP,
49 REGSET_XFP, 49 REGSET_XFP,
50 REGSET_IOPERM64 = REGSET_XFP, 50 REGSET_IOPERM64 = REGSET_XFP,
51 REGSET_XSTATE,
51 REGSET_TLS, 52 REGSET_TLS,
52 REGSET_IOPERM32, 53 REGSET_IOPERM32,
53}; 54};
@@ -140,30 +141,6 @@ static const int arg_offs_table[] = {
140#endif 141#endif
141}; 142};
142 143
143/**
144 * regs_get_argument_nth() - get Nth argument at function call
145 * @regs: pt_regs which contains registers at function entry.
146 * @n: argument number.
147 *
148 * regs_get_argument_nth() returns @n th argument of a function call.
149 * Since usually the kernel stack will be changed right after function entry,
150 * you must use this at function entry. If the @n th entry is NOT in the
151 * kernel stack or pt_regs, this returns 0.
152 */
153unsigned long regs_get_argument_nth(struct pt_regs *regs, unsigned int n)
154{
155 if (n < ARRAY_SIZE(arg_offs_table))
156 return *(unsigned long *)((char *)regs + arg_offs_table[n]);
157 else {
158 /*
159 * The typical case: arg n is on the stack.
160 * (Note: stack[0] = return address, so skip it)
161 */
162 n -= ARRAY_SIZE(arg_offs_table);
163 return regs_get_kernel_stack_nth(regs, 1 + n);
164 }
165}
166
167/* 144/*
168 * does not yet catch signals sent when the child dies. 145 * does not yet catch signals sent when the child dies.
169 * in exit.c or in signal.c. 146 * in exit.c or in signal.c.
@@ -702,7 +679,7 @@ static unsigned long ptrace_get_debugreg(struct task_struct *tsk, int n)
702 } else if (n == 6) { 679 } else if (n == 6) {
703 val = thread->debugreg6; 680 val = thread->debugreg6;
704 } else if (n == 7) { 681 } else if (n == 7) {
705 val = ptrace_get_dr7(thread->ptrace_bps); 682 val = thread->ptrace_dr7;
706 } 683 }
707 return val; 684 return val;
708} 685}
@@ -778,8 +755,11 @@ int ptrace_set_debugreg(struct task_struct *tsk, int n, unsigned long val)
778 return rc; 755 return rc;
779 } 756 }
780 /* All that's left is DR7 */ 757 /* All that's left is DR7 */
781 if (n == 7) 758 if (n == 7) {
782 rc = ptrace_write_dr7(tsk, val); 759 rc = ptrace_write_dr7(tsk, val);
760 if (!rc)
761 thread->ptrace_dr7 = val;
762 }
783 763
784ret_path: 764ret_path:
785 return rc; 765 return rc;
@@ -1584,7 +1564,7 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
1584 1564
1585#ifdef CONFIG_X86_64 1565#ifdef CONFIG_X86_64
1586 1566
1587static const struct user_regset x86_64_regsets[] = { 1567static struct user_regset x86_64_regsets[] __read_mostly = {
1588 [REGSET_GENERAL] = { 1568 [REGSET_GENERAL] = {
1589 .core_note_type = NT_PRSTATUS, 1569 .core_note_type = NT_PRSTATUS,
1590 .n = sizeof(struct user_regs_struct) / sizeof(long), 1570 .n = sizeof(struct user_regs_struct) / sizeof(long),
@@ -1597,6 +1577,12 @@ static const struct user_regset x86_64_regsets[] = {
1597 .size = sizeof(long), .align = sizeof(long), 1577 .size = sizeof(long), .align = sizeof(long),
1598 .active = xfpregs_active, .get = xfpregs_get, .set = xfpregs_set 1578 .active = xfpregs_active, .get = xfpregs_get, .set = xfpregs_set
1599 }, 1579 },
1580 [REGSET_XSTATE] = {
1581 .core_note_type = NT_X86_XSTATE,
1582 .size = sizeof(u64), .align = sizeof(u64),
1583 .active = xstateregs_active, .get = xstateregs_get,
1584 .set = xstateregs_set
1585 },
1600 [REGSET_IOPERM64] = { 1586 [REGSET_IOPERM64] = {
1601 .core_note_type = NT_386_IOPERM, 1587 .core_note_type = NT_386_IOPERM,
1602 .n = IO_BITMAP_LONGS, 1588 .n = IO_BITMAP_LONGS,
@@ -1622,7 +1608,7 @@ static const struct user_regset_view user_x86_64_view = {
1622#endif /* CONFIG_X86_64 */ 1608#endif /* CONFIG_X86_64 */
1623 1609
1624#if defined CONFIG_X86_32 || defined CONFIG_IA32_EMULATION 1610#if defined CONFIG_X86_32 || defined CONFIG_IA32_EMULATION
1625static const struct user_regset x86_32_regsets[] = { 1611static struct user_regset x86_32_regsets[] __read_mostly = {
1626 [REGSET_GENERAL] = { 1612 [REGSET_GENERAL] = {
1627 .core_note_type = NT_PRSTATUS, 1613 .core_note_type = NT_PRSTATUS,
1628 .n = sizeof(struct user_regs_struct32) / sizeof(u32), 1614 .n = sizeof(struct user_regs_struct32) / sizeof(u32),
@@ -1641,6 +1627,12 @@ static const struct user_regset x86_32_regsets[] = {
1641 .size = sizeof(u32), .align = sizeof(u32), 1627 .size = sizeof(u32), .align = sizeof(u32),
1642 .active = xfpregs_active, .get = xfpregs_get, .set = xfpregs_set 1628 .active = xfpregs_active, .get = xfpregs_get, .set = xfpregs_set
1643 }, 1629 },
1630 [REGSET_XSTATE] = {
1631 .core_note_type = NT_X86_XSTATE,
1632 .size = sizeof(u64), .align = sizeof(u64),
1633 .active = xstateregs_active, .get = xstateregs_get,
1634 .set = xstateregs_set
1635 },
1644 [REGSET_TLS] = { 1636 [REGSET_TLS] = {
1645 .core_note_type = NT_386_TLS, 1637 .core_note_type = NT_386_TLS,
1646 .n = GDT_ENTRY_TLS_ENTRIES, .bias = GDT_ENTRY_TLS_MIN, 1638 .n = GDT_ENTRY_TLS_ENTRIES, .bias = GDT_ENTRY_TLS_MIN,
@@ -1663,6 +1655,23 @@ static const struct user_regset_view user_x86_32_view = {
1663}; 1655};
1664#endif 1656#endif
1665 1657
1658/*
1659 * This represents bytes 464..511 in the memory layout exported through
1660 * the REGSET_XSTATE interface.
1661 */
1662u64 xstate_fx_sw_bytes[USER_XSTATE_FX_SW_WORDS];
1663
1664void update_regset_xstate_info(unsigned int size, u64 xstate_mask)
1665{
1666#ifdef CONFIG_X86_64
1667 x86_64_regsets[REGSET_XSTATE].n = size / sizeof(u64);
1668#endif
1669#if defined CONFIG_X86_32 || defined CONFIG_IA32_EMULATION
1670 x86_32_regsets[REGSET_XSTATE].n = size / sizeof(u64);
1671#endif
1672 xstate_fx_sw_bytes[USER_XSTATE_XCR0_WORD] = xstate_mask;
1673}
1674
1666const struct user_regset_view *task_user_regset_view(struct task_struct *task) 1675const struct user_regset_view *task_user_regset_view(struct task_struct *task)
1667{ 1676{
1668#ifdef CONFIG_IA32_EMULATION 1677#ifdef CONFIG_IA32_EMULATION
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index 5d9e40c58628..cb42109a55b4 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -121,7 +121,9 @@
121unsigned long max_low_pfn_mapped; 121unsigned long max_low_pfn_mapped;
122unsigned long max_pfn_mapped; 122unsigned long max_pfn_mapped;
123 123
124#ifdef CONFIG_DMI
124RESERVE_BRK(dmi_alloc, 65536); 125RESERVE_BRK(dmi_alloc, 65536);
126#endif
125 127
126unsigned int boot_cpu_id __read_mostly; 128unsigned int boot_cpu_id __read_mostly;
127 129
@@ -667,6 +669,23 @@ static struct dmi_system_id __initdata bad_bios_dmi_table[] = {
667 {} 669 {}
668}; 670};
669 671
672static void __init trim_bios_range(void)
673{
674 /*
675 * A special case is the first 4Kb of memory;
676 * This is a BIOS owned area, not kernel ram, but generally
677 * not listed as such in the E820 table.
678 */
679 e820_update_range(0, PAGE_SIZE, E820_RAM, E820_RESERVED);
680 /*
681 * special case: Some BIOSen report the PC BIOS
682 * area (640->1Mb) as ram even though it is not.
683 * take them out.
684 */
685 e820_remove_range(BIOS_BEGIN, BIOS_END - BIOS_BEGIN, E820_RAM, 1);
686 sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &e820.nr_map);
687}
688
670/* 689/*
671 * Determine if we were loaded by an EFI loader. If so, then we have also been 690 * Determine if we were loaded by an EFI loader. If so, then we have also been
672 * passed the efi memmap, systab, etc., so we should use these data structures 691 * passed the efi memmap, systab, etc., so we should use these data structures
@@ -830,7 +849,7 @@ void __init setup_arch(char **cmdline_p)
830 insert_resource(&iomem_resource, &data_resource); 849 insert_resource(&iomem_resource, &data_resource);
831 insert_resource(&iomem_resource, &bss_resource); 850 insert_resource(&iomem_resource, &bss_resource);
832 851
833 852 trim_bios_range();
834#ifdef CONFIG_X86_32 853#ifdef CONFIG_X86_32
835 if (ppro_with_ram_bug()) { 854 if (ppro_with_ram_bug()) {
836 e820_update_range(0x70000000ULL, 0x40000ULL, E820_RAM, 855 e820_update_range(0x70000000ULL, 0x40000ULL, E820_RAM,
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index b4e870cbdc60..9b4401115ea1 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -320,6 +320,7 @@ notrace static void __cpuinit start_secondary(void *unused)
320 unlock_vector_lock(); 320 unlock_vector_lock();
321 ipi_call_unlock(); 321 ipi_call_unlock();
322 per_cpu(cpu_state, smp_processor_id()) = CPU_ONLINE; 322 per_cpu(cpu_state, smp_processor_id()) = CPU_ONLINE;
323 x86_platform.nmi_init();
323 324
324 /* enable local interrupts */ 325 /* enable local interrupts */
325 local_irq_enable(); 326 local_irq_enable();
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index 33399176512a..1168e4454188 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -534,6 +534,9 @@ dotraplinkage void __kprobes do_debug(struct pt_regs *regs, long error_code)
534 534
535 get_debugreg(dr6, 6); 535 get_debugreg(dr6, 6);
536 536
537 /* Filter out all the reserved bits which are preset to 1 */
538 dr6 &= ~DR6_RESERVED;
539
537 /* Catch kmemcheck conditions first of all! */ 540 /* Catch kmemcheck conditions first of all! */
538 if ((dr6 & DR_STEP) && kmemcheck_trap(regs)) 541 if ((dr6 & DR_STEP) && kmemcheck_trap(regs))
539 return; 542 return;
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index 597683aa5ba0..208a857c679f 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -740,7 +740,7 @@ static cycle_t __vsyscall_fn vread_tsc(void)
740} 740}
741#endif 741#endif
742 742
743static void resume_tsc(void) 743static void resume_tsc(struct clocksource *cs)
744{ 744{
745 clocksource_tsc.cycle_last = 0; 745 clocksource_tsc.cycle_last = 0;
746} 746}
@@ -806,7 +806,7 @@ static void __init check_system_tsc_reliable(void)
806 unsigned long res_low, res_high; 806 unsigned long res_low, res_high;
807 807
808 rdmsr_safe(MSR_GEODE_BUSCONT_CONF0, &res_low, &res_high); 808 rdmsr_safe(MSR_GEODE_BUSCONT_CONF0, &res_low, &res_high);
809 /* Geode_LX - the OLPC CPU has a possibly a very reliable TSC */ 809 /* Geode_LX - the OLPC CPU has a very reliable TSC */
810 if (res_low & RTSC_SUSP) 810 if (res_low & RTSC_SUSP)
811 tsc_clocksource_reliable = 1; 811 tsc_clocksource_reliable = 1;
812#endif 812#endif
diff --git a/arch/x86/kernel/uv_sysfs.c b/arch/x86/kernel/uv_sysfs.c
index 36afb98675a4..309c70fb7759 100644
--- a/arch/x86/kernel/uv_sysfs.c
+++ b/arch/x86/kernel/uv_sysfs.c
@@ -54,19 +54,19 @@ static int __init sgi_uv_sysfs_init(void)
54 if (!sgi_uv_kobj) 54 if (!sgi_uv_kobj)
55 sgi_uv_kobj = kobject_create_and_add("sgi_uv", firmware_kobj); 55 sgi_uv_kobj = kobject_create_and_add("sgi_uv", firmware_kobj);
56 if (!sgi_uv_kobj) { 56 if (!sgi_uv_kobj) {
57 printk(KERN_WARNING "kobject_create_and_add sgi_uv failed \n"); 57 printk(KERN_WARNING "kobject_create_and_add sgi_uv failed\n");
58 return -EINVAL; 58 return -EINVAL;
59 } 59 }
60 60
61 ret = sysfs_create_file(sgi_uv_kobj, &partition_id_attr.attr); 61 ret = sysfs_create_file(sgi_uv_kobj, &partition_id_attr.attr);
62 if (ret) { 62 if (ret) {
63 printk(KERN_WARNING "sysfs_create_file partition_id failed \n"); 63 printk(KERN_WARNING "sysfs_create_file partition_id failed\n");
64 return ret; 64 return ret;
65 } 65 }
66 66
67 ret = sysfs_create_file(sgi_uv_kobj, &coherence_id_attr.attr); 67 ret = sysfs_create_file(sgi_uv_kobj, &coherence_id_attr.attr);
68 if (ret) { 68 if (ret) {
69 printk(KERN_WARNING "sysfs_create_file coherence_id failed \n"); 69 printk(KERN_WARNING "sysfs_create_file coherence_id failed\n");
70 return ret; 70 return ret;
71 } 71 }
72 72
diff --git a/arch/x86/kernel/x8664_ksyms_64.c b/arch/x86/kernel/x8664_ksyms_64.c
index 619f7f88b8cc..693920b22496 100644
--- a/arch/x86/kernel/x8664_ksyms_64.c
+++ b/arch/x86/kernel/x8664_ksyms_64.c
@@ -26,7 +26,8 @@ EXPORT_SYMBOL(__put_user_2);
26EXPORT_SYMBOL(__put_user_4); 26EXPORT_SYMBOL(__put_user_4);
27EXPORT_SYMBOL(__put_user_8); 27EXPORT_SYMBOL(__put_user_8);
28 28
29EXPORT_SYMBOL(copy_user_generic); 29EXPORT_SYMBOL(copy_user_generic_string);
30EXPORT_SYMBOL(copy_user_generic_unrolled);
30EXPORT_SYMBOL(__copy_user_nocache); 31EXPORT_SYMBOL(__copy_user_nocache);
31EXPORT_SYMBOL(_copy_from_user); 32EXPORT_SYMBOL(_copy_from_user);
32EXPORT_SYMBOL(_copy_to_user); 33EXPORT_SYMBOL(_copy_to_user);
diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c
index ccd179dec36e..ee5746c94628 100644
--- a/arch/x86/kernel/x86_init.c
+++ b/arch/x86/kernel/x86_init.c
@@ -76,10 +76,13 @@ struct x86_cpuinit_ops x86_cpuinit __cpuinitdata = {
76 .setup_percpu_clockev = setup_secondary_APIC_clock, 76 .setup_percpu_clockev = setup_secondary_APIC_clock,
77}; 77};
78 78
79static void default_nmi_init(void) { };
80
79struct x86_platform_ops x86_platform = { 81struct x86_platform_ops x86_platform = {
80 .calibrate_tsc = native_calibrate_tsc, 82 .calibrate_tsc = native_calibrate_tsc,
81 .get_wallclock = mach_get_cmos_time, 83 .get_wallclock = mach_get_cmos_time,
82 .set_wallclock = mach_set_rtc_mmss, 84 .set_wallclock = mach_set_rtc_mmss,
83 .iommu_shutdown = iommu_shutdown_noop, 85 .iommu_shutdown = iommu_shutdown_noop,
84 .is_untracked_pat_range = is_ISA_range, 86 .is_untracked_pat_range = is_ISA_range,
87 .nmi_init = default_nmi_init
85}; 88};
diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c
index c5ee17e8c6d9..782c3a362ec6 100644
--- a/arch/x86/kernel/xsave.c
+++ b/arch/x86/kernel/xsave.c
@@ -337,6 +337,7 @@ void __ref xsave_cntxt_init(void)
337 cpuid_count(0xd, 0, &eax, &ebx, &ecx, &edx); 337 cpuid_count(0xd, 0, &eax, &ebx, &ecx, &edx);
338 xstate_size = ebx; 338 xstate_size = ebx;
339 339
340 update_regset_xstate_info(xstate_size, pcntxt_mask);
340 prepare_fx_sw_frame(); 341 prepare_fx_sw_frame();
341 342
342 setup_xstate_init(); 343 setup_xstate_init();
diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile
index cffd754f3039..419386c24b82 100644
--- a/arch/x86/lib/Makefile
+++ b/arch/x86/lib/Makefile
@@ -14,7 +14,7 @@ $(obj)/inat.o: $(obj)/inat-tables.c
14 14
15clean-files := inat-tables.c 15clean-files := inat-tables.c
16 16
17obj-$(CONFIG_SMP) += msr-smp.o 17obj-$(CONFIG_SMP) += msr-smp.o cache-smp.o
18 18
19lib-y := delay.o 19lib-y := delay.o
20lib-y += thunk_$(BITS).o 20lib-y += thunk_$(BITS).o
@@ -34,9 +34,10 @@ ifneq ($(CONFIG_X86_CMPXCHG64),y)
34endif 34endif
35 lib-$(CONFIG_X86_USE_3DNOW) += mmx_32.o 35 lib-$(CONFIG_X86_USE_3DNOW) += mmx_32.o
36else 36else
37 obj-y += io_64.o iomap_copy_64.o 37 obj-y += iomap_copy_64.o
38 lib-y += csum-partial_64.o csum-copy_64.o csum-wrappers_64.o 38 lib-y += csum-partial_64.o csum-copy_64.o csum-wrappers_64.o
39 lib-y += thunk_64.o clear_page_64.o copy_page_64.o 39 lib-y += thunk_64.o clear_page_64.o copy_page_64.o
40 lib-y += memmove_64.o memset_64.o 40 lib-y += memmove_64.o memset_64.o
41 lib-y += copy_user_64.o rwlock_64.o copy_user_nocache_64.o 41 lib-y += copy_user_64.o rwlock_64.o copy_user_nocache_64.o
42 lib-$(CONFIG_RWSEM_XCHGADD_ALGORITHM) += rwsem_64.o
42endif 43endif
diff --git a/arch/x86/lib/cache-smp.c b/arch/x86/lib/cache-smp.c
new file mode 100644
index 000000000000..a3c668875038
--- /dev/null
+++ b/arch/x86/lib/cache-smp.c
@@ -0,0 +1,19 @@
1#include <linux/smp.h>
2#include <linux/module.h>
3
4static void __wbinvd(void *dummy)
5{
6 wbinvd();
7}
8
9void wbinvd_on_cpu(int cpu)
10{
11 smp_call_function_single(cpu, __wbinvd, NULL, 1);
12}
13EXPORT_SYMBOL(wbinvd_on_cpu);
14
15int wbinvd_on_all_cpus(void)
16{
17 return on_each_cpu(__wbinvd, NULL, 1);
18}
19EXPORT_SYMBOL(wbinvd_on_all_cpus);
diff --git a/arch/x86/lib/copy_user_64.S b/arch/x86/lib/copy_user_64.S
index cf889d4e076a..71100c98e337 100644
--- a/arch/x86/lib/copy_user_64.S
+++ b/arch/x86/lib/copy_user_64.S
@@ -90,12 +90,6 @@ ENTRY(_copy_from_user)
90 CFI_ENDPROC 90 CFI_ENDPROC
91ENDPROC(_copy_from_user) 91ENDPROC(_copy_from_user)
92 92
93ENTRY(copy_user_generic)
94 CFI_STARTPROC
95 ALTERNATIVE_JUMP X86_FEATURE_REP_GOOD,copy_user_generic_unrolled,copy_user_generic_string
96 CFI_ENDPROC
97ENDPROC(copy_user_generic)
98
99 .section .fixup,"ax" 93 .section .fixup,"ax"
100 /* must zero dest */ 94 /* must zero dest */
101ENTRY(bad_from_user) 95ENTRY(bad_from_user)
diff --git a/arch/x86/lib/io_64.c b/arch/x86/lib/io_64.c
deleted file mode 100644
index 3f1eb59b5f08..000000000000
--- a/arch/x86/lib/io_64.c
+++ /dev/null
@@ -1,25 +0,0 @@
1#include <linux/string.h>
2#include <linux/module.h>
3#include <asm/io.h>
4
5void __memcpy_toio(unsigned long dst, const void *src, unsigned len)
6{
7 __inline_memcpy((void *)dst, src, len);
8}
9EXPORT_SYMBOL(__memcpy_toio);
10
11void __memcpy_fromio(void *dst, unsigned long src, unsigned len)
12{
13 __inline_memcpy(dst, (const void *)src, len);
14}
15EXPORT_SYMBOL(__memcpy_fromio);
16
17void memset_io(volatile void __iomem *a, int b, size_t c)
18{
19 /*
20 * TODO: memset can mangle the IO patterns quite a bit.
21 * perhaps it would be better to use a dumb one:
22 */
23 memset((void *)a, b, c);
24}
25EXPORT_SYMBOL(memset_io);
diff --git a/arch/x86/lib/memcpy_64.S b/arch/x86/lib/memcpy_64.S
index ad5441ed1b57..f82e884928af 100644
--- a/arch/x86/lib/memcpy_64.S
+++ b/arch/x86/lib/memcpy_64.S
@@ -20,12 +20,11 @@
20/* 20/*
21 * memcpy_c() - fast string ops (REP MOVSQ) based variant. 21 * memcpy_c() - fast string ops (REP MOVSQ) based variant.
22 * 22 *
23 * Calls to this get patched into the kernel image via the 23 * This gets patched over the unrolled variant (below) via the
24 * alternative instructions framework: 24 * alternative instructions framework:
25 */ 25 */
26 ALIGN 26 .section .altinstr_replacement, "ax", @progbits
27memcpy_c: 27.Lmemcpy_c:
28 CFI_STARTPROC
29 movq %rdi, %rax 28 movq %rdi, %rax
30 29
31 movl %edx, %ecx 30 movl %edx, %ecx
@@ -35,8 +34,8 @@ memcpy_c:
35 movl %edx, %ecx 34 movl %edx, %ecx
36 rep movsb 35 rep movsb
37 ret 36 ret
38 CFI_ENDPROC 37.Lmemcpy_e:
39ENDPROC(memcpy_c) 38 .previous
40 39
41ENTRY(__memcpy) 40ENTRY(__memcpy)
42ENTRY(memcpy) 41ENTRY(memcpy)
@@ -128,16 +127,10 @@ ENDPROC(__memcpy)
128 * It is also a lot simpler. Use this when possible: 127 * It is also a lot simpler. Use this when possible:
129 */ 128 */
130 129
131 .section .altinstr_replacement, "ax"
1321: .byte 0xeb /* jmp <disp8> */
133 .byte (memcpy_c - memcpy) - (2f - 1b) /* offset */
1342:
135 .previous
136
137 .section .altinstructions, "a" 130 .section .altinstructions, "a"
138 .align 8 131 .align 8
139 .quad memcpy 132 .quad memcpy
140 .quad 1b 133 .quad .Lmemcpy_c
141 .byte X86_FEATURE_REP_GOOD 134 .byte X86_FEATURE_REP_GOOD
142 135
143 /* 136 /*
@@ -145,6 +138,6 @@ ENDPROC(__memcpy)
145 * so it is silly to overwrite itself with nops - reboot is the 138 * so it is silly to overwrite itself with nops - reboot is the
146 * only outcome... 139 * only outcome...
147 */ 140 */
148 .byte 2b - 1b 141 .byte .Lmemcpy_e - .Lmemcpy_c
149 .byte 2b - 1b 142 .byte .Lmemcpy_e - .Lmemcpy_c
150 .previous 143 .previous
diff --git a/arch/x86/lib/memset_64.S b/arch/x86/lib/memset_64.S
index 2c5948116bd2..e88d3b81644a 100644
--- a/arch/x86/lib/memset_64.S
+++ b/arch/x86/lib/memset_64.S
@@ -12,9 +12,8 @@
12 * 12 *
13 * rax original destination 13 * rax original destination
14 */ 14 */
15 ALIGN 15 .section .altinstr_replacement, "ax", @progbits
16memset_c: 16.Lmemset_c:
17 CFI_STARTPROC
18 movq %rdi,%r9 17 movq %rdi,%r9
19 movl %edx,%r8d 18 movl %edx,%r8d
20 andl $7,%r8d 19 andl $7,%r8d
@@ -29,8 +28,8 @@ memset_c:
29 rep stosb 28 rep stosb
30 movq %r9,%rax 29 movq %r9,%rax
31 ret 30 ret
32 CFI_ENDPROC 31.Lmemset_e:
33ENDPROC(memset_c) 32 .previous
34 33
35ENTRY(memset) 34ENTRY(memset)
36ENTRY(__memset) 35ENTRY(__memset)
@@ -118,16 +117,11 @@ ENDPROC(__memset)
118 117
119#include <asm/cpufeature.h> 118#include <asm/cpufeature.h>
120 119
121 .section .altinstr_replacement,"ax"
1221: .byte 0xeb /* jmp <disp8> */
123 .byte (memset_c - memset) - (2f - 1b) /* offset */
1242:
125 .previous
126 .section .altinstructions,"a" 120 .section .altinstructions,"a"
127 .align 8 121 .align 8
128 .quad memset 122 .quad memset
129 .quad 1b 123 .quad .Lmemset_c
130 .byte X86_FEATURE_REP_GOOD 124 .byte X86_FEATURE_REP_GOOD
131 .byte .Lfinal - memset 125 .byte .Lfinal - memset
132 .byte 2b - 1b 126 .byte .Lmemset_e - .Lmemset_c
133 .previous 127 .previous
diff --git a/arch/x86/lib/rwsem_64.S b/arch/x86/lib/rwsem_64.S
new file mode 100644
index 000000000000..15acecf0d7aa
--- /dev/null
+++ b/arch/x86/lib/rwsem_64.S
@@ -0,0 +1,81 @@
1/*
2 * x86-64 rwsem wrappers
3 *
4 * This interfaces the inline asm code to the slow-path
5 * C routines. We need to save the call-clobbered regs
6 * that the asm does not mark as clobbered, and move the
7 * argument from %rax to %rdi.
8 *
9 * NOTE! We don't need to save %rax, because the functions
10 * will always return the semaphore pointer in %rax (which
11 * is also the input argument to these helpers)
12 *
13 * The following can clobber %rdx because the asm clobbers it:
14 * call_rwsem_down_write_failed
15 * call_rwsem_wake
16 * but %rdi, %rsi, %rcx, %r8-r11 always need saving.
17 */
18
19#include <linux/linkage.h>
20#include <asm/rwlock.h>
21#include <asm/alternative-asm.h>
22#include <asm/frame.h>
23#include <asm/dwarf2.h>
24
25#define save_common_regs \
26 pushq %rdi; \
27 pushq %rsi; \
28 pushq %rcx; \
29 pushq %r8; \
30 pushq %r9; \
31 pushq %r10; \
32 pushq %r11
33
34#define restore_common_regs \
35 popq %r11; \
36 popq %r10; \
37 popq %r9; \
38 popq %r8; \
39 popq %rcx; \
40 popq %rsi; \
41 popq %rdi
42
43/* Fix up special calling conventions */
44ENTRY(call_rwsem_down_read_failed)
45 save_common_regs
46 pushq %rdx
47 movq %rax,%rdi
48 call rwsem_down_read_failed
49 popq %rdx
50 restore_common_regs
51 ret
52 ENDPROC(call_rwsem_down_read_failed)
53
54ENTRY(call_rwsem_down_write_failed)
55 save_common_regs
56 movq %rax,%rdi
57 call rwsem_down_write_failed
58 restore_common_regs
59 ret
60 ENDPROC(call_rwsem_down_write_failed)
61
62ENTRY(call_rwsem_wake)
63 decw %dx /* do nothing if still outstanding active readers */
64 jnz 1f
65 save_common_regs
66 movq %rax,%rdi
67 call rwsem_wake
68 restore_common_regs
691: ret
70 ENDPROC(call_rwsem_wake)
71
72/* Fix up special calling conventions */
73ENTRY(call_rwsem_downgrade_wake)
74 save_common_regs
75 pushq %rdx
76 movq %rax,%rdi
77 call rwsem_downgrade_wake
78 popq %rdx
79 restore_common_regs
80 ret
81 ENDPROC(call_rwsem_downgrade_wake)
diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c
index d406c5239019..e71c5cbc8f35 100644
--- a/arch/x86/mm/init.c
+++ b/arch/x86/mm/init.c
@@ -266,16 +266,9 @@ unsigned long __init_refok init_memory_mapping(unsigned long start,
266 if (!after_bootmem) 266 if (!after_bootmem)
267 find_early_table_space(end, use_pse, use_gbpages); 267 find_early_table_space(end, use_pse, use_gbpages);
268 268
269#ifdef CONFIG_X86_32
270 for (i = 0; i < nr_range; i++)
271 kernel_physical_mapping_init(mr[i].start, mr[i].end,
272 mr[i].page_size_mask);
273 ret = end;
274#else /* CONFIG_X86_64 */
275 for (i = 0; i < nr_range; i++) 269 for (i = 0; i < nr_range; i++)
276 ret = kernel_physical_mapping_init(mr[i].start, mr[i].end, 270 ret = kernel_physical_mapping_init(mr[i].start, mr[i].end,
277 mr[i].page_size_mask); 271 mr[i].page_size_mask);
278#endif
279 272
280#ifdef CONFIG_X86_32 273#ifdef CONFIG_X86_32
281 early_ioremap_page_table_range_init(); 274 early_ioremap_page_table_range_init();
diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c
index 9a0c258a86be..2226f2c70ea3 100644
--- a/arch/x86/mm/init_32.c
+++ b/arch/x86/mm/init_32.c
@@ -241,6 +241,7 @@ kernel_physical_mapping_init(unsigned long start,
241 unsigned long page_size_mask) 241 unsigned long page_size_mask)
242{ 242{
243 int use_pse = page_size_mask == (1<<PG_LEVEL_2M); 243 int use_pse = page_size_mask == (1<<PG_LEVEL_2M);
244 unsigned long last_map_addr = end;
244 unsigned long start_pfn, end_pfn; 245 unsigned long start_pfn, end_pfn;
245 pgd_t *pgd_base = swapper_pg_dir; 246 pgd_t *pgd_base = swapper_pg_dir;
246 int pgd_idx, pmd_idx, pte_ofs; 247 int pgd_idx, pmd_idx, pte_ofs;
@@ -341,9 +342,10 @@ repeat:
341 prot = PAGE_KERNEL_EXEC; 342 prot = PAGE_KERNEL_EXEC;
342 343
343 pages_4k++; 344 pages_4k++;
344 if (mapping_iter == 1) 345 if (mapping_iter == 1) {
345 set_pte(pte, pfn_pte(pfn, init_prot)); 346 set_pte(pte, pfn_pte(pfn, init_prot));
346 else 347 last_map_addr = (pfn << PAGE_SHIFT) + PAGE_SIZE;
348 } else
347 set_pte(pte, pfn_pte(pfn, prot)); 349 set_pte(pte, pfn_pte(pfn, prot));
348 } 350 }
349 } 351 }
@@ -368,7 +370,7 @@ repeat:
368 mapping_iter = 2; 370 mapping_iter = 2;
369 goto repeat; 371 goto repeat;
370 } 372 }
371 return 0; 373 return last_map_addr;
372} 374}
373 375
374pte_t *kmap_pte; 376pte_t *kmap_pte;
diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c
index c246d259822d..5eb1ba74a3a9 100644
--- a/arch/x86/mm/ioremap.c
+++ b/arch/x86/mm/ioremap.c
@@ -24,43 +24,6 @@
24 24
25#include "physaddr.h" 25#include "physaddr.h"
26 26
27int page_is_ram(unsigned long pagenr)
28{
29 resource_size_t addr, end;
30 int i;
31
32 /*
33 * A special case is the first 4Kb of memory;
34 * This is a BIOS owned area, not kernel ram, but generally
35 * not listed as such in the E820 table.
36 */
37 if (pagenr == 0)
38 return 0;
39
40 /*
41 * Second special case: Some BIOSen report the PC BIOS
42 * area (640->1Mb) as ram even though it is not.
43 */
44 if (pagenr >= (BIOS_BEGIN >> PAGE_SHIFT) &&
45 pagenr < (BIOS_END >> PAGE_SHIFT))
46 return 0;
47
48 for (i = 0; i < e820.nr_map; i++) {
49 /*
50 * Not usable memory:
51 */
52 if (e820.map[i].type != E820_RAM)
53 continue;
54 addr = (e820.map[i].addr + PAGE_SIZE-1) >> PAGE_SHIFT;
55 end = (e820.map[i].addr + e820.map[i].size) >> PAGE_SHIFT;
56
57
58 if ((pagenr >= addr) && (pagenr < end))
59 return 1;
60 }
61 return 0;
62}
63
64/* 27/*
65 * Fix up the linear direct mapping of the kernel to avoid cache attribute 28 * Fix up the linear direct mapping of the kernel to avoid cache attribute
66 * conflicts. 29 * conflicts.
@@ -422,6 +385,10 @@ void __init early_ioremap_init(void)
422 * The boot-ioremap range spans multiple pmds, for which 385 * The boot-ioremap range spans multiple pmds, for which
423 * we are not prepared: 386 * we are not prepared:
424 */ 387 */
388#define __FIXADDR_TOP (-PAGE_SIZE)
389 BUILD_BUG_ON((__fix_to_virt(FIX_BTMAP_BEGIN) >> PMD_SHIFT)
390 != (__fix_to_virt(FIX_BTMAP_END) >> PMD_SHIFT));
391#undef __FIXADDR_TOP
425 if (pmd != early_ioremap_pmd(fix_to_virt(FIX_BTMAP_END))) { 392 if (pmd != early_ioremap_pmd(fix_to_virt(FIX_BTMAP_END))) {
426 WARN_ON(1); 393 WARN_ON(1);
427 printk(KERN_WARNING "pmd %p != %p\n", 394 printk(KERN_WARNING "pmd %p != %p\n",
diff --git a/arch/x86/mm/kmemcheck/kmemcheck.c b/arch/x86/mm/kmemcheck/kmemcheck.c
index 8cc183344140..b3b531a4f8e5 100644
--- a/arch/x86/mm/kmemcheck/kmemcheck.c
+++ b/arch/x86/mm/kmemcheck/kmemcheck.c
@@ -337,7 +337,7 @@ bool kmemcheck_is_obj_initialized(unsigned long addr, size_t size)
337 if (!shadow) 337 if (!shadow)
338 return true; 338 return true;
339 339
340 status = kmemcheck_shadow_test(shadow, size); 340 status = kmemcheck_shadow_test_all(shadow, size);
341 341
342 return status == KMEMCHECK_SHADOW_INITIALIZED; 342 return status == KMEMCHECK_SHADOW_INITIALIZED;
343} 343}
diff --git a/arch/x86/mm/kmemcheck/shadow.c b/arch/x86/mm/kmemcheck/shadow.c
index 3f66b82076a3..aec124214d97 100644
--- a/arch/x86/mm/kmemcheck/shadow.c
+++ b/arch/x86/mm/kmemcheck/shadow.c
@@ -125,12 +125,12 @@ void kmemcheck_mark_initialized_pages(struct page *p, unsigned int n)
125 125
126enum kmemcheck_shadow kmemcheck_shadow_test(void *shadow, unsigned int size) 126enum kmemcheck_shadow kmemcheck_shadow_test(void *shadow, unsigned int size)
127{ 127{
128#ifdef CONFIG_KMEMCHECK_PARTIAL_OK
128 uint8_t *x; 129 uint8_t *x;
129 unsigned int i; 130 unsigned int i;
130 131
131 x = shadow; 132 x = shadow;
132 133
133#ifdef CONFIG_KMEMCHECK_PARTIAL_OK
134 /* 134 /*
135 * Make sure _some_ bytes are initialized. Gcc frequently generates 135 * Make sure _some_ bytes are initialized. Gcc frequently generates
136 * code to access neighboring bytes. 136 * code to access neighboring bytes.
@@ -139,13 +139,25 @@ enum kmemcheck_shadow kmemcheck_shadow_test(void *shadow, unsigned int size)
139 if (x[i] == KMEMCHECK_SHADOW_INITIALIZED) 139 if (x[i] == KMEMCHECK_SHADOW_INITIALIZED)
140 return x[i]; 140 return x[i];
141 } 141 }
142
143 return x[0];
142#else 144#else
145 return kmemcheck_shadow_test_all(shadow, size);
146#endif
147}
148
149enum kmemcheck_shadow kmemcheck_shadow_test_all(void *shadow, unsigned int size)
150{
151 uint8_t *x;
152 unsigned int i;
153
154 x = shadow;
155
143 /* All bytes must be initialized. */ 156 /* All bytes must be initialized. */
144 for (i = 0; i < size; ++i) { 157 for (i = 0; i < size; ++i) {
145 if (x[i] != KMEMCHECK_SHADOW_INITIALIZED) 158 if (x[i] != KMEMCHECK_SHADOW_INITIALIZED)
146 return x[i]; 159 return x[i];
147 } 160 }
148#endif
149 161
150 return x[0]; 162 return x[0];
151} 163}
diff --git a/arch/x86/mm/kmemcheck/shadow.h b/arch/x86/mm/kmemcheck/shadow.h
index af46d9ab9d86..ff0b2f70fbcb 100644
--- a/arch/x86/mm/kmemcheck/shadow.h
+++ b/arch/x86/mm/kmemcheck/shadow.h
@@ -11,6 +11,8 @@ enum kmemcheck_shadow {
11void *kmemcheck_shadow_lookup(unsigned long address); 11void *kmemcheck_shadow_lookup(unsigned long address);
12 12
13enum kmemcheck_shadow kmemcheck_shadow_test(void *shadow, unsigned int size); 13enum kmemcheck_shadow kmemcheck_shadow_test(void *shadow, unsigned int size);
14enum kmemcheck_shadow kmemcheck_shadow_test_all(void *shadow,
15 unsigned int size);
14void kmemcheck_shadow_set(void *shadow, unsigned int size); 16void kmemcheck_shadow_set(void *shadow, unsigned int size);
15 17
16#endif 18#endif
diff --git a/arch/x86/mm/mmap.c b/arch/x86/mm/mmap.c
index c8191defc38a..1dab5194fd9d 100644
--- a/arch/x86/mm/mmap.c
+++ b/arch/x86/mm/mmap.c
@@ -71,7 +71,7 @@ static int mmap_is_legacy(void)
71 if (current->personality & ADDR_COMPAT_LAYOUT) 71 if (current->personality & ADDR_COMPAT_LAYOUT)
72 return 1; 72 return 1;
73 73
74 if (current->signal->rlim[RLIMIT_STACK].rlim_cur == RLIM_INFINITY) 74 if (rlimit(RLIMIT_STACK) == RLIM_INFINITY)
75 return 1; 75 return 1;
76 76
77 return sysctl_legacy_va_layout; 77 return sysctl_legacy_va_layout;
@@ -96,7 +96,7 @@ static unsigned long mmap_rnd(void)
96 96
97static unsigned long mmap_base(void) 97static unsigned long mmap_base(void)
98{ 98{
99 unsigned long gap = current->signal->rlim[RLIMIT_STACK].rlim_cur; 99 unsigned long gap = rlimit(RLIMIT_STACK);
100 100
101 if (gap < MIN_GAP) 101 if (gap < MIN_GAP)
102 gap = MIN_GAP; 102 gap = MIN_GAP;
diff --git a/arch/x86/mm/numa_64.c b/arch/x86/mm/numa_64.c
index 83bbc70d11bb..3307ea8bd43a 100644
--- a/arch/x86/mm/numa_64.c
+++ b/arch/x86/mm/numa_64.c
@@ -427,7 +427,7 @@ static int __init split_nodes_interleave(u64 addr, u64 max_addr,
427 * Calculate the number of big nodes that can be allocated as a result 427 * Calculate the number of big nodes that can be allocated as a result
428 * of consolidating the remainder. 428 * of consolidating the remainder.
429 */ 429 */
430 big = ((size & ~FAKE_NODE_MIN_HASH_MASK) & nr_nodes) / 430 big = ((size & ~FAKE_NODE_MIN_HASH_MASK) * nr_nodes) /
431 FAKE_NODE_MIN_SIZE; 431 FAKE_NODE_MIN_SIZE;
432 432
433 size &= FAKE_NODE_MIN_HASH_MASK; 433 size &= FAKE_NODE_MIN_HASH_MASK;
@@ -502,77 +502,99 @@ static int __init split_nodes_interleave(u64 addr, u64 max_addr,
502} 502}
503 503
504/* 504/*
505 * Splits num_nodes nodes up equally starting at node_start. The return value 505 * Returns the end address of a node so that there is at least `size' amount of
506 * is the number of nodes split up and addr is adjusted to be at the end of the 506 * non-reserved memory or `max_addr' is reached.
507 * last node allocated.
508 */ 507 */
509static int __init split_nodes_equally(u64 *addr, u64 max_addr, int node_start, 508static u64 __init find_end_of_node(u64 start, u64 max_addr, u64 size)
510 int num_nodes)
511{ 509{
512 unsigned int big; 510 u64 end = start + size;
513 u64 size;
514 int i;
515
516 if (num_nodes <= 0)
517 return -1;
518 if (num_nodes > MAX_NUMNODES)
519 num_nodes = MAX_NUMNODES;
520 size = (max_addr - *addr - e820_hole_size(*addr, max_addr)) /
521 num_nodes;
522 /*
523 * Calculate the number of big nodes that can be allocated as a result
524 * of consolidating the leftovers.
525 */
526 big = ((size & ~FAKE_NODE_MIN_HASH_MASK) * num_nodes) /
527 FAKE_NODE_MIN_SIZE;
528
529 /* Round down to nearest FAKE_NODE_MIN_SIZE. */
530 size &= FAKE_NODE_MIN_HASH_MASK;
531 if (!size) {
532 printk(KERN_ERR "Not enough memory for each node. "
533 "NUMA emulation disabled.\n");
534 return -1;
535 }
536
537 for (i = node_start; i < num_nodes + node_start; i++) {
538 u64 end = *addr + size;
539 511
540 if (i < big) 512 while (end - start - e820_hole_size(start, end) < size) {
541 end += FAKE_NODE_MIN_SIZE; 513 end += FAKE_NODE_MIN_SIZE;
542 /* 514 if (end > max_addr) {
543 * The final node can have the remaining system RAM. Other
544 * nodes receive roughly the same amount of available pages.
545 */
546 if (i == num_nodes + node_start - 1)
547 end = max_addr; 515 end = max_addr;
548 else
549 while (end - *addr - e820_hole_size(*addr, end) <
550 size) {
551 end += FAKE_NODE_MIN_SIZE;
552 if (end > max_addr) {
553 end = max_addr;
554 break;
555 }
556 }
557 if (setup_node_range(i, addr, end - *addr, max_addr) < 0)
558 break; 516 break;
517 }
559 } 518 }
560 return i - node_start + 1; 519 return end;
561} 520}
562 521
563/* 522/*
564 * Splits the remaining system RAM into chunks of size. The remaining memory is 523 * Sets up fake nodes of `size' interleaved over physical nodes ranging from
565 * always assigned to a final node and can be asymmetric. Returns the number of 524 * `addr' to `max_addr'. The return value is the number of nodes allocated.
566 * nodes split.
567 */ 525 */
568static int __init split_nodes_by_size(u64 *addr, u64 max_addr, int node_start, 526static int __init split_nodes_size_interleave(u64 addr, u64 max_addr, u64 size)
569 u64 size)
570{ 527{
571 int i = node_start; 528 nodemask_t physnode_mask = NODE_MASK_NONE;
572 size = (size << 20) & FAKE_NODE_MIN_HASH_MASK; 529 u64 min_size;
573 while (!setup_node_range(i++, addr, size, max_addr)) 530 int ret = 0;
574 ; 531 int i;
575 return i - node_start; 532
533 if (!size)
534 return -1;
535 /*
536 * The limit on emulated nodes is MAX_NUMNODES, so the size per node is
537 * increased accordingly if the requested size is too small. This
538 * creates a uniform distribution of node sizes across the entire
539 * machine (but not necessarily over physical nodes).
540 */
541 min_size = (max_addr - addr - e820_hole_size(addr, max_addr)) /
542 MAX_NUMNODES;
543 min_size = max(min_size, FAKE_NODE_MIN_SIZE);
544 if ((min_size & FAKE_NODE_MIN_HASH_MASK) < min_size)
545 min_size = (min_size + FAKE_NODE_MIN_SIZE) &
546 FAKE_NODE_MIN_HASH_MASK;
547 if (size < min_size) {
548 pr_err("Fake node size %LuMB too small, increasing to %LuMB\n",
549 size >> 20, min_size >> 20);
550 size = min_size;
551 }
552 size &= FAKE_NODE_MIN_HASH_MASK;
553
554 for (i = 0; i < MAX_NUMNODES; i++)
555 if (physnodes[i].start != physnodes[i].end)
556 node_set(i, physnode_mask);
557 /*
558 * Fill physical nodes with fake nodes of size until there is no memory
559 * left on any of them.
560 */
561 while (nodes_weight(physnode_mask)) {
562 for_each_node_mask(i, physnode_mask) {
563 u64 dma32_end = MAX_DMA32_PFN << PAGE_SHIFT;
564 u64 end;
565
566 end = find_end_of_node(physnodes[i].start,
567 physnodes[i].end, size);
568 /*
569 * If there won't be at least FAKE_NODE_MIN_SIZE of
570 * non-reserved memory in ZONE_DMA32 for the next node,
571 * this one must extend to the boundary.
572 */
573 if (end < dma32_end && dma32_end - end -
574 e820_hole_size(end, dma32_end) < FAKE_NODE_MIN_SIZE)
575 end = dma32_end;
576
577 /*
578 * If there won't be enough non-reserved memory for the
579 * next node, this one must extend to the end of the
580 * physical node.
581 */
582 if (physnodes[i].end - end -
583 e820_hole_size(end, physnodes[i].end) < size)
584 end = physnodes[i].end;
585
586 /*
587 * Setup the fake node that will be allocated as bootmem
588 * later. If setup_node_range() returns non-zero, there
589 * is no more memory available on this physical node.
590 */
591 if (setup_node_range(ret++, &physnodes[i].start,
592 end - physnodes[i].start,
593 physnodes[i].end) < 0)
594 node_clear(i, physnode_mask);
595 }
596 }
597 return ret;
576} 598}
577 599
578/* 600/*
@@ -582,87 +604,32 @@ static int __init split_nodes_by_size(u64 *addr, u64 max_addr, int node_start,
582static int __init numa_emulation(unsigned long start_pfn, 604static int __init numa_emulation(unsigned long start_pfn,
583 unsigned long last_pfn, int acpi, int k8) 605 unsigned long last_pfn, int acpi, int k8)
584{ 606{
585 u64 size, addr = start_pfn << PAGE_SHIFT; 607 u64 addr = start_pfn << PAGE_SHIFT;
586 u64 max_addr = last_pfn << PAGE_SHIFT; 608 u64 max_addr = last_pfn << PAGE_SHIFT;
587 int num_nodes = 0, num = 0, coeff_flag, coeff = -1, i;
588 int num_phys_nodes; 609 int num_phys_nodes;
610 int num_nodes;
611 int i;
589 612
590 num_phys_nodes = setup_physnodes(addr, max_addr, acpi, k8); 613 num_phys_nodes = setup_physnodes(addr, max_addr, acpi, k8);
591 /* 614 /*
592 * If the numa=fake command-line is just a single number N, split the 615 * If the numa=fake command-line contains a 'M' or 'G', it represents
593 * system RAM into N fake nodes. 616 * the fixed node size. Otherwise, if it is just a single number N,
617 * split the system RAM into N fake nodes.
594 */ 618 */
595 if (!strchr(cmdline, '*') && !strchr(cmdline, ',')) { 619 if (strchr(cmdline, 'M') || strchr(cmdline, 'G')) {
596 long n = simple_strtol(cmdline, NULL, 0); 620 u64 size;
597
598 num_nodes = split_nodes_interleave(addr, max_addr,
599 num_phys_nodes, n);
600 if (num_nodes < 0)
601 return num_nodes;
602 goto out;
603 }
604 621
605 /* Parse the command line. */ 622 size = memparse(cmdline, &cmdline);
606 for (coeff_flag = 0; ; cmdline++) { 623 num_nodes = split_nodes_size_interleave(addr, max_addr, size);
607 if (*cmdline && isdigit(*cmdline)) { 624 } else {
608 num = num * 10 + *cmdline - '0'; 625 unsigned long n;
609 continue; 626
610 } 627 n = simple_strtoul(cmdline, NULL, 0);
611 if (*cmdline == '*') { 628 num_nodes = split_nodes_interleave(addr, max_addr, num_phys_nodes, n);
612 if (num > 0)
613 coeff = num;
614 coeff_flag = 1;
615 }
616 if (!*cmdline || *cmdline == ',') {
617 if (!coeff_flag)
618 coeff = 1;
619 /*
620 * Round down to the nearest FAKE_NODE_MIN_SIZE.
621 * Command-line coefficients are in megabytes.
622 */
623 size = ((u64)num << 20) & FAKE_NODE_MIN_HASH_MASK;
624 if (size)
625 for (i = 0; i < coeff; i++, num_nodes++)
626 if (setup_node_range(num_nodes, &addr,
627 size, max_addr) < 0)
628 goto done;
629 if (!*cmdline)
630 break;
631 coeff_flag = 0;
632 coeff = -1;
633 }
634 num = 0;
635 }
636done:
637 if (!num_nodes)
638 return -1;
639 /* Fill remainder of system RAM, if appropriate. */
640 if (addr < max_addr) {
641 if (coeff_flag && coeff < 0) {
642 /* Split remaining nodes into num-sized chunks */
643 num_nodes += split_nodes_by_size(&addr, max_addr,
644 num_nodes, num);
645 goto out;
646 }
647 switch (*(cmdline - 1)) {
648 case '*':
649 /* Split remaining nodes into coeff chunks */
650 if (coeff <= 0)
651 break;
652 num_nodes += split_nodes_equally(&addr, max_addr,
653 num_nodes, coeff);
654 break;
655 case ',':
656 /* Do not allocate remaining system RAM */
657 break;
658 default:
659 /* Give one final node */
660 setup_node_range(num_nodes, &addr, max_addr - addr,
661 max_addr);
662 num_nodes++;
663 }
664 } 629 }
665out: 630
631 if (num_nodes < 0)
632 return num_nodes;
666 memnode_shift = compute_hash_shift(nodes, num_nodes, NULL); 633 memnode_shift = compute_hash_shift(nodes, num_nodes, NULL);
667 if (memnode_shift < 0) { 634 if (memnode_shift < 0) {
668 memnode_shift = 0; 635 memnode_shift = 0;
diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c
index ed34f5e35999..c9ba9deafe83 100644
--- a/arch/x86/mm/pgtable.c
+++ b/arch/x86/mm/pgtable.c
@@ -6,6 +6,14 @@
6 6
7#define PGALLOC_GFP GFP_KERNEL | __GFP_NOTRACK | __GFP_REPEAT | __GFP_ZERO 7#define PGALLOC_GFP GFP_KERNEL | __GFP_NOTRACK | __GFP_REPEAT | __GFP_ZERO
8 8
9#ifdef CONFIG_HIGHPTE
10#define PGALLOC_USER_GFP __GFP_HIGHMEM
11#else
12#define PGALLOC_USER_GFP 0
13#endif
14
15gfp_t __userpte_alloc_gfp = PGALLOC_GFP | PGALLOC_USER_GFP;
16
9pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address) 17pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
10{ 18{
11 return (pte_t *)__get_free_page(PGALLOC_GFP); 19 return (pte_t *)__get_free_page(PGALLOC_GFP);
@@ -15,16 +23,29 @@ pgtable_t pte_alloc_one(struct mm_struct *mm, unsigned long address)
15{ 23{
16 struct page *pte; 24 struct page *pte;
17 25
18#ifdef CONFIG_HIGHPTE 26 pte = alloc_pages(__userpte_alloc_gfp, 0);
19 pte = alloc_pages(PGALLOC_GFP | __GFP_HIGHMEM, 0);
20#else
21 pte = alloc_pages(PGALLOC_GFP, 0);
22#endif
23 if (pte) 27 if (pte)
24 pgtable_page_ctor(pte); 28 pgtable_page_ctor(pte);
25 return pte; 29 return pte;
26} 30}
27 31
32static int __init setup_userpte(char *arg)
33{
34 if (!arg)
35 return -EINVAL;
36
37 /*
38 * "userpte=nohigh" disables allocation of user pagetables in
39 * high memory.
40 */
41 if (strcmp(arg, "nohigh") == 0)
42 __userpte_alloc_gfp &= ~__GFP_HIGHMEM;
43 else
44 return -EINVAL;
45 return 0;
46}
47early_param("userpte", setup_userpte);
48
28void ___pte_free_tlb(struct mmu_gather *tlb, struct page *pte) 49void ___pte_free_tlb(struct mmu_gather *tlb, struct page *pte)
29{ 50{
30 pgtable_page_dtor(pte); 51 pgtable_page_dtor(pte);
diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c
index 65b58e4b0b8b..426f3a1a64d3 100644
--- a/arch/x86/mm/tlb.c
+++ b/arch/x86/mm/tlb.c
@@ -41,7 +41,7 @@ union smp_flush_state {
41 struct { 41 struct {
42 struct mm_struct *flush_mm; 42 struct mm_struct *flush_mm;
43 unsigned long flush_va; 43 unsigned long flush_va;
44 spinlock_t tlbstate_lock; 44 raw_spinlock_t tlbstate_lock;
45 DECLARE_BITMAP(flush_cpumask, NR_CPUS); 45 DECLARE_BITMAP(flush_cpumask, NR_CPUS);
46 }; 46 };
47 char pad[INTERNODE_CACHE_BYTES]; 47 char pad[INTERNODE_CACHE_BYTES];
@@ -181,7 +181,7 @@ static void flush_tlb_others_ipi(const struct cpumask *cpumask,
181 * num_online_cpus() <= NUM_INVALIDATE_TLB_VECTORS, but it is 181 * num_online_cpus() <= NUM_INVALIDATE_TLB_VECTORS, but it is
182 * probably not worth checking this for a cache-hot lock. 182 * probably not worth checking this for a cache-hot lock.
183 */ 183 */
184 spin_lock(&f->tlbstate_lock); 184 raw_spin_lock(&f->tlbstate_lock);
185 185
186 f->flush_mm = mm; 186 f->flush_mm = mm;
187 f->flush_va = va; 187 f->flush_va = va;
@@ -199,7 +199,7 @@ static void flush_tlb_others_ipi(const struct cpumask *cpumask,
199 199
200 f->flush_mm = NULL; 200 f->flush_mm = NULL;
201 f->flush_va = 0; 201 f->flush_va = 0;
202 spin_unlock(&f->tlbstate_lock); 202 raw_spin_unlock(&f->tlbstate_lock);
203} 203}
204 204
205void native_flush_tlb_others(const struct cpumask *cpumask, 205void native_flush_tlb_others(const struct cpumask *cpumask,
@@ -223,7 +223,7 @@ static int __cpuinit init_smp_flush(void)
223 int i; 223 int i;
224 224
225 for (i = 0; i < ARRAY_SIZE(flush_state); i++) 225 for (i = 0; i < ARRAY_SIZE(flush_state); i++)
226 spin_lock_init(&flush_state[i].tlbstate_lock); 226 raw_spin_lock_init(&flush_state[i].tlbstate_lock);
227 227
228 return 0; 228 return 0;
229} 229}
diff --git a/arch/x86/oprofile/nmi_int.c b/arch/x86/oprofile/nmi_int.c
index 3347f696edc7..2c505ee71014 100644
--- a/arch/x86/oprofile/nmi_int.c
+++ b/arch/x86/oprofile/nmi_int.c
@@ -159,7 +159,7 @@ static int nmi_setup_mux(void)
159 159
160 for_each_possible_cpu(i) { 160 for_each_possible_cpu(i) {
161 per_cpu(cpu_msrs, i).multiplex = 161 per_cpu(cpu_msrs, i).multiplex =
162 kmalloc(multiplex_size, GFP_KERNEL); 162 kzalloc(multiplex_size, GFP_KERNEL);
163 if (!per_cpu(cpu_msrs, i).multiplex) 163 if (!per_cpu(cpu_msrs, i).multiplex)
164 return 0; 164 return 0;
165 } 165 }
@@ -179,7 +179,6 @@ static void nmi_cpu_setup_mux(int cpu, struct op_msrs const * const msrs)
179 if (counter_config[i].enabled) { 179 if (counter_config[i].enabled) {
180 multiplex[i].saved = -(u64)counter_config[i].count; 180 multiplex[i].saved = -(u64)counter_config[i].count;
181 } else { 181 } else {
182 multiplex[i].addr = 0;
183 multiplex[i].saved = 0; 182 multiplex[i].saved = 0;
184 } 183 }
185 } 184 }
@@ -189,25 +188,27 @@ static void nmi_cpu_setup_mux(int cpu, struct op_msrs const * const msrs)
189 188
190static void nmi_cpu_save_mpx_registers(struct op_msrs *msrs) 189static void nmi_cpu_save_mpx_registers(struct op_msrs *msrs)
191{ 190{
191 struct op_msr *counters = msrs->counters;
192 struct op_msr *multiplex = msrs->multiplex; 192 struct op_msr *multiplex = msrs->multiplex;
193 int i; 193 int i;
194 194
195 for (i = 0; i < model->num_counters; ++i) { 195 for (i = 0; i < model->num_counters; ++i) {
196 int virt = op_x86_phys_to_virt(i); 196 int virt = op_x86_phys_to_virt(i);
197 if (multiplex[virt].addr) 197 if (counters[i].addr)
198 rdmsrl(multiplex[virt].addr, multiplex[virt].saved); 198 rdmsrl(counters[i].addr, multiplex[virt].saved);
199 } 199 }
200} 200}
201 201
202static void nmi_cpu_restore_mpx_registers(struct op_msrs *msrs) 202static void nmi_cpu_restore_mpx_registers(struct op_msrs *msrs)
203{ 203{
204 struct op_msr *counters = msrs->counters;
204 struct op_msr *multiplex = msrs->multiplex; 205 struct op_msr *multiplex = msrs->multiplex;
205 int i; 206 int i;
206 207
207 for (i = 0; i < model->num_counters; ++i) { 208 for (i = 0; i < model->num_counters; ++i) {
208 int virt = op_x86_phys_to_virt(i); 209 int virt = op_x86_phys_to_virt(i);
209 if (multiplex[virt].addr) 210 if (counters[i].addr)
210 wrmsrl(multiplex[virt].addr, multiplex[virt].saved); 211 wrmsrl(counters[i].addr, multiplex[virt].saved);
211 } 212 }
212} 213}
213 214
@@ -303,11 +304,11 @@ static int allocate_msrs(void)
303 304
304 int i; 305 int i;
305 for_each_possible_cpu(i) { 306 for_each_possible_cpu(i) {
306 per_cpu(cpu_msrs, i).counters = kmalloc(counters_size, 307 per_cpu(cpu_msrs, i).counters = kzalloc(counters_size,
307 GFP_KERNEL); 308 GFP_KERNEL);
308 if (!per_cpu(cpu_msrs, i).counters) 309 if (!per_cpu(cpu_msrs, i).counters)
309 return 0; 310 return 0;
310 per_cpu(cpu_msrs, i).controls = kmalloc(controls_size, 311 per_cpu(cpu_msrs, i).controls = kzalloc(controls_size,
311 GFP_KERNEL); 312 GFP_KERNEL);
312 if (!per_cpu(cpu_msrs, i).controls) 313 if (!per_cpu(cpu_msrs, i).controls)
313 return 0; 314 return 0;
diff --git a/arch/x86/oprofile/op_model_amd.c b/arch/x86/oprofile/op_model_amd.c
index 39686c29f03a..6a58256dce9f 100644
--- a/arch/x86/oprofile/op_model_amd.c
+++ b/arch/x86/oprofile/op_model_amd.c
@@ -22,6 +22,9 @@
22#include <asm/ptrace.h> 22#include <asm/ptrace.h>
23#include <asm/msr.h> 23#include <asm/msr.h>
24#include <asm/nmi.h> 24#include <asm/nmi.h>
25#include <asm/apic.h>
26#include <asm/processor.h>
27#include <asm/cpufeature.h>
25 28
26#include "op_x86_model.h" 29#include "op_x86_model.h"
27#include "op_counter.h" 30#include "op_counter.h"
@@ -43,15 +46,13 @@
43 46
44static unsigned long reset_value[NUM_VIRT_COUNTERS]; 47static unsigned long reset_value[NUM_VIRT_COUNTERS];
45 48
46#ifdef CONFIG_OPROFILE_IBS
47
48/* IbsFetchCtl bits/masks */ 49/* IbsFetchCtl bits/masks */
49#define IBS_FETCH_RAND_EN (1ULL<<57) 50#define IBS_FETCH_RAND_EN (1ULL<<57)
50#define IBS_FETCH_VAL (1ULL<<49) 51#define IBS_FETCH_VAL (1ULL<<49)
51#define IBS_FETCH_ENABLE (1ULL<<48) 52#define IBS_FETCH_ENABLE (1ULL<<48)
52#define IBS_FETCH_CNT_MASK 0xFFFF0000ULL 53#define IBS_FETCH_CNT_MASK 0xFFFF0000ULL
53 54
54/*IbsOpCtl bits */ 55/* IbsOpCtl bits */
55#define IBS_OP_CNT_CTL (1ULL<<19) 56#define IBS_OP_CNT_CTL (1ULL<<19)
56#define IBS_OP_VAL (1ULL<<18) 57#define IBS_OP_VAL (1ULL<<18)
57#define IBS_OP_ENABLE (1ULL<<17) 58#define IBS_OP_ENABLE (1ULL<<17)
@@ -59,7 +60,7 @@ static unsigned long reset_value[NUM_VIRT_COUNTERS];
59#define IBS_FETCH_SIZE 6 60#define IBS_FETCH_SIZE 6
60#define IBS_OP_SIZE 12 61#define IBS_OP_SIZE 12
61 62
62static int has_ibs; /* AMD Family10h and later */ 63static u32 ibs_caps;
63 64
64struct op_ibs_config { 65struct op_ibs_config {
65 unsigned long op_enabled; 66 unsigned long op_enabled;
@@ -71,24 +72,52 @@ struct op_ibs_config {
71}; 72};
72 73
73static struct op_ibs_config ibs_config; 74static struct op_ibs_config ibs_config;
75static u64 ibs_op_ctl;
74 76
75#endif 77/*
78 * IBS cpuid feature detection
79 */
76 80
77#ifdef CONFIG_OPROFILE_EVENT_MULTIPLEX 81#define IBS_CPUID_FEATURES 0x8000001b
82
83/*
84 * Same bit mask as for IBS cpuid feature flags (Fn8000_001B_EAX), but
85 * bit 0 is used to indicate the existence of IBS.
86 */
87#define IBS_CAPS_AVAIL (1LL<<0)
88#define IBS_CAPS_RDWROPCNT (1LL<<3)
89#define IBS_CAPS_OPCNT (1LL<<4)
90
91/*
92 * IBS randomization macros
93 */
94#define IBS_RANDOM_BITS 12
95#define IBS_RANDOM_MASK ((1ULL << IBS_RANDOM_BITS) - 1)
96#define IBS_RANDOM_MAXCNT_OFFSET (1ULL << (IBS_RANDOM_BITS - 5))
78 97
79static void op_mux_fill_in_addresses(struct op_msrs * const msrs) 98static u32 get_ibs_caps(void)
80{ 99{
81 int i; 100 u32 ibs_caps;
101 unsigned int max_level;
82 102
83 for (i = 0; i < NUM_VIRT_COUNTERS; i++) { 103 if (!boot_cpu_has(X86_FEATURE_IBS))
84 int hw_counter = op_x86_virt_to_phys(i); 104 return 0;
85 if (reserve_perfctr_nmi(MSR_K7_PERFCTR0 + i)) 105
86 msrs->multiplex[i].addr = MSR_K7_PERFCTR0 + hw_counter; 106 /* check IBS cpuid feature flags */
87 else 107 max_level = cpuid_eax(0x80000000);
88 msrs->multiplex[i].addr = 0; 108 if (max_level < IBS_CPUID_FEATURES)
89 } 109 return IBS_CAPS_AVAIL;
110
111 ibs_caps = cpuid_eax(IBS_CPUID_FEATURES);
112 if (!(ibs_caps & IBS_CAPS_AVAIL))
113 /* cpuid flags not valid */
114 return IBS_CAPS_AVAIL;
115
116 return ibs_caps;
90} 117}
91 118
119#ifdef CONFIG_OPROFILE_EVENT_MULTIPLEX
120
92static void op_mux_switch_ctrl(struct op_x86_model_spec const *model, 121static void op_mux_switch_ctrl(struct op_x86_model_spec const *model,
93 struct op_msrs const * const msrs) 122 struct op_msrs const * const msrs)
94{ 123{
@@ -98,7 +127,7 @@ static void op_mux_switch_ctrl(struct op_x86_model_spec const *model,
98 /* enable active counters */ 127 /* enable active counters */
99 for (i = 0; i < NUM_COUNTERS; ++i) { 128 for (i = 0; i < NUM_COUNTERS; ++i) {
100 int virt = op_x86_phys_to_virt(i); 129 int virt = op_x86_phys_to_virt(i);
101 if (!counter_config[virt].enabled) 130 if (!reset_value[virt])
102 continue; 131 continue;
103 rdmsrl(msrs->controls[i].addr, val); 132 rdmsrl(msrs->controls[i].addr, val);
104 val &= model->reserved; 133 val &= model->reserved;
@@ -107,10 +136,6 @@ static void op_mux_switch_ctrl(struct op_x86_model_spec const *model,
107 } 136 }
108} 137}
109 138
110#else
111
112static inline void op_mux_fill_in_addresses(struct op_msrs * const msrs) { }
113
114#endif 139#endif
115 140
116/* functions for op_amd_spec */ 141/* functions for op_amd_spec */
@@ -122,18 +147,12 @@ static void op_amd_fill_in_addresses(struct op_msrs * const msrs)
122 for (i = 0; i < NUM_COUNTERS; i++) { 147 for (i = 0; i < NUM_COUNTERS; i++) {
123 if (reserve_perfctr_nmi(MSR_K7_PERFCTR0 + i)) 148 if (reserve_perfctr_nmi(MSR_K7_PERFCTR0 + i))
124 msrs->counters[i].addr = MSR_K7_PERFCTR0 + i; 149 msrs->counters[i].addr = MSR_K7_PERFCTR0 + i;
125 else
126 msrs->counters[i].addr = 0;
127 } 150 }
128 151
129 for (i = 0; i < NUM_CONTROLS; i++) { 152 for (i = 0; i < NUM_CONTROLS; i++) {
130 if (reserve_evntsel_nmi(MSR_K7_EVNTSEL0 + i)) 153 if (reserve_evntsel_nmi(MSR_K7_EVNTSEL0 + i))
131 msrs->controls[i].addr = MSR_K7_EVNTSEL0 + i; 154 msrs->controls[i].addr = MSR_K7_EVNTSEL0 + i;
132 else
133 msrs->controls[i].addr = 0;
134 } 155 }
135
136 op_mux_fill_in_addresses(msrs);
137} 156}
138 157
139static void op_amd_setup_ctrs(struct op_x86_model_spec const *model, 158static void op_amd_setup_ctrs(struct op_x86_model_spec const *model,
@@ -144,7 +163,8 @@ static void op_amd_setup_ctrs(struct op_x86_model_spec const *model,
144 163
145 /* setup reset_value */ 164 /* setup reset_value */
146 for (i = 0; i < NUM_VIRT_COUNTERS; ++i) { 165 for (i = 0; i < NUM_VIRT_COUNTERS; ++i) {
147 if (counter_config[i].enabled) 166 if (counter_config[i].enabled
167 && msrs->counters[op_x86_virt_to_phys(i)].addr)
148 reset_value[i] = counter_config[i].count; 168 reset_value[i] = counter_config[i].count;
149 else 169 else
150 reset_value[i] = 0; 170 reset_value[i] = 0;
@@ -152,9 +172,18 @@ static void op_amd_setup_ctrs(struct op_x86_model_spec const *model,
152 172
153 /* clear all counters */ 173 /* clear all counters */
154 for (i = 0; i < NUM_CONTROLS; ++i) { 174 for (i = 0; i < NUM_CONTROLS; ++i) {
155 if (unlikely(!msrs->controls[i].addr)) 175 if (unlikely(!msrs->controls[i].addr)) {
176 if (counter_config[i].enabled && !smp_processor_id())
177 /*
178 * counter is reserved, this is on all
179 * cpus, so report only for cpu #0
180 */
181 op_x86_warn_reserved(i);
156 continue; 182 continue;
183 }
157 rdmsrl(msrs->controls[i].addr, val); 184 rdmsrl(msrs->controls[i].addr, val);
185 if (val & ARCH_PERFMON_EVENTSEL0_ENABLE)
186 op_x86_warn_in_use(i);
158 val &= model->reserved; 187 val &= model->reserved;
159 wrmsrl(msrs->controls[i].addr, val); 188 wrmsrl(msrs->controls[i].addr, val);
160 } 189 }
@@ -169,9 +198,7 @@ static void op_amd_setup_ctrs(struct op_x86_model_spec const *model,
169 /* enable active counters */ 198 /* enable active counters */
170 for (i = 0; i < NUM_COUNTERS; ++i) { 199 for (i = 0; i < NUM_COUNTERS; ++i) {
171 int virt = op_x86_phys_to_virt(i); 200 int virt = op_x86_phys_to_virt(i);
172 if (!counter_config[virt].enabled) 201 if (!reset_value[virt])
173 continue;
174 if (!msrs->counters[i].addr)
175 continue; 202 continue;
176 203
177 /* setup counter registers */ 204 /* setup counter registers */
@@ -185,7 +212,60 @@ static void op_amd_setup_ctrs(struct op_x86_model_spec const *model,
185 } 212 }
186} 213}
187 214
188#ifdef CONFIG_OPROFILE_IBS 215/*
216 * 16-bit Linear Feedback Shift Register (LFSR)
217 *
218 * 16 14 13 11
219 * Feedback polynomial = X + X + X + X + 1
220 */
221static unsigned int lfsr_random(void)
222{
223 static unsigned int lfsr_value = 0xF00D;
224 unsigned int bit;
225
226 /* Compute next bit to shift in */
227 bit = ((lfsr_value >> 0) ^
228 (lfsr_value >> 2) ^
229 (lfsr_value >> 3) ^
230 (lfsr_value >> 5)) & 0x0001;
231
232 /* Advance to next register value */
233 lfsr_value = (lfsr_value >> 1) | (bit << 15);
234
235 return lfsr_value;
236}
237
238/*
239 * IBS software randomization
240 *
241 * The IBS periodic op counter is randomized in software. The lower 12
242 * bits of the 20 bit counter are randomized. IbsOpCurCnt is
243 * initialized with a 12 bit random value.
244 */
245static inline u64 op_amd_randomize_ibs_op(u64 val)
246{
247 unsigned int random = lfsr_random();
248
249 if (!(ibs_caps & IBS_CAPS_RDWROPCNT))
250 /*
251 * Work around if the hw can not write to IbsOpCurCnt
252 *
253 * Randomize the lower 8 bits of the 16 bit
254 * IbsOpMaxCnt [15:0] value in the range of -128 to
255 * +127 by adding/subtracting an offset to the
256 * maximum count (IbsOpMaxCnt).
257 *
258 * To avoid over or underflows and protect upper bits
259 * starting at bit 16, the initial value for
260 * IbsOpMaxCnt must fit in the range from 0x0081 to
261 * 0xff80.
262 */
263 val += (s8)(random >> 4);
264 else
265 val |= (u64)(random & IBS_RANDOM_MASK) << 32;
266
267 return val;
268}
189 269
190static inline void 270static inline void
191op_amd_handle_ibs(struct pt_regs * const regs, 271op_amd_handle_ibs(struct pt_regs * const regs,
@@ -194,7 +274,7 @@ op_amd_handle_ibs(struct pt_regs * const regs,
194 u64 val, ctl; 274 u64 val, ctl;
195 struct op_entry entry; 275 struct op_entry entry;
196 276
197 if (!has_ibs) 277 if (!ibs_caps)
198 return; 278 return;
199 279
200 if (ibs_config.fetch_enabled) { 280 if (ibs_config.fetch_enabled) {
@@ -236,8 +316,7 @@ op_amd_handle_ibs(struct pt_regs * const regs,
236 oprofile_write_commit(&entry); 316 oprofile_write_commit(&entry);
237 317
238 /* reenable the IRQ */ 318 /* reenable the IRQ */
239 ctl &= ~IBS_OP_VAL & 0xFFFFFFFF; 319 ctl = op_amd_randomize_ibs_op(ibs_op_ctl);
240 ctl |= IBS_OP_ENABLE;
241 wrmsrl(MSR_AMD64_IBSOPCTL, ctl); 320 wrmsrl(MSR_AMD64_IBSOPCTL, ctl);
242 } 321 }
243 } 322 }
@@ -246,41 +325,57 @@ op_amd_handle_ibs(struct pt_regs * const regs,
246static inline void op_amd_start_ibs(void) 325static inline void op_amd_start_ibs(void)
247{ 326{
248 u64 val; 327 u64 val;
249 if (has_ibs && ibs_config.fetch_enabled) { 328
329 if (!ibs_caps)
330 return;
331
332 if (ibs_config.fetch_enabled) {
250 val = (ibs_config.max_cnt_fetch >> 4) & 0xFFFF; 333 val = (ibs_config.max_cnt_fetch >> 4) & 0xFFFF;
251 val |= ibs_config.rand_en ? IBS_FETCH_RAND_EN : 0; 334 val |= ibs_config.rand_en ? IBS_FETCH_RAND_EN : 0;
252 val |= IBS_FETCH_ENABLE; 335 val |= IBS_FETCH_ENABLE;
253 wrmsrl(MSR_AMD64_IBSFETCHCTL, val); 336 wrmsrl(MSR_AMD64_IBSFETCHCTL, val);
254 } 337 }
255 338
256 if (has_ibs && ibs_config.op_enabled) { 339 if (ibs_config.op_enabled) {
257 val = (ibs_config.max_cnt_op >> 4) & 0xFFFF; 340 ibs_op_ctl = ibs_config.max_cnt_op >> 4;
258 val |= ibs_config.dispatched_ops ? IBS_OP_CNT_CTL : 0; 341 if (!(ibs_caps & IBS_CAPS_RDWROPCNT)) {
259 val |= IBS_OP_ENABLE; 342 /*
343 * IbsOpCurCnt not supported. See
344 * op_amd_randomize_ibs_op() for details.
345 */
346 ibs_op_ctl = clamp(ibs_op_ctl, 0x0081ULL, 0xFF80ULL);
347 } else {
348 /*
349 * The start value is randomized with a
350 * positive offset, we need to compensate it
351 * with the half of the randomized range. Also
352 * avoid underflows.
353 */
354 ibs_op_ctl = min(ibs_op_ctl + IBS_RANDOM_MAXCNT_OFFSET,
355 0xFFFFULL);
356 }
357 if (ibs_caps & IBS_CAPS_OPCNT && ibs_config.dispatched_ops)
358 ibs_op_ctl |= IBS_OP_CNT_CTL;
359 ibs_op_ctl |= IBS_OP_ENABLE;
360 val = op_amd_randomize_ibs_op(ibs_op_ctl);
260 wrmsrl(MSR_AMD64_IBSOPCTL, val); 361 wrmsrl(MSR_AMD64_IBSOPCTL, val);
261 } 362 }
262} 363}
263 364
264static void op_amd_stop_ibs(void) 365static void op_amd_stop_ibs(void)
265{ 366{
266 if (has_ibs && ibs_config.fetch_enabled) 367 if (!ibs_caps)
368 return;
369
370 if (ibs_config.fetch_enabled)
267 /* clear max count and enable */ 371 /* clear max count and enable */
268 wrmsrl(MSR_AMD64_IBSFETCHCTL, 0); 372 wrmsrl(MSR_AMD64_IBSFETCHCTL, 0);
269 373
270 if (has_ibs && ibs_config.op_enabled) 374 if (ibs_config.op_enabled)
271 /* clear max count and enable */ 375 /* clear max count and enable */
272 wrmsrl(MSR_AMD64_IBSOPCTL, 0); 376 wrmsrl(MSR_AMD64_IBSOPCTL, 0);
273} 377}
274 378
275#else
276
277static inline void op_amd_handle_ibs(struct pt_regs * const regs,
278 struct op_msrs const * const msrs) { }
279static inline void op_amd_start_ibs(void) { }
280static inline void op_amd_stop_ibs(void) { }
281
282#endif
283
284static int op_amd_check_ctrs(struct pt_regs * const regs, 379static int op_amd_check_ctrs(struct pt_regs * const regs,
285 struct op_msrs const * const msrs) 380 struct op_msrs const * const msrs)
286{ 381{
@@ -355,8 +450,6 @@ static void op_amd_shutdown(struct op_msrs const * const msrs)
355 } 450 }
356} 451}
357 452
358#ifdef CONFIG_OPROFILE_IBS
359
360static u8 ibs_eilvt_off; 453static u8 ibs_eilvt_off;
361 454
362static inline void apic_init_ibs_nmi_per_cpu(void *arg) 455static inline void apic_init_ibs_nmi_per_cpu(void *arg)
@@ -405,45 +498,36 @@ static int init_ibs_nmi(void)
405 return 1; 498 return 1;
406 } 499 }
407 500
408#ifdef CONFIG_NUMA
409 /* Sanity check */
410 /* Works only for 64bit with proper numa implementation. */
411 if (nodes != num_possible_nodes()) {
412 printk(KERN_DEBUG "Failed to setup CPU node(s) for IBS, "
413 "found: %d, expected %d",
414 nodes, num_possible_nodes());
415 return 1;
416 }
417#endif
418 return 0; 501 return 0;
419} 502}
420 503
421/* uninitialize the APIC for the IBS interrupts if needed */ 504/* uninitialize the APIC for the IBS interrupts if needed */
422static void clear_ibs_nmi(void) 505static void clear_ibs_nmi(void)
423{ 506{
424 if (has_ibs) 507 if (ibs_caps)
425 on_each_cpu(apic_clear_ibs_nmi_per_cpu, NULL, 1); 508 on_each_cpu(apic_clear_ibs_nmi_per_cpu, NULL, 1);
426} 509}
427 510
428/* initialize the APIC for the IBS interrupts if available */ 511/* initialize the APIC for the IBS interrupts if available */
429static void ibs_init(void) 512static void ibs_init(void)
430{ 513{
431 has_ibs = boot_cpu_has(X86_FEATURE_IBS); 514 ibs_caps = get_ibs_caps();
432 515
433 if (!has_ibs) 516 if (!ibs_caps)
434 return; 517 return;
435 518
436 if (init_ibs_nmi()) { 519 if (init_ibs_nmi()) {
437 has_ibs = 0; 520 ibs_caps = 0;
438 return; 521 return;
439 } 522 }
440 523
441 printk(KERN_INFO "oprofile: AMD IBS detected\n"); 524 printk(KERN_INFO "oprofile: AMD IBS detected (0x%08x)\n",
525 (unsigned)ibs_caps);
442} 526}
443 527
444static void ibs_exit(void) 528static void ibs_exit(void)
445{ 529{
446 if (!has_ibs) 530 if (!ibs_caps)
447 return; 531 return;
448 532
449 clear_ibs_nmi(); 533 clear_ibs_nmi();
@@ -463,7 +547,7 @@ static int setup_ibs_files(struct super_block *sb, struct dentry *root)
463 if (ret) 547 if (ret)
464 return ret; 548 return ret;
465 549
466 if (!has_ibs) 550 if (!ibs_caps)
467 return ret; 551 return ret;
468 552
469 /* model specific files */ 553 /* model specific files */
@@ -473,7 +557,7 @@ static int setup_ibs_files(struct super_block *sb, struct dentry *root)
473 ibs_config.fetch_enabled = 0; 557 ibs_config.fetch_enabled = 0;
474 ibs_config.max_cnt_op = 250000; 558 ibs_config.max_cnt_op = 250000;
475 ibs_config.op_enabled = 0; 559 ibs_config.op_enabled = 0;
476 ibs_config.dispatched_ops = 1; 560 ibs_config.dispatched_ops = 0;
477 561
478 dir = oprofilefs_mkdir(sb, root, "ibs_fetch"); 562 dir = oprofilefs_mkdir(sb, root, "ibs_fetch");
479 oprofilefs_create_ulong(sb, dir, "enable", 563 oprofilefs_create_ulong(sb, dir, "enable",
@@ -488,8 +572,9 @@ static int setup_ibs_files(struct super_block *sb, struct dentry *root)
488 &ibs_config.op_enabled); 572 &ibs_config.op_enabled);
489 oprofilefs_create_ulong(sb, dir, "max_count", 573 oprofilefs_create_ulong(sb, dir, "max_count",
490 &ibs_config.max_cnt_op); 574 &ibs_config.max_cnt_op);
491 oprofilefs_create_ulong(sb, dir, "dispatched_ops", 575 if (ibs_caps & IBS_CAPS_OPCNT)
492 &ibs_config.dispatched_ops); 576 oprofilefs_create_ulong(sb, dir, "dispatched_ops",
577 &ibs_config.dispatched_ops);
493 578
494 return 0; 579 return 0;
495} 580}
@@ -507,19 +592,6 @@ static void op_amd_exit(void)
507 ibs_exit(); 592 ibs_exit();
508} 593}
509 594
510#else
511
512/* no IBS support */
513
514static int op_amd_init(struct oprofile_operations *ops)
515{
516 return 0;
517}
518
519static void op_amd_exit(void) {}
520
521#endif /* CONFIG_OPROFILE_IBS */
522
523struct op_x86_model_spec op_amd_spec = { 595struct op_x86_model_spec op_amd_spec = {
524 .num_counters = NUM_COUNTERS, 596 .num_counters = NUM_COUNTERS,
525 .num_controls = NUM_CONTROLS, 597 .num_controls = NUM_CONTROLS,
diff --git a/arch/x86/oprofile/op_model_p4.c b/arch/x86/oprofile/op_model_p4.c
index ac6b354becdf..e6a160a4684a 100644
--- a/arch/x86/oprofile/op_model_p4.c
+++ b/arch/x86/oprofile/op_model_p4.c
@@ -394,12 +394,6 @@ static void p4_fill_in_addresses(struct op_msrs * const msrs)
394 setup_num_counters(); 394 setup_num_counters();
395 stag = get_stagger(); 395 stag = get_stagger();
396 396
397 /* initialize some registers */
398 for (i = 0; i < num_counters; ++i)
399 msrs->counters[i].addr = 0;
400 for (i = 0; i < num_controls; ++i)
401 msrs->controls[i].addr = 0;
402
403 /* the counter & cccr registers we pay attention to */ 397 /* the counter & cccr registers we pay attention to */
404 for (i = 0; i < num_counters; ++i) { 398 for (i = 0; i < num_counters; ++i) {
405 addr = p4_counters[VIRT_CTR(stag, i)].counter_address; 399 addr = p4_counters[VIRT_CTR(stag, i)].counter_address;
diff --git a/arch/x86/oprofile/op_model_ppro.c b/arch/x86/oprofile/op_model_ppro.c
index 8eb05878554c..5d1727ba409e 100644
--- a/arch/x86/oprofile/op_model_ppro.c
+++ b/arch/x86/oprofile/op_model_ppro.c
@@ -37,15 +37,11 @@ static void ppro_fill_in_addresses(struct op_msrs * const msrs)
37 for (i = 0; i < num_counters; i++) { 37 for (i = 0; i < num_counters; i++) {
38 if (reserve_perfctr_nmi(MSR_P6_PERFCTR0 + i)) 38 if (reserve_perfctr_nmi(MSR_P6_PERFCTR0 + i))
39 msrs->counters[i].addr = MSR_P6_PERFCTR0 + i; 39 msrs->counters[i].addr = MSR_P6_PERFCTR0 + i;
40 else
41 msrs->counters[i].addr = 0;
42 } 40 }
43 41
44 for (i = 0; i < num_counters; i++) { 42 for (i = 0; i < num_counters; i++) {
45 if (reserve_evntsel_nmi(MSR_P6_EVNTSEL0 + i)) 43 if (reserve_evntsel_nmi(MSR_P6_EVNTSEL0 + i))
46 msrs->controls[i].addr = MSR_P6_EVNTSEL0 + i; 44 msrs->controls[i].addr = MSR_P6_EVNTSEL0 + i;
47 else
48 msrs->controls[i].addr = 0;
49 } 45 }
50} 46}
51 47
@@ -57,7 +53,7 @@ static void ppro_setup_ctrs(struct op_x86_model_spec const *model,
57 int i; 53 int i;
58 54
59 if (!reset_value) { 55 if (!reset_value) {
60 reset_value = kmalloc(sizeof(reset_value[0]) * num_counters, 56 reset_value = kzalloc(sizeof(reset_value[0]) * num_counters,
61 GFP_ATOMIC); 57 GFP_ATOMIC);
62 if (!reset_value) 58 if (!reset_value)
63 return; 59 return;
@@ -82,9 +78,18 @@ static void ppro_setup_ctrs(struct op_x86_model_spec const *model,
82 78
83 /* clear all counters */ 79 /* clear all counters */
84 for (i = 0; i < num_counters; ++i) { 80 for (i = 0; i < num_counters; ++i) {
85 if (unlikely(!msrs->controls[i].addr)) 81 if (unlikely(!msrs->controls[i].addr)) {
82 if (counter_config[i].enabled && !smp_processor_id())
83 /*
84 * counter is reserved, this is on all
85 * cpus, so report only for cpu #0
86 */
87 op_x86_warn_reserved(i);
86 continue; 88 continue;
89 }
87 rdmsrl(msrs->controls[i].addr, val); 90 rdmsrl(msrs->controls[i].addr, val);
91 if (val & ARCH_PERFMON_EVENTSEL0_ENABLE)
92 op_x86_warn_in_use(i);
88 val &= model->reserved; 93 val &= model->reserved;
89 wrmsrl(msrs->controls[i].addr, val); 94 wrmsrl(msrs->controls[i].addr, val);
90 } 95 }
diff --git a/arch/x86/oprofile/op_x86_model.h b/arch/x86/oprofile/op_x86_model.h
index 7b8e75d16081..ff82a755edd4 100644
--- a/arch/x86/oprofile/op_x86_model.h
+++ b/arch/x86/oprofile/op_x86_model.h
@@ -57,6 +57,26 @@ struct op_x86_model_spec {
57 57
58struct op_counter_config; 58struct op_counter_config;
59 59
60static inline void op_x86_warn_in_use(int counter)
61{
62 /*
63 * The warning indicates an already running counter. If
64 * oprofile doesn't collect data, then try using a different
65 * performance counter on your platform to monitor the desired
66 * event. Delete counter #%d from the desired event by editing
67 * the /usr/share/oprofile/%s/<cpu>/events file. If the event
68 * cannot be monitored by any other counter, contact your
69 * hardware or BIOS vendor.
70 */
71 pr_warning("oprofile: counter #%d on cpu #%d may already be used\n",
72 counter, smp_processor_id());
73}
74
75static inline void op_x86_warn_reserved(int counter)
76{
77 pr_warning("oprofile: counter #%d is already reserved\n", counter);
78}
79
60extern u64 op_x86_get_ctrl(struct op_x86_model_spec const *model, 80extern u64 op_x86_get_ctrl(struct op_x86_model_spec const *model,
61 struct op_counter_config *counter_config); 81 struct op_counter_config *counter_config);
62extern int op_x86_phys_to_virt(int phys); 82extern int op_x86_phys_to_virt(int phys);
diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c
index 959e548a7039..5f11ff6f5389 100644
--- a/arch/x86/pci/acpi.c
+++ b/arch/x86/pci/acpi.c
@@ -15,6 +15,51 @@ struct pci_root_info {
15 int busnum; 15 int busnum;
16}; 16};
17 17
18static bool pci_use_crs = true;
19
20static int __init set_use_crs(const struct dmi_system_id *id)
21{
22 pci_use_crs = true;
23 return 0;
24}
25
26static const struct dmi_system_id pci_use_crs_table[] __initconst = {
27 /* http://bugzilla.kernel.org/show_bug.cgi?id=14183 */
28 {
29 .callback = set_use_crs,
30 .ident = "IBM System x3800",
31 .matches = {
32 DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
33 DMI_MATCH(DMI_PRODUCT_NAME, "x3800"),
34 },
35 },
36 {}
37};
38
39void __init pci_acpi_crs_quirks(void)
40{
41 int year;
42
43 if (dmi_get_date(DMI_BIOS_DATE, &year, NULL, NULL) && year < 2008)
44 pci_use_crs = false;
45
46 dmi_check_system(pci_use_crs_table);
47
48 /*
49 * If the user specifies "pci=use_crs" or "pci=nocrs" explicitly, that
50 * takes precedence over anything we figured out above.
51 */
52 if (pci_probe & PCI_ROOT_NO_CRS)
53 pci_use_crs = false;
54 else if (pci_probe & PCI_USE__CRS)
55 pci_use_crs = true;
56
57 printk(KERN_INFO "PCI: %s host bridge windows from ACPI; "
58 "if necessary, use \"pci=%s\" and report a bug\n",
59 pci_use_crs ? "Using" : "Ignoring",
60 pci_use_crs ? "nocrs" : "use_crs");
61}
62
18static acpi_status 63static acpi_status
19resource_to_addr(struct acpi_resource *resource, 64resource_to_addr(struct acpi_resource *resource,
20 struct acpi_resource_address64 *addr) 65 struct acpi_resource_address64 *addr)
@@ -45,20 +90,6 @@ count_resource(struct acpi_resource *acpi_res, void *data)
45 return AE_OK; 90 return AE_OK;
46} 91}
47 92
48static int
49bus_has_transparent_bridge(struct pci_bus *bus)
50{
51 struct pci_dev *dev;
52
53 list_for_each_entry(dev, &bus->devices, bus_list) {
54 u16 class = dev->class >> 8;
55
56 if (class == PCI_CLASS_BRIDGE_PCI && dev->transparent)
57 return true;
58 }
59 return false;
60}
61
62static void 93static void
63align_resource(struct acpi_device *bridge, struct resource *res) 94align_resource(struct acpi_device *bridge, struct resource *res)
64{ 95{
@@ -92,12 +123,8 @@ setup_resource(struct acpi_resource *acpi_res, void *data)
92 acpi_status status; 123 acpi_status status;
93 unsigned long flags; 124 unsigned long flags;
94 struct resource *root; 125 struct resource *root;
95 int max_root_bus_resources = PCI_BUS_NUM_RESOURCES;
96 u64 start, end; 126 u64 start, end;
97 127
98 if (bus_has_transparent_bridge(info->bus))
99 max_root_bus_resources -= 3;
100
101 status = resource_to_addr(acpi_res, &addr); 128 status = resource_to_addr(acpi_res, &addr);
102 if (!ACPI_SUCCESS(status)) 129 if (!ACPI_SUCCESS(status))
103 return AE_OK; 130 return AE_OK;
@@ -115,15 +142,6 @@ setup_resource(struct acpi_resource *acpi_res, void *data)
115 142
116 start = addr.minimum + addr.translation_offset; 143 start = addr.minimum + addr.translation_offset;
117 end = start + addr.address_length - 1; 144 end = start + addr.address_length - 1;
118 if (info->res_num >= max_root_bus_resources) {
119 if (pci_probe & PCI_USE__CRS)
120 printk(KERN_WARNING "PCI: Failed to allocate "
121 "0x%lx-0x%lx from %s for %s due to _CRS "
122 "returning more than %d resource descriptors\n",
123 (unsigned long) start, (unsigned long) end,
124 root->name, info->name, max_root_bus_resources);
125 return AE_OK;
126 }
127 145
128 res = &info->res[info->res_num]; 146 res = &info->res[info->res_num];
129 res->name = info->name; 147 res->name = info->name;
@@ -133,7 +151,7 @@ setup_resource(struct acpi_resource *acpi_res, void *data)
133 res->child = NULL; 151 res->child = NULL;
134 align_resource(info->bridge, res); 152 align_resource(info->bridge, res);
135 153
136 if (!(pci_probe & PCI_USE__CRS)) { 154 if (!pci_use_crs) {
137 dev_printk(KERN_DEBUG, &info->bridge->dev, 155 dev_printk(KERN_DEBUG, &info->bridge->dev,
138 "host bridge window %pR (ignored)\n", res); 156 "host bridge window %pR (ignored)\n", res);
139 return AE_OK; 157 return AE_OK;
@@ -143,7 +161,7 @@ setup_resource(struct acpi_resource *acpi_res, void *data)
143 dev_err(&info->bridge->dev, 161 dev_err(&info->bridge->dev,
144 "can't allocate host bridge window %pR\n", res); 162 "can't allocate host bridge window %pR\n", res);
145 } else { 163 } else {
146 info->bus->resource[info->res_num] = res; 164 pci_bus_add_resource(info->bus, res, 0);
147 info->res_num++; 165 info->res_num++;
148 if (addr.translation_offset) 166 if (addr.translation_offset)
149 dev_info(&info->bridge->dev, "host bridge window %pR " 167 dev_info(&info->bridge->dev, "host bridge window %pR "
@@ -164,10 +182,8 @@ get_current_resources(struct acpi_device *device, int busnum,
164 struct pci_root_info info; 182 struct pci_root_info info;
165 size_t size; 183 size_t size;
166 184
167 if (!(pci_probe & PCI_USE__CRS)) 185 if (pci_use_crs)
168 dev_info(&device->dev, 186 pci_bus_remove_resources(bus);
169 "ignoring host bridge windows from ACPI; "
170 "boot with \"pci=use_crs\" to use them\n");
171 187
172 info.bridge = device; 188 info.bridge = device;
173 info.bus = bus; 189 info.bus = bus;
diff --git a/arch/x86/pci/bus_numa.c b/arch/x86/pci/bus_numa.c
index f939d603adfa..12d54ff3654d 100644
--- a/arch/x86/pci/bus_numa.c
+++ b/arch/x86/pci/bus_numa.c
@@ -36,13 +36,14 @@ void x86_pci_root_bus_res_quirks(struct pci_bus *b)
36 printk(KERN_DEBUG "PCI: peer root bus %02x res updated from pci conf\n", 36 printk(KERN_DEBUG "PCI: peer root bus %02x res updated from pci conf\n",
37 b->number); 37 b->number);
38 38
39 pci_bus_remove_resources(b);
39 info = &pci_root_info[i]; 40 info = &pci_root_info[i];
40 for (j = 0; j < info->res_num; j++) { 41 for (j = 0; j < info->res_num; j++) {
41 struct resource *res; 42 struct resource *res;
42 struct resource *root; 43 struct resource *root;
43 44
44 res = &info->res[j]; 45 res = &info->res[j];
45 b->resource[j] = res; 46 pci_bus_add_resource(b, res, 0);
46 if (res->flags & IORESOURCE_IO) 47 if (res->flags & IORESOURCE_IO)
47 root = &ioport_resource; 48 root = &ioport_resource;
48 else 49 else
diff --git a/arch/x86/pci/bus_numa.h b/arch/x86/pci/bus_numa.h
index adbc23fe82ac..731b64ee8d84 100644
--- a/arch/x86/pci/bus_numa.h
+++ b/arch/x86/pci/bus_numa.h
@@ -2,8 +2,7 @@
2 2
3/* 3/*
4 * sub bus (transparent) will use entres from 3 to store extra from 4 * sub bus (transparent) will use entres from 3 to store extra from
5 * root, so need to make sure we have enough slot there, Should we 5 * root, so need to make sure we have enough slot there.
6 * increase PCI_BUS_NUM_RESOURCES?
7 */ 6 */
8#define RES_NUM 16 7#define RES_NUM 16
9struct pci_root_info { 8struct pci_root_info {
diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c
index d2552c68e94d..3736176acaab 100644
--- a/arch/x86/pci/common.c
+++ b/arch/x86/pci/common.c
@@ -520,6 +520,9 @@ char * __devinit pcibios_setup(char *str)
520 } else if (!strcmp(str, "use_crs")) { 520 } else if (!strcmp(str, "use_crs")) {
521 pci_probe |= PCI_USE__CRS; 521 pci_probe |= PCI_USE__CRS;
522 return NULL; 522 return NULL;
523 } else if (!strcmp(str, "nocrs")) {
524 pci_probe |= PCI_ROOT_NO_CRS;
525 return NULL;
523 } else if (!strcmp(str, "earlydump")) { 526 } else if (!strcmp(str, "earlydump")) {
524 pci_early_dump_regs = 1; 527 pci_early_dump_regs = 1;
525 return NULL; 528 return NULL;
diff --git a/arch/x86/pci/i386.c b/arch/x86/pci/i386.c
index 5dc9e8c63fcd..5a8fbf8d4cac 100644
--- a/arch/x86/pci/i386.c
+++ b/arch/x86/pci/i386.c
@@ -60,22 +60,20 @@ skip_isa_ioresource_align(struct pci_dev *dev) {
60 * but we want to try to avoid allocating at 0x2900-0x2bff 60 * but we want to try to avoid allocating at 0x2900-0x2bff
61 * which might have be mirrored at 0x0100-0x03ff.. 61 * which might have be mirrored at 0x0100-0x03ff..
62 */ 62 */
63void 63resource_size_t
64pcibios_align_resource(void *data, struct resource *res, 64pcibios_align_resource(void *data, const struct resource *res,
65 resource_size_t size, resource_size_t align) 65 resource_size_t size, resource_size_t align)
66{ 66{
67 struct pci_dev *dev = data; 67 struct pci_dev *dev = data;
68 resource_size_t start = res->start;
68 69
69 if (res->flags & IORESOURCE_IO) { 70 if (res->flags & IORESOURCE_IO) {
70 resource_size_t start = res->start;
71
72 if (skip_isa_ioresource_align(dev)) 71 if (skip_isa_ioresource_align(dev))
73 return; 72 return start;
74 if (start & 0x300) { 73 if (start & 0x300)
75 start = (start + 0x3ff) & ~0x3ff; 74 start = (start + 0x3ff) & ~0x3ff;
76 res->start = start;
77 }
78 } 75 }
76 return start;
79} 77}
80EXPORT_SYMBOL(pcibios_align_resource); 78EXPORT_SYMBOL(pcibios_align_resource);
81 79
diff --git a/arch/x86/pci/irq.c b/arch/x86/pci/irq.c
index 0696d506c4ad..b02f6d8ac922 100644
--- a/arch/x86/pci/irq.c
+++ b/arch/x86/pci/irq.c
@@ -590,6 +590,8 @@ static __init int intel_router_probe(struct irq_router *r, struct pci_dev *route
590 case PCI_DEVICE_ID_INTEL_ICH10_1: 590 case PCI_DEVICE_ID_INTEL_ICH10_1:
591 case PCI_DEVICE_ID_INTEL_ICH10_2: 591 case PCI_DEVICE_ID_INTEL_ICH10_2:
592 case PCI_DEVICE_ID_INTEL_ICH10_3: 592 case PCI_DEVICE_ID_INTEL_ICH10_3:
593 case PCI_DEVICE_ID_INTEL_CPT_LPC1:
594 case PCI_DEVICE_ID_INTEL_CPT_LPC2:
593 r->name = "PIIX/ICH"; 595 r->name = "PIIX/ICH";
594 r->get = pirq_piix_get; 596 r->get = pirq_piix_get;
595 r->set = pirq_piix_set; 597 r->set = pirq_piix_set;
diff --git a/arch/x86/pci/mmconfig-shared.c b/arch/x86/pci/mmconfig-shared.c
index b19d1e54201e..8f3f9a50b1e0 100644
--- a/arch/x86/pci/mmconfig-shared.c
+++ b/arch/x86/pci/mmconfig-shared.c
@@ -303,22 +303,17 @@ static void __init pci_mmcfg_check_end_bus_number(void)
303{ 303{
304 struct pci_mmcfg_region *cfg, *cfgx; 304 struct pci_mmcfg_region *cfg, *cfgx;
305 305
306 /* last one*/ 306 /* Fixup overlaps */
307 cfg = list_entry(pci_mmcfg_list.prev, typeof(*cfg), list);
308 if (cfg)
309 if (cfg->end_bus < cfg->start_bus)
310 cfg->end_bus = 255;
311
312 if (list_is_singular(&pci_mmcfg_list))
313 return;
314
315 /* don't overlap please */
316 list_for_each_entry(cfg, &pci_mmcfg_list, list) { 307 list_for_each_entry(cfg, &pci_mmcfg_list, list) {
317 if (cfg->end_bus < cfg->start_bus) 308 if (cfg->end_bus < cfg->start_bus)
318 cfg->end_bus = 255; 309 cfg->end_bus = 255;
319 310
311 /* Don't access the list head ! */
312 if (cfg->list.next == &pci_mmcfg_list)
313 break;
314
320 cfgx = list_entry(cfg->list.next, typeof(*cfg), list); 315 cfgx = list_entry(cfg->list.next, typeof(*cfg), list);
321 if (cfg != cfgx && cfg->end_bus >= cfgx->start_bus) 316 if (cfg->end_bus >= cfgx->start_bus)
322 cfg->end_bus = cfgx->start_bus - 1; 317 cfg->end_bus = cfgx->start_bus - 1;
323 } 318 }
324} 319}
diff --git a/arch/x86/pci/numaq_32.c b/arch/x86/pci/numaq_32.c
index 8eb295e116f6..8884a1c1ada6 100644
--- a/arch/x86/pci/numaq_32.c
+++ b/arch/x86/pci/numaq_32.c
@@ -8,9 +8,7 @@
8#include <asm/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#include <asm/numaq.h>
12#define XQUAD_PORTIO_BASE 0xfe400000
13#define XQUAD_PORTIO_QUAD 0x40000 /* 256k per quad. */
14 12
15#define BUS2QUAD(global) (mp_bus_id_to_node[global]) 13#define BUS2QUAD(global) (mp_bus_id_to_node[global])
16 14
@@ -18,8 +16,6 @@
18 16
19#define QUADLOCAL2BUS(quad,local) (quad_local_to_mp_bus_id[quad][local]) 17#define QUADLOCAL2BUS(quad,local) (quad_local_to_mp_bus_id[quad][local])
20 18
21#define XQUAD_PORT_ADDR(port, quad) (xquad_portio + (XQUAD_PORTIO_QUAD*quad) + port)
22
23#define PCI_CONF1_MQ_ADDRESS(bus, devfn, reg) \ 19#define PCI_CONF1_MQ_ADDRESS(bus, devfn, reg) \
24 (0x80000000 | (BUS2LOCAL(bus) << 16) | (devfn << 8) | (reg & ~3)) 20 (0x80000000 | (BUS2LOCAL(bus) << 16) | (devfn << 8) | (reg & ~3))
25 21
diff --git a/arch/x86/tools/test_get_len.c b/arch/x86/tools/test_get_len.c
index bee8d6ac2691..13403fc95a96 100644
--- a/arch/x86/tools/test_get_len.c
+++ b/arch/x86/tools/test_get_len.c
@@ -43,7 +43,7 @@ static int x86_64;
43static void usage(void) 43static void usage(void)
44{ 44{
45 fprintf(stderr, "Usage: objdump -d a.out | awk -f distill.awk |" 45 fprintf(stderr, "Usage: objdump -d a.out | awk -f distill.awk |"
46 " %s [-y|-n] [-v] \n", prog); 46 " %s [-y|-n] [-v]\n", prog);
47 fprintf(stderr, "\t-y 64bit mode\n"); 47 fprintf(stderr, "\t-y 64bit mode\n");
48 fprintf(stderr, "\t-n 32bit mode\n"); 48 fprintf(stderr, "\t-n 32bit mode\n");
49 fprintf(stderr, "\t-v verbose mode\n"); 49 fprintf(stderr, "\t-v verbose mode\n");
@@ -69,7 +69,7 @@ static void dump_field(FILE *fp, const char *name, const char *indent,
69 69
70static void dump_insn(FILE *fp, struct insn *insn) 70static void dump_insn(FILE *fp, struct insn *insn)
71{ 71{
72 fprintf(fp, "Instruction = { \n"); 72 fprintf(fp, "Instruction = {\n");
73 dump_field(fp, "prefixes", "\t", &insn->prefixes); 73 dump_field(fp, "prefixes", "\t", &insn->prefixes);
74 dump_field(fp, "rex_prefix", "\t", &insn->rex_prefix); 74 dump_field(fp, "rex_prefix", "\t", &insn->rex_prefix);
75 dump_field(fp, "vex_prefix", "\t", &insn->vex_prefix); 75 dump_field(fp, "vex_prefix", "\t", &insn->vex_prefix);
diff --git a/arch/xtensa/include/asm/pgtable.h b/arch/xtensa/include/asm/pgtable.h
index a138770c358e..76bf35554117 100644
--- a/arch/xtensa/include/asm/pgtable.h
+++ b/arch/xtensa/include/asm/pgtable.h
@@ -394,7 +394,7 @@ ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
394#define kern_addr_valid(addr) (1) 394#define kern_addr_valid(addr) (1)
395 395
396extern void update_mmu_cache(struct vm_area_struct * vma, 396extern void update_mmu_cache(struct vm_area_struct * vma,
397 unsigned long address, pte_t pte); 397 unsigned long address, pte_t *ptep);
398 398
399/* 399/*
400 * remap a physical page `pfn' of size `size' with page protection `prot' 400 * remap a physical page `pfn' of size `size' with page protection `prot'
diff --git a/arch/xtensa/kernel/pci.c b/arch/xtensa/kernel/pci.c
index b7c073484e01..cd1026931203 100644
--- a/arch/xtensa/kernel/pci.c
+++ b/arch/xtensa/kernel/pci.c
@@ -69,26 +69,25 @@ static int pci_bus_count;
69 * but we want to try to avoid allocating at 0x2900-0x2bff 69 * but we want to try to avoid allocating at 0x2900-0x2bff
70 * which might have be mirrored at 0x0100-0x03ff.. 70 * which might have be mirrored at 0x0100-0x03ff..
71 */ 71 */
72void 72resource_size_t
73pcibios_align_resource(void *data, struct resource *res, resource_size_t size, 73pcibios_align_resource(void *data, const struct resource *res,
74 resource_size_t align) 74 resource_size_t size, resource_size_t align)
75{ 75{
76 struct pci_dev *dev = data; 76 struct pci_dev *dev = data;
77 resource_size_t start = res->start;
77 78
78 if (res->flags & IORESOURCE_IO) { 79 if (res->flags & IORESOURCE_IO) {
79 resource_size_t start = res->start;
80
81 if (size > 0x100) { 80 if (size > 0x100) {
82 printk(KERN_ERR "PCI: I/O Region %s/%d too large" 81 printk(KERN_ERR "PCI: I/O Region %s/%d too large"
83 " (%ld bytes)\n", pci_name(dev), 82 " (%ld bytes)\n", pci_name(dev),
84 dev->resource - res, size); 83 dev->resource - res, size);
85 } 84 }
86 85
87 if (start & 0x300) { 86 if (start & 0x300)
88 start = (start + 0x3ff) & ~0x3ff; 87 start = (start + 0x3ff) & ~0x3ff;
89 res->start = start;
90 }
91 } 88 }
89
90 return start;
92} 91}
93 92
94int 93int
diff --git a/arch/xtensa/mm/cache.c b/arch/xtensa/mm/cache.c
index 3ba990c67676..85df4655d326 100644
--- a/arch/xtensa/mm/cache.c
+++ b/arch/xtensa/mm/cache.c
@@ -147,9 +147,9 @@ void flush_cache_page(struct vm_area_struct* vma, unsigned long address,
147#endif 147#endif
148 148
149void 149void
150update_mmu_cache(struct vm_area_struct * vma, unsigned long addr, pte_t pte) 150update_mmu_cache(struct vm_area_struct * vma, unsigned long addr, pte_t *ptep)
151{ 151{
152 unsigned long pfn = pte_pfn(pte); 152 unsigned long pfn = pte_pfn(*ptep);
153 struct page *page; 153 struct page *page;
154 154
155 if (!pfn_valid(pfn)) 155 if (!pfn_valid(pfn))