aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/Kconfig2
-rw-r--r--arch/alpha/kernel/srm_env.c5
-rw-r--r--arch/arm/mach-pxa/pcm990-baseboard.c53
-rw-r--r--arch/arm/plat-mxc/include/mach/mx3_camera.h52
-rw-r--r--arch/blackfin/mm/sram-alloc.c1
-rw-r--r--arch/cris/arch-v10/kernel/time.c1
-rw-r--r--arch/cris/arch-v32/kernel/smp.c1
-rw-r--r--arch/cris/arch-v32/kernel/time.c1
-rw-r--r--arch/frv/kernel/irq-mb93091.c4
-rw-r--r--arch/frv/kernel/irq-mb93093.c1
-rw-r--r--arch/frv/kernel/irq-mb93493.c2
-rw-r--r--arch/frv/kernel/time.c1
-rw-r--r--arch/h8300/kernel/timer/itu.c1
-rw-r--r--arch/h8300/kernel/timer/timer16.c1
-rw-r--r--arch/h8300/kernel/timer/timer8.c1
-rw-r--r--arch/h8300/kernel/timer/tpu.c1
-rw-r--r--arch/ia64/dig/Makefile4
-rw-r--r--arch/ia64/dig/dig_vtd_iommu.c59
-rw-r--r--arch/ia64/hp/common/hwsw_iommu.c165
-rw-r--r--arch/ia64/hp/common/sba_iommu.c79
-rw-r--r--arch/ia64/include/asm/dma-mapping.h194
-rw-r--r--arch/ia64/include/asm/machvec.h102
-rw-r--r--arch/ia64/include/asm/machvec_dig_vtd.h20
-rw-r--r--arch/ia64/include/asm/machvec_hpzx1.h23
-rw-r--r--arch/ia64/include/asm/machvec_hpzx1_swiotlb.h27
-rw-r--r--arch/ia64/include/asm/machvec_sn2.h27
-rw-r--r--arch/ia64/include/asm/topology.h5
-rw-r--r--arch/ia64/kernel/Makefile4
-rw-r--r--arch/ia64/kernel/dma-mapping.c13
-rw-r--r--arch/ia64/kernel/machvec.c8
-rw-r--r--arch/ia64/kernel/palinfo.c2
-rw-r--r--arch/ia64/kernel/pci-dma.c46
-rw-r--r--arch/ia64/kernel/pci-swiotlb.c30
-rw-r--r--arch/ia64/sn/kernel/sn2/prominfo_proc.c9
-rw-r--r--arch/ia64/sn/pci/pci_dma.c99
-rw-r--r--arch/m32r/kernel/time.c1
-rw-r--r--arch/m68k/include/asm/ide.h73
-rw-r--r--arch/mips/Kconfig12
-rw-r--r--arch/mips/Makefile6
-rw-r--r--arch/mips/alchemy/Kconfig2
-rw-r--r--arch/mips/alchemy/common/gpio.c203
-rw-r--r--arch/mips/alchemy/devboards/pb1200/platform.c10
-rw-r--r--arch/mips/cavium-octeon/Makefile2
-rw-r--r--arch/mips/cavium-octeon/flash_setup.c2
-rw-r--r--arch/mips/cavium-octeon/octeon-irq.c2
-rw-r--r--arch/mips/cobalt/irq.c1
-rw-r--r--arch/mips/emma/markeins/irq.c51
-rw-r--r--arch/mips/emma/markeins/platform.c3
-rw-r--r--arch/mips/include/asm/cpu.h3
-rw-r--r--arch/mips/include/asm/hazards.h4
-rw-r--r--arch/mips/include/asm/mach-au1x00/cpu-feature-overrides.h49
-rw-r--r--arch/mips/include/asm/mach-au1x00/gpio.h70
-rw-r--r--arch/mips/include/asm/mach-ip27/topology.h1
-rw-r--r--arch/mips/include/asm/mips-boards/generic.h2
-rw-r--r--arch/mips/include/asm/smp-ops.h2
-rw-r--r--arch/mips/include/asm/spinlock.h8
-rw-r--r--arch/mips/include/asm/types.h8
-rw-r--r--arch/mips/jazz/irq.c1
-rw-r--r--arch/mips/jazz/jazzdma.c3
-rw-r--r--arch/mips/kernel/cevt-bcm1480.c1
-rw-r--r--arch/mips/kernel/cevt-sb1250.c1
-rw-r--r--arch/mips/kernel/cpu-probe.c21
-rw-r--r--arch/mips/kernel/i8253.c2
-rw-r--r--arch/mips/kernel/i8259.c1
-rw-r--r--arch/mips/kernel/irq-msc01.c6
-rw-r--r--arch/mips/kernel/irq_cpu.c3
-rw-r--r--arch/mips/kernel/linux32.c6
-rw-r--r--arch/mips/kernel/setup.c3
-rw-r--r--arch/mips/kernel/smp-up.c14
-rw-r--r--arch/mips/kernel/smp.c2
-rw-r--r--arch/mips/kernel/traps.c3
-rw-r--r--arch/mips/lasat/interrupt.c1
-rw-r--r--arch/mips/lemote/lm2e/irq.c1
-rw-r--r--arch/mips/mm/c-r4k.c17
-rw-r--r--arch/mips/mm/highmem.c9
-rw-r--r--arch/mips/mm/init.c3
-rw-r--r--arch/mips/mm/ioremap.c9
-rw-r--r--arch/mips/mm/tlbex.c8
-rw-r--r--arch/mips/mti-malta/malta-init.c2
-rw-r--r--arch/mips/sgi-ip27/ip27-berr.c2
-rw-r--r--arch/mips/sgi-ip27/ip27-nmi.c6
-rw-r--r--arch/mips/sgi-ip32/ip32-irq.c65
-rw-r--r--arch/mips/sgi-ip32/ip32-memory.c2
-rw-r--r--arch/mips/sibyte/bcm1480/irq.c2
-rw-r--r--arch/mips/sibyte/sb1250/irq.c2
-rw-r--r--arch/mips/sni/a20r.c2
-rw-r--r--arch/mips/sni/pcimt.c2
-rw-r--r--arch/mips/sni/pcit.c4
-rw-r--r--arch/mips/sni/rm200.c5
-rw-r--r--arch/mips/txx9/Kconfig1
-rw-r--r--arch/mips/vr41xx/common/irq.c1
-rw-r--r--arch/mn10300/kernel/time.c1
-rw-r--r--arch/powerpc/Kconfig74
-rw-r--r--arch/powerpc/Kconfig.debug2
-rw-r--r--arch/powerpc/Makefile4
-rw-r--r--arch/powerpc/boot/Makefile9
-rw-r--r--arch/powerpc/boot/cuboot-amigaone.c35
-rw-r--r--arch/powerpc/boot/dts/amigaone.dts173
-rw-r--r--arch/powerpc/boot/dts/asp834x-redboot.dts82
-rw-r--r--arch/powerpc/boot/dts/canyonlands.dts28
-rw-r--r--arch/powerpc/boot/dts/cm5200.dts49
-rw-r--r--arch/powerpc/boot/dts/digsy_mtc.dts254
-rw-r--r--arch/powerpc/boot/dts/gef_ppc9a.dts367
-rw-r--r--arch/powerpc/boot/dts/gef_sbc310.dts367
-rw-r--r--arch/powerpc/boot/dts/gef_sbc610.dts41
-rw-r--r--arch/powerpc/boot/dts/ksi8560.dts79
-rw-r--r--arch/powerpc/boot/dts/lite5200.dts52
-rw-r--r--arch/powerpc/boot/dts/lite5200b.dts63
-rw-r--r--arch/powerpc/boot/dts/media5200.dts318
-rw-r--r--arch/powerpc/boot/dts/motionpro.dts42
-rw-r--r--arch/powerpc/boot/dts/mpc8313erdb.dts11
-rw-r--r--arch/powerpc/boot/dts/mpc8315erdb.dts144
-rw-r--r--arch/powerpc/boot/dts/mpc8349emitx.dts69
-rw-r--r--arch/powerpc/boot/dts/mpc8349emitxgp.dts42
-rw-r--r--arch/powerpc/boot/dts/mpc834x_mds.dts81
-rw-r--r--arch/powerpc/boot/dts/mpc8377_mds.dts211
-rw-r--r--arch/powerpc/boot/dts/mpc8377_rdb.dts229
-rw-r--r--arch/powerpc/boot/dts/mpc8378_mds.dts209
-rw-r--r--arch/powerpc/boot/dts/mpc8378_rdb.dts229
-rw-r--r--arch/powerpc/boot/dts/mpc8379_mds.dts146
-rw-r--r--arch/powerpc/boot/dts/mpc8379_rdb.dts164
-rw-r--r--arch/powerpc/boot/dts/mpc8536ds.dts78
-rw-r--r--arch/powerpc/boot/dts/mpc8540ads.dts117
-rw-r--r--arch/powerpc/boot/dts/mpc8541cds.dts78
-rw-r--r--arch/powerpc/boot/dts/mpc8544ds.dts81
-rw-r--r--arch/powerpc/boot/dts/mpc8548cds.dts156
-rw-r--r--arch/powerpc/boot/dts/mpc8555cds.dts78
-rw-r--r--arch/powerpc/boot/dts/mpc8560ads.dts102
-rw-r--r--arch/powerpc/boot/dts/mpc8568mds.dts102
-rw-r--r--arch/powerpc/boot/dts/mpc8572ds.dts160
-rw-r--r--arch/powerpc/boot/dts/mpc8572ds_36b.dts799
-rw-r--r--arch/powerpc/boot/dts/mpc8572ds_camp_core0.dts49
-rw-r--r--arch/powerpc/boot/dts/mpc8572ds_camp_core1.dts6
-rw-r--r--arch/powerpc/boot/dts/mpc8610_hpcd.dts2
-rw-r--r--arch/powerpc/boot/dts/mpc8641_hpcn.dts157
-rw-r--r--arch/powerpc/boot/dts/pcm030.dts182
-rw-r--r--arch/powerpc/boot/dts/pcm032.dts392
-rw-r--r--arch/powerpc/boot/dts/redwood.dts244
-rw-r--r--arch/powerpc/boot/dts/sbc8349.dts80
-rw-r--r--arch/powerpc/boot/dts/sbc8548.dts78
-rw-r--r--arch/powerpc/boot/dts/sbc8560.dts100
-rw-r--r--arch/powerpc/boot/dts/sbc8641d.dts156
-rw-r--r--arch/powerpc/boot/dts/socrates.dts338
-rw-r--r--arch/powerpc/boot/dts/stx_gp3_8560.dts78
-rw-r--r--arch/powerpc/boot/dts/tqm5200.dts32
-rw-r--r--arch/powerpc/boot/dts/tqm8540.dts122
-rw-r--r--arch/powerpc/boot/dts/tqm8541.dts95
-rw-r--r--arch/powerpc/boot/dts/tqm8548-bigflash.dts177
-rw-r--r--arch/powerpc/boot/dts/tqm8548.dts177
-rw-r--r--arch/powerpc/boot/dts/tqm8555.dts95
-rw-r--r--arch/powerpc/boot/dts/tqm8560.dts99
-rw-r--r--arch/powerpc/boot/dts/virtex440-ml507.dts124
-rw-r--r--arch/powerpc/boot/serial.c3
-rwxr-xr-xarch/powerpc/boot/wrapper7
-rw-r--r--arch/powerpc/configs/44x/canyonlands_defconfig266
-rw-r--r--arch/powerpc/configs/44x/redwood_defconfig1176
-rw-r--r--arch/powerpc/configs/85xx/socrates_defconfig1410
-rw-r--r--arch/powerpc/configs/86xx/gef_ppc9a_defconfig1889
-rw-r--r--arch/powerpc/configs/86xx/gef_sbc310_defconfig1613
-rw-r--r--arch/powerpc/configs/amigaone_defconfig1636
-rw-r--r--arch/powerpc/configs/mpc5200_defconfig71
-rw-r--r--arch/powerpc/configs/ppc64_defconfig6
-rw-r--r--arch/powerpc/include/asm/code-patching.h4
-rw-r--r--arch/powerpc/include/asm/cputable.h4
-rw-r--r--arch/powerpc/include/asm/dbell.h43
-rw-r--r--arch/powerpc/include/asm/dma-mapping.h12
-rw-r--r--arch/powerpc/include/asm/elf.h12
-rw-r--r--arch/powerpc/include/asm/fixmap.h2
-rw-r--r--arch/powerpc/include/asm/ftrace.h39
-rw-r--r--arch/powerpc/include/asm/highmem.h12
-rw-r--r--arch/powerpc/include/asm/hw_irq.h2
-rw-r--r--arch/powerpc/include/asm/io.h6
-rw-r--r--arch/powerpc/include/asm/lppaca.h8
-rw-r--r--arch/powerpc/include/asm/machdep.h4
-rw-r--r--arch/powerpc/include/asm/mmu-44x.h2
-rw-r--r--arch/powerpc/include/asm/mmu-book3e.h (renamed from arch/powerpc/include/asm/mmu-fsl-booke.h)66
-rw-r--r--arch/powerpc/include/asm/mmu-hash64.h2
-rw-r--r--arch/powerpc/include/asm/mmu.h20
-rw-r--r--arch/powerpc/include/asm/mmu_context.h2
-rw-r--r--arch/powerpc/include/asm/mpc52xx.h1
-rw-r--r--arch/powerpc/include/asm/page.h6
-rw-r--r--arch/powerpc/include/asm/page_32.h4
-rw-r--r--arch/powerpc/include/asm/pgtable-ppc32.h557
-rw-r--r--arch/powerpc/include/asm/pgtable-ppc64-4k.h (renamed from arch/powerpc/include/asm/pgtable-4k.h)55
-rw-r--r--arch/powerpc/include/asm/pgtable-ppc64-64k.h42
-rw-r--r--arch/powerpc/include/asm/pgtable-ppc64.h196
-rw-r--r--arch/powerpc/include/asm/pgtable.h134
-rw-r--r--arch/powerpc/include/asm/ppc-opcode.h73
-rw-r--r--arch/powerpc/include/asm/ppc_asm.h6
-rw-r--r--arch/powerpc/include/asm/processor.h19
-rw-r--r--arch/powerpc/include/asm/ps3av.h2
-rw-r--r--arch/powerpc/include/asm/ps3fb.h1
-rw-r--r--arch/powerpc/include/asm/pte-40x.h64
-rw-r--r--arch/powerpc/include/asm/pte-44x.h102
-rw-r--r--arch/powerpc/include/asm/pte-8xx.h67
-rw-r--r--arch/powerpc/include/asm/pte-common.h180
-rw-r--r--arch/powerpc/include/asm/pte-fsl-booke.h48
-rw-r--r--arch/powerpc/include/asm/pte-hash32.h48
-rw-r--r--arch/powerpc/include/asm/pte-hash64-4k.h17
-rw-r--r--arch/powerpc/include/asm/pte-hash64-64k.h (renamed from arch/powerpc/include/asm/pgtable-64k.h)132
-rw-r--r--arch/powerpc/include/asm/pte-hash64.h54
-rw-r--r--arch/powerpc/include/asm/reg.h2
-rw-r--r--arch/powerpc/include/asm/reg_booke.h2
-rw-r--r--arch/powerpc/include/asm/system.h2
-rw-r--r--arch/powerpc/include/asm/thread_info.h11
-rw-r--r--arch/powerpc/include/asm/topology.h5
-rw-r--r--arch/powerpc/include/asm/udbg.h1
-rw-r--r--arch/powerpc/kernel/Makefile12
-rw-r--r--arch/powerpc/kernel/align.c2
-rw-r--r--arch/powerpc/kernel/asm-offsets.c3
-rw-r--r--arch/powerpc/kernel/cpu_setup_44x.S1
-rw-r--r--arch/powerpc/kernel/cpu_setup_6xx.S5
-rw-r--r--arch/powerpc/kernel/cpu_setup_fsl_booke.S31
-rw-r--r--arch/powerpc/kernel/cputable.c166
-rw-r--r--arch/powerpc/kernel/crash_dump.c2
-rw-r--r--arch/powerpc/kernel/dbell.c44
-rw-r--r--arch/powerpc/kernel/entry_32.S129
-rw-r--r--arch/powerpc/kernel/entry_64.S89
-rw-r--r--arch/powerpc/kernel/ftrace.c222
-rw-r--r--arch/powerpc/kernel/head_32.S101
-rw-r--r--arch/powerpc/kernel/head_64.S6
-rw-r--r--arch/powerpc/kernel/head_booke.h19
-rw-r--r--arch/powerpc/kernel/head_fsl_booke.S101
-rw-r--r--arch/powerpc/kernel/irq.c4
-rw-r--r--arch/powerpc/kernel/module_64.c2
-rw-r--r--arch/powerpc/kernel/pci-common.c45
-rw-r--r--arch/powerpc/kernel/pci_32.c36
-rw-r--r--arch/powerpc/kernel/pci_64.c19
-rw-r--r--arch/powerpc/kernel/process.c58
-rw-r--r--arch/powerpc/kernel/prom.c6
-rw-r--r--arch/powerpc/kernel/prom_init.c2
-rw-r--r--arch/powerpc/kernel/prom_init_check.sh2
-rw-r--r--arch/powerpc/kernel/rtas.c10
-rw-r--r--arch/powerpc/kernel/rtas_flash.c1
-rw-r--r--arch/powerpc/kernel/setup-common.c36
-rw-r--r--arch/powerpc/kernel/setup_64.c42
-rw-r--r--arch/powerpc/kernel/signal.c4
-rw-r--r--arch/powerpc/kernel/signal.h12
-rw-r--r--arch/powerpc/kernel/signal_32.c4
-rw-r--r--arch/powerpc/kernel/signal_64.c2
-rw-r--r--arch/powerpc/kernel/sysfs.c35
-rw-r--r--arch/powerpc/kernel/traps.c79
-rw-r--r--arch/powerpc/kernel/udbg.c7
-rw-r--r--arch/powerpc/kernel/udbg_16550.c60
-rw-r--r--arch/powerpc/kernel/vmlinux.lds.S1
-rw-r--r--arch/powerpc/lib/dma-noncoherent.c303
-rw-r--r--arch/powerpc/lib/feature-fixups.c4
-rw-r--r--arch/powerpc/math-emu/Makefile5
-rw-r--r--arch/powerpc/mm/Makefile4
-rw-r--r--arch/powerpc/mm/fault.c46
-rw-r--r--arch/powerpc/mm/fsl_booke_mmu.c95
-rw-r--r--arch/powerpc/mm/gup.c16
-rw-r--r--arch/powerpc/mm/hash_utils_64.c51
-rw-r--r--arch/powerpc/mm/mem.c33
-rw-r--r--arch/powerpc/mm/mmap_64.c (renamed from arch/powerpc/mm/mmap.c)64
-rw-r--r--arch/powerpc/mm/mmu_context_nohash.c4
-rw-r--r--arch/powerpc/mm/numa.c174
-rw-r--r--arch/powerpc/mm/pgtable.c134
-rw-r--r--arch/powerpc/mm/pgtable_32.c18
-rw-r--r--arch/powerpc/mm/pgtable_64.c25
-rw-r--r--arch/powerpc/mm/ppc_mmu_32.c10
-rw-r--r--arch/powerpc/mm/tlb_hash64.c6
-rw-r--r--arch/powerpc/mm/tlb_nohash.c18
-rw-r--r--arch/powerpc/mm/tlb_nohash_low.S44
-rw-r--r--arch/powerpc/oprofile/op_model_7450.c21
-rw-r--r--arch/powerpc/platforms/44x/Kconfig19
-rw-r--r--arch/powerpc/platforms/44x/ppc44x_simple.c1
-rw-r--r--arch/powerpc/platforms/512x/Kconfig4
-rw-r--r--arch/powerpc/platforms/52xx/Kconfig15
-rw-r--r--arch/powerpc/platforms/52xx/Makefile3
-rw-r--r--arch/powerpc/platforms/52xx/media5200.c273
-rw-r--r--arch/powerpc/platforms/52xx/mpc5200_simple.c4
-rw-r--r--arch/powerpc/platforms/52xx/mpc52xx_common.c40
-rw-r--r--arch/powerpc/platforms/52xx/mpc52xx_gpio.c85
-rw-r--r--arch/powerpc/platforms/52xx/mpc52xx_gpt.c396
-rw-r--r--arch/powerpc/platforms/52xx/mpc52xx_pic.c170
-rw-r--r--arch/powerpc/platforms/82xx/Kconfig2
-rw-r--r--arch/powerpc/platforms/83xx/Kconfig2
-rw-r--r--arch/powerpc/platforms/83xx/asp834x.c1
-rw-r--r--arch/powerpc/platforms/83xx/mpc831x_rdb.c2
-rw-r--r--arch/powerpc/platforms/83xx/mpc834x_itx.c1
-rw-r--r--arch/powerpc/platforms/83xx/mpc834x_mds.c1
-rw-r--r--arch/powerpc/platforms/83xx/mpc837x_mds.c11
-rw-r--r--arch/powerpc/platforms/83xx/mpc837x_rdb.c3
-rw-r--r--arch/powerpc/platforms/83xx/sbc834x.c1
-rw-r--r--arch/powerpc/platforms/83xx/usb.c3
-rw-r--r--arch/powerpc/platforms/85xx/Kconfig6
-rw-r--r--arch/powerpc/platforms/85xx/Makefile1
-rw-r--r--arch/powerpc/platforms/85xx/ksi8560.c3
-rw-r--r--arch/powerpc/platforms/85xx/mpc8536_ds.c1
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_ads.c1
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_cds.c2
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_ds.c1
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_mds.c1
-rw-r--r--arch/powerpc/platforms/85xx/sbc8548.c1
-rw-r--r--arch/powerpc/platforms/85xx/sbc8560.c1
-rw-r--r--arch/powerpc/platforms/85xx/smp.c43
-rw-r--r--arch/powerpc/platforms/85xx/socrates.c133
-rw-r--r--arch/powerpc/platforms/85xx/socrates_fpga_pic.c327
-rw-r--r--arch/powerpc/platforms/85xx/socrates_fpga_pic.h16
-rw-r--r--arch/powerpc/platforms/85xx/stx_gp3.c1
-rw-r--r--arch/powerpc/platforms/85xx/tqm85xx.c1
-rw-r--r--arch/powerpc/platforms/86xx/Kconfig20
-rw-r--r--arch/powerpc/platforms/86xx/Makefile2
-rw-r--r--arch/powerpc/platforms/86xx/gef_gpio.c36
-rw-r--r--arch/powerpc/platforms/86xx/gef_ppc9a.c224
-rw-r--r--arch/powerpc/platforms/86xx/gef_sbc310.c235
-rw-r--r--arch/powerpc/platforms/86xx/gef_sbc610.c1
-rw-r--r--arch/powerpc/platforms/86xx/mpc8610_hpcd.c1
-rw-r--r--arch/powerpc/platforms/86xx/mpc86xx_hpcn.c1
-rw-r--r--arch/powerpc/platforms/86xx/sbc8641d.c1
-rw-r--r--arch/powerpc/platforms/8xx/m8xx_setup.c1
-rw-r--r--arch/powerpc/platforms/Kconfig39
-rw-r--r--arch/powerpc/platforms/Kconfig.cputype22
-rw-r--r--arch/powerpc/platforms/Makefile1
-rw-r--r--arch/powerpc/platforms/amigaone/Kconfig18
-rw-r--r--arch/powerpc/platforms/amigaone/Makefile1
-rw-r--r--arch/powerpc/platforms/amigaone/setup.c170
-rw-r--r--arch/powerpc/platforms/cell/Kconfig33
-rw-r--r--arch/powerpc/platforms/cell/Makefile2
-rw-r--r--arch/powerpc/platforms/cell/io-workarounds.c4
-rw-r--r--arch/powerpc/platforms/cell/iommu.c9
-rw-r--r--arch/powerpc/platforms/cell/qpace_setup.c15
-rw-r--r--arch/powerpc/platforms/cell/spu_base.c2
-rw-r--r--arch/powerpc/platforms/cell/spu_fault.c48
-rw-r--r--arch/powerpc/platforms/cell/spufs/context.c4
-rw-r--r--arch/powerpc/platforms/cell/spufs/file.c20
-rw-r--r--arch/powerpc/platforms/cell/spufs/inode.c5
-rw-r--r--arch/powerpc/platforms/cell/spufs/run.c3
-rw-r--r--arch/powerpc/platforms/cell/spufs/spufs.h8
-rw-r--r--arch/powerpc/platforms/chrp/Kconfig2
-rw-r--r--arch/powerpc/platforms/chrp/pegasos_eth.c72
-rw-r--r--arch/powerpc/platforms/chrp/setup.c1
-rw-r--r--arch/powerpc/platforms/embedded6xx/Kconfig2
-rw-r--r--arch/powerpc/platforms/iseries/Kconfig2
-rw-r--r--arch/powerpc/platforms/iseries/irq.c2
-rw-r--r--arch/powerpc/platforms/iseries/setup.c2
-rw-r--r--arch/powerpc/platforms/maple/Kconfig2
-rw-r--r--arch/powerpc/platforms/pasemi/Kconfig2
-rw-r--r--arch/powerpc/platforms/powermac/Kconfig2
-rw-r--r--arch/powerpc/platforms/powermac/cpufreq_64.c5
-rw-r--r--arch/powerpc/platforms/powermac/pic.c2
-rw-r--r--arch/powerpc/platforms/powermac/pic.h2
-rw-r--r--arch/powerpc/platforms/powermac/setup.c3
-rw-r--r--arch/powerpc/platforms/powermac/smp.c1
-rw-r--r--arch/powerpc/platforms/prep/Kconfig2
-rw-r--r--arch/powerpc/platforms/ps3/Kconfig2
-rw-r--r--arch/powerpc/platforms/ps3/mm.c4
-rw-r--r--arch/powerpc/platforms/pseries/Kconfig17
-rw-r--r--arch/powerpc/platforms/pseries/Makefile3
-rw-r--r--arch/powerpc/platforms/pseries/dtl.c278
-rw-r--r--arch/powerpc/platforms/pseries/eeh_driver.c68
-rw-r--r--arch/powerpc/platforms/pseries/msi.c248
-rw-r--r--arch/powerpc/platforms/pseries/pci_dlpar.c2
-rw-r--r--arch/powerpc/platforms/pseries/plpar_wrappers.h10
-rw-r--r--arch/powerpc/platforms/pseries/reconfig.c6
-rw-r--r--arch/powerpc/sysdev/cpm1.c1
-rw-r--r--arch/powerpc/sysdev/cpm2.c4
-rw-r--r--arch/powerpc/sysdev/cpm_common.c2
-rw-r--r--arch/powerpc/sysdev/fsl_pci.c244
-rw-r--r--arch/powerpc/sysdev/fsl_soc.c4
-rw-r--r--arch/powerpc/sysdev/ipic.c6
-rw-r--r--arch/powerpc/sysdev/msi_bitmap.c6
-rw-r--r--arch/powerpc/sysdev/pmi.c2
-rw-r--r--arch/powerpc/sysdev/ppc4xx_pci.c2
-rw-r--r--arch/sh/boards/board-ap325rxa.c3
-rw-r--r--arch/sh/boards/mach-migor/setup.c5
-rw-r--r--arch/sh/include/asm/topology.h1
-rw-r--r--arch/sh/kernel/time_64.c1
-rw-r--r--arch/sh/kernel/timers/timer-cmt.c1
-rw-r--r--arch/sh/kernel/timers/timer-mtu2.c1
-rw-r--r--arch/sh/kernel/timers/timer-tmu.c1
-rw-r--r--arch/sparc/include/asm/mmu_context_64.h8
-rw-r--r--arch/sparc/include/asm/smp_64.h3
-rw-r--r--arch/sparc/include/asm/system_32.h2
-rw-r--r--arch/sparc/include/asm/topology_64.h12
-rw-r--r--arch/sparc/kernel/ds.c2
-rw-r--r--arch/sparc/kernel/irq_32.c2
-rw-r--r--arch/sparc/kernel/irq_64.c4
-rw-r--r--arch/sparc/kernel/led.c1
-rw-r--r--arch/sparc/kernel/mdesc.c2
-rw-r--r--arch/sparc/kernel/nmi.c23
-rw-r--r--arch/sparc/kernel/prom_64.c4
-rw-r--r--arch/sparc/kernel/smp_32.c36
-rw-r--r--arch/sparc/kernel/smp_64.c14
-rw-r--r--arch/sparc/kernel/sun4d_irq.c1
-rw-r--r--arch/sparc/kernel/sun4d_smp.c11
-rw-r--r--arch/sparc/kernel/sun4m_smp.c10
-rw-r--r--arch/sparc/mm/init_64.c2
-rw-r--r--arch/sparc/mm/srmmu.c2
-rw-r--r--arch/x86/Kconfig16
-rw-r--r--arch/x86/Kconfig.cpu17
-rw-r--r--arch/x86/Makefile29
-rw-r--r--arch/x86/boot/Makefile53
-rw-r--r--arch/x86/boot/header.S29
-rw-r--r--arch/x86/boot/pm.c44
-rw-r--r--arch/x86/boot/pmjump.S1
-rw-r--r--arch/x86/boot/setup.ld3
-rw-r--r--arch/x86/boot/tools/build.c9
-rw-r--r--arch/x86/boot/video-vga.c22
-rw-r--r--arch/x86/include/asm/apic.h37
-rw-r--r--arch/x86/include/asm/apicdef.h1
-rw-r--r--arch/x86/include/asm/boot.h4
-rw-r--r--arch/x86/include/asm/cacheflush.h3
-rwxr-xr-xarch/x86/include/asm/cpu_debug.h226
-rw-r--r--arch/x86/include/asm/desc.h3
-rw-r--r--arch/x86/include/asm/device.h2
-rw-r--r--arch/x86/include/asm/dma-mapping.h188
-rw-r--r--arch/x86/include/asm/dmi.h19
-rw-r--r--arch/x86/include/asm/e820.h2
-rw-r--r--arch/x86/include/asm/entry_arch.h2
-rw-r--r--arch/x86/include/asm/ftrace.h25
-rw-r--r--arch/x86/include/asm/hardirq.h1
-rw-r--r--arch/x86/include/asm/highmem.h1
-rw-r--r--arch/x86/include/asm/hw_irq.h1
-rw-r--r--arch/x86/include/asm/init.h18
-rw-r--r--arch/x86/include/asm/io_apic.h5
-rw-r--r--arch/x86/include/asm/iommu.h2
-rw-r--r--arch/x86/include/asm/irq.h1
-rw-r--r--arch/x86/include/asm/irq_remapping.h2
-rw-r--r--arch/x86/include/asm/irq_vectors.h5
-rw-r--r--arch/x86/include/asm/kexec.h13
-rw-r--r--arch/x86/include/asm/lguest_hcall.h24
-rw-r--r--arch/x86/include/asm/linkage.h19
-rw-r--r--arch/x86/include/asm/mce.h35
-rw-r--r--arch/x86/include/asm/msidef.h1
-rw-r--r--arch/x86/include/asm/msr-index.h5
-rw-r--r--arch/x86/include/asm/page_32_types.h5
-rw-r--r--arch/x86/include/asm/page_types.h6
-rw-r--r--arch/x86/include/asm/paravirt.h19
-rw-r--r--arch/x86/include/asm/pat.h5
-rw-r--r--arch/x86/include/asm/pgtable-2level.h7
-rw-r--r--arch/x86/include/asm/pgtable-3level.h17
-rw-r--r--arch/x86/include/asm/pgtable.h2
-rw-r--r--arch/x86/include/asm/pgtable_32.h3
-rw-r--r--arch/x86/include/asm/pgtable_32_types.h5
-rw-r--r--arch/x86/include/asm/pgtable_types.h1
-rw-r--r--arch/x86/include/asm/processor.h5
-rw-r--r--arch/x86/include/asm/sections.h7
-rw-r--r--arch/x86/include/asm/setup.h39
-rw-r--r--arch/x86/include/asm/timer.h2
-rw-r--r--arch/x86/include/asm/topology.h12
-rw-r--r--arch/x86/include/asm/uv/uv_hub.h4
-rw-r--r--arch/x86/include/asm/xen/hypercall.h2
-rw-r--r--arch/x86/kernel/Makefile6
-rw-r--r--arch/x86/kernel/alternative.c17
-rw-r--r--arch/x86/kernel/amd_iommu.c26
-rw-r--r--arch/x86/kernel/apic/apic.c35
-rw-r--r--arch/x86/kernel/apic/apic_flat_64.c18
-rw-r--r--arch/x86/kernel/apic/io_apic.c292
-rw-r--r--arch/x86/kernel/apic/probe_64.c7
-rw-r--r--arch/x86/kernel/apic/x2apic_cluster.c6
-rw-r--r--arch/x86/kernel/apic/x2apic_phys.c6
-rw-r--r--arch/x86/kernel/apm_32.c15
-rw-r--r--arch/x86/kernel/check.c8
-rw-r--r--arch/x86/kernel/cpu/Makefile5
-rw-r--r--arch/x86/kernel/cpu/addon_cpuid_features.c2
-rw-r--r--arch/x86/kernel/cpu/amd.c54
-rw-r--r--arch/x86/kernel/cpu/centaur.c36
-rw-r--r--arch/x86/kernel/cpu/centaur_64.c37
-rw-r--r--arch/x86/kernel/cpu/common.c396
-rw-r--r--arch/x86/kernel/cpu/cpu.h25
-rwxr-xr-xarch/x86/kernel/cpu/cpu_debug.c901
-rw-r--r--arch/x86/kernel/cpu/cyrix.c16
-rw-r--r--arch/x86/kernel/cpu/intel.c32
-rw-r--r--arch/x86/kernel/cpu/intel_cacheinfo.c8
-rw-r--r--arch/x86/kernel/cpu/mcheck/Makefile1
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce_32.c14
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce_64.c530
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce_amd_64.c62
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce_intel_64.c207
-rw-r--r--arch/x86/kernel/cpu/mcheck/threshold.c29
-rw-r--r--arch/x86/kernel/cpu/mtrr/Makefile2
-rw-r--r--arch/x86/kernel/cpu/mtrr/cleanup.c1101
-rw-r--r--arch/x86/kernel/cpu/mtrr/generic.c202
-rw-r--r--arch/x86/kernel/cpu/mtrr/if.c10
-rw-r--r--arch/x86/kernel/cpu/mtrr/main.c1069
-rw-r--r--arch/x86/kernel/cpu/mtrr/mtrr.h4
-rw-r--r--arch/x86/kernel/cpu/transmeta.c2
-rw-r--r--arch/x86/kernel/cpu/umc.c2
-rw-r--r--arch/x86/kernel/dumpstack.c1
-rw-r--r--arch/x86/kernel/e820.c142
-rw-r--r--arch/x86/kernel/early_printk.c20
-rw-r--r--arch/x86/kernel/entry_32.S18
-rw-r--r--arch/x86/kernel/entry_64.S6
-rw-r--r--arch/x86/kernel/ftrace.c75
-rw-r--r--arch/x86/kernel/head32.c5
-rw-r--r--arch/x86/kernel/head64.c2
-rw-r--r--arch/x86/kernel/head_32.S76
-rw-r--r--arch/x86/kernel/i8253.c68
-rw-r--r--arch/x86/kernel/io_delay.c27
-rw-r--r--arch/x86/kernel/irq.c88
-rw-r--r--arch/x86/kernel/irqinit_32.c5
-rw-r--r--arch/x86/kernel/irqinit_64.c4
-rw-r--r--arch/x86/kernel/kdebugfs.c82
-rw-r--r--arch/x86/kernel/kprobes.c2
-rw-r--r--arch/x86/kernel/kvm.c7
-rw-r--r--arch/x86/kernel/machine_kexec_32.c17
-rw-r--r--arch/x86/kernel/machine_kexec_64.c99
-rw-r--r--arch/x86/kernel/mfgpt_32.c1
-rw-r--r--arch/x86/kernel/mmconf-fam10h_64.c2
-rw-r--r--arch/x86/kernel/mpparse.c384
-rw-r--r--arch/x86/kernel/paravirt.c1
-rw-r--r--arch/x86/kernel/pci-calgary_64.c38
-rw-r--r--arch/x86/kernel/pci-dma.c14
-rw-r--r--arch/x86/kernel/pci-gart_64.c34
-rw-r--r--arch/x86/kernel/pci-nommu.c39
-rw-r--r--arch/x86/kernel/pci-swiotlb.c (renamed from arch/x86/kernel/pci-swiotlb_64.c)19
-rw-r--r--arch/x86/kernel/process.c5
-rw-r--r--arch/x86/kernel/ptrace.c3
-rw-r--r--arch/x86/kernel/quirks.c3
-rw-r--r--arch/x86/kernel/relocate_kernel_32.S24
-rw-r--r--arch/x86/kernel/relocate_kernel_64.S189
-rw-r--r--arch/x86/kernel/rtc.c20
-rw-r--r--arch/x86/kernel/setup.c59
-rw-r--r--arch/x86/kernel/signal.c48
-rw-r--r--arch/x86/kernel/smpboot.c78
-rw-r--r--arch/x86/kernel/time_64.c2
-rw-r--r--arch/x86/kernel/tlb_uv.c3
-rw-r--r--arch/x86/kernel/topology.c14
-rw-r--r--arch/x86/kernel/uv_time.c393
-rw-r--r--arch/x86/kernel/visws_quirks.c2
-rw-r--r--arch/x86/kernel/vmi_32.c6
-rw-r--r--arch/x86/kernel/vmiclock_32.c1
-rw-r--r--arch/x86/kernel/vmlinux_32.lds.S21
-rw-r--r--arch/x86/kernel/vmlinux_64.lds.S101
-rw-r--r--arch/x86/kernel/vsmp_64.c12
-rw-r--r--arch/x86/lguest/boot.c94
-rw-r--r--arch/x86/lguest/i386_head.S4
-rw-r--r--arch/x86/lib/memcpy_64.S143
-rw-r--r--arch/x86/mm/highmem_32.c24
-rw-r--r--arch/x86/mm/init.c344
-rw-r--r--arch/x86/mm/init_32.c256
-rw-r--r--arch/x86/mm/init_64.c280
-rw-r--r--arch/x86/mm/iomap_32.c26
-rw-r--r--arch/x86/mm/ioremap.c52
-rw-r--r--arch/x86/mm/kmmio.c2
-rw-r--r--arch/x86/mm/memtest.c3
-rw-r--r--arch/x86/mm/numa_32.c5
-rw-r--r--arch/x86/mm/pageattr.c147
-rw-r--r--arch/x86/mm/pat.c5
-rw-r--r--arch/x86/mm/pgtable_32.c2
-rw-r--r--arch/x86/mm/tlb.c5
-rw-r--r--arch/x86/pci/common.c4
-rw-r--r--arch/x86/pci/fixup.c4
-rw-r--r--arch/x86/pci/i386.c3
-rw-r--r--arch/x86/xen/mmu.c7
547 files changed, 26845 insertions, 9186 deletions
diff --git a/arch/Kconfig b/arch/Kconfig
index 550dab22daa1..830c16a2b801 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -106,3 +106,5 @@ config HAVE_CLK
106 The <linux/clk.h> calls support software clock gating and 106 The <linux/clk.h> calls support software clock gating and
107 thus are a key power management tool on many systems. 107 thus are a key power management tool on many systems.
108 108
109config HAVE_DMA_API_DEBUG
110 bool
diff --git a/arch/alpha/kernel/srm_env.c b/arch/alpha/kernel/srm_env.c
index 78ad7cd1bbd6..d12af472e1c0 100644
--- a/arch/alpha/kernel/srm_env.c
+++ b/arch/alpha/kernel/srm_env.c
@@ -218,7 +218,6 @@ srm_env_init(void)
218 BASE_DIR); 218 BASE_DIR);
219 goto cleanup; 219 goto cleanup;
220 } 220 }
221 base_dir->owner = THIS_MODULE;
222 221
223 /* 222 /*
224 * Create per-name subdirectory 223 * Create per-name subdirectory
@@ -229,7 +228,6 @@ srm_env_init(void)
229 BASE_DIR, NAMED_DIR); 228 BASE_DIR, NAMED_DIR);
230 goto cleanup; 229 goto cleanup;
231 } 230 }
232 named_dir->owner = THIS_MODULE;
233 231
234 /* 232 /*
235 * Create per-number subdirectory 233 * Create per-number subdirectory
@@ -241,7 +239,6 @@ srm_env_init(void)
241 goto cleanup; 239 goto cleanup;
242 240
243 } 241 }
244 numbered_dir->owner = THIS_MODULE;
245 242
246 /* 243 /*
247 * Create all named nodes 244 * Create all named nodes
@@ -254,7 +251,6 @@ srm_env_init(void)
254 goto cleanup; 251 goto cleanup;
255 252
256 entry->proc_entry->data = (void *) entry; 253 entry->proc_entry->data = (void *) entry;
257 entry->proc_entry->owner = THIS_MODULE;
258 entry->proc_entry->read_proc = srm_env_read; 254 entry->proc_entry->read_proc = srm_env_read;
259 entry->proc_entry->write_proc = srm_env_write; 255 entry->proc_entry->write_proc = srm_env_write;
260 256
@@ -275,7 +271,6 @@ srm_env_init(void)
275 271
276 entry->id = var_num; 272 entry->id = var_num;
277 entry->proc_entry->data = (void *) entry; 273 entry->proc_entry->data = (void *) entry;
278 entry->proc_entry->owner = THIS_MODULE;
279 entry->proc_entry->read_proc = srm_env_read; 274 entry->proc_entry->read_proc = srm_env_read;
280 entry->proc_entry->write_proc = srm_env_write; 275 entry->proc_entry->write_proc = srm_env_write;
281 } 276 }
diff --git a/arch/arm/mach-pxa/pcm990-baseboard.c b/arch/arm/mach-pxa/pcm990-baseboard.c
index f46698e20c1f..6112740b4ae9 100644
--- a/arch/arm/mach-pxa/pcm990-baseboard.c
+++ b/arch/arm/mach-pxa/pcm990-baseboard.c
@@ -380,14 +380,49 @@ static struct pca953x_platform_data pca9536_data = {
380 .gpio_base = NR_BUILTIN_GPIO + 1, 380 .gpio_base = NR_BUILTIN_GPIO + 1,
381}; 381};
382 382
383static struct soc_camera_link iclink[] = { 383static int gpio_bus_switch;
384 { 384
385 .bus_id = 0, /* Must match with the camera ID above */ 385static int pcm990_camera_set_bus_param(struct soc_camera_link *link,
386 .gpio = NR_BUILTIN_GPIO + 1, 386 unsigned long flags)
387 }, { 387{
388 .bus_id = 0, /* Must match with the camera ID above */ 388 if (gpio_bus_switch <= 0) {
389 .gpio = -ENXIO, 389 if (flags == SOCAM_DATAWIDTH_10)
390 return 0;
391 else
392 return -EINVAL;
393 }
394
395 if (flags & SOCAM_DATAWIDTH_8)
396 gpio_set_value(gpio_bus_switch, 1);
397 else
398 gpio_set_value(gpio_bus_switch, 0);
399
400 return 0;
401}
402
403static unsigned long pcm990_camera_query_bus_param(struct soc_camera_link *link)
404{
405 int ret;
406
407 if (!gpio_bus_switch) {
408 ret = gpio_request(NR_BUILTIN_GPIO + 1, "camera");
409 if (!ret) {
410 gpio_bus_switch = NR_BUILTIN_GPIO + 1;
411 gpio_direction_output(gpio_bus_switch, 0);
412 } else
413 gpio_bus_switch = -EINVAL;
390 } 414 }
415
416 if (gpio_bus_switch > 0)
417 return SOCAM_DATAWIDTH_8 | SOCAM_DATAWIDTH_10;
418 else
419 return SOCAM_DATAWIDTH_10;
420}
421
422static struct soc_camera_link iclink = {
423 .bus_id = 0, /* Must match with the camera ID above */
424 .query_bus_param = pcm990_camera_query_bus_param,
425 .set_bus_param = pcm990_camera_set_bus_param,
391}; 426};
392 427
393/* Board I2C devices. */ 428/* Board I2C devices. */
@@ -398,10 +433,10 @@ static struct i2c_board_info __initdata pcm990_i2c_devices[] = {
398 .platform_data = &pca9536_data, 433 .platform_data = &pca9536_data,
399 }, { 434 }, {
400 I2C_BOARD_INFO("mt9v022", 0x48), 435 I2C_BOARD_INFO("mt9v022", 0x48),
401 .platform_data = &iclink[0], /* With extender */ 436 .platform_data = &iclink, /* With extender */
402 }, { 437 }, {
403 I2C_BOARD_INFO("mt9m001", 0x5d), 438 I2C_BOARD_INFO("mt9m001", 0x5d),
404 .platform_data = &iclink[0], /* With extender */ 439 .platform_data = &iclink, /* With extender */
405 }, 440 },
406}; 441};
407#endif /* CONFIG_VIDEO_PXA27x ||CONFIG_VIDEO_PXA27x_MODULE */ 442#endif /* CONFIG_VIDEO_PXA27x ||CONFIG_VIDEO_PXA27x_MODULE */
diff --git a/arch/arm/plat-mxc/include/mach/mx3_camera.h b/arch/arm/plat-mxc/include/mach/mx3_camera.h
new file mode 100644
index 000000000000..36d7ff27b5e2
--- /dev/null
+++ b/arch/arm/plat-mxc/include/mach/mx3_camera.h
@@ -0,0 +1,52 @@
1/*
2 * mx3_camera.h - i.MX3x camera driver header file
3 *
4 * Copyright (C) 2008, Guennadi Liakhovetski, DENX Software Engineering, <lg@denx.de>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
19 */
20
21#ifndef _MX3_CAMERA_H_
22#define _MX3_CAMERA_H_
23
24#include <linux/device.h>
25
26#define MX3_CAMERA_CLK_SRC 1
27#define MX3_CAMERA_EXT_VSYNC 2
28#define MX3_CAMERA_DP 4
29#define MX3_CAMERA_PCP 8
30#define MX3_CAMERA_HSP 0x10
31#define MX3_CAMERA_VSP 0x20
32#define MX3_CAMERA_DATAWIDTH_4 0x40
33#define MX3_CAMERA_DATAWIDTH_8 0x80
34#define MX3_CAMERA_DATAWIDTH_10 0x100
35#define MX3_CAMERA_DATAWIDTH_15 0x200
36
37#define MX3_CAMERA_DATAWIDTH_MASK (MX3_CAMERA_DATAWIDTH_4 | MX3_CAMERA_DATAWIDTH_8 | \
38 MX3_CAMERA_DATAWIDTH_10 | MX3_CAMERA_DATAWIDTH_15)
39
40/**
41 * struct mx3_camera_pdata - i.MX3x camera platform data
42 * @flags: MX3_CAMERA_* flags
43 * @mclk_10khz: master clock frequency in 10kHz units
44 * @dma_dev: IPU DMA device to match against in channel allocation
45 */
46struct mx3_camera_pdata {
47 unsigned long flags;
48 unsigned long mclk_10khz;
49 struct device *dma_dev;
50};
51
52#endif
diff --git a/arch/blackfin/mm/sram-alloc.c b/arch/blackfin/mm/sram-alloc.c
index 834cab7438a8..530d1393a232 100644
--- a/arch/blackfin/mm/sram-alloc.c
+++ b/arch/blackfin/mm/sram-alloc.c
@@ -854,7 +854,6 @@ static int __init sram_proc_init(void)
854 printk(KERN_WARNING "unable to create /proc/sram\n"); 854 printk(KERN_WARNING "unable to create /proc/sram\n");
855 return -1; 855 return -1;
856 } 856 }
857 ptr->owner = THIS_MODULE;
858 ptr->read_proc = sram_proc_read; 857 ptr->read_proc = sram_proc_read;
859 return 0; 858 return 0;
860} 859}
diff --git a/arch/cris/arch-v10/kernel/time.c b/arch/cris/arch-v10/kernel/time.c
index c685ba4c3387..2b73c7a5b649 100644
--- a/arch/cris/arch-v10/kernel/time.c
+++ b/arch/cris/arch-v10/kernel/time.c
@@ -261,7 +261,6 @@ timer_interrupt(int irq, void *dev_id)
261static struct irqaction irq2 = { 261static struct irqaction irq2 = {
262 .handler = timer_interrupt, 262 .handler = timer_interrupt,
263 .flags = IRQF_SHARED | IRQF_DISABLED, 263 .flags = IRQF_SHARED | IRQF_DISABLED,
264 .mask = CPU_MASK_NONE,
265 .name = "timer", 264 .name = "timer",
266}; 265};
267 266
diff --git a/arch/cris/arch-v32/kernel/smp.c b/arch/cris/arch-v32/kernel/smp.c
index 9dac17334640..f59a973c97ee 100644
--- a/arch/cris/arch-v32/kernel/smp.c
+++ b/arch/cris/arch-v32/kernel/smp.c
@@ -65,7 +65,6 @@ static int send_ipi(int vector, int wait, cpumask_t cpu_mask);
65static struct irqaction irq_ipi = { 65static struct irqaction irq_ipi = {
66 .handler = crisv32_ipi_interrupt, 66 .handler = crisv32_ipi_interrupt,
67 .flags = IRQF_DISABLED, 67 .flags = IRQF_DISABLED,
68 .mask = CPU_MASK_NONE,
69 .name = "ipi", 68 .name = "ipi",
70}; 69};
71 70
diff --git a/arch/cris/arch-v32/kernel/time.c b/arch/cris/arch-v32/kernel/time.c
index 3a13dd6e0a9a..65633d0dab86 100644
--- a/arch/cris/arch-v32/kernel/time.c
+++ b/arch/cris/arch-v32/kernel/time.c
@@ -267,7 +267,6 @@ timer_interrupt(int irq, void *dev_id)
267static struct irqaction irq_timer = { 267static struct irqaction irq_timer = {
268 .handler = timer_interrupt, 268 .handler = timer_interrupt,
269 .flags = IRQF_SHARED | IRQF_DISABLED, 269 .flags = IRQF_SHARED | IRQF_DISABLED,
270 .mask = CPU_MASK_NONE,
271 .name = "timer" 270 .name = "timer"
272}; 271};
273 272
diff --git a/arch/frv/kernel/irq-mb93091.c b/arch/frv/kernel/irq-mb93091.c
index 9e38f99bbab8..4dd9adaf115a 100644
--- a/arch/frv/kernel/irq-mb93091.c
+++ b/arch/frv/kernel/irq-mb93091.c
@@ -109,28 +109,24 @@ static struct irqaction fpga_irq[4] = {
109 [0] = { 109 [0] = {
110 .handler = fpga_interrupt, 110 .handler = fpga_interrupt,
111 .flags = IRQF_DISABLED | IRQF_SHARED, 111 .flags = IRQF_DISABLED | IRQF_SHARED,
112 .mask = CPU_MASK_NONE,
113 .name = "fpga.0", 112 .name = "fpga.0",
114 .dev_id = (void *) 0x0028UL, 113 .dev_id = (void *) 0x0028UL,
115 }, 114 },
116 [1] = { 115 [1] = {
117 .handler = fpga_interrupt, 116 .handler = fpga_interrupt,
118 .flags = IRQF_DISABLED | IRQF_SHARED, 117 .flags = IRQF_DISABLED | IRQF_SHARED,
119 .mask = CPU_MASK_NONE,
120 .name = "fpga.1", 118 .name = "fpga.1",
121 .dev_id = (void *) 0x0050UL, 119 .dev_id = (void *) 0x0050UL,
122 }, 120 },
123 [2] = { 121 [2] = {
124 .handler = fpga_interrupt, 122 .handler = fpga_interrupt,
125 .flags = IRQF_DISABLED | IRQF_SHARED, 123 .flags = IRQF_DISABLED | IRQF_SHARED,
126 .mask = CPU_MASK_NONE,
127 .name = "fpga.2", 124 .name = "fpga.2",
128 .dev_id = (void *) 0x1c00UL, 125 .dev_id = (void *) 0x1c00UL,
129 }, 126 },
130 [3] = { 127 [3] = {
131 .handler = fpga_interrupt, 128 .handler = fpga_interrupt,
132 .flags = IRQF_DISABLED | IRQF_SHARED, 129 .flags = IRQF_DISABLED | IRQF_SHARED,
133 .mask = CPU_MASK_NONE,
134 .name = "fpga.3", 130 .name = "fpga.3",
135 .dev_id = (void *) 0x6386UL, 131 .dev_id = (void *) 0x6386UL,
136 } 132 }
diff --git a/arch/frv/kernel/irq-mb93093.c b/arch/frv/kernel/irq-mb93093.c
index 3c2752ca9775..e45209031873 100644
--- a/arch/frv/kernel/irq-mb93093.c
+++ b/arch/frv/kernel/irq-mb93093.c
@@ -108,7 +108,6 @@ static struct irqaction fpga_irq[1] = {
108 [0] = { 108 [0] = {
109 .handler = fpga_interrupt, 109 .handler = fpga_interrupt,
110 .flags = IRQF_DISABLED, 110 .flags = IRQF_DISABLED,
111 .mask = CPU_MASK_NONE,
112 .name = "fpga.0", 111 .name = "fpga.0",
113 .dev_id = (void *) 0x0700UL, 112 .dev_id = (void *) 0x0700UL,
114 } 113 }
diff --git a/arch/frv/kernel/irq-mb93493.c b/arch/frv/kernel/irq-mb93493.c
index 7754c7338e4b..ba55ecdfb245 100644
--- a/arch/frv/kernel/irq-mb93493.c
+++ b/arch/frv/kernel/irq-mb93493.c
@@ -120,14 +120,12 @@ static struct irqaction mb93493_irq[2] = {
120 [0] = { 120 [0] = {
121 .handler = mb93493_interrupt, 121 .handler = mb93493_interrupt,
122 .flags = IRQF_DISABLED | IRQF_SHARED, 122 .flags = IRQF_DISABLED | IRQF_SHARED,
123 .mask = CPU_MASK_NONE,
124 .name = "mb93493.0", 123 .name = "mb93493.0",
125 .dev_id = (void *) __addr_MB93493_IQSR(0), 124 .dev_id = (void *) __addr_MB93493_IQSR(0),
126 }, 125 },
127 [1] = { 126 [1] = {
128 .handler = mb93493_interrupt, 127 .handler = mb93493_interrupt,
129 .flags = IRQF_DISABLED | IRQF_SHARED, 128 .flags = IRQF_DISABLED | IRQF_SHARED,
130 .mask = CPU_MASK_NONE,
131 .name = "mb93493.1", 129 .name = "mb93493.1",
132 .dev_id = (void *) __addr_MB93493_IQSR(1), 130 .dev_id = (void *) __addr_MB93493_IQSR(1),
133 } 131 }
diff --git a/arch/frv/kernel/time.c b/arch/frv/kernel/time.c
index 69f6a4ef5d61..fb0ce7577225 100644
--- a/arch/frv/kernel/time.c
+++ b/arch/frv/kernel/time.c
@@ -45,7 +45,6 @@ static irqreturn_t timer_interrupt(int irq, void *dummy);
45static struct irqaction timer_irq = { 45static struct irqaction timer_irq = {
46 .handler = timer_interrupt, 46 .handler = timer_interrupt,
47 .flags = IRQF_DISABLED, 47 .flags = IRQF_DISABLED,
48 .mask = CPU_MASK_NONE,
49 .name = "timer", 48 .name = "timer",
50}; 49};
51 50
diff --git a/arch/h8300/kernel/timer/itu.c b/arch/h8300/kernel/timer/itu.c
index d1c926596b08..4883ba7103a8 100644
--- a/arch/h8300/kernel/timer/itu.c
+++ b/arch/h8300/kernel/timer/itu.c
@@ -60,7 +60,6 @@ static struct irqaction itu_irq = {
60 .name = "itu", 60 .name = "itu",
61 .handler = timer_interrupt, 61 .handler = timer_interrupt,
62 .flags = IRQF_DISABLED | IRQF_TIMER, 62 .flags = IRQF_DISABLED | IRQF_TIMER,
63 .mask = CPU_MASK_NONE,
64}; 63};
65 64
66static const int __initdata divide_rate[] = {1, 2, 4, 8}; 65static const int __initdata divide_rate[] = {1, 2, 4, 8};
diff --git a/arch/h8300/kernel/timer/timer16.c b/arch/h8300/kernel/timer/timer16.c
index e14271b72119..042dbb53f3fb 100644
--- a/arch/h8300/kernel/timer/timer16.c
+++ b/arch/h8300/kernel/timer/timer16.c
@@ -55,7 +55,6 @@ static struct irqaction timer16_irq = {
55 .name = "timer-16", 55 .name = "timer-16",
56 .handler = timer_interrupt, 56 .handler = timer_interrupt,
57 .flags = IRQF_DISABLED | IRQF_TIMER, 57 .flags = IRQF_DISABLED | IRQF_TIMER,
58 .mask = CPU_MASK_NONE,
59}; 58};
60 59
61static const int __initdata divide_rate[] = {1, 2, 4, 8}; 60static const int __initdata divide_rate[] = {1, 2, 4, 8};
diff --git a/arch/h8300/kernel/timer/timer8.c b/arch/h8300/kernel/timer/timer8.c
index 0556d7c7bea6..38be0cabef0d 100644
--- a/arch/h8300/kernel/timer/timer8.c
+++ b/arch/h8300/kernel/timer/timer8.c
@@ -75,7 +75,6 @@ static struct irqaction timer8_irq = {
75 .name = "timer-8", 75 .name = "timer-8",
76 .handler = timer_interrupt, 76 .handler = timer_interrupt,
77 .flags = IRQF_DISABLED | IRQF_TIMER, 77 .flags = IRQF_DISABLED | IRQF_TIMER,
78 .mask = CPU_MASK_NONE,
79}; 78};
80 79
81static const int __initdata divide_rate[] = {8, 64, 8192}; 80static const int __initdata divide_rate[] = {8, 64, 8192};
diff --git a/arch/h8300/kernel/timer/tpu.c b/arch/h8300/kernel/timer/tpu.c
index df7f453a9673..ad383caae196 100644
--- a/arch/h8300/kernel/timer/tpu.c
+++ b/arch/h8300/kernel/timer/tpu.c
@@ -65,7 +65,6 @@ static struct irqaction tpu_irq = {
65 .name = "tpu", 65 .name = "tpu",
66 .handler = timer_interrupt, 66 .handler = timer_interrupt,
67 .flags = IRQF_DISABLED | IRQF_TIMER, 67 .flags = IRQF_DISABLED | IRQF_TIMER,
68 .mask = CPU_MASK_NONE,
69}; 68};
70 69
71const static int __initdata divide_rate[] = { 70const static int __initdata divide_rate[] = {
diff --git a/arch/ia64/dig/Makefile b/arch/ia64/dig/Makefile
index 5c0283830bd6..2f7caddf093e 100644
--- a/arch/ia64/dig/Makefile
+++ b/arch/ia64/dig/Makefile
@@ -7,8 +7,8 @@
7 7
8obj-y := setup.o 8obj-y := setup.o
9ifeq ($(CONFIG_DMAR), y) 9ifeq ($(CONFIG_DMAR), y)
10obj-$(CONFIG_IA64_GENERIC) += machvec.o machvec_vtd.o dig_vtd_iommu.o 10obj-$(CONFIG_IA64_GENERIC) += machvec.o machvec_vtd.o
11else 11else
12obj-$(CONFIG_IA64_GENERIC) += machvec.o 12obj-$(CONFIG_IA64_GENERIC) += machvec.o
13endif 13endif
14obj-$(CONFIG_IA64_DIG_VTD) += dig_vtd_iommu.o 14
diff --git a/arch/ia64/dig/dig_vtd_iommu.c b/arch/ia64/dig/dig_vtd_iommu.c
deleted file mode 100644
index 1c8a079017a3..000000000000
--- a/arch/ia64/dig/dig_vtd_iommu.c
+++ /dev/null
@@ -1,59 +0,0 @@
1#include <linux/types.h>
2#include <linux/kernel.h>
3#include <linux/module.h>
4#include <linux/intel-iommu.h>
5
6void *
7vtd_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle,
8 gfp_t flags)
9{
10 return intel_alloc_coherent(dev, size, dma_handle, flags);
11}
12EXPORT_SYMBOL_GPL(vtd_alloc_coherent);
13
14void
15vtd_free_coherent(struct device *dev, size_t size, void *vaddr,
16 dma_addr_t dma_handle)
17{
18 intel_free_coherent(dev, size, vaddr, dma_handle);
19}
20EXPORT_SYMBOL_GPL(vtd_free_coherent);
21
22dma_addr_t
23vtd_map_single_attrs(struct device *dev, void *addr, size_t size,
24 int dir, struct dma_attrs *attrs)
25{
26 return intel_map_single(dev, (phys_addr_t)addr, size, dir);
27}
28EXPORT_SYMBOL_GPL(vtd_map_single_attrs);
29
30void
31vtd_unmap_single_attrs(struct device *dev, dma_addr_t iova, size_t size,
32 int dir, struct dma_attrs *attrs)
33{
34 intel_unmap_single(dev, iova, size, dir);
35}
36EXPORT_SYMBOL_GPL(vtd_unmap_single_attrs);
37
38int
39vtd_map_sg_attrs(struct device *dev, struct scatterlist *sglist, int nents,
40 int dir, struct dma_attrs *attrs)
41{
42 return intel_map_sg(dev, sglist, nents, dir);
43}
44EXPORT_SYMBOL_GPL(vtd_map_sg_attrs);
45
46void
47vtd_unmap_sg_attrs(struct device *dev, struct scatterlist *sglist,
48 int nents, int dir, struct dma_attrs *attrs)
49{
50 intel_unmap_sg(dev, sglist, nents, dir);
51}
52EXPORT_SYMBOL_GPL(vtd_unmap_sg_attrs);
53
54int
55vtd_dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
56{
57 return 0;
58}
59EXPORT_SYMBOL_GPL(vtd_dma_mapping_error);
diff --git a/arch/ia64/hp/common/hwsw_iommu.c b/arch/ia64/hp/common/hwsw_iommu.c
index 2769dbfd03bf..e4a80d82e3d8 100644
--- a/arch/ia64/hp/common/hwsw_iommu.c
+++ b/arch/ia64/hp/common/hwsw_iommu.c
@@ -13,49 +13,34 @@
13 */ 13 */
14 14
15#include <linux/device.h> 15#include <linux/device.h>
16#include <linux/dma-mapping.h>
16#include <linux/swiotlb.h> 17#include <linux/swiotlb.h>
17
18#include <asm/machvec.h> 18#include <asm/machvec.h>
19 19
20extern struct dma_map_ops sba_dma_ops, swiotlb_dma_ops;
21
20/* swiotlb declarations & definitions: */ 22/* swiotlb declarations & definitions: */
21extern int swiotlb_late_init_with_default_size (size_t size); 23extern int swiotlb_late_init_with_default_size (size_t size);
22 24
23/* hwiommu declarations & definitions: */
24
25extern ia64_mv_dma_alloc_coherent sba_alloc_coherent;
26extern ia64_mv_dma_free_coherent sba_free_coherent;
27extern ia64_mv_dma_map_single_attrs sba_map_single_attrs;
28extern ia64_mv_dma_unmap_single_attrs sba_unmap_single_attrs;
29extern ia64_mv_dma_map_sg_attrs sba_map_sg_attrs;
30extern ia64_mv_dma_unmap_sg_attrs sba_unmap_sg_attrs;
31extern ia64_mv_dma_supported sba_dma_supported;
32extern ia64_mv_dma_mapping_error sba_dma_mapping_error;
33
34#define hwiommu_alloc_coherent sba_alloc_coherent
35#define hwiommu_free_coherent sba_free_coherent
36#define hwiommu_map_single_attrs sba_map_single_attrs
37#define hwiommu_unmap_single_attrs sba_unmap_single_attrs
38#define hwiommu_map_sg_attrs sba_map_sg_attrs
39#define hwiommu_unmap_sg_attrs sba_unmap_sg_attrs
40#define hwiommu_dma_supported sba_dma_supported
41#define hwiommu_dma_mapping_error sba_dma_mapping_error
42#define hwiommu_sync_single_for_cpu machvec_dma_sync_single
43#define hwiommu_sync_sg_for_cpu machvec_dma_sync_sg
44#define hwiommu_sync_single_for_device machvec_dma_sync_single
45#define hwiommu_sync_sg_for_device machvec_dma_sync_sg
46
47
48/* 25/*
49 * Note: we need to make the determination of whether or not to use 26 * Note: we need to make the determination of whether or not to use
50 * the sw I/O TLB based purely on the device structure. Anything else 27 * the sw I/O TLB based purely on the device structure. Anything else
51 * would be unreliable or would be too intrusive. 28 * would be unreliable or would be too intrusive.
52 */ 29 */
53static inline int 30static inline int use_swiotlb(struct device *dev)
54use_swiotlb (struct device *dev)
55{ 31{
56 return dev && dev->dma_mask && !hwiommu_dma_supported(dev, *dev->dma_mask); 32 return dev && dev->dma_mask &&
33 !sba_dma_ops.dma_supported(dev, *dev->dma_mask);
57} 34}
58 35
36struct dma_map_ops *hwsw_dma_get_ops(struct device *dev)
37{
38 if (use_swiotlb(dev))
39 return &swiotlb_dma_ops;
40 return &sba_dma_ops;
41}
42EXPORT_SYMBOL(hwsw_dma_get_ops);
43
59void __init 44void __init
60hwsw_init (void) 45hwsw_init (void)
61{ 46{
@@ -71,125 +56,3 @@ hwsw_init (void)
71#endif 56#endif
72 } 57 }
73} 58}
74
75void *
76hwsw_alloc_coherent (struct device *dev, size_t size, dma_addr_t *dma_handle, gfp_t flags)
77{
78 if (use_swiotlb(dev))
79 return swiotlb_alloc_coherent(dev, size, dma_handle, flags);
80 else
81 return hwiommu_alloc_coherent(dev, size, dma_handle, flags);
82}
83
84void
85hwsw_free_coherent (struct device *dev, size_t size, void *vaddr, dma_addr_t dma_handle)
86{
87 if (use_swiotlb(dev))
88 swiotlb_free_coherent(dev, size, vaddr, dma_handle);
89 else
90 hwiommu_free_coherent(dev, size, vaddr, dma_handle);
91}
92
93dma_addr_t
94hwsw_map_single_attrs(struct device *dev, void *addr, size_t size, int dir,
95 struct dma_attrs *attrs)
96{
97 if (use_swiotlb(dev))
98 return swiotlb_map_single_attrs(dev, addr, size, dir, attrs);
99 else
100 return hwiommu_map_single_attrs(dev, addr, size, dir, attrs);
101}
102EXPORT_SYMBOL(hwsw_map_single_attrs);
103
104void
105hwsw_unmap_single_attrs(struct device *dev, dma_addr_t iova, size_t size,
106 int dir, struct dma_attrs *attrs)
107{
108 if (use_swiotlb(dev))
109 return swiotlb_unmap_single_attrs(dev, iova, size, dir, attrs);
110 else
111 return hwiommu_unmap_single_attrs(dev, iova, size, dir, attrs);
112}
113EXPORT_SYMBOL(hwsw_unmap_single_attrs);
114
115int
116hwsw_map_sg_attrs(struct device *dev, struct scatterlist *sglist, int nents,
117 int dir, struct dma_attrs *attrs)
118{
119 if (use_swiotlb(dev))
120 return swiotlb_map_sg_attrs(dev, sglist, nents, dir, attrs);
121 else
122 return hwiommu_map_sg_attrs(dev, sglist, nents, dir, attrs);
123}
124EXPORT_SYMBOL(hwsw_map_sg_attrs);
125
126void
127hwsw_unmap_sg_attrs(struct device *dev, struct scatterlist *sglist, int nents,
128 int dir, struct dma_attrs *attrs)
129{
130 if (use_swiotlb(dev))
131 return swiotlb_unmap_sg_attrs(dev, sglist, nents, dir, attrs);
132 else
133 return hwiommu_unmap_sg_attrs(dev, sglist, nents, dir, attrs);
134}
135EXPORT_SYMBOL(hwsw_unmap_sg_attrs);
136
137void
138hwsw_sync_single_for_cpu (struct device *dev, dma_addr_t addr, size_t size, int dir)
139{
140 if (use_swiotlb(dev))
141 swiotlb_sync_single_for_cpu(dev, addr, size, dir);
142 else
143 hwiommu_sync_single_for_cpu(dev, addr, size, dir);
144}
145
146void
147hwsw_sync_sg_for_cpu (struct device *dev, struct scatterlist *sg, int nelems, int dir)
148{
149 if (use_swiotlb(dev))
150 swiotlb_sync_sg_for_cpu(dev, sg, nelems, dir);
151 else
152 hwiommu_sync_sg_for_cpu(dev, sg, nelems, dir);
153}
154
155void
156hwsw_sync_single_for_device (struct device *dev, dma_addr_t addr, size_t size, int dir)
157{
158 if (use_swiotlb(dev))
159 swiotlb_sync_single_for_device(dev, addr, size, dir);
160 else
161 hwiommu_sync_single_for_device(dev, addr, size, dir);
162}
163
164void
165hwsw_sync_sg_for_device (struct device *dev, struct scatterlist *sg, int nelems, int dir)
166{
167 if (use_swiotlb(dev))
168 swiotlb_sync_sg_for_device(dev, sg, nelems, dir);
169 else
170 hwiommu_sync_sg_for_device(dev, sg, nelems, dir);
171}
172
173int
174hwsw_dma_supported (struct device *dev, u64 mask)
175{
176 if (hwiommu_dma_supported(dev, mask))
177 return 1;
178 return swiotlb_dma_supported(dev, mask);
179}
180
181int
182hwsw_dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
183{
184 return hwiommu_dma_mapping_error(dev, dma_addr) ||
185 swiotlb_dma_mapping_error(dev, dma_addr);
186}
187
188EXPORT_SYMBOL(hwsw_dma_mapping_error);
189EXPORT_SYMBOL(hwsw_dma_supported);
190EXPORT_SYMBOL(hwsw_alloc_coherent);
191EXPORT_SYMBOL(hwsw_free_coherent);
192EXPORT_SYMBOL(hwsw_sync_single_for_cpu);
193EXPORT_SYMBOL(hwsw_sync_single_for_device);
194EXPORT_SYMBOL(hwsw_sync_sg_for_cpu);
195EXPORT_SYMBOL(hwsw_sync_sg_for_device);
diff --git a/arch/ia64/hp/common/sba_iommu.c b/arch/ia64/hp/common/sba_iommu.c
index 6d5e6c5630e3..56ceb68eb99d 100644
--- a/arch/ia64/hp/common/sba_iommu.c
+++ b/arch/ia64/hp/common/sba_iommu.c
@@ -36,6 +36,7 @@
36#include <linux/bitops.h> /* hweight64() */ 36#include <linux/bitops.h> /* hweight64() */
37#include <linux/crash_dump.h> 37#include <linux/crash_dump.h>
38#include <linux/iommu-helper.h> 38#include <linux/iommu-helper.h>
39#include <linux/dma-mapping.h>
39 40
40#include <asm/delay.h> /* ia64_get_itc() */ 41#include <asm/delay.h> /* ia64_get_itc() */
41#include <asm/io.h> 42#include <asm/io.h>
@@ -908,11 +909,13 @@ sba_mark_invalid(struct ioc *ioc, dma_addr_t iova, size_t byte_cnt)
908 * 909 *
909 * See Documentation/PCI/PCI-DMA-mapping.txt 910 * See Documentation/PCI/PCI-DMA-mapping.txt
910 */ 911 */
911dma_addr_t 912static dma_addr_t sba_map_page(struct device *dev, struct page *page,
912sba_map_single_attrs(struct device *dev, void *addr, size_t size, int dir, 913 unsigned long poff, size_t size,
913 struct dma_attrs *attrs) 914 enum dma_data_direction dir,
915 struct dma_attrs *attrs)
914{ 916{
915 struct ioc *ioc; 917 struct ioc *ioc;
918 void *addr = page_address(page) + poff;
916 dma_addr_t iovp; 919 dma_addr_t iovp;
917 dma_addr_t offset; 920 dma_addr_t offset;
918 u64 *pdir_start; 921 u64 *pdir_start;
@@ -990,7 +993,14 @@ sba_map_single_attrs(struct device *dev, void *addr, size_t size, int dir,
990#endif 993#endif
991 return SBA_IOVA(ioc, iovp, offset); 994 return SBA_IOVA(ioc, iovp, offset);
992} 995}
993EXPORT_SYMBOL(sba_map_single_attrs); 996
997static dma_addr_t sba_map_single_attrs(struct device *dev, void *addr,
998 size_t size, enum dma_data_direction dir,
999 struct dma_attrs *attrs)
1000{
1001 return sba_map_page(dev, virt_to_page(addr),
1002 (unsigned long)addr & ~PAGE_MASK, size, dir, attrs);
1003}
994 1004
995#ifdef ENABLE_MARK_CLEAN 1005#ifdef ENABLE_MARK_CLEAN
996static SBA_INLINE void 1006static SBA_INLINE void
@@ -1026,8 +1036,8 @@ sba_mark_clean(struct ioc *ioc, dma_addr_t iova, size_t size)
1026 * 1036 *
1027 * See Documentation/PCI/PCI-DMA-mapping.txt 1037 * See Documentation/PCI/PCI-DMA-mapping.txt
1028 */ 1038 */
1029void sba_unmap_single_attrs(struct device *dev, dma_addr_t iova, size_t size, 1039static void sba_unmap_page(struct device *dev, dma_addr_t iova, size_t size,
1030 int dir, struct dma_attrs *attrs) 1040 enum dma_data_direction dir, struct dma_attrs *attrs)
1031{ 1041{
1032 struct ioc *ioc; 1042 struct ioc *ioc;
1033#if DELAYED_RESOURCE_CNT > 0 1043#if DELAYED_RESOURCE_CNT > 0
@@ -1094,7 +1104,12 @@ void sba_unmap_single_attrs(struct device *dev, dma_addr_t iova, size_t size,
1094 spin_unlock_irqrestore(&ioc->res_lock, flags); 1104 spin_unlock_irqrestore(&ioc->res_lock, flags);
1095#endif /* DELAYED_RESOURCE_CNT == 0 */ 1105#endif /* DELAYED_RESOURCE_CNT == 0 */
1096} 1106}
1097EXPORT_SYMBOL(sba_unmap_single_attrs); 1107
1108void sba_unmap_single_attrs(struct device *dev, dma_addr_t iova, size_t size,
1109 enum dma_data_direction dir, struct dma_attrs *attrs)
1110{
1111 sba_unmap_page(dev, iova, size, dir, attrs);
1112}
1098 1113
1099/** 1114/**
1100 * sba_alloc_coherent - allocate/map shared mem for DMA 1115 * sba_alloc_coherent - allocate/map shared mem for DMA
@@ -1104,7 +1119,7 @@ EXPORT_SYMBOL(sba_unmap_single_attrs);
1104 * 1119 *
1105 * See Documentation/PCI/PCI-DMA-mapping.txt 1120 * See Documentation/PCI/PCI-DMA-mapping.txt
1106 */ 1121 */
1107void * 1122static void *
1108sba_alloc_coherent (struct device *dev, size_t size, dma_addr_t *dma_handle, gfp_t flags) 1123sba_alloc_coherent (struct device *dev, size_t size, dma_addr_t *dma_handle, gfp_t flags)
1109{ 1124{
1110 struct ioc *ioc; 1125 struct ioc *ioc;
@@ -1167,7 +1182,8 @@ sba_alloc_coherent (struct device *dev, size_t size, dma_addr_t *dma_handle, gfp
1167 * 1182 *
1168 * See Documentation/PCI/PCI-DMA-mapping.txt 1183 * See Documentation/PCI/PCI-DMA-mapping.txt
1169 */ 1184 */
1170void sba_free_coherent (struct device *dev, size_t size, void *vaddr, dma_addr_t dma_handle) 1185static void sba_free_coherent (struct device *dev, size_t size, void *vaddr,
1186 dma_addr_t dma_handle)
1171{ 1187{
1172 sba_unmap_single_attrs(dev, dma_handle, size, 0, NULL); 1188 sba_unmap_single_attrs(dev, dma_handle, size, 0, NULL);
1173 free_pages((unsigned long) vaddr, get_order(size)); 1189 free_pages((unsigned long) vaddr, get_order(size));
@@ -1422,8 +1438,9 @@ sba_coalesce_chunks(struct ioc *ioc, struct device *dev,
1422 * 1438 *
1423 * See Documentation/PCI/PCI-DMA-mapping.txt 1439 * See Documentation/PCI/PCI-DMA-mapping.txt
1424 */ 1440 */
1425int sba_map_sg_attrs(struct device *dev, struct scatterlist *sglist, int nents, 1441static int sba_map_sg_attrs(struct device *dev, struct scatterlist *sglist,
1426 int dir, struct dma_attrs *attrs) 1442 int nents, enum dma_data_direction dir,
1443 struct dma_attrs *attrs)
1427{ 1444{
1428 struct ioc *ioc; 1445 struct ioc *ioc;
1429 int coalesced, filled = 0; 1446 int coalesced, filled = 0;
@@ -1502,7 +1519,6 @@ int sba_map_sg_attrs(struct device *dev, struct scatterlist *sglist, int nents,
1502 1519
1503 return filled; 1520 return filled;
1504} 1521}
1505EXPORT_SYMBOL(sba_map_sg_attrs);
1506 1522
1507/** 1523/**
1508 * sba_unmap_sg_attrs - unmap Scatter/Gather list 1524 * sba_unmap_sg_attrs - unmap Scatter/Gather list
@@ -1514,8 +1530,9 @@ EXPORT_SYMBOL(sba_map_sg_attrs);
1514 * 1530 *
1515 * See Documentation/PCI/PCI-DMA-mapping.txt 1531 * See Documentation/PCI/PCI-DMA-mapping.txt
1516 */ 1532 */
1517void sba_unmap_sg_attrs(struct device *dev, struct scatterlist *sglist, 1533static void sba_unmap_sg_attrs(struct device *dev, struct scatterlist *sglist,
1518 int nents, int dir, struct dma_attrs *attrs) 1534 int nents, enum dma_data_direction dir,
1535 struct dma_attrs *attrs)
1519{ 1536{
1520#ifdef ASSERT_PDIR_SANITY 1537#ifdef ASSERT_PDIR_SANITY
1521 struct ioc *ioc; 1538 struct ioc *ioc;
@@ -1551,7 +1568,6 @@ void sba_unmap_sg_attrs(struct device *dev, struct scatterlist *sglist,
1551#endif 1568#endif
1552 1569
1553} 1570}
1554EXPORT_SYMBOL(sba_unmap_sg_attrs);
1555 1571
1556/************************************************************** 1572/**************************************************************
1557* 1573*
@@ -2064,6 +2080,8 @@ static struct acpi_driver acpi_sba_ioc_driver = {
2064 }, 2080 },
2065}; 2081};
2066 2082
2083extern struct dma_map_ops swiotlb_dma_ops;
2084
2067static int __init 2085static int __init
2068sba_init(void) 2086sba_init(void)
2069{ 2087{
@@ -2077,6 +2095,7 @@ sba_init(void)
2077 * a successful kdump kernel boot is to use the swiotlb. 2095 * a successful kdump kernel boot is to use the swiotlb.
2078 */ 2096 */
2079 if (is_kdump_kernel()) { 2097 if (is_kdump_kernel()) {
2098 dma_ops = &swiotlb_dma_ops;
2080 if (swiotlb_late_init_with_default_size(64 * (1<<20)) != 0) 2099 if (swiotlb_late_init_with_default_size(64 * (1<<20)) != 0)
2081 panic("Unable to initialize software I/O TLB:" 2100 panic("Unable to initialize software I/O TLB:"
2082 " Try machvec=dig boot option"); 2101 " Try machvec=dig boot option");
@@ -2092,6 +2111,7 @@ sba_init(void)
2092 * If we didn't find something sba_iommu can claim, we 2111 * If we didn't find something sba_iommu can claim, we
2093 * need to setup the swiotlb and switch to the dig machvec. 2112 * need to setup the swiotlb and switch to the dig machvec.
2094 */ 2113 */
2114 dma_ops = &swiotlb_dma_ops;
2095 if (swiotlb_late_init_with_default_size(64 * (1<<20)) != 0) 2115 if (swiotlb_late_init_with_default_size(64 * (1<<20)) != 0)
2096 panic("Unable to find SBA IOMMU or initialize " 2116 panic("Unable to find SBA IOMMU or initialize "
2097 "software I/O TLB: Try machvec=dig boot option"); 2117 "software I/O TLB: Try machvec=dig boot option");
@@ -2138,15 +2158,13 @@ nosbagart(char *str)
2138 return 1; 2158 return 1;
2139} 2159}
2140 2160
2141int 2161static int sba_dma_supported (struct device *dev, u64 mask)
2142sba_dma_supported (struct device *dev, u64 mask)
2143{ 2162{
2144 /* make sure it's at least 32bit capable */ 2163 /* make sure it's at least 32bit capable */
2145 return ((mask & 0xFFFFFFFFUL) == 0xFFFFFFFFUL); 2164 return ((mask & 0xFFFFFFFFUL) == 0xFFFFFFFFUL);
2146} 2165}
2147 2166
2148int 2167static int sba_dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
2149sba_dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
2150{ 2168{
2151 return 0; 2169 return 0;
2152} 2170}
@@ -2176,7 +2194,22 @@ sba_page_override(char *str)
2176 2194
2177__setup("sbapagesize=",sba_page_override); 2195__setup("sbapagesize=",sba_page_override);
2178 2196
2179EXPORT_SYMBOL(sba_dma_mapping_error); 2197struct dma_map_ops sba_dma_ops = {
2180EXPORT_SYMBOL(sba_dma_supported); 2198 .alloc_coherent = sba_alloc_coherent,
2181EXPORT_SYMBOL(sba_alloc_coherent); 2199 .free_coherent = sba_free_coherent,
2182EXPORT_SYMBOL(sba_free_coherent); 2200 .map_page = sba_map_page,
2201 .unmap_page = sba_unmap_page,
2202 .map_sg = sba_map_sg_attrs,
2203 .unmap_sg = sba_unmap_sg_attrs,
2204 .sync_single_for_cpu = machvec_dma_sync_single,
2205 .sync_sg_for_cpu = machvec_dma_sync_sg,
2206 .sync_single_for_device = machvec_dma_sync_single,
2207 .sync_sg_for_device = machvec_dma_sync_sg,
2208 .dma_supported = sba_dma_supported,
2209 .mapping_error = sba_dma_mapping_error,
2210};
2211
2212void sba_dma_init(void)
2213{
2214 dma_ops = &sba_dma_ops;
2215}
diff --git a/arch/ia64/include/asm/dma-mapping.h b/arch/ia64/include/asm/dma-mapping.h
index 1f912d927585..36c0009dbece 100644
--- a/arch/ia64/include/asm/dma-mapping.h
+++ b/arch/ia64/include/asm/dma-mapping.h
@@ -11,99 +11,128 @@
11 11
12#define ARCH_HAS_DMA_GET_REQUIRED_MASK 12#define ARCH_HAS_DMA_GET_REQUIRED_MASK
13 13
14struct dma_mapping_ops { 14extern struct dma_map_ops *dma_ops;
15 int (*mapping_error)(struct device *dev,
16 dma_addr_t dma_addr);
17 void* (*alloc_coherent)(struct device *dev, size_t size,
18 dma_addr_t *dma_handle, gfp_t gfp);
19 void (*free_coherent)(struct device *dev, size_t size,
20 void *vaddr, dma_addr_t dma_handle);
21 dma_addr_t (*map_single)(struct device *hwdev, unsigned long ptr,
22 size_t size, int direction);
23 void (*unmap_single)(struct device *dev, dma_addr_t addr,
24 size_t size, int direction);
25 void (*sync_single_for_cpu)(struct device *hwdev,
26 dma_addr_t dma_handle, size_t size,
27 int direction);
28 void (*sync_single_for_device)(struct device *hwdev,
29 dma_addr_t dma_handle, size_t size,
30 int direction);
31 void (*sync_single_range_for_cpu)(struct device *hwdev,
32 dma_addr_t dma_handle, unsigned long offset,
33 size_t size, int direction);
34 void (*sync_single_range_for_device)(struct device *hwdev,
35 dma_addr_t dma_handle, unsigned long offset,
36 size_t size, int direction);
37 void (*sync_sg_for_cpu)(struct device *hwdev,
38 struct scatterlist *sg, int nelems,
39 int direction);
40 void (*sync_sg_for_device)(struct device *hwdev,
41 struct scatterlist *sg, int nelems,
42 int direction);
43 int (*map_sg)(struct device *hwdev, struct scatterlist *sg,
44 int nents, int direction);
45 void (*unmap_sg)(struct device *hwdev,
46 struct scatterlist *sg, int nents,
47 int direction);
48 int (*dma_supported_op)(struct device *hwdev, u64 mask);
49 int is_phys;
50};
51
52extern struct dma_mapping_ops *dma_ops;
53extern struct ia64_machine_vector ia64_mv; 15extern struct ia64_machine_vector ia64_mv;
54extern void set_iommu_machvec(void); 16extern void set_iommu_machvec(void);
55 17
56#define dma_alloc_coherent(dev, size, handle, gfp) \ 18extern void machvec_dma_sync_single(struct device *, dma_addr_t, size_t,
57 platform_dma_alloc_coherent(dev, size, handle, (gfp) | GFP_DMA) 19 enum dma_data_direction);
20extern void machvec_dma_sync_sg(struct device *, struct scatterlist *, int,
21 enum dma_data_direction);
58 22
59/* coherent mem. is cheap */ 23static inline void *dma_alloc_coherent(struct device *dev, size_t size,
60static inline void * 24 dma_addr_t *daddr, gfp_t gfp)
61dma_alloc_noncoherent(struct device *dev, size_t size, dma_addr_t *dma_handle,
62 gfp_t flag)
63{ 25{
64 return dma_alloc_coherent(dev, size, dma_handle, flag); 26 struct dma_map_ops *ops = platform_dma_get_ops(dev);
27 return ops->alloc_coherent(dev, size, daddr, gfp);
65} 28}
66#define dma_free_coherent platform_dma_free_coherent 29
67static inline void 30static inline void dma_free_coherent(struct device *dev, size_t size,
68dma_free_noncoherent(struct device *dev, size_t size, void *cpu_addr, 31 void *caddr, dma_addr_t daddr)
69 dma_addr_t dma_handle) 32{
33 struct dma_map_ops *ops = platform_dma_get_ops(dev);
34 ops->free_coherent(dev, size, caddr, daddr);
35}
36
37#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
38#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
39
40static inline dma_addr_t dma_map_single_attrs(struct device *dev,
41 void *caddr, size_t size,
42 enum dma_data_direction dir,
43 struct dma_attrs *attrs)
44{
45 struct dma_map_ops *ops = platform_dma_get_ops(dev);
46 return ops->map_page(dev, virt_to_page(caddr),
47 (unsigned long)caddr & ~PAGE_MASK, size,
48 dir, attrs);
49}
50
51static inline void dma_unmap_single_attrs(struct device *dev, dma_addr_t daddr,
52 size_t size,
53 enum dma_data_direction dir,
54 struct dma_attrs *attrs)
55{
56 struct dma_map_ops *ops = platform_dma_get_ops(dev);
57 ops->unmap_page(dev, daddr, size, dir, attrs);
58}
59
60#define dma_map_single(d, a, s, r) dma_map_single_attrs(d, a, s, r, NULL)
61#define dma_unmap_single(d, a, s, r) dma_unmap_single_attrs(d, a, s, r, NULL)
62
63static inline int dma_map_sg_attrs(struct device *dev, struct scatterlist *sgl,
64 int nents, enum dma_data_direction dir,
65 struct dma_attrs *attrs)
66{
67 struct dma_map_ops *ops = platform_dma_get_ops(dev);
68 return ops->map_sg(dev, sgl, nents, dir, attrs);
69}
70
71static inline void dma_unmap_sg_attrs(struct device *dev,
72 struct scatterlist *sgl, int nents,
73 enum dma_data_direction dir,
74 struct dma_attrs *attrs)
75{
76 struct dma_map_ops *ops = platform_dma_get_ops(dev);
77 ops->unmap_sg(dev, sgl, nents, dir, attrs);
78}
79
80#define dma_map_sg(d, s, n, r) dma_map_sg_attrs(d, s, n, r, NULL)
81#define dma_unmap_sg(d, s, n, r) dma_unmap_sg_attrs(d, s, n, r, NULL)
82
83static inline void dma_sync_single_for_cpu(struct device *dev, dma_addr_t daddr,
84 size_t size,
85 enum dma_data_direction dir)
70{ 86{
71 dma_free_coherent(dev, size, cpu_addr, dma_handle); 87 struct dma_map_ops *ops = platform_dma_get_ops(dev);
88 ops->sync_single_for_cpu(dev, daddr, size, dir);
72} 89}
73#define dma_map_single_attrs platform_dma_map_single_attrs 90
74static inline dma_addr_t dma_map_single(struct device *dev, void *cpu_addr, 91static inline void dma_sync_sg_for_cpu(struct device *dev,
75 size_t size, int dir) 92 struct scatterlist *sgl,
93 int nents, enum dma_data_direction dir)
76{ 94{
77 return dma_map_single_attrs(dev, cpu_addr, size, dir, NULL); 95 struct dma_map_ops *ops = platform_dma_get_ops(dev);
96 ops->sync_sg_for_cpu(dev, sgl, nents, dir);
78} 97}
79#define dma_map_sg_attrs platform_dma_map_sg_attrs 98
80static inline int dma_map_sg(struct device *dev, struct scatterlist *sgl, 99static inline void dma_sync_single_for_device(struct device *dev,
81 int nents, int dir) 100 dma_addr_t daddr,
101 size_t size,
102 enum dma_data_direction dir)
82{ 103{
83 return dma_map_sg_attrs(dev, sgl, nents, dir, NULL); 104 struct dma_map_ops *ops = platform_dma_get_ops(dev);
105 ops->sync_single_for_device(dev, daddr, size, dir);
84} 106}
85#define dma_unmap_single_attrs platform_dma_unmap_single_attrs 107
86static inline void dma_unmap_single(struct device *dev, dma_addr_t cpu_addr, 108static inline void dma_sync_sg_for_device(struct device *dev,
87 size_t size, int dir) 109 struct scatterlist *sgl,
110 int nents,
111 enum dma_data_direction dir)
88{ 112{
89 return dma_unmap_single_attrs(dev, cpu_addr, size, dir, NULL); 113 struct dma_map_ops *ops = platform_dma_get_ops(dev);
114 ops->sync_sg_for_device(dev, sgl, nents, dir);
90} 115}
91#define dma_unmap_sg_attrs platform_dma_unmap_sg_attrs 116
92static inline void dma_unmap_sg(struct device *dev, struct scatterlist *sgl, 117static inline int dma_mapping_error(struct device *dev, dma_addr_t daddr)
93 int nents, int dir) 118{
119 struct dma_map_ops *ops = platform_dma_get_ops(dev);
120 return ops->mapping_error(dev, daddr);
121}
122
123static inline dma_addr_t dma_map_page(struct device *dev, struct page *page,
124 size_t offset, size_t size,
125 enum dma_data_direction dir)
94{ 126{
95 return dma_unmap_sg_attrs(dev, sgl, nents, dir, NULL); 127 struct dma_map_ops *ops = platform_dma_get_ops(dev);
128 return ops->map_page(dev, page, offset, size, dir, NULL);
96} 129}
97#define dma_sync_single_for_cpu platform_dma_sync_single_for_cpu
98#define dma_sync_sg_for_cpu platform_dma_sync_sg_for_cpu
99#define dma_sync_single_for_device platform_dma_sync_single_for_device
100#define dma_sync_sg_for_device platform_dma_sync_sg_for_device
101#define dma_mapping_error platform_dma_mapping_error
102 130
103#define dma_map_page(dev, pg, off, size, dir) \ 131static inline void dma_unmap_page(struct device *dev, dma_addr_t addr,
104 dma_map_single(dev, page_address(pg) + (off), (size), (dir)) 132 size_t size, enum dma_data_direction dir)
105#define dma_unmap_page(dev, dma_addr, size, dir) \ 133{
106 dma_unmap_single(dev, dma_addr, size, dir) 134 dma_unmap_single(dev, addr, size, dir);
135}
107 136
108/* 137/*
109 * Rest of this file is part of the "Advanced DMA API". Use at your own risk. 138 * Rest of this file is part of the "Advanced DMA API". Use at your own risk.
@@ -115,7 +144,11 @@ static inline void dma_unmap_sg(struct device *dev, struct scatterlist *sgl,
115#define dma_sync_single_range_for_device(dev, dma_handle, offset, size, dir) \ 144#define dma_sync_single_range_for_device(dev, dma_handle, offset, size, dir) \
116 dma_sync_single_for_device(dev, dma_handle, size, dir) 145 dma_sync_single_for_device(dev, dma_handle, size, dir)
117 146
118#define dma_supported platform_dma_supported 147static inline int dma_supported(struct device *dev, u64 mask)
148{
149 struct dma_map_ops *ops = platform_dma_get_ops(dev);
150 return ops->dma_supported(dev, mask);
151}
119 152
120static inline int 153static inline int
121dma_set_mask (struct device *dev, u64 mask) 154dma_set_mask (struct device *dev, u64 mask)
@@ -141,11 +174,4 @@ dma_cache_sync (struct device *dev, void *vaddr, size_t size,
141 174
142#define dma_is_consistent(d, h) (1) /* all we do is coherent memory... */ 175#define dma_is_consistent(d, h) (1) /* all we do is coherent memory... */
143 176
144static inline struct dma_mapping_ops *get_dma_ops(struct device *dev)
145{
146 return dma_ops;
147}
148
149
150
151#endif /* _ASM_IA64_DMA_MAPPING_H */ 177#endif /* _ASM_IA64_DMA_MAPPING_H */
diff --git a/arch/ia64/include/asm/machvec.h b/arch/ia64/include/asm/machvec.h
index fe87b2121707..367d299d9938 100644
--- a/arch/ia64/include/asm/machvec.h
+++ b/arch/ia64/include/asm/machvec.h
@@ -11,7 +11,6 @@
11#define _ASM_IA64_MACHVEC_H 11#define _ASM_IA64_MACHVEC_H
12 12
13#include <linux/types.h> 13#include <linux/types.h>
14#include <linux/swiotlb.h>
15 14
16/* forward declarations: */ 15/* forward declarations: */
17struct device; 16struct device;
@@ -45,24 +44,8 @@ typedef void ia64_mv_kernel_launch_event_t(void);
45 44
46/* DMA-mapping interface: */ 45/* DMA-mapping interface: */
47typedef void ia64_mv_dma_init (void); 46typedef void ia64_mv_dma_init (void);
48typedef void *ia64_mv_dma_alloc_coherent (struct device *, size_t, dma_addr_t *, gfp_t);
49typedef void ia64_mv_dma_free_coherent (struct device *, size_t, void *, dma_addr_t);
50typedef dma_addr_t ia64_mv_dma_map_single (struct device *, void *, size_t, int);
51typedef void ia64_mv_dma_unmap_single (struct device *, dma_addr_t, size_t, int);
52typedef int ia64_mv_dma_map_sg (struct device *, struct scatterlist *, int, int);
53typedef void ia64_mv_dma_unmap_sg (struct device *, struct scatterlist *, int, int);
54typedef void ia64_mv_dma_sync_single_for_cpu (struct device *, dma_addr_t, size_t, int);
55typedef void ia64_mv_dma_sync_sg_for_cpu (struct device *, struct scatterlist *, int, int);
56typedef void ia64_mv_dma_sync_single_for_device (struct device *, dma_addr_t, size_t, int);
57typedef void ia64_mv_dma_sync_sg_for_device (struct device *, struct scatterlist *, int, int);
58typedef int ia64_mv_dma_mapping_error(struct device *, dma_addr_t dma_addr);
59typedef int ia64_mv_dma_supported (struct device *, u64);
60
61typedef dma_addr_t ia64_mv_dma_map_single_attrs (struct device *, void *, size_t, int, struct dma_attrs *);
62typedef void ia64_mv_dma_unmap_single_attrs (struct device *, dma_addr_t, size_t, int, struct dma_attrs *);
63typedef int ia64_mv_dma_map_sg_attrs (struct device *, struct scatterlist *, int, int, struct dma_attrs *);
64typedef void ia64_mv_dma_unmap_sg_attrs (struct device *, struct scatterlist *, int, int, struct dma_attrs *);
65typedef u64 ia64_mv_dma_get_required_mask (struct device *); 47typedef u64 ia64_mv_dma_get_required_mask (struct device *);
48typedef struct dma_map_ops *ia64_mv_dma_get_ops(struct device *);
66 49
67/* 50/*
68 * WARNING: The legacy I/O space is _architected_. Platforms are 51 * WARNING: The legacy I/O space is _architected_. Platforms are
@@ -114,8 +97,6 @@ machvec_noop_bus (struct pci_bus *bus)
114 97
115extern void machvec_setup (char **); 98extern void machvec_setup (char **);
116extern void machvec_timer_interrupt (int, void *); 99extern void machvec_timer_interrupt (int, void *);
117extern void machvec_dma_sync_single (struct device *, dma_addr_t, size_t, int);
118extern void machvec_dma_sync_sg (struct device *, struct scatterlist *, int, int);
119extern void machvec_tlb_migrate_finish (struct mm_struct *); 100extern void machvec_tlb_migrate_finish (struct mm_struct *);
120 101
121# if defined (CONFIG_IA64_HP_SIM) 102# if defined (CONFIG_IA64_HP_SIM)
@@ -148,19 +129,8 @@ extern void machvec_tlb_migrate_finish (struct mm_struct *);
148# define platform_global_tlb_purge ia64_mv.global_tlb_purge 129# define platform_global_tlb_purge ia64_mv.global_tlb_purge
149# define platform_tlb_migrate_finish ia64_mv.tlb_migrate_finish 130# define platform_tlb_migrate_finish ia64_mv.tlb_migrate_finish
150# define platform_dma_init ia64_mv.dma_init 131# define platform_dma_init ia64_mv.dma_init
151# define platform_dma_alloc_coherent ia64_mv.dma_alloc_coherent
152# define platform_dma_free_coherent ia64_mv.dma_free_coherent
153# define platform_dma_map_single_attrs ia64_mv.dma_map_single_attrs
154# define platform_dma_unmap_single_attrs ia64_mv.dma_unmap_single_attrs
155# define platform_dma_map_sg_attrs ia64_mv.dma_map_sg_attrs
156# define platform_dma_unmap_sg_attrs ia64_mv.dma_unmap_sg_attrs
157# define platform_dma_sync_single_for_cpu ia64_mv.dma_sync_single_for_cpu
158# define platform_dma_sync_sg_for_cpu ia64_mv.dma_sync_sg_for_cpu
159# define platform_dma_sync_single_for_device ia64_mv.dma_sync_single_for_device
160# define platform_dma_sync_sg_for_device ia64_mv.dma_sync_sg_for_device
161# define platform_dma_mapping_error ia64_mv.dma_mapping_error
162# define platform_dma_supported ia64_mv.dma_supported
163# define platform_dma_get_required_mask ia64_mv.dma_get_required_mask 132# define platform_dma_get_required_mask ia64_mv.dma_get_required_mask
133# define platform_dma_get_ops ia64_mv.dma_get_ops
164# define platform_irq_to_vector ia64_mv.irq_to_vector 134# define platform_irq_to_vector ia64_mv.irq_to_vector
165# define platform_local_vector_to_irq ia64_mv.local_vector_to_irq 135# define platform_local_vector_to_irq ia64_mv.local_vector_to_irq
166# define platform_pci_get_legacy_mem ia64_mv.pci_get_legacy_mem 136# define platform_pci_get_legacy_mem ia64_mv.pci_get_legacy_mem
@@ -203,19 +173,8 @@ struct ia64_machine_vector {
203 ia64_mv_global_tlb_purge_t *global_tlb_purge; 173 ia64_mv_global_tlb_purge_t *global_tlb_purge;
204 ia64_mv_tlb_migrate_finish_t *tlb_migrate_finish; 174 ia64_mv_tlb_migrate_finish_t *tlb_migrate_finish;
205 ia64_mv_dma_init *dma_init; 175 ia64_mv_dma_init *dma_init;
206 ia64_mv_dma_alloc_coherent *dma_alloc_coherent;
207 ia64_mv_dma_free_coherent *dma_free_coherent;
208 ia64_mv_dma_map_single_attrs *dma_map_single_attrs;
209 ia64_mv_dma_unmap_single_attrs *dma_unmap_single_attrs;
210 ia64_mv_dma_map_sg_attrs *dma_map_sg_attrs;
211 ia64_mv_dma_unmap_sg_attrs *dma_unmap_sg_attrs;
212 ia64_mv_dma_sync_single_for_cpu *dma_sync_single_for_cpu;
213 ia64_mv_dma_sync_sg_for_cpu *dma_sync_sg_for_cpu;
214 ia64_mv_dma_sync_single_for_device *dma_sync_single_for_device;
215 ia64_mv_dma_sync_sg_for_device *dma_sync_sg_for_device;
216 ia64_mv_dma_mapping_error *dma_mapping_error;
217 ia64_mv_dma_supported *dma_supported;
218 ia64_mv_dma_get_required_mask *dma_get_required_mask; 176 ia64_mv_dma_get_required_mask *dma_get_required_mask;
177 ia64_mv_dma_get_ops *dma_get_ops;
219 ia64_mv_irq_to_vector *irq_to_vector; 178 ia64_mv_irq_to_vector *irq_to_vector;
220 ia64_mv_local_vector_to_irq *local_vector_to_irq; 179 ia64_mv_local_vector_to_irq *local_vector_to_irq;
221 ia64_mv_pci_get_legacy_mem_t *pci_get_legacy_mem; 180 ia64_mv_pci_get_legacy_mem_t *pci_get_legacy_mem;
@@ -254,19 +213,8 @@ struct ia64_machine_vector {
254 platform_global_tlb_purge, \ 213 platform_global_tlb_purge, \
255 platform_tlb_migrate_finish, \ 214 platform_tlb_migrate_finish, \
256 platform_dma_init, \ 215 platform_dma_init, \
257 platform_dma_alloc_coherent, \
258 platform_dma_free_coherent, \
259 platform_dma_map_single_attrs, \
260 platform_dma_unmap_single_attrs, \
261 platform_dma_map_sg_attrs, \
262 platform_dma_unmap_sg_attrs, \
263 platform_dma_sync_single_for_cpu, \
264 platform_dma_sync_sg_for_cpu, \
265 platform_dma_sync_single_for_device, \
266 platform_dma_sync_sg_for_device, \
267 platform_dma_mapping_error, \
268 platform_dma_supported, \
269 platform_dma_get_required_mask, \ 216 platform_dma_get_required_mask, \
217 platform_dma_get_ops, \
270 platform_irq_to_vector, \ 218 platform_irq_to_vector, \
271 platform_local_vector_to_irq, \ 219 platform_local_vector_to_irq, \
272 platform_pci_get_legacy_mem, \ 220 platform_pci_get_legacy_mem, \
@@ -302,6 +250,9 @@ extern void machvec_init_from_cmdline(const char *cmdline);
302# error Unknown configuration. Update arch/ia64/include/asm/machvec.h. 250# error Unknown configuration. Update arch/ia64/include/asm/machvec.h.
303# endif /* CONFIG_IA64_GENERIC */ 251# endif /* CONFIG_IA64_GENERIC */
304 252
253extern void swiotlb_dma_init(void);
254extern struct dma_map_ops *dma_get_ops(struct device *);
255
305/* 256/*
306 * Define default versions so we can extend machvec for new platforms without having 257 * Define default versions so we can extend machvec for new platforms without having
307 * to update the machvec files for all existing platforms. 258 * to update the machvec files for all existing platforms.
@@ -332,43 +283,10 @@ extern void machvec_init_from_cmdline(const char *cmdline);
332# define platform_kernel_launch_event machvec_noop 283# define platform_kernel_launch_event machvec_noop
333#endif 284#endif
334#ifndef platform_dma_init 285#ifndef platform_dma_init
335# define platform_dma_init swiotlb_init 286# define platform_dma_init swiotlb_dma_init
336#endif
337#ifndef platform_dma_alloc_coherent
338# define platform_dma_alloc_coherent swiotlb_alloc_coherent
339#endif
340#ifndef platform_dma_free_coherent
341# define platform_dma_free_coherent swiotlb_free_coherent
342#endif
343#ifndef platform_dma_map_single_attrs
344# define platform_dma_map_single_attrs swiotlb_map_single_attrs
345#endif
346#ifndef platform_dma_unmap_single_attrs
347# define platform_dma_unmap_single_attrs swiotlb_unmap_single_attrs
348#endif
349#ifndef platform_dma_map_sg_attrs
350# define platform_dma_map_sg_attrs swiotlb_map_sg_attrs
351#endif
352#ifndef platform_dma_unmap_sg_attrs
353# define platform_dma_unmap_sg_attrs swiotlb_unmap_sg_attrs
354#endif
355#ifndef platform_dma_sync_single_for_cpu
356# define platform_dma_sync_single_for_cpu swiotlb_sync_single_for_cpu
357#endif
358#ifndef platform_dma_sync_sg_for_cpu
359# define platform_dma_sync_sg_for_cpu swiotlb_sync_sg_for_cpu
360#endif
361#ifndef platform_dma_sync_single_for_device
362# define platform_dma_sync_single_for_device swiotlb_sync_single_for_device
363#endif
364#ifndef platform_dma_sync_sg_for_device
365# define platform_dma_sync_sg_for_device swiotlb_sync_sg_for_device
366#endif
367#ifndef platform_dma_mapping_error
368# define platform_dma_mapping_error swiotlb_dma_mapping_error
369#endif 287#endif
370#ifndef platform_dma_supported 288#ifndef platform_dma_get_ops
371# define platform_dma_supported swiotlb_dma_supported 289# define platform_dma_get_ops dma_get_ops
372#endif 290#endif
373#ifndef platform_dma_get_required_mask 291#ifndef platform_dma_get_required_mask
374# define platform_dma_get_required_mask ia64_dma_get_required_mask 292# define platform_dma_get_required_mask ia64_dma_get_required_mask
diff --git a/arch/ia64/include/asm/machvec_dig_vtd.h b/arch/ia64/include/asm/machvec_dig_vtd.h
index 3400b561e711..6ab1de5c45ef 100644
--- a/arch/ia64/include/asm/machvec_dig_vtd.h
+++ b/arch/ia64/include/asm/machvec_dig_vtd.h
@@ -2,14 +2,6 @@
2#define _ASM_IA64_MACHVEC_DIG_VTD_h 2#define _ASM_IA64_MACHVEC_DIG_VTD_h
3 3
4extern ia64_mv_setup_t dig_setup; 4extern ia64_mv_setup_t dig_setup;
5extern ia64_mv_dma_alloc_coherent vtd_alloc_coherent;
6extern ia64_mv_dma_free_coherent vtd_free_coherent;
7extern ia64_mv_dma_map_single_attrs vtd_map_single_attrs;
8extern ia64_mv_dma_unmap_single_attrs vtd_unmap_single_attrs;
9extern ia64_mv_dma_map_sg_attrs vtd_map_sg_attrs;
10extern ia64_mv_dma_unmap_sg_attrs vtd_unmap_sg_attrs;
11extern ia64_mv_dma_supported iommu_dma_supported;
12extern ia64_mv_dma_mapping_error vtd_dma_mapping_error;
13extern ia64_mv_dma_init pci_iommu_alloc; 5extern ia64_mv_dma_init pci_iommu_alloc;
14 6
15/* 7/*
@@ -22,17 +14,5 @@ extern ia64_mv_dma_init pci_iommu_alloc;
22#define platform_name "dig_vtd" 14#define platform_name "dig_vtd"
23#define platform_setup dig_setup 15#define platform_setup dig_setup
24#define platform_dma_init pci_iommu_alloc 16#define platform_dma_init pci_iommu_alloc
25#define platform_dma_alloc_coherent vtd_alloc_coherent
26#define platform_dma_free_coherent vtd_free_coherent
27#define platform_dma_map_single_attrs vtd_map_single_attrs
28#define platform_dma_unmap_single_attrs vtd_unmap_single_attrs
29#define platform_dma_map_sg_attrs vtd_map_sg_attrs
30#define platform_dma_unmap_sg_attrs vtd_unmap_sg_attrs
31#define platform_dma_sync_single_for_cpu machvec_dma_sync_single
32#define platform_dma_sync_sg_for_cpu machvec_dma_sync_sg
33#define platform_dma_sync_single_for_device machvec_dma_sync_single
34#define platform_dma_sync_sg_for_device machvec_dma_sync_sg
35#define platform_dma_supported iommu_dma_supported
36#define platform_dma_mapping_error vtd_dma_mapping_error
37 17
38#endif /* _ASM_IA64_MACHVEC_DIG_VTD_h */ 18#endif /* _ASM_IA64_MACHVEC_DIG_VTD_h */
diff --git a/arch/ia64/include/asm/machvec_hpzx1.h b/arch/ia64/include/asm/machvec_hpzx1.h
index 2f57f5144b9f..3bd83d78a412 100644
--- a/arch/ia64/include/asm/machvec_hpzx1.h
+++ b/arch/ia64/include/asm/machvec_hpzx1.h
@@ -2,14 +2,7 @@
2#define _ASM_IA64_MACHVEC_HPZX1_h 2#define _ASM_IA64_MACHVEC_HPZX1_h
3 3
4extern ia64_mv_setup_t dig_setup; 4extern ia64_mv_setup_t dig_setup;
5extern ia64_mv_dma_alloc_coherent sba_alloc_coherent; 5extern ia64_mv_dma_init sba_dma_init;
6extern ia64_mv_dma_free_coherent sba_free_coherent;
7extern ia64_mv_dma_map_single_attrs sba_map_single_attrs;
8extern ia64_mv_dma_unmap_single_attrs sba_unmap_single_attrs;
9extern ia64_mv_dma_map_sg_attrs sba_map_sg_attrs;
10extern ia64_mv_dma_unmap_sg_attrs sba_unmap_sg_attrs;
11extern ia64_mv_dma_supported sba_dma_supported;
12extern ia64_mv_dma_mapping_error sba_dma_mapping_error;
13 6
14/* 7/*
15 * This stuff has dual use! 8 * This stuff has dual use!
@@ -20,18 +13,6 @@ extern ia64_mv_dma_mapping_error sba_dma_mapping_error;
20 */ 13 */
21#define platform_name "hpzx1" 14#define platform_name "hpzx1"
22#define platform_setup dig_setup 15#define platform_setup dig_setup
23#define platform_dma_init machvec_noop 16#define platform_dma_init sba_dma_init
24#define platform_dma_alloc_coherent sba_alloc_coherent
25#define platform_dma_free_coherent sba_free_coherent
26#define platform_dma_map_single_attrs sba_map_single_attrs
27#define platform_dma_unmap_single_attrs sba_unmap_single_attrs
28#define platform_dma_map_sg_attrs sba_map_sg_attrs
29#define platform_dma_unmap_sg_attrs sba_unmap_sg_attrs
30#define platform_dma_sync_single_for_cpu machvec_dma_sync_single
31#define platform_dma_sync_sg_for_cpu machvec_dma_sync_sg
32#define platform_dma_sync_single_for_device machvec_dma_sync_single
33#define platform_dma_sync_sg_for_device machvec_dma_sync_sg
34#define platform_dma_supported sba_dma_supported
35#define platform_dma_mapping_error sba_dma_mapping_error
36 17
37#endif /* _ASM_IA64_MACHVEC_HPZX1_h */ 18#endif /* _ASM_IA64_MACHVEC_HPZX1_h */
diff --git a/arch/ia64/include/asm/machvec_hpzx1_swiotlb.h b/arch/ia64/include/asm/machvec_hpzx1_swiotlb.h
index a842cdda827b..1091ac39740c 100644
--- a/arch/ia64/include/asm/machvec_hpzx1_swiotlb.h
+++ b/arch/ia64/include/asm/machvec_hpzx1_swiotlb.h
@@ -2,18 +2,7 @@
2#define _ASM_IA64_MACHVEC_HPZX1_SWIOTLB_h 2#define _ASM_IA64_MACHVEC_HPZX1_SWIOTLB_h
3 3
4extern ia64_mv_setup_t dig_setup; 4extern ia64_mv_setup_t dig_setup;
5extern ia64_mv_dma_alloc_coherent hwsw_alloc_coherent; 5extern ia64_mv_dma_get_ops hwsw_dma_get_ops;
6extern ia64_mv_dma_free_coherent hwsw_free_coherent;
7extern ia64_mv_dma_map_single_attrs hwsw_map_single_attrs;
8extern ia64_mv_dma_unmap_single_attrs hwsw_unmap_single_attrs;
9extern ia64_mv_dma_map_sg_attrs hwsw_map_sg_attrs;
10extern ia64_mv_dma_unmap_sg_attrs hwsw_unmap_sg_attrs;
11extern ia64_mv_dma_supported hwsw_dma_supported;
12extern ia64_mv_dma_mapping_error hwsw_dma_mapping_error;
13extern ia64_mv_dma_sync_single_for_cpu hwsw_sync_single_for_cpu;
14extern ia64_mv_dma_sync_sg_for_cpu hwsw_sync_sg_for_cpu;
15extern ia64_mv_dma_sync_single_for_device hwsw_sync_single_for_device;
16extern ia64_mv_dma_sync_sg_for_device hwsw_sync_sg_for_device;
17 6
18/* 7/*
19 * This stuff has dual use! 8 * This stuff has dual use!
@@ -23,20 +12,8 @@ extern ia64_mv_dma_sync_sg_for_device hwsw_sync_sg_for_device;
23 * the macros are used directly. 12 * the macros are used directly.
24 */ 13 */
25#define platform_name "hpzx1_swiotlb" 14#define platform_name "hpzx1_swiotlb"
26
27#define platform_setup dig_setup 15#define platform_setup dig_setup
28#define platform_dma_init machvec_noop 16#define platform_dma_init machvec_noop
29#define platform_dma_alloc_coherent hwsw_alloc_coherent 17#define platform_dma_get_ops hwsw_dma_get_ops
30#define platform_dma_free_coherent hwsw_free_coherent
31#define platform_dma_map_single_attrs hwsw_map_single_attrs
32#define platform_dma_unmap_single_attrs hwsw_unmap_single_attrs
33#define platform_dma_map_sg_attrs hwsw_map_sg_attrs
34#define platform_dma_unmap_sg_attrs hwsw_unmap_sg_attrs
35#define platform_dma_supported hwsw_dma_supported
36#define platform_dma_mapping_error hwsw_dma_mapping_error
37#define platform_dma_sync_single_for_cpu hwsw_sync_single_for_cpu
38#define platform_dma_sync_sg_for_cpu hwsw_sync_sg_for_cpu
39#define platform_dma_sync_single_for_device hwsw_sync_single_for_device
40#define platform_dma_sync_sg_for_device hwsw_sync_sg_for_device
41 18
42#endif /* _ASM_IA64_MACHVEC_HPZX1_SWIOTLB_h */ 19#endif /* _ASM_IA64_MACHVEC_HPZX1_SWIOTLB_h */
diff --git a/arch/ia64/include/asm/machvec_sn2.h b/arch/ia64/include/asm/machvec_sn2.h
index f1a6e0d6dfa5..f061a30aac42 100644
--- a/arch/ia64/include/asm/machvec_sn2.h
+++ b/arch/ia64/include/asm/machvec_sn2.h
@@ -55,19 +55,8 @@ extern ia64_mv_readb_t __sn_readb_relaxed;
55extern ia64_mv_readw_t __sn_readw_relaxed; 55extern ia64_mv_readw_t __sn_readw_relaxed;
56extern ia64_mv_readl_t __sn_readl_relaxed; 56extern ia64_mv_readl_t __sn_readl_relaxed;
57extern ia64_mv_readq_t __sn_readq_relaxed; 57extern ia64_mv_readq_t __sn_readq_relaxed;
58extern ia64_mv_dma_alloc_coherent sn_dma_alloc_coherent;
59extern ia64_mv_dma_free_coherent sn_dma_free_coherent;
60extern ia64_mv_dma_map_single_attrs sn_dma_map_single_attrs;
61extern ia64_mv_dma_unmap_single_attrs sn_dma_unmap_single_attrs;
62extern ia64_mv_dma_map_sg_attrs sn_dma_map_sg_attrs;
63extern ia64_mv_dma_unmap_sg_attrs sn_dma_unmap_sg_attrs;
64extern ia64_mv_dma_sync_single_for_cpu sn_dma_sync_single_for_cpu;
65extern ia64_mv_dma_sync_sg_for_cpu sn_dma_sync_sg_for_cpu;
66extern ia64_mv_dma_sync_single_for_device sn_dma_sync_single_for_device;
67extern ia64_mv_dma_sync_sg_for_device sn_dma_sync_sg_for_device;
68extern ia64_mv_dma_mapping_error sn_dma_mapping_error;
69extern ia64_mv_dma_supported sn_dma_supported;
70extern ia64_mv_dma_get_required_mask sn_dma_get_required_mask; 58extern ia64_mv_dma_get_required_mask sn_dma_get_required_mask;
59extern ia64_mv_dma_init sn_dma_init;
71extern ia64_mv_migrate_t sn_migrate; 60extern ia64_mv_migrate_t sn_migrate;
72extern ia64_mv_kernel_launch_event_t sn_kernel_launch_event; 61extern ia64_mv_kernel_launch_event_t sn_kernel_launch_event;
73extern ia64_mv_setup_msi_irq_t sn_setup_msi_irq; 62extern ia64_mv_setup_msi_irq_t sn_setup_msi_irq;
@@ -111,20 +100,8 @@ extern ia64_mv_pci_fixup_bus_t sn_pci_fixup_bus;
111#define platform_pci_get_legacy_mem sn_pci_get_legacy_mem 100#define platform_pci_get_legacy_mem sn_pci_get_legacy_mem
112#define platform_pci_legacy_read sn_pci_legacy_read 101#define platform_pci_legacy_read sn_pci_legacy_read
113#define platform_pci_legacy_write sn_pci_legacy_write 102#define platform_pci_legacy_write sn_pci_legacy_write
114#define platform_dma_init machvec_noop
115#define platform_dma_alloc_coherent sn_dma_alloc_coherent
116#define platform_dma_free_coherent sn_dma_free_coherent
117#define platform_dma_map_single_attrs sn_dma_map_single_attrs
118#define platform_dma_unmap_single_attrs sn_dma_unmap_single_attrs
119#define platform_dma_map_sg_attrs sn_dma_map_sg_attrs
120#define platform_dma_unmap_sg_attrs sn_dma_unmap_sg_attrs
121#define platform_dma_sync_single_for_cpu sn_dma_sync_single_for_cpu
122#define platform_dma_sync_sg_for_cpu sn_dma_sync_sg_for_cpu
123#define platform_dma_sync_single_for_device sn_dma_sync_single_for_device
124#define platform_dma_sync_sg_for_device sn_dma_sync_sg_for_device
125#define platform_dma_mapping_error sn_dma_mapping_error
126#define platform_dma_supported sn_dma_supported
127#define platform_dma_get_required_mask sn_dma_get_required_mask 103#define platform_dma_get_required_mask sn_dma_get_required_mask
104#define platform_dma_init sn_dma_init
128#define platform_migrate sn_migrate 105#define platform_migrate sn_migrate
129#define platform_kernel_launch_event sn_kernel_launch_event 106#define platform_kernel_launch_event sn_kernel_launch_event
130#ifdef CONFIG_PCI_MSI 107#ifdef CONFIG_PCI_MSI
diff --git a/arch/ia64/include/asm/topology.h b/arch/ia64/include/asm/topology.h
index 3193f4417e16..f260dcf21515 100644
--- a/arch/ia64/include/asm/topology.h
+++ b/arch/ia64/include/asm/topology.h
@@ -44,11 +44,6 @@
44#define parent_node(nid) (nid) 44#define parent_node(nid) (nid)
45 45
46/* 46/*
47 * Returns the number of the first CPU on Node 'node'.
48 */
49#define node_to_first_cpu(node) (cpumask_first(cpumask_of_node(node)))
50
51/*
52 * Determines the node for a given pci bus 47 * Determines the node for a given pci bus
53 */ 48 */
54#define pcibus_to_node(bus) PCI_CONTROLLER(bus)->node 49#define pcibus_to_node(bus) PCI_CONTROLLER(bus)->node
diff --git a/arch/ia64/kernel/Makefile b/arch/ia64/kernel/Makefile
index c381ea954892..f2778f2c4fd9 100644
--- a/arch/ia64/kernel/Makefile
+++ b/arch/ia64/kernel/Makefile
@@ -7,7 +7,7 @@ extra-y := head.o init_task.o vmlinux.lds
7obj-y := acpi.o entry.o efi.o efi_stub.o gate-data.o fsys.o ia64_ksyms.o irq.o irq_ia64.o \ 7obj-y := acpi.o entry.o efi.o efi_stub.o gate-data.o fsys.o ia64_ksyms.o irq.o irq_ia64.o \
8 irq_lsapic.o ivt.o machvec.o pal.o patch.o process.o perfmon.o ptrace.o sal.o \ 8 irq_lsapic.o ivt.o machvec.o pal.o patch.o process.o perfmon.o ptrace.o sal.o \
9 salinfo.o setup.o signal.o sys_ia64.o time.o traps.o unaligned.o \ 9 salinfo.o setup.o signal.o sys_ia64.o time.o traps.o unaligned.o \
10 unwind.o mca.o mca_asm.o topology.o 10 unwind.o mca.o mca_asm.o topology.o dma-mapping.o
11 11
12obj-$(CONFIG_IA64_BRL_EMU) += brl_emu.o 12obj-$(CONFIG_IA64_BRL_EMU) += brl_emu.o
13obj-$(CONFIG_IA64_GENERIC) += acpi-ext.o 13obj-$(CONFIG_IA64_GENERIC) += acpi-ext.o
@@ -43,9 +43,7 @@ ifneq ($(CONFIG_IA64_ESI),)
43obj-y += esi_stub.o # must be in kernel proper 43obj-y += esi_stub.o # must be in kernel proper
44endif 44endif
45obj-$(CONFIG_DMAR) += pci-dma.o 45obj-$(CONFIG_DMAR) += pci-dma.o
46ifeq ($(CONFIG_DMAR), y)
47obj-$(CONFIG_SWIOTLB) += pci-swiotlb.o 46obj-$(CONFIG_SWIOTLB) += pci-swiotlb.o
48endif
49 47
50# The gate DSO image is built using a special linker script. 48# The gate DSO image is built using a special linker script.
51targets += gate.so gate-syms.o 49targets += gate.so gate-syms.o
diff --git a/arch/ia64/kernel/dma-mapping.c b/arch/ia64/kernel/dma-mapping.c
new file mode 100644
index 000000000000..086a2aeb0404
--- /dev/null
+++ b/arch/ia64/kernel/dma-mapping.c
@@ -0,0 +1,13 @@
1#include <linux/dma-mapping.h>
2
3/* Set this to 1 if there is a HW IOMMU in the system */
4int iommu_detected __read_mostly;
5
6struct dma_map_ops *dma_ops;
7EXPORT_SYMBOL(dma_ops);
8
9struct dma_map_ops *dma_get_ops(struct device *dev)
10{
11 return dma_ops;
12}
13EXPORT_SYMBOL(dma_get_ops);
diff --git a/arch/ia64/kernel/machvec.c b/arch/ia64/kernel/machvec.c
index 7ccb228ceedc..d41a40ef80c0 100644
--- a/arch/ia64/kernel/machvec.c
+++ b/arch/ia64/kernel/machvec.c
@@ -1,5 +1,5 @@
1#include <linux/module.h> 1#include <linux/module.h>
2 2#include <linux/dma-mapping.h>
3#include <asm/machvec.h> 3#include <asm/machvec.h>
4#include <asm/system.h> 4#include <asm/system.h>
5 5
@@ -75,14 +75,16 @@ machvec_timer_interrupt (int irq, void *dev_id)
75EXPORT_SYMBOL(machvec_timer_interrupt); 75EXPORT_SYMBOL(machvec_timer_interrupt);
76 76
77void 77void
78machvec_dma_sync_single (struct device *hwdev, dma_addr_t dma_handle, size_t size, int dir) 78machvec_dma_sync_single(struct device *hwdev, dma_addr_t dma_handle, size_t size,
79 enum dma_data_direction dir)
79{ 80{
80 mb(); 81 mb();
81} 82}
82EXPORT_SYMBOL(machvec_dma_sync_single); 83EXPORT_SYMBOL(machvec_dma_sync_single);
83 84
84void 85void
85machvec_dma_sync_sg (struct device *hwdev, struct scatterlist *sg, int n, int dir) 86machvec_dma_sync_sg(struct device *hwdev, struct scatterlist *sg, int n,
87 enum dma_data_direction dir)
86{ 88{
87 mb(); 89 mb();
88} 90}
diff --git a/arch/ia64/kernel/palinfo.c b/arch/ia64/kernel/palinfo.c
index e5c57f413ca2..a4f19c70aadd 100644
--- a/arch/ia64/kernel/palinfo.c
+++ b/arch/ia64/kernel/palinfo.c
@@ -1002,8 +1002,6 @@ create_palinfo_proc_entries(unsigned int cpu)
1002 *pdir = create_proc_read_entry( 1002 *pdir = create_proc_read_entry(
1003 palinfo_entries[j].name, 0, cpu_dir, 1003 palinfo_entries[j].name, 0, cpu_dir,
1004 palinfo_read_entry, (void *)f.value); 1004 palinfo_read_entry, (void *)f.value);
1005 if (*pdir)
1006 (*pdir)->owner = THIS_MODULE;
1007 pdir++; 1005 pdir++;
1008 } 1006 }
1009} 1007}
diff --git a/arch/ia64/kernel/pci-dma.c b/arch/ia64/kernel/pci-dma.c
index d0ada067a4af..e4cb443bb988 100644
--- a/arch/ia64/kernel/pci-dma.c
+++ b/arch/ia64/kernel/pci-dma.c
@@ -32,9 +32,6 @@ int force_iommu __read_mostly = 1;
32int force_iommu __read_mostly; 32int force_iommu __read_mostly;
33#endif 33#endif
34 34
35/* Set this to 1 if there is a HW IOMMU in the system */
36int iommu_detected __read_mostly;
37
38/* Dummy device used for NULL arguments (normally ISA). Better would 35/* Dummy device used for NULL arguments (normally ISA). Better would
39 be probably a smaller DMA mask, but this is bug-to-bug compatible 36 be probably a smaller DMA mask, but this is bug-to-bug compatible
40 to i386. */ 37 to i386. */
@@ -44,18 +41,7 @@ struct device fallback_dev = {
44 .dma_mask = &fallback_dev.coherent_dma_mask, 41 .dma_mask = &fallback_dev.coherent_dma_mask,
45}; 42};
46 43
47void __init pci_iommu_alloc(void) 44extern struct dma_map_ops intel_dma_ops;
48{
49 /*
50 * The order of these functions is important for
51 * fall-back/fail-over reasons
52 */
53 detect_intel_iommu();
54
55#ifdef CONFIG_SWIOTLB
56 pci_swiotlb_init();
57#endif
58}
59 45
60static int __init pci_iommu_init(void) 46static int __init pci_iommu_init(void)
61{ 47{
@@ -79,15 +65,12 @@ iommu_dma_init(void)
79 return; 65 return;
80} 66}
81 67
82struct dma_mapping_ops *dma_ops;
83EXPORT_SYMBOL(dma_ops);
84
85int iommu_dma_supported(struct device *dev, u64 mask) 68int iommu_dma_supported(struct device *dev, u64 mask)
86{ 69{
87 struct dma_mapping_ops *ops = get_dma_ops(dev); 70 struct dma_map_ops *ops = platform_dma_get_ops(dev);
88 71
89 if (ops->dma_supported_op) 72 if (ops->dma_supported)
90 return ops->dma_supported_op(dev, mask); 73 return ops->dma_supported(dev, mask);
91 74
92 /* Copied from i386. Doesn't make much sense, because it will 75 /* Copied from i386. Doesn't make much sense, because it will
93 only work for pci_alloc_coherent. 76 only work for pci_alloc_coherent.
@@ -116,4 +99,25 @@ int iommu_dma_supported(struct device *dev, u64 mask)
116} 99}
117EXPORT_SYMBOL(iommu_dma_supported); 100EXPORT_SYMBOL(iommu_dma_supported);
118 101
102void __init pci_iommu_alloc(void)
103{
104 dma_ops = &intel_dma_ops;
105
106 dma_ops->sync_single_for_cpu = machvec_dma_sync_single;
107 dma_ops->sync_sg_for_cpu = machvec_dma_sync_sg;
108 dma_ops->sync_single_for_device = machvec_dma_sync_single;
109 dma_ops->sync_sg_for_device = machvec_dma_sync_sg;
110 dma_ops->dma_supported = iommu_dma_supported;
111
112 /*
113 * The order of these functions is important for
114 * fall-back/fail-over reasons
115 */
116 detect_intel_iommu();
117
118#ifdef CONFIG_SWIOTLB
119 pci_swiotlb_init();
120#endif
121}
122
119#endif 123#endif
diff --git a/arch/ia64/kernel/pci-swiotlb.c b/arch/ia64/kernel/pci-swiotlb.c
index 16c50516dbc1..573f02c39a00 100644
--- a/arch/ia64/kernel/pci-swiotlb.c
+++ b/arch/ia64/kernel/pci-swiotlb.c
@@ -13,23 +13,37 @@
13int swiotlb __read_mostly; 13int swiotlb __read_mostly;
14EXPORT_SYMBOL(swiotlb); 14EXPORT_SYMBOL(swiotlb);
15 15
16struct dma_mapping_ops swiotlb_dma_ops = { 16static void *ia64_swiotlb_alloc_coherent(struct device *dev, size_t size,
17 .mapping_error = swiotlb_dma_mapping_error, 17 dma_addr_t *dma_handle, gfp_t gfp)
18 .alloc_coherent = swiotlb_alloc_coherent, 18{
19 if (dev->coherent_dma_mask != DMA_64BIT_MASK)
20 gfp |= GFP_DMA;
21 return swiotlb_alloc_coherent(dev, size, dma_handle, gfp);
22}
23
24struct dma_map_ops swiotlb_dma_ops = {
25 .alloc_coherent = ia64_swiotlb_alloc_coherent,
19 .free_coherent = swiotlb_free_coherent, 26 .free_coherent = swiotlb_free_coherent,
20 .map_single = swiotlb_map_single, 27 .map_page = swiotlb_map_page,
21 .unmap_single = swiotlb_unmap_single, 28 .unmap_page = swiotlb_unmap_page,
29 .map_sg = swiotlb_map_sg_attrs,
30 .unmap_sg = swiotlb_unmap_sg_attrs,
22 .sync_single_for_cpu = swiotlb_sync_single_for_cpu, 31 .sync_single_for_cpu = swiotlb_sync_single_for_cpu,
23 .sync_single_for_device = swiotlb_sync_single_for_device, 32 .sync_single_for_device = swiotlb_sync_single_for_device,
24 .sync_single_range_for_cpu = swiotlb_sync_single_range_for_cpu, 33 .sync_single_range_for_cpu = swiotlb_sync_single_range_for_cpu,
25 .sync_single_range_for_device = swiotlb_sync_single_range_for_device, 34 .sync_single_range_for_device = swiotlb_sync_single_range_for_device,
26 .sync_sg_for_cpu = swiotlb_sync_sg_for_cpu, 35 .sync_sg_for_cpu = swiotlb_sync_sg_for_cpu,
27 .sync_sg_for_device = swiotlb_sync_sg_for_device, 36 .sync_sg_for_device = swiotlb_sync_sg_for_device,
28 .map_sg = swiotlb_map_sg, 37 .dma_supported = swiotlb_dma_supported,
29 .unmap_sg = swiotlb_unmap_sg, 38 .mapping_error = swiotlb_dma_mapping_error,
30 .dma_supported_op = swiotlb_dma_supported,
31}; 39};
32 40
41void __init swiotlb_dma_init(void)
42{
43 dma_ops = &swiotlb_dma_ops;
44 swiotlb_init();
45}
46
33void __init pci_swiotlb_init(void) 47void __init pci_swiotlb_init(void)
34{ 48{
35 if (!iommu_detected) { 49 if (!iommu_detected) {
diff --git a/arch/ia64/sn/kernel/sn2/prominfo_proc.c b/arch/ia64/sn/kernel/sn2/prominfo_proc.c
index 4dcce3d0e04c..e63328818643 100644
--- a/arch/ia64/sn/kernel/sn2/prominfo_proc.c
+++ b/arch/ia64/sn/kernel/sn2/prominfo_proc.c
@@ -225,7 +225,6 @@ static struct proc_dir_entry *sgi_prominfo_entry;
225int __init prominfo_init(void) 225int __init prominfo_init(void)
226{ 226{
227 struct proc_dir_entry **entp; 227 struct proc_dir_entry **entp;
228 struct proc_dir_entry *p;
229 cnodeid_t cnodeid; 228 cnodeid_t cnodeid;
230 unsigned long nasid; 229 unsigned long nasid;
231 int size; 230 int size;
@@ -246,14 +245,10 @@ int __init prominfo_init(void)
246 sprintf(name, "node%d", cnodeid); 245 sprintf(name, "node%d", cnodeid);
247 *entp = proc_mkdir(name, sgi_prominfo_entry); 246 *entp = proc_mkdir(name, sgi_prominfo_entry);
248 nasid = cnodeid_to_nasid(cnodeid); 247 nasid = cnodeid_to_nasid(cnodeid);
249 p = create_proc_read_entry("fit", 0, *entp, read_fit_entry, 248 create_proc_read_entry("fit", 0, *entp, read_fit_entry,
250 (void *)nasid); 249 (void *)nasid);
251 if (p) 250 create_proc_read_entry("version", 0, *entp,
252 p->owner = THIS_MODULE;
253 p = create_proc_read_entry("version", 0, *entp,
254 read_version_entry, (void *)nasid); 251 read_version_entry, (void *)nasid);
255 if (p)
256 p->owner = THIS_MODULE;
257 entp++; 252 entp++;
258 } 253 }
259 254
diff --git a/arch/ia64/sn/pci/pci_dma.c b/arch/ia64/sn/pci/pci_dma.c
index 863f5017baae..8c130e8f00e1 100644
--- a/arch/ia64/sn/pci/pci_dma.c
+++ b/arch/ia64/sn/pci/pci_dma.c
@@ -10,7 +10,7 @@
10 */ 10 */
11 11
12#include <linux/module.h> 12#include <linux/module.h>
13#include <linux/dma-attrs.h> 13#include <linux/dma-mapping.h>
14#include <asm/dma.h> 14#include <asm/dma.h>
15#include <asm/sn/intr.h> 15#include <asm/sn/intr.h>
16#include <asm/sn/pcibus_provider_defs.h> 16#include <asm/sn/pcibus_provider_defs.h>
@@ -31,7 +31,7 @@
31 * this function. Of course, SN only supports devices that have 32 or more 31 * this function. Of course, SN only supports devices that have 32 or more
32 * address bits when using the PMU. 32 * address bits when using the PMU.
33 */ 33 */
34int sn_dma_supported(struct device *dev, u64 mask) 34static int sn_dma_supported(struct device *dev, u64 mask)
35{ 35{
36 BUG_ON(dev->bus != &pci_bus_type); 36 BUG_ON(dev->bus != &pci_bus_type);
37 37
@@ -39,7 +39,6 @@ int sn_dma_supported(struct device *dev, u64 mask)
39 return 0; 39 return 0;
40 return 1; 40 return 1;
41} 41}
42EXPORT_SYMBOL(sn_dma_supported);
43 42
44/** 43/**
45 * sn_dma_set_mask - set the DMA mask 44 * sn_dma_set_mask - set the DMA mask
@@ -75,8 +74,8 @@ EXPORT_SYMBOL(sn_dma_set_mask);
75 * queue for a SCSI controller). See Documentation/DMA-API.txt for 74 * queue for a SCSI controller). See Documentation/DMA-API.txt for
76 * more information. 75 * more information.
77 */ 76 */
78void *sn_dma_alloc_coherent(struct device *dev, size_t size, 77static void *sn_dma_alloc_coherent(struct device *dev, size_t size,
79 dma_addr_t * dma_handle, gfp_t flags) 78 dma_addr_t * dma_handle, gfp_t flags)
80{ 79{
81 void *cpuaddr; 80 void *cpuaddr;
82 unsigned long phys_addr; 81 unsigned long phys_addr;
@@ -124,7 +123,6 @@ void *sn_dma_alloc_coherent(struct device *dev, size_t size,
124 123
125 return cpuaddr; 124 return cpuaddr;
126} 125}
127EXPORT_SYMBOL(sn_dma_alloc_coherent);
128 126
129/** 127/**
130 * sn_pci_free_coherent - free memory associated with coherent DMAable region 128 * sn_pci_free_coherent - free memory associated with coherent DMAable region
@@ -136,8 +134,8 @@ EXPORT_SYMBOL(sn_dma_alloc_coherent);
136 * Frees the memory allocated by dma_alloc_coherent(), potentially unmapping 134 * Frees the memory allocated by dma_alloc_coherent(), potentially unmapping
137 * any associated IOMMU mappings. 135 * any associated IOMMU mappings.
138 */ 136 */
139void sn_dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, 137static void sn_dma_free_coherent(struct device *dev, size_t size, void *cpu_addr,
140 dma_addr_t dma_handle) 138 dma_addr_t dma_handle)
141{ 139{
142 struct pci_dev *pdev = to_pci_dev(dev); 140 struct pci_dev *pdev = to_pci_dev(dev);
143 struct sn_pcibus_provider *provider = SN_PCIDEV_BUSPROVIDER(pdev); 141 struct sn_pcibus_provider *provider = SN_PCIDEV_BUSPROVIDER(pdev);
@@ -147,7 +145,6 @@ void sn_dma_free_coherent(struct device *dev, size_t size, void *cpu_addr,
147 provider->dma_unmap(pdev, dma_handle, 0); 145 provider->dma_unmap(pdev, dma_handle, 0);
148 free_pages((unsigned long)cpu_addr, get_order(size)); 146 free_pages((unsigned long)cpu_addr, get_order(size));
149} 147}
150EXPORT_SYMBOL(sn_dma_free_coherent);
151 148
152/** 149/**
153 * sn_dma_map_single_attrs - map a single page for DMA 150 * sn_dma_map_single_attrs - map a single page for DMA
@@ -173,10 +170,12 @@ EXPORT_SYMBOL(sn_dma_free_coherent);
173 * TODO: simplify our interface; 170 * TODO: simplify our interface;
174 * figure out how to save dmamap handle so can use two step. 171 * figure out how to save dmamap handle so can use two step.
175 */ 172 */
176dma_addr_t sn_dma_map_single_attrs(struct device *dev, void *cpu_addr, 173static dma_addr_t sn_dma_map_page(struct device *dev, struct page *page,
177 size_t size, int direction, 174 unsigned long offset, size_t size,
178 struct dma_attrs *attrs) 175 enum dma_data_direction dir,
176 struct dma_attrs *attrs)
179{ 177{
178 void *cpu_addr = page_address(page) + offset;
180 dma_addr_t dma_addr; 179 dma_addr_t dma_addr;
181 unsigned long phys_addr; 180 unsigned long phys_addr;
182 struct pci_dev *pdev = to_pci_dev(dev); 181 struct pci_dev *pdev = to_pci_dev(dev);
@@ -201,7 +200,6 @@ dma_addr_t sn_dma_map_single_attrs(struct device *dev, void *cpu_addr,
201 } 200 }
202 return dma_addr; 201 return dma_addr;
203} 202}
204EXPORT_SYMBOL(sn_dma_map_single_attrs);
205 203
206/** 204/**
207 * sn_dma_unmap_single_attrs - unamp a DMA mapped page 205 * sn_dma_unmap_single_attrs - unamp a DMA mapped page
@@ -215,21 +213,20 @@ EXPORT_SYMBOL(sn_dma_map_single_attrs);
215 * by @dma_handle into the coherence domain. On SN, we're always cache 213 * by @dma_handle into the coherence domain. On SN, we're always cache
216 * coherent, so we just need to free any ATEs associated with this mapping. 214 * coherent, so we just need to free any ATEs associated with this mapping.
217 */ 215 */
218void sn_dma_unmap_single_attrs(struct device *dev, dma_addr_t dma_addr, 216static void sn_dma_unmap_page(struct device *dev, dma_addr_t dma_addr,
219 size_t size, int direction, 217 size_t size, enum dma_data_direction dir,
220 struct dma_attrs *attrs) 218 struct dma_attrs *attrs)
221{ 219{
222 struct pci_dev *pdev = to_pci_dev(dev); 220 struct pci_dev *pdev = to_pci_dev(dev);
223 struct sn_pcibus_provider *provider = SN_PCIDEV_BUSPROVIDER(pdev); 221 struct sn_pcibus_provider *provider = SN_PCIDEV_BUSPROVIDER(pdev);
224 222
225 BUG_ON(dev->bus != &pci_bus_type); 223 BUG_ON(dev->bus != &pci_bus_type);
226 224
227 provider->dma_unmap(pdev, dma_addr, direction); 225 provider->dma_unmap(pdev, dma_addr, dir);
228} 226}
229EXPORT_SYMBOL(sn_dma_unmap_single_attrs);
230 227
231/** 228/**
232 * sn_dma_unmap_sg_attrs - unmap a DMA scatterlist 229 * sn_dma_unmap_sg - unmap a DMA scatterlist
233 * @dev: device to unmap 230 * @dev: device to unmap
234 * @sg: scatterlist to unmap 231 * @sg: scatterlist to unmap
235 * @nhwentries: number of scatterlist entries 232 * @nhwentries: number of scatterlist entries
@@ -238,9 +235,9 @@ EXPORT_SYMBOL(sn_dma_unmap_single_attrs);
238 * 235 *
239 * Unmap a set of streaming mode DMA translations. 236 * Unmap a set of streaming mode DMA translations.
240 */ 237 */
241void sn_dma_unmap_sg_attrs(struct device *dev, struct scatterlist *sgl, 238static void sn_dma_unmap_sg(struct device *dev, struct scatterlist *sgl,
242 int nhwentries, int direction, 239 int nhwentries, enum dma_data_direction dir,
243 struct dma_attrs *attrs) 240 struct dma_attrs *attrs)
244{ 241{
245 int i; 242 int i;
246 struct pci_dev *pdev = to_pci_dev(dev); 243 struct pci_dev *pdev = to_pci_dev(dev);
@@ -250,15 +247,14 @@ void sn_dma_unmap_sg_attrs(struct device *dev, struct scatterlist *sgl,
250 BUG_ON(dev->bus != &pci_bus_type); 247 BUG_ON(dev->bus != &pci_bus_type);
251 248
252 for_each_sg(sgl, sg, nhwentries, i) { 249 for_each_sg(sgl, sg, nhwentries, i) {
253 provider->dma_unmap(pdev, sg->dma_address, direction); 250 provider->dma_unmap(pdev, sg->dma_address, dir);
254 sg->dma_address = (dma_addr_t) NULL; 251 sg->dma_address = (dma_addr_t) NULL;
255 sg->dma_length = 0; 252 sg->dma_length = 0;
256 } 253 }
257} 254}
258EXPORT_SYMBOL(sn_dma_unmap_sg_attrs);
259 255
260/** 256/**
261 * sn_dma_map_sg_attrs - map a scatterlist for DMA 257 * sn_dma_map_sg - map a scatterlist for DMA
262 * @dev: device to map for 258 * @dev: device to map for
263 * @sg: scatterlist to map 259 * @sg: scatterlist to map
264 * @nhwentries: number of entries 260 * @nhwentries: number of entries
@@ -272,8 +268,9 @@ EXPORT_SYMBOL(sn_dma_unmap_sg_attrs);
272 * 268 *
273 * Maps each entry of @sg for DMA. 269 * Maps each entry of @sg for DMA.
274 */ 270 */
275int sn_dma_map_sg_attrs(struct device *dev, struct scatterlist *sgl, 271static int sn_dma_map_sg(struct device *dev, struct scatterlist *sgl,
276 int nhwentries, int direction, struct dma_attrs *attrs) 272 int nhwentries, enum dma_data_direction dir,
273 struct dma_attrs *attrs)
277{ 274{
278 unsigned long phys_addr; 275 unsigned long phys_addr;
279 struct scatterlist *saved_sg = sgl, *sg; 276 struct scatterlist *saved_sg = sgl, *sg;
@@ -310,8 +307,7 @@ int sn_dma_map_sg_attrs(struct device *dev, struct scatterlist *sgl,
310 * Free any successfully allocated entries. 307 * Free any successfully allocated entries.
311 */ 308 */
312 if (i > 0) 309 if (i > 0)
313 sn_dma_unmap_sg_attrs(dev, saved_sg, i, 310 sn_dma_unmap_sg(dev, saved_sg, i, dir, attrs);
314 direction, attrs);
315 return 0; 311 return 0;
316 } 312 }
317 313
@@ -320,41 +316,36 @@ int sn_dma_map_sg_attrs(struct device *dev, struct scatterlist *sgl,
320 316
321 return nhwentries; 317 return nhwentries;
322} 318}
323EXPORT_SYMBOL(sn_dma_map_sg_attrs);
324 319
325void sn_dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, 320static void sn_dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle,
326 size_t size, int direction) 321 size_t size, enum dma_data_direction dir)
327{ 322{
328 BUG_ON(dev->bus != &pci_bus_type); 323 BUG_ON(dev->bus != &pci_bus_type);
329} 324}
330EXPORT_SYMBOL(sn_dma_sync_single_for_cpu);
331 325
332void sn_dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, 326static void sn_dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle,
333 size_t size, int direction) 327 size_t size,
328 enum dma_data_direction dir)
334{ 329{
335 BUG_ON(dev->bus != &pci_bus_type); 330 BUG_ON(dev->bus != &pci_bus_type);
336} 331}
337EXPORT_SYMBOL(sn_dma_sync_single_for_device);
338 332
339void sn_dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, 333static void sn_dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg,
340 int nelems, int direction) 334 int nelems, enum dma_data_direction dir)
341{ 335{
342 BUG_ON(dev->bus != &pci_bus_type); 336 BUG_ON(dev->bus != &pci_bus_type);
343} 337}
344EXPORT_SYMBOL(sn_dma_sync_sg_for_cpu);
345 338
346void sn_dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, 339static void sn_dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg,
347 int nelems, int direction) 340 int nelems, enum dma_data_direction dir)
348{ 341{
349 BUG_ON(dev->bus != &pci_bus_type); 342 BUG_ON(dev->bus != &pci_bus_type);
350} 343}
351EXPORT_SYMBOL(sn_dma_sync_sg_for_device);
352 344
353int sn_dma_mapping_error(struct device *dev, dma_addr_t dma_addr) 345static int sn_dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
354{ 346{
355 return 0; 347 return 0;
356} 348}
357EXPORT_SYMBOL(sn_dma_mapping_error);
358 349
359u64 sn_dma_get_required_mask(struct device *dev) 350u64 sn_dma_get_required_mask(struct device *dev)
360{ 351{
@@ -471,3 +462,23 @@ int sn_pci_legacy_write(struct pci_bus *bus, u16 port, u32 val, u8 size)
471 out: 462 out:
472 return ret; 463 return ret;
473} 464}
465
466static struct dma_map_ops sn_dma_ops = {
467 .alloc_coherent = sn_dma_alloc_coherent,
468 .free_coherent = sn_dma_free_coherent,
469 .map_page = sn_dma_map_page,
470 .unmap_page = sn_dma_unmap_page,
471 .map_sg = sn_dma_map_sg,
472 .unmap_sg = sn_dma_unmap_sg,
473 .sync_single_for_cpu = sn_dma_sync_single_for_cpu,
474 .sync_sg_for_cpu = sn_dma_sync_sg_for_cpu,
475 .sync_single_for_device = sn_dma_sync_single_for_device,
476 .sync_sg_for_device = sn_dma_sync_sg_for_device,
477 .mapping_error = sn_dma_mapping_error,
478 .dma_supported = sn_dma_supported,
479};
480
481void sn_dma_init(void)
482{
483 dma_ops = &sn_dma_ops;
484}
diff --git a/arch/m32r/kernel/time.c b/arch/m32r/kernel/time.c
index 6ea017727cce..cada3ba4b990 100644
--- a/arch/m32r/kernel/time.c
+++ b/arch/m32r/kernel/time.c
@@ -230,7 +230,6 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id)
230static struct irqaction irq0 = { 230static struct irqaction irq0 = {
231 .handler = timer_interrupt, 231 .handler = timer_interrupt,
232 .flags = IRQF_DISABLED, 232 .flags = IRQF_DISABLED,
233 .mask = CPU_MASK_NONE,
234 .name = "MFT2", 233 .name = "MFT2",
235}; 234};
236 235
diff --git a/arch/m68k/include/asm/ide.h b/arch/m68k/include/asm/ide.h
index b996a3c8cff5..3958726664ba 100644
--- a/arch/m68k/include/asm/ide.h
+++ b/arch/m68k/include/asm/ide.h
@@ -30,101 +30,28 @@
30#define _M68K_IDE_H 30#define _M68K_IDE_H
31 31
32#ifdef __KERNEL__ 32#ifdef __KERNEL__
33
34
35#include <asm/setup.h> 33#include <asm/setup.h>
36#include <asm/io.h> 34#include <asm/io.h>
37#include <asm/irq.h> 35#include <asm/irq.h>
38 36
39#ifdef CONFIG_ATARI
40#include <linux/interrupt.h>
41#include <asm/atari_stdma.h>
42#endif
43
44#ifdef CONFIG_MAC
45#include <asm/macints.h>
46#endif
47
48/* 37/*
49 * Get rid of defs from io.h - ide has its private and conflicting versions 38 * Get rid of defs from io.h - ide has its private and conflicting versions
50 * Since so far no single m68k platform uses ISA/PCI I/O space for IDE, we 39 * Since so far no single m68k platform uses ISA/PCI I/O space for IDE, we
51 * always use the `raw' MMIO versions 40 * always use the `raw' MMIO versions
52 */ 41 */
53#undef inb
54#undef inw
55#undef insw
56#undef inl
57#undef insl
58#undef outb
59#undef outw
60#undef outsw
61#undef outl
62#undef outsl
63#undef readb 42#undef readb
64#undef readw 43#undef readw
65#undef readl
66#undef writeb 44#undef writeb
67#undef writew 45#undef writew
68#undef writel
69 46
70#define inb in_8
71#define inw in_be16
72#define insw(port, addr, n) raw_insw((u16 *)port, addr, n)
73#define inl in_be32
74#define insl(port, addr, n) raw_insl((u32 *)port, addr, n)
75#define outb(val, port) out_8(port, val)
76#define outw(val, port) out_be16(port, val)
77#define outsw(port, addr, n) raw_outsw((u16 *)port, addr, n)
78#define outl(val, port) out_be32(port, val)
79#define outsl(port, addr, n) raw_outsl((u32 *)port, addr, n)
80#define readb in_8 47#define readb in_8
81#define readw in_be16 48#define readw in_be16
82#define __ide_mm_insw(port, addr, n) raw_insw((u16 *)port, addr, n) 49#define __ide_mm_insw(port, addr, n) raw_insw((u16 *)port, addr, n)
83#define readl in_be32
84#define __ide_mm_insl(port, addr, n) raw_insl((u32 *)port, addr, n) 50#define __ide_mm_insl(port, addr, n) raw_insl((u32 *)port, addr, n)
85#define writeb(val, port) out_8(port, val) 51#define writeb(val, port) out_8(port, val)
86#define writew(val, port) out_be16(port, val) 52#define writew(val, port) out_be16(port, val)
87#define __ide_mm_outsw(port, addr, n) raw_outsw((u16 *)port, addr, n) 53#define __ide_mm_outsw(port, addr, n) raw_outsw((u16 *)port, addr, n)
88#define writel(val, port) out_be32(port, val)
89#define __ide_mm_outsl(port, addr, n) raw_outsl((u32 *)port, addr, n) 54#define __ide_mm_outsl(port, addr, n) raw_outsl((u32 *)port, addr, n)
90#if defined(CONFIG_ATARI) || defined(CONFIG_Q40)
91#define insw_swapw(port, addr, n) raw_insw_swapw((u16 *)port, addr, n)
92#define outsw_swapw(port, addr, n) raw_outsw_swapw((u16 *)port, addr, n)
93#endif
94
95#ifdef CONFIG_BLK_DEV_FALCON_IDE
96#define IDE_ARCH_LOCK
97
98extern int falconide_intr_lock;
99
100static __inline__ void ide_release_lock (void)
101{
102 if (MACH_IS_ATARI) {
103 if (falconide_intr_lock == 0) {
104 printk("ide_release_lock: bug\n");
105 return;
106 }
107 falconide_intr_lock = 0;
108 stdma_release();
109 }
110}
111
112static __inline__ void
113ide_get_lock(irq_handler_t handler, void *data)
114{
115 if (MACH_IS_ATARI) {
116 if (falconide_intr_lock == 0) {
117 if (in_interrupt() > 0)
118 panic( "Falcon IDE hasn't ST-DMA lock in interrupt" );
119 stdma_lock(handler, data);
120 falconide_intr_lock = 1;
121 }
122 }
123}
124#endif /* CONFIG_BLK_DEV_FALCON_IDE */
125
126#define IDE_ARCH_ACK_INTR
127#define ide_ack_intr(hwif) ((hwif)->ack_intr ? (hwif)->ack_intr(hwif) : 1)
128 55
129#endif /* __KERNEL__ */ 56#endif /* __KERNEL__ */
130#endif /* _M68K_IDE_H */ 57#endif /* _M68K_IDE_H */
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 206cb7953b0c..dc787190430a 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -77,7 +77,6 @@ config MIPS_COBALT
77 select SYS_SUPPORTS_32BIT_KERNEL 77 select SYS_SUPPORTS_32BIT_KERNEL
78 select SYS_SUPPORTS_64BIT_KERNEL 78 select SYS_SUPPORTS_64BIT_KERNEL
79 select SYS_SUPPORTS_LITTLE_ENDIAN 79 select SYS_SUPPORTS_LITTLE_ENDIAN
80 select GENERIC_HARDIRQS_NO__DO_IRQ
81 80
82config MACH_DECSTATION 81config MACH_DECSTATION
83 bool "DECstations" 82 bool "DECstations"
@@ -132,7 +131,6 @@ config MACH_JAZZ
132 select SYS_SUPPORTS_32BIT_KERNEL 131 select SYS_SUPPORTS_32BIT_KERNEL
133 select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL 132 select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL
134 select SYS_SUPPORTS_100HZ 133 select SYS_SUPPORTS_100HZ
135 select GENERIC_HARDIRQS_NO__DO_IRQ
136 help 134 help
137 This a family of machines based on the MIPS R4030 chipset which was 135 This a family of machines based on the MIPS R4030 chipset which was
138 used by several vendors to build RISC/os and Windows NT workstations. 136 used by several vendors to build RISC/os and Windows NT workstations.
@@ -154,7 +152,6 @@ config LASAT
154 select SYS_SUPPORTS_32BIT_KERNEL 152 select SYS_SUPPORTS_32BIT_KERNEL
155 select SYS_SUPPORTS_64BIT_KERNEL if BROKEN 153 select SYS_SUPPORTS_64BIT_KERNEL if BROKEN
156 select SYS_SUPPORTS_LITTLE_ENDIAN 154 select SYS_SUPPORTS_LITTLE_ENDIAN
157 select GENERIC_HARDIRQS_NO__DO_IRQ
158 155
159config LEMOTE_FULONG 156config LEMOTE_FULONG
160 bool "Lemote Fulong mini-PC" 157 bool "Lemote Fulong mini-PC"
@@ -175,7 +172,6 @@ config LEMOTE_FULONG
175 select SYS_SUPPORTS_LITTLE_ENDIAN 172 select SYS_SUPPORTS_LITTLE_ENDIAN
176 select SYS_SUPPORTS_HIGHMEM 173 select SYS_SUPPORTS_HIGHMEM
177 select SYS_HAS_EARLY_PRINTK 174 select SYS_HAS_EARLY_PRINTK
178 select GENERIC_HARDIRQS_NO__DO_IRQ
179 select GENERIC_ISA_DMA_SUPPORT_BROKEN 175 select GENERIC_ISA_DMA_SUPPORT_BROKEN
180 select CPU_HAS_WB 176 select CPU_HAS_WB
181 help 177 help
@@ -250,7 +246,6 @@ config MACH_VR41XX
250 select CEVT_R4K 246 select CEVT_R4K
251 select CSRC_R4K 247 select CSRC_R4K
252 select SYS_HAS_CPU_VR41XX 248 select SYS_HAS_CPU_VR41XX
253 select GENERIC_HARDIRQS_NO__DO_IRQ
254 249
255config NXP_STB220 250config NXP_STB220
256 bool "NXP STB220 board" 251 bool "NXP STB220 board"
@@ -364,7 +359,6 @@ config SGI_IP27
364 select SYS_SUPPORTS_BIG_ENDIAN 359 select SYS_SUPPORTS_BIG_ENDIAN
365 select SYS_SUPPORTS_NUMA 360 select SYS_SUPPORTS_NUMA
366 select SYS_SUPPORTS_SMP 361 select SYS_SUPPORTS_SMP
367 select GENERIC_HARDIRQS_NO__DO_IRQ
368 help 362 help
369 This are the SGI Origin 200, Origin 2000 and Onyx 2 Graphics 363 This are the SGI Origin 200, Origin 2000 and Onyx 2 Graphics
370 workstations. To compile a Linux kernel that runs on these, say Y 364 workstations. To compile a Linux kernel that runs on these, say Y
@@ -563,7 +557,6 @@ config MIKROTIK_RB532
563 select CEVT_R4K 557 select CEVT_R4K
564 select CSRC_R4K 558 select CSRC_R4K
565 select DMA_NONCOHERENT 559 select DMA_NONCOHERENT
566 select GENERIC_HARDIRQS_NO__DO_IRQ
567 select HW_HAS_PCI 560 select HW_HAS_PCI
568 select IRQ_CPU 561 select IRQ_CPU
569 select SYS_HAS_CPU_MIPS32_R1 562 select SYS_HAS_CPU_MIPS32_R1
@@ -700,8 +693,7 @@ config SCHED_OMIT_FRAME_POINTER
700 default y 693 default y
701 694
702config GENERIC_HARDIRQS_NO__DO_IRQ 695config GENERIC_HARDIRQS_NO__DO_IRQ
703 bool 696 def_bool y
704 default n
705 697
706# 698#
707# Select some configuration options automatically based on user selections. 699# Select some configuration options automatically based on user selections.
@@ -920,7 +912,6 @@ config SOC_PNX833X
920 select SYS_SUPPORTS_32BIT_KERNEL 912 select SYS_SUPPORTS_32BIT_KERNEL
921 select SYS_SUPPORTS_LITTLE_ENDIAN 913 select SYS_SUPPORTS_LITTLE_ENDIAN
922 select SYS_SUPPORTS_BIG_ENDIAN 914 select SYS_SUPPORTS_BIG_ENDIAN
923 select GENERIC_HARDIRQS_NO__DO_IRQ
924 select GENERIC_GPIO 915 select GENERIC_GPIO
925 select CPU_MIPSR2_IRQ_VI 916 select CPU_MIPSR2_IRQ_VI
926 917
@@ -939,7 +930,6 @@ config SOC_PNX8550
939 select SYS_HAS_CPU_MIPS32_R1 930 select SYS_HAS_CPU_MIPS32_R1
940 select SYS_HAS_EARLY_PRINTK 931 select SYS_HAS_EARLY_PRINTK
941 select SYS_SUPPORTS_32BIT_KERNEL 932 select SYS_SUPPORTS_32BIT_KERNEL
942 select GENERIC_HARDIRQS_NO__DO_IRQ
943 select GENERIC_GPIO 933 select GENERIC_GPIO
944 934
945config SWAP_IO_SPACE 935config SWAP_IO_SPACE
diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index 22dab2e14348..8d544c7c9fe9 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -720,11 +720,17 @@ ifdef CONFIG_MIPS32_O32
720 $(Q)$(MAKE) $(build)=. missing-syscalls EXTRA_CFLAGS="-mabi=32" 720 $(Q)$(MAKE) $(build)=. missing-syscalls EXTRA_CFLAGS="-mabi=32"
721endif 721endif
722 722
723install:
724 $(Q)install -D -m 755 vmlinux $(INSTALL_PATH)/vmlinux-$(KERNELRELEASE)
725 $(Q)install -D -m 644 .config $(INSTALL_PATH)/config-$(KERNELRELEASE)
726 $(Q)install -D -m 644 System.map $(INSTALL_PATH)/System.map-$(KERNELRELEASE)
727
723archclean: 728archclean:
724 @$(MAKE) $(clean)=arch/mips/boot 729 @$(MAKE) $(clean)=arch/mips/boot
725 @$(MAKE) $(clean)=arch/mips/lasat 730 @$(MAKE) $(clean)=arch/mips/lasat
726 731
727define archhelp 732define archhelp
733 echo ' install - install kernel into $(INSTALL_PATH)'
728 echo ' vmlinux.ecoff - ECOFF boot image' 734 echo ' vmlinux.ecoff - ECOFF boot image'
729 echo ' vmlinux.bin - Raw binary boot image' 735 echo ' vmlinux.bin - Raw binary boot image'
730 echo ' vmlinux.srec - SREC boot image' 736 echo ' vmlinux.srec - SREC boot image'
diff --git a/arch/mips/alchemy/Kconfig b/arch/mips/alchemy/Kconfig
index 7f8ef13d0014..8128aebfb155 100644
--- a/arch/mips/alchemy/Kconfig
+++ b/arch/mips/alchemy/Kconfig
@@ -134,4 +134,4 @@ config SOC_AU1X00
134 select SYS_HAS_CPU_MIPS32_R1 134 select SYS_HAS_CPU_MIPS32_R1
135 select SYS_SUPPORTS_32BIT_KERNEL 135 select SYS_SUPPORTS_32BIT_KERNEL
136 select SYS_SUPPORTS_APM_EMULATION 136 select SYS_SUPPORTS_APM_EMULATION
137 select GENERIC_HARDIRQS_NO__DO_IRQ 137 select ARCH_REQUIRE_GPIOLIB
diff --git a/arch/mips/alchemy/common/gpio.c b/arch/mips/alchemy/common/gpio.c
index e660ddd611c4..91a9c4436c39 100644
--- a/arch/mips/alchemy/common/gpio.c
+++ b/arch/mips/alchemy/common/gpio.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2007, OpenWrt.org, Florian Fainelli <florian@openwrt.org> 2 * Copyright (C) 2007-2009, OpenWrt.org, Florian Fainelli <florian@openwrt.org>
3 * Architecture specific GPIO support 3 * Architecture specific GPIO support
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
@@ -27,122 +27,175 @@
27 * others have a second one : GPIO2 27 * others have a second one : GPIO2
28 */ 28 */
29 29
30#include <linux/kernel.h>
30#include <linux/module.h> 31#include <linux/module.h>
32#include <linux/types.h>
33#include <linux/platform_device.h>
34#include <linux/gpio.h>
31 35
32#include <asm/mach-au1x00/au1000.h> 36#include <asm/mach-au1x00/au1000.h>
33#include <asm/gpio.h> 37#include <asm/gpio.h>
34 38
35#define gpio1 sys 39struct au1000_gpio_chip {
36#if !defined(CONFIG_SOC_AU1000) 40 struct gpio_chip chip;
37 41 void __iomem *regbase;
38static struct au1x00_gpio2 *const gpio2 = (struct au1x00_gpio2 *) GPIO2_BASE; 42};
39#define GPIO2_OUTPUT_ENABLE_MASK 0x00010000
40 43
41static int au1xxx_gpio2_read(unsigned gpio) 44#if !defined(CONFIG_SOC_AU1000)
45static int au1000_gpio2_get(struct gpio_chip *chip, unsigned offset)
42{ 46{
43 gpio -= AU1XXX_GPIO_BASE; 47 u32 mask = 1 << offset;
44 return ((gpio2->pinstate >> gpio) & 0x01); 48 struct au1000_gpio_chip *gpch;
49
50 gpch = container_of(chip, struct au1000_gpio_chip, chip);
51 return readl(gpch->regbase + AU1000_GPIO2_ST) & mask;
45} 52}
46 53
47static void au1xxx_gpio2_write(unsigned gpio, int value) 54static void au1000_gpio2_set(struct gpio_chip *chip,
55 unsigned offset, int value)
48{ 56{
49 gpio -= AU1XXX_GPIO_BASE; 57 u32 mask = ((GPIO2_OUT_EN_MASK << offset) | (!!value << offset));
58 struct au1000_gpio_chip *gpch;
59 unsigned long flags;
60
61 gpch = container_of(chip, struct au1000_gpio_chip, chip);
50 62
51 gpio2->output = (GPIO2_OUTPUT_ENABLE_MASK << gpio) | ((!!value) << gpio); 63 local_irq_save(flags);
64 writel(mask, gpch->regbase + AU1000_GPIO2_OUT);
65 local_irq_restore(flags);
52} 66}
53 67
54static int au1xxx_gpio2_direction_input(unsigned gpio) 68static int au1000_gpio2_direction_input(struct gpio_chip *chip, unsigned offset)
55{ 69{
56 gpio -= AU1XXX_GPIO_BASE; 70 u32 mask = 1 << offset;
57 gpio2->dir &= ~(0x01 << gpio); 71 u32 tmp;
72 struct au1000_gpio_chip *gpch;
73 unsigned long flags;
74
75 gpch = container_of(chip, struct au1000_gpio_chip, chip);
76
77 local_irq_save(flags);
78 tmp = readl(gpch->regbase + AU1000_GPIO2_DIR);
79 tmp &= ~mask;
80 writel(tmp, gpch->regbase + AU1000_GPIO2_DIR);
81 local_irq_restore(flags);
82
58 return 0; 83 return 0;
59} 84}
60 85
61static int au1xxx_gpio2_direction_output(unsigned gpio, int value) 86static int au1000_gpio2_direction_output(struct gpio_chip *chip,
87 unsigned offset, int value)
62{ 88{
63 gpio -= AU1XXX_GPIO_BASE; 89 u32 mask = 1 << offset;
64 gpio2->dir |= 0x01 << gpio; 90 u32 out_mask = ((GPIO2_OUT_EN_MASK << offset) | (!!value << offset));
65 gpio2->output = (GPIO2_OUTPUT_ENABLE_MASK << gpio) | ((!!value) << gpio); 91 u32 tmp;
92 struct au1000_gpio_chip *gpch;
93 unsigned long flags;
94
95 gpch = container_of(chip, struct au1000_gpio_chip, chip);
96
97 local_irq_save(flags);
98 tmp = readl(gpch->regbase + AU1000_GPIO2_DIR);
99 tmp |= mask;
100 writel(tmp, gpch->regbase + AU1000_GPIO2_DIR);
101 writel(out_mask, gpch->regbase + AU1000_GPIO2_OUT);
102 local_irq_restore(flags);
103
66 return 0; 104 return 0;
67} 105}
68
69#endif /* !defined(CONFIG_SOC_AU1000) */ 106#endif /* !defined(CONFIG_SOC_AU1000) */
70 107
71static int au1xxx_gpio1_read(unsigned gpio) 108static int au1000_gpio1_get(struct gpio_chip *chip, unsigned offset)
72{ 109{
73 return (gpio1->pinstaterd >> gpio) & 0x01; 110 u32 mask = 1 << offset;
111 struct au1000_gpio_chip *gpch;
112
113 gpch = container_of(chip, struct au1000_gpio_chip, chip);
114 return readl(gpch->regbase + AU1000_GPIO1_ST) & mask;
74} 115}
75 116
76static void au1xxx_gpio1_write(unsigned gpio, int value) 117static void au1000_gpio1_set(struct gpio_chip *chip,
118 unsigned offset, int value)
77{ 119{
120 u32 mask = 1 << offset;
121 u32 reg_offset;
122 struct au1000_gpio_chip *gpch;
123 unsigned long flags;
124
125 gpch = container_of(chip, struct au1000_gpio_chip, chip);
126
78 if (value) 127 if (value)
79 gpio1->outputset = (0x01 << gpio); 128 reg_offset = AU1000_GPIO1_OUT;
80 else 129 else
81 /* Output a zero */ 130 reg_offset = AU1000_GPIO1_CLR;
82 gpio1->outputclr = (0x01 << gpio);
83}
84 131
85static int au1xxx_gpio1_direction_input(unsigned gpio) 132 local_irq_save(flags);
86{ 133 writel(mask, gpch->regbase + reg_offset);
87 gpio1->pininputen = (0x01 << gpio); 134 local_irq_restore(flags);
88 return 0;
89} 135}
90 136
91static int au1xxx_gpio1_direction_output(unsigned gpio, int value) 137static int au1000_gpio1_direction_input(struct gpio_chip *chip, unsigned offset)
92{ 138{
93 gpio1->trioutclr = (0x01 & gpio); 139 u32 mask = 1 << offset;
94 au1xxx_gpio1_write(gpio, value); 140 struct au1000_gpio_chip *gpch;
141
142 gpch = container_of(chip, struct au1000_gpio_chip, chip);
143 writel(mask, gpch->regbase + AU1000_GPIO1_ST);
144
95 return 0; 145 return 0;
96} 146}
97 147
98int au1xxx_gpio_get_value(unsigned gpio) 148static int au1000_gpio1_direction_output(struct gpio_chip *chip,
149 unsigned offset, int value)
99{ 150{
100 if (gpio >= AU1XXX_GPIO_BASE) 151 u32 mask = 1 << offset;
101#if defined(CONFIG_SOC_AU1000) 152 struct au1000_gpio_chip *gpch;
102 return 0;
103#else
104 return au1xxx_gpio2_read(gpio);
105#endif
106 else
107 return au1xxx_gpio1_read(gpio);
108}
109EXPORT_SYMBOL(au1xxx_gpio_get_value);
110 153
111void au1xxx_gpio_set_value(unsigned gpio, int value) 154 gpch = container_of(chip, struct au1000_gpio_chip, chip);
112{
113 if (gpio >= AU1XXX_GPIO_BASE)
114#if defined(CONFIG_SOC_AU1000)
115 ;
116#else
117 au1xxx_gpio2_write(gpio, value);
118#endif
119 else
120 au1xxx_gpio1_write(gpio, value);
121}
122EXPORT_SYMBOL(au1xxx_gpio_set_value);
123 155
124int au1xxx_gpio_direction_input(unsigned gpio) 156 writel(mask, gpch->regbase + AU1000_GPIO1_TRI_OUT);
125{ 157 au1000_gpio1_set(chip, offset, value);
126 if (gpio >= AU1XXX_GPIO_BASE)
127#if defined(CONFIG_SOC_AU1000)
128 return -ENODEV;
129#else
130 return au1xxx_gpio2_direction_input(gpio);
131#endif
132 158
133 return au1xxx_gpio1_direction_input(gpio); 159 return 0;
134} 160}
135EXPORT_SYMBOL(au1xxx_gpio_direction_input);
136 161
137int au1xxx_gpio_direction_output(unsigned gpio, int value) 162struct au1000_gpio_chip au1000_gpio_chip[] = {
163 [0] = {
164 .regbase = (void __iomem *)SYS_BASE,
165 .chip = {
166 .label = "au1000-gpio1",
167 .direction_input = au1000_gpio1_direction_input,
168 .direction_output = au1000_gpio1_direction_output,
169 .get = au1000_gpio1_get,
170 .set = au1000_gpio1_set,
171 .base = 0,
172 .ngpio = 32,
173 },
174 },
175#if !defined(CONFIG_SOC_AU1000)
176 [1] = {
177 .regbase = (void __iomem *)GPIO2_BASE,
178 .chip = {
179 .label = "au1000-gpio2",
180 .direction_input = au1000_gpio2_direction_input,
181 .direction_output = au1000_gpio2_direction_output,
182 .get = au1000_gpio2_get,
183 .set = au1000_gpio2_set,
184 .base = AU1XXX_GPIO_BASE,
185 .ngpio = 32,
186 },
187 },
188#endif
189};
190
191static int __init au1000_gpio_init(void)
138{ 192{
139 if (gpio >= AU1XXX_GPIO_BASE) 193 gpiochip_add(&au1000_gpio_chip[0].chip);
140#if defined(CONFIG_SOC_AU1000) 194#if !defined(CONFIG_SOC_AU1000)
141 return -ENODEV; 195 gpiochip_add(&au1000_gpio_chip[1].chip);
142#else
143 return au1xxx_gpio2_direction_output(gpio, value);
144#endif 196#endif
145 197
146 return au1xxx_gpio1_direction_output(gpio, value); 198 return 0;
147} 199}
148EXPORT_SYMBOL(au1xxx_gpio_direction_output); 200arch_initcall(au1000_gpio_init);
201
diff --git a/arch/mips/alchemy/devboards/pb1200/platform.c b/arch/mips/alchemy/devboards/pb1200/platform.c
index 95303297c534..0d68e1985ffd 100644
--- a/arch/mips/alchemy/devboards/pb1200/platform.c
+++ b/arch/mips/alchemy/devboards/pb1200/platform.c
@@ -22,6 +22,7 @@
22#include <linux/init.h> 22#include <linux/init.h>
23#include <linux/leds.h> 23#include <linux/leds.h>
24#include <linux/platform_device.h> 24#include <linux/platform_device.h>
25#include <linux/smc91x.h>
25 26
26#include <asm/mach-au1x00/au1xxx.h> 27#include <asm/mach-au1x00/au1xxx.h>
27#include <asm/mach-au1x00/au1100_mmc.h> 28#include <asm/mach-au1x00/au1100_mmc.h>
@@ -131,6 +132,12 @@ static struct platform_device ide_device = {
131 .resource = ide_resources 132 .resource = ide_resources
132}; 133};
133 134
135static struct smc91x_platdata smc_data = {
136 .flags = SMC91X_NOWAIT | SMC91X_USE_16BIT,
137 .leda = RPC_LED_100_10,
138 .ledb = RPC_LED_TX_RX,
139};
140
134static struct resource smc91c111_resources[] = { 141static struct resource smc91c111_resources[] = {
135 [0] = { 142 [0] = {
136 .name = "smc91x-regs", 143 .name = "smc91x-regs",
@@ -146,6 +153,9 @@ static struct resource smc91c111_resources[] = {
146}; 153};
147 154
148static struct platform_device smc91c111_device = { 155static struct platform_device smc91c111_device = {
156 .dev = {
157 .platform_data = &smc_data,
158 },
149 .name = "smc91x", 159 .name = "smc91x",
150 .id = -1, 160 .id = -1,
151 .num_resources = ARRAY_SIZE(smc91c111_resources), 161 .num_resources = ARRAY_SIZE(smc91c111_resources),
diff --git a/arch/mips/cavium-octeon/Makefile b/arch/mips/cavium-octeon/Makefile
index 1c2a7faf5881..d6903c3f3d51 100644
--- a/arch/mips/cavium-octeon/Makefile
+++ b/arch/mips/cavium-octeon/Makefile
@@ -14,3 +14,5 @@ obj-y += dma-octeon.o flash_setup.o
14obj-y += octeon-memcpy.o 14obj-y += octeon-memcpy.o
15 15
16obj-$(CONFIG_SMP) += smp.o 16obj-$(CONFIG_SMP) += smp.o
17
18EXTRA_CFLAGS += -Werror
diff --git a/arch/mips/cavium-octeon/flash_setup.c b/arch/mips/cavium-octeon/flash_setup.c
index 553d36cbcc42..008f657116eb 100644
--- a/arch/mips/cavium-octeon/flash_setup.c
+++ b/arch/mips/cavium-octeon/flash_setup.c
@@ -57,7 +57,7 @@ static int __init flash_init(void)
57 flash_map.bankwidth = 1; 57 flash_map.bankwidth = 1;
58 flash_map.virt = ioremap(flash_map.phys, flash_map.size); 58 flash_map.virt = ioremap(flash_map.phys, flash_map.size);
59 pr_notice("Bootbus flash: Setting flash for %luMB flash at " 59 pr_notice("Bootbus flash: Setting flash for %luMB flash at "
60 "0x%08lx\n", flash_map.size >> 20, flash_map.phys); 60 "0x%08llx\n", flash_map.size >> 20, flash_map.phys);
61 simple_map_init(&flash_map); 61 simple_map_init(&flash_map);
62 mymtd = do_map_probe("cfi_probe", &flash_map); 62 mymtd = do_map_probe("cfi_probe", &flash_map);
63 if (mymtd) { 63 if (mymtd) {
diff --git a/arch/mips/cavium-octeon/octeon-irq.c b/arch/mips/cavium-octeon/octeon-irq.c
index fc72984a5dae..1c19af8daa62 100644
--- a/arch/mips/cavium-octeon/octeon-irq.c
+++ b/arch/mips/cavium-octeon/octeon-irq.c
@@ -31,7 +31,7 @@ static void octeon_irq_core_ack(unsigned int irq)
31 31
32static void octeon_irq_core_eoi(unsigned int irq) 32static void octeon_irq_core_eoi(unsigned int irq)
33{ 33{
34 irq_desc_t *desc = irq_desc + irq; 34 struct irq_desc *desc = irq_desc + irq;
35 unsigned int bit = irq - OCTEON_IRQ_SW0; 35 unsigned int bit = irq - OCTEON_IRQ_SW0;
36 /* 36 /*
37 * If an IRQ is being processed while we are disabling it the 37 * If an IRQ is being processed while we are disabling it the
diff --git a/arch/mips/cobalt/irq.c b/arch/mips/cobalt/irq.c
index ac4fb912649d..cb9bf820fe53 100644
--- a/arch/mips/cobalt/irq.c
+++ b/arch/mips/cobalt/irq.c
@@ -47,7 +47,6 @@ asmlinkage void plat_irq_dispatch(void)
47 47
48static struct irqaction cascade = { 48static struct irqaction cascade = {
49 .handler = no_action, 49 .handler = no_action,
50 .mask = CPU_MASK_NONE,
51 .name = "cascade", 50 .name = "cascade",
52}; 51};
53 52
diff --git a/arch/mips/emma/markeins/irq.c b/arch/mips/emma/markeins/irq.c
index c2583ecc93cf..43828ae796ec 100644
--- a/arch/mips/emma/markeins/irq.c
+++ b/arch/mips/emma/markeins/irq.c
@@ -80,9 +80,9 @@ void emma2rh_irq_init(void)
80 u32 i; 80 u32 i;
81 81
82 for (i = 0; i < NUM_EMMA2RH_IRQ; i++) 82 for (i = 0; i < NUM_EMMA2RH_IRQ; i++)
83 set_irq_chip_and_handler(EMMA2RH_IRQ_BASE + i, 83 set_irq_chip_and_handler_name(EMMA2RH_IRQ_BASE + i,
84 &emma2rh_irq_controller, 84 &emma2rh_irq_controller,
85 handle_level_irq); 85 handle_level_irq, "level");
86} 86}
87 87
88static void emma2rh_sw_irq_enable(unsigned int irq) 88static void emma2rh_sw_irq_enable(unsigned int irq)
@@ -120,9 +120,9 @@ void emma2rh_sw_irq_init(void)
120 u32 i; 120 u32 i;
121 121
122 for (i = 0; i < NUM_EMMA2RH_IRQ_SW; i++) 122 for (i = 0; i < NUM_EMMA2RH_IRQ_SW; i++)
123 set_irq_chip_and_handler(EMMA2RH_SW_IRQ_BASE + i, 123 set_irq_chip_and_handler_name(EMMA2RH_SW_IRQ_BASE + i,
124 &emma2rh_sw_irq_controller, 124 &emma2rh_sw_irq_controller,
125 handle_level_irq); 125 handle_level_irq, "level");
126} 126}
127 127
128static void emma2rh_gpio_irq_enable(unsigned int irq) 128static void emma2rh_gpio_irq_enable(unsigned int irq)
@@ -149,37 +149,28 @@ static void emma2rh_gpio_irq_disable(unsigned int irq)
149 149
150static void emma2rh_gpio_irq_ack(unsigned int irq) 150static void emma2rh_gpio_irq_ack(unsigned int irq)
151{ 151{
152 u32 reg;
153
154 irq -= EMMA2RH_GPIO_IRQ_BASE; 152 irq -= EMMA2RH_GPIO_IRQ_BASE;
155 emma2rh_out32(EMMA2RH_GPIO_INT_ST, ~(1 << irq)); 153 emma2rh_out32(EMMA2RH_GPIO_INT_ST, ~(1 << irq));
156
157 reg = emma2rh_in32(EMMA2RH_GPIO_INT_MASK);
158 reg &= ~(1 << irq);
159 emma2rh_out32(EMMA2RH_GPIO_INT_MASK, reg);
160} 154}
161 155
162static void emma2rh_gpio_irq_end(unsigned int irq) 156static void emma2rh_gpio_irq_mask_ack(unsigned int irq)
163{ 157{
164 u32 reg; 158 u32 reg;
165 159
166 if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) { 160 irq -= EMMA2RH_GPIO_IRQ_BASE;
167 161 emma2rh_out32(EMMA2RH_GPIO_INT_ST, ~(1 << irq));
168 irq -= EMMA2RH_GPIO_IRQ_BASE;
169 162
170 reg = emma2rh_in32(EMMA2RH_GPIO_INT_MASK); 163 reg = emma2rh_in32(EMMA2RH_GPIO_INT_MASK);
171 reg |= 1 << irq; 164 reg &= ~(1 << irq);
172 emma2rh_out32(EMMA2RH_GPIO_INT_MASK, reg); 165 emma2rh_out32(EMMA2RH_GPIO_INT_MASK, reg);
173 }
174} 166}
175 167
176struct irq_chip emma2rh_gpio_irq_controller = { 168struct irq_chip emma2rh_gpio_irq_controller = {
177 .name = "emma2rh_gpio_irq", 169 .name = "emma2rh_gpio_irq",
178 .ack = emma2rh_gpio_irq_ack, 170 .ack = emma2rh_gpio_irq_ack,
179 .mask = emma2rh_gpio_irq_disable, 171 .mask = emma2rh_gpio_irq_disable,
180 .mask_ack = emma2rh_gpio_irq_ack, 172 .mask_ack = emma2rh_gpio_irq_mask_ack,
181 .unmask = emma2rh_gpio_irq_enable, 173 .unmask = emma2rh_gpio_irq_enable,
182 .end = emma2rh_gpio_irq_end,
183}; 174};
184 175
185void emma2rh_gpio_irq_init(void) 176void emma2rh_gpio_irq_init(void)
@@ -187,14 +178,14 @@ void emma2rh_gpio_irq_init(void)
187 u32 i; 178 u32 i;
188 179
189 for (i = 0; i < NUM_EMMA2RH_IRQ_GPIO; i++) 180 for (i = 0; i < NUM_EMMA2RH_IRQ_GPIO; i++)
190 set_irq_chip(EMMA2RH_GPIO_IRQ_BASE + i, 181 set_irq_chip_and_handler_name(EMMA2RH_GPIO_IRQ_BASE + i,
191 &emma2rh_gpio_irq_controller); 182 &emma2rh_gpio_irq_controller,
183 handle_edge_irq, "edge");
192} 184}
193 185
194static struct irqaction irq_cascade = { 186static struct irqaction irq_cascade = {
195 .handler = no_action, 187 .handler = no_action,
196 .flags = 0, 188 .flags = 0,
197 .mask = CPU_MASK_NONE,
198 .name = "cascade", 189 .name = "cascade",
199 .dev_id = NULL, 190 .dev_id = NULL,
200 .next = NULL, 191 .next = NULL,
@@ -213,8 +204,7 @@ void emma2rh_irq_dispatch(void)
213 emma2rh_in32(EMMA2RH_BHIF_INT_EN_0); 204 emma2rh_in32(EMMA2RH_BHIF_INT_EN_0);
214 205
215#ifdef EMMA2RH_SW_CASCADE 206#ifdef EMMA2RH_SW_CASCADE
216 if (intStatus & 207 if (intStatus & (1UL << EMMA2RH_SW_CASCADE)) {
217 (1 << ((EMMA2RH_SW_CASCADE - EMMA2RH_IRQ_INT0) & (32 - 1)))) {
218 u32 swIntStatus; 208 u32 swIntStatus;
219 swIntStatus = emma2rh_in32(EMMA2RH_BHIF_SW_INT) 209 swIntStatus = emma2rh_in32(EMMA2RH_BHIF_SW_INT)
220 & emma2rh_in32(EMMA2RH_BHIF_SW_INT_EN); 210 & emma2rh_in32(EMMA2RH_BHIF_SW_INT_EN);
@@ -225,6 +215,8 @@ void emma2rh_irq_dispatch(void)
225 } 215 }
226 } 216 }
227 } 217 }
218 /* Skip S/W interrupt */
219 intStatus &= ~(1UL << EMMA2RH_SW_CASCADE);
228#endif 220#endif
229 221
230 for (i = 0, bitmask = 1; i < 32; i++, bitmask <<= 1) { 222 for (i = 0, bitmask = 1; i < 32; i++, bitmask <<= 1) {
@@ -238,8 +230,7 @@ void emma2rh_irq_dispatch(void)
238 emma2rh_in32(EMMA2RH_BHIF_INT_EN_1); 230 emma2rh_in32(EMMA2RH_BHIF_INT_EN_1);
239 231
240#ifdef EMMA2RH_GPIO_CASCADE 232#ifdef EMMA2RH_GPIO_CASCADE
241 if (intStatus & 233 if (intStatus & (1UL << (EMMA2RH_GPIO_CASCADE % 32))) {
242 (1 << ((EMMA2RH_GPIO_CASCADE - EMMA2RH_IRQ_INT0) & (32 - 1)))) {
243 u32 gpioIntStatus; 234 u32 gpioIntStatus;
244 gpioIntStatus = emma2rh_in32(EMMA2RH_GPIO_INT_ST) 235 gpioIntStatus = emma2rh_in32(EMMA2RH_GPIO_INT_ST)
245 & emma2rh_in32(EMMA2RH_GPIO_INT_MASK); 236 & emma2rh_in32(EMMA2RH_GPIO_INT_MASK);
@@ -250,6 +241,8 @@ void emma2rh_irq_dispatch(void)
250 } 241 }
251 } 242 }
252 } 243 }
244 /* Skip GPIO interrupt */
245 intStatus &= ~(1UL << (EMMA2RH_GPIO_CASCADE % 32));
253#endif 246#endif
254 247
255 for (i = 32, bitmask = 1; i < 64; i++, bitmask <<= 1) { 248 for (i = 32, bitmask = 1; i < 64; i++, bitmask <<= 1) {
diff --git a/arch/mips/emma/markeins/platform.c b/arch/mips/emma/markeins/platform.c
index d5f47e4f0d18..80ae12ef87db 100644
--- a/arch/mips/emma/markeins/platform.c
+++ b/arch/mips/emma/markeins/platform.c
@@ -110,6 +110,7 @@ struct platform_device i2c_emma_devices[] = {
110static struct plat_serial8250_port platform_serial_ports[] = { 110static struct plat_serial8250_port platform_serial_ports[] = {
111 [0] = { 111 [0] = {
112 .membase= (void __iomem*)KSEG1ADDR(EMMA2RH_PFUR0_BASE + 3), 112 .membase= (void __iomem*)KSEG1ADDR(EMMA2RH_PFUR0_BASE + 3),
113 .mapbase = EMMA2RH_PFUR0_BASE + 3,
113 .irq = EMMA2RH_IRQ_PFUR0, 114 .irq = EMMA2RH_IRQ_PFUR0,
114 .uartclk = EMMA2RH_SERIAL_CLOCK, 115 .uartclk = EMMA2RH_SERIAL_CLOCK,
115 .regshift = 4, 116 .regshift = 4,
@@ -117,6 +118,7 @@ static struct plat_serial8250_port platform_serial_ports[] = {
117 .flags = EMMA2RH_SERIAL_FLAGS, 118 .flags = EMMA2RH_SERIAL_FLAGS,
118 }, [1] = { 119 }, [1] = {
119 .membase = (void __iomem*)KSEG1ADDR(EMMA2RH_PFUR1_BASE + 3), 120 .membase = (void __iomem*)KSEG1ADDR(EMMA2RH_PFUR1_BASE + 3),
121 .mapbase = EMMA2RH_PFUR1_BASE + 3,
120 .irq = EMMA2RH_IRQ_PFUR1, 122 .irq = EMMA2RH_IRQ_PFUR1,
121 .uartclk = EMMA2RH_SERIAL_CLOCK, 123 .uartclk = EMMA2RH_SERIAL_CLOCK,
122 .regshift = 4, 124 .regshift = 4,
@@ -124,6 +126,7 @@ static struct plat_serial8250_port platform_serial_ports[] = {
124 .flags = EMMA2RH_SERIAL_FLAGS, 126 .flags = EMMA2RH_SERIAL_FLAGS,
125 }, [2] = { 127 }, [2] = {
126 .membase = (void __iomem*)KSEG1ADDR(EMMA2RH_PFUR2_BASE + 3), 128 .membase = (void __iomem*)KSEG1ADDR(EMMA2RH_PFUR2_BASE + 3),
129 .mapbase = EMMA2RH_PFUR2_BASE + 3,
127 .irq = EMMA2RH_IRQ_PFUR2, 130 .irq = EMMA2RH_IRQ_PFUR2,
128 .uartclk = EMMA2RH_SERIAL_CLOCK, 131 .uartclk = EMMA2RH_SERIAL_CLOCK,
129 .regshift = 4, 132 .regshift = 4,
diff --git a/arch/mips/include/asm/cpu.h b/arch/mips/include/asm/cpu.h
index c018727c7ddc..3bdc0e3d89cc 100644
--- a/arch/mips/include/asm/cpu.h
+++ b/arch/mips/include/asm/cpu.h
@@ -209,8 +209,7 @@ enum cpu_type_enum {
209 * MIPS32 class processors 209 * MIPS32 class processors
210 */ 210 */
211 CPU_4KC, CPU_4KEC, CPU_4KSC, CPU_24K, CPU_34K, CPU_1004K, CPU_74K, 211 CPU_4KC, CPU_4KEC, CPU_4KSC, CPU_24K, CPU_34K, CPU_1004K, CPU_74K,
212 CPU_AU1000, CPU_AU1100, CPU_AU1200, CPU_AU1210, CPU_AU1250, CPU_AU1500, 212 CPU_ALCHEMY, CPU_PR4450, CPU_BCM3302, CPU_BCM4710,
213 CPU_AU1550, CPU_PR4450, CPU_BCM3302, CPU_BCM4710,
214 213
215 /* 214 /*
216 * MIPS64 class processors 215 * MIPS64 class processors
diff --git a/arch/mips/include/asm/hazards.h b/arch/mips/include/asm/hazards.h
index 134e1fc8f4d6..a12d971db4f9 100644
--- a/arch/mips/include/asm/hazards.h
+++ b/arch/mips/include/asm/hazards.h
@@ -87,7 +87,7 @@ do { \
87 : "=r" (tmp)); \ 87 : "=r" (tmp)); \
88} while (0) 88} while (0)
89 89
90#elif defined(CONFIG_CPU_MIPSR1) 90#elif defined(CONFIG_CPU_MIPSR1) && !defined(CONFIG_MACH_ALCHEMY)
91 91
92/* 92/*
93 * These are slightly complicated by the fact that we guarantee R1 kernels to 93 * These are slightly complicated by the fact that we guarantee R1 kernels to
@@ -139,7 +139,7 @@ do { \
139} while (0) 139} while (0)
140 140
141#elif defined(CONFIG_CPU_R10000) || defined(CONFIG_CPU_CAVIUM_OCTEON) || \ 141#elif defined(CONFIG_CPU_R10000) || defined(CONFIG_CPU_CAVIUM_OCTEON) || \
142 defined(CONFIG_CPU_R5500) 142 defined(CONFIG_CPU_R5500) || defined(CONFIG_MACH_ALCHEMY)
143 143
144/* 144/*
145 * R10000 rocks - all hazards handled in hardware, so this becomes a nobrainer. 145 * R10000 rocks - all hazards handled in hardware, so this becomes a nobrainer.
diff --git a/arch/mips/include/asm/mach-au1x00/cpu-feature-overrides.h b/arch/mips/include/asm/mach-au1x00/cpu-feature-overrides.h
new file mode 100644
index 000000000000..d5df0cab9b87
--- /dev/null
+++ b/arch/mips/include/asm/mach-au1x00/cpu-feature-overrides.h
@@ -0,0 +1,49 @@
1/*
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
7#ifndef __ASM_MACH_AU1X00_CPU_FEATURE_OVERRIDES_H
8#define __ASM_MACH_AU1X00_CPU_FEATURE_OVERRIDES_H
9
10#define cpu_has_tlb 1
11#define cpu_has_4kex 1
12#define cpu_has_3k_cache 0
13#define cpu_has_4k_cache 1
14#define cpu_has_tx39_cache 0
15#define cpu_has_fpu 0
16#define cpu_has_counter 1
17#define cpu_has_watch 1
18#define cpu_has_divec 1
19#define cpu_has_vce 0
20#define cpu_has_cache_cdex_p 0
21#define cpu_has_cache_cdex_s 0
22#define cpu_has_mcheck 1
23#define cpu_has_ejtag 1
24#define cpu_has_llsc 1
25#define cpu_has_mips16 0
26#define cpu_has_mdmx 0
27#define cpu_has_mips3d 0
28#define cpu_has_smartmips 0
29#define cpu_has_vtag_icache 0
30#define cpu_has_dc_aliases 0
31#define cpu_has_ic_fills_f_dc 1
32#define cpu_has_mips32r1 1
33#define cpu_has_mips32r2 0
34#define cpu_has_mips64r1 0
35#define cpu_has_mips64r2 0
36#define cpu_has_dsp 0
37#define cpu_has_mipsmt 0
38#define cpu_has_userlocal 0
39#define cpu_has_nofpuex 0
40#define cpu_has_64bits 0
41#define cpu_has_64bit_zero_reg 0
42#define cpu_has_vint 0
43#define cpu_has_veic 0
44#define cpu_has_inclusive_pcaches 0
45
46#define cpu_dcache_line_size() 32
47#define cpu_icache_line_size() 32
48
49#endif /* __ASM_MACH_AU1X00_CPU_FEATURE_OVERRIDES_H */
diff --git a/arch/mips/include/asm/mach-au1x00/gpio.h b/arch/mips/include/asm/mach-au1x00/gpio.h
index 2dc61e009a08..34d9b7279024 100644
--- a/arch/mips/include/asm/mach-au1x00/gpio.h
+++ b/arch/mips/include/asm/mach-au1x00/gpio.h
@@ -5,65 +5,29 @@
5 5
6#define AU1XXX_GPIO_BASE 200 6#define AU1XXX_GPIO_BASE 200
7 7
8struct au1x00_gpio2 { 8/* GPIO bank 1 offsets */
9 u32 dir; 9#define AU1000_GPIO1_TRI_OUT 0x0100
10 u32 reserved; 10#define AU1000_GPIO1_OUT 0x0108
11 u32 output; 11#define AU1000_GPIO1_ST 0x0110
12 u32 pinstate; 12#define AU1000_GPIO1_CLR 0x010C
13 u32 inten;
14 u32 enable;
15};
16 13
17extern int au1xxx_gpio_get_value(unsigned gpio); 14/* GPIO bank 2 offsets */
18extern void au1xxx_gpio_set_value(unsigned gpio, int value); 15#define AU1000_GPIO2_DIR 0x00
19extern int au1xxx_gpio_direction_input(unsigned gpio); 16#define AU1000_GPIO2_RSVD 0x04
20extern int au1xxx_gpio_direction_output(unsigned gpio, int value); 17#define AU1000_GPIO2_OUT 0x08
18#define AU1000_GPIO2_ST 0x0C
19#define AU1000_GPIO2_INT 0x10
20#define AU1000_GPIO2_EN 0x14
21 21
22#define GPIO2_OUT_EN_MASK 0x00010000
22 23
23/* Wrappers for the arch-neutral GPIO API */ 24#define gpio_to_irq(gpio) NULL
24 25
25static inline int gpio_request(unsigned gpio, const char *label) 26#define gpio_get_value __gpio_get_value
26{ 27#define gpio_set_value __gpio_set_value
27 /* Not yet implemented */
28 return 0;
29}
30 28
31static inline void gpio_free(unsigned gpio) 29#define gpio_cansleep __gpio_cansleep
32{
33 /* Not yet implemented */
34}
35 30
36static inline int gpio_direction_input(unsigned gpio)
37{
38 return au1xxx_gpio_direction_input(gpio);
39}
40
41static inline int gpio_direction_output(unsigned gpio, int value)
42{
43 return au1xxx_gpio_direction_output(gpio, value);
44}
45
46static inline int gpio_get_value(unsigned gpio)
47{
48 return au1xxx_gpio_get_value(gpio);
49}
50
51static inline void gpio_set_value(unsigned gpio, int value)
52{
53 au1xxx_gpio_set_value(gpio, value);
54}
55
56static inline int gpio_to_irq(unsigned gpio)
57{
58 return gpio;
59}
60
61static inline int irq_to_gpio(unsigned irq)
62{
63 return irq;
64}
65
66/* For cansleep */
67#include <asm-generic/gpio.h> 31#include <asm-generic/gpio.h>
68 32
69#endif /* _AU1XXX_GPIO_H_ */ 33#endif /* _AU1XXX_GPIO_H_ */
diff --git a/arch/mips/include/asm/mach-ip27/topology.h b/arch/mips/include/asm/mach-ip27/topology.h
index 55d481569a1f..07547231e078 100644
--- a/arch/mips/include/asm/mach-ip27/topology.h
+++ b/arch/mips/include/asm/mach-ip27/topology.h
@@ -26,7 +26,6 @@ extern struct cpuinfo_ip27 sn_cpu_info[NR_CPUS];
26#define parent_node(node) (node) 26#define parent_node(node) (node)
27#define node_to_cpumask(node) (hub_data(node)->h_cpus) 27#define node_to_cpumask(node) (hub_data(node)->h_cpus)
28#define cpumask_of_node(node) (&hub_data(node)->h_cpus) 28#define cpumask_of_node(node) (&hub_data(node)->h_cpus)
29#define node_to_first_cpu(node) (cpumask_first(cpumask_of_node(node)))
30struct pci_bus; 29struct pci_bus;
31extern int pcibus_to_node(struct pci_bus *); 30extern int pcibus_to_node(struct pci_bus *);
32 31
diff --git a/arch/mips/include/asm/mips-boards/generic.h b/arch/mips/include/asm/mips-boards/generic.h
index 7f0b034dd9a5..c0da1a881e3d 100644
--- a/arch/mips/include/asm/mips-boards/generic.h
+++ b/arch/mips/include/asm/mips-boards/generic.h
@@ -71,8 +71,6 @@
71 71
72#define MIPS_REVISION_CORID (((*(volatile u32 *)ioremap(MIPS_REVISION_REG, 4)) >> 10) & 0x3f) 72#define MIPS_REVISION_CORID (((*(volatile u32 *)ioremap(MIPS_REVISION_REG, 4)) >> 10) & 0x3f)
73 73
74extern int mips_revision_corid;
75
76#define MIPS_REVISION_SCON_OTHER 0 74#define MIPS_REVISION_SCON_OTHER 0
77#define MIPS_REVISION_SCON_SOCITSC 1 75#define MIPS_REVISION_SCON_SOCITSC 1
78#define MIPS_REVISION_SCON_SOCITSCP 2 76#define MIPS_REVISION_SCON_SOCITSCP 2
diff --git a/arch/mips/include/asm/smp-ops.h b/arch/mips/include/asm/smp-ops.h
index 43c207e72a63..64ffc0290b84 100644
--- a/arch/mips/include/asm/smp-ops.h
+++ b/arch/mips/include/asm/smp-ops.h
@@ -15,6 +15,8 @@
15 15
16#include <linux/cpumask.h> 16#include <linux/cpumask.h>
17 17
18struct task_struct;
19
18struct plat_smp_ops { 20struct plat_smp_ops {
19 void (*send_ipi_single)(int cpu, unsigned int action); 21 void (*send_ipi_single)(int cpu, unsigned int action);
20 void (*send_ipi_mask)(cpumask_t mask, unsigned int action); 22 void (*send_ipi_mask)(cpumask_t mask, unsigned int action);
diff --git a/arch/mips/include/asm/spinlock.h b/arch/mips/include/asm/spinlock.h
index 0884947ebe27..10e82441b496 100644
--- a/arch/mips/include/asm/spinlock.h
+++ b/arch/mips/include/asm/spinlock.h
@@ -76,7 +76,7 @@ static inline void __raw_spin_lock(raw_spinlock_t *lock)
76 "2: \n" 76 "2: \n"
77 " .subsection 2 \n" 77 " .subsection 2 \n"
78 "4: andi %[ticket], %[ticket], 0x1fff \n" 78 "4: andi %[ticket], %[ticket], 0x1fff \n"
79 "5: sll %[ticket], 5 \n" 79 " sll %[ticket], 5 \n"
80 " \n" 80 " \n"
81 "6: bnez %[ticket], 6b \n" 81 "6: bnez %[ticket], 6b \n"
82 " subu %[ticket], 1 \n" 82 " subu %[ticket], 1 \n"
@@ -85,7 +85,7 @@ static inline void __raw_spin_lock(raw_spinlock_t *lock)
85 " andi %[ticket], %[ticket], 0x1fff \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 5b \n" 88 " b 4b \n"
89 " subu %[ticket], %[ticket], 1 \n" 89 " subu %[ticket], %[ticket], 1 \n"
90 " .previous \n" 90 " .previous \n"
91 " .set pop \n" 91 " .set pop \n"
@@ -113,7 +113,7 @@ static inline void __raw_spin_lock(raw_spinlock_t *lock)
113 " ll %[ticket], %[ticket_ptr] \n" 113 " ll %[ticket], %[ticket_ptr] \n"
114 " \n" 114 " \n"
115 "4: andi %[ticket], %[ticket], 0x1fff \n" 115 "4: andi %[ticket], %[ticket], 0x1fff \n"
116 "5: sll %[ticket], 5 \n" 116 " sll %[ticket], 5 \n"
117 " \n" 117 " \n"
118 "6: bnez %[ticket], 6b \n" 118 "6: bnez %[ticket], 6b \n"
119 " subu %[ticket], 1 \n" 119 " subu %[ticket], 1 \n"
@@ -122,7 +122,7 @@ static inline void __raw_spin_lock(raw_spinlock_t *lock)
122 " andi %[ticket], %[ticket], 0x1fff \n" 122 " andi %[ticket], %[ticket], 0x1fff \n"
123 " beq %[ticket], %[my_ticket], 2b \n" 123 " beq %[ticket], %[my_ticket], 2b \n"
124 " subu %[ticket], %[my_ticket], %[ticket] \n" 124 " subu %[ticket], %[my_ticket], %[ticket] \n"
125 " b 5b \n" 125 " b 4b \n"
126 " subu %[ticket], %[ticket], 1 \n" 126 " subu %[ticket], %[ticket], 1 \n"
127 " .previous \n" 127 " .previous \n"
128 " .set pop \n" 128 " .set pop \n"
diff --git a/arch/mips/include/asm/types.h b/arch/mips/include/asm/types.h
index bcbb8d675af5..7956e69a3bd5 100644
--- a/arch/mips/include/asm/types.h
+++ b/arch/mips/include/asm/types.h
@@ -4,12 +4,18 @@
4 * for more details. 4 * for more details.
5 * 5 *
6 * Copyright (C) 1994, 1995, 1996, 1999 by Ralf Baechle 6 * Copyright (C) 1994, 1995, 1996, 1999 by Ralf Baechle
7 * Copyright (C) 2008 Wind River Systems,
8 * written by Ralf Baechle
7 * Copyright (C) 1999 Silicon Graphics, Inc. 9 * Copyright (C) 1999 Silicon Graphics, Inc.
8 */ 10 */
9#ifndef _ASM_TYPES_H 11#ifndef _ASM_TYPES_H
10#define _ASM_TYPES_H 12#define _ASM_TYPES_H
11 13
12#if _MIPS_SZLONG == 64 14/*
15 * We don't use int-l64.h for the kernel anymore but still use it for
16 * userspace to avoid code changes.
17 */
18#if (_MIPS_SZLONG == 64) && !defined(__KERNEL__)
13# include <asm-generic/int-l64.h> 19# include <asm-generic/int-l64.h>
14#else 20#else
15# include <asm-generic/int-ll64.h> 21# include <asm-generic/int-ll64.h>
diff --git a/arch/mips/jazz/irq.c b/arch/mips/jazz/irq.c
index 03965cb1b252..d9b6a5b5399d 100644
--- a/arch/mips/jazz/irq.c
+++ b/arch/mips/jazz/irq.c
@@ -134,7 +134,6 @@ static irqreturn_t r4030_timer_interrupt(int irq, void *dev_id)
134static struct irqaction r4030_timer_irqaction = { 134static struct irqaction r4030_timer_irqaction = {
135 .handler = r4030_timer_interrupt, 135 .handler = r4030_timer_interrupt,
136 .flags = IRQF_DISABLED, 136 .flags = IRQF_DISABLED,
137 .mask = CPU_MASK_CPU0,
138 .name = "R4030 timer", 137 .name = "R4030 timer",
139}; 138};
140 139
diff --git a/arch/mips/jazz/jazzdma.c b/arch/mips/jazz/jazzdma.c
index c672c08d49e5..f0fd636723be 100644
--- a/arch/mips/jazz/jazzdma.c
+++ b/arch/mips/jazz/jazzdma.c
@@ -68,8 +68,7 @@ static int __init vdma_init(void)
68 */ 68 */
69 pgtbl = (VDMA_PGTBL_ENTRY *)__get_free_pages(GFP_KERNEL | GFP_DMA, 69 pgtbl = (VDMA_PGTBL_ENTRY *)__get_free_pages(GFP_KERNEL | GFP_DMA,
70 get_order(VDMA_PGTBL_SIZE)); 70 get_order(VDMA_PGTBL_SIZE));
71 if (!pgtbl) 71 BUG_ON(!pgtbl);
72 BUG();
73 dma_cache_wback_inv((unsigned long)pgtbl, VDMA_PGTBL_SIZE); 72 dma_cache_wback_inv((unsigned long)pgtbl, VDMA_PGTBL_SIZE);
74 pgtbl = (VDMA_PGTBL_ENTRY *)KSEG1ADDR(pgtbl); 73 pgtbl = (VDMA_PGTBL_ENTRY *)KSEG1ADDR(pgtbl);
75 74
diff --git a/arch/mips/kernel/cevt-bcm1480.c b/arch/mips/kernel/cevt-bcm1480.c
index b820661678b0..a5182a207696 100644
--- a/arch/mips/kernel/cevt-bcm1480.c
+++ b/arch/mips/kernel/cevt-bcm1480.c
@@ -144,7 +144,6 @@ void __cpuinit sb1480_clockevent_init(void)
144 144
145 action->handler = sibyte_counter_handler; 145 action->handler = sibyte_counter_handler;
146 action->flags = IRQF_DISABLED | IRQF_PERCPU; 146 action->flags = IRQF_DISABLED | IRQF_PERCPU;
147 action->mask = cpumask_of_cpu(cpu);
148 action->name = name; 147 action->name = name;
149 action->dev_id = cd; 148 action->dev_id = cd;
150 149
diff --git a/arch/mips/kernel/cevt-sb1250.c b/arch/mips/kernel/cevt-sb1250.c
index a2eebaafda52..340f53e5c6b1 100644
--- a/arch/mips/kernel/cevt-sb1250.c
+++ b/arch/mips/kernel/cevt-sb1250.c
@@ -143,7 +143,6 @@ void __cpuinit sb1250_clockevent_init(void)
143 143
144 action->handler = sibyte_counter_handler; 144 action->handler = sibyte_counter_handler;
145 action->flags = IRQF_DISABLED | IRQF_PERCPU; 145 action->flags = IRQF_DISABLED | IRQF_PERCPU;
146 action->mask = cpumask_of_cpu(cpu);
147 action->name = name; 146 action->name = name;
148 action->dev_id = cd; 147 action->dev_id = cd;
149 148
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
index 1bdbcad3bb74..b13b8eb30596 100644
--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
@@ -183,13 +183,7 @@ void __init check_wait(void)
183 case CPU_TX49XX: 183 case CPU_TX49XX:
184 cpu_wait = r4k_wait_irqoff; 184 cpu_wait = r4k_wait_irqoff;
185 break; 185 break;
186 case CPU_AU1000: 186 case CPU_ALCHEMY:
187 case CPU_AU1100:
188 case CPU_AU1500:
189 case CPU_AU1550:
190 case CPU_AU1200:
191 case CPU_AU1210:
192 case CPU_AU1250:
193 cpu_wait = au1k_wait; 187 cpu_wait = au1k_wait;
194 break; 188 break;
195 case CPU_20KC: 189 case CPU_20KC:
@@ -783,37 +777,30 @@ static inline void cpu_probe_alchemy(struct cpuinfo_mips *c, unsigned int cpu)
783 switch (c->processor_id & 0xff00) { 777 switch (c->processor_id & 0xff00) {
784 case PRID_IMP_AU1_REV1: 778 case PRID_IMP_AU1_REV1:
785 case PRID_IMP_AU1_REV2: 779 case PRID_IMP_AU1_REV2:
780 c->cputype = CPU_ALCHEMY;
786 switch ((c->processor_id >> 24) & 0xff) { 781 switch ((c->processor_id >> 24) & 0xff) {
787 case 0: 782 case 0:
788 c->cputype = CPU_AU1000;
789 __cpu_name[cpu] = "Au1000"; 783 __cpu_name[cpu] = "Au1000";
790 break; 784 break;
791 case 1: 785 case 1:
792 c->cputype = CPU_AU1500;
793 __cpu_name[cpu] = "Au1500"; 786 __cpu_name[cpu] = "Au1500";
794 break; 787 break;
795 case 2: 788 case 2:
796 c->cputype = CPU_AU1100;
797 __cpu_name[cpu] = "Au1100"; 789 __cpu_name[cpu] = "Au1100";
798 break; 790 break;
799 case 3: 791 case 3:
800 c->cputype = CPU_AU1550;
801 __cpu_name[cpu] = "Au1550"; 792 __cpu_name[cpu] = "Au1550";
802 break; 793 break;
803 case 4: 794 case 4:
804 c->cputype = CPU_AU1200;
805 __cpu_name[cpu] = "Au1200"; 795 __cpu_name[cpu] = "Au1200";
806 if ((c->processor_id & 0xff) == 2) { 796 if ((c->processor_id & 0xff) == 2)
807 c->cputype = CPU_AU1250;
808 __cpu_name[cpu] = "Au1250"; 797 __cpu_name[cpu] = "Au1250";
809 }
810 break; 798 break;
811 case 5: 799 case 5:
812 c->cputype = CPU_AU1210;
813 __cpu_name[cpu] = "Au1210"; 800 __cpu_name[cpu] = "Au1210";
814 break; 801 break;
815 default: 802 default:
816 panic("Unknown Au Core!"); 803 __cpu_name[cpu] = "Au1xxx";
817 break; 804 break;
818 } 805 }
819 break; 806 break;
diff --git a/arch/mips/kernel/i8253.c b/arch/mips/kernel/i8253.c
index f4d187825f96..689719e34f08 100644
--- a/arch/mips/kernel/i8253.c
+++ b/arch/mips/kernel/i8253.c
@@ -98,7 +98,6 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id)
98static struct irqaction irq0 = { 98static struct irqaction irq0 = {
99 .handler = timer_interrupt, 99 .handler = timer_interrupt,
100 .flags = IRQF_DISABLED | IRQF_NOBALANCING, 100 .flags = IRQF_DISABLED | IRQF_NOBALANCING,
101 .mask = CPU_MASK_NONE,
102 .name = "timer" 101 .name = "timer"
103}; 102};
104 103
@@ -121,7 +120,6 @@ void __init setup_pit_timer(void)
121 cd->min_delta_ns = clockevent_delta2ns(0xF, cd); 120 cd->min_delta_ns = clockevent_delta2ns(0xF, cd);
122 clockevents_register_device(cd); 121 clockevents_register_device(cd);
123 122
124 irq0.mask = cpumask_of_cpu(cpu);
125 setup_irq(0, &irq0); 123 setup_irq(0, &irq0);
126} 124}
127 125
diff --git a/arch/mips/kernel/i8259.c b/arch/mips/kernel/i8259.c
index 413bd1d37f54..01c0885a8061 100644
--- a/arch/mips/kernel/i8259.c
+++ b/arch/mips/kernel/i8259.c
@@ -306,7 +306,6 @@ static void init_8259A(int auto_eoi)
306 */ 306 */
307static struct irqaction irq2 = { 307static struct irqaction irq2 = {
308 .handler = no_action, 308 .handler = no_action,
309 .mask = CPU_MASK_NONE,
310 .name = "cascade", 309 .name = "cascade",
311}; 310};
312 311
diff --git a/arch/mips/kernel/irq-msc01.c b/arch/mips/kernel/irq-msc01.c
index 963c16d266ab..6a8cd28133d5 100644
--- a/arch/mips/kernel/irq-msc01.c
+++ b/arch/mips/kernel/irq-msc01.c
@@ -140,14 +140,16 @@ void __init init_msc_irqs(unsigned long icubase, unsigned int irqbase, msc_irqma
140 140
141 switch (imp->im_type) { 141 switch (imp->im_type) {
142 case MSC01_IRQ_EDGE: 142 case MSC01_IRQ_EDGE:
143 set_irq_chip(irqbase+n, &msc_edgeirq_type); 143 set_irq_chip_and_handler_name(irqbase + n,
144 &msc_edgeirq_type, handle_edge_irq, "edge");
144 if (cpu_has_veic) 145 if (cpu_has_veic)
145 MSCIC_WRITE(MSC01_IC_SUP+n*8, MSC01_IC_SUP_EDGE_BIT); 146 MSCIC_WRITE(MSC01_IC_SUP+n*8, MSC01_IC_SUP_EDGE_BIT);
146 else 147 else
147 MSCIC_WRITE(MSC01_IC_SUP+n*8, MSC01_IC_SUP_EDGE_BIT | imp->im_lvl); 148 MSCIC_WRITE(MSC01_IC_SUP+n*8, MSC01_IC_SUP_EDGE_BIT | imp->im_lvl);
148 break; 149 break;
149 case MSC01_IRQ_LEVEL: 150 case MSC01_IRQ_LEVEL:
150 set_irq_chip(irqbase+n, &msc_levelirq_type); 151 set_irq_chip_and_handler_name(irqbase+n,
152 &msc_levelirq_type, handle_level_irq, "level");
151 if (cpu_has_veic) 153 if (cpu_has_veic)
152 MSCIC_WRITE(MSC01_IC_SUP+n*8, 0); 154 MSCIC_WRITE(MSC01_IC_SUP+n*8, 0);
153 else 155 else
diff --git a/arch/mips/kernel/irq_cpu.c b/arch/mips/kernel/irq_cpu.c
index 0ee2567b780d..55c8a3ca507b 100644
--- a/arch/mips/kernel/irq_cpu.c
+++ b/arch/mips/kernel/irq_cpu.c
@@ -112,7 +112,8 @@ void __init mips_cpu_irq_init(void)
112 */ 112 */
113 if (cpu_has_mipsmt) 113 if (cpu_has_mipsmt)
114 for (i = irq_base; i < irq_base + 2; i++) 114 for (i = irq_base; i < irq_base + 2; i++)
115 set_irq_chip(i, &mips_mt_cpu_irq_controller); 115 set_irq_chip_and_handler(i, &mips_mt_cpu_irq_controller,
116 handle_percpu_irq);
116 117
117 for (i = irq_base + 2; i < irq_base + 8; i++) 118 for (i = irq_base + 2; i < irq_base + 8; i++)
118 set_irq_chip_and_handler(i, &mips_cpu_irq_controller, 119 set_irq_chip_and_handler(i, &mips_cpu_irq_controller,
diff --git a/arch/mips/kernel/linux32.c b/arch/mips/kernel/linux32.c
index 2a472713de8e..6242bc68add7 100644
--- a/arch/mips/kernel/linux32.c
+++ b/arch/mips/kernel/linux32.c
@@ -133,9 +133,9 @@ SYSCALL_DEFINE4(32_ftruncate64, unsigned long, fd, unsigned long, __dummy,
133 return sys_ftruncate(fd, merge_64(a2, a3)); 133 return sys_ftruncate(fd, merge_64(a2, a3));
134} 134}
135 135
136SYSCALL_DEFINE5(32_llseek, unsigned long, fd, unsigned long, offset_high, 136SYSCALL_DEFINE5(32_llseek, unsigned int, fd, unsigned int, offset_high,
137 unsigned long, offset_low, loff_t __user *, result, 137 unsigned int, offset_low, loff_t __user *, result,
138 unsigned long, origin) 138 unsigned int, origin)
139{ 139{
140 return sys_llseek(fd, offset_high, offset_low, result, origin); 140 return sys_llseek(fd, offset_high, offset_low, result, origin);
141} 141}
diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
index 4430a1f8fdf1..2950b97253b7 100644
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -277,7 +277,8 @@ static void __init bootmem_init(void)
277 * not selected. Once that done we can determine the low bound 277 * not selected. Once that done we can determine the low bound
278 * of usable memory. 278 * of usable memory.
279 */ 279 */
280 reserved_end = max(init_initrd(), PFN_UP(__pa_symbol(&_end))); 280 reserved_end = max(init_initrd(),
281 (unsigned long) PFN_UP(__pa_symbol(&_end)));
281 282
282 /* 283 /*
283 * max_low_pfn is not a number of pages. The number of pages 284 * max_low_pfn is not a number of pages. The number of pages
diff --git a/arch/mips/kernel/smp-up.c b/arch/mips/kernel/smp-up.c
index ead6c30eeb14..878e3733bbb2 100644
--- a/arch/mips/kernel/smp-up.c
+++ b/arch/mips/kernel/smp-up.c
@@ -13,7 +13,7 @@
13/* 13/*
14 * Send inter-processor interrupt 14 * Send inter-processor interrupt
15 */ 15 */
16void up_send_ipi_single(int cpu, unsigned int action) 16static void up_send_ipi_single(int cpu, unsigned int action)
17{ 17{
18 panic(KERN_ERR "%s called", __func__); 18 panic(KERN_ERR "%s called", __func__);
19} 19}
@@ -27,31 +27,31 @@ static inline void up_send_ipi_mask(cpumask_t mask, unsigned int action)
27 * After we've done initial boot, this function is called to allow the 27 * After we've done initial boot, this function is called to allow the
28 * board code to clean up state, if needed 28 * board code to clean up state, if needed
29 */ 29 */
30void __cpuinit up_init_secondary(void) 30static void __cpuinit up_init_secondary(void)
31{ 31{
32} 32}
33 33
34void __cpuinit up_smp_finish(void) 34static void __cpuinit up_smp_finish(void)
35{ 35{
36} 36}
37 37
38/* Hook for after all CPUs are online */ 38/* Hook for after all CPUs are online */
39void up_cpus_done(void) 39static void up_cpus_done(void)
40{ 40{
41} 41}
42 42
43/* 43/*
44 * Firmware CPU startup hook 44 * Firmware CPU startup hook
45 */ 45 */
46void __cpuinit up_boot_secondary(int cpu, struct task_struct *idle) 46static void __cpuinit up_boot_secondary(int cpu, struct task_struct *idle)
47{ 47{
48} 48}
49 49
50void __init up_smp_setup(void) 50static void __init up_smp_setup(void)
51{ 51{
52} 52}
53 53
54void __init up_prepare_cpus(unsigned int max_cpus) 54static void __init up_prepare_cpus(unsigned int max_cpus)
55{ 55{
56} 56}
57 57
diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c
index 3da94704f816..c937506a03aa 100644
--- a/arch/mips/kernel/smp.c
+++ b/arch/mips/kernel/smp.c
@@ -44,7 +44,7 @@
44#include <asm/mipsmtregs.h> 44#include <asm/mipsmtregs.h>
45#endif /* CONFIG_MIPS_MT_SMTC */ 45#endif /* CONFIG_MIPS_MT_SMTC */
46 46
47volatile cpumask_t cpu_callin_map; /* Bitmask of started secondaries */ 47static volatile cpumask_t cpu_callin_map; /* Bitmask of started secondaries */
48int __cpu_number_map[NR_CPUS]; /* Map physical to logical */ 48int __cpu_number_map[NR_CPUS]; /* Map physical to logical */
49int __cpu_logical_map[NR_CPUS]; /* Map logical to physical */ 49int __cpu_logical_map[NR_CPUS]; /* Map logical to physical */
50 50
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index 29fadaccecdd..e83da174b533 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -1277,8 +1277,7 @@ static void *set_vi_srs_handler(int n, vi_handler_t addr, int srs)
1277 u32 *w; 1277 u32 *w;
1278 unsigned char *b; 1278 unsigned char *b;
1279 1279
1280 if (!cpu_has_veic && !cpu_has_vint) 1280 BUG_ON(!cpu_has_veic && !cpu_has_vint);
1281 BUG();
1282 1281
1283 if (addr == NULL) { 1282 if (addr == NULL) {
1284 handler = (unsigned long) do_default_vi; 1283 handler = (unsigned long) do_default_vi;
diff --git a/arch/mips/lasat/interrupt.c b/arch/mips/lasat/interrupt.c
index d1ac7a25c856..1353fb135ed3 100644
--- a/arch/mips/lasat/interrupt.c
+++ b/arch/mips/lasat/interrupt.c
@@ -104,7 +104,6 @@ asmlinkage void plat_irq_dispatch(void)
104 104
105static struct irqaction cascade = { 105static struct irqaction cascade = {
106 .handler = no_action, 106 .handler = no_action,
107 .mask = CPU_MASK_NONE,
108 .name = "cascade", 107 .name = "cascade",
109}; 108};
110 109
diff --git a/arch/mips/lemote/lm2e/irq.c b/arch/mips/lemote/lm2e/irq.c
index 3e0b7beb1009..1d0a09f3b832 100644
--- a/arch/mips/lemote/lm2e/irq.c
+++ b/arch/mips/lemote/lm2e/irq.c
@@ -92,7 +92,6 @@ asmlinkage void plat_irq_dispatch(void)
92 92
93static struct irqaction cascade_irqaction = { 93static struct irqaction cascade_irqaction = {
94 .handler = no_action, 94 .handler = no_action,
95 .mask = CPU_MASK_NONE,
96 .name = "cascade", 95 .name = "cascade",
97}; 96};
98 97
diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c
index 871e828bc62a..58d9075e86fe 100644
--- a/arch/mips/mm/c-r4k.c
+++ b/arch/mips/mm/c-r4k.c
@@ -1026,13 +1026,7 @@ static void __cpuinit probe_pcache(void)
1026 c->icache.flags |= MIPS_CACHE_VTAG; 1026 c->icache.flags |= MIPS_CACHE_VTAG;
1027 break; 1027 break;
1028 1028
1029 case CPU_AU1000: 1029 case CPU_ALCHEMY:
1030 case CPU_AU1500:
1031 case CPU_AU1100:
1032 case CPU_AU1550:
1033 case CPU_AU1200:
1034 case CPU_AU1210:
1035 case CPU_AU1250:
1036 c->icache.flags |= MIPS_CACHE_IC_F_DC; 1030 c->icache.flags |= MIPS_CACHE_IC_F_DC;
1037 break; 1031 break;
1038 } 1032 }
@@ -1244,7 +1238,7 @@ void au1x00_fixup_config_od(void)
1244 /* 1238 /*
1245 * Au1100 errata actually keeps silence about this bit, so we set it 1239 * Au1100 errata actually keeps silence about this bit, so we set it
1246 * just in case for those revisions that require it to be set according 1240 * just in case for those revisions that require it to be set according
1247 * to arch/mips/au1000/common/cputable.c 1241 * to the (now gone) cpu table.
1248 */ 1242 */
1249 case 0x02030200: /* Au1100 AB */ 1243 case 0x02030200: /* Au1100 AB */
1250 case 0x02030201: /* Au1100 BA */ 1244 case 0x02030201: /* Au1100 BA */
@@ -1314,11 +1308,10 @@ static void __cpuinit coherency_setup(void)
1314 break; 1308 break;
1315 /* 1309 /*
1316 * We need to catch the early Alchemy SOCs with 1310 * We need to catch the early Alchemy SOCs with
1317 * the write-only co_config.od bit and set it back to one... 1311 * the write-only co_config.od bit and set it back to one on:
1312 * Au1000 rev DA, HA, HB; Au1100 AB, BA, BC, Au1500 AB
1318 */ 1313 */
1319 case CPU_AU1000: /* rev. DA, HA, HB */ 1314 case CPU_ALCHEMY:
1320 case CPU_AU1100: /* rev. AB, BA, BC ?? */
1321 case CPU_AU1500: /* rev. AB */
1322 au1x00_fixup_config_od(); 1315 au1x00_fixup_config_od();
1323 break; 1316 break;
1324 1317
diff --git a/arch/mips/mm/highmem.c b/arch/mips/mm/highmem.c
index 8f2cd8eda741..060d28dca8a8 100644
--- a/arch/mips/mm/highmem.c
+++ b/arch/mips/mm/highmem.c
@@ -17,8 +17,7 @@ void *__kmap(struct page *page)
17 17
18void __kunmap(struct page *page) 18void __kunmap(struct page *page)
19{ 19{
20 if (in_interrupt()) 20 BUG_ON(in_interrupt());
21 BUG();
22 if (!PageHighMem(page)) 21 if (!PageHighMem(page))
23 return; 22 return;
24 kunmap_high(page); 23 kunmap_high(page);
@@ -46,8 +45,7 @@ void *__kmap_atomic(struct page *page, enum km_type type)
46 idx = type + KM_TYPE_NR*smp_processor_id(); 45 idx = type + KM_TYPE_NR*smp_processor_id();
47 vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx); 46 vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
48#ifdef CONFIG_DEBUG_HIGHMEM 47#ifdef CONFIG_DEBUG_HIGHMEM
49 if (!pte_none(*(kmap_pte-idx))) 48 BUG_ON(!pte_none(*(kmap_pte - idx)));
50 BUG();
51#endif 49#endif
52 set_pte(kmap_pte-idx, mk_pte(page, kmap_prot)); 50 set_pte(kmap_pte-idx, mk_pte(page, kmap_prot));
53 local_flush_tlb_one((unsigned long)vaddr); 51 local_flush_tlb_one((unsigned long)vaddr);
@@ -66,8 +64,7 @@ void __kunmap_atomic(void *kvaddr, enum km_type type)
66 return; 64 return;
67 } 65 }
68 66
69 if (vaddr != __fix_to_virt(FIX_KMAP_BEGIN+idx)) 67 BUG_ON(vaddr != __fix_to_virt(FIX_KMAP_BEGIN + idx));
70 BUG();
71 68
72 /* 69 /*
73 * force other mappings to Oops if they'll try to access 70 * force other mappings to Oops if they'll try to access
diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c
index 137c14bafd6b..d9348946a19e 100644
--- a/arch/mips/mm/init.c
+++ b/arch/mips/mm/init.c
@@ -307,8 +307,7 @@ void __init fixrange_init(unsigned long start, unsigned long end,
307 if (pmd_none(*pmd)) { 307 if (pmd_none(*pmd)) {
308 pte = (pte_t *) alloc_bootmem_low_pages(PAGE_SIZE); 308 pte = (pte_t *) alloc_bootmem_low_pages(PAGE_SIZE);
309 set_pmd(pmd, __pmd((unsigned long)pte)); 309 set_pmd(pmd, __pmd((unsigned long)pte));
310 if (pte != pte_offset_kernel(pmd, 0)) 310 BUG_ON(pte != pte_offset_kernel(pmd, 0));
311 BUG();
312 } 311 }
313 vaddr += PMD_SIZE; 312 vaddr += PMD_SIZE;
314 } 313 }
diff --git a/arch/mips/mm/ioremap.c b/arch/mips/mm/ioremap.c
index 59945b9ee23c..0c43248347bd 100644
--- a/arch/mips/mm/ioremap.c
+++ b/arch/mips/mm/ioremap.c
@@ -27,8 +27,7 @@ static inline void remap_area_pte(pte_t * pte, unsigned long address,
27 end = address + size; 27 end = address + size;
28 if (end > PMD_SIZE) 28 if (end > PMD_SIZE)
29 end = PMD_SIZE; 29 end = PMD_SIZE;
30 if (address >= end) 30 BUG_ON(address >= end);
31 BUG();
32 pfn = phys_addr >> PAGE_SHIFT; 31 pfn = phys_addr >> PAGE_SHIFT;
33 do { 32 do {
34 if (!pte_none(*pte)) { 33 if (!pte_none(*pte)) {
@@ -52,8 +51,7 @@ static inline int remap_area_pmd(pmd_t * pmd, unsigned long address,
52 if (end > PGDIR_SIZE) 51 if (end > PGDIR_SIZE)
53 end = PGDIR_SIZE; 52 end = PGDIR_SIZE;
54 phys_addr -= address; 53 phys_addr -= address;
55 if (address >= end) 54 BUG_ON(address >= end);
56 BUG();
57 do { 55 do {
58 pte_t * pte = pte_alloc_kernel(pmd, address); 56 pte_t * pte = pte_alloc_kernel(pmd, address);
59 if (!pte) 57 if (!pte)
@@ -75,8 +73,7 @@ static int remap_area_pages(unsigned long address, phys_t phys_addr,
75 phys_addr -= address; 73 phys_addr -= address;
76 dir = pgd_offset(&init_mm, address); 74 dir = pgd_offset(&init_mm, address);
77 flush_cache_all(); 75 flush_cache_all();
78 if (address >= end) 76 BUG_ON(address >= end);
79 BUG();
80 do { 77 do {
81 pud_t *pud; 78 pud_t *pud;
82 pmd_t *pmd; 79 pmd_t *pmd;
diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c
index f335cf6cdd78..0615b62efd6d 100644
--- a/arch/mips/mm/tlbex.c
+++ b/arch/mips/mm/tlbex.c
@@ -292,13 +292,6 @@ static void __cpuinit build_tlb_write_entry(u32 **p, struct uasm_label **l,
292 case CPU_R4300: 292 case CPU_R4300:
293 case CPU_5KC: 293 case CPU_5KC:
294 case CPU_TX49XX: 294 case CPU_TX49XX:
295 case CPU_AU1000:
296 case CPU_AU1100:
297 case CPU_AU1500:
298 case CPU_AU1550:
299 case CPU_AU1200:
300 case CPU_AU1210:
301 case CPU_AU1250:
302 case CPU_PR4450: 295 case CPU_PR4450:
303 uasm_i_nop(p); 296 uasm_i_nop(p);
304 tlbw(p); 297 tlbw(p);
@@ -321,6 +314,7 @@ static void __cpuinit build_tlb_write_entry(u32 **p, struct uasm_label **l,
321 case CPU_R5500: 314 case CPU_R5500:
322 if (m4kc_tlbp_war()) 315 if (m4kc_tlbp_war())
323 uasm_i_nop(p); 316 uasm_i_nop(p);
317 case CPU_ALCHEMY:
324 tlbw(p); 318 tlbw(p);
325 break; 319 break;
326 320
diff --git a/arch/mips/mti-malta/malta-init.c b/arch/mips/mti-malta/malta-init.c
index 4832af251668..475038a141a6 100644
--- a/arch/mips/mti-malta/malta-init.c
+++ b/arch/mips/mti-malta/malta-init.c
@@ -48,7 +48,7 @@ int *_prom_argv, *_prom_envp;
48 48
49int init_debug = 0; 49int init_debug = 0;
50 50
51int mips_revision_corid; 51static int mips_revision_corid;
52int mips_revision_sconid; 52int mips_revision_sconid;
53 53
54/* Bonito64 system controller register base. */ 54/* Bonito64 system controller register base. */
diff --git a/arch/mips/sgi-ip27/ip27-berr.c b/arch/mips/sgi-ip27/ip27-berr.c
index 7d05e68fdc77..04cebadc2b3c 100644
--- a/arch/mips/sgi-ip27/ip27-berr.c
+++ b/arch/mips/sgi-ip27/ip27-berr.c
@@ -66,7 +66,7 @@ int ip27_be_handler(struct pt_regs *regs, int is_fixup)
66 printk("Slice %c got %cbe at 0x%lx\n", 'A' + cpu, data ? 'd' : 'i', 66 printk("Slice %c got %cbe at 0x%lx\n", 'A' + cpu, data ? 'd' : 'i',
67 regs->cp0_epc); 67 regs->cp0_epc);
68 printk("Hub information:\n"); 68 printk("Hub information:\n");
69 printk("ERR_INT_PEND = 0x%06lx\n", LOCAL_HUB_L(PI_ERR_INT_PEND)); 69 printk("ERR_INT_PEND = 0x%06llx\n", LOCAL_HUB_L(PI_ERR_INT_PEND));
70 errst0 = LOCAL_HUB_L(cpu ? PI_ERR_STATUS0_B : PI_ERR_STATUS0_A); 70 errst0 = LOCAL_HUB_L(cpu ? PI_ERR_STATUS0_B : PI_ERR_STATUS0_A);
71 errst1 = LOCAL_HUB_L(cpu ? PI_ERR_STATUS1_B : PI_ERR_STATUS1_A); 71 errst1 = LOCAL_HUB_L(cpu ? PI_ERR_STATUS1_B : PI_ERR_STATUS1_A);
72 dump_hub_information(errst0, errst1); 72 dump_hub_information(errst0, errst1);
diff --git a/arch/mips/sgi-ip27/ip27-nmi.c b/arch/mips/sgi-ip27/ip27-nmi.c
index 64459e7d891b..6c5a630566f9 100644
--- a/arch/mips/sgi-ip27/ip27-nmi.c
+++ b/arch/mips/sgi-ip27/ip27-nmi.c
@@ -143,8 +143,8 @@ void nmi_dump_hub_irq(nasid_t nasid, int slice)
143 pend0 = REMOTE_HUB_L(nasid, PI_INT_PEND0); 143 pend0 = REMOTE_HUB_L(nasid, PI_INT_PEND0);
144 pend1 = REMOTE_HUB_L(nasid, PI_INT_PEND1); 144 pend1 = REMOTE_HUB_L(nasid, PI_INT_PEND1);
145 145
146 printk("PI_INT_MASK0: %16lx PI_INT_MASK1: %16lx\n", mask0, mask1); 146 printk("PI_INT_MASK0: %16Lx PI_INT_MASK1: %16Lx\n", mask0, mask1);
147 printk("PI_INT_PEND0: %16lx PI_INT_PEND1: %16lx\n", pend0, pend1); 147 printk("PI_INT_PEND0: %16Lx PI_INT_PEND1: %16Lx\n", pend0, pend1);
148 printk("\n\n"); 148 printk("\n\n");
149} 149}
150 150
@@ -219,7 +219,7 @@ cont_nmi_dump(void)
219 if (i == 1000) { 219 if (i == 1000) {
220 for_each_online_node(node) 220 for_each_online_node(node)
221 if (NODEPDA(node)->dump_count == 0) { 221 if (NODEPDA(node)->dump_count == 0) {
222 cpu = node_to_first_cpu(node); 222 cpu = cpumask_first(cpumask_of_node(node));
223 for (n=0; n < CNODE_NUM_CPUS(node); cpu++, n++) { 223 for (n=0; n < CNODE_NUM_CPUS(node); cpu++, n++) {
224 CPUMASK_SETB(nmied_cpus, cpu); 224 CPUMASK_SETB(nmied_cpus, cpu);
225 /* 225 /*
diff --git a/arch/mips/sgi-ip32/ip32-irq.c b/arch/mips/sgi-ip32/ip32-irq.c
index 0d6b6663d5f6..83a0b3c359da 100644
--- a/arch/mips/sgi-ip32/ip32-irq.c
+++ b/arch/mips/sgi-ip32/ip32-irq.c
@@ -115,14 +115,12 @@ extern irqreturn_t crime_cpuerr_intr(int irq, void *dev_id);
115struct irqaction memerr_irq = { 115struct irqaction memerr_irq = {
116 .handler = crime_memerr_intr, 116 .handler = crime_memerr_intr,
117 .flags = IRQF_DISABLED, 117 .flags = IRQF_DISABLED,
118 .mask = CPU_MASK_NONE,
119 .name = "CRIME memory error", 118 .name = "CRIME memory error",
120}; 119};
121 120
122struct irqaction cpuerr_irq = { 121struct irqaction cpuerr_irq = {
123 .handler = crime_cpuerr_intr, 122 .handler = crime_cpuerr_intr,
124 .flags = IRQF_DISABLED, 123 .flags = IRQF_DISABLED,
125 .mask = CPU_MASK_NONE,
126 .name = "CRIME CPU error", 124 .name = "CRIME CPU error",
127}; 125};
128 126
@@ -325,16 +323,11 @@ static void mask_and_ack_maceisa_irq(unsigned int irq)
325{ 323{
326 unsigned long mace_int; 324 unsigned long mace_int;
327 325
328 switch (irq) { 326 /* edge triggered */
329 case MACEISA_PARALLEL_IRQ: 327 mace_int = mace->perif.ctrl.istat;
330 case MACEISA_SERIAL1_TDMAPR_IRQ: 328 mace_int &= ~(1 << (irq - MACEISA_AUDIO_SW_IRQ));
331 case MACEISA_SERIAL2_TDMAPR_IRQ: 329 mace->perif.ctrl.istat = mace_int;
332 /* edge triggered */ 330
333 mace_int = mace->perif.ctrl.istat;
334 mace_int &= ~(1 << (irq - MACEISA_AUDIO_SW_IRQ));
335 mace->perif.ctrl.istat = mace_int;
336 break;
337 }
338 disable_maceisa_irq(irq); 331 disable_maceisa_irq(irq);
339} 332}
340 333
@@ -344,7 +337,16 @@ static void end_maceisa_irq(unsigned irq)
344 enable_maceisa_irq(irq); 337 enable_maceisa_irq(irq);
345} 338}
346 339
347static struct irq_chip ip32_maceisa_interrupt = { 340static struct irq_chip ip32_maceisa_level_interrupt = {
341 .name = "IP32 MACE ISA",
342 .ack = disable_maceisa_irq,
343 .mask = disable_maceisa_irq,
344 .mask_ack = disable_maceisa_irq,
345 .unmask = enable_maceisa_irq,
346 .end = end_maceisa_irq,
347};
348
349static struct irq_chip ip32_maceisa_edge_interrupt = {
348 .name = "IP32 MACE ISA", 350 .name = "IP32 MACE ISA",
349 .ack = mask_and_ack_maceisa_irq, 351 .ack = mask_and_ack_maceisa_irq,
350 .mask = disable_maceisa_irq, 352 .mask = disable_maceisa_irq,
@@ -500,27 +502,50 @@ void __init arch_init_irq(void)
500 for (irq = CRIME_IRQ_BASE; irq <= IP32_IRQ_MAX; irq++) { 502 for (irq = CRIME_IRQ_BASE; irq <= IP32_IRQ_MAX; irq++) {
501 switch (irq) { 503 switch (irq) {
502 case MACE_VID_IN1_IRQ ... MACE_PCI_BRIDGE_IRQ: 504 case MACE_VID_IN1_IRQ ... MACE_PCI_BRIDGE_IRQ:
503 set_irq_chip(irq, &ip32_mace_interrupt); 505 set_irq_chip_and_handler_name(irq,&ip32_mace_interrupt,
506 handle_level_irq, "level");
504 break; 507 break;
508
505 case MACEPCI_SCSI0_IRQ ... MACEPCI_SHARED2_IRQ: 509 case MACEPCI_SCSI0_IRQ ... MACEPCI_SHARED2_IRQ:
506 set_irq_chip(irq, &ip32_macepci_interrupt); 510 set_irq_chip_and_handler_name(irq,
511 &ip32_macepci_interrupt, handle_level_irq,
512 "level");
507 break; 513 break;
514
508 case CRIME_GBE0_IRQ ... CRIME_GBE3_IRQ: 515 case CRIME_GBE0_IRQ ... CRIME_GBE3_IRQ:
509 set_irq_chip(irq, &crime_edge_interrupt); 516 set_irq_chip_and_handler_name(irq,
517 &crime_edge_interrupt, handle_edge_irq, "edge");
510 break; 518 break;
511 case CRIME_CPUERR_IRQ: 519 case CRIME_CPUERR_IRQ:
512 case CRIME_MEMERR_IRQ: 520 case CRIME_MEMERR_IRQ:
513 set_irq_chip(irq, &crime_level_interrupt); 521 set_irq_chip_and_handler_name(irq,
522 &crime_level_interrupt, handle_level_irq,
523 "level");
514 break; 524 break;
525
515 case CRIME_RE_EMPTY_E_IRQ ... CRIME_RE_IDLE_E_IRQ: 526 case CRIME_RE_EMPTY_E_IRQ ... CRIME_RE_IDLE_E_IRQ:
516 case CRIME_SOFT0_IRQ ... CRIME_SOFT2_IRQ: 527 case CRIME_SOFT0_IRQ ... CRIME_SOFT2_IRQ:
517 set_irq_chip(irq, &crime_edge_interrupt); 528 set_irq_chip_and_handler_name(irq,
529 &crime_edge_interrupt, handle_edge_irq, "edge");
518 break; 530 break;
531
519 case CRIME_VICE_IRQ: 532 case CRIME_VICE_IRQ:
520 set_irq_chip(irq, &crime_edge_interrupt); 533 set_irq_chip_and_handler_name(irq,
534 &crime_edge_interrupt, handle_edge_irq, "edge");
535 break;
536
537 case MACEISA_PARALLEL_IRQ:
538 case MACEISA_SERIAL1_TDMAPR_IRQ:
539 case MACEISA_SERIAL2_TDMAPR_IRQ:
540 set_irq_chip_and_handler_name(irq,
541 &ip32_maceisa_edge_interrupt, handle_edge_irq,
542 "edge");
521 break; 543 break;
544
522 default: 545 default:
523 set_irq_chip(irq, &ip32_maceisa_interrupt); 546 set_irq_chip_and_handler_name(irq,
547 &ip32_maceisa_level_interrupt, handle_level_irq,
548 "level");
524 break; 549 break;
525 } 550 }
526 } 551 }
diff --git a/arch/mips/sgi-ip32/ip32-memory.c b/arch/mips/sgi-ip32/ip32-memory.c
index ca93ecf825ae..828ce131c228 100644
--- a/arch/mips/sgi-ip32/ip32-memory.c
+++ b/arch/mips/sgi-ip32/ip32-memory.c
@@ -36,7 +36,7 @@ void __init prom_meminit(void)
36 if (base + size > (256 << 20)) 36 if (base + size > (256 << 20))
37 base += CRIME_HI_MEM_BASE; 37 base += CRIME_HI_MEM_BASE;
38 38
39 printk("CRIME MC: bank %u base 0x%016lx size %luMiB\n", 39 printk("CRIME MC: bank %u base 0x%016Lx size %LuMiB\n",
40 bank, base, size >> 20); 40 bank, base, size >> 20);
41 add_memory_region(base, size, BOOT_MEM_RAM); 41 add_memory_region(base, size, BOOT_MEM_RAM);
42 } 42 }
diff --git a/arch/mips/sibyte/bcm1480/irq.c b/arch/mips/sibyte/bcm1480/irq.c
index 12b465d404df..352352b3cb2f 100644
--- a/arch/mips/sibyte/bcm1480/irq.c
+++ b/arch/mips/sibyte/bcm1480/irq.c
@@ -236,7 +236,7 @@ void __init init_bcm1480_irqs(void)
236 int i; 236 int i;
237 237
238 for (i = 0; i < BCM1480_NR_IRQS; i++) { 238 for (i = 0; i < BCM1480_NR_IRQS; i++) {
239 set_irq_chip(i, &bcm1480_irq_type); 239 set_irq_chip_and_handler(i, &bcm1480_irq_type, handle_level_irq);
240 bcm1480_irq_owner[i] = 0; 240 bcm1480_irq_owner[i] = 0;
241 } 241 }
242} 242}
diff --git a/arch/mips/sibyte/sb1250/irq.c b/arch/mips/sibyte/sb1250/irq.c
index 808ac2959b8c..c08ff582da6f 100644
--- a/arch/mips/sibyte/sb1250/irq.c
+++ b/arch/mips/sibyte/sb1250/irq.c
@@ -220,7 +220,7 @@ void __init init_sb1250_irqs(void)
220 int i; 220 int i;
221 221
222 for (i = 0; i < SB1250_NR_IRQS; i++) { 222 for (i = 0; i < SB1250_NR_IRQS; i++) {
223 set_irq_chip(i, &sb1250_irq_type); 223 set_irq_chip_and_handler(i, &sb1250_irq_type, handle_level_irq);
224 sb1250_irq_owner[i] = 0; 224 sb1250_irq_owner[i] = 0;
225 } 225 }
226} 226}
diff --git a/arch/mips/sni/a20r.c b/arch/mips/sni/a20r.c
index 3f8cf5eb2f06..7dd76fb3b645 100644
--- a/arch/mips/sni/a20r.c
+++ b/arch/mips/sni/a20r.c
@@ -219,7 +219,7 @@ void __init sni_a20r_irq_init(void)
219 int i; 219 int i;
220 220
221 for (i = SNI_A20R_IRQ_BASE + 2 ; i < SNI_A20R_IRQ_BASE + 8; i++) 221 for (i = SNI_A20R_IRQ_BASE + 2 ; i < SNI_A20R_IRQ_BASE + 8; i++)
222 set_irq_chip(i, &a20r_irq_type); 222 set_irq_chip_and_handler(i, &a20r_irq_type, handle_level_irq);
223 sni_hwint = a20r_hwint; 223 sni_hwint = a20r_hwint;
224 change_c0_status(ST0_IM, IE_IRQ0); 224 change_c0_status(ST0_IM, IE_IRQ0);
225 setup_irq(SNI_A20R_IRQ_BASE + 3, &sni_isa_irq); 225 setup_irq(SNI_A20R_IRQ_BASE + 3, &sni_isa_irq);
diff --git a/arch/mips/sni/pcimt.c b/arch/mips/sni/pcimt.c
index 834650f371e0..74e6c67982fb 100644
--- a/arch/mips/sni/pcimt.c
+++ b/arch/mips/sni/pcimt.c
@@ -304,7 +304,7 @@ void __init sni_pcimt_irq_init(void)
304 mips_cpu_irq_init(); 304 mips_cpu_irq_init();
305 /* Actually we've got more interrupts to handle ... */ 305 /* Actually we've got more interrupts to handle ... */
306 for (i = PCIMT_IRQ_INT2; i <= PCIMT_IRQ_SCSI; i++) 306 for (i = PCIMT_IRQ_INT2; i <= PCIMT_IRQ_SCSI; i++)
307 set_irq_chip(i, &pcimt_irq_type); 307 set_irq_chip_and_handler(i, &pcimt_irq_type, handle_level_irq);
308 sni_hwint = sni_pcimt_hwint; 308 sni_hwint = sni_pcimt_hwint;
309 change_c0_status(ST0_IM, IE_IRQ1|IE_IRQ3); 309 change_c0_status(ST0_IM, IE_IRQ1|IE_IRQ3);
310} 310}
diff --git a/arch/mips/sni/pcit.c b/arch/mips/sni/pcit.c
index e5f12cf96e8e..071a9573ac7f 100644
--- a/arch/mips/sni/pcit.c
+++ b/arch/mips/sni/pcit.c
@@ -246,7 +246,7 @@ void __init sni_pcit_irq_init(void)
246 246
247 mips_cpu_irq_init(); 247 mips_cpu_irq_init();
248 for (i = SNI_PCIT_INT_START; i <= SNI_PCIT_INT_END; i++) 248 for (i = SNI_PCIT_INT_START; i <= SNI_PCIT_INT_END; i++)
249 set_irq_chip(i, &pcit_irq_type); 249 set_irq_chip_and_handler(i, &pcit_irq_type, handle_level_irq);
250 *(volatile u32 *)SNI_PCIT_INT_REG = 0; 250 *(volatile u32 *)SNI_PCIT_INT_REG = 0;
251 sni_hwint = sni_pcit_hwint; 251 sni_hwint = sni_pcit_hwint;
252 change_c0_status(ST0_IM, IE_IRQ1); 252 change_c0_status(ST0_IM, IE_IRQ1);
@@ -259,7 +259,7 @@ void __init sni_pcit_cplus_irq_init(void)
259 259
260 mips_cpu_irq_init(); 260 mips_cpu_irq_init();
261 for (i = SNI_PCIT_INT_START; i <= SNI_PCIT_INT_END; i++) 261 for (i = SNI_PCIT_INT_START; i <= SNI_PCIT_INT_END; i++)
262 set_irq_chip(i, &pcit_irq_type); 262 set_irq_chip_and_handler(i, &pcit_irq_type, handle_level_irq);
263 *(volatile u32 *)SNI_PCIT_INT_REG = 0x40000000; 263 *(volatile u32 *)SNI_PCIT_INT_REG = 0x40000000;
264 sni_hwint = sni_pcit_hwint_cplus; 264 sni_hwint = sni_pcit_hwint_cplus;
265 change_c0_status(ST0_IM, IE_IRQ0); 265 change_c0_status(ST0_IM, IE_IRQ0);
diff --git a/arch/mips/sni/rm200.c b/arch/mips/sni/rm200.c
index 5310aa75afa4..5e687819cbc2 100644
--- a/arch/mips/sni/rm200.c
+++ b/arch/mips/sni/rm200.c
@@ -359,7 +359,8 @@ void sni_rm200_init_8259A(void)
359 * IRQ2 is cascade interrupt to second interrupt controller 359 * IRQ2 is cascade interrupt to second interrupt controller
360 */ 360 */
361static struct irqaction sni_rm200_irq2 = { 361static struct irqaction sni_rm200_irq2 = {
362 no_action, 0, CPU_MASK_NONE, "cascade", NULL, NULL 362 .handler = no_action,
363 .name = "cascade",
363}; 364};
364 365
365static struct resource sni_rm200_pic1_resource = { 366static struct resource sni_rm200_pic1_resource = {
@@ -487,7 +488,7 @@ void __init sni_rm200_irq_init(void)
487 mips_cpu_irq_init(); 488 mips_cpu_irq_init();
488 /* Actually we've got more interrupts to handle ... */ 489 /* Actually we've got more interrupts to handle ... */
489 for (i = SNI_RM200_INT_START; i <= SNI_RM200_INT_END; i++) 490 for (i = SNI_RM200_INT_START; i <= SNI_RM200_INT_END; i++)
490 set_irq_chip(i, &rm200_irq_type); 491 set_irq_chip_and_handler(i, &rm200_irq_type, handle_level_irq);
491 sni_hwint = sni_rm200_hwint; 492 sni_hwint = sni_rm200_hwint;
492 change_c0_status(ST0_IM, IE_IRQ0); 493 change_c0_status(ST0_IM, IE_IRQ0);
493 setup_irq(SNI_RM200_INT_START + 0, &sni_rm200_i8259A_irq); 494 setup_irq(SNI_RM200_INT_START + 0, &sni_rm200_i8259A_irq);
diff --git a/arch/mips/txx9/Kconfig b/arch/mips/txx9/Kconfig
index 226e8bb2f0a1..0db7cf38ed8b 100644
--- a/arch/mips/txx9/Kconfig
+++ b/arch/mips/txx9/Kconfig
@@ -20,7 +20,6 @@ config MACH_TXX9
20 select SYS_SUPPORTS_32BIT_KERNEL 20 select SYS_SUPPORTS_32BIT_KERNEL
21 select SYS_SUPPORTS_LITTLE_ENDIAN 21 select SYS_SUPPORTS_LITTLE_ENDIAN
22 select SYS_SUPPORTS_BIG_ENDIAN 22 select SYS_SUPPORTS_BIG_ENDIAN
23 select GENERIC_HARDIRQS_NO__DO_IRQ
24 23
25config TOSHIBA_JMR3927 24config TOSHIBA_JMR3927
26 bool "Toshiba JMR-TX3927 board" 25 bool "Toshiba JMR-TX3927 board"
diff --git a/arch/mips/vr41xx/common/irq.c b/arch/mips/vr41xx/common/irq.c
index 92dd1a0ca352..9cc389109b19 100644
--- a/arch/mips/vr41xx/common/irq.c
+++ b/arch/mips/vr41xx/common/irq.c
@@ -32,7 +32,6 @@ static irq_cascade_t irq_cascade[NR_IRQS] __cacheline_aligned;
32 32
33static struct irqaction cascade_irqaction = { 33static struct irqaction cascade_irqaction = {
34 .handler = no_action, 34 .handler = no_action,
35 .mask = CPU_MASK_NONE,
36 .name = "cascade", 35 .name = "cascade",
37}; 36};
38 37
diff --git a/arch/mn10300/kernel/time.c b/arch/mn10300/kernel/time.c
index e4606586f94c..395caf01b909 100644
--- a/arch/mn10300/kernel/time.c
+++ b/arch/mn10300/kernel/time.c
@@ -37,7 +37,6 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id);
37static struct irqaction timer_irq = { 37static struct irqaction timer_irq = {
38 .handler = timer_interrupt, 38 .handler = timer_interrupt,
39 .flags = IRQF_DISABLED | IRQF_SHARED | IRQF_TIMER, 39 .flags = IRQF_DISABLED | IRQF_SHARED | IRQF_TIMER,
40 .mask = CPU_MASK_NONE,
41 .name = "timer", 40 .name = "timer",
42}; 41};
43 42
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 74cc312c347c..ad6b1c084fe3 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -111,6 +111,7 @@ config PPC
111 select HAVE_FTRACE_MCOUNT_RECORD 111 select HAVE_FTRACE_MCOUNT_RECORD
112 select HAVE_DYNAMIC_FTRACE 112 select HAVE_DYNAMIC_FTRACE
113 select HAVE_FUNCTION_TRACER 113 select HAVE_FUNCTION_TRACER
114 select HAVE_FUNCTION_GRAPH_TRACER
114 select ARCH_WANT_OPTIONAL_GPIOLIB 115 select ARCH_WANT_OPTIONAL_GPIOLIB
115 select HAVE_IDE 116 select HAVE_IDE
116 select HAVE_IOREMAP_PROT 117 select HAVE_IOREMAP_PROT
@@ -312,7 +313,7 @@ config ARCH_ENABLE_MEMORY_HOTREMOVE
312 313
313config KEXEC 314config KEXEC
314 bool "kexec system call (EXPERIMENTAL)" 315 bool "kexec system call (EXPERIMENTAL)"
315 depends on (PPC_PRPMC2800 || PPC_MULTIPLATFORM) && EXPERIMENTAL 316 depends on BOOK3S && EXPERIMENTAL
316 help 317 help
317 kexec is a system call that implements the ability to shutdown your 318 kexec is a system call that implements the ability to shutdown your
318 current kernel, and to start another kernel. It is like a reboot 319 current kernel, and to start another kernel. It is like a reboot
@@ -409,6 +410,18 @@ config PPC_HAS_HASH_64K
409 depends on PPC64 410 depends on PPC64
410 default n 411 default n
411 412
413config STDBINUTILS
414 bool "Using standard binutils settings"
415 depends on 44x
416 default y
417 help
418 Turning this option off allows you to select 256KB PAGE_SIZE on 44x.
419 Note, that kernel will be able to run only those applications,
420 which had been compiled using binutils later than 2.17.50.0.3 with
421 '-zmax-page-size' set to 256K (the default is 64K). Or, if using
422 the older binutils, you can patch them with a trivial patch, which
423 changes the ELF_MAXPAGESIZE definition from 0x10000 to 0x40000.
424
412choice 425choice
413 prompt "Page size" 426 prompt "Page size"
414 default PPC_4K_PAGES 427 default PPC_4K_PAGES
@@ -444,6 +457,19 @@ config PPC_64K_PAGES
444 bool "64k page size" if 44x || PPC_STD_MMU_64 457 bool "64k page size" if 44x || PPC_STD_MMU_64
445 select PPC_HAS_HASH_64K if PPC_STD_MMU_64 458 select PPC_HAS_HASH_64K if PPC_STD_MMU_64
446 459
460config PPC_256K_PAGES
461 bool "256k page size" if 44x
462 depends on !STDBINUTILS && (!SHMEM || BROKEN)
463 help
464 Make the page size 256k.
465
466 As the ELF standard only requires alignment to support page
467 sizes up to 64k, you will need to compile all of your user
468 space applications with a non-standard binutils settings
469 (see the STDBINUTILS description for details).
470
471 Say N unless you know what you are doing.
472
447endchoice 473endchoice
448 474
449config FORCE_MAX_ZONEORDER 475config FORCE_MAX_ZONEORDER
@@ -456,6 +482,8 @@ config FORCE_MAX_ZONEORDER
456 default "9" if PPC_STD_MMU_32 && PPC_16K_PAGES 482 default "9" if PPC_STD_MMU_32 && PPC_16K_PAGES
457 range 7 64 if PPC_STD_MMU_32 && PPC_64K_PAGES 483 range 7 64 if PPC_STD_MMU_32 && PPC_64K_PAGES
458 default "7" if PPC_STD_MMU_32 && PPC_64K_PAGES 484 default "7" if PPC_STD_MMU_32 && PPC_64K_PAGES
485 range 5 64 if PPC_STD_MMU_32 && PPC_256K_PAGES
486 default "5" if PPC_STD_MMU_32 && PPC_256K_PAGES
459 range 11 64 487 range 11 64
460 default "11" 488 default "11"
461 help 489 help
@@ -594,6 +622,7 @@ config FSL_SOC
594config FSL_PCI 622config FSL_PCI
595 bool 623 bool
596 select PPC_INDIRECT_PCI 624 select PPC_INDIRECT_PCI
625 select PCI_QUIRKS
597 626
598config 4xx_SOC 627config 4xx_SOC
599 bool 628 bool
@@ -730,6 +759,22 @@ config LOWMEM_SIZE
730 hex "Maximum low memory size (in bytes)" if LOWMEM_SIZE_BOOL 759 hex "Maximum low memory size (in bytes)" if LOWMEM_SIZE_BOOL
731 default "0x30000000" 760 default "0x30000000"
732 761
762config LOWMEM_CAM_NUM_BOOL
763 bool "Set number of CAMs to use to map low memory"
764 depends on ADVANCED_OPTIONS && FSL_BOOKE
765 help
766 This option allows you to set the maximum number of CAM slots that
767 will be used to map low memory. There are a limited number of slots
768 available and even more limited number that will fit in the L1 MMU.
769 However, using more entries will allow mapping more low memory. This
770 can be useful in optimizing the layout of kernel virtual memory.
771
772 Say N here unless you know what you are doing.
773
774config LOWMEM_CAM_NUM
775 int "Number of CAMs to use to map low memory" if LOWMEM_CAM_NUM_BOOL
776 default 3
777
733config RELOCATABLE 778config RELOCATABLE
734 bool "Build a relocatable kernel (EXPERIMENTAL)" 779 bool "Build a relocatable kernel (EXPERIMENTAL)"
735 depends on EXPERIMENTAL && ADVANCED_OPTIONS && FLATMEM && FSL_BOOKE 780 depends on EXPERIMENTAL && ADVANCED_OPTIONS && FLATMEM && FSL_BOOKE
@@ -794,7 +839,7 @@ config PHYSICAL_START
794 839
795config PHYSICAL_ALIGN 840config PHYSICAL_ALIGN
796 hex 841 hex
797 default "0x10000000" if FSL_BOOKE 842 default "0x04000000" if FSL_BOOKE
798 help 843 help
799 This value puts the alignment restrictions on physical address 844 This value puts the alignment restrictions on physical address
800 where kernel is loaded and run from. Kernel is compiled for an 845 where kernel is loaded and run from. Kernel is compiled for an
@@ -815,31 +860,6 @@ config TASK_SIZE
815 default "0x80000000" if PPC_PREP || PPC_8xx 860 default "0x80000000" if PPC_PREP || PPC_8xx
816 default "0xc0000000" 861 default "0xc0000000"
817 862
818config CONSISTENT_START_BOOL
819 bool "Set custom consistent memory pool address"
820 depends on ADVANCED_OPTIONS && NOT_COHERENT_CACHE
821 help
822 This option allows you to set the base virtual address
823 of the consistent memory pool. This pool of virtual
824 memory is used to make consistent memory allocations.
825
826config CONSISTENT_START
827 hex "Base virtual address of consistent memory pool" if CONSISTENT_START_BOOL
828 default "0xfd000000" if (NOT_COHERENT_CACHE && 8xx)
829 default "0xff100000" if NOT_COHERENT_CACHE
830
831config CONSISTENT_SIZE_BOOL
832 bool "Set custom consistent memory pool size"
833 depends on ADVANCED_OPTIONS && NOT_COHERENT_CACHE
834 help
835 This option allows you to set the size of the
836 consistent memory pool. This pool of virtual memory
837 is used to make consistent memory allocations.
838
839config CONSISTENT_SIZE
840 hex "Size of consistent memory pool" if CONSISTENT_SIZE_BOOL
841 default "0x00200000" if NOT_COHERENT_CACHE
842
843config PIN_TLB 863config PIN_TLB
844 bool "Pinned Kernel TLBs (860 ONLY)" 864 bool "Pinned Kernel TLBs (860 ONLY)"
845 depends on ADVANCED_OPTIONS && 8xx 865 depends on ADVANCED_OPTIONS && 8xx
diff --git a/arch/powerpc/Kconfig.debug b/arch/powerpc/Kconfig.debug
index 08f7cc0a1953..22091bbfdc9b 100644
--- a/arch/powerpc/Kconfig.debug
+++ b/arch/powerpc/Kconfig.debug
@@ -129,7 +129,7 @@ config BDI_SWITCH
129 129
130config BOOTX_TEXT 130config BOOTX_TEXT
131 bool "Support for early boot text console (BootX or OpenFirmware only)" 131 bool "Support for early boot text console (BootX or OpenFirmware only)"
132 depends on PPC_OF && PPC_MULTIPLATFORM 132 depends on PPC_OF && PPC_BOOK3S
133 help 133 help
134 Say Y here to see progress messages from the boot firmware in text 134 Say Y here to see progress messages from the boot firmware in text
135 mode. Requires either BootX or Open Firmware. 135 mode. Requires either BootX or Open Firmware.
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 72d17f50e54f..551fc58c05cf 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -147,8 +147,8 @@ core-y += arch/powerpc/kernel/ \
147 arch/powerpc/mm/ \ 147 arch/powerpc/mm/ \
148 arch/powerpc/lib/ \ 148 arch/powerpc/lib/ \
149 arch/powerpc/sysdev/ \ 149 arch/powerpc/sysdev/ \
150 arch/powerpc/platforms/ 150 arch/powerpc/platforms/ \
151core-$(CONFIG_MATH_EMULATION) += arch/powerpc/math-emu/ 151 arch/powerpc/math-emu/
152core-$(CONFIG_XMON) += arch/powerpc/xmon/ 152core-$(CONFIG_XMON) += arch/powerpc/xmon/
153core-$(CONFIG_KVM) += arch/powerpc/kvm/ 153core-$(CONFIG_KVM) += arch/powerpc/kvm/
154 154
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index e84df338ea29..4458abb67c51 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -70,7 +70,7 @@ src-plat := of.c cuboot-52xx.c cuboot-824x.c cuboot-83xx.c cuboot-85xx.c holly.c
70 cuboot-katmai.c cuboot-rainier.c redboot-8xx.c ep8248e.c \ 70 cuboot-katmai.c cuboot-rainier.c redboot-8xx.c ep8248e.c \
71 cuboot-warp.c cuboot-85xx-cpm2.c cuboot-yosemite.c simpleboot.c \ 71 cuboot-warp.c cuboot-85xx-cpm2.c cuboot-yosemite.c simpleboot.c \
72 virtex405-head.S virtex.c redboot-83xx.c cuboot-sam440ep.c \ 72 virtex405-head.S virtex.c redboot-83xx.c cuboot-sam440ep.c \
73 cuboot-acadia.c 73 cuboot-acadia.c cuboot-amigaone.c
74src-boot := $(src-wlib) $(src-plat) empty.c 74src-boot := $(src-wlib) $(src-plat) empty.c
75 75
76src-boot := $(addprefix $(obj)/, $(src-boot)) 76src-boot := $(addprefix $(obj)/, $(src-boot))
@@ -235,7 +235,9 @@ image-$(CONFIG_PPC_ADDER875) += cuImage.adder875-uboot \
235 dtbImage.adder875-redboot 235 dtbImage.adder875-redboot
236 236
237# Board ports in arch/powerpc/platform/52xx/Kconfig 237# Board ports in arch/powerpc/platform/52xx/Kconfig
238image-$(CONFIG_PPC_LITE5200) += cuImage.lite5200 cuImage.lite5200b 238image-$(CONFIG_PPC_LITE5200) += cuImage.lite5200 lite5200.dtb
239image-$(CONFIG_PPC_LITE5200) += cuImage.lite5200b lite5200b.dtb
240image-$(CONFIG_PPC_MEDIA5200) += cuImage.media5200 media5200.dtb
239 241
240# Board ports in arch/powerpc/platform/82xx/Kconfig 242# Board ports in arch/powerpc/platform/82xx/Kconfig
241image-$(CONFIG_MPC8272_ADS) += cuImage.mpc8272ads 243image-$(CONFIG_MPC8272_ADS) += cuImage.mpc8272ads
@@ -274,6 +276,9 @@ image-$(CONFIG_STORCENTER) += cuImage.storcenter
274image-$(CONFIG_MPC7448HPC2) += cuImage.mpc7448hpc2 276image-$(CONFIG_MPC7448HPC2) += cuImage.mpc7448hpc2
275image-$(CONFIG_PPC_C2K) += cuImage.c2k 277image-$(CONFIG_PPC_C2K) += cuImage.c2k
276 278
279# Board port in arch/powerpc/platform/amigaone/Kconfig
280image-$(CONFIG_AMIGAONE) += cuImage.amigaone
281
277# For 32-bit powermacs, build the COFF and miboot images 282# For 32-bit powermacs, build the COFF and miboot images
278# as well as the ELF images. 283# as well as the ELF images.
279ifeq ($(CONFIG_PPC32),y) 284ifeq ($(CONFIG_PPC32),y)
diff --git a/arch/powerpc/boot/cuboot-amigaone.c b/arch/powerpc/boot/cuboot-amigaone.c
new file mode 100644
index 000000000000..d5029674030b
--- /dev/null
+++ b/arch/powerpc/boot/cuboot-amigaone.c
@@ -0,0 +1,35 @@
1/*
2 * Old U-boot compatibility for AmigaOne
3 *
4 * Author: Gerhard Pircher (gerhard_pircher@gmx.net)
5 *
6 * Based on cuboot-83xx.c
7 * Copyright (c) 2007 Freescale Semiconductor, Inc.
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 version 2 as published
11 * by the Free Software Foundation.
12 */
13
14#include "ops.h"
15#include "stdio.h"
16#include "cuboot.h"
17
18#include "ppcboot.h"
19
20static bd_t bd;
21
22static void platform_fixups(void)
23{
24 dt_fixup_memory(bd.bi_memstart, bd.bi_memsize);
25 dt_fixup_cpu_clocks(bd.bi_intfreq, bd.bi_busfreq / 4, bd.bi_busfreq);
26}
27
28void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
29 unsigned long r6, unsigned long r7)
30{
31 CUBOOT_INIT();
32 fdt_init(_dtb_start);
33 serial_console_init();
34 platform_ops.fixups = platform_fixups;
35}
diff --git a/arch/powerpc/boot/dts/amigaone.dts b/arch/powerpc/boot/dts/amigaone.dts
new file mode 100644
index 000000000000..26549fca2ed4
--- /dev/null
+++ b/arch/powerpc/boot/dts/amigaone.dts
@@ -0,0 +1,173 @@
1/*
2 * AmigaOne Device Tree Source
3 *
4 * Copyright 2008 Gerhard Pircher (gerhard_pircher@gmx.net)
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
10 */
11
12/dts-v1/;
13
14/ {
15 model = "AmigaOne";
16 compatible = "eyetech,amigaone";
17 coherency-off;
18 #address-cells = <1>;
19 #size-cells = <1>;
20
21 cpus {
22 #cpus = <1>;
23 #address-cells = <1>;
24 #size-cells = <0>;
25
26 cpu@0 {
27 device_type = "cpu";
28 reg = <0>;
29 d-cache-line-size = <32>; // 32 bytes
30 i-cache-line-size = <32>; // 32 bytes
31 d-cache-size = <32768>; // L1, 32K
32 i-cache-size = <32768>; // L1, 32K
33 timebase-frequency = <0>; // 33.3 MHz, from U-boot
34 clock-frequency = <0>; // From U-boot
35 bus-frequency = <0>; // From U-boot
36 };
37 };
38
39 memory {
40 device_type = "memory";
41 reg = <0 0>; // From U-boot
42 };
43
44 pci@80000000 {
45 device_type = "pci";
46 compatible = "mai-logic,articia-s";
47 bus-frequency = <33333333>;
48 bus-range = <0 0xff>;
49 ranges = <0x01000000 0 0x00000000 0xfe000000 0 0x00c00000 // PCI I/O
50 0x02000000 0 0x80000000 0x80000000 0 0x7d000000 // PCI memory
51 0x02000000 0 0x00000000 0xfd000000 0 0x01000000>; // PCI alias memory (ISA)
52 // Configuration address and data register.
53 reg = <0xfec00cf8 4
54 0xfee00cfc 4>;
55 8259-interrupt-acknowledge = <0xfef00000>;
56 // Do not define a interrupt-parent here, if there is no
57 // interrupt-map property.
58 #address-cells = <3>;
59 #size-cells = <2>;
60
61 isa@7 {
62 device_type = "isa";
63 compatible = "pciclass,0601";
64 vendor-id = <0x00001106>;
65 device-id = <0x00000686>;
66 revision-id = <0x00000010>;
67 class-code = <0x00060100>;
68 subsystem-id = <0>;
69 subsystem-vendor-id = <0>;
70 devsel-speed = <0x00000001>;
71 min-grant = <0>;
72 max-latency = <0>;
73 /* First 64k for I/O at 0x0 on PCI mapped to 0x0 on ISA. */
74 ranges = <0x00000001 0 0x01000000 0 0x00000000 0x00010000>;
75 interrupt-parent = <&i8259>;
76 #interrupt-cells = <2>;
77 #address-cells = <2>;
78 #size-cells = <1>;
79
80 dma-controller@0 {
81 compatible = "pnpPNP,200";
82 reg = <1 0x00000000 0x00000020
83 1 0x00000080 0x00000010
84 1 0x000000c0 0x00000020>;
85 };
86
87 i8259: interrupt-controller@20 {
88 device_type = "interrupt-controller";
89 compatible = "pnpPNP,000";
90 interrupt-controller;
91 reg = <1 0x00000020 0x00000002
92 1 0x000000a0 0x00000002
93 1 0x000004d0 0x00000002>;
94 reserved-interrupts = <2>;
95 #interrupt-cells = <2>;
96 };
97
98 timer@40 {
99 // Also adds pcspkr to platform devices.
100 compatible = "pnpPNP,100";
101 reg = <1 0x00000040 0x00000020>;
102 };
103
104 8042@60 {
105 device_type = "8042";
106 reg = <1 0x00000060 0x00000001
107 1 0x00000064 0x00000001>;
108 interrupts = <1 3 12 3>;
109 #address-cells = <1>;
110 #size-cells = <0>;
111
112 keyboard@0 {
113 compatible = "pnpPNP,303";
114 reg = <0>;
115 };
116
117 mouse@1 {
118 compatible = "pnpPNP,f03";
119 reg = <1>;
120 };
121 };
122
123 rtc@70 {
124 compatible = "pnpPNP,b00";
125 reg = <1 0x00000070 0x00000002>;
126 interrupts = <8 3>;
127 };
128
129 serial@3f8 {
130 device_type = "serial";
131 compatible = "pnpPNP,501","pnpPNP,500";
132 reg = <1 0x000003f8 0x00000008>;
133 interrupts = <4 3>;
134 clock-frequency = <1843200>;
135 current-speed = <115200>;
136 };
137
138 serial@2f8 {
139 device_type = "serial";
140 compatible = "pnpPNP,501","pnpPNP,500";
141 reg = <1 0x000002f8 0x00000008>;
142 interrupts = <3 3>;
143 clock-frequency = <1843200>;
144 current-speed = <115200>;
145 };
146
147 parallel@378 {
148 device_type = "parallel";
149 // No ECP support for now, otherwise add "pnpPNP,401".
150 compatible = "pnpPNP,400";
151 reg = <1 0x00000378 0x00000003
152 1 0x00000778 0x00000003>;
153 };
154
155 fdc@3f0 {
156 device_type = "fdc";
157 compatible = "pnpPNP,700";
158 reg = <1 0x000003f0 0x00000008>;
159 interrupts = <6 3>;
160 #address-cells = <1>;
161 #size-cells = <0>;
162
163 disk@0 {
164 reg = <0>;
165 };
166 };
167 };
168 };
169
170 chosen {
171 linux,stdout-path = "/pci@80000000/isa@7/serial@3f8";
172 };
173};
diff --git a/arch/powerpc/boot/dts/asp834x-redboot.dts b/arch/powerpc/boot/dts/asp834x-redboot.dts
index 524af7ef9f26..7da84fd7be93 100644
--- a/arch/powerpc/boot/dts/asp834x-redboot.dts
+++ b/arch/powerpc/boot/dts/asp834x-redboot.dts
@@ -181,70 +181,76 @@
181 phy_type = "ulpi"; 181 phy_type = "ulpi";
182 }; 182 };
183 183
184 mdio@24520 {
185 #address-cells = <1>;
186 #size-cells = <0>;
187 compatible = "fsl,gianfar-mdio";
188 reg = <0x24520 0x20>;
189
190 phy0: ethernet-phy@0 {
191 interrupt-parent = <&ipic>;
192 interrupts = <17 0x8>;
193 reg = <0x1>;
194 device_type = "ethernet-phy";
195 };
196 phy1: ethernet-phy@1 {
197 interrupt-parent = <&ipic>;
198 interrupts = <18 0x8>;
199 reg = <0x2>;
200 device_type = "ethernet-phy";
201 };
202
203 tbi0: tbi-phy@11 {
204 reg = <0x11>;
205 device_type = "tbi-phy";
206 };
207 };
208
209 mdio@25520 {
210 #address-cells = <1>;
211 #size-cells = <0>;
212 compatible = "fsl,gianfar-tbi";
213 reg = <0x25520 0x20>;
214
215 tbi1: tbi-phy@11 {
216 reg = <0x11>;
217 device_type = "tbi-phy";
218 };
219 };
220
221
222 enet0: ethernet@24000 { 184 enet0: ethernet@24000 {
185 #address-cells = <1>;
186 #size-cells = <1>;
223 cell-index = <0>; 187 cell-index = <0>;
224 device_type = "network"; 188 device_type = "network";
225 model = "TSEC"; 189 model = "TSEC";
226 compatible = "gianfar"; 190 compatible = "gianfar";
227 reg = <0x24000 0x1000>; 191 reg = <0x24000 0x1000>;
192 ranges = <0x0 0x24000 0x1000>;
228 local-mac-address = [ 00 08 e5 11 32 33 ]; 193 local-mac-address = [ 00 08 e5 11 32 33 ];
229 interrupts = <32 0x8 33 0x8 34 0x8>; 194 interrupts = <32 0x8 33 0x8 34 0x8>;
230 interrupt-parent = <&ipic>; 195 interrupt-parent = <&ipic>;
231 tbi-handle = <&tbi0>; 196 tbi-handle = <&tbi0>;
232 phy-handle = <&phy0>; 197 phy-handle = <&phy0>;
233 linux,network-index = <0>; 198 linux,network-index = <0>;
199
200 mdio@520 {
201 #address-cells = <1>;
202 #size-cells = <0>;
203 compatible = "fsl,gianfar-mdio";
204 reg = <0x520 0x20>;
205
206 phy0: ethernet-phy@0 {
207 interrupt-parent = <&ipic>;
208 interrupts = <17 0x8>;
209 reg = <0x1>;
210 device_type = "ethernet-phy";
211 };
212
213 phy1: ethernet-phy@1 {
214 interrupt-parent = <&ipic>;
215 interrupts = <18 0x8>;
216 reg = <0x2>;
217 device_type = "ethernet-phy";
218 };
219
220 tbi0: tbi-phy@11 {
221 reg = <0x11>;
222 device_type = "tbi-phy";
223 };
224 };
234 }; 225 };
235 226
236 enet1: ethernet@25000 { 227 enet1: ethernet@25000 {
228 #address-cells = <1>;
229 #size-cells = <1>;
237 cell-index = <1>; 230 cell-index = <1>;
238 device_type = "network"; 231 device_type = "network";
239 model = "TSEC"; 232 model = "TSEC";
240 compatible = "gianfar"; 233 compatible = "gianfar";
241 reg = <0x25000 0x1000>; 234 reg = <0x25000 0x1000>;
235 ranges = <0x0 0x25000 0x1000>;
242 local-mac-address = [ 00 08 e5 11 32 34 ]; 236 local-mac-address = [ 00 08 e5 11 32 34 ];
243 interrupts = <35 0x8 36 0x8 37 0x8>; 237 interrupts = <35 0x8 36 0x8 37 0x8>;
244 interrupt-parent = <&ipic>; 238 interrupt-parent = <&ipic>;
245 tbi-handle = <&tbi1>; 239 tbi-handle = <&tbi1>;
246 phy-handle = <&phy1>; 240 phy-handle = <&phy1>;
247 linux,network-index = <1>; 241 linux,network-index = <1>;
242
243 mdio@520 {
244 #address-cells = <1>;
245 #size-cells = <0>;
246 compatible = "fsl,gianfar-tbi";
247 reg = <0x520 0x20>;
248
249 tbi1: tbi-phy@11 {
250 reg = <0x11>;
251 device_type = "tbi-phy";
252 };
253 };
248 }; 254 };
249 255
250 serial0: serial@4500 { 256 serial0: serial@4500 {
diff --git a/arch/powerpc/boot/dts/canyonlands.dts b/arch/powerpc/boot/dts/canyonlands.dts
index 4447def69dc5..5fd1ad09bdf2 100644
--- a/arch/powerpc/boot/dts/canyonlands.dts
+++ b/arch/powerpc/boot/dts/canyonlands.dts
@@ -149,6 +149,20 @@
149 /*RXDE*/ 0x5 0x4>; 149 /*RXDE*/ 0x5 0x4>;
150 }; 150 };
151 151
152 USB0: ehci@bffd0400 {
153 compatible = "ibm,usb-ehci-460ex", "usb-ehci";
154 interrupt-parent = <&UIC2>;
155 interrupts = <0x1d 4>;
156 reg = <4 0xbffd0400 0x90 4 0xbffd0490 0x70>;
157 };
158
159 USB1: usb@bffd0000 {
160 compatible = "ohci-le";
161 reg = <4 0xbffd0000 0x60>;
162 interrupt-parent = <&UIC2>;
163 interrupts = <0x1e 4>;
164 };
165
152 POB0: opb { 166 POB0: opb {
153 compatible = "ibm,opb-460ex", "ibm,opb"; 167 compatible = "ibm,opb-460ex", "ibm,opb";
154 #address-cells = <1>; 168 #address-cells = <1>;
@@ -252,6 +266,20 @@
252 reg = <0xef600700 0x00000014>; 266 reg = <0xef600700 0x00000014>;
253 interrupt-parent = <&UIC0>; 267 interrupt-parent = <&UIC0>;
254 interrupts = <0x2 0x4>; 268 interrupts = <0x2 0x4>;
269 #address-cells = <1>;
270 #size-cells = <0>;
271 rtc@68 {
272 compatible = "stm,m41t80";
273 reg = <0x68>;
274 interrupt-parent = <&UIC2>;
275 interrupts = <0x19 0x8>;
276 };
277 sttm@48 {
278 compatible = "ad,ad7414";
279 reg = <0x48>;
280 interrupt-parent = <&UIC1>;
281 interrupts = <0x14 0x8>;
282 };
255 }; 283 };
256 284
257 IIC1: i2c@ef600800 { 285 IIC1: i2c@ef600800 {
diff --git a/arch/powerpc/boot/dts/cm5200.dts b/arch/powerpc/boot/dts/cm5200.dts
index 2f74cc4e093e..cee8080aa245 100644
--- a/arch/powerpc/boot/dts/cm5200.dts
+++ b/arch/powerpc/boot/dts/cm5200.dts
@@ -17,6 +17,7 @@
17 compatible = "schindler,cm5200"; 17 compatible = "schindler,cm5200";
18 #address-cells = <1>; 18 #address-cells = <1>;
19 #size-cells = <1>; 19 #size-cells = <1>;
20 interrupt-parent = <&mpc5200_pic>;
20 21
21 cpus { 22 cpus {
22 #address-cells = <1>; 23 #address-cells = <1>;
@@ -66,7 +67,6 @@
66 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt"; 67 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
67 reg = <0x600 0x10>; 68 reg = <0x600 0x10>;
68 interrupts = <1 9 0>; 69 interrupts = <1 9 0>;
69 interrupt-parent = <&mpc5200_pic>;
70 fsl,has-wdt; 70 fsl,has-wdt;
71 }; 71 };
72 72
@@ -74,84 +74,76 @@
74 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt"; 74 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
75 reg = <0x610 0x10>; 75 reg = <0x610 0x10>;
76 interrupts = <1 10 0>; 76 interrupts = <1 10 0>;
77 interrupt-parent = <&mpc5200_pic>;
78 }; 77 };
79 78
80 timer@620 { // General Purpose Timer 79 timer@620 { // General Purpose Timer
81 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt"; 80 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
82 reg = <0x620 0x10>; 81 reg = <0x620 0x10>;
83 interrupts = <1 11 0>; 82 interrupts = <1 11 0>;
84 interrupt-parent = <&mpc5200_pic>;
85 }; 83 };
86 84
87 timer@630 { // General Purpose Timer 85 timer@630 { // General Purpose Timer
88 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt"; 86 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
89 reg = <0x630 0x10>; 87 reg = <0x630 0x10>;
90 interrupts = <1 12 0>; 88 interrupts = <1 12 0>;
91 interrupt-parent = <&mpc5200_pic>;
92 }; 89 };
93 90
94 timer@640 { // General Purpose Timer 91 timer@640 { // General Purpose Timer
95 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt"; 92 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
96 reg = <0x640 0x10>; 93 reg = <0x640 0x10>;
97 interrupts = <1 13 0>; 94 interrupts = <1 13 0>;
98 interrupt-parent = <&mpc5200_pic>;
99 }; 95 };
100 96
101 timer@650 { // General Purpose Timer 97 timer@650 { // General Purpose Timer
102 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt"; 98 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
103 reg = <0x650 0x10>; 99 reg = <0x650 0x10>;
104 interrupts = <1 14 0>; 100 interrupts = <1 14 0>;
105 interrupt-parent = <&mpc5200_pic>;
106 }; 101 };
107 102
108 timer@660 { // General Purpose Timer 103 timer@660 { // General Purpose Timer
109 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt"; 104 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
110 reg = <0x660 0x10>; 105 reg = <0x660 0x10>;
111 interrupts = <1 15 0>; 106 interrupts = <1 15 0>;
112 interrupt-parent = <&mpc5200_pic>;
113 }; 107 };
114 108
115 timer@670 { // General Purpose Timer 109 timer@670 { // General Purpose Timer
116 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt"; 110 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
117 reg = <0x670 0x10>; 111 reg = <0x670 0x10>;
118 interrupts = <1 16 0>; 112 interrupts = <1 16 0>;
119 interrupt-parent = <&mpc5200_pic>;
120 }; 113 };
121 114
122 rtc@800 { // Real time clock 115 rtc@800 { // Real time clock
123 compatible = "fsl,mpc5200b-rtc","fsl,mpc5200-rtc"; 116 compatible = "fsl,mpc5200b-rtc","fsl,mpc5200-rtc";
124 reg = <0x800 0x100>; 117 reg = <0x800 0x100>;
125 interrupts = <1 5 0 1 6 0>; 118 interrupts = <1 5 0 1 6 0>;
126 interrupt-parent = <&mpc5200_pic>;
127 }; 119 };
128 120
129 gpio@b00 { 121 gpio_simple: gpio@b00 {
130 compatible = "fsl,mpc5200b-gpio","fsl,mpc5200-gpio"; 122 compatible = "fsl,mpc5200b-gpio","fsl,mpc5200-gpio";
131 reg = <0xb00 0x40>; 123 reg = <0xb00 0x40>;
132 interrupts = <1 7 0>; 124 interrupts = <1 7 0>;
133 interrupt-parent = <&mpc5200_pic>; 125 gpio-controller;
126 #gpio-cells = <2>;
134 }; 127 };
135 128
136 gpio@c00 { 129 gpio_wkup: gpio@c00 {
137 compatible = "fsl,mpc5200b-gpio-wkup","fsl,mpc5200-gpio-wkup"; 130 compatible = "fsl,mpc5200b-gpio-wkup","fsl,mpc5200-gpio-wkup";
138 reg = <0xc00 0x40>; 131 reg = <0xc00 0x40>;
139 interrupts = <1 8 0 0 3 0>; 132 interrupts = <1 8 0 0 3 0>;
140 interrupt-parent = <&mpc5200_pic>; 133 gpio-controller;
134 #gpio-cells = <2>;
141 }; 135 };
142 136
143 spi@f00 { 137 spi@f00 {
144 compatible = "fsl,mpc5200b-spi","fsl,mpc5200-spi"; 138 compatible = "fsl,mpc5200b-spi","fsl,mpc5200-spi";
145 reg = <0xf00 0x20>; 139 reg = <0xf00 0x20>;
146 interrupts = <2 13 0 2 14 0>; 140 interrupts = <2 13 0 2 14 0>;
147 interrupt-parent = <&mpc5200_pic>;
148 }; 141 };
149 142
150 usb@1000 { 143 usb@1000 {
151 compatible = "fsl,mpc5200b-ohci","fsl,mpc5200-ohci","ohci-be"; 144 compatible = "fsl,mpc5200b-ohci","fsl,mpc5200-ohci","ohci-be";
152 reg = <0x1000 0xff>; 145 reg = <0x1000 0xff>;
153 interrupts = <2 6 0>; 146 interrupts = <2 6 0>;
154 interrupt-parent = <&mpc5200_pic>;
155 }; 147 };
156 148
157 dma-controller@1200 { 149 dma-controller@1200 {
@@ -161,7 +153,6 @@
161 3 4 0 3 5 0 3 6 0 3 7 0 153 3 4 0 3 5 0 3 6 0 3 7 0
162 3 8 0 3 9 0 3 10 0 3 11 0 154 3 8 0 3 9 0 3 10 0 3 11 0
163 3 12 0 3 13 0 3 14 0 3 15 0>; 155 3 12 0 3 13 0 3 14 0 3 15 0>;
164 interrupt-parent = <&mpc5200_pic>;
165 }; 156 };
166 157
167 xlb@1f00 { 158 xlb@1f00 {
@@ -170,48 +161,34 @@
170 }; 161 };
171 162
172 serial@2000 { // PSC1 163 serial@2000 { // PSC1
173 device_type = "serial";
174 compatible = "fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart"; 164 compatible = "fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart";
175 port-number = <0>; // Logical port assignment
176 reg = <0x2000 0x100>; 165 reg = <0x2000 0x100>;
177 interrupts = <2 1 0>; 166 interrupts = <2 1 0>;
178 interrupt-parent = <&mpc5200_pic>;
179 }; 167 };
180 168
181 serial@2200 { // PSC2 169 serial@2200 { // PSC2
182 device_type = "serial"; 170 compatible = "fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart";
183 compatible = "fsl,mpc5200-psc-uart";
184 port-number = <1>; // Logical port assignment
185 reg = <0x2200 0x100>; 171 reg = <0x2200 0x100>;
186 interrupts = <2 2 0>; 172 interrupts = <2 2 0>;
187 interrupt-parent = <&mpc5200_pic>;
188 }; 173 };
189 174
190 serial@2400 { // PSC3 175 serial@2400 { // PSC3
191 device_type = "serial"; 176 compatible = "fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart";
192 compatible = "fsl,mpc5200-psc-uart";
193 port-number = <2>; // Logical port assignment
194 reg = <0x2400 0x100>; 177 reg = <0x2400 0x100>;
195 interrupts = <2 3 0>; 178 interrupts = <2 3 0>;
196 interrupt-parent = <&mpc5200_pic>;
197 }; 179 };
198 180
199 serial@2c00 { // PSC6 181 serial@2c00 { // PSC6
200 device_type = "serial";
201 compatible = "fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart"; 182 compatible = "fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart";
202 port-number = <5>; // Logical port assignment
203 reg = <0x2c00 0x100>; 183 reg = <0x2c00 0x100>;
204 interrupts = <2 4 0>; 184 interrupts = <2 4 0>;
205 interrupt-parent = <&mpc5200_pic>;
206 }; 185 };
207 186
208 ethernet@3000 { 187 ethernet@3000 {
209 device_type = "network";
210 compatible = "fsl,mpc5200b-fec","fsl,mpc5200-fec"; 188 compatible = "fsl,mpc5200b-fec","fsl,mpc5200-fec";
211 reg = <0x3000 0x400>; 189 reg = <0x3000 0x400>;
212 local-mac-address = [ 00 00 00 00 00 00 ]; 190 local-mac-address = [ 00 00 00 00 00 00 ];
213 interrupts = <2 5 0>; 191 interrupts = <2 5 0>;
214 interrupt-parent = <&mpc5200_pic>;
215 phy-handle = <&phy0>; 192 phy-handle = <&phy0>;
216 }; 193 };
217 194
@@ -221,10 +198,8 @@
221 compatible = "fsl,mpc5200b-mdio","fsl,mpc5200-mdio"; 198 compatible = "fsl,mpc5200b-mdio","fsl,mpc5200-mdio";
222 reg = <0x3000 0x400>; // fec range, since we need to setup fec interrupts 199 reg = <0x3000 0x400>; // fec range, since we need to setup fec interrupts
223 interrupts = <2 5 0>; // these are for "mii command finished", not link changes & co. 200 interrupts = <2 5 0>; // these are for "mii command finished", not link changes & co.
224 interrupt-parent = <&mpc5200_pic>;
225 201
226 phy0: ethernet-phy@0 { 202 phy0: ethernet-phy@0 {
227 device_type = "ethernet-phy";
228 reg = <0>; 203 reg = <0>;
229 }; 204 };
230 }; 205 };
@@ -235,7 +210,6 @@
235 compatible = "fsl,mpc5200b-i2c","fsl,mpc5200-i2c","fsl-i2c"; 210 compatible = "fsl,mpc5200b-i2c","fsl,mpc5200-i2c","fsl-i2c";
236 reg = <0x3d40 0x40>; 211 reg = <0x3d40 0x40>;
237 interrupts = <2 16 0>; 212 interrupts = <2 16 0>;
238 interrupt-parent = <&mpc5200_pic>;
239 fsl5200-clocking; 213 fsl5200-clocking;
240 }; 214 };
241 215
@@ -245,9 +219,8 @@
245 }; 219 };
246 }; 220 };
247 221
248 lpb { 222 localbus {
249 model = "fsl,lpb"; 223 compatible = "fsl,mpc5200b-lpb","simple-bus";
250 compatible = "fsl,lpb";
251 #address-cells = <2>; 224 #address-cells = <2>;
252 #size-cells = <1>; 225 #size-cells = <1>;
253 ranges = <0 0 0xfc000000 0x2000000>; 226 ranges = <0 0 0xfc000000 0x2000000>;
diff --git a/arch/powerpc/boot/dts/digsy_mtc.dts b/arch/powerpc/boot/dts/digsy_mtc.dts
new file mode 100644
index 000000000000..4c36186ef946
--- /dev/null
+++ b/arch/powerpc/boot/dts/digsy_mtc.dts
@@ -0,0 +1,254 @@
1/*
2 * Digsy MTC board Device Tree Source
3 *
4 * Copyright (C) 2009 Semihalf
5 *
6 * Based on the CM5200 by M. Balakowicz
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
14/dts-v1/;
15
16/ {
17 model = "intercontrol,digsy-mtc";
18 compatible = "intercontrol,digsy-mtc";
19 #address-cells = <1>;
20 #size-cells = <1>;
21 interrupt-parent = <&mpc5200_pic>;
22
23 cpus {
24 #address-cells = <1>;
25 #size-cells = <0>;
26
27 PowerPC,5200@0 {
28 device_type = "cpu";
29 reg = <0>;
30 d-cache-line-size = <32>;
31 i-cache-line-size = <32>;
32 d-cache-size = <0x4000>; // L1, 16K
33 i-cache-size = <0x4000>; // L1, 16K
34 timebase-frequency = <0>; // from bootloader
35 bus-frequency = <0>; // from bootloader
36 clock-frequency = <0>; // from bootloader
37 };
38 };
39
40 memory {
41 device_type = "memory";
42 reg = <0x00000000 0x02000000>; // 32MB
43 };
44
45 soc5200@f0000000 {
46 #address-cells = <1>;
47 #size-cells = <1>;
48 compatible = "fsl,mpc5200b-immr";
49 ranges = <0 0xf0000000 0x0000c000>;
50 reg = <0xf0000000 0x00000100>;
51 bus-frequency = <0>; // from bootloader
52 system-frequency = <0>; // from bootloader
53
54 cdm@200 {
55 compatible = "fsl,mpc5200b-cdm","fsl,mpc5200-cdm";
56 reg = <0x200 0x38>;
57 };
58
59 mpc5200_pic: interrupt-controller@500 {
60 // 5200 interrupts are encoded into two levels;
61 interrupt-controller;
62 #interrupt-cells = <3>;
63 compatible = "fsl,mpc5200b-pic","fsl,mpc5200-pic";
64 reg = <0x500 0x80>;
65 };
66
67 timer@600 { // General Purpose Timer
68 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
69 reg = <0x600 0x10>;
70 interrupts = <1 9 0>;
71 fsl,has-wdt;
72 };
73
74 timer@610 { // General Purpose Timer
75 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
76 reg = <0x610 0x10>;
77 interrupts = <1 10 0>;
78 };
79
80 timer@620 { // General Purpose Timer
81 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
82 reg = <0x620 0x10>;
83 interrupts = <1 11 0>;
84 };
85
86 timer@630 { // General Purpose Timer
87 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
88 reg = <0x630 0x10>;
89 interrupts = <1 12 0>;
90 };
91
92 timer@640 { // General Purpose Timer
93 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
94 reg = <0x640 0x10>;
95 interrupts = <1 13 0>;
96 };
97
98 timer@650 { // General Purpose Timer
99 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
100 reg = <0x650 0x10>;
101 interrupts = <1 14 0>;
102 };
103
104 timer@660 { // General Purpose Timer
105 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
106 reg = <0x660 0x10>;
107 interrupts = <1 15 0>;
108 };
109
110 timer@670 { // General Purpose Timer
111 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
112 reg = <0x670 0x10>;
113 interrupts = <1 16 0>;
114 };
115
116 gpio_simple: gpio@b00 {
117 compatible = "fsl,mpc5200b-gpio","fsl,mpc5200-gpio";
118 reg = <0xb00 0x40>;
119 interrupts = <1 7 0>;
120 gpio-controller;
121 #gpio-cells = <2>;
122 };
123
124 gpio_wkup: gpio@c00 {
125 compatible = "fsl,mpc5200b-gpio-wkup","fsl,mpc5200-gpio-wkup";
126 reg = <0xc00 0x40>;
127 interrupts = <1 8 0 0 3 0>;
128 gpio-controller;
129 #gpio-cells = <2>;
130 };
131
132 spi@f00 {
133 compatible = "fsl,mpc5200b-spi","fsl,mpc5200-spi";
134 reg = <0xf00 0x20>;
135 interrupts = <2 13 0 2 14 0>;
136 };
137
138 usb@1000 {
139 compatible = "fsl,mpc5200b-ohci","fsl,mpc5200-ohci","ohci-be";
140 reg = <0x1000 0xff>;
141 interrupts = <2 6 0>;
142 };
143
144 dma-controller@1200 {
145 compatible = "fsl,mpc5200b-bestcomm","fsl,mpc5200-bestcomm";
146 reg = <0x1200 0x80>;
147 interrupts = <3 0 0 3 1 0 3 2 0 3 3 0
148 3 4 0 3 5 0 3 6 0 3 7 0
149 3 8 0 3 9 0 3 10 0 3 11 0
150 3 12 0 3 13 0 3 14 0 3 15 0>;
151 };
152
153 xlb@1f00 {
154 compatible = "fsl,mpc5200b-xlb","fsl,mpc5200-xlb";
155 reg = <0x1f00 0x100>;
156 };
157
158 serial@2600 { // PSC4
159 compatible = "fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart";
160 reg = <0x2600 0x100>;
161 interrupts = <2 11 0>;
162 };
163
164 serial@2800 { // PSC5
165 compatible = "fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart";
166 reg = <0x2800 0x100>;
167 interrupts = <2 12 0>;
168 };
169
170 ethernet@3000 {
171 compatible = "fsl,mpc5200b-fec","fsl,mpc5200-fec";
172 reg = <0x3000 0x400>;
173 local-mac-address = [ 00 00 00 00 00 00 ];
174 interrupts = <2 5 0>;
175 phy-handle = <&phy0>;
176 };
177
178 mdio@3000 {
179 #address-cells = <1>;
180 #size-cells = <0>;
181 compatible = "fsl,mpc5200b-mdio","fsl,mpc5200-mdio";
182 reg = <0x3000 0x400>; // fec range, since we need to setup fec interrupts
183 interrupts = <2 5 0>; // these are for "mii command finished", not link changes & co.
184
185 phy0: ethernet-phy@0 {
186 reg = <0>;
187 };
188 };
189
190 ata@3a00 {
191 compatible = "fsl,mpc5200b-ata","fsl,mpc5200-ata";
192 reg = <0x3a00 0x100>;
193 interrupts = <2 7 0>;
194 };
195
196 i2c@3d00 {
197 #address-cells = <1>;
198 #size-cells = <0>;
199 compatible = "fsl,mpc5200b-i2c","fsl,mpc5200-i2c","fsl-i2c";
200 reg = <0x3d00 0x40>;
201 interrupts = <2 15 0>;
202 fsl5200-clocking;
203
204 rtc@50 {
205 compatible = "at,24c08";
206 reg = <0x50>;
207 };
208
209 rtc@68 {
210 compatible = "dallas,ds1339";
211 reg = <0x68>;
212 };
213 };
214
215 sram@8000 {
216 compatible = "fsl,mpc5200b-sram","fsl,mpc5200-sram";
217 reg = <0x8000 0x4000>;
218 };
219 };
220
221 lpb {
222 compatible = "fsl,mpc5200b-lpb","simple-bus";
223 #address-cells = <2>;
224 #size-cells = <1>;
225 ranges = <0 0 0xff000000 0x1000000>;
226
227 // 16-bit flash device at LocalPlus Bus CS0
228 flash@0,0 {
229 compatible = "cfi-flash";
230 reg = <0 0 0x1000000>;
231 bank-width = <2>;
232 device-width = <2>;
233 #size-cells = <1>;
234 #address-cells = <1>;
235
236 partition@0 {
237 label = "kernel";
238 reg = <0x0 0x00200000>;
239 };
240 partition@200000 {
241 label = "root";
242 reg = <0x00200000 0x00300000>;
243 };
244 partition@500000 {
245 label = "user";
246 reg = <0x00500000 0x00a00000>;
247 };
248 partition@f00000 {
249 label = "u-boot";
250 reg = <0x00f00000 0x100000>;
251 };
252 };
253 };
254};
diff --git a/arch/powerpc/boot/dts/gef_ppc9a.dts b/arch/powerpc/boot/dts/gef_ppc9a.dts
new file mode 100644
index 000000000000..d47ad0718759
--- /dev/null
+++ b/arch/powerpc/boot/dts/gef_ppc9a.dts
@@ -0,0 +1,367 @@
1/*
2 * GE Fanuc PPC9A Device Tree Source
3 *
4 * Copyright 2008 GE Fanuc Intelligent Platforms Embedded Systems, Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
10 *
11 * Based on: SBS CM6 Device Tree Source
12 * Copyright 2007 SBS Technologies GmbH & Co. KG
13 * And: mpc8641_hpcn.dts (MPC8641 HPCN Device Tree Source)
14 * Copyright 2006 Freescale Semiconductor Inc.
15 */
16
17/*
18 * Compiled with dtc -I dts -O dtb -o gef_ppc9a.dtb gef_ppc9a.dts
19 */
20
21/dts-v1/;
22
23/ {
24 model = "GEF_PPC9A";
25 compatible = "gef,ppc9a";
26 #address-cells = <1>;
27 #size-cells = <1>;
28
29 aliases {
30 ethernet0 = &enet0;
31 ethernet1 = &enet1;
32 serial0 = &serial0;
33 serial1 = &serial1;
34 pci0 = &pci0;
35 };
36
37 cpus {
38 #address-cells = <1>;
39 #size-cells = <0>;
40
41 PowerPC,8641@0 {
42 device_type = "cpu";
43 reg = <0>;
44 d-cache-line-size = <32>; // 32 bytes
45 i-cache-line-size = <32>; // 32 bytes
46 d-cache-size = <32768>; // L1, 32K
47 i-cache-size = <32768>; // L1, 32K
48 timebase-frequency = <0>; // From uboot
49 bus-frequency = <0>; // From uboot
50 clock-frequency = <0>; // From uboot
51 };
52 PowerPC,8641@1 {
53 device_type = "cpu";
54 reg = <1>;
55 d-cache-line-size = <32>; // 32 bytes
56 i-cache-line-size = <32>; // 32 bytes
57 d-cache-size = <32768>; // L1, 32K
58 i-cache-size = <32768>; // L1, 32K
59 timebase-frequency = <0>; // From uboot
60 bus-frequency = <0>; // From uboot
61 clock-frequency = <0>; // From uboot
62 };
63 };
64
65 memory {
66 device_type = "memory";
67 reg = <0x0 0x40000000>; // set by uboot
68 };
69
70 localbus@fef05000 {
71 #address-cells = <2>;
72 #size-cells = <1>;
73 compatible = "fsl,mpc8641-localbus", "simple-bus";
74 reg = <0xfef05000 0x1000>;
75 interrupts = <19 2>;
76 interrupt-parent = <&mpic>;
77
78 ranges = <0 0 0xff000000 0x01000000 // 16MB Boot flash
79 1 0 0xe8000000 0x08000000 // Paged Flash 0
80 2 0 0xe0000000 0x08000000 // Paged Flash 1
81 3 0 0xfc100000 0x00020000 // NVRAM
82 4 0 0xfc000000 0x00008000 // FPGA
83 5 0 0xfc008000 0x00008000 // AFIX FPGA
84 6 0 0xfd000000 0x00800000 // IO FPGA (8-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,ppc9a-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,ppc9a-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 };
120
121 fpga@4,0 {
122 compatible = "gef,ppc9a-fpga-regs";
123 reg = <0x4 0x0 0x40>;
124 };
125
126 wdt@4,2000 {
127 compatible = "gef,ppc9a-fpga-wdt", "gef,fpga-wdt-1.00",
128 "gef,fpga-wdt";
129 reg = <0x4 0x2000 0x8>;
130 interrupts = <0x1a 0x4>;
131 interrupt-parent = <&gef_pic>;
132 };
133 /* Second watchdog available, driver currently supports one.
134 wdt@4,2010 {
135 compatible = "gef,ppc9a-fpga-wdt", "gef,fpga-wdt-1.00",
136 "gef,fpga-wdt";
137 reg = <0x4 0x2010 0x8>;
138 interrupts = <0x1b 0x4>;
139 interrupt-parent = <&gef_pic>;
140 };
141 */
142 gef_pic: pic@4,4000 {
143 #interrupt-cells = <1>;
144 interrupt-controller;
145 compatible = "gef,ppc9a-fpga-pic", "gef,fpga-pic-1.00";
146 reg = <0x4 0x4000 0x20>;
147 interrupts = <0x8
148 0x9>;
149 interrupt-parent = <&mpic>;
150
151 };
152 gef_gpio: gpio@7,14000 {
153 #gpio-cells = <2>;
154 compatible = "gef,ppc9a-gpio", "gef,sbc610-gpio";
155 reg = <0x7 0x14000 0x24>;
156 gpio-controller;
157 };
158 };
159
160 soc@fef00000 {
161 #address-cells = <1>;
162 #size-cells = <1>;
163 #interrupt-cells = <2>;
164 compatible = "fsl,mpc8641-soc", "simple-bus";
165 ranges = <0x0 0xfef00000 0x00100000>;
166 reg = <0xfef00000 0x100000>; // CCSRBAR 1M
167 bus-frequency = <33333333>;
168
169 i2c1: i2c@3000 {
170 #address-cells = <1>;
171 #size-cells = <0>;
172 compatible = "fsl-i2c";
173 reg = <0x3000 0x100>;
174 interrupts = <0x2b 0x2>;
175 interrupt-parent = <&mpic>;
176 dfsrr;
177
178 hwmon@48 {
179 compatible = "national,lm92";
180 reg = <0x48>;
181 };
182
183 hwmon@4c {
184 compatible = "adi,adt7461";
185 reg = <0x4c>;
186 };
187
188 rtc@51 {
189 compatible = "epson,rx8581";
190 reg = <0x00000051>;
191 };
192
193 eti@6b {
194 compatible = "dallas,ds1682";
195 reg = <0x6b>;
196 };
197 };
198
199 i2c2: i2c@3100 {
200 #address-cells = <1>;
201 #size-cells = <0>;
202 compatible = "fsl-i2c";
203 reg = <0x3100 0x100>;
204 interrupts = <0x2b 0x2>;
205 interrupt-parent = <&mpic>;
206 dfsrr;
207 };
208
209 dma@21300 {
210 #address-cells = <1>;
211 #size-cells = <1>;
212 compatible = "fsl,mpc8641-dma", "fsl,eloplus-dma";
213 reg = <0x21300 0x4>;
214 ranges = <0x0 0x21100 0x200>;
215 cell-index = <0>;
216 dma-channel@0 {
217 compatible = "fsl,mpc8641-dma-channel",
218 "fsl,eloplus-dma-channel";
219 reg = <0x0 0x80>;
220 cell-index = <0>;
221 interrupt-parent = <&mpic>;
222 interrupts = <20 2>;
223 };
224 dma-channel@80 {
225 compatible = "fsl,mpc8641-dma-channel",
226 "fsl,eloplus-dma-channel";
227 reg = <0x80 0x80>;
228 cell-index = <1>;
229 interrupt-parent = <&mpic>;
230 interrupts = <21 2>;
231 };
232 dma-channel@100 {
233 compatible = "fsl,mpc8641-dma-channel",
234 "fsl,eloplus-dma-channel";
235 reg = <0x100 0x80>;
236 cell-index = <2>;
237 interrupt-parent = <&mpic>;
238 interrupts = <22 2>;
239 };
240 dma-channel@180 {
241 compatible = "fsl,mpc8641-dma-channel",
242 "fsl,eloplus-dma-channel";
243 reg = <0x180 0x80>;
244 cell-index = <3>;
245 interrupt-parent = <&mpic>;
246 interrupts = <23 2>;
247 };
248 };
249
250 enet0: ethernet@24000 {
251 #address-cells = <1>;
252 #size-cells = <1>;
253 device_type = "network";
254 model = "eTSEC";
255 compatible = "gianfar";
256 reg = <0x24000 0x1000>;
257 ranges = <0x0 0x24000 0x1000>;
258 local-mac-address = [ 00 00 00 00 00 00 ];
259 interrupts = <0x1d 0x2 0x1e 0x2 0x22 0x2>;
260 interrupt-parent = <&mpic>;
261 phy-handle = <&phy0>;
262 phy-connection-type = "gmii";
263
264 mdio@520 {
265 #address-cells = <1>;
266 #size-cells = <0>;
267 compatible = "fsl,gianfar-mdio";
268 reg = <0x520 0x20>;
269
270 phy0: ethernet-phy@0 {
271 interrupt-parent = <&gef_pic>;
272 interrupts = <0x9 0x4>;
273 reg = <1>;
274 };
275 phy2: ethernet-phy@2 {
276 interrupt-parent = <&gef_pic>;
277 interrupts = <0x8 0x4>;
278 reg = <3>;
279 };
280 };
281 };
282
283 enet1: ethernet@26000 {
284 device_type = "network";
285 model = "eTSEC";
286 compatible = "gianfar";
287 reg = <0x26000 0x1000>;
288 local-mac-address = [ 00 00 00 00 00 00 ];
289 interrupts = <0x1f 0x2 0x20 0x2 0x21 0x2>;
290 interrupt-parent = <&mpic>;
291 phy-handle = <&phy2>;
292 phy-connection-type = "gmii";
293 };
294
295 serial0: serial@4500 {
296 cell-index = <0>;
297 device_type = "serial";
298 compatible = "ns16550";
299 reg = <0x4500 0x100>;
300 clock-frequency = <0>;
301 interrupts = <0x2a 0x2>;
302 interrupt-parent = <&mpic>;
303 };
304
305 serial1: serial@4600 {
306 cell-index = <1>;
307 device_type = "serial";
308 compatible = "ns16550";
309 reg = <0x4600 0x100>;
310 clock-frequency = <0>;
311 interrupts = <0x1c 0x2>;
312 interrupt-parent = <&mpic>;
313 };
314
315 mpic: pic@40000 {
316 clock-frequency = <0>;
317 interrupt-controller;
318 #address-cells = <0>;
319 #interrupt-cells = <2>;
320 reg = <0x40000 0x40000>;
321 compatible = "chrp,open-pic";
322 device_type = "open-pic";
323 };
324
325 global-utilities@e0000 {
326 compatible = "fsl,mpc8641-guts";
327 reg = <0xe0000 0x1000>;
328 fsl,has-rstcr;
329 };
330 };
331
332 pci0: pcie@fef08000 {
333 compatible = "fsl,mpc8641-pcie";
334 device_type = "pci";
335 #interrupt-cells = <1>;
336 #size-cells = <2>;
337 #address-cells = <3>;
338 reg = <0xfef08000 0x1000>;
339 bus-range = <0x0 0xff>;
340 ranges = <0x02000000 0x0 0x80000000 0x80000000 0x0 0x40000000
341 0x01000000 0x0 0x00000000 0xfe000000 0x0 0x00400000>;
342 clock-frequency = <33333333>;
343 interrupt-parent = <&mpic>;
344 interrupts = <0x18 0x2>;
345 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
346 interrupt-map = <
347 0x0000 0x0 0x0 0x1 &mpic 0x0 0x1
348 0x0000 0x0 0x0 0x2 &mpic 0x1 0x1
349 0x0000 0x0 0x0 0x3 &mpic 0x2 0x1
350 0x0000 0x0 0x0 0x4 &mpic 0x3 0x1
351 >;
352
353 pcie@0 {
354 reg = <0 0 0 0 0>;
355 #size-cells = <2>;
356 #address-cells = <3>;
357 device_type = "pci";
358 ranges = <0x02000000 0x0 0x80000000
359 0x02000000 0x0 0x80000000
360 0x0 0x40000000
361
362 0x01000000 0x0 0x00000000
363 0x01000000 0x0 0x00000000
364 0x0 0x00400000>;
365 };
366 };
367};
diff --git a/arch/powerpc/boot/dts/gef_sbc310.dts b/arch/powerpc/boot/dts/gef_sbc310.dts
new file mode 100644
index 000000000000..1569117e5ddc
--- /dev/null
+++ b/arch/powerpc/boot/dts/gef_sbc310.dts
@@ -0,0 +1,367 @@
1/*
2 * GE Fanuc SBC310 Device Tree Source
3 *
4 * Copyright 2008 GE Fanuc Intelligent Platforms Embedded Systems, Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
10 *
11 * Based on: SBS CM6 Device Tree Source
12 * Copyright 2007 SBS Technologies GmbH & Co. KG
13 * And: mpc8641_hpcn.dts (MPC8641 HPCN Device Tree Source)
14 * Copyright 2006 Freescale Semiconductor Inc.
15 */
16
17/*
18 * Compiled with dtc -I dts -O dtb -o gef_sbc310.dtb gef_sbc310.dts
19 */
20
21/dts-v1/;
22
23/ {
24 model = "GEF_SBC310";
25 compatible = "gef,sbc310";
26 #address-cells = <1>;
27 #size-cells = <1>;
28
29 aliases {
30 ethernet0 = &enet0;
31 ethernet1 = &enet1;
32 serial0 = &serial0;
33 serial1 = &serial1;
34 pci0 = &pci0;
35 };
36
37 cpus {
38 #address-cells = <1>;
39 #size-cells = <0>;
40
41 PowerPC,8641@0 {
42 device_type = "cpu";
43 reg = <0>;
44 d-cache-line-size = <32>; // 32 bytes
45 i-cache-line-size = <32>; // 32 bytes
46 d-cache-size = <32768>; // L1, 32K
47 i-cache-size = <32768>; // L1, 32K
48 timebase-frequency = <0>; // From uboot
49 bus-frequency = <0>; // From uboot
50 clock-frequency = <0>; // From uboot
51 };
52 PowerPC,8641@1 {
53 device_type = "cpu";
54 reg = <1>;
55 d-cache-line-size = <32>; // 32 bytes
56 i-cache-line-size = <32>; // 32 bytes
57 d-cache-size = <32768>; // L1, 32K
58 i-cache-size = <32768>; // L1, 32K
59 timebase-frequency = <0>; // From uboot
60 bus-frequency = <0>; // From uboot
61 clock-frequency = <0>; // From uboot
62 };
63 };
64
65 memory {
66 device_type = "memory";
67 reg = <0x0 0x40000000>; // set by uboot
68 };
69
70 localbus@fef05000 {
71 #address-cells = <2>;
72 #size-cells = <1>;
73 compatible = "fsl,mpc8641-localbus", "simple-bus";
74 reg = <0xfef05000 0x1000>;
75 interrupts = <19 2>;
76 interrupt-parent = <&mpic>;
77
78 ranges = <0 0 0xff000000 0x01000000 // 16MB Boot flash
79 1 0 0xe0000000 0x08000000 // Paged Flash 0
80 2 0 0xe8000000 0x08000000 // Paged Flash 1
81 3 0 0xfc100000 0x00020000 // NVRAM
82 4 0 0xfc000000 0x00010000>; // FPGA
83
84 /* flash@0,0 is a mirror of part of the memory in flash@1,0
85 flash@0,0 {
86 compatible = "cfi-flash";
87 reg = <0 0 0x01000000>;
88 bank-width = <2>;
89 device-width = <2>;
90 #address-cells = <1>;
91 #size-cells = <1>;
92 partition@0 {
93 label = "firmware";
94 reg = <0x00000000 0x01000000>;
95 read-only;
96 };
97 };
98 */
99
100 flash@1,0 {
101 compatible = "cfi-flash";
102 reg = <1 0 0x8000000>;
103 bank-width = <2>;
104 device-width = <2>;
105 #address-cells = <1>;
106 #size-cells = <1>;
107 partition@0 {
108 label = "user";
109 reg = <0x00000000 0x07800000>;
110 };
111 partition@7800000 {
112 label = "firmware";
113 reg = <0x07800000 0x00800000>;
114 read-only;
115 };
116 };
117
118 fpga@4,0 {
119 compatible = "gef,fpga-regs";
120 reg = <0x4 0x0 0x40>;
121 };
122
123 wdt@4,2000 {
124 #interrupt-cells = <2>;
125 device_type = "watchdog";
126 compatible = "gef,fpga-wdt";
127 reg = <0x4 0x2000 0x8>;
128 interrupts = <0x1a 0x4>;
129 interrupt-parent = <&gef_pic>;
130 };
131/*
132 wdt@4,2010 {
133 #interrupt-cells = <2>;
134 device_type = "watchdog";
135 compatible = "gef,fpga-wdt";
136 reg = <0x4 0x2010 0x8>;
137 interrupts = <0x1b 0x4>;
138 interrupt-parent = <&gef_pic>;
139 };
140*/
141 gef_pic: pic@4,4000 {
142 #interrupt-cells = <1>;
143 interrupt-controller;
144 compatible = "gef,fpga-pic";
145 reg = <0x4 0x4000 0x20>;
146 interrupts = <0x8
147 0x9>;
148 interrupt-parent = <&mpic>;
149
150 };
151 gef_gpio: gpio@4,8000 {
152 #gpio-cells = <2>;
153 compatible = "gef,sbc310-gpio";
154 reg = <0x4 0x8000 0x24>;
155 gpio-controller;
156 };
157 };
158
159 soc@fef00000 {
160 #address-cells = <1>;
161 #size-cells = <1>;
162 #interrupt-cells = <2>;
163 device_type = "soc";
164 compatible = "simple-bus";
165 ranges = <0x0 0xfef00000 0x00100000>;
166 reg = <0xfef00000 0x100000>; // CCSRBAR 1M
167 bus-frequency = <33333333>;
168
169 i2c1: i2c@3000 {
170 #address-cells = <1>;
171 #size-cells = <0>;
172 compatible = "fsl-i2c";
173 reg = <0x3000 0x100>;
174 interrupts = <0x2b 0x2>;
175 interrupt-parent = <&mpic>;
176 dfsrr;
177
178 rtc@51 {
179 compatible = "epson,rx8581";
180 reg = <0x00000051>;
181 };
182 };
183
184 i2c2: i2c@3100 {
185 #address-cells = <1>;
186 #size-cells = <0>;
187 compatible = "fsl-i2c";
188 reg = <0x3100 0x100>;
189 interrupts = <0x2b 0x2>;
190 interrupt-parent = <&mpic>;
191 dfsrr;
192
193 hwmon@48 {
194 compatible = "national,lm92";
195 reg = <0x48>;
196 };
197
198 hwmon@4c {
199 compatible = "adi,adt7461";
200 reg = <0x4c>;
201 };
202
203 eti@6b {
204 compatible = "dallas,ds1682";
205 reg = <0x6b>;
206 };
207 };
208
209 dma@21300 {
210 #address-cells = <1>;
211 #size-cells = <1>;
212 compatible = "fsl,mpc8641-dma", "fsl,eloplus-dma";
213 reg = <0x21300 0x4>;
214 ranges = <0x0 0x21100 0x200>;
215 cell-index = <0>;
216 dma-channel@0 {
217 compatible = "fsl,mpc8641-dma-channel",
218 "fsl,eloplus-dma-channel";
219 reg = <0x0 0x80>;
220 cell-index = <0>;
221 interrupt-parent = <&mpic>;
222 interrupts = <20 2>;
223 };
224 dma-channel@80 {
225 compatible = "fsl,mpc8641-dma-channel",
226 "fsl,eloplus-dma-channel";
227 reg = <0x80 0x80>;
228 cell-index = <1>;
229 interrupt-parent = <&mpic>;
230 interrupts = <21 2>;
231 };
232 dma-channel@100 {
233 compatible = "fsl,mpc8641-dma-channel",
234 "fsl,eloplus-dma-channel";
235 reg = <0x100 0x80>;
236 cell-index = <2>;
237 interrupt-parent = <&mpic>;
238 interrupts = <22 2>;
239 };
240 dma-channel@180 {
241 compatible = "fsl,mpc8641-dma-channel",
242 "fsl,eloplus-dma-channel";
243 reg = <0x180 0x80>;
244 cell-index = <3>;
245 interrupt-parent = <&mpic>;
246 interrupts = <23 2>;
247 };
248 };
249
250 enet0: ethernet@24000 {
251 #address-cells = <1>;
252 #size-cells = <1>;
253 device_type = "network";
254 model = "eTSEC";
255 compatible = "gianfar";
256 reg = <0x24000 0x1000>;
257 ranges = <0x0 0x24000 0x1000>;
258 local-mac-address = [ 00 00 00 00 00 00 ];
259 interrupts = <0x1d 0x2 0x1e 0x2 0x22 0x2>;
260 interrupt-parent = <&mpic>;
261 phy-handle = <&phy0>;
262 phy-connection-type = "gmii";
263
264 mdio@520 {
265 #address-cells = <1>;
266 #size-cells = <0>;
267 compatible = "fsl,gianfar-mdio";
268 reg = <0x520 0x20>;
269
270 phy0: ethernet-phy@0 {
271 interrupt-parent = <&gef_pic>;
272 interrupts = <0x9 0x4>;
273 reg = <1>;
274 };
275 phy2: ethernet-phy@2 {
276 interrupt-parent = <&gef_pic>;
277 interrupts = <0x8 0x4>;
278 reg = <3>;
279 };
280 };
281 };
282
283 enet1: ethernet@26000 {
284 device_type = "network";
285 model = "eTSEC";
286 compatible = "gianfar";
287 reg = <0x26000 0x1000>;
288 local-mac-address = [ 00 00 00 00 00 00 ];
289 interrupts = <0x1f 0x2 0x20 0x2 0x21 0x2>;
290 interrupt-parent = <&mpic>;
291 phy-handle = <&phy2>;
292 phy-connection-type = "gmii";
293 };
294
295 serial0: serial@4500 {
296 cell-index = <0>;
297 device_type = "serial";
298 compatible = "ns16550";
299 reg = <0x4500 0x100>;
300 clock-frequency = <0>;
301 interrupts = <0x2a 0x2>;
302 interrupt-parent = <&mpic>;
303 };
304
305 serial1: serial@4600 {
306 cell-index = <1>;
307 device_type = "serial";
308 compatible = "ns16550";
309 reg = <0x4600 0x100>;
310 clock-frequency = <0>;
311 interrupts = <0x1c 0x2>;
312 interrupt-parent = <&mpic>;
313 };
314
315 mpic: pic@40000 {
316 clock-frequency = <0>;
317 interrupt-controller;
318 #address-cells = <0>;
319 #interrupt-cells = <2>;
320 reg = <0x40000 0x40000>;
321 compatible = "chrp,open-pic";
322 device_type = "open-pic";
323 };
324
325 global-utilities@e0000 {
326 compatible = "fsl,mpc8641-guts";
327 reg = <0xe0000 0x1000>;
328 fsl,has-rstcr;
329 };
330 };
331
332 pci0: pcie@fef08000 {
333 compatible = "fsl,mpc8641-pcie";
334 device_type = "pci";
335 #interrupt-cells = <1>;
336 #size-cells = <2>;
337 #address-cells = <3>;
338 reg = <0xfef08000 0x1000>;
339 bus-range = <0x0 0xff>;
340 ranges = <0x02000000 0x0 0x80000000 0x80000000 0x0 0x40000000
341 0x01000000 0x0 0x00000000 0xfe000000 0x0 0x00400000>;
342 clock-frequency = <33333333>;
343 interrupt-parent = <&mpic>;
344 interrupts = <0x18 0x2>;
345 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
346 interrupt-map = <
347 0x0000 0x0 0x0 0x1 &mpic 0x0 0x2
348 0x0000 0x0 0x0 0x2 &mpic 0x1 0x2
349 0x0000 0x0 0x0 0x3 &mpic 0x2 0x2
350 0x0000 0x0 0x0 0x4 &mpic 0x3 0x2
351 >;
352
353 pcie@0 {
354 reg = <0 0 0 0 0>;
355 #size-cells = <2>;
356 #address-cells = <3>;
357 device_type = "pci";
358 ranges = <0x02000000 0x0 0x80000000
359 0x02000000 0x0 0x80000000
360 0x0 0x40000000
361
362 0x01000000 0x0 0x00000000
363 0x01000000 0x0 0x00000000
364 0x0 0x00400000>;
365 };
366 };
367};
diff --git a/arch/powerpc/boot/dts/gef_sbc610.dts b/arch/powerpc/boot/dts/gef_sbc610.dts
index e78c355c7bac..6582dbd36da7 100644
--- a/arch/powerpc/boot/dts/gef_sbc610.dts
+++ b/arch/powerpc/boot/dts/gef_sbc610.dts
@@ -71,7 +71,7 @@
71 #address-cells = <2>; 71 #address-cells = <2>;
72 #size-cells = <1>; 72 #size-cells = <1>;
73 compatible = "fsl,mpc8641-localbus", "simple-bus"; 73 compatible = "fsl,mpc8641-localbus", "simple-bus";
74 reg = <0xf8005000 0x1000>; 74 reg = <0xfef05000 0x1000>;
75 interrupts = <19 2>; 75 interrupts = <19 2>;
76 interrupt-parent = <&mpic>; 76 interrupt-parent = <&mpic>;
77 77
@@ -202,34 +202,37 @@
202 }; 202 };
203 }; 203 };
204 204
205 mdio@24520 {
206 #address-cells = <1>;
207 #size-cells = <0>;
208 compatible = "fsl,gianfar-mdio";
209 reg = <0x24520 0x20>;
210
211 phy0: ethernet-phy@0 {
212 interrupt-parent = <&gef_pic>;
213 interrupts = <0x9 0x4>;
214 reg = <1>;
215 };
216 phy2: ethernet-phy@2 {
217 interrupt-parent = <&gef_pic>;
218 interrupts = <0x8 0x4>;
219 reg = <3>;
220 };
221 };
222
223 enet0: ethernet@24000 { 205 enet0: ethernet@24000 {
206 #address-cells = <1>;
207 #size-cells = <1>;
224 device_type = "network"; 208 device_type = "network";
225 model = "eTSEC"; 209 model = "eTSEC";
226 compatible = "gianfar"; 210 compatible = "gianfar";
227 reg = <0x24000 0x1000>; 211 reg = <0x24000 0x1000>;
212 ranges = <0x0 0x24000 0x1000>;
228 local-mac-address = [ 00 00 00 00 00 00 ]; 213 local-mac-address = [ 00 00 00 00 00 00 ];
229 interrupts = <0x1d 0x2 0x1e 0x2 0x22 0x2>; 214 interrupts = <0x1d 0x2 0x1e 0x2 0x22 0x2>;
230 interrupt-parent = <&mpic>; 215 interrupt-parent = <&mpic>;
231 phy-handle = <&phy0>; 216 phy-handle = <&phy0>;
232 phy-connection-type = "gmii"; 217 phy-connection-type = "gmii";
218
219 mdio@520 {
220 #address-cells = <1>;
221 #size-cells = <0>;
222 compatible = "fsl,gianfar-mdio";
223 reg = <0x520 0x20>;
224
225 phy0: ethernet-phy@0 {
226 interrupt-parent = <&gef_pic>;
227 interrupts = <0x9 0x4>;
228 reg = <1>;
229 };
230 phy2: ethernet-phy@2 {
231 interrupt-parent = <&gef_pic>;
232 interrupts = <0x8 0x4>;
233 reg = <3>;
234 };
235 };
233 }; 236 };
234 237
235 enet1: ethernet@26000 { 238 enet1: ethernet@26000 {
diff --git a/arch/powerpc/boot/dts/ksi8560.dts b/arch/powerpc/boot/dts/ksi8560.dts
index 3bfff47418db..308fe7c29dea 100644
--- a/arch/powerpc/boot/dts/ksi8560.dts
+++ b/arch/powerpc/boot/dts/ksi8560.dts
@@ -124,67 +124,72 @@
124 }; 124 };
125 }; 125 };
126 126
127 mdio@24520 { /* For TSECs */
128 #address-cells = <1>;
129 #size-cells = <0>;
130 compatible = "fsl,gianfar-mdio";
131 reg = <0x24520 0x20>;
132
133 PHY1: ethernet-phy@1 {
134 interrupt-parent = <&mpic>;
135 reg = <0x1>;
136 device_type = "ethernet-phy";
137 };
138
139 PHY2: ethernet-phy@2 {
140 interrupt-parent = <&mpic>;
141 reg = <0x2>;
142 device_type = "ethernet-phy";
143 };
144
145 tbi0: tbi-phy@11 {
146 reg = <0x11>;
147 device_type = "tbi-phy";
148 };
149 };
150
151 mdio@25520 {
152 #address-cells = <1>;
153 #size-cells = <0>;
154 compatible = "fsl,gianfar-tbi";
155 reg = <0x25520 0x20>;
156
157 tbi1: tbi-phy@11 {
158 reg = <0x11>;
159 device_type = "tbi-phy";
160 };
161 };
162
163
164 enet0: ethernet@24000 { 127 enet0: ethernet@24000 {
128 #address-cells = <1>;
129 #size-cells = <1>;
165 device_type = "network"; 130 device_type = "network";
166 model = "TSEC"; 131 model = "TSEC";
167 compatible = "gianfar"; 132 compatible = "gianfar";
168 reg = <0x24000 0x1000>; 133 reg = <0x24000 0x1000>;
134 ranges = <0x0 0x24000 0x1000>;
169 /* Mac address filled in by bootwrapper */ 135 /* Mac address filled in by bootwrapper */
170 local-mac-address = [ 00 00 00 00 00 00 ]; 136 local-mac-address = [ 00 00 00 00 00 00 ];
171 interrupts = <0x1d 0x2 0x1e 0x2 0x22 0x2>; 137 interrupts = <0x1d 0x2 0x1e 0x2 0x22 0x2>;
172 interrupt-parent = <&mpic>; 138 interrupt-parent = <&mpic>;
173 tbi-handle = <&tbi0>; 139 tbi-handle = <&tbi0>;
174 phy-handle = <&PHY1>; 140 phy-handle = <&PHY1>;
141
142 mdio@520 { /* For TSECs */
143 #address-cells = <1>;
144 #size-cells = <0>;
145 compatible = "fsl,gianfar-mdio";
146 reg = <0x520 0x20>;
147
148 PHY1: ethernet-phy@1 {
149 interrupt-parent = <&mpic>;
150 reg = <0x1>;
151 device_type = "ethernet-phy";
152 };
153
154 PHY2: ethernet-phy@2 {
155 interrupt-parent = <&mpic>;
156 reg = <0x2>;
157 device_type = "ethernet-phy";
158 };
159
160 tbi0: tbi-phy@11 {
161 reg = <0x11>;
162 device_type = "tbi-phy";
163 };
164 };
175 }; 165 };
176 166
177 enet1: ethernet@25000 { 167 enet1: ethernet@25000 {
168 #address-cells = <1>;
169 #size-cells = <1>;
178 device_type = "network"; 170 device_type = "network";
179 model = "TSEC"; 171 model = "TSEC";
180 compatible = "gianfar"; 172 compatible = "gianfar";
181 reg = <0x25000 0x1000>; 173 reg = <0x25000 0x1000>;
174 ranges = <0x0 0x25000 0x1000>;
182 /* Mac address filled in by bootwrapper */ 175 /* Mac address filled in by bootwrapper */
183 local-mac-address = [ 00 00 00 00 00 00 ]; 176 local-mac-address = [ 00 00 00 00 00 00 ];
184 interrupts = <0x23 0x2 0x24 0x2 0x28 0x2>; 177 interrupts = <0x23 0x2 0x24 0x2 0x28 0x2>;
185 interrupt-parent = <&mpic>; 178 interrupt-parent = <&mpic>;
186 tbi-handle = <&tbi1>; 179 tbi-handle = <&tbi1>;
187 phy-handle = <&PHY2>; 180 phy-handle = <&PHY2>;
181
182 mdio@520 {
183 #address-cells = <1>;
184 #size-cells = <0>;
185 compatible = "fsl,gianfar-tbi";
186 reg = <0x520 0x20>;
187
188 tbi1: tbi-phy@11 {
189 reg = <0x11>;
190 device_type = "tbi-phy";
191 };
192 };
188 }; 193 };
189 194
190 mpic: pic@40000 { 195 mpic: pic@40000 {
diff --git a/arch/powerpc/boot/dts/lite5200.dts b/arch/powerpc/boot/dts/lite5200.dts
index 3f7a5dce8de0..de30b3f9eb26 100644
--- a/arch/powerpc/boot/dts/lite5200.dts
+++ b/arch/powerpc/boot/dts/lite5200.dts
@@ -17,6 +17,7 @@
17 compatible = "fsl,lite5200"; 17 compatible = "fsl,lite5200";
18 #address-cells = <1>; 18 #address-cells = <1>;
19 #size-cells = <1>; 19 #size-cells = <1>;
20 interrupt-parent = <&mpc5200_pic>;
20 21
21 cpus { 22 cpus {
22 #address-cells = <1>; 23 #address-cells = <1>;
@@ -58,96 +59,74 @@
58 // 5200 interrupts are encoded into two levels; 59 // 5200 interrupts are encoded into two levels;
59 interrupt-controller; 60 interrupt-controller;
60 #interrupt-cells = <3>; 61 #interrupt-cells = <3>;
61 device_type = "interrupt-controller";
62 compatible = "fsl,mpc5200-pic"; 62 compatible = "fsl,mpc5200-pic";
63 reg = <0x500 0x80>; 63 reg = <0x500 0x80>;
64 }; 64 };
65 65
66 timer@600 { // General Purpose Timer 66 timer@600 { // General Purpose Timer
67 compatible = "fsl,mpc5200-gpt"; 67 compatible = "fsl,mpc5200-gpt";
68 cell-index = <0>;
69 reg = <0x600 0x10>; 68 reg = <0x600 0x10>;
70 interrupts = <1 9 0>; 69 interrupts = <1 9 0>;
71 interrupt-parent = <&mpc5200_pic>;
72 fsl,has-wdt; 70 fsl,has-wdt;
73 }; 71 };
74 72
75 timer@610 { // General Purpose Timer 73 timer@610 { // General Purpose Timer
76 compatible = "fsl,mpc5200-gpt"; 74 compatible = "fsl,mpc5200-gpt";
77 cell-index = <1>;
78 reg = <0x610 0x10>; 75 reg = <0x610 0x10>;
79 interrupts = <1 10 0>; 76 interrupts = <1 10 0>;
80 interrupt-parent = <&mpc5200_pic>;
81 }; 77 };
82 78
83 timer@620 { // General Purpose Timer 79 timer@620 { // General Purpose Timer
84 compatible = "fsl,mpc5200-gpt"; 80 compatible = "fsl,mpc5200-gpt";
85 cell-index = <2>;
86 reg = <0x620 0x10>; 81 reg = <0x620 0x10>;
87 interrupts = <1 11 0>; 82 interrupts = <1 11 0>;
88 interrupt-parent = <&mpc5200_pic>;
89 }; 83 };
90 84
91 timer@630 { // General Purpose Timer 85 timer@630 { // General Purpose Timer
92 compatible = "fsl,mpc5200-gpt"; 86 compatible = "fsl,mpc5200-gpt";
93 cell-index = <3>;
94 reg = <0x630 0x10>; 87 reg = <0x630 0x10>;
95 interrupts = <1 12 0>; 88 interrupts = <1 12 0>;
96 interrupt-parent = <&mpc5200_pic>;
97 }; 89 };
98 90
99 timer@640 { // General Purpose Timer 91 timer@640 { // General Purpose Timer
100 compatible = "fsl,mpc5200-gpt"; 92 compatible = "fsl,mpc5200-gpt";
101 cell-index = <4>;
102 reg = <0x640 0x10>; 93 reg = <0x640 0x10>;
103 interrupts = <1 13 0>; 94 interrupts = <1 13 0>;
104 interrupt-parent = <&mpc5200_pic>;
105 }; 95 };
106 96
107 timer@650 { // General Purpose Timer 97 timer@650 { // General Purpose Timer
108 compatible = "fsl,mpc5200-gpt"; 98 compatible = "fsl,mpc5200-gpt";
109 cell-index = <5>;
110 reg = <0x650 0x10>; 99 reg = <0x650 0x10>;
111 interrupts = <1 14 0>; 100 interrupts = <1 14 0>;
112 interrupt-parent = <&mpc5200_pic>;
113 }; 101 };
114 102
115 timer@660 { // General Purpose Timer 103 timer@660 { // General Purpose Timer
116 compatible = "fsl,mpc5200-gpt"; 104 compatible = "fsl,mpc5200-gpt";
117 cell-index = <6>;
118 reg = <0x660 0x10>; 105 reg = <0x660 0x10>;
119 interrupts = <1 15 0>; 106 interrupts = <1 15 0>;
120 interrupt-parent = <&mpc5200_pic>;
121 }; 107 };
122 108
123 timer@670 { // General Purpose Timer 109 timer@670 { // General Purpose Timer
124 compatible = "fsl,mpc5200-gpt"; 110 compatible = "fsl,mpc5200-gpt";
125 cell-index = <7>;
126 reg = <0x670 0x10>; 111 reg = <0x670 0x10>;
127 interrupts = <1 16 0>; 112 interrupts = <1 16 0>;
128 interrupt-parent = <&mpc5200_pic>;
129 }; 113 };
130 114
131 rtc@800 { // Real time clock 115 rtc@800 { // Real time clock
132 compatible = "fsl,mpc5200-rtc"; 116 compatible = "fsl,mpc5200-rtc";
133 reg = <0x800 0x100>; 117 reg = <0x800 0x100>;
134 interrupts = <1 5 0 1 6 0>; 118 interrupts = <1 5 0 1 6 0>;
135 interrupt-parent = <&mpc5200_pic>;
136 }; 119 };
137 120
138 can@900 { 121 can@900 {
139 compatible = "fsl,mpc5200-mscan"; 122 compatible = "fsl,mpc5200-mscan";
140 cell-index = <0>;
141 interrupts = <2 17 0>; 123 interrupts = <2 17 0>;
142 interrupt-parent = <&mpc5200_pic>;
143 reg = <0x900 0x80>; 124 reg = <0x900 0x80>;
144 }; 125 };
145 126
146 can@980 { 127 can@980 {
147 compatible = "fsl,mpc5200-mscan"; 128 compatible = "fsl,mpc5200-mscan";
148 cell-index = <1>;
149 interrupts = <2 18 0>; 129 interrupts = <2 18 0>;
150 interrupt-parent = <&mpc5200_pic>;
151 reg = <0x980 0x80>; 130 reg = <0x980 0x80>;
152 }; 131 };
153 132
@@ -155,39 +134,33 @@
155 compatible = "fsl,mpc5200-gpio"; 134 compatible = "fsl,mpc5200-gpio";
156 reg = <0xb00 0x40>; 135 reg = <0xb00 0x40>;
157 interrupts = <1 7 0>; 136 interrupts = <1 7 0>;
158 interrupt-parent = <&mpc5200_pic>;
159 }; 137 };
160 138
161 gpio@c00 { 139 gpio@c00 {
162 compatible = "fsl,mpc5200-gpio-wkup"; 140 compatible = "fsl,mpc5200-gpio-wkup";
163 reg = <0xc00 0x40>; 141 reg = <0xc00 0x40>;
164 interrupts = <1 8 0 0 3 0>; 142 interrupts = <1 8 0 0 3 0>;
165 interrupt-parent = <&mpc5200_pic>;
166 }; 143 };
167 144
168 spi@f00 { 145 spi@f00 {
169 compatible = "fsl,mpc5200-spi"; 146 compatible = "fsl,mpc5200-spi";
170 reg = <0xf00 0x20>; 147 reg = <0xf00 0x20>;
171 interrupts = <2 13 0 2 14 0>; 148 interrupts = <2 13 0 2 14 0>;
172 interrupt-parent = <&mpc5200_pic>;
173 }; 149 };
174 150
175 usb@1000 { 151 usb@1000 {
176 compatible = "fsl,mpc5200-ohci","ohci-be"; 152 compatible = "fsl,mpc5200-ohci","ohci-be";
177 reg = <0x1000 0xff>; 153 reg = <0x1000 0xff>;
178 interrupts = <2 6 0>; 154 interrupts = <2 6 0>;
179 interrupt-parent = <&mpc5200_pic>;
180 }; 155 };
181 156
182 dma-controller@1200 { 157 dma-controller@1200 {
183 device_type = "dma-controller";
184 compatible = "fsl,mpc5200-bestcomm"; 158 compatible = "fsl,mpc5200-bestcomm";
185 reg = <0x1200 0x80>; 159 reg = <0x1200 0x80>;
186 interrupts = <3 0 0 3 1 0 3 2 0 3 3 0 160 interrupts = <3 0 0 3 1 0 3 2 0 3 3 0
187 3 4 0 3 5 0 3 6 0 3 7 0 161 3 4 0 3 5 0 3 6 0 3 7 0
188 3 8 0 3 9 0 3 10 0 3 11 0 162 3 8 0 3 9 0 3 10 0 3 11 0
189 3 12 0 3 13 0 3 14 0 3 15 0>; 163 3 12 0 3 13 0 3 14 0 3 15 0>;
190 interrupt-parent = <&mpc5200_pic>;
191 }; 164 };
192 165
193 xlb@1f00 { 166 xlb@1f00 {
@@ -196,13 +169,10 @@
196 }; 169 };
197 170
198 serial@2000 { // PSC1 171 serial@2000 { // PSC1
199 device_type = "serial";
200 compatible = "fsl,mpc5200-psc-uart"; 172 compatible = "fsl,mpc5200-psc-uart";
201 port-number = <0>; // Logical port assignment
202 cell-index = <0>; 173 cell-index = <0>;
203 reg = <0x2000 0x100>; 174 reg = <0x2000 0x100>;
204 interrupts = <2 1 0>; 175 interrupts = <2 1 0>;
205 interrupt-parent = <&mpc5200_pic>;
206 }; 176 };
207 177
208 // PSC2 in ac97 mode example 178 // PSC2 in ac97 mode example
@@ -211,7 +181,6 @@
211 // cell-index = <1>; 181 // cell-index = <1>;
212 // reg = <0x2200 0x100>; 182 // reg = <0x2200 0x100>;
213 // interrupts = <2 2 0>; 183 // interrupts = <2 2 0>;
214 // interrupt-parent = <&mpc5200_pic>;
215 //}; 184 //};
216 185
217 // PSC3 in CODEC mode example 186 // PSC3 in CODEC mode example
@@ -220,27 +189,22 @@
220 // cell-index = <2>; 189 // cell-index = <2>;
221 // reg = <0x2400 0x100>; 190 // reg = <0x2400 0x100>;
222 // interrupts = <2 3 0>; 191 // interrupts = <2 3 0>;
223 // interrupt-parent = <&mpc5200_pic>;
224 //}; 192 //};
225 193
226 // PSC4 in uart mode example 194 // PSC4 in uart mode example
227 //serial@2600 { // PSC4 195 //serial@2600 { // PSC4
228 // device_type = "serial";
229 // compatible = "fsl,mpc5200-psc-uart"; 196 // compatible = "fsl,mpc5200-psc-uart";
230 // cell-index = <3>; 197 // cell-index = <3>;
231 // reg = <0x2600 0x100>; 198 // reg = <0x2600 0x100>;
232 // interrupts = <2 11 0>; 199 // interrupts = <2 11 0>;
233 // interrupt-parent = <&mpc5200_pic>;
234 //}; 200 //};
235 201
236 // PSC5 in uart mode example 202 // PSC5 in uart mode example
237 //serial@2800 { // PSC5 203 //serial@2800 { // PSC5
238 // device_type = "serial";
239 // compatible = "fsl,mpc5200-psc-uart"; 204 // compatible = "fsl,mpc5200-psc-uart";
240 // cell-index = <4>; 205 // cell-index = <4>;
241 // reg = <0x2800 0x100>; 206 // reg = <0x2800 0x100>;
242 // interrupts = <2 12 0>; 207 // interrupts = <2 12 0>;
243 // interrupt-parent = <&mpc5200_pic>;
244 //}; 208 //};
245 209
246 // PSC6 in spi mode example 210 // PSC6 in spi mode example
@@ -249,16 +213,13 @@
249 // cell-index = <5>; 213 // cell-index = <5>;
250 // reg = <0x2c00 0x100>; 214 // reg = <0x2c00 0x100>;
251 // interrupts = <2 4 0>; 215 // interrupts = <2 4 0>;
252 // interrupt-parent = <&mpc5200_pic>;
253 //}; 216 //};
254 217
255 ethernet@3000 { 218 ethernet@3000 {
256 device_type = "network";
257 compatible = "fsl,mpc5200-fec"; 219 compatible = "fsl,mpc5200-fec";
258 reg = <0x3000 0x400>; 220 reg = <0x3000 0x400>;
259 local-mac-address = [ 00 00 00 00 00 00 ]; 221 local-mac-address = [ 00 00 00 00 00 00 ];
260 interrupts = <2 5 0>; 222 interrupts = <2 5 0>;
261 interrupt-parent = <&mpc5200_pic>;
262 phy-handle = <&phy0>; 223 phy-handle = <&phy0>;
263 }; 224 };
264 225
@@ -268,30 +229,24 @@
268 compatible = "fsl,mpc5200-mdio"; 229 compatible = "fsl,mpc5200-mdio";
269 reg = <0x3000 0x400>; // fec range, since we need to setup fec interrupts 230 reg = <0x3000 0x400>; // fec range, since we need to setup fec interrupts
270 interrupts = <2 5 0>; // these are for "mii command finished", not link changes & co. 231 interrupts = <2 5 0>; // these are for "mii command finished", not link changes & co.
271 interrupt-parent = <&mpc5200_pic>;
272 232
273 phy0: ethernet-phy@1 { 233 phy0: ethernet-phy@1 {
274 device_type = "ethernet-phy";
275 reg = <1>; 234 reg = <1>;
276 }; 235 };
277 }; 236 };
278 237
279 ata@3a00 { 238 ata@3a00 {
280 device_type = "ata";
281 compatible = "fsl,mpc5200-ata"; 239 compatible = "fsl,mpc5200-ata";
282 reg = <0x3a00 0x100>; 240 reg = <0x3a00 0x100>;
283 interrupts = <2 7 0>; 241 interrupts = <2 7 0>;
284 interrupt-parent = <&mpc5200_pic>;
285 }; 242 };
286 243
287 i2c@3d00 { 244 i2c@3d00 {
288 #address-cells = <1>; 245 #address-cells = <1>;
289 #size-cells = <0>; 246 #size-cells = <0>;
290 compatible = "fsl,mpc5200-i2c","fsl-i2c"; 247 compatible = "fsl,mpc5200-i2c","fsl-i2c";
291 cell-index = <0>;
292 reg = <0x3d00 0x40>; 248 reg = <0x3d00 0x40>;
293 interrupts = <2 15 0>; 249 interrupts = <2 15 0>;
294 interrupt-parent = <&mpc5200_pic>;
295 fsl5200-clocking; 250 fsl5200-clocking;
296 }; 251 };
297 252
@@ -299,14 +254,12 @@
299 #address-cells = <1>; 254 #address-cells = <1>;
300 #size-cells = <0>; 255 #size-cells = <0>;
301 compatible = "fsl,mpc5200-i2c","fsl-i2c"; 256 compatible = "fsl,mpc5200-i2c","fsl-i2c";
302 cell-index = <1>;
303 reg = <0x3d40 0x40>; 257 reg = <0x3d40 0x40>;
304 interrupts = <2 16 0>; 258 interrupts = <2 16 0>;
305 interrupt-parent = <&mpc5200_pic>;
306 fsl5200-clocking; 259 fsl5200-clocking;
307 }; 260 };
308 sram@8000 { 261 sram@8000 {
309 compatible = "fsl,mpc5200-sram","sram"; 262 compatible = "fsl,mpc5200-sram";
310 reg = <0x8000 0x4000>; 263 reg = <0x8000 0x4000>;
311 }; 264 };
312 }; 265 };
@@ -325,7 +278,6 @@
325 0xc000 0 0 4 &mpc5200_pic 0 0 3>; 278 0xc000 0 0 4 &mpc5200_pic 0 0 3>;
326 clock-frequency = <0>; // From boot loader 279 clock-frequency = <0>; // From boot loader
327 interrupts = <2 8 0 2 9 0 2 10 0>; 280 interrupts = <2 8 0 2 9 0 2 10 0>;
328 interrupt-parent = <&mpc5200_pic>;
329 bus-range = <0 0>; 281 bus-range = <0 0>;
330 ranges = <0x42000000 0 0x80000000 0x80000000 0 0x20000000 282 ranges = <0x42000000 0 0x80000000 0x80000000 0 0x20000000
331 0x02000000 0 0xa0000000 0xa0000000 0 0x10000000 283 0x02000000 0 0xa0000000 0xa0000000 0 0x10000000
diff --git a/arch/powerpc/boot/dts/lite5200b.dts b/arch/powerpc/boot/dts/lite5200b.dts
index 63e3bb48e843..c63e3566479e 100644
--- a/arch/powerpc/boot/dts/lite5200b.dts
+++ b/arch/powerpc/boot/dts/lite5200b.dts
@@ -17,6 +17,7 @@
17 compatible = "fsl,lite5200b"; 17 compatible = "fsl,lite5200b";
18 #address-cells = <1>; 18 #address-cells = <1>;
19 #size-cells = <1>; 19 #size-cells = <1>;
20 interrupt-parent = <&mpc5200_pic>;
20 21
21 cpus { 22 cpus {
22 #address-cells = <1>; 23 #address-cells = <1>;
@@ -58,136 +59,112 @@
58 // 5200 interrupts are encoded into two levels; 59 // 5200 interrupts are encoded into two levels;
59 interrupt-controller; 60 interrupt-controller;
60 #interrupt-cells = <3>; 61 #interrupt-cells = <3>;
61 device_type = "interrupt-controller";
62 compatible = "fsl,mpc5200b-pic","fsl,mpc5200-pic"; 62 compatible = "fsl,mpc5200b-pic","fsl,mpc5200-pic";
63 reg = <0x500 0x80>; 63 reg = <0x500 0x80>;
64 }; 64 };
65 65
66 timer@600 { // General Purpose Timer 66 timer@600 { // General Purpose Timer
67 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt"; 67 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
68 cell-index = <0>;
69 reg = <0x600 0x10>; 68 reg = <0x600 0x10>;
70 interrupts = <1 9 0>; 69 interrupts = <1 9 0>;
71 interrupt-parent = <&mpc5200_pic>;
72 fsl,has-wdt; 70 fsl,has-wdt;
73 }; 71 };
74 72
75 timer@610 { // General Purpose Timer 73 timer@610 { // General Purpose Timer
76 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt"; 74 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
77 cell-index = <1>;
78 reg = <0x610 0x10>; 75 reg = <0x610 0x10>;
79 interrupts = <1 10 0>; 76 interrupts = <1 10 0>;
80 interrupt-parent = <&mpc5200_pic>;
81 }; 77 };
82 78
83 timer@620 { // General Purpose Timer 79 timer@620 { // General Purpose Timer
84 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt"; 80 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
85 cell-index = <2>;
86 reg = <0x620 0x10>; 81 reg = <0x620 0x10>;
87 interrupts = <1 11 0>; 82 interrupts = <1 11 0>;
88 interrupt-parent = <&mpc5200_pic>;
89 }; 83 };
90 84
91 timer@630 { // General Purpose Timer 85 timer@630 { // General Purpose Timer
92 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt"; 86 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
93 cell-index = <3>;
94 reg = <0x630 0x10>; 87 reg = <0x630 0x10>;
95 interrupts = <1 12 0>; 88 interrupts = <1 12 0>;
96 interrupt-parent = <&mpc5200_pic>;
97 }; 89 };
98 90
99 timer@640 { // General Purpose Timer 91 timer@640 { // General Purpose Timer
100 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt"; 92 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
101 cell-index = <4>;
102 reg = <0x640 0x10>; 93 reg = <0x640 0x10>;
103 interrupts = <1 13 0>; 94 interrupts = <1 13 0>;
104 interrupt-parent = <&mpc5200_pic>;
105 }; 95 };
106 96
107 timer@650 { // General Purpose Timer 97 timer@650 { // General Purpose Timer
108 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt"; 98 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
109 cell-index = <5>;
110 reg = <0x650 0x10>; 99 reg = <0x650 0x10>;
111 interrupts = <1 14 0>; 100 interrupts = <1 14 0>;
112 interrupt-parent = <&mpc5200_pic>;
113 }; 101 };
114 102
115 timer@660 { // General Purpose Timer 103 timer@660 { // General Purpose Timer
116 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt"; 104 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
117 cell-index = <6>;
118 reg = <0x660 0x10>; 105 reg = <0x660 0x10>;
119 interrupts = <1 15 0>; 106 interrupts = <1 15 0>;
120 interrupt-parent = <&mpc5200_pic>;
121 }; 107 };
122 108
123 timer@670 { // General Purpose Timer 109 timer@670 { // General Purpose Timer
124 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt"; 110 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
125 cell-index = <7>;
126 reg = <0x670 0x10>; 111 reg = <0x670 0x10>;
127 interrupts = <1 16 0>; 112 interrupts = <1 16 0>;
128 interrupt-parent = <&mpc5200_pic>;
129 }; 113 };
130 114
131 rtc@800 { // Real time clock 115 rtc@800 { // Real time clock
132 compatible = "fsl,mpc5200b-rtc","fsl,mpc5200-rtc"; 116 compatible = "fsl,mpc5200b-rtc","fsl,mpc5200-rtc";
133 reg = <0x800 0x100>; 117 reg = <0x800 0x100>;
134 interrupts = <1 5 0 1 6 0>; 118 interrupts = <1 5 0 1 6 0>;
135 interrupt-parent = <&mpc5200_pic>;
136 }; 119 };
137 120
138 can@900 { 121 can@900 {
139 compatible = "fsl,mpc5200b-mscan","fsl,mpc5200-mscan"; 122 compatible = "fsl,mpc5200b-mscan","fsl,mpc5200-mscan";
140 cell-index = <0>;
141 interrupts = <2 17 0>; 123 interrupts = <2 17 0>;
142 interrupt-parent = <&mpc5200_pic>;
143 reg = <0x900 0x80>; 124 reg = <0x900 0x80>;
144 }; 125 };
145 126
146 can@980 { 127 can@980 {
147 compatible = "fsl,mpc5200b-mscan","fsl,mpc5200-mscan"; 128 compatible = "fsl,mpc5200b-mscan","fsl,mpc5200-mscan";
148 cell-index = <1>;
149 interrupts = <2 18 0>; 129 interrupts = <2 18 0>;
150 interrupt-parent = <&mpc5200_pic>;
151 reg = <0x980 0x80>; 130 reg = <0x980 0x80>;
152 }; 131 };
153 132
154 gpio@b00 { 133 gpio_simple: gpio@b00 {
155 compatible = "fsl,mpc5200b-gpio","fsl,mpc5200-gpio"; 134 compatible = "fsl,mpc5200b-gpio","fsl,mpc5200-gpio";
156 reg = <0xb00 0x40>; 135 reg = <0xb00 0x40>;
157 interrupts = <1 7 0>; 136 interrupts = <1 7 0>;
158 interrupt-parent = <&mpc5200_pic>; 137 gpio-controller;
138 #gpio-cells = <2>;
159 }; 139 };
160 140
161 gpio@c00 { 141 gpio_wkup: gpio@c00 {
162 compatible = "fsl,mpc5200b-gpio-wkup","fsl,mpc5200-gpio-wkup"; 142 compatible = "fsl,mpc5200b-gpio-wkup","fsl,mpc5200-gpio-wkup";
163 reg = <0xc00 0x40>; 143 reg = <0xc00 0x40>;
164 interrupts = <1 8 0 0 3 0>; 144 interrupts = <1 8 0 0 3 0>;
165 interrupt-parent = <&mpc5200_pic>; 145 gpio-controller;
146 #gpio-cells = <2>;
166 }; 147 };
167 148
168 spi@f00 { 149 spi@f00 {
169 compatible = "fsl,mpc5200b-spi","fsl,mpc5200-spi"; 150 compatible = "fsl,mpc5200b-spi","fsl,mpc5200-spi";
170 reg = <0xf00 0x20>; 151 reg = <0xf00 0x20>;
171 interrupts = <2 13 0 2 14 0>; 152 interrupts = <2 13 0 2 14 0>;
172 interrupt-parent = <&mpc5200_pic>;
173 }; 153 };
174 154
175 usb@1000 { 155 usb@1000 {
176 compatible = "fsl,mpc5200b-ohci","fsl,mpc5200-ohci","ohci-be"; 156 compatible = "fsl,mpc5200b-ohci","fsl,mpc5200-ohci","ohci-be";
177 reg = <0x1000 0xff>; 157 reg = <0x1000 0xff>;
178 interrupts = <2 6 0>; 158 interrupts = <2 6 0>;
179 interrupt-parent = <&mpc5200_pic>;
180 }; 159 };
181 160
182 dma-controller@1200 { 161 dma-controller@1200 {
183 device_type = "dma-controller";
184 compatible = "fsl,mpc5200b-bestcomm","fsl,mpc5200-bestcomm"; 162 compatible = "fsl,mpc5200b-bestcomm","fsl,mpc5200-bestcomm";
185 reg = <0x1200 0x80>; 163 reg = <0x1200 0x80>;
186 interrupts = <3 0 0 3 1 0 3 2 0 3 3 0 164 interrupts = <3 0 0 3 1 0 3 2 0 3 3 0
187 3 4 0 3 5 0 3 6 0 3 7 0 165 3 4 0 3 5 0 3 6 0 3 7 0
188 3 8 0 3 9 0 3 10 0 3 11 0 166 3 8 0 3 9 0 3 10 0 3 11 0
189 3 12 0 3 13 0 3 14 0 3 15 0>; 167 3 12 0 3 13 0 3 14 0 3 15 0>;
190 interrupt-parent = <&mpc5200_pic>;
191 }; 168 };
192 169
193 xlb@1f00 { 170 xlb@1f00 {
@@ -196,13 +173,10 @@
196 }; 173 };
197 174
198 serial@2000 { // PSC1 175 serial@2000 { // PSC1
199 device_type = "serial";
200 compatible = "fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart"; 176 compatible = "fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart";
201 port-number = <0>; // Logical port assignment
202 cell-index = <0>; 177 cell-index = <0>;
203 reg = <0x2000 0x100>; 178 reg = <0x2000 0x100>;
204 interrupts = <2 1 0>; 179 interrupts = <2 1 0>;
205 interrupt-parent = <&mpc5200_pic>;
206 }; 180 };
207 181
208 // PSC2 in ac97 mode example 182 // PSC2 in ac97 mode example
@@ -211,7 +185,6 @@
211 // cell-index = <1>; 185 // cell-index = <1>;
212 // reg = <0x2200 0x100>; 186 // reg = <0x2200 0x100>;
213 // interrupts = <2 2 0>; 187 // interrupts = <2 2 0>;
214 // interrupt-parent = <&mpc5200_pic>;
215 //}; 188 //};
216 189
217 // PSC3 in CODEC mode example 190 // PSC3 in CODEC mode example
@@ -220,27 +193,22 @@
220 // cell-index = <2>; 193 // cell-index = <2>;
221 // reg = <0x2400 0x100>; 194 // reg = <0x2400 0x100>;
222 // interrupts = <2 3 0>; 195 // interrupts = <2 3 0>;
223 // interrupt-parent = <&mpc5200_pic>;
224 //}; 196 //};
225 197
226 // PSC4 in uart mode example 198 // PSC4 in uart mode example
227 //serial@2600 { // PSC4 199 //serial@2600 { // PSC4
228 // device_type = "serial";
229 // compatible = "fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart"; 200 // compatible = "fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart";
230 // cell-index = <3>; 201 // cell-index = <3>;
231 // reg = <0x2600 0x100>; 202 // reg = <0x2600 0x100>;
232 // interrupts = <2 11 0>; 203 // interrupts = <2 11 0>;
233 // interrupt-parent = <&mpc5200_pic>;
234 //}; 204 //};
235 205
236 // PSC5 in uart mode example 206 // PSC5 in uart mode example
237 //serial@2800 { // PSC5 207 //serial@2800 { // PSC5
238 // device_type = "serial";
239 // compatible = "fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart"; 208 // compatible = "fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart";
240 // cell-index = <4>; 209 // cell-index = <4>;
241 // reg = <0x2800 0x100>; 210 // reg = <0x2800 0x100>;
242 // interrupts = <2 12 0>; 211 // interrupts = <2 12 0>;
243 // interrupt-parent = <&mpc5200_pic>;
244 //}; 212 //};
245 213
246 // PSC6 in spi mode example 214 // PSC6 in spi mode example
@@ -249,49 +217,40 @@
249 // cell-index = <5>; 217 // cell-index = <5>;
250 // reg = <0x2c00 0x100>; 218 // reg = <0x2c00 0x100>;
251 // interrupts = <2 4 0>; 219 // interrupts = <2 4 0>;
252 // interrupt-parent = <&mpc5200_pic>;
253 //}; 220 //};
254 221
255 ethernet@3000 { 222 ethernet@3000 {
256 device_type = "network";
257 compatible = "fsl,mpc5200b-fec","fsl,mpc5200-fec"; 223 compatible = "fsl,mpc5200b-fec","fsl,mpc5200-fec";
258 reg = <0x3000 0x400>; 224 reg = <0x3000 0x400>;
259 local-mac-address = [ 00 00 00 00 00 00 ]; 225 local-mac-address = [ 00 00 00 00 00 00 ];
260 interrupts = <2 5 0>; 226 interrupts = <2 5 0>;
261 interrupt-parent = <&mpc5200_pic>;
262 phy-handle = <&phy0>; 227 phy-handle = <&phy0>;
263 }; 228 };
264 229
265 mdio@3000 { 230 mdio@3000 {
266 #address-cells = <1>; 231 #address-cells = <1>;
267 #size-cells = <0>; 232 #size-cells = <0>;
268 compatible = "fsl,mpc5200b-mdio", "fsl,mpc5200-mdio"; 233 compatible = "fsl,mpc5200b-mdio","fsl,mpc5200-mdio";
269 reg = <0x3000 0x400>; // fec range, since we need to setup fec interrupts 234 reg = <0x3000 0x400>; // fec range, since we need to setup fec interrupts
270 interrupts = <2 5 0>; // these are for "mii command finished", not link changes & co. 235 interrupts = <2 5 0>; // these are for "mii command finished", not link changes & co.
271 interrupt-parent = <&mpc5200_pic>;
272 236
273 phy0: ethernet-phy@0 { 237 phy0: ethernet-phy@0 {
274 device_type = "ethernet-phy";
275 reg = <0>; 238 reg = <0>;
276 }; 239 };
277 }; 240 };
278 241
279 ata@3a00 { 242 ata@3a00 {
280 device_type = "ata";
281 compatible = "fsl,mpc5200b-ata","fsl,mpc5200-ata"; 243 compatible = "fsl,mpc5200b-ata","fsl,mpc5200-ata";
282 reg = <0x3a00 0x100>; 244 reg = <0x3a00 0x100>;
283 interrupts = <2 7 0>; 245 interrupts = <2 7 0>;
284 interrupt-parent = <&mpc5200_pic>;
285 }; 246 };
286 247
287 i2c@3d00 { 248 i2c@3d00 {
288 #address-cells = <1>; 249 #address-cells = <1>;
289 #size-cells = <0>; 250 #size-cells = <0>;
290 compatible = "fsl,mpc5200b-i2c","fsl,mpc5200-i2c","fsl-i2c"; 251 compatible = "fsl,mpc5200b-i2c","fsl,mpc5200-i2c","fsl-i2c";
291 cell-index = <0>;
292 reg = <0x3d00 0x40>; 252 reg = <0x3d00 0x40>;
293 interrupts = <2 15 0>; 253 interrupts = <2 15 0>;
294 interrupt-parent = <&mpc5200_pic>;
295 fsl5200-clocking; 254 fsl5200-clocking;
296 }; 255 };
297 256
@@ -299,14 +258,13 @@
299 #address-cells = <1>; 258 #address-cells = <1>;
300 #size-cells = <0>; 259 #size-cells = <0>;
301 compatible = "fsl,mpc5200b-i2c","fsl,mpc5200-i2c","fsl-i2c"; 260 compatible = "fsl,mpc5200b-i2c","fsl,mpc5200-i2c","fsl-i2c";
302 cell-index = <1>;
303 reg = <0x3d40 0x40>; 261 reg = <0x3d40 0x40>;
304 interrupts = <2 16 0>; 262 interrupts = <2 16 0>;
305 interrupt-parent = <&mpc5200_pic>;
306 fsl5200-clocking; 263 fsl5200-clocking;
307 }; 264 };
265
308 sram@8000 { 266 sram@8000 {
309 compatible = "fsl,mpc5200b-sram","fsl,mpc5200-sram","sram"; 267 compatible = "fsl,mpc5200b-sram","fsl,mpc5200-sram";
310 reg = <0x8000 0x4000>; 268 reg = <0x8000 0x4000>;
311 }; 269 };
312 }; 270 };
@@ -330,7 +288,6 @@
330 0xc800 0 0 4 &mpc5200_pic 0 0 3>; 288 0xc800 0 0 4 &mpc5200_pic 0 0 3>;
331 clock-frequency = <0>; // From boot loader 289 clock-frequency = <0>; // From boot loader
332 interrupts = <2 8 0 2 9 0 2 10 0>; 290 interrupts = <2 8 0 2 9 0 2 10 0>;
333 interrupt-parent = <&mpc5200_pic>;
334 bus-range = <0 0>; 291 bus-range = <0 0>;
335 ranges = <0x42000000 0 0x80000000 0x80000000 0 0x20000000 292 ranges = <0x42000000 0 0x80000000 0x80000000 0 0x20000000
336 0x02000000 0 0xa0000000 0xa0000000 0 0x10000000 293 0x02000000 0 0xa0000000 0xa0000000 0 0x10000000
diff --git a/arch/powerpc/boot/dts/media5200.dts b/arch/powerpc/boot/dts/media5200.dts
new file mode 100644
index 000000000000..e297d8b41875
--- /dev/null
+++ b/arch/powerpc/boot/dts/media5200.dts
@@ -0,0 +1,318 @@
1/*
2 * Freescale Media5200 board Device Tree Source
3 *
4 * Copyright 2009 Secret Lab Technologies Ltd.
5 * Grant Likely <grant.likely@secretlab.ca>
6 * Steven Cavanagh <scavanagh@secretlab.ca>
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
14/dts-v1/;
15
16/ {
17 model = "fsl,media5200";
18 compatible = "fsl,media5200";
19 #address-cells = <1>;
20 #size-cells = <1>;
21 interrupt-parent = <&mpc5200_pic>;
22
23 aliases {
24 console = &console;
25 ethernet0 = &eth0;
26 };
27
28 chosen {
29 linux,stdout-path = &console;
30 };
31
32 cpus {
33 #address-cells = <1>;
34 #size-cells = <0>;
35
36 PowerPC,5200@0 {
37 device_type = "cpu";
38 reg = <0>;
39 d-cache-line-size = <32>;
40 i-cache-line-size = <32>;
41 d-cache-size = <0x4000>; // L1, 16K
42 i-cache-size = <0x4000>; // L1, 16K
43 timebase-frequency = <33000000>; // 33 MHz, these were configured by U-Boot
44 bus-frequency = <132000000>; // 132 MHz
45 clock-frequency = <396000000>; // 396 MHz
46 };
47 };
48
49 memory {
50 device_type = "memory";
51 reg = <0x00000000 0x08000000>; // 128MB RAM
52 };
53
54 soc@f0000000 {
55 #address-cells = <1>;
56 #size-cells = <1>;
57 compatible = "fsl,mpc5200b-immr";
58 ranges = <0 0xf0000000 0x0000c000>;
59 reg = <0xf0000000 0x00000100>;
60 bus-frequency = <132000000>;// 132 MHz
61 system-frequency = <0>; // from bootloader
62
63 cdm@200 {
64 compatible = "fsl,mpc5200b-cdm","fsl,mpc5200-cdm";
65 reg = <0x200 0x38>;
66 };
67
68 mpc5200_pic: interrupt-controller@500 {
69 // 5200 interrupts are encoded into two levels;
70 interrupt-controller;
71 #interrupt-cells = <3>;
72 compatible = "fsl,mpc5200b-pic","fsl,mpc5200-pic";
73 reg = <0x500 0x80>;
74 };
75
76 timer@600 { // General Purpose Timer
77 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
78 reg = <0x600 0x10>;
79 interrupts = <1 9 0>;
80 fsl,has-wdt;
81 };
82
83 timer@610 { // General Purpose Timer
84 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
85 reg = <0x610 0x10>;
86 interrupts = <1 10 0>;
87 };
88
89 timer@620 { // General Purpose Timer
90 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
91 reg = <0x620 0x10>;
92 interrupts = <1 11 0>;
93 };
94
95 timer@630 { // General Purpose Timer
96 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
97 reg = <0x630 0x10>;
98 interrupts = <1 12 0>;
99 };
100
101 timer@640 { // General Purpose Timer
102 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
103 reg = <0x640 0x10>;
104 interrupts = <1 13 0>;
105 };
106
107 timer@650 { // General Purpose Timer
108 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
109 reg = <0x650 0x10>;
110 interrupts = <1 14 0>;
111 };
112
113 timer@660 { // General Purpose Timer
114 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
115 reg = <0x660 0x10>;
116 interrupts = <1 15 0>;
117 };
118
119 timer@670 { // General Purpose Timer
120 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
121 reg = <0x670 0x10>;
122 interrupts = <1 16 0>;
123 };
124
125 rtc@800 { // Real time clock
126 compatible = "fsl,mpc5200b-rtc","fsl,mpc5200-rtc";
127 reg = <0x800 0x100>;
128 interrupts = <1 5 0 1 6 0>;
129 };
130
131 can@900 {
132 compatible = "fsl,mpc5200b-mscan","fsl,mpc5200-mscan";
133 interrupts = <2 17 0>;
134 reg = <0x900 0x80>;
135 };
136
137 can@980 {
138 compatible = "fsl,mpc5200b-mscan","fsl,mpc5200-mscan";
139 interrupts = <2 18 0>;
140 reg = <0x980 0x80>;
141 };
142
143 gpio_simple: gpio@b00 {
144 compatible = "fsl,mpc5200b-gpio","fsl,mpc5200-gpio";
145 reg = <0xb00 0x40>;
146 interrupts = <1 7 0>;
147 gpio-controller;
148 #gpio-cells = <2>;
149 };
150
151 gpio_wkup: gpio@c00 {
152 compatible = "fsl,mpc5200b-gpio-wkup","fsl,mpc5200-gpio-wkup";
153 reg = <0xc00 0x40>;
154 interrupts = <1 8 0 0 3 0>;
155 gpio-controller;
156 #gpio-cells = <2>;
157 };
158
159 spi@f00 {
160 compatible = "fsl,mpc5200b-spi","fsl,mpc5200-spi";
161 reg = <0xf00 0x20>;
162 interrupts = <2 13 0 2 14 0>;
163 };
164
165 usb@1000 {
166 compatible = "fsl,mpc5200b-ohci","fsl,mpc5200-ohci","ohci-be";
167 reg = <0x1000 0x100>;
168 interrupts = <2 6 0>;
169 };
170
171 dma-controller@1200 {
172 compatible = "fsl,mpc5200b-bestcomm","fsl,mpc5200-bestcomm";
173 reg = <0x1200 0x80>;
174 interrupts = <3 0 0 3 1 0 3 2 0 3 3 0
175 3 4 0 3 5 0 3 6 0 3 7 0
176 3 8 0 3 9 0 3 10 0 3 11 0
177 3 12 0 3 13 0 3 14 0 3 15 0>;
178 };
179
180 xlb@1f00 {
181 compatible = "fsl,mpc5200b-xlb","fsl,mpc5200-xlb";
182 reg = <0x1f00 0x100>;
183 };
184
185 // PSC6 in uart mode
186 console: serial@2c00 { // PSC6
187 compatible = "fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart";
188 cell-index = <5>;
189 port-number = <0>; // Logical port assignment
190 reg = <0x2c00 0x100>;
191 interrupts = <2 4 0>;
192 };
193
194 eth0: ethernet@3000 {
195 compatible = "fsl,mpc5200b-fec","fsl,mpc5200-fec";
196 reg = <0x3000 0x400>;
197 local-mac-address = [ 00 00 00 00 00 00 ];
198 interrupts = <2 5 0>;
199 phy-handle = <&phy0>;
200 };
201
202 mdio@3000 {
203 #address-cells = <1>;
204 #size-cells = <0>;
205 compatible = "fsl,mpc5200b-mdio","fsl,mpc5200-mdio";
206 reg = <0x3000 0x400>; // fec range, since we need to setup fec interrupts
207 interrupts = <2 5 0>; // these are for "mii command finished", not link changes & co.
208
209 phy0: ethernet-phy@0 {
210 reg = <0>;
211 };
212 };
213
214 ata@3a00 {
215 compatible = "fsl,mpc5200b-ata","fsl,mpc5200-ata";
216 reg = <0x3a00 0x100>;
217 interrupts = <2 7 0>;
218 };
219
220 i2c@3d00 {
221 #address-cells = <1>;
222 #size-cells = <0>;
223 compatible = "fsl,mpc5200b-i2c","fsl,mpc5200-i2c","fsl-i2c";
224 reg = <0x3d00 0x40>;
225 interrupts = <2 15 0>;
226 fsl5200-clocking;
227 };
228
229 i2c@3d40 {
230 #address-cells = <1>;
231 #size-cells = <0>;
232 compatible = "fsl,mpc5200b-i2c","fsl,mpc5200-i2c","fsl-i2c";
233 reg = <0x3d40 0x40>;
234 interrupts = <2 16 0>;
235 fsl5200-clocking;
236 };
237
238 sram@8000 {
239 compatible = "fsl,mpc5200b-sram","fsl,mpc5200-sram";
240 reg = <0x8000 0x4000>;
241 };
242 };
243
244 pci@f0000d00 {
245 #interrupt-cells = <1>;
246 #size-cells = <2>;
247 #address-cells = <3>;
248 device_type = "pci";
249 compatible = "fsl,mpc5200b-pci","fsl,mpc5200-pci";
250 reg = <0xf0000d00 0x100>;
251 interrupt-map-mask = <0xf800 0 0 7>;
252 interrupt-map = <0xc000 0 0 1 &media5200_fpga 0 2 // 1st slot
253 0xc000 0 0 2 &media5200_fpga 0 3
254 0xc000 0 0 3 &media5200_fpga 0 4
255 0xc000 0 0 4 &media5200_fpga 0 5
256
257 0xc800 0 0 1 &media5200_fpga 0 3 // 2nd slot
258 0xc800 0 0 2 &media5200_fpga 0 4
259 0xc800 0 0 3 &media5200_fpga 0 5
260 0xc800 0 0 4 &media5200_fpga 0 2
261
262 0xd000 0 0 1 &media5200_fpga 0 4 // miniPCI
263 0xd000 0 0 2 &media5200_fpga 0 5
264
265 0xe000 0 0 1 &media5200_fpga 0 5 // CoralIP
266 >;
267 clock-frequency = <0>; // From boot loader
268 interrupts = <2 8 0 2 9 0 2 10 0>;
269 interrupt-parent = <&mpc5200_pic>;
270 bus-range = <0 0>;
271 ranges = <0x42000000 0 0x80000000 0x80000000 0 0x20000000
272 0x02000000 0 0xa0000000 0xa0000000 0 0x10000000
273 0x01000000 0 0x00000000 0xb0000000 0 0x01000000>;
274 };
275
276 localbus {
277 compatible = "fsl,mpc5200b-lpb","simple-bus";
278 #address-cells = <2>;
279 #size-cells = <1>;
280
281 ranges = < 0 0 0xfc000000 0x02000000
282 1 0 0xfe000000 0x02000000
283 2 0 0xf0010000 0x00010000
284 3 0 0xf0020000 0x00010000 >;
285
286 flash@0,0 {
287 compatible = "amd,am29lv28ml", "cfi-flash";
288 reg = <0 0x0 0x2000000>; // 32 MB
289 bank-width = <4>; // Width in bytes of the flash bank
290 device-width = <2>; // Two devices on each bank
291 };
292
293 flash@1,0 {
294 compatible = "amd,am29lv28ml", "cfi-flash";
295 reg = <1 0 0x2000000>; // 32 MB
296 bank-width = <4>; // Width in bytes of the flash bank
297 device-width = <2>; // Two devices on each bank
298 };
299
300 media5200_fpga: fpga@2,0 {
301 compatible = "fsl,media5200-fpga";
302 interrupt-controller;
303 #interrupt-cells = <2>; // 0:bank 1:id; no type field
304 reg = <2 0 0x10000>;
305
306 interrupt-parent = <&mpc5200_pic>;
307 interrupts = <0 0 3 // IRQ bank 0
308 1 1 3>; // IRQ bank 1
309 };
310
311 uart@3,0 {
312 compatible = "ti,tl16c752bpt";
313 reg = <3 0 0x10000>;
314 interrupt-parent = <&media5200_fpga>;
315 interrupts = <0 0 0 1>; // 2 irqs
316 };
317 };
318};
diff --git a/arch/powerpc/boot/dts/motionpro.dts b/arch/powerpc/boot/dts/motionpro.dts
index 52ba6f98b273..7be8ca038676 100644
--- a/arch/powerpc/boot/dts/motionpro.dts
+++ b/arch/powerpc/boot/dts/motionpro.dts
@@ -17,6 +17,7 @@
17 compatible = "promess,motionpro"; 17 compatible = "promess,motionpro";
18 #address-cells = <1>; 18 #address-cells = <1>;
19 #size-cells = <1>; 19 #size-cells = <1>;
20 interrupt-parent = <&mpc5200_pic>;
20 21
21 cpus { 22 cpus {
22 #address-cells = <1>; 23 #address-cells = <1>;
@@ -66,7 +67,6 @@
66 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt"; 67 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
67 reg = <0x600 0x10>; 68 reg = <0x600 0x10>;
68 interrupts = <1 9 0>; 69 interrupts = <1 9 0>;
69 interrupt-parent = <&mpc5200_pic>;
70 fsl,has-wdt; 70 fsl,has-wdt;
71 }; 71 };
72 72
@@ -74,35 +74,30 @@
74 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt"; 74 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
75 reg = <0x610 0x10>; 75 reg = <0x610 0x10>;
76 interrupts = <1 10 0>; 76 interrupts = <1 10 0>;
77 interrupt-parent = <&mpc5200_pic>;
78 }; 77 };
79 78
80 timer@620 { // General Purpose Timer 79 timer@620 { // General Purpose Timer
81 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt"; 80 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
82 reg = <0x620 0x10>; 81 reg = <0x620 0x10>;
83 interrupts = <1 11 0>; 82 interrupts = <1 11 0>;
84 interrupt-parent = <&mpc5200_pic>;
85 }; 83 };
86 84
87 timer@630 { // General Purpose Timer 85 timer@630 { // General Purpose Timer
88 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt"; 86 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
89 reg = <0x630 0x10>; 87 reg = <0x630 0x10>;
90 interrupts = <1 12 0>; 88 interrupts = <1 12 0>;
91 interrupt-parent = <&mpc5200_pic>;
92 }; 89 };
93 90
94 timer@640 { // General Purpose Timer 91 timer@640 { // General Purpose Timer
95 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt"; 92 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
96 reg = <0x640 0x10>; 93 reg = <0x640 0x10>;
97 interrupts = <1 13 0>; 94 interrupts = <1 13 0>;
98 interrupt-parent = <&mpc5200_pic>;
99 }; 95 };
100 96
101 timer@650 { // General Purpose Timer 97 timer@650 { // General Purpose Timer
102 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt"; 98 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
103 reg = <0x650 0x10>; 99 reg = <0x650 0x10>;
104 interrupts = <1 14 0>; 100 interrupts = <1 14 0>;
105 interrupt-parent = <&mpc5200_pic>;
106 }; 101 };
107 102
108 motionpro-led@660 { // Motion-PRO status LED 103 motionpro-led@660 { // Motion-PRO status LED
@@ -110,7 +105,6 @@
110 label = "motionpro-statusled"; 105 label = "motionpro-statusled";
111 reg = <0x660 0x10>; 106 reg = <0x660 0x10>;
112 interrupts = <1 15 0>; 107 interrupts = <1 15 0>;
113 interrupt-parent = <&mpc5200_pic>;
114 blink-delay = <100>; // 100 msec 108 blink-delay = <100>; // 100 msec
115 }; 109 };
116 110
@@ -119,49 +113,46 @@
119 label = "motionpro-readyled"; 113 label = "motionpro-readyled";
120 reg = <0x670 0x10>; 114 reg = <0x670 0x10>;
121 interrupts = <1 16 0>; 115 interrupts = <1 16 0>;
122 interrupt-parent = <&mpc5200_pic>;
123 }; 116 };
124 117
125 rtc@800 { // Real time clock 118 rtc@800 { // Real time clock
126 compatible = "fsl,mpc5200b-rtc","fsl,mpc5200-rtc"; 119 compatible = "fsl,mpc5200b-rtc","fsl,mpc5200-rtc";
127 reg = <0x800 0x100>; 120 reg = <0x800 0x100>;
128 interrupts = <1 5 0 1 6 0>; 121 interrupts = <1 5 0 1 6 0>;
129 interrupt-parent = <&mpc5200_pic>;
130 }; 122 };
131 123
132 can@980 { 124 can@980 {
133 compatible = "fsl,mpc5200b-mscan","fsl,mpc5200-mscan"; 125 compatible = "fsl,mpc5200b-mscan","fsl,mpc5200-mscan";
134 interrupts = <2 18 0>; 126 interrupts = <2 18 0>;
135 interrupt-parent = <&mpc5200_pic>;
136 reg = <0x980 0x80>; 127 reg = <0x980 0x80>;
137 }; 128 };
138 129
139 gpio@b00 { 130 gpio_simple: gpio@b00 {
140 compatible = "fsl,mpc5200b-gpio","fsl,mpc5200-gpio"; 131 compatible = "fsl,mpc5200b-gpio","fsl,mpc5200-gpio";
141 reg = <0xb00 0x40>; 132 reg = <0xb00 0x40>;
142 interrupts = <1 7 0>; 133 interrupts = <1 7 0>;
143 interrupt-parent = <&mpc5200_pic>; 134 gpio-controller;
135 #gpio-cells = <2>;
144 }; 136 };
145 137
146 gpio@c00 { 138 gpio_wkup: gpio@c00 {
147 compatible = "fsl,mpc5200b-gpio-wkup","fsl,mpc5200-gpio-wkup"; 139 compatible = "fsl,mpc5200b-gpio-wkup","fsl,mpc5200-gpio-wkup";
148 reg = <0xc00 0x40>; 140 reg = <0xc00 0x40>;
149 interrupts = <1 8 0 0 3 0>; 141 interrupts = <1 8 0 0 3 0>;
150 interrupt-parent = <&mpc5200_pic>; 142 gpio-controller;
143 #gpio-cells = <2>;
151 }; 144 };
152 145
153 spi@f00 { 146 spi@f00 {
154 compatible = "fsl,mpc5200b-spi","fsl,mpc5200-spi"; 147 compatible = "fsl,mpc5200b-spi","fsl,mpc5200-spi";
155 reg = <0xf00 0x20>; 148 reg = <0xf00 0x20>;
156 interrupts = <2 13 0 2 14 0>; 149 interrupts = <2 13 0 2 14 0>;
157 interrupt-parent = <&mpc5200_pic>;
158 }; 150 };
159 151
160 usb@1000 { 152 usb@1000 {
161 compatible = "fsl,mpc5200b-ohci","fsl,mpc5200-ohci","ohci-be"; 153 compatible = "fsl,mpc5200b-ohci","fsl,mpc5200-ohci","ohci-be";
162 reg = <0x1000 0xff>; 154 reg = <0x1000 0xff>;
163 interrupts = <2 6 0>; 155 interrupts = <2 6 0>;
164 interrupt-parent = <&mpc5200_pic>;
165 }; 156 };
166 157
167 dma-controller@1200 { 158 dma-controller@1200 {
@@ -171,7 +162,6 @@
171 3 4 0 3 5 0 3 6 0 3 7 0 162 3 4 0 3 5 0 3 6 0 3 7 0
172 3 8 0 3 9 0 3 10 0 3 11 0 163 3 8 0 3 9 0 3 10 0 3 11 0
173 3 12 0 3 13 0 3 14 0 3 15 0>; 164 3 12 0 3 13 0 3 14 0 3 15 0>;
174 interrupt-parent = <&mpc5200_pic>;
175 }; 165 };
176 166
177 xlb@1f00 { 167 xlb@1f00 {
@@ -180,12 +170,9 @@
180 }; 170 };
181 171
182 serial@2000 { // PSC1 172 serial@2000 { // PSC1
183 device_type = "serial";
184 compatible = "fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart"; 173 compatible = "fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart";
185 port-number = <0>; // Logical port assignment
186 reg = <0x2000 0x100>; 174 reg = <0x2000 0x100>;
187 interrupts = <2 1 0>; 175 interrupts = <2 1 0>;
188 interrupt-parent = <&mpc5200_pic>;
189 }; 176 };
190 177
191 // PSC2 in spi master mode 178 // PSC2 in spi master mode
@@ -194,26 +181,20 @@
194 cell-index = <1>; 181 cell-index = <1>;
195 reg = <0x2200 0x100>; 182 reg = <0x2200 0x100>;
196 interrupts = <2 2 0>; 183 interrupts = <2 2 0>;
197 interrupt-parent = <&mpc5200_pic>;
198 }; 184 };
199 185
200 // PSC5 in uart mode 186 // PSC5 in uart mode
201 serial@2800 { // PSC5 187 serial@2800 { // PSC5
202 device_type = "serial";
203 compatible = "fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart"; 188 compatible = "fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart";
204 port-number = <4>; // Logical port assignment
205 reg = <0x2800 0x100>; 189 reg = <0x2800 0x100>;
206 interrupts = <2 12 0>; 190 interrupts = <2 12 0>;
207 interrupt-parent = <&mpc5200_pic>;
208 }; 191 };
209 192
210 ethernet@3000 { 193 ethernet@3000 {
211 device_type = "network";
212 compatible = "fsl,mpc5200b-fec","fsl,mpc5200-fec"; 194 compatible = "fsl,mpc5200b-fec","fsl,mpc5200-fec";
213 reg = <0x3000 0x400>; 195 reg = <0x3000 0x400>;
214 local-mac-address = [ 00 00 00 00 00 00 ]; 196 local-mac-address = [ 00 00 00 00 00 00 ];
215 interrupts = <2 5 0>; 197 interrupts = <2 5 0>;
216 interrupt-parent = <&mpc5200_pic>;
217 phy-handle = <&phy0>; 198 phy-handle = <&phy0>;
218 }; 199 };
219 200
@@ -223,10 +204,8 @@
223 compatible = "fsl,mpc5200b-mdio","fsl,mpc5200-mdio"; 204 compatible = "fsl,mpc5200b-mdio","fsl,mpc5200-mdio";
224 reg = <0x3000 0x400>; // fec range, since we need to setup fec interrupts 205 reg = <0x3000 0x400>; // fec range, since we need to setup fec interrupts
225 interrupts = <2 5 0>; // these are for "mii command finished", not link changes & co. 206 interrupts = <2 5 0>; // these are for "mii command finished", not link changes & co.
226 interrupt-parent = <&mpc5200_pic>;
227 207
228 phy0: ethernet-phy@2 { 208 phy0: ethernet-phy@2 {
229 device_type = "ethernet-phy";
230 reg = <2>; 209 reg = <2>;
231 }; 210 };
232 }; 211 };
@@ -235,7 +214,6 @@
235 compatible = "fsl,mpc5200b-ata","fsl,mpc5200-ata"; 214 compatible = "fsl,mpc5200b-ata","fsl,mpc5200-ata";
236 reg = <0x3a00 0x100>; 215 reg = <0x3a00 0x100>;
237 interrupts = <2 7 0>; 216 interrupts = <2 7 0>;
238 interrupt-parent = <&mpc5200_pic>;
239 }; 217 };
240 218
241 i2c@3d40 { 219 i2c@3d40 {
@@ -244,7 +222,6 @@
244 compatible = "fsl,mpc5200b-i2c","fsl,mpc5200-i2c","fsl-i2c"; 222 compatible = "fsl,mpc5200b-i2c","fsl,mpc5200-i2c","fsl-i2c";
245 reg = <0x3d40 0x40>; 223 reg = <0x3d40 0x40>;
246 interrupts = <2 16 0>; 224 interrupts = <2 16 0>;
247 interrupt-parent = <&mpc5200_pic>;
248 fsl5200-clocking; 225 fsl5200-clocking;
249 226
250 rtc@68 { 227 rtc@68 {
@@ -259,8 +236,8 @@
259 }; 236 };
260 }; 237 };
261 238
262 lpb { 239 localbus {
263 compatible = "fsl,lpb"; 240 compatible = "fsl,mpc5200b-lpb","simple-bus";
264 #address-cells = <2>; 241 #address-cells = <2>;
265 #size-cells = <1>; 242 #size-cells = <1>;
266 ranges = <0 0 0xff000000 0x01000000 243 ranges = <0 0 0xff000000 0x01000000
@@ -273,7 +250,6 @@
273 compatible = "promess,motionpro-kollmorgen"; 250 compatible = "promess,motionpro-kollmorgen";
274 reg = <1 0 0x10000>; 251 reg = <1 0 0x10000>;
275 interrupts = <1 1 0>; 252 interrupts = <1 1 0>;
276 interrupt-parent = <&mpc5200_pic>;
277 }; 253 };
278 254
279 // 8-bit board CPLD on LocalPlus Bus CS2 255 // 8-bit board CPLD on LocalPlus Bus CS2
diff --git a/arch/powerpc/boot/dts/mpc8313erdb.dts b/arch/powerpc/boot/dts/mpc8313erdb.dts
index 3ebf7ec0484c..761faa7b6964 100644
--- a/arch/powerpc/boot/dts/mpc8313erdb.dts
+++ b/arch/powerpc/boot/dts/mpc8313erdb.dts
@@ -180,7 +180,7 @@
180 #address-cells = <1>; 180 #address-cells = <1>;
181 #size-cells = <1>; 181 #size-cells = <1>;
182 sleep = <&pmc 0x20000000>; 182 sleep = <&pmc 0x20000000>;
183 ranges; 183 ranges = <0x0 0x24000 0x1000>;
184 184
185 cell-index = <0>; 185 cell-index = <0>;
186 device_type = "network"; 186 device_type = "network";
@@ -195,11 +195,11 @@
195 fixed-link = <1 1 1000 0 0>; 195 fixed-link = <1 1 1000 0 0>;
196 fsl,magic-packet; 196 fsl,magic-packet;
197 197
198 mdio@24520 { 198 mdio@520 {
199 #address-cells = <1>; 199 #address-cells = <1>;
200 #size-cells = <0>; 200 #size-cells = <0>;
201 compatible = "fsl,gianfar-mdio"; 201 compatible = "fsl,gianfar-mdio";
202 reg = <0x24520 0x20>; 202 reg = <0x520 0x20>;
203 phy4: ethernet-phy@4 { 203 phy4: ethernet-phy@4 {
204 interrupt-parent = <&ipic>; 204 interrupt-parent = <&ipic>;
205 interrupts = <20 0x8>; 205 interrupts = <20 0x8>;
@@ -221,6 +221,7 @@
221 model = "eTSEC"; 221 model = "eTSEC";
222 compatible = "gianfar"; 222 compatible = "gianfar";
223 reg = <0x25000 0x1000>; 223 reg = <0x25000 0x1000>;
224 ranges = <0x0 0x25000 0x1000>;
224 local-mac-address = [ 00 00 00 00 00 00 ]; 225 local-mac-address = [ 00 00 00 00 00 00 ];
225 interrupts = <34 0x8 33 0x8 32 0x8>; 226 interrupts = <34 0x8 33 0x8 32 0x8>;
226 interrupt-parent = <&ipic>; 227 interrupt-parent = <&ipic>;
@@ -229,11 +230,11 @@
229 sleep = <&pmc 0x10000000>; 230 sleep = <&pmc 0x10000000>;
230 fsl,magic-packet; 231 fsl,magic-packet;
231 232
232 mdio@25520 { 233 mdio@520 {
233 #address-cells = <1>; 234 #address-cells = <1>;
234 #size-cells = <0>; 235 #size-cells = <0>;
235 compatible = "fsl,gianfar-tbi"; 236 compatible = "fsl,gianfar-tbi";
236 reg = <0x25520 0x20>; 237 reg = <0x520 0x20>;
237 238
238 tbi1: tbi-phy@11 { 239 tbi1: tbi-phy@11 {
239 reg = <0x11>; 240 reg = <0x11>;
diff --git a/arch/powerpc/boot/dts/mpc8315erdb.dts b/arch/powerpc/boot/dts/mpc8315erdb.dts
index 71784165b77e..3f4c5fb988a0 100644
--- a/arch/powerpc/boot/dts/mpc8315erdb.dts
+++ b/arch/powerpc/boot/dts/mpc8315erdb.dts
@@ -22,6 +22,8 @@
22 serial0 = &serial0; 22 serial0 = &serial0;
23 serial1 = &serial1; 23 serial1 = &serial1;
24 pci0 = &pci0; 24 pci0 = &pci0;
25 pci1 = &pci1;
26 pci2 = &pci2;
25 }; 27 };
26 28
27 cpus { 29 cpus {
@@ -188,66 +190,74 @@
188 phy_type = "utmi"; 190 phy_type = "utmi";
189 }; 191 };
190 192
191 mdio@24520 {
192 #address-cells = <1>;
193 #size-cells = <0>;
194 compatible = "fsl,gianfar-mdio";
195 reg = <0x24520 0x20>;
196 phy0: ethernet-phy@0 {
197 interrupt-parent = <&ipic>;
198 interrupts = <20 0x8>;
199 reg = <0x0>;
200 device_type = "ethernet-phy";
201 };
202 phy1: ethernet-phy@1 {
203 interrupt-parent = <&ipic>;
204 interrupts = <19 0x8>;
205 reg = <0x1>;
206 device_type = "ethernet-phy";
207 };
208 tbi0: tbi-phy@11 {
209 reg = <0x11>;
210 device_type = "tbi-phy";
211 };
212 };
213
214 mdio@25520 {
215 #address-cells = <1>;
216 #size-cells = <0>;
217 compatible = "fsl,gianfar-tbi";
218 reg = <0x25520 0x20>;
219
220 tbi1: tbi-phy@11 {
221 reg = <0x11>;
222 device_type = "tbi-phy";
223 };
224 };
225
226
227 enet0: ethernet@24000 { 193 enet0: ethernet@24000 {
194 #address-cells = <1>;
195 #size-cells = <1>;
228 cell-index = <0>; 196 cell-index = <0>;
229 device_type = "network"; 197 device_type = "network";
230 model = "eTSEC"; 198 model = "eTSEC";
231 compatible = "gianfar"; 199 compatible = "gianfar";
232 reg = <0x24000 0x1000>; 200 reg = <0x24000 0x1000>;
201 ranges = <0x0 0x24000 0x1000>;
233 local-mac-address = [ 00 00 00 00 00 00 ]; 202 local-mac-address = [ 00 00 00 00 00 00 ];
234 interrupts = <32 0x8 33 0x8 34 0x8>; 203 interrupts = <32 0x8 33 0x8 34 0x8>;
235 interrupt-parent = <&ipic>; 204 interrupt-parent = <&ipic>;
236 tbi-handle = <&tbi0>; 205 tbi-handle = <&tbi0>;
237 phy-handle = < &phy0 >; 206 phy-handle = < &phy0 >;
207
208 mdio@520 {
209 #address-cells = <1>;
210 #size-cells = <0>;
211 compatible = "fsl,gianfar-mdio";
212 reg = <0x520 0x20>;
213
214 phy0: ethernet-phy@0 {
215 interrupt-parent = <&ipic>;
216 interrupts = <20 0x8>;
217 reg = <0x0>;
218 device_type = "ethernet-phy";
219 };
220
221 phy1: ethernet-phy@1 {
222 interrupt-parent = <&ipic>;
223 interrupts = <19 0x8>;
224 reg = <0x1>;
225 device_type = "ethernet-phy";
226 };
227
228 tbi0: tbi-phy@11 {
229 reg = <0x11>;
230 device_type = "tbi-phy";
231 };
232 };
238 }; 233 };
239 234
240 enet1: ethernet@25000 { 235 enet1: ethernet@25000 {
236 #address-cells = <1>;
237 #size-cells = <1>;
241 cell-index = <1>; 238 cell-index = <1>;
242 device_type = "network"; 239 device_type = "network";
243 model = "eTSEC"; 240 model = "eTSEC";
244 compatible = "gianfar"; 241 compatible = "gianfar";
245 reg = <0x25000 0x1000>; 242 reg = <0x25000 0x1000>;
243 ranges = <0x0 0x25000 0x1000>;
246 local-mac-address = [ 00 00 00 00 00 00 ]; 244 local-mac-address = [ 00 00 00 00 00 00 ];
247 interrupts = <35 0x8 36 0x8 37 0x8>; 245 interrupts = <35 0x8 36 0x8 37 0x8>;
248 interrupt-parent = <&ipic>; 246 interrupt-parent = <&ipic>;
249 tbi-handle = <&tbi1>; 247 tbi-handle = <&tbi1>;
250 phy-handle = < &phy1 >; 248 phy-handle = < &phy1 >;
249
250 mdio@520 {
251 #address-cells = <1>;
252 #size-cells = <0>;
253 compatible = "fsl,gianfar-tbi";
254 reg = <0x520 0x20>;
255
256 tbi1: tbi-phy@11 {
257 reg = <0x11>;
258 device_type = "tbi-phy";
259 };
260 };
251 }; 261 };
252 262
253 serial0: serial@4500 { 263 serial0: serial@4500 {
@@ -349,4 +359,66 @@
349 compatible = "fsl,mpc8349-pci"; 359 compatible = "fsl,mpc8349-pci";
350 device_type = "pci"; 360 device_type = "pci";
351 }; 361 };
362
363 pci1: pcie@e0009000 {
364 #address-cells = <3>;
365 #size-cells = <2>;
366 #interrupt-cells = <1>;
367 device_type = "pci";
368 compatible = "fsl,mpc8315-pcie", "fsl,mpc8314-pcie";
369 reg = <0xe0009000 0x00001000>;
370 ranges = <0x02000000 0 0xa0000000 0xa0000000 0 0x10000000
371 0x01000000 0 0x00000000 0xb1000000 0 0x00800000>;
372 bus-range = <0 255>;
373 interrupt-map-mask = <0xf800 0 0 7>;
374 interrupt-map = <0 0 0 1 &ipic 1 8
375 0 0 0 2 &ipic 1 8
376 0 0 0 3 &ipic 1 8
377 0 0 0 4 &ipic 1 8>;
378 clock-frequency = <0>;
379
380 pcie@0 {
381 #address-cells = <3>;
382 #size-cells = <2>;
383 device_type = "pci";
384 reg = <0 0 0 0 0>;
385 ranges = <0x02000000 0 0xa0000000
386 0x02000000 0 0xa0000000
387 0 0x10000000
388 0x01000000 0 0x00000000
389 0x01000000 0 0x00000000
390 0 0x00800000>;
391 };
392 };
393
394 pci2: pcie@e000a000 {
395 #address-cells = <3>;
396 #size-cells = <2>;
397 #interrupt-cells = <1>;
398 device_type = "pci";
399 compatible = "fsl,mpc8315-pcie", "fsl,mpc8314-pcie";
400 reg = <0xe000a000 0x00001000>;
401 ranges = <0x02000000 0 0xc0000000 0xc0000000 0 0x10000000
402 0x01000000 0 0x00000000 0xd1000000 0 0x00800000>;
403 bus-range = <0 255>;
404 interrupt-map-mask = <0xf800 0 0 7>;
405 interrupt-map = <0 0 0 1 &ipic 2 8
406 0 0 0 2 &ipic 2 8
407 0 0 0 3 &ipic 2 8
408 0 0 0 4 &ipic 2 8>;
409 clock-frequency = <0>;
410
411 pcie@0 {
412 #address-cells = <3>;
413 #size-cells = <2>;
414 device_type = "pci";
415 reg = <0 0 0 0 0>;
416 ranges = <0x02000000 0 0xc0000000
417 0x02000000 0 0xc0000000
418 0 0x10000000
419 0x01000000 0 0x00000000
420 0x01000000 0 0x00000000
421 0 0x00800000>;
422 };
423 };
352}; 424};
diff --git a/arch/powerpc/boot/dts/mpc8349emitx.dts b/arch/powerpc/boot/dts/mpc8349emitx.dts
index b5eda94a8e2a..1ae38f0ddef8 100644
--- a/arch/powerpc/boot/dts/mpc8349emitx.dts
+++ b/arch/powerpc/boot/dts/mpc8349emitx.dts
@@ -170,57 +170,52 @@
170 phy_type = "ulpi"; 170 phy_type = "ulpi";
171 }; 171 };
172 172
173 mdio@24520 {
174 #address-cells = <1>;
175 #size-cells = <0>;
176 compatible = "fsl,gianfar-mdio";
177 reg = <0x24520 0x20>;
178
179 /* Vitesse 8201 */
180 phy1c: ethernet-phy@1c {
181 interrupt-parent = <&ipic>;
182 interrupts = <18 0x8>;
183 reg = <0x1c>;
184 device_type = "ethernet-phy";
185 };
186 tbi0: tbi-phy@11 {
187 reg = <0x11>;
188 device_type = "tbi-phy";
189 };
190 };
191
192 mdio@25520 {
193 #address-cells = <1>;
194 #size-cells = <0>;
195 compatible = "fsl,gianfar-tbi";
196 reg = <0x25520 0x20>;
197
198 tbi1: tbi-phy@11 {
199 reg = <0x11>;
200 device_type = "tbi-phy";
201 };
202 };
203
204 enet0: ethernet@24000 { 173 enet0: ethernet@24000 {
174 #address-cells = <1>;
175 #size-cells = <1>;
205 cell-index = <0>; 176 cell-index = <0>;
206 device_type = "network"; 177 device_type = "network";
207 model = "TSEC"; 178 model = "TSEC";
208 compatible = "gianfar"; 179 compatible = "gianfar";
209 reg = <0x24000 0x1000>; 180 reg = <0x24000 0x1000>;
181 ranges = <0x0 0x24000 0x1000>;
210 local-mac-address = [ 00 00 00 00 00 00 ]; 182 local-mac-address = [ 00 00 00 00 00 00 ];
211 interrupts = <32 0x8 33 0x8 34 0x8>; 183 interrupts = <32 0x8 33 0x8 34 0x8>;
212 interrupt-parent = <&ipic>; 184 interrupt-parent = <&ipic>;
213 tbi-handle = <&tbi0>; 185 tbi-handle = <&tbi0>;
214 phy-handle = <&phy1c>; 186 phy-handle = <&phy1c>;
215 linux,network-index = <0>; 187 linux,network-index = <0>;
188
189 mdio@520 {
190 #address-cells = <1>;
191 #size-cells = <0>;
192 compatible = "fsl,gianfar-mdio";
193 reg = <0x520 0x20>;
194
195 /* Vitesse 8201 */
196 phy1c: ethernet-phy@1c {
197 interrupt-parent = <&ipic>;
198 interrupts = <18 0x8>;
199 reg = <0x1c>;
200 device_type = "ethernet-phy";
201 };
202
203 tbi0: tbi-phy@11 {
204 reg = <0x11>;
205 device_type = "tbi-phy";
206 };
207 };
216 }; 208 };
217 209
218 enet1: ethernet@25000 { 210 enet1: ethernet@25000 {
211 #address-cells = <1>;
212 #size-cells = <1>;
219 cell-index = <1>; 213 cell-index = <1>;
220 device_type = "network"; 214 device_type = "network";
221 model = "TSEC"; 215 model = "TSEC";
222 compatible = "gianfar"; 216 compatible = "gianfar";
223 reg = <0x25000 0x1000>; 217 reg = <0x25000 0x1000>;
218 ranges = <0x0 0x25000 0x1000>;
224 local-mac-address = [ 00 00 00 00 00 00 ]; 219 local-mac-address = [ 00 00 00 00 00 00 ];
225 interrupts = <35 0x8 36 0x8 37 0x8>; 220 interrupts = <35 0x8 36 0x8 37 0x8>;
226 interrupt-parent = <&ipic>; 221 interrupt-parent = <&ipic>;
@@ -228,6 +223,18 @@
228 fixed-link = <1 1 1000 0 0>; 223 fixed-link = <1 1 1000 0 0>;
229 linux,network-index = <1>; 224 linux,network-index = <1>;
230 tbi-handle = <&tbi1>; 225 tbi-handle = <&tbi1>;
226
227 mdio@520 {
228 #address-cells = <1>;
229 #size-cells = <0>;
230 compatible = "fsl,gianfar-tbi";
231 reg = <0x520 0x20>;
232
233 tbi1: tbi-phy@11 {
234 reg = <0x11>;
235 device_type = "tbi-phy";
236 };
237 };
231 }; 238 };
232 239
233 serial0: serial@4500 { 240 serial0: serial@4500 {
diff --git a/arch/powerpc/boot/dts/mpc8349emitxgp.dts b/arch/powerpc/boot/dts/mpc8349emitxgp.dts
index c87a6015e165..662abe1fb804 100644
--- a/arch/powerpc/boot/dts/mpc8349emitxgp.dts
+++ b/arch/powerpc/boot/dts/mpc8349emitxgp.dts
@@ -149,37 +149,41 @@
149 phy_type = "ulpi"; 149 phy_type = "ulpi";
150 }; 150 };
151 151
152 mdio@24520 {
153 #address-cells = <1>;
154 #size-cells = <0>;
155 compatible = "fsl,gianfar-mdio";
156 reg = <0x24520 0x20>;
157
158 /* Vitesse 8201 */
159 phy1c: ethernet-phy@1c {
160 interrupt-parent = <&ipic>;
161 interrupts = <18 0x8>;
162 reg = <0x1c>;
163 device_type = "ethernet-phy";
164 };
165 tbi0: tbi-phy@11 {
166 reg = <0x11>;
167 device_type = "tbi-phy";
168 };
169 };
170
171 enet0: ethernet@24000 { 152 enet0: ethernet@24000 {
153 #address-cells = <1>;
154 #size-cells = <1>;
172 cell-index = <0>; 155 cell-index = <0>;
173 device_type = "network"; 156 device_type = "network";
174 model = "TSEC"; 157 model = "TSEC";
175 compatible = "gianfar"; 158 compatible = "gianfar";
176 reg = <0x24000 0x1000>; 159 reg = <0x24000 0x1000>;
160 ranges = <0x0 0x24000 0x1000>;
177 local-mac-address = [ 00 00 00 00 00 00 ]; 161 local-mac-address = [ 00 00 00 00 00 00 ];
178 interrupts = <32 0x8 33 0x8 34 0x8>; 162 interrupts = <32 0x8 33 0x8 34 0x8>;
179 interrupt-parent = <&ipic>; 163 interrupt-parent = <&ipic>;
180 tbi-handle = <&tbi0>; 164 tbi-handle = <&tbi0>;
181 phy-handle = <&phy1c>; 165 phy-handle = <&phy1c>;
182 linux,network-index = <0>; 166 linux,network-index = <0>;
167
168 mdio@520 {
169 #address-cells = <1>;
170 #size-cells = <0>;
171 compatible = "fsl,gianfar-mdio";
172 reg = <0x520 0x20>;
173
174 /* Vitesse 8201 */
175 phy1c: ethernet-phy@1c {
176 interrupt-parent = <&ipic>;
177 interrupts = <18 0x8>;
178 reg = <0x1c>;
179 device_type = "ethernet-phy";
180 };
181
182 tbi0: tbi-phy@11 {
183 reg = <0x11>;
184 device_type = "tbi-phy";
185 };
186 };
183 }; 187 };
184 188
185 serial0: serial@4500 { 189 serial0: serial@4500 {
diff --git a/arch/powerpc/boot/dts/mpc834x_mds.dts b/arch/powerpc/boot/dts/mpc834x_mds.dts
index d9adba01c09c..d9f0a2325fa4 100644
--- a/arch/powerpc/boot/dts/mpc834x_mds.dts
+++ b/arch/powerpc/boot/dts/mpc834x_mds.dts
@@ -167,69 +167,76 @@
167 phy_type = "ulpi"; 167 phy_type = "ulpi";
168 }; 168 };
169 169
170 mdio@24520 {
171 #address-cells = <1>;
172 #size-cells = <0>;
173 compatible = "fsl,gianfar-mdio";
174 reg = <0x24520 0x20>;
175
176 phy0: ethernet-phy@0 {
177 interrupt-parent = <&ipic>;
178 interrupts = <17 0x8>;
179 reg = <0x0>;
180 device_type = "ethernet-phy";
181 };
182 phy1: ethernet-phy@1 {
183 interrupt-parent = <&ipic>;
184 interrupts = <18 0x8>;
185 reg = <0x1>;
186 device_type = "ethernet-phy";
187 };
188 tbi0: tbi-phy@11 {
189 reg = <0x11>;
190 device_type = "tbi-phy";
191 };
192 };
193
194 mdio@25520 {
195 #address-cells = <1>;
196 #size-cells = <0>;
197 compatible = "fsl,gianfar-tbi";
198 reg = <0x25520 0x20>;
199
200 tbi1: tbi-phy@11 {
201 reg = <0x11>;
202 device_type = "tbi-phy";
203 };
204 };
205
206
207 enet0: ethernet@24000 { 170 enet0: ethernet@24000 {
171 #address-cells = <1>;
172 #size-cells = <1>;
208 cell-index = <0>; 173 cell-index = <0>;
209 device_type = "network"; 174 device_type = "network";
210 model = "TSEC"; 175 model = "TSEC";
211 compatible = "gianfar"; 176 compatible = "gianfar";
212 reg = <0x24000 0x1000>; 177 reg = <0x24000 0x1000>;
178 ranges = <0x0 0x24000 0x1000>;
213 local-mac-address = [ 00 00 00 00 00 00 ]; 179 local-mac-address = [ 00 00 00 00 00 00 ];
214 interrupts = <32 0x8 33 0x8 34 0x8>; 180 interrupts = <32 0x8 33 0x8 34 0x8>;
215 interrupt-parent = <&ipic>; 181 interrupt-parent = <&ipic>;
216 tbi-handle = <&tbi0>; 182 tbi-handle = <&tbi0>;
217 phy-handle = <&phy0>; 183 phy-handle = <&phy0>;
218 linux,network-index = <0>; 184 linux,network-index = <0>;
185
186 mdio@520 {
187 #address-cells = <1>;
188 #size-cells = <0>;
189 compatible = "fsl,gianfar-mdio";
190 reg = <0x520 0x20>;
191
192 phy0: ethernet-phy@0 {
193 interrupt-parent = <&ipic>;
194 interrupts = <17 0x8>;
195 reg = <0x0>;
196 device_type = "ethernet-phy";
197 };
198
199 phy1: ethernet-phy@1 {
200 interrupt-parent = <&ipic>;
201 interrupts = <18 0x8>;
202 reg = <0x1>;
203 device_type = "ethernet-phy";
204 };
205
206 tbi0: tbi-phy@11 {
207 reg = <0x11>;
208 device_type = "tbi-phy";
209 };
210 };
219 }; 211 };
220 212
221 enet1: ethernet@25000 { 213 enet1: ethernet@25000 {
214 #address-cells = <1>;
215 #size-cells = <1>;
222 cell-index = <1>; 216 cell-index = <1>;
223 device_type = "network"; 217 device_type = "network";
224 model = "TSEC"; 218 model = "TSEC";
225 compatible = "gianfar"; 219 compatible = "gianfar";
226 reg = <0x25000 0x1000>; 220 reg = <0x25000 0x1000>;
221 ranges = <0x0 0x25000 0x1000>;
227 local-mac-address = [ 00 00 00 00 00 00 ]; 222 local-mac-address = [ 00 00 00 00 00 00 ];
228 interrupts = <35 0x8 36 0x8 37 0x8>; 223 interrupts = <35 0x8 36 0x8 37 0x8>;
229 interrupt-parent = <&ipic>; 224 interrupt-parent = <&ipic>;
230 tbi-handle = <&tbi1>; 225 tbi-handle = <&tbi1>;
231 phy-handle = <&phy1>; 226 phy-handle = <&phy1>;
232 linux,network-index = <1>; 227 linux,network-index = <1>;
228
229 mdio@520 {
230 #address-cells = <1>;
231 #size-cells = <0>;
232 compatible = "fsl,gianfar-tbi";
233 reg = <0x520 0x20>;
234
235 tbi1: tbi-phy@11 {
236 reg = <0x11>;
237 device_type = "tbi-phy";
238 };
239 };
233 }; 240 };
234 241
235 serial0: serial@4500 { 242 serial0: serial@4500 {
diff --git a/arch/powerpc/boot/dts/mpc8377_mds.dts b/arch/powerpc/boot/dts/mpc8377_mds.dts
index 1d14d7052e6d..963708017e6c 100644
--- a/arch/powerpc/boot/dts/mpc8377_mds.dts
+++ b/arch/powerpc/boot/dts/mpc8377_mds.dts
@@ -23,6 +23,8 @@
23 serial0 = &serial0; 23 serial0 = &serial0;
24 serial1 = &serial1; 24 serial1 = &serial1;
25 pci0 = &pci0; 25 pci0 = &pci0;
26 pci1 = &pci1;
27 pci2 = &pci2;
26 }; 28 };
27 29
28 cpus { 30 cpus {
@@ -127,21 +129,38 @@
127 reg = <0x200 0x100>; 129 reg = <0x200 0x100>;
128 }; 130 };
129 131
130 i2c@3000 { 132 sleep-nexus {
131 #address-cells = <1>; 133 #address-cells = <1>;
132 #size-cells = <0>; 134 #size-cells = <1>;
133 cell-index = <0>; 135 compatible = "simple-bus";
134 compatible = "fsl-i2c"; 136 sleep = <&pmc 0x0c000000>;
135 reg = <0x3000 0x100>; 137 ranges;
136 interrupts = <14 0x8>; 138
137 interrupt-parent = <&ipic>; 139 i2c@3000 {
138 dfsrr; 140 #address-cells = <1>;
141 #size-cells = <0>;
142 cell-index = <0>;
143 compatible = "fsl-i2c";
144 reg = <0x3000 0x100>;
145 interrupts = <14 0x8>;
146 interrupt-parent = <&ipic>;
147 dfsrr;
148
149 rtc@68 {
150 compatible = "dallas,ds1374";
151 reg = <0x68>;
152 interrupts = <19 0x8>;
153 interrupt-parent = <&ipic>;
154 };
155 };
139 156
140 rtc@68 { 157 sdhci@2e000 {
141 compatible = "dallas,ds1374"; 158 compatible = "fsl,mpc8377-esdhc", "fsl,mpc8379-esdhc";
142 reg = <0x68>; 159 reg = <0x2e000 0x1000>;
143 interrupts = <19 0x8>; 160 interrupts = <42 0x8>;
144 interrupt-parent = <&ipic>; 161 interrupt-parent = <&ipic>;
162 /* Filled in by U-Boot */
163 clock-frequency = <0>;
145 }; 164 };
146 }; 165 };
147 166
@@ -174,70 +193,83 @@
174 interrupts = <38 0x8>; 193 interrupts = <38 0x8>;
175 dr_mode = "host"; 194 dr_mode = "host";
176 phy_type = "ulpi"; 195 phy_type = "ulpi";
196 sleep = <&pmc 0x00c00000>;
177 }; 197 };
178 198
179 mdio@24520 {
180 #address-cells = <1>;
181 #size-cells = <0>;
182 compatible = "fsl,gianfar-mdio";
183 reg = <0x24520 0x20>;
184 phy2: ethernet-phy@2 {
185 interrupt-parent = <&ipic>;
186 interrupts = <17 0x8>;
187 reg = <0x2>;
188 device_type = "ethernet-phy";
189 };
190 phy3: ethernet-phy@3 {
191 interrupt-parent = <&ipic>;
192 interrupts = <18 0x8>;
193 reg = <0x3>;
194 device_type = "ethernet-phy";
195 };
196 tbi0: tbi-phy@11 {
197 reg = <0x11>;
198 device_type = "tbi-phy";
199 };
200 };
201
202 mdio@25520 {
203 #address-cells = <1>;
204 #size-cells = <0>;
205 compatible = "fsl,gianfar-tbi";
206 reg = <0x25520 0x20>;
207
208 tbi1: tbi-phy@11 {
209 reg = <0x11>;
210 device_type = "tbi-phy";
211 };
212 };
213
214
215 enet0: ethernet@24000 { 199 enet0: ethernet@24000 {
200 #address-cells = <1>;
201 #size-cells = <1>;
216 cell-index = <0>; 202 cell-index = <0>;
217 device_type = "network"; 203 device_type = "network";
218 model = "eTSEC"; 204 model = "eTSEC";
219 compatible = "gianfar"; 205 compatible = "gianfar";
220 reg = <0x24000 0x1000>; 206 reg = <0x24000 0x1000>;
207 ranges = <0x0 0x24000 0x1000>;
221 local-mac-address = [ 00 00 00 00 00 00 ]; 208 local-mac-address = [ 00 00 00 00 00 00 ];
222 interrupts = <32 0x8 33 0x8 34 0x8>; 209 interrupts = <32 0x8 33 0x8 34 0x8>;
223 phy-connection-type = "mii"; 210 phy-connection-type = "mii";
224 interrupt-parent = <&ipic>; 211 interrupt-parent = <&ipic>;
225 tbi-handle = <&tbi0>; 212 tbi-handle = <&tbi0>;
226 phy-handle = <&phy2>; 213 phy-handle = <&phy2>;
214 sleep = <&pmc 0xc0000000>;
215 fsl,magic-packet;
216
217 mdio@520 {
218 #address-cells = <1>;
219 #size-cells = <0>;
220 compatible = "fsl,gianfar-mdio";
221 reg = <0x520 0x20>;
222
223 phy2: ethernet-phy@2 {
224 interrupt-parent = <&ipic>;
225 interrupts = <17 0x8>;
226 reg = <0x2>;
227 device_type = "ethernet-phy";
228 };
229
230 phy3: ethernet-phy@3 {
231 interrupt-parent = <&ipic>;
232 interrupts = <18 0x8>;
233 reg = <0x3>;
234 device_type = "ethernet-phy";
235 };
236
237 tbi0: tbi-phy@11 {
238 reg = <0x11>;
239 device_type = "tbi-phy";
240 };
241 };
227 }; 242 };
228 243
229 enet1: ethernet@25000 { 244 enet1: ethernet@25000 {
245 #address-cells = <1>;
246 #size-cells = <1>;
230 cell-index = <1>; 247 cell-index = <1>;
231 device_type = "network"; 248 device_type = "network";
232 model = "eTSEC"; 249 model = "eTSEC";
233 compatible = "gianfar"; 250 compatible = "gianfar";
234 reg = <0x25000 0x1000>; 251 reg = <0x25000 0x1000>;
252 ranges = <0x0 0x25000 0x1000>;
235 local-mac-address = [ 00 00 00 00 00 00 ]; 253 local-mac-address = [ 00 00 00 00 00 00 ];
236 interrupts = <35 0x8 36 0x8 37 0x8>; 254 interrupts = <35 0x8 36 0x8 37 0x8>;
237 phy-connection-type = "mii"; 255 phy-connection-type = "mii";
238 interrupt-parent = <&ipic>; 256 interrupt-parent = <&ipic>;
239 tbi-handle = <&tbi1>; 257 tbi-handle = <&tbi1>;
240 phy-handle = <&phy3>; 258 phy-handle = <&phy3>;
259 sleep = <&pmc 0x30000000>;
260 fsl,magic-packet;
261
262 mdio@520 {
263 #address-cells = <1>;
264 #size-cells = <0>;
265 compatible = "fsl,gianfar-tbi";
266 reg = <0x520 0x20>;
267
268 tbi1: tbi-phy@11 {
269 reg = <0x11>;
270 device_type = "tbi-phy";
271 };
272 };
241 }; 273 };
242 274
243 serial0: serial@4500 { 275 serial0: serial@4500 {
@@ -309,14 +341,7 @@
309 fsl,channel-fifo-len = <24>; 341 fsl,channel-fifo-len = <24>;
310 fsl,exec-units-mask = <0x9fe>; 342 fsl,exec-units-mask = <0x9fe>;
311 fsl,descriptor-types-mask = <0x3ab0ebf>; 343 fsl,descriptor-types-mask = <0x3ab0ebf>;
312 }; 344 sleep = <&pmc 0x03000000>;
313
314 sdhc@2e000 {
315 model = "eSDHC";
316 compatible = "fsl,esdhc";
317 reg = <0x2e000 0x1000>;
318 interrupts = <42 0x8>;
319 interrupt-parent = <&ipic>;
320 }; 345 };
321 346
322 sata@18000 { 347 sata@18000 {
@@ -324,6 +349,7 @@
324 reg = <0x18000 0x1000>; 349 reg = <0x18000 0x1000>;
325 interrupts = <44 0x8>; 350 interrupts = <44 0x8>;
326 interrupt-parent = <&ipic>; 351 interrupt-parent = <&ipic>;
352 sleep = <&pmc 0x000000c0>;
327 }; 353 };
328 354
329 sata@19000 { 355 sata@19000 {
@@ -331,6 +357,7 @@
331 reg = <0x19000 0x1000>; 357 reg = <0x19000 0x1000>;
332 interrupts = <45 0x8>; 358 interrupts = <45 0x8>;
333 interrupt-parent = <&ipic>; 359 interrupt-parent = <&ipic>;
360 sleep = <&pmc 0x00000030>;
334 }; 361 };
335 362
336 /* IPIC 363 /* IPIC
@@ -346,6 +373,13 @@
346 #interrupt-cells = <2>; 373 #interrupt-cells = <2>;
347 reg = <0x700 0x100>; 374 reg = <0x700 0x100>;
348 }; 375 };
376
377 pmc: power@b00 {
378 compatible = "fsl,mpc8377-pmc", "fsl,mpc8349-pmc";
379 reg = <0xb00 0x100 0xa00 0x100>;
380 interrupts = <80 0x8>;
381 interrupt-parent = <&ipic>;
382 };
349 }; 383 };
350 384
351 pci0: pci@e0008500 { 385 pci0: pci@e0008500 {
@@ -400,6 +434,7 @@
400 ranges = <0x02000000 0x0 0x90000000 0x90000000 0x0 0x10000000 434 ranges = <0x02000000 0x0 0x90000000 0x90000000 0x0 0x10000000
401 0x42000000 0x0 0x80000000 0x80000000 0x0 0x10000000 435 0x42000000 0x0 0x80000000 0x80000000 0x0 0x10000000
402 0x01000000 0x0 0x00000000 0xe0300000 0x0 0x00100000>; 436 0x01000000 0x0 0x00000000 0xe0300000 0x0 0x00100000>;
437 sleep = <&pmc 0x00010000>;
403 clock-frequency = <0>; 438 clock-frequency = <0>;
404 #interrupt-cells = <1>; 439 #interrupt-cells = <1>;
405 #size-cells = <2>; 440 #size-cells = <2>;
@@ -409,4 +444,68 @@
409 compatible = "fsl,mpc8349-pci"; 444 compatible = "fsl,mpc8349-pci";
410 device_type = "pci"; 445 device_type = "pci";
411 }; 446 };
447
448 pci1: pcie@e0009000 {
449 #address-cells = <3>;
450 #size-cells = <2>;
451 #interrupt-cells = <1>;
452 device_type = "pci";
453 compatible = "fsl,mpc8377-pcie", "fsl,mpc8314-pcie";
454 reg = <0xe0009000 0x00001000>;
455 ranges = <0x02000000 0 0xa8000000 0xa8000000 0 0x10000000
456 0x01000000 0 0x00000000 0xb8000000 0 0x00800000>;
457 bus-range = <0 255>;
458 interrupt-map-mask = <0xf800 0 0 7>;
459 interrupt-map = <0 0 0 1 &ipic 1 8
460 0 0 0 2 &ipic 1 8
461 0 0 0 3 &ipic 1 8
462 0 0 0 4 &ipic 1 8>;
463 sleep = <&pmc 0x00300000>;
464 clock-frequency = <0>;
465
466 pcie@0 {
467 #address-cells = <3>;
468 #size-cells = <2>;
469 device_type = "pci";
470 reg = <0 0 0 0 0>;
471 ranges = <0x02000000 0 0xa8000000
472 0x02000000 0 0xa8000000
473 0 0x10000000
474 0x01000000 0 0x00000000
475 0x01000000 0 0x00000000
476 0 0x00800000>;
477 };
478 };
479
480 pci2: pcie@e000a000 {
481 #address-cells = <3>;
482 #size-cells = <2>;
483 #interrupt-cells = <1>;
484 device_type = "pci";
485 compatible = "fsl,mpc8377-pcie", "fsl,mpc8314-pcie";
486 reg = <0xe000a000 0x00001000>;
487 ranges = <0x02000000 0 0xc8000000 0xc8000000 0 0x10000000
488 0x01000000 0 0x00000000 0xd8000000 0 0x00800000>;
489 bus-range = <0 255>;
490 interrupt-map-mask = <0xf800 0 0 7>;
491 interrupt-map = <0 0 0 1 &ipic 2 8
492 0 0 0 2 &ipic 2 8
493 0 0 0 3 &ipic 2 8
494 0 0 0 4 &ipic 2 8>;
495 sleep = <&pmc 0x000c0000>;
496 clock-frequency = <0>;
497
498 pcie@0 {
499 #address-cells = <3>;
500 #size-cells = <2>;
501 device_type = "pci";
502 reg = <0 0 0 0 0>;
503 ranges = <0x02000000 0 0xc8000000
504 0x02000000 0 0xc8000000
505 0 0x10000000
506 0x01000000 0 0x00000000
507 0x01000000 0 0x00000000
508 0 0x00800000>;
509 };
510 };
412}; 511};
diff --git a/arch/powerpc/boot/dts/mpc8377_rdb.dts b/arch/powerpc/boot/dts/mpc8377_rdb.dts
index 9413af3b9925..053339390c22 100644
--- a/arch/powerpc/boot/dts/mpc8377_rdb.dts
+++ b/arch/powerpc/boot/dts/mpc8377_rdb.dts
@@ -22,6 +22,8 @@
22 serial0 = &serial0; 22 serial0 = &serial0;
23 serial1 = &serial1; 23 serial1 = &serial1;
24 pci0 = &pci0; 24 pci0 = &pci0;
25 pci1 = &pci1;
26 pci2 = &pci2;
25 }; 27 };
26 28
27 cpus { 29 cpus {
@@ -107,26 +109,72 @@
107 reg = <0x200 0x100>; 109 reg = <0x200 0x100>;
108 }; 110 };
109 111
110 i2c@3000 { 112 gpio1: gpio-controller@c00 {
111 #address-cells = <1>; 113 #gpio-cells = <2>;
112 #size-cells = <0>; 114 compatible = "fsl,mpc8377-gpio", "fsl,mpc8349-gpio";
113 cell-index = <0>; 115 reg = <0xc00 0x100>;
114 compatible = "fsl-i2c"; 116 interrupts = <74 0x8>;
115 reg = <0x3000 0x100>;
116 interrupts = <14 0x8>;
117 interrupt-parent = <&ipic>; 117 interrupt-parent = <&ipic>;
118 dfsrr; 118 gpio-controller;
119 rtc@68 { 119 };
120 compatible = "dallas,ds1339"; 120
121 reg = <0x68>; 121 gpio2: gpio-controller@d00 {
122 #gpio-cells = <2>;
123 compatible = "fsl,mpc8377-gpio", "fsl,mpc8349-gpio";
124 reg = <0xd00 0x100>;
125 interrupts = <75 0x8>;
126 interrupt-parent = <&ipic>;
127 gpio-controller;
128 };
129
130 sleep-nexus {
131 #address-cells = <1>;
132 #size-cells = <1>;
133 compatible = "simple-bus";
134 sleep = <&pmc 0x0c000000>;
135 ranges;
136
137 i2c@3000 {
138 #address-cells = <1>;
139 #size-cells = <0>;
140 cell-index = <0>;
141 compatible = "fsl-i2c";
142 reg = <0x3000 0x100>;
143 interrupts = <14 0x8>;
144 interrupt-parent = <&ipic>;
145 dfsrr;
146
147 dtt@48 {
148 compatible = "national,lm75";
149 reg = <0x48>;
150 };
151
152 at24@50 {
153 compatible = "at24,24c256";
154 reg = <0x50>;
155 };
156
157 rtc@68 {
158 compatible = "dallas,ds1339";
159 reg = <0x68>;
160 };
161
162 mcu_pio: mcu@a {
163 #gpio-cells = <2>;
164 compatible = "fsl,mc9s08qg8-mpc8377erdb",
165 "fsl,mcu-mpc8349emitx";
166 reg = <0x0a>;
167 gpio-controller;
168 };
122 }; 169 };
123 170
124 mcu_pio: mcu@a { 171 sdhci@2e000 {
125 #gpio-cells = <2>; 172 compatible = "fsl,mpc8377-esdhc", "fsl,mpc8379-esdhc";
126 compatible = "fsl,mc9s08qg8-mpc8377erdb", 173 reg = <0x2e000 0x1000>;
127 "fsl,mcu-mpc8349emitx"; 174 interrupts = <42 0x8>;
128 reg = <0x0a>; 175 interrupt-parent = <&ipic>;
129 gpio-controller; 176 /* Filled in by U-Boot */
177 clock-frequency = <0>;
130 }; 178 };
131 }; 179 };
132 180
@@ -197,64 +245,76 @@
197 interrupt-parent = <&ipic>; 245 interrupt-parent = <&ipic>;
198 interrupts = <38 0x8>; 246 interrupts = <38 0x8>;
199 phy_type = "ulpi"; 247 phy_type = "ulpi";
248 sleep = <&pmc 0x00c00000>;
200 }; 249 };
201 250
202 mdio@24520 {
203 #address-cells = <1>;
204 #size-cells = <0>;
205 compatible = "fsl,gianfar-mdio";
206 reg = <0x24520 0x20>;
207 phy2: ethernet-phy@2 {
208 interrupt-parent = <&ipic>;
209 interrupts = <17 0x8>;
210 reg = <0x2>;
211 device_type = "ethernet-phy";
212 };
213 tbi0: tbi-phy@11 {
214 reg = <0x11>;
215 device_type = "tbi-phy";
216 };
217 };
218
219 mdio@25520 {
220 #address-cells = <1>;
221 #size-cells = <0>;
222 compatible = "fsl,gianfar-tbi";
223 reg = <0x25520 0x20>;
224
225 tbi1: tbi-phy@11 {
226 reg = <0x11>;
227 device_type = "tbi-phy";
228 };
229 };
230
231
232 enet0: ethernet@24000 { 251 enet0: ethernet@24000 {
252 #address-cells = <1>;
253 #size-cells = <1>;
233 cell-index = <0>; 254 cell-index = <0>;
234 device_type = "network"; 255 device_type = "network";
235 model = "eTSEC"; 256 model = "eTSEC";
236 compatible = "gianfar"; 257 compatible = "gianfar";
237 reg = <0x24000 0x1000>; 258 reg = <0x24000 0x1000>;
259 ranges = <0x0 0x24000 0x1000>;
238 local-mac-address = [ 00 00 00 00 00 00 ]; 260 local-mac-address = [ 00 00 00 00 00 00 ];
239 interrupts = <32 0x8 33 0x8 34 0x8>; 261 interrupts = <32 0x8 33 0x8 34 0x8>;
240 phy-connection-type = "mii"; 262 phy-connection-type = "mii";
241 interrupt-parent = <&ipic>; 263 interrupt-parent = <&ipic>;
242 tbi-handle = <&tbi0>; 264 tbi-handle = <&tbi0>;
243 phy-handle = <&phy2>; 265 phy-handle = <&phy2>;
266 sleep = <&pmc 0xc0000000>;
267 fsl,magic-packet;
268
269 mdio@520 {
270 #address-cells = <1>;
271 #size-cells = <0>;
272 compatible = "fsl,gianfar-mdio";
273 reg = <0x520 0x20>;
274
275 phy2: ethernet-phy@2 {
276 interrupt-parent = <&ipic>;
277 interrupts = <17 0x8>;
278 reg = <0x2>;
279 device_type = "ethernet-phy";
280 };
281
282 tbi0: tbi-phy@11 {
283 reg = <0x11>;
284 device_type = "tbi-phy";
285 };
286 };
244 }; 287 };
245 288
246 enet1: ethernet@25000 { 289 enet1: ethernet@25000 {
290 #address-cells = <1>;
291 #size-cells = <1>;
247 cell-index = <1>; 292 cell-index = <1>;
248 device_type = "network"; 293 device_type = "network";
249 model = "eTSEC"; 294 model = "eTSEC";
250 compatible = "gianfar"; 295 compatible = "gianfar";
251 reg = <0x25000 0x1000>; 296 reg = <0x25000 0x1000>;
297 ranges = <0x0 0x25000 0x1000>;
252 local-mac-address = [ 00 00 00 00 00 00 ]; 298 local-mac-address = [ 00 00 00 00 00 00 ];
253 interrupts = <35 0x8 36 0x8 37 0x8>; 299 interrupts = <35 0x8 36 0x8 37 0x8>;
254 phy-connection-type = "mii"; 300 phy-connection-type = "mii";
255 interrupt-parent = <&ipic>; 301 interrupt-parent = <&ipic>;
256 fixed-link = <1 1 1000 0 0>; 302 fixed-link = <1 1 1000 0 0>;
257 tbi-handle = <&tbi1>; 303 tbi-handle = <&tbi1>;
304 sleep = <&pmc 0x30000000>;
305 fsl,magic-packet;
306
307 mdio@520 {
308 #address-cells = <1>;
309 #size-cells = <0>;
310 compatible = "fsl,gianfar-tbi";
311 reg = <0x520 0x20>;
312
313 tbi1: tbi-phy@11 {
314 reg = <0x11>;
315 device_type = "tbi-phy";
316 };
317 };
258 }; 318 };
259 319
260 serial0: serial@4500 { 320 serial0: serial@4500 {
@@ -287,6 +347,7 @@
287 fsl,channel-fifo-len = <24>; 347 fsl,channel-fifo-len = <24>;
288 fsl,exec-units-mask = <0x9fe>; 348 fsl,exec-units-mask = <0x9fe>;
289 fsl,descriptor-types-mask = <0x3ab0ebf>; 349 fsl,descriptor-types-mask = <0x3ab0ebf>;
350 sleep = <&pmc 0x03000000>;
290 }; 351 };
291 352
292 sata@18000 { 353 sata@18000 {
@@ -294,6 +355,7 @@
294 reg = <0x18000 0x1000>; 355 reg = <0x18000 0x1000>;
295 interrupts = <44 0x8>; 356 interrupts = <44 0x8>;
296 interrupt-parent = <&ipic>; 357 interrupt-parent = <&ipic>;
358 sleep = <&pmc 0x000000c0>;
297 }; 359 };
298 360
299 sata@19000 { 361 sata@19000 {
@@ -301,6 +363,7 @@
301 reg = <0x19000 0x1000>; 363 reg = <0x19000 0x1000>;
302 interrupts = <45 0x8>; 364 interrupts = <45 0x8>;
303 interrupt-parent = <&ipic>; 365 interrupt-parent = <&ipic>;
366 sleep = <&pmc 0x00000030>;
304 }; 367 };
305 368
306 /* IPIC 369 /* IPIC
@@ -316,6 +379,13 @@
316 #interrupt-cells = <2>; 379 #interrupt-cells = <2>;
317 reg = <0x700 0x100>; 380 reg = <0x700 0x100>;
318 }; 381 };
382
383 pmc: power@b00 {
384 compatible = "fsl,mpc8377-pmc", "fsl,mpc8349-pmc";
385 reg = <0xb00 0x100 0xa00 0x100>;
386 interrupts = <80 0x8>;
387 interrupt-parent = <&ipic>;
388 };
319 }; 389 };
320 390
321 pci0: pci@e0008500 { 391 pci0: pci@e0008500 {
@@ -341,6 +411,7 @@
341 ranges = <0x02000000 0x0 0x90000000 0x90000000 0x0 0x10000000 411 ranges = <0x02000000 0x0 0x90000000 0x90000000 0x0 0x10000000
342 0x42000000 0x0 0x80000000 0x80000000 0x0 0x10000000 412 0x42000000 0x0 0x80000000 0x80000000 0x0 0x10000000
343 0x01000000 0x0 0x00000000 0xe2000000 0x0 0x00100000>; 413 0x01000000 0x0 0x00000000 0xe2000000 0x0 0x00100000>;
414 sleep = <&pmc 0x00010000>;
344 clock-frequency = <66666666>; 415 clock-frequency = <66666666>;
345 #interrupt-cells = <1>; 416 #interrupt-cells = <1>;
346 #size-cells = <2>; 417 #size-cells = <2>;
@@ -350,4 +421,68 @@
350 compatible = "fsl,mpc8349-pci"; 421 compatible = "fsl,mpc8349-pci";
351 device_type = "pci"; 422 device_type = "pci";
352 }; 423 };
424
425 pci1: pcie@e0009000 {
426 #address-cells = <3>;
427 #size-cells = <2>;
428 #interrupt-cells = <1>;
429 device_type = "pci";
430 compatible = "fsl,mpc8377-pcie", "fsl,mpc8314-pcie";
431 reg = <0xe0009000 0x00001000>;
432 ranges = <0x02000000 0 0xa8000000 0xa8000000 0 0x10000000
433 0x01000000 0 0x00000000 0xb8000000 0 0x00800000>;
434 bus-range = <0 255>;
435 interrupt-map-mask = <0xf800 0 0 7>;
436 interrupt-map = <0 0 0 1 &ipic 1 8
437 0 0 0 2 &ipic 1 8
438 0 0 0 3 &ipic 1 8
439 0 0 0 4 &ipic 1 8>;
440 sleep = <&pmc 0x00300000>;
441 clock-frequency = <0>;
442
443 pcie@0 {
444 #address-cells = <3>;
445 #size-cells = <2>;
446 device_type = "pci";
447 reg = <0 0 0 0 0>;
448 ranges = <0x02000000 0 0xa8000000
449 0x02000000 0 0xa8000000
450 0 0x10000000
451 0x01000000 0 0x00000000
452 0x01000000 0 0x00000000
453 0 0x00800000>;
454 };
455 };
456
457 pci2: pcie@e000a000 {
458 #address-cells = <3>;
459 #size-cells = <2>;
460 #interrupt-cells = <1>;
461 device_type = "pci";
462 compatible = "fsl,mpc8377-pcie", "fsl,mpc8314-pcie";
463 reg = <0xe000a000 0x00001000>;
464 ranges = <0x02000000 0 0xc8000000 0xc8000000 0 0x10000000
465 0x01000000 0 0x00000000 0xd8000000 0 0x00800000>;
466 bus-range = <0 255>;
467 interrupt-map-mask = <0xf800 0 0 7>;
468 interrupt-map = <0 0 0 1 &ipic 2 8
469 0 0 0 2 &ipic 2 8
470 0 0 0 3 &ipic 2 8
471 0 0 0 4 &ipic 2 8>;
472 sleep = <&pmc 0x000c0000>;
473 clock-frequency = <0>;
474
475 pcie@0 {
476 #address-cells = <3>;
477 #size-cells = <2>;
478 device_type = "pci";
479 reg = <0 0 0 0 0>;
480 ranges = <0x02000000 0 0xc8000000
481 0x02000000 0 0xc8000000
482 0 0x10000000
483 0x01000000 0 0x00000000
484 0x01000000 0 0x00000000
485 0 0x00800000>;
486 };
487 };
353}; 488};
diff --git a/arch/powerpc/boot/dts/mpc8378_mds.dts b/arch/powerpc/boot/dts/mpc8378_mds.dts
index b85fc02682d2..651ff2f9db2d 100644
--- a/arch/powerpc/boot/dts/mpc8378_mds.dts
+++ b/arch/powerpc/boot/dts/mpc8378_mds.dts
@@ -23,6 +23,8 @@
23 serial0 = &serial0; 23 serial0 = &serial0;
24 serial1 = &serial1; 24 serial1 = &serial1;
25 pci0 = &pci0; 25 pci0 = &pci0;
26 pci1 = &pci1;
27 pci2 = &pci2;
26 }; 28 };
27 29
28 cpus { 30 cpus {
@@ -127,21 +129,38 @@
127 reg = <0x200 0x100>; 129 reg = <0x200 0x100>;
128 }; 130 };
129 131
130 i2c@3000 { 132 sleep-nexus {
131 #address-cells = <1>; 133 #address-cells = <1>;
132 #size-cells = <0>; 134 #size-cells = <1>;
133 cell-index = <0>; 135 compatible = "simple-bus";
134 compatible = "fsl-i2c"; 136 sleep = <&pmc 0x0c000000>;
135 reg = <0x3000 0x100>; 137 ranges;
136 interrupts = <14 0x8>; 138
137 interrupt-parent = <&ipic>; 139 i2c@3000 {
138 dfsrr; 140 #address-cells = <1>;
141 #size-cells = <0>;
142 cell-index = <0>;
143 compatible = "fsl-i2c";
144 reg = <0x3000 0x100>;
145 interrupts = <14 0x8>;
146 interrupt-parent = <&ipic>;
147 dfsrr;
148
149 rtc@68 {
150 compatible = "dallas,ds1374";
151 reg = <0x68>;
152 interrupts = <19 0x8>;
153 interrupt-parent = <&ipic>;
154 };
155 };
139 156
140 rtc@68 { 157 sdhci@2e000 {
141 compatible = "dallas,ds1374"; 158 compatible = "fsl,mpc8378-esdhc", "fsl,mpc8379-esdhc";
142 reg = <0x68>; 159 reg = <0x2e000 0x1000>;
143 interrupts = <19 0x8>; 160 interrupts = <42 0x8>;
144 interrupt-parent = <&ipic>; 161 interrupt-parent = <&ipic>;
162 /* Filled in by U-Boot */
163 clock-frequency = <0>;
145 }; 164 };
146 }; 165 };
147 166
@@ -213,70 +232,83 @@
213 interrupts = <38 0x8>; 232 interrupts = <38 0x8>;
214 dr_mode = "host"; 233 dr_mode = "host";
215 phy_type = "ulpi"; 234 phy_type = "ulpi";
235 sleep = <&pmc 0x00c00000>;
216 }; 236 };
217 237
218 mdio@24520 {
219 #address-cells = <1>;
220 #size-cells = <0>;
221 compatible = "fsl,gianfar-mdio";
222 reg = <0x24520 0x20>;
223 phy2: ethernet-phy@2 {
224 interrupt-parent = <&ipic>;
225 interrupts = <17 0x8>;
226 reg = <0x2>;
227 device_type = "ethernet-phy";
228 };
229 phy3: ethernet-phy@3 {
230 interrupt-parent = <&ipic>;
231 interrupts = <18 0x8>;
232 reg = <0x3>;
233 device_type = "ethernet-phy";
234 };
235 tbi0: tbi-phy@11 {
236 reg = <0x11>;
237 device_type = "tbi-phy";
238 };
239 };
240
241 mdio@25520 {
242 #address-cells = <1>;
243 #size-cells = <0>;
244 compatible = "fsl,gianfar-tbi";
245 reg = <0x25520 0x20>;
246
247 tbi1: tbi-phy@11 {
248 reg = <0x11>;
249 device_type = "tbi-phy";
250 };
251 };
252
253
254 enet0: ethernet@24000 { 238 enet0: ethernet@24000 {
239 #address-cells = <1>;
240 #size-cells = <1>;
255 cell-index = <0>; 241 cell-index = <0>;
256 device_type = "network"; 242 device_type = "network";
257 model = "eTSEC"; 243 model = "eTSEC";
258 compatible = "gianfar"; 244 compatible = "gianfar";
259 reg = <0x24000 0x1000>; 245 reg = <0x24000 0x1000>;
246 ranges = <0x0 0x24000 0x1000>;
260 local-mac-address = [ 00 00 00 00 00 00 ]; 247 local-mac-address = [ 00 00 00 00 00 00 ];
261 interrupts = <32 0x8 33 0x8 34 0x8>; 248 interrupts = <32 0x8 33 0x8 34 0x8>;
262 phy-connection-type = "mii"; 249 phy-connection-type = "mii";
263 interrupt-parent = <&ipic>; 250 interrupt-parent = <&ipic>;
264 tbi-handle = <&tbi0>; 251 tbi-handle = <&tbi0>;
265 phy-handle = <&phy2>; 252 phy-handle = <&phy2>;
253 sleep = <&pmc 0xc0000000>;
254 fsl,magic-packet;
255
256 mdio@520 {
257 #address-cells = <1>;
258 #size-cells = <0>;
259 compatible = "fsl,gianfar-mdio";
260 reg = <0x520 0x20>;
261
262 phy2: ethernet-phy@2 {
263 interrupt-parent = <&ipic>;
264 interrupts = <17 0x8>;
265 reg = <0x2>;
266 device_type = "ethernet-phy";
267 };
268
269 phy3: ethernet-phy@3 {
270 interrupt-parent = <&ipic>;
271 interrupts = <18 0x8>;
272 reg = <0x3>;
273 device_type = "ethernet-phy";
274 };
275
276 tbi0: tbi-phy@11 {
277 reg = <0x11>;
278 device_type = "tbi-phy";
279 };
280 };
266 }; 281 };
267 282
268 enet1: ethernet@25000 { 283 enet1: ethernet@25000 {
284 #address-cells = <1>;
285 #size-cells = <1>;
269 cell-index = <1>; 286 cell-index = <1>;
270 device_type = "network"; 287 device_type = "network";
271 model = "eTSEC"; 288 model = "eTSEC";
272 compatible = "gianfar"; 289 compatible = "gianfar";
273 reg = <0x25000 0x1000>; 290 reg = <0x25000 0x1000>;
291 ranges = <0x0 0x25000 0x1000>;
274 local-mac-address = [ 00 00 00 00 00 00 ]; 292 local-mac-address = [ 00 00 00 00 00 00 ];
275 interrupts = <35 0x8 36 0x8 37 0x8>; 293 interrupts = <35 0x8 36 0x8 37 0x8>;
276 phy-connection-type = "mii"; 294 phy-connection-type = "mii";
277 interrupt-parent = <&ipic>; 295 interrupt-parent = <&ipic>;
278 tbi-handle = <&tbi1>; 296 tbi-handle = <&tbi1>;
279 phy-handle = <&phy3>; 297 phy-handle = <&phy3>;
298 sleep = <&pmc 0x30000000>;
299 fsl,magic-packet;
300
301 mdio@520 {
302 #address-cells = <1>;
303 #size-cells = <0>;
304 compatible = "fsl,gianfar-tbi";
305 reg = <0x520 0x20>;
306
307 tbi1: tbi-phy@11 {
308 reg = <0x11>;
309 device_type = "tbi-phy";
310 };
311 };
280 }; 312 };
281 313
282 serial0: serial@4500 { 314 serial0: serial@4500 {
@@ -309,14 +341,7 @@
309 fsl,channel-fifo-len = <24>; 341 fsl,channel-fifo-len = <24>;
310 fsl,exec-units-mask = <0x9fe>; 342 fsl,exec-units-mask = <0x9fe>;
311 fsl,descriptor-types-mask = <0x3ab0ebf>; 343 fsl,descriptor-types-mask = <0x3ab0ebf>;
312 }; 344 sleep = <&pmc 0x03000000>;
313
314 sdhc@2e000 {
315 model = "eSDHC";
316 compatible = "fsl,esdhc";
317 reg = <0x2e000 0x1000>;
318 interrupts = <42 0x8>;
319 interrupt-parent = <&ipic>;
320 }; 345 };
321 346
322 /* IPIC 347 /* IPIC
@@ -332,6 +357,13 @@
332 #interrupt-cells = <2>; 357 #interrupt-cells = <2>;
333 reg = <0x700 0x100>; 358 reg = <0x700 0x100>;
334 }; 359 };
360
361 pmc: power@b00 {
362 compatible = "fsl,mpc8378-pmc", "fsl,mpc8349-pmc";
363 reg = <0xb00 0x100 0xa00 0x100>;
364 interrupts = <80 0x8>;
365 interrupt-parent = <&ipic>;
366 };
335 }; 367 };
336 368
337 pci0: pci@e0008500 { 369 pci0: pci@e0008500 {
@@ -387,6 +419,7 @@
387 0x42000000 0x0 0x80000000 0x80000000 0x0 0x10000000 419 0x42000000 0x0 0x80000000 0x80000000 0x0 0x10000000
388 0x01000000 0x0 0x00000000 0xe0300000 0x0 0x00100000>; 420 0x01000000 0x0 0x00000000 0xe0300000 0x0 0x00100000>;
389 clock-frequency = <0>; 421 clock-frequency = <0>;
422 sleep = <&pmc 0x00010000>;
390 #interrupt-cells = <1>; 423 #interrupt-cells = <1>;
391 #size-cells = <2>; 424 #size-cells = <2>;
392 #address-cells = <3>; 425 #address-cells = <3>;
@@ -395,4 +428,68 @@
395 compatible = "fsl,mpc8349-pci"; 428 compatible = "fsl,mpc8349-pci";
396 device_type = "pci"; 429 device_type = "pci";
397 }; 430 };
431
432 pci1: pcie@e0009000 {
433 #address-cells = <3>;
434 #size-cells = <2>;
435 #interrupt-cells = <1>;
436 device_type = "pci";
437 compatible = "fsl,mpc8378-pcie", "fsl,mpc8314-pcie";
438 reg = <0xe0009000 0x00001000>;
439 ranges = <0x02000000 0 0xa8000000 0xa8000000 0 0x10000000
440 0x01000000 0 0x00000000 0xb8000000 0 0x00800000>;
441 bus-range = <0 255>;
442 interrupt-map-mask = <0xf800 0 0 7>;
443 interrupt-map = <0 0 0 1 &ipic 1 8
444 0 0 0 2 &ipic 1 8
445 0 0 0 3 &ipic 1 8
446 0 0 0 4 &ipic 1 8>;
447 sleep = <&pmc 0x00300000>;
448 clock-frequency = <0>;
449
450 pcie@0 {
451 #address-cells = <3>;
452 #size-cells = <2>;
453 device_type = "pci";
454 reg = <0 0 0 0 0>;
455 ranges = <0x02000000 0 0xa8000000
456 0x02000000 0 0xa8000000
457 0 0x10000000
458 0x01000000 0 0x00000000
459 0x01000000 0 0x00000000
460 0 0x00800000>;
461 };
462 };
463
464 pci2: pcie@e000a000 {
465 #address-cells = <3>;
466 #size-cells = <2>;
467 #interrupt-cells = <1>;
468 device_type = "pci";
469 compatible = "fsl,mpc8378-pcie", "fsl,mpc8314-pcie";
470 reg = <0xe000a000 0x00001000>;
471 ranges = <0x02000000 0 0xc8000000 0xc8000000 0 0x10000000
472 0x01000000 0 0x00000000 0xd8000000 0 0x00800000>;
473 bus-range = <0 255>;
474 interrupt-map-mask = <0xf800 0 0 7>;
475 interrupt-map = <0 0 0 1 &ipic 2 8
476 0 0 0 2 &ipic 2 8
477 0 0 0 3 &ipic 2 8
478 0 0 0 4 &ipic 2 8>;
479 sleep = <&pmc 0x000c0000>;
480 clock-frequency = <0>;
481
482 pcie@0 {
483 #address-cells = <3>;
484 #size-cells = <2>;
485 device_type = "pci";
486 reg = <0 0 0 0 0>;
487 ranges = <0x02000000 0 0xc8000000
488 0x02000000 0 0xc8000000
489 0 0x10000000
490 0x01000000 0 0x00000000
491 0x01000000 0 0x00000000
492 0 0x00800000>;
493 };
494 };
398}; 495};
diff --git a/arch/powerpc/boot/dts/mpc8378_rdb.dts b/arch/powerpc/boot/dts/mpc8378_rdb.dts
index 23c10ce22c2c..5d90e85704c3 100644
--- a/arch/powerpc/boot/dts/mpc8378_rdb.dts
+++ b/arch/powerpc/boot/dts/mpc8378_rdb.dts
@@ -22,6 +22,8 @@
22 serial0 = &serial0; 22 serial0 = &serial0;
23 serial1 = &serial1; 23 serial1 = &serial1;
24 pci0 = &pci0; 24 pci0 = &pci0;
25 pci1 = &pci1;
26 pci2 = &pci2;
25 }; 27 };
26 28
27 cpus { 29 cpus {
@@ -107,26 +109,72 @@
107 reg = <0x200 0x100>; 109 reg = <0x200 0x100>;
108 }; 110 };
109 111
110 i2c@3000 { 112 gpio1: gpio-controller@c00 {
111 #address-cells = <1>; 113 #gpio-cells = <2>;
112 #size-cells = <0>; 114 compatible = "fsl,mpc8378-gpio", "fsl,mpc8349-gpio";
113 cell-index = <0>; 115 reg = <0xc00 0x100>;
114 compatible = "fsl-i2c"; 116 interrupts = <74 0x8>;
115 reg = <0x3000 0x100>;
116 interrupts = <14 0x8>;
117 interrupt-parent = <&ipic>; 117 interrupt-parent = <&ipic>;
118 dfsrr; 118 gpio-controller;
119 rtc@68 { 119 };
120 compatible = "dallas,ds1339"; 120
121 reg = <0x68>; 121 gpio2: gpio-controller@d00 {
122 #gpio-cells = <2>;
123 compatible = "fsl,mpc8378-gpio", "fsl,mpc8349-gpio";
124 reg = <0xd00 0x100>;
125 interrupts = <75 0x8>;
126 interrupt-parent = <&ipic>;
127 gpio-controller;
128 };
129
130 sleep-nexus {
131 #address-cells = <1>;
132 #size-cells = <1>;
133 compatible = "simple-bus";
134 sleep = <&pmc 0x0c000000>;
135 ranges;
136
137 i2c@3000 {
138 #address-cells = <1>;
139 #size-cells = <0>;
140 cell-index = <0>;
141 compatible = "fsl-i2c";
142 reg = <0x3000 0x100>;
143 interrupts = <14 0x8>;
144 interrupt-parent = <&ipic>;
145 dfsrr;
146
147 dtt@48 {
148 compatible = "national,lm75";
149 reg = <0x48>;
150 };
151
152 at24@50 {
153 compatible = "at24,24c256";
154 reg = <0x50>;
155 };
156
157 rtc@68 {
158 compatible = "dallas,ds1339";
159 reg = <0x68>;
160 };
161
162 mcu_pio: mcu@a {
163 #gpio-cells = <2>;
164 compatible = "fsl,mc9s08qg8-mpc8378erdb",
165 "fsl,mcu-mpc8349emitx";
166 reg = <0x0a>;
167 gpio-controller;
168 };
122 }; 169 };
123 170
124 mcu_pio: mcu@a { 171 sdhci@2e000 {
125 #gpio-cells = <2>; 172 compatible = "fsl,mpc8378-esdhc", "fsl,mpc8379-esdhc";
126 compatible = "fsl,mc9s08qg8-mpc8378erdb", 173 reg = <0x2e000 0x1000>;
127 "fsl,mcu-mpc8349emitx"; 174 interrupts = <42 0x8>;
128 reg = <0x0a>; 175 interrupt-parent = <&ipic>;
129 gpio-controller; 176 /* Filled in by U-Boot */
177 clock-frequency = <0>;
130 }; 178 };
131 }; 179 };
132 180
@@ -197,62 +245,76 @@
197 interrupt-parent = <&ipic>; 245 interrupt-parent = <&ipic>;
198 interrupts = <38 0x8>; 246 interrupts = <38 0x8>;
199 phy_type = "ulpi"; 247 phy_type = "ulpi";
248 sleep = <&pmc 0x00c00000>;
200 }; 249 };
201 250
202 mdio@24520 {
203 #address-cells = <1>;
204 #size-cells = <0>;
205 compatible = "fsl,gianfar-mdio";
206 reg = <0x24520 0x20>;
207 phy2: ethernet-phy@2 {
208 interrupt-parent = <&ipic>;
209 interrupts = <17 0x8>;
210 reg = <0x2>;
211 device_type = "ethernet-phy";
212 };
213 tbi0: tbi-phy@11 {
214 reg = <0x11>;
215 device_type = "tbi-phy";
216 };
217 };
218
219 mdio@25520 {
220 #address-cells = <1>;
221 #size-cells = <0>;
222 compatible = "fsl,gianfar-tbi";
223 reg = <0x25520 0x20>;
224
225 tbi1: tbi-phy@11 {
226 reg = <0x11>;
227 device_type = "tbi-phy";
228 };
229 };
230
231
232 enet0: ethernet@24000 { 251 enet0: ethernet@24000 {
252 #address-cells = <1>;
253 #size-cells = <1>;
233 cell-index = <0>; 254 cell-index = <0>;
234 device_type = "network"; 255 device_type = "network";
235 model = "eTSEC"; 256 model = "eTSEC";
236 compatible = "gianfar"; 257 compatible = "gianfar";
237 reg = <0x24000 0x1000>; 258 reg = <0x24000 0x1000>;
259 ranges = <0x0 0x24000 0x1000>;
238 local-mac-address = [ 00 00 00 00 00 00 ]; 260 local-mac-address = [ 00 00 00 00 00 00 ];
239 interrupts = <32 0x8 33 0x8 34 0x8>; 261 interrupts = <32 0x8 33 0x8 34 0x8>;
240 phy-connection-type = "mii"; 262 phy-connection-type = "mii";
241 interrupt-parent = <&ipic>; 263 interrupt-parent = <&ipic>;
264 tbi-handle = <&tbi0>;
242 phy-handle = <&phy2>; 265 phy-handle = <&phy2>;
266 sleep = <&pmc 0xc0000000>;
267 fsl,magic-packet;
268
269 mdio@520 {
270 #address-cells = <1>;
271 #size-cells = <0>;
272 compatible = "fsl,gianfar-mdio";
273 reg = <0x520 0x20>;
274
275 phy2: ethernet-phy@2 {
276 interrupt-parent = <&ipic>;
277 interrupts = <17 0x8>;
278 reg = <0x2>;
279 device_type = "ethernet-phy";
280 };
281
282 tbi0: tbi-phy@11 {
283 reg = <0x11>;
284 device_type = "tbi-phy";
285 };
286 };
243 }; 287 };
244 288
245 enet1: ethernet@25000 { 289 enet1: ethernet@25000 {
290 #address-cells = <1>;
291 #size-cells = <1>;
246 cell-index = <1>; 292 cell-index = <1>;
247 device_type = "network"; 293 device_type = "network";
248 model = "eTSEC"; 294 model = "eTSEC";
249 compatible = "gianfar"; 295 compatible = "gianfar";
250 reg = <0x25000 0x1000>; 296 reg = <0x25000 0x1000>;
297 ranges = <0x0 0x25000 0x1000>;
251 local-mac-address = [ 00 00 00 00 00 00 ]; 298 local-mac-address = [ 00 00 00 00 00 00 ];
252 interrupts = <35 0x8 36 0x8 37 0x8>; 299 interrupts = <35 0x8 36 0x8 37 0x8>;
253 phy-connection-type = "mii"; 300 phy-connection-type = "mii";
254 interrupt-parent = <&ipic>; 301 interrupt-parent = <&ipic>;
255 fixed-link = <1 1 1000 0 0>; 302 fixed-link = <1 1 1000 0 0>;
303 tbi-handle = <&tbi1>;
304 sleep = <&pmc 0x30000000>;
305 fsl,magic-packet;
306
307 mdio@520 {
308 #address-cells = <1>;
309 #size-cells = <0>;
310 compatible = "fsl,gianfar-tbi";
311 reg = <0x520 0x20>;
312
313 tbi1: tbi-phy@11 {
314 reg = <0x11>;
315 device_type = "tbi-phy";
316 };
317 };
256 }; 318 };
257 319
258 serial0: serial@4500 { 320 serial0: serial@4500 {
@@ -285,6 +347,7 @@
285 fsl,channel-fifo-len = <24>; 347 fsl,channel-fifo-len = <24>;
286 fsl,exec-units-mask = <0x9fe>; 348 fsl,exec-units-mask = <0x9fe>;
287 fsl,descriptor-types-mask = <0x3ab0ebf>; 349 fsl,descriptor-types-mask = <0x3ab0ebf>;
350 sleep = <&pmc 0x03000000>;
288 }; 351 };
289 352
290 /* IPIC 353 /* IPIC
@@ -300,6 +363,13 @@
300 #interrupt-cells = <2>; 363 #interrupt-cells = <2>;
301 reg = <0x700 0x100>; 364 reg = <0x700 0x100>;
302 }; 365 };
366
367 pmc: power@b00 {
368 compatible = "fsl,mpc8378-pmc", "fsl,mpc8349-pmc";
369 reg = <0xb00 0x100 0xa00 0x100>;
370 interrupts = <80 0x8>;
371 interrupt-parent = <&ipic>;
372 };
303 }; 373 };
304 374
305 pci0: pci@e0008500 { 375 pci0: pci@e0008500 {
@@ -325,6 +395,7 @@
325 ranges = <0x02000000 0x0 0x90000000 0x90000000 0x0 0x10000000 395 ranges = <0x02000000 0x0 0x90000000 0x90000000 0x0 0x10000000
326 0x42000000 0x0 0x80000000 0x80000000 0x0 0x10000000 396 0x42000000 0x0 0x80000000 0x80000000 0x0 0x10000000
327 0x01000000 0x0 0x00000000 0xe2000000 0x0 0x00100000>; 397 0x01000000 0x0 0x00000000 0xe2000000 0x0 0x00100000>;
398 sleep = <&pmc 0x00010000>;
328 clock-frequency = <66666666>; 399 clock-frequency = <66666666>;
329 #interrupt-cells = <1>; 400 #interrupt-cells = <1>;
330 #size-cells = <2>; 401 #size-cells = <2>;
@@ -334,4 +405,68 @@
334 compatible = "fsl,mpc8349-pci"; 405 compatible = "fsl,mpc8349-pci";
335 device_type = "pci"; 406 device_type = "pci";
336 }; 407 };
408
409 pci1: pcie@e0009000 {
410 #address-cells = <3>;
411 #size-cells = <2>;
412 #interrupt-cells = <1>;
413 device_type = "pci";
414 compatible = "fsl,mpc8378-pcie", "fsl,mpc8314-pcie";
415 reg = <0xe0009000 0x00001000>;
416 ranges = <0x02000000 0 0xa8000000 0xa8000000 0 0x10000000
417 0x01000000 0 0x00000000 0xb8000000 0 0x00800000>;
418 bus-range = <0 255>;
419 interrupt-map-mask = <0xf800 0 0 7>;
420 interrupt-map = <0 0 0 1 &ipic 1 8
421 0 0 0 2 &ipic 1 8
422 0 0 0 3 &ipic 1 8
423 0 0 0 4 &ipic 1 8>;
424 sleep = <&pmc 0x00300000>;
425 clock-frequency = <0>;
426
427 pcie@0 {
428 #address-cells = <3>;
429 #size-cells = <2>;
430 device_type = "pci";
431 reg = <0 0 0 0 0>;
432 ranges = <0x02000000 0 0xa8000000
433 0x02000000 0 0xa8000000
434 0 0x10000000
435 0x01000000 0 0x00000000
436 0x01000000 0 0x00000000
437 0 0x00800000>;
438 };
439 };
440
441 pci2: pcie@e000a000 {
442 #address-cells = <3>;
443 #size-cells = <2>;
444 #interrupt-cells = <1>;
445 device_type = "pci";
446 compatible = "fsl,mpc8378-pcie", "fsl,mpc8314-pcie";
447 reg = <0xe000a000 0x00001000>;
448 ranges = <0x02000000 0 0xc8000000 0xc8000000 0 0x10000000
449 0x01000000 0 0x00000000 0xd8000000 0 0x00800000>;
450 bus-range = <0 255>;
451 interrupt-map-mask = <0xf800 0 0 7>;
452 interrupt-map = <0 0 0 1 &ipic 2 8
453 0 0 0 2 &ipic 2 8
454 0 0 0 3 &ipic 2 8
455 0 0 0 4 &ipic 2 8>;
456 sleep = <&pmc 0x000c0000>;
457 clock-frequency = <0>;
458
459 pcie@0 {
460 #address-cells = <3>;
461 #size-cells = <2>;
462 device_type = "pci";
463 reg = <0 0 0 0 0>;
464 ranges = <0x02000000 0 0xc8000000
465 0x02000000 0 0xc8000000
466 0 0x10000000
467 0x01000000 0 0x00000000
468 0x01000000 0 0x00000000
469 0 0x00800000>;
470 };
471 };
337}; 472};
diff --git a/arch/powerpc/boot/dts/mpc8379_mds.dts b/arch/powerpc/boot/dts/mpc8379_mds.dts
index acf06c438dbf..d6f208b8297a 100644
--- a/arch/powerpc/boot/dts/mpc8379_mds.dts
+++ b/arch/powerpc/boot/dts/mpc8379_mds.dts
@@ -127,21 +127,38 @@
127 reg = <0x200 0x100>; 127 reg = <0x200 0x100>;
128 }; 128 };
129 129
130 i2c@3000 { 130 sleep-nexus {
131 #address-cells = <1>; 131 #address-cells = <1>;
132 #size-cells = <0>; 132 #size-cells = <1>;
133 cell-index = <0>; 133 compatible = "simple-bus";
134 compatible = "fsl-i2c"; 134 sleep = <&pmc 0x0c000000>;
135 reg = <0x3000 0x100>; 135 ranges;
136 interrupts = <14 0x8>; 136
137 interrupt-parent = <&ipic>; 137 i2c@3000 {
138 dfsrr; 138 #address-cells = <1>;
139 #size-cells = <0>;
140 cell-index = <0>;
141 compatible = "fsl-i2c";
142 reg = <0x3000 0x100>;
143 interrupts = <14 0x8>;
144 interrupt-parent = <&ipic>;
145 dfsrr;
146
147 rtc@68 {
148 compatible = "dallas,ds1374";
149 reg = <0x68>;
150 interrupts = <19 0x8>;
151 interrupt-parent = <&ipic>;
152 };
153 };
139 154
140 rtc@68 { 155 sdhci@2e000 {
141 compatible = "dallas,ds1374"; 156 compatible = "fsl,mpc8379-esdhc";
142 reg = <0x68>; 157 reg = <0x2e000 0x1000>;
143 interrupts = <19 0x8>; 158 interrupts = <42 0x8>;
144 interrupt-parent = <&ipic>; 159 interrupt-parent = <&ipic>;
160 /* Filled in by U-Boot */
161 clock-frequency = <0>;
145 }; 162 };
146 }; 163 };
147 164
@@ -213,69 +230,83 @@
213 interrupts = <38 0x8>; 230 interrupts = <38 0x8>;
214 dr_mode = "host"; 231 dr_mode = "host";
215 phy_type = "ulpi"; 232 phy_type = "ulpi";
216 }; 233 sleep = <&pmc 0x00c00000>;
217
218 mdio@24520 {
219 #address-cells = <1>;
220 #size-cells = <0>;
221 compatible = "fsl,gianfar-mdio";
222 reg = <0x24520 0x20>;
223 phy2: ethernet-phy@2 {
224 interrupt-parent = <&ipic>;
225 interrupts = <17 0x8>;
226 reg = <0x2>;
227 device_type = "ethernet-phy";
228 };
229 phy3: ethernet-phy@3 {
230 interrupt-parent = <&ipic>;
231 interrupts = <18 0x8>;
232 reg = <0x3>;
233 device_type = "ethernet-phy";
234 };
235 tbi0: tbi-phy@11 {
236 reg = <0x11>;
237 device_type = "tbi-phy";
238 };
239 };
240
241 mdio@25520 {
242 #address-cells = <1>;
243 #size-cells = <0>;
244 compatible = "fsl,gianfar-tbi";
245 reg = <0x25520 0x20>;
246
247 tbi1: tbi-phy@11 {
248 reg = <0x11>;
249 device_type = "tbi-phy";
250 };
251 }; 234 };
252 235
253 enet0: ethernet@24000 { 236 enet0: ethernet@24000 {
237 #address-cells = <1>;
238 #size-cells = <1>;
254 cell-index = <0>; 239 cell-index = <0>;
255 device_type = "network"; 240 device_type = "network";
256 model = "eTSEC"; 241 model = "eTSEC";
257 compatible = "gianfar"; 242 compatible = "gianfar";
258 reg = <0x24000 0x1000>; 243 reg = <0x24000 0x1000>;
244 ranges = <0x0 0x24000 0x1000>;
259 local-mac-address = [ 00 00 00 00 00 00 ]; 245 local-mac-address = [ 00 00 00 00 00 00 ];
260 interrupts = <32 0x8 33 0x8 34 0x8>; 246 interrupts = <32 0x8 33 0x8 34 0x8>;
261 phy-connection-type = "mii"; 247 phy-connection-type = "mii";
262 interrupt-parent = <&ipic>; 248 interrupt-parent = <&ipic>;
263 tbi-handle = <&tbi0>; 249 tbi-handle = <&tbi0>;
264 phy-handle = <&phy2>; 250 phy-handle = <&phy2>;
251 sleep = <&pmc 0xc0000000>;
252 fsl,magic-packet;
253
254 mdio@520 {
255 #address-cells = <1>;
256 #size-cells = <0>;
257 compatible = "fsl,gianfar-mdio";
258 reg = <0x520 0x20>;
259
260 phy2: ethernet-phy@2 {
261 interrupt-parent = <&ipic>;
262 interrupts = <17 0x8>;
263 reg = <0x2>;
264 device_type = "ethernet-phy";
265 };
266
267 phy3: ethernet-phy@3 {
268 interrupt-parent = <&ipic>;
269 interrupts = <18 0x8>;
270 reg = <0x3>;
271 device_type = "ethernet-phy";
272 };
273
274 tbi0: tbi-phy@11 {
275 reg = <0x11>;
276 device_type = "tbi-phy";
277 };
278 };
265 }; 279 };
266 280
267 enet1: ethernet@25000 { 281 enet1: ethernet@25000 {
282 #address-cells = <1>;
283 #size-cells = <1>;
268 cell-index = <1>; 284 cell-index = <1>;
269 device_type = "network"; 285 device_type = "network";
270 model = "eTSEC"; 286 model = "eTSEC";
271 compatible = "gianfar"; 287 compatible = "gianfar";
272 reg = <0x25000 0x1000>; 288 reg = <0x25000 0x1000>;
289 ranges = <0x0 0x25000 0x1000>;
273 local-mac-address = [ 00 00 00 00 00 00 ]; 290 local-mac-address = [ 00 00 00 00 00 00 ];
274 interrupts = <35 0x8 36 0x8 37 0x8>; 291 interrupts = <35 0x8 36 0x8 37 0x8>;
275 phy-connection-type = "mii"; 292 phy-connection-type = "mii";
276 interrupt-parent = <&ipic>; 293 interrupt-parent = <&ipic>;
277 tbi-handle = <&tbi1>; 294 tbi-handle = <&tbi1>;
278 phy-handle = <&phy3>; 295 phy-handle = <&phy3>;
296 sleep = <&pmc 0x30000000>;
297 fsl,magic-packet;
298
299 mdio@520 {
300 #address-cells = <1>;
301 #size-cells = <0>;
302 compatible = "fsl,gianfar-tbi";
303 reg = <0x520 0x20>;
304
305 tbi1: tbi-phy@11 {
306 reg = <0x11>;
307 device_type = "tbi-phy";
308 };
309 };
279 }; 310 };
280 311
281 serial0: serial@4500 { 312 serial0: serial@4500 {
@@ -308,14 +339,7 @@
308 fsl,channel-fifo-len = <24>; 339 fsl,channel-fifo-len = <24>;
309 fsl,exec-units-mask = <0x9fe>; 340 fsl,exec-units-mask = <0x9fe>;
310 fsl,descriptor-types-mask = <0x3ab0ebf>; 341 fsl,descriptor-types-mask = <0x3ab0ebf>;
311 }; 342 sleep = <&pmc 0x03000000>;
312
313 sdhc@2e000 {
314 model = "eSDHC";
315 compatible = "fsl,esdhc";
316 reg = <0x2e000 0x1000>;
317 interrupts = <42 0x8>;
318 interrupt-parent = <&ipic>;
319 }; 343 };
320 344
321 sata@18000 { 345 sata@18000 {
@@ -323,6 +347,7 @@
323 reg = <0x18000 0x1000>; 347 reg = <0x18000 0x1000>;
324 interrupts = <44 0x8>; 348 interrupts = <44 0x8>;
325 interrupt-parent = <&ipic>; 349 interrupt-parent = <&ipic>;
350 sleep = <&pmc 0x000000c0>;
326 }; 351 };
327 352
328 sata@19000 { 353 sata@19000 {
@@ -330,6 +355,7 @@
330 reg = <0x19000 0x1000>; 355 reg = <0x19000 0x1000>;
331 interrupts = <45 0x8>; 356 interrupts = <45 0x8>;
332 interrupt-parent = <&ipic>; 357 interrupt-parent = <&ipic>;
358 sleep = <&pmc 0x00000030>;
333 }; 359 };
334 360
335 sata@1a000 { 361 sata@1a000 {
@@ -337,6 +363,7 @@
337 reg = <0x1a000 0x1000>; 363 reg = <0x1a000 0x1000>;
338 interrupts = <46 0x8>; 364 interrupts = <46 0x8>;
339 interrupt-parent = <&ipic>; 365 interrupt-parent = <&ipic>;
366 sleep = <&pmc 0x0000000c>;
340 }; 367 };
341 368
342 sata@1b000 { 369 sata@1b000 {
@@ -344,6 +371,7 @@
344 reg = <0x1b000 0x1000>; 371 reg = <0x1b000 0x1000>;
345 interrupts = <47 0x8>; 372 interrupts = <47 0x8>;
346 interrupt-parent = <&ipic>; 373 interrupt-parent = <&ipic>;
374 sleep = <&pmc 0x00000003>;
347 }; 375 };
348 376
349 /* IPIC 377 /* IPIC
@@ -359,6 +387,13 @@
359 #interrupt-cells = <2>; 387 #interrupt-cells = <2>;
360 reg = <0x700 0x100>; 388 reg = <0x700 0x100>;
361 }; 389 };
390
391 pmc: power@b00 {
392 compatible = "fsl,mpc8379-pmc", "fsl,mpc8349-pmc";
393 reg = <0xb00 0x100 0xa00 0x100>;
394 interrupts = <80 0x8>;
395 interrupt-parent = <&ipic>;
396 };
362 }; 397 };
363 398
364 pci0: pci@e0008500 { 399 pci0: pci@e0008500 {
@@ -413,6 +448,7 @@
413 ranges = <0x02000000 0x0 0x90000000 0x90000000 0x0 0x10000000 448 ranges = <0x02000000 0x0 0x90000000 0x90000000 0x0 0x10000000
414 0x42000000 0x0 0x80000000 0x80000000 0x0 0x10000000 449 0x42000000 0x0 0x80000000 0x80000000 0x0 0x10000000
415 0x01000000 0x0 0x00000000 0xe0300000 0x0 0x00100000>; 450 0x01000000 0x0 0x00000000 0xe0300000 0x0 0x00100000>;
451 sleep = <&pmc 0x00010000>;
416 clock-frequency = <0>; 452 clock-frequency = <0>;
417 #interrupt-cells = <1>; 453 #interrupt-cells = <1>;
418 #size-cells = <2>; 454 #size-cells = <2>;
diff --git a/arch/powerpc/boot/dts/mpc8379_rdb.dts b/arch/powerpc/boot/dts/mpc8379_rdb.dts
index 72cdc3c4c7e3..98ae95bd18f4 100644
--- a/arch/powerpc/boot/dts/mpc8379_rdb.dts
+++ b/arch/powerpc/boot/dts/mpc8379_rdb.dts
@@ -107,26 +107,72 @@
107 reg = <0x200 0x100>; 107 reg = <0x200 0x100>;
108 }; 108 };
109 109
110 i2c@3000 { 110 gpio1: gpio-controller@c00 {
111 #address-cells = <1>; 111 #gpio-cells = <2>;
112 #size-cells = <0>; 112 compatible = "fsl,mpc8379-gpio", "fsl,mpc8349-gpio";
113 cell-index = <0>; 113 reg = <0xc00 0x100>;
114 compatible = "fsl-i2c"; 114 interrupts = <74 0x8>;
115 reg = <0x3000 0x100>;
116 interrupts = <14 0x8>;
117 interrupt-parent = <&ipic>; 115 interrupt-parent = <&ipic>;
118 dfsrr; 116 gpio-controller;
119 rtc@68 { 117 };
120 compatible = "dallas,ds1339"; 118
121 reg = <0x68>; 119 gpio2: gpio-controller@d00 {
120 #gpio-cells = <2>;
121 compatible = "fsl,mpc8379-gpio", "fsl,mpc8349-gpio";
122 reg = <0xd00 0x100>;
123 interrupts = <75 0x8>;
124 interrupt-parent = <&ipic>;
125 gpio-controller;
126 };
127
128 sleep-nexus {
129 #address-cells = <1>;
130 #size-cells = <1>;
131 compatible = "simple-bus";
132 sleep = <&pmc 0x0c000000>;
133 ranges;
134
135 i2c@3000 {
136 #address-cells = <1>;
137 #size-cells = <0>;
138 cell-index = <0>;
139 compatible = "fsl-i2c";
140 reg = <0x3000 0x100>;
141 interrupts = <14 0x8>;
142 interrupt-parent = <&ipic>;
143 dfsrr;
144
145 dtt@48 {
146 compatible = "national,lm75";
147 reg = <0x48>;
148 };
149
150 at24@50 {
151 compatible = "at24,24c256";
152 reg = <0x50>;
153 };
154
155 rtc@68 {
156 compatible = "dallas,ds1339";
157 reg = <0x68>;
158 };
159
160 mcu_pio: mcu@a {
161 #gpio-cells = <2>;
162 compatible = "fsl,mc9s08qg8-mpc8379erdb",
163 "fsl,mcu-mpc8349emitx";
164 reg = <0x0a>;
165 gpio-controller;
166 };
122 }; 167 };
123 168
124 mcu_pio: mcu@a { 169 sdhci@2e000 {
125 #gpio-cells = <2>; 170 compatible = "fsl,mpc8379-esdhc";
126 compatible = "fsl,mc9s08qg8-mpc8379erdb", 171 reg = <0x2e000 0x1000>;
127 "fsl,mcu-mpc8349emitx"; 172 interrupts = <42 0x8>;
128 reg = <0x0a>; 173 interrupt-parent = <&ipic>;
129 gpio-controller; 174 /* Filled in by U-Boot */
175 clock-frequency = <0>;
130 }; 176 };
131 }; 177 };
132 178
@@ -197,63 +243,76 @@
197 interrupt-parent = <&ipic>; 243 interrupt-parent = <&ipic>;
198 interrupts = <38 0x8>; 244 interrupts = <38 0x8>;
199 phy_type = "ulpi"; 245 phy_type = "ulpi";
200 }; 246 sleep = <&pmc 0x00c00000>;
201
202 mdio@24520 {
203 #address-cells = <1>;
204 #size-cells = <0>;
205 compatible = "fsl,gianfar-mdio";
206 reg = <0x24520 0x20>;
207 phy2: ethernet-phy@2 {
208 interrupt-parent = <&ipic>;
209 interrupts = <17 0x8>;
210 reg = <0x2>;
211 device_type = "ethernet-phy";
212 };
213 tbi0: tbi-phy@11 {
214 reg = <0x11>;
215 device_type = "tbi-phy";
216 };
217 };
218
219 mdio@25520 {
220 #address-cells = <1>;
221 #size-cells = <0>;
222 compatible = "fsl,gianfar-tbi";
223 reg = <0x25520 0x20>;
224
225 tbi1: tbi-phy@11 {
226 reg = <0x11>;
227 device_type = "tbi-phy";
228 };
229 }; 247 };
230 248
231 enet0: ethernet@24000 { 249 enet0: ethernet@24000 {
250 #address-cells = <1>;
251 #size-cells = <1>;
232 cell-index = <0>; 252 cell-index = <0>;
233 device_type = "network"; 253 device_type = "network";
234 model = "eTSEC"; 254 model = "eTSEC";
235 compatible = "gianfar"; 255 compatible = "gianfar";
236 reg = <0x24000 0x1000>; 256 reg = <0x24000 0x1000>;
257 ranges = <0x0 0x24000 0x1000>;
237 local-mac-address = [ 00 00 00 00 00 00 ]; 258 local-mac-address = [ 00 00 00 00 00 00 ];
238 interrupts = <32 0x8 33 0x8 34 0x8>; 259 interrupts = <32 0x8 33 0x8 34 0x8>;
239 phy-connection-type = "mii"; 260 phy-connection-type = "mii";
240 interrupt-parent = <&ipic>; 261 interrupt-parent = <&ipic>;
241 tbi-handle = <&tbi0>; 262 tbi-handle = <&tbi0>;
242 phy-handle = <&phy2>; 263 phy-handle = <&phy2>;
264 sleep = <&pmc 0xc0000000>;
265 fsl,magic-packet;
266
267 mdio@520 {
268 #address-cells = <1>;
269 #size-cells = <0>;
270 compatible = "fsl,gianfar-mdio";
271 reg = <0x520 0x20>;
272
273 phy2: ethernet-phy@2 {
274 interrupt-parent = <&ipic>;
275 interrupts = <17 0x8>;
276 reg = <0x2>;
277 device_type = "ethernet-phy";
278 };
279
280 tbi0: tbi-phy@11 {
281 reg = <0x11>;
282 device_type = "tbi-phy";
283 };
284 };
243 }; 285 };
244 286
245 enet1: ethernet@25000 { 287 enet1: ethernet@25000 {
288 #address-cells = <1>;
289 #size-cells = <1>;
246 cell-index = <1>; 290 cell-index = <1>;
247 device_type = "network"; 291 device_type = "network";
248 model = "eTSEC"; 292 model = "eTSEC";
249 compatible = "gianfar"; 293 compatible = "gianfar";
250 reg = <0x25000 0x1000>; 294 reg = <0x25000 0x1000>;
295 ranges = <0x0 0x25000 0x1000>;
251 local-mac-address = [ 00 00 00 00 00 00 ]; 296 local-mac-address = [ 00 00 00 00 00 00 ];
252 interrupts = <35 0x8 36 0x8 37 0x8>; 297 interrupts = <35 0x8 36 0x8 37 0x8>;
253 phy-connection-type = "mii"; 298 phy-connection-type = "mii";
254 interrupt-parent = <&ipic>; 299 interrupt-parent = <&ipic>;
255 fixed-link = <1 1 1000 0 0>; 300 fixed-link = <1 1 1000 0 0>;
256 tbi-handle = <&tbi1>; 301 tbi-handle = <&tbi1>;
302 sleep = <&pmc 0x30000000>;
303 fsl,magic-packet;
304
305 mdio@520 {
306 #address-cells = <1>;
307 #size-cells = <0>;
308 compatible = "fsl,gianfar-tbi";
309 reg = <0x520 0x20>;
310
311 tbi1: tbi-phy@11 {
312 reg = <0x11>;
313 device_type = "tbi-phy";
314 };
315 };
257 }; 316 };
258 317
259 serial0: serial@4500 { 318 serial0: serial@4500 {
@@ -286,6 +345,7 @@
286 fsl,channel-fifo-len = <24>; 345 fsl,channel-fifo-len = <24>;
287 fsl,exec-units-mask = <0x9fe>; 346 fsl,exec-units-mask = <0x9fe>;
288 fsl,descriptor-types-mask = <0x3ab0ebf>; 347 fsl,descriptor-types-mask = <0x3ab0ebf>;
348 sleep = <&pmc 0x03000000>;
289 }; 349 };
290 350
291 sata@18000 { 351 sata@18000 {
@@ -293,6 +353,7 @@
293 reg = <0x18000 0x1000>; 353 reg = <0x18000 0x1000>;
294 interrupts = <44 0x8>; 354 interrupts = <44 0x8>;
295 interrupt-parent = <&ipic>; 355 interrupt-parent = <&ipic>;
356 sleep = <&pmc 0x000000c0>;
296 }; 357 };
297 358
298 sata@19000 { 359 sata@19000 {
@@ -300,6 +361,7 @@
300 reg = <0x19000 0x1000>; 361 reg = <0x19000 0x1000>;
301 interrupts = <45 0x8>; 362 interrupts = <45 0x8>;
302 interrupt-parent = <&ipic>; 363 interrupt-parent = <&ipic>;
364 sleep = <&pmc 0x00000030>;
303 }; 365 };
304 366
305 sata@1a000 { 367 sata@1a000 {
@@ -307,6 +369,7 @@
307 reg = <0x1a000 0x1000>; 369 reg = <0x1a000 0x1000>;
308 interrupts = <46 0x8>; 370 interrupts = <46 0x8>;
309 interrupt-parent = <&ipic>; 371 interrupt-parent = <&ipic>;
372 sleep = <&pmc 0x0000000c>;
310 }; 373 };
311 374
312 sata@1b000 { 375 sata@1b000 {
@@ -314,6 +377,7 @@
314 reg = <0x1b000 0x1000>; 377 reg = <0x1b000 0x1000>;
315 interrupts = <47 0x8>; 378 interrupts = <47 0x8>;
316 interrupt-parent = <&ipic>; 379 interrupt-parent = <&ipic>;
380 sleep = <&pmc 0x00000003>;
317 }; 381 };
318 382
319 /* IPIC 383 /* IPIC
@@ -329,6 +393,13 @@
329 #interrupt-cells = <2>; 393 #interrupt-cells = <2>;
330 reg = <0x700 0x100>; 394 reg = <0x700 0x100>;
331 }; 395 };
396
397 pmc: power@b00 {
398 compatible = "fsl,mpc8379-pmc", "fsl,mpc8349-pmc";
399 reg = <0xb00 0x100 0xa00 0x100>;
400 interrupts = <80 0x8>;
401 interrupt-parent = <&ipic>;
402 };
332 }; 403 };
333 404
334 pci0: pci@e0008500 { 405 pci0: pci@e0008500 {
@@ -354,6 +425,7 @@
354 ranges = <0x02000000 0x0 0x90000000 0x90000000 0x0 0x10000000 425 ranges = <0x02000000 0x0 0x90000000 0x90000000 0x0 0x10000000
355 0x42000000 0x0 0x80000000 0x80000000 0x0 0x10000000 426 0x42000000 0x0 0x80000000 0x80000000 0x0 0x10000000
356 0x01000000 0x0 0x00000000 0xe2000000 0x0 0x00100000>; 427 0x01000000 0x0 0x00000000 0xe2000000 0x0 0x00100000>;
428 sleep = <&pmc 0x00010000>;
357 clock-frequency = <66666666>; 429 clock-frequency = <66666666>;
358 #interrupt-cells = <1>; 430 #interrupt-cells = <1>;
359 #size-cells = <2>; 431 #size-cells = <2>;
diff --git a/arch/powerpc/boot/dts/mpc8536ds.dts b/arch/powerpc/boot/dts/mpc8536ds.dts
index 3c905df1812c..b31c5041350b 100644
--- a/arch/powerpc/boot/dts/mpc8536ds.dts
+++ b/arch/powerpc/boot/dts/mpc8536ds.dts
@@ -137,42 +137,6 @@
137 }; 137 };
138 }; 138 };
139 139
140 mdio@24520 {
141 #address-cells = <1>;
142 #size-cells = <0>;
143 compatible = "fsl,gianfar-mdio";
144 reg = <0x24520 0x20>;
145
146 phy0: ethernet-phy@0 {
147 interrupt-parent = <&mpic>;
148 interrupts = <10 0x1>;
149 reg = <0>;
150 device_type = "ethernet-phy";
151 };
152 phy1: ethernet-phy@1 {
153 interrupt-parent = <&mpic>;
154 interrupts = <10 0x1>;
155 reg = <1>;
156 device_type = "ethernet-phy";
157 };
158 tbi0: tbi-phy@11 {
159 reg = <0x11>;
160 device_type = "tbi-phy";
161 };
162 };
163
164 mdio@26520 {
165 #address-cells = <1>;
166 #size-cells = <0>;
167 compatible = "fsl,gianfar-tbi";
168 reg = <0x26520 0x20>;
169
170 tbi1: tbi-phy@11 {
171 reg = <0x11>;
172 device_type = "tbi-phy";
173 };
174 };
175
176 usb@22000 { 140 usb@22000 {
177 compatible = "fsl,mpc8536-usb2-mph", "fsl-usb2-mph"; 141 compatible = "fsl,mpc8536-usb2-mph", "fsl-usb2-mph";
178 reg = <0x22000 0x1000>; 142 reg = <0x22000 0x1000>;
@@ -194,31 +158,73 @@
194 }; 158 };
195 159
196 enet0: ethernet@24000 { 160 enet0: ethernet@24000 {
161 #address-cells = <1>;
162 #size-cells = <1>;
197 cell-index = <0>; 163 cell-index = <0>;
198 device_type = "network"; 164 device_type = "network";
199 model = "eTSEC"; 165 model = "eTSEC";
200 compatible = "gianfar"; 166 compatible = "gianfar";
201 reg = <0x24000 0x1000>; 167 reg = <0x24000 0x1000>;
168 ranges = <0x0 0x24000 0x1000>;
202 local-mac-address = [ 00 00 00 00 00 00 ]; 169 local-mac-address = [ 00 00 00 00 00 00 ];
203 interrupts = <29 2 30 2 34 2>; 170 interrupts = <29 2 30 2 34 2>;
204 interrupt-parent = <&mpic>; 171 interrupt-parent = <&mpic>;
205 tbi-handle = <&tbi0>; 172 tbi-handle = <&tbi0>;
206 phy-handle = <&phy1>; 173 phy-handle = <&phy1>;
207 phy-connection-type = "rgmii-id"; 174 phy-connection-type = "rgmii-id";
175
176 mdio@520 {
177 #address-cells = <1>;
178 #size-cells = <0>;
179 compatible = "fsl,gianfar-mdio";
180 reg = <0x520 0x20>;
181
182 phy0: ethernet-phy@0 {
183 interrupt-parent = <&mpic>;
184 interrupts = <10 0x1>;
185 reg = <0>;
186 device_type = "ethernet-phy";
187 };
188 phy1: ethernet-phy@1 {
189 interrupt-parent = <&mpic>;
190 interrupts = <10 0x1>;
191 reg = <1>;
192 device_type = "ethernet-phy";
193 };
194 tbi0: tbi-phy@11 {
195 reg = <0x11>;
196 device_type = "tbi-phy";
197 };
198 };
208 }; 199 };
209 200
210 enet1: ethernet@26000 { 201 enet1: ethernet@26000 {
202 #address-cells = <1>;
203 #size-cells = <1>;
211 cell-index = <1>; 204 cell-index = <1>;
212 device_type = "network"; 205 device_type = "network";
213 model = "eTSEC"; 206 model = "eTSEC";
214 compatible = "gianfar"; 207 compatible = "gianfar";
215 reg = <0x26000 0x1000>; 208 reg = <0x26000 0x1000>;
209 ranges = <0x0 0x26000 0x1000>;
216 local-mac-address = [ 00 00 00 00 00 00 ]; 210 local-mac-address = [ 00 00 00 00 00 00 ];
217 interrupts = <31 2 32 2 33 2>; 211 interrupts = <31 2 32 2 33 2>;
218 interrupt-parent = <&mpic>; 212 interrupt-parent = <&mpic>;
219 tbi-handle = <&tbi1>; 213 tbi-handle = <&tbi1>;
220 phy-handle = <&phy0>; 214 phy-handle = <&phy0>;
221 phy-connection-type = "rgmii-id"; 215 phy-connection-type = "rgmii-id";
216
217 mdio@520 {
218 #address-cells = <1>;
219 #size-cells = <0>;
220 compatible = "fsl,gianfar-tbi";
221 reg = <0x520 0x20>;
222
223 tbi1: tbi-phy@11 {
224 reg = <0x11>;
225 device_type = "tbi-phy";
226 };
227 };
222 }; 228 };
223 229
224 usb@2b000 { 230 usb@2b000 {
diff --git a/arch/powerpc/boot/dts/mpc8540ads.dts b/arch/powerpc/boot/dts/mpc8540ads.dts
index 79570ffe41b9..ddd67be10b03 100644
--- a/arch/powerpc/boot/dts/mpc8540ads.dts
+++ b/arch/powerpc/boot/dts/mpc8540ads.dts
@@ -126,97 +126,106 @@
126 }; 126 };
127 }; 127 };
128 128
129 mdio@24520 {
130 #address-cells = <1>;
131 #size-cells = <0>;
132 compatible = "fsl,gianfar-mdio";
133 reg = <0x24520 0x20>;
134
135 phy0: ethernet-phy@0 {
136 interrupt-parent = <&mpic>;
137 interrupts = <5 1>;
138 reg = <0x0>;
139 device_type = "ethernet-phy";
140 };
141 phy1: ethernet-phy@1 {
142 interrupt-parent = <&mpic>;
143 interrupts = <5 1>;
144 reg = <0x1>;
145 device_type = "ethernet-phy";
146 };
147 phy3: ethernet-phy@3 {
148 interrupt-parent = <&mpic>;
149 interrupts = <7 1>;
150 reg = <0x3>;
151 device_type = "ethernet-phy";
152 };
153 tbi0: tbi-phy@11 {
154 reg = <0x11>;
155 device_type = "tbi-phy";
156 };
157 };
158
159 mdio@25520 {
160 #address-cells = <1>;
161 #size-cells = <0>;
162 compatible = "fsl,gianfar-tbi";
163 reg = <0x25520 0x20>;
164
165 tbi1: tbi-phy@11 {
166 reg = <0x11>;
167 device_type = "tbi-phy";
168 };
169 };
170
171 mdio@26520 {
172 #address-cells = <1>;
173 #size-cells = <0>;
174 compatible = "fsl,gianfar-tbi";
175 reg = <0x26520 0x20>;
176
177 tbi2: tbi-phy@11 {
178 reg = <0x11>;
179 device_type = "tbi-phy";
180 };
181 };
182
183 enet0: ethernet@24000 { 129 enet0: ethernet@24000 {
130 #address-cells = <1>;
131 #size-cells = <1>;
184 cell-index = <0>; 132 cell-index = <0>;
185 device_type = "network"; 133 device_type = "network";
186 model = "TSEC"; 134 model = "TSEC";
187 compatible = "gianfar"; 135 compatible = "gianfar";
188 reg = <0x24000 0x1000>; 136 reg = <0x24000 0x1000>;
137 ranges = <0x0 0x24000 0x1000>;
189 local-mac-address = [ 00 00 00 00 00 00 ]; 138 local-mac-address = [ 00 00 00 00 00 00 ];
190 interrupts = <29 2 30 2 34 2>; 139 interrupts = <29 2 30 2 34 2>;
191 interrupt-parent = <&mpic>; 140 interrupt-parent = <&mpic>;
192 tbi-handle = <&tbi0>; 141 tbi-handle = <&tbi0>;
193 phy-handle = <&phy0>; 142 phy-handle = <&phy0>;
143
144 mdio@520 {
145 #address-cells = <1>;
146 #size-cells = <0>;
147 compatible = "fsl,gianfar-mdio";
148 reg = <0x520 0x20>;
149
150 phy0: ethernet-phy@0 {
151 interrupt-parent = <&mpic>;
152 interrupts = <5 1>;
153 reg = <0x0>;
154 device_type = "ethernet-phy";
155 };
156 phy1: ethernet-phy@1 {
157 interrupt-parent = <&mpic>;
158 interrupts = <5 1>;
159 reg = <0x1>;
160 device_type = "ethernet-phy";
161 };
162 phy3: ethernet-phy@3 {
163 interrupt-parent = <&mpic>;
164 interrupts = <7 1>;
165 reg = <0x3>;
166 device_type = "ethernet-phy";
167 };
168 tbi0: tbi-phy@11 {
169 reg = <0x11>;
170 device_type = "tbi-phy";
171 };
172 };
194 }; 173 };
195 174
196 enet1: ethernet@25000 { 175 enet1: ethernet@25000 {
176 #address-cells = <1>;
177 #size-cells = <1>;
197 cell-index = <1>; 178 cell-index = <1>;
198 device_type = "network"; 179 device_type = "network";
199 model = "TSEC"; 180 model = "TSEC";
200 compatible = "gianfar"; 181 compatible = "gianfar";
201 reg = <0x25000 0x1000>; 182 reg = <0x25000 0x1000>;
183 ranges = <0x0 0x25000 0x1000>;
202 local-mac-address = [ 00 00 00 00 00 00 ]; 184 local-mac-address = [ 00 00 00 00 00 00 ];
203 interrupts = <35 2 36 2 40 2>; 185 interrupts = <35 2 36 2 40 2>;
204 interrupt-parent = <&mpic>; 186 interrupt-parent = <&mpic>;
205 tbi-handle = <&tbi1>; 187 tbi-handle = <&tbi1>;
206 phy-handle = <&phy1>; 188 phy-handle = <&phy1>;
189
190 mdio@520 {
191 #address-cells = <1>;
192 #size-cells = <0>;
193 compatible = "fsl,gianfar-tbi";
194 reg = <0x520 0x20>;
195
196 tbi1: tbi-phy@11 {
197 reg = <0x11>;
198 device_type = "tbi-phy";
199 };
200 };
207 }; 201 };
208 202
209 enet2: ethernet@26000 { 203 enet2: ethernet@26000 {
204 #address-cells = <1>;
205 #size-cells = <1>;
210 cell-index = <2>; 206 cell-index = <2>;
211 device_type = "network"; 207 device_type = "network";
212 model = "FEC"; 208 model = "FEC";
213 compatible = "gianfar"; 209 compatible = "gianfar";
214 reg = <0x26000 0x1000>; 210 reg = <0x26000 0x1000>;
211 ranges = <0x0 0x26000 0x1000>;
215 local-mac-address = [ 00 00 00 00 00 00 ]; 212 local-mac-address = [ 00 00 00 00 00 00 ];
216 interrupts = <41 2>; 213 interrupts = <41 2>;
217 interrupt-parent = <&mpic>; 214 interrupt-parent = <&mpic>;
218 tbi-handle = <&tbi2>; 215 tbi-handle = <&tbi2>;
219 phy-handle = <&phy3>; 216 phy-handle = <&phy3>;
217
218 mdio@520 {
219 #address-cells = <1>;
220 #size-cells = <0>;
221 compatible = "fsl,gianfar-tbi";
222 reg = <0x520 0x20>;
223
224 tbi2: tbi-phy@11 {
225 reg = <0x11>;
226 device_type = "tbi-phy";
227 };
228 };
220 }; 229 };
221 230
222 serial0: serial@4500 { 231 serial0: serial@4500 {
diff --git a/arch/powerpc/boot/dts/mpc8541cds.dts b/arch/powerpc/boot/dts/mpc8541cds.dts
index 221036a8ce23..e45097f44fbd 100644
--- a/arch/powerpc/boot/dts/mpc8541cds.dts
+++ b/arch/powerpc/boot/dts/mpc8541cds.dts
@@ -126,66 +126,72 @@
126 }; 126 };
127 }; 127 };
128 128
129 mdio@24520 {
130 #address-cells = <1>;
131 #size-cells = <0>;
132 compatible = "fsl,gianfar-mdio";
133 reg = <0x24520 0x20>;
134
135 phy0: ethernet-phy@0 {
136 interrupt-parent = <&mpic>;
137 interrupts = <5 1>;
138 reg = <0x0>;
139 device_type = "ethernet-phy";
140 };
141 phy1: ethernet-phy@1 {
142 interrupt-parent = <&mpic>;
143 interrupts = <5 1>;
144 reg = <0x1>;
145 device_type = "ethernet-phy";
146 };
147 tbi0: tbi-phy@11 {
148 reg = <0x11>;
149 device_type = "tbi-phy";
150 };
151 };
152
153 mdio@25520 {
154 #address-cells = <1>;
155 #size-cells = <0>;
156 compatible = "fsl,gianfar-tbi";
157 reg = <0x25520 0x20>;
158
159 tbi1: tbi-phy@11 {
160 reg = <0x11>;
161 device_type = "tbi-phy";
162 };
163 };
164
165 enet0: ethernet@24000 { 129 enet0: ethernet@24000 {
130 #address-cells = <1>;
131 #size-cells = <1>;
166 cell-index = <0>; 132 cell-index = <0>;
167 device_type = "network"; 133 device_type = "network";
168 model = "TSEC"; 134 model = "TSEC";
169 compatible = "gianfar"; 135 compatible = "gianfar";
170 reg = <0x24000 0x1000>; 136 reg = <0x24000 0x1000>;
137 ranges = <0x0 0x24000 0x1000>;
171 local-mac-address = [ 00 00 00 00 00 00 ]; 138 local-mac-address = [ 00 00 00 00 00 00 ];
172 interrupts = <29 2 30 2 34 2>; 139 interrupts = <29 2 30 2 34 2>;
173 interrupt-parent = <&mpic>; 140 interrupt-parent = <&mpic>;
174 tbi-handle = <&tbi0>; 141 tbi-handle = <&tbi0>;
175 phy-handle = <&phy0>; 142 phy-handle = <&phy0>;
143
144 mdio@520 {
145 #address-cells = <1>;
146 #size-cells = <0>;
147 compatible = "fsl,gianfar-mdio";
148 reg = <0x520 0x20>;
149
150 phy0: ethernet-phy@0 {
151 interrupt-parent = <&mpic>;
152 interrupts = <5 1>;
153 reg = <0x0>;
154 device_type = "ethernet-phy";
155 };
156 phy1: ethernet-phy@1 {
157 interrupt-parent = <&mpic>;
158 interrupts = <5 1>;
159 reg = <0x1>;
160 device_type = "ethernet-phy";
161 };
162 tbi0: tbi-phy@11 {
163 reg = <0x11>;
164 device_type = "tbi-phy";
165 };
166 };
176 }; 167 };
177 168
178 enet1: ethernet@25000 { 169 enet1: ethernet@25000 {
170 #address-cells = <1>;
171 #size-cells = <1>;
179 cell-index = <1>; 172 cell-index = <1>;
180 device_type = "network"; 173 device_type = "network";
181 model = "TSEC"; 174 model = "TSEC";
182 compatible = "gianfar"; 175 compatible = "gianfar";
183 reg = <0x25000 0x1000>; 176 reg = <0x25000 0x1000>;
177 ranges = <0x0 0x25000 0x1000>;
184 local-mac-address = [ 00 00 00 00 00 00 ]; 178 local-mac-address = [ 00 00 00 00 00 00 ];
185 interrupts = <35 2 36 2 40 2>; 179 interrupts = <35 2 36 2 40 2>;
186 interrupt-parent = <&mpic>; 180 interrupt-parent = <&mpic>;
187 tbi-handle = <&tbi1>; 181 tbi-handle = <&tbi1>;
188 phy-handle = <&phy1>; 182 phy-handle = <&phy1>;
183
184 mdio@520 {
185 #address-cells = <1>;
186 #size-cells = <0>;
187 compatible = "fsl,gianfar-tbi";
188 reg = <0x520 0x20>;
189
190 tbi1: tbi-phy@11 {
191 reg = <0x11>;
192 device_type = "tbi-phy";
193 };
194 };
189 }; 195 };
190 196
191 serial0: serial@4500 { 197 serial0: serial@4500 {
diff --git a/arch/powerpc/boot/dts/mpc8544ds.dts b/arch/powerpc/boot/dts/mpc8544ds.dts
index 0668d1048779..7c6932be0197 100644
--- a/arch/powerpc/boot/dts/mpc8544ds.dts
+++ b/arch/powerpc/boot/dts/mpc8544ds.dts
@@ -98,44 +98,6 @@
98 dfsrr; 98 dfsrr;
99 }; 99 };
100 100
101 mdio@24520 {
102 #address-cells = <1>;
103 #size-cells = <0>;
104 compatible = "fsl,gianfar-mdio";
105 reg = <0x24520 0x20>;
106
107 phy0: ethernet-phy@0 {
108 interrupt-parent = <&mpic>;
109 interrupts = <10 1>;
110 reg = <0x0>;
111 device_type = "ethernet-phy";
112 };
113 phy1: ethernet-phy@1 {
114 interrupt-parent = <&mpic>;
115 interrupts = <10 1>;
116 reg = <0x1>;
117 device_type = "ethernet-phy";
118 };
119
120 tbi0: tbi-phy@11 {
121 reg = <0x11>;
122 device_type = "tbi-phy";
123 };
124 };
125
126 mdio@26520 {
127 #address-cells = <1>;
128 #size-cells = <0>;
129 compatible = "fsl,gianfar-tbi";
130 reg = <0x26520 0x20>;
131
132 tbi1: tbi-phy@11 {
133 reg = <0x11>;
134 device_type = "tbi-phy";
135 };
136 };
137
138
139 dma@21300 { 101 dma@21300 {
140 #address-cells = <1>; 102 #address-cells = <1>;
141 #size-cells = <1>; 103 #size-cells = <1>;
@@ -178,31 +140,74 @@
178 }; 140 };
179 141
180 enet0: ethernet@24000 { 142 enet0: ethernet@24000 {
143 #address-cells = <1>;
144 #size-cells = <1>;
181 cell-index = <0>; 145 cell-index = <0>;
182 device_type = "network"; 146 device_type = "network";
183 model = "TSEC"; 147 model = "TSEC";
184 compatible = "gianfar"; 148 compatible = "gianfar";
185 reg = <0x24000 0x1000>; 149 reg = <0x24000 0x1000>;
150 ranges = <0x0 0x24000 0x1000>;
186 local-mac-address = [ 00 00 00 00 00 00 ]; 151 local-mac-address = [ 00 00 00 00 00 00 ];
187 interrupts = <29 2 30 2 34 2>; 152 interrupts = <29 2 30 2 34 2>;
188 interrupt-parent = <&mpic>; 153 interrupt-parent = <&mpic>;
189 phy-handle = <&phy0>; 154 phy-handle = <&phy0>;
190 tbi-handle = <&tbi0>; 155 tbi-handle = <&tbi0>;
191 phy-connection-type = "rgmii-id"; 156 phy-connection-type = "rgmii-id";
157
158 mdio@520 {
159 #address-cells = <1>;
160 #size-cells = <0>;
161 compatible = "fsl,gianfar-mdio";
162 reg = <0x520 0x20>;
163
164 phy0: ethernet-phy@0 {
165 interrupt-parent = <&mpic>;
166 interrupts = <10 1>;
167 reg = <0x0>;
168 device_type = "ethernet-phy";
169 };
170 phy1: ethernet-phy@1 {
171 interrupt-parent = <&mpic>;
172 interrupts = <10 1>;
173 reg = <0x1>;
174 device_type = "ethernet-phy";
175 };
176
177 tbi0: tbi-phy@11 {
178 reg = <0x11>;
179 device_type = "tbi-phy";
180 };
181 };
192 }; 182 };
193 183
194 enet1: ethernet@26000 { 184 enet1: ethernet@26000 {
185 #address-cells = <1>;
186 #size-cells = <1>;
195 cell-index = <1>; 187 cell-index = <1>;
196 device_type = "network"; 188 device_type = "network";
197 model = "TSEC"; 189 model = "TSEC";
198 compatible = "gianfar"; 190 compatible = "gianfar";
199 reg = <0x26000 0x1000>; 191 reg = <0x26000 0x1000>;
192 ranges = <0x0 0x26000 0x1000>;
200 local-mac-address = [ 00 00 00 00 00 00 ]; 193 local-mac-address = [ 00 00 00 00 00 00 ];
201 interrupts = <31 2 32 2 33 2>; 194 interrupts = <31 2 32 2 33 2>;
202 interrupt-parent = <&mpic>; 195 interrupt-parent = <&mpic>;
203 phy-handle = <&phy1>; 196 phy-handle = <&phy1>;
204 tbi-handle = <&tbi1>; 197 tbi-handle = <&tbi1>;
205 phy-connection-type = "rgmii-id"; 198 phy-connection-type = "rgmii-id";
199
200 mdio@520 {
201 #address-cells = <1>;
202 #size-cells = <0>;
203 compatible = "fsl,gianfar-tbi";
204 reg = <0x520 0x20>;
205
206 tbi1: tbi-phy@11 {
207 reg = <0x11>;
208 device_type = "tbi-phy";
209 };
210 };
206 }; 211 };
207 212
208 serial0: serial@4500 { 213 serial0: serial@4500 {
diff --git a/arch/powerpc/boot/dts/mpc8548cds.dts b/arch/powerpc/boot/dts/mpc8548cds.dts
index df774a7088ff..804e90353293 100644
--- a/arch/powerpc/boot/dts/mpc8548cds.dts
+++ b/arch/powerpc/boot/dts/mpc8548cds.dts
@@ -142,129 +142,141 @@
142 }; 142 };
143 }; 143 };
144 144
145 mdio@24520 {
146 #address-cells = <1>;
147 #size-cells = <0>;
148 compatible = "fsl,gianfar-mdio";
149 reg = <0x24520 0x20>;
150
151 phy0: ethernet-phy@0 {
152 interrupt-parent = <&mpic>;
153 interrupts = <5 1>;
154 reg = <0x0>;
155 device_type = "ethernet-phy";
156 };
157 phy1: ethernet-phy@1 {
158 interrupt-parent = <&mpic>;
159 interrupts = <5 1>;
160 reg = <0x1>;
161 device_type = "ethernet-phy";
162 };
163 phy2: ethernet-phy@2 {
164 interrupt-parent = <&mpic>;
165 interrupts = <5 1>;
166 reg = <0x2>;
167 device_type = "ethernet-phy";
168 };
169 phy3: ethernet-phy@3 {
170 interrupt-parent = <&mpic>;
171 interrupts = <5 1>;
172 reg = <0x3>;
173 device_type = "ethernet-phy";
174 };
175 tbi0: tbi-phy@11 {
176 reg = <0x11>;
177 device_type = "tbi-phy";
178 };
179 };
180
181 mdio@25520 {
182 #address-cells = <1>;
183 #size-cells = <0>;
184 compatible = "fsl,gianfar-tbi";
185 reg = <0x25520 0x20>;
186
187 tbi1: tbi-phy@11 {
188 reg = <0x11>;
189 device_type = "tbi-phy";
190 };
191 };
192
193 mdio@26520 {
194 #address-cells = <1>;
195 #size-cells = <0>;
196 compatible = "fsl,gianfar-tbi";
197 reg = <0x26520 0x20>;
198
199 tbi2: tbi-phy@11 {
200 reg = <0x11>;
201 device_type = "tbi-phy";
202 };
203 };
204
205 mdio@27520 {
206 #address-cells = <1>;
207 #size-cells = <0>;
208 compatible = "fsl,gianfar-tbi";
209 reg = <0x27520 0x20>;
210
211 tbi3: tbi-phy@11 {
212 reg = <0x11>;
213 device_type = "tbi-phy";
214 };
215 };
216
217 enet0: ethernet@24000 { 145 enet0: ethernet@24000 {
146 #address-cells = <1>;
147 #size-cells = <1>;
218 cell-index = <0>; 148 cell-index = <0>;
219 device_type = "network"; 149 device_type = "network";
220 model = "eTSEC"; 150 model = "eTSEC";
221 compatible = "gianfar"; 151 compatible = "gianfar";
222 reg = <0x24000 0x1000>; 152 reg = <0x24000 0x1000>;
153 ranges = <0x0 0x24000 0x1000>;
223 local-mac-address = [ 00 00 00 00 00 00 ]; 154 local-mac-address = [ 00 00 00 00 00 00 ];
224 interrupts = <29 2 30 2 34 2>; 155 interrupts = <29 2 30 2 34 2>;
225 interrupt-parent = <&mpic>; 156 interrupt-parent = <&mpic>;
226 tbi-handle = <&tbi0>; 157 tbi-handle = <&tbi0>;
227 phy-handle = <&phy0>; 158 phy-handle = <&phy0>;
159
160 mdio@520 {
161 #address-cells = <1>;
162 #size-cells = <0>;
163 compatible = "fsl,gianfar-mdio";
164 reg = <0x520 0x20>;
165
166 phy0: ethernet-phy@0 {
167 interrupt-parent = <&mpic>;
168 interrupts = <5 1>;
169 reg = <0x0>;
170 device_type = "ethernet-phy";
171 };
172 phy1: ethernet-phy@1 {
173 interrupt-parent = <&mpic>;
174 interrupts = <5 1>;
175 reg = <0x1>;
176 device_type = "ethernet-phy";
177 };
178 phy2: ethernet-phy@2 {
179 interrupt-parent = <&mpic>;
180 interrupts = <5 1>;
181 reg = <0x2>;
182 device_type = "ethernet-phy";
183 };
184 phy3: ethernet-phy@3 {
185 interrupt-parent = <&mpic>;
186 interrupts = <5 1>;
187 reg = <0x3>;
188 device_type = "ethernet-phy";
189 };
190 tbi0: tbi-phy@11 {
191 reg = <0x11>;
192 device_type = "tbi-phy";
193 };
194 };
228 }; 195 };
229 196
230 enet1: ethernet@25000 { 197 enet1: ethernet@25000 {
198 #address-cells = <1>;
199 #size-cells = <1>;
231 cell-index = <1>; 200 cell-index = <1>;
232 device_type = "network"; 201 device_type = "network";
233 model = "eTSEC"; 202 model = "eTSEC";
234 compatible = "gianfar"; 203 compatible = "gianfar";
235 reg = <0x25000 0x1000>; 204 reg = <0x25000 0x1000>;
205 ranges = <0x0 0x25000 0x1000>;
236 local-mac-address = [ 00 00 00 00 00 00 ]; 206 local-mac-address = [ 00 00 00 00 00 00 ];
237 interrupts = <35 2 36 2 40 2>; 207 interrupts = <35 2 36 2 40 2>;
238 interrupt-parent = <&mpic>; 208 interrupt-parent = <&mpic>;
239 tbi-handle = <&tbi1>; 209 tbi-handle = <&tbi1>;
240 phy-handle = <&phy1>; 210 phy-handle = <&phy1>;
211
212 mdio@520 {
213 #address-cells = <1>;
214 #size-cells = <0>;
215 compatible = "fsl,gianfar-tbi";
216 reg = <0x520 0x20>;
217
218 tbi1: tbi-phy@11 {
219 reg = <0x11>;
220 device_type = "tbi-phy";
221 };
222 };
241 }; 223 };
242 224
243/* eTSEC 3/4 are currently broken 225/* eTSEC 3/4 are currently broken
244 enet2: ethernet@26000 { 226 enet2: ethernet@26000 {
227 #address-cells = <1>;
228 #size-cells = <1>;
245 cell-index = <2>; 229 cell-index = <2>;
246 device_type = "network"; 230 device_type = "network";
247 model = "eTSEC"; 231 model = "eTSEC";
248 compatible = "gianfar"; 232 compatible = "gianfar";
249 reg = <0x26000 0x1000>; 233 reg = <0x26000 0x1000>;
234 ranges = <0x0 0x26000 0x1000>;
250 local-mac-address = [ 00 00 00 00 00 00 ]; 235 local-mac-address = [ 00 00 00 00 00 00 ];
251 interrupts = <31 2 32 2 33 2>; 236 interrupts = <31 2 32 2 33 2>;
252 interrupt-parent = <&mpic>; 237 interrupt-parent = <&mpic>;
253 tbi-handle = <&tbi2>; 238 tbi-handle = <&tbi2>;
254 phy-handle = <&phy2>; 239 phy-handle = <&phy2>;
240
241 mdio@520 {
242 #address-cells = <1>;
243 #size-cells = <0>;
244 compatible = "fsl,gianfar-tbi";
245 reg = <0x520 0x20>;
246
247 tbi2: tbi-phy@11 {
248 reg = <0x11>;
249 device_type = "tbi-phy";
250 };
251 };
255 }; 252 };
256 253
257 enet3: ethernet@27000 { 254 enet3: ethernet@27000 {
255 #address-cells = <1>;
256 #size-cells = <1>;
258 cell-index = <3>; 257 cell-index = <3>;
259 device_type = "network"; 258 device_type = "network";
260 model = "eTSEC"; 259 model = "eTSEC";
261 compatible = "gianfar"; 260 compatible = "gianfar";
262 reg = <0x27000 0x1000>; 261 reg = <0x27000 0x1000>;
262 ranges = <0x0 0x27000 0x1000>;
263 local-mac-address = [ 00 00 00 00 00 00 ]; 263 local-mac-address = [ 00 00 00 00 00 00 ];
264 interrupts = <37 2 38 2 39 2>; 264 interrupts = <37 2 38 2 39 2>;
265 interrupt-parent = <&mpic>; 265 interrupt-parent = <&mpic>;
266 tbi-handle = <&tbi3>; 266 tbi-handle = <&tbi3>;
267 phy-handle = <&phy3>; 267 phy-handle = <&phy3>;
268
269 mdio@520 {
270 #address-cells = <1>;
271 #size-cells = <0>;
272 compatible = "fsl,gianfar-tbi";
273 reg = <0x520 0x20>;
274
275 tbi3: tbi-phy@11 {
276 reg = <0x11>;
277 device_type = "tbi-phy";
278 };
279 };
268 }; 280 };
269 */ 281 */
270 282
diff --git a/arch/powerpc/boot/dts/mpc8555cds.dts b/arch/powerpc/boot/dts/mpc8555cds.dts
index 053b01e1c93b..9484f0729b10 100644
--- a/arch/powerpc/boot/dts/mpc8555cds.dts
+++ b/arch/powerpc/boot/dts/mpc8555cds.dts
@@ -126,66 +126,72 @@
126 }; 126 };
127 }; 127 };
128 128
129 mdio@24520 {
130 #address-cells = <1>;
131 #size-cells = <0>;
132 compatible = "fsl,gianfar-mdio";
133 reg = <0x24520 0x20>;
134
135 phy0: ethernet-phy@0 {
136 interrupt-parent = <&mpic>;
137 interrupts = <5 1>;
138 reg = <0x0>;
139 device_type = "ethernet-phy";
140 };
141 phy1: ethernet-phy@1 {
142 interrupt-parent = <&mpic>;
143 interrupts = <5 1>;
144 reg = <0x1>;
145 device_type = "ethernet-phy";
146 };
147 tbi0: tbi-phy@11 {
148 reg = <0x11>;
149 device_type = "tbi-phy";
150 };
151 };
152
153 mdio@25520 {
154 #address-cells = <1>;
155 #size-cells = <0>;
156 compatible = "fsl,gianfar-tbi";
157 reg = <0x25520 0x20>;
158
159 tbi1: tbi-phy@11 {
160 reg = <0x11>;
161 device_type = "tbi-phy";
162 };
163 };
164
165 enet0: ethernet@24000 { 129 enet0: ethernet@24000 {
130 #address-cells = <1>;
131 #size-cells = <1>;
166 cell-index = <0>; 132 cell-index = <0>;
167 device_type = "network"; 133 device_type = "network";
168 model = "TSEC"; 134 model = "TSEC";
169 compatible = "gianfar"; 135 compatible = "gianfar";
170 reg = <0x24000 0x1000>; 136 reg = <0x24000 0x1000>;
137 ranges = <0x0 0x24000 0x1000>;
171 local-mac-address = [ 00 00 00 00 00 00 ]; 138 local-mac-address = [ 00 00 00 00 00 00 ];
172 interrupts = <29 2 30 2 34 2>; 139 interrupts = <29 2 30 2 34 2>;
173 interrupt-parent = <&mpic>; 140 interrupt-parent = <&mpic>;
174 tbi-handle = <&tbi0>; 141 tbi-handle = <&tbi0>;
175 phy-handle = <&phy0>; 142 phy-handle = <&phy0>;
143
144 mdio@520 {
145 #address-cells = <1>;
146 #size-cells = <0>;
147 compatible = "fsl,gianfar-mdio";
148 reg = <0x520 0x20>;
149
150 phy0: ethernet-phy@0 {
151 interrupt-parent = <&mpic>;
152 interrupts = <5 1>;
153 reg = <0x0>;
154 device_type = "ethernet-phy";
155 };
156 phy1: ethernet-phy@1 {
157 interrupt-parent = <&mpic>;
158 interrupts = <5 1>;
159 reg = <0x1>;
160 device_type = "ethernet-phy";
161 };
162 tbi0: tbi-phy@11 {
163 reg = <0x11>;
164 device_type = "tbi-phy";
165 };
166 };
176 }; 167 };
177 168
178 enet1: ethernet@25000 { 169 enet1: ethernet@25000 {
170 #address-cells = <1>;
171 #size-cells = <1>;
179 cell-index = <1>; 172 cell-index = <1>;
180 device_type = "network"; 173 device_type = "network";
181 model = "TSEC"; 174 model = "TSEC";
182 compatible = "gianfar"; 175 compatible = "gianfar";
183 reg = <0x25000 0x1000>; 176 reg = <0x25000 0x1000>;
177 ranges = <0x0 0x25000 0x1000>;
184 local-mac-address = [ 00 00 00 00 00 00 ]; 178 local-mac-address = [ 00 00 00 00 00 00 ];
185 interrupts = <35 2 36 2 40 2>; 179 interrupts = <35 2 36 2 40 2>;
186 interrupt-parent = <&mpic>; 180 interrupt-parent = <&mpic>;
187 tbi-handle = <&tbi1>; 181 tbi-handle = <&tbi1>;
188 phy-handle = <&phy1>; 182 phy-handle = <&phy1>;
183
184 mdio@520 {
185 #address-cells = <1>;
186 #size-cells = <0>;
187 compatible = "fsl,gianfar-tbi";
188 reg = <0x520 0x20>;
189
190 tbi1: tbi-phy@11 {
191 reg = <0x11>;
192 device_type = "tbi-phy";
193 };
194 };
189 }; 195 };
190 196
191 serial0: serial@4500 { 197 serial0: serial@4500 {
diff --git a/arch/powerpc/boot/dts/mpc8560ads.dts b/arch/powerpc/boot/dts/mpc8560ads.dts
index 11b1bcbe14ce..cc2acf87d02f 100644
--- a/arch/powerpc/boot/dts/mpc8560ads.dts
+++ b/arch/powerpc/boot/dts/mpc8560ads.dts
@@ -115,78 +115,84 @@
115 }; 115 };
116 }; 116 };
117 117
118 mdio@24520 {
119 #address-cells = <1>;
120 #size-cells = <0>;
121 compatible = "fsl,gianfar-mdio";
122 reg = <0x24520 0x20>;
123
124 phy0: ethernet-phy@0 {
125 interrupt-parent = <&mpic>;
126 interrupts = <5 1>;
127 reg = <0x0>;
128 device_type = "ethernet-phy";
129 };
130 phy1: ethernet-phy@1 {
131 interrupt-parent = <&mpic>;
132 interrupts = <5 1>;
133 reg = <0x1>;
134 device_type = "ethernet-phy";
135 };
136 phy2: ethernet-phy@2 {
137 interrupt-parent = <&mpic>;
138 interrupts = <7 1>;
139 reg = <0x2>;
140 device_type = "ethernet-phy";
141 };
142 phy3: ethernet-phy@3 {
143 interrupt-parent = <&mpic>;
144 interrupts = <7 1>;
145 reg = <0x3>;
146 device_type = "ethernet-phy";
147 };
148 tbi0: tbi-phy@11 {
149 reg = <0x11>;
150 device_type = "tbi-phy";
151 };
152 };
153
154 mdio@25520 {
155 #address-cells = <1>;
156 #size-cells = <0>;
157 compatible = "fsl,gianfar-tbi";
158 reg = <0x25520 0x20>;
159
160 tbi1: tbi-phy@11 {
161 reg = <0x11>;
162 device_type = "tbi-phy";
163 };
164 };
165
166 enet0: ethernet@24000 { 118 enet0: ethernet@24000 {
119 #address-cells = <1>;
120 #size-cells = <1>;
167 cell-index = <0>; 121 cell-index = <0>;
168 device_type = "network"; 122 device_type = "network";
169 model = "TSEC"; 123 model = "TSEC";
170 compatible = "gianfar"; 124 compatible = "gianfar";
171 reg = <0x24000 0x1000>; 125 reg = <0x24000 0x1000>;
126 ranges = <0x0 0x24000 0x1000>;
172 local-mac-address = [ 00 00 00 00 00 00 ]; 127 local-mac-address = [ 00 00 00 00 00 00 ];
173 interrupts = <29 2 30 2 34 2>; 128 interrupts = <29 2 30 2 34 2>;
174 interrupt-parent = <&mpic>; 129 interrupt-parent = <&mpic>;
175 tbi-handle = <&tbi0>; 130 tbi-handle = <&tbi0>;
176 phy-handle = <&phy0>; 131 phy-handle = <&phy0>;
132
133 mdio@520 {
134 #address-cells = <1>;
135 #size-cells = <0>;
136 compatible = "fsl,gianfar-mdio";
137 reg = <0x520 0x20>;
138
139 phy0: ethernet-phy@0 {
140 interrupt-parent = <&mpic>;
141 interrupts = <5 1>;
142 reg = <0x0>;
143 device_type = "ethernet-phy";
144 };
145 phy1: ethernet-phy@1 {
146 interrupt-parent = <&mpic>;
147 interrupts = <5 1>;
148 reg = <0x1>;
149 device_type = "ethernet-phy";
150 };
151 phy2: ethernet-phy@2 {
152 interrupt-parent = <&mpic>;
153 interrupts = <7 1>;
154 reg = <0x2>;
155 device_type = "ethernet-phy";
156 };
157 phy3: ethernet-phy@3 {
158 interrupt-parent = <&mpic>;
159 interrupts = <7 1>;
160 reg = <0x3>;
161 device_type = "ethernet-phy";
162 };
163 tbi0: tbi-phy@11 {
164 reg = <0x11>;
165 device_type = "tbi-phy";
166 };
167 };
177 }; 168 };
178 169
179 enet1: ethernet@25000 { 170 enet1: ethernet@25000 {
171 #address-cells = <1>;
172 #size-cells = <1>;
180 cell-index = <1>; 173 cell-index = <1>;
181 device_type = "network"; 174 device_type = "network";
182 model = "TSEC"; 175 model = "TSEC";
183 compatible = "gianfar"; 176 compatible = "gianfar";
184 reg = <0x25000 0x1000>; 177 reg = <0x25000 0x1000>;
178 ranges = <0x0 0x25000 0x1000>;
185 local-mac-address = [ 00 00 00 00 00 00 ]; 179 local-mac-address = [ 00 00 00 00 00 00 ];
186 interrupts = <35 2 36 2 40 2>; 180 interrupts = <35 2 36 2 40 2>;
187 interrupt-parent = <&mpic>; 181 interrupt-parent = <&mpic>;
188 tbi-handle = <&tbi1>; 182 tbi-handle = <&tbi1>;
189 phy-handle = <&phy1>; 183 phy-handle = <&phy1>;
184
185 mdio@520 {
186 #address-cells = <1>;
187 #size-cells = <0>;
188 compatible = "fsl,gianfar-tbi";
189 reg = <0x520 0x20>;
190
191 tbi1: tbi-phy@11 {
192 reg = <0x11>;
193 device_type = "tbi-phy";
194 };
195 };
190 }; 196 };
191 197
192 mpic: pic@40000 { 198 mpic: pic@40000 {
diff --git a/arch/powerpc/boot/dts/mpc8568mds.dts b/arch/powerpc/boot/dts/mpc8568mds.dts
index 1955bd9e113d..9d52e3b25047 100644
--- a/arch/powerpc/boot/dts/mpc8568mds.dts
+++ b/arch/powerpc/boot/dts/mpc8568mds.dts
@@ -149,78 +149,84 @@
149 }; 149 };
150 }; 150 };
151 151
152 mdio@24520 {
153 #address-cells = <1>;
154 #size-cells = <0>;
155 compatible = "fsl,gianfar-mdio";
156 reg = <0x24520 0x20>;
157
158 phy0: ethernet-phy@7 {
159 interrupt-parent = <&mpic>;
160 interrupts = <1 1>;
161 reg = <0x7>;
162 device_type = "ethernet-phy";
163 };
164 phy1: ethernet-phy@1 {
165 interrupt-parent = <&mpic>;
166 interrupts = <2 1>;
167 reg = <0x1>;
168 device_type = "ethernet-phy";
169 };
170 phy2: ethernet-phy@2 {
171 interrupt-parent = <&mpic>;
172 interrupts = <1 1>;
173 reg = <0x2>;
174 device_type = "ethernet-phy";
175 };
176 phy3: ethernet-phy@3 {
177 interrupt-parent = <&mpic>;
178 interrupts = <2 1>;
179 reg = <0x3>;
180 device_type = "ethernet-phy";
181 };
182 tbi0: tbi-phy@11 {
183 reg = <0x11>;
184 device_type = "tbi-phy";
185 };
186 };
187
188 mdio@25520 {
189 #address-cells = <1>;
190 #size-cells = <0>;
191 compatible = "fsl,gianfar-tbi";
192 reg = <0x25520 0x20>;
193
194 tbi1: tbi-phy@11 {
195 reg = <0x11>;
196 device_type = "tbi-phy";
197 };
198 };
199
200 enet0: ethernet@24000 { 152 enet0: ethernet@24000 {
153 #address-cells = <1>;
154 #size-cells = <1>;
201 cell-index = <0>; 155 cell-index = <0>;
202 device_type = "network"; 156 device_type = "network";
203 model = "eTSEC"; 157 model = "eTSEC";
204 compatible = "gianfar"; 158 compatible = "gianfar";
205 reg = <0x24000 0x1000>; 159 reg = <0x24000 0x1000>;
160 ranges = <0x0 0x24000 0x1000>;
206 local-mac-address = [ 00 00 00 00 00 00 ]; 161 local-mac-address = [ 00 00 00 00 00 00 ];
207 interrupts = <29 2 30 2 34 2>; 162 interrupts = <29 2 30 2 34 2>;
208 interrupt-parent = <&mpic>; 163 interrupt-parent = <&mpic>;
209 tbi-handle = <&tbi0>; 164 tbi-handle = <&tbi0>;
210 phy-handle = <&phy2>; 165 phy-handle = <&phy2>;
166
167 mdio@520 {
168 #address-cells = <1>;
169 #size-cells = <0>;
170 compatible = "fsl,gianfar-mdio";
171 reg = <0x520 0x20>;
172
173 phy0: ethernet-phy@7 {
174 interrupt-parent = <&mpic>;
175 interrupts = <1 1>;
176 reg = <0x7>;
177 device_type = "ethernet-phy";
178 };
179 phy1: ethernet-phy@1 {
180 interrupt-parent = <&mpic>;
181 interrupts = <2 1>;
182 reg = <0x1>;
183 device_type = "ethernet-phy";
184 };
185 phy2: ethernet-phy@2 {
186 interrupt-parent = <&mpic>;
187 interrupts = <1 1>;
188 reg = <0x2>;
189 device_type = "ethernet-phy";
190 };
191 phy3: ethernet-phy@3 {
192 interrupt-parent = <&mpic>;
193 interrupts = <2 1>;
194 reg = <0x3>;
195 device_type = "ethernet-phy";
196 };
197 tbi0: tbi-phy@11 {
198 reg = <0x11>;
199 device_type = "tbi-phy";
200 };
201 };
211 }; 202 };
212 203
213 enet1: ethernet@25000 { 204 enet1: ethernet@25000 {
205 #address-cells = <1>;
206 #size-cells = <1>;
214 cell-index = <1>; 207 cell-index = <1>;
215 device_type = "network"; 208 device_type = "network";
216 model = "eTSEC"; 209 model = "eTSEC";
217 compatible = "gianfar"; 210 compatible = "gianfar";
218 reg = <0x25000 0x1000>; 211 reg = <0x25000 0x1000>;
212 ranges = <0x0 0x25000 0x1000>;
219 local-mac-address = [ 00 00 00 00 00 00 ]; 213 local-mac-address = [ 00 00 00 00 00 00 ];
220 interrupts = <35 2 36 2 40 2>; 214 interrupts = <35 2 36 2 40 2>;
221 interrupt-parent = <&mpic>; 215 interrupt-parent = <&mpic>;
222 tbi-handle = <&tbi1>; 216 tbi-handle = <&tbi1>;
223 phy-handle = <&phy3>; 217 phy-handle = <&phy3>;
218
219 mdio@520 {
220 #address-cells = <1>;
221 #size-cells = <0>;
222 compatible = "fsl,gianfar-tbi";
223 reg = <0x520 0x20>;
224
225 tbi1: tbi-phy@11 {
226 reg = <0x11>;
227 device_type = "tbi-phy";
228 };
229 };
224 }; 230 };
225 231
226 serial0: serial@4500 { 232 serial0: serial@4500 {
diff --git a/arch/powerpc/boot/dts/mpc8572ds.dts b/arch/powerpc/boot/dts/mpc8572ds.dts
index 359c3b727420..6e79a4169088 100644
--- a/arch/powerpc/boot/dts/mpc8572ds.dts
+++ b/arch/powerpc/boot/dts/mpc8572ds.dts
@@ -1,7 +1,7 @@
1/* 1/*
2 * MPC8572 DS Device Tree Source 2 * MPC8572 DS Device Tree Source
3 * 3 *
4 * Copyright 2007, 2008 Freescale Semiconductor Inc. 4 * Copyright 2007-2009 Freescale Semiconductor Inc.
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify it 6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the 7 * under the terms of the GNU General Public License as published by the
@@ -312,129 +312,141 @@
312 }; 312 };
313 }; 313 };
314 314
315 mdio@24520 {
316 #address-cells = <1>;
317 #size-cells = <0>;
318 compatible = "fsl,gianfar-mdio";
319 reg = <0x24520 0x20>;
320
321 phy0: ethernet-phy@0 {
322 interrupt-parent = <&mpic>;
323 interrupts = <10 1>;
324 reg = <0x0>;
325 };
326 phy1: ethernet-phy@1 {
327 interrupt-parent = <&mpic>;
328 interrupts = <10 1>;
329 reg = <0x1>;
330 };
331 phy2: ethernet-phy@2 {
332 interrupt-parent = <&mpic>;
333 interrupts = <10 1>;
334 reg = <0x2>;
335 };
336 phy3: ethernet-phy@3 {
337 interrupt-parent = <&mpic>;
338 interrupts = <10 1>;
339 reg = <0x3>;
340 };
341
342 tbi0: tbi-phy@11 {
343 reg = <0x11>;
344 device_type = "tbi-phy";
345 };
346 };
347
348 mdio@25520 {
349 #address-cells = <1>;
350 #size-cells = <0>;
351 compatible = "fsl,gianfar-tbi";
352 reg = <0x25520 0x20>;
353
354 tbi1: tbi-phy@11 {
355 reg = <0x11>;
356 device_type = "tbi-phy";
357 };
358 };
359
360 mdio@26520 {
361 #address-cells = <1>;
362 #size-cells = <0>;
363 compatible = "fsl,gianfar-tbi";
364 reg = <0x26520 0x20>;
365
366 tbi2: tbi-phy@11 {
367 reg = <0x11>;
368 device_type = "tbi-phy";
369 };
370 };
371
372 mdio@27520 {
373 #address-cells = <1>;
374 #size-cells = <0>;
375 compatible = "fsl,gianfar-tbi";
376 reg = <0x27520 0x20>;
377
378 tbi3: tbi-phy@11 {
379 reg = <0x11>;
380 device_type = "tbi-phy";
381 };
382 };
383
384 enet0: ethernet@24000 { 315 enet0: ethernet@24000 {
316 #address-cells = <1>;
317 #size-cells = <1>;
385 cell-index = <0>; 318 cell-index = <0>;
386 device_type = "network"; 319 device_type = "network";
387 model = "eTSEC"; 320 model = "eTSEC";
388 compatible = "gianfar"; 321 compatible = "gianfar";
389 reg = <0x24000 0x1000>; 322 reg = <0x24000 0x1000>;
323 ranges = <0x0 0x24000 0x1000>;
390 local-mac-address = [ 00 00 00 00 00 00 ]; 324 local-mac-address = [ 00 00 00 00 00 00 ];
391 interrupts = <29 2 30 2 34 2>; 325 interrupts = <29 2 30 2 34 2>;
392 interrupt-parent = <&mpic>; 326 interrupt-parent = <&mpic>;
393 tbi-handle = <&tbi0>; 327 tbi-handle = <&tbi0>;
394 phy-handle = <&phy0>; 328 phy-handle = <&phy0>;
395 phy-connection-type = "rgmii-id"; 329 phy-connection-type = "rgmii-id";
330
331 mdio@520 {
332 #address-cells = <1>;
333 #size-cells = <0>;
334 compatible = "fsl,gianfar-mdio";
335 reg = <0x520 0x20>;
336
337 phy0: ethernet-phy@0 {
338 interrupt-parent = <&mpic>;
339 interrupts = <10 1>;
340 reg = <0x0>;
341 };
342 phy1: ethernet-phy@1 {
343 interrupt-parent = <&mpic>;
344 interrupts = <10 1>;
345 reg = <0x1>;
346 };
347 phy2: ethernet-phy@2 {
348 interrupt-parent = <&mpic>;
349 interrupts = <10 1>;
350 reg = <0x2>;
351 };
352 phy3: ethernet-phy@3 {
353 interrupt-parent = <&mpic>;
354 interrupts = <10 1>;
355 reg = <0x3>;
356 };
357
358 tbi0: tbi-phy@11 {
359 reg = <0x11>;
360 device_type = "tbi-phy";
361 };
362 };
396 }; 363 };
397 364
398 enet1: ethernet@25000 { 365 enet1: ethernet@25000 {
366 #address-cells = <1>;
367 #size-cells = <1>;
399 cell-index = <1>; 368 cell-index = <1>;
400 device_type = "network"; 369 device_type = "network";
401 model = "eTSEC"; 370 model = "eTSEC";
402 compatible = "gianfar"; 371 compatible = "gianfar";
403 reg = <0x25000 0x1000>; 372 reg = <0x25000 0x1000>;
373 ranges = <0x0 0x25000 0x1000>;
404 local-mac-address = [ 00 00 00 00 00 00 ]; 374 local-mac-address = [ 00 00 00 00 00 00 ];
405 interrupts = <35 2 36 2 40 2>; 375 interrupts = <35 2 36 2 40 2>;
406 interrupt-parent = <&mpic>; 376 interrupt-parent = <&mpic>;
407 tbi-handle = <&tbi1>; 377 tbi-handle = <&tbi1>;
408 phy-handle = <&phy1>; 378 phy-handle = <&phy1>;
409 phy-connection-type = "rgmii-id"; 379 phy-connection-type = "rgmii-id";
380
381 mdio@520 {
382 #address-cells = <1>;
383 #size-cells = <0>;
384 compatible = "fsl,gianfar-tbi";
385 reg = <0x520 0x20>;
386
387 tbi1: tbi-phy@11 {
388 reg = <0x11>;
389 device_type = "tbi-phy";
390 };
391 };
410 }; 392 };
411 393
412 enet2: ethernet@26000 { 394 enet2: ethernet@26000 {
395 #address-cells = <1>;
396 #size-cells = <1>;
413 cell-index = <2>; 397 cell-index = <2>;
414 device_type = "network"; 398 device_type = "network";
415 model = "eTSEC"; 399 model = "eTSEC";
416 compatible = "gianfar"; 400 compatible = "gianfar";
417 reg = <0x26000 0x1000>; 401 reg = <0x26000 0x1000>;
402 ranges = <0x0 0x26000 0x1000>;
418 local-mac-address = [ 00 00 00 00 00 00 ]; 403 local-mac-address = [ 00 00 00 00 00 00 ];
419 interrupts = <31 2 32 2 33 2>; 404 interrupts = <31 2 32 2 33 2>;
420 interrupt-parent = <&mpic>; 405 interrupt-parent = <&mpic>;
421 tbi-handle = <&tbi2>; 406 tbi-handle = <&tbi2>;
422 phy-handle = <&phy2>; 407 phy-handle = <&phy2>;
423 phy-connection-type = "rgmii-id"; 408 phy-connection-type = "rgmii-id";
409
410 mdio@520 {
411 #address-cells = <1>;
412 #size-cells = <0>;
413 compatible = "fsl,gianfar-tbi";
414 reg = <0x520 0x20>;
415
416 tbi2: tbi-phy@11 {
417 reg = <0x11>;
418 device_type = "tbi-phy";
419 };
420 };
424 }; 421 };
425 422
426 enet3: ethernet@27000 { 423 enet3: ethernet@27000 {
424 #address-cells = <1>;
425 #size-cells = <1>;
427 cell-index = <3>; 426 cell-index = <3>;
428 device_type = "network"; 427 device_type = "network";
429 model = "eTSEC"; 428 model = "eTSEC";
430 compatible = "gianfar"; 429 compatible = "gianfar";
431 reg = <0x27000 0x1000>; 430 reg = <0x27000 0x1000>;
431 ranges = <0x0 0x27000 0x1000>;
432 local-mac-address = [ 00 00 00 00 00 00 ]; 432 local-mac-address = [ 00 00 00 00 00 00 ];
433 interrupts = <37 2 38 2 39 2>; 433 interrupts = <37 2 38 2 39 2>;
434 interrupt-parent = <&mpic>; 434 interrupt-parent = <&mpic>;
435 tbi-handle = <&tbi3>; 435 tbi-handle = <&tbi3>;
436 phy-handle = <&phy3>; 436 phy-handle = <&phy3>;
437 phy-connection-type = "rgmii-id"; 437 phy-connection-type = "rgmii-id";
438
439 mdio@520 {
440 #address-cells = <1>;
441 #size-cells = <0>;
442 compatible = "fsl,gianfar-tbi";
443 reg = <0x520 0x20>;
444
445 tbi3: tbi-phy@11 {
446 reg = <0x11>;
447 device_type = "tbi-phy";
448 };
449 };
438 }; 450 };
439 451
440 serial0: serial@4500 { 452 serial0: serial@4500 {
@@ -643,7 +655,7 @@
643 655
644 0x1000000 0x0 0x0 656 0x1000000 0x0 0x0
645 0x1000000 0x0 0x0 657 0x1000000 0x0 0x0
646 0x0 0x100000>; 658 0x0 0x10000>;
647 uli1575@0 { 659 uli1575@0 {
648 reg = <0x0 0x0 0x0 0x0 0x0>; 660 reg = <0x0 0x0 0x0 0x0 0x0>;
649 #size-cells = <2>; 661 #size-cells = <2>;
@@ -654,7 +666,7 @@
654 666
655 0x1000000 0x0 0x0 667 0x1000000 0x0 0x0
656 0x1000000 0x0 0x0 668 0x1000000 0x0 0x0
657 0x0 0x100000>; 669 0x0 0x10000>;
658 isa@1e { 670 isa@1e {
659 device_type = "isa"; 671 device_type = "isa";
660 #interrupt-cells = <2>; 672 #interrupt-cells = <2>;
@@ -744,7 +756,7 @@
744 756
745 0x1000000 0x0 0x0 757 0x1000000 0x0 0x0
746 0x1000000 0x0 0x0 758 0x1000000 0x0 0x0
747 0x0 0x100000>; 759 0x0 0x10000>;
748 }; 760 };
749 }; 761 };
750 762
@@ -781,7 +793,7 @@
781 793
782 0x1000000 0x0 0x0 794 0x1000000 0x0 0x0
783 0x1000000 0x0 0x0 795 0x1000000 0x0 0x0
784 0x0 0x100000>; 796 0x0 0x10000>;
785 }; 797 };
786 }; 798 };
787}; 799};
diff --git a/arch/powerpc/boot/dts/mpc8572ds_36b.dts b/arch/powerpc/boot/dts/mpc8572ds_36b.dts
new file mode 100644
index 000000000000..dbd81a764742
--- /dev/null
+++ b/arch/powerpc/boot/dts/mpc8572ds_36b.dts
@@ -0,0 +1,799 @@
1/*
2 * MPC8572 DS Device Tree Source
3 *
4 * Copyright 2007-2009 Freescale Semiconductor Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
10 */
11
12/dts-v1/;
13/ {
14 model = "fsl,MPC8572DS";
15 compatible = "fsl,MPC8572DS";
16 #address-cells = <2>;
17 #size-cells = <2>;
18
19 aliases {
20 ethernet0 = &enet0;
21 ethernet1 = &enet1;
22 ethernet2 = &enet2;
23 ethernet3 = &enet3;
24 serial0 = &serial0;
25 serial1 = &serial1;
26 pci0 = &pci0;
27 pci1 = &pci1;
28 pci2 = &pci2;
29 };
30
31 cpus {
32 #address-cells = <1>;
33 #size-cells = <0>;
34
35 PowerPC,8572@0 {
36 device_type = "cpu";
37 reg = <0x0>;
38 d-cache-line-size = <32>; // 32 bytes
39 i-cache-line-size = <32>; // 32 bytes
40 d-cache-size = <0x8000>; // L1, 32K
41 i-cache-size = <0x8000>; // L1, 32K
42 timebase-frequency = <0>;
43 bus-frequency = <0>;
44 clock-frequency = <0>;
45 next-level-cache = <&L2>;
46 };
47
48 PowerPC,8572@1 {
49 device_type = "cpu";
50 reg = <0x1>;
51 d-cache-line-size = <32>; // 32 bytes
52 i-cache-line-size = <32>; // 32 bytes
53 d-cache-size = <0x8000>; // L1, 32K
54 i-cache-size = <0x8000>; // L1, 32K
55 timebase-frequency = <0>;
56 bus-frequency = <0>;
57 clock-frequency = <0>;
58 next-level-cache = <&L2>;
59 };
60 };
61
62 memory {
63 device_type = "memory";
64 };
65
66 localbus@fffe05000 {
67 #address-cells = <2>;
68 #size-cells = <1>;
69 compatible = "fsl,mpc8572-elbc", "fsl,elbc", "simple-bus";
70 reg = <0xf 0xffe05000 0 0x1000>;
71 interrupts = <19 2>;
72 interrupt-parent = <&mpic>;
73
74 ranges = <0x0 0x0 0xf 0xe8000000 0x08000000
75 0x1 0x0 0xf 0xe0000000 0x08000000
76 0x2 0x0 0xf 0xffa00000 0x00040000
77 0x3 0x0 0xf 0xffdf0000 0x00008000
78 0x4 0x0 0xf 0xffa40000 0x00040000
79 0x5 0x0 0xf 0xffa80000 0x00040000
80 0x6 0x0 0xf 0xffac0000 0x00040000>;
81
82 nor@0,0 {
83 #address-cells = <1>;
84 #size-cells = <1>;
85 compatible = "cfi-flash";
86 reg = <0x0 0x0 0x8000000>;
87 bank-width = <2>;
88 device-width = <1>;
89
90 ramdisk@0 {
91 reg = <0x0 0x03000000>;
92 read-only;
93 };
94
95 diagnostic@3000000 {
96 reg = <0x03000000 0x00e00000>;
97 read-only;
98 };
99
100 dink@3e00000 {
101 reg = <0x03e00000 0x00200000>;
102 read-only;
103 };
104
105 kernel@4000000 {
106 reg = <0x04000000 0x00400000>;
107 read-only;
108 };
109
110 jffs2@4400000 {
111 reg = <0x04400000 0x03b00000>;
112 };
113
114 dtb@7f00000 {
115 reg = <0x07f00000 0x00080000>;
116 read-only;
117 };
118
119 u-boot@7f80000 {
120 reg = <0x07f80000 0x00080000>;
121 read-only;
122 };
123 };
124
125 nand@2,0 {
126 #address-cells = <1>;
127 #size-cells = <1>;
128 compatible = "fsl,mpc8572-fcm-nand",
129 "fsl,elbc-fcm-nand";
130 reg = <0x2 0x0 0x40000>;
131
132 u-boot@0 {
133 reg = <0x0 0x02000000>;
134 read-only;
135 };
136
137 jffs2@2000000 {
138 reg = <0x02000000 0x10000000>;
139 };
140
141 ramdisk@12000000 {
142 reg = <0x12000000 0x08000000>;
143 read-only;
144 };
145
146 kernel@1a000000 {
147 reg = <0x1a000000 0x04000000>;
148 };
149
150 dtb@1e000000 {
151 reg = <0x1e000000 0x01000000>;
152 read-only;
153 };
154
155 empty@1f000000 {
156 reg = <0x1f000000 0x21000000>;
157 };
158 };
159
160 nand@4,0 {
161 compatible = "fsl,mpc8572-fcm-nand",
162 "fsl,elbc-fcm-nand";
163 reg = <0x4 0x0 0x40000>;
164 };
165
166 nand@5,0 {
167 compatible = "fsl,mpc8572-fcm-nand",
168 "fsl,elbc-fcm-nand";
169 reg = <0x5 0x0 0x40000>;
170 };
171
172 nand@6,0 {
173 compatible = "fsl,mpc8572-fcm-nand",
174 "fsl,elbc-fcm-nand";
175 reg = <0x6 0x0 0x40000>;
176 };
177 };
178
179 soc8572@fffe00000 {
180 #address-cells = <1>;
181 #size-cells = <1>;
182 device_type = "soc";
183 compatible = "simple-bus";
184 ranges = <0x0 0xf 0xffe00000 0x100000>;
185 reg = <0xf 0xffe00000 0 0x1000>; // CCSRBAR & soc regs, remove once parse code for immrbase fixed
186 bus-frequency = <0>; // Filled out by uboot.
187
188 memory-controller@2000 {
189 compatible = "fsl,mpc8572-memory-controller";
190 reg = <0x2000 0x1000>;
191 interrupt-parent = <&mpic>;
192 interrupts = <18 2>;
193 };
194
195 memory-controller@6000 {
196 compatible = "fsl,mpc8572-memory-controller";
197 reg = <0x6000 0x1000>;
198 interrupt-parent = <&mpic>;
199 interrupts = <18 2>;
200 };
201
202 L2: l2-cache-controller@20000 {
203 compatible = "fsl,mpc8572-l2-cache-controller";
204 reg = <0x20000 0x1000>;
205 cache-line-size = <32>; // 32 bytes
206 cache-size = <0x100000>; // L2, 1M
207 interrupt-parent = <&mpic>;
208 interrupts = <16 2>;
209 };
210
211 i2c@3000 {
212 #address-cells = <1>;
213 #size-cells = <0>;
214 cell-index = <0>;
215 compatible = "fsl-i2c";
216 reg = <0x3000 0x100>;
217 interrupts = <43 2>;
218 interrupt-parent = <&mpic>;
219 dfsrr;
220 };
221
222 i2c@3100 {
223 #address-cells = <1>;
224 #size-cells = <0>;
225 cell-index = <1>;
226 compatible = "fsl-i2c";
227 reg = <0x3100 0x100>;
228 interrupts = <43 2>;
229 interrupt-parent = <&mpic>;
230 dfsrr;
231 };
232
233 dma@c300 {
234 #address-cells = <1>;
235 #size-cells = <1>;
236 compatible = "fsl,mpc8572-dma", "fsl,eloplus-dma";
237 reg = <0xc300 0x4>;
238 ranges = <0x0 0xc100 0x200>;
239 cell-index = <1>;
240 dma-channel@0 {
241 compatible = "fsl,mpc8572-dma-channel",
242 "fsl,eloplus-dma-channel";
243 reg = <0x0 0x80>;
244 cell-index = <0>;
245 interrupt-parent = <&mpic>;
246 interrupts = <76 2>;
247 };
248 dma-channel@80 {
249 compatible = "fsl,mpc8572-dma-channel",
250 "fsl,eloplus-dma-channel";
251 reg = <0x80 0x80>;
252 cell-index = <1>;
253 interrupt-parent = <&mpic>;
254 interrupts = <77 2>;
255 };
256 dma-channel@100 {
257 compatible = "fsl,mpc8572-dma-channel",
258 "fsl,eloplus-dma-channel";
259 reg = <0x100 0x80>;
260 cell-index = <2>;
261 interrupt-parent = <&mpic>;
262 interrupts = <78 2>;
263 };
264 dma-channel@180 {
265 compatible = "fsl,mpc8572-dma-channel",
266 "fsl,eloplus-dma-channel";
267 reg = <0x180 0x80>;
268 cell-index = <3>;
269 interrupt-parent = <&mpic>;
270 interrupts = <79 2>;
271 };
272 };
273
274 dma@21300 {
275 #address-cells = <1>;
276 #size-cells = <1>;
277 compatible = "fsl,mpc8572-dma", "fsl,eloplus-dma";
278 reg = <0x21300 0x4>;
279 ranges = <0x0 0x21100 0x200>;
280 cell-index = <0>;
281 dma-channel@0 {
282 compatible = "fsl,mpc8572-dma-channel",
283 "fsl,eloplus-dma-channel";
284 reg = <0x0 0x80>;
285 cell-index = <0>;
286 interrupt-parent = <&mpic>;
287 interrupts = <20 2>;
288 };
289 dma-channel@80 {
290 compatible = "fsl,mpc8572-dma-channel",
291 "fsl,eloplus-dma-channel";
292 reg = <0x80 0x80>;
293 cell-index = <1>;
294 interrupt-parent = <&mpic>;
295 interrupts = <21 2>;
296 };
297 dma-channel@100 {
298 compatible = "fsl,mpc8572-dma-channel",
299 "fsl,eloplus-dma-channel";
300 reg = <0x100 0x80>;
301 cell-index = <2>;
302 interrupt-parent = <&mpic>;
303 interrupts = <22 2>;
304 };
305 dma-channel@180 {
306 compatible = "fsl,mpc8572-dma-channel",
307 "fsl,eloplus-dma-channel";
308 reg = <0x180 0x80>;
309 cell-index = <3>;
310 interrupt-parent = <&mpic>;
311 interrupts = <23 2>;
312 };
313 };
314
315 enet0: ethernet@24000 {
316 #address-cells = <1>;
317 #size-cells = <1>;
318 cell-index = <0>;
319 device_type = "network";
320 model = "eTSEC";
321 compatible = "gianfar";
322 reg = <0x24000 0x1000>;
323 ranges = <0x0 0x24000 0x1000>;
324 local-mac-address = [ 00 00 00 00 00 00 ];
325 interrupts = <29 2 30 2 34 2>;
326 interrupt-parent = <&mpic>;
327 tbi-handle = <&tbi0>;
328 phy-handle = <&phy0>;
329 phy-connection-type = "rgmii-id";
330
331 mdio@520 {
332 #address-cells = <1>;
333 #size-cells = <0>;
334 compatible = "fsl,gianfar-mdio";
335 reg = <0x520 0x20>;
336
337 phy0: ethernet-phy@0 {
338 interrupt-parent = <&mpic>;
339 interrupts = <10 1>;
340 reg = <0x0>;
341 };
342 phy1: ethernet-phy@1 {
343 interrupt-parent = <&mpic>;
344 interrupts = <10 1>;
345 reg = <0x1>;
346 };
347 phy2: ethernet-phy@2 {
348 interrupt-parent = <&mpic>;
349 interrupts = <10 1>;
350 reg = <0x2>;
351 };
352 phy3: ethernet-phy@3 {
353 interrupt-parent = <&mpic>;
354 interrupts = <10 1>;
355 reg = <0x3>;
356 };
357
358 tbi0: tbi-phy@11 {
359 reg = <0x11>;
360 device_type = "tbi-phy";
361 };
362 };
363 };
364
365 enet1: ethernet@25000 {
366 #address-cells = <1>;
367 #size-cells = <1>;
368 cell-index = <1>;
369 device_type = "network";
370 model = "eTSEC";
371 compatible = "gianfar";
372 reg = <0x25000 0x1000>;
373 ranges = <0x0 0x25000 0x1000>;
374 local-mac-address = [ 00 00 00 00 00 00 ];
375 interrupts = <35 2 36 2 40 2>;
376 interrupt-parent = <&mpic>;
377 tbi-handle = <&tbi1>;
378 phy-handle = <&phy1>;
379 phy-connection-type = "rgmii-id";
380
381 mdio@520 {
382 #address-cells = <1>;
383 #size-cells = <0>;
384 compatible = "fsl,gianfar-tbi";
385 reg = <0x520 0x20>;
386
387 tbi1: tbi-phy@11 {
388 reg = <0x11>;
389 device_type = "tbi-phy";
390 };
391 };
392 };
393
394 enet2: ethernet@26000 {
395 #address-cells = <1>;
396 #size-cells = <1>;
397 cell-index = <2>;
398 device_type = "network";
399 model = "eTSEC";
400 compatible = "gianfar";
401 reg = <0x26000 0x1000>;
402 ranges = <0x0 0x26000 0x1000>;
403 local-mac-address = [ 00 00 00 00 00 00 ];
404 interrupts = <31 2 32 2 33 2>;
405 interrupt-parent = <&mpic>;
406 tbi-handle = <&tbi2>;
407 phy-handle = <&phy2>;
408 phy-connection-type = "rgmii-id";
409
410 mdio@520 {
411 #address-cells = <1>;
412 #size-cells = <0>;
413 compatible = "fsl,gianfar-tbi";
414 reg = <0x520 0x20>;
415
416 tbi2: tbi-phy@11 {
417 reg = <0x11>;
418 device_type = "tbi-phy";
419 };
420 };
421 };
422
423 enet3: ethernet@27000 {
424 #address-cells = <1>;
425 #size-cells = <1>;
426 cell-index = <3>;
427 device_type = "network";
428 model = "eTSEC";
429 compatible = "gianfar";
430 reg = <0x27000 0x1000>;
431 ranges = <0x0 0x27000 0x1000>;
432 local-mac-address = [ 00 00 00 00 00 00 ];
433 interrupts = <37 2 38 2 39 2>;
434 interrupt-parent = <&mpic>;
435 tbi-handle = <&tbi3>;
436 phy-handle = <&phy3>;
437 phy-connection-type = "rgmii-id";
438
439 mdio@520 {
440 #address-cells = <1>;
441 #size-cells = <0>;
442 compatible = "fsl,gianfar-tbi";
443 reg = <0x520 0x20>;
444
445 tbi3: tbi-phy@11 {
446 reg = <0x11>;
447 device_type = "tbi-phy";
448 };
449 };
450 };
451
452 serial0: serial@4500 {
453 cell-index = <0>;
454 device_type = "serial";
455 compatible = "ns16550";
456 reg = <0x4500 0x100>;
457 clock-frequency = <0>;
458 interrupts = <42 2>;
459 interrupt-parent = <&mpic>;
460 };
461
462 serial1: serial@4600 {
463 cell-index = <1>;
464 device_type = "serial";
465 compatible = "ns16550";
466 reg = <0x4600 0x100>;
467 clock-frequency = <0>;
468 interrupts = <42 2>;
469 interrupt-parent = <&mpic>;
470 };
471
472 global-utilities@e0000 { //global utilities block
473 compatible = "fsl,mpc8572-guts";
474 reg = <0xe0000 0x1000>;
475 fsl,has-rstcr;
476 };
477
478 msi@41600 {
479 compatible = "fsl,mpc8572-msi", "fsl,mpic-msi";
480 reg = <0x41600 0x80>;
481 msi-available-ranges = <0 0x100>;
482 interrupts = <
483 0xe0 0
484 0xe1 0
485 0xe2 0
486 0xe3 0
487 0xe4 0
488 0xe5 0
489 0xe6 0
490 0xe7 0>;
491 interrupt-parent = <&mpic>;
492 };
493
494 crypto@30000 {
495 compatible = "fsl,sec3.0", "fsl,sec2.4", "fsl,sec2.2",
496 "fsl,sec2.1", "fsl,sec2.0";
497 reg = <0x30000 0x10000>;
498 interrupts = <45 2 58 2>;
499 interrupt-parent = <&mpic>;
500 fsl,num-channels = <4>;
501 fsl,channel-fifo-len = <24>;
502 fsl,exec-units-mask = <0x9fe>;
503 fsl,descriptor-types-mask = <0x3ab0ebf>;
504 };
505
506 mpic: pic@40000 {
507 interrupt-controller;
508 #address-cells = <0>;
509 #interrupt-cells = <2>;
510 reg = <0x40000 0x40000>;
511 compatible = "chrp,open-pic";
512 device_type = "open-pic";
513 };
514 };
515
516 pci0: pcie@fffe08000 {
517 cell-index = <0>;
518 compatible = "fsl,mpc8548-pcie";
519 device_type = "pci";
520 #interrupt-cells = <1>;
521 #size-cells = <2>;
522 #address-cells = <3>;
523 reg = <0xf 0xffe08000 0 0x1000>;
524 bus-range = <0 255>;
525 ranges = <0x2000000 0x0 0xc0000000 0xc 0x00000000 0x0 0x20000000
526 0x1000000 0x0 0x00000000 0xf 0xffc00000 0x0 0x00010000>;
527 clock-frequency = <33333333>;
528 interrupt-parent = <&mpic>;
529 interrupts = <24 2>;
530 interrupt-map-mask = <0xff00 0x0 0x0 0x7>;
531 interrupt-map = <
532 /* IDSEL 0x11 func 0 - PCI slot 1 */
533 0x8800 0x0 0x0 0x1 &mpic 0x2 0x1
534 0x8800 0x0 0x0 0x2 &mpic 0x3 0x1
535 0x8800 0x0 0x0 0x3 &mpic 0x4 0x1
536 0x8800 0x0 0x0 0x4 &mpic 0x1 0x1
537
538 /* IDSEL 0x11 func 1 - PCI slot 1 */
539 0x8900 0x0 0x0 0x1 &mpic 0x2 0x1
540 0x8900 0x0 0x0 0x2 &mpic 0x3 0x1
541 0x8900 0x0 0x0 0x3 &mpic 0x4 0x1
542 0x8900 0x0 0x0 0x4 &mpic 0x1 0x1
543
544 /* IDSEL 0x11 func 2 - PCI slot 1 */
545 0x8a00 0x0 0x0 0x1 &mpic 0x2 0x1
546 0x8a00 0x0 0x0 0x2 &mpic 0x3 0x1
547 0x8a00 0x0 0x0 0x3 &mpic 0x4 0x1
548 0x8a00 0x0 0x0 0x4 &mpic 0x1 0x1
549
550 /* IDSEL 0x11 func 3 - PCI slot 1 */
551 0x8b00 0x0 0x0 0x1 &mpic 0x2 0x1
552 0x8b00 0x0 0x0 0x2 &mpic 0x3 0x1
553 0x8b00 0x0 0x0 0x3 &mpic 0x4 0x1
554 0x8b00 0x0 0x0 0x4 &mpic 0x1 0x1
555
556 /* IDSEL 0x11 func 4 - PCI slot 1 */
557 0x8c00 0x0 0x0 0x1 &mpic 0x2 0x1
558 0x8c00 0x0 0x0 0x2 &mpic 0x3 0x1
559 0x8c00 0x0 0x0 0x3 &mpic 0x4 0x1
560 0x8c00 0x0 0x0 0x4 &mpic 0x1 0x1
561
562 /* IDSEL 0x11 func 5 - PCI slot 1 */
563 0x8d00 0x0 0x0 0x1 &mpic 0x2 0x1
564 0x8d00 0x0 0x0 0x2 &mpic 0x3 0x1
565 0x8d00 0x0 0x0 0x3 &mpic 0x4 0x1
566 0x8d00 0x0 0x0 0x4 &mpic 0x1 0x1
567
568 /* IDSEL 0x11 func 6 - PCI slot 1 */
569 0x8e00 0x0 0x0 0x1 &mpic 0x2 0x1
570 0x8e00 0x0 0x0 0x2 &mpic 0x3 0x1
571 0x8e00 0x0 0x0 0x3 &mpic 0x4 0x1
572 0x8e00 0x0 0x0 0x4 &mpic 0x1 0x1
573
574 /* IDSEL 0x11 func 7 - PCI slot 1 */
575 0x8f00 0x0 0x0 0x1 &mpic 0x2 0x1
576 0x8f00 0x0 0x0 0x2 &mpic 0x3 0x1
577 0x8f00 0x0 0x0 0x3 &mpic 0x4 0x1
578 0x8f00 0x0 0x0 0x4 &mpic 0x1 0x1
579
580 /* IDSEL 0x12 func 0 - PCI slot 2 */
581 0x9000 0x0 0x0 0x1 &mpic 0x3 0x1
582 0x9000 0x0 0x0 0x2 &mpic 0x4 0x1
583 0x9000 0x0 0x0 0x3 &mpic 0x1 0x1
584 0x9000 0x0 0x0 0x4 &mpic 0x2 0x1
585
586 /* IDSEL 0x12 func 1 - PCI slot 2 */
587 0x9100 0x0 0x0 0x1 &mpic 0x3 0x1
588 0x9100 0x0 0x0 0x2 &mpic 0x4 0x1
589 0x9100 0x0 0x0 0x3 &mpic 0x1 0x1
590 0x9100 0x0 0x0 0x4 &mpic 0x2 0x1
591
592 /* IDSEL 0x12 func 2 - PCI slot 2 */
593 0x9200 0x0 0x0 0x1 &mpic 0x3 0x1
594 0x9200 0x0 0x0 0x2 &mpic 0x4 0x1
595 0x9200 0x0 0x0 0x3 &mpic 0x1 0x1
596 0x9200 0x0 0x0 0x4 &mpic 0x2 0x1
597
598 /* IDSEL 0x12 func 3 - PCI slot 2 */
599 0x9300 0x0 0x0 0x1 &mpic 0x3 0x1
600 0x9300 0x0 0x0 0x2 &mpic 0x4 0x1
601 0x9300 0x0 0x0 0x3 &mpic 0x1 0x1
602 0x9300 0x0 0x0 0x4 &mpic 0x2 0x1
603
604 /* IDSEL 0x12 func 4 - PCI slot 2 */
605 0x9400 0x0 0x0 0x1 &mpic 0x3 0x1
606 0x9400 0x0 0x0 0x2 &mpic 0x4 0x1
607 0x9400 0x0 0x0 0x3 &mpic 0x1 0x1
608 0x9400 0x0 0x0 0x4 &mpic 0x2 0x1
609
610 /* IDSEL 0x12 func 5 - PCI slot 2 */
611 0x9500 0x0 0x0 0x1 &mpic 0x3 0x1
612 0x9500 0x0 0x0 0x2 &mpic 0x4 0x1
613 0x9500 0x0 0x0 0x3 &mpic 0x1 0x1
614 0x9500 0x0 0x0 0x4 &mpic 0x2 0x1
615
616 /* IDSEL 0x12 func 6 - PCI slot 2 */
617 0x9600 0x0 0x0 0x1 &mpic 0x3 0x1
618 0x9600 0x0 0x0 0x2 &mpic 0x4 0x1
619 0x9600 0x0 0x0 0x3 &mpic 0x1 0x1
620 0x9600 0x0 0x0 0x4 &mpic 0x2 0x1
621
622 /* IDSEL 0x12 func 7 - PCI slot 2 */
623 0x9700 0x0 0x0 0x1 &mpic 0x3 0x1
624 0x9700 0x0 0x0 0x2 &mpic 0x4 0x1
625 0x9700 0x0 0x0 0x3 &mpic 0x1 0x1
626 0x9700 0x0 0x0 0x4 &mpic 0x2 0x1
627
628 // IDSEL 0x1c USB
629 0xe000 0x0 0x0 0x1 &i8259 0xc 0x2
630 0xe100 0x0 0x0 0x2 &i8259 0x9 0x2
631 0xe200 0x0 0x0 0x3 &i8259 0xa 0x2
632 0xe300 0x0 0x0 0x4 &i8259 0xb 0x2
633
634 // IDSEL 0x1d Audio
635 0xe800 0x0 0x0 0x1 &i8259 0x6 0x2
636
637 // IDSEL 0x1e Legacy
638 0xf000 0x0 0x0 0x1 &i8259 0x7 0x2
639 0xf100 0x0 0x0 0x1 &i8259 0x7 0x2
640
641 // IDSEL 0x1f IDE/SATA
642 0xf800 0x0 0x0 0x1 &i8259 0xe 0x2
643 0xf900 0x0 0x0 0x1 &i8259 0x5 0x2
644
645 >;
646
647 pcie@0 {
648 reg = <0x0 0x0 0x0 0x0 0x0>;
649 #size-cells = <2>;
650 #address-cells = <3>;
651 device_type = "pci";
652 ranges = <0x2000000 0x0 0xc0000000
653 0x2000000 0x0 0xc0000000
654 0x0 0x20000000
655
656 0x1000000 0x0 0x0
657 0x1000000 0x0 0x0
658 0x0 0x10000>;
659 uli1575@0 {
660 reg = <0x0 0x0 0x0 0x0 0x0>;
661 #size-cells = <2>;
662 #address-cells = <3>;
663 ranges = <0x2000000 0x0 0xc0000000
664 0x2000000 0x0 0xc0000000
665 0x0 0x20000000
666
667 0x1000000 0x0 0x0
668 0x1000000 0x0 0x0
669 0x0 0x10000>;
670 isa@1e {
671 device_type = "isa";
672 #interrupt-cells = <2>;
673 #size-cells = <1>;
674 #address-cells = <2>;
675 reg = <0xf000 0x0 0x0 0x0 0x0>;
676 ranges = <0x1 0x0 0x1000000 0x0 0x0
677 0x1000>;
678 interrupt-parent = <&i8259>;
679
680 i8259: interrupt-controller@20 {
681 reg = <0x1 0x20 0x2
682 0x1 0xa0 0x2
683 0x1 0x4d0 0x2>;
684 interrupt-controller;
685 device_type = "interrupt-controller";
686 #address-cells = <0>;
687 #interrupt-cells = <2>;
688 compatible = "chrp,iic";
689 interrupts = <9 2>;
690 interrupt-parent = <&mpic>;
691 };
692
693 i8042@60 {
694 #size-cells = <0>;
695 #address-cells = <1>;
696 reg = <0x1 0x60 0x1 0x1 0x64 0x1>;
697 interrupts = <1 3 12 3>;
698 interrupt-parent =
699 <&i8259>;
700
701 keyboard@0 {
702 reg = <0x0>;
703 compatible = "pnpPNP,303";
704 };
705
706 mouse@1 {
707 reg = <0x1>;
708 compatible = "pnpPNP,f03";
709 };
710 };
711
712 rtc@70 {
713 compatible = "pnpPNP,b00";
714 reg = <0x1 0x70 0x2>;
715 };
716
717 gpio@400 {
718 reg = <0x1 0x400 0x80>;
719 };
720 };
721 };
722 };
723
724 };
725
726 pci1: pcie@fffe09000 {
727 cell-index = <1>;
728 compatible = "fsl,mpc8548-pcie";
729 device_type = "pci";
730 #interrupt-cells = <1>;
731 #size-cells = <2>;
732 #address-cells = <3>;
733 reg = <0xf 0xffe09000 0 0x1000>;
734 bus-range = <0 255>;
735 ranges = <0x2000000 0x0 0xc0000000 0xc 0x20000000 0x0 0x20000000
736 0x1000000 0x0 0x00000000 0xf 0xffc10000 0x0 0x00010000>;
737 clock-frequency = <33333333>;
738 interrupt-parent = <&mpic>;
739 interrupts = <25 2>;
740 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
741 interrupt-map = <
742 /* IDSEL 0x0 */
743 0000 0x0 0x0 0x1 &mpic 0x4 0x1
744 0000 0x0 0x0 0x2 &mpic 0x5 0x1
745 0000 0x0 0x0 0x3 &mpic 0x6 0x1
746 0000 0x0 0x0 0x4 &mpic 0x7 0x1
747 >;
748 pcie@0 {
749 reg = <0x0 0x0 0x0 0x0 0x0>;
750 #size-cells = <2>;
751 #address-cells = <3>;
752 device_type = "pci";
753 ranges = <0x2000000 0x0 0xc0000000
754 0x2000000 0x0 0xc0000000
755 0x0 0x20000000
756
757 0x1000000 0x0 0x0
758 0x1000000 0x0 0x0
759 0x0 0x10000>;
760 };
761 };
762
763 pci2: pcie@fffe0a000 {
764 cell-index = <2>;
765 compatible = "fsl,mpc8548-pcie";
766 device_type = "pci";
767 #interrupt-cells = <1>;
768 #size-cells = <2>;
769 #address-cells = <3>;
770 reg = <0xf 0xffe0a000 0 0x1000>;
771 bus-range = <0 255>;
772 ranges = <0x2000000 0x0 0xc0000000 0xc 0x40000000 0x0 0x20000000
773 0x1000000 0x0 0x00000000 0xf 0xffc20000 0x0 0x00010000>;
774 clock-frequency = <33333333>;
775 interrupt-parent = <&mpic>;
776 interrupts = <26 2>;
777 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
778 interrupt-map = <
779 /* IDSEL 0x0 */
780 0000 0x0 0x0 0x1 &mpic 0x0 0x1
781 0000 0x0 0x0 0x2 &mpic 0x1 0x1
782 0000 0x0 0x0 0x3 &mpic 0x2 0x1
783 0000 0x0 0x0 0x4 &mpic 0x3 0x1
784 >;
785 pcie@0 {
786 reg = <0x0 0x0 0x0 0x0 0x0>;
787 #size-cells = <2>;
788 #address-cells = <3>;
789 device_type = "pci";
790 ranges = <0x2000000 0x0 0xc0000000
791 0x2000000 0x0 0xc0000000
792 0x0 0x20000000
793
794 0x1000000 0x0 0x0
795 0x1000000 0x0 0x0
796 0x0 0x10000>;
797 };
798 };
799};
diff --git a/arch/powerpc/boot/dts/mpc8572ds_camp_core0.dts b/arch/powerpc/boot/dts/mpc8572ds_camp_core0.dts
index fd462efa9e61..2bc0c7189653 100644
--- a/arch/powerpc/boot/dts/mpc8572ds_camp_core0.dts
+++ b/arch/powerpc/boot/dts/mpc8572ds_camp_core0.dts
@@ -6,7 +6,7 @@
6 * This dts file allows core0 to have memory, l2, i2c, dma1, global-util, eth0, 6 * This dts file allows core0 to have memory, l2, i2c, dma1, global-util, eth0,
7 * eth1, crypto, pci0, pci1. 7 * eth1, crypto, pci0, pci1.
8 * 8 *
9 * Copyright 2007, 2008 Freescale Semiconductor Inc. 9 * Copyright 2007-2009 Freescale Semiconductor Inc.
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
@@ -148,35 +148,38 @@
148 }; 148 };
149 }; 149 };
150 150
151 mdio@24520 {
152 #address-cells = <1>;
153 #size-cells = <0>;
154 compatible = "fsl,gianfar-mdio";
155 reg = <0x24520 0x20>;
156
157 phy0: ethernet-phy@0 {
158 interrupt-parent = <&mpic>;
159 interrupts = <10 1>;
160 reg = <0x0>;
161 };
162 phy1: ethernet-phy@1 {
163 interrupt-parent = <&mpic>;
164 interrupts = <10 1>;
165 reg = <0x1>;
166 };
167 };
168
169 enet0: ethernet@24000 { 151 enet0: ethernet@24000 {
152 #address-cells = <1>;
153 #size-cells = <1>;
170 cell-index = <0>; 154 cell-index = <0>;
171 device_type = "network"; 155 device_type = "network";
172 model = "eTSEC"; 156 model = "eTSEC";
173 compatible = "gianfar"; 157 compatible = "gianfar";
174 reg = <0x24000 0x1000>; 158 reg = <0x24000 0x1000>;
159 ranges = <0x0 0x24000 0x1000>;
175 local-mac-address = [ 00 00 00 00 00 00 ]; 160 local-mac-address = [ 00 00 00 00 00 00 ];
176 interrupts = <29 2 30 2 34 2>; 161 interrupts = <29 2 30 2 34 2>;
177 interrupt-parent = <&mpic>; 162 interrupt-parent = <&mpic>;
178 phy-handle = <&phy0>; 163 phy-handle = <&phy0>;
179 phy-connection-type = "rgmii-id"; 164 phy-connection-type = "rgmii-id";
165
166 mdio@520 {
167 #address-cells = <1>;
168 #size-cells = <0>;
169 compatible = "fsl,gianfar-mdio";
170 reg = <0x520 0x20>;
171
172 phy0: ethernet-phy@0 {
173 interrupt-parent = <&mpic>;
174 interrupts = <10 1>;
175 reg = <0x0>;
176 };
177 phy1: ethernet-phy@1 {
178 interrupt-parent = <&mpic>;
179 interrupts = <10 1>;
180 reg = <0x1>;
181 };
182 };
180 }; 183 };
181 184
182 enet1: ethernet@25000 { 185 enet1: ethernet@25000 {
@@ -227,7 +230,7 @@
227 device_type = "open-pic"; 230 device_type = "open-pic";
228 protected-sources = < 231 protected-sources = <
229 31 32 33 37 38 39 /* enet2 enet3 */ 232 31 32 33 37 38 39 /* enet2 enet3 */
230 76 77 78 79 27 42 /* dma2 pci2 serial*/ 233 76 77 78 79 26 42 /* dma2 pci2 serial*/
231 0xe0 0xe1 0xe2 0xe3 /* msi */ 234 0xe0 0xe1 0xe2 0xe3 /* msi */
232 0xe4 0xe5 0xe6 0xe7 235 0xe4 0xe5 0xe6 0xe7
233 >; 236 >;
@@ -376,7 +379,7 @@
376 379
377 0x1000000 0x0 0x0 380 0x1000000 0x0 0x0
378 0x1000000 0x0 0x0 381 0x1000000 0x0 0x0
379 0x0 0x100000>; 382 0x0 0x10000>;
380 uli1575@0 { 383 uli1575@0 {
381 reg = <0x0 0x0 0x0 0x0 0x0>; 384 reg = <0x0 0x0 0x0 0x0 0x0>;
382 #size-cells = <2>; 385 #size-cells = <2>;
@@ -387,7 +390,7 @@
387 390
388 0x1000000 0x0 0x0 391 0x1000000 0x0 0x0
389 0x1000000 0x0 0x0 392 0x1000000 0x0 0x0
390 0x0 0x100000>; 393 0x0 0x10000>;
391 isa@1e { 394 isa@1e {
392 device_type = "isa"; 395 device_type = "isa";
393 #interrupt-cells = <2>; 396 #interrupt-cells = <2>;
@@ -477,7 +480,7 @@
477 480
478 0x1000000 0x0 0x0 481 0x1000000 0x0 0x0
479 0x1000000 0x0 0x0 482 0x1000000 0x0 0x0
480 0x0 0x100000>; 483 0x0 0x10000>;
481 }; 484 };
482 }; 485 };
483}; 486};
diff --git a/arch/powerpc/boot/dts/mpc8572ds_camp_core1.dts b/arch/powerpc/boot/dts/mpc8572ds_camp_core1.dts
index e35230f2ac93..159cb3a875f0 100644
--- a/arch/powerpc/boot/dts/mpc8572ds_camp_core1.dts
+++ b/arch/powerpc/boot/dts/mpc8572ds_camp_core1.dts
@@ -7,7 +7,7 @@
7 * 7 *
8 * Please note to add "-b 1" for core1's dts compiling. 8 * Please note to add "-b 1" for core1's dts compiling.
9 * 9 *
10 * Copyright 2007, 2008 Freescale Semiconductor Inc. 10 * Copyright 2007-2009 Freescale Semiconductor Inc.
11 * 11 *
12 * This program is free software; you can redistribute it and/or modify it 12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the 13 * under the terms of the GNU General Public License as published by the
@@ -186,7 +186,7 @@
186 protected-sources = < 186 protected-sources = <
187 18 16 10 42 45 58 /* MEM L2 mdio serial crypto */ 187 18 16 10 42 45 58 /* MEM L2 mdio serial crypto */
188 29 30 34 35 36 40 /* enet0 enet1 */ 188 29 30 34 35 36 40 /* enet0 enet1 */
189 24 26 20 21 22 23 /* pcie0 pcie1 dma1 */ 189 24 25 20 21 22 23 /* pci0 pci1 dma1 */
190 43 /* i2c */ 190 43 /* i2c */
191 0x1 0x2 0x3 0x4 /* pci slot */ 191 0x1 0x2 0x3 0x4 /* pci slot */
192 0x9 0xa 0xb 0xc /* usb */ 192 0x9 0xa 0xb 0xc /* usb */
@@ -228,7 +228,7 @@
228 228
229 0x1000000 0x0 0x0 229 0x1000000 0x0 0x0
230 0x1000000 0x0 0x0 230 0x1000000 0x0 0x0
231 0x0 0x100000>; 231 0x0 0x10000>;
232 }; 232 };
233 }; 233 };
234}; 234};
diff --git a/arch/powerpc/boot/dts/mpc8610_hpcd.dts b/arch/powerpc/boot/dts/mpc8610_hpcd.dts
index f724d72c7b92..1bd3ebe11437 100644
--- a/arch/powerpc/boot/dts/mpc8610_hpcd.dts
+++ b/arch/powerpc/boot/dts/mpc8610_hpcd.dts
@@ -217,6 +217,7 @@
217 codec-handle = <&cs4270>; 217 codec-handle = <&cs4270>;
218 fsl,playback-dma = <&dma00>; 218 fsl,playback-dma = <&dma00>;
219 fsl,capture-dma = <&dma01>; 219 fsl,capture-dma = <&dma01>;
220 fsl,fifo-depth = <8>;
220 }; 221 };
221 222
222 ssi@16100 { 223 ssi@16100 {
@@ -225,6 +226,7 @@
225 reg = <0x16100 0x100>; 226 reg = <0x16100 0x100>;
226 interrupt-parent = <&mpic>; 227 interrupt-parent = <&mpic>;
227 interrupts = <63 2>; 228 interrupts = <63 2>;
229 fsl,fifo-depth = <8>;
228 }; 230 };
229 231
230 dma@21300 { 232 dma@21300 {
diff --git a/arch/powerpc/boot/dts/mpc8641_hpcn.dts b/arch/powerpc/boot/dts/mpc8641_hpcn.dts
index 4481532cbe77..d72beb192460 100644
--- a/arch/powerpc/boot/dts/mpc8641_hpcn.dts
+++ b/arch/powerpc/boot/dts/mpc8641_hpcn.dts
@@ -180,133 +180,144 @@
180 }; 180 };
181 }; 181 };
182 182
183 mdio@24520 {
184 #address-cells = <1>;
185 #size-cells = <0>;
186 compatible = "fsl,gianfar-mdio";
187 reg = <0x24520 0x20>;
188
189 phy0: ethernet-phy@0 {
190 interrupt-parent = <&mpic>;
191 interrupts = <10 1>;
192 reg = <0>;
193 device_type = "ethernet-phy";
194 };
195 phy1: ethernet-phy@1 {
196 interrupt-parent = <&mpic>;
197 interrupts = <10 1>;
198 reg = <1>;
199 device_type = "ethernet-phy";
200 };
201 phy2: ethernet-phy@2 {
202 interrupt-parent = <&mpic>;
203 interrupts = <10 1>;
204 reg = <2>;
205 device_type = "ethernet-phy";
206 };
207 phy3: ethernet-phy@3 {
208 interrupt-parent = <&mpic>;
209 interrupts = <10 1>;
210 reg = <3>;
211 device_type = "ethernet-phy";
212 };
213 tbi0: tbi-phy@11 {
214 reg = <0x11>;
215 device_type = "tbi-phy";
216 };
217 };
218
219 mdio@25520 {
220 #address-cells = <1>;
221 #size-cells = <0>;
222 compatible = "fsl,gianfar-tbi";
223 reg = <0x25520 0x20>;
224
225 tbi1: tbi-phy@11 {
226 reg = <0x11>;
227 device_type = "tbi-phy";
228 };
229 };
230
231 mdio@26520 {
232 #address-cells = <1>;
233 #size-cells = <0>;
234 compatible = "fsl,gianfar-tbi";
235 reg = <0x26520 0x20>;
236
237 tbi2: tbi-phy@11 {
238 reg = <0x11>;
239 device_type = "tbi-phy";
240 };
241 };
242
243 mdio@27520 {
244 #address-cells = <1>;
245 #size-cells = <0>;
246 compatible = "fsl,gianfar-tbi";
247 reg = <0x27520 0x20>;
248
249 tbi3: tbi-phy@11 {
250 reg = <0x11>;
251 device_type = "tbi-phy";
252 };
253 };
254
255
256 enet0: ethernet@24000 { 183 enet0: ethernet@24000 {
184 #address-cells = <1>;
185 #size-cells = <1>;
257 cell-index = <0>; 186 cell-index = <0>;
258 device_type = "network"; 187 device_type = "network";
259 model = "TSEC"; 188 model = "TSEC";
260 compatible = "gianfar"; 189 compatible = "gianfar";
261 reg = <0x24000 0x1000>; 190 reg = <0x24000 0x1000>;
191 ranges = <0x0 0x24000 0x1000>;
262 local-mac-address = [ 00 00 00 00 00 00 ]; 192 local-mac-address = [ 00 00 00 00 00 00 ];
263 interrupts = <29 2 30 2 34 2>; 193 interrupts = <29 2 30 2 34 2>;
264 interrupt-parent = <&mpic>; 194 interrupt-parent = <&mpic>;
265 tbi-handle = <&tbi0>; 195 tbi-handle = <&tbi0>;
266 phy-handle = <&phy0>; 196 phy-handle = <&phy0>;
267 phy-connection-type = "rgmii-id"; 197 phy-connection-type = "rgmii-id";
198
199 mdio@520 {
200 #address-cells = <1>;
201 #size-cells = <0>;
202 compatible = "fsl,gianfar-mdio";
203 reg = <0x520 0x20>;
204
205 phy0: ethernet-phy@0 {
206 interrupt-parent = <&mpic>;
207 interrupts = <10 1>;
208 reg = <0>;
209 device_type = "ethernet-phy";
210 };
211 phy1: ethernet-phy@1 {
212 interrupt-parent = <&mpic>;
213 interrupts = <10 1>;
214 reg = <1>;
215 device_type = "ethernet-phy";
216 };
217 phy2: ethernet-phy@2 {
218 interrupt-parent = <&mpic>;
219 interrupts = <10 1>;
220 reg = <2>;
221 device_type = "ethernet-phy";
222 };
223 phy3: ethernet-phy@3 {
224 interrupt-parent = <&mpic>;
225 interrupts = <10 1>;
226 reg = <3>;
227 device_type = "ethernet-phy";
228 };
229 tbi0: tbi-phy@11 {
230 reg = <0x11>;
231 device_type = "tbi-phy";
232 };
233 };
268 }; 234 };
269 235
270 enet1: ethernet@25000 { 236 enet1: ethernet@25000 {
237 #address-cells = <1>;
238 #size-cells = <1>;
271 cell-index = <1>; 239 cell-index = <1>;
272 device_type = "network"; 240 device_type = "network";
273 model = "TSEC"; 241 model = "TSEC";
274 compatible = "gianfar"; 242 compatible = "gianfar";
275 reg = <0x25000 0x1000>; 243 reg = <0x25000 0x1000>;
244 ranges = <0x0 0x25000 0x1000>;
276 local-mac-address = [ 00 00 00 00 00 00 ]; 245 local-mac-address = [ 00 00 00 00 00 00 ];
277 interrupts = <35 2 36 2 40 2>; 246 interrupts = <35 2 36 2 40 2>;
278 interrupt-parent = <&mpic>; 247 interrupt-parent = <&mpic>;
279 tbi-handle = <&tbi1>; 248 tbi-handle = <&tbi1>;
280 phy-handle = <&phy1>; 249 phy-handle = <&phy1>;
281 phy-connection-type = "rgmii-id"; 250 phy-connection-type = "rgmii-id";
251
252 mdio@520 {
253 #address-cells = <1>;
254 #size-cells = <0>;
255 compatible = "fsl,gianfar-tbi";
256 reg = <0x520 0x20>;
257
258 tbi1: tbi-phy@11 {
259 reg = <0x11>;
260 device_type = "tbi-phy";
261 };
262 };
282 }; 263 };
283 264
284 enet2: ethernet@26000 { 265 enet2: ethernet@26000 {
266 #address-cells = <1>;
267 #size-cells = <1>;
285 cell-index = <2>; 268 cell-index = <2>;
286 device_type = "network"; 269 device_type = "network";
287 model = "TSEC"; 270 model = "TSEC";
288 compatible = "gianfar"; 271 compatible = "gianfar";
289 reg = <0x26000 0x1000>; 272 reg = <0x26000 0x1000>;
273 ranges = <0x0 0x26000 0x1000>;
290 local-mac-address = [ 00 00 00 00 00 00 ]; 274 local-mac-address = [ 00 00 00 00 00 00 ];
291 interrupts = <31 2 32 2 33 2>; 275 interrupts = <31 2 32 2 33 2>;
292 interrupt-parent = <&mpic>; 276 interrupt-parent = <&mpic>;
293 tbi-handle = <&tbi2>; 277 tbi-handle = <&tbi2>;
294 phy-handle = <&phy2>; 278 phy-handle = <&phy2>;
295 phy-connection-type = "rgmii-id"; 279 phy-connection-type = "rgmii-id";
280
281 mdio@520 {
282 #address-cells = <1>;
283 #size-cells = <0>;
284 compatible = "fsl,gianfar-tbi";
285 reg = <0x520 0x20>;
286
287 tbi2: tbi-phy@11 {
288 reg = <0x11>;
289 device_type = "tbi-phy";
290 };
291 };
296 }; 292 };
297 293
298 enet3: ethernet@27000 { 294 enet3: ethernet@27000 {
295 #address-cells = <1>;
296 #size-cells = <1>;
299 cell-index = <3>; 297 cell-index = <3>;
300 device_type = "network"; 298 device_type = "network";
301 model = "TSEC"; 299 model = "TSEC";
302 compatible = "gianfar"; 300 compatible = "gianfar";
303 reg = <0x27000 0x1000>; 301 reg = <0x27000 0x1000>;
302 ranges = <0x0 0x27000 0x1000>;
304 local-mac-address = [ 00 00 00 00 00 00 ]; 303 local-mac-address = [ 00 00 00 00 00 00 ];
305 interrupts = <37 2 38 2 39 2>; 304 interrupts = <37 2 38 2 39 2>;
306 interrupt-parent = <&mpic>; 305 interrupt-parent = <&mpic>;
307 tbi-handle = <&tbi3>; 306 tbi-handle = <&tbi3>;
308 phy-handle = <&phy3>; 307 phy-handle = <&phy3>;
309 phy-connection-type = "rgmii-id"; 308 phy-connection-type = "rgmii-id";
309
310 mdio@520 {
311 #address-cells = <1>;
312 #size-cells = <0>;
313 compatible = "fsl,gianfar-tbi";
314 reg = <0x520 0x20>;
315
316 tbi3: tbi-phy@11 {
317 reg = <0x11>;
318 device_type = "tbi-phy";
319 };
320 };
310 }; 321 };
311 322
312 serial0: serial@4500 { 323 serial0: serial@4500 {
diff --git a/arch/powerpc/boot/dts/pcm030.dts b/arch/powerpc/boot/dts/pcm030.dts
index be2c11ca0594..895834713894 100644
--- a/arch/powerpc/boot/dts/pcm030.dts
+++ b/arch/powerpc/boot/dts/pcm030.dts
@@ -19,6 +19,7 @@
19 compatible = "phytec,pcm030"; 19 compatible = "phytec,pcm030";
20 #address-cells = <1>; 20 #address-cells = <1>;
21 #size-cells = <1>; 21 #size-cells = <1>;
22 interrupt-parent = <&mpc5200_pic>;
22 23
23 cpus { 24 cpus {
24 #address-cells = <1>; 25 #address-cells = <1>;
@@ -29,26 +30,26 @@
29 reg = <0>; 30 reg = <0>;
30 d-cache-line-size = <32>; 31 d-cache-line-size = <32>;
31 i-cache-line-size = <32>; 32 i-cache-line-size = <32>;
32 d-cache-size = <0x4000>; /* L1, 16K */ 33 d-cache-size = <0x4000>; // L1, 16K
33 i-cache-size = <0x4000>; /* L1, 16K */ 34 i-cache-size = <0x4000>; // L1, 16K
34 timebase-frequency = <0>; /* From Bootloader */ 35 timebase-frequency = <0>; // from bootloader
35 bus-frequency = <0>; /* From Bootloader */ 36 bus-frequency = <0>; // from bootloader
36 clock-frequency = <0>; /* From Bootloader */ 37 clock-frequency = <0>; // from bootloader
37 }; 38 };
38 }; 39 };
39 40
40 memory { 41 memory {
41 device_type = "memory"; 42 device_type = "memory";
42 reg = <0x00000000 0x04000000>; /* 64MB */ 43 reg = <0x00000000 0x04000000>; // 64MB
43 }; 44 };
44 45
45 soc5200@f0000000 { 46 soc5200@f0000000 {
46 #address-cells = <1>; 47 #address-cells = <1>;
47 #size-cells = <1>; 48 #size-cells = <1>;
48 compatible = "fsl,mpc5200b-immr"; 49 compatible = "fsl,mpc5200b-immr";
49 ranges = <0x0 0xf0000000 0x0000c000>; 50 ranges = <0 0xf0000000 0x0000c000>;
50 bus-frequency = <0>; /* From bootloader */ 51 bus-frequency = <0>; // from bootloader
51 system-frequency = <0>; /* From bootloader */ 52 system-frequency = <0>; // from bootloader
52 53
53 cdm@200 { 54 cdm@200 {
54 compatible = "fsl,mpc5200b-cdm","fsl,mpc5200-cdm"; 55 compatible = "fsl,mpc5200b-cdm","fsl,mpc5200-cdm";
@@ -56,87 +57,70 @@
56 }; 57 };
57 58
58 mpc5200_pic: interrupt-controller@500 { 59 mpc5200_pic: interrupt-controller@500 {
59 /* 5200 interrupts are encoded into two levels; */ 60 // 5200 interrupts are encoded into two levels;
60 interrupt-controller; 61 interrupt-controller;
61 #interrupt-cells = <3>; 62 #interrupt-cells = <3>;
62 device_type = "interrupt-controller";
63 compatible = "fsl,mpc5200b-pic","fsl,mpc5200-pic"; 63 compatible = "fsl,mpc5200b-pic","fsl,mpc5200-pic";
64 reg = <0x500 0x80>; 64 reg = <0x500 0x80>;
65 }; 65 };
66 66
67 timer@600 { /* General Purpose Timer */ 67 timer@600 { // General Purpose Timer
68 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt"; 68 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
69 cell-index = <0>;
70 reg = <0x600 0x10>; 69 reg = <0x600 0x10>;
71 interrupts = <0x1 0x9 0x0>; 70 interrupts = <1 9 0>;
72 interrupt-parent = <&mpc5200_pic>;
73 fsl,has-wdt; 71 fsl,has-wdt;
74 }; 72 };
75 73
76 timer@610 { /* General Purpose Timer */ 74 timer@610 { // General Purpose Timer
77 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt"; 75 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
78 cell-index = <1>;
79 reg = <0x610 0x10>; 76 reg = <0x610 0x10>;
80 interrupts = <0x1 0xa 0x0>; 77 interrupts = <1 10 0>;
81 interrupt-parent = <&mpc5200_pic>;
82 }; 78 };
83 79
84 gpt2: timer@620 { /* General Purpose Timer in GPIO mode */ 80 gpt2: timer@620 { // General Purpose Timer in GPIO mode
85 compatible = "fsl,mpc5200b-gpt-gpio","fsl,mpc5200-gpt-gpio"; 81 compatible = "fsl,mpc5200b-gpt-gpio","fsl,mpc5200-gpt-gpio";
86 cell-index = <2>;
87 reg = <0x620 0x10>; 82 reg = <0x620 0x10>;
88 interrupts = <0x1 0xb 0x0>; 83 interrupts = <1 11 0>;
89 interrupt-parent = <&mpc5200_pic>;
90 gpio-controller; 84 gpio-controller;
91 #gpio-cells = <2>; 85 #gpio-cells = <2>;
92 }; 86 };
93 87
94 gpt3: timer@630 { /* General Purpose Timer in GPIO mode */ 88 gpt3: timer@630 { // General Purpose Timer in GPIO mode
95 compatible = "fsl,mpc5200b-gpt-gpio","fsl,mpc5200-gpt-gpio"; 89 compatible = "fsl,mpc5200b-gpt-gpio","fsl,mpc5200-gpt-gpio";
96 cell-index = <3>;
97 reg = <0x630 0x10>; 90 reg = <0x630 0x10>;
98 interrupts = <0x1 0xc 0x0>; 91 interrupts = <1 12 0>;
99 interrupt-parent = <&mpc5200_pic>;
100 gpio-controller; 92 gpio-controller;
101 #gpio-cells = <2>; 93 #gpio-cells = <2>;
102 }; 94 };
103 95
104 gpt4: timer@640 { /* General Purpose Timer in GPIO mode */ 96 gpt4: timer@640 { // General Purpose Timer in GPIO mode
105 compatible = "fsl,mpc5200b-gpt-gpio","fsl,mpc5200-gpt-gpio"; 97 compatible = "fsl,mpc5200b-gpt-gpio","fsl,mpc5200-gpt-gpio";
106 cell-index = <4>;
107 reg = <0x640 0x10>; 98 reg = <0x640 0x10>;
108 interrupts = <0x1 0xd 0x0>; 99 interrupts = <1 13 0>;
109 interrupt-parent = <&mpc5200_pic>;
110 gpio-controller; 100 gpio-controller;
111 #gpio-cells = <2>; 101 #gpio-cells = <2>;
112 }; 102 };
113 103
114 gpt5: timer@650 { /* General Purpose Timer in GPIO mode */ 104 gpt5: timer@650 { // General Purpose Timer in GPIO mode
115 compatible = "fsl,mpc5200b-gpt-gpio","fsl,mpc5200-gpt-gpio"; 105 compatible = "fsl,mpc5200b-gpt-gpio","fsl,mpc5200-gpt-gpio";
116 cell-index = <5>;
117 reg = <0x650 0x10>; 106 reg = <0x650 0x10>;
118 interrupts = <0x1 0xe 0x0>; 107 interrupts = <1 14 0>;
119 interrupt-parent = <&mpc5200_pic>;
120 gpio-controller; 108 gpio-controller;
121 #gpio-cells = <2>; 109 #gpio-cells = <2>;
122 }; 110 };
123 111
124 gpt6: timer@660 { /* General Purpose Timer in GPIO mode */ 112 gpt6: timer@660 { // General Purpose Timer in GPIO mode
125 compatible = "fsl,mpc5200b-gpt-gpio","fsl,mpc5200-gpt-gpio"; 113 compatible = "fsl,mpc5200b-gpt-gpio","fsl,mpc5200-gpt-gpio";
126 cell-index = <6>;
127 reg = <0x660 0x10>; 114 reg = <0x660 0x10>;
128 interrupts = <0x1 0xf 0x0>; 115 interrupts = <1 15 0>;
129 interrupt-parent = <&mpc5200_pic>;
130 gpio-controller; 116 gpio-controller;
131 #gpio-cells = <2>; 117 #gpio-cells = <2>;
132 }; 118 };
133 119
134 gpt7: timer@670 { /* General Purpose Timer in GPIO mode */ 120 gpt7: timer@670 { // General Purpose Timer in GPIO mode
135 compatible = "fsl,mpc5200b-gpt-gpio","fsl,mpc5200-gpt-gpio"; 121 compatible = "fsl,mpc5200b-gpt-gpio","fsl,mpc5200-gpt-gpio";
136 cell-index = <7>;
137 reg = <0x670 0x10>; 122 reg = <0x670 0x10>;
138 interrupts = <0x1 0x10 0x0>; 123 interrupts = <1 16 0>;
139 interrupt-parent = <&mpc5200_pic>;
140 gpio-controller; 124 gpio-controller;
141 #gpio-cells = <2>; 125 #gpio-cells = <2>;
142 }; 126 };
@@ -144,40 +128,33 @@
144 rtc@800 { // Real time clock 128 rtc@800 { // Real time clock
145 compatible = "fsl,mpc5200b-rtc","fsl,mpc5200-rtc"; 129 compatible = "fsl,mpc5200b-rtc","fsl,mpc5200-rtc";
146 reg = <0x800 0x100>; 130 reg = <0x800 0x100>;
147 interrupts = <0x1 0x5 0x0 0x1 0x6 0x0>; 131 interrupts = <1 5 0 1 6 0>;
148 interrupt-parent = <&mpc5200_pic>;
149 }; 132 };
150 133
151 can@900 { 134 can@900 {
152 compatible = "fsl,mpc5200b-mscan","fsl,mpc5200-mscan"; 135 compatible = "fsl,mpc5200b-mscan","fsl,mpc5200-mscan";
153 cell-index = <0>; 136 interrupts = <2 17 0>;
154 interrupts = <0x2 0x11 0x0>;
155 interrupt-parent = <&mpc5200_pic>;
156 reg = <0x900 0x80>; 137 reg = <0x900 0x80>;
157 }; 138 };
158 139
159 can@980 { 140 can@980 {
160 compatible = "fsl,mpc5200b-mscan","fsl,mpc5200-mscan"; 141 compatible = "fsl,mpc5200b-mscan","fsl,mpc5200-mscan";
161 cell-index = <1>; 142 interrupts = <2 18 0>;
162 interrupts = <0x2 0x12 0x0>;
163 interrupt-parent = <&mpc5200_pic>;
164 reg = <0x980 0x80>; 143 reg = <0x980 0x80>;
165 }; 144 };
166 145
167 gpio_simple: gpio@b00 { 146 gpio_simple: gpio@b00 {
168 compatible = "fsl,mpc5200b-gpio","fsl,mpc5200-gpio"; 147 compatible = "fsl,mpc5200b-gpio","fsl,mpc5200-gpio";
169 reg = <0xb00 0x40>; 148 reg = <0xb00 0x40>;
170 interrupts = <0x1 0x7 0x0>; 149 interrupts = <1 7 0>;
171 interrupt-parent = <&mpc5200_pic>;
172 gpio-controller; 150 gpio-controller;
173 #gpio-cells = <2>; 151 #gpio-cells = <2>;
174 }; 152 };
175 153
176 gpio_wkup: gpio-wkup@c00 { 154 gpio_wkup: gpio@c00 {
177 compatible = "fsl,mpc5200b-gpio-wkup","fsl,mpc5200-gpio-wkup"; 155 compatible = "fsl,mpc5200b-gpio-wkup","fsl,mpc5200-gpio-wkup";
178 reg = <0xc00 0x40>; 156 reg = <0xc00 0x40>;
179 interrupts = <0x1 0x8 0x0 0x0 0x3 0x0>; 157 interrupts = <1 8 0 0 3 0>;
180 interrupt-parent = <&mpc5200_pic>;
181 gpio-controller; 158 gpio-controller;
182 #gpio-cells = <2>; 159 #gpio-cells = <2>;
183 }; 160 };
@@ -185,26 +162,22 @@
185 spi@f00 { 162 spi@f00 {
186 compatible = "fsl,mpc5200b-spi","fsl,mpc5200-spi"; 163 compatible = "fsl,mpc5200b-spi","fsl,mpc5200-spi";
187 reg = <0xf00 0x20>; 164 reg = <0xf00 0x20>;
188 interrupts = <0x2 0xd 0x0 0x2 0xe 0x0>; 165 interrupts = <2 13 0 2 14 0>;
189 interrupt-parent = <&mpc5200_pic>;
190 }; 166 };
191 167
192 usb@1000 { 168 usb@1000 {
193 compatible = "fsl,mpc5200b-ohci","fsl,mpc5200-ohci","ohci-be"; 169 compatible = "fsl,mpc5200b-ohci","fsl,mpc5200-ohci","ohci-be";
194 reg = <0x1000 0xff>; 170 reg = <0x1000 0xff>;
195 interrupts = <0x2 0x6 0x0>; 171 interrupts = <2 6 0>;
196 interrupt-parent = <&mpc5200_pic>;
197 }; 172 };
198 173
199 dma-controller@1200 { 174 dma-controller@1200 {
200 device_type = "dma-controller";
201 compatible = "fsl,mpc5200b-bestcomm","fsl,mpc5200-bestcomm"; 175 compatible = "fsl,mpc5200b-bestcomm","fsl,mpc5200-bestcomm";
202 reg = <0x1200 0x80>; 176 reg = <0x1200 0x80>;
203 interrupts = <0x3 0x0 0x0 0x3 0x1 0x0 0x3 0x2 0x0 0x3 0x3 0x0 177 interrupts = <3 0 0 3 1 0 3 2 0 3 3 0
204 0x3 0x4 0x0 0x3 0x5 0x0 0x3 0x6 0x0 0x3 0x7 0x0 178 3 4 0 3 5 0 3 6 0 3 7 0
205 0x3 0x8 0x0 0x3 0x9 0x0 0x3 0xa 0x0 0x3 0xb 0x0 179 3 8 0 3 9 0 3 10 0 3 11 0
206 0x3 0xc 0x0 0x3 0xd 0x0 0x3 0xe 0x0 0x3 0xf 0x0>; 180 3 12 0 3 13 0 3 14 0 3 15 0>;
207 interrupt-parent = <&mpc5200_pic>;
208 }; 181 };
209 182
210 xlb@1f00 { 183 xlb@1f00 {
@@ -213,24 +186,19 @@
213 }; 186 };
214 187
215 ac97@2000 { /* PSC1 in ac97 mode */ 188 ac97@2000 { /* PSC1 in ac97 mode */
216 device_type = "sound";
217 compatible = "mpc5200b-psc-ac97","fsl,mpc5200b-psc-ac97"; 189 compatible = "mpc5200b-psc-ac97","fsl,mpc5200b-psc-ac97";
218 cell-index = <0>; 190 cell-index = <0>;
219 reg = <0x2000 0x100>; 191 reg = <0x2000 0x100>;
220 interrupts = <0x2 0x2 0x0>; 192 interrupts = <2 1 0>;
221 interrupt-parent = <&mpc5200_pic>;
222 }; 193 };
223 194
224 /* PSC2 port is used by CAN1/2 */ 195 /* PSC2 port is used by CAN1/2 */
225 196
226 serial@2400 { /* PSC3 in UART mode */ 197 serial@2400 { /* PSC3 in UART mode */
227 device_type = "serial";
228 compatible = "fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart"; 198 compatible = "fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart";
229 port-number = <0>;
230 cell-index = <2>; 199 cell-index = <2>;
231 reg = <0x2400 0x100>; 200 reg = <0x2400 0x100>;
232 interrupts = <0x2 0x3 0x0>; 201 interrupts = <2 3 0>;
233 interrupt-parent = <&mpc5200_pic>;
234 }; 202 };
235 203
236 /* PSC4 is ??? */ 204 /* PSC4 is ??? */
@@ -238,55 +206,44 @@
238 /* PSC5 is ??? */ 206 /* PSC5 is ??? */
239 207
240 serial@2c00 { /* PSC6 in UART mode */ 208 serial@2c00 { /* PSC6 in UART mode */
241 device_type = "serial";
242 compatible = "fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart"; 209 compatible = "fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart";
243 port-number = <1>;
244 cell-index = <5>; 210 cell-index = <5>;
245 reg = <0x2c00 0x100>; 211 reg = <0x2c00 0x100>;
246 interrupts = <0x2 0x4 0x0>; 212 interrupts = <2 4 0>;
247 interrupt-parent = <&mpc5200_pic>;
248 }; 213 };
249 214
250 ethernet@3000 { 215 ethernet@3000 {
251 device_type = "network";
252 compatible = "fsl,mpc5200b-fec","fsl,mpc5200-fec"; 216 compatible = "fsl,mpc5200b-fec","fsl,mpc5200-fec";
253 reg = <0x3000 0x400>; 217 reg = <0x3000 0x400>;
254 local-mac-address = [00 00 00 00 00 00]; 218 local-mac-address = [ 00 00 00 00 00 00 ];
255 interrupts = <0x2 0x5 0x0>; 219 interrupts = <2 5 0>;
256 interrupt-parent = <&mpc5200_pic>;
257 phy-handle = <&phy0>; 220 phy-handle = <&phy0>;
258 }; 221 };
259 222
260 mdio@3000 { 223 mdio@3000 {
261 #address-cells = <1>; 224 #address-cells = <1>;
262 #size-cells = <0>; 225 #size-cells = <0>;
263 compatible = "fsl,mpc5200b-mdio", "fsl,mpc5200-mdio"; 226 compatible = "fsl,mpc5200b-mdio","fsl,mpc5200-mdio";
264 reg = <0x3000 0x400>; /* fec range, since we need to setup fec interrupts */ 227 reg = <0x3000 0x400>; // fec range, since we need to setup fec interrupts
265 interrupts = <0x2 0x5 0x0>; /* these are for "mii command finished", not link changes & co. */ 228 interrupts = <2 5 0>; // these are for "mii command finished", not link changes & co.
266 interrupt-parent = <&mpc5200_pic>; 229
267 230 phy0: ethernet-phy@0 {
268 phy0:ethernet-phy@0 { 231 reg = <0>;
269 device_type = "ethernet-phy";
270 reg = <0x0>;
271 }; 232 };
272 }; 233 };
273 234
274 ata@3a00 { 235 ata@3a00 {
275 device_type = "ata";
276 compatible = "fsl,mpc5200b-ata","fsl,mpc5200-ata"; 236 compatible = "fsl,mpc5200b-ata","fsl,mpc5200-ata";
277 reg = <0x3a00 0x100>; 237 reg = <0x3a00 0x100>;
278 interrupts = <0x2 0x7 0x0>; 238 interrupts = <2 7 0>;
279 interrupt-parent = <&mpc5200_pic>;
280 }; 239 };
281 240
282 i2c@3d00 { 241 i2c@3d00 {
283 #address-cells = <1>; 242 #address-cells = <1>;
284 #size-cells = <0>; 243 #size-cells = <0>;
285 compatible = "fsl,mpc5200b-i2c","fsl,mpc5200-i2c","fsl-i2c"; 244 compatible = "fsl,mpc5200b-i2c","fsl,mpc5200-i2c","fsl-i2c";
286 cell-index = <0>;
287 reg = <0x3d00 0x40>; 245 reg = <0x3d00 0x40>;
288 interrupts = <0x2 0xf 0x0>; 246 interrupts = <2 15 0>;
289 interrupt-parent = <&mpc5200_pic>;
290 fsl5200-clocking; 247 fsl5200-clocking;
291 }; 248 };
292 249
@@ -294,10 +251,8 @@
294 #address-cells = <1>; 251 #address-cells = <1>;
295 #size-cells = <0>; 252 #size-cells = <0>;
296 compatible = "fsl,mpc5200b-i2c","fsl,mpc5200-i2c","fsl-i2c"; 253 compatible = "fsl,mpc5200b-i2c","fsl,mpc5200-i2c","fsl-i2c";
297 cell-index = <1>;
298 reg = <0x3d40 0x40>; 254 reg = <0x3d40 0x40>;
299 interrupts = <0x2 0x10 0x0>; 255 interrupts = <2 16 0>;
300 interrupt-parent = <&mpc5200_pic>;
301 fsl5200-clocking; 256 fsl5200-clocking;
302 rtc@51 { 257 rtc@51 {
303 compatible = "nxp,pcf8563"; 258 compatible = "nxp,pcf8563";
@@ -307,7 +262,7 @@
307 }; 262 };
308 263
309 sram@8000 { 264 sram@8000 {
310 compatible = "fsl,mpc5200b-sram","fsl,mpc5200-sram","sram"; 265 compatible = "fsl,mpc5200b-sram","fsl,mpc5200-sram";
311 reg = <0x8000 0x4000>; 266 reg = <0x8000 0x4000>;
312 }; 267 };
313 268
@@ -340,22 +295,21 @@
340 device_type = "pci"; 295 device_type = "pci";
341 compatible = "fsl,mpc5200b-pci","fsl,mpc5200-pci"; 296 compatible = "fsl,mpc5200b-pci","fsl,mpc5200-pci";
342 reg = <0xf0000d00 0x100>; 297 reg = <0xf0000d00 0x100>;
343 interrupt-map-mask = <0xf800 0x0 0x0 0x7>; 298 interrupt-map-mask = <0xf800 0 0 7>;
344 interrupt-map = <0xc000 0x0 0x0 0x1 &mpc5200_pic 0x0 0x0 0x3 /* 1st slot */ 299 interrupt-map = <0xc000 0 0 1 &mpc5200_pic 0 0 3 // 1st slot
345 0xc000 0x0 0x0 0x2 &mpc5200_pic 0x1 0x1 0x3 300 0xc000 0 0 2 &mpc5200_pic 1 1 3
346 0xc000 0x0 0x0 0x3 &mpc5200_pic 0x1 0x2 0x3 301 0xc000 0 0 3 &mpc5200_pic 1 2 3
347 0xc000 0x0 0x0 0x4 &mpc5200_pic 0x1 0x3 0x3 302 0xc000 0 0 4 &mpc5200_pic 1 3 3
348 303
349 0xc800 0x0 0x0 0x1 &mpc5200_pic 0x1 0x1 0x3 /* 2nd slot */ 304 0xc800 0 0 1 &mpc5200_pic 1 1 3 // 2nd slot
350 0xc800 0x0 0x0 0x2 &mpc5200_pic 0x1 0x2 0x3 305 0xc800 0 0 2 &mpc5200_pic 1 2 3
351 0xc800 0x0 0x0 0x3 &mpc5200_pic 0x1 0x3 0x3 306 0xc800 0 0 3 &mpc5200_pic 1 3 3
352 0xc800 0x0 0x0 0x4 &mpc5200_pic 0x0 0x0 0x3>; 307 0xc800 0 0 4 &mpc5200_pic 0 0 3>;
353 clock-frequency = <0>; // From boot loader 308 clock-frequency = <0>; // From boot loader
354 interrupts = <0x2 0x8 0x0 0x2 0x9 0x0 0x2 0xa 0x0>; 309 interrupts = <2 8 0 2 9 0 2 10 0>;
355 interrupt-parent = <&mpc5200_pic>;
356 bus-range = <0 0>; 310 bus-range = <0 0>;
357 ranges = <0x42000000 0x0 0x80000000 0x80000000 0x0 0x20000000 311 ranges = <0x42000000 0 0x80000000 0x80000000 0 0x20000000
358 0x02000000 0x0 0xa0000000 0xa0000000 0x0 0x10000000 312 0x02000000 0 0xa0000000 0xa0000000 0 0x10000000
359 0x01000000 0x0 0x00000000 0xb0000000 0x0 0x01000000>; 313 0x01000000 0 0x00000000 0xb0000000 0 0x01000000>;
360 }; 314 };
361}; 315};
diff --git a/arch/powerpc/boot/dts/pcm032.dts b/arch/powerpc/boot/dts/pcm032.dts
new file mode 100644
index 000000000000..030042678392
--- /dev/null
+++ b/arch/powerpc/boot/dts/pcm032.dts
@@ -0,0 +1,392 @@
1/*
2 * phyCORE-MPC5200B-IO (pcm032) board Device Tree Source
3 *
4 * Copyright (C) 2006-2009 Pengutronix
5 * Sascha Hauer <s.hauer@pengutronix.de>
6 * Juergen Beisert <j.beisert@pengutronix.de>
7 * Wolfram Sang <w.sang@pengutronix.de>
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
15/dts-v1/;
16
17/ {
18 model = "phytec,pcm032";
19 compatible = "phytec,pcm032";
20 #address-cells = <1>;
21 #size-cells = <1>;
22 interrupt-parent = <&mpc5200_pic>;
23
24 cpus {
25 #address-cells = <1>;
26 #size-cells = <0>;
27
28 PowerPC,5200@0 {
29 device_type = "cpu";
30 reg = <0>;
31 d-cache-line-size = <32>;
32 i-cache-line-size = <32>;
33 d-cache-size = <0x4000>; // L1, 16K
34 i-cache-size = <0x4000>; // L1, 16K
35 timebase-frequency = <0>; // from bootloader
36 bus-frequency = <0>; // from bootloader
37 clock-frequency = <0>; // from bootloader
38 };
39 };
40
41 memory {
42 device_type = "memory";
43 reg = <0x00000000 0x08000000>; // 128MB
44 };
45
46 soc5200@f0000000 {
47 #address-cells = <1>;
48 #size-cells = <1>;
49 compatible = "fsl,mpc5200b-immr";
50 ranges = <0 0xf0000000 0x0000c000>;
51 bus-frequency = <0>; // from bootloader
52 system-frequency = <0>; // from bootloader
53
54 cdm@200 {
55 compatible = "fsl,mpc5200b-cdm","fsl,mpc5200-cdm";
56 reg = <0x200 0x38>;
57 };
58
59 mpc5200_pic: interrupt-controller@500 {
60 // 5200 interrupts are encoded into two levels;
61 interrupt-controller;
62 #interrupt-cells = <3>;
63 compatible = "fsl,mpc5200b-pic","fsl,mpc5200-pic";
64 reg = <0x500 0x80>;
65 };
66
67 timer@600 { // General Purpose Timer
68 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
69 reg = <0x600 0x10>;
70 interrupts = <1 9 0>;
71 fsl,has-wdt;
72 };
73
74 timer@610 { // General Purpose Timer
75 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
76 reg = <0x610 0x10>;
77 interrupts = <1 10 0>;
78 };
79
80 gpt2: timer@620 { // General Purpose Timer in GPIO mode
81 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
82 reg = <0x620 0x10>;
83 interrupts = <1 11 0>;
84 gpio-controller;
85 #gpio-cells = <2>;
86 };
87
88 gpt3: timer@630 { // General Purpose Timer in GPIO mode
89 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
90 reg = <0x630 0x10>;
91 interrupts = <1 12 0>;
92 gpio-controller;
93 #gpio-cells = <2>;
94 };
95
96 gpt4: timer@640 { // General Purpose Timer in GPIO mode
97 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
98 reg = <0x640 0x10>;
99 interrupts = <1 13 0>;
100 gpio-controller;
101 #gpio-cells = <2>;
102 };
103
104 gpt5: timer@650 { // General Purpose Timer in GPIO mode
105 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
106 reg = <0x650 0x10>;
107 interrupts = <1 14 0>;
108 gpio-controller;
109 #gpio-cells = <2>;
110 };
111
112 gpt6: timer@660 { // General Purpose Timer in GPIO mode
113 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
114 reg = <0x660 0x10>;
115 interrupts = <1 15 0>;
116 gpio-controller;
117 #gpio-cells = <2>;
118 };
119
120 gpt7: timer@670 { // General Purpose Timer in GPIO mode
121 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
122 reg = <0x670 0x10>;
123 interrupts = <1 16 0>;
124 gpio-controller;
125 #gpio-cells = <2>;
126 };
127
128 rtc@800 { // Real time clock
129 compatible = "fsl,mpc5200b-rtc","fsl,mpc5200-rtc";
130 reg = <0x800 0x100>;
131 interrupts = <1 5 0 1 6 0>;
132 };
133
134 can@900 {
135 compatible = "fsl,mpc5200b-mscan","fsl,mpc5200-mscan";
136 interrupts = <2 17 0>;
137 reg = <0x900 0x80>;
138 };
139
140 can@980 {
141 compatible = "fsl,mpc5200b-mscan","fsl,mpc5200-mscan";
142 interrupts = <2 18 0>;
143 reg = <0x980 0x80>;
144 };
145
146 gpio_simple: gpio@b00 {
147 compatible = "fsl,mpc5200b-gpio","fsl,mpc5200-gpio";
148 reg = <0xb00 0x40>;
149 interrupts = <1 7 0>;
150 gpio-controller;
151 #gpio-cells = <2>;
152 };
153
154 gpio_wkup: gpio@c00 {
155 compatible = "fsl,mpc5200b-gpio-wkup","fsl,mpc5200-gpio-wkup";
156 reg = <0xc00 0x40>;
157 interrupts = <1 8 0 0 3 0>;
158 gpio-controller;
159 #gpio-cells = <2>;
160 };
161
162 spi@f00 {
163 compatible = "fsl,mpc5200b-spi","fsl,mpc5200-spi";
164 reg = <0xf00 0x20>;
165 interrupts = <2 13 0 2 14 0>;
166 };
167
168 usb@1000 {
169 compatible = "fsl,mpc5200b-ohci","fsl,mpc5200-ohci","ohci-be";
170 reg = <0x1000 0xff>;
171 interrupts = <2 6 0>;
172 };
173
174 dma-controller@1200 {
175 compatible = "fsl,mpc5200b-bestcomm","fsl,mpc5200-bestcomm";
176 reg = <0x1200 0x80>;
177 interrupts = <3 0 0 3 1 0 3 2 0 3 3 0
178 3 4 0 3 5 0 3 6 0 3 7 0
179 3 8 0 3 9 0 3 10 0 3 11 0
180 3 12 0 3 13 0 3 14 0 3 15 0>;
181 };
182
183 xlb@1f00 {
184 compatible = "fsl,mpc5200b-xlb","fsl,mpc5200-xlb";
185 reg = <0x1f00 0x100>;
186 };
187
188 ac97@2000 { /* PSC1 is ac97 */
189 compatible = "fsl,mpc5200b-psc-ac97","fsl,mpc5200-psc-ac97";
190 cell-index = <0>;
191 reg = <0x2000 0x100>;
192 interrupts = <2 1 0>;
193 };
194
195 /* PSC2 port is used by CAN1/2 */
196
197 serial@2400 { /* PSC3 in UART mode */
198 compatible = "fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart";
199 cell-index = <2>;
200 reg = <0x2400 0x100>;
201 interrupts = <2 3 0>;
202 };
203
204 /* PSC4 is ??? */
205
206 /* PSC5 is ??? */
207
208 serial@2c00 { /* PSC6 in UART mode */
209 compatible = "fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart";
210 cell-index = <5>;
211 reg = <0x2c00 0x100>;
212 interrupts = <2 4 0>;
213 };
214
215 ethernet@3000 {
216 compatible = "fsl,mpc5200b-fec","fsl,mpc5200-fec";
217 reg = <0x3000 0x400>;
218 local-mac-address = [ 00 00 00 00 00 00 ];
219 interrupts = <2 5 0>;
220 phy-handle = <&phy0>;
221 };
222
223 mdio@3000 {
224 #address-cells = <1>;
225 #size-cells = <0>;
226 compatible = "fsl,mpc5200b-mdio","fsl,mpc5200-mdio";
227 reg = <0x3000 0x400>; // fec range, since we need to setup fec interrupts
228 interrupts = <2 5 0>; // these are for "mii command finished", not link changes & co.
229
230 phy0: ethernet-phy@0 {
231 reg = <0>;
232 };
233 };
234
235 ata@3a00 {
236 compatible = "fsl,mpc5200b-ata","fsl,mpc5200-ata";
237 reg = <0x3a00 0x100>;
238 interrupts = <2 7 0>;
239 };
240
241 i2c@3d00 {
242 #address-cells = <1>;
243 #size-cells = <0>;
244 compatible = "fsl,mpc5200b-i2c","fsl,mpc5200-i2c","fsl-i2c";
245 reg = <0x3d00 0x40>;
246 interrupts = <2 15 0>;
247 fsl5200-clocking;
248 };
249
250 i2c@3d40 {
251 #address-cells = <1>;
252 #size-cells = <0>;
253 compatible = "fsl,mpc5200b-i2c","fsl,mpc5200-i2c","fsl-i2c";
254 reg = <0x3d40 0x40>;
255 interrupts = <2 16 0>;
256 fsl5200-clocking;
257 rtc@51 {
258 compatible = "nxp,pcf8563";
259 reg = <0x51>;
260 };
261 eeprom@52 {
262 compatible = "at24,24c32";
263 reg = <0x52>;
264 };
265 };
266
267 sram@8000 {
268 compatible = "fsl,mpc5200b-sram","fsl,mpc5200-sram";
269 reg = <0x8000 0x4000>;
270 };
271 };
272
273 pci@f0000d00 {
274 #interrupt-cells = <1>;
275 #size-cells = <2>;
276 #address-cells = <3>;
277 device_type = "pci";
278 compatible = "fsl,mpc5200b-pci","fsl,mpc5200-pci";
279 reg = <0xf0000d00 0x100>;
280 interrupt-map-mask = <0xf800 0 0 7>;
281 interrupt-map = <0xc000 0 0 1 &mpc5200_pic 0 0 3 // 1st slot
282 0xc000 0 0 2 &mpc5200_pic 1 1 3
283 0xc000 0 0 3 &mpc5200_pic 1 2 3
284 0xc000 0 0 4 &mpc5200_pic 1 3 3
285
286 0xc800 0 0 1 &mpc5200_pic 1 1 3 // 2nd slot
287 0xc800 0 0 2 &mpc5200_pic 1 2 3
288 0xc800 0 0 3 &mpc5200_pic 1 3 3
289 0xc800 0 0 4 &mpc5200_pic 0 0 3>;
290 clock-frequency = <0>; // From boot loader
291 interrupts = <2 8 0 2 9 0 2 10 0>;
292 bus-range = <0 0>;
293 ranges = <0x42000000 0 0x80000000 0x80000000 0 0x20000000
294 0x02000000 0 0xa0000000 0xa0000000 0 0x10000000
295 0x01000000 0 0x00000000 0xb0000000 0 0x01000000>;
296 };
297
298 localbus {
299 compatible = "fsl,mpc5200b-lpb","fsl,mpc5200-lpb","simple-bus";
300
301 #address-cells = <2>;
302 #size-cells = <1>;
303
304 ranges = <0 0 0xfe000000 0x02000000
305 1 0 0xfc000000 0x02000000
306 2 0 0xfbe00000 0x00200000
307 3 0 0xf9e00000 0x02000000
308 4 0 0xf7e00000 0x02000000
309 5 0 0xe6000000 0x02000000
310 6 0 0xe8000000 0x02000000
311 7 0 0xea000000 0x02000000>;
312
313 flash@0,0 {
314 compatible = "cfi-flash";
315 reg = <0 0 0x02000000>;
316 bank-width = <4>;
317 #size-cells = <1>;
318 #address-cells = <1>;
319
320 partition@0 {
321 label = "ubootl";
322 reg = <0x00000000 0x00040000>;
323 };
324 partition@40000 {
325 label = "kernel";
326 reg = <0x00040000 0x001c0000>;
327 };
328 partition@200000 {
329 label = "jffs2";
330 reg = <0x00200000 0x01d00000>;
331 };
332 partition@1f00000 {
333 label = "uboot";
334 reg = <0x01f00000 0x00040000>;
335 };
336 partition@1f40000 {
337 label = "env";
338 reg = <0x01f40000 0x00040000>;
339 };
340 partition@1f80000 {
341 label = "oftree";
342 reg = <0x01f80000 0x00040000>;
343 };
344 partition@1fc0000 {
345 label = "space";
346 reg = <0x01fc0000 0x00040000>;
347 };
348 };
349
350 sram@2,0 {
351 compatible = "mtd-ram";
352 reg = <2 0 0x00200000>;
353 bank-width = <2>;
354 };
355
356 /*
357 * example snippets for FPGA
358 *
359 * fpga@3,0 {
360 * compatible = "fpga_driver";
361 * reg = <3 0 0x02000000>;
362 * bank-width = <4>;
363 * };
364 *
365 * fpga@4,0 {
366 * compatible = "fpga_driver";
367 * reg = <4 0 0x02000000>;
368 * bank-width = <4>;
369 * };
370 */
371
372 /*
373 * example snippets for free chipselects
374 *
375 * device@5,0 {
376 * compatible = "custom_driver";
377 * reg = <5 0 0x02000000>;
378 * };
379 *
380 * device@6,0 {
381 * compatible = "custom_driver";
382 * reg = <6 0 0x02000000>;
383 * };
384 *
385 * device@7,0 {
386 * compatible = "custom_driver";
387 * reg = <7 0 0x02000000>;
388 * };
389 */
390 };
391};
392
diff --git a/arch/powerpc/boot/dts/redwood.dts b/arch/powerpc/boot/dts/redwood.dts
new file mode 100644
index 000000000000..ad402c488741
--- /dev/null
+++ b/arch/powerpc/boot/dts/redwood.dts
@@ -0,0 +1,244 @@
1/*
2 * Device Tree Source for AMCC Redwood(460SX)
3 *
4 * Copyright 2008 AMCC <tmarri@amcc.com>
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without
8 * any warranty of any kind, whether express or implied.
9 */
10
11/dts-v1/;
12
13/ {
14 #address-cells = <2>;
15 #size-cells = <1>;
16 model = "amcc,redwood";
17 compatible = "amcc,redwood";
18 dcr-parent = <&{/cpus/cpu@0}>;
19
20 aliases {
21 ethernet0 = &EMAC0;
22 serial0 = &UART0;
23 };
24
25 cpus {
26 #address-cells = <1>;
27 #size-cells = <0>;
28
29 cpu@0 {
30 device_type = "cpu";
31 model = "PowerPC,460SX";
32 reg = <0x00000000>;
33 clock-frequency = <0>; /* Filled in by U-Boot */
34 timebase-frequency = <0>; /* Filled in by U-Boot */
35 i-cache-line-size = <32>;
36 d-cache-line-size = <32>;
37 i-cache-size = <32768>;
38 d-cache-size = <32768>;
39 dcr-controller;
40 dcr-access-method = "native";
41 };
42 };
43
44 memory {
45 device_type = "memory";
46 reg = <0x00000000 0x00000000 0x00000000>; /* Filled in by U-Boot */
47 };
48
49 UIC0: interrupt-controller0 {
50 compatible = "ibm,uic-460sx","ibm,uic";
51 interrupt-controller;
52 cell-index = <0>;
53 dcr-reg = <0x0c0 0x009>;
54 #address-cells = <0>;
55 #size-cells = <0>;
56 #interrupt-cells = <2>;
57 };
58
59 UIC1: interrupt-controller1 {
60 compatible = "ibm,uic-460sx","ibm,uic";
61 interrupt-controller;
62 cell-index = <1>;
63 dcr-reg = <0x0d0 0x009>;
64 #address-cells = <0>;
65 #size-cells = <0>;
66 #interrupt-cells = <2>;
67 interrupts = <0x1e 0x4 0x1f 0x4>; /* cascade */
68 interrupt-parent = <&UIC0>;
69 };
70
71 UIC2: interrupt-controller2 {
72 compatible = "ibm,uic-460sx","ibm,uic";
73 interrupt-controller;
74 cell-index = <2>;
75 dcr-reg = <0x0e0 0x009>;
76 #address-cells = <0>;
77 #size-cells = <0>;
78 #interrupt-cells = <2>;
79 interrupts = <0xa 0x4 0xb 0x4>; /* cascade */
80 interrupt-parent = <&UIC0>;
81 };
82
83 UIC3: interrupt-controller3 {
84 compatible = "ibm,uic-460sx","ibm,uic";
85 interrupt-controller;
86 cell-index = <3>;
87 dcr-reg = <0x0f0 0x009>;
88 #address-cells = <0>;
89 #size-cells = <0>;
90 #interrupt-cells = <2>;
91 interrupts = <0x10 0x4 0x11 0x4>; /* cascade */
92 interrupt-parent = <&UIC0>;
93 };
94
95 SDR0: sdr {
96 compatible = "ibm,sdr-460sx";
97 dcr-reg = <0x00e 0x002>;
98 };
99
100 CPR0: cpr {
101 compatible = "ibm,cpr-460sx";
102 dcr-reg = <0x00c 0x002>;
103 };
104
105 plb {
106 compatible = "ibm,plb-460sx", "ibm,plb4";
107 #address-cells = <2>;
108 #size-cells = <1>;
109 ranges;
110 clock-frequency = <0>; /* Filled in by U-Boot */
111
112 SDRAM0: sdram {
113 compatible = "ibm,sdram-460sx", "ibm,sdram-405gp";
114 dcr-reg = <0x010 0x002>;
115 };
116
117 MAL0: mcmal {
118 compatible = "ibm,mcmal-460sx", "ibm,mcmal2";
119 dcr-reg = <0x180 0x62>;
120 num-tx-chans = <4>;
121 num-rx-chans = <32>;
122 #address-cells = <1>;
123 #size-cells = <1>;
124 interrupt-parent = <&UIC1>;
125 interrupts = < /*TXEOB*/ 0x6 0x4
126 /*RXEOB*/ 0x7 0x4
127 /*SERR*/ 0x1 0x4
128 /*TXDE*/ 0x2 0x4
129 /*RXDE*/ 0x3 0x4
130 /*COAL TX0*/ 0x18 0x2
131 /*COAL TX1*/ 0x19 0x2
132 /*COAL TX2*/ 0x1a 0x2
133 /*COAL TX3*/ 0x1b 0x2
134 /*COAL RX0*/ 0x1c 0x2
135 /*COAL RX1*/ 0x1d 0x2
136 /*COAL RX2*/ 0x1e 0x2
137 /*COAL RX3*/ 0x1f 0x2>;
138 };
139
140 POB0: opb {
141 compatible = "ibm,opb-460sx", "ibm,opb";
142 #address-cells = <1>;
143 #size-cells = <1>;
144 ranges = <0xb0000000 0x00000004 0xb0000000 0x50000000>;
145 clock-frequency = <0>; /* Filled in by U-Boot */
146
147 EBC0: ebc {
148 compatible = "ibm,ebc-460sx", "ibm,ebc";
149 dcr-reg = <0x012 0x002>;
150 #address-cells = <2>;
151 #size-cells = <1>;
152 clock-frequency = <0>; /* Filled in by U-Boot */
153 /* ranges property is supplied by U-Boot */
154 interrupts = <0x6 0x4>;
155 interrupt-parent = <&UIC1>;
156
157 nor_flash@0,0 {
158 compatible = "amd,s29gl512n", "cfi-flash";
159 bank-width = <2>;
160 reg = <0x0000000 0x00000000 0x04000000>;
161 #address-cells = <1>;
162 #size-cells = <1>;
163 partition@0 {
164 label = "kernel";
165 reg = <0x00000000 0x001e0000>;
166 };
167 partition@1e0000 {
168 label = "dtb";
169 reg = <0x001e0000 0x00020000>;
170 };
171 partition@200000 {
172 label = "ramdisk";
173 reg = <0x00200000 0x01400000>;
174 };
175 partition@1600000 {
176 label = "jffs2";
177 reg = <0x01600000 0x00400000>;
178 };
179 partition@1a00000 {
180 label = "user";
181 reg = <0x01a00000 0x02560000>;
182 };
183 partition@3f60000 {
184 label = "env";
185 reg = <0x03f60000 0x00040000>;
186 };
187 partition@3fa0000 {
188 label = "u-boot";
189 reg = <0x03fa0000 0x00060000>;
190 };
191 };
192 };
193
194 UART0: serial@ef600200 {
195 device_type = "serial";
196 compatible = "ns16550";
197 reg = <0xef600200 0x00000008>;
198 virtual-reg = <0xef600200>;
199 clock-frequency = <0>; /* Filled in by U-Boot */
200 current-speed = <0>; /* Filled in by U-Boot */
201 interrupt-parent = <&UIC0>;
202 interrupts = <0x0 0x4>;
203 };
204
205 RGMII0: emac-rgmii@ef600900 {
206 compatible = "ibm,rgmii-460sx", "ibm,rgmii";
207 reg = <0xef600900 0x00000008>;
208 };
209
210 EMAC0: ethernet@ef600a00 {
211 device_type = "network";
212 compatible = "ibm,emac-460sx", "ibm,emac4";
213 interrupt-parent = <&EMAC0>;
214 interrupts = <0x0 0x1>;
215 #interrupt-cells = <1>;
216 #address-cells = <0>;
217 #size-cells = <0>;
218 interrupt-map = </*Status*/ 0x0 &UIC0 0x13 0x4
219 /*Wake*/ 0x1 &UIC2 0x1d 0x4>;
220 reg = <0xef600a00 0x00000070>;
221 local-mac-address = [000000000000]; /* Filled in by U-Boot */
222 mal-device = <&MAL0>;
223 mal-tx-channel = <0>;
224 mal-rx-channel = <0>;
225 cell-index = <0>;
226 max-frame-size = <9000>;
227 rx-fifo-size = <4096>;
228 tx-fifo-size = <2048>;
229 phy-mode = "rgmii";
230 phy-map = <0x00000000>;
231 rgmii-device = <&RGMII0>;
232 rgmii-channel = <0>;
233 has-inverted-stacr-oc;
234 has-new-stacr-staopc;
235 };
236
237 };
238
239 };
240 chosen {
241 linux,stdout-path = "/plb/opb/serial@ef600200";
242 };
243
244};
diff --git a/arch/powerpc/boot/dts/sbc8349.dts b/arch/powerpc/boot/dts/sbc8349.dts
index 8d365a57ebc1..a36dbbc48694 100644
--- a/arch/powerpc/boot/dts/sbc8349.dts
+++ b/arch/powerpc/boot/dts/sbc8349.dts
@@ -159,68 +159,76 @@
159 phy_type = "ulpi"; 159 phy_type = "ulpi";
160 }; 160 };
161 161
162 mdio@24520 {
163 #address-cells = <1>;
164 #size-cells = <0>;
165 compatible = "fsl,gianfar-mdio";
166 reg = <0x24520 0x20>;
167
168 phy0: ethernet-phy@19 {
169 interrupt-parent = <&ipic>;
170 interrupts = <20 0x8>;
171 reg = <0x19>;
172 device_type = "ethernet-phy";
173 };
174 phy1: ethernet-phy@1a {
175 interrupt-parent = <&ipic>;
176 interrupts = <21 0x8>;
177 reg = <0x1a>;
178 device_type = "ethernet-phy";
179 };
180 tbi0: tbi-phy@11 {
181 reg = <0x11>;
182 device_type = "tbi-phy";
183 };
184 };
185
186 mdio@25520 {
187 #address-cells = <1>;
188 #size-cells = <0>;
189 compatible = "fsl,gianfar-tbi";
190 reg = <0x25520 0x20>;
191
192 tbi1: tbi-phy@11 {
193 reg = <0x11>;
194 device_type = "tbi-phy";
195 };
196 };
197
198 enet0: ethernet@24000 { 162 enet0: ethernet@24000 {
163 #address-cells = <1>;
164 #size-cells = <1>;
199 cell-index = <0>; 165 cell-index = <0>;
200 device_type = "network"; 166 device_type = "network";
201 model = "TSEC"; 167 model = "TSEC";
202 compatible = "gianfar"; 168 compatible = "gianfar";
203 reg = <0x24000 0x1000>; 169 reg = <0x24000 0x1000>;
170 ranges = <0x0 0x24000 0x1000>;
204 local-mac-address = [ 00 00 00 00 00 00 ]; 171 local-mac-address = [ 00 00 00 00 00 00 ];
205 interrupts = <32 0x8 33 0x8 34 0x8>; 172 interrupts = <32 0x8 33 0x8 34 0x8>;
206 interrupt-parent = <&ipic>; 173 interrupt-parent = <&ipic>;
207 tbi-handle = <&tbi0>; 174 tbi-handle = <&tbi0>;
208 phy-handle = <&phy0>; 175 phy-handle = <&phy0>;
209 linux,network-index = <0>; 176 linux,network-index = <0>;
177
178 mdio@520 {
179 #address-cells = <1>;
180 #size-cells = <0>;
181 compatible = "fsl,gianfar-mdio";
182 reg = <0x520 0x20>;
183
184 phy0: ethernet-phy@19 {
185 interrupt-parent = <&ipic>;
186 interrupts = <20 0x8>;
187 reg = <0x19>;
188 device_type = "ethernet-phy";
189 };
190
191 phy1: ethernet-phy@1a {
192 interrupt-parent = <&ipic>;
193 interrupts = <21 0x8>;
194 reg = <0x1a>;
195 device_type = "ethernet-phy";
196 };
197
198 tbi0: tbi-phy@11 {
199 reg = <0x11>;
200 device_type = "tbi-phy";
201 };
202 };
210 }; 203 };
211 204
212 enet1: ethernet@25000 { 205 enet1: ethernet@25000 {
206 #address-cells = <1>;
207 #size-cells = <1>;
213 cell-index = <1>; 208 cell-index = <1>;
214 device_type = "network"; 209 device_type = "network";
215 model = "TSEC"; 210 model = "TSEC";
216 compatible = "gianfar"; 211 compatible = "gianfar";
217 reg = <0x25000 0x1000>; 212 reg = <0x25000 0x1000>;
213 ranges = <0x0 0x25000 0x1000>;
218 local-mac-address = [ 00 00 00 00 00 00 ]; 214 local-mac-address = [ 00 00 00 00 00 00 ];
219 interrupts = <35 0x8 36 0x8 37 0x8>; 215 interrupts = <35 0x8 36 0x8 37 0x8>;
220 interrupt-parent = <&ipic>; 216 interrupt-parent = <&ipic>;
221 tbi-handle = <&tbi1>; 217 tbi-handle = <&tbi1>;
222 phy-handle = <&phy1>; 218 phy-handle = <&phy1>;
223 linux,network-index = <1>; 219 linux,network-index = <1>;
220
221 mdio@520 {
222 #address-cells = <1>;
223 #size-cells = <0>;
224 compatible = "fsl,gianfar-tbi";
225 reg = <0x520 0x20>;
226
227 tbi1: tbi-phy@11 {
228 reg = <0x11>;
229 device_type = "tbi-phy";
230 };
231 };
224 }; 232 };
225 233
226 serial0: serial@4500 { 234 serial0: serial@4500 {
diff --git a/arch/powerpc/boot/dts/sbc8548.dts b/arch/powerpc/boot/dts/sbc8548.dts
index 2baf4a51f224..9c5079fec4f2 100644
--- a/arch/powerpc/boot/dts/sbc8548.dts
+++ b/arch/powerpc/boot/dts/sbc8548.dts
@@ -234,66 +234,72 @@
234 }; 234 };
235 }; 235 };
236 236
237 mdio@24520 {
238 #address-cells = <1>;
239 #size-cells = <0>;
240 compatible = "fsl,gianfar-mdio";
241 reg = <0x24520 0x20>;
242
243 phy0: ethernet-phy@19 {
244 interrupt-parent = <&mpic>;
245 interrupts = <0x6 0x1>;
246 reg = <0x19>;
247 device_type = "ethernet-phy";
248 };
249 phy1: ethernet-phy@1a {
250 interrupt-parent = <&mpic>;
251 interrupts = <0x7 0x1>;
252 reg = <0x1a>;
253 device_type = "ethernet-phy";
254 };
255 tbi0: tbi-phy@11 {
256 reg = <0x11>;
257 device_type = "tbi-phy";
258 };
259 };
260
261 mdio@25520 {
262 #address-cells = <1>;
263 #size-cells = <0>;
264 compatible = "fsl,gianfar-tbi";
265 reg = <0x25520 0x20>;
266
267 tbi1: tbi-phy@11 {
268 reg = <0x11>;
269 device_type = "tbi-phy";
270 };
271 };
272
273 enet0: ethernet@24000 { 237 enet0: ethernet@24000 {
238 #address-cells = <1>;
239 #size-cells = <1>;
274 cell-index = <0>; 240 cell-index = <0>;
275 device_type = "network"; 241 device_type = "network";
276 model = "eTSEC"; 242 model = "eTSEC";
277 compatible = "gianfar"; 243 compatible = "gianfar";
278 reg = <0x24000 0x1000>; 244 reg = <0x24000 0x1000>;
245 ranges = <0x0 0x24000 0x1000>;
279 local-mac-address = [ 00 00 00 00 00 00 ]; 246 local-mac-address = [ 00 00 00 00 00 00 ];
280 interrupts = <0x1d 0x2 0x1e 0x2 0x22 0x2>; 247 interrupts = <0x1d 0x2 0x1e 0x2 0x22 0x2>;
281 interrupt-parent = <&mpic>; 248 interrupt-parent = <&mpic>;
282 tbi-handle = <&tbi0>; 249 tbi-handle = <&tbi0>;
283 phy-handle = <&phy0>; 250 phy-handle = <&phy0>;
251
252 mdio@520 {
253 #address-cells = <1>;
254 #size-cells = <0>;
255 compatible = "fsl,gianfar-mdio";
256 reg = <0x520 0x20>;
257
258 phy0: ethernet-phy@19 {
259 interrupt-parent = <&mpic>;
260 interrupts = <0x6 0x1>;
261 reg = <0x19>;
262 device_type = "ethernet-phy";
263 };
264 phy1: ethernet-phy@1a {
265 interrupt-parent = <&mpic>;
266 interrupts = <0x7 0x1>;
267 reg = <0x1a>;
268 device_type = "ethernet-phy";
269 };
270 tbi0: tbi-phy@11 {
271 reg = <0x11>;
272 device_type = "tbi-phy";
273 };
274 };
284 }; 275 };
285 276
286 enet1: ethernet@25000 { 277 enet1: ethernet@25000 {
278 #address-cells = <1>;
279 #size-cells = <1>;
287 cell-index = <1>; 280 cell-index = <1>;
288 device_type = "network"; 281 device_type = "network";
289 model = "eTSEC"; 282 model = "eTSEC";
290 compatible = "gianfar"; 283 compatible = "gianfar";
291 reg = <0x25000 0x1000>; 284 reg = <0x25000 0x1000>;
285 ranges = <0x0 0x25000 0x1000>;
292 local-mac-address = [ 00 00 00 00 00 00 ]; 286 local-mac-address = [ 00 00 00 00 00 00 ];
293 interrupts = <0x23 0x2 0x24 0x2 0x28 0x2>; 287 interrupts = <0x23 0x2 0x24 0x2 0x28 0x2>;
294 interrupt-parent = <&mpic>; 288 interrupt-parent = <&mpic>;
295 tbi-handle = <&tbi1>; 289 tbi-handle = <&tbi1>;
296 phy-handle = <&phy1>; 290 phy-handle = <&phy1>;
291
292 mdio@520 {
293 #address-cells = <1>;
294 #size-cells = <0>;
295 compatible = "fsl,gianfar-tbi";
296 reg = <0x520 0x20>;
297
298 tbi1: tbi-phy@11 {
299 reg = <0x11>;
300 device_type = "tbi-phy";
301 };
302 };
297 }; 303 };
298 304
299 serial0: serial@4500 { 305 serial0: serial@4500 {
diff --git a/arch/powerpc/boot/dts/sbc8560.dts b/arch/powerpc/boot/dts/sbc8560.dts
index 01542f7062ab..b772405a9a0a 100644
--- a/arch/powerpc/boot/dts/sbc8560.dts
+++ b/arch/powerpc/boot/dts/sbc8560.dts
@@ -139,77 +139,83 @@
139 }; 139 };
140 }; 140 };
141 141
142 mdio@24520 {
143 #address-cells = <1>;
144 #size-cells = <0>;
145 compatible = "fsl,gianfar-mdio";
146 reg = <0x24520 0x20>;
147 phy0: ethernet-phy@19 {
148 interrupt-parent = <&mpic>;
149 interrupts = <0x6 0x1>;
150 reg = <0x19>;
151 device_type = "ethernet-phy";
152 };
153 phy1: ethernet-phy@1a {
154 interrupt-parent = <&mpic>;
155 interrupts = <0x7 0x1>;
156 reg = <0x1a>;
157 device_type = "ethernet-phy";
158 };
159 phy2: ethernet-phy@1b {
160 interrupt-parent = <&mpic>;
161 interrupts = <0x8 0x1>;
162 reg = <0x1b>;
163 device_type = "ethernet-phy";
164 };
165 phy3: ethernet-phy@1c {
166 interrupt-parent = <&mpic>;
167 interrupts = <0x8 0x1>;
168 reg = <0x1c>;
169 device_type = "ethernet-phy";
170 };
171 tbi0: tbi-phy@11 {
172 reg = <0x11>;
173 device_type = "tbi-phy";
174 };
175 };
176
177 mdio@25520 {
178 #address-cells = <1>;
179 #size-cells = <0>;
180 compatible = "fsl,gianfar-tbi";
181 reg = <0x25520 0x20>;
182
183 tbi1: tbi-phy@11 {
184 reg = <0x11>;
185 device_type = "tbi-phy";
186 };
187 };
188
189 enet0: ethernet@24000 { 142 enet0: ethernet@24000 {
143 #address-cells = <1>;
144 #size-cells = <1>;
190 cell-index = <0>; 145 cell-index = <0>;
191 device_type = "network"; 146 device_type = "network";
192 model = "TSEC"; 147 model = "TSEC";
193 compatible = "gianfar"; 148 compatible = "gianfar";
194 reg = <0x24000 0x1000>; 149 reg = <0x24000 0x1000>;
150 ranges = <0x0 0x24000 0x1000>;
195 local-mac-address = [ 00 00 00 00 00 00 ]; 151 local-mac-address = [ 00 00 00 00 00 00 ];
196 interrupts = <0x1d 0x2 0x1e 0x2 0x22 0x2>; 152 interrupts = <0x1d 0x2 0x1e 0x2 0x22 0x2>;
197 interrupt-parent = <&mpic>; 153 interrupt-parent = <&mpic>;
198 tbi-handle = <&tbi0>; 154 tbi-handle = <&tbi0>;
199 phy-handle = <&phy0>; 155 phy-handle = <&phy0>;
156
157 mdio@520 {
158 #address-cells = <1>;
159 #size-cells = <0>;
160 compatible = "fsl,gianfar-mdio";
161 reg = <0x520 0x20>;
162 phy0: ethernet-phy@19 {
163 interrupt-parent = <&mpic>;
164 interrupts = <0x6 0x1>;
165 reg = <0x19>;
166 device_type = "ethernet-phy";
167 };
168 phy1: ethernet-phy@1a {
169 interrupt-parent = <&mpic>;
170 interrupts = <0x7 0x1>;
171 reg = <0x1a>;
172 device_type = "ethernet-phy";
173 };
174 phy2: ethernet-phy@1b {
175 interrupt-parent = <&mpic>;
176 interrupts = <0x8 0x1>;
177 reg = <0x1b>;
178 device_type = "ethernet-phy";
179 };
180 phy3: ethernet-phy@1c {
181 interrupt-parent = <&mpic>;
182 interrupts = <0x8 0x1>;
183 reg = <0x1c>;
184 device_type = "ethernet-phy";
185 };
186 tbi0: tbi-phy@11 {
187 reg = <0x11>;
188 device_type = "tbi-phy";
189 };
190 };
200 }; 191 };
201 192
202 enet1: ethernet@25000 { 193 enet1: ethernet@25000 {
194 #address-cells = <1>;
195 #size-cells = <1>;
203 cell-index = <1>; 196 cell-index = <1>;
204 device_type = "network"; 197 device_type = "network";
205 model = "TSEC"; 198 model = "TSEC";
206 compatible = "gianfar"; 199 compatible = "gianfar";
207 reg = <0x25000 0x1000>; 200 reg = <0x25000 0x1000>;
201 ranges = <0x0 0x25000 0x1000>;
208 local-mac-address = [ 00 00 00 00 00 00 ]; 202 local-mac-address = [ 00 00 00 00 00 00 ];
209 interrupts = <0x23 0x2 0x24 0x2 0x28 0x2>; 203 interrupts = <0x23 0x2 0x24 0x2 0x28 0x2>;
210 interrupt-parent = <&mpic>; 204 interrupt-parent = <&mpic>;
211 tbi-handle = <&tbi1>; 205 tbi-handle = <&tbi1>;
212 phy-handle = <&phy1>; 206 phy-handle = <&phy1>;
207
208 mdio@520 {
209 #address-cells = <1>;
210 #size-cells = <0>;
211 compatible = "fsl,gianfar-tbi";
212 reg = <0x520 0x20>;
213
214 tbi1: tbi-phy@11 {
215 reg = <0x11>;
216 device_type = "tbi-phy";
217 };
218 };
213 }; 219 };
214 220
215 mpic: pic@40000 { 221 mpic: pic@40000 {
diff --git a/arch/powerpc/boot/dts/sbc8641d.dts b/arch/powerpc/boot/dts/sbc8641d.dts
index 36db981548e4..e3e914e78caa 100644
--- a/arch/powerpc/boot/dts/sbc8641d.dts
+++ b/arch/powerpc/boot/dts/sbc8641d.dts
@@ -192,132 +192,144 @@
192 }; 192 };
193 }; 193 };
194 194
195 mdio@24520 {
196 #address-cells = <1>;
197 #size-cells = <0>;
198 compatible = "fsl,gianfar-mdio";
199 reg = <0x24520 0x20>;
200
201 phy0: ethernet-phy@1f {
202 interrupt-parent = <&mpic>;
203 interrupts = <10 1>;
204 reg = <0x1f>;
205 device_type = "ethernet-phy";
206 };
207 phy1: ethernet-phy@0 {
208 interrupt-parent = <&mpic>;
209 interrupts = <10 1>;
210 reg = <0>;
211 device_type = "ethernet-phy";
212 };
213 phy2: ethernet-phy@1 {
214 interrupt-parent = <&mpic>;
215 interrupts = <10 1>;
216 reg = <1>;
217 device_type = "ethernet-phy";
218 };
219 phy3: ethernet-phy@2 {
220 interrupt-parent = <&mpic>;
221 interrupts = <10 1>;
222 reg = <2>;
223 device_type = "ethernet-phy";
224 };
225 tbi0: tbi-phy@11 {
226 reg = <0x11>;
227 device_type = "tbi-phy";
228 };
229 };
230
231 mdio@25520 {
232 #address-cells = <1>;
233 #size-cells = <0>;
234 compatible = "fsl,gianfar-tbi";
235 reg = <0x25520 0x20>;
236
237 tbi1: tbi-phy@11 {
238 reg = <0x11>;
239 device_type = "tbi-phy";
240 };
241 };
242
243 mdio@26520 {
244 #address-cells = <1>;
245 #size-cells = <0>;
246 compatible = "fsl,gianfar-tbi";
247 reg = <0x26520 0x20>;
248
249 tbi2: tbi-phy@11 {
250 reg = <0x11>;
251 device_type = "tbi-phy";
252 };
253 };
254
255 mdio@27520 {
256 #address-cells = <1>;
257 #size-cells = <0>;
258 compatible = "fsl,gianfar-tbi";
259 reg = <0x27520 0x20>;
260
261 tbi3: tbi-phy@11 {
262 reg = <0x11>;
263 device_type = "tbi-phy";
264 };
265 };
266
267 enet0: ethernet@24000 { 195 enet0: ethernet@24000 {
196 #address-cells = <1>;
197 #size-cells = <1>;
268 cell-index = <0>; 198 cell-index = <0>;
269 device_type = "network"; 199 device_type = "network";
270 model = "TSEC"; 200 model = "TSEC";
271 compatible = "gianfar"; 201 compatible = "gianfar";
272 reg = <0x24000 0x1000>; 202 reg = <0x24000 0x1000>;
203 ranges = <0x0 0x24000 0x1000>;
273 local-mac-address = [ 00 00 00 00 00 00 ]; 204 local-mac-address = [ 00 00 00 00 00 00 ];
274 interrupts = <29 2 30 2 34 2>; 205 interrupts = <29 2 30 2 34 2>;
275 interrupt-parent = <&mpic>; 206 interrupt-parent = <&mpic>;
276 tbi-handle = <&tbi0>; 207 tbi-handle = <&tbi0>;
277 phy-handle = <&phy0>; 208 phy-handle = <&phy0>;
278 phy-connection-type = "rgmii-id"; 209 phy-connection-type = "rgmii-id";
210
211 mdio@520 {
212 #address-cells = <1>;
213 #size-cells = <0>;
214 compatible = "fsl,gianfar-mdio";
215 reg = <0x520 0x20>;
216
217 phy0: ethernet-phy@1f {
218 interrupt-parent = <&mpic>;
219 interrupts = <10 1>;
220 reg = <0x1f>;
221 device_type = "ethernet-phy";
222 };
223 phy1: ethernet-phy@0 {
224 interrupt-parent = <&mpic>;
225 interrupts = <10 1>;
226 reg = <0>;
227 device_type = "ethernet-phy";
228 };
229 phy2: ethernet-phy@1 {
230 interrupt-parent = <&mpic>;
231 interrupts = <10 1>;
232 reg = <1>;
233 device_type = "ethernet-phy";
234 };
235 phy3: ethernet-phy@2 {
236 interrupt-parent = <&mpic>;
237 interrupts = <10 1>;
238 reg = <2>;
239 device_type = "ethernet-phy";
240 };
241 tbi0: tbi-phy@11 {
242 reg = <0x11>;
243 device_type = "tbi-phy";
244 };
245 };
279 }; 246 };
280 247
281 enet1: ethernet@25000 { 248 enet1: ethernet@25000 {
249 #address-cells = <1>;
250 #size-cells = <1>;
282 cell-index = <1>; 251 cell-index = <1>;
283 device_type = "network"; 252 device_type = "network";
284 model = "TSEC"; 253 model = "TSEC";
285 compatible = "gianfar"; 254 compatible = "gianfar";
286 reg = <0x25000 0x1000>; 255 reg = <0x25000 0x1000>;
256 ranges = <0x0 0x25000 0x1000>;
287 local-mac-address = [ 00 00 00 00 00 00 ]; 257 local-mac-address = [ 00 00 00 00 00 00 ];
288 interrupts = <35 2 36 2 40 2>; 258 interrupts = <35 2 36 2 40 2>;
289 interrupt-parent = <&mpic>; 259 interrupt-parent = <&mpic>;
290 tbi-handle = <&tbi1>; 260 tbi-handle = <&tbi1>;
291 phy-handle = <&phy1>; 261 phy-handle = <&phy1>;
292 phy-connection-type = "rgmii-id"; 262 phy-connection-type = "rgmii-id";
263
264 mdio@520 {
265 #address-cells = <1>;
266 #size-cells = <0>;
267 compatible = "fsl,gianfar-tbi";
268 reg = <0x520 0x20>;
269
270 tbi1: tbi-phy@11 {
271 reg = <0x11>;
272 device_type = "tbi-phy";
273 };
274 };
293 }; 275 };
294 276
295 enet2: ethernet@26000 { 277 enet2: ethernet@26000 {
278 #address-cells = <1>;
279 #size-cells = <1>;
296 cell-index = <2>; 280 cell-index = <2>;
297 device_type = "network"; 281 device_type = "network";
298 model = "TSEC"; 282 model = "TSEC";
299 compatible = "gianfar"; 283 compatible = "gianfar";
300 reg = <0x26000 0x1000>; 284 reg = <0x26000 0x1000>;
285 ranges = <0x0 0x26000 0x1000>;
301 local-mac-address = [ 00 00 00 00 00 00 ]; 286 local-mac-address = [ 00 00 00 00 00 00 ];
302 interrupts = <31 2 32 2 33 2>; 287 interrupts = <31 2 32 2 33 2>;
303 interrupt-parent = <&mpic>; 288 interrupt-parent = <&mpic>;
304 tbi-handle = <&tbi2>; 289 tbi-handle = <&tbi2>;
305 phy-handle = <&phy2>; 290 phy-handle = <&phy2>;
306 phy-connection-type = "rgmii-id"; 291 phy-connection-type = "rgmii-id";
292
293 mdio@520 {
294 #address-cells = <1>;
295 #size-cells = <0>;
296 compatible = "fsl,gianfar-tbi";
297 reg = <0x520 0x20>;
298
299 tbi2: tbi-phy@11 {
300 reg = <0x11>;
301 device_type = "tbi-phy";
302 };
303 };
307 }; 304 };
308 305
309 enet3: ethernet@27000 { 306 enet3: ethernet@27000 {
307 #address-cells = <1>;
308 #size-cells = <1>;
310 cell-index = <3>; 309 cell-index = <3>;
311 device_type = "network"; 310 device_type = "network";
312 model = "TSEC"; 311 model = "TSEC";
313 compatible = "gianfar"; 312 compatible = "gianfar";
314 reg = <0x27000 0x1000>; 313 reg = <0x27000 0x1000>;
314 ranges = <0x0 0x27000 0x1000>;
315 local-mac-address = [ 00 00 00 00 00 00 ]; 315 local-mac-address = [ 00 00 00 00 00 00 ];
316 interrupts = <37 2 38 2 39 2>; 316 interrupts = <37 2 38 2 39 2>;
317 interrupt-parent = <&mpic>; 317 interrupt-parent = <&mpic>;
318 tbi-handle = <&tbi3>; 318 tbi-handle = <&tbi3>;
319 phy-handle = <&phy3>; 319 phy-handle = <&phy3>;
320 phy-connection-type = "rgmii-id"; 320 phy-connection-type = "rgmii-id";
321
322 mdio@520 {
323 #address-cells = <1>;
324 #size-cells = <0>;
325 compatible = "fsl,gianfar-tbi";
326 reg = <0x520 0x20>;
327
328 tbi3: tbi-phy@11 {
329 reg = <0x11>;
330 device_type = "tbi-phy";
331 };
332 };
321 }; 333 };
322 334
323 serial0: serial@4500 { 335 serial0: serial@4500 {
diff --git a/arch/powerpc/boot/dts/socrates.dts b/arch/powerpc/boot/dts/socrates.dts
new file mode 100644
index 000000000000..b8d0fc6f0042
--- /dev/null
+++ b/arch/powerpc/boot/dts/socrates.dts
@@ -0,0 +1,338 @@
1/*
2 * Device Tree Source for the Socrates board (MPC8544).
3 *
4 * Copyright (c) 2008 Emcraft Systems.
5 * Sergei Poselenov, <sposelenov@emcraft.com>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 */
12
13/dts-v1/;
14
15/ {
16 model = "abb,socrates";
17 compatible = "abb,socrates";
18 #address-cells = <1>;
19 #size-cells = <1>;
20
21 aliases {
22 ethernet0 = &enet0;
23 ethernet1 = &enet1;
24 serial0 = &serial0;
25 serial1 = &serial1;
26 pci0 = &pci0;
27 };
28
29 cpus {
30 #address-cells = <1>;
31 #size-cells = <0>;
32
33 PowerPC,8544@0 {
34 device_type = "cpu";
35 reg = <0>;
36 d-cache-line-size = <32>;
37 i-cache-line-size = <32>;
38 d-cache-size = <0x8000>; // L1, 32K
39 i-cache-size = <0x8000>; // L1, 32K
40 timebase-frequency = <0>;
41 bus-frequency = <0>;
42 clock-frequency = <0>;
43 next-level-cache = <&L2>;
44 };
45 };
46
47 memory {
48 device_type = "memory";
49 reg = <0x00000000 0x00000000>; // Filled in by U-Boot
50 };
51
52 soc8544@e0000000 {
53 #address-cells = <1>;
54 #size-cells = <1>;
55
56 ranges = <0x00000000 0xe0000000 0x00100000>;
57 reg = <0xe0000000 0x00001000>; // CCSRBAR 1M
58 bus-frequency = <0>; // Filled in by U-Boot
59 compatible = "fsl,mpc8544-immr", "simple-bus";
60
61 memory-controller@2000 {
62 compatible = "fsl,mpc8544-memory-controller";
63 reg = <0x2000 0x1000>;
64 interrupt-parent = <&mpic>;
65 interrupts = <18 2>;
66 };
67
68 L2: l2-cache-controller@20000 {
69 compatible = "fsl,mpc8544-l2-cache-controller";
70 reg = <0x20000 0x1000>;
71 cache-line-size = <32>;
72 cache-size = <0x40000>; // L2, 256K
73 interrupt-parent = <&mpic>;
74 interrupts = <16 2>;
75 };
76
77 i2c@3000 {
78 #address-cells = <1>;
79 #size-cells = <0>;
80 cell-index = <0>;
81 compatible = "fsl-i2c";
82 reg = <0x3000 0x100>;
83 interrupts = <43 2>;
84 interrupt-parent = <&mpic>;
85 dfsrr;
86
87 dtt@28 {
88 compatible = "winbond,w83782d";
89 reg = <0x28>;
90 };
91 rtc@32 {
92 compatible = "epson,rx8025";
93 reg = <0x32>;
94 interrupts = <7 1>;
95 interrupt-parent = <&mpic>;
96 };
97 dtt@4c {
98 compatible = "dallas,ds75";
99 reg = <0x4c>;
100 };
101 ts@4a {
102 compatible = "ti,tsc2003";
103 reg = <0x4a>;
104 interrupt-parent = <&mpic>;
105 interrupts = <8 1>;
106 };
107 };
108
109 i2c@3100 {
110 #address-cells = <1>;
111 #size-cells = <0>;
112 cell-index = <1>;
113 compatible = "fsl-i2c";
114 reg = <0x3100 0x100>;
115 interrupts = <43 2>;
116 interrupt-parent = <&mpic>;
117 dfsrr;
118 };
119
120 enet0: ethernet@24000 {
121 #address-cells = <1>;
122 #size-cells = <1>;
123 cell-index = <0>;
124 device_type = "network";
125 model = "eTSEC";
126 compatible = "gianfar";
127 reg = <0x24000 0x1000>;
128 ranges = <0x0 0x24000 0x1000>;
129 local-mac-address = [ 00 00 00 00 00 00 ];
130 interrupts = <29 2 30 2 34 2>;
131 interrupt-parent = <&mpic>;
132 phy-handle = <&phy0>;
133 tbi-handle = <&tbi0>;
134 phy-connection-type = "rgmii-id";
135
136 mdio@520 {
137 #address-cells = <1>;
138 #size-cells = <0>;
139 compatible = "fsl,gianfar-mdio";
140 reg = <0x520 0x20>;
141
142 phy0: ethernet-phy@0 {
143 interrupt-parent = <&mpic>;
144 interrupts = <0 1>;
145 reg = <0>;
146 };
147 phy1: ethernet-phy@1 {
148 interrupt-parent = <&mpic>;
149 interrupts = <0 1>;
150 reg = <1>;
151 };
152 tbi0: tbi-phy@11 {
153 reg = <0x11>;
154 };
155 };
156 };
157
158 enet1: ethernet@26000 {
159 #address-cells = <1>;
160 #size-cells = <1>;
161 cell-index = <1>;
162 device_type = "network";
163 model = "eTSEC";
164 compatible = "gianfar";
165 reg = <0x26000 0x1000>;
166 ranges = <0x0 0x26000 0x1000>;
167 local-mac-address = [ 00 00 00 00 00 00 ];
168 interrupts = <31 2 32 2 33 2>;
169 interrupt-parent = <&mpic>;
170 phy-handle = <&phy1>;
171 tbi-handle = <&tbi1>;
172 phy-connection-type = "rgmii-id";
173
174 mdio@520 {
175 #address-cells = <1>;
176 #size-cells = <0>;
177 compatible = "fsl,gianfar-tbi";
178 reg = <0x520 0x20>;
179
180 tbi1: tbi-phy@11 {
181 reg = <0x11>;
182 };
183 };
184 };
185
186 serial0: serial@4500 {
187 cell-index = <0>;
188 device_type = "serial";
189 compatible = "ns16550";
190 reg = <0x4500 0x100>;
191 clock-frequency = <0>;
192 interrupts = <42 2>;
193 interrupt-parent = <&mpic>;
194 };
195
196 serial1: serial@4600 {
197 cell-index = <1>;
198 device_type = "serial";
199 compatible = "ns16550";
200 reg = <0x4600 0x100>;
201 clock-frequency = <0>;
202 interrupts = <42 2>;
203 interrupt-parent = <&mpic>;
204 };
205
206 global-utilities@e0000 { //global utilities block
207 compatible = "fsl,mpc8548-guts";
208 reg = <0xe0000 0x1000>;
209 fsl,has-rstcr;
210 };
211
212 mpic: pic@40000 {
213 interrupt-controller;
214 #address-cells = <0>;
215 #interrupt-cells = <2>;
216 reg = <0x40000 0x40000>;
217 compatible = "chrp,open-pic";
218 device_type = "open-pic";
219 };
220 };
221
222
223 localbus {
224 compatible = "fsl,mpc8544-localbus",
225 "fsl,pq3-localbus",
226 "simple-bus";
227 #address-cells = <2>;
228 #size-cells = <1>;
229 reg = <0xe0005000 0x40>;
230
231 ranges = <0 0 0xfc000000 0x04000000
232 2 0 0xc8000000 0x04000000
233 3 0 0xc0000000 0x00100000
234 >; /* Overwritten by U-Boot */
235
236 nor_flash@0,0 {
237 compatible = "amd,s29gl256n", "cfi-flash";
238 bank-width = <2>;
239 reg = <0x0 0x000000 0x4000000>;
240 #address-cells = <1>;
241 #size-cells = <1>;
242 partition@0 {
243 label = "kernel";
244 reg = <0x0 0x1e0000>;
245 read-only;
246 };
247 partition@1e0000 {
248 label = "dtb";
249 reg = <0x1e0000 0x20000>;
250 };
251 partition@200000 {
252 label = "root";
253 reg = <0x200000 0x200000>;
254 };
255 partition@400000 {
256 label = "user";
257 reg = <0x400000 0x3b80000>;
258 };
259 partition@3f80000 {
260 label = "env";
261 reg = <0x3f80000 0x40000>;
262 read-only;
263 };
264 partition@3fc0000 {
265 label = "u-boot";
266 reg = <0x3fc0000 0x40000>;
267 read-only;
268 };
269 };
270
271 display@2,0 {
272 compatible = "fujitsu,lime";
273 reg = <2 0x0 0x4000000>;
274 interrupt-parent = <&mpic>;
275 interrupts = <6 1>;
276 };
277
278 fpga_pic: fpga-pic@3,10 {
279 compatible = "abb,socrates-fpga-pic";
280 reg = <3 0x10 0x10>;
281 interrupt-controller;
282 /* IRQs 2, 10, 11, active low, level-sensitive */
283 interrupts = <2 1 10 1 11 1>;
284 interrupt-parent = <&mpic>;
285 #interrupt-cells = <3>;
286 };
287
288 spi@3,60 {
289 compatible = "abb,socrates-spi";
290 reg = <3 0x60 0x10>;
291 interrupts = <8 4 0>; // number, type, routing
292 interrupt-parent = <&fpga_pic>;
293 };
294
295 nand@3,70 {
296 compatible = "abb,socrates-nand";
297 reg = <3 0x70 0x04>;
298 bank-width = <1>;
299 #address-cells = <1>;
300 #size-cells = <1>;
301 data@0 {
302 label = "data";
303 reg = <0x0 0x40000000>;
304 };
305 };
306
307 can@3,100 {
308 compatible = "philips,sja1000";
309 reg = <3 0x100 0x80>;
310 interrupts = <2 8 1>; // number, type, routing
311 interrupt-parent = <&fpga_pic>;
312 };
313 };
314
315 pci0: pci@e0008000 {
316 cell-index = <0>;
317 #interrupt-cells = <1>;
318 #size-cells = <2>;
319 #address-cells = <3>;
320 compatible = "fsl,mpc8540-pci";
321 device_type = "pci";
322 reg = <0xe0008000 0x1000>;
323 clock-frequency = <66666666>;
324
325 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
326 interrupt-map = <
327 /* IDSEL 0x11 */
328 0x8800 0x0 0x0 1 &mpic 5 1
329 /* IDSEL 0x12 */
330 0x9000 0x0 0x0 1 &mpic 4 1>;
331 interrupt-parent = <&mpic>;
332 interrupts = <24 2>;
333 bus-range = <0x0 0x0>;
334 ranges = <0x02000000 0x0 0x80000000 0x80000000 0x0 0x20000000
335 0x01000000 0x0 0x00000000 0xe2000000 0x0 0x01000000>;
336 };
337
338};
diff --git a/arch/powerpc/boot/dts/stx_gp3_8560.dts b/arch/powerpc/boot/dts/stx_gp3_8560.dts
index fff33fe6efc6..8b173957fb5f 100644
--- a/arch/powerpc/boot/dts/stx_gp3_8560.dts
+++ b/arch/powerpc/boot/dts/stx_gp3_8560.dts
@@ -124,66 +124,72 @@
124 }; 124 };
125 }; 125 };
126 126
127 mdio@24520 {
128 #address-cells = <1>;
129 #size-cells = <0>;
130 compatible = "fsl,gianfar-mdio";
131 reg = <0x24520 0x20>;
132
133 phy2: ethernet-phy@2 {
134 interrupt-parent = <&mpic>;
135 interrupts = <5 4>;
136 reg = <2>;
137 device_type = "ethernet-phy";
138 };
139 phy4: ethernet-phy@4 {
140 interrupt-parent = <&mpic>;
141 interrupts = <5 4>;
142 reg = <4>;
143 device_type = "ethernet-phy";
144 };
145 tbi0: tbi-phy@11 {
146 reg = <0x11>;
147 device_type = "tbi-phy";
148 };
149 };
150
151 mdio@25520 {
152 #address-cells = <1>;
153 #size-cells = <0>;
154 compatible = "fsl,gianfar-tbi";
155 reg = <0x25520 0x20>;
156
157 tbi1: tbi-phy@11 {
158 reg = <0x11>;
159 device_type = "tbi-phy";
160 };
161 };
162
163 enet0: ethernet@24000 { 127 enet0: ethernet@24000 {
128 #address-cells = <1>;
129 #size-cells = <1>;
164 cell-index = <0>; 130 cell-index = <0>;
165 device_type = "network"; 131 device_type = "network";
166 model = "TSEC"; 132 model = "TSEC";
167 compatible = "gianfar"; 133 compatible = "gianfar";
168 reg = <0x24000 0x1000>; 134 reg = <0x24000 0x1000>;
135 ranges = <0x0 0x24000 0x1000>;
169 local-mac-address = [ 00 00 00 00 00 00 ]; 136 local-mac-address = [ 00 00 00 00 00 00 ];
170 interrupts = <29 2 30 2 34 2>; 137 interrupts = <29 2 30 2 34 2>;
171 interrupt-parent = <&mpic>; 138 interrupt-parent = <&mpic>;
172 tbi-handle = <&tbi0>; 139 tbi-handle = <&tbi0>;
173 phy-handle = <&phy2>; 140 phy-handle = <&phy2>;
141
142 mdio@520 {
143 #address-cells = <1>;
144 #size-cells = <0>;
145 compatible = "fsl,gianfar-mdio";
146 reg = <0x520 0x20>;
147
148 phy2: ethernet-phy@2 {
149 interrupt-parent = <&mpic>;
150 interrupts = <5 4>;
151 reg = <2>;
152 device_type = "ethernet-phy";
153 };
154 phy4: ethernet-phy@4 {
155 interrupt-parent = <&mpic>;
156 interrupts = <5 4>;
157 reg = <4>;
158 device_type = "ethernet-phy";
159 };
160 tbi0: tbi-phy@11 {
161 reg = <0x11>;
162 device_type = "tbi-phy";
163 };
164 };
174 }; 165 };
175 166
176 enet1: ethernet@25000 { 167 enet1: ethernet@25000 {
168 #address-cells = <1>;
169 #size-cells = <1>;
177 cell-index = <1>; 170 cell-index = <1>;
178 device_type = "network"; 171 device_type = "network";
179 model = "TSEC"; 172 model = "TSEC";
180 compatible = "gianfar"; 173 compatible = "gianfar";
181 reg = <0x25000 0x1000>; 174 reg = <0x25000 0x1000>;
175 ranges = <0x0 0x25000 0x1000>;
182 local-mac-address = [ 00 00 00 00 00 00 ]; 176 local-mac-address = [ 00 00 00 00 00 00 ];
183 interrupts = <35 2 36 2 40 2>; 177 interrupts = <35 2 36 2 40 2>;
184 interrupt-parent = <&mpic>; 178 interrupt-parent = <&mpic>;
185 tbi-handle = <&tbi1>; 179 tbi-handle = <&tbi1>;
186 phy-handle = <&phy4>; 180 phy-handle = <&phy4>;
181
182 mdio@520 {
183 #address-cells = <1>;
184 #size-cells = <0>;
185 compatible = "fsl,gianfar-tbi";
186 reg = <0x520 0x20>;
187
188 tbi1: tbi-phy@11 {
189 reg = <0x11>;
190 device_type = "tbi-phy";
191 };
192 };
187 }; 193 };
188 194
189 mpic: pic@40000 { 195 mpic: pic@40000 {
diff --git a/arch/powerpc/boot/dts/tqm5200.dts b/arch/powerpc/boot/dts/tqm5200.dts
index 906302e26a62..c9590b58b7b0 100644
--- a/arch/powerpc/boot/dts/tqm5200.dts
+++ b/arch/powerpc/boot/dts/tqm5200.dts
@@ -17,6 +17,7 @@
17 compatible = "tqc,tqm5200"; 17 compatible = "tqc,tqm5200";
18 #address-cells = <1>; 18 #address-cells = <1>;
19 #size-cells = <1>; 19 #size-cells = <1>;
20 interrupt-parent = <&mpc5200_pic>;
20 21
21 cpus { 22 cpus {
22 #address-cells = <1>; 23 #address-cells = <1>;
@@ -66,36 +67,33 @@
66 compatible = "fsl,mpc5200-gpt"; 67 compatible = "fsl,mpc5200-gpt";
67 reg = <0x600 0x10>; 68 reg = <0x600 0x10>;
68 interrupts = <1 9 0>; 69 interrupts = <1 9 0>;
69 interrupt-parent = <&mpc5200_pic>;
70 fsl,has-wdt; 70 fsl,has-wdt;
71 }; 71 };
72 72
73 can@900 { 73 can@900 {
74 compatible = "fsl,mpc5200-mscan"; 74 compatible = "fsl,mpc5200-mscan";
75 interrupts = <2 17 0>; 75 interrupts = <2 17 0>;
76 interrupt-parent = <&mpc5200_pic>;
77 reg = <0x900 0x80>; 76 reg = <0x900 0x80>;
78 }; 77 };
79 78
80 can@980 { 79 can@980 {
81 compatible = "fsl,mpc5200-mscan"; 80 compatible = "fsl,mpc5200-mscan";
82 interrupts = <2 18 0>; 81 interrupts = <2 18 0>;
83 interrupt-parent = <&mpc5200_pic>;
84 reg = <0x980 0x80>; 82 reg = <0x980 0x80>;
85 }; 83 };
86 84
87 gpio@b00 { 85 gpio_simple: gpio@b00 {
88 compatible = "fsl,mpc5200-gpio"; 86 compatible = "fsl,mpc5200-gpio";
89 reg = <0xb00 0x40>; 87 reg = <0xb00 0x40>;
90 interrupts = <1 7 0>; 88 interrupts = <1 7 0>;
91 interrupt-parent = <&mpc5200_pic>; 89 gpio-controller;
90 #gpio-cells = <2>;
92 }; 91 };
93 92
94 usb@1000 { 93 usb@1000 {
95 compatible = "fsl,mpc5200-ohci","ohci-be"; 94 compatible = "fsl,mpc5200-ohci","ohci-be";
96 reg = <0x1000 0xff>; 95 reg = <0x1000 0xff>;
97 interrupts = <2 6 0>; 96 interrupts = <2 6 0>;
98 interrupt-parent = <&mpc5200_pic>;
99 }; 97 };
100 98
101 dma-controller@1200 { 99 dma-controller@1200 {
@@ -105,7 +103,6 @@
105 3 4 0 3 5 0 3 6 0 3 7 0 103 3 4 0 3 5 0 3 6 0 3 7 0
106 3 8 0 3 9 0 3 10 0 3 11 0 104 3 8 0 3 9 0 3 10 0 3 11 0
107 3 12 0 3 13 0 3 14 0 3 15 0>; 105 3 12 0 3 13 0 3 14 0 3 15 0>;
108 interrupt-parent = <&mpc5200_pic>;
109 }; 106 };
110 107
111 xlb@1f00 { 108 xlb@1f00 {
@@ -114,39 +111,28 @@
114 }; 111 };
115 112
116 serial@2000 { // PSC1 113 serial@2000 { // PSC1
117 device_type = "serial";
118 compatible = "fsl,mpc5200-psc-uart"; 114 compatible = "fsl,mpc5200-psc-uart";
119 port-number = <0>; // Logical port assignment
120 reg = <0x2000 0x100>; 115 reg = <0x2000 0x100>;
121 interrupts = <2 1 0>; 116 interrupts = <2 1 0>;
122 interrupt-parent = <&mpc5200_pic>;
123 }; 117 };
124 118
125 serial@2200 { // PSC2 119 serial@2200 { // PSC2
126 device_type = "serial";
127 compatible = "fsl,mpc5200-psc-uart"; 120 compatible = "fsl,mpc5200-psc-uart";
128 port-number = <1>; // Logical port assignment
129 reg = <0x2200 0x100>; 121 reg = <0x2200 0x100>;
130 interrupts = <2 2 0>; 122 interrupts = <2 2 0>;
131 interrupt-parent = <&mpc5200_pic>;
132 }; 123 };
133 124
134 serial@2400 { // PSC3 125 serial@2400 { // PSC3
135 device_type = "serial";
136 compatible = "fsl,mpc5200-psc-uart"; 126 compatible = "fsl,mpc5200-psc-uart";
137 port-number = <2>; // Logical port assignment
138 reg = <0x2400 0x100>; 127 reg = <0x2400 0x100>;
139 interrupts = <2 3 0>; 128 interrupts = <2 3 0>;
140 interrupt-parent = <&mpc5200_pic>;
141 }; 129 };
142 130
143 ethernet@3000 { 131 ethernet@3000 {
144 device_type = "network";
145 compatible = "fsl,mpc5200-fec"; 132 compatible = "fsl,mpc5200-fec";
146 reg = <0x3000 0x400>; 133 reg = <0x3000 0x400>;
147 local-mac-address = [ 00 00 00 00 00 00 ]; 134 local-mac-address = [ 00 00 00 00 00 00 ];
148 interrupts = <2 5 0>; 135 interrupts = <2 5 0>;
149 interrupt-parent = <&mpc5200_pic>;
150 phy-handle = <&phy0>; 136 phy-handle = <&phy0>;
151 }; 137 };
152 138
@@ -156,10 +142,8 @@
156 compatible = "fsl,mpc5200-mdio"; 142 compatible = "fsl,mpc5200-mdio";
157 reg = <0x3000 0x400>; // fec range, since we need to setup fec interrupts 143 reg = <0x3000 0x400>; // fec range, since we need to setup fec interrupts
158 interrupts = <2 5 0>; // these are for "mii command finished", not link changes & co. 144 interrupts = <2 5 0>; // these are for "mii command finished", not link changes & co.
159 interrupt-parent = <&mpc5200_pic>;
160 145
161 phy0: ethernet-phy@0 { 146 phy0: ethernet-phy@0 {
162 device_type = "ethernet-phy";
163 reg = <0>; 147 reg = <0>;
164 }; 148 };
165 }; 149 };
@@ -168,7 +152,6 @@
168 compatible = "fsl,mpc5200-ata"; 152 compatible = "fsl,mpc5200-ata";
169 reg = <0x3a00 0x100>; 153 reg = <0x3a00 0x100>;
170 interrupts = <2 7 0>; 154 interrupts = <2 7 0>;
171 interrupt-parent = <&mpc5200_pic>;
172 }; 155 };
173 156
174 i2c@3d40 { 157 i2c@3d40 {
@@ -177,7 +160,6 @@
177 compatible = "fsl,mpc5200-i2c","fsl-i2c"; 160 compatible = "fsl,mpc5200-i2c","fsl-i2c";
178 reg = <0x3d40 0x40>; 161 reg = <0x3d40 0x40>;
179 interrupts = <2 16 0>; 162 interrupts = <2 16 0>;
180 interrupt-parent = <&mpc5200_pic>;
181 fsl5200-clocking; 163 fsl5200-clocking;
182 164
183 rtc@68 { 165 rtc@68 {
@@ -192,9 +174,8 @@
192 }; 174 };
193 }; 175 };
194 176
195 lpb { 177 localbus {
196 model = "fsl,lpb"; 178 compatible = "fsl,mpc5200-lpb","simple-bus";
197 compatible = "fsl,lpb";
198 #address-cells = <2>; 179 #address-cells = <2>;
199 #size-cells = <1>; 180 #size-cells = <1>;
200 ranges = <0 0 0xfc000000 0x02000000>; 181 ranges = <0 0 0xfc000000 0x02000000>;
@@ -223,7 +204,6 @@
223 0xc000 0 0 4 &mpc5200_pic 0 0 3>; 204 0xc000 0 0 4 &mpc5200_pic 0 0 3>;
224 clock-frequency = <0>; // From boot loader 205 clock-frequency = <0>; // From boot loader
225 interrupts = <2 8 0 2 9 0 2 10 0>; 206 interrupts = <2 8 0 2 9 0 2 10 0>;
226 interrupt-parent = <&mpc5200_pic>;
227 bus-range = <0 0>; 207 bus-range = <0 0>;
228 ranges = <0x42000000 0 0x80000000 0x80000000 0 0x10000000 208 ranges = <0x42000000 0 0x80000000 0x80000000 0 0x10000000
229 0x02000000 0 0x90000000 0x90000000 0 0x10000000 209 0x02000000 0 0x90000000 0x90000000 0 0x10000000
diff --git a/arch/powerpc/boot/dts/tqm8540.dts b/arch/powerpc/boot/dts/tqm8540.dts
index a693f01c21aa..ac9413a29f9f 100644
--- a/arch/powerpc/boot/dts/tqm8540.dts
+++ b/arch/powerpc/boot/dts/tqm8540.dts
@@ -84,6 +84,11 @@
84 interrupt-parent = <&mpic>; 84 interrupt-parent = <&mpic>;
85 dfsrr; 85 dfsrr;
86 86
87 dtt@50 {
88 compatible = "national,lm75";
89 reg = <0x50>;
90 };
91
87 rtc@68 { 92 rtc@68 {
88 compatible = "dallas,ds1337"; 93 compatible = "dallas,ds1337";
89 reg = <0x68>; 94 reg = <0x68>;
@@ -131,94 +136,103 @@
131 }; 136 };
132 }; 137 };
133 138
134 mdio@24520 {
135 #address-cells = <1>;
136 #size-cells = <0>;
137 compatible = "fsl,gianfar-mdio";
138 reg = <0x24520 0x20>;
139
140 phy1: ethernet-phy@1 {
141 interrupt-parent = <&mpic>;
142 interrupts = <8 1>;
143 reg = <1>;
144 device_type = "ethernet-phy";
145 };
146 phy2: ethernet-phy@2 {
147 interrupt-parent = <&mpic>;
148 interrupts = <8 1>;
149 reg = <2>;
150 device_type = "ethernet-phy";
151 };
152 phy3: ethernet-phy@3 {
153 interrupt-parent = <&mpic>;
154 interrupts = <8 1>;
155 reg = <3>;
156 device_type = "ethernet-phy";
157 };
158 tbi0: tbi-phy@11 {
159 reg = <0x11>;
160 device_type = "tbi-phy";
161 };
162 };
163
164 mdio@25520 {
165 #address-cells = <1>;
166 #size-cells = <0>;
167 compatible = "fsl,gianfar-tbi";
168 reg = <0x25520 0x20>;
169
170 tbi1: tbi-phy@11 {
171 reg = <0x11>;
172 device_type = "tbi-phy";
173 };
174 };
175
176 mdio@26520 {
177 #address-cells = <1>;
178 #size-cells = <0>;
179 compatible = "fsl,gianfar-tbi";
180 reg = <0x26520 0x20>;
181
182 tbi2: tbi-phy@11 {
183 reg = <0x11>;
184 device_type = "tbi-phy";
185 };
186 };
187
188 enet0: ethernet@24000 { 139 enet0: ethernet@24000 {
140 #address-cells = <1>;
141 #size-cells = <1>;
189 cell-index = <0>; 142 cell-index = <0>;
190 device_type = "network"; 143 device_type = "network";
191 model = "TSEC"; 144 model = "TSEC";
192 compatible = "gianfar"; 145 compatible = "gianfar";
193 reg = <0x24000 0x1000>; 146 reg = <0x24000 0x1000>;
147 ranges = <0x0 0x24000 0x1000>;
194 local-mac-address = [ 00 00 00 00 00 00 ]; 148 local-mac-address = [ 00 00 00 00 00 00 ];
195 interrupts = <29 2 30 2 34 2>; 149 interrupts = <29 2 30 2 34 2>;
196 interrupt-parent = <&mpic>; 150 interrupt-parent = <&mpic>;
197 phy-handle = <&phy2>; 151 phy-handle = <&phy2>;
152
153 mdio@520 {
154 #address-cells = <1>;
155 #size-cells = <0>;
156 compatible = "fsl,gianfar-mdio";
157 reg = <0x520 0x20>;
158
159 phy1: ethernet-phy@1 {
160 interrupt-parent = <&mpic>;
161 interrupts = <8 1>;
162 reg = <1>;
163 device_type = "ethernet-phy";
164 };
165 phy2: ethernet-phy@2 {
166 interrupt-parent = <&mpic>;
167 interrupts = <8 1>;
168 reg = <2>;
169 device_type = "ethernet-phy";
170 };
171 phy3: ethernet-phy@3 {
172 interrupt-parent = <&mpic>;
173 interrupts = <8 1>;
174 reg = <3>;
175 device_type = "ethernet-phy";
176 };
177 tbi0: tbi-phy@11 {
178 reg = <0x11>;
179 device_type = "tbi-phy";
180 };
181 };
198 }; 182 };
199 183
200 enet1: ethernet@25000 { 184 enet1: ethernet@25000 {
185 #address-cells = <1>;
186 #size-cells = <1>;
201 cell-index = <1>; 187 cell-index = <1>;
202 device_type = "network"; 188 device_type = "network";
203 model = "TSEC"; 189 model = "TSEC";
204 compatible = "gianfar"; 190 compatible = "gianfar";
205 reg = <0x25000 0x1000>; 191 reg = <0x25000 0x1000>;
192 ranges = <0x0 0x25000 0x1000>;
206 local-mac-address = [ 00 00 00 00 00 00 ]; 193 local-mac-address = [ 00 00 00 00 00 00 ];
207 interrupts = <35 2 36 2 40 2>; 194 interrupts = <35 2 36 2 40 2>;
208 interrupt-parent = <&mpic>; 195 interrupt-parent = <&mpic>;
209 phy-handle = <&phy1>; 196 phy-handle = <&phy1>;
197
198 mdio@520 {
199 #address-cells = <1>;
200 #size-cells = <0>;
201 compatible = "fsl,gianfar-tbi";
202 reg = <0x520 0x20>;
203
204 tbi1: tbi-phy@11 {
205 reg = <0x11>;
206 device_type = "tbi-phy";
207 };
208 };
210 }; 209 };
211 210
212 enet2: ethernet@26000 { 211 enet2: ethernet@26000 {
212 #address-cells = <1>;
213 #size-cells = <1>;
213 cell-index = <2>; 214 cell-index = <2>;
214 device_type = "network"; 215 device_type = "network";
215 model = "FEC"; 216 model = "FEC";
216 compatible = "gianfar"; 217 compatible = "gianfar";
217 reg = <0x26000 0x1000>; 218 reg = <0x26000 0x1000>;
219 ranges = <0x0 0x26000 0x1000>;
218 local-mac-address = [ 00 00 00 00 00 00 ]; 220 local-mac-address = [ 00 00 00 00 00 00 ];
219 interrupts = <41 2>; 221 interrupts = <41 2>;
220 interrupt-parent = <&mpic>; 222 interrupt-parent = <&mpic>;
221 phy-handle = <&phy3>; 223 phy-handle = <&phy3>;
224
225 mdio@520 {
226 #address-cells = <1>;
227 #size-cells = <0>;
228 compatible = "fsl,gianfar-tbi";
229 reg = <0x520 0x20>;
230
231 tbi2: tbi-phy@11 {
232 reg = <0x11>;
233 device_type = "tbi-phy";
234 };
235 };
222 }; 236 };
223 237
224 serial0: serial@4500 { 238 serial0: serial@4500 {
diff --git a/arch/powerpc/boot/dts/tqm8541.dts b/arch/powerpc/boot/dts/tqm8541.dts
index 9e3f5f0dde20..c71bb5dd5e5e 100644
--- a/arch/powerpc/boot/dts/tqm8541.dts
+++ b/arch/powerpc/boot/dts/tqm8541.dts
@@ -83,6 +83,11 @@
83 interrupt-parent = <&mpic>; 83 interrupt-parent = <&mpic>;
84 dfsrr; 84 dfsrr;
85 85
86 dtt@50 {
87 compatible = "national,lm75";
88 reg = <0x50>;
89 };
90
86 rtc@68 { 91 rtc@68 {
87 compatible = "dallas,ds1337"; 92 compatible = "dallas,ds1337";
88 reg = <0x68>; 93 reg = <0x68>;
@@ -130,72 +135,78 @@
130 }; 135 };
131 }; 136 };
132 137
133 mdio@24520 {
134 #address-cells = <1>;
135 #size-cells = <0>;
136 compatible = "fsl,gianfar-mdio";
137 reg = <0x24520 0x20>;
138
139 phy1: ethernet-phy@1 {
140 interrupt-parent = <&mpic>;
141 interrupts = <8 1>;
142 reg = <1>;
143 device_type = "ethernet-phy";
144 };
145 phy2: ethernet-phy@2 {
146 interrupt-parent = <&mpic>;
147 interrupts = <8 1>;
148 reg = <2>;
149 device_type = "ethernet-phy";
150 };
151 phy3: ethernet-phy@3 {
152 interrupt-parent = <&mpic>;
153 interrupts = <8 1>;
154 reg = <3>;
155 device_type = "ethernet-phy";
156 };
157 tbi0: tbi-phy@11 {
158 reg = <0x11>;
159 device_type = "tbi-phy";
160 };
161 };
162
163 mdio@25520 {
164 #address-cells = <1>;
165 #size-cells = <0>;
166 compatible = "fsl,gianfar-tbi";
167 reg = <0x25520 0x20>;
168
169 tbi1: tbi-phy@11 {
170 reg = <0x11>;
171 device_type = "tbi-phy";
172 };
173 };
174
175 enet0: ethernet@24000 { 138 enet0: ethernet@24000 {
139 #address-cells = <1>;
140 #size-cells = <1>;
176 cell-index = <0>; 141 cell-index = <0>;
177 device_type = "network"; 142 device_type = "network";
178 model = "TSEC"; 143 model = "TSEC";
179 compatible = "gianfar"; 144 compatible = "gianfar";
180 reg = <0x24000 0x1000>; 145 reg = <0x24000 0x1000>;
146 ranges = <0x0 0x24000 0x1000>;
181 local-mac-address = [ 00 00 00 00 00 00 ]; 147 local-mac-address = [ 00 00 00 00 00 00 ];
182 interrupts = <29 2 30 2 34 2>; 148 interrupts = <29 2 30 2 34 2>;
183 interrupt-parent = <&mpic>; 149 interrupt-parent = <&mpic>;
184 tbi-handle = <&tbi0>; 150 tbi-handle = <&tbi0>;
185 phy-handle = <&phy2>; 151 phy-handle = <&phy2>;
152
153 mdio@520 {
154 #address-cells = <1>;
155 #size-cells = <0>;
156 compatible = "fsl,gianfar-mdio";
157 reg = <0x520 0x20>;
158
159 phy1: ethernet-phy@1 {
160 interrupt-parent = <&mpic>;
161 interrupts = <8 1>;
162 reg = <1>;
163 device_type = "ethernet-phy";
164 };
165 phy2: ethernet-phy@2 {
166 interrupt-parent = <&mpic>;
167 interrupts = <8 1>;
168 reg = <2>;
169 device_type = "ethernet-phy";
170 };
171 phy3: ethernet-phy@3 {
172 interrupt-parent = <&mpic>;
173 interrupts = <8 1>;
174 reg = <3>;
175 device_type = "ethernet-phy";
176 };
177 tbi0: tbi-phy@11 {
178 reg = <0x11>;
179 device_type = "tbi-phy";
180 };
181 };
186 }; 182 };
187 183
188 enet1: ethernet@25000 { 184 enet1: ethernet@25000 {
185 #address-cells = <1>;
186 #size-cells = <1>;
189 cell-index = <1>; 187 cell-index = <1>;
190 device_type = "network"; 188 device_type = "network";
191 model = "TSEC"; 189 model = "TSEC";
192 compatible = "gianfar"; 190 compatible = "gianfar";
193 reg = <0x25000 0x1000>; 191 reg = <0x25000 0x1000>;
192 ranges = <0x0 0x25000 0x1000>;
194 local-mac-address = [ 00 00 00 00 00 00 ]; 193 local-mac-address = [ 00 00 00 00 00 00 ];
195 interrupts = <35 2 36 2 40 2>; 194 interrupts = <35 2 36 2 40 2>;
196 interrupt-parent = <&mpic>; 195 interrupt-parent = <&mpic>;
197 tbi-handle = <&tbi1>; 196 tbi-handle = <&tbi1>;
198 phy-handle = <&phy1>; 197 phy-handle = <&phy1>;
198
199 mdio@520 {
200 #address-cells = <1>;
201 #size-cells = <0>;
202 compatible = "fsl,gianfar-tbi";
203 reg = <0x520 0x20>;
204
205 tbi1: tbi-phy@11 {
206 reg = <0x11>;
207 device_type = "tbi-phy";
208 };
209 };
199 }; 210 };
200 211
201 serial0: serial@4500 { 212 serial0: serial@4500 {
diff --git a/arch/powerpc/boot/dts/tqm8548-bigflash.dts b/arch/powerpc/boot/dts/tqm8548-bigflash.dts
index 15086eb65c50..28b1a95257cd 100644
--- a/arch/powerpc/boot/dts/tqm8548-bigflash.dts
+++ b/arch/powerpc/boot/dts/tqm8548-bigflash.dts
@@ -85,6 +85,11 @@
85 interrupt-parent = <&mpic>; 85 interrupt-parent = <&mpic>;
86 dfsrr; 86 dfsrr;
87 87
88 dtt@50 {
89 compatible = "national,lm75";
90 reg = <0x50>;
91 };
92
88 rtc@68 { 93 rtc@68 {
89 compatible = "dallas,ds1337"; 94 compatible = "dallas,ds1337";
90 reg = <0x68>; 95 reg = <0x68>;
@@ -143,134 +148,146 @@
143 }; 148 };
144 }; 149 };
145 150
146 mdio@24520 {
147 #address-cells = <1>;
148 #size-cells = <0>;
149 compatible = "fsl,gianfar-mdio";
150 reg = <0x24520 0x20>;
151
152 phy1: ethernet-phy@0 {
153 interrupt-parent = <&mpic>;
154 interrupts = <8 1>;
155 reg = <1>;
156 device_type = "ethernet-phy";
157 };
158 phy2: ethernet-phy@1 {
159 interrupt-parent = <&mpic>;
160 interrupts = <8 1>;
161 reg = <2>;
162 device_type = "ethernet-phy";
163 };
164 phy3: ethernet-phy@3 {
165 interrupt-parent = <&mpic>;
166 interrupts = <8 1>;
167 reg = <3>;
168 device_type = "ethernet-phy";
169 };
170 phy4: ethernet-phy@4 {
171 interrupt-parent = <&mpic>;
172 interrupts = <8 1>;
173 reg = <4>;
174 device_type = "ethernet-phy";
175 };
176 phy5: ethernet-phy@5 {
177 interrupt-parent = <&mpic>;
178 interrupts = <8 1>;
179 reg = <5>;
180 device_type = "ethernet-phy";
181 };
182 tbi0: tbi-phy@11 {
183 reg = <0x11>;
184 device_type = "tbi-phy";
185 };
186 };
187
188 mdio@25520 {
189 #address-cells = <1>;
190 #size-cells = <0>;
191 compatible = "fsl,gianfar-tbi";
192 reg = <0x25520 0x20>;
193
194 tbi1: tbi-phy@11 {
195 reg = <0x11>;
196 device_type = "tbi-phy";
197 };
198 };
199
200 mdio@26520 {
201 #address-cells = <1>;
202 #size-cells = <0>;
203 compatible = "fsl,gianfar-tbi";
204 reg = <0x26520 0x20>;
205
206 tbi2: tbi-phy@11 {
207 reg = <0x11>;
208 device_type = "tbi-phy";
209 };
210 };
211
212 mdio@27520 {
213 #address-cells = <1>;
214 #size-cells = <0>;
215 compatible = "fsl,gianfar-tbi";
216 reg = <0x27520 0x20>;
217
218 tbi3: tbi-phy@11 {
219 reg = <0x11>;
220 device_type = "tbi-phy";
221 };
222 };
223
224 enet0: ethernet@24000 { 151 enet0: ethernet@24000 {
152 #address-cells = <1>;
153 #size-cells = <1>;
225 cell-index = <0>; 154 cell-index = <0>;
226 device_type = "network"; 155 device_type = "network";
227 model = "eTSEC"; 156 model = "eTSEC";
228 compatible = "gianfar"; 157 compatible = "gianfar";
229 reg = <0x24000 0x1000>; 158 reg = <0x24000 0x1000>;
159 ranges = <0x0 0x24000 0x1000>;
230 local-mac-address = [ 00 00 00 00 00 00 ]; 160 local-mac-address = [ 00 00 00 00 00 00 ];
231 interrupts = <29 2 30 2 34 2>; 161 interrupts = <29 2 30 2 34 2>;
232 interrupt-parent = <&mpic>; 162 interrupt-parent = <&mpic>;
233 tbi-handle = <&tbi0>; 163 tbi-handle = <&tbi0>;
234 phy-handle = <&phy2>; 164 phy-handle = <&phy2>;
165
166 mdio@520 {
167 #address-cells = <1>;
168 #size-cells = <0>;
169 compatible = "fsl,gianfar-mdio";
170 reg = <0x520 0x20>;
171
172 phy1: ethernet-phy@0 {
173 interrupt-parent = <&mpic>;
174 interrupts = <8 1>;
175 reg = <1>;
176 device_type = "ethernet-phy";
177 };
178 phy2: ethernet-phy@1 {
179 interrupt-parent = <&mpic>;
180 interrupts = <8 1>;
181 reg = <2>;
182 device_type = "ethernet-phy";
183 };
184 phy3: ethernet-phy@3 {
185 interrupt-parent = <&mpic>;
186 interrupts = <8 1>;
187 reg = <3>;
188 device_type = "ethernet-phy";
189 };
190 phy4: ethernet-phy@4 {
191 interrupt-parent = <&mpic>;
192 interrupts = <8 1>;
193 reg = <4>;
194 device_type = "ethernet-phy";
195 };
196 phy5: ethernet-phy@5 {
197 interrupt-parent = <&mpic>;
198 interrupts = <8 1>;
199 reg = <5>;
200 device_type = "ethernet-phy";
201 };
202 tbi0: tbi-phy@11 {
203 reg = <0x11>;
204 device_type = "tbi-phy";
205 };
206 };
235 }; 207 };
236 208
237 enet1: ethernet@25000 { 209 enet1: ethernet@25000 {
210 #address-cells = <1>;
211 #size-cells = <1>;
238 cell-index = <1>; 212 cell-index = <1>;
239 device_type = "network"; 213 device_type = "network";
240 model = "eTSEC"; 214 model = "eTSEC";
241 compatible = "gianfar"; 215 compatible = "gianfar";
242 reg = <0x25000 0x1000>; 216 reg = <0x25000 0x1000>;
217 ranges = <0x0 0x25000 0x1000>;
243 local-mac-address = [ 00 00 00 00 00 00 ]; 218 local-mac-address = [ 00 00 00 00 00 00 ];
244 interrupts = <35 2 36 2 40 2>; 219 interrupts = <35 2 36 2 40 2>;
245 interrupt-parent = <&mpic>; 220 interrupt-parent = <&mpic>;
246 tbi-handle = <&tbi1>; 221 tbi-handle = <&tbi1>;
247 phy-handle = <&phy1>; 222 phy-handle = <&phy1>;
223
224 mdio@520 {
225 #address-cells = <1>;
226 #size-cells = <0>;
227 compatible = "fsl,gianfar-tbi";
228 reg = <0x520 0x20>;
229
230 tbi1: tbi-phy@11 {
231 reg = <0x11>;
232 device_type = "tbi-phy";
233 };
234 };
248 }; 235 };
249 236
250 enet2: ethernet@26000 { 237 enet2: ethernet@26000 {
238 #address-cells = <1>;
239 #size-cells = <1>;
251 cell-index = <2>; 240 cell-index = <2>;
252 device_type = "network"; 241 device_type = "network";
253 model = "eTSEC"; 242 model = "eTSEC";
254 compatible = "gianfar"; 243 compatible = "gianfar";
255 reg = <0x26000 0x1000>; 244 reg = <0x26000 0x1000>;
245 ranges = <0x0 0x26000 0x1000>;
256 local-mac-address = [ 00 00 00 00 00 00 ]; 246 local-mac-address = [ 00 00 00 00 00 00 ];
257 interrupts = <31 2 32 2 33 2>; 247 interrupts = <31 2 32 2 33 2>;
258 interrupt-parent = <&mpic>; 248 interrupt-parent = <&mpic>;
259 tbi-handle = <&tbi2>; 249 tbi-handle = <&tbi2>;
260 phy-handle = <&phy3>; 250 phy-handle = <&phy3>;
251
252 mdio@520 {
253 #address-cells = <1>;
254 #size-cells = <0>;
255 compatible = "fsl,gianfar-tbi";
256 reg = <0x520 0x20>;
257
258 tbi2: tbi-phy@11 {
259 reg = <0x11>;
260 device_type = "tbi-phy";
261 };
262 };
261 }; 263 };
262 264
263 enet3: ethernet@27000 { 265 enet3: ethernet@27000 {
266 #address-cells = <1>;
267 #size-cells = <1>;
264 cell-index = <3>; 268 cell-index = <3>;
265 device_type = "network"; 269 device_type = "network";
266 model = "eTSEC"; 270 model = "eTSEC";
267 compatible = "gianfar"; 271 compatible = "gianfar";
268 reg = <0x27000 0x1000>; 272 reg = <0x27000 0x1000>;
273 ranges = <0x0 0x27000 0x1000>;
269 local-mac-address = [ 00 00 00 00 00 00 ]; 274 local-mac-address = [ 00 00 00 00 00 00 ];
270 interrupts = <37 2 38 2 39 2>; 275 interrupts = <37 2 38 2 39 2>;
271 interrupt-parent = <&mpic>; 276 interrupt-parent = <&mpic>;
272 tbi-handle = <&tbi3>; 277 tbi-handle = <&tbi3>;
273 phy-handle = <&phy4>; 278 phy-handle = <&phy4>;
279
280 mdio@520 {
281 #address-cells = <1>;
282 #size-cells = <0>;
283 compatible = "fsl,gianfar-tbi";
284 reg = <0x520 0x20>;
285
286 tbi3: tbi-phy@11 {
287 reg = <0x11>;
288 device_type = "tbi-phy";
289 };
290 };
274 }; 291 };
275 292
276 serial0: serial@4500 { 293 serial0: serial@4500 {
@@ -365,14 +382,14 @@
365 can0@2,0 { 382 can0@2,0 {
366 compatible = "intel,82527"; // Bosch CC770 383 compatible = "intel,82527"; // Bosch CC770
367 reg = <2 0x0 0x100>; 384 reg = <2 0x0 0x100>;
368 interrupts = <4 0>; 385 interrupts = <4 1>;
369 interrupt-parent = <&mpic>; 386 interrupt-parent = <&mpic>;
370 }; 387 };
371 388
372 can1@2,100 { 389 can1@2,100 {
373 compatible = "intel,82527"; // Bosch CC770 390 compatible = "intel,82527"; // Bosch CC770
374 reg = <2 0x100 0x100>; 391 reg = <2 0x100 0x100>;
375 interrupts = <4 0>; 392 interrupts = <4 1>;
376 interrupt-parent = <&mpic>; 393 interrupt-parent = <&mpic>;
377 }; 394 };
378 395
diff --git a/arch/powerpc/boot/dts/tqm8548.dts b/arch/powerpc/boot/dts/tqm8548.dts
index b7b65f5e79b6..826fb622cd3c 100644
--- a/arch/powerpc/boot/dts/tqm8548.dts
+++ b/arch/powerpc/boot/dts/tqm8548.dts
@@ -85,6 +85,11 @@
85 interrupt-parent = <&mpic>; 85 interrupt-parent = <&mpic>;
86 dfsrr; 86 dfsrr;
87 87
88 dtt@50 {
89 compatible = "national,lm75";
90 reg = <0x50>;
91 };
92
88 rtc@68 { 93 rtc@68 {
89 compatible = "dallas,ds1337"; 94 compatible = "dallas,ds1337";
90 reg = <0x68>; 95 reg = <0x68>;
@@ -143,134 +148,146 @@
143 }; 148 };
144 }; 149 };
145 150
146 mdio@24520 {
147 #address-cells = <1>;
148 #size-cells = <0>;
149 compatible = "fsl,gianfar-mdio";
150 reg = <0x24520 0x20>;
151
152 phy1: ethernet-phy@0 {
153 interrupt-parent = <&mpic>;
154 interrupts = <8 1>;
155 reg = <1>;
156 device_type = "ethernet-phy";
157 };
158 phy2: ethernet-phy@1 {
159 interrupt-parent = <&mpic>;
160 interrupts = <8 1>;
161 reg = <2>;
162 device_type = "ethernet-phy";
163 };
164 phy3: ethernet-phy@3 {
165 interrupt-parent = <&mpic>;
166 interrupts = <8 1>;
167 reg = <3>;
168 device_type = "ethernet-phy";
169 };
170 phy4: ethernet-phy@4 {
171 interrupt-parent = <&mpic>;
172 interrupts = <8 1>;
173 reg = <4>;
174 device_type = "ethernet-phy";
175 };
176 phy5: ethernet-phy@5 {
177 interrupt-parent = <&mpic>;
178 interrupts = <8 1>;
179 reg = <5>;
180 device_type = "ethernet-phy";
181 };
182 tbi0: tbi-phy@11 {
183 reg = <0x11>;
184 device_type = "tbi-phy";
185 };
186 };
187
188 mdio@25520 {
189 #address-cells = <1>;
190 #size-cells = <0>;
191 compatible = "fsl,gianfar-tbi";
192 reg = <0x25520 0x20>;
193
194 tbi1: tbi-phy@11 {
195 reg = <0x11>;
196 device_type = "tbi-phy";
197 };
198 };
199
200 mdio@26520 {
201 #address-cells = <1>;
202 #size-cells = <0>;
203 compatible = "fsl,gianfar-tbi";
204 reg = <0x26520 0x20>;
205
206 tbi2: tbi-phy@11 {
207 reg = <0x11>;
208 device_type = "tbi-phy";
209 };
210 };
211
212 mdio@27520 {
213 #address-cells = <1>;
214 #size-cells = <0>;
215 compatible = "fsl,gianfar-tbi";
216 reg = <0x27520 0x20>;
217
218 tbi3: tbi-phy@11 {
219 reg = <0x11>;
220 device_type = "tbi-phy";
221 };
222 };
223
224 enet0: ethernet@24000 { 151 enet0: ethernet@24000 {
152 #address-cells = <1>;
153 #size-cells = <1>;
225 cell-index = <0>; 154 cell-index = <0>;
226 device_type = "network"; 155 device_type = "network";
227 model = "eTSEC"; 156 model = "eTSEC";
228 compatible = "gianfar"; 157 compatible = "gianfar";
229 reg = <0x24000 0x1000>; 158 reg = <0x24000 0x1000>;
159 ranges = <0x0 0x24000 0x1000>;
230 local-mac-address = [ 00 00 00 00 00 00 ]; 160 local-mac-address = [ 00 00 00 00 00 00 ];
231 interrupts = <29 2 30 2 34 2>; 161 interrupts = <29 2 30 2 34 2>;
232 interrupt-parent = <&mpic>; 162 interrupt-parent = <&mpic>;
233 tbi-handle = <&tbi0>; 163 tbi-handle = <&tbi0>;
234 phy-handle = <&phy2>; 164 phy-handle = <&phy2>;
165
166 mdio@520 {
167 #address-cells = <1>;
168 #size-cells = <0>;
169 compatible = "fsl,gianfar-mdio";
170 reg = <0x520 0x20>;
171
172 phy1: ethernet-phy@0 {
173 interrupt-parent = <&mpic>;
174 interrupts = <8 1>;
175 reg = <1>;
176 device_type = "ethernet-phy";
177 };
178 phy2: ethernet-phy@1 {
179 interrupt-parent = <&mpic>;
180 interrupts = <8 1>;
181 reg = <2>;
182 device_type = "ethernet-phy";
183 };
184 phy3: ethernet-phy@3 {
185 interrupt-parent = <&mpic>;
186 interrupts = <8 1>;
187 reg = <3>;
188 device_type = "ethernet-phy";
189 };
190 phy4: ethernet-phy@4 {
191 interrupt-parent = <&mpic>;
192 interrupts = <8 1>;
193 reg = <4>;
194 device_type = "ethernet-phy";
195 };
196 phy5: ethernet-phy@5 {
197 interrupt-parent = <&mpic>;
198 interrupts = <8 1>;
199 reg = <5>;
200 device_type = "ethernet-phy";
201 };
202 tbi0: tbi-phy@11 {
203 reg = <0x11>;
204 device_type = "tbi-phy";
205 };
206 };
235 }; 207 };
236 208
237 enet1: ethernet@25000 { 209 enet1: ethernet@25000 {
210 #address-cells = <1>;
211 #size-cells = <1>;
238 cell-index = <1>; 212 cell-index = <1>;
239 device_type = "network"; 213 device_type = "network";
240 model = "eTSEC"; 214 model = "eTSEC";
241 compatible = "gianfar"; 215 compatible = "gianfar";
242 reg = <0x25000 0x1000>; 216 reg = <0x25000 0x1000>;
217 ranges = <0x0 0x25000 0x1000>;
243 local-mac-address = [ 00 00 00 00 00 00 ]; 218 local-mac-address = [ 00 00 00 00 00 00 ];
244 interrupts = <35 2 36 2 40 2>; 219 interrupts = <35 2 36 2 40 2>;
245 interrupt-parent = <&mpic>; 220 interrupt-parent = <&mpic>;
246 tbi-handle = <&tbi1>; 221 tbi-handle = <&tbi1>;
247 phy-handle = <&phy1>; 222 phy-handle = <&phy1>;
223
224 mdio@520 {
225 #address-cells = <1>;
226 #size-cells = <0>;
227 compatible = "fsl,gianfar-tbi";
228 reg = <0x520 0x20>;
229
230 tbi1: tbi-phy@11 {
231 reg = <0x11>;
232 device_type = "tbi-phy";
233 };
234 };
248 }; 235 };
249 236
250 enet2: ethernet@26000 { 237 enet2: ethernet@26000 {
238 #address-cells = <1>;
239 #size-cells = <1>;
251 cell-index = <2>; 240 cell-index = <2>;
252 device_type = "network"; 241 device_type = "network";
253 model = "eTSEC"; 242 model = "eTSEC";
254 compatible = "gianfar"; 243 compatible = "gianfar";
255 reg = <0x26000 0x1000>; 244 reg = <0x26000 0x1000>;
245 ranges = <0x0 0x26000 0x1000>;
256 local-mac-address = [ 00 00 00 00 00 00 ]; 246 local-mac-address = [ 00 00 00 00 00 00 ];
257 interrupts = <31 2 32 2 33 2>; 247 interrupts = <31 2 32 2 33 2>;
258 interrupt-parent = <&mpic>; 248 interrupt-parent = <&mpic>;
259 tbi-handle = <&tbi2>; 249 tbi-handle = <&tbi2>;
260 phy-handle = <&phy3>; 250 phy-handle = <&phy3>;
251
252 mdio@520 {
253 #address-cells = <1>;
254 #size-cells = <0>;
255 compatible = "fsl,gianfar-tbi";
256 reg = <0x520 0x20>;
257
258 tbi2: tbi-phy@11 {
259 reg = <0x11>;
260 device_type = "tbi-phy";
261 };
262 };
261 }; 263 };
262 264
263 enet3: ethernet@27000 { 265 enet3: ethernet@27000 {
266 #address-cells = <1>;
267 #size-cells = <1>;
264 cell-index = <3>; 268 cell-index = <3>;
265 device_type = "network"; 269 device_type = "network";
266 model = "eTSEC"; 270 model = "eTSEC";
267 compatible = "gianfar"; 271 compatible = "gianfar";
268 reg = <0x27000 0x1000>; 272 reg = <0x27000 0x1000>;
273 ranges = <0x0 0x27000 0x1000>;
269 local-mac-address = [ 00 00 00 00 00 00 ]; 274 local-mac-address = [ 00 00 00 00 00 00 ];
270 interrupts = <37 2 38 2 39 2>; 275 interrupts = <37 2 38 2 39 2>;
271 interrupt-parent = <&mpic>; 276 interrupt-parent = <&mpic>;
272 tbi-handle = <&tbi3>; 277 tbi-handle = <&tbi3>;
273 phy-handle = <&phy4>; 278 phy-handle = <&phy4>;
279
280 mdio@520 {
281 #address-cells = <1>;
282 #size-cells = <0>;
283 compatible = "fsl,gianfar-tbi";
284 reg = <0x520 0x20>;
285
286 tbi3: tbi-phy@11 {
287 reg = <0x11>;
288 device_type = "tbi-phy";
289 };
290 };
274 }; 291 };
275 292
276 serial0: serial@4500 { 293 serial0: serial@4500 {
@@ -365,14 +382,14 @@
365 can0@2,0 { 382 can0@2,0 {
366 compatible = "intel,82527"; // Bosch CC770 383 compatible = "intel,82527"; // Bosch CC770
367 reg = <2 0x0 0x100>; 384 reg = <2 0x0 0x100>;
368 interrupts = <4 0>; 385 interrupts = <4 1>;
369 interrupt-parent = <&mpic>; 386 interrupt-parent = <&mpic>;
370 }; 387 };
371 388
372 can1@2,100 { 389 can1@2,100 {
373 compatible = "intel,82527"; // Bosch CC770 390 compatible = "intel,82527"; // Bosch CC770
374 reg = <2 0x100 0x100>; 391 reg = <2 0x100 0x100>;
375 interrupts = <4 0>; 392 interrupts = <4 1>;
376 interrupt-parent = <&mpic>; 393 interrupt-parent = <&mpic>;
377 }; 394 };
378 395
diff --git a/arch/powerpc/boot/dts/tqm8555.dts b/arch/powerpc/boot/dts/tqm8555.dts
index cf92b4e7945e..a133ded6dddb 100644
--- a/arch/powerpc/boot/dts/tqm8555.dts
+++ b/arch/powerpc/boot/dts/tqm8555.dts
@@ -83,6 +83,11 @@
83 interrupt-parent = <&mpic>; 83 interrupt-parent = <&mpic>;
84 dfsrr; 84 dfsrr;
85 85
86 dtt@50 {
87 compatible = "national,lm75";
88 reg = <0x50>;
89 };
90
86 rtc@68 { 91 rtc@68 {
87 compatible = "dallas,ds1337"; 92 compatible = "dallas,ds1337";
88 reg = <0x68>; 93 reg = <0x68>;
@@ -130,72 +135,78 @@
130 }; 135 };
131 }; 136 };
132 137
133 mdio@24520 {
134 #address-cells = <1>;
135 #size-cells = <0>;
136 compatible = "fsl,gianfar-mdio";
137 reg = <0x24520 0x20>;
138
139 phy1: ethernet-phy@1 {
140 interrupt-parent = <&mpic>;
141 interrupts = <8 1>;
142 reg = <1>;
143 device_type = "ethernet-phy";
144 };
145 phy2: ethernet-phy@2 {
146 interrupt-parent = <&mpic>;
147 interrupts = <8 1>;
148 reg = <2>;
149 device_type = "ethernet-phy";
150 };
151 phy3: ethernet-phy@3 {
152 interrupt-parent = <&mpic>;
153 interrupts = <8 1>;
154 reg = <3>;
155 device_type = "ethernet-phy";
156 };
157 tbi0: tbi-phy@11 {
158 reg = <0x11>;
159 device_type = "tbi-phy";
160 };
161 };
162
163 mdio@25520 {
164 #address-cells = <1>;
165 #size-cells = <0>;
166 compatible = "fsl,gianfar-tbi";
167 reg = <0x25520 0x20>;
168
169 tbi1: tbi-phy@11 {
170 reg = <0x11>;
171 device_type = "tbi-phy";
172 };
173 };
174
175 enet0: ethernet@24000 { 138 enet0: ethernet@24000 {
139 #address-cells = <1>;
140 #size-cells = <1>;
176 cell-index = <0>; 141 cell-index = <0>;
177 device_type = "network"; 142 device_type = "network";
178 model = "TSEC"; 143 model = "TSEC";
179 compatible = "gianfar"; 144 compatible = "gianfar";
180 reg = <0x24000 0x1000>; 145 reg = <0x24000 0x1000>;
146 ranges = <0x0 0x24000 0x1000>;
181 local-mac-address = [ 00 00 00 00 00 00 ]; 147 local-mac-address = [ 00 00 00 00 00 00 ];
182 interrupts = <29 2 30 2 34 2>; 148 interrupts = <29 2 30 2 34 2>;
183 interrupt-parent = <&mpic>; 149 interrupt-parent = <&mpic>;
184 tbi-handle = <&tbi0>; 150 tbi-handle = <&tbi0>;
185 phy-handle = <&phy2>; 151 phy-handle = <&phy2>;
152
153 mdio@520 {
154 #address-cells = <1>;
155 #size-cells = <0>;
156 compatible = "fsl,gianfar-mdio";
157 reg = <0x520 0x20>;
158
159 phy1: ethernet-phy@1 {
160 interrupt-parent = <&mpic>;
161 interrupts = <8 1>;
162 reg = <1>;
163 device_type = "ethernet-phy";
164 };
165 phy2: ethernet-phy@2 {
166 interrupt-parent = <&mpic>;
167 interrupts = <8 1>;
168 reg = <2>;
169 device_type = "ethernet-phy";
170 };
171 phy3: ethernet-phy@3 {
172 interrupt-parent = <&mpic>;
173 interrupts = <8 1>;
174 reg = <3>;
175 device_type = "ethernet-phy";
176 };
177 tbi0: tbi-phy@11 {
178 reg = <0x11>;
179 device_type = "tbi-phy";
180 };
181 };
186 }; 182 };
187 183
188 enet1: ethernet@25000 { 184 enet1: ethernet@25000 {
185 #address-cells = <1>;
186 #size-cells = <1>;
189 cell-index = <1>; 187 cell-index = <1>;
190 device_type = "network"; 188 device_type = "network";
191 model = "TSEC"; 189 model = "TSEC";
192 compatible = "gianfar"; 190 compatible = "gianfar";
193 reg = <0x25000 0x1000>; 191 reg = <0x25000 0x1000>;
192 ranges = <0x0 0x25000 0x1000>;
194 local-mac-address = [ 00 00 00 00 00 00 ]; 193 local-mac-address = [ 00 00 00 00 00 00 ];
195 interrupts = <35 2 36 2 40 2>; 194 interrupts = <35 2 36 2 40 2>;
196 interrupt-parent = <&mpic>; 195 interrupt-parent = <&mpic>;
197 tbi-handle = <&tbi1>; 196 tbi-handle = <&tbi1>;
198 phy-handle = <&phy1>; 197 phy-handle = <&phy1>;
198
199 mdio@520 {
200 #address-cells = <1>;
201 #size-cells = <0>;
202 compatible = "fsl,gianfar-tbi";
203 reg = <0x520 0x20>;
204
205 tbi1: tbi-phy@11 {
206 reg = <0x11>;
207 device_type = "tbi-phy";
208 };
209 };
199 }; 210 };
200 211
201 serial0: serial@4500 { 212 serial0: serial@4500 {
diff --git a/arch/powerpc/boot/dts/tqm8560.dts b/arch/powerpc/boot/dts/tqm8560.dts
index 9e1ab2d2f669..649e2e576267 100644
--- a/arch/powerpc/boot/dts/tqm8560.dts
+++ b/arch/powerpc/boot/dts/tqm8560.dts
@@ -85,6 +85,11 @@
85 interrupt-parent = <&mpic>; 85 interrupt-parent = <&mpic>;
86 dfsrr; 86 dfsrr;
87 87
88 dtt@50 {
89 compatible = "national,lm75";
90 reg = <0x50>;
91 };
92
88 rtc@68 { 93 rtc@68 {
89 compatible = "dallas,ds1337"; 94 compatible = "dallas,ds1337";
90 reg = <0x68>; 95 reg = <0x68>;
@@ -132,72 +137,78 @@
132 }; 137 };
133 }; 138 };
134 139
135 mdio@24520 {
136 #address-cells = <1>;
137 #size-cells = <0>;
138 compatible = "fsl,gianfar-mdio";
139 reg = <0x24520 0x20>;
140
141 phy1: ethernet-phy@1 {
142 interrupt-parent = <&mpic>;
143 interrupts = <8 1>;
144 reg = <1>;
145 device_type = "ethernet-phy";
146 };
147 phy2: ethernet-phy@2 {
148 interrupt-parent = <&mpic>;
149 interrupts = <8 1>;
150 reg = <2>;
151 device_type = "ethernet-phy";
152 };
153 phy3: ethernet-phy@3 {
154 interrupt-parent = <&mpic>;
155 interrupts = <8 1>;
156 reg = <3>;
157 device_type = "ethernet-phy";
158 };
159 tbi0: tbi-phy@11 {
160 reg = <0x11>;
161 device_type = "tbi-phy";
162 };
163 };
164
165 mdio@25520 {
166 #address-cells = <1>;
167 #size-cells = <0>;
168 compatible = "fsl,gianfar-tbi";
169 reg = <0x25520 0x20>;
170
171 tbi1: tbi-phy@11 {
172 reg = <0x11>;
173 device_type = "tbi-phy";
174 };
175 };
176
177 enet0: ethernet@24000 { 140 enet0: ethernet@24000 {
141 #address-cells = <1>;
142 #size-cells = <1>;
178 cell-index = <0>; 143 cell-index = <0>;
179 device_type = "network"; 144 device_type = "network";
180 model = "TSEC"; 145 model = "TSEC";
181 compatible = "gianfar"; 146 compatible = "gianfar";
182 reg = <0x24000 0x1000>; 147 reg = <0x24000 0x1000>;
148 ranges = <0x0 0x24000 0x1000>;
183 local-mac-address = [ 00 00 00 00 00 00 ]; 149 local-mac-address = [ 00 00 00 00 00 00 ];
184 interrupts = <29 2 30 2 34 2>; 150 interrupts = <29 2 30 2 34 2>;
185 interrupt-parent = <&mpic>; 151 interrupt-parent = <&mpic>;
186 tbi-handle = <&tbi0>; 152 tbi-handle = <&tbi0>;
187 phy-handle = <&phy2>; 153 phy-handle = <&phy2>;
154
155 mdio@520 {
156 #address-cells = <1>;
157 #size-cells = <0>;
158 compatible = "fsl,gianfar-mdio";
159 reg = <0x520 0x20>;
160
161 phy1: ethernet-phy@1 {
162 interrupt-parent = <&mpic>;
163 interrupts = <8 1>;
164 reg = <1>;
165 device_type = "ethernet-phy";
166 };
167 phy2: ethernet-phy@2 {
168 interrupt-parent = <&mpic>;
169 interrupts = <8 1>;
170 reg = <2>;
171 device_type = "ethernet-phy";
172 };
173 phy3: ethernet-phy@3 {
174 interrupt-parent = <&mpic>;
175 interrupts = <8 1>;
176 reg = <3>;
177 device_type = "ethernet-phy";
178 };
179 tbi0: tbi-phy@11 {
180 reg = <0x11>;
181 device_type = "tbi-phy";
182 };
183 };
188 }; 184 };
189 185
190 enet1: ethernet@25000 { 186 enet1: ethernet@25000 {
187 #address-cells = <1>;
188 #size-cells = <1>;
191 cell-index = <1>; 189 cell-index = <1>;
192 device_type = "network"; 190 device_type = "network";
193 model = "TSEC"; 191 model = "TSEC";
194 compatible = "gianfar"; 192 compatible = "gianfar";
195 reg = <0x25000 0x1000>; 193 reg = <0x25000 0x1000>;
194 ranges = <0x0 0x25000 0x1000>;
196 local-mac-address = [ 00 00 00 00 00 00 ]; 195 local-mac-address = [ 00 00 00 00 00 00 ];
197 interrupts = <35 2 36 2 40 2>; 196 interrupts = <35 2 36 2 40 2>;
198 interrupt-parent = <&mpic>; 197 interrupt-parent = <&mpic>;
199 tbi-handle = <&tbi1>; 198 tbi-handle = <&tbi1>;
200 phy-handle = <&phy1>; 199 phy-handle = <&phy1>;
200
201 mdio@520 {
202 #address-cells = <1>;
203 #size-cells = <0>;
204 compatible = "fsl,gianfar-tbi";
205 reg = <0x520 0x20>;
206
207 tbi1: tbi-phy@11 {
208 reg = <0x11>;
209 device_type = "tbi-phy";
210 };
211 };
201 }; 212 };
202 213
203 mpic: pic@40000 { 214 mpic: pic@40000 {
@@ -335,14 +346,14 @@
335 can0@2,0 { 346 can0@2,0 {
336 compatible = "intel,82527"; // Bosch CC770 347 compatible = "intel,82527"; // Bosch CC770
337 reg = <2 0x0 0x100>; 348 reg = <2 0x0 0x100>;
338 interrupts = <4 0>; 349 interrupts = <4 1>;
339 interrupt-parent = <&mpic>; 350 interrupt-parent = <&mpic>;
340 }; 351 };
341 352
342 can1@2,100 { 353 can1@2,100 {
343 compatible = "intel,82527"; // Bosch CC770 354 compatible = "intel,82527"; // Bosch CC770
344 reg = <2 0x100 0x100>; 355 reg = <2 0x100 0x100>;
345 interrupts = <4 0>; 356 interrupts = <4 1>;
346 interrupt-parent = <&mpic>; 357 interrupt-parent = <&mpic>;
347 }; 358 };
348 }; 359 };
diff --git a/arch/powerpc/boot/dts/virtex440-ml507.dts b/arch/powerpc/boot/dts/virtex440-ml507.dts
index dc8e78e2dceb..52d8c1ad26a1 100644
--- a/arch/powerpc/boot/dts/virtex440-ml507.dts
+++ b/arch/powerpc/boot/dts/virtex440-ml507.dts
@@ -7,6 +7,15 @@
7 * This file is licensed under the terms of the GNU General Public License 7 * This file is licensed under the terms of the GNU General Public License
8 * version 2. This program is licensed "as is" without any warranty of any 8 * version 2. This program is licensed "as is" without any warranty of any
9 * kind, whether express or implied. 9 * kind, whether express or implied.
10 *
11 * ---
12 *
13 * Device Tree Generator version: 1.1
14 *
15 * CAUTION: This file is automatically generated by libgen.
16 * Version: Xilinx EDK 10.1.03 EDK_K_SP3.6
17 *
18 * XPS project directory: ml507_ppc440_emb_ref
10 */ 19 */
11 20
12/dts-v1/; 21/dts-v1/;
@@ -22,8 +31,8 @@
22 reg = < 0 0x10000000 >; 31 reg = < 0 0x10000000 >;
23 } ; 32 } ;
24 chosen { 33 chosen {
25 bootargs = "console=ttyS0 ip=on root=/dev/ram"; 34 bootargs = "console=ttyS0 root=/dev/ram";
26 linux,stdout-path = "/plb@0/serial@83e00000"; 35 linux,stdout-path = &RS232_Uart_1;
27 } ; 36 } ;
28 cpus { 37 cpus {
29 #address-cells = <1>; 38 #address-cells = <1>;
@@ -136,19 +145,19 @@
136 compatible = "xlnx,ll-dma-1.00.a"; 145 compatible = "xlnx,ll-dma-1.00.a";
137 dcr-reg = < 0x80 0x11 >; 146 dcr-reg = < 0x80 0x11 >;
138 interrupt-parent = <&xps_intc_0>; 147 interrupt-parent = <&xps_intc_0>;
139 interrupts = < 9 2 0xa 2 >; 148 interrupts = < 10 2 11 2 >;
140 } ; 149 } ;
141 } ; 150 } ;
142 } ; 151 } ;
143 plb_v46_0: plb@0 { 152 plb_v46_0: plb@0 {
144 #address-cells = <1>; 153 #address-cells = <1>;
145 #size-cells = <1>; 154 #size-cells = <1>;
146 compatible = "xlnx,plb-v46-1.02.a", "simple-bus"; 155 compatible = "xlnx,plb-v46-1.03.a", "simple-bus";
147 ranges ; 156 ranges ;
148 DIP_Switches_8Bit: gpio@81460000 { 157 DIP_Switches_8Bit: gpio@81460000 {
149 compatible = "xlnx,xps-gpio-1.00.a"; 158 compatible = "xlnx,xps-gpio-1.00.a";
150 interrupt-parent = <&xps_intc_0>; 159 interrupt-parent = <&xps_intc_0>;
151 interrupts = < 6 2 >; 160 interrupts = < 7 2 >;
152 reg = < 0x81460000 0x10000 >; 161 reg = < 0x81460000 0x10000 >;
153 xlnx,all-inputs = <1>; 162 xlnx,all-inputs = <1>;
154 xlnx,all-inputs-2 = <0>; 163 xlnx,all-inputs-2 = <0>;
@@ -163,6 +172,86 @@
163 xlnx,tri-default = <0xffffffff>; 172 xlnx,tri-default = <0xffffffff>;
164 xlnx,tri-default-2 = <0xffffffff>; 173 xlnx,tri-default-2 = <0xffffffff>;
165 } ; 174 } ;
175 FLASH: flash@fc000000 {
176 bank-width = <2>;
177 compatible = "xlnx,xps-mch-emc-2.00.a", "cfi-flash";
178 reg = < 0xfc000000 0x2000000 >;
179 xlnx,family = "virtex5";
180 xlnx,include-datawidth-matching-0 = <0x1>;
181 xlnx,include-datawidth-matching-1 = <0x0>;
182 xlnx,include-datawidth-matching-2 = <0x0>;
183 xlnx,include-datawidth-matching-3 = <0x0>;
184 xlnx,include-negedge-ioregs = <0x0>;
185 xlnx,include-plb-ipif = <0x1>;
186 xlnx,include-wrbuf = <0x1>;
187 xlnx,max-mem-width = <0x10>;
188 xlnx,mch-native-dwidth = <0x20>;
189 xlnx,mch-plb-clk-period-ps = <0x2710>;
190 xlnx,mch-splb-awidth = <0x20>;
191 xlnx,mch0-accessbuf-depth = <0x10>;
192 xlnx,mch0-protocol = <0x0>;
193 xlnx,mch0-rddatabuf-depth = <0x10>;
194 xlnx,mch1-accessbuf-depth = <0x10>;
195 xlnx,mch1-protocol = <0x0>;
196 xlnx,mch1-rddatabuf-depth = <0x10>;
197 xlnx,mch2-accessbuf-depth = <0x10>;
198 xlnx,mch2-protocol = <0x0>;
199 xlnx,mch2-rddatabuf-depth = <0x10>;
200 xlnx,mch3-accessbuf-depth = <0x10>;
201 xlnx,mch3-protocol = <0x0>;
202 xlnx,mch3-rddatabuf-depth = <0x10>;
203 xlnx,mem0-width = <0x10>;
204 xlnx,mem1-width = <0x20>;
205 xlnx,mem2-width = <0x20>;
206 xlnx,mem3-width = <0x20>;
207 xlnx,num-banks-mem = <0x1>;
208 xlnx,num-channels = <0x2>;
209 xlnx,priority-mode = <0x0>;
210 xlnx,synch-mem-0 = <0x0>;
211 xlnx,synch-mem-1 = <0x0>;
212 xlnx,synch-mem-2 = <0x0>;
213 xlnx,synch-mem-3 = <0x0>;
214 xlnx,synch-pipedelay-0 = <0x2>;
215 xlnx,synch-pipedelay-1 = <0x2>;
216 xlnx,synch-pipedelay-2 = <0x2>;
217 xlnx,synch-pipedelay-3 = <0x2>;
218 xlnx,tavdv-ps-mem-0 = <0x1adb0>;
219 xlnx,tavdv-ps-mem-1 = <0x3a98>;
220 xlnx,tavdv-ps-mem-2 = <0x3a98>;
221 xlnx,tavdv-ps-mem-3 = <0x3a98>;
222 xlnx,tcedv-ps-mem-0 = <0x1adb0>;
223 xlnx,tcedv-ps-mem-1 = <0x3a98>;
224 xlnx,tcedv-ps-mem-2 = <0x3a98>;
225 xlnx,tcedv-ps-mem-3 = <0x3a98>;
226 xlnx,thzce-ps-mem-0 = <0x88b8>;
227 xlnx,thzce-ps-mem-1 = <0x1b58>;
228 xlnx,thzce-ps-mem-2 = <0x1b58>;
229 xlnx,thzce-ps-mem-3 = <0x1b58>;
230 xlnx,thzoe-ps-mem-0 = <0x1b58>;
231 xlnx,thzoe-ps-mem-1 = <0x1b58>;
232 xlnx,thzoe-ps-mem-2 = <0x1b58>;
233 xlnx,thzoe-ps-mem-3 = <0x1b58>;
234 xlnx,tlzwe-ps-mem-0 = <0x88b8>;
235 xlnx,tlzwe-ps-mem-1 = <0x0>;
236 xlnx,tlzwe-ps-mem-2 = <0x0>;
237 xlnx,tlzwe-ps-mem-3 = <0x0>;
238 xlnx,twc-ps-mem-0 = <0x2af8>;
239 xlnx,twc-ps-mem-1 = <0x3a98>;
240 xlnx,twc-ps-mem-2 = <0x3a98>;
241 xlnx,twc-ps-mem-3 = <0x3a98>;
242 xlnx,twp-ps-mem-0 = <0x11170>;
243 xlnx,twp-ps-mem-1 = <0x2ee0>;
244 xlnx,twp-ps-mem-2 = <0x2ee0>;
245 xlnx,twp-ps-mem-3 = <0x2ee0>;
246 xlnx,xcl0-linesize = <0x4>;
247 xlnx,xcl0-writexfer = <0x1>;
248 xlnx,xcl1-linesize = <0x4>;
249 xlnx,xcl1-writexfer = <0x1>;
250 xlnx,xcl2-linesize = <0x4>;
251 xlnx,xcl2-writexfer = <0x1>;
252 xlnx,xcl3-linesize = <0x4>;
253 xlnx,xcl3-writexfer = <0x1>;
254 } ;
166 Hard_Ethernet_MAC: xps-ll-temac@81c00000 { 255 Hard_Ethernet_MAC: xps-ll-temac@81c00000 {
167 #address-cells = <1>; 256 #address-cells = <1>;
168 #size-cells = <1>; 257 #size-cells = <1>;
@@ -185,6 +274,19 @@
185 xlnx,txfifo = <0x1000>; 274 xlnx,txfifo = <0x1000>;
186 } ; 275 } ;
187 } ; 276 } ;
277 IIC_EEPROM: i2c@81600000 {
278 compatible = "xlnx,xps-iic-2.00.a";
279 interrupt-parent = <&xps_intc_0>;
280 interrupts = < 6 2 >;
281 reg = < 0x81600000 0x10000 >;
282 xlnx,clk-freq = <0x5f5e100>;
283 xlnx,family = "virtex5";
284 xlnx,gpo-width = <0x1>;
285 xlnx,iic-freq = <0x186a0>;
286 xlnx,scl-inertial-delay = <0x0>;
287 xlnx,sda-inertial-delay = <0x0>;
288 xlnx,ten-bit-adr = <0x0>;
289 } ;
188 LEDs_8Bit: gpio@81400000 { 290 LEDs_8Bit: gpio@81400000 {
189 compatible = "xlnx,xps-gpio-1.00.a"; 291 compatible = "xlnx,xps-gpio-1.00.a";
190 reg = < 0x81400000 0x10000 >; 292 reg = < 0x81400000 0x10000 >;
@@ -220,7 +322,7 @@
220 Push_Buttons_5Bit: gpio@81440000 { 322 Push_Buttons_5Bit: gpio@81440000 {
221 compatible = "xlnx,xps-gpio-1.00.a"; 323 compatible = "xlnx,xps-gpio-1.00.a";
222 interrupt-parent = <&xps_intc_0>; 324 interrupt-parent = <&xps_intc_0>;
223 interrupts = < 7 2 >; 325 interrupts = < 8 2 >;
224 reg = < 0x81440000 0x10000 >; 326 reg = < 0x81440000 0x10000 >;
225 xlnx,all-inputs = <1>; 327 xlnx,all-inputs = <1>;
226 xlnx,all-inputs-2 = <0>; 328 xlnx,all-inputs-2 = <0>;
@@ -237,13 +339,13 @@
237 } ; 339 } ;
238 RS232_Uart_1: serial@83e00000 { 340 RS232_Uart_1: serial@83e00000 {
239 clock-frequency = <100000000>; 341 clock-frequency = <100000000>;
240 compatible = "xlnx,xps-uart16550-2.00.a", "ns16550"; 342 compatible = "xlnx,xps-uart16550-2.00.b", "ns16550";
241 current-speed = <0x2580>; 343 current-speed = <9600>;
242 device_type = "serial"; 344 device_type = "serial";
243 interrupt-parent = <&xps_intc_0>; 345 interrupt-parent = <&xps_intc_0>;
244 interrupts = < 8 2 >; 346 interrupts = < 9 2 >;
245 reg = < 0x83e00000 0x10000 >; 347 reg = < 0x83e00000 0x10000 >;
246 reg-offset = <3>; 348 reg-offset = <0x1003>;
247 reg-shift = <2>; 349 reg-shift = <2>;
248 xlnx,family = "virtex5"; 350 xlnx,family = "virtex5";
249 xlnx,has-external-rclk = <0>; 351 xlnx,has-external-rclk = <0>;
@@ -268,7 +370,7 @@
268 compatible = "xlnx,xps-intc-1.00.a"; 370 compatible = "xlnx,xps-intc-1.00.a";
269 interrupt-controller ; 371 interrupt-controller ;
270 reg = < 0x81800000 0x10000 >; 372 reg = < 0x81800000 0x10000 >;
271 xlnx,num-intr-inputs = <0xb>; 373 xlnx,num-intr-inputs = <0xc>;
272 } ; 374 } ;
273 xps_timebase_wdt_1: xps-timebase-wdt@83a00000 { 375 xps_timebase_wdt_1: xps-timebase-wdt@83a00000 {
274 compatible = "xlnx,xps-timebase-wdt-1.00.b"; 376 compatible = "xlnx,xps-timebase-wdt-1.00.b";
diff --git a/arch/powerpc/boot/serial.c b/arch/powerpc/boot/serial.c
index 8b3607cb53fb..f2156f07571f 100644
--- a/arch/powerpc/boot/serial.c
+++ b/arch/powerpc/boot/serial.c
@@ -117,7 +117,8 @@ int serial_console_init(void)
117 if (devp == NULL) 117 if (devp == NULL)
118 goto err_out; 118 goto err_out;
119 119
120 if (dt_is_compatible(devp, "ns16550")) 120 if (dt_is_compatible(devp, "ns16550") ||
121 dt_is_compatible(devp, "pnpPNP,501"))
121 rc = ns16550_console_init(devp, &serial_cd); 122 rc = ns16550_console_init(devp, &serial_cd);
122 else if (dt_is_compatible(devp, "marvell,mv64360-mpsc")) 123 else if (dt_is_compatible(devp, "marvell,mv64360-mpsc"))
123 rc = mpsc_console_init(devp, &serial_cd); 124 rc = mpsc_console_init(devp, &serial_cd);
diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper
index 965c237c122d..3ac75aecdb94 100755
--- a/arch/powerpc/boot/wrapper
+++ b/arch/powerpc/boot/wrapper
@@ -186,6 +186,9 @@ cuboot*)
186 *-mpc85*|*-tqm85*|*-sbc85*) 186 *-mpc85*|*-tqm85*|*-sbc85*)
187 platformo=$object/cuboot-85xx.o 187 platformo=$object/cuboot-85xx.o
188 ;; 188 ;;
189 *-amigaone)
190 link_address='0x800000'
191 ;;
189 esac 192 esac
190 ;; 193 ;;
191ps3) 194ps3)
@@ -211,11 +214,11 @@ simpleboot-virtex405-*)
211 binary=y 214 binary=y
212 ;; 215 ;;
213simpleboot-virtex440-*) 216simpleboot-virtex440-*)
214 platformo="$object/simpleboot.o $object/virtex.o" 217 platformo="$object/fixed-head.o $object/simpleboot.o $object/virtex.o"
215 binary=y 218 binary=y
216 ;; 219 ;;
217simpleboot-*) 220simpleboot-*)
218 platformo="$object/simpleboot.o" 221 platformo="$object/fixed-head.o $object/simpleboot.o"
219 binary=y 222 binary=y
220 ;; 223 ;;
221asp834x-redboot) 224asp834x-redboot)
diff --git a/arch/powerpc/configs/44x/canyonlands_defconfig b/arch/powerpc/configs/44x/canyonlands_defconfig
index 81cdcc4b9278..f9a08ee49b96 100644
--- a/arch/powerpc/configs/44x/canyonlands_defconfig
+++ b/arch/powerpc/configs/44x/canyonlands_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.29-rc2 3# Linux kernel version: 2.6.29-rc3
4# Tue Jan 20 08:22:35 2009 4# Mon Feb 2 13:13:04 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -74,6 +74,15 @@ CONFIG_POSIX_MQUEUE=y
74# CONFIG_BSD_PROCESS_ACCT is not set 74# CONFIG_BSD_PROCESS_ACCT is not set
75# CONFIG_TASKSTATS is not set 75# CONFIG_TASKSTATS is not set
76# CONFIG_AUDIT is not set 76# CONFIG_AUDIT is not set
77
78#
79# RCU Subsystem
80#
81CONFIG_CLASSIC_RCU=y
82# CONFIG_TREE_RCU is not set
83# CONFIG_PREEMPT_RCU is not set
84# CONFIG_TREE_RCU_TRACE is not set
85# CONFIG_PREEMPT_RCU_TRACE is not set
77# CONFIG_IKCONFIG is not set 86# CONFIG_IKCONFIG is not set
78CONFIG_LOG_BUF_SHIFT=14 87CONFIG_LOG_BUF_SHIFT=14
79# CONFIG_GROUP_SCHED is not set 88# CONFIG_GROUP_SCHED is not set
@@ -147,11 +156,6 @@ CONFIG_DEFAULT_AS=y
147# CONFIG_DEFAULT_CFQ is not set 156# CONFIG_DEFAULT_CFQ is not set
148# CONFIG_DEFAULT_NOOP is not set 157# CONFIG_DEFAULT_NOOP is not set
149CONFIG_DEFAULT_IOSCHED="anticipatory" 158CONFIG_DEFAULT_IOSCHED="anticipatory"
150CONFIG_CLASSIC_RCU=y
151# CONFIG_TREE_RCU is not set
152# CONFIG_PREEMPT_RCU is not set
153# CONFIG_TREE_RCU_TRACE is not set
154# CONFIG_PREEMPT_RCU_TRACE is not set
155# CONFIG_FREEZER is not set 159# CONFIG_FREEZER is not set
156CONFIG_PPC4xx_PCI_EXPRESS=y 160CONFIG_PPC4xx_PCI_EXPRESS=y
157 161
@@ -373,6 +377,7 @@ CONFIG_CONNECTOR=y
373CONFIG_PROC_EVENTS=y 377CONFIG_PROC_EVENTS=y
374# CONFIG_MTD is not set 378# CONFIG_MTD is not set
375CONFIG_OF_DEVICE=y 379CONFIG_OF_DEVICE=y
380CONFIG_OF_I2C=y
376# CONFIG_PARPORT is not set 381# CONFIG_PARPORT is not set
377CONFIG_BLK_DEV=y 382CONFIG_BLK_DEV=y
378# CONFIG_BLK_DEV_FD is not set 383# CONFIG_BLK_DEV_FD is not set
@@ -384,6 +389,7 @@ CONFIG_BLK_DEV=y
384# CONFIG_BLK_DEV_LOOP is not set 389# CONFIG_BLK_DEV_LOOP is not set
385# CONFIG_BLK_DEV_NBD is not set 390# CONFIG_BLK_DEV_NBD is not set
386# CONFIG_BLK_DEV_SX8 is not set 391# CONFIG_BLK_DEV_SX8 is not set
392# CONFIG_BLK_DEV_UB is not set
387CONFIG_BLK_DEV_RAM=y 393CONFIG_BLK_DEV_RAM=y
388CONFIG_BLK_DEV_RAM_COUNT=16 394CONFIG_BLK_DEV_RAM_COUNT=16
389CONFIG_BLK_DEV_RAM_SIZE=35000 395CONFIG_BLK_DEV_RAM_SIZE=35000
@@ -466,6 +472,15 @@ CONFIG_IBM_NEW_EMAC_EMAC4=y
466# 472#
467# Enable WiMAX (Networking options) to see the WiMAX drivers 473# Enable WiMAX (Networking options) to see the WiMAX drivers
468# 474#
475
476#
477# USB Network Adapters
478#
479# CONFIG_USB_CATC is not set
480# CONFIG_USB_KAWETH is not set
481# CONFIG_USB_PEGASUS is not set
482# CONFIG_USB_RTL8150 is not set
483# CONFIG_USB_USBNET is not set
469# CONFIG_WAN is not set 484# CONFIG_WAN is not set
470# CONFIG_FDDI is not set 485# CONFIG_FDDI is not set
471# CONFIG_HIPPI is not set 486# CONFIG_HIPPI is not set
@@ -533,13 +548,136 @@ CONFIG_LEGACY_PTY_COUNT=256
533# CONFIG_RAW_DRIVER is not set 548# CONFIG_RAW_DRIVER is not set
534# CONFIG_TCG_TPM is not set 549# CONFIG_TCG_TPM is not set
535CONFIG_DEVPORT=y 550CONFIG_DEVPORT=y
536# CONFIG_I2C is not set 551CONFIG_I2C=y
552CONFIG_I2C_BOARDINFO=y
553CONFIG_I2C_CHARDEV=y
554CONFIG_I2C_HELPER_AUTO=y
555
556#
557# I2C Hardware Bus support
558#
559
560#
561# PC SMBus host controller drivers
562#
563# CONFIG_I2C_ALI1535 is not set
564# CONFIG_I2C_ALI1563 is not set
565# CONFIG_I2C_ALI15X3 is not set
566# CONFIG_I2C_AMD756 is not set
567# CONFIG_I2C_AMD8111 is not set
568# CONFIG_I2C_I801 is not set
569# CONFIG_I2C_ISCH is not set
570# CONFIG_I2C_PIIX4 is not set
571# CONFIG_I2C_NFORCE2 is not set
572# CONFIG_I2C_SIS5595 is not set
573# CONFIG_I2C_SIS630 is not set
574# CONFIG_I2C_SIS96X is not set
575# CONFIG_I2C_VIA is not set
576# CONFIG_I2C_VIAPRO is not set
577
578#
579# I2C system bus drivers (mostly embedded / system-on-chip)
580#
581CONFIG_I2C_IBM_IIC=y
582# CONFIG_I2C_MPC is not set
583# CONFIG_I2C_OCORES is not set
584# CONFIG_I2C_SIMTEC is not set
585
586#
587# External I2C/SMBus adapter drivers
588#
589# CONFIG_I2C_PARPORT_LIGHT is not set
590# CONFIG_I2C_TAOS_EVM is not set
591# CONFIG_I2C_TINY_USB is not set
592
593#
594# Graphics adapter I2C/DDC channel drivers
595#
596# CONFIG_I2C_VOODOO3 is not set
597
598#
599# Other I2C/SMBus bus drivers
600#
601# CONFIG_I2C_PCA_PLATFORM is not set
602# CONFIG_I2C_STUB is not set
603
604#
605# Miscellaneous I2C Chip support
606#
607# CONFIG_DS1682 is not set
608# CONFIG_SENSORS_PCF8574 is not set
609# CONFIG_PCF8575 is not set
610# CONFIG_SENSORS_PCA9539 is not set
611# CONFIG_SENSORS_PCF8591 is not set
612# CONFIG_SENSORS_MAX6875 is not set
613# CONFIG_SENSORS_TSL2550 is not set
614# CONFIG_I2C_DEBUG_CORE is not set
615# CONFIG_I2C_DEBUG_ALGO is not set
616# CONFIG_I2C_DEBUG_BUS is not set
617# CONFIG_I2C_DEBUG_CHIP is not set
537# CONFIG_SPI is not set 618# CONFIG_SPI is not set
538CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 619CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
539# CONFIG_GPIOLIB is not set 620# CONFIG_GPIOLIB is not set
540# CONFIG_W1 is not set 621# CONFIG_W1 is not set
541# CONFIG_POWER_SUPPLY is not set 622# CONFIG_POWER_SUPPLY is not set
542# CONFIG_HWMON is not set 623CONFIG_HWMON=y
624# CONFIG_HWMON_VID is not set
625CONFIG_SENSORS_AD7414=y
626# CONFIG_SENSORS_AD7418 is not set
627# CONFIG_SENSORS_ADM1021 is not set
628# CONFIG_SENSORS_ADM1025 is not set
629# CONFIG_SENSORS_ADM1026 is not set
630# CONFIG_SENSORS_ADM1029 is not set
631# CONFIG_SENSORS_ADM1031 is not set
632# CONFIG_SENSORS_ADM9240 is not set
633# CONFIG_SENSORS_ADT7462 is not set
634# CONFIG_SENSORS_ADT7470 is not set
635# CONFIG_SENSORS_ADT7473 is not set
636# CONFIG_SENSORS_ADT7475 is not set
637# CONFIG_SENSORS_ATXP1 is not set
638# CONFIG_SENSORS_DS1621 is not set
639# CONFIG_SENSORS_I5K_AMB is not set
640# CONFIG_SENSORS_F71805F is not set
641# CONFIG_SENSORS_F71882FG is not set
642# CONFIG_SENSORS_F75375S is not set
643# CONFIG_SENSORS_GL518SM is not set
644# CONFIG_SENSORS_GL520SM is not set
645# CONFIG_SENSORS_IT87 is not set
646# CONFIG_SENSORS_LM63 is not set
647# CONFIG_SENSORS_LM75 is not set
648# CONFIG_SENSORS_LM77 is not set
649# CONFIG_SENSORS_LM78 is not set
650# CONFIG_SENSORS_LM80 is not set
651# CONFIG_SENSORS_LM83 is not set
652# CONFIG_SENSORS_LM85 is not set
653# CONFIG_SENSORS_LM87 is not set
654# CONFIG_SENSORS_LM90 is not set
655# CONFIG_SENSORS_LM92 is not set
656# CONFIG_SENSORS_LM93 is not set
657# CONFIG_SENSORS_LTC4245 is not set
658# CONFIG_SENSORS_MAX1619 is not set
659# CONFIG_SENSORS_MAX6650 is not set
660# CONFIG_SENSORS_PC87360 is not set
661# CONFIG_SENSORS_PC87427 is not set
662# CONFIG_SENSORS_SIS5595 is not set
663# CONFIG_SENSORS_DME1737 is not set
664# CONFIG_SENSORS_SMSC47M1 is not set
665# CONFIG_SENSORS_SMSC47M192 is not set
666# CONFIG_SENSORS_SMSC47B397 is not set
667# CONFIG_SENSORS_ADS7828 is not set
668# CONFIG_SENSORS_THMC50 is not set
669# CONFIG_SENSORS_VIA686A is not set
670# CONFIG_SENSORS_VT1211 is not set
671# CONFIG_SENSORS_VT8231 is not set
672# CONFIG_SENSORS_W83781D is not set
673# CONFIG_SENSORS_W83791D is not set
674# CONFIG_SENSORS_W83792D is not set
675# CONFIG_SENSORS_W83793 is not set
676# CONFIG_SENSORS_W83L785TS is not set
677# CONFIG_SENSORS_W83L786NG is not set
678# CONFIG_SENSORS_W83627HF is not set
679# CONFIG_SENSORS_W83627EHF is not set
680# CONFIG_HWMON_DEBUG_CHIP is not set
543# CONFIG_THERMAL is not set 681# CONFIG_THERMAL is not set
544# CONFIG_THERMAL_HWMON is not set 682# CONFIG_THERMAL_HWMON is not set
545# CONFIG_WATCHDOG is not set 683# CONFIG_WATCHDOG is not set
@@ -556,7 +694,12 @@ CONFIG_SSB_POSSIBLE=y
556# CONFIG_MFD_CORE is not set 694# CONFIG_MFD_CORE is not set
557# CONFIG_MFD_SM501 is not set 695# CONFIG_MFD_SM501 is not set
558# CONFIG_HTC_PASIC3 is not set 696# CONFIG_HTC_PASIC3 is not set
697# CONFIG_TWL4030_CORE is not set
559# CONFIG_MFD_TMIO is not set 698# CONFIG_MFD_TMIO is not set
699# CONFIG_PMIC_DA903X is not set
700# CONFIG_MFD_WM8400 is not set
701# CONFIG_MFD_WM8350_I2C is not set
702# CONFIG_MFD_PCF50633 is not set
560# CONFIG_REGULATOR is not set 703# CONFIG_REGULATOR is not set
561 704
562# 705#
@@ -574,6 +717,7 @@ CONFIG_SSB_POSSIBLE=y
574# Multimedia drivers 717# Multimedia drivers
575# 718#
576CONFIG_DAB=y 719CONFIG_DAB=y
720# CONFIG_USB_DABUSB is not set
577 721
578# 722#
579# Graphics support 723# Graphics support
@@ -590,7 +734,109 @@ CONFIG_VIDEO_OUTPUT_CONTROL=m
590# 734#
591# CONFIG_DISPLAY_SUPPORT is not set 735# CONFIG_DISPLAY_SUPPORT is not set
592# CONFIG_SOUND is not set 736# CONFIG_SOUND is not set
593# CONFIG_USB_SUPPORT is not set 737CONFIG_USB_SUPPORT=y
738CONFIG_USB_ARCH_HAS_HCD=y
739CONFIG_USB_ARCH_HAS_OHCI=y
740CONFIG_USB_ARCH_HAS_EHCI=y
741CONFIG_USB=y
742# CONFIG_USB_DEBUG is not set
743CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
744
745#
746# Miscellaneous USB options
747#
748CONFIG_USB_DEVICEFS=y
749CONFIG_USB_DEVICE_CLASS=y
750# CONFIG_USB_DYNAMIC_MINORS is not set
751# CONFIG_USB_OTG is not set
752# CONFIG_USB_OTG_WHITELIST is not set
753# CONFIG_USB_OTG_BLACKLIST_HUB is not set
754CONFIG_USB_MON=y
755# CONFIG_USB_WUSB is not set
756# CONFIG_USB_WUSB_CBAF is not set
757
758#
759# USB Host Controller Drivers
760#
761# CONFIG_USB_C67X00_HCD is not set
762CONFIG_USB_EHCI_HCD=m
763# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
764# CONFIG_USB_EHCI_TT_NEWSCHED is not set
765CONFIG_USB_EHCI_HCD_PPC_OF=y
766# CONFIG_USB_OXU210HP_HCD is not set
767# CONFIG_USB_ISP116X_HCD is not set
768# CONFIG_USB_ISP1760_HCD is not set
769CONFIG_USB_OHCI_HCD=y
770CONFIG_USB_OHCI_HCD_PPC_OF=y
771CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
772CONFIG_USB_OHCI_HCD_PPC_OF_LE=y
773CONFIG_USB_OHCI_HCD_PCI=y
774CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y
775CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y
776CONFIG_USB_OHCI_LITTLE_ENDIAN=y
777# CONFIG_USB_UHCI_HCD is not set
778# CONFIG_USB_SL811_HCD is not set
779# CONFIG_USB_R8A66597_HCD is not set
780# CONFIG_USB_WHCI_HCD is not set
781# CONFIG_USB_HWA_HCD is not set
782
783#
784# USB Device Class drivers
785#
786# CONFIG_USB_ACM is not set
787# CONFIG_USB_PRINTER is not set
788# CONFIG_USB_WDM is not set
789# CONFIG_USB_TMC is not set
790
791#
792# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
793#
794
795#
796# see USB_STORAGE Help for more information
797#
798CONFIG_USB_LIBUSUAL=y
799
800#
801# USB Imaging devices
802#
803# CONFIG_USB_MDC800 is not set
804
805#
806# USB port drivers
807#
808# CONFIG_USB_SERIAL is not set
809
810#
811# USB Miscellaneous drivers
812#
813# CONFIG_USB_EMI62 is not set
814# CONFIG_USB_EMI26 is not set
815# CONFIG_USB_ADUTUX is not set
816# CONFIG_USB_SEVSEG is not set
817# CONFIG_USB_RIO500 is not set
818# CONFIG_USB_LEGOTOWER is not set
819# CONFIG_USB_LCD is not set
820# CONFIG_USB_BERRY_CHARGE is not set
821# CONFIG_USB_LED is not set
822# CONFIG_USB_CYPRESS_CY7C63 is not set
823# CONFIG_USB_CYTHERM is not set
824# CONFIG_USB_PHIDGET is not set
825# CONFIG_USB_IDMOUSE is not set
826# CONFIG_USB_FTDI_ELAN is not set
827# CONFIG_USB_APPLEDISPLAY is not set
828# CONFIG_USB_SISUSBVGA is not set
829# CONFIG_USB_LD is not set
830# CONFIG_USB_TRANCEVIBRATOR is not set
831# CONFIG_USB_IOWARRIOR is not set
832# CONFIG_USB_TEST is not set
833# CONFIG_USB_ISIGHTFW is not set
834# CONFIG_USB_VST is not set
835# CONFIG_USB_GADGET is not set
836
837#
838# OTG and related infrastructure
839#
594# CONFIG_UWB is not set 840# CONFIG_UWB is not set
595# CONFIG_MMC is not set 841# CONFIG_MMC is not set
596# CONFIG_MEMSTICK is not set 842# CONFIG_MEMSTICK is not set
diff --git a/arch/powerpc/configs/44x/redwood_defconfig b/arch/powerpc/configs/44x/redwood_defconfig
new file mode 100644
index 000000000000..e665433762ba
--- /dev/null
+++ b/arch/powerpc/configs/44x/redwood_defconfig
@@ -0,0 +1,1176 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.29-rc3
4# Wed Feb 4 14:31:09 2009
5#
6# CONFIG_PPC64 is not set
7
8#
9# Processor support
10#
11# CONFIG_6xx is not set
12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set
15CONFIG_44x=y
16# CONFIG_E200 is not set
17CONFIG_PPC_FPU=y
18CONFIG_4xx=y
19CONFIG_BOOKE=y
20CONFIG_PTE_64BIT=y
21CONFIG_PHYS_64BIT=y
22CONFIG_PPC_MMU_NOHASH=y
23# CONFIG_PPC_MM_SLICES is not set
24CONFIG_NOT_COHERENT_CACHE=y
25CONFIG_PPC32=y
26CONFIG_WORD_SIZE=32
27CONFIG_ARCH_PHYS_ADDR_T_64BIT=y
28CONFIG_MMU=y
29CONFIG_GENERIC_CMOS_UPDATE=y
30CONFIG_GENERIC_TIME=y
31CONFIG_GENERIC_TIME_VSYSCALL=y
32CONFIG_GENERIC_CLOCKEVENTS=y
33CONFIG_GENERIC_HARDIRQS=y
34# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
35CONFIG_IRQ_PER_CPU=y
36CONFIG_STACKTRACE_SUPPORT=y
37CONFIG_HAVE_LATENCYTOP_SUPPORT=y
38CONFIG_LOCKDEP_SUPPORT=y
39CONFIG_RWSEM_XCHGADD_ALGORITHM=y
40CONFIG_ARCH_HAS_ILOG2_U32=y
41CONFIG_GENERIC_HWEIGHT=y
42CONFIG_GENERIC_CALIBRATE_DELAY=y
43CONFIG_GENERIC_FIND_NEXT_BIT=y
44# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
45CONFIG_PPC=y
46CONFIG_EARLY_PRINTK=y
47CONFIG_GENERIC_NVRAM=y
48CONFIG_SCHED_OMIT_FRAME_POINTER=y
49CONFIG_ARCH_MAY_HAVE_PC_FDC=y
50CONFIG_PPC_OF=y
51CONFIG_OF=y
52CONFIG_PPC_UDBG_16550=y
53# CONFIG_GENERIC_TBSYNC is not set
54CONFIG_AUDIT_ARCH=y
55CONFIG_GENERIC_BUG=y
56# CONFIG_DEFAULT_UIMAGE is not set
57CONFIG_PPC_DCR_NATIVE=y
58# CONFIG_PPC_DCR_MMIO is not set
59CONFIG_PPC_DCR=y
60CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
61
62#
63# General setup
64#
65CONFIG_EXPERIMENTAL=y
66CONFIG_BROKEN_ON_SMP=y
67CONFIG_INIT_ENV_ARG_LIMIT=32
68CONFIG_LOCALVERSION=""
69CONFIG_LOCALVERSION_AUTO=y
70CONFIG_SWAP=y
71CONFIG_SYSVIPC=y
72CONFIG_SYSVIPC_SYSCTL=y
73CONFIG_POSIX_MQUEUE=y
74# CONFIG_BSD_PROCESS_ACCT is not set
75# CONFIG_TASKSTATS is not set
76# CONFIG_AUDIT is not set
77
78#
79# RCU Subsystem
80#
81CONFIG_CLASSIC_RCU=y
82# CONFIG_TREE_RCU is not set
83# CONFIG_PREEMPT_RCU is not set
84# CONFIG_TREE_RCU_TRACE is not set
85# CONFIG_PREEMPT_RCU_TRACE is not set
86# CONFIG_IKCONFIG is not set
87CONFIG_LOG_BUF_SHIFT=14
88# CONFIG_GROUP_SCHED is not set
89# CONFIG_CGROUPS is not set
90CONFIG_SYSFS_DEPRECATED=y
91CONFIG_SYSFS_DEPRECATED_V2=y
92# CONFIG_RELAY is not set
93# CONFIG_NAMESPACES is not set
94CONFIG_BLK_DEV_INITRD=y
95CONFIG_INITRAMFS_SOURCE=""
96# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
97CONFIG_SYSCTL=y
98CONFIG_EMBEDDED=y
99CONFIG_SYSCTL_SYSCALL=y
100CONFIG_KALLSYMS=y
101# CONFIG_KALLSYMS_ALL is not set
102# CONFIG_KALLSYMS_EXTRA_PASS is not set
103CONFIG_HOTPLUG=y
104CONFIG_PRINTK=y
105CONFIG_BUG=y
106CONFIG_ELF_CORE=y
107CONFIG_COMPAT_BRK=y
108CONFIG_BASE_FULL=y
109CONFIG_FUTEX=y
110CONFIG_ANON_INODES=y
111CONFIG_EPOLL=y
112CONFIG_SIGNALFD=y
113CONFIG_TIMERFD=y
114CONFIG_EVENTFD=y
115CONFIG_SHMEM=y
116CONFIG_AIO=y
117CONFIG_VM_EVENT_COUNTERS=y
118CONFIG_PCI_QUIRKS=y
119CONFIG_SLUB_DEBUG=y
120# CONFIG_SLAB is not set
121CONFIG_SLUB=y
122# CONFIG_SLOB is not set
123# CONFIG_PROFILING is not set
124CONFIG_HAVE_OPROFILE=y
125# CONFIG_KPROBES is not set
126CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
127CONFIG_HAVE_IOREMAP_PROT=y
128CONFIG_HAVE_KPROBES=y
129CONFIG_HAVE_KRETPROBES=y
130CONFIG_HAVE_ARCH_TRACEHOOK=y
131# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
132CONFIG_SLABINFO=y
133CONFIG_RT_MUTEXES=y
134CONFIG_BASE_SMALL=0
135CONFIG_MODULES=y
136# CONFIG_MODULE_FORCE_LOAD is not set
137CONFIG_MODULE_UNLOAD=y
138# CONFIG_MODULE_FORCE_UNLOAD is not set
139# CONFIG_MODVERSIONS is not set
140# CONFIG_MODULE_SRCVERSION_ALL is not set
141CONFIG_BLOCK=y
142CONFIG_LBD=y
143# CONFIG_BLK_DEV_IO_TRACE is not set
144# CONFIG_BLK_DEV_BSG is not set
145# CONFIG_BLK_DEV_INTEGRITY is not set
146
147#
148# IO Schedulers
149#
150CONFIG_IOSCHED_NOOP=y
151CONFIG_IOSCHED_AS=y
152CONFIG_IOSCHED_DEADLINE=y
153CONFIG_IOSCHED_CFQ=y
154CONFIG_DEFAULT_AS=y
155# CONFIG_DEFAULT_DEADLINE is not set
156# CONFIG_DEFAULT_CFQ is not set
157# CONFIG_DEFAULT_NOOP is not set
158CONFIG_DEFAULT_IOSCHED="anticipatory"
159# CONFIG_FREEZER is not set
160CONFIG_PPC4xx_PCI_EXPRESS=y
161
162#
163# Platform support
164#
165# CONFIG_PPC_CELL is not set
166# CONFIG_PPC_CELL_NATIVE is not set
167# CONFIG_PQ2ADS is not set
168# CONFIG_BAMBOO is not set
169# CONFIG_EBONY is not set
170# CONFIG_SAM440EP is not set
171# CONFIG_SEQUOIA is not set
172# CONFIG_TAISHAN is not set
173# CONFIG_KATMAI is not set
174# CONFIG_RAINIER is not set
175# CONFIG_WARP is not set
176# CONFIG_ARCHES is not set
177# CONFIG_CANYONLANDS is not set
178# CONFIG_GLACIER is not set
179CONFIG_REDWOOD=y
180# CONFIG_YOSEMITE is not set
181# CONFIG_XILINX_VIRTEX440_GENERIC_BOARD is not set
182CONFIG_PPC44x_SIMPLE=y
183# CONFIG_PPC4xx_GPIO is not set
184CONFIG_460SX=y
185# CONFIG_IPIC is not set
186# CONFIG_MPIC is not set
187# CONFIG_MPIC_WEIRD is not set
188# CONFIG_PPC_I8259 is not set
189# CONFIG_PPC_RTAS is not set
190# CONFIG_MMIO_NVRAM is not set
191# CONFIG_PPC_MPC106 is not set
192# CONFIG_PPC_970_NAP is not set
193# CONFIG_PPC_INDIRECT_IO is not set
194# CONFIG_GENERIC_IOMAP is not set
195# CONFIG_CPU_FREQ is not set
196# CONFIG_FSL_ULI1575 is not set
197# CONFIG_SIMPLE_GPIO is not set
198
199#
200# Kernel options
201#
202# CONFIG_HIGHMEM is not set
203CONFIG_TICK_ONESHOT=y
204CONFIG_NO_HZ=y
205CONFIG_HIGH_RES_TIMERS=y
206CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
207# CONFIG_HZ_100 is not set
208CONFIG_HZ_250=y
209# CONFIG_HZ_300 is not set
210# CONFIG_HZ_1000 is not set
211CONFIG_HZ=250
212CONFIG_SCHED_HRTICK=y
213CONFIG_PREEMPT_NONE=y
214# CONFIG_PREEMPT_VOLUNTARY is not set
215# CONFIG_PREEMPT is not set
216CONFIG_BINFMT_ELF=y
217# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
218# CONFIG_HAVE_AOUT is not set
219# CONFIG_BINFMT_MISC is not set
220# CONFIG_MATH_EMULATION is not set
221# CONFIG_IOMMU_HELPER is not set
222CONFIG_PPC_NEED_DMA_SYNC_OPS=y
223CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
224CONFIG_ARCH_HAS_WALK_MEMORY=y
225CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
226CONFIG_ARCH_FLATMEM_ENABLE=y
227CONFIG_ARCH_POPULATES_NODE_MAP=y
228CONFIG_SELECT_MEMORY_MODEL=y
229CONFIG_FLATMEM_MANUAL=y
230# CONFIG_DISCONTIGMEM_MANUAL is not set
231# CONFIG_SPARSEMEM_MANUAL is not set
232CONFIG_FLATMEM=y
233CONFIG_FLAT_NODE_MEM_MAP=y
234CONFIG_PAGEFLAGS_EXTENDED=y
235CONFIG_SPLIT_PTLOCK_CPUS=4
236CONFIG_MIGRATION=y
237CONFIG_PHYS_ADDR_T_64BIT=y
238CONFIG_ZONE_DMA_FLAG=1
239CONFIG_BOUNCE=y
240CONFIG_VIRT_TO_BUS=y
241CONFIG_UNEVICTABLE_LRU=y
242CONFIG_PPC_4K_PAGES=y
243# CONFIG_PPC_16K_PAGES is not set
244# CONFIG_PPC_64K_PAGES is not set
245CONFIG_FORCE_MAX_ZONEORDER=11
246CONFIG_PROC_DEVICETREE=y
247CONFIG_CMDLINE_BOOL=y
248CONFIG_CMDLINE=""
249CONFIG_EXTRA_TARGETS=""
250CONFIG_SECCOMP=y
251CONFIG_ISA_DMA_API=y
252
253#
254# Bus options
255#
256CONFIG_ZONE_DMA=y
257CONFIG_PPC_INDIRECT_PCI=y
258CONFIG_4xx_SOC=y
259CONFIG_PPC_PCI_CHOICE=y
260CONFIG_PCI=y
261CONFIG_PCI_DOMAINS=y
262CONFIG_PCI_SYSCALL=y
263CONFIG_PCIEPORTBUS=y
264CONFIG_PCIEAER=y
265# CONFIG_PCIEASPM is not set
266CONFIG_ARCH_SUPPORTS_MSI=y
267# CONFIG_PCI_MSI is not set
268CONFIG_PCI_LEGACY=y
269# CONFIG_PCI_DEBUG is not set
270# CONFIG_PCI_STUB is not set
271# CONFIG_PCCARD is not set
272# CONFIG_HOTPLUG_PCI is not set
273# CONFIG_HAS_RAPIDIO is not set
274
275#
276# Advanced setup
277#
278# CONFIG_ADVANCED_OPTIONS is not set
279
280#
281# Default settings for advanced configuration options are used
282#
283CONFIG_LOWMEM_SIZE=0x30000000
284CONFIG_PAGE_OFFSET=0xc0000000
285CONFIG_KERNEL_START=0xc0000000
286CONFIG_PHYSICAL_START=0x00000000
287CONFIG_TASK_SIZE=0xc0000000
288CONFIG_CONSISTENT_START=0xff100000
289CONFIG_CONSISTENT_SIZE=0x00200000
290CONFIG_NET=y
291
292#
293# Networking options
294#
295CONFIG_COMPAT_NET_DEV_OPS=y
296CONFIG_PACKET=y
297# CONFIG_PACKET_MMAP is not set
298CONFIG_UNIX=y
299# CONFIG_NET_KEY is not set
300CONFIG_INET=y
301# CONFIG_IP_MULTICAST is not set
302# CONFIG_IP_ADVANCED_ROUTER is not set
303CONFIG_IP_FIB_HASH=y
304CONFIG_IP_PNP=y
305CONFIG_IP_PNP_DHCP=y
306CONFIG_IP_PNP_BOOTP=y
307# CONFIG_IP_PNP_RARP is not set
308# CONFIG_NET_IPIP is not set
309# CONFIG_NET_IPGRE is not set
310# CONFIG_ARPD is not set
311# CONFIG_SYN_COOKIES is not set
312# CONFIG_INET_AH is not set
313# CONFIG_INET_ESP is not set
314# CONFIG_INET_IPCOMP is not set
315# CONFIG_INET_XFRM_TUNNEL is not set
316# CONFIG_INET_TUNNEL is not set
317# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
318# CONFIG_INET_XFRM_MODE_TUNNEL is not set
319# CONFIG_INET_XFRM_MODE_BEET is not set
320# CONFIG_INET_LRO is not set
321CONFIG_INET_DIAG=y
322CONFIG_INET_TCP_DIAG=y
323# CONFIG_TCP_CONG_ADVANCED is not set
324CONFIG_TCP_CONG_CUBIC=y
325CONFIG_DEFAULT_TCP_CONG="cubic"
326# CONFIG_TCP_MD5SIG is not set
327# CONFIG_IPV6 is not set
328# CONFIG_NETWORK_SECMARK is not set
329# CONFIG_NETFILTER is not set
330# CONFIG_IP_DCCP is not set
331# CONFIG_IP_SCTP is not set
332# CONFIG_TIPC is not set
333# CONFIG_ATM is not set
334# CONFIG_BRIDGE is not set
335# CONFIG_NET_DSA is not set
336# CONFIG_VLAN_8021Q is not set
337# CONFIG_DECNET is not set
338# CONFIG_LLC2 is not set
339# CONFIG_IPX is not set
340# CONFIG_ATALK is not set
341# CONFIG_X25 is not set
342# CONFIG_LAPB is not set
343# CONFIG_ECONET is not set
344# CONFIG_WAN_ROUTER is not set
345# CONFIG_NET_SCHED is not set
346# CONFIG_DCB is not set
347
348#
349# Network testing
350#
351# CONFIG_NET_PKTGEN is not set
352# CONFIG_HAMRADIO is not set
353# CONFIG_CAN is not set
354# CONFIG_IRDA is not set
355# CONFIG_BT is not set
356# CONFIG_AF_RXRPC is not set
357# CONFIG_PHONET is not set
358CONFIG_WIRELESS=y
359# CONFIG_CFG80211 is not set
360CONFIG_WIRELESS_OLD_REGULATORY=y
361# CONFIG_WIRELESS_EXT is not set
362# CONFIG_LIB80211 is not set
363# CONFIG_MAC80211 is not set
364# CONFIG_WIMAX is not set
365# CONFIG_RFKILL is not set
366# CONFIG_NET_9P is not set
367
368#
369# Device Drivers
370#
371
372#
373# Generic Driver Options
374#
375CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
376CONFIG_STANDALONE=y
377CONFIG_PREVENT_FIRMWARE_BUILD=y
378CONFIG_FW_LOADER=y
379CONFIG_FIRMWARE_IN_KERNEL=y
380CONFIG_EXTRA_FIRMWARE=""
381# CONFIG_DEBUG_DRIVER is not set
382# CONFIG_DEBUG_DEVRES is not set
383# CONFIG_SYS_HYPERVISOR is not set
384CONFIG_CONNECTOR=y
385CONFIG_PROC_EVENTS=y
386CONFIG_MTD=y
387# CONFIG_MTD_DEBUG is not set
388CONFIG_MTD_CONCAT=y
389CONFIG_MTD_PARTITIONS=y
390# CONFIG_MTD_TESTS is not set
391# CONFIG_MTD_REDBOOT_PARTS is not set
392CONFIG_MTD_CMDLINE_PARTS=y
393CONFIG_MTD_OF_PARTS=y
394# CONFIG_MTD_AR7_PARTS is not set
395
396#
397# User Modules And Translation Layers
398#
399CONFIG_MTD_CHAR=y
400CONFIG_MTD_BLKDEVS=y
401CONFIG_MTD_BLOCK=y
402# CONFIG_FTL is not set
403# CONFIG_NFTL is not set
404# CONFIG_INFTL is not set
405# CONFIG_RFD_FTL is not set
406# CONFIG_SSFDC is not set
407# CONFIG_MTD_OOPS is not set
408
409#
410# RAM/ROM/Flash chip drivers
411#
412CONFIG_MTD_CFI=y
413# CONFIG_MTD_JEDECPROBE is not set
414CONFIG_MTD_GEN_PROBE=y
415# CONFIG_MTD_CFI_ADV_OPTIONS is not set
416CONFIG_MTD_MAP_BANK_WIDTH_1=y
417CONFIG_MTD_MAP_BANK_WIDTH_2=y
418CONFIG_MTD_MAP_BANK_WIDTH_4=y
419# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
420# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
421# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
422CONFIG_MTD_CFI_I1=y
423CONFIG_MTD_CFI_I2=y
424# CONFIG_MTD_CFI_I4 is not set
425# CONFIG_MTD_CFI_I8 is not set
426# CONFIG_MTD_CFI_INTELEXT is not set
427CONFIG_MTD_CFI_AMDSTD=y
428# CONFIG_MTD_CFI_STAA is not set
429CONFIG_MTD_CFI_UTIL=y
430# CONFIG_MTD_RAM is not set
431# CONFIG_MTD_ROM is not set
432# CONFIG_MTD_ABSENT is not set
433
434#
435# Mapping drivers for chip access
436#
437# CONFIG_MTD_COMPLEX_MAPPINGS is not set
438# CONFIG_MTD_PHYSMAP is not set
439CONFIG_MTD_PHYSMAP_OF=y
440# CONFIG_MTD_INTEL_VR_NOR is not set
441# CONFIG_MTD_PLATRAM is not set
442
443#
444# Self-contained MTD device drivers
445#
446# CONFIG_MTD_PMC551 is not set
447# CONFIG_MTD_SLRAM is not set
448# CONFIG_MTD_PHRAM is not set
449# CONFIG_MTD_MTDRAM is not set
450# CONFIG_MTD_BLOCK2MTD is not set
451
452#
453# Disk-On-Chip Device Drivers
454#
455# CONFIG_MTD_DOC2000 is not set
456# CONFIG_MTD_DOC2001 is not set
457# CONFIG_MTD_DOC2001PLUS is not set
458# CONFIG_MTD_NAND is not set
459# CONFIG_MTD_ONENAND is not set
460
461#
462# LPDDR flash memory drivers
463#
464# CONFIG_MTD_LPDDR is not set
465# CONFIG_MTD_QINFO_PROBE is not set
466
467#
468# UBI - Unsorted block images
469#
470# CONFIG_MTD_UBI is not set
471CONFIG_OF_DEVICE=y
472CONFIG_OF_I2C=y
473# CONFIG_PARPORT is not set
474CONFIG_BLK_DEV=y
475# CONFIG_BLK_DEV_FD is not set
476# CONFIG_BLK_CPQ_DA is not set
477# CONFIG_BLK_CPQ_CISS_DA is not set
478# CONFIG_BLK_DEV_DAC960 is not set
479# CONFIG_BLK_DEV_UMEM is not set
480# CONFIG_BLK_DEV_COW_COMMON is not set
481# CONFIG_BLK_DEV_LOOP is not set
482# CONFIG_BLK_DEV_NBD is not set
483# CONFIG_BLK_DEV_SX8 is not set
484CONFIG_BLK_DEV_RAM=y
485CONFIG_BLK_DEV_RAM_COUNT=16
486CONFIG_BLK_DEV_RAM_SIZE=35000
487# CONFIG_BLK_DEV_XIP is not set
488# CONFIG_CDROM_PKTCDVD is not set
489# CONFIG_ATA_OVER_ETH is not set
490# CONFIG_XILINX_SYSACE is not set
491# CONFIG_BLK_DEV_HD is not set
492# CONFIG_MISC_DEVICES is not set
493CONFIG_HAVE_IDE=y
494# CONFIG_IDE is not set
495
496#
497# SCSI device support
498#
499# CONFIG_RAID_ATTRS is not set
500CONFIG_SCSI=y
501CONFIG_SCSI_DMA=y
502# CONFIG_SCSI_TGT is not set
503# CONFIG_SCSI_NETLINK is not set
504CONFIG_SCSI_PROC_FS=y
505
506#
507# SCSI support type (disk, tape, CD-ROM)
508#
509CONFIG_BLK_DEV_SD=y
510# CONFIG_CHR_DEV_ST is not set
511# CONFIG_CHR_DEV_OSST is not set
512# CONFIG_BLK_DEV_SR is not set
513CONFIG_CHR_DEV_SG=y
514# CONFIG_CHR_DEV_SCH is not set
515
516#
517# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
518#
519# CONFIG_SCSI_MULTI_LUN is not set
520# CONFIG_SCSI_CONSTANTS is not set
521# CONFIG_SCSI_LOGGING is not set
522# CONFIG_SCSI_SCAN_ASYNC is not set
523CONFIG_SCSI_WAIT_SCAN=m
524
525#
526# SCSI Transports
527#
528# CONFIG_SCSI_SPI_ATTRS is not set
529# CONFIG_SCSI_FC_ATTRS is not set
530# CONFIG_SCSI_ISCSI_ATTRS is not set
531CONFIG_SCSI_SAS_ATTRS=y
532# CONFIG_SCSI_SAS_LIBSAS is not set
533# CONFIG_SCSI_SRP_ATTRS is not set
534CONFIG_SCSI_LOWLEVEL=y
535# CONFIG_ISCSI_TCP is not set
536# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
537# CONFIG_SCSI_3W_9XXX is not set
538# CONFIG_SCSI_ACARD is not set
539# CONFIG_SCSI_AACRAID is not set
540# CONFIG_SCSI_AIC7XXX is not set
541# CONFIG_SCSI_AIC7XXX_OLD is not set
542# CONFIG_SCSI_AIC79XX is not set
543# CONFIG_SCSI_AIC94XX is not set
544# CONFIG_SCSI_DPT_I2O is not set
545# CONFIG_SCSI_ADVANSYS is not set
546# CONFIG_SCSI_ARCMSR is not set
547# CONFIG_MEGARAID_NEWGEN is not set
548# CONFIG_MEGARAID_LEGACY is not set
549# CONFIG_MEGARAID_SAS is not set
550# CONFIG_SCSI_HPTIOP is not set
551# CONFIG_SCSI_BUSLOGIC is not set
552# CONFIG_LIBFC is not set
553# CONFIG_FCOE is not set
554# CONFIG_SCSI_DMX3191D is not set
555# CONFIG_SCSI_EATA is not set
556# CONFIG_SCSI_FUTURE_DOMAIN is not set
557# CONFIG_SCSI_GDTH is not set
558# CONFIG_SCSI_IPS is not set
559# CONFIG_SCSI_INITIO is not set
560# CONFIG_SCSI_INIA100 is not set
561# CONFIG_SCSI_MVSAS is not set
562# CONFIG_SCSI_STEX is not set
563# CONFIG_SCSI_SYM53C8XX_2 is not set
564# CONFIG_SCSI_QLOGIC_1280 is not set
565# CONFIG_SCSI_QLA_FC is not set
566# CONFIG_SCSI_QLA_ISCSI is not set
567# CONFIG_SCSI_LPFC is not set
568# CONFIG_SCSI_DC395x is not set
569# CONFIG_SCSI_DC390T is not set
570# CONFIG_SCSI_NSP32 is not set
571# CONFIG_SCSI_DEBUG is not set
572# CONFIG_SCSI_SRP is not set
573# CONFIG_SCSI_DH is not set
574# CONFIG_ATA is not set
575# CONFIG_MD is not set
576CONFIG_FUSION=y
577# CONFIG_FUSION_SPI is not set
578# CONFIG_FUSION_FC is not set
579CONFIG_FUSION_SAS=y
580CONFIG_FUSION_MAX_SGE=128
581# CONFIG_FUSION_CTL is not set
582# CONFIG_FUSION_LOGGING is not set
583
584#
585# IEEE 1394 (FireWire) support
586#
587
588#
589# Enable only one of the two stacks, unless you know what you are doing
590#
591# CONFIG_FIREWIRE is not set
592# CONFIG_IEEE1394 is not set
593CONFIG_I2O=y
594CONFIG_I2O_LCT_NOTIFY_ON_CHANGES=y
595CONFIG_I2O_EXT_ADAPTEC=y
596# CONFIG_I2O_CONFIG is not set
597# CONFIG_I2O_BUS is not set
598# CONFIG_I2O_BLOCK is not set
599# CONFIG_I2O_SCSI is not set
600# CONFIG_I2O_PROC is not set
601# CONFIG_MACINTOSH_DRIVERS is not set
602CONFIG_NETDEVICES=y
603# CONFIG_DUMMY is not set
604# CONFIG_BONDING is not set
605# CONFIG_MACVLAN is not set
606# CONFIG_EQUALIZER is not set
607# CONFIG_TUN is not set
608# CONFIG_VETH is not set
609# CONFIG_ARCNET is not set
610# CONFIG_PHYLIB is not set
611CONFIG_NET_ETHERNET=y
612# CONFIG_MII is not set
613# CONFIG_HAPPYMEAL is not set
614# CONFIG_SUNGEM is not set
615# CONFIG_CASSINI is not set
616# CONFIG_NET_VENDOR_3COM is not set
617# CONFIG_NET_TULIP is not set
618# CONFIG_HP100 is not set
619CONFIG_IBM_NEW_EMAC=y
620CONFIG_IBM_NEW_EMAC_RXB=256
621CONFIG_IBM_NEW_EMAC_TXB=256
622CONFIG_IBM_NEW_EMAC_POLL_WEIGHT=32
623CONFIG_IBM_NEW_EMAC_RX_COPY_THRESHOLD=256
624CONFIG_IBM_NEW_EMAC_RX_SKB_HEADROOM=0
625CONFIG_IBM_NEW_EMAC_DEBUG=y
626CONFIG_IBM_NEW_EMAC_ZMII=y
627CONFIG_IBM_NEW_EMAC_RGMII=y
628CONFIG_IBM_NEW_EMAC_TAH=y
629CONFIG_IBM_NEW_EMAC_EMAC4=y
630# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
631# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
632# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
633# CONFIG_NET_PCI is not set
634# CONFIG_B44 is not set
635# CONFIG_ATL2 is not set
636CONFIG_NETDEV_1000=y
637# CONFIG_ACENIC is not set
638# CONFIG_DL2K is not set
639# CONFIG_E1000 is not set
640CONFIG_E1000E=y
641# CONFIG_IP1000 is not set
642# CONFIG_IGB is not set
643# CONFIG_NS83820 is not set
644# CONFIG_HAMACHI is not set
645# CONFIG_YELLOWFIN is not set
646# CONFIG_R8169 is not set
647# CONFIG_SIS190 is not set
648# CONFIG_SKGE is not set
649# CONFIG_SKY2 is not set
650# CONFIG_VIA_VELOCITY is not set
651# CONFIG_TIGON3 is not set
652# CONFIG_BNX2 is not set
653# CONFIG_QLA3XXX is not set
654# CONFIG_ATL1 is not set
655# CONFIG_ATL1E is not set
656# CONFIG_JME is not set
657# CONFIG_NETDEV_10000 is not set
658# CONFIG_TR is not set
659
660#
661# Wireless LAN
662#
663# CONFIG_WLAN_PRE80211 is not set
664# CONFIG_WLAN_80211 is not set
665# CONFIG_IWLWIFI_LEDS is not set
666
667#
668# Enable WiMAX (Networking options) to see the WiMAX drivers
669#
670# CONFIG_WAN is not set
671# CONFIG_FDDI is not set
672# CONFIG_HIPPI is not set
673# CONFIG_PPP is not set
674# CONFIG_SLIP is not set
675# CONFIG_NET_FC is not set
676# CONFIG_NETCONSOLE is not set
677# CONFIG_NETPOLL is not set
678# CONFIG_NET_POLL_CONTROLLER is not set
679# CONFIG_ISDN is not set
680# CONFIG_PHONE is not set
681
682#
683# Input device support
684#
685# CONFIG_INPUT is not set
686
687#
688# Hardware I/O ports
689#
690# CONFIG_SERIO is not set
691# CONFIG_GAMEPORT is not set
692
693#
694# Character devices
695#
696# CONFIG_VT is not set
697CONFIG_DEVKMEM=y
698# CONFIG_SERIAL_NONSTANDARD is not set
699# CONFIG_NOZOMI is not set
700
701#
702# Serial drivers
703#
704CONFIG_SERIAL_8250=y
705CONFIG_SERIAL_8250_CONSOLE=y
706# CONFIG_SERIAL_8250_PCI is not set
707CONFIG_SERIAL_8250_NR_UARTS=1
708CONFIG_SERIAL_8250_RUNTIME_UARTS=1
709CONFIG_SERIAL_8250_EXTENDED=y
710# CONFIG_SERIAL_8250_MANY_PORTS is not set
711CONFIG_SERIAL_8250_SHARE_IRQ=y
712# CONFIG_SERIAL_8250_DETECT_IRQ is not set
713# CONFIG_SERIAL_8250_RSA is not set
714
715#
716# Non-8250 serial port support
717#
718# CONFIG_SERIAL_UARTLITE is not set
719CONFIG_SERIAL_CORE=y
720CONFIG_SERIAL_CORE_CONSOLE=y
721# CONFIG_SERIAL_JSM is not set
722CONFIG_SERIAL_OF_PLATFORM=y
723# CONFIG_SERIAL_OF_PLATFORM_NWPSERIAL is not set
724CONFIG_UNIX98_PTYS=y
725# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
726CONFIG_LEGACY_PTYS=y
727CONFIG_LEGACY_PTY_COUNT=256
728# CONFIG_HVC_UDBG is not set
729# CONFIG_IPMI_HANDLER is not set
730# CONFIG_HW_RANDOM is not set
731# CONFIG_NVRAM is not set
732# CONFIG_GEN_RTC is not set
733# CONFIG_R3964 is not set
734# CONFIG_APPLICOM is not set
735# CONFIG_RAW_DRIVER is not set
736# CONFIG_TCG_TPM is not set
737CONFIG_DEVPORT=y
738CONFIG_I2C=y
739CONFIG_I2C_BOARDINFO=y
740CONFIG_I2C_CHARDEV=y
741CONFIG_I2C_HELPER_AUTO=y
742
743#
744# I2C Hardware Bus support
745#
746
747#
748# PC SMBus host controller drivers
749#
750# CONFIG_I2C_ALI1535 is not set
751# CONFIG_I2C_ALI1563 is not set
752# CONFIG_I2C_ALI15X3 is not set
753# CONFIG_I2C_AMD756 is not set
754# CONFIG_I2C_AMD8111 is not set
755# CONFIG_I2C_I801 is not set
756# CONFIG_I2C_ISCH is not set
757# CONFIG_I2C_PIIX4 is not set
758# CONFIG_I2C_NFORCE2 is not set
759# CONFIG_I2C_SIS5595 is not set
760# CONFIG_I2C_SIS630 is not set
761# CONFIG_I2C_SIS96X is not set
762# CONFIG_I2C_VIA is not set
763# CONFIG_I2C_VIAPRO is not set
764
765#
766# I2C system bus drivers (mostly embedded / system-on-chip)
767#
768CONFIG_I2C_IBM_IIC=y
769# CONFIG_I2C_MPC is not set
770# CONFIG_I2C_OCORES is not set
771# CONFIG_I2C_SIMTEC is not set
772
773#
774# External I2C/SMBus adapter drivers
775#
776# CONFIG_I2C_PARPORT_LIGHT is not set
777# CONFIG_I2C_TAOS_EVM is not set
778
779#
780# Graphics adapter I2C/DDC channel drivers
781#
782# CONFIG_I2C_VOODOO3 is not set
783
784#
785# Other I2C/SMBus bus drivers
786#
787# CONFIG_I2C_PCA_PLATFORM is not set
788# CONFIG_I2C_STUB is not set
789
790#
791# Miscellaneous I2C Chip support
792#
793# CONFIG_DS1682 is not set
794# CONFIG_SENSORS_PCF8574 is not set
795# CONFIG_PCF8575 is not set
796# CONFIG_SENSORS_PCA9539 is not set
797# CONFIG_SENSORS_PCF8591 is not set
798# CONFIG_SENSORS_MAX6875 is not set
799# CONFIG_SENSORS_TSL2550 is not set
800CONFIG_I2C_DEBUG_CORE=y
801CONFIG_I2C_DEBUG_ALGO=y
802CONFIG_I2C_DEBUG_BUS=y
803CONFIG_I2C_DEBUG_CHIP=y
804# CONFIG_SPI is not set
805CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
806# CONFIG_GPIOLIB is not set
807# CONFIG_W1 is not set
808# CONFIG_POWER_SUPPLY is not set
809# CONFIG_HWMON is not set
810# CONFIG_THERMAL is not set
811# CONFIG_THERMAL_HWMON is not set
812# CONFIG_WATCHDOG is not set
813CONFIG_SSB_POSSIBLE=y
814
815#
816# Sonics Silicon Backplane
817#
818# CONFIG_SSB is not set
819
820#
821# Multifunction device drivers
822#
823# CONFIG_MFD_CORE is not set
824# CONFIG_MFD_SM501 is not set
825# CONFIG_HTC_PASIC3 is not set
826# CONFIG_TWL4030_CORE is not set
827# CONFIG_MFD_TMIO is not set
828# CONFIG_PMIC_DA903X is not set
829# CONFIG_MFD_WM8400 is not set
830# CONFIG_MFD_WM8350_I2C is not set
831# CONFIG_MFD_PCF50633 is not set
832# CONFIG_REGULATOR is not set
833
834#
835# Multimedia devices
836#
837
838#
839# Multimedia core support
840#
841# CONFIG_VIDEO_DEV is not set
842# CONFIG_DVB_CORE is not set
843# CONFIG_VIDEO_MEDIA is not set
844
845#
846# Multimedia drivers
847#
848CONFIG_DAB=y
849
850#
851# Graphics support
852#
853# CONFIG_AGP is not set
854# CONFIG_DRM is not set
855# CONFIG_VGASTATE is not set
856CONFIG_VIDEO_OUTPUT_CONTROL=m
857# CONFIG_FB is not set
858# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
859
860#
861# Display device support
862#
863# CONFIG_DISPLAY_SUPPORT is not set
864# CONFIG_SOUND is not set
865# CONFIG_USB_SUPPORT is not set
866# CONFIG_UWB is not set
867# CONFIG_MMC is not set
868# CONFIG_MEMSTICK is not set
869# CONFIG_NEW_LEDS is not set
870# CONFIG_ACCESSIBILITY is not set
871# CONFIG_INFINIBAND is not set
872# CONFIG_EDAC is not set
873# CONFIG_RTC_CLASS is not set
874CONFIG_DMADEVICES=y
875
876#
877# DMA Devices
878#
879# CONFIG_UIO is not set
880# CONFIG_STAGING is not set
881
882#
883# File systems
884#
885CONFIG_EXT2_FS=y
886# CONFIG_EXT2_FS_XATTR is not set
887# CONFIG_EXT2_FS_XIP is not set
888# CONFIG_EXT3_FS is not set
889# CONFIG_EXT4_FS is not set
890# CONFIG_REISERFS_FS is not set
891# CONFIG_JFS_FS is not set
892# CONFIG_FS_POSIX_ACL is not set
893CONFIG_FILE_LOCKING=y
894# CONFIG_XFS_FS is not set
895# CONFIG_GFS2_FS is not set
896# CONFIG_OCFS2_FS is not set
897# CONFIG_BTRFS_FS is not set
898CONFIG_DNOTIFY=y
899CONFIG_INOTIFY=y
900CONFIG_INOTIFY_USER=y
901# CONFIG_QUOTA is not set
902# CONFIG_AUTOFS_FS is not set
903# CONFIG_AUTOFS4_FS is not set
904# CONFIG_FUSE_FS is not set
905
906#
907# CD-ROM/DVD Filesystems
908#
909# CONFIG_ISO9660_FS is not set
910# CONFIG_UDF_FS is not set
911
912#
913# DOS/FAT/NT Filesystems
914#
915# CONFIG_MSDOS_FS is not set
916# CONFIG_VFAT_FS is not set
917# CONFIG_NTFS_FS is not set
918
919#
920# Pseudo filesystems
921#
922CONFIG_PROC_FS=y
923CONFIG_PROC_KCORE=y
924CONFIG_PROC_SYSCTL=y
925CONFIG_PROC_PAGE_MONITOR=y
926CONFIG_SYSFS=y
927CONFIG_TMPFS=y
928# CONFIG_TMPFS_POSIX_ACL is not set
929# CONFIG_HUGETLB_PAGE is not set
930# CONFIG_CONFIGFS_FS is not set
931CONFIG_MISC_FILESYSTEMS=y
932# CONFIG_ADFS_FS is not set
933# CONFIG_AFFS_FS is not set
934# CONFIG_HFS_FS is not set
935# CONFIG_HFSPLUS_FS is not set
936# CONFIG_BEFS_FS is not set
937# CONFIG_BFS_FS is not set
938# CONFIG_EFS_FS is not set
939# CONFIG_JFFS2_FS is not set
940CONFIG_CRAMFS=y
941# CONFIG_SQUASHFS is not set
942# CONFIG_VXFS_FS is not set
943# CONFIG_MINIX_FS is not set
944# CONFIG_OMFS_FS is not set
945# CONFIG_HPFS_FS is not set
946# CONFIG_QNX4FS_FS is not set
947# CONFIG_ROMFS_FS is not set
948# CONFIG_SYSV_FS is not set
949# CONFIG_UFS_FS is not set
950CONFIG_NETWORK_FILESYSTEMS=y
951CONFIG_NFS_FS=y
952CONFIG_NFS_V3=y
953# CONFIG_NFS_V3_ACL is not set
954# CONFIG_NFS_V4 is not set
955CONFIG_ROOT_NFS=y
956# CONFIG_NFSD is not set
957CONFIG_LOCKD=y
958CONFIG_LOCKD_V4=y
959CONFIG_NFS_COMMON=y
960CONFIG_SUNRPC=y
961# CONFIG_SUNRPC_REGISTER_V4 is not set
962# CONFIG_RPCSEC_GSS_KRB5 is not set
963# CONFIG_RPCSEC_GSS_SPKM3 is not set
964# CONFIG_SMB_FS is not set
965# CONFIG_CIFS is not set
966# CONFIG_NCP_FS is not set
967# CONFIG_CODA_FS is not set
968# CONFIG_AFS_FS is not set
969
970#
971# Partition Types
972#
973# CONFIG_PARTITION_ADVANCED is not set
974CONFIG_MSDOS_PARTITION=y
975# CONFIG_NLS is not set
976# CONFIG_DLM is not set
977
978#
979# Library routines
980#
981CONFIG_BITREVERSE=y
982CONFIG_GENERIC_FIND_LAST_BIT=y
983# CONFIG_CRC_CCITT is not set
984# CONFIG_CRC16 is not set
985# CONFIG_CRC_T10DIF is not set
986# CONFIG_CRC_ITU_T is not set
987CONFIG_CRC32=y
988# CONFIG_CRC7 is not set
989# CONFIG_LIBCRC32C is not set
990CONFIG_ZLIB_INFLATE=y
991CONFIG_PLIST=y
992CONFIG_HAS_IOMEM=y
993CONFIG_HAS_IOPORT=y
994CONFIG_HAS_DMA=y
995CONFIG_HAVE_LMB=y
996
997#
998# Kernel hacking
999#
1000# CONFIG_PRINTK_TIME is not set
1001CONFIG_ENABLE_WARN_DEPRECATED=y
1002CONFIG_ENABLE_MUST_CHECK=y
1003CONFIG_FRAME_WARN=1024
1004CONFIG_MAGIC_SYSRQ=y
1005# CONFIG_UNUSED_SYMBOLS is not set
1006CONFIG_DEBUG_FS=y
1007# CONFIG_HEADERS_CHECK is not set
1008CONFIG_DEBUG_KERNEL=y
1009# CONFIG_DEBUG_SHIRQ is not set
1010CONFIG_DETECT_SOFTLOCKUP=y
1011# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
1012CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
1013CONFIG_SCHED_DEBUG=y
1014# CONFIG_SCHEDSTATS is not set
1015# CONFIG_TIMER_STATS is not set
1016# CONFIG_DEBUG_OBJECTS is not set
1017# CONFIG_SLUB_DEBUG_ON is not set
1018# CONFIG_SLUB_STATS is not set
1019# CONFIG_DEBUG_RT_MUTEXES is not set
1020# CONFIG_RT_MUTEX_TESTER is not set
1021# CONFIG_DEBUG_SPINLOCK is not set
1022# CONFIG_DEBUG_MUTEXES is not set
1023# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1024# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1025# CONFIG_DEBUG_KOBJECT is not set
1026# CONFIG_DEBUG_BUGVERBOSE is not set
1027# CONFIG_DEBUG_INFO is not set
1028# CONFIG_DEBUG_VM is not set
1029# CONFIG_DEBUG_WRITECOUNT is not set
1030# CONFIG_DEBUG_MEMORY_INIT is not set
1031# CONFIG_DEBUG_LIST is not set
1032# CONFIG_DEBUG_SG is not set
1033# CONFIG_DEBUG_NOTIFIERS is not set
1034# CONFIG_BOOT_PRINTK_DELAY is not set
1035# CONFIG_RCU_TORTURE_TEST is not set
1036# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1037# CONFIG_BACKTRACE_SELF_TEST is not set
1038# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1039# CONFIG_FAULT_INJECTION is not set
1040# CONFIG_LATENCYTOP is not set
1041CONFIG_SYSCTL_SYSCALL_CHECK=y
1042CONFIG_HAVE_FUNCTION_TRACER=y
1043CONFIG_HAVE_DYNAMIC_FTRACE=y
1044CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1045
1046#
1047# Tracers
1048#
1049# CONFIG_FUNCTION_TRACER is not set
1050# CONFIG_SCHED_TRACER is not set
1051# CONFIG_CONTEXT_SWITCH_TRACER is not set
1052# CONFIG_BOOT_TRACER is not set
1053# CONFIG_TRACE_BRANCH_PROFILING is not set
1054# CONFIG_STACK_TRACER is not set
1055# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
1056# CONFIG_SAMPLES is not set
1057CONFIG_HAVE_ARCH_KGDB=y
1058# CONFIG_KGDB is not set
1059CONFIG_PRINT_STACK_DEPTH=64
1060# CONFIG_DEBUG_STACKOVERFLOW is not set
1061# CONFIG_DEBUG_STACK_USAGE is not set
1062# CONFIG_DEBUG_PAGEALLOC is not set
1063# CONFIG_CODE_PATCHING_SELFTEST is not set
1064# CONFIG_FTR_FIXUP_SELFTEST is not set
1065# CONFIG_MSI_BITMAP_SELFTEST is not set
1066# CONFIG_XMON is not set
1067# CONFIG_IRQSTACKS is not set
1068# CONFIG_VIRQ_DEBUG is not set
1069# CONFIG_BDI_SWITCH is not set
1070# CONFIG_PPC_EARLY_DEBUG is not set
1071
1072#
1073# Security options
1074#
1075# CONFIG_KEYS is not set
1076# CONFIG_SECURITY is not set
1077# CONFIG_SECURITYFS is not set
1078# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1079CONFIG_CRYPTO=y
1080
1081#
1082# Crypto core or helper
1083#
1084# CONFIG_CRYPTO_FIPS is not set
1085CONFIG_CRYPTO_ALGAPI=y
1086CONFIG_CRYPTO_ALGAPI2=y
1087CONFIG_CRYPTO_AEAD=y
1088CONFIG_CRYPTO_AEAD2=y
1089CONFIG_CRYPTO_BLKCIPHER=y
1090CONFIG_CRYPTO_BLKCIPHER2=y
1091CONFIG_CRYPTO_HASH=y
1092CONFIG_CRYPTO_HASH2=y
1093CONFIG_CRYPTO_RNG=y
1094CONFIG_CRYPTO_RNG2=y
1095CONFIG_CRYPTO_MANAGER=y
1096CONFIG_CRYPTO_MANAGER2=y
1097CONFIG_CRYPTO_GF128MUL=y
1098# CONFIG_CRYPTO_NULL is not set
1099CONFIG_CRYPTO_CRYPTD=y
1100CONFIG_CRYPTO_AUTHENC=y
1101# CONFIG_CRYPTO_TEST is not set
1102
1103#
1104# Authenticated Encryption with Associated Data
1105#
1106CONFIG_CRYPTO_CCM=y
1107CONFIG_CRYPTO_GCM=y
1108CONFIG_CRYPTO_SEQIV=y
1109
1110#
1111# Block modes
1112#
1113CONFIG_CRYPTO_CBC=y
1114CONFIG_CRYPTO_CTR=y
1115CONFIG_CRYPTO_CTS=y
1116CONFIG_CRYPTO_ECB=y
1117CONFIG_CRYPTO_LRW=y
1118CONFIG_CRYPTO_PCBC=y
1119CONFIG_CRYPTO_XTS=y
1120
1121#
1122# Hash modes
1123#
1124CONFIG_CRYPTO_HMAC=y
1125CONFIG_CRYPTO_XCBC=y
1126
1127#
1128# Digest
1129#
1130# CONFIG_CRYPTO_CRC32C is not set
1131CONFIG_CRYPTO_MD4=y
1132CONFIG_CRYPTO_MD5=y
1133# CONFIG_CRYPTO_MICHAEL_MIC is not set
1134# CONFIG_CRYPTO_RMD128 is not set
1135# CONFIG_CRYPTO_RMD160 is not set
1136# CONFIG_CRYPTO_RMD256 is not set
1137# CONFIG_CRYPTO_RMD320 is not set
1138CONFIG_CRYPTO_SHA1=y
1139CONFIG_CRYPTO_SHA256=y
1140CONFIG_CRYPTO_SHA512=y
1141# CONFIG_CRYPTO_TGR192 is not set
1142# CONFIG_CRYPTO_WP512 is not set
1143
1144#
1145# Ciphers
1146#
1147CONFIG_CRYPTO_AES=y
1148# CONFIG_CRYPTO_ANUBIS is not set
1149CONFIG_CRYPTO_ARC4=y
1150CONFIG_CRYPTO_BLOWFISH=y
1151# CONFIG_CRYPTO_CAMELLIA is not set
1152# CONFIG_CRYPTO_CAST5 is not set
1153# CONFIG_CRYPTO_CAST6 is not set
1154CONFIG_CRYPTO_DES=y
1155# CONFIG_CRYPTO_FCRYPT is not set
1156# CONFIG_CRYPTO_KHAZAD is not set
1157# CONFIG_CRYPTO_SALSA20 is not set
1158# CONFIG_CRYPTO_SEED is not set
1159# CONFIG_CRYPTO_SERPENT is not set
1160# CONFIG_CRYPTO_TEA is not set
1161# CONFIG_CRYPTO_TWOFISH is not set
1162
1163#
1164# Compression
1165#
1166# CONFIG_CRYPTO_DEFLATE is not set
1167# CONFIG_CRYPTO_LZO is not set
1168
1169#
1170# Random Number Generation
1171#
1172# CONFIG_CRYPTO_ANSI_CPRNG is not set
1173CONFIG_CRYPTO_HW=y
1174# CONFIG_CRYPTO_DEV_HIFN_795X is not set
1175# CONFIG_PPC_CLOCK is not set
1176# CONFIG_VIRTUALIZATION is not set
diff --git a/arch/powerpc/configs/85xx/socrates_defconfig b/arch/powerpc/configs/85xx/socrates_defconfig
new file mode 100644
index 000000000000..0cc9048290a8
--- /dev/null
+++ b/arch/powerpc/configs/85xx/socrates_defconfig
@@ -0,0 +1,1410 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.26.2
4# Sat Oct 18 11:06:13 2008
5#
6# CONFIG_PPC64 is not set
7
8#
9# Processor support
10#
11# CONFIG_6xx is not set
12CONFIG_PPC_85xx=y
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_E500=y
18CONFIG_BOOKE=y
19CONFIG_FSL_BOOKE=y
20CONFIG_FSL_EMB_PERFMON=y
21# CONFIG_PHYS_64BIT is not set
22CONFIG_SPE=y
23# CONFIG_PPC_MM_SLICES is not set
24CONFIG_PPC32=y
25CONFIG_WORD_SIZE=32
26CONFIG_PPC_MERGE=y
27CONFIG_MMU=y
28CONFIG_GENERIC_CMOS_UPDATE=y
29CONFIG_GENERIC_TIME=y
30CONFIG_GENERIC_TIME_VSYSCALL=y
31CONFIG_GENERIC_CLOCKEVENTS=y
32CONFIG_GENERIC_HARDIRQS=y
33# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
34CONFIG_IRQ_PER_CPU=y
35CONFIG_STACKTRACE_SUPPORT=y
36CONFIG_LOCKDEP_SUPPORT=y
37CONFIG_RWSEM_XCHGADD_ALGORITHM=y
38CONFIG_ARCH_HAS_ILOG2_U32=y
39CONFIG_GENERIC_HWEIGHT=y
40CONFIG_GENERIC_CALIBRATE_DELAY=y
41CONFIG_GENERIC_FIND_NEXT_BIT=y
42# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
43CONFIG_PPC=y
44CONFIG_EARLY_PRINTK=y
45CONFIG_GENERIC_NVRAM=y
46CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
47CONFIG_ARCH_MAY_HAVE_PC_FDC=y
48CONFIG_PPC_OF=y
49CONFIG_OF=y
50CONFIG_PPC_UDBG_16550=y
51# CONFIG_GENERIC_TBSYNC is not set
52CONFIG_AUDIT_ARCH=y
53CONFIG_GENERIC_BUG=y
54CONFIG_DEFAULT_UIMAGE=y
55# CONFIG_PPC_DCR_NATIVE is not set
56# CONFIG_PPC_DCR_MMIO is not set
57CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
58
59#
60# General setup
61#
62CONFIG_EXPERIMENTAL=y
63CONFIG_BROKEN_ON_SMP=y
64CONFIG_INIT_ENV_ARG_LIMIT=32
65CONFIG_LOCALVERSION=""
66CONFIG_LOCALVERSION_AUTO=y
67CONFIG_SWAP=y
68CONFIG_SYSVIPC=y
69CONFIG_SYSVIPC_SYSCTL=y
70# CONFIG_POSIX_MQUEUE is not set
71# CONFIG_BSD_PROCESS_ACCT is not set
72# CONFIG_TASKSTATS is not set
73# CONFIG_AUDIT is not set
74# CONFIG_IKCONFIG is not set
75CONFIG_LOG_BUF_SHIFT=16
76# CONFIG_CGROUPS is not set
77CONFIG_GROUP_SCHED=y
78CONFIG_FAIR_GROUP_SCHED=y
79# CONFIG_RT_GROUP_SCHED is not set
80CONFIG_USER_SCHED=y
81# CONFIG_CGROUP_SCHED is not set
82CONFIG_SYSFS_DEPRECATED=y
83CONFIG_SYSFS_DEPRECATED_V2=y
84# CONFIG_RELAY is not set
85# CONFIG_NAMESPACES is not set
86CONFIG_BLK_DEV_INITRD=y
87CONFIG_INITRAMFS_SOURCE=""
88# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
89CONFIG_SYSCTL=y
90CONFIG_EMBEDDED=y
91CONFIG_SYSCTL_SYSCALL=y
92CONFIG_SYSCTL_SYSCALL_CHECK=y
93# CONFIG_KALLSYMS is not set
94# CONFIG_HOTPLUG is not set
95CONFIG_PRINTK=y
96CONFIG_BUG=y
97CONFIG_ELF_CORE=y
98CONFIG_COMPAT_BRK=y
99CONFIG_BASE_FULL=y
100CONFIG_FUTEX=y
101CONFIG_ANON_INODES=y
102# CONFIG_EPOLL is not set
103CONFIG_SIGNALFD=y
104CONFIG_TIMERFD=y
105CONFIG_EVENTFD=y
106CONFIG_SHMEM=y
107CONFIG_VM_EVENT_COUNTERS=y
108CONFIG_SLUB_DEBUG=y
109# CONFIG_SLAB is not set
110CONFIG_SLUB=y
111# CONFIG_SLOB is not set
112# CONFIG_PROFILING is not set
113# CONFIG_MARKERS is not set
114CONFIG_HAVE_OPROFILE=y
115CONFIG_HAVE_KPROBES=y
116CONFIG_HAVE_KRETPROBES=y
117# CONFIG_HAVE_DMA_ATTRS is not set
118CONFIG_PROC_PAGE_MONITOR=y
119CONFIG_SLABINFO=y
120CONFIG_RT_MUTEXES=y
121# CONFIG_TINY_SHMEM is not set
122CONFIG_BASE_SMALL=0
123CONFIG_MODULES=y
124# CONFIG_MODULE_FORCE_LOAD is not set
125CONFIG_MODULE_UNLOAD=y
126CONFIG_MODULE_FORCE_UNLOAD=y
127# CONFIG_MODVERSIONS is not set
128# CONFIG_MODULE_SRCVERSION_ALL is not set
129# CONFIG_KMOD is not set
130CONFIG_BLOCK=y
131# CONFIG_LBD is not set
132# CONFIG_BLK_DEV_IO_TRACE is not set
133# CONFIG_LSF is not set
134# CONFIG_BLK_DEV_BSG is not set
135
136#
137# IO Schedulers
138#
139CONFIG_IOSCHED_NOOP=y
140CONFIG_IOSCHED_AS=y
141CONFIG_IOSCHED_DEADLINE=y
142CONFIG_IOSCHED_CFQ=y
143CONFIG_DEFAULT_AS=y
144# CONFIG_DEFAULT_DEADLINE is not set
145# CONFIG_DEFAULT_CFQ is not set
146# CONFIG_DEFAULT_NOOP is not set
147CONFIG_DEFAULT_IOSCHED="anticipatory"
148CONFIG_CLASSIC_RCU=y
149
150#
151# Platform support
152#
153# CONFIG_PPC_MPC512x is not set
154# CONFIG_PPC_MPC5121 is not set
155# CONFIG_PPC_CELL is not set
156# CONFIG_PPC_CELL_NATIVE is not set
157# CONFIG_PQ2ADS is not set
158CONFIG_MPC85xx=y
159# CONFIG_MPC8540_ADS is not set
160# CONFIG_MPC8560_ADS is not set
161# CONFIG_MPC85xx_CDS is not set
162# CONFIG_MPC85xx_MDS is not set
163# CONFIG_MPC85xx_DS is not set
164CONFIG_SOCRATES=y
165# CONFIG_KSI8560 is not set
166# CONFIG_STX_GP3 is not set
167# CONFIG_TQM8540 is not set
168# CONFIG_TQM8541 is not set
169# CONFIG_TQM8555 is not set
170# CONFIG_TQM8560 is not set
171# CONFIG_SBC8548 is not set
172# CONFIG_SBC8560 is not set
173# CONFIG_IPIC is not set
174CONFIG_MPIC=y
175# CONFIG_MPIC_WEIRD is not set
176# CONFIG_PPC_I8259 is not set
177# CONFIG_PPC_RTAS is not set
178# CONFIG_MMIO_NVRAM is not set
179# CONFIG_PPC_MPC106 is not set
180# CONFIG_PPC_970_NAP is not set
181# CONFIG_PPC_INDIRECT_IO is not set
182# CONFIG_GENERIC_IOMAP is not set
183# CONFIG_CPU_FREQ is not set
184# CONFIG_CPM2 is not set
185# CONFIG_FSL_ULI1575 is not set
186
187#
188# Kernel options
189#
190# CONFIG_HIGHMEM is not set
191# CONFIG_TICK_ONESHOT is not set
192# CONFIG_NO_HZ is not set
193# CONFIG_HIGH_RES_TIMERS is not set
194CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
195# CONFIG_HZ_100 is not set
196CONFIG_HZ_250=y
197# CONFIG_HZ_300 is not set
198# CONFIG_HZ_1000 is not set
199CONFIG_HZ=250
200# CONFIG_SCHED_HRTICK is not set
201CONFIG_PREEMPT_NONE=y
202# CONFIG_PREEMPT_VOLUNTARY is not set
203# CONFIG_PREEMPT is not set
204CONFIG_BINFMT_ELF=y
205# CONFIG_BINFMT_MISC is not set
206CONFIG_MATH_EMULATION=y
207# CONFIG_IOMMU_HELPER is not set
208CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
209CONFIG_ARCH_HAS_WALK_MEMORY=y
210CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
211CONFIG_ARCH_FLATMEM_ENABLE=y
212CONFIG_ARCH_POPULATES_NODE_MAP=y
213CONFIG_SELECT_MEMORY_MODEL=y
214CONFIG_FLATMEM_MANUAL=y
215# CONFIG_DISCONTIGMEM_MANUAL is not set
216# CONFIG_SPARSEMEM_MANUAL is not set
217CONFIG_FLATMEM=y
218CONFIG_FLAT_NODE_MEM_MAP=y
219# CONFIG_SPARSEMEM_STATIC is not set
220# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
221CONFIG_PAGEFLAGS_EXTENDED=y
222CONFIG_SPLIT_PTLOCK_CPUS=4
223# CONFIG_RESOURCES_64BIT is not set
224CONFIG_ZONE_DMA_FLAG=1
225CONFIG_BOUNCE=y
226CONFIG_VIRT_TO_BUS=y
227CONFIG_FORCE_MAX_ZONEORDER=11
228# CONFIG_PROC_DEVICETREE is not set
229# CONFIG_CMDLINE_BOOL is not set
230# CONFIG_PM is not set
231CONFIG_SECCOMP=y
232CONFIG_ISA_DMA_API=y
233
234#
235# Bus options
236#
237CONFIG_ZONE_DMA=y
238CONFIG_PPC_INDIRECT_PCI=y
239CONFIG_FSL_SOC=y
240CONFIG_FSL_PCI=y
241CONFIG_PCI=y
242CONFIG_PCI_DOMAINS=y
243CONFIG_PCI_SYSCALL=y
244# CONFIG_PCIEPORTBUS is not set
245CONFIG_ARCH_SUPPORTS_MSI=y
246# CONFIG_PCI_MSI is not set
247CONFIG_PCI_LEGACY=y
248# CONFIG_HAS_RAPIDIO is not set
249
250#
251# Advanced setup
252#
253# CONFIG_ADVANCED_OPTIONS is not set
254
255#
256# Default settings for advanced configuration options are used
257#
258CONFIG_LOWMEM_SIZE=0x30000000
259CONFIG_PAGE_OFFSET=0xc0000000
260CONFIG_KERNEL_START=0xc0000000
261CONFIG_PHYSICAL_START=0x00000000
262CONFIG_PHYSICAL_ALIGN=0x10000000
263CONFIG_TASK_SIZE=0xc0000000
264
265#
266# Networking
267#
268CONFIG_NET=y
269
270#
271# Networking options
272#
273CONFIG_PACKET=y
274# CONFIG_PACKET_MMAP is not set
275CONFIG_UNIX=y
276CONFIG_XFRM=y
277# CONFIG_XFRM_USER is not set
278# CONFIG_XFRM_SUB_POLICY is not set
279# CONFIG_XFRM_MIGRATE is not set
280# CONFIG_XFRM_STATISTICS is not set
281# CONFIG_NET_KEY is not set
282CONFIG_INET=y
283CONFIG_IP_MULTICAST=y
284# CONFIG_IP_ADVANCED_ROUTER is not set
285CONFIG_IP_FIB_HASH=y
286CONFIG_IP_PNP=y
287CONFIG_IP_PNP_DHCP=y
288CONFIG_IP_PNP_BOOTP=y
289# CONFIG_IP_PNP_RARP is not set
290# CONFIG_NET_IPIP is not set
291# CONFIG_NET_IPGRE is not set
292# CONFIG_IP_MROUTE is not set
293# CONFIG_ARPD is not set
294CONFIG_SYN_COOKIES=y
295# CONFIG_INET_AH is not set
296# CONFIG_INET_ESP is not set
297# CONFIG_INET_IPCOMP is not set
298# CONFIG_INET_XFRM_TUNNEL is not set
299# CONFIG_INET_TUNNEL is not set
300CONFIG_INET_XFRM_MODE_TRANSPORT=y
301CONFIG_INET_XFRM_MODE_TUNNEL=y
302CONFIG_INET_XFRM_MODE_BEET=y
303# CONFIG_INET_LRO is not set
304CONFIG_INET_DIAG=y
305CONFIG_INET_TCP_DIAG=y
306# CONFIG_TCP_CONG_ADVANCED is not set
307CONFIG_TCP_CONG_CUBIC=y
308CONFIG_DEFAULT_TCP_CONG="cubic"
309# CONFIG_TCP_MD5SIG is not set
310# CONFIG_IPV6 is not set
311# CONFIG_NETWORK_SECMARK is not set
312# CONFIG_NETFILTER is not set
313# CONFIG_IP_DCCP is not set
314# CONFIG_IP_SCTP is not set
315# CONFIG_TIPC is not set
316# CONFIG_ATM is not set
317# CONFIG_BRIDGE is not set
318# CONFIG_VLAN_8021Q is not set
319# CONFIG_DECNET is not set
320# CONFIG_LLC2 is not set
321# CONFIG_IPX is not set
322# CONFIG_ATALK is not set
323# CONFIG_X25 is not set
324# CONFIG_LAPB is not set
325# CONFIG_ECONET is not set
326# CONFIG_WAN_ROUTER is not set
327# CONFIG_NET_SCHED is not set
328
329#
330# Network testing
331#
332# CONFIG_NET_PKTGEN is not set
333# CONFIG_HAMRADIO is not set
334CONFIG_CAN=y
335CONFIG_CAN_RAW=y
336CONFIG_CAN_BCM=y
337
338#
339# CAN Device Drivers
340#
341# CONFIG_CAN_VCAN is not set
342# CONFIG_CAN_OLD_DRIVERS is not set
343# CONFIG_CAN_SLCAN is not set
344CONFIG_CAN_SJA1000=y
345CONFIG_CAN_SJA1000_MEM_OF=y
346# CONFIG_CAN_EMS_PCI is not set
347# CONFIG_CAN_IXXAT_PCI is not set
348# CONFIG_CAN_PEAK_PCI is not set
349# CONFIG_CAN_KVASER_PCI is not set
350# CONFIG_CAN_MSCAN is not set
351# CONFIG_CAN_DEBUG_DEVICES is not set
352# CONFIG_IRDA is not set
353# CONFIG_BT is not set
354# CONFIG_AF_RXRPC is not set
355
356#
357# Wireless
358#
359# CONFIG_CFG80211 is not set
360# CONFIG_WIRELESS_EXT is not set
361# CONFIG_MAC80211 is not set
362# CONFIG_IEEE80211 is not set
363# CONFIG_RFKILL is not set
364# CONFIG_NET_9P is not set
365
366#
367# Device Drivers
368#
369
370#
371# Generic Driver Options
372#
373CONFIG_STANDALONE=y
374CONFIG_PREVENT_FIRMWARE_BUILD=y
375# CONFIG_SYS_HYPERVISOR is not set
376# CONFIG_CONNECTOR is not set
377CONFIG_MTD=y
378# CONFIG_MTD_DEBUG is not set
379CONFIG_MTD_CONCAT=y
380CONFIG_MTD_PARTITIONS=y
381# CONFIG_MTD_REDBOOT_PARTS is not set
382CONFIG_MTD_CMDLINE_PARTS=y
383CONFIG_MTD_OF_PARTS=y
384# CONFIG_MTD_AR7_PARTS is not set
385
386#
387# User Modules And Translation Layers
388#
389CONFIG_MTD_CHAR=y
390CONFIG_MTD_BLKDEVS=y
391CONFIG_MTD_BLOCK=y
392# CONFIG_FTL is not set
393# CONFIG_NFTL is not set
394# CONFIG_INFTL is not set
395# CONFIG_RFD_FTL is not set
396# CONFIG_SSFDC is not set
397# CONFIG_MTD_OOPS is not set
398
399#
400# RAM/ROM/Flash chip drivers
401#
402CONFIG_MTD_CFI=y
403CONFIG_MTD_JEDECPROBE=y
404CONFIG_MTD_GEN_PROBE=y
405# CONFIG_MTD_CFI_ADV_OPTIONS is not set
406CONFIG_MTD_MAP_BANK_WIDTH_1=y
407CONFIG_MTD_MAP_BANK_WIDTH_2=y
408CONFIG_MTD_MAP_BANK_WIDTH_4=y
409# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
410# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
411# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
412CONFIG_MTD_CFI_I1=y
413CONFIG_MTD_CFI_I2=y
414# CONFIG_MTD_CFI_I4 is not set
415# CONFIG_MTD_CFI_I8 is not set
416# CONFIG_MTD_CFI_INTELEXT is not set
417CONFIG_MTD_CFI_AMDSTD=y
418# CONFIG_MTD_CFI_STAA is not set
419CONFIG_MTD_CFI_UTIL=y
420# CONFIG_MTD_RAM is not set
421# CONFIG_MTD_ROM is not set
422# CONFIG_MTD_ABSENT is not set
423
424#
425# Mapping drivers for chip access
426#
427# CONFIG_MTD_COMPLEX_MAPPINGS is not set
428# CONFIG_MTD_PHYSMAP is not set
429CONFIG_MTD_PHYSMAP_OF=y
430# CONFIG_MTD_INTEL_VR_NOR is not set
431# CONFIG_MTD_PLATRAM is not set
432
433#
434# Self-contained MTD device drivers
435#
436# CONFIG_MTD_PMC551 is not set
437# CONFIG_MTD_DATAFLASH is not set
438# CONFIG_MTD_M25P80 is not set
439# CONFIG_MTD_SLRAM is not set
440# CONFIG_MTD_PHRAM is not set
441# CONFIG_MTD_MTDRAM is not set
442# CONFIG_MTD_BLOCK2MTD is not set
443
444#
445# Disk-On-Chip Device Drivers
446#
447# CONFIG_MTD_DOC2000 is not set
448# CONFIG_MTD_DOC2001 is not set
449# CONFIG_MTD_DOC2001PLUS is not set
450CONFIG_MTD_NAND=y
451# CONFIG_MTD_NAND_VERIFY_WRITE is not set
452# CONFIG_MTD_NAND_ECC_SMC is not set
453# CONFIG_MTD_NAND_MUSEUM_IDS is not set
454CONFIG_MTD_NAND_IDS=y
455# CONFIG_MTD_NAND_DISKONCHIP is not set
456# CONFIG_MTD_NAND_CAFE is not set
457# CONFIG_MTD_NAND_NANDSIM is not set
458# CONFIG_MTD_NAND_PLATFORM is not set
459# CONFIG_MTD_ALAUDA is not set
460# CONFIG_MTD_NAND_FSL_ELBC is not set
461CONFIG_MTD_NAND_SOCRATES=y
462# CONFIG_MTD_ONENAND is not set
463
464#
465# UBI - Unsorted block images
466#
467# CONFIG_MTD_UBI is not set
468CONFIG_OF_DEVICE=y
469CONFIG_OF_I2C=y
470# CONFIG_PARPORT is not set
471CONFIG_BLK_DEV=y
472# CONFIG_BLK_DEV_FD is not set
473# CONFIG_BLK_CPQ_DA is not set
474# CONFIG_BLK_CPQ_CISS_DA is not set
475# CONFIG_BLK_DEV_DAC960 is not set
476# CONFIG_BLK_DEV_UMEM is not set
477# CONFIG_BLK_DEV_COW_COMMON is not set
478CONFIG_BLK_DEV_LOOP=y
479# CONFIG_BLK_DEV_CRYPTOLOOP is not set
480# CONFIG_BLK_DEV_NBD is not set
481# CONFIG_BLK_DEV_SX8 is not set
482# CONFIG_BLK_DEV_UB is not set
483CONFIG_BLK_DEV_RAM=y
484CONFIG_BLK_DEV_RAM_COUNT=16
485CONFIG_BLK_DEV_RAM_SIZE=32768
486# CONFIG_BLK_DEV_XIP is not set
487# CONFIG_CDROM_PKTCDVD is not set
488# CONFIG_ATA_OVER_ETH is not set
489CONFIG_MISC_DEVICES=y
490# CONFIG_PHANTOM is not set
491# CONFIG_EEPROM_93CX6 is not set
492# CONFIG_SGI_IOC4 is not set
493# CONFIG_TIFM_CORE is not set
494# CONFIG_ENCLOSURE_SERVICES is not set
495CONFIG_HAVE_IDE=y
496# CONFIG_IDE is not set
497
498#
499# SCSI device support
500#
501# CONFIG_RAID_ATTRS is not set
502CONFIG_SCSI=y
503CONFIG_SCSI_DMA=y
504# CONFIG_SCSI_TGT is not set
505# CONFIG_SCSI_NETLINK is not set
506CONFIG_SCSI_PROC_FS=y
507
508#
509# SCSI support type (disk, tape, CD-ROM)
510#
511CONFIG_BLK_DEV_SD=y
512# CONFIG_CHR_DEV_ST is not set
513# CONFIG_CHR_DEV_OSST is not set
514# CONFIG_BLK_DEV_SR is not set
515# CONFIG_CHR_DEV_SG is not set
516# CONFIG_CHR_DEV_SCH is not set
517
518#
519# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
520#
521# CONFIG_SCSI_MULTI_LUN is not set
522# CONFIG_SCSI_CONSTANTS is not set
523# CONFIG_SCSI_LOGGING is not set
524# CONFIG_SCSI_SCAN_ASYNC is not set
525CONFIG_SCSI_WAIT_SCAN=m
526
527#
528# SCSI Transports
529#
530# CONFIG_SCSI_SPI_ATTRS is not set
531# CONFIG_SCSI_FC_ATTRS is not set
532# CONFIG_SCSI_ISCSI_ATTRS is not set
533# CONFIG_SCSI_SAS_LIBSAS is not set
534# CONFIG_SCSI_SRP_ATTRS is not set
535# CONFIG_SCSI_LOWLEVEL is not set
536# CONFIG_ATA is not set
537# CONFIG_MD is not set
538# CONFIG_FUSION is not set
539
540#
541# IEEE 1394 (FireWire) support
542#
543
544#
545# Enable only one of the two stacks, unless you know what you are doing
546#
547# CONFIG_FIREWIRE is not set
548# CONFIG_IEEE1394 is not set
549# CONFIG_I2O is not set
550# CONFIG_MACINTOSH_DRIVERS is not set
551CONFIG_NETDEVICES=y
552# CONFIG_NETDEVICES_MULTIQUEUE is not set
553# CONFIG_DUMMY is not set
554# CONFIG_BONDING is not set
555# CONFIG_MACVLAN is not set
556# CONFIG_EQUALIZER is not set
557# CONFIG_TUN is not set
558# CONFIG_VETH is not set
559# CONFIG_ARCNET is not set
560CONFIG_PHYLIB=y
561
562#
563# MII PHY device drivers
564#
565CONFIG_MARVELL_PHY=y
566# CONFIG_DAVICOM_PHY is not set
567# CONFIG_QSEMI_PHY is not set
568# CONFIG_LXT_PHY is not set
569# CONFIG_CICADA_PHY is not set
570# CONFIG_VITESSE_PHY is not set
571# CONFIG_SMSC_PHY is not set
572# CONFIG_BROADCOM_PHY is not set
573# CONFIG_ICPLUS_PHY is not set
574# CONFIG_REALTEK_PHY is not set
575# CONFIG_FIXED_PHY is not set
576# CONFIG_MDIO_BITBANG is not set
577CONFIG_NET_ETHERNET=y
578CONFIG_MII=y
579# CONFIG_HAPPYMEAL is not set
580# CONFIG_SUNGEM is not set
581# CONFIG_CASSINI is not set
582# CONFIG_NET_VENDOR_3COM is not set
583# CONFIG_ENC28J60 is not set
584# CONFIG_NET_TULIP is not set
585# CONFIG_HP100 is not set
586# CONFIG_IBM_NEW_EMAC_ZMII is not set
587# CONFIG_IBM_NEW_EMAC_RGMII is not set
588# CONFIG_IBM_NEW_EMAC_TAH is not set
589# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
590# CONFIG_NET_PCI is not set
591# CONFIG_B44 is not set
592CONFIG_NETDEV_1000=y
593# CONFIG_ACENIC is not set
594# CONFIG_DL2K is not set
595# CONFIG_E1000 is not set
596# CONFIG_E1000E is not set
597# CONFIG_E1000E_ENABLED is not set
598# CONFIG_IP1000 is not set
599# CONFIG_IGB is not set
600# CONFIG_NS83820 is not set
601# CONFIG_HAMACHI is not set
602# CONFIG_YELLOWFIN is not set
603# CONFIG_R8169 is not set
604# CONFIG_SIS190 is not set
605# CONFIG_SKGE is not set
606# CONFIG_SKY2 is not set
607# CONFIG_VIA_VELOCITY is not set
608# CONFIG_TIGON3 is not set
609# CONFIG_BNX2 is not set
610CONFIG_GIANFAR=y
611CONFIG_GFAR_NAPI=y
612# CONFIG_QLA3XXX is not set
613# CONFIG_ATL1 is not set
614# CONFIG_NETDEV_10000 is not set
615# CONFIG_TR is not set
616
617#
618# Wireless LAN
619#
620# CONFIG_WLAN_PRE80211 is not set
621# CONFIG_WLAN_80211 is not set
622# CONFIG_IWLWIFI_LEDS is not set
623
624#
625# USB Network Adapters
626#
627# CONFIG_USB_CATC is not set
628# CONFIG_USB_KAWETH is not set
629# CONFIG_USB_PEGASUS is not set
630# CONFIG_USB_RTL8150 is not set
631# CONFIG_USB_USBNET is not set
632# CONFIG_WAN is not set
633# CONFIG_FDDI is not set
634# CONFIG_HIPPI is not set
635# CONFIG_PPP is not set
636# CONFIG_SLIP is not set
637# CONFIG_NET_FC 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
651#
652# Userland interfaces
653#
654CONFIG_INPUT_MOUSEDEV=y
655CONFIG_INPUT_MOUSEDEV_PSAUX=y
656CONFIG_INPUT_MOUSEDEV_SCREEN_X=800
657CONFIG_INPUT_MOUSEDEV_SCREEN_Y=480
658# CONFIG_INPUT_JOYDEV is not set
659CONFIG_INPUT_EVDEV=y
660# CONFIG_INPUT_EVBUG is not set
661
662#
663# Input Device Drivers
664#
665# CONFIG_INPUT_KEYBOARD is not set
666# CONFIG_INPUT_MOUSE is not set
667# CONFIG_INPUT_JOYSTICK is not set
668# CONFIG_INPUT_TABLET is not set
669CONFIG_INPUT_TOUCHSCREEN=y
670# CONFIG_TOUCHSCREEN_ADS7846 is not set
671# CONFIG_TOUCHSCREEN_FUJITSU is not set
672# CONFIG_TOUCHSCREEN_GUNZE is not set
673# CONFIG_TOUCHSCREEN_ELO is not set
674# CONFIG_TOUCHSCREEN_MTOUCH is not set
675# CONFIG_TOUCHSCREEN_MK712 is not set
676# CONFIG_TOUCHSCREEN_PENMOUNT is not set
677# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
678# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
679# CONFIG_TOUCHSCREEN_UCB1400 is not set
680CONFIG_TOUCHSCREEN_TSC2003=y
681# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
682# CONFIG_INPUT_MISC is not set
683
684#
685# Hardware I/O ports
686#
687# CONFIG_SERIO is not set
688# CONFIG_GAMEPORT is not set
689
690#
691# Character devices
692#
693CONFIG_VT=y
694CONFIG_VT_CONSOLE=y
695CONFIG_HW_CONSOLE=y
696# CONFIG_VT_HW_CONSOLE_BINDING is not set
697CONFIG_DEVKMEM=y
698# CONFIG_SERIAL_NONSTANDARD is not set
699# CONFIG_NOZOMI is not set
700
701#
702# Serial drivers
703#
704CONFIG_SERIAL_8250=y
705CONFIG_SERIAL_8250_CONSOLE=y
706CONFIG_SERIAL_8250_PCI=y
707CONFIG_SERIAL_8250_NR_UARTS=2
708CONFIG_SERIAL_8250_RUNTIME_UARTS=2
709CONFIG_SERIAL_8250_EXTENDED=y
710CONFIG_SERIAL_8250_MANY_PORTS=y
711CONFIG_SERIAL_8250_SHARE_IRQ=y
712CONFIG_SERIAL_8250_DETECT_IRQ=y
713CONFIG_SERIAL_8250_RSA=y
714
715#
716# Non-8250 serial port support
717#
718# CONFIG_SERIAL_UARTLITE is not set
719CONFIG_SERIAL_CORE=y
720CONFIG_SERIAL_CORE_CONSOLE=y
721# CONFIG_SERIAL_JSM is not set
722# CONFIG_SERIAL_OF_PLATFORM is not set
723CONFIG_UNIX98_PTYS=y
724CONFIG_LEGACY_PTYS=y
725CONFIG_LEGACY_PTY_COUNT=256
726# CONFIG_IPMI_HANDLER is not set
727CONFIG_HW_RANDOM=y
728# CONFIG_NVRAM is not set
729# CONFIG_R3964 is not set
730# CONFIG_APPLICOM is not set
731# CONFIG_RAW_DRIVER is not set
732# CONFIG_TCG_TPM is not set
733CONFIG_DEVPORT=y
734CONFIG_I2C=y
735CONFIG_I2C_BOARDINFO=y
736CONFIG_I2C_CHARDEV=y
737
738#
739# I2C Hardware Bus support
740#
741# CONFIG_I2C_ALI1535 is not set
742# CONFIG_I2C_ALI1563 is not set
743# CONFIG_I2C_ALI15X3 is not set
744# CONFIG_I2C_AMD756 is not set
745# CONFIG_I2C_AMD8111 is not set
746# CONFIG_I2C_I801 is not set
747# CONFIG_I2C_I810 is not set
748# CONFIG_I2C_PIIX4 is not set
749CONFIG_I2C_MPC=y
750# CONFIG_I2C_NFORCE2 is not set
751# CONFIG_I2C_OCORES is not set
752# CONFIG_I2C_PARPORT_LIGHT is not set
753# CONFIG_I2C_PROSAVAGE is not set
754# CONFIG_I2C_SAVAGE4 is not set
755# CONFIG_I2C_SIMTEC is not set
756# CONFIG_I2C_SIS5595 is not set
757# CONFIG_I2C_SIS630 is not set
758# CONFIG_I2C_SIS96X is not set
759# CONFIG_I2C_TAOS_EVM is not set
760# CONFIG_I2C_STUB is not set
761# CONFIG_I2C_TINY_USB is not set
762# CONFIG_I2C_VIA is not set
763# CONFIG_I2C_VIAPRO is not set
764# CONFIG_I2C_VOODOO3 is not set
765# CONFIG_I2C_PCA_PLATFORM is not set
766
767#
768# Miscellaneous I2C Chip support
769#
770# CONFIG_DS1682 is not set
771# CONFIG_SENSORS_EEPROM is not set
772# CONFIG_SENSORS_PCF8574 is not set
773# CONFIG_PCF8575 is not set
774# CONFIG_SENSORS_PCF8591 is not set
775# CONFIG_SENSORS_MAX6875 is not set
776# CONFIG_SENSORS_TSL2550 is not set
777# CONFIG_I2C_DEBUG_CORE is not set
778# CONFIG_I2C_DEBUG_ALGO is not set
779# CONFIG_I2C_DEBUG_BUS is not set
780# CONFIG_I2C_DEBUG_CHIP is not set
781CONFIG_SPI=y
782CONFIG_SPI_MASTER=y
783
784#
785# SPI Master Controller Drivers
786#
787# CONFIG_SPI_BITBANG is not set
788CONFIG_SPI_SOCRATES=y
789
790#
791# SPI Protocol Masters
792#
793# CONFIG_SPI_AT25 is not set
794# CONFIG_SPI_SPIDEV is not set
795# CONFIG_SPI_TLE62X0 is not set
796# CONFIG_W1 is not set
797# CONFIG_POWER_SUPPLY is not set
798CONFIG_HWMON=y
799CONFIG_HWMON_VID=y
800# CONFIG_SENSORS_AD7418 is not set
801# CONFIG_SENSORS_ADM1021 is not set
802# CONFIG_SENSORS_ADM1025 is not set
803# CONFIG_SENSORS_ADM1026 is not set
804# CONFIG_SENSORS_ADM1029 is not set
805# CONFIG_SENSORS_ADM1031 is not set
806# CONFIG_SENSORS_ADM9240 is not set
807# CONFIG_SENSORS_ADT7470 is not set
808# CONFIG_SENSORS_ADT7473 is not set
809# CONFIG_SENSORS_ATXP1 is not set
810# CONFIG_SENSORS_DS1621 is not set
811# CONFIG_SENSORS_I5K_AMB is not set
812# CONFIG_SENSORS_F71805F is not set
813# CONFIG_SENSORS_F71882FG is not set
814# CONFIG_SENSORS_F75375S is not set
815# CONFIG_SENSORS_GL518SM is not set
816# CONFIG_SENSORS_GL520SM is not set
817# CONFIG_SENSORS_IT87 is not set
818# CONFIG_SENSORS_LM63 is not set
819# CONFIG_SENSORS_LM70 is not set
820CONFIG_SENSORS_LM75=y
821# CONFIG_SENSORS_LM77 is not set
822# CONFIG_SENSORS_LM78 is not set
823# CONFIG_SENSORS_LM80 is not set
824# CONFIG_SENSORS_LM83 is not set
825# CONFIG_SENSORS_LM85 is not set
826# CONFIG_SENSORS_LM87 is not set
827# CONFIG_SENSORS_LM90 is not set
828# CONFIG_SENSORS_LM92 is not set
829# CONFIG_SENSORS_LM93 is not set
830# CONFIG_SENSORS_MAX1619 is not set
831# CONFIG_SENSORS_MAX6650 is not set
832# CONFIG_SENSORS_PC87360 is not set
833# CONFIG_SENSORS_PC87427 is not set
834# CONFIG_SENSORS_SIS5595 is not set
835# CONFIG_SENSORS_DME1737 is not set
836# CONFIG_SENSORS_SMSC47M1 is not set
837# CONFIG_SENSORS_SMSC47M192 is not set
838# CONFIG_SENSORS_SMSC47B397 is not set
839# CONFIG_SENSORS_ADS7828 is not set
840# CONFIG_SENSORS_THMC50 is not set
841# CONFIG_SENSORS_VIA686A is not set
842# CONFIG_SENSORS_VT1211 is not set
843# CONFIG_SENSORS_VT8231 is not set
844CONFIG_SENSORS_W83781D=y
845# CONFIG_SENSORS_W83791D is not set
846# CONFIG_SENSORS_W83792D is not set
847# CONFIG_SENSORS_W83793 is not set
848# CONFIG_SENSORS_W83L785TS is not set
849# CONFIG_SENSORS_W83L786NG is not set
850# CONFIG_SENSORS_W83627HF is not set
851# CONFIG_SENSORS_W83627EHF is not set
852CONFIG_HWMON_DEBUG_CHIP=y
853# CONFIG_THERMAL is not set
854# CONFIG_THERMAL_HWMON is not set
855# CONFIG_WATCHDOG is not set
856
857#
858# Sonics Silicon Backplane
859#
860CONFIG_SSB_POSSIBLE=y
861# CONFIG_SSB is not set
862
863#
864# Multifunction device drivers
865#
866# CONFIG_MFD_SM501 is not set
867# CONFIG_HTC_PASIC3 is not set
868
869#
870# Multimedia devices
871#
872
873#
874# Multimedia core support
875#
876# CONFIG_VIDEO_DEV is not set
877# CONFIG_DVB_CORE is not set
878# CONFIG_VIDEO_MEDIA is not set
879
880#
881# Multimedia drivers
882#
883CONFIG_DAB=y
884# CONFIG_USB_DABUSB is not set
885
886#
887# Graphics support
888#
889# CONFIG_AGP is not set
890# CONFIG_DRM is not set
891# CONFIG_VGASTATE is not set
892# CONFIG_VIDEO_OUTPUT_CONTROL is not set
893CONFIG_FB=y
894# CONFIG_FIRMWARE_EDID is not set
895# CONFIG_FB_DDC is not set
896CONFIG_FB_CFB_FILLRECT=y
897CONFIG_FB_CFB_COPYAREA=y
898CONFIG_FB_CFB_IMAGEBLIT=y
899# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
900# CONFIG_FB_SYS_FILLRECT is not set
901# CONFIG_FB_SYS_COPYAREA is not set
902# CONFIG_FB_SYS_IMAGEBLIT is not set
903CONFIG_FB_FOREIGN_ENDIAN=y
904CONFIG_FB_BOTH_ENDIAN=y
905# CONFIG_FB_BIG_ENDIAN is not set
906# CONFIG_FB_LITTLE_ENDIAN is not set
907# CONFIG_FB_SYS_FOPS is not set
908# CONFIG_FB_SVGALIB is not set
909# CONFIG_FB_MACMODES is not set
910# CONFIG_FB_BACKLIGHT is not set
911# CONFIG_FB_MODE_HELPERS is not set
912# CONFIG_FB_TILEBLITTING is not set
913
914#
915# Frame buffer hardware drivers
916#
917CONFIG_FB_MB862XX=y
918# CONFIG_FB_MB862XX_PCI_GDC is not set
919CONFIG_FB_MB862XX_LIME=y
920# CONFIG_FB_PRE_INIT_FB is not set
921# CONFIG_FB_CIRRUS is not set
922# CONFIG_FB_PM2 is not set
923# CONFIG_FB_CYBER2000 is not set
924# CONFIG_FB_OF is not set
925# CONFIG_FB_CT65550 is not set
926# CONFIG_FB_ASILIANT is not set
927# CONFIG_FB_IMSTT is not set
928# CONFIG_FB_VGA16 is not set
929# CONFIG_FB_S1D13XXX is not set
930# CONFIG_FB_NVIDIA is not set
931# CONFIG_FB_RIVA is not set
932# CONFIG_FB_MATROX is not set
933# CONFIG_FB_RADEON is not set
934# CONFIG_FB_ATY128 is not set
935# CONFIG_FB_ATY is not set
936# CONFIG_FB_S3 is not set
937# CONFIG_FB_SAVAGE is not set
938# CONFIG_FB_SIS is not set
939# CONFIG_FB_NEOMAGIC is not set
940# CONFIG_FB_KYRO is not set
941# CONFIG_FB_3DFX is not set
942# CONFIG_FB_VOODOO1 is not set
943# CONFIG_FB_VT8623 is not set
944# CONFIG_FB_TRIDENT is not set
945# CONFIG_FB_ARK is not set
946# CONFIG_FB_PM3 is not set
947# CONFIG_FB_FSL_DIU is not set
948# CONFIG_FB_IBM_GXT4500 is not set
949# CONFIG_FB_VIRTUAL is not set
950# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
951
952#
953# Display device support
954#
955# CONFIG_DISPLAY_SUPPORT is not set
956
957#
958# Console display driver support
959#
960# CONFIG_VGA_CONSOLE is not set
961CONFIG_DUMMY_CONSOLE=y
962CONFIG_FRAMEBUFFER_CONSOLE=y
963# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
964# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
965CONFIG_FONTS=y
966# CONFIG_FONT_8x8 is not set
967CONFIG_FONT_8x16=y
968# CONFIG_FONT_6x11 is not set
969# CONFIG_FONT_7x14 is not set
970# CONFIG_FONT_PEARL_8x8 is not set
971# CONFIG_FONT_ACORN_8x8 is not set
972# CONFIG_FONT_MINI_4x6 is not set
973# CONFIG_FONT_SUN8x16 is not set
974# CONFIG_FONT_SUN12x22 is not set
975# CONFIG_FONT_10x18 is not set
976# CONFIG_LOGO is not set
977
978#
979# Sound
980#
981# CONFIG_SOUND is not set
982CONFIG_HID_SUPPORT=y
983CONFIG_HID=y
984# CONFIG_HID_DEBUG is not set
985# CONFIG_HIDRAW is not set
986
987#
988# USB Input Devices
989#
990CONFIG_USB_HID=y
991# CONFIG_USB_HIDINPUT_POWERBOOK is not set
992# CONFIG_HID_FF is not set
993# CONFIG_USB_HIDDEV is not set
994CONFIG_USB_SUPPORT=y
995CONFIG_USB_ARCH_HAS_HCD=y
996CONFIG_USB_ARCH_HAS_OHCI=y
997CONFIG_USB_ARCH_HAS_EHCI=y
998CONFIG_USB=y
999# CONFIG_USB_DEBUG is not set
1000CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
1001
1002#
1003# Miscellaneous USB options
1004#
1005CONFIG_USB_DEVICEFS=y
1006CONFIG_USB_DEVICE_CLASS=y
1007# CONFIG_USB_DYNAMIC_MINORS is not set
1008# CONFIG_USB_OTG is not set
1009# CONFIG_USB_OTG_WHITELIST is not set
1010# CONFIG_USB_OTG_BLACKLIST_HUB is not set
1011
1012#
1013# USB Host Controller Drivers
1014#
1015# CONFIG_USB_C67X00_HCD is not set
1016CONFIG_USB_EHCI_HCD=y
1017# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
1018# CONFIG_USB_EHCI_TT_NEWSCHED is not set
1019# CONFIG_USB_EHCI_FSL is not set
1020CONFIG_USB_EHCI_HCD_PPC_OF=y
1021# CONFIG_USB_ISP116X_HCD is not set
1022# CONFIG_USB_ISP1760_HCD is not set
1023CONFIG_USB_OHCI_HCD=y
1024CONFIG_USB_OHCI_HCD_PPC_OF=y
1025CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
1026# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set
1027CONFIG_USB_OHCI_HCD_PCI=y
1028CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y
1029CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y
1030CONFIG_USB_OHCI_LITTLE_ENDIAN=y
1031# CONFIG_USB_UHCI_HCD is not set
1032# CONFIG_USB_SL811_HCD is not set
1033# CONFIG_USB_R8A66597_HCD is not set
1034
1035#
1036# USB Device Class drivers
1037#
1038# CONFIG_USB_ACM is not set
1039# CONFIG_USB_PRINTER is not set
1040# CONFIG_USB_WDM is not set
1041
1042#
1043# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
1044#
1045
1046#
1047# may also be needed; see USB_STORAGE Help for more information
1048#
1049CONFIG_USB_STORAGE=y
1050# CONFIG_USB_STORAGE_DEBUG is not set
1051# CONFIG_USB_STORAGE_DATAFAB is not set
1052# CONFIG_USB_STORAGE_FREECOM is not set
1053# CONFIG_USB_STORAGE_ISD200 is not set
1054# CONFIG_USB_STORAGE_DPCM is not set
1055# CONFIG_USB_STORAGE_USBAT is not set
1056# CONFIG_USB_STORAGE_SDDR09 is not set
1057# CONFIG_USB_STORAGE_SDDR55 is not set
1058# CONFIG_USB_STORAGE_JUMPSHOT is not set
1059# CONFIG_USB_STORAGE_ALAUDA is not set
1060# CONFIG_USB_STORAGE_ONETOUCH is not set
1061# CONFIG_USB_STORAGE_KARMA is not set
1062# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
1063# CONFIG_USB_LIBUSUAL is not set
1064
1065#
1066# USB Imaging devices
1067#
1068# CONFIG_USB_MDC800 is not set
1069# CONFIG_USB_MICROTEK is not set
1070CONFIG_USB_MON=y
1071
1072#
1073# USB port drivers
1074#
1075# CONFIG_USB_SERIAL is not set
1076
1077#
1078# USB Miscellaneous drivers
1079#
1080# CONFIG_USB_EMI62 is not set
1081# CONFIG_USB_EMI26 is not set
1082# CONFIG_USB_ADUTUX is not set
1083# CONFIG_USB_AUERSWALD is not set
1084# CONFIG_USB_RIO500 is not set
1085# CONFIG_USB_LEGOTOWER is not set
1086# CONFIG_USB_LCD is not set
1087# CONFIG_USB_BERRY_CHARGE is not set
1088# CONFIG_USB_LED is not set
1089# CONFIG_USB_CYPRESS_CY7C63 is not set
1090# CONFIG_USB_CYTHERM is not set
1091# CONFIG_USB_PHIDGET is not set
1092# CONFIG_USB_IDMOUSE is not set
1093# CONFIG_USB_FTDI_ELAN is not set
1094# CONFIG_USB_APPLEDISPLAY is not set
1095# CONFIG_USB_SISUSBVGA is not set
1096# CONFIG_USB_LD is not set
1097# CONFIG_USB_TRANCEVIBRATOR is not set
1098# CONFIG_USB_IOWARRIOR is not set
1099# CONFIG_USB_TEST is not set
1100# CONFIG_USB_ISIGHTFW is not set
1101# CONFIG_USB_GADGET is not set
1102# CONFIG_MMC is not set
1103# CONFIG_MEMSTICK is not set
1104# CONFIG_NEW_LEDS is not set
1105# CONFIG_ACCESSIBILITY is not set
1106# CONFIG_INFINIBAND is not set
1107# CONFIG_EDAC is not set
1108CONFIG_RTC_LIB=y
1109CONFIG_RTC_CLASS=y
1110CONFIG_RTC_HCTOSYS=y
1111CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
1112# CONFIG_RTC_DEBUG is not set
1113
1114#
1115# RTC interfaces
1116#
1117CONFIG_RTC_INTF_SYSFS=y
1118CONFIG_RTC_INTF_PROC=y
1119CONFIG_RTC_INTF_DEV=y
1120# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
1121# CONFIG_RTC_DRV_TEST is not set
1122
1123#
1124# I2C RTC drivers
1125#
1126# CONFIG_RTC_DRV_DS1307 is not set
1127# CONFIG_RTC_DRV_DS1374 is not set
1128# CONFIG_RTC_DRV_DS1672 is not set
1129# CONFIG_RTC_DRV_MAX6900 is not set
1130# CONFIG_RTC_DRV_RS5C372 is not set
1131# CONFIG_RTC_DRV_ISL1208 is not set
1132# CONFIG_RTC_DRV_X1205 is not set
1133# CONFIG_RTC_DRV_PCF8563 is not set
1134# CONFIG_RTC_DRV_PCF8583 is not set
1135# CONFIG_RTC_DRV_M41T80 is not set
1136# CONFIG_RTC_DRV_S35390A is not set
1137# CONFIG_RTC_DRV_FM3130 is not set
1138CONFIG_RTC_DRV_RX8025=y
1139
1140#
1141# SPI RTC drivers
1142#
1143# CONFIG_RTC_DRV_MAX6902 is not set
1144# CONFIG_RTC_DRV_R9701 is not set
1145# CONFIG_RTC_DRV_RS5C348 is not set
1146
1147#
1148# Platform RTC drivers
1149#
1150# CONFIG_RTC_DRV_CMOS is not set
1151# CONFIG_RTC_DRV_DS1511 is not set
1152# CONFIG_RTC_DRV_DS1553 is not set
1153# CONFIG_RTC_DRV_DS1742 is not set
1154# CONFIG_RTC_DRV_STK17TA8 is not set
1155# CONFIG_RTC_DRV_M48T86 is not set
1156# CONFIG_RTC_DRV_M48T59 is not set
1157# CONFIG_RTC_DRV_V3020 is not set
1158
1159#
1160# on-CPU RTC drivers
1161#
1162CONFIG_RTC_DRV_PPC=y
1163# CONFIG_DMADEVICES is not set
1164# CONFIG_UIO is not set
1165
1166#
1167# File systems
1168#
1169CONFIG_EXT2_FS=y
1170# CONFIG_EXT2_FS_XATTR is not set
1171# CONFIG_EXT2_FS_XIP is not set
1172CONFIG_EXT3_FS=y
1173CONFIG_EXT3_FS_XATTR=y
1174# CONFIG_EXT3_FS_POSIX_ACL is not set
1175# CONFIG_EXT3_FS_SECURITY is not set
1176# CONFIG_EXT4DEV_FS is not set
1177CONFIG_JBD=y
1178CONFIG_FS_MBCACHE=y
1179# CONFIG_REISERFS_FS is not set
1180# CONFIG_JFS_FS is not set
1181# CONFIG_FS_POSIX_ACL is not set
1182# CONFIG_XFS_FS is not set
1183# CONFIG_OCFS2_FS is not set
1184CONFIG_DNOTIFY=y
1185CONFIG_INOTIFY=y
1186CONFIG_INOTIFY_USER=y
1187# CONFIG_QUOTA is not set
1188# CONFIG_AUTOFS_FS is not set
1189# CONFIG_AUTOFS4_FS is not set
1190# CONFIG_FUSE_FS is not set
1191
1192#
1193# CD-ROM/DVD Filesystems
1194#
1195# CONFIG_ISO9660_FS is not set
1196# CONFIG_UDF_FS is not set
1197
1198#
1199# DOS/FAT/NT Filesystems
1200#
1201# CONFIG_MSDOS_FS is not set
1202# CONFIG_VFAT_FS is not set
1203# CONFIG_NTFS_FS is not set
1204
1205#
1206# Pseudo filesystems
1207#
1208CONFIG_PROC_FS=y
1209CONFIG_PROC_KCORE=y
1210CONFIG_PROC_SYSCTL=y
1211CONFIG_SYSFS=y
1212CONFIG_TMPFS=y
1213# CONFIG_TMPFS_POSIX_ACL is not set
1214# CONFIG_HUGETLB_PAGE is not set
1215# CONFIG_CONFIGFS_FS is not set
1216
1217#
1218# Miscellaneous filesystems
1219#
1220# CONFIG_ADFS_FS is not set
1221# CONFIG_AFFS_FS is not set
1222# CONFIG_HFS_FS is not set
1223# CONFIG_HFSPLUS_FS is not set
1224# CONFIG_BEFS_FS is not set
1225# CONFIG_BFS_FS is not set
1226# CONFIG_EFS_FS is not set
1227CONFIG_JFFS2_FS=y
1228CONFIG_JFFS2_FS_DEBUG=0
1229CONFIG_JFFS2_FS_WRITEBUFFER=y
1230# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
1231# CONFIG_JFFS2_SUMMARY is not set
1232# CONFIG_JFFS2_FS_XATTR is not set
1233# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
1234CONFIG_JFFS2_ZLIB=y
1235# CONFIG_JFFS2_LZO is not set
1236CONFIG_JFFS2_RTIME=y
1237# CONFIG_JFFS2_RUBIN is not set
1238CONFIG_CRAMFS=y
1239# CONFIG_VXFS_FS is not set
1240# CONFIG_MINIX_FS is not set
1241# CONFIG_HPFS_FS is not set
1242# CONFIG_QNX4FS_FS is not set
1243# CONFIG_ROMFS_FS is not set
1244# CONFIG_SYSV_FS is not set
1245# CONFIG_UFS_FS is not set
1246CONFIG_NETWORK_FILESYSTEMS=y
1247CONFIG_NFS_FS=y
1248CONFIG_NFS_V3=y
1249# CONFIG_NFS_V3_ACL is not set
1250# CONFIG_NFS_V4 is not set
1251# CONFIG_NFSD is not set
1252CONFIG_ROOT_NFS=y
1253CONFIG_LOCKD=y
1254CONFIG_LOCKD_V4=y
1255CONFIG_NFS_COMMON=y
1256CONFIG_SUNRPC=y
1257# CONFIG_SUNRPC_BIND34 is not set
1258# CONFIG_RPCSEC_GSS_KRB5 is not set
1259# CONFIG_RPCSEC_GSS_SPKM3 is not set
1260# CONFIG_SMB_FS is not set
1261# CONFIG_CIFS is not set
1262# CONFIG_NCP_FS is not set
1263# CONFIG_CODA_FS is not set
1264# CONFIG_AFS_FS is not set
1265
1266#
1267# Partition Types
1268#
1269CONFIG_PARTITION_ADVANCED=y
1270# CONFIG_ACORN_PARTITION is not set
1271# CONFIG_OSF_PARTITION is not set
1272# CONFIG_AMIGA_PARTITION is not set
1273# CONFIG_ATARI_PARTITION is not set
1274# CONFIG_MAC_PARTITION is not set
1275CONFIG_MSDOS_PARTITION=y
1276# CONFIG_BSD_DISKLABEL is not set
1277# CONFIG_MINIX_SUBPARTITION is not set
1278# CONFIG_SOLARIS_X86_PARTITION is not set
1279# CONFIG_UNIXWARE_DISKLABEL is not set
1280# CONFIG_LDM_PARTITION is not set
1281# CONFIG_SGI_PARTITION is not set
1282# CONFIG_ULTRIX_PARTITION is not set
1283# CONFIG_SUN_PARTITION is not set
1284# CONFIG_KARMA_PARTITION is not set
1285# CONFIG_EFI_PARTITION is not set
1286# CONFIG_SYSV68_PARTITION is not set
1287# CONFIG_NLS is not set
1288# CONFIG_DLM is not set
1289
1290#
1291# Library routines
1292#
1293CONFIG_BITREVERSE=y
1294# CONFIG_GENERIC_FIND_FIRST_BIT is not set
1295# CONFIG_CRC_CCITT is not set
1296# CONFIG_CRC16 is not set
1297# CONFIG_CRC_ITU_T is not set
1298CONFIG_CRC32=y
1299# CONFIG_CRC7 is not set
1300# CONFIG_LIBCRC32C is not set
1301CONFIG_ZLIB_INFLATE=y
1302CONFIG_ZLIB_DEFLATE=y
1303CONFIG_PLIST=y
1304CONFIG_HAS_IOMEM=y
1305CONFIG_HAS_IOPORT=y
1306CONFIG_HAS_DMA=y
1307CONFIG_HAVE_LMB=y
1308
1309#
1310# Kernel hacking
1311#
1312# CONFIG_PRINTK_TIME is not set
1313CONFIG_ENABLE_WARN_DEPRECATED=y
1314CONFIG_ENABLE_MUST_CHECK=y
1315CONFIG_FRAME_WARN=1024
1316# CONFIG_MAGIC_SYSRQ is not set
1317# CONFIG_UNUSED_SYMBOLS is not set
1318# CONFIG_DEBUG_FS is not set
1319# CONFIG_HEADERS_CHECK is not set
1320# CONFIG_DEBUG_KERNEL is not set
1321# CONFIG_SLUB_DEBUG_ON is not set
1322# CONFIG_SLUB_STATS is not set
1323# CONFIG_DEBUG_BUGVERBOSE is not set
1324# CONFIG_SAMPLES is not set
1325# CONFIG_IRQSTACKS is not set
1326# CONFIG_PPC_EARLY_DEBUG is not set
1327
1328#
1329# Security options
1330#
1331# CONFIG_KEYS is not set
1332# CONFIG_SECURITY is not set
1333# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1334CONFIG_CRYPTO=y
1335
1336#
1337# Crypto core or helper
1338#
1339# CONFIG_CRYPTO_MANAGER is not set
1340# CONFIG_CRYPTO_GF128MUL is not set
1341# CONFIG_CRYPTO_NULL is not set
1342# CONFIG_CRYPTO_CRYPTD is not set
1343# CONFIG_CRYPTO_AUTHENC is not set
1344# CONFIG_CRYPTO_TEST is not set
1345
1346#
1347# Authenticated Encryption with Associated Data
1348#
1349# CONFIG_CRYPTO_CCM is not set
1350# CONFIG_CRYPTO_GCM is not set
1351# CONFIG_CRYPTO_SEQIV is not set
1352
1353#
1354# Block modes
1355#
1356# CONFIG_CRYPTO_CBC is not set
1357# CONFIG_CRYPTO_CTR is not set
1358# CONFIG_CRYPTO_CTS is not set
1359# CONFIG_CRYPTO_ECB is not set
1360# CONFIG_CRYPTO_LRW is not set
1361# CONFIG_CRYPTO_PCBC is not set
1362# CONFIG_CRYPTO_XTS is not set
1363
1364#
1365# Hash modes
1366#
1367# CONFIG_CRYPTO_HMAC is not set
1368# CONFIG_CRYPTO_XCBC is not set
1369
1370#
1371# Digest
1372#
1373# CONFIG_CRYPTO_CRC32C is not set
1374# CONFIG_CRYPTO_MD4 is not set
1375# CONFIG_CRYPTO_MD5 is not set
1376# CONFIG_CRYPTO_MICHAEL_MIC is not set
1377# CONFIG_CRYPTO_SHA1 is not set
1378# CONFIG_CRYPTO_SHA256 is not set
1379# CONFIG_CRYPTO_SHA512 is not set
1380# CONFIG_CRYPTO_TGR192 is not set
1381# CONFIG_CRYPTO_WP512 is not set
1382
1383#
1384# Ciphers
1385#
1386# CONFIG_CRYPTO_AES is not set
1387# CONFIG_CRYPTO_ANUBIS is not set
1388# CONFIG_CRYPTO_ARC4 is not set
1389# CONFIG_CRYPTO_BLOWFISH is not set
1390# CONFIG_CRYPTO_CAMELLIA is not set
1391# CONFIG_CRYPTO_CAST5 is not set
1392# CONFIG_CRYPTO_CAST6 is not set
1393# CONFIG_CRYPTO_DES is not set
1394# CONFIG_CRYPTO_FCRYPT is not set
1395# CONFIG_CRYPTO_KHAZAD is not set
1396# CONFIG_CRYPTO_SALSA20 is not set
1397# CONFIG_CRYPTO_SEED is not set
1398# CONFIG_CRYPTO_SERPENT is not set
1399# CONFIG_CRYPTO_TEA is not set
1400# CONFIG_CRYPTO_TWOFISH is not set
1401
1402#
1403# Compression
1404#
1405# CONFIG_CRYPTO_DEFLATE is not set
1406# CONFIG_CRYPTO_LZO is not set
1407CONFIG_CRYPTO_HW=y
1408# CONFIG_CRYPTO_DEV_HIFN_795X is not set
1409# CONFIG_PPC_CLOCK is not set
1410# CONFIG_VIRTUALIZATION is not set
diff --git a/arch/powerpc/configs/86xx/gef_ppc9a_defconfig b/arch/powerpc/configs/86xx/gef_ppc9a_defconfig
new file mode 100644
index 000000000000..df2c16337794
--- /dev/null
+++ b/arch/powerpc/configs/86xx/gef_ppc9a_defconfig
@@ -0,0 +1,1889 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.29-rc7
4# Fri Mar 13 15:36:11 2009
5#
6# CONFIG_PPC64 is not set
7
8#
9# Processor support
10#
11CONFIG_6xx=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_FPU=y
18# CONFIG_PHYS_64BIT is not set
19CONFIG_ALTIVEC=y
20CONFIG_PPC_STD_MMU=y
21CONFIG_PPC_STD_MMU_32=y
22# CONFIG_PPC_MM_SLICES is not set
23CONFIG_SMP=y
24CONFIG_NR_CPUS=2
25CONFIG_PPC32=y
26CONFIG_WORD_SIZE=32
27# CONFIG_ARCH_PHYS_ADDR_T_64BIT is not set
28CONFIG_MMU=y
29CONFIG_GENERIC_CMOS_UPDATE=y
30CONFIG_GENERIC_TIME=y
31CONFIG_GENERIC_TIME_VSYSCALL=y
32CONFIG_GENERIC_CLOCKEVENTS=y
33CONFIG_GENERIC_HARDIRQS=y
34# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
35CONFIG_IRQ_PER_CPU=y
36CONFIG_STACKTRACE_SUPPORT=y
37CONFIG_HAVE_LATENCYTOP_SUPPORT=y
38CONFIG_LOCKDEP_SUPPORT=y
39CONFIG_RWSEM_XCHGADD_ALGORITHM=y
40CONFIG_GENERIC_LOCKBREAK=y
41CONFIG_ARCH_HAS_ILOG2_U32=y
42CONFIG_GENERIC_HWEIGHT=y
43CONFIG_GENERIC_CALIBRATE_DELAY=y
44CONFIG_GENERIC_FIND_NEXT_BIT=y
45CONFIG_GENERIC_GPIO=y
46# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
47CONFIG_PPC=y
48CONFIG_EARLY_PRINTK=y
49CONFIG_GENERIC_NVRAM=y
50CONFIG_SCHED_OMIT_FRAME_POINTER=y
51CONFIG_ARCH_MAY_HAVE_PC_FDC=y
52CONFIG_PPC_OF=y
53CONFIG_OF=y
54CONFIG_PPC_UDBG_16550=y
55CONFIG_GENERIC_TBSYNC=y
56CONFIG_AUDIT_ARCH=y
57CONFIG_GENERIC_BUG=y
58CONFIG_DEFAULT_UIMAGE=y
59# CONFIG_PPC_DCR_NATIVE is not set
60# CONFIG_PPC_DCR_MMIO is not set
61CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
62
63#
64# General setup
65#
66CONFIG_EXPERIMENTAL=y
67CONFIG_LOCK_KERNEL=y
68CONFIG_INIT_ENV_ARG_LIMIT=32
69CONFIG_LOCALVERSION=""
70CONFIG_LOCALVERSION_AUTO=y
71CONFIG_SWAP=y
72CONFIG_SYSVIPC=y
73CONFIG_SYSVIPC_SYSCTL=y
74CONFIG_POSIX_MQUEUE=y
75CONFIG_BSD_PROCESS_ACCT=y
76CONFIG_BSD_PROCESS_ACCT_V3=y
77# CONFIG_TASKSTATS is not set
78# CONFIG_AUDIT is not set
79
80#
81# RCU Subsystem
82#
83CONFIG_CLASSIC_RCU=y
84# CONFIG_TREE_RCU is not set
85# CONFIG_PREEMPT_RCU is not set
86# CONFIG_TREE_RCU_TRACE is not set
87# CONFIG_PREEMPT_RCU_TRACE is not set
88CONFIG_IKCONFIG=y
89CONFIG_IKCONFIG_PROC=y
90CONFIG_LOG_BUF_SHIFT=14
91CONFIG_GROUP_SCHED=y
92CONFIG_FAIR_GROUP_SCHED=y
93# CONFIG_RT_GROUP_SCHED is not set
94CONFIG_USER_SCHED=y
95# CONFIG_CGROUP_SCHED is not set
96# CONFIG_CGROUPS is not set
97CONFIG_SYSFS_DEPRECATED=y
98CONFIG_SYSFS_DEPRECATED_V2=y
99CONFIG_RELAY=y
100# CONFIG_NAMESPACES is not set
101CONFIG_BLK_DEV_INITRD=y
102CONFIG_INITRAMFS_SOURCE=""
103# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
104CONFIG_SYSCTL=y
105CONFIG_EMBEDDED=y
106CONFIG_SYSCTL_SYSCALL=y
107CONFIG_KALLSYMS=y
108# CONFIG_KALLSYMS_ALL is not set
109# CONFIG_KALLSYMS_EXTRA_PASS is not set
110CONFIG_HOTPLUG=y
111CONFIG_PRINTK=y
112CONFIG_BUG=y
113CONFIG_ELF_CORE=y
114CONFIG_COMPAT_BRK=y
115CONFIG_BASE_FULL=y
116CONFIG_FUTEX=y
117CONFIG_ANON_INODES=y
118CONFIG_EPOLL=y
119CONFIG_SIGNALFD=y
120CONFIG_TIMERFD=y
121CONFIG_EVENTFD=y
122CONFIG_SHMEM=y
123CONFIG_AIO=y
124CONFIG_VM_EVENT_COUNTERS=y
125CONFIG_PCI_QUIRKS=y
126CONFIG_SLAB=y
127# CONFIG_SLUB is not set
128# CONFIG_SLOB is not set
129# CONFIG_PROFILING is not set
130CONFIG_HAVE_OPROFILE=y
131# CONFIG_KPROBES is not set
132CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
133CONFIG_HAVE_IOREMAP_PROT=y
134CONFIG_HAVE_KPROBES=y
135CONFIG_HAVE_KRETPROBES=y
136CONFIG_HAVE_ARCH_TRACEHOOK=y
137CONFIG_USE_GENERIC_SMP_HELPERS=y
138# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
139CONFIG_SLABINFO=y
140CONFIG_RT_MUTEXES=y
141CONFIG_BASE_SMALL=0
142CONFIG_MODULES=y
143# CONFIG_MODULE_FORCE_LOAD is not set
144CONFIG_MODULE_UNLOAD=y
145# CONFIG_MODULE_FORCE_UNLOAD is not set
146# CONFIG_MODVERSIONS is not set
147# CONFIG_MODULE_SRCVERSION_ALL is not set
148CONFIG_STOP_MACHINE=y
149CONFIG_BLOCK=y
150# CONFIG_LBD is not set
151# CONFIG_BLK_DEV_IO_TRACE is not set
152# CONFIG_BLK_DEV_BSG is not set
153# CONFIG_BLK_DEV_INTEGRITY is not set
154
155#
156# IO Schedulers
157#
158CONFIG_IOSCHED_NOOP=y
159CONFIG_IOSCHED_AS=y
160CONFIG_IOSCHED_DEADLINE=y
161CONFIG_IOSCHED_CFQ=y
162# CONFIG_DEFAULT_AS is not set
163# CONFIG_DEFAULT_DEADLINE is not set
164CONFIG_DEFAULT_CFQ=y
165# CONFIG_DEFAULT_NOOP is not set
166CONFIG_DEFAULT_IOSCHED="cfq"
167# CONFIG_FREEZER is not set
168
169#
170# Platform support
171#
172CONFIG_PPC_MULTIPLATFORM=y
173CONFIG_CLASSIC32=y
174# CONFIG_PPC_CHRP is not set
175# CONFIG_MPC5121_ADS is not set
176# CONFIG_MPC5121_GENERIC is not set
177# CONFIG_PPC_MPC52xx is not set
178# CONFIG_PPC_PMAC is not set
179# CONFIG_PPC_CELL is not set
180# CONFIG_PPC_CELL_NATIVE is not set
181# CONFIG_PPC_82xx is not set
182# CONFIG_PQ2ADS is not set
183# CONFIG_PPC_83xx is not set
184CONFIG_PPC_86xx=y
185# CONFIG_MPC8641_HPCN is not set
186# CONFIG_SBC8641D is not set
187# CONFIG_MPC8610_HPCD is not set
188CONFIG_GEF_PPC9A=y
189# CONFIG_GEF_SBC310 is not set
190# CONFIG_GEF_SBC610 is not set
191CONFIG_MPC8641=y
192# CONFIG_IPIC is not set
193CONFIG_MPIC=y
194# CONFIG_MPIC_WEIRD is not set
195# CONFIG_PPC_I8259 is not set
196# CONFIG_PPC_RTAS is not set
197# CONFIG_MMIO_NVRAM is not set
198# CONFIG_PPC_MPC106 is not set
199# CONFIG_PPC_970_NAP is not set
200# CONFIG_PPC_INDIRECT_IO is not set
201# CONFIG_GENERIC_IOMAP is not set
202# CONFIG_CPU_FREQ is not set
203# CONFIG_TAU is not set
204# CONFIG_QUICC_ENGINE is not set
205# CONFIG_FSL_ULI1575 is not set
206# CONFIG_MPC8xxx_GPIO is not set
207# CONFIG_SIMPLE_GPIO is not set
208
209#
210# Kernel options
211#
212# CONFIG_HIGHMEM is not set
213CONFIG_TICK_ONESHOT=y
214# CONFIG_NO_HZ is not set
215CONFIG_HIGH_RES_TIMERS=y
216CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
217# CONFIG_HZ_100 is not set
218# CONFIG_HZ_250 is not set
219# CONFIG_HZ_300 is not set
220CONFIG_HZ_1000=y
221CONFIG_HZ=1000
222CONFIG_SCHED_HRTICK=y
223# CONFIG_PREEMPT_NONE is not set
224# CONFIG_PREEMPT_VOLUNTARY is not set
225CONFIG_PREEMPT=y
226CONFIG_BINFMT_ELF=y
227# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
228# CONFIG_HAVE_AOUT is not set
229CONFIG_BINFMT_MISC=m
230# CONFIG_IOMMU_HELPER is not set
231CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
232CONFIG_ARCH_HAS_WALK_MEMORY=y
233CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
234# CONFIG_KEXEC is not set
235# CONFIG_CRASH_DUMP is not set
236CONFIG_IRQ_ALL_CPUS=y
237CONFIG_ARCH_FLATMEM_ENABLE=y
238CONFIG_ARCH_POPULATES_NODE_MAP=y
239CONFIG_SELECT_MEMORY_MODEL=y
240CONFIG_FLATMEM_MANUAL=y
241# CONFIG_DISCONTIGMEM_MANUAL is not set
242# CONFIG_SPARSEMEM_MANUAL is not set
243CONFIG_FLATMEM=y
244CONFIG_FLAT_NODE_MEM_MAP=y
245CONFIG_PAGEFLAGS_EXTENDED=y
246CONFIG_SPLIT_PTLOCK_CPUS=4
247CONFIG_MIGRATION=y
248# CONFIG_PHYS_ADDR_T_64BIT is not set
249CONFIG_ZONE_DMA_FLAG=1
250CONFIG_BOUNCE=y
251CONFIG_VIRT_TO_BUS=y
252CONFIG_UNEVICTABLE_LRU=y
253CONFIG_PPC_4K_PAGES=y
254# CONFIG_PPC_16K_PAGES is not set
255# CONFIG_PPC_64K_PAGES is not set
256CONFIG_FORCE_MAX_ZONEORDER=11
257# CONFIG_PROC_DEVICETREE is not set
258# CONFIG_CMDLINE_BOOL is not set
259CONFIG_EXTRA_TARGETS=""
260# CONFIG_PM is not set
261CONFIG_SECCOMP=y
262CONFIG_ISA_DMA_API=y
263
264#
265# Bus options
266#
267CONFIG_ZONE_DMA=y
268CONFIG_GENERIC_ISA_DMA=y
269CONFIG_PPC_INDIRECT_PCI=y
270CONFIG_FSL_SOC=y
271CONFIG_FSL_PCI=y
272CONFIG_PPC_PCI_CHOICE=y
273CONFIG_PCI=y
274CONFIG_PCI_DOMAINS=y
275CONFIG_PCI_SYSCALL=y
276CONFIG_PCIEPORTBUS=y
277CONFIG_PCIEAER=y
278# CONFIG_PCIEASPM is not set
279CONFIG_ARCH_SUPPORTS_MSI=y
280# CONFIG_PCI_MSI is not set
281# CONFIG_PCI_LEGACY is not set
282CONFIG_PCI_DEBUG=y
283# CONFIG_PCI_STUB is not set
284# CONFIG_PCCARD is not set
285# CONFIG_HOTPLUG_PCI is not set
286# CONFIG_HAS_RAPIDIO is not set
287
288#
289# Advanced setup
290#
291# CONFIG_ADVANCED_OPTIONS is not set
292
293#
294# Default settings for advanced configuration options are used
295#
296CONFIG_LOWMEM_SIZE=0x30000000
297CONFIG_PAGE_OFFSET=0xc0000000
298CONFIG_KERNEL_START=0xc0000000
299CONFIG_PHYSICAL_START=0x00000000
300CONFIG_TASK_SIZE=0xc0000000
301CONFIG_NET=y
302
303#
304# Networking options
305#
306CONFIG_COMPAT_NET_DEV_OPS=y
307CONFIG_PACKET=y
308CONFIG_PACKET_MMAP=y
309CONFIG_UNIX=y
310CONFIG_XFRM=y
311CONFIG_XFRM_USER=m
312# CONFIG_XFRM_SUB_POLICY is not set
313# CONFIG_XFRM_MIGRATE is not set
314# CONFIG_XFRM_STATISTICS is not set
315CONFIG_XFRM_IPCOMP=m
316CONFIG_NET_KEY=m
317# CONFIG_NET_KEY_MIGRATE is not set
318CONFIG_INET=y
319CONFIG_IP_MULTICAST=y
320CONFIG_IP_ADVANCED_ROUTER=y
321CONFIG_ASK_IP_FIB_HASH=y
322# CONFIG_IP_FIB_TRIE is not set
323CONFIG_IP_FIB_HASH=y
324CONFIG_IP_MULTIPLE_TABLES=y
325CONFIG_IP_ROUTE_MULTIPATH=y
326CONFIG_IP_ROUTE_VERBOSE=y
327CONFIG_IP_PNP=y
328CONFIG_IP_PNP_DHCP=y
329CONFIG_IP_PNP_BOOTP=y
330CONFIG_IP_PNP_RARP=y
331CONFIG_NET_IPIP=m
332CONFIG_NET_IPGRE=m
333CONFIG_NET_IPGRE_BROADCAST=y
334CONFIG_IP_MROUTE=y
335CONFIG_IP_PIMSM_V1=y
336CONFIG_IP_PIMSM_V2=y
337# CONFIG_ARPD is not set
338CONFIG_SYN_COOKIES=y
339CONFIG_INET_AH=m
340CONFIG_INET_ESP=m
341CONFIG_INET_IPCOMP=m
342CONFIG_INET_XFRM_TUNNEL=m
343CONFIG_INET_TUNNEL=m
344CONFIG_INET_XFRM_MODE_TRANSPORT=y
345CONFIG_INET_XFRM_MODE_TUNNEL=y
346CONFIG_INET_XFRM_MODE_BEET=y
347# CONFIG_INET_LRO is not set
348CONFIG_INET_DIAG=y
349CONFIG_INET_TCP_DIAG=y
350# CONFIG_TCP_CONG_ADVANCED is not set
351CONFIG_TCP_CONG_CUBIC=y
352CONFIG_DEFAULT_TCP_CONG="cubic"
353# CONFIG_TCP_MD5SIG is not set
354CONFIG_IPV6=m
355# CONFIG_IPV6_PRIVACY is not set
356# CONFIG_IPV6_ROUTER_PREF is not set
357# CONFIG_IPV6_OPTIMISTIC_DAD is not set
358CONFIG_INET6_AH=m
359CONFIG_INET6_ESP=m
360CONFIG_INET6_IPCOMP=m
361# CONFIG_IPV6_MIP6 is not set
362CONFIG_INET6_XFRM_TUNNEL=m
363CONFIG_INET6_TUNNEL=m
364CONFIG_INET6_XFRM_MODE_TRANSPORT=m
365CONFIG_INET6_XFRM_MODE_TUNNEL=m
366CONFIG_INET6_XFRM_MODE_BEET=m
367# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
368CONFIG_IPV6_SIT=m
369CONFIG_IPV6_NDISC_NODETYPE=y
370CONFIG_IPV6_TUNNEL=m
371# CONFIG_IPV6_MULTIPLE_TABLES is not set
372# CONFIG_IPV6_MROUTE is not set
373# CONFIG_NETLABEL is not set
374# CONFIG_NETWORK_SECMARK is not set
375CONFIG_NETFILTER=y
376# CONFIG_NETFILTER_DEBUG is not set
377CONFIG_NETFILTER_ADVANCED=y
378CONFIG_BRIDGE_NETFILTER=y
379
380#
381# Core Netfilter Configuration
382#
383# CONFIG_NETFILTER_NETLINK_QUEUE is not set
384# CONFIG_NETFILTER_NETLINK_LOG is not set
385# CONFIG_NF_CONNTRACK is not set
386CONFIG_NETFILTER_XTABLES=m
387# CONFIG_NETFILTER_XT_TARGET_CLASSIFY is not set
388# CONFIG_NETFILTER_XT_TARGET_DSCP is not set
389# CONFIG_NETFILTER_XT_TARGET_MARK is not set
390# CONFIG_NETFILTER_XT_TARGET_NFLOG is not set
391# CONFIG_NETFILTER_XT_TARGET_NFQUEUE is not set
392# CONFIG_NETFILTER_XT_TARGET_RATEEST is not set
393# CONFIG_NETFILTER_XT_TARGET_TRACE is not set
394# CONFIG_NETFILTER_XT_TARGET_TCPMSS is not set
395# CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP is not set
396# CONFIG_NETFILTER_XT_MATCH_COMMENT is not set
397# CONFIG_NETFILTER_XT_MATCH_DCCP is not set
398# CONFIG_NETFILTER_XT_MATCH_DSCP is not set
399# CONFIG_NETFILTER_XT_MATCH_ESP is not set
400# CONFIG_NETFILTER_XT_MATCH_HASHLIMIT is not set
401# CONFIG_NETFILTER_XT_MATCH_IPRANGE is not set
402# CONFIG_NETFILTER_XT_MATCH_LENGTH is not set
403# CONFIG_NETFILTER_XT_MATCH_LIMIT is not set
404# CONFIG_NETFILTER_XT_MATCH_MAC is not set
405# CONFIG_NETFILTER_XT_MATCH_MARK is not set
406# CONFIG_NETFILTER_XT_MATCH_MULTIPORT is not set
407# CONFIG_NETFILTER_XT_MATCH_OWNER is not set
408# CONFIG_NETFILTER_XT_MATCH_POLICY is not set
409# CONFIG_NETFILTER_XT_MATCH_PHYSDEV is not set
410# CONFIG_NETFILTER_XT_MATCH_PKTTYPE is not set
411# CONFIG_NETFILTER_XT_MATCH_QUOTA is not set
412# CONFIG_NETFILTER_XT_MATCH_RATEEST is not set
413# CONFIG_NETFILTER_XT_MATCH_REALM is not set
414# CONFIG_NETFILTER_XT_MATCH_RECENT is not set
415# CONFIG_NETFILTER_XT_MATCH_SCTP is not set
416# CONFIG_NETFILTER_XT_MATCH_STATISTIC is not set
417# CONFIG_NETFILTER_XT_MATCH_STRING is not set
418# CONFIG_NETFILTER_XT_MATCH_TCPMSS is not set
419# CONFIG_NETFILTER_XT_MATCH_TIME is not set
420# CONFIG_NETFILTER_XT_MATCH_U32 is not set
421# CONFIG_IP_VS is not set
422
423#
424# IP: Netfilter Configuration
425#
426# CONFIG_NF_DEFRAG_IPV4 is not set
427CONFIG_IP_NF_QUEUE=m
428CONFIG_IP_NF_IPTABLES=m
429CONFIG_IP_NF_MATCH_ADDRTYPE=m
430# CONFIG_IP_NF_MATCH_AH is not set
431CONFIG_IP_NF_MATCH_ECN=m
432CONFIG_IP_NF_MATCH_TTL=m
433CONFIG_IP_NF_FILTER=m
434CONFIG_IP_NF_TARGET_REJECT=m
435CONFIG_IP_NF_TARGET_LOG=m
436CONFIG_IP_NF_TARGET_ULOG=m
437CONFIG_IP_NF_MANGLE=m
438CONFIG_IP_NF_TARGET_ECN=m
439# CONFIG_IP_NF_TARGET_TTL is not set
440CONFIG_IP_NF_RAW=m
441# CONFIG_IP_NF_SECURITY is not set
442CONFIG_IP_NF_ARPTABLES=m
443CONFIG_IP_NF_ARPFILTER=m
444CONFIG_IP_NF_ARP_MANGLE=m
445
446#
447# IPv6: Netfilter Configuration
448#
449CONFIG_IP6_NF_QUEUE=m
450CONFIG_IP6_NF_IPTABLES=m
451# CONFIG_IP6_NF_MATCH_AH is not set
452CONFIG_IP6_NF_MATCH_EUI64=m
453CONFIG_IP6_NF_MATCH_FRAG=m
454CONFIG_IP6_NF_MATCH_OPTS=m
455CONFIG_IP6_NF_MATCH_HL=m
456CONFIG_IP6_NF_MATCH_IPV6HEADER=m
457# CONFIG_IP6_NF_MATCH_MH is not set
458CONFIG_IP6_NF_MATCH_RT=m
459CONFIG_IP6_NF_TARGET_LOG=m
460CONFIG_IP6_NF_FILTER=m
461# CONFIG_IP6_NF_TARGET_REJECT is not set
462CONFIG_IP6_NF_MANGLE=m
463# CONFIG_IP6_NF_TARGET_HL is not set
464CONFIG_IP6_NF_RAW=m
465# CONFIG_IP6_NF_SECURITY is not set
466# CONFIG_BRIDGE_NF_EBTABLES is not set
467# CONFIG_IP_DCCP is not set
468CONFIG_IP_SCTP=m
469# CONFIG_SCTP_DBG_MSG is not set
470# CONFIG_SCTP_DBG_OBJCNT is not set
471# CONFIG_SCTP_HMAC_NONE is not set
472# CONFIG_SCTP_HMAC_SHA1 is not set
473CONFIG_SCTP_HMAC_MD5=y
474CONFIG_TIPC=m
475# CONFIG_TIPC_ADVANCED is not set
476# CONFIG_TIPC_DEBUG is not set
477CONFIG_ATM=m
478CONFIG_ATM_CLIP=m
479# CONFIG_ATM_CLIP_NO_ICMP is not set
480CONFIG_ATM_LANE=m
481CONFIG_ATM_MPOA=m
482CONFIG_ATM_BR2684=m
483# CONFIG_ATM_BR2684_IPFILTER is not set
484CONFIG_STP=m
485CONFIG_BRIDGE=m
486# CONFIG_NET_DSA is not set
487CONFIG_VLAN_8021Q=m
488# CONFIG_VLAN_8021Q_GVRP is not set
489# CONFIG_DECNET is not set
490CONFIG_LLC=m
491# CONFIG_LLC2 is not set
492# CONFIG_IPX is not set
493# CONFIG_ATALK is not set
494# CONFIG_X25 is not set
495# CONFIG_LAPB is not set
496# CONFIG_ECONET is not set
497CONFIG_WAN_ROUTER=m
498CONFIG_NET_SCHED=y
499
500#
501# Queueing/Scheduling
502#
503CONFIG_NET_SCH_CBQ=m
504CONFIG_NET_SCH_HTB=m
505CONFIG_NET_SCH_HFSC=m
506CONFIG_NET_SCH_ATM=m
507CONFIG_NET_SCH_PRIO=m
508# CONFIG_NET_SCH_MULTIQ is not set
509CONFIG_NET_SCH_RED=m
510CONFIG_NET_SCH_SFQ=m
511CONFIG_NET_SCH_TEQL=m
512CONFIG_NET_SCH_TBF=m
513CONFIG_NET_SCH_GRED=m
514CONFIG_NET_SCH_DSMARK=m
515CONFIG_NET_SCH_NETEM=m
516# CONFIG_NET_SCH_DRR is not set
517
518#
519# Classification
520#
521CONFIG_NET_CLS=y
522# CONFIG_NET_CLS_BASIC is not set
523CONFIG_NET_CLS_TCINDEX=m
524CONFIG_NET_CLS_ROUTE4=m
525CONFIG_NET_CLS_ROUTE=y
526CONFIG_NET_CLS_FW=m
527CONFIG_NET_CLS_U32=m
528# CONFIG_CLS_U32_PERF is not set
529# CONFIG_CLS_U32_MARK is not set
530CONFIG_NET_CLS_RSVP=m
531CONFIG_NET_CLS_RSVP6=m
532# CONFIG_NET_CLS_FLOW is not set
533# CONFIG_NET_EMATCH is not set
534# CONFIG_NET_CLS_ACT is not set
535# CONFIG_NET_CLS_IND is not set
536CONFIG_NET_SCH_FIFO=y
537# CONFIG_DCB is not set
538
539#
540# Network testing
541#
542CONFIG_NET_PKTGEN=m
543# CONFIG_HAMRADIO is not set
544# CONFIG_CAN is not set
545# CONFIG_IRDA is not set
546# CONFIG_BT is not set
547# CONFIG_AF_RXRPC is not set
548# CONFIG_PHONET is not set
549CONFIG_FIB_RULES=y
550CONFIG_WIRELESS=y
551# CONFIG_CFG80211 is not set
552CONFIG_WIRELESS_OLD_REGULATORY=y
553# CONFIG_WIRELESS_EXT is not set
554# CONFIG_LIB80211 is not set
555# CONFIG_MAC80211 is not set
556# CONFIG_WIMAX is not set
557# CONFIG_RFKILL is not set
558# CONFIG_NET_9P is not set
559
560#
561# Device Drivers
562#
563
564#
565# Generic Driver Options
566#
567CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
568CONFIG_STANDALONE=y
569CONFIG_PREVENT_FIRMWARE_BUILD=y
570# CONFIG_FW_LOADER is not set
571# CONFIG_DEBUG_DRIVER is not set
572# CONFIG_DEBUG_DEVRES is not set
573# CONFIG_SYS_HYPERVISOR is not set
574# CONFIG_CONNECTOR is not set
575CONFIG_MTD=y
576# CONFIG_MTD_DEBUG is not set
577CONFIG_MTD_CONCAT=y
578CONFIG_MTD_PARTITIONS=y
579# CONFIG_MTD_TESTS is not set
580# CONFIG_MTD_REDBOOT_PARTS is not set
581# CONFIG_MTD_CMDLINE_PARTS is not set
582CONFIG_MTD_OF_PARTS=y
583# CONFIG_MTD_AR7_PARTS is not set
584
585#
586# User Modules And Translation Layers
587#
588CONFIG_MTD_CHAR=y
589CONFIG_MTD_BLKDEVS=y
590CONFIG_MTD_BLOCK=y
591# CONFIG_FTL is not set
592# CONFIG_NFTL is not set
593# CONFIG_INFTL is not set
594# CONFIG_RFD_FTL is not set
595# CONFIG_SSFDC is not set
596# CONFIG_MTD_OOPS is not set
597
598#
599# RAM/ROM/Flash chip drivers
600#
601CONFIG_MTD_CFI=y
602CONFIG_MTD_JEDECPROBE=y
603CONFIG_MTD_GEN_PROBE=y
604# CONFIG_MTD_CFI_ADV_OPTIONS is not set
605CONFIG_MTD_MAP_BANK_WIDTH_1=y
606CONFIG_MTD_MAP_BANK_WIDTH_2=y
607CONFIG_MTD_MAP_BANK_WIDTH_4=y
608# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
609# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
610# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
611CONFIG_MTD_CFI_I1=y
612CONFIG_MTD_CFI_I2=y
613# CONFIG_MTD_CFI_I4 is not set
614# CONFIG_MTD_CFI_I8 is not set
615CONFIG_MTD_CFI_INTELEXT=y
616CONFIG_MTD_CFI_AMDSTD=y
617# CONFIG_MTD_CFI_STAA is not set
618CONFIG_MTD_CFI_UTIL=y
619# CONFIG_MTD_RAM is not set
620# CONFIG_MTD_ROM is not set
621# CONFIG_MTD_ABSENT is not set
622
623#
624# Mapping drivers for chip access
625#
626# CONFIG_MTD_COMPLEX_MAPPINGS is not set
627# CONFIG_MTD_PHYSMAP is not set
628CONFIG_MTD_PHYSMAP_OF=y
629# CONFIG_MTD_INTEL_VR_NOR is not set
630# CONFIG_MTD_PLATRAM is not set
631
632#
633# Self-contained MTD device drivers
634#
635# CONFIG_MTD_PMC551 is not set
636# CONFIG_MTD_SLRAM is not set
637# CONFIG_MTD_PHRAM is not set
638# CONFIG_MTD_MTDRAM is not set
639# CONFIG_MTD_BLOCK2MTD is not set
640
641#
642# Disk-On-Chip Device Drivers
643#
644# CONFIG_MTD_DOC2000 is not set
645# CONFIG_MTD_DOC2001 is not set
646# CONFIG_MTD_DOC2001PLUS is not set
647# CONFIG_MTD_NAND is not set
648# CONFIG_MTD_ONENAND is not set
649
650#
651# LPDDR flash memory drivers
652#
653# CONFIG_MTD_LPDDR is not set
654
655#
656# UBI - Unsorted block images
657#
658# CONFIG_MTD_UBI is not set
659CONFIG_OF_DEVICE=y
660CONFIG_OF_GPIO=y
661CONFIG_OF_I2C=y
662# CONFIG_PARPORT is not set
663CONFIG_BLK_DEV=y
664# CONFIG_BLK_DEV_FD is not set
665# CONFIG_BLK_CPQ_DA is not set
666# CONFIG_BLK_CPQ_CISS_DA is not set
667# CONFIG_BLK_DEV_DAC960 is not set
668# CONFIG_BLK_DEV_UMEM is not set
669# CONFIG_BLK_DEV_COW_COMMON is not set
670CONFIG_BLK_DEV_LOOP=m
671CONFIG_BLK_DEV_CRYPTOLOOP=m
672CONFIG_BLK_DEV_NBD=m
673# CONFIG_BLK_DEV_SX8 is not set
674# CONFIG_BLK_DEV_UB is not set
675CONFIG_BLK_DEV_RAM=y
676CONFIG_BLK_DEV_RAM_COUNT=16
677CONFIG_BLK_DEV_RAM_SIZE=131072
678# CONFIG_BLK_DEV_XIP is not set
679# CONFIG_CDROM_PKTCDVD is not set
680# CONFIG_ATA_OVER_ETH is not set
681# CONFIG_BLK_DEV_HD is not set
682CONFIG_MISC_DEVICES=y
683# CONFIG_PHANTOM is not set
684# CONFIG_SGI_IOC4 is not set
685# CONFIG_TIFM_CORE is not set
686# CONFIG_ICS932S401 is not set
687# CONFIG_ENCLOSURE_SERVICES is not set
688# CONFIG_HP_ILO is not set
689# CONFIG_C2PORT is not set
690
691#
692# EEPROM support
693#
694# CONFIG_EEPROM_AT24 is not set
695# CONFIG_EEPROM_LEGACY is not set
696# CONFIG_EEPROM_93CX6 is not set
697CONFIG_HAVE_IDE=y
698# CONFIG_IDE is not set
699
700#
701# SCSI device support
702#
703# CONFIG_RAID_ATTRS is not set
704CONFIG_SCSI=y
705CONFIG_SCSI_DMA=y
706# CONFIG_SCSI_TGT is not set
707# CONFIG_SCSI_NETLINK is not set
708CONFIG_SCSI_PROC_FS=y
709
710#
711# SCSI support type (disk, tape, CD-ROM)
712#
713CONFIG_BLK_DEV_SD=y
714CONFIG_CHR_DEV_ST=y
715# CONFIG_CHR_DEV_OSST is not set
716CONFIG_BLK_DEV_SR=y
717# CONFIG_BLK_DEV_SR_VENDOR is not set
718# CONFIG_CHR_DEV_SG is not set
719# CONFIG_CHR_DEV_SCH is not set
720
721#
722# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
723#
724# CONFIG_SCSI_MULTI_LUN is not set
725# CONFIG_SCSI_CONSTANTS is not set
726# CONFIG_SCSI_LOGGING is not set
727# CONFIG_SCSI_SCAN_ASYNC is not set
728CONFIG_SCSI_WAIT_SCAN=m
729
730#
731# SCSI Transports
732#
733# CONFIG_SCSI_SPI_ATTRS is not set
734# CONFIG_SCSI_FC_ATTRS is not set
735# CONFIG_SCSI_ISCSI_ATTRS is not set
736# CONFIG_SCSI_SAS_LIBSAS is not set
737# CONFIG_SCSI_SRP_ATTRS is not set
738CONFIG_SCSI_LOWLEVEL=y
739# CONFIG_ISCSI_TCP is not set
740# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
741# CONFIG_SCSI_3W_9XXX is not set
742# CONFIG_SCSI_ACARD is not set
743# CONFIG_SCSI_AACRAID is not set
744# CONFIG_SCSI_AIC7XXX is not set
745# CONFIG_SCSI_AIC7XXX_OLD is not set
746# CONFIG_SCSI_AIC79XX is not set
747# CONFIG_SCSI_AIC94XX is not set
748# CONFIG_SCSI_DPT_I2O is not set
749# CONFIG_SCSI_ADVANSYS is not set
750# CONFIG_SCSI_ARCMSR is not set
751# CONFIG_MEGARAID_NEWGEN is not set
752# CONFIG_MEGARAID_LEGACY is not set
753# CONFIG_MEGARAID_SAS is not set
754# CONFIG_SCSI_HPTIOP is not set
755# CONFIG_SCSI_BUSLOGIC is not set
756# CONFIG_LIBFC is not set
757# CONFIG_FCOE is not set
758# CONFIG_SCSI_DMX3191D is not set
759# CONFIG_SCSI_EATA is not set
760# CONFIG_SCSI_FUTURE_DOMAIN is not set
761# CONFIG_SCSI_GDTH is not set
762# CONFIG_SCSI_IPS is not set
763# CONFIG_SCSI_INITIO is not set
764# CONFIG_SCSI_INIA100 is not set
765# CONFIG_SCSI_MVSAS is not set
766# CONFIG_SCSI_STEX is not set
767# CONFIG_SCSI_SYM53C8XX_2 is not set
768# CONFIG_SCSI_IPR is not set
769# CONFIG_SCSI_QLOGIC_1280 is not set
770# CONFIG_SCSI_QLA_FC is not set
771# CONFIG_SCSI_QLA_ISCSI is not set
772# CONFIG_SCSI_LPFC is not set
773# CONFIG_SCSI_DC395x is not set
774# CONFIG_SCSI_DC390T is not set
775# CONFIG_SCSI_NSP32 is not set
776# CONFIG_SCSI_DEBUG is not set
777# CONFIG_SCSI_SRP is not set
778# CONFIG_SCSI_DH is not set
779CONFIG_ATA=y
780# CONFIG_ATA_NONSTANDARD is not set
781CONFIG_SATA_PMP=y
782# CONFIG_SATA_AHCI is not set
783# CONFIG_SATA_SIL24 is not set
784# CONFIG_SATA_FSL is not set
785CONFIG_ATA_SFF=y
786# CONFIG_SATA_SVW is not set
787# CONFIG_ATA_PIIX is not set
788# CONFIG_SATA_MV is not set
789# CONFIG_SATA_NV is not set
790# CONFIG_PDC_ADMA is not set
791# CONFIG_SATA_QSTOR is not set
792# CONFIG_SATA_PROMISE is not set
793# CONFIG_SATA_SX4 is not set
794CONFIG_SATA_SIL=y
795# CONFIG_SATA_SIS is not set
796# CONFIG_SATA_ULI is not set
797# CONFIG_SATA_VIA is not set
798# CONFIG_SATA_VITESSE is not set
799# CONFIG_SATA_INIC162X is not set
800# CONFIG_PATA_ALI is not set
801# CONFIG_PATA_AMD is not set
802# CONFIG_PATA_ARTOP is not set
803# CONFIG_PATA_ATIIXP is not set
804# CONFIG_PATA_CMD640_PCI is not set
805# CONFIG_PATA_CMD64X is not set
806# CONFIG_PATA_CS5520 is not set
807# CONFIG_PATA_CS5530 is not set
808# CONFIG_PATA_CYPRESS is not set
809# CONFIG_PATA_EFAR is not set
810# CONFIG_ATA_GENERIC is not set
811# CONFIG_PATA_HPT366 is not set
812# CONFIG_PATA_HPT37X is not set
813# CONFIG_PATA_HPT3X2N is not set
814# CONFIG_PATA_HPT3X3 is not set
815# CONFIG_PATA_IT821X is not set
816# CONFIG_PATA_IT8213 is not set
817# CONFIG_PATA_JMICRON is not set
818# CONFIG_PATA_TRIFLEX is not set
819# CONFIG_PATA_MARVELL is not set
820# CONFIG_PATA_MPIIX is not set
821# CONFIG_PATA_OLDPIIX is not set
822# CONFIG_PATA_NETCELL is not set
823# CONFIG_PATA_NINJA32 is not set
824# CONFIG_PATA_NS87410 is not set
825# CONFIG_PATA_NS87415 is not set
826# CONFIG_PATA_OPTI is not set
827# CONFIG_PATA_OPTIDMA is not set
828# CONFIG_PATA_PDC_OLD is not set
829# CONFIG_PATA_RADISYS is not set
830# CONFIG_PATA_RZ1000 is not set
831# CONFIG_PATA_SC1200 is not set
832# CONFIG_PATA_SERVERWORKS is not set
833# CONFIG_PATA_PDC2027X is not set
834# CONFIG_PATA_SIL680 is not set
835# CONFIG_PATA_SIS is not set
836# CONFIG_PATA_VIA is not set
837# CONFIG_PATA_WINBOND is not set
838# CONFIG_PATA_PLATFORM is not set
839# CONFIG_PATA_SCH is not set
840# CONFIG_MD is not set
841# CONFIG_FUSION is not set
842
843#
844# IEEE 1394 (FireWire) support
845#
846
847#
848# Enable only one of the two stacks, unless you know what you are doing
849#
850# CONFIG_FIREWIRE is not set
851# CONFIG_IEEE1394 is not set
852# CONFIG_I2O is not set
853# CONFIG_MACINTOSH_DRIVERS is not set
854CONFIG_NETDEVICES=y
855CONFIG_DUMMY=m
856CONFIG_BONDING=m
857# CONFIG_MACVLAN is not set
858# CONFIG_EQUALIZER is not set
859CONFIG_TUN=m
860# CONFIG_VETH is not set
861# CONFIG_ARCNET is not set
862CONFIG_PHYLIB=y
863
864#
865# MII PHY device drivers
866#
867# CONFIG_MARVELL_PHY is not set
868# CONFIG_DAVICOM_PHY is not set
869# CONFIG_QSEMI_PHY is not set
870# CONFIG_LXT_PHY is not set
871# CONFIG_CICADA_PHY is not set
872# CONFIG_VITESSE_PHY is not set
873# CONFIG_SMSC_PHY is not set
874# CONFIG_BROADCOM_PHY is not set
875# CONFIG_ICPLUS_PHY is not set
876# CONFIG_REALTEK_PHY is not set
877# CONFIG_NATIONAL_PHY is not set
878# CONFIG_STE10XP is not set
879# CONFIG_LSI_ET1011C_PHY is not set
880# CONFIG_FIXED_PHY is not set
881# CONFIG_MDIO_BITBANG is not set
882CONFIG_NET_ETHERNET=y
883CONFIG_MII=y
884# CONFIG_HAPPYMEAL is not set
885# CONFIG_SUNGEM is not set
886# CONFIG_CASSINI is not set
887# CONFIG_NET_VENDOR_3COM is not set
888# CONFIG_NET_TULIP is not set
889# CONFIG_HP100 is not set
890# CONFIG_IBM_NEW_EMAC_ZMII is not set
891# CONFIG_IBM_NEW_EMAC_RGMII is not set
892# CONFIG_IBM_NEW_EMAC_TAH is not set
893# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
894# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
895# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
896# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
897# CONFIG_NET_PCI is not set
898# CONFIG_B44 is not set
899# CONFIG_ATL2 is not set
900CONFIG_NETDEV_1000=y
901# CONFIG_ACENIC is not set
902# CONFIG_DL2K is not set
903# CONFIG_E1000 is not set
904# CONFIG_E1000E is not set
905# CONFIG_IP1000 is not set
906# CONFIG_IGB is not set
907# CONFIG_NS83820 is not set
908# CONFIG_HAMACHI is not set
909# CONFIG_YELLOWFIN is not set
910# CONFIG_R8169 is not set
911# CONFIG_SIS190 is not set
912# CONFIG_SKGE is not set
913# CONFIG_SKY2 is not set
914# CONFIG_VIA_VELOCITY is not set
915# CONFIG_TIGON3 is not set
916# CONFIG_BNX2 is not set
917CONFIG_GIANFAR=y
918# CONFIG_MV643XX_ETH is not set
919# CONFIG_QLA3XXX is not set
920# CONFIG_ATL1 is not set
921# CONFIG_ATL1E is not set
922# CONFIG_ATL1C is not set
923# CONFIG_JME is not set
924# CONFIG_NETDEV_10000 is not set
925# CONFIG_TR is not set
926
927#
928# Wireless LAN
929#
930# CONFIG_WLAN_PRE80211 is not set
931# CONFIG_WLAN_80211 is not set
932# CONFIG_IWLWIFI_LEDS is not set
933
934#
935# Enable WiMAX (Networking options) to see the WiMAX drivers
936#
937
938#
939# USB Network Adapters
940#
941# CONFIG_USB_CATC is not set
942# CONFIG_USB_KAWETH is not set
943# CONFIG_USB_PEGASUS is not set
944# CONFIG_USB_RTL8150 is not set
945# CONFIG_USB_USBNET is not set
946# CONFIG_WAN is not set
947CONFIG_ATM_DRIVERS=y
948# CONFIG_ATM_DUMMY is not set
949# CONFIG_ATM_TCP is not set
950# CONFIG_ATM_LANAI is not set
951# CONFIG_ATM_ENI is not set
952# CONFIG_ATM_FIRESTREAM is not set
953# CONFIG_ATM_ZATM is not set
954# CONFIG_ATM_NICSTAR is not set
955# CONFIG_ATM_IDT77252 is not set
956# CONFIG_ATM_AMBASSADOR is not set
957# CONFIG_ATM_HORIZON is not set
958# CONFIG_ATM_IA is not set
959# CONFIG_ATM_FORE200E is not set
960# CONFIG_ATM_HE is not set
961# CONFIG_ATM_SOLOS is not set
962# CONFIG_FDDI is not set
963# CONFIG_HIPPI is not set
964CONFIG_PPP=m
965CONFIG_PPP_MULTILINK=y
966CONFIG_PPP_FILTER=y
967CONFIG_PPP_ASYNC=m
968CONFIG_PPP_SYNC_TTY=m
969CONFIG_PPP_DEFLATE=m
970CONFIG_PPP_BSDCOMP=m
971# CONFIG_PPP_MPPE is not set
972CONFIG_PPPOE=m
973CONFIG_PPPOATM=m
974# CONFIG_PPPOL2TP is not set
975CONFIG_SLIP=m
976CONFIG_SLIP_COMPRESSED=y
977CONFIG_SLHC=m
978CONFIG_SLIP_SMART=y
979CONFIG_SLIP_MODE_SLIP6=y
980# CONFIG_NET_FC is not set
981CONFIG_NETCONSOLE=y
982# CONFIG_NETCONSOLE_DYNAMIC is not set
983CONFIG_NETPOLL=y
984CONFIG_NETPOLL_TRAP=y
985CONFIG_NET_POLL_CONTROLLER=y
986# CONFIG_ISDN is not set
987# CONFIG_PHONE is not set
988
989#
990# Input device support
991#
992CONFIG_INPUT=y
993CONFIG_INPUT_FF_MEMLESS=m
994# CONFIG_INPUT_POLLDEV is not set
995
996#
997# Userland interfaces
998#
999CONFIG_INPUT_MOUSEDEV=y
1000CONFIG_INPUT_MOUSEDEV_PSAUX=y
1001CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
1002CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
1003# CONFIG_INPUT_JOYDEV is not set
1004# CONFIG_INPUT_EVDEV is not set
1005# CONFIG_INPUT_EVBUG is not set
1006
1007#
1008# Input Device Drivers
1009#
1010# CONFIG_INPUT_KEYBOARD is not set
1011# CONFIG_INPUT_MOUSE is not set
1012# CONFIG_INPUT_JOYSTICK is not set
1013# CONFIG_INPUT_TABLET is not set
1014# CONFIG_INPUT_TOUCHSCREEN is not set
1015# CONFIG_INPUT_MISC is not set
1016
1017#
1018# Hardware I/O ports
1019#
1020# CONFIG_SERIO is not set
1021# CONFIG_GAMEPORT is not set
1022
1023#
1024# Character devices
1025#
1026CONFIG_VT=y
1027CONFIG_CONSOLE_TRANSLATIONS=y
1028CONFIG_VT_CONSOLE=y
1029CONFIG_HW_CONSOLE=y
1030# CONFIG_VT_HW_CONSOLE_BINDING is not set
1031CONFIG_DEVKMEM=y
1032# CONFIG_SERIAL_NONSTANDARD is not set
1033# CONFIG_NOZOMI is not set
1034
1035#
1036# Serial drivers
1037#
1038CONFIG_SERIAL_8250=y
1039CONFIG_SERIAL_8250_CONSOLE=y
1040# CONFIG_SERIAL_8250_PCI is not set
1041CONFIG_SERIAL_8250_NR_UARTS=2
1042CONFIG_SERIAL_8250_RUNTIME_UARTS=2
1043# CONFIG_SERIAL_8250_EXTENDED is not set
1044
1045#
1046# Non-8250 serial port support
1047#
1048# CONFIG_SERIAL_UARTLITE is not set
1049CONFIG_SERIAL_CORE=y
1050CONFIG_SERIAL_CORE_CONSOLE=y
1051# CONFIG_SERIAL_JSM is not set
1052# CONFIG_SERIAL_OF_PLATFORM is not set
1053CONFIG_UNIX98_PTYS=y
1054# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
1055# CONFIG_LEGACY_PTYS is not set
1056# CONFIG_HVC_UDBG is not set
1057# CONFIG_IPMI_HANDLER is not set
1058CONFIG_HW_RANDOM=y
1059CONFIG_NVRAM=y
1060# CONFIG_R3964 is not set
1061# CONFIG_APPLICOM is not set
1062# CONFIG_RAW_DRIVER is not set
1063# CONFIG_TCG_TPM is not set
1064CONFIG_DEVPORT=y
1065CONFIG_I2C=y
1066CONFIG_I2C_BOARDINFO=y
1067CONFIG_I2C_CHARDEV=y
1068CONFIG_I2C_HELPER_AUTO=y
1069
1070#
1071# I2C Hardware Bus support
1072#
1073
1074#
1075# PC SMBus host controller drivers
1076#
1077# CONFIG_I2C_ALI1535 is not set
1078# CONFIG_I2C_ALI1563 is not set
1079# CONFIG_I2C_ALI15X3 is not set
1080# CONFIG_I2C_AMD756 is not set
1081# CONFIG_I2C_AMD8111 is not set
1082# CONFIG_I2C_I801 is not set
1083# CONFIG_I2C_ISCH is not set
1084# CONFIG_I2C_PIIX4 is not set
1085# CONFIG_I2C_NFORCE2 is not set
1086# CONFIG_I2C_SIS5595 is not set
1087# CONFIG_I2C_SIS630 is not set
1088# CONFIG_I2C_SIS96X is not set
1089# CONFIG_I2C_VIA is not set
1090# CONFIG_I2C_VIAPRO is not set
1091
1092#
1093# I2C system bus drivers (mostly embedded / system-on-chip)
1094#
1095# CONFIG_I2C_GPIO is not set
1096CONFIG_I2C_MPC=y
1097# CONFIG_I2C_OCORES is not set
1098# CONFIG_I2C_SIMTEC is not set
1099
1100#
1101# External I2C/SMBus adapter drivers
1102#
1103# CONFIG_I2C_PARPORT_LIGHT is not set
1104# CONFIG_I2C_TAOS_EVM is not set
1105# CONFIG_I2C_TINY_USB is not set
1106
1107#
1108# Graphics adapter I2C/DDC channel drivers
1109#
1110# CONFIG_I2C_VOODOO3 is not set
1111
1112#
1113# Other I2C/SMBus bus drivers
1114#
1115# CONFIG_I2C_PCA_PLATFORM is not set
1116# CONFIG_I2C_STUB is not set
1117
1118#
1119# Miscellaneous I2C Chip support
1120#
1121CONFIG_DS1682=y
1122# CONFIG_SENSORS_PCF8574 is not set
1123# CONFIG_PCF8575 is not set
1124# CONFIG_SENSORS_PCA9539 is not set
1125# CONFIG_SENSORS_PCF8591 is not set
1126# CONFIG_SENSORS_MAX6875 is not set
1127# CONFIG_SENSORS_TSL2550 is not set
1128# CONFIG_I2C_DEBUG_CORE is not set
1129# CONFIG_I2C_DEBUG_ALGO is not set
1130# CONFIG_I2C_DEBUG_BUS is not set
1131# CONFIG_I2C_DEBUG_CHIP is not set
1132# CONFIG_SPI is not set
1133CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
1134CONFIG_ARCH_REQUIRE_GPIOLIB=y
1135CONFIG_GPIOLIB=y
1136# CONFIG_DEBUG_GPIO is not set
1137# CONFIG_GPIO_SYSFS is not set
1138
1139#
1140# Memory mapped GPIO expanders:
1141#
1142# CONFIG_GPIO_XILINX is not set
1143
1144#
1145# I2C GPIO expanders:
1146#
1147# CONFIG_GPIO_MAX732X is not set
1148# CONFIG_GPIO_PCA953X is not set
1149# CONFIG_GPIO_PCF857X is not set
1150
1151#
1152# PCI GPIO expanders:
1153#
1154# CONFIG_GPIO_BT8XX is not set
1155
1156#
1157# SPI GPIO expanders:
1158#
1159# CONFIG_W1 is not set
1160# CONFIG_POWER_SUPPLY is not set
1161CONFIG_HWMON=y
1162# CONFIG_HWMON_VID is not set
1163# CONFIG_SENSORS_AD7414 is not set
1164# CONFIG_SENSORS_AD7418 is not set
1165# CONFIG_SENSORS_ADM1021 is not set
1166# CONFIG_SENSORS_ADM1025 is not set
1167# CONFIG_SENSORS_ADM1026 is not set
1168# CONFIG_SENSORS_ADM1029 is not set
1169# CONFIG_SENSORS_ADM1031 is not set
1170# CONFIG_SENSORS_ADM9240 is not set
1171# CONFIG_SENSORS_ADT7462 is not set
1172# CONFIG_SENSORS_ADT7470 is not set
1173# CONFIG_SENSORS_ADT7473 is not set
1174# CONFIG_SENSORS_ADT7475 is not set
1175# CONFIG_SENSORS_ATXP1 is not set
1176# CONFIG_SENSORS_DS1621 is not set
1177# CONFIG_SENSORS_I5K_AMB is not set
1178# CONFIG_SENSORS_F71805F is not set
1179# CONFIG_SENSORS_F71882FG is not set
1180# CONFIG_SENSORS_F75375S is not set
1181# CONFIG_SENSORS_GL518SM is not set
1182# CONFIG_SENSORS_GL520SM is not set
1183# CONFIG_SENSORS_IT87 is not set
1184# CONFIG_SENSORS_LM63 is not set
1185# CONFIG_SENSORS_LM75 is not set
1186# CONFIG_SENSORS_LM77 is not set
1187# CONFIG_SENSORS_LM78 is not set
1188# CONFIG_SENSORS_LM80 is not set
1189# CONFIG_SENSORS_LM83 is not set
1190# CONFIG_SENSORS_LM85 is not set
1191# CONFIG_SENSORS_LM87 is not set
1192CONFIG_SENSORS_LM90=y
1193CONFIG_SENSORS_LM92=y
1194# CONFIG_SENSORS_LM93 is not set
1195# CONFIG_SENSORS_LTC4245 is not set
1196# CONFIG_SENSORS_MAX1619 is not set
1197# CONFIG_SENSORS_MAX6650 is not set
1198# CONFIG_SENSORS_PC87360 is not set
1199# CONFIG_SENSORS_PC87427 is not set
1200# CONFIG_SENSORS_SIS5595 is not set
1201# CONFIG_SENSORS_DME1737 is not set
1202# CONFIG_SENSORS_SMSC47M1 is not set
1203# CONFIG_SENSORS_SMSC47M192 is not set
1204# CONFIG_SENSORS_SMSC47B397 is not set
1205# CONFIG_SENSORS_ADS7828 is not set
1206# CONFIG_SENSORS_THMC50 is not set
1207# CONFIG_SENSORS_VIA686A is not set
1208# CONFIG_SENSORS_VT1211 is not set
1209# CONFIG_SENSORS_VT8231 is not set
1210# CONFIG_SENSORS_W83781D is not set
1211# CONFIG_SENSORS_W83791D is not set
1212# CONFIG_SENSORS_W83792D is not set
1213# CONFIG_SENSORS_W83793 is not set
1214# CONFIG_SENSORS_W83L785TS is not set
1215# CONFIG_SENSORS_W83L786NG is not set
1216# CONFIG_SENSORS_W83627HF is not set
1217# CONFIG_SENSORS_W83627EHF is not set
1218# CONFIG_HWMON_DEBUG_CHIP is not set
1219# CONFIG_THERMAL is not set
1220# CONFIG_THERMAL_HWMON is not set
1221CONFIG_WATCHDOG=y
1222# CONFIG_WATCHDOG_NOWAYOUT is not set
1223
1224#
1225# Watchdog Device Drivers
1226#
1227# CONFIG_SOFT_WATCHDOG is not set
1228# CONFIG_ALIM7101_WDT is not set
1229CONFIG_GEF_WDT=y
1230# CONFIG_8xxx_WDT is not set
1231
1232#
1233# PCI-based Watchdog Cards
1234#
1235# CONFIG_PCIPCWATCHDOG is not set
1236# CONFIG_WDTPCI is not set
1237
1238#
1239# USB-based Watchdog Cards
1240#
1241# CONFIG_USBPCWATCHDOG is not set
1242CONFIG_SSB_POSSIBLE=y
1243
1244#
1245# Sonics Silicon Backplane
1246#
1247# CONFIG_SSB is not set
1248
1249#
1250# Multifunction device drivers
1251#
1252# CONFIG_MFD_CORE is not set
1253# CONFIG_MFD_SM501 is not set
1254# CONFIG_HTC_PASIC3 is not set
1255# CONFIG_TPS65010 is not set
1256# CONFIG_TWL4030_CORE is not set
1257# CONFIG_MFD_TMIO is not set
1258# CONFIG_PMIC_DA903X is not set
1259# CONFIG_MFD_WM8400 is not set
1260# CONFIG_MFD_WM8350_I2C is not set
1261# CONFIG_MFD_PCF50633 is not set
1262# CONFIG_REGULATOR is not set
1263
1264#
1265# Multimedia devices
1266#
1267
1268#
1269# Multimedia core support
1270#
1271# CONFIG_VIDEO_DEV is not set
1272# CONFIG_DVB_CORE is not set
1273# CONFIG_VIDEO_MEDIA is not set
1274
1275#
1276# Multimedia drivers
1277#
1278CONFIG_DAB=y
1279# CONFIG_USB_DABUSB is not set
1280
1281#
1282# Graphics support
1283#
1284# CONFIG_AGP is not set
1285# CONFIG_DRM is not set
1286# CONFIG_VGASTATE is not set
1287CONFIG_VIDEO_OUTPUT_CONTROL=m
1288# CONFIG_FB is not set
1289# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
1290
1291#
1292# Display device support
1293#
1294# CONFIG_DISPLAY_SUPPORT is not set
1295
1296#
1297# Console display driver support
1298#
1299CONFIG_VGA_CONSOLE=y
1300# CONFIG_VGACON_SOFT_SCROLLBACK is not set
1301CONFIG_DUMMY_CONSOLE=y
1302# CONFIG_SOUND is not set
1303CONFIG_HID_SUPPORT=y
1304CONFIG_HID=y
1305# CONFIG_HID_DEBUG is not set
1306# CONFIG_HIDRAW is not set
1307
1308#
1309# USB Input Devices
1310#
1311CONFIG_USB_HID=y
1312# CONFIG_HID_PID is not set
1313# CONFIG_USB_HIDDEV is not set
1314
1315#
1316# Special HID drivers
1317#
1318CONFIG_HID_COMPAT=y
1319CONFIG_HID_A4TECH=y
1320CONFIG_HID_APPLE=y
1321CONFIG_HID_BELKIN=y
1322CONFIG_HID_CHERRY=y
1323CONFIG_HID_CHICONY=y
1324CONFIG_HID_CYPRESS=y
1325CONFIG_HID_EZKEY=y
1326CONFIG_HID_GYRATION=y
1327CONFIG_HID_LOGITECH=y
1328# CONFIG_LOGITECH_FF is not set
1329# CONFIG_LOGIRUMBLEPAD2_FF is not set
1330CONFIG_HID_MICROSOFT=y
1331CONFIG_HID_MONTEREY=y
1332# CONFIG_HID_NTRIG is not set
1333CONFIG_HID_PANTHERLORD=y
1334# CONFIG_PANTHERLORD_FF is not set
1335CONFIG_HID_PETALYNX=y
1336CONFIG_HID_SAMSUNG=y
1337CONFIG_HID_SONY=y
1338CONFIG_HID_SUNPLUS=y
1339# CONFIG_GREENASIA_FF is not set
1340# CONFIG_HID_TOPSEED is not set
1341CONFIG_THRUSTMASTER_FF=m
1342CONFIG_ZEROPLUS_FF=m
1343CONFIG_USB_SUPPORT=y
1344CONFIG_USB_ARCH_HAS_HCD=y
1345CONFIG_USB_ARCH_HAS_OHCI=y
1346CONFIG_USB_ARCH_HAS_EHCI=y
1347CONFIG_USB=y
1348# CONFIG_USB_DEBUG is not set
1349# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
1350
1351#
1352# Miscellaneous USB options
1353#
1354# CONFIG_USB_DEVICEFS is not set
1355# CONFIG_USB_DEVICE_CLASS is not set
1356# CONFIG_USB_DYNAMIC_MINORS is not set
1357# CONFIG_USB_OTG is not set
1358# CONFIG_USB_OTG_WHITELIST is not set
1359# CONFIG_USB_OTG_BLACKLIST_HUB is not set
1360# CONFIG_USB_MON is not set
1361# CONFIG_USB_WUSB is not set
1362# CONFIG_USB_WUSB_CBAF is not set
1363
1364#
1365# USB Host Controller Drivers
1366#
1367# CONFIG_USB_C67X00_HCD is not set
1368CONFIG_USB_EHCI_HCD=y
1369# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
1370# CONFIG_USB_EHCI_TT_NEWSCHED is not set
1371# CONFIG_USB_EHCI_FSL is not set
1372# CONFIG_USB_EHCI_HCD_PPC_OF is not set
1373# CONFIG_USB_OXU210HP_HCD is not set
1374# CONFIG_USB_ISP116X_HCD is not set
1375# CONFIG_USB_ISP1760_HCD is not set
1376CONFIG_USB_OHCI_HCD=y
1377# CONFIG_USB_OHCI_HCD_PPC_OF is not set
1378# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
1379# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
1380CONFIG_USB_OHCI_LITTLE_ENDIAN=y
1381# CONFIG_USB_UHCI_HCD is not set
1382# CONFIG_USB_SL811_HCD is not set
1383# CONFIG_USB_R8A66597_HCD is not set
1384# CONFIG_USB_WHCI_HCD is not set
1385# CONFIG_USB_HWA_HCD is not set
1386
1387#
1388# USB Device Class drivers
1389#
1390# CONFIG_USB_ACM is not set
1391# CONFIG_USB_PRINTER is not set
1392# CONFIG_USB_WDM is not set
1393# CONFIG_USB_TMC is not set
1394
1395#
1396# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
1397#
1398
1399#
1400# see USB_STORAGE Help for more information
1401#
1402CONFIG_USB_STORAGE=y
1403# CONFIG_USB_STORAGE_DEBUG is not set
1404# CONFIG_USB_STORAGE_DATAFAB is not set
1405# CONFIG_USB_STORAGE_FREECOM is not set
1406# CONFIG_USB_STORAGE_ISD200 is not set
1407# CONFIG_USB_STORAGE_USBAT is not set
1408# CONFIG_USB_STORAGE_SDDR09 is not set
1409# CONFIG_USB_STORAGE_SDDR55 is not set
1410# CONFIG_USB_STORAGE_JUMPSHOT is not set
1411# CONFIG_USB_STORAGE_ALAUDA is not set
1412# CONFIG_USB_STORAGE_ONETOUCH is not set
1413# CONFIG_USB_STORAGE_KARMA is not set
1414# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
1415# CONFIG_USB_LIBUSUAL is not set
1416
1417#
1418# USB Imaging devices
1419#
1420# CONFIG_USB_MDC800 is not set
1421# CONFIG_USB_MICROTEK is not set
1422
1423#
1424# USB port drivers
1425#
1426# CONFIG_USB_SERIAL is not set
1427
1428#
1429# USB Miscellaneous drivers
1430#
1431# CONFIG_USB_EMI62 is not set
1432# CONFIG_USB_EMI26 is not set
1433# CONFIG_USB_ADUTUX is not set
1434# CONFIG_USB_SEVSEG is not set
1435# CONFIG_USB_RIO500 is not set
1436# CONFIG_USB_LEGOTOWER is not set
1437# CONFIG_USB_LCD is not set
1438# CONFIG_USB_BERRY_CHARGE is not set
1439# CONFIG_USB_LED is not set
1440# CONFIG_USB_CYPRESS_CY7C63 is not set
1441# CONFIG_USB_CYTHERM is not set
1442# CONFIG_USB_PHIDGET is not set
1443# CONFIG_USB_IDMOUSE is not set
1444# CONFIG_USB_FTDI_ELAN is not set
1445# CONFIG_USB_APPLEDISPLAY is not set
1446# CONFIG_USB_SISUSBVGA is not set
1447# CONFIG_USB_LD is not set
1448# CONFIG_USB_TRANCEVIBRATOR is not set
1449# CONFIG_USB_IOWARRIOR is not set
1450# CONFIG_USB_ISIGHTFW is not set
1451# CONFIG_USB_VST is not set
1452# CONFIG_USB_ATM is not set
1453# CONFIG_USB_GADGET is not set
1454
1455#
1456# OTG and related infrastructure
1457#
1458# CONFIG_USB_GPIO_VBUS is not set
1459# CONFIG_UWB is not set
1460# CONFIG_MMC is not set
1461# CONFIG_MEMSTICK is not set
1462# CONFIG_NEW_LEDS is not set
1463# CONFIG_ACCESSIBILITY is not set
1464# CONFIG_INFINIBAND is not set
1465# CONFIG_EDAC is not set
1466CONFIG_RTC_LIB=y
1467CONFIG_RTC_CLASS=y
1468CONFIG_RTC_HCTOSYS=y
1469CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
1470# CONFIG_RTC_DEBUG is not set
1471
1472#
1473# RTC interfaces
1474#
1475CONFIG_RTC_INTF_SYSFS=y
1476# CONFIG_RTC_INTF_PROC is not set
1477CONFIG_RTC_INTF_DEV=y
1478# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
1479# CONFIG_RTC_DRV_TEST is not set
1480
1481#
1482# I2C RTC drivers
1483#
1484# CONFIG_RTC_DRV_DS1307 is not set
1485# CONFIG_RTC_DRV_DS1374 is not set
1486# CONFIG_RTC_DRV_DS1672 is not set
1487# CONFIG_RTC_DRV_MAX6900 is not set
1488# CONFIG_RTC_DRV_RS5C372 is not set
1489# CONFIG_RTC_DRV_ISL1208 is not set
1490# CONFIG_RTC_DRV_X1205 is not set
1491# CONFIG_RTC_DRV_PCF8563 is not set
1492# CONFIG_RTC_DRV_PCF8583 is not set
1493# CONFIG_RTC_DRV_M41T80 is not set
1494# CONFIG_RTC_DRV_S35390A is not set
1495# CONFIG_RTC_DRV_FM3130 is not set
1496CONFIG_RTC_DRV_RX8581=y
1497
1498#
1499# SPI RTC drivers
1500#
1501
1502#
1503# Platform RTC drivers
1504#
1505# CONFIG_RTC_DRV_CMOS is not set
1506# CONFIG_RTC_DRV_DS1286 is not set
1507# CONFIG_RTC_DRV_DS1511 is not set
1508# CONFIG_RTC_DRV_DS1553 is not set
1509# CONFIG_RTC_DRV_DS1742 is not set
1510# CONFIG_RTC_DRV_STK17TA8 is not set
1511# CONFIG_RTC_DRV_M48T86 is not set
1512# CONFIG_RTC_DRV_M48T35 is not set
1513# CONFIG_RTC_DRV_M48T59 is not set
1514# CONFIG_RTC_DRV_BQ4802 is not set
1515# CONFIG_RTC_DRV_V3020 is not set
1516
1517#
1518# on-CPU RTC drivers
1519#
1520# CONFIG_RTC_DRV_PPC is not set
1521# CONFIG_DMADEVICES is not set
1522# CONFIG_UIO is not set
1523# CONFIG_STAGING is not set
1524
1525#
1526# File systems
1527#
1528CONFIG_EXT2_FS=y
1529CONFIG_EXT2_FS_XATTR=y
1530CONFIG_EXT2_FS_POSIX_ACL=y
1531# CONFIG_EXT2_FS_SECURITY is not set
1532# CONFIG_EXT2_FS_XIP is not set
1533CONFIG_EXT3_FS=y
1534CONFIG_EXT3_FS_XATTR=y
1535CONFIG_EXT3_FS_POSIX_ACL=y
1536# CONFIG_EXT3_FS_SECURITY is not set
1537# CONFIG_EXT4_FS is not set
1538CONFIG_JBD=y
1539CONFIG_FS_MBCACHE=y
1540# CONFIG_REISERFS_FS is not set
1541# CONFIG_JFS_FS is not set
1542CONFIG_FS_POSIX_ACL=y
1543CONFIG_FILE_LOCKING=y
1544# CONFIG_XFS_FS is not set
1545# CONFIG_OCFS2_FS is not set
1546# CONFIG_BTRFS_FS is not set
1547CONFIG_DNOTIFY=y
1548CONFIG_INOTIFY=y
1549CONFIG_INOTIFY_USER=y
1550# CONFIG_QUOTA is not set
1551# CONFIG_AUTOFS_FS is not set
1552# CONFIG_AUTOFS4_FS is not set
1553# CONFIG_FUSE_FS is not set
1554
1555#
1556# CD-ROM/DVD Filesystems
1557#
1558# CONFIG_ISO9660_FS is not set
1559# CONFIG_UDF_FS is not set
1560
1561#
1562# DOS/FAT/NT Filesystems
1563#
1564CONFIG_FAT_FS=y
1565CONFIG_MSDOS_FS=y
1566CONFIG_VFAT_FS=y
1567CONFIG_FAT_DEFAULT_CODEPAGE=437
1568CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1569# CONFIG_NTFS_FS is not set
1570
1571#
1572# Pseudo filesystems
1573#
1574CONFIG_PROC_FS=y
1575CONFIG_PROC_KCORE=y
1576CONFIG_PROC_SYSCTL=y
1577CONFIG_PROC_PAGE_MONITOR=y
1578CONFIG_SYSFS=y
1579CONFIG_TMPFS=y
1580# CONFIG_TMPFS_POSIX_ACL is not set
1581# CONFIG_HUGETLB_PAGE is not set
1582# CONFIG_CONFIGFS_FS is not set
1583CONFIG_MISC_FILESYSTEMS=y
1584# CONFIG_ADFS_FS is not set
1585# CONFIG_AFFS_FS is not set
1586# CONFIG_HFS_FS is not set
1587# CONFIG_HFSPLUS_FS is not set
1588# CONFIG_BEFS_FS is not set
1589# CONFIG_BFS_FS is not set
1590# CONFIG_EFS_FS is not set
1591CONFIG_JFFS2_FS=y
1592CONFIG_JFFS2_FS_DEBUG=0
1593CONFIG_JFFS2_FS_WRITEBUFFER=y
1594# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
1595# CONFIG_JFFS2_SUMMARY is not set
1596# CONFIG_JFFS2_FS_XATTR is not set
1597# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
1598CONFIG_JFFS2_ZLIB=y
1599# CONFIG_JFFS2_LZO is not set
1600CONFIG_JFFS2_RTIME=y
1601# CONFIG_JFFS2_RUBIN is not set
1602# CONFIG_CRAMFS is not set
1603# CONFIG_SQUASHFS is not set
1604# CONFIG_VXFS_FS is not set
1605# CONFIG_MINIX_FS is not set
1606# CONFIG_OMFS_FS is not set
1607# CONFIG_HPFS_FS is not set
1608# CONFIG_QNX4FS_FS is not set
1609# CONFIG_ROMFS_FS is not set
1610# CONFIG_SYSV_FS is not set
1611# CONFIG_UFS_FS is not set
1612CONFIG_NETWORK_FILESYSTEMS=y
1613CONFIG_NFS_FS=y
1614CONFIG_NFS_V3=y
1615# CONFIG_NFS_V3_ACL is not set
1616CONFIG_NFS_V4=y
1617CONFIG_ROOT_NFS=y
1618# CONFIG_NFSD is not set
1619CONFIG_LOCKD=y
1620CONFIG_LOCKD_V4=y
1621CONFIG_NFS_COMMON=y
1622CONFIG_SUNRPC=y
1623CONFIG_SUNRPC_GSS=y
1624# CONFIG_SUNRPC_REGISTER_V4 is not set
1625CONFIG_RPCSEC_GSS_KRB5=y
1626# CONFIG_RPCSEC_GSS_SPKM3 is not set
1627# CONFIG_SMB_FS is not set
1628CONFIG_CIFS=m
1629# CONFIG_CIFS_STATS is not set
1630# CONFIG_CIFS_WEAK_PW_HASH is not set
1631CONFIG_CIFS_XATTR=y
1632CONFIG_CIFS_POSIX=y
1633# CONFIG_CIFS_DEBUG2 is not set
1634# CONFIG_CIFS_EXPERIMENTAL is not set
1635# CONFIG_NCP_FS is not set
1636# CONFIG_CODA_FS is not set
1637# CONFIG_AFS_FS is not set
1638
1639#
1640# Partition Types
1641#
1642# CONFIG_PARTITION_ADVANCED is not set
1643CONFIG_MSDOS_PARTITION=y
1644CONFIG_NLS=y
1645CONFIG_NLS_DEFAULT="iso8859-1"
1646CONFIG_NLS_CODEPAGE_437=m
1647CONFIG_NLS_CODEPAGE_737=m
1648CONFIG_NLS_CODEPAGE_775=m
1649CONFIG_NLS_CODEPAGE_850=m
1650CONFIG_NLS_CODEPAGE_852=m
1651CONFIG_NLS_CODEPAGE_855=m
1652CONFIG_NLS_CODEPAGE_857=m
1653CONFIG_NLS_CODEPAGE_860=m
1654CONFIG_NLS_CODEPAGE_861=m
1655CONFIG_NLS_CODEPAGE_862=m
1656CONFIG_NLS_CODEPAGE_863=m
1657CONFIG_NLS_CODEPAGE_864=m
1658CONFIG_NLS_CODEPAGE_865=m
1659CONFIG_NLS_CODEPAGE_866=m
1660CONFIG_NLS_CODEPAGE_869=m
1661CONFIG_NLS_CODEPAGE_936=m
1662CONFIG_NLS_CODEPAGE_950=m
1663CONFIG_NLS_CODEPAGE_932=m
1664CONFIG_NLS_CODEPAGE_949=m
1665CONFIG_NLS_CODEPAGE_874=m
1666CONFIG_NLS_ISO8859_8=m
1667CONFIG_NLS_CODEPAGE_1250=m
1668CONFIG_NLS_CODEPAGE_1251=m
1669CONFIG_NLS_ASCII=m
1670CONFIG_NLS_ISO8859_1=m
1671CONFIG_NLS_ISO8859_2=m
1672CONFIG_NLS_ISO8859_3=m
1673CONFIG_NLS_ISO8859_4=m
1674CONFIG_NLS_ISO8859_5=m
1675CONFIG_NLS_ISO8859_6=m
1676CONFIG_NLS_ISO8859_7=m
1677CONFIG_NLS_ISO8859_9=m
1678CONFIG_NLS_ISO8859_13=m
1679CONFIG_NLS_ISO8859_14=m
1680CONFIG_NLS_ISO8859_15=m
1681CONFIG_NLS_KOI8_R=m
1682CONFIG_NLS_KOI8_U=m
1683CONFIG_NLS_UTF8=m
1684# CONFIG_DLM is not set
1685
1686#
1687# Library routines
1688#
1689CONFIG_BITREVERSE=y
1690CONFIG_GENERIC_FIND_LAST_BIT=y
1691CONFIG_CRC_CCITT=m
1692# CONFIG_CRC16 is not set
1693# CONFIG_CRC_T10DIF is not set
1694# CONFIG_CRC_ITU_T is not set
1695CONFIG_CRC32=y
1696# CONFIG_CRC7 is not set
1697CONFIG_LIBCRC32C=m
1698CONFIG_ZLIB_INFLATE=y
1699CONFIG_ZLIB_DEFLATE=y
1700CONFIG_PLIST=y
1701CONFIG_HAS_IOMEM=y
1702CONFIG_HAS_IOPORT=y
1703CONFIG_HAS_DMA=y
1704CONFIG_HAVE_LMB=y
1705
1706#
1707# Kernel hacking
1708#
1709# CONFIG_PRINTK_TIME is not set
1710CONFIG_ENABLE_WARN_DEPRECATED=y
1711CONFIG_ENABLE_MUST_CHECK=y
1712CONFIG_FRAME_WARN=1024
1713CONFIG_MAGIC_SYSRQ=y
1714# CONFIG_UNUSED_SYMBOLS is not set
1715# CONFIG_DEBUG_FS is not set
1716# CONFIG_HEADERS_CHECK is not set
1717CONFIG_DEBUG_KERNEL=y
1718# CONFIG_DEBUG_SHIRQ is not set
1719CONFIG_DETECT_SOFTLOCKUP=y
1720# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
1721CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
1722CONFIG_SCHED_DEBUG=y
1723# CONFIG_SCHEDSTATS is not set
1724# CONFIG_TIMER_STATS is not set
1725# CONFIG_DEBUG_OBJECTS is not set
1726# CONFIG_DEBUG_SLAB is not set
1727# CONFIG_DEBUG_RT_MUTEXES is not set
1728# CONFIG_RT_MUTEX_TESTER is not set
1729# CONFIG_DEBUG_SPINLOCK is not set
1730# CONFIG_DEBUG_MUTEXES is not set
1731# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1732# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1733# CONFIG_DEBUG_KOBJECT is not set
1734# CONFIG_DEBUG_BUGVERBOSE is not set
1735CONFIG_DEBUG_INFO=y
1736# CONFIG_DEBUG_VM is not set
1737# CONFIG_DEBUG_WRITECOUNT is not set
1738# CONFIG_DEBUG_MEMORY_INIT is not set
1739# CONFIG_DEBUG_LIST is not set
1740# CONFIG_DEBUG_SG is not set
1741# CONFIG_DEBUG_NOTIFIERS is not set
1742# CONFIG_BOOT_PRINTK_DELAY is not set
1743# CONFIG_RCU_TORTURE_TEST is not set
1744# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1745# CONFIG_BACKTRACE_SELF_TEST is not set
1746# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1747# CONFIG_FAULT_INJECTION is not set
1748# CONFIG_LATENCYTOP is not set
1749CONFIG_SYSCTL_SYSCALL_CHECK=y
1750CONFIG_HAVE_FUNCTION_TRACER=y
1751CONFIG_HAVE_DYNAMIC_FTRACE=y
1752CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1753
1754#
1755# Tracers
1756#
1757# CONFIG_FUNCTION_TRACER is not set
1758# CONFIG_PREEMPT_TRACER is not set
1759# CONFIG_SCHED_TRACER is not set
1760# CONFIG_CONTEXT_SWITCH_TRACER is not set
1761# CONFIG_BOOT_TRACER is not set
1762# CONFIG_TRACE_BRANCH_PROFILING is not set
1763# CONFIG_STACK_TRACER is not set
1764# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
1765# CONFIG_SAMPLES is not set
1766CONFIG_HAVE_ARCH_KGDB=y
1767# CONFIG_KGDB is not set
1768CONFIG_PRINT_STACK_DEPTH=64
1769# CONFIG_DEBUG_STACKOVERFLOW is not set
1770# CONFIG_DEBUG_STACK_USAGE is not set
1771# CONFIG_DEBUG_PAGEALLOC is not set
1772# CONFIG_CODE_PATCHING_SELFTEST is not set
1773# CONFIG_FTR_FIXUP_SELFTEST is not set
1774# CONFIG_MSI_BITMAP_SELFTEST is not set
1775# CONFIG_XMON is not set
1776# CONFIG_IRQSTACKS is not set
1777# CONFIG_BDI_SWITCH is not set
1778# CONFIG_BOOTX_TEXT is not set
1779# CONFIG_PPC_EARLY_DEBUG is not set
1780
1781#
1782# Security options
1783#
1784# CONFIG_KEYS is not set
1785CONFIG_SECURITY=y
1786# CONFIG_SECURITYFS is not set
1787CONFIG_SECURITY_NETWORK=y
1788# CONFIG_SECURITY_NETWORK_XFRM is not set
1789# CONFIG_SECURITY_PATH is not set
1790# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1791# CONFIG_SECURITY_ROOTPLUG is not set
1792CONFIG_SECURITY_DEFAULT_MMAP_MIN_ADDR=0
1793CONFIG_CRYPTO=y
1794
1795#
1796# Crypto core or helper
1797#
1798# CONFIG_CRYPTO_FIPS is not set
1799CONFIG_CRYPTO_ALGAPI=y
1800CONFIG_CRYPTO_ALGAPI2=y
1801CONFIG_CRYPTO_AEAD=m
1802CONFIG_CRYPTO_AEAD2=y
1803CONFIG_CRYPTO_BLKCIPHER=y
1804CONFIG_CRYPTO_BLKCIPHER2=y
1805CONFIG_CRYPTO_HASH=y
1806CONFIG_CRYPTO_HASH2=y
1807CONFIG_CRYPTO_RNG2=y
1808CONFIG_CRYPTO_MANAGER=y
1809CONFIG_CRYPTO_MANAGER2=y
1810# CONFIG_CRYPTO_GF128MUL is not set
1811CONFIG_CRYPTO_NULL=m
1812# CONFIG_CRYPTO_CRYPTD is not set
1813CONFIG_CRYPTO_AUTHENC=m
1814CONFIG_CRYPTO_TEST=m
1815
1816#
1817# Authenticated Encryption with Associated Data
1818#
1819# CONFIG_CRYPTO_CCM is not set
1820# CONFIG_CRYPTO_GCM is not set
1821# CONFIG_CRYPTO_SEQIV is not set
1822
1823#
1824# Block modes
1825#
1826CONFIG_CRYPTO_CBC=y
1827# CONFIG_CRYPTO_CTR is not set
1828# CONFIG_CRYPTO_CTS is not set
1829CONFIG_CRYPTO_ECB=m
1830# CONFIG_CRYPTO_LRW is not set
1831CONFIG_CRYPTO_PCBC=m
1832# CONFIG_CRYPTO_XTS is not set
1833
1834#
1835# Hash modes
1836#
1837CONFIG_CRYPTO_HMAC=y
1838# CONFIG_CRYPTO_XCBC is not set
1839
1840#
1841# Digest
1842#
1843CONFIG_CRYPTO_CRC32C=m
1844CONFIG_CRYPTO_MD4=m
1845CONFIG_CRYPTO_MD5=y
1846CONFIG_CRYPTO_MICHAEL_MIC=m
1847# CONFIG_CRYPTO_RMD128 is not set
1848# CONFIG_CRYPTO_RMD160 is not set
1849# CONFIG_CRYPTO_RMD256 is not set
1850# CONFIG_CRYPTO_RMD320 is not set
1851CONFIG_CRYPTO_SHA1=m
1852CONFIG_CRYPTO_SHA256=m
1853CONFIG_CRYPTO_SHA512=m
1854# CONFIG_CRYPTO_TGR192 is not set
1855CONFIG_CRYPTO_WP512=m
1856
1857#
1858# Ciphers
1859#
1860CONFIG_CRYPTO_AES=m
1861CONFIG_CRYPTO_ANUBIS=m
1862CONFIG_CRYPTO_ARC4=m
1863CONFIG_CRYPTO_BLOWFISH=m
1864# CONFIG_CRYPTO_CAMELLIA is not set
1865CONFIG_CRYPTO_CAST5=m
1866CONFIG_CRYPTO_CAST6=m
1867CONFIG_CRYPTO_DES=y
1868# CONFIG_CRYPTO_FCRYPT is not set
1869CONFIG_CRYPTO_KHAZAD=m
1870# CONFIG_CRYPTO_SALSA20 is not set
1871# CONFIG_CRYPTO_SEED is not set
1872CONFIG_CRYPTO_SERPENT=m
1873CONFIG_CRYPTO_TEA=m
1874CONFIG_CRYPTO_TWOFISH=m
1875CONFIG_CRYPTO_TWOFISH_COMMON=m
1876
1877#
1878# Compression
1879#
1880CONFIG_CRYPTO_DEFLATE=m
1881# CONFIG_CRYPTO_LZO is not set
1882
1883#
1884# Random Number Generation
1885#
1886# CONFIG_CRYPTO_ANSI_CPRNG is not set
1887# CONFIG_CRYPTO_HW is not set
1888# CONFIG_PPC_CLOCK is not set
1889# CONFIG_VIRTUALIZATION is not set
diff --git a/arch/powerpc/configs/86xx/gef_sbc310_defconfig b/arch/powerpc/configs/86xx/gef_sbc310_defconfig
new file mode 100644
index 000000000000..bd236b3d915a
--- /dev/null
+++ b/arch/powerpc/configs/86xx/gef_sbc310_defconfig
@@ -0,0 +1,1613 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.29-rc3
4# Wed Jan 28 23:05:34 2009
5#
6# CONFIG_PPC64 is not set
7
8#
9# Processor support
10#
11CONFIG_6xx=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_FPU=y
18# CONFIG_PHYS_64BIT is not set
19CONFIG_ALTIVEC=y
20CONFIG_PPC_STD_MMU=y
21CONFIG_PPC_STD_MMU_32=y
22# CONFIG_PPC_MM_SLICES is not set
23CONFIG_SMP=y
24CONFIG_NR_CPUS=2
25CONFIG_PPC32=y
26CONFIG_WORD_SIZE=32
27# CONFIG_ARCH_PHYS_ADDR_T_64BIT is not set
28CONFIG_MMU=y
29CONFIG_GENERIC_CMOS_UPDATE=y
30CONFIG_GENERIC_TIME=y
31CONFIG_GENERIC_TIME_VSYSCALL=y
32CONFIG_GENERIC_CLOCKEVENTS=y
33CONFIG_GENERIC_HARDIRQS=y
34# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
35CONFIG_IRQ_PER_CPU=y
36CONFIG_STACKTRACE_SUPPORT=y
37CONFIG_HAVE_LATENCYTOP_SUPPORT=y
38CONFIG_LOCKDEP_SUPPORT=y
39CONFIG_RWSEM_XCHGADD_ALGORITHM=y
40CONFIG_GENERIC_LOCKBREAK=y
41CONFIG_ARCH_HAS_ILOG2_U32=y
42CONFIG_GENERIC_HWEIGHT=y
43CONFIG_GENERIC_CALIBRATE_DELAY=y
44CONFIG_GENERIC_FIND_NEXT_BIT=y
45CONFIG_GENERIC_GPIO=y
46# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
47CONFIG_PPC=y
48CONFIG_EARLY_PRINTK=y
49CONFIG_GENERIC_NVRAM=y
50CONFIG_SCHED_OMIT_FRAME_POINTER=y
51CONFIG_ARCH_MAY_HAVE_PC_FDC=y
52CONFIG_PPC_OF=y
53CONFIG_OF=y
54CONFIG_PPC_UDBG_16550=y
55CONFIG_GENERIC_TBSYNC=y
56CONFIG_AUDIT_ARCH=y
57CONFIG_GENERIC_BUG=y
58CONFIG_DEFAULT_UIMAGE=y
59# CONFIG_PPC_DCR_NATIVE is not set
60# CONFIG_PPC_DCR_MMIO is not set
61CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
62
63#
64# General setup
65#
66CONFIG_EXPERIMENTAL=y
67CONFIG_LOCK_KERNEL=y
68CONFIG_INIT_ENV_ARG_LIMIT=32
69CONFIG_LOCALVERSION=""
70CONFIG_LOCALVERSION_AUTO=y
71CONFIG_SWAP=y
72CONFIG_SYSVIPC=y
73CONFIG_SYSVIPC_SYSCTL=y
74CONFIG_POSIX_MQUEUE=y
75CONFIG_BSD_PROCESS_ACCT=y
76CONFIG_BSD_PROCESS_ACCT_V3=y
77# CONFIG_TASKSTATS is not set
78# CONFIG_AUDIT is not set
79
80#
81# RCU Subsystem
82#
83CONFIG_CLASSIC_RCU=y
84# CONFIG_TREE_RCU is not set
85# CONFIG_PREEMPT_RCU is not set
86# CONFIG_TREE_RCU_TRACE is not set
87# CONFIG_PREEMPT_RCU_TRACE is not set
88CONFIG_IKCONFIG=y
89CONFIG_IKCONFIG_PROC=y
90CONFIG_LOG_BUF_SHIFT=14
91# CONFIG_GROUP_SCHED is not set
92# CONFIG_CGROUPS is not set
93CONFIG_SYSFS_DEPRECATED=y
94CONFIG_SYSFS_DEPRECATED_V2=y
95CONFIG_RELAY=y
96# CONFIG_NAMESPACES is not set
97CONFIG_BLK_DEV_INITRD=y
98CONFIG_INITRAMFS_SOURCE=""
99# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
100CONFIG_SYSCTL=y
101CONFIG_EMBEDDED=y
102CONFIG_SYSCTL_SYSCALL=y
103CONFIG_KALLSYMS=y
104# CONFIG_KALLSYMS_EXTRA_PASS is not set
105CONFIG_HOTPLUG=y
106CONFIG_PRINTK=y
107CONFIG_BUG=y
108CONFIG_ELF_CORE=y
109CONFIG_COMPAT_BRK=y
110CONFIG_BASE_FULL=y
111CONFIG_FUTEX=y
112CONFIG_ANON_INODES=y
113CONFIG_EPOLL=y
114CONFIG_SIGNALFD=y
115CONFIG_TIMERFD=y
116CONFIG_EVENTFD=y
117CONFIG_SHMEM=y
118CONFIG_AIO=y
119CONFIG_VM_EVENT_COUNTERS=y
120CONFIG_PCI_QUIRKS=y
121CONFIG_SLAB=y
122# CONFIG_SLUB is not set
123# CONFIG_SLOB is not set
124# CONFIG_PROFILING is not set
125CONFIG_HAVE_OPROFILE=y
126# CONFIG_KPROBES is not set
127CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
128CONFIG_HAVE_IOREMAP_PROT=y
129CONFIG_HAVE_KPROBES=y
130CONFIG_HAVE_KRETPROBES=y
131CONFIG_HAVE_ARCH_TRACEHOOK=y
132CONFIG_USE_GENERIC_SMP_HELPERS=y
133# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
134CONFIG_SLABINFO=y
135CONFIG_RT_MUTEXES=y
136CONFIG_BASE_SMALL=0
137CONFIG_MODULES=y
138# CONFIG_MODULE_FORCE_LOAD is not set
139CONFIG_MODULE_UNLOAD=y
140# CONFIG_MODULE_FORCE_UNLOAD is not set
141# CONFIG_MODVERSIONS is not set
142# CONFIG_MODULE_SRCVERSION_ALL is not set
143CONFIG_STOP_MACHINE=y
144CONFIG_BLOCK=y
145# CONFIG_LBD is not set
146# CONFIG_BLK_DEV_IO_TRACE is not set
147# CONFIG_BLK_DEV_BSG is not set
148# CONFIG_BLK_DEV_INTEGRITY is not set
149
150#
151# IO Schedulers
152#
153CONFIG_IOSCHED_NOOP=y
154CONFIG_IOSCHED_AS=y
155CONFIG_IOSCHED_DEADLINE=y
156CONFIG_IOSCHED_CFQ=y
157# CONFIG_DEFAULT_AS is not set
158# CONFIG_DEFAULT_DEADLINE is not set
159CONFIG_DEFAULT_CFQ=y
160# CONFIG_DEFAULT_NOOP is not set
161CONFIG_DEFAULT_IOSCHED="cfq"
162# CONFIG_FREEZER is not set
163CONFIG_PPC_MSI_BITMAP=y
164
165#
166# Platform support
167#
168CONFIG_PPC_MULTIPLATFORM=y
169CONFIG_CLASSIC32=y
170# CONFIG_PPC_CHRP is not set
171# CONFIG_MPC5121_ADS is not set
172# CONFIG_MPC5121_GENERIC is not set
173# CONFIG_PPC_MPC52xx is not set
174# CONFIG_PPC_PMAC is not set
175# CONFIG_PPC_CELL is not set
176# CONFIG_PPC_CELL_NATIVE is not set
177# CONFIG_PPC_82xx is not set
178# CONFIG_PQ2ADS is not set
179# CONFIG_PPC_83xx is not set
180CONFIG_PPC_86xx=y
181# CONFIG_MPC8641_HPCN is not set
182# CONFIG_SBC8641D is not set
183# CONFIG_MPC8610_HPCD is not set
184CONFIG_GEF_SBC310=y
185# CONFIG_GEF_SBC610 is not set
186CONFIG_MPC8641=y
187# CONFIG_IPIC is not set
188CONFIG_MPIC=y
189# CONFIG_MPIC_WEIRD is not set
190# CONFIG_PPC_I8259 is not set
191# CONFIG_PPC_RTAS is not set
192# CONFIG_MMIO_NVRAM is not set
193# CONFIG_PPC_MPC106 is not set
194# CONFIG_PPC_970_NAP is not set
195# CONFIG_PPC_INDIRECT_IO is not set
196# CONFIG_GENERIC_IOMAP is not set
197# CONFIG_CPU_FREQ is not set
198# CONFIG_TAU is not set
199# CONFIG_QUICC_ENGINE is not set
200# CONFIG_FSL_ULI1575 is not set
201# CONFIG_MPC8xxx_GPIO is not set
202# CONFIG_SIMPLE_GPIO is not set
203
204#
205# Kernel options
206#
207# CONFIG_HIGHMEM is not set
208CONFIG_TICK_ONESHOT=y
209# CONFIG_NO_HZ is not set
210CONFIG_HIGH_RES_TIMERS=y
211CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
212# CONFIG_HZ_100 is not set
213# CONFIG_HZ_250 is not set
214# CONFIG_HZ_300 is not set
215CONFIG_HZ_1000=y
216CONFIG_HZ=1000
217CONFIG_SCHED_HRTICK=y
218# CONFIG_PREEMPT_NONE is not set
219# CONFIG_PREEMPT_VOLUNTARY is not set
220CONFIG_PREEMPT=y
221CONFIG_BINFMT_ELF=y
222# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
223# CONFIG_HAVE_AOUT is not set
224CONFIG_BINFMT_MISC=y
225# CONFIG_IOMMU_HELPER is not set
226CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
227CONFIG_ARCH_HAS_WALK_MEMORY=y
228CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
229# CONFIG_KEXEC is not set
230# CONFIG_CRASH_DUMP is not set
231CONFIG_IRQ_ALL_CPUS=y
232CONFIG_ARCH_FLATMEM_ENABLE=y
233CONFIG_ARCH_POPULATES_NODE_MAP=y
234CONFIG_SELECT_MEMORY_MODEL=y
235CONFIG_FLATMEM_MANUAL=y
236# CONFIG_DISCONTIGMEM_MANUAL is not set
237# CONFIG_SPARSEMEM_MANUAL is not set
238CONFIG_FLATMEM=y
239CONFIG_FLAT_NODE_MEM_MAP=y
240CONFIG_PAGEFLAGS_EXTENDED=y
241CONFIG_SPLIT_PTLOCK_CPUS=4
242CONFIG_MIGRATION=y
243# CONFIG_PHYS_ADDR_T_64BIT is not set
244CONFIG_ZONE_DMA_FLAG=1
245CONFIG_BOUNCE=y
246CONFIG_VIRT_TO_BUS=y
247CONFIG_UNEVICTABLE_LRU=y
248CONFIG_PPC_4K_PAGES=y
249# CONFIG_PPC_16K_PAGES is not set
250# CONFIG_PPC_64K_PAGES is not set
251CONFIG_FORCE_MAX_ZONEORDER=11
252# CONFIG_PROC_DEVICETREE is not set
253# CONFIG_CMDLINE_BOOL is not set
254CONFIG_EXTRA_TARGETS=""
255# CONFIG_PM is not set
256CONFIG_SECCOMP=y
257CONFIG_ISA_DMA_API=y
258
259#
260# Bus options
261#
262CONFIG_ZONE_DMA=y
263CONFIG_GENERIC_ISA_DMA=y
264CONFIG_PPC_INDIRECT_PCI=y
265CONFIG_FSL_SOC=y
266CONFIG_FSL_PCI=y
267CONFIG_PPC_PCI_CHOICE=y
268CONFIG_PCI=y
269CONFIG_PCI_DOMAINS=y
270CONFIG_PCI_SYSCALL=y
271CONFIG_PCIEPORTBUS=y
272CONFIG_PCIEAER=y
273# CONFIG_PCIEASPM is not set
274CONFIG_ARCH_SUPPORTS_MSI=y
275CONFIG_PCI_MSI=y
276# CONFIG_PCI_LEGACY is not set
277# CONFIG_PCI_STUB is not set
278# CONFIG_PCCARD is not set
279# CONFIG_HOTPLUG_PCI is not set
280# CONFIG_HAS_RAPIDIO is not set
281
282#
283# Advanced setup
284#
285# CONFIG_ADVANCED_OPTIONS is not set
286
287#
288# Default settings for advanced configuration options are used
289#
290CONFIG_LOWMEM_SIZE=0x30000000
291CONFIG_LOWMEM_CAM_NUM=3
292CONFIG_PAGE_OFFSET=0xc0000000
293CONFIG_KERNEL_START=0xc0000000
294CONFIG_PHYSICAL_START=0x00000000
295CONFIG_TASK_SIZE=0xc0000000
296CONFIG_NET=y
297
298#
299# Networking options
300#
301CONFIG_COMPAT_NET_DEV_OPS=y
302CONFIG_PACKET=y
303CONFIG_PACKET_MMAP=y
304CONFIG_UNIX=y
305CONFIG_XFRM=y
306CONFIG_XFRM_USER=m
307# CONFIG_XFRM_SUB_POLICY is not set
308# CONFIG_XFRM_MIGRATE is not set
309# CONFIG_XFRM_STATISTICS is not set
310CONFIG_XFRM_IPCOMP=m
311CONFIG_NET_KEY=m
312# CONFIG_NET_KEY_MIGRATE is not set
313CONFIG_INET=y
314CONFIG_IP_MULTICAST=y
315CONFIG_IP_ADVANCED_ROUTER=y
316CONFIG_ASK_IP_FIB_HASH=y
317# CONFIG_IP_FIB_TRIE is not set
318CONFIG_IP_FIB_HASH=y
319CONFIG_IP_MULTIPLE_TABLES=y
320CONFIG_IP_ROUTE_MULTIPATH=y
321CONFIG_IP_ROUTE_VERBOSE=y
322CONFIG_IP_PNP=y
323CONFIG_IP_PNP_DHCP=y
324CONFIG_IP_PNP_BOOTP=y
325CONFIG_IP_PNP_RARP=y
326CONFIG_NET_IPIP=m
327CONFIG_NET_IPGRE=m
328CONFIG_NET_IPGRE_BROADCAST=y
329CONFIG_IP_MROUTE=y
330CONFIG_IP_PIMSM_V1=y
331CONFIG_IP_PIMSM_V2=y
332# CONFIG_ARPD is not set
333CONFIG_SYN_COOKIES=y
334CONFIG_INET_AH=m
335CONFIG_INET_ESP=m
336CONFIG_INET_IPCOMP=m
337CONFIG_INET_XFRM_TUNNEL=m
338CONFIG_INET_TUNNEL=m
339CONFIG_INET_XFRM_MODE_TRANSPORT=y
340CONFIG_INET_XFRM_MODE_TUNNEL=y
341# CONFIG_INET_XFRM_MODE_BEET is not set
342CONFIG_INET_LRO=y
343CONFIG_INET_DIAG=y
344CONFIG_INET_TCP_DIAG=y
345# CONFIG_TCP_CONG_ADVANCED is not set
346CONFIG_TCP_CONG_CUBIC=y
347CONFIG_DEFAULT_TCP_CONG="cubic"
348# CONFIG_TCP_MD5SIG is not set
349CONFIG_IPV6=m
350# CONFIG_IPV6_PRIVACY is not set
351# CONFIG_IPV6_ROUTER_PREF is not set
352# CONFIG_IPV6_OPTIMISTIC_DAD is not set
353CONFIG_INET6_AH=m
354CONFIG_INET6_ESP=m
355CONFIG_INET6_IPCOMP=m
356# CONFIG_IPV6_MIP6 is not set
357CONFIG_INET6_XFRM_TUNNEL=m
358CONFIG_INET6_TUNNEL=m
359CONFIG_INET6_XFRM_MODE_TRANSPORT=m
360CONFIG_INET6_XFRM_MODE_TUNNEL=m
361CONFIG_INET6_XFRM_MODE_BEET=m
362# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
363CONFIG_IPV6_SIT=m
364CONFIG_IPV6_NDISC_NODETYPE=y
365CONFIG_IPV6_TUNNEL=m
366# CONFIG_IPV6_MULTIPLE_TABLES is not set
367# CONFIG_IPV6_MROUTE is not set
368# CONFIG_NETWORK_SECMARK is not set
369# CONFIG_NETFILTER is not set
370# CONFIG_IP_DCCP is not set
371# CONFIG_IP_SCTP is not set
372# CONFIG_TIPC is not set
373# CONFIG_ATM is not set
374# CONFIG_BRIDGE is not set
375# CONFIG_NET_DSA is not set
376# CONFIG_VLAN_8021Q is not set
377# CONFIG_DECNET is not set
378# CONFIG_LLC2 is not set
379# CONFIG_IPX is not set
380# CONFIG_ATALK is not set
381# CONFIG_X25 is not set
382# CONFIG_LAPB is not set
383# CONFIG_ECONET is not set
384# CONFIG_WAN_ROUTER is not set
385# CONFIG_NET_SCHED is not set
386# CONFIG_DCB is not set
387
388#
389# Network testing
390#
391CONFIG_NET_PKTGEN=m
392# CONFIG_HAMRADIO is not set
393# CONFIG_CAN is not set
394# CONFIG_IRDA is not set
395# CONFIG_BT is not set
396# CONFIG_AF_RXRPC is not set
397# CONFIG_PHONET is not set
398CONFIG_FIB_RULES=y
399# CONFIG_WIRELESS is not set
400# CONFIG_WIMAX is not set
401# CONFIG_RFKILL is not set
402# CONFIG_NET_9P is not set
403
404#
405# Device Drivers
406#
407
408#
409# Generic Driver Options
410#
411CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
412CONFIG_STANDALONE=y
413CONFIG_PREVENT_FIRMWARE_BUILD=y
414# CONFIG_FW_LOADER is not set
415# CONFIG_SYS_HYPERVISOR is not set
416# CONFIG_CONNECTOR is not set
417CONFIG_MTD=y
418# CONFIG_MTD_DEBUG is not set
419CONFIG_MTD_CONCAT=y
420CONFIG_MTD_PARTITIONS=y
421# CONFIG_MTD_TESTS is not set
422# CONFIG_MTD_REDBOOT_PARTS is not set
423# CONFIG_MTD_CMDLINE_PARTS is not set
424CONFIG_MTD_OF_PARTS=y
425# CONFIG_MTD_AR7_PARTS is not set
426
427#
428# User Modules And Translation Layers
429#
430CONFIG_MTD_CHAR=y
431CONFIG_MTD_BLKDEVS=y
432CONFIG_MTD_BLOCK=y
433# CONFIG_FTL is not set
434# CONFIG_NFTL is not set
435# CONFIG_INFTL is not set
436# CONFIG_RFD_FTL is not set
437# CONFIG_SSFDC is not set
438# CONFIG_MTD_OOPS is not set
439
440#
441# RAM/ROM/Flash chip drivers
442#
443CONFIG_MTD_CFI=y
444CONFIG_MTD_JEDECPROBE=y
445CONFIG_MTD_GEN_PROBE=y
446# CONFIG_MTD_CFI_ADV_OPTIONS is not set
447CONFIG_MTD_MAP_BANK_WIDTH_1=y
448CONFIG_MTD_MAP_BANK_WIDTH_2=y
449CONFIG_MTD_MAP_BANK_WIDTH_4=y
450# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
451# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
452# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
453CONFIG_MTD_CFI_I1=y
454CONFIG_MTD_CFI_I2=y
455# CONFIG_MTD_CFI_I4 is not set
456# CONFIG_MTD_CFI_I8 is not set
457CONFIG_MTD_CFI_INTELEXT=y
458CONFIG_MTD_CFI_AMDSTD=y
459# CONFIG_MTD_CFI_STAA is not set
460CONFIG_MTD_CFI_UTIL=y
461# CONFIG_MTD_RAM is not set
462# CONFIG_MTD_ROM is not set
463# CONFIG_MTD_ABSENT is not set
464
465#
466# Mapping drivers for chip access
467#
468# CONFIG_MTD_COMPLEX_MAPPINGS is not set
469# CONFIG_MTD_PHYSMAP is not set
470CONFIG_MTD_PHYSMAP_OF=y
471# CONFIG_MTD_INTEL_VR_NOR is not set
472# CONFIG_MTD_PLATRAM is not set
473
474#
475# Self-contained MTD device drivers
476#
477# CONFIG_MTD_PMC551 is not set
478# CONFIG_MTD_SLRAM is not set
479# CONFIG_MTD_PHRAM is not set
480# CONFIG_MTD_MTDRAM is not set
481# CONFIG_MTD_BLOCK2MTD is not set
482
483#
484# Disk-On-Chip Device Drivers
485#
486# CONFIG_MTD_DOC2000 is not set
487# CONFIG_MTD_DOC2001 is not set
488# CONFIG_MTD_DOC2001PLUS is not set
489# CONFIG_MTD_NAND is not set
490# CONFIG_MTD_ONENAND is not set
491
492#
493# LPDDR flash memory drivers
494#
495# CONFIG_MTD_LPDDR is not set
496# CONFIG_MTD_QINFO_PROBE is not set
497
498#
499# UBI - Unsorted block images
500#
501# CONFIG_MTD_UBI is not set
502CONFIG_OF_DEVICE=y
503CONFIG_OF_GPIO=y
504CONFIG_OF_I2C=y
505# CONFIG_PARPORT is not set
506CONFIG_BLK_DEV=y
507# CONFIG_BLK_DEV_FD is not set
508# CONFIG_BLK_CPQ_DA is not set
509# CONFIG_BLK_CPQ_CISS_DA is not set
510# CONFIG_BLK_DEV_DAC960 is not set
511# CONFIG_BLK_DEV_UMEM is not set
512# CONFIG_BLK_DEV_COW_COMMON is not set
513CONFIG_BLK_DEV_LOOP=m
514CONFIG_BLK_DEV_CRYPTOLOOP=m
515CONFIG_BLK_DEV_NBD=m
516# CONFIG_BLK_DEV_SX8 is not set
517# CONFIG_BLK_DEV_UB is not set
518CONFIG_BLK_DEV_RAM=y
519CONFIG_BLK_DEV_RAM_COUNT=16
520CONFIG_BLK_DEV_RAM_SIZE=131072
521# CONFIG_BLK_DEV_XIP is not set
522# CONFIG_CDROM_PKTCDVD is not set
523# CONFIG_ATA_OVER_ETH is not set
524# CONFIG_BLK_DEV_HD is not set
525CONFIG_MISC_DEVICES=y
526# CONFIG_PHANTOM is not set
527# CONFIG_SGI_IOC4 is not set
528# CONFIG_TIFM_CORE is not set
529# CONFIG_ICS932S401 is not set
530# CONFIG_ENCLOSURE_SERVICES is not set
531# CONFIG_HP_ILO is not set
532# CONFIG_C2PORT is not set
533
534#
535# EEPROM support
536#
537# CONFIG_EEPROM_AT24 is not set
538# CONFIG_EEPROM_LEGACY is not set
539# CONFIG_EEPROM_93CX6 is not set
540CONFIG_HAVE_IDE=y
541# CONFIG_IDE is not set
542
543#
544# SCSI device support
545#
546# CONFIG_RAID_ATTRS is not set
547CONFIG_SCSI=y
548CONFIG_SCSI_DMA=y
549# CONFIG_SCSI_TGT is not set
550# CONFIG_SCSI_NETLINK is not set
551CONFIG_SCSI_PROC_FS=y
552
553#
554# SCSI support type (disk, tape, CD-ROM)
555#
556CONFIG_BLK_DEV_SD=y
557CONFIG_CHR_DEV_ST=y
558# CONFIG_CHR_DEV_OSST is not set
559CONFIG_BLK_DEV_SR=y
560# CONFIG_BLK_DEV_SR_VENDOR is not set
561# CONFIG_CHR_DEV_SG is not set
562# CONFIG_CHR_DEV_SCH is not set
563
564#
565# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
566#
567# CONFIG_SCSI_MULTI_LUN is not set
568# CONFIG_SCSI_CONSTANTS is not set
569# CONFIG_SCSI_LOGGING is not set
570# CONFIG_SCSI_SCAN_ASYNC is not set
571CONFIG_SCSI_WAIT_SCAN=m
572
573#
574# SCSI Transports
575#
576# CONFIG_SCSI_SPI_ATTRS is not set
577# CONFIG_SCSI_FC_ATTRS is not set
578# CONFIG_SCSI_ISCSI_ATTRS is not set
579# CONFIG_SCSI_SAS_LIBSAS is not set
580# CONFIG_SCSI_SRP_ATTRS is not set
581CONFIG_SCSI_LOWLEVEL=y
582# CONFIG_ISCSI_TCP is not set
583# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
584# CONFIG_SCSI_3W_9XXX is not set
585# CONFIG_SCSI_ACARD is not set
586# CONFIG_SCSI_AACRAID is not set
587# CONFIG_SCSI_AIC7XXX is not set
588# CONFIG_SCSI_AIC7XXX_OLD is not set
589# CONFIG_SCSI_AIC79XX is not set
590# CONFIG_SCSI_AIC94XX is not set
591# CONFIG_SCSI_DPT_I2O is not set
592# CONFIG_SCSI_ADVANSYS is not set
593# CONFIG_SCSI_ARCMSR is not set
594# CONFIG_MEGARAID_NEWGEN is not set
595# CONFIG_MEGARAID_LEGACY is not set
596# CONFIG_MEGARAID_SAS is not set
597# CONFIG_SCSI_HPTIOP is not set
598# CONFIG_SCSI_BUSLOGIC is not set
599# CONFIG_LIBFC is not set
600# CONFIG_FCOE is not set
601# CONFIG_SCSI_DMX3191D is not set
602# CONFIG_SCSI_EATA is not set
603# CONFIG_SCSI_FUTURE_DOMAIN is not set
604# CONFIG_SCSI_GDTH is not set
605# CONFIG_SCSI_IPS is not set
606# CONFIG_SCSI_INITIO is not set
607# CONFIG_SCSI_INIA100 is not set
608# CONFIG_SCSI_MVSAS is not set
609# CONFIG_SCSI_STEX is not set
610# CONFIG_SCSI_SYM53C8XX_2 is not set
611# CONFIG_SCSI_IPR is not set
612# CONFIG_SCSI_QLOGIC_1280 is not set
613# CONFIG_SCSI_QLA_FC is not set
614# CONFIG_SCSI_QLA_ISCSI is not set
615# CONFIG_SCSI_LPFC is not set
616# CONFIG_SCSI_DC395x is not set
617# CONFIG_SCSI_DC390T is not set
618# CONFIG_SCSI_NSP32 is not set
619# CONFIG_SCSI_DEBUG is not set
620# CONFIG_SCSI_SRP is not set
621# CONFIG_SCSI_DH is not set
622CONFIG_ATA=y
623# CONFIG_ATA_NONSTANDARD is not set
624CONFIG_SATA_PMP=y
625# CONFIG_SATA_AHCI is not set
626CONFIG_SATA_SIL24=y
627# CONFIG_SATA_FSL is not set
628# CONFIG_ATA_SFF is not set
629# CONFIG_MD is not set
630# CONFIG_FUSION is not set
631
632#
633# IEEE 1394 (FireWire) support
634#
635
636#
637# Enable only one of the two stacks, unless you know what you are doing
638#
639# CONFIG_FIREWIRE is not set
640# CONFIG_IEEE1394 is not set
641# CONFIG_I2O is not set
642# CONFIG_MACINTOSH_DRIVERS is not set
643CONFIG_NETDEVICES=y
644CONFIG_DUMMY=m
645CONFIG_BONDING=m
646# CONFIG_MACVLAN is not set
647# CONFIG_EQUALIZER is not set
648CONFIG_TUN=m
649# CONFIG_VETH is not set
650# CONFIG_ARCNET is not set
651CONFIG_PHYLIB=y
652
653#
654# MII PHY device drivers
655#
656# CONFIG_MARVELL_PHY is not set
657# CONFIG_DAVICOM_PHY is not set
658# CONFIG_QSEMI_PHY is not set
659# CONFIG_LXT_PHY is not set
660# CONFIG_CICADA_PHY is not set
661# CONFIG_VITESSE_PHY is not set
662# CONFIG_SMSC_PHY is not set
663# CONFIG_BROADCOM_PHY is not set
664# CONFIG_ICPLUS_PHY is not set
665# CONFIG_REALTEK_PHY is not set
666# CONFIG_NATIONAL_PHY is not set
667# CONFIG_STE10XP is not set
668# CONFIG_LSI_ET1011C_PHY is not set
669# CONFIG_FIXED_PHY is not set
670# CONFIG_MDIO_BITBANG is not set
671CONFIG_NET_ETHERNET=y
672CONFIG_MII=y
673# CONFIG_HAPPYMEAL is not set
674# CONFIG_SUNGEM is not set
675# CONFIG_CASSINI is not set
676# CONFIG_NET_VENDOR_3COM is not set
677# CONFIG_NET_TULIP is not set
678# CONFIG_HP100 is not set
679# CONFIG_IBM_NEW_EMAC_ZMII is not set
680# CONFIG_IBM_NEW_EMAC_RGMII is not set
681# CONFIG_IBM_NEW_EMAC_TAH is not set
682# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
683# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
684# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
685# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
686# CONFIG_NET_PCI is not set
687# CONFIG_B44 is not set
688# CONFIG_ATL2 is not set
689CONFIG_NETDEV_1000=y
690# CONFIG_ACENIC is not set
691# CONFIG_DL2K is not set
692# CONFIG_E1000 is not set
693# CONFIG_E1000E is not set
694# CONFIG_IP1000 is not set
695# CONFIG_IGB is not set
696# CONFIG_NS83820 is not set
697# CONFIG_HAMACHI is not set
698# CONFIG_YELLOWFIN is not set
699# CONFIG_R8169 is not set
700# CONFIG_SIS190 is not set
701# CONFIG_SKGE is not set
702# CONFIG_SKY2 is not set
703# CONFIG_VIA_VELOCITY is not set
704# CONFIG_TIGON3 is not set
705# CONFIG_BNX2 is not set
706CONFIG_GIANFAR=y
707# CONFIG_MV643XX_ETH is not set
708# CONFIG_QLA3XXX is not set
709# CONFIG_ATL1 is not set
710# CONFIG_ATL1E is not set
711# CONFIG_JME is not set
712# CONFIG_NETDEV_10000 is not set
713# CONFIG_TR is not set
714
715#
716# Wireless LAN
717#
718# CONFIG_WLAN_PRE80211 is not set
719# CONFIG_WLAN_80211 is not set
720# CONFIG_IWLWIFI_LEDS is not set
721
722#
723# Enable WiMAX (Networking options) to see the WiMAX drivers
724#
725
726#
727# USB Network Adapters
728#
729# CONFIG_USB_CATC is not set
730# CONFIG_USB_KAWETH is not set
731# CONFIG_USB_PEGASUS is not set
732# CONFIG_USB_RTL8150 is not set
733# CONFIG_USB_USBNET is not set
734# CONFIG_WAN is not set
735# CONFIG_FDDI is not set
736# CONFIG_HIPPI is not set
737CONFIG_PPP=m
738CONFIG_PPP_MULTILINK=y
739CONFIG_PPP_FILTER=y
740CONFIG_PPP_ASYNC=m
741CONFIG_PPP_SYNC_TTY=m
742CONFIG_PPP_DEFLATE=m
743CONFIG_PPP_BSDCOMP=m
744# CONFIG_PPP_MPPE is not set
745CONFIG_PPPOE=m
746# CONFIG_PPPOL2TP is not set
747CONFIG_SLIP=m
748CONFIG_SLIP_COMPRESSED=y
749CONFIG_SLHC=m
750CONFIG_SLIP_SMART=y
751CONFIG_SLIP_MODE_SLIP6=y
752# CONFIG_NET_FC is not set
753CONFIG_NETCONSOLE=y
754# CONFIG_NETCONSOLE_DYNAMIC is not set
755CONFIG_NETPOLL=y
756CONFIG_NETPOLL_TRAP=y
757CONFIG_NET_POLL_CONTROLLER=y
758# CONFIG_ISDN is not set
759# CONFIG_PHONE is not set
760
761#
762# Input device support
763#
764CONFIG_INPUT=y
765# CONFIG_INPUT_FF_MEMLESS is not set
766# CONFIG_INPUT_POLLDEV is not set
767
768#
769# Userland interfaces
770#
771CONFIG_INPUT_MOUSEDEV=y
772CONFIG_INPUT_MOUSEDEV_PSAUX=y
773CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
774CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
775# CONFIG_INPUT_JOYDEV is not set
776# CONFIG_INPUT_EVDEV is not set
777# CONFIG_INPUT_EVBUG is not set
778
779#
780# Input Device Drivers
781#
782# CONFIG_INPUT_KEYBOARD is not set
783# CONFIG_INPUT_MOUSE is not set
784# CONFIG_INPUT_JOYSTICK is not set
785# CONFIG_INPUT_TABLET is not set
786# CONFIG_INPUT_TOUCHSCREEN is not set
787# CONFIG_INPUT_MISC is not set
788
789#
790# Hardware I/O ports
791#
792# CONFIG_SERIO is not set
793# CONFIG_GAMEPORT is not set
794
795#
796# Character devices
797#
798CONFIG_VT=y
799CONFIG_CONSOLE_TRANSLATIONS=y
800CONFIG_VT_CONSOLE=y
801CONFIG_HW_CONSOLE=y
802# CONFIG_VT_HW_CONSOLE_BINDING is not set
803CONFIG_DEVKMEM=y
804# CONFIG_SERIAL_NONSTANDARD is not set
805# CONFIG_NOZOMI is not set
806
807#
808# Serial drivers
809#
810CONFIG_SERIAL_8250=y
811CONFIG_SERIAL_8250_CONSOLE=y
812# CONFIG_SERIAL_8250_PCI is not set
813CONFIG_SERIAL_8250_NR_UARTS=2
814CONFIG_SERIAL_8250_RUNTIME_UARTS=2
815# CONFIG_SERIAL_8250_EXTENDED is not set
816
817#
818# Non-8250 serial port support
819#
820# CONFIG_SERIAL_UARTLITE is not set
821CONFIG_SERIAL_CORE=y
822CONFIG_SERIAL_CORE_CONSOLE=y
823# CONFIG_SERIAL_JSM is not set
824# CONFIG_SERIAL_OF_PLATFORM is not set
825CONFIG_UNIX98_PTYS=y
826# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
827# CONFIG_LEGACY_PTYS is not set
828# CONFIG_HVC_UDBG is not set
829# CONFIG_IPMI_HANDLER is not set
830CONFIG_HW_RANDOM=y
831CONFIG_NVRAM=y
832# CONFIG_R3964 is not set
833# CONFIG_APPLICOM is not set
834# CONFIG_RAW_DRIVER is not set
835# CONFIG_TCG_TPM is not set
836CONFIG_DEVPORT=y
837CONFIG_I2C=y
838CONFIG_I2C_BOARDINFO=y
839CONFIG_I2C_CHARDEV=y
840CONFIG_I2C_HELPER_AUTO=y
841
842#
843# I2C Hardware Bus support
844#
845
846#
847# PC SMBus host controller drivers
848#
849# CONFIG_I2C_ALI1535 is not set
850# CONFIG_I2C_ALI1563 is not set
851# CONFIG_I2C_ALI15X3 is not set
852# CONFIG_I2C_AMD756 is not set
853# CONFIG_I2C_AMD8111 is not set
854# CONFIG_I2C_I801 is not set
855# CONFIG_I2C_ISCH is not set
856# CONFIG_I2C_PIIX4 is not set
857# CONFIG_I2C_NFORCE2 is not set
858# CONFIG_I2C_SIS5595 is not set
859# CONFIG_I2C_SIS630 is not set
860# CONFIG_I2C_SIS96X is not set
861# CONFIG_I2C_VIA is not set
862# CONFIG_I2C_VIAPRO is not set
863
864#
865# I2C system bus drivers (mostly embedded / system-on-chip)
866#
867# CONFIG_I2C_GPIO is not set
868CONFIG_I2C_MPC=y
869# CONFIG_I2C_OCORES is not set
870# CONFIG_I2C_SIMTEC is not set
871
872#
873# External I2C/SMBus adapter drivers
874#
875# CONFIG_I2C_PARPORT_LIGHT is not set
876# CONFIG_I2C_TAOS_EVM is not set
877# CONFIG_I2C_TINY_USB is not set
878
879#
880# Graphics adapter I2C/DDC channel drivers
881#
882# CONFIG_I2C_VOODOO3 is not set
883
884#
885# Other I2C/SMBus bus drivers
886#
887# CONFIG_I2C_PCA_PLATFORM is not set
888# CONFIG_I2C_STUB is not set
889
890#
891# Miscellaneous I2C Chip support
892#
893CONFIG_DS1682=y
894# CONFIG_SENSORS_PCF8574 is not set
895# CONFIG_PCF8575 is not set
896# CONFIG_SENSORS_PCA9539 is not set
897# CONFIG_SENSORS_PCF8591 is not set
898# CONFIG_SENSORS_MAX6875 is not set
899# CONFIG_SENSORS_TSL2550 is not set
900# CONFIG_I2C_DEBUG_CORE is not set
901# CONFIG_I2C_DEBUG_ALGO is not set
902# CONFIG_I2C_DEBUG_BUS is not set
903# CONFIG_I2C_DEBUG_CHIP is not set
904# CONFIG_SPI is not set
905CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
906CONFIG_ARCH_REQUIRE_GPIOLIB=y
907CONFIG_GPIOLIB=y
908CONFIG_GPIO_SYSFS=y
909
910#
911# Memory mapped GPIO expanders:
912#
913# CONFIG_GPIO_XILINX is not set
914
915#
916# I2C GPIO expanders:
917#
918# CONFIG_GPIO_MAX732X is not set
919# CONFIG_GPIO_PCA953X is not set
920# CONFIG_GPIO_PCF857X is not set
921
922#
923# PCI GPIO expanders:
924#
925# CONFIG_GPIO_BT8XX is not set
926
927#
928# SPI GPIO expanders:
929#
930# CONFIG_W1 is not set
931# CONFIG_POWER_SUPPLY is not set
932CONFIG_HWMON=y
933# CONFIG_HWMON_VID is not set
934# CONFIG_SENSORS_AD7414 is not set
935# CONFIG_SENSORS_AD7418 is not set
936# CONFIG_SENSORS_ADM1021 is not set
937# CONFIG_SENSORS_ADM1025 is not set
938# CONFIG_SENSORS_ADM1026 is not set
939# CONFIG_SENSORS_ADM1029 is not set
940# CONFIG_SENSORS_ADM1031 is not set
941# CONFIG_SENSORS_ADM9240 is not set
942# CONFIG_SENSORS_ADT7462 is not set
943# CONFIG_SENSORS_ADT7470 is not set
944# CONFIG_SENSORS_ADT7473 is not set
945# CONFIG_SENSORS_ADT7475 is not set
946# CONFIG_SENSORS_ATXP1 is not set
947# CONFIG_SENSORS_DS1621 is not set
948# CONFIG_SENSORS_I5K_AMB is not set
949# CONFIG_SENSORS_F71805F is not set
950# CONFIG_SENSORS_F71882FG is not set
951# CONFIG_SENSORS_F75375S is not set
952# CONFIG_SENSORS_GL518SM is not set
953# CONFIG_SENSORS_GL520SM is not set
954# CONFIG_SENSORS_IT87 is not set
955# CONFIG_SENSORS_LM63 is not set
956# CONFIG_SENSORS_LM75 is not set
957# CONFIG_SENSORS_LM77 is not set
958# CONFIG_SENSORS_LM78 is not set
959# CONFIG_SENSORS_LM80 is not set
960# CONFIG_SENSORS_LM83 is not set
961# CONFIG_SENSORS_LM85 is not set
962# CONFIG_SENSORS_LM87 is not set
963CONFIG_SENSORS_LM90=y
964CONFIG_SENSORS_LM92=y
965# CONFIG_SENSORS_LM93 is not set
966# CONFIG_SENSORS_LTC4245 is not set
967# CONFIG_SENSORS_MAX1619 is not set
968# CONFIG_SENSORS_MAX6650 is not set
969# CONFIG_SENSORS_PC87360 is not set
970# CONFIG_SENSORS_PC87427 is not set
971# CONFIG_SENSORS_SIS5595 is not set
972# CONFIG_SENSORS_DME1737 is not set
973# CONFIG_SENSORS_SMSC47M1 is not set
974# CONFIG_SENSORS_SMSC47M192 is not set
975# CONFIG_SENSORS_SMSC47B397 is not set
976# CONFIG_SENSORS_ADS7828 is not set
977# CONFIG_SENSORS_THMC50 is not set
978# CONFIG_SENSORS_VIA686A is not set
979# CONFIG_SENSORS_VT1211 is not set
980# CONFIG_SENSORS_VT8231 is not set
981# CONFIG_SENSORS_W83781D is not set
982# CONFIG_SENSORS_W83791D is not set
983# CONFIG_SENSORS_W83792D is not set
984# CONFIG_SENSORS_W83793 is not set
985# CONFIG_SENSORS_W83L785TS is not set
986# CONFIG_SENSORS_W83L786NG is not set
987# CONFIG_SENSORS_W83627HF is not set
988# CONFIG_SENSORS_W83627EHF is not set
989# CONFIG_HWMON_DEBUG_CHIP is not set
990# CONFIG_THERMAL is not set
991# CONFIG_THERMAL_HWMON is not set
992CONFIG_WATCHDOG=y
993# CONFIG_WATCHDOG_NOWAYOUT is not set
994
995#
996# Watchdog Device Drivers
997#
998# CONFIG_SOFT_WATCHDOG is not set
999# CONFIG_ALIM7101_WDT is not set
1000CONFIG_GEF_WDT=y
1001# CONFIG_8xxx_WDT is not set
1002
1003#
1004# PCI-based Watchdog Cards
1005#
1006# CONFIG_PCIPCWATCHDOG is not set
1007# CONFIG_WDTPCI is not set
1008
1009#
1010# USB-based Watchdog Cards
1011#
1012# CONFIG_USBPCWATCHDOG is not set
1013CONFIG_SSB_POSSIBLE=y
1014
1015#
1016# Sonics Silicon Backplane
1017#
1018# CONFIG_SSB is not set
1019
1020#
1021# Multifunction device drivers
1022#
1023# CONFIG_MFD_CORE is not set
1024# CONFIG_MFD_SM501 is not set
1025# CONFIG_HTC_PASIC3 is not set
1026# CONFIG_TPS65010 is not set
1027# CONFIG_TWL4030_CORE is not set
1028# CONFIG_MFD_TMIO is not set
1029# CONFIG_PMIC_DA903X is not set
1030# CONFIG_MFD_WM8400 is not set
1031# CONFIG_MFD_WM8350_I2C is not set
1032# CONFIG_MFD_PCF50633 is not set
1033# CONFIG_REGULATOR is not set
1034
1035#
1036# Multimedia devices
1037#
1038
1039#
1040# Multimedia core support
1041#
1042# CONFIG_VIDEO_DEV is not set
1043# CONFIG_DVB_CORE is not set
1044# CONFIG_VIDEO_MEDIA is not set
1045
1046#
1047# Multimedia drivers
1048#
1049CONFIG_DAB=y
1050# CONFIG_USB_DABUSB is not set
1051
1052#
1053# Graphics support
1054#
1055# CONFIG_AGP is not set
1056# CONFIG_DRM is not set
1057# CONFIG_VGASTATE is not set
1058CONFIG_VIDEO_OUTPUT_CONTROL=m
1059# CONFIG_FB is not set
1060# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
1061
1062#
1063# Display device support
1064#
1065# CONFIG_DISPLAY_SUPPORT is not set
1066
1067#
1068# Console display driver support
1069#
1070CONFIG_VGA_CONSOLE=y
1071# CONFIG_VGACON_SOFT_SCROLLBACK is not set
1072CONFIG_DUMMY_CONSOLE=y
1073# CONFIG_SOUND is not set
1074CONFIG_HID_SUPPORT=y
1075CONFIG_HID=y
1076# CONFIG_HID_DEBUG is not set
1077# CONFIG_HIDRAW is not set
1078
1079#
1080# USB Input Devices
1081#
1082CONFIG_USB_HID=y
1083# CONFIG_HID_PID is not set
1084# CONFIG_USB_HIDDEV is not set
1085
1086#
1087# Special HID drivers
1088#
1089CONFIG_HID_COMPAT=y
1090CONFIG_HID_A4TECH=y
1091CONFIG_HID_APPLE=y
1092CONFIG_HID_BELKIN=y
1093CONFIG_HID_CHERRY=y
1094CONFIG_HID_CHICONY=y
1095CONFIG_HID_CYPRESS=y
1096CONFIG_HID_EZKEY=y
1097CONFIG_HID_GYRATION=y
1098CONFIG_HID_LOGITECH=y
1099# CONFIG_LOGITECH_FF is not set
1100# CONFIG_LOGIRUMBLEPAD2_FF is not set
1101CONFIG_HID_MICROSOFT=y
1102CONFIG_HID_MONTEREY=y
1103# CONFIG_HID_NTRIG is not set
1104CONFIG_HID_PANTHERLORD=y
1105# CONFIG_PANTHERLORD_FF is not set
1106CONFIG_HID_PETALYNX=y
1107CONFIG_HID_SAMSUNG=y
1108CONFIG_HID_SONY=y
1109CONFIG_HID_SUNPLUS=y
1110# CONFIG_GREENASIA_FF is not set
1111# CONFIG_HID_TOPSEED is not set
1112# CONFIG_THRUSTMASTER_FF is not set
1113# CONFIG_ZEROPLUS_FF is not set
1114CONFIG_USB_SUPPORT=y
1115CONFIG_USB_ARCH_HAS_HCD=y
1116CONFIG_USB_ARCH_HAS_OHCI=y
1117CONFIG_USB_ARCH_HAS_EHCI=y
1118CONFIG_USB=y
1119# CONFIG_USB_DEBUG is not set
1120# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
1121
1122#
1123# Miscellaneous USB options
1124#
1125# CONFIG_USB_DEVICEFS is not set
1126# CONFIG_USB_DEVICE_CLASS is not set
1127# CONFIG_USB_DYNAMIC_MINORS is not set
1128# CONFIG_USB_OTG is not set
1129# CONFIG_USB_OTG_WHITELIST is not set
1130# CONFIG_USB_OTG_BLACKLIST_HUB is not set
1131# CONFIG_USB_MON is not set
1132# CONFIG_USB_WUSB is not set
1133# CONFIG_USB_WUSB_CBAF is not set
1134
1135#
1136# USB Host Controller Drivers
1137#
1138# CONFIG_USB_C67X00_HCD is not set
1139CONFIG_USB_EHCI_HCD=y
1140# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
1141# CONFIG_USB_EHCI_TT_NEWSCHED is not set
1142# CONFIG_USB_EHCI_FSL is not set
1143# CONFIG_USB_EHCI_HCD_PPC_OF is not set
1144# CONFIG_USB_OXU210HP_HCD is not set
1145# CONFIG_USB_ISP116X_HCD is not set
1146# CONFIG_USB_ISP1760_HCD is not set
1147CONFIG_USB_OHCI_HCD=y
1148# CONFIG_USB_OHCI_HCD_PPC_OF is not set
1149# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
1150# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
1151CONFIG_USB_OHCI_LITTLE_ENDIAN=y
1152# CONFIG_USB_UHCI_HCD is not set
1153# CONFIG_USB_SL811_HCD is not set
1154# CONFIG_USB_R8A66597_HCD is not set
1155# CONFIG_USB_WHCI_HCD is not set
1156# CONFIG_USB_HWA_HCD is not set
1157
1158#
1159# USB Device Class drivers
1160#
1161# CONFIG_USB_ACM is not set
1162# CONFIG_USB_PRINTER is not set
1163# CONFIG_USB_WDM is not set
1164# CONFIG_USB_TMC is not set
1165
1166#
1167# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
1168#
1169
1170#
1171# see USB_STORAGE Help for more information
1172#
1173CONFIG_USB_STORAGE=y
1174# CONFIG_USB_STORAGE_DEBUG is not set
1175# CONFIG_USB_STORAGE_DATAFAB is not set
1176# CONFIG_USB_STORAGE_FREECOM is not set
1177# CONFIG_USB_STORAGE_ISD200 is not set
1178# CONFIG_USB_STORAGE_USBAT is not set
1179# CONFIG_USB_STORAGE_SDDR09 is not set
1180# CONFIG_USB_STORAGE_SDDR55 is not set
1181# CONFIG_USB_STORAGE_JUMPSHOT is not set
1182# CONFIG_USB_STORAGE_ALAUDA is not set
1183# CONFIG_USB_STORAGE_ONETOUCH is not set
1184# CONFIG_USB_STORAGE_KARMA is not set
1185# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
1186# CONFIG_USB_LIBUSUAL is not set
1187
1188#
1189# USB Imaging devices
1190#
1191# CONFIG_USB_MDC800 is not set
1192# CONFIG_USB_MICROTEK is not set
1193
1194#
1195# USB port drivers
1196#
1197# CONFIG_USB_SERIAL is not set
1198
1199#
1200# USB Miscellaneous drivers
1201#
1202# CONFIG_USB_EMI62 is not set
1203# CONFIG_USB_EMI26 is not set
1204# CONFIG_USB_ADUTUX is not set
1205# CONFIG_USB_SEVSEG is not set
1206# CONFIG_USB_RIO500 is not set
1207# CONFIG_USB_LEGOTOWER is not set
1208# CONFIG_USB_LCD is not set
1209# CONFIG_USB_BERRY_CHARGE is not set
1210# CONFIG_USB_LED is not set
1211# CONFIG_USB_CYPRESS_CY7C63 is not set
1212# CONFIG_USB_CYTHERM is not set
1213# CONFIG_USB_PHIDGET is not set
1214# CONFIG_USB_IDMOUSE is not set
1215# CONFIG_USB_FTDI_ELAN is not set
1216# CONFIG_USB_APPLEDISPLAY is not set
1217# CONFIG_USB_SISUSBVGA is not set
1218# CONFIG_USB_LD is not set
1219# CONFIG_USB_TRANCEVIBRATOR is not set
1220# CONFIG_USB_IOWARRIOR is not set
1221# CONFIG_USB_ISIGHTFW is not set
1222# CONFIG_USB_VST is not set
1223# CONFIG_USB_GADGET is not set
1224
1225#
1226# OTG and related infrastructure
1227#
1228# CONFIG_USB_GPIO_VBUS is not set
1229# CONFIG_UWB is not set
1230# CONFIG_MMC is not set
1231# CONFIG_MEMSTICK is not set
1232# CONFIG_NEW_LEDS is not set
1233# CONFIG_ACCESSIBILITY is not set
1234# CONFIG_INFINIBAND is not set
1235# CONFIG_EDAC is not set
1236CONFIG_RTC_LIB=y
1237CONFIG_RTC_CLASS=y
1238CONFIG_RTC_HCTOSYS=y
1239CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
1240# CONFIG_RTC_DEBUG is not set
1241
1242#
1243# RTC interfaces
1244#
1245CONFIG_RTC_INTF_SYSFS=y
1246# CONFIG_RTC_INTF_PROC is not set
1247CONFIG_RTC_INTF_DEV=y
1248# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
1249# CONFIG_RTC_DRV_TEST is not set
1250
1251#
1252# I2C RTC drivers
1253#
1254# CONFIG_RTC_DRV_DS1307 is not set
1255# CONFIG_RTC_DRV_DS1374 is not set
1256# CONFIG_RTC_DRV_DS1672 is not set
1257# CONFIG_RTC_DRV_MAX6900 is not set
1258# CONFIG_RTC_DRV_RS5C372 is not set
1259# CONFIG_RTC_DRV_ISL1208 is not set
1260# CONFIG_RTC_DRV_X1205 is not set
1261# CONFIG_RTC_DRV_PCF8563 is not set
1262# CONFIG_RTC_DRV_PCF8583 is not set
1263# CONFIG_RTC_DRV_M41T80 is not set
1264# CONFIG_RTC_DRV_S35390A is not set
1265# CONFIG_RTC_DRV_FM3130 is not set
1266CONFIG_RTC_DRV_RX8581=y
1267
1268#
1269# SPI RTC drivers
1270#
1271
1272#
1273# Platform RTC drivers
1274#
1275# CONFIG_RTC_DRV_CMOS is not set
1276# CONFIG_RTC_DRV_DS1286 is not set
1277# CONFIG_RTC_DRV_DS1511 is not set
1278# CONFIG_RTC_DRV_DS1553 is not set
1279# CONFIG_RTC_DRV_DS1742 is not set
1280# CONFIG_RTC_DRV_STK17TA8 is not set
1281# CONFIG_RTC_DRV_M48T86 is not set
1282# CONFIG_RTC_DRV_M48T35 is not set
1283# CONFIG_RTC_DRV_M48T59 is not set
1284# CONFIG_RTC_DRV_BQ4802 is not set
1285# CONFIG_RTC_DRV_V3020 is not set
1286
1287#
1288# on-CPU RTC drivers
1289#
1290# CONFIG_RTC_DRV_PPC is not set
1291# CONFIG_DMADEVICES is not set
1292# CONFIG_UIO is not set
1293# CONFIG_STAGING is not set
1294
1295#
1296# File systems
1297#
1298CONFIG_EXT2_FS=y
1299CONFIG_EXT2_FS_XATTR=y
1300CONFIG_EXT2_FS_POSIX_ACL=y
1301# CONFIG_EXT2_FS_SECURITY is not set
1302# CONFIG_EXT2_FS_XIP is not set
1303CONFIG_EXT3_FS=y
1304CONFIG_EXT3_FS_XATTR=y
1305CONFIG_EXT3_FS_POSIX_ACL=y
1306# CONFIG_EXT3_FS_SECURITY is not set
1307# CONFIG_EXT4_FS is not set
1308CONFIG_JBD=y
1309CONFIG_FS_MBCACHE=y
1310# CONFIG_REISERFS_FS is not set
1311# CONFIG_JFS_FS is not set
1312CONFIG_FS_POSIX_ACL=y
1313CONFIG_FILE_LOCKING=y
1314# CONFIG_XFS_FS is not set
1315# CONFIG_OCFS2_FS is not set
1316# CONFIG_BTRFS_FS is not set
1317CONFIG_DNOTIFY=y
1318CONFIG_INOTIFY=y
1319CONFIG_INOTIFY_USER=y
1320# CONFIG_QUOTA is not set
1321# CONFIG_AUTOFS_FS is not set
1322# CONFIG_AUTOFS4_FS is not set
1323# CONFIG_FUSE_FS is not set
1324
1325#
1326# CD-ROM/DVD Filesystems
1327#
1328CONFIG_ISO9660_FS=y
1329CONFIG_JOLIET=y
1330CONFIG_ZISOFS=y
1331CONFIG_UDF_FS=y
1332CONFIG_UDF_NLS=y
1333
1334#
1335# DOS/FAT/NT Filesystems
1336#
1337CONFIG_FAT_FS=y
1338CONFIG_MSDOS_FS=y
1339CONFIG_VFAT_FS=y
1340CONFIG_FAT_DEFAULT_CODEPAGE=850
1341CONFIG_FAT_DEFAULT_IOCHARSET="ascii"
1342# CONFIG_NTFS_FS is not set
1343
1344#
1345# Pseudo filesystems
1346#
1347CONFIG_PROC_FS=y
1348CONFIG_PROC_KCORE=y
1349CONFIG_PROC_SYSCTL=y
1350CONFIG_PROC_PAGE_MONITOR=y
1351CONFIG_SYSFS=y
1352CONFIG_TMPFS=y
1353# CONFIG_TMPFS_POSIX_ACL is not set
1354# CONFIG_HUGETLB_PAGE is not set
1355# CONFIG_CONFIGFS_FS is not set
1356CONFIG_MISC_FILESYSTEMS=y
1357# CONFIG_ADFS_FS is not set
1358# CONFIG_AFFS_FS is not set
1359# CONFIG_HFS_FS is not set
1360# CONFIG_HFSPLUS_FS is not set
1361# CONFIG_BEFS_FS is not set
1362# CONFIG_BFS_FS is not set
1363# CONFIG_EFS_FS is not set
1364CONFIG_JFFS2_FS=y
1365CONFIG_JFFS2_FS_DEBUG=0
1366CONFIG_JFFS2_FS_WRITEBUFFER=y
1367# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
1368# CONFIG_JFFS2_SUMMARY is not set
1369# CONFIG_JFFS2_FS_XATTR is not set
1370# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
1371CONFIG_JFFS2_ZLIB=y
1372# CONFIG_JFFS2_LZO is not set
1373CONFIG_JFFS2_RTIME=y
1374# CONFIG_JFFS2_RUBIN is not set
1375# CONFIG_CRAMFS is not set
1376# CONFIG_SQUASHFS is not set
1377# CONFIG_VXFS_FS is not set
1378# CONFIG_MINIX_FS is not set
1379# CONFIG_OMFS_FS is not set
1380# CONFIG_HPFS_FS is not set
1381# CONFIG_QNX4FS_FS is not set
1382# CONFIG_ROMFS_FS is not set
1383# CONFIG_SYSV_FS is not set
1384# CONFIG_UFS_FS is not set
1385CONFIG_NETWORK_FILESYSTEMS=y
1386CONFIG_NFS_FS=y
1387CONFIG_NFS_V3=y
1388# CONFIG_NFS_V3_ACL is not set
1389CONFIG_NFS_V4=y
1390CONFIG_ROOT_NFS=y
1391# CONFIG_NFSD is not set
1392CONFIG_LOCKD=y
1393CONFIG_LOCKD_V4=y
1394CONFIG_NFS_COMMON=y
1395CONFIG_SUNRPC=y
1396CONFIG_SUNRPC_GSS=y
1397# CONFIG_SUNRPC_REGISTER_V4 is not set
1398CONFIG_RPCSEC_GSS_KRB5=y
1399# CONFIG_RPCSEC_GSS_SPKM3 is not set
1400# CONFIG_SMB_FS is not set
1401CONFIG_CIFS=m
1402# CONFIG_CIFS_STATS is not set
1403# CONFIG_CIFS_WEAK_PW_HASH is not set
1404CONFIG_CIFS_XATTR=y
1405CONFIG_CIFS_POSIX=y
1406# CONFIG_CIFS_DEBUG2 is not set
1407# CONFIG_CIFS_EXPERIMENTAL is not set
1408# CONFIG_NCP_FS is not set
1409# CONFIG_CODA_FS is not set
1410# CONFIG_AFS_FS is not set
1411
1412#
1413# Partition Types
1414#
1415# CONFIG_PARTITION_ADVANCED is not set
1416CONFIG_MSDOS_PARTITION=y
1417CONFIG_NLS=y
1418CONFIG_NLS_DEFAULT="iso8859-1"
1419CONFIG_NLS_CODEPAGE_437=m
1420CONFIG_NLS_CODEPAGE_737=m
1421CONFIG_NLS_CODEPAGE_775=m
1422CONFIG_NLS_CODEPAGE_850=m
1423CONFIG_NLS_CODEPAGE_852=m
1424CONFIG_NLS_CODEPAGE_855=m
1425CONFIG_NLS_CODEPAGE_857=m
1426CONFIG_NLS_CODEPAGE_860=m
1427CONFIG_NLS_CODEPAGE_861=m
1428CONFIG_NLS_CODEPAGE_862=m
1429CONFIG_NLS_CODEPAGE_863=m
1430CONFIG_NLS_CODEPAGE_864=m
1431CONFIG_NLS_CODEPAGE_865=m
1432CONFIG_NLS_CODEPAGE_866=m
1433CONFIG_NLS_CODEPAGE_869=m
1434CONFIG_NLS_CODEPAGE_936=m
1435CONFIG_NLS_CODEPAGE_950=m
1436CONFIG_NLS_CODEPAGE_932=m
1437CONFIG_NLS_CODEPAGE_949=m
1438CONFIG_NLS_CODEPAGE_874=m
1439CONFIG_NLS_ISO8859_8=m
1440CONFIG_NLS_CODEPAGE_1250=m
1441CONFIG_NLS_CODEPAGE_1251=m
1442CONFIG_NLS_ASCII=m
1443CONFIG_NLS_ISO8859_1=m
1444CONFIG_NLS_ISO8859_2=m
1445CONFIG_NLS_ISO8859_3=m
1446CONFIG_NLS_ISO8859_4=m
1447CONFIG_NLS_ISO8859_5=m
1448CONFIG_NLS_ISO8859_6=m
1449CONFIG_NLS_ISO8859_7=m
1450CONFIG_NLS_ISO8859_9=m
1451CONFIG_NLS_ISO8859_13=m
1452CONFIG_NLS_ISO8859_14=m
1453CONFIG_NLS_ISO8859_15=m
1454CONFIG_NLS_KOI8_R=m
1455CONFIG_NLS_KOI8_U=m
1456CONFIG_NLS_UTF8=m
1457# CONFIG_DLM is not set
1458
1459#
1460# Library routines
1461#
1462CONFIG_BITREVERSE=y
1463CONFIG_GENERIC_FIND_LAST_BIT=y
1464CONFIG_CRC_CCITT=y
1465# CONFIG_CRC16 is not set
1466CONFIG_CRC_T10DIF=y
1467CONFIG_CRC_ITU_T=y
1468CONFIG_CRC32=y
1469# CONFIG_CRC7 is not set
1470CONFIG_LIBCRC32C=y
1471CONFIG_ZLIB_INFLATE=y
1472CONFIG_ZLIB_DEFLATE=y
1473CONFIG_PLIST=y
1474CONFIG_HAS_IOMEM=y
1475CONFIG_HAS_IOPORT=y
1476CONFIG_HAS_DMA=y
1477CONFIG_HAVE_LMB=y
1478
1479#
1480# Kernel hacking
1481#
1482# CONFIG_PRINTK_TIME is not set
1483CONFIG_ENABLE_WARN_DEPRECATED=y
1484CONFIG_ENABLE_MUST_CHECK=y
1485CONFIG_FRAME_WARN=1024
1486CONFIG_MAGIC_SYSRQ=y
1487# CONFIG_UNUSED_SYMBOLS is not set
1488# CONFIG_DEBUG_FS is not set
1489# CONFIG_HEADERS_CHECK is not set
1490# CONFIG_DEBUG_KERNEL is not set
1491# CONFIG_DEBUG_BUGVERBOSE is not set
1492# CONFIG_DEBUG_MEMORY_INIT is not set
1493# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1494# CONFIG_LATENCYTOP is not set
1495CONFIG_SYSCTL_SYSCALL_CHECK=y
1496CONFIG_HAVE_FUNCTION_TRACER=y
1497CONFIG_HAVE_DYNAMIC_FTRACE=y
1498CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1499
1500#
1501# Tracers
1502#
1503# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
1504# CONFIG_SAMPLES is not set
1505CONFIG_HAVE_ARCH_KGDB=y
1506CONFIG_PRINT_STACK_DEPTH=64
1507# CONFIG_IRQSTACKS is not set
1508# CONFIG_BOOTX_TEXT is not set
1509# CONFIG_PPC_EARLY_DEBUG is not set
1510
1511#
1512# Security options
1513#
1514# CONFIG_KEYS is not set
1515# CONFIG_SECURITY is not set
1516# CONFIG_SECURITYFS is not set
1517# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1518CONFIG_CRYPTO=y
1519
1520#
1521# Crypto core or helper
1522#
1523# CONFIG_CRYPTO_FIPS is not set
1524CONFIG_CRYPTO_ALGAPI=y
1525CONFIG_CRYPTO_ALGAPI2=y
1526CONFIG_CRYPTO_AEAD=m
1527CONFIG_CRYPTO_AEAD2=y
1528CONFIG_CRYPTO_BLKCIPHER=y
1529CONFIG_CRYPTO_BLKCIPHER2=y
1530CONFIG_CRYPTO_HASH=y
1531CONFIG_CRYPTO_HASH2=y
1532CONFIG_CRYPTO_RNG2=y
1533CONFIG_CRYPTO_MANAGER=y
1534CONFIG_CRYPTO_MANAGER2=y
1535# CONFIG_CRYPTO_GF128MUL is not set
1536# CONFIG_CRYPTO_NULL is not set
1537# CONFIG_CRYPTO_CRYPTD is not set
1538CONFIG_CRYPTO_AUTHENC=m
1539# CONFIG_CRYPTO_TEST is not set
1540
1541#
1542# Authenticated Encryption with Associated Data
1543#
1544# CONFIG_CRYPTO_CCM is not set
1545# CONFIG_CRYPTO_GCM is not set
1546# CONFIG_CRYPTO_SEQIV is not set
1547
1548#
1549# Block modes
1550#
1551CONFIG_CRYPTO_CBC=y
1552# CONFIG_CRYPTO_CTR is not set
1553# CONFIG_CRYPTO_CTS is not set
1554# CONFIG_CRYPTO_ECB is not set
1555# CONFIG_CRYPTO_LRW is not set
1556# CONFIG_CRYPTO_PCBC is not set
1557# CONFIG_CRYPTO_XTS is not set
1558
1559#
1560# Hash modes
1561#
1562CONFIG_CRYPTO_HMAC=m
1563# CONFIG_CRYPTO_XCBC is not set
1564
1565#
1566# Digest
1567#
1568CONFIG_CRYPTO_CRC32C=y
1569# CONFIG_CRYPTO_MD4 is not set
1570CONFIG_CRYPTO_MD5=y
1571# CONFIG_CRYPTO_MICHAEL_MIC is not set
1572# CONFIG_CRYPTO_RMD128 is not set
1573# CONFIG_CRYPTO_RMD160 is not set
1574# CONFIG_CRYPTO_RMD256 is not set
1575# CONFIG_CRYPTO_RMD320 is not set
1576CONFIG_CRYPTO_SHA1=m
1577# CONFIG_CRYPTO_SHA256 is not set
1578# CONFIG_CRYPTO_SHA512 is not set
1579# CONFIG_CRYPTO_TGR192 is not set
1580# CONFIG_CRYPTO_WP512 is not set
1581
1582#
1583# Ciphers
1584#
1585# CONFIG_CRYPTO_AES is not set
1586# CONFIG_CRYPTO_ANUBIS is not set
1587# CONFIG_CRYPTO_ARC4 is not set
1588# CONFIG_CRYPTO_BLOWFISH is not set
1589# CONFIG_CRYPTO_CAMELLIA is not set
1590# CONFIG_CRYPTO_CAST5 is not set
1591# CONFIG_CRYPTO_CAST6 is not set
1592CONFIG_CRYPTO_DES=y
1593# CONFIG_CRYPTO_FCRYPT is not set
1594# CONFIG_CRYPTO_KHAZAD is not set
1595# CONFIG_CRYPTO_SALSA20 is not set
1596# CONFIG_CRYPTO_SEED is not set
1597# CONFIG_CRYPTO_SERPENT is not set
1598# CONFIG_CRYPTO_TEA is not set
1599# CONFIG_CRYPTO_TWOFISH is not set
1600
1601#
1602# Compression
1603#
1604CONFIG_CRYPTO_DEFLATE=m
1605# CONFIG_CRYPTO_LZO is not set
1606
1607#
1608# Random Number Generation
1609#
1610# CONFIG_CRYPTO_ANSI_CPRNG is not set
1611# CONFIG_CRYPTO_HW is not set
1612# CONFIG_PPC_CLOCK is not set
1613# CONFIG_VIRTUALIZATION is not set
diff --git a/arch/powerpc/configs/amigaone_defconfig b/arch/powerpc/configs/amigaone_defconfig
new file mode 100644
index 000000000000..b63cc38df6b1
--- /dev/null
+++ b/arch/powerpc/configs/amigaone_defconfig
@@ -0,0 +1,1636 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.29-rc3
4# Sun Feb 1 14:22:42 2009
5#
6# CONFIG_PPC64 is not set
7
8#
9# Processor support
10#
11CONFIG_6xx=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_FPU=y
18CONFIG_ALTIVEC=y
19CONFIG_PPC_STD_MMU=y
20CONFIG_PPC_STD_MMU_32=y
21# CONFIG_PPC_MM_SLICES is not set
22# CONFIG_SMP is not set
23CONFIG_NOT_COHERENT_CACHE=y
24CONFIG_CHECK_CACHE_COHERENCY=y
25CONFIG_PPC32=y
26CONFIG_WORD_SIZE=32
27# CONFIG_ARCH_PHYS_ADDR_T_64BIT is not set
28CONFIG_MMU=y
29CONFIG_GENERIC_CMOS_UPDATE=y
30CONFIG_GENERIC_TIME=y
31CONFIG_GENERIC_TIME_VSYSCALL=y
32CONFIG_GENERIC_CLOCKEVENTS=y
33CONFIG_GENERIC_HARDIRQS=y
34# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
35CONFIG_IRQ_PER_CPU=y
36CONFIG_STACKTRACE_SUPPORT=y
37CONFIG_HAVE_LATENCYTOP_SUPPORT=y
38CONFIG_LOCKDEP_SUPPORT=y
39CONFIG_RWSEM_XCHGADD_ALGORITHM=y
40CONFIG_ARCH_HAS_ILOG2_U32=y
41CONFIG_GENERIC_HWEIGHT=y
42CONFIG_GENERIC_CALIBRATE_DELAY=y
43CONFIG_GENERIC_FIND_NEXT_BIT=y
44# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
45CONFIG_PPC=y
46CONFIG_EARLY_PRINTK=y
47CONFIG_GENERIC_NVRAM=y
48CONFIG_SCHED_OMIT_FRAME_POINTER=y
49CONFIG_ARCH_MAY_HAVE_PC_FDC=y
50CONFIG_PPC_OF=y
51CONFIG_OF=y
52CONFIG_PPC_UDBG_16550=y
53# CONFIG_GENERIC_TBSYNC is not set
54CONFIG_AUDIT_ARCH=y
55CONFIG_GENERIC_BUG=y
56CONFIG_DEFAULT_UIMAGE=y
57# CONFIG_PPC_DCR_NATIVE is not set
58# CONFIG_PPC_DCR_MMIO is not set
59CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
60
61#
62# General setup
63#
64CONFIG_EXPERIMENTAL=y
65CONFIG_BROKEN_ON_SMP=y
66CONFIG_INIT_ENV_ARG_LIMIT=32
67CONFIG_LOCALVERSION=""
68# CONFIG_LOCALVERSION_AUTO is not set
69CONFIG_SWAP=y
70CONFIG_SYSVIPC=y
71CONFIG_SYSVIPC_SYSCTL=y
72CONFIG_POSIX_MQUEUE=y
73# CONFIG_BSD_PROCESS_ACCT is not set
74# CONFIG_TASKSTATS is not set
75# CONFIG_AUDIT is not set
76
77#
78# RCU Subsystem
79#
80CONFIG_CLASSIC_RCU=y
81# CONFIG_TREE_RCU is not set
82# CONFIG_PREEMPT_RCU is not set
83# CONFIG_TREE_RCU_TRACE is not set
84# CONFIG_PREEMPT_RCU_TRACE is not set
85CONFIG_IKCONFIG=y
86CONFIG_IKCONFIG_PROC=y
87CONFIG_LOG_BUF_SHIFT=15
88# CONFIG_GROUP_SCHED is not set
89# CONFIG_CGROUPS is not set
90CONFIG_SYSFS_DEPRECATED=y
91CONFIG_SYSFS_DEPRECATED_V2=y
92# CONFIG_RELAY is not set
93CONFIG_NAMESPACES=y
94# CONFIG_UTS_NS is not set
95# CONFIG_IPC_NS is not set
96# CONFIG_USER_NS is not set
97# CONFIG_PID_NS is not set
98# CONFIG_NET_NS is not set
99CONFIG_BLK_DEV_INITRD=y
100CONFIG_INITRAMFS_SOURCE=""
101CONFIG_CC_OPTIMIZE_FOR_SIZE=y
102CONFIG_SYSCTL=y
103# CONFIG_EMBEDDED is not set
104CONFIG_SYSCTL_SYSCALL=y
105CONFIG_KALLSYMS=y
106# CONFIG_KALLSYMS_ALL is not set
107# CONFIG_KALLSYMS_EXTRA_PASS is not set
108CONFIG_HOTPLUG=y
109CONFIG_PRINTK=y
110CONFIG_BUG=y
111CONFIG_ELF_CORE=y
112CONFIG_PCSPKR_PLATFORM=y
113# CONFIG_COMPAT_BRK is not set
114CONFIG_BASE_FULL=y
115CONFIG_FUTEX=y
116CONFIG_ANON_INODES=y
117CONFIG_EPOLL=y
118CONFIG_SIGNALFD=y
119CONFIG_TIMERFD=y
120CONFIG_EVENTFD=y
121CONFIG_SHMEM=y
122CONFIG_AIO=y
123CONFIG_VM_EVENT_COUNTERS=y
124CONFIG_PCI_QUIRKS=y
125CONFIG_SLUB_DEBUG=y
126# CONFIG_SLAB is not set
127CONFIG_SLUB=y
128# CONFIG_SLOB is not set
129# CONFIG_PROFILING is not set
130CONFIG_HAVE_OPROFILE=y
131# CONFIG_KPROBES is not set
132CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
133CONFIG_HAVE_IOREMAP_PROT=y
134CONFIG_HAVE_KPROBES=y
135CONFIG_HAVE_KRETPROBES=y
136CONFIG_HAVE_ARCH_TRACEHOOK=y
137# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
138CONFIG_SLABINFO=y
139CONFIG_RT_MUTEXES=y
140CONFIG_BASE_SMALL=0
141CONFIG_MODULES=y
142# CONFIG_MODULE_FORCE_LOAD is not set
143CONFIG_MODULE_UNLOAD=y
144CONFIG_MODULE_FORCE_UNLOAD=y
145# CONFIG_MODVERSIONS is not set
146# CONFIG_MODULE_SRCVERSION_ALL is not set
147CONFIG_BLOCK=y
148CONFIG_LBD=y
149# CONFIG_BLK_DEV_IO_TRACE is not set
150# CONFIG_BLK_DEV_BSG is not set
151# CONFIG_BLK_DEV_INTEGRITY is not set
152
153#
154# IO Schedulers
155#
156CONFIG_IOSCHED_NOOP=y
157CONFIG_IOSCHED_AS=y
158CONFIG_IOSCHED_DEADLINE=y
159CONFIG_IOSCHED_CFQ=y
160CONFIG_DEFAULT_AS=y
161# CONFIG_DEFAULT_DEADLINE is not set
162# CONFIG_DEFAULT_CFQ is not set
163# CONFIG_DEFAULT_NOOP is not set
164CONFIG_DEFAULT_IOSCHED="anticipatory"
165# CONFIG_FREEZER is not set
166
167#
168# Platform support
169#
170CONFIG_PPC_MULTIPLATFORM=y
171CONFIG_CLASSIC32=y
172# CONFIG_PPC_CHRP is not set
173# CONFIG_MPC5121_ADS is not set
174# CONFIG_MPC5121_GENERIC is not set
175# CONFIG_PPC_MPC52xx is not set
176# CONFIG_PPC_PMAC is not set
177# CONFIG_PPC_CELL is not set
178# CONFIG_PPC_CELL_NATIVE is not set
179# CONFIG_PPC_82xx is not set
180# CONFIG_PQ2ADS is not set
181# CONFIG_PPC_83xx is not set
182# CONFIG_PPC_86xx is not set
183# CONFIG_EMBEDDED6xx is not set
184CONFIG_AMIGAONE=y
185# CONFIG_IPIC is not set
186# CONFIG_MPIC is not set
187# CONFIG_MPIC_WEIRD is not set
188CONFIG_PPC_I8259=y
189# CONFIG_PPC_RTAS is not set
190# CONFIG_MMIO_NVRAM is not set
191# CONFIG_PPC_MPC106 is not set
192# CONFIG_PPC_970_NAP is not set
193# CONFIG_PPC_INDIRECT_IO is not set
194# CONFIG_GENERIC_IOMAP is not set
195# CONFIG_CPU_FREQ is not set
196# CONFIG_TAU is not set
197# CONFIG_FSL_ULI1575 is not set
198# CONFIG_SIMPLE_GPIO is not set
199
200#
201# Kernel options
202#
203CONFIG_HIGHMEM=y
204CONFIG_TICK_ONESHOT=y
205CONFIG_NO_HZ=y
206CONFIG_HIGH_RES_TIMERS=y
207CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
208# CONFIG_HZ_100 is not set
209CONFIG_HZ_250=y
210# CONFIG_HZ_300 is not set
211# CONFIG_HZ_1000 is not set
212CONFIG_HZ=250
213CONFIG_SCHED_HRTICK=y
214CONFIG_PREEMPT_NONE=y
215# CONFIG_PREEMPT_VOLUNTARY is not set
216# CONFIG_PREEMPT is not set
217CONFIG_BINFMT_ELF=y
218# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
219# CONFIG_HAVE_AOUT is not set
220CONFIG_BINFMT_MISC=y
221# CONFIG_IOMMU_HELPER is not set
222CONFIG_PPC_NEED_DMA_SYNC_OPS=y
223CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
224CONFIG_ARCH_HAS_WALK_MEMORY=y
225CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
226# CONFIG_KEXEC is not set
227# CONFIG_CRASH_DUMP is not set
228CONFIG_ARCH_FLATMEM_ENABLE=y
229CONFIG_ARCH_POPULATES_NODE_MAP=y
230CONFIG_SELECT_MEMORY_MODEL=y
231CONFIG_FLATMEM_MANUAL=y
232# CONFIG_DISCONTIGMEM_MANUAL is not set
233# CONFIG_SPARSEMEM_MANUAL is not set
234CONFIG_FLATMEM=y
235CONFIG_FLAT_NODE_MEM_MAP=y
236CONFIG_PAGEFLAGS_EXTENDED=y
237CONFIG_SPLIT_PTLOCK_CPUS=4
238# CONFIG_MIGRATION is not set
239# CONFIG_PHYS_ADDR_T_64BIT is not set
240CONFIG_ZONE_DMA_FLAG=1
241CONFIG_BOUNCE=y
242CONFIG_VIRT_TO_BUS=y
243CONFIG_UNEVICTABLE_LRU=y
244CONFIG_PPC_4K_PAGES=y
245# CONFIG_PPC_16K_PAGES is not set
246# CONFIG_PPC_64K_PAGES is not set
247CONFIG_FORCE_MAX_ZONEORDER=11
248CONFIG_PROC_DEVICETREE=y
249# CONFIG_CMDLINE_BOOL is not set
250CONFIG_EXTRA_TARGETS=""
251# CONFIG_PM is not set
252CONFIG_SECCOMP=y
253CONFIG_ISA_DMA_API=y
254
255#
256# Bus options
257#
258CONFIG_ZONE_DMA=y
259CONFIG_GENERIC_ISA_DMA=y
260CONFIG_PPC_INDIRECT_PCI=y
261CONFIG_PCI=y
262CONFIG_PCI_DOMAINS=y
263CONFIG_PCI_SYSCALL=y
264# CONFIG_PCIEPORTBUS is not set
265CONFIG_ARCH_SUPPORTS_MSI=y
266# CONFIG_PCI_MSI is not set
267# CONFIG_PCI_LEGACY is not set
268# CONFIG_PCI_DEBUG is not set
269# CONFIG_PCI_STUB is not set
270# CONFIG_PCCARD is not set
271# CONFIG_HOTPLUG_PCI is not set
272# CONFIG_HAS_RAPIDIO is not set
273
274#
275# Advanced setup
276#
277# CONFIG_ADVANCED_OPTIONS is not set
278
279#
280# Default settings for advanced configuration options are used
281#
282CONFIG_LOWMEM_SIZE=0x30000000
283CONFIG_PAGE_OFFSET=0xc0000000
284CONFIG_KERNEL_START=0xc0000000
285CONFIG_PHYSICAL_START=0x00000000
286CONFIG_TASK_SIZE=0xc0000000
287CONFIG_CONSISTENT_START=0xff100000
288CONFIG_CONSISTENT_SIZE=0x00200000
289CONFIG_NET=y
290
291#
292# Networking options
293#
294CONFIG_COMPAT_NET_DEV_OPS=y
295CONFIG_PACKET=y
296# CONFIG_PACKET_MMAP is not set
297CONFIG_UNIX=y
298# CONFIG_NET_KEY is not set
299CONFIG_INET=y
300CONFIG_IP_MULTICAST=y
301# CONFIG_IP_ADVANCED_ROUTER is not set
302CONFIG_IP_FIB_HASH=y
303# CONFIG_IP_PNP is not set
304# CONFIG_NET_IPIP is not set
305# CONFIG_NET_IPGRE is not set
306# CONFIG_IP_MROUTE is not set
307# CONFIG_ARPD is not set
308CONFIG_SYN_COOKIES=y
309# CONFIG_INET_AH is not set
310# CONFIG_INET_ESP is not set
311# CONFIG_INET_IPCOMP is not set
312# CONFIG_INET_XFRM_TUNNEL is not set
313# CONFIG_INET_TUNNEL is not set
314# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
315# CONFIG_INET_XFRM_MODE_TUNNEL is not set
316# CONFIG_INET_XFRM_MODE_BEET is not set
317# CONFIG_INET_LRO is not set
318CONFIG_INET_DIAG=y
319CONFIG_INET_TCP_DIAG=y
320# CONFIG_TCP_CONG_ADVANCED is not set
321CONFIG_TCP_CONG_CUBIC=y
322CONFIG_DEFAULT_TCP_CONG="cubic"
323# CONFIG_TCP_MD5SIG is not set
324# CONFIG_IPV6 is not set
325# CONFIG_NETWORK_SECMARK is not set
326CONFIG_NETFILTER=y
327# CONFIG_NETFILTER_DEBUG is not set
328# CONFIG_NETFILTER_ADVANCED is not set
329
330#
331# Core Netfilter Configuration
332#
333CONFIG_NETFILTER_NETLINK=m
334CONFIG_NETFILTER_NETLINK_LOG=m
335CONFIG_NF_CONNTRACK=m
336CONFIG_NF_CONNTRACK_FTP=m
337CONFIG_NF_CONNTRACK_IRC=m
338CONFIG_NF_CONNTRACK_SIP=m
339CONFIG_NF_CT_NETLINK=m
340CONFIG_NETFILTER_XTABLES=m
341# CONFIG_NETFILTER_XT_TARGET_MARK is not set
342# CONFIG_NETFILTER_XT_TARGET_NFLOG is not set
343# CONFIG_NETFILTER_XT_TARGET_TCPMSS is not set
344# CONFIG_NETFILTER_XT_MATCH_CONNTRACK is not set
345# CONFIG_NETFILTER_XT_MATCH_MARK is not set
346# CONFIG_NETFILTER_XT_MATCH_STATE is not set
347# CONFIG_IP_VS is not set
348
349#
350# IP: Netfilter Configuration
351#
352CONFIG_NF_DEFRAG_IPV4=m
353CONFIG_NF_CONNTRACK_IPV4=m
354CONFIG_NF_CONNTRACK_PROC_COMPAT=y
355CONFIG_IP_NF_IPTABLES=m
356CONFIG_IP_NF_FILTER=m
357CONFIG_IP_NF_TARGET_REJECT=m
358CONFIG_IP_NF_TARGET_LOG=m
359# CONFIG_IP_NF_TARGET_ULOG is not set
360CONFIG_NF_NAT=m
361CONFIG_NF_NAT_NEEDED=y
362CONFIG_IP_NF_TARGET_MASQUERADE=m
363CONFIG_NF_NAT_FTP=m
364CONFIG_NF_NAT_IRC=m
365# CONFIG_NF_NAT_TFTP is not set
366# CONFIG_NF_NAT_AMANDA is not set
367# CONFIG_NF_NAT_PPTP is not set
368# CONFIG_NF_NAT_H323 is not set
369CONFIG_NF_NAT_SIP=m
370# CONFIG_IP_NF_MANGLE is not set
371# CONFIG_IP_DCCP is not set
372# CONFIG_IP_SCTP is not set
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# CONFIG_DCB is not set
388
389#
390# Network testing
391#
392# CONFIG_NET_PKTGEN is not set
393# CONFIG_HAMRADIO is not set
394# CONFIG_CAN is not set
395# CONFIG_IRDA is not set
396# CONFIG_BT is not set
397# CONFIG_AF_RXRPC is not set
398# CONFIG_PHONET is not set
399# CONFIG_WIRELESS is not set
400# CONFIG_WIMAX is not set
401# CONFIG_RFKILL is not set
402# CONFIG_NET_9P is not set
403
404#
405# Device Drivers
406#
407
408#
409# Generic Driver Options
410#
411CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
412# CONFIG_STANDALONE is not set
413CONFIG_PREVENT_FIRMWARE_BUILD=y
414CONFIG_FW_LOADER=y
415CONFIG_FIRMWARE_IN_KERNEL=y
416CONFIG_EXTRA_FIRMWARE=""
417# CONFIG_DEBUG_DRIVER is not set
418# CONFIG_DEBUG_DEVRES is not set
419# CONFIG_SYS_HYPERVISOR is not set
420# CONFIG_CONNECTOR is not set
421# CONFIG_MTD is not set
422CONFIG_OF_DEVICE=y
423CONFIG_OF_I2C=y
424CONFIG_PARPORT=y
425CONFIG_PARPORT_PC=y
426# CONFIG_PARPORT_SERIAL is not set
427CONFIG_PARPORT_PC_FIFO=y
428# CONFIG_PARPORT_PC_SUPERIO is not set
429# CONFIG_PARPORT_GSC is not set
430# CONFIG_PARPORT_AX88796 is not set
431# CONFIG_PARPORT_1284 is not set
432CONFIG_BLK_DEV=y
433CONFIG_BLK_DEV_FD=y
434# CONFIG_PARIDE is not set
435# CONFIG_BLK_CPQ_DA is not set
436# CONFIG_BLK_CPQ_CISS_DA is not set
437# CONFIG_BLK_DEV_DAC960 is not set
438# CONFIG_BLK_DEV_UMEM is not set
439# CONFIG_BLK_DEV_COW_COMMON is not set
440CONFIG_BLK_DEV_LOOP=y
441# CONFIG_BLK_DEV_CRYPTOLOOP is not set
442# CONFIG_BLK_DEV_NBD is not set
443# CONFIG_BLK_DEV_SX8 is not set
444# CONFIG_BLK_DEV_UB is not set
445CONFIG_BLK_DEV_RAM=y
446CONFIG_BLK_DEV_RAM_COUNT=16
447CONFIG_BLK_DEV_RAM_SIZE=4096
448# CONFIG_BLK_DEV_XIP is not set
449# CONFIG_CDROM_PKTCDVD is not set
450# CONFIG_ATA_OVER_ETH is not set
451# CONFIG_BLK_DEV_HD is not set
452CONFIG_MISC_DEVICES=y
453# CONFIG_PHANTOM is not set
454# CONFIG_SGI_IOC4 is not set
455# CONFIG_TIFM_CORE is not set
456# CONFIG_ICS932S401 is not set
457# CONFIG_ENCLOSURE_SERVICES is not set
458# CONFIG_HP_ILO is not set
459# CONFIG_C2PORT is not set
460
461#
462# EEPROM support
463#
464# CONFIG_EEPROM_AT24 is not set
465# CONFIG_EEPROM_LEGACY is not set
466# CONFIG_EEPROM_93CX6 is not set
467CONFIG_HAVE_IDE=y
468CONFIG_IDE=y
469
470#
471# Please see Documentation/ide/ide.txt for help/info on IDE drives
472#
473CONFIG_IDE_TIMINGS=y
474CONFIG_IDE_ATAPI=y
475# CONFIG_BLK_DEV_IDE_SATA is not set
476CONFIG_IDE_GD=y
477CONFIG_IDE_GD_ATA=y
478# CONFIG_IDE_GD_ATAPI is not set
479CONFIG_BLK_DEV_IDECD=y
480CONFIG_BLK_DEV_IDECD_VERBOSE_ERRORS=y
481# CONFIG_BLK_DEV_IDETAPE is not set
482# CONFIG_IDE_TASK_IOCTL is not set
483CONFIG_IDE_PROC_FS=y
484
485#
486# IDE chipset support/bugfixes
487#
488# CONFIG_BLK_DEV_PLATFORM is not set
489CONFIG_BLK_DEV_IDEDMA_SFF=y
490
491#
492# PCI IDE chipsets support
493#
494CONFIG_BLK_DEV_IDEPCI=y
495# CONFIG_IDEPCI_PCIBUS_ORDER is not set
496# CONFIG_BLK_DEV_OFFBOARD is not set
497CONFIG_BLK_DEV_GENERIC=y
498# CONFIG_BLK_DEV_OPTI621 is not set
499CONFIG_BLK_DEV_IDEDMA_PCI=y
500# CONFIG_BLK_DEV_AEC62XX is not set
501# CONFIG_BLK_DEV_ALI15X3 is not set
502# CONFIG_BLK_DEV_AMD74XX is not set
503# CONFIG_BLK_DEV_CMD64X is not set
504# CONFIG_BLK_DEV_TRIFLEX is not set
505# CONFIG_BLK_DEV_CS5520 is not set
506# CONFIG_BLK_DEV_CS5530 is not set
507# CONFIG_BLK_DEV_HPT366 is not set
508# CONFIG_BLK_DEV_JMICRON is not set
509# CONFIG_BLK_DEV_SC1200 is not set
510# CONFIG_BLK_DEV_PIIX is not set
511# CONFIG_BLK_DEV_IT8172 is not set
512# CONFIG_BLK_DEV_IT8213 is not set
513# CONFIG_BLK_DEV_IT821X is not set
514# CONFIG_BLK_DEV_NS87415 is not set
515# CONFIG_BLK_DEV_PDC202XX_OLD is not set
516# CONFIG_BLK_DEV_PDC202XX_NEW is not set
517# CONFIG_BLK_DEV_SVWKS is not set
518CONFIG_BLK_DEV_SIIMAGE=y
519# CONFIG_BLK_DEV_SL82C105 is not set
520# CONFIG_BLK_DEV_SLC90E66 is not set
521# CONFIG_BLK_DEV_TRM290 is not set
522CONFIG_BLK_DEV_VIA82CXXX=y
523# CONFIG_BLK_DEV_TC86C001 is not set
524CONFIG_BLK_DEV_IDEDMA=y
525
526#
527# SCSI device support
528#
529# CONFIG_RAID_ATTRS is not set
530CONFIG_SCSI=y
531CONFIG_SCSI_DMA=y
532# CONFIG_SCSI_TGT is not set
533# CONFIG_SCSI_NETLINK is not set
534CONFIG_SCSI_PROC_FS=y
535
536#
537# SCSI support type (disk, tape, CD-ROM)
538#
539CONFIG_BLK_DEV_SD=y
540CONFIG_CHR_DEV_ST=y
541# CONFIG_CHR_DEV_OSST is not set
542CONFIG_BLK_DEV_SR=y
543CONFIG_BLK_DEV_SR_VENDOR=y
544CONFIG_CHR_DEV_SG=y
545# CONFIG_CHR_DEV_SCH is not set
546
547#
548# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
549#
550# CONFIG_SCSI_MULTI_LUN is not set
551CONFIG_SCSI_CONSTANTS=y
552# CONFIG_SCSI_LOGGING is not set
553# CONFIG_SCSI_SCAN_ASYNC is not set
554CONFIG_SCSI_WAIT_SCAN=m
555
556#
557# SCSI Transports
558#
559CONFIG_SCSI_SPI_ATTRS=y
560# CONFIG_SCSI_FC_ATTRS is not set
561# CONFIG_SCSI_ISCSI_ATTRS is not set
562# CONFIG_SCSI_SAS_LIBSAS is not set
563# CONFIG_SCSI_SRP_ATTRS is not set
564CONFIG_SCSI_LOWLEVEL=y
565# CONFIG_ISCSI_TCP is not set
566# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
567# CONFIG_SCSI_3W_9XXX is not set
568# CONFIG_SCSI_ACARD is not set
569# CONFIG_SCSI_AACRAID is not set
570# CONFIG_SCSI_AIC7XXX is not set
571# CONFIG_SCSI_AIC7XXX_OLD is not set
572# CONFIG_SCSI_AIC79XX is not set
573# CONFIG_SCSI_AIC94XX is not set
574# CONFIG_SCSI_DPT_I2O is not set
575# CONFIG_SCSI_ADVANSYS is not set
576# CONFIG_SCSI_ARCMSR is not set
577# CONFIG_MEGARAID_NEWGEN is not set
578# CONFIG_MEGARAID_LEGACY is not set
579# CONFIG_MEGARAID_SAS is not set
580# CONFIG_SCSI_HPTIOP is not set
581# CONFIG_SCSI_BUSLOGIC is not set
582# CONFIG_LIBFC is not set
583# CONFIG_FCOE is not set
584# CONFIG_SCSI_DMX3191D is not set
585# CONFIG_SCSI_EATA is not set
586# CONFIG_SCSI_FUTURE_DOMAIN is not set
587# CONFIG_SCSI_GDTH is not set
588# CONFIG_SCSI_IPS is not set
589# CONFIG_SCSI_INITIO is not set
590# CONFIG_SCSI_INIA100 is not set
591# CONFIG_SCSI_PPA is not set
592# CONFIG_SCSI_IMM is not set
593# CONFIG_SCSI_MVSAS is not set
594# CONFIG_SCSI_STEX is not set
595CONFIG_SCSI_SYM53C8XX_2=y
596CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0
597CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
598CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
599# CONFIG_SCSI_SYM53C8XX_MMIO is not set
600# CONFIG_SCSI_QLOGIC_1280 is not set
601# CONFIG_SCSI_QLA_FC is not set
602# CONFIG_SCSI_QLA_ISCSI is not set
603# CONFIG_SCSI_LPFC is not set
604# CONFIG_SCSI_DC395x is not set
605# CONFIG_SCSI_DC390T is not set
606# CONFIG_SCSI_NSP32 is not set
607# CONFIG_SCSI_DEBUG is not set
608# CONFIG_SCSI_SRP is not set
609# CONFIG_SCSI_DH is not set
610# CONFIG_ATA is not set
611# CONFIG_MD is not set
612# CONFIG_FUSION is not set
613
614#
615# IEEE 1394 (FireWire) support
616#
617
618#
619# Enable only one of the two stacks, unless you know what you are doing
620#
621# CONFIG_FIREWIRE is not set
622# CONFIG_IEEE1394 is not set
623# CONFIG_I2O is not set
624# CONFIG_MACINTOSH_DRIVERS is not set
625CONFIG_NETDEVICES=y
626# CONFIG_DUMMY is not set
627# CONFIG_BONDING is not set
628# CONFIG_MACVLAN is not set
629# CONFIG_EQUALIZER is not set
630# CONFIG_TUN is not set
631# CONFIG_VETH is not set
632# CONFIG_ARCNET is not set
633CONFIG_PHYLIB=y
634
635#
636# MII PHY device drivers
637#
638# CONFIG_MARVELL_PHY is not set
639# CONFIG_DAVICOM_PHY is not set
640# CONFIG_QSEMI_PHY is not set
641# CONFIG_LXT_PHY is not set
642# CONFIG_CICADA_PHY is not set
643# CONFIG_VITESSE_PHY is not set
644# CONFIG_SMSC_PHY is not set
645# CONFIG_BROADCOM_PHY is not set
646# CONFIG_ICPLUS_PHY is not set
647# CONFIG_REALTEK_PHY is not set
648# CONFIG_NATIONAL_PHY is not set
649# CONFIG_STE10XP is not set
650# CONFIG_LSI_ET1011C_PHY is not set
651# CONFIG_FIXED_PHY is not set
652# CONFIG_MDIO_BITBANG is not set
653CONFIG_NET_ETHERNET=y
654CONFIG_MII=y
655# CONFIG_HAPPYMEAL is not set
656# CONFIG_SUNGEM is not set
657# CONFIG_CASSINI is not set
658CONFIG_NET_VENDOR_3COM=y
659CONFIG_VORTEX=y
660# CONFIG_TYPHOON is not set
661# CONFIG_NET_TULIP is not set
662# CONFIG_HP100 is not set
663# CONFIG_IBM_NEW_EMAC_ZMII is not set
664# CONFIG_IBM_NEW_EMAC_RGMII is not set
665# CONFIG_IBM_NEW_EMAC_TAH is not set
666# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
667# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
668# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
669# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
670CONFIG_NET_PCI=y
671# CONFIG_PCNET32 is not set
672# CONFIG_AMD8111_ETH is not set
673# CONFIG_ADAPTEC_STARFIRE is not set
674# CONFIG_B44 is not set
675# CONFIG_FORCEDETH is not set
676# CONFIG_E100 is not set
677# CONFIG_FEALNX is not set
678# CONFIG_NATSEMI is not set
679# CONFIG_NE2K_PCI is not set
680CONFIG_8139CP=y
681CONFIG_8139TOO=y
682CONFIG_8139TOO_PIO=y
683# CONFIG_8139TOO_TUNE_TWISTER is not set
684# CONFIG_8139TOO_8129 is not set
685# CONFIG_8139_OLD_RX_RESET is not set
686# CONFIG_R6040 is not set
687# CONFIG_SIS900 is not set
688# CONFIG_EPIC100 is not set
689# CONFIG_SMSC9420 is not set
690# CONFIG_SUNDANCE is not set
691# CONFIG_TLAN is not set
692# CONFIG_VIA_RHINE is not set
693# CONFIG_SC92031 is not set
694# CONFIG_NET_POCKET is not set
695# CONFIG_ATL2 is not set
696# CONFIG_NETDEV_1000 is not set
697# CONFIG_NETDEV_10000 is not set
698# CONFIG_TR is not set
699
700#
701# Wireless LAN
702#
703# CONFIG_WLAN_PRE80211 is not set
704# CONFIG_WLAN_80211 is not set
705# CONFIG_IWLWIFI_LEDS is not set
706
707#
708# Enable WiMAX (Networking options) to see the WiMAX drivers
709#
710
711#
712# USB Network Adapters
713#
714# CONFIG_USB_CATC is not set
715# CONFIG_USB_KAWETH is not set
716# CONFIG_USB_PEGASUS is not set
717# CONFIG_USB_RTL8150 is not set
718# CONFIG_USB_USBNET is not set
719# CONFIG_WAN is not set
720# CONFIG_FDDI is not set
721# CONFIG_HIPPI is not set
722# CONFIG_PLIP is not set
723CONFIG_PPP=m
724CONFIG_PPP_MULTILINK=y
725CONFIG_PPP_FILTER=y
726CONFIG_PPP_ASYNC=m
727CONFIG_PPP_SYNC_TTY=m
728CONFIG_PPP_DEFLATE=m
729CONFIG_PPP_BSDCOMP=m
730CONFIG_PPP_MPPE=m
731CONFIG_PPPOE=m
732# CONFIG_PPPOL2TP is not set
733# CONFIG_SLIP is not set
734CONFIG_SLHC=m
735# CONFIG_NET_FC is not set
736# CONFIG_NETCONSOLE is not set
737# CONFIG_NETPOLL is not set
738# CONFIG_NET_POLL_CONTROLLER is not set
739# CONFIG_ISDN is not set
740# CONFIG_PHONE is not set
741
742#
743# Input device support
744#
745CONFIG_INPUT=y
746# CONFIG_INPUT_FF_MEMLESS is not set
747# CONFIG_INPUT_POLLDEV is not set
748
749#
750# Userland interfaces
751#
752CONFIG_INPUT_MOUSEDEV=y
753CONFIG_INPUT_MOUSEDEV_PSAUX=y
754CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
755CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
756# CONFIG_INPUT_JOYDEV is not set
757CONFIG_INPUT_EVDEV=y
758# CONFIG_INPUT_EVBUG is not set
759
760#
761# Input Device Drivers
762#
763CONFIG_INPUT_KEYBOARD=y
764CONFIG_KEYBOARD_ATKBD=y
765# CONFIG_KEYBOARD_SUNKBD is not set
766# CONFIG_KEYBOARD_LKKBD is not set
767# CONFIG_KEYBOARD_XTKBD is not set
768# CONFIG_KEYBOARD_NEWTON is not set
769# CONFIG_KEYBOARD_STOWAWAY is not set
770CONFIG_INPUT_MOUSE=y
771CONFIG_MOUSE_PS2=y
772CONFIG_MOUSE_PS2_ALPS=y
773CONFIG_MOUSE_PS2_LOGIPS2PP=y
774CONFIG_MOUSE_PS2_SYNAPTICS=y
775CONFIG_MOUSE_PS2_LIFEBOOK=y
776CONFIG_MOUSE_PS2_TRACKPOINT=y
777# CONFIG_MOUSE_PS2_ELANTECH is not set
778# CONFIG_MOUSE_PS2_TOUCHKIT is not set
779# CONFIG_MOUSE_SERIAL is not set
780# CONFIG_MOUSE_APPLETOUCH is not set
781# CONFIG_MOUSE_BCM5974 is not set
782# CONFIG_MOUSE_VSXXXAA is not set
783# CONFIG_INPUT_JOYSTICK is not set
784# CONFIG_INPUT_TABLET is not set
785# CONFIG_INPUT_TOUCHSCREEN is not set
786CONFIG_INPUT_MISC=y
787CONFIG_INPUT_PCSPKR=y
788# CONFIG_INPUT_ATI_REMOTE is not set
789# CONFIG_INPUT_ATI_REMOTE2 is not set
790# CONFIG_INPUT_KEYSPAN_REMOTE is not set
791# CONFIG_INPUT_POWERMATE is not set
792# CONFIG_INPUT_YEALINK is not set
793# CONFIG_INPUT_CM109 is not set
794CONFIG_INPUT_UINPUT=y
795
796#
797# Hardware I/O ports
798#
799CONFIG_SERIO=y
800CONFIG_SERIO_I8042=y
801CONFIG_SERIO_SERPORT=y
802# CONFIG_SERIO_PARKBD is not set
803# CONFIG_SERIO_PCIPS2 is not set
804CONFIG_SERIO_LIBPS2=y
805# CONFIG_SERIO_RAW is not set
806# CONFIG_SERIO_XILINX_XPS_PS2 is not set
807# CONFIG_GAMEPORT is not set
808
809#
810# Character devices
811#
812CONFIG_VT=y
813CONFIG_CONSOLE_TRANSLATIONS=y
814CONFIG_VT_CONSOLE=y
815CONFIG_HW_CONSOLE=y
816# CONFIG_VT_HW_CONSOLE_BINDING is not set
817CONFIG_DEVKMEM=y
818# CONFIG_SERIAL_NONSTANDARD is not set
819# CONFIG_NOZOMI is not set
820
821#
822# Serial drivers
823#
824CONFIG_SERIAL_8250=y
825CONFIG_SERIAL_8250_CONSOLE=y
826CONFIG_SERIAL_8250_PCI=y
827CONFIG_SERIAL_8250_NR_UARTS=4
828CONFIG_SERIAL_8250_RUNTIME_UARTS=4
829# CONFIG_SERIAL_8250_EXTENDED is not set
830
831#
832# Non-8250 serial port support
833#
834# CONFIG_SERIAL_UARTLITE is not set
835CONFIG_SERIAL_CORE=y
836CONFIG_SERIAL_CORE_CONSOLE=y
837# CONFIG_SERIAL_JSM is not set
838# CONFIG_SERIAL_OF_PLATFORM is not set
839CONFIG_UNIX98_PTYS=y
840# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
841CONFIG_LEGACY_PTYS=y
842CONFIG_LEGACY_PTY_COUNT=256
843# CONFIG_PRINTER is not set
844# CONFIG_PPDEV is not set
845# CONFIG_HVC_UDBG is not set
846# CONFIG_IPMI_HANDLER is not set
847# CONFIG_HW_RANDOM is not set
848# CONFIG_NVRAM is not set
849# CONFIG_R3964 is not set
850# CONFIG_APPLICOM is not set
851# CONFIG_RAW_DRIVER is not set
852# CONFIG_TCG_TPM is not set
853CONFIG_DEVPORT=y
854CONFIG_I2C=y
855CONFIG_I2C_BOARDINFO=y
856# CONFIG_I2C_CHARDEV is not set
857CONFIG_I2C_HELPER_AUTO=y
858CONFIG_I2C_ALGOBIT=y
859
860#
861# I2C Hardware Bus support
862#
863
864#
865# PC SMBus host controller drivers
866#
867# CONFIG_I2C_ALI1535 is not set
868# CONFIG_I2C_ALI1563 is not set
869# CONFIG_I2C_ALI15X3 is not set
870# CONFIG_I2C_AMD756 is not set
871# CONFIG_I2C_AMD8111 is not set
872# CONFIG_I2C_I801 is not set
873# CONFIG_I2C_ISCH is not set
874# CONFIG_I2C_PIIX4 is not set
875# CONFIG_I2C_NFORCE2 is not set
876# CONFIG_I2C_SIS5595 is not set
877# CONFIG_I2C_SIS630 is not set
878# CONFIG_I2C_SIS96X is not set
879# CONFIG_I2C_VIA is not set
880# CONFIG_I2C_VIAPRO is not set
881
882#
883# I2C system bus drivers (mostly embedded / system-on-chip)
884#
885# CONFIG_I2C_MPC is not set
886# CONFIG_I2C_OCORES is not set
887# CONFIG_I2C_SIMTEC is not set
888
889#
890# External I2C/SMBus adapter drivers
891#
892# CONFIG_I2C_PARPORT is not set
893# CONFIG_I2C_PARPORT_LIGHT is not set
894# CONFIG_I2C_TAOS_EVM is not set
895# CONFIG_I2C_TINY_USB is not set
896
897#
898# Graphics adapter I2C/DDC channel drivers
899#
900# CONFIG_I2C_VOODOO3 is not set
901
902#
903# Other I2C/SMBus bus drivers
904#
905# CONFIG_I2C_PCA_PLATFORM is not set
906# CONFIG_I2C_STUB is not set
907
908#
909# Miscellaneous I2C Chip support
910#
911# CONFIG_DS1682 is not set
912# CONFIG_SENSORS_PCF8574 is not set
913# CONFIG_PCF8575 is not set
914# CONFIG_SENSORS_PCA9539 is not set
915# CONFIG_SENSORS_PCF8591 is not set
916# CONFIG_SENSORS_MAX6875 is not set
917# CONFIG_SENSORS_TSL2550 is not set
918# CONFIG_I2C_DEBUG_CORE is not set
919# CONFIG_I2C_DEBUG_ALGO is not set
920# CONFIG_I2C_DEBUG_BUS is not set
921# CONFIG_I2C_DEBUG_CHIP is not set
922# CONFIG_SPI is not set
923CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
924# CONFIG_GPIOLIB is not set
925# CONFIG_W1 is not set
926# CONFIG_POWER_SUPPLY is not set
927# CONFIG_HWMON is not set
928# CONFIG_THERMAL is not set
929# CONFIG_THERMAL_HWMON is not set
930# CONFIG_WATCHDOG is not set
931CONFIG_SSB_POSSIBLE=y
932
933#
934# Sonics Silicon Backplane
935#
936# CONFIG_SSB is not set
937
938#
939# Multifunction device drivers
940#
941# CONFIG_MFD_CORE is not set
942# CONFIG_MFD_SM501 is not set
943# CONFIG_HTC_PASIC3 is not set
944# CONFIG_TWL4030_CORE is not set
945# CONFIG_MFD_TMIO is not set
946# CONFIG_PMIC_DA903X is not set
947# CONFIG_MFD_WM8400 is not set
948# CONFIG_MFD_WM8350_I2C is not set
949# CONFIG_MFD_PCF50633 is not set
950# CONFIG_REGULATOR is not set
951
952#
953# Multimedia devices
954#
955
956#
957# Multimedia core support
958#
959# CONFIG_VIDEO_DEV is not set
960# CONFIG_DVB_CORE is not set
961# CONFIG_VIDEO_MEDIA is not set
962
963#
964# Multimedia drivers
965#
966# CONFIG_DAB is not set
967
968#
969# Graphics support
970#
971# CONFIG_AGP is not set
972# CONFIG_DRM is not set
973# CONFIG_VGASTATE is not set
974# CONFIG_VIDEO_OUTPUT_CONTROL is not set
975CONFIG_FB=y
976CONFIG_FIRMWARE_EDID=y
977CONFIG_FB_DDC=y
978# CONFIG_FB_BOOT_VESA_SUPPORT is not set
979CONFIG_FB_CFB_FILLRECT=y
980CONFIG_FB_CFB_COPYAREA=y
981CONFIG_FB_CFB_IMAGEBLIT=y
982# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
983# CONFIG_FB_SYS_FILLRECT is not set
984# CONFIG_FB_SYS_COPYAREA is not set
985# CONFIG_FB_SYS_IMAGEBLIT is not set
986# CONFIG_FB_FOREIGN_ENDIAN is not set
987# CONFIG_FB_SYS_FOPS is not set
988# CONFIG_FB_SVGALIB is not set
989CONFIG_FB_MACMODES=y
990CONFIG_FB_BACKLIGHT=y
991CONFIG_FB_MODE_HELPERS=y
992CONFIG_FB_TILEBLITTING=y
993
994#
995# Frame buffer hardware drivers
996#
997# CONFIG_FB_CIRRUS is not set
998# CONFIG_FB_PM2 is not set
999# CONFIG_FB_CYBER2000 is not set
1000# CONFIG_FB_OF is not set
1001# CONFIG_FB_CT65550 is not set
1002# CONFIG_FB_ASILIANT is not set
1003# CONFIG_FB_IMSTT is not set
1004# CONFIG_FB_VGA16 is not set
1005# CONFIG_FB_S1D13XXX is not set
1006# CONFIG_FB_NVIDIA is not set
1007# CONFIG_FB_RIVA is not set
1008# CONFIG_FB_MATROX is not set
1009CONFIG_FB_RADEON=y
1010CONFIG_FB_RADEON_I2C=y
1011CONFIG_FB_RADEON_BACKLIGHT=y
1012# CONFIG_FB_RADEON_DEBUG is not set
1013# CONFIG_FB_ATY128 is not set
1014# CONFIG_FB_ATY is not set
1015# CONFIG_FB_S3 is not set
1016# CONFIG_FB_SAVAGE is not set
1017# CONFIG_FB_SIS is not set
1018# CONFIG_FB_VIA is not set
1019# CONFIG_FB_NEOMAGIC is not set
1020# CONFIG_FB_KYRO is not set
1021CONFIG_FB_3DFX=y
1022# CONFIG_FB_3DFX_ACCEL is not set
1023# CONFIG_FB_VOODOO1 is not set
1024# CONFIG_FB_VT8623 is not set
1025# CONFIG_FB_TRIDENT is not set
1026# CONFIG_FB_ARK is not set
1027# CONFIG_FB_PM3 is not set
1028# CONFIG_FB_CARMINE is not set
1029# CONFIG_FB_IBM_GXT4500 is not set
1030# CONFIG_FB_VIRTUAL is not set
1031# CONFIG_FB_METRONOME is not set
1032# CONFIG_FB_MB862XX is not set
1033CONFIG_BACKLIGHT_LCD_SUPPORT=y
1034CONFIG_LCD_CLASS_DEVICE=m
1035# CONFIG_LCD_ILI9320 is not set
1036# CONFIG_LCD_PLATFORM is not set
1037CONFIG_BACKLIGHT_CLASS_DEVICE=y
1038CONFIG_BACKLIGHT_GENERIC=y
1039
1040#
1041# Display device support
1042#
1043CONFIG_DISPLAY_SUPPORT=m
1044
1045#
1046# Display hardware drivers
1047#
1048
1049#
1050# Console display driver support
1051#
1052CONFIG_VGA_CONSOLE=y
1053# CONFIG_VGACON_SOFT_SCROLLBACK is not set
1054CONFIG_DUMMY_CONSOLE=y
1055CONFIG_FRAMEBUFFER_CONSOLE=y
1056# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
1057# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
1058# CONFIG_FONTS is not set
1059CONFIG_FONT_8x8=y
1060CONFIG_FONT_8x16=y
1061CONFIG_LOGO=y
1062CONFIG_LOGO_LINUX_MONO=y
1063CONFIG_LOGO_LINUX_VGA16=y
1064CONFIG_LOGO_LINUX_CLUT224=y
1065# CONFIG_SOUND is not set
1066CONFIG_HID_SUPPORT=y
1067CONFIG_HID=y
1068# CONFIG_HID_DEBUG is not set
1069# CONFIG_HIDRAW is not set
1070
1071#
1072# USB Input Devices
1073#
1074CONFIG_USB_HID=y
1075# CONFIG_HID_PID is not set
1076# CONFIG_USB_HIDDEV is not set
1077
1078#
1079# Special HID drivers
1080#
1081CONFIG_HID_COMPAT=y
1082CONFIG_HID_A4TECH=y
1083CONFIG_HID_APPLE=y
1084CONFIG_HID_BELKIN=y
1085CONFIG_HID_CHERRY=y
1086CONFIG_HID_CHICONY=y
1087CONFIG_HID_CYPRESS=y
1088CONFIG_HID_EZKEY=y
1089CONFIG_HID_GYRATION=y
1090CONFIG_HID_LOGITECH=y
1091# CONFIG_LOGITECH_FF is not set
1092# CONFIG_LOGIRUMBLEPAD2_FF is not set
1093CONFIG_HID_MICROSOFT=y
1094CONFIG_HID_MONTEREY=y
1095CONFIG_HID_NTRIG=y
1096CONFIG_HID_PANTHERLORD=y
1097# CONFIG_PANTHERLORD_FF is not set
1098CONFIG_HID_PETALYNX=y
1099CONFIG_HID_SAMSUNG=y
1100CONFIG_HID_SONY=y
1101CONFIG_HID_SUNPLUS=y
1102# CONFIG_GREENASIA_FF is not set
1103CONFIG_HID_TOPSEED=y
1104# CONFIG_THRUSTMASTER_FF is not set
1105# CONFIG_ZEROPLUS_FF is not set
1106CONFIG_USB_SUPPORT=y
1107CONFIG_USB_ARCH_HAS_HCD=y
1108CONFIG_USB_ARCH_HAS_OHCI=y
1109CONFIG_USB_ARCH_HAS_EHCI=y
1110CONFIG_USB=y
1111# CONFIG_USB_DEBUG is not set
1112# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
1113
1114#
1115# Miscellaneous USB options
1116#
1117CONFIG_USB_DEVICEFS=y
1118CONFIG_USB_DEVICE_CLASS=y
1119# CONFIG_USB_DYNAMIC_MINORS is not set
1120# CONFIG_USB_OTG is not set
1121CONFIG_USB_MON=y
1122# CONFIG_USB_WUSB is not set
1123# CONFIG_USB_WUSB_CBAF is not set
1124
1125#
1126# USB Host Controller Drivers
1127#
1128# CONFIG_USB_C67X00_HCD is not set
1129# CONFIG_USB_EHCI_HCD is not set
1130# CONFIG_USB_OXU210HP_HCD is not set
1131# CONFIG_USB_ISP116X_HCD is not set
1132# CONFIG_USB_ISP1760_HCD is not set
1133CONFIG_USB_OHCI_HCD=y
1134# CONFIG_USB_OHCI_HCD_PPC_OF is not set
1135# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
1136# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
1137CONFIG_USB_OHCI_LITTLE_ENDIAN=y
1138CONFIG_USB_UHCI_HCD=y
1139# CONFIG_USB_SL811_HCD is not set
1140# CONFIG_USB_R8A66597_HCD is not set
1141# CONFIG_USB_WHCI_HCD is not set
1142# CONFIG_USB_HWA_HCD is not set
1143
1144#
1145# USB Device Class drivers
1146#
1147# CONFIG_USB_ACM is not set
1148# CONFIG_USB_PRINTER is not set
1149# CONFIG_USB_WDM is not set
1150# CONFIG_USB_TMC is not set
1151
1152#
1153# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
1154#
1155
1156#
1157# see USB_STORAGE Help for more information
1158#
1159CONFIG_USB_STORAGE=m
1160# CONFIG_USB_STORAGE_DEBUG is not set
1161# CONFIG_USB_STORAGE_DATAFAB is not set
1162# CONFIG_USB_STORAGE_FREECOM is not set
1163# CONFIG_USB_STORAGE_ISD200 is not set
1164# CONFIG_USB_STORAGE_USBAT is not set
1165# CONFIG_USB_STORAGE_SDDR09 is not set
1166# CONFIG_USB_STORAGE_SDDR55 is not set
1167# CONFIG_USB_STORAGE_JUMPSHOT is not set
1168# CONFIG_USB_STORAGE_ALAUDA is not set
1169# CONFIG_USB_STORAGE_ONETOUCH is not set
1170# CONFIG_USB_STORAGE_KARMA is not set
1171# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
1172# CONFIG_USB_LIBUSUAL is not set
1173
1174#
1175# USB Imaging devices
1176#
1177# CONFIG_USB_MDC800 is not set
1178# CONFIG_USB_MICROTEK is not set
1179
1180#
1181# USB port drivers
1182#
1183# CONFIG_USB_USS720 is not set
1184# CONFIG_USB_SERIAL is not set
1185
1186#
1187# USB Miscellaneous drivers
1188#
1189# CONFIG_USB_EMI62 is not set
1190# CONFIG_USB_EMI26 is not set
1191# CONFIG_USB_ADUTUX is not set
1192# CONFIG_USB_SEVSEG is not set
1193# CONFIG_USB_RIO500 is not set
1194# CONFIG_USB_LEGOTOWER is not set
1195# CONFIG_USB_LCD is not set
1196# CONFIG_USB_BERRY_CHARGE is not set
1197# CONFIG_USB_LED is not set
1198# CONFIG_USB_CYPRESS_CY7C63 is not set
1199# CONFIG_USB_CYTHERM is not set
1200# CONFIG_USB_PHIDGET is not set
1201# CONFIG_USB_IDMOUSE is not set
1202# CONFIG_USB_FTDI_ELAN is not set
1203# CONFIG_USB_APPLEDISPLAY is not set
1204# CONFIG_USB_LD is not set
1205# CONFIG_USB_TRANCEVIBRATOR is not set
1206# CONFIG_USB_IOWARRIOR is not set
1207# CONFIG_USB_TEST is not set
1208# CONFIG_USB_ISIGHTFW is not set
1209# CONFIG_USB_VST is not set
1210# CONFIG_USB_GADGET is not set
1211
1212#
1213# OTG and related infrastructure
1214#
1215# CONFIG_UWB is not set
1216# CONFIG_MMC is not set
1217# CONFIG_MEMSTICK is not set
1218# CONFIG_NEW_LEDS is not set
1219# CONFIG_ACCESSIBILITY is not set
1220# CONFIG_INFINIBAND is not set
1221# CONFIG_EDAC is not set
1222CONFIG_RTC_LIB=y
1223CONFIG_RTC_CLASS=y
1224CONFIG_RTC_HCTOSYS=y
1225CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
1226# CONFIG_RTC_DEBUG is not set
1227
1228#
1229# RTC interfaces
1230#
1231CONFIG_RTC_INTF_SYSFS=y
1232CONFIG_RTC_INTF_PROC=y
1233CONFIG_RTC_INTF_DEV=y
1234# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
1235# CONFIG_RTC_DRV_TEST is not set
1236
1237#
1238# I2C RTC drivers
1239#
1240# CONFIG_RTC_DRV_DS1307 is not set
1241# CONFIG_RTC_DRV_DS1374 is not set
1242# CONFIG_RTC_DRV_DS1672 is not set
1243# CONFIG_RTC_DRV_MAX6900 is not set
1244# CONFIG_RTC_DRV_RS5C372 is not set
1245# CONFIG_RTC_DRV_ISL1208 is not set
1246# CONFIG_RTC_DRV_X1205 is not set
1247# CONFIG_RTC_DRV_PCF8563 is not set
1248# CONFIG_RTC_DRV_PCF8583 is not set
1249# CONFIG_RTC_DRV_M41T80 is not set
1250# CONFIG_RTC_DRV_S35390A is not set
1251# CONFIG_RTC_DRV_FM3130 is not set
1252# CONFIG_RTC_DRV_RX8581 is not set
1253
1254#
1255# SPI RTC drivers
1256#
1257
1258#
1259# Platform RTC drivers
1260#
1261CONFIG_RTC_DRV_CMOS=y
1262# CONFIG_RTC_DRV_DS1286 is not set
1263# CONFIG_RTC_DRV_DS1511 is not set
1264# CONFIG_RTC_DRV_DS1553 is not set
1265# CONFIG_RTC_DRV_DS1742 is not set
1266# CONFIG_RTC_DRV_STK17TA8 is not set
1267# CONFIG_RTC_DRV_M48T86 is not set
1268# CONFIG_RTC_DRV_M48T35 is not set
1269# CONFIG_RTC_DRV_M48T59 is not set
1270# CONFIG_RTC_DRV_BQ4802 is not set
1271# CONFIG_RTC_DRV_V3020 is not set
1272
1273#
1274# on-CPU RTC drivers
1275#
1276# CONFIG_RTC_DRV_PPC is not set
1277# CONFIG_DMADEVICES is not set
1278# CONFIG_AUXDISPLAY is not set
1279# CONFIG_UIO is not set
1280# CONFIG_STAGING is not set
1281
1282#
1283# File systems
1284#
1285CONFIG_EXT2_FS=y
1286# CONFIG_EXT2_FS_XATTR is not set
1287# CONFIG_EXT2_FS_XIP is not set
1288CONFIG_EXT3_FS=y
1289CONFIG_EXT3_FS_XATTR=y
1290# CONFIG_EXT3_FS_POSIX_ACL is not set
1291# CONFIG_EXT3_FS_SECURITY is not set
1292CONFIG_EXT4_FS=y
1293# CONFIG_EXT4DEV_COMPAT is not set
1294CONFIG_EXT4_FS_XATTR=y
1295# CONFIG_EXT4_FS_POSIX_ACL is not set
1296# CONFIG_EXT4_FS_SECURITY is not set
1297CONFIG_JBD=y
1298CONFIG_JBD2=y
1299CONFIG_FS_MBCACHE=y
1300# CONFIG_REISERFS_FS is not set
1301# CONFIG_JFS_FS is not set
1302# CONFIG_FS_POSIX_ACL is not set
1303CONFIG_FILE_LOCKING=y
1304# CONFIG_XFS_FS is not set
1305# CONFIG_GFS2_FS is not set
1306# CONFIG_OCFS2_FS is not set
1307# CONFIG_BTRFS_FS is not set
1308CONFIG_DNOTIFY=y
1309CONFIG_INOTIFY=y
1310CONFIG_INOTIFY_USER=y
1311# CONFIG_QUOTA is not set
1312# CONFIG_AUTOFS_FS is not set
1313# CONFIG_AUTOFS4_FS is not set
1314# CONFIG_FUSE_FS is not set
1315
1316#
1317# CD-ROM/DVD Filesystems
1318#
1319CONFIG_ISO9660_FS=y
1320# CONFIG_JOLIET is not set
1321# CONFIG_ZISOFS is not set
1322# CONFIG_UDF_FS is not set
1323
1324#
1325# DOS/FAT/NT Filesystems
1326#
1327CONFIG_FAT_FS=m
1328CONFIG_MSDOS_FS=m
1329CONFIG_VFAT_FS=m
1330CONFIG_FAT_DEFAULT_CODEPAGE=437
1331CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1332# CONFIG_NTFS_FS is not set
1333
1334#
1335# Pseudo filesystems
1336#
1337CONFIG_PROC_FS=y
1338CONFIG_PROC_KCORE=y
1339CONFIG_PROC_SYSCTL=y
1340CONFIG_PROC_PAGE_MONITOR=y
1341CONFIG_SYSFS=y
1342CONFIG_TMPFS=y
1343# CONFIG_TMPFS_POSIX_ACL is not set
1344# CONFIG_HUGETLB_PAGE is not set
1345# CONFIG_CONFIGFS_FS is not set
1346CONFIG_MISC_FILESYSTEMS=y
1347# CONFIG_ADFS_FS is not set
1348CONFIG_AFFS_FS=m
1349# CONFIG_HFS_FS is not set
1350# CONFIG_HFSPLUS_FS is not set
1351# CONFIG_BEFS_FS is not set
1352# CONFIG_BFS_FS is not set
1353# CONFIG_EFS_FS is not set
1354# CONFIG_CRAMFS is not set
1355# CONFIG_SQUASHFS is not set
1356# CONFIG_VXFS_FS is not set
1357# CONFIG_MINIX_FS is not set
1358# CONFIG_OMFS_FS is not set
1359# CONFIG_HPFS_FS is not set
1360# CONFIG_QNX4FS_FS is not set
1361# CONFIG_ROMFS_FS is not set
1362# CONFIG_SYSV_FS is not set
1363# CONFIG_UFS_FS is not set
1364CONFIG_NETWORK_FILESYSTEMS=y
1365# CONFIG_NFS_FS is not set
1366# CONFIG_NFSD is not set
1367# CONFIG_SMB_FS is not set
1368# CONFIG_CIFS is not set
1369# CONFIG_NCP_FS is not set
1370# CONFIG_CODA_FS is not set
1371# CONFIG_AFS_FS is not set
1372
1373#
1374# Partition Types
1375#
1376CONFIG_PARTITION_ADVANCED=y
1377# CONFIG_ACORN_PARTITION is not set
1378# CONFIG_OSF_PARTITION is not set
1379CONFIG_AMIGA_PARTITION=y
1380# CONFIG_ATARI_PARTITION is not set
1381# CONFIG_MAC_PARTITION is not set
1382CONFIG_MSDOS_PARTITION=y
1383# CONFIG_BSD_DISKLABEL is not set
1384# CONFIG_MINIX_SUBPARTITION is not set
1385# CONFIG_SOLARIS_X86_PARTITION is not set
1386# CONFIG_UNIXWARE_DISKLABEL is not set
1387# CONFIG_LDM_PARTITION is not set
1388# CONFIG_SGI_PARTITION is not set
1389# CONFIG_ULTRIX_PARTITION is not set
1390# CONFIG_SUN_PARTITION is not set
1391# CONFIG_KARMA_PARTITION is not set
1392# CONFIG_EFI_PARTITION is not set
1393# CONFIG_SYSV68_PARTITION is not set
1394CONFIG_NLS=y
1395CONFIG_NLS_DEFAULT="iso8859-1"
1396# CONFIG_NLS_CODEPAGE_437 is not set
1397# CONFIG_NLS_CODEPAGE_737 is not set
1398# CONFIG_NLS_CODEPAGE_775 is not set
1399# CONFIG_NLS_CODEPAGE_850 is not set
1400# CONFIG_NLS_CODEPAGE_852 is not set
1401# CONFIG_NLS_CODEPAGE_855 is not set
1402# CONFIG_NLS_CODEPAGE_857 is not set
1403# CONFIG_NLS_CODEPAGE_860 is not set
1404# CONFIG_NLS_CODEPAGE_861 is not set
1405# CONFIG_NLS_CODEPAGE_862 is not set
1406# CONFIG_NLS_CODEPAGE_863 is not set
1407# CONFIG_NLS_CODEPAGE_864 is not set
1408# CONFIG_NLS_CODEPAGE_865 is not set
1409# CONFIG_NLS_CODEPAGE_866 is not set
1410# CONFIG_NLS_CODEPAGE_869 is not set
1411# CONFIG_NLS_CODEPAGE_936 is not set
1412# CONFIG_NLS_CODEPAGE_950 is not set
1413# CONFIG_NLS_CODEPAGE_932 is not set
1414# CONFIG_NLS_CODEPAGE_949 is not set
1415# CONFIG_NLS_CODEPAGE_874 is not set
1416# CONFIG_NLS_ISO8859_8 is not set
1417# CONFIG_NLS_CODEPAGE_1250 is not set
1418# CONFIG_NLS_CODEPAGE_1251 is not set
1419CONFIG_NLS_ASCII=y
1420CONFIG_NLS_ISO8859_1=m
1421# CONFIG_NLS_ISO8859_2 is not set
1422# CONFIG_NLS_ISO8859_3 is not set
1423# CONFIG_NLS_ISO8859_4 is not set
1424# CONFIG_NLS_ISO8859_5 is not set
1425# CONFIG_NLS_ISO8859_6 is not set
1426# CONFIG_NLS_ISO8859_7 is not set
1427# CONFIG_NLS_ISO8859_9 is not set
1428# CONFIG_NLS_ISO8859_13 is not set
1429# CONFIG_NLS_ISO8859_14 is not set
1430# CONFIG_NLS_ISO8859_15 is not set
1431# CONFIG_NLS_KOI8_R is not set
1432# CONFIG_NLS_KOI8_U is not set
1433# CONFIG_NLS_UTF8 is not set
1434# CONFIG_DLM is not set
1435
1436#
1437# Library routines
1438#
1439CONFIG_BITREVERSE=y
1440CONFIG_GENERIC_FIND_LAST_BIT=y
1441CONFIG_CRC_CCITT=m
1442CONFIG_CRC16=y
1443CONFIG_CRC_T10DIF=y
1444# CONFIG_CRC_ITU_T is not set
1445CONFIG_CRC32=y
1446# CONFIG_CRC7 is not set
1447# CONFIG_LIBCRC32C is not set
1448CONFIG_ZLIB_INFLATE=m
1449CONFIG_ZLIB_DEFLATE=m
1450CONFIG_PLIST=y
1451CONFIG_HAS_IOMEM=y
1452CONFIG_HAS_IOPORT=y
1453CONFIG_HAS_DMA=y
1454CONFIG_HAVE_LMB=y
1455
1456#
1457# Kernel hacking
1458#
1459# CONFIG_PRINTK_TIME is not set
1460CONFIG_ENABLE_WARN_DEPRECATED=y
1461CONFIG_ENABLE_MUST_CHECK=y
1462CONFIG_FRAME_WARN=1024
1463CONFIG_MAGIC_SYSRQ=y
1464# CONFIG_UNUSED_SYMBOLS is not set
1465# CONFIG_DEBUG_FS is not set
1466# CONFIG_HEADERS_CHECK is not set
1467CONFIG_DEBUG_KERNEL=y
1468# CONFIG_DEBUG_SHIRQ is not set
1469CONFIG_DETECT_SOFTLOCKUP=y
1470# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
1471CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
1472CONFIG_SCHED_DEBUG=y
1473# CONFIG_SCHEDSTATS is not set
1474# CONFIG_TIMER_STATS is not set
1475# CONFIG_DEBUG_OBJECTS is not set
1476# CONFIG_SLUB_DEBUG_ON is not set
1477# CONFIG_SLUB_STATS is not set
1478# CONFIG_DEBUG_RT_MUTEXES is not set
1479# CONFIG_RT_MUTEX_TESTER is not set
1480# CONFIG_DEBUG_SPINLOCK is not set
1481CONFIG_DEBUG_MUTEXES=y
1482CONFIG_DEBUG_SPINLOCK_SLEEP=y
1483# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1484# CONFIG_DEBUG_KOBJECT is not set
1485# CONFIG_DEBUG_HIGHMEM is not set
1486CONFIG_DEBUG_BUGVERBOSE=y
1487# CONFIG_DEBUG_INFO is not set
1488# CONFIG_DEBUG_VM is not set
1489# CONFIG_DEBUG_WRITECOUNT is not set
1490CONFIG_DEBUG_MEMORY_INIT=y
1491# CONFIG_DEBUG_LIST is not set
1492# CONFIG_DEBUG_SG is not set
1493# CONFIG_DEBUG_NOTIFIERS is not set
1494# CONFIG_BOOT_PRINTK_DELAY is not set
1495# CONFIG_RCU_TORTURE_TEST is not set
1496# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1497# CONFIG_BACKTRACE_SELF_TEST is not set
1498# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1499# CONFIG_FAULT_INJECTION is not set
1500# CONFIG_LATENCYTOP is not set
1501CONFIG_SYSCTL_SYSCALL_CHECK=y
1502CONFIG_HAVE_FUNCTION_TRACER=y
1503CONFIG_HAVE_DYNAMIC_FTRACE=y
1504CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1505
1506#
1507# Tracers
1508#
1509# CONFIG_FUNCTION_TRACER is not set
1510# CONFIG_SCHED_TRACER is not set
1511# CONFIG_CONTEXT_SWITCH_TRACER is not set
1512# CONFIG_BOOT_TRACER is not set
1513# CONFIG_TRACE_BRANCH_PROFILING is not set
1514# CONFIG_STACK_TRACER is not set
1515# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
1516# CONFIG_SAMPLES is not set
1517CONFIG_HAVE_ARCH_KGDB=y
1518# CONFIG_KGDB is not set
1519CONFIG_PRINT_STACK_DEPTH=64
1520# CONFIG_DEBUG_STACKOVERFLOW is not set
1521# CONFIG_DEBUG_STACK_USAGE is not set
1522# CONFIG_DEBUG_PAGEALLOC is not set
1523# CONFIG_CODE_PATCHING_SELFTEST is not set
1524# CONFIG_FTR_FIXUP_SELFTEST is not set
1525# CONFIG_MSI_BITMAP_SELFTEST is not set
1526CONFIG_XMON=y
1527CONFIG_XMON_DEFAULT=y
1528CONFIG_XMON_DISASSEMBLY=y
1529CONFIG_DEBUGGER=y
1530CONFIG_IRQSTACKS=y
1531# CONFIG_BDI_SWITCH is not set
1532# CONFIG_BOOTX_TEXT is not set
1533# CONFIG_PPC_EARLY_DEBUG is not set
1534
1535#
1536# Security options
1537#
1538# CONFIG_KEYS is not set
1539# CONFIG_SECURITY is not set
1540# CONFIG_SECURITYFS is not set
1541# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1542CONFIG_CRYPTO=y
1543
1544#
1545# Crypto core or helper
1546#
1547# CONFIG_CRYPTO_FIPS is not set
1548CONFIG_CRYPTO_ALGAPI=m
1549CONFIG_CRYPTO_ALGAPI2=m
1550CONFIG_CRYPTO_AEAD2=m
1551CONFIG_CRYPTO_BLKCIPHER=m
1552CONFIG_CRYPTO_BLKCIPHER2=m
1553CONFIG_CRYPTO_HASH=m
1554CONFIG_CRYPTO_HASH2=m
1555CONFIG_CRYPTO_RNG2=m
1556CONFIG_CRYPTO_MANAGER=m
1557CONFIG_CRYPTO_MANAGER2=m
1558# CONFIG_CRYPTO_GF128MUL is not set
1559# CONFIG_CRYPTO_NULL is not set
1560# CONFIG_CRYPTO_CRYPTD is not set
1561# CONFIG_CRYPTO_AUTHENC is not set
1562# CONFIG_CRYPTO_TEST is not set
1563
1564#
1565# Authenticated Encryption with Associated Data
1566#
1567# CONFIG_CRYPTO_CCM is not set
1568# CONFIG_CRYPTO_GCM is not set
1569# CONFIG_CRYPTO_SEQIV is not set
1570
1571#
1572# Block modes
1573#
1574CONFIG_CRYPTO_CBC=m
1575# CONFIG_CRYPTO_CTR is not set
1576# CONFIG_CRYPTO_CTS is not set
1577CONFIG_CRYPTO_ECB=m
1578# CONFIG_CRYPTO_LRW is not set
1579CONFIG_CRYPTO_PCBC=m
1580# CONFIG_CRYPTO_XTS is not set
1581
1582#
1583# Hash modes
1584#
1585# CONFIG_CRYPTO_HMAC is not set
1586# CONFIG_CRYPTO_XCBC is not set
1587
1588#
1589# Digest
1590#
1591# CONFIG_CRYPTO_CRC32C is not set
1592# CONFIG_CRYPTO_MD4 is not set
1593# CONFIG_CRYPTO_MD5 is not set
1594# CONFIG_CRYPTO_MICHAEL_MIC is not set
1595# CONFIG_CRYPTO_RMD128 is not set
1596# CONFIG_CRYPTO_RMD160 is not set
1597# CONFIG_CRYPTO_RMD256 is not set
1598# CONFIG_CRYPTO_RMD320 is not set
1599CONFIG_CRYPTO_SHA1=m
1600# CONFIG_CRYPTO_SHA256 is not set
1601# CONFIG_CRYPTO_SHA512 is not set
1602# CONFIG_CRYPTO_TGR192 is not set
1603# CONFIG_CRYPTO_WP512 is not set
1604
1605#
1606# Ciphers
1607#
1608# CONFIG_CRYPTO_AES is not set
1609# CONFIG_CRYPTO_ANUBIS is not set
1610CONFIG_CRYPTO_ARC4=m
1611# CONFIG_CRYPTO_BLOWFISH is not set
1612# CONFIG_CRYPTO_CAMELLIA is not set
1613# CONFIG_CRYPTO_CAST5 is not set
1614# CONFIG_CRYPTO_CAST6 is not set
1615# CONFIG_CRYPTO_DES is not set
1616# CONFIG_CRYPTO_FCRYPT is not set
1617# CONFIG_CRYPTO_KHAZAD is not set
1618# CONFIG_CRYPTO_SALSA20 is not set
1619# CONFIG_CRYPTO_SEED is not set
1620# CONFIG_CRYPTO_SERPENT is not set
1621# CONFIG_CRYPTO_TEA is not set
1622# CONFIG_CRYPTO_TWOFISH is not set
1623
1624#
1625# Compression
1626#
1627# CONFIG_CRYPTO_DEFLATE is not set
1628# CONFIG_CRYPTO_LZO is not set
1629
1630#
1631# Random Number Generation
1632#
1633# CONFIG_CRYPTO_ANSI_CPRNG is not set
1634# CONFIG_CRYPTO_HW is not set
1635# CONFIG_PPC_CLOCK is not set
1636# CONFIG_VIRTUALIZATION is not set
diff --git a/arch/powerpc/configs/mpc5200_defconfig b/arch/powerpc/configs/mpc5200_defconfig
index 81afc8b373d7..af0cd55605d0 100644
--- a/arch/powerpc/configs/mpc5200_defconfig
+++ b/arch/powerpc/configs/mpc5200_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.29-rc2 3# Linux kernel version: 2.6.29-rc3
4# Mon Jan 26 21:40:44 2009 4# Fri Feb 6 09:48:53 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -388,7 +388,10 @@ CONFIG_MTD=y
388CONFIG_MTD_CONCAT=y 388CONFIG_MTD_CONCAT=y
389CONFIG_MTD_PARTITIONS=y 389CONFIG_MTD_PARTITIONS=y
390# CONFIG_MTD_TESTS is not set 390# CONFIG_MTD_TESTS is not set
391# CONFIG_MTD_REDBOOT_PARTS is not set 391CONFIG_MTD_REDBOOT_PARTS=y
392CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
393# CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set
394# CONFIG_MTD_REDBOOT_PARTS_READONLY is not set
392CONFIG_MTD_CMDLINE_PARTS=y 395CONFIG_MTD_CMDLINE_PARTS=y
393# CONFIG_MTD_OF_PARTS is not set 396# CONFIG_MTD_OF_PARTS is not set
394# CONFIG_MTD_AR7_PARTS is not set 397# CONFIG_MTD_AR7_PARTS is not set
@@ -502,7 +505,7 @@ CONFIG_MISC_DEVICES=y
502# 505#
503# EEPROM support 506# EEPROM support
504# 507#
505# CONFIG_EEPROM_AT24 is not set 508CONFIG_EEPROM_AT24=y
506# CONFIG_EEPROM_LEGACY is not set 509# CONFIG_EEPROM_LEGACY is not set
507# CONFIG_EEPROM_93CX6 is not set 510# CONFIG_EEPROM_93CX6 is not set
508CONFIG_HAVE_IDE=y 511CONFIG_HAVE_IDE=y
@@ -678,7 +681,7 @@ CONFIG_PHYLIB=y
678# CONFIG_MARVELL_PHY is not set 681# CONFIG_MARVELL_PHY is not set
679# CONFIG_DAVICOM_PHY is not set 682# CONFIG_DAVICOM_PHY is not set
680# CONFIG_QSEMI_PHY is not set 683# CONFIG_QSEMI_PHY is not set
681# CONFIG_LXT_PHY is not set 684CONFIG_LXT_PHY=y
682# CONFIG_CICADA_PHY is not set 685# CONFIG_CICADA_PHY is not set
683# CONFIG_VITESSE_PHY is not set 686# CONFIG_VITESSE_PHY is not set
684# CONFIG_SMSC_PHY is not set 687# CONFIG_SMSC_PHY is not set
@@ -815,8 +818,6 @@ CONFIG_LEGACY_PTY_COUNT=256
815# CONFIG_IPMI_HANDLER is not set 818# CONFIG_IPMI_HANDLER is not set
816# CONFIG_HW_RANDOM is not set 819# CONFIG_HW_RANDOM is not set
817# CONFIG_NVRAM is not set 820# CONFIG_NVRAM is not set
818CONFIG_GEN_RTC=y
819# CONFIG_GEN_RTC_X is not set
820# CONFIG_R3964 is not set 821# CONFIG_R3964 is not set
821# CONFIG_APPLICOM is not set 822# CONFIG_APPLICOM is not set
822# CONFIG_RAW_DRIVER is not set 823# CONFIG_RAW_DRIVER is not set
@@ -1281,7 +1282,61 @@ CONFIG_NEW_LEDS=y
1281# CONFIG_ACCESSIBILITY is not set 1282# CONFIG_ACCESSIBILITY is not set
1282# CONFIG_INFINIBAND is not set 1283# CONFIG_INFINIBAND is not set
1283# CONFIG_EDAC is not set 1284# CONFIG_EDAC is not set
1284# CONFIG_RTC_CLASS is not set 1285CONFIG_RTC_LIB=y
1286CONFIG_RTC_CLASS=y
1287CONFIG_RTC_HCTOSYS=y
1288CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
1289# CONFIG_RTC_DEBUG is not set
1290
1291#
1292# RTC interfaces
1293#
1294CONFIG_RTC_INTF_SYSFS=y
1295CONFIG_RTC_INTF_PROC=y
1296CONFIG_RTC_INTF_DEV=y
1297# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
1298# CONFIG_RTC_DRV_TEST is not set
1299
1300#
1301# I2C RTC drivers
1302#
1303CONFIG_RTC_DRV_DS1307=y
1304# CONFIG_RTC_DRV_DS1374 is not set
1305# CONFIG_RTC_DRV_DS1672 is not set
1306# CONFIG_RTC_DRV_MAX6900 is not set
1307# CONFIG_RTC_DRV_RS5C372 is not set
1308# CONFIG_RTC_DRV_ISL1208 is not set
1309# CONFIG_RTC_DRV_X1205 is not set
1310# CONFIG_RTC_DRV_PCF8563 is not set
1311# CONFIG_RTC_DRV_PCF8583 is not set
1312# CONFIG_RTC_DRV_M41T80 is not set
1313# CONFIG_RTC_DRV_S35390A is not set
1314# CONFIG_RTC_DRV_FM3130 is not set
1315# CONFIG_RTC_DRV_RX8581 is not set
1316
1317#
1318# SPI RTC drivers
1319#
1320
1321#
1322# Platform RTC drivers
1323#
1324# CONFIG_RTC_DRV_CMOS is not set
1325# CONFIG_RTC_DRV_DS1286 is not set
1326# CONFIG_RTC_DRV_DS1511 is not set
1327# CONFIG_RTC_DRV_DS1553 is not set
1328# CONFIG_RTC_DRV_DS1742 is not set
1329# CONFIG_RTC_DRV_STK17TA8 is not set
1330# CONFIG_RTC_DRV_M48T86 is not set
1331# CONFIG_RTC_DRV_M48T35 is not set
1332# CONFIG_RTC_DRV_M48T59 is not set
1333# CONFIG_RTC_DRV_BQ4802 is not set
1334# CONFIG_RTC_DRV_V3020 is not set
1335
1336#
1337# on-CPU RTC drivers
1338#
1339# CONFIG_RTC_DRV_PPC is not set
1285# CONFIG_DMADEVICES is not set 1340# CONFIG_DMADEVICES is not set
1286# CONFIG_UIO is not set 1341# CONFIG_UIO is not set
1287# CONFIG_STAGING is not set 1342# CONFIG_STAGING is not set
diff --git a/arch/powerpc/configs/ppc64_defconfig b/arch/powerpc/configs/ppc64_defconfig
index 88c6295b76c1..252401824575 100644
--- a/arch/powerpc/configs/ppc64_defconfig
+++ b/arch/powerpc/configs/ppc64_defconfig
@@ -2067,9 +2067,9 @@ CONFIG_DEBUG_STACKOVERFLOW=y
2067CONFIG_DEBUG_STACK_USAGE=y 2067CONFIG_DEBUG_STACK_USAGE=y
2068# CONFIG_DEBUG_PAGEALLOC is not set 2068# CONFIG_DEBUG_PAGEALLOC is not set
2069# CONFIG_HCALL_STATS is not set 2069# CONFIG_HCALL_STATS is not set
2070# CONFIG_CODE_PATCHING_SELFTEST is not set 2070CONFIG_CODE_PATCHING_SELFTEST=y
2071# CONFIG_FTR_FIXUP_SELFTEST is not set 2071CONFIG_FTR_FIXUP_SELFTEST=y
2072# CONFIG_MSI_BITMAP_SELFTEST is not set 2072CONFIG_MSI_BITMAP_SELFTEST=y
2073CONFIG_XMON=y 2073CONFIG_XMON=y
2074# CONFIG_XMON_DEFAULT is not set 2074# CONFIG_XMON_DEFAULT is not set
2075CONFIG_XMON_DISASSEMBLY=y 2075CONFIG_XMON_DISASSEMBLY=y
diff --git a/arch/powerpc/include/asm/code-patching.h b/arch/powerpc/include/asm/code-patching.h
index 107d9b915e33..37c32aba79b7 100644
--- a/arch/powerpc/include/asm/code-patching.h
+++ b/arch/powerpc/include/asm/code-patching.h
@@ -11,9 +11,7 @@
11 */ 11 */
12 12
13#include <asm/types.h> 13#include <asm/types.h>
14 14#include <asm/ppc-opcode.h>
15#define PPC_NOP_INSTR 0x60000000
16#define PPC_LWSYNC_INSTR 0x7c2004ac
17 15
18/* Flags for create_branch: 16/* Flags for create_branch:
19 * "b" == create_branch(addr, target, 0); 17 * "b" == create_branch(addr, target, 0);
diff --git a/arch/powerpc/include/asm/cputable.h b/arch/powerpc/include/asm/cputable.h
index 21172badd708..80f315e8a421 100644
--- a/arch/powerpc/include/asm/cputable.h
+++ b/arch/powerpc/include/asm/cputable.h
@@ -145,6 +145,7 @@ extern const char *powerpc_base_platform;
145#define CPU_FTR_USE_TB ASM_CONST(0x0000000000000040) 145#define CPU_FTR_USE_TB ASM_CONST(0x0000000000000040)
146#define CPU_FTR_L2CSR ASM_CONST(0x0000000000000080) 146#define CPU_FTR_L2CSR ASM_CONST(0x0000000000000080)
147#define CPU_FTR_601 ASM_CONST(0x0000000000000100) 147#define CPU_FTR_601 ASM_CONST(0x0000000000000100)
148#define CPU_FTR_DBELL ASM_CONST(0x0000000000000200)
148#define CPU_FTR_CAN_NAP ASM_CONST(0x0000000000000400) 149#define CPU_FTR_CAN_NAP ASM_CONST(0x0000000000000400)
149#define CPU_FTR_L3CR ASM_CONST(0x0000000000000800) 150#define CPU_FTR_L3CR ASM_CONST(0x0000000000000800)
150#define CPU_FTR_L3_DISABLE_NAP ASM_CONST(0x0000000000001000) 151#define CPU_FTR_L3_DISABLE_NAP ASM_CONST(0x0000000000001000)
@@ -375,7 +376,8 @@ extern const char *powerpc_base_platform;
375 CPU_FTR_NODSISRALIGN | CPU_FTR_NOEXECUTE) 376 CPU_FTR_NODSISRALIGN | CPU_FTR_NOEXECUTE)
376#define CPU_FTRS_E500MC (CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | \ 377#define CPU_FTRS_E500MC (CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | \
377 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_NODSISRALIGN | \ 378 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_NODSISRALIGN | \
378 CPU_FTR_L2CSR | CPU_FTR_LWSYNC | CPU_FTR_NOEXECUTE) 379 CPU_FTR_L2CSR | CPU_FTR_LWSYNC | CPU_FTR_NOEXECUTE | \
380 CPU_FTR_DBELL)
379#define CPU_FTRS_GENERIC_32 (CPU_FTR_COMMON | CPU_FTR_NODSISRALIGN) 381#define CPU_FTRS_GENERIC_32 (CPU_FTR_COMMON | CPU_FTR_NODSISRALIGN)
380 382
381/* 64-bit CPUs */ 383/* 64-bit CPUs */
diff --git a/arch/powerpc/include/asm/dbell.h b/arch/powerpc/include/asm/dbell.h
new file mode 100644
index 000000000000..501189a543d1
--- /dev/null
+++ b/arch/powerpc/include/asm/dbell.h
@@ -0,0 +1,43 @@
1/*
2 * Copyright 2009 Freescale Semicondutor, Inc.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
8 *
9 * provides masks and opcode images for use by code generation, emulation
10 * and for instructions that older assemblers might not know about
11 */
12#ifndef _ASM_POWERPC_DBELL_H
13#define _ASM_POWERPC_DBELL_H
14
15#include <linux/smp.h>
16#include <linux/threads.h>
17
18#include <asm/ppc-opcode.h>
19
20#define PPC_DBELL_MSG_BRDCAST (0x04000000)
21#define PPC_DBELL_TYPE(x) (((x) & 0xf) << 28)
22enum ppc_dbell {
23 PPC_DBELL = 0, /* doorbell */
24 PPC_DBELL_CRIT = 1, /* critical doorbell */
25 PPC_G_DBELL = 2, /* guest doorbell */
26 PPC_G_DBELL_CRIT = 3, /* guest critical doorbell */
27 PPC_G_DBELL_MC = 4, /* guest mcheck doorbell */
28};
29
30#ifdef CONFIG_SMP
31extern unsigned long dbell_smp_message[NR_CPUS];
32extern void smp_dbell_message_pass(int target, int msg);
33#endif
34
35static inline void ppc_msgsnd(enum ppc_dbell type, u32 flags, u32 tag)
36{
37 u32 msg = PPC_DBELL_TYPE(type) | (flags & PPC_DBELL_MSG_BRDCAST) |
38 (tag & 0x07ffffff);
39
40 __asm__ __volatile__ (PPC_MSGSND(%0) : : "r" (msg));
41}
42
43#endif /* _ASM_POWERPC_DBELL_H */
diff --git a/arch/powerpc/include/asm/dma-mapping.h b/arch/powerpc/include/asm/dma-mapping.h
index 86cef7ddc8d5..c69f2b5f0cc4 100644
--- a/arch/powerpc/include/asm/dma-mapping.h
+++ b/arch/powerpc/include/asm/dma-mapping.h
@@ -109,18 +109,8 @@ static inline struct dma_mapping_ops *get_dma_ops(struct device *dev)
109 * only ISA DMA device we support is the floppy and we have a hack 109 * only ISA DMA device we support is the floppy and we have a hack
110 * in the floppy driver directly to get a device for us. 110 * in the floppy driver directly to get a device for us.
111 */ 111 */
112 112 if (unlikely(dev == NULL))
113 if (unlikely(dev == NULL) || dev->archdata.dma_ops == NULL) {
114#ifdef CONFIG_PPC64
115 return NULL; 113 return NULL;
116#else
117 /* Use default on 32-bit if dma_ops is not set up */
118 /* TODO: Long term, we should fix drivers so that dev and
119 * archdata dma_ops are set up for all buses.
120 */
121 return &dma_direct_ops;
122#endif
123 }
124 114
125 return dev->archdata.dma_ops; 115 return dev->archdata.dma_ops;
126} 116}
diff --git a/arch/powerpc/include/asm/elf.h b/arch/powerpc/include/asm/elf.h
index b5600ce6055e..1a856b15226e 100644
--- a/arch/powerpc/include/asm/elf.h
+++ b/arch/powerpc/include/asm/elf.h
@@ -8,6 +8,7 @@
8#endif 8#endif
9 9
10#include <linux/types.h> 10#include <linux/types.h>
11
11#include <asm/ptrace.h> 12#include <asm/ptrace.h>
12#include <asm/cputable.h> 13#include <asm/cputable.h>
13#include <asm/auxvec.h> 14#include <asm/auxvec.h>
@@ -178,7 +179,8 @@ typedef elf_fpreg_t elf_vsrreghalf_t32[ELF_NVSRHALFREG];
178 the loader. We need to make sure that it is out of the way of the program 179 the loader. We need to make sure that it is out of the way of the program
179 that it will "exec", and that there is sufficient room for the brk. */ 180 that it will "exec", and that there is sufficient room for the brk. */
180 181
181#define ELF_ET_DYN_BASE (0x20000000) 182extern unsigned long randomize_et_dyn(unsigned long base);
183#define ELF_ET_DYN_BASE (randomize_et_dyn(0x20000000))
182 184
183/* 185/*
184 * Our registers are always unsigned longs, whether we're a 32 bit 186 * Our registers are always unsigned longs, whether we're a 32 bit
@@ -270,6 +272,14 @@ extern int arch_setup_additional_pages(struct linux_binprm *bprm,
270 int uses_interp); 272 int uses_interp);
271#define VDSO_AUX_ENT(a,b) NEW_AUX_ENT(a,b); 273#define VDSO_AUX_ENT(a,b) NEW_AUX_ENT(a,b);
272 274
275/* 1GB for 64bit, 8MB for 32bit */
276#define STACK_RND_MASK (is_32bit_task() ? \
277 (0x7ff >> (PAGE_SHIFT - 12)) : \
278 (0x3ffff >> (PAGE_SHIFT - 12)))
279
280extern unsigned long arch_randomize_brk(struct mm_struct *mm);
281#define arch_randomize_brk arch_randomize_brk
282
273#endif /* __KERNEL__ */ 283#endif /* __KERNEL__ */
274 284
275/* 285/*
diff --git a/arch/powerpc/include/asm/fixmap.h b/arch/powerpc/include/asm/fixmap.h
index 8428b38a3d30..d60fd18f428c 100644
--- a/arch/powerpc/include/asm/fixmap.h
+++ b/arch/powerpc/include/asm/fixmap.h
@@ -61,7 +61,7 @@ extern void __set_fixmap (enum fixed_addresses idx,
61 * Some hardware wants to get fixmapped without caching. 61 * Some hardware wants to get fixmapped without caching.
62 */ 62 */
63#define set_fixmap_nocache(idx, phys) \ 63#define set_fixmap_nocache(idx, phys) \
64 __set_fixmap(idx, phys, PAGE_KERNEL_NOCACHE) 64 __set_fixmap(idx, phys, PAGE_KERNEL_NCG)
65 65
66#define clear_fixmap(idx) \ 66#define clear_fixmap(idx) \
67 __set_fixmap(idx, 0, __pgprot(0)) 67 __set_fixmap(idx, 0, __pgprot(0))
diff --git a/arch/powerpc/include/asm/ftrace.h b/arch/powerpc/include/asm/ftrace.h
index e5f2ae8362f7..dde1296b8b41 100644
--- a/arch/powerpc/include/asm/ftrace.h
+++ b/arch/powerpc/include/asm/ftrace.h
@@ -5,7 +5,44 @@
5#define MCOUNT_ADDR ((long)(_mcount)) 5#define MCOUNT_ADDR ((long)(_mcount))
6#define MCOUNT_INSN_SIZE 4 /* sizeof mcount call */ 6#define MCOUNT_INSN_SIZE 4 /* sizeof mcount call */
7 7
8#ifndef __ASSEMBLY__ 8#ifdef __ASSEMBLY__
9
10/* Based off of objdump optput from glibc */
11
12#define MCOUNT_SAVE_FRAME \
13 stwu r1,-48(r1); \
14 stw r3, 12(r1); \
15 stw r4, 16(r1); \
16 stw r5, 20(r1); \
17 stw r6, 24(r1); \
18 mflr r3; \
19 lwz r4, 52(r1); \
20 mfcr r5; \
21 stw r7, 28(r1); \
22 stw r8, 32(r1); \
23 stw r9, 36(r1); \
24 stw r10,40(r1); \
25 stw r3, 44(r1); \
26 stw r5, 8(r1)
27
28#define MCOUNT_RESTORE_FRAME \
29 lwz r6, 8(r1); \
30 lwz r0, 44(r1); \
31 lwz r3, 12(r1); \
32 mtctr r0; \
33 lwz r4, 16(r1); \
34 mtcr r6; \
35 lwz r5, 20(r1); \
36 lwz r6, 24(r1); \
37 lwz r0, 52(r1); \
38 lwz r7, 28(r1); \
39 lwz r8, 32(r1); \
40 mtlr r0; \
41 lwz r9, 36(r1); \
42 lwz r10,40(r1); \
43 addi r1, r1, 48
44
45#else /* !__ASSEMBLY__ */
9extern void _mcount(void); 46extern void _mcount(void);
10 47
11#ifdef CONFIG_DYNAMIC_FTRACE 48#ifdef CONFIG_DYNAMIC_FTRACE
diff --git a/arch/powerpc/include/asm/highmem.h b/arch/powerpc/include/asm/highmem.h
index 04e4a620952e..545028f86488 100644
--- a/arch/powerpc/include/asm/highmem.h
+++ b/arch/powerpc/include/asm/highmem.h
@@ -39,15 +39,15 @@ extern pte_t *pkmap_page_table;
39 * chunk of RAM. 39 * chunk of RAM.
40 */ 40 */
41/* 41/*
42 * We use one full pte table with 4K pages. And with 16K/64K pages pte 42 * We use one full pte table with 4K pages. And with 16K/64K/256K pages pte
43 * table covers enough memory (32MB and 512MB resp.) that both FIXMAP 43 * table covers enough memory (32MB/512MB/2GB resp.), so that both FIXMAP
44 * and PKMAP can be placed in single pte table. We use 1024 pages for 44 * and PKMAP can be placed in a single pte table. We use 512 pages for PKMAP
45 * PKMAP in case of 16K/64K pages. 45 * in case of 16K/64K/256K page sizes.
46 */ 46 */
47#ifdef CONFIG_PPC_4K_PAGES 47#ifdef CONFIG_PPC_4K_PAGES
48#define PKMAP_ORDER PTE_SHIFT 48#define PKMAP_ORDER PTE_SHIFT
49#else 49#else
50#define PKMAP_ORDER 10 50#define PKMAP_ORDER 9
51#endif 51#endif
52#define LAST_PKMAP (1 << PKMAP_ORDER) 52#define LAST_PKMAP (1 << PKMAP_ORDER)
53#ifndef CONFIG_PPC_4K_PAGES 53#ifndef CONFIG_PPC_4K_PAGES
@@ -99,7 +99,7 @@ static inline void *kmap_atomic_prot(struct page *page, enum km_type type, pgpro
99#ifdef CONFIG_DEBUG_HIGHMEM 99#ifdef CONFIG_DEBUG_HIGHMEM
100 BUG_ON(!pte_none(*(kmap_pte-idx))); 100 BUG_ON(!pte_none(*(kmap_pte-idx)));
101#endif 101#endif
102 __set_pte_at(&init_mm, vaddr, kmap_pte-idx, mk_pte(page, prot)); 102 __set_pte_at(&init_mm, vaddr, kmap_pte-idx, mk_pte(page, prot), 1);
103 local_flush_tlb_page(NULL, vaddr); 103 local_flush_tlb_page(NULL, vaddr);
104 104
105 return (void*) vaddr; 105 return (void*) vaddr;
diff --git a/arch/powerpc/include/asm/hw_irq.h b/arch/powerpc/include/asm/hw_irq.h
index f75a5fc64d2e..b7e034b0a6dd 100644
--- a/arch/powerpc/include/asm/hw_irq.h
+++ b/arch/powerpc/include/asm/hw_irq.h
@@ -129,7 +129,7 @@ static inline int irqs_disabled_flags(unsigned long flags)
129 * interrupt-retrigger: should we handle this via lost interrupts and IPIs 129 * interrupt-retrigger: should we handle this via lost interrupts and IPIs
130 * or should we not care like we do now ? --BenH. 130 * or should we not care like we do now ? --BenH.
131 */ 131 */
132struct hw_interrupt_type; 132struct irq_chip;
133 133
134#endif /* __KERNEL__ */ 134#endif /* __KERNEL__ */
135#endif /* _ASM_POWERPC_HW_IRQ_H */ 135#endif /* _ASM_POWERPC_HW_IRQ_H */
diff --git a/arch/powerpc/include/asm/io.h b/arch/powerpc/include/asm/io.h
index 494cd8b0a278..001f2f11c19b 100644
--- a/arch/powerpc/include/asm/io.h
+++ b/arch/powerpc/include/asm/io.h
@@ -632,6 +632,9 @@ static inline void iosync(void)
632 * ioremap_flags and cannot be hooked (but can be used by a hook on one 632 * ioremap_flags and cannot be hooked (but can be used by a hook on one
633 * of the previous ones) 633 * of the previous ones)
634 * 634 *
635 * * __ioremap_caller is the same as above but takes an explicit caller
636 * reference rather than using __builtin_return_address(0)
637 *
635 * * __iounmap, is the low level implementation used by iounmap and cannot 638 * * __iounmap, is the low level implementation used by iounmap and cannot
636 * be hooked (but can be used by a hook on iounmap) 639 * be hooked (but can be used by a hook on iounmap)
637 * 640 *
@@ -646,6 +649,9 @@ extern void iounmap(volatile void __iomem *addr);
646 649
647extern void __iomem *__ioremap(phys_addr_t, unsigned long size, 650extern void __iomem *__ioremap(phys_addr_t, unsigned long size,
648 unsigned long flags); 651 unsigned long flags);
652extern void __iomem *__ioremap_caller(phys_addr_t, unsigned long size,
653 unsigned long flags, void *caller);
654
649extern void __iounmap(volatile void __iomem *addr); 655extern void __iounmap(volatile void __iomem *addr);
650 656
651extern void __iomem * __ioremap_at(phys_addr_t pa, void *ea, 657extern void __iomem * __ioremap_at(phys_addr_t pa, void *ea,
diff --git a/arch/powerpc/include/asm/lppaca.h b/arch/powerpc/include/asm/lppaca.h
index 25aaa97facd8..68235f7e4a8f 100644
--- a/arch/powerpc/include/asm/lppaca.h
+++ b/arch/powerpc/include/asm/lppaca.h
@@ -97,7 +97,7 @@ struct lppaca {
97 u64 saved_gpr4; // Saved GPR4 x28-x2F 97 u64 saved_gpr4; // Saved GPR4 x28-x2F
98 u64 saved_gpr5; // Saved GPR5 x30-x37 98 u64 saved_gpr5; // Saved GPR5 x30-x37
99 99
100 u8 reserved4; // Reserved x38-x38 100 u8 dtl_enable_mask; // Dispatch Trace Log mask x38-x38
101 u8 donate_dedicated_cpu; // Donate dedicated CPU cycles x39-x39 101 u8 donate_dedicated_cpu; // Donate dedicated CPU cycles x39-x39
102 u8 fpregs_in_use; // FP regs in use x3A-x3A 102 u8 fpregs_in_use; // FP regs in use x3A-x3A
103 u8 pmcregs_in_use; // PMC regs in use x3B-x3B 103 u8 pmcregs_in_use; // PMC regs in use x3B-x3B
@@ -133,8 +133,10 @@ struct lppaca {
133//============================================================================= 133//=============================================================================
134// CACHE_LINE_4-5 0x0180 - 0x027F Contains PMC interrupt data 134// CACHE_LINE_4-5 0x0180 - 0x027F Contains PMC interrupt data
135//============================================================================= 135//=============================================================================
136 u32 page_ins; // CMO Hint - # page ins by OS x00-x04 136 u32 page_ins; // CMO Hint - # page ins by OS x00-x03
137 u8 pmc_save_area[252]; // PMC interrupt Area x04-xFF 137 u8 reserved8[148]; // Reserved x04-x97
138 volatile u64 dtl_idx; // Dispatch Trace Log head idx x98-x9F
139 u8 reserved9[96]; // Reserved xA0-xFF
138} __attribute__((__aligned__(0x400))); 140} __attribute__((__aligned__(0x400)));
139 141
140extern struct lppaca lppaca[]; 142extern struct lppaca lppaca[];
diff --git a/arch/powerpc/include/asm/machdep.h b/arch/powerpc/include/asm/machdep.h
index 2740c44ff717..0efdb1dfdc5f 100644
--- a/arch/powerpc/include/asm/machdep.h
+++ b/arch/powerpc/include/asm/machdep.h
@@ -90,7 +90,7 @@ struct machdep_calls {
90 void (*tce_flush)(struct iommu_table *tbl); 90 void (*tce_flush)(struct iommu_table *tbl);
91 91
92 void __iomem * (*ioremap)(phys_addr_t addr, unsigned long size, 92 void __iomem * (*ioremap)(phys_addr_t addr, unsigned long size,
93 unsigned long flags); 93 unsigned long flags, void *caller);
94 void (*iounmap)(volatile void __iomem *token); 94 void (*iounmap)(volatile void __iomem *token);
95 95
96#ifdef CONFIG_PM 96#ifdef CONFIG_PM
@@ -327,8 +327,6 @@ extern void __devinit smp_generic_take_timebase(void);
327 */ 327 */
328/* Print a boot progress message. */ 328/* Print a boot progress message. */
329void ppc64_boot_msg(unsigned int src, const char *msg); 329void ppc64_boot_msg(unsigned int src, const char *msg);
330/* Print a termination message (print only -- does not stop the kernel) */
331void ppc64_terminate_msg(unsigned int src, const char *msg);
332 330
333static inline void log_error(char *buf, unsigned int err_type, int fatal) 331static inline void log_error(char *buf, unsigned int err_type, int fatal)
334{ 332{
diff --git a/arch/powerpc/include/asm/mmu-44x.h b/arch/powerpc/include/asm/mmu-44x.h
index 27cc6fdcd3b7..3c86576bfefa 100644
--- a/arch/powerpc/include/asm/mmu-44x.h
+++ b/arch/powerpc/include/asm/mmu-44x.h
@@ -83,6 +83,8 @@ typedef struct {
83#define PPC44x_TLBE_SIZE PPC44x_TLB_16K 83#define PPC44x_TLBE_SIZE PPC44x_TLB_16K
84#elif (PAGE_SHIFT == 16) 84#elif (PAGE_SHIFT == 16)
85#define PPC44x_TLBE_SIZE PPC44x_TLB_64K 85#define PPC44x_TLBE_SIZE PPC44x_TLB_64K
86#elif (PAGE_SHIFT == 18)
87#define PPC44x_TLBE_SIZE PPC44x_TLB_256K
86#else 88#else
87#error "Unsupported PAGE_SIZE" 89#error "Unsupported PAGE_SIZE"
88#endif 90#endif
diff --git a/arch/powerpc/include/asm/mmu-fsl-booke.h b/arch/powerpc/include/asm/mmu-book3e.h
index 4285b64a65e0..7e74cff81d86 100644
--- a/arch/powerpc/include/asm/mmu-fsl-booke.h
+++ b/arch/powerpc/include/asm/mmu-book3e.h
@@ -1,26 +1,42 @@
1#ifndef _ASM_POWERPC_MMU_FSL_BOOKE_H_ 1#ifndef _ASM_POWERPC_MMU_BOOK3E_H_
2#define _ASM_POWERPC_MMU_FSL_BOOKE_H_ 2#define _ASM_POWERPC_MMU_BOOK3E_H_
3/* 3/*
4 * Freescale Book-E MMU support 4 * Freescale Book-E/Book-3e (ISA 2.06+) MMU support
5 */ 5 */
6 6
7/* Book-E defined page sizes */ 7/* Book-3e defined page sizes */
8#define BOOKE_PAGESZ_1K 0 8#define BOOK3E_PAGESZ_1K 0
9#define BOOKE_PAGESZ_4K 1 9#define BOOK3E_PAGESZ_2K 1
10#define BOOKE_PAGESZ_16K 2 10#define BOOK3E_PAGESZ_4K 2
11#define BOOKE_PAGESZ_64K 3 11#define BOOK3E_PAGESZ_8K 3
12#define BOOKE_PAGESZ_256K 4 12#define BOOK3E_PAGESZ_16K 4
13#define BOOKE_PAGESZ_1M 5 13#define BOOK3E_PAGESZ_32K 5
14#define BOOKE_PAGESZ_4M 6 14#define BOOK3E_PAGESZ_64K 6
15#define BOOKE_PAGESZ_16M 7 15#define BOOK3E_PAGESZ_128K 7
16#define BOOKE_PAGESZ_64M 8 16#define BOOK3E_PAGESZ_256K 8
17#define BOOKE_PAGESZ_256M 9 17#define BOOK3E_PAGESZ_512K 9
18#define BOOKE_PAGESZ_1GB 10 18#define BOOK3E_PAGESZ_1M 10
19#define BOOKE_PAGESZ_4GB 11 19#define BOOK3E_PAGESZ_2M 11
20#define BOOKE_PAGESZ_16GB 12 20#define BOOK3E_PAGESZ_4M 12
21#define BOOKE_PAGESZ_64GB 13 21#define BOOK3E_PAGESZ_8M 13
22#define BOOKE_PAGESZ_256GB 14 22#define BOOK3E_PAGESZ_16M 14
23#define BOOKE_PAGESZ_1TB 15 23#define BOOK3E_PAGESZ_32M 15
24#define BOOK3E_PAGESZ_64M 16
25#define BOOK3E_PAGESZ_128M 17
26#define BOOK3E_PAGESZ_256M 18
27#define BOOK3E_PAGESZ_512M 19
28#define BOOK3E_PAGESZ_1GB 20
29#define BOOK3E_PAGESZ_2GB 21
30#define BOOK3E_PAGESZ_4GB 22
31#define BOOK3E_PAGESZ_8GB 23
32#define BOOK3E_PAGESZ_16GB 24
33#define BOOK3E_PAGESZ_32GB 25
34#define BOOK3E_PAGESZ_64GB 26
35#define BOOK3E_PAGESZ_128GB 27
36#define BOOK3E_PAGESZ_256GB 28
37#define BOOK3E_PAGESZ_512GB 29
38#define BOOK3E_PAGESZ_1TB 30
39#define BOOK3E_PAGESZ_2TB 31
24 40
25#define MAS0_TLBSEL(x) ((x << 28) & 0x30000000) 41#define MAS0_TLBSEL(x) ((x << 28) & 0x30000000)
26#define MAS0_ESEL(x) ((x << 16) & 0x0FFF0000) 42#define MAS0_ESEL(x) ((x << 16) & 0x0FFF0000)
@@ -29,8 +45,9 @@
29#define MAS1_VALID 0x80000000 45#define MAS1_VALID 0x80000000
30#define MAS1_IPROT 0x40000000 46#define MAS1_IPROT 0x40000000
31#define MAS1_TID(x) ((x << 16) & 0x3FFF0000) 47#define MAS1_TID(x) ((x << 16) & 0x3FFF0000)
48#define MAS1_IND 0x00002000
32#define MAS1_TS 0x00001000 49#define MAS1_TS 0x00001000
33#define MAS1_TSIZE(x) ((x << 8) & 0x00000F00) 50#define MAS1_TSIZE(x) ((x << 7) & 0x00000F80)
34 51
35#define MAS2_EPN 0xFFFFF000 52#define MAS2_EPN 0xFFFFF000
36#define MAS2_X0 0x00000040 53#define MAS2_X0 0x00000040
@@ -40,7 +57,7 @@
40#define MAS2_M 0x00000004 57#define MAS2_M 0x00000004
41#define MAS2_G 0x00000002 58#define MAS2_G 0x00000002
42#define MAS2_E 0x00000001 59#define MAS2_E 0x00000001
43#define MAS2_EPN_MASK(size) (~0 << (2*(size) + 10)) 60#define MAS2_EPN_MASK(size) (~0 << (size + 10))
44#define MAS2_VAL(addr, size, flags) ((addr) & MAS2_EPN_MASK(size) | (flags)) 61#define MAS2_VAL(addr, size, flags) ((addr) & MAS2_EPN_MASK(size) | (flags))
45 62
46#define MAS3_RPN 0xFFFFF000 63#define MAS3_RPN 0xFFFFF000
@@ -56,7 +73,7 @@
56#define MAS3_SR 0x00000001 73#define MAS3_SR 0x00000001
57 74
58#define MAS4_TLBSELD(x) MAS0_TLBSEL(x) 75#define MAS4_TLBSELD(x) MAS0_TLBSEL(x)
59#define MAS4_TIDDSEL 0x000F0000 76#define MAS4_INDD 0x00008000
60#define MAS4_TSIZED(x) MAS1_TSIZE(x) 77#define MAS4_TSIZED(x) MAS1_TSIZE(x)
61#define MAS4_X0D 0x00000040 78#define MAS4_X0D 0x00000040
62#define MAS4_X1D 0x00000020 79#define MAS4_X1D 0x00000020
@@ -68,6 +85,7 @@
68 85
69#define MAS6_SPID0 0x3FFF0000 86#define MAS6_SPID0 0x3FFF0000
70#define MAS6_SPID1 0x00007FFE 87#define MAS6_SPID1 0x00007FFE
88#define MAS6_ISIZE(x) MAS1_TSIZE(x)
71#define MAS6_SAS 0x00000001 89#define MAS6_SAS 0x00000001
72#define MAS6_SPID MAS6_SPID0 90#define MAS6_SPID MAS6_SPID0
73 91
@@ -84,4 +102,4 @@ typedef struct {
84} mm_context_t; 102} mm_context_t;
85#endif /* !__ASSEMBLY__ */ 103#endif /* !__ASSEMBLY__ */
86 104
87#endif /* _ASM_POWERPC_MMU_FSL_BOOKE_H_ */ 105#endif /* _ASM_POWERPC_MMU_BOOK3E_H_ */
diff --git a/arch/powerpc/include/asm/mmu-hash64.h b/arch/powerpc/include/asm/mmu-hash64.h
index 68b752626808..98c104a09961 100644
--- a/arch/powerpc/include/asm/mmu-hash64.h
+++ b/arch/powerpc/include/asm/mmu-hash64.h
@@ -284,8 +284,6 @@ extern void add_gpage(unsigned long addr, unsigned long page_size,
284 unsigned long number_of_pages); 284 unsigned long number_of_pages);
285extern void demote_segment_4k(struct mm_struct *mm, unsigned long addr); 285extern void demote_segment_4k(struct mm_struct *mm, unsigned long addr);
286 286
287extern void htab_initialize(void);
288extern void htab_initialize_secondary(void);
289extern void hpte_init_native(void); 287extern void hpte_init_native(void);
290extern void hpte_init_lpar(void); 288extern void hpte_init_lpar(void);
291extern void hpte_init_iSeries(void); 289extern void hpte_init_iSeries(void);
diff --git a/arch/powerpc/include/asm/mmu.h b/arch/powerpc/include/asm/mmu.h
index 6e7639911318..cbf154387091 100644
--- a/arch/powerpc/include/asm/mmu.h
+++ b/arch/powerpc/include/asm/mmu.h
@@ -36,9 +36,9 @@
36 */ 36 */
37#define MMU_FTR_USE_TLBIVAX_BCAST ASM_CONST(0x00040000) 37#define MMU_FTR_USE_TLBIVAX_BCAST ASM_CONST(0x00040000)
38 38
39/* Enable use of tlbilx invalidate-by-PID variant. 39/* Enable use of tlbilx invalidate instructions.
40 */ 40 */
41#define MMU_FTR_USE_TLBILX_PID ASM_CONST(0x00080000) 41#define MMU_FTR_USE_TLBILX ASM_CONST(0x00080000)
42 42
43/* This indicates that the processor cannot handle multiple outstanding 43/* This indicates that the processor cannot handle multiple outstanding
44 * broadcast tlbivax or tlbsync. This makes the code use a spinlock 44 * broadcast tlbivax or tlbsync. This makes the code use a spinlock
@@ -46,6 +46,12 @@
46 */ 46 */
47#define MMU_FTR_LOCK_BCAST_INVAL ASM_CONST(0x00100000) 47#define MMU_FTR_LOCK_BCAST_INVAL ASM_CONST(0x00100000)
48 48
49/* This indicates that the processor doesn't handle way selection
50 * properly and needs SW to track and update the LRU state. This
51 * is specific to an errata on e300c2/c3/c4 class parts
52 */
53#define MMU_FTR_NEED_DTLB_SW_LRU ASM_CONST(0x00200000)
54
49#ifndef __ASSEMBLY__ 55#ifndef __ASSEMBLY__
50#include <asm/cputable.h> 56#include <asm/cputable.h>
51 57
@@ -56,6 +62,10 @@ static inline int mmu_has_feature(unsigned long feature)
56 62
57extern unsigned int __start___mmu_ftr_fixup, __stop___mmu_ftr_fixup; 63extern unsigned int __start___mmu_ftr_fixup, __stop___mmu_ftr_fixup;
58 64
65/* MMU initialization (64-bit only fo now) */
66extern void early_init_mmu(void);
67extern void early_init_mmu_secondary(void);
68
59#endif /* !__ASSEMBLY__ */ 69#endif /* !__ASSEMBLY__ */
60 70
61 71
@@ -71,9 +81,9 @@ extern unsigned int __start___mmu_ftr_fixup, __stop___mmu_ftr_fixup;
71#elif defined(CONFIG_44x) 81#elif defined(CONFIG_44x)
72/* 44x-style software loaded TLB */ 82/* 44x-style software loaded TLB */
73# include <asm/mmu-44x.h> 83# include <asm/mmu-44x.h>
74#elif defined(CONFIG_FSL_BOOKE) 84#elif defined(CONFIG_PPC_BOOK3E_MMU)
75/* Freescale Book-E software loaded TLB */ 85/* Freescale Book-E software loaded TLB or Book-3e (ISA 2.06+) MMU */
76# include <asm/mmu-fsl-booke.h> 86# include <asm/mmu-book3e.h>
77#elif defined (CONFIG_PPC_8xx) 87#elif defined (CONFIG_PPC_8xx)
78/* Motorola/Freescale 8xx software loaded TLB */ 88/* Motorola/Freescale 8xx software loaded TLB */
79# include <asm/mmu-8xx.h> 89# include <asm/mmu-8xx.h>
diff --git a/arch/powerpc/include/asm/mmu_context.h b/arch/powerpc/include/asm/mmu_context.h
index ab4f19263c42..b7063669f972 100644
--- a/arch/powerpc/include/asm/mmu_context.h
+++ b/arch/powerpc/include/asm/mmu_context.h
@@ -31,7 +31,7 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
31 struct task_struct *tsk) 31 struct task_struct *tsk)
32{ 32{
33 /* Mark this context has been used on the new CPU */ 33 /* Mark this context has been used on the new CPU */
34 cpu_set(smp_processor_id(), next->cpu_vm_mask); 34 cpumask_set_cpu(smp_processor_id(), mm_cpumask(next));
35 35
36 /* 32-bit keeps track of the current PGDIR in the thread struct */ 36 /* 32-bit keeps track of the current PGDIR in the thread struct */
37#ifdef CONFIG_PPC32 37#ifdef CONFIG_PPC32
diff --git a/arch/powerpc/include/asm/mpc52xx.h b/arch/powerpc/include/asm/mpc52xx.h
index 81a23932a160..52e049cd9e68 100644
--- a/arch/powerpc/include/asm/mpc52xx.h
+++ b/arch/powerpc/include/asm/mpc52xx.h
@@ -273,6 +273,7 @@ extern void mpc5200_setup_xlb_arbiter(void);
273extern void mpc52xx_declare_of_platform_devices(void); 273extern void mpc52xx_declare_of_platform_devices(void);
274extern void mpc52xx_map_common_devices(void); 274extern void mpc52xx_map_common_devices(void);
275extern int mpc52xx_set_psc_clkdiv(int psc_id, int clkdiv); 275extern int mpc52xx_set_psc_clkdiv(int psc_id, int clkdiv);
276extern unsigned int mpc52xx_get_xtal_freq(struct device_node *node);
276extern void mpc52xx_restart(char *cmd); 277extern void mpc52xx_restart(char *cmd);
277 278
278/* mpc52xx_pic.c */ 279/* mpc52xx_pic.c */
diff --git a/arch/powerpc/include/asm/page.h b/arch/powerpc/include/asm/page.h
index 197d569f5bd3..32cbf16f10ea 100644
--- a/arch/powerpc/include/asm/page.h
+++ b/arch/powerpc/include/asm/page.h
@@ -19,12 +19,14 @@
19#include <asm/kdump.h> 19#include <asm/kdump.h>
20 20
21/* 21/*
22 * On regular PPC32 page size is 4K (but we support 4K/16K/64K pages 22 * On regular PPC32 page size is 4K (but we support 4K/16K/64K/256K pages
23 * on PPC44x). For PPC64 we support either 4K or 64K software 23 * on PPC44x). For PPC64 we support either 4K or 64K software
24 * page size. When using 64K pages however, whether we are really supporting 24 * page size. When using 64K pages however, whether we are really supporting
25 * 64K pages in HW or not is irrelevant to those definitions. 25 * 64K pages in HW or not is irrelevant to those definitions.
26 */ 26 */
27#if defined(CONFIG_PPC_64K_PAGES) 27#if defined(CONFIG_PPC_256K_PAGES)
28#define PAGE_SHIFT 18
29#elif defined(CONFIG_PPC_64K_PAGES)
28#define PAGE_SHIFT 16 30#define PAGE_SHIFT 16
29#elif defined(CONFIG_PPC_16K_PAGES) 31#elif defined(CONFIG_PPC_16K_PAGES)
30#define PAGE_SHIFT 14 32#define PAGE_SHIFT 14
diff --git a/arch/powerpc/include/asm/page_32.h b/arch/powerpc/include/asm/page_32.h
index 1458d9500381..a0e3f6e6b4ee 100644
--- a/arch/powerpc/include/asm/page_32.h
+++ b/arch/powerpc/include/asm/page_32.h
@@ -19,7 +19,11 @@
19#define PTE_FLAGS_OFFSET 0 19#define PTE_FLAGS_OFFSET 0
20#endif 20#endif
21 21
22#ifdef CONFIG_PPC_256K_PAGES
23#define PTE_SHIFT (PAGE_SHIFT - PTE_T_LOG2 - 2) /* 1/4 of a page */
24#else
22#define PTE_SHIFT (PAGE_SHIFT - PTE_T_LOG2) /* full page */ 25#define PTE_SHIFT (PAGE_SHIFT - PTE_T_LOG2) /* full page */
26#endif
23 27
24#ifndef __ASSEMBLY__ 28#ifndef __ASSEMBLY__
25/* 29/*
diff --git a/arch/powerpc/include/asm/pgtable-ppc32.h b/arch/powerpc/include/asm/pgtable-ppc32.h
index 820b5f0a35ce..ba45c997830f 100644
--- a/arch/powerpc/include/asm/pgtable-ppc32.h
+++ b/arch/powerpc/include/asm/pgtable-ppc32.h
@@ -19,55 +19,6 @@ extern int icache_44x_need_flush;
19#endif /* __ASSEMBLY__ */ 19#endif /* __ASSEMBLY__ */
20 20
21/* 21/*
22 * The PowerPC MMU uses a hash table containing PTEs, together with
23 * a set of 16 segment registers (on 32-bit implementations), to define
24 * the virtual to physical address mapping.
25 *
26 * We use the hash table as an extended TLB, i.e. a cache of currently
27 * active mappings. We maintain a two-level page table tree, much
28 * like that used by the i386, for the sake of the Linux memory
29 * management code. Low-level assembler code in hashtable.S
30 * (procedure hash_page) is responsible for extracting ptes from the
31 * tree and putting them into the hash table when necessary, and
32 * updating the accessed and modified bits in the page table tree.
33 */
34
35/*
36 * The PowerPC MPC8xx uses a TLB with hardware assisted, software tablewalk.
37 * We also use the two level tables, but we can put the real bits in them
38 * needed for the TLB and tablewalk. These definitions require Mx_CTR.PPM = 0,
39 * Mx_CTR.PPCS = 0, and MD_CTR.TWAM = 1. The level 2 descriptor has
40 * additional page protection (when Mx_CTR.PPCS = 1) that allows TLB hit
41 * based upon user/super access. The TLB does not have accessed nor write
42 * protect. We assume that if the TLB get loaded with an entry it is
43 * accessed, and overload the changed bit for write protect. We use
44 * two bits in the software pte that are supposed to be set to zero in
45 * the TLB entry (24 and 25) for these indicators. Although the level 1
46 * descriptor contains the guarded and writethrough/copyback bits, we can
47 * set these at the page level since they get copied from the Mx_TWC
48 * register when the TLB entry is loaded. We will use bit 27 for guard, since
49 * that is where it exists in the MD_TWC, and bit 26 for writethrough.
50 * These will get masked from the level 2 descriptor at TLB load time, and
51 * copied to the MD_TWC before it gets loaded.
52 * Large page sizes added. We currently support two sizes, 4K and 8M.
53 * This also allows a TLB hander optimization because we can directly
54 * load the PMD into MD_TWC. The 8M pages are only used for kernel
55 * mapping of well known areas. The PMD (PGD) entries contain control
56 * flags in addition to the address, so care must be taken that the
57 * software no longer assumes these are only pointers.
58 */
59
60/*
61 * At present, all PowerPC 400-class processors share a similar TLB
62 * architecture. The instruction and data sides share a unified,
63 * 64-entry, fully-associative TLB which is maintained totally under
64 * software control. In addition, the instruction side has a
65 * hardware-managed, 4-entry, fully-associative TLB which serves as a
66 * first level to the shared TLB. These two TLBs are known as the UTLB
67 * and ITLB, respectively (see "mmu.h" for definitions).
68 */
69
70/*
71 * The normal case is that PTEs are 32-bits and we have a 1-page 22 * The normal case is that PTEs are 32-bits and we have a 1-page
72 * 1024-entry pgdir pointing to 1-page 1024-entry PTE pages. -- paulus 23 * 1024-entry pgdir pointing to 1-page 1024-entry PTE pages. -- paulus
73 * 24 *
@@ -135,409 +86,22 @@ extern int icache_44x_need_flush;
135 */ 86 */
136 87
137#if defined(CONFIG_40x) 88#if defined(CONFIG_40x)
138 89#include <asm/pte-40x.h>
139/* There are several potential gotchas here. The 40x hardware TLBLO
140 field looks like this:
141
142 0 1 2 3 4 ... 18 19 20 21 22 23 24 25 26 27 28 29 30 31
143 RPN..................... 0 0 EX WR ZSEL....... W I M G
144
145 Where possible we make the Linux PTE bits match up with this
146
147 - bits 20 and 21 must be cleared, because we use 4k pages (40x can
148 support down to 1k pages), this is done in the TLBMiss exception
149 handler.
150 - We use only zones 0 (for kernel pages) and 1 (for user pages)
151 of the 16 available. Bit 24-26 of the TLB are cleared in the TLB
152 miss handler. Bit 27 is PAGE_USER, thus selecting the correct
153 zone.
154 - PRESENT *must* be in the bottom two bits because swap cache
155 entries use the top 30 bits. Because 40x doesn't support SMP
156 anyway, M is irrelevant so we borrow it for PAGE_PRESENT. Bit 30
157 is cleared in the TLB miss handler before the TLB entry is loaded.
158 - All other bits of the PTE are loaded into TLBLO without
159 modification, leaving us only the bits 20, 21, 24, 25, 26, 30 for
160 software PTE bits. We actually use use bits 21, 24, 25, and
161 30 respectively for the software bits: ACCESSED, DIRTY, RW, and
162 PRESENT.
163*/
164
165/* Definitions for 40x embedded chips. */
166#define _PAGE_GUARDED 0x001 /* G: page is guarded from prefetch */
167#define _PAGE_FILE 0x001 /* when !present: nonlinear file mapping */
168#define _PAGE_PRESENT 0x002 /* software: PTE contains a translation */
169#define _PAGE_NO_CACHE 0x004 /* I: caching is inhibited */
170#define _PAGE_WRITETHRU 0x008 /* W: caching is write-through */
171#define _PAGE_USER 0x010 /* matches one of the zone permission bits */
172#define _PAGE_RW 0x040 /* software: Writes permitted */
173#define _PAGE_DIRTY 0x080 /* software: dirty page */
174#define _PAGE_HWWRITE 0x100 /* hardware: Dirty & RW, set in exception */
175#define _PAGE_HWEXEC 0x200 /* hardware: EX permission */
176#define _PAGE_ACCESSED 0x400 /* software: R: page referenced */
177
178#define _PMD_PRESENT 0x400 /* PMD points to page of PTEs */
179#define _PMD_BAD 0x802
180#define _PMD_SIZE 0x0e0 /* size field, != 0 for large-page PMD entry */
181#define _PMD_SIZE_4M 0x0c0
182#define _PMD_SIZE_16M 0x0e0
183#define PMD_PAGE_SIZE(pmdval) (1024 << (((pmdval) & _PMD_SIZE) >> 4))
184
185/* Until my rework is finished, 40x still needs atomic PTE updates */
186#define PTE_ATOMIC_UPDATES 1
187
188#elif defined(CONFIG_44x) 90#elif defined(CONFIG_44x)
189/* 91#include <asm/pte-44x.h>
190 * Definitions for PPC440
191 *
192 * Because of the 3 word TLB entries to support 36-bit addressing,
193 * the attribute are difficult to map in such a fashion that they
194 * are easily loaded during exception processing. I decided to
195 * organize the entry so the ERPN is the only portion in the
196 * upper word of the PTE and the attribute bits below are packed
197 * in as sensibly as they can be in the area below a 4KB page size
198 * oriented RPN. This at least makes it easy to load the RPN and
199 * ERPN fields in the TLB. -Matt
200 *
201 * Note that these bits preclude future use of a page size
202 * less than 4KB.
203 *
204 *
205 * PPC 440 core has following TLB attribute fields;
206 *
207 * TLB1:
208 * 0 1 2 3 4 ... 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
209 * RPN................................. - - - - - - ERPN.......
210 *
211 * TLB2:
212 * 0 1 2 3 4 ... 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
213 * - - - - - - U0 U1 U2 U3 W I M G E - UX UW UR SX SW SR
214 *
215 * Newer 440 cores (440x6 as used on AMCC 460EX/460GT) have additional
216 * TLB2 storage attibute fields. Those are:
217 *
218 * TLB2:
219 * 0...10 11 12 13 14 15 16...31
220 * no change WL1 IL1I IL1D IL2I IL2D no change
221 *
222 * There are some constrains and options, to decide mapping software bits
223 * into TLB entry.
224 *
225 * - PRESENT *must* be in the bottom three bits because swap cache
226 * entries use the top 29 bits for TLB2.
227 *
228 * - FILE *must* be in the bottom three bits because swap cache
229 * entries use the top 29 bits for TLB2.
230 *
231 * - CACHE COHERENT bit (M) has no effect on original PPC440 cores,
232 * because it doesn't support SMP. However, some later 460 variants
233 * have -some- form of SMP support and so I keep the bit there for
234 * future use
235 *
236 * With the PPC 44x Linux implementation, the 0-11th LSBs of the PTE are used
237 * for memory protection related functions (see PTE structure in
238 * include/asm-ppc/mmu.h). The _PAGE_XXX definitions in this file map to the
239 * above bits. Note that the bit values are CPU specific, not architecture
240 * specific.
241 *
242 * The kernel PTE entry holds an arch-dependent swp_entry structure under
243 * certain situations. In other words, in such situations some portion of
244 * the PTE bits are used as a swp_entry. In the PPC implementation, the
245 * 3-24th LSB are shared with swp_entry, however the 0-2nd three LSB still
246 * hold protection values. That means the three protection bits are
247 * reserved for both PTE and SWAP entry at the most significant three
248 * LSBs.
249 *
250 * There are three protection bits available for SWAP entry:
251 * _PAGE_PRESENT
252 * _PAGE_FILE
253 * _PAGE_HASHPTE (if HW has)
254 *
255 * So those three bits have to be inside of 0-2nd LSB of PTE.
256 *
257 */
258
259#define _PAGE_PRESENT 0x00000001 /* S: PTE valid */
260#define _PAGE_RW 0x00000002 /* S: Write permission */
261#define _PAGE_FILE 0x00000004 /* S: nonlinear file mapping */
262#define _PAGE_HWEXEC 0x00000004 /* H: Execute permission */
263#define _PAGE_ACCESSED 0x00000008 /* S: Page referenced */
264#define _PAGE_DIRTY 0x00000010 /* S: Page dirty */
265#define _PAGE_SPECIAL 0x00000020 /* S: Special page */
266#define _PAGE_USER 0x00000040 /* S: User page */
267#define _PAGE_ENDIAN 0x00000080 /* H: E bit */
268#define _PAGE_GUARDED 0x00000100 /* H: G bit */
269#define _PAGE_COHERENT 0x00000200 /* H: M bit */
270#define _PAGE_NO_CACHE 0x00000400 /* H: I bit */
271#define _PAGE_WRITETHRU 0x00000800 /* H: W bit */
272
273/* TODO: Add large page lowmem mapping support */
274#define _PMD_PRESENT 0
275#define _PMD_PRESENT_MASK (PAGE_MASK)
276#define _PMD_BAD (~PAGE_MASK)
277
278/* ERPN in a PTE never gets cleared, ignore it */
279#define _PTE_NONE_MASK 0xffffffff00000000ULL
280
281#define __HAVE_ARCH_PTE_SPECIAL
282
283#elif defined(CONFIG_FSL_BOOKE) 92#elif defined(CONFIG_FSL_BOOKE)
284/* 93#include <asm/pte-fsl-booke.h>
285 MMU Assist Register 3:
286
287 32 33 34 35 36 ... 50 51 52 53 54 55 56 57 58 59 60 61 62 63
288 RPN...................... 0 0 U0 U1 U2 U3 UX SX UW SW UR SR
289
290 - PRESENT *must* be in the bottom three bits because swap cache
291 entries use the top 29 bits.
292
293 - FILE *must* be in the bottom three bits because swap cache
294 entries use the top 29 bits.
295*/
296
297/* Definitions for FSL Book-E Cores */
298#define _PAGE_PRESENT 0x00001 /* S: PTE contains a translation */
299#define _PAGE_USER 0x00002 /* S: User page (maps to UR) */
300#define _PAGE_FILE 0x00002 /* S: when !present: nonlinear file mapping */
301#define _PAGE_RW 0x00004 /* S: Write permission (SW) */
302#define _PAGE_DIRTY 0x00008 /* S: Page dirty */
303#define _PAGE_HWEXEC 0x00010 /* H: SX permission */
304#define _PAGE_ACCESSED 0x00020 /* S: Page referenced */
305
306#define _PAGE_ENDIAN 0x00040 /* H: E bit */
307#define _PAGE_GUARDED 0x00080 /* H: G bit */
308#define _PAGE_COHERENT 0x00100 /* H: M bit */
309#define _PAGE_NO_CACHE 0x00200 /* H: I bit */
310#define _PAGE_WRITETHRU 0x00400 /* H: W bit */
311#define _PAGE_SPECIAL 0x00800 /* S: Special page */
312
313#ifdef CONFIG_PTE_64BIT
314/* ERPN in a PTE never gets cleared, ignore it */
315#define _PTE_NONE_MASK 0xffffffffffff0000ULL
316#endif
317
318#define _PMD_PRESENT 0
319#define _PMD_PRESENT_MASK (PAGE_MASK)
320#define _PMD_BAD (~PAGE_MASK)
321
322#define __HAVE_ARCH_PTE_SPECIAL
323
324#elif defined(CONFIG_8xx) 94#elif defined(CONFIG_8xx)
325/* Definitions for 8xx embedded chips. */ 95#include <asm/pte-8xx.h>
326#define _PAGE_PRESENT 0x0001 /* Page is valid */
327#define _PAGE_FILE 0x0002 /* when !present: nonlinear file mapping */
328#define _PAGE_NO_CACHE 0x0002 /* I: cache inhibit */
329#define _PAGE_SHARED 0x0004 /* No ASID (context) compare */
330
331/* These five software bits must be masked out when the entry is loaded
332 * into the TLB.
333 */
334#define _PAGE_EXEC 0x0008 /* software: i-cache coherency required */
335#define _PAGE_GUARDED 0x0010 /* software: guarded access */
336#define _PAGE_DIRTY 0x0020 /* software: page changed */
337#define _PAGE_RW 0x0040 /* software: user write access allowed */
338#define _PAGE_ACCESSED 0x0080 /* software: page referenced */
339
340/* Setting any bits in the nibble with the follow two controls will
341 * require a TLB exception handler change. It is assumed unused bits
342 * are always zero.
343 */
344#define _PAGE_HWWRITE 0x0100 /* h/w write enable: never set in Linux PTE */
345#define _PAGE_USER 0x0800 /* One of the PP bits, the other is USER&~RW */
346
347#define _PMD_PRESENT 0x0001
348#define _PMD_BAD 0x0ff0
349#define _PMD_PAGE_MASK 0x000c
350#define _PMD_PAGE_8M 0x000c
351
352#define _PTE_NONE_MASK _PAGE_ACCESSED
353
354/* Until my rework is finished, 8xx still needs atomic PTE updates */
355#define PTE_ATOMIC_UPDATES 1
356
357#else /* CONFIG_6xx */ 96#else /* CONFIG_6xx */
358/* Definitions for 60x, 740/750, etc. */ 97#include <asm/pte-hash32.h>
359#define _PAGE_PRESENT 0x001 /* software: pte contains a translation */
360#define _PAGE_HASHPTE 0x002 /* hash_page has made an HPTE for this pte */
361#define _PAGE_FILE 0x004 /* when !present: nonlinear file mapping */
362#define _PAGE_USER 0x004 /* usermode access allowed */
363#define _PAGE_GUARDED 0x008 /* G: prohibit speculative access */
364#define _PAGE_COHERENT 0x010 /* M: enforce memory coherence (SMP systems) */
365#define _PAGE_NO_CACHE 0x020 /* I: cache inhibit */
366#define _PAGE_WRITETHRU 0x040 /* W: cache write-through */
367#define _PAGE_DIRTY 0x080 /* C: page changed */
368#define _PAGE_ACCESSED 0x100 /* R: page referenced */
369#define _PAGE_EXEC 0x200 /* software: i-cache coherency required */
370#define _PAGE_RW 0x400 /* software: user write access allowed */
371#define _PAGE_SPECIAL 0x800 /* software: Special page */
372
373#ifdef CONFIG_PTE_64BIT
374/* We never clear the high word of the pte */
375#define _PTE_NONE_MASK (0xffffffff00000000ULL | _PAGE_HASHPTE)
376#else
377#define _PTE_NONE_MASK _PAGE_HASHPTE
378#endif 98#endif
379 99
380#define _PMD_PRESENT 0 100/* And here we include common definitions */
381#define _PMD_PRESENT_MASK (PAGE_MASK) 101#include <asm/pte-common.h>
382#define _PMD_BAD (~PAGE_MASK)
383
384/* Hash table based platforms need atomic updates of the linux PTE */
385#define PTE_ATOMIC_UPDATES 1
386
387#define __HAVE_ARCH_PTE_SPECIAL
388
389#endif
390
391/*
392 * Some bits are only used on some cpu families...
393 */
394#ifndef _PAGE_HASHPTE
395#define _PAGE_HASHPTE 0
396#endif
397#ifndef _PTE_NONE_MASK
398#define _PTE_NONE_MASK 0
399#endif
400#ifndef _PAGE_SHARED
401#define _PAGE_SHARED 0
402#endif
403#ifndef _PAGE_HWWRITE
404#define _PAGE_HWWRITE 0
405#endif
406#ifndef _PAGE_HWEXEC
407#define _PAGE_HWEXEC 0
408#endif
409#ifndef _PAGE_EXEC
410#define _PAGE_EXEC 0
411#endif
412#ifndef _PAGE_ENDIAN
413#define _PAGE_ENDIAN 0
414#endif
415#ifndef _PAGE_COHERENT
416#define _PAGE_COHERENT 0
417#endif
418#ifndef _PAGE_WRITETHRU
419#define _PAGE_WRITETHRU 0
420#endif
421#ifndef _PAGE_SPECIAL
422#define _PAGE_SPECIAL 0
423#endif
424#ifndef _PMD_PRESENT_MASK
425#define _PMD_PRESENT_MASK _PMD_PRESENT
426#endif
427#ifndef _PMD_SIZE
428#define _PMD_SIZE 0
429#define PMD_PAGE_SIZE(pmd) bad_call_to_PMD_PAGE_SIZE()
430#endif
431
432#define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY | \
433 _PAGE_SPECIAL)
434
435
436#define PAGE_PROT_BITS (_PAGE_GUARDED | _PAGE_COHERENT | _PAGE_NO_CACHE | \
437 _PAGE_WRITETHRU | _PAGE_ENDIAN | \
438 _PAGE_USER | _PAGE_ACCESSED | \
439 _PAGE_RW | _PAGE_HWWRITE | _PAGE_DIRTY | \
440 _PAGE_EXEC | _PAGE_HWEXEC)
441
442/*
443 * We define 2 sets of base prot bits, one for basic pages (ie,
444 * cacheable kernel and user pages) and one for non cacheable
445 * pages. We always set _PAGE_COHERENT when SMP is enabled or
446 * the processor might need it for DMA coherency.
447 */
448#if defined(CONFIG_SMP) || defined(CONFIG_PPC_STD_MMU)
449#define _PAGE_BASE (_PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_COHERENT)
450#else
451#define _PAGE_BASE (_PAGE_PRESENT | _PAGE_ACCESSED)
452#endif
453#define _PAGE_BASE_NC (_PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_NO_CACHE)
454
455#define _PAGE_WRENABLE (_PAGE_RW | _PAGE_DIRTY | _PAGE_HWWRITE)
456#define _PAGE_KERNEL (_PAGE_BASE | _PAGE_SHARED | _PAGE_WRENABLE)
457#define _PAGE_KERNEL_NC (_PAGE_BASE_NC | _PAGE_SHARED | _PAGE_WRENABLE)
458
459#ifdef CONFIG_PPC_STD_MMU
460/* On standard PPC MMU, no user access implies kernel read/write access,
461 * so to write-protect kernel memory we must turn on user access */
462#define _PAGE_KERNEL_RO (_PAGE_BASE | _PAGE_SHARED | _PAGE_USER)
463#else
464#define _PAGE_KERNEL_RO (_PAGE_BASE | _PAGE_SHARED)
465#endif
466
467#define _PAGE_IO (_PAGE_KERNEL_NC | _PAGE_GUARDED)
468#define _PAGE_RAM (_PAGE_KERNEL | _PAGE_HWEXEC)
469
470#if defined(CONFIG_KGDB) || defined(CONFIG_XMON) || defined(CONFIG_BDI_SWITCH) ||\
471 defined(CONFIG_KPROBES)
472/* We want the debuggers to be able to set breakpoints anywhere, so
473 * don't write protect the kernel text */
474#define _PAGE_RAM_TEXT _PAGE_RAM
475#else
476#define _PAGE_RAM_TEXT (_PAGE_KERNEL_RO | _PAGE_HWEXEC)
477#endif
478
479#define PAGE_NONE __pgprot(_PAGE_BASE)
480#define PAGE_READONLY __pgprot(_PAGE_BASE | _PAGE_USER)
481#define PAGE_READONLY_X __pgprot(_PAGE_BASE | _PAGE_USER | _PAGE_EXEC)
482#define PAGE_SHARED __pgprot(_PAGE_BASE | _PAGE_USER | _PAGE_RW)
483#define PAGE_SHARED_X __pgprot(_PAGE_BASE | _PAGE_USER | _PAGE_RW | _PAGE_EXEC)
484#define PAGE_COPY __pgprot(_PAGE_BASE | _PAGE_USER)
485#define PAGE_COPY_X __pgprot(_PAGE_BASE | _PAGE_USER | _PAGE_EXEC)
486
487#define PAGE_KERNEL __pgprot(_PAGE_RAM)
488#define PAGE_KERNEL_NOCACHE __pgprot(_PAGE_IO)
489
490/*
491 * The PowerPC can only do execute protection on a segment (256MB) basis,
492 * not on a page basis. So we consider execute permission the same as read.
493 * Also, write permissions imply read permissions.
494 * This is the closest we can get..
495 */
496#define __P000 PAGE_NONE
497#define __P001 PAGE_READONLY_X
498#define __P010 PAGE_COPY
499#define __P011 PAGE_COPY_X
500#define __P100 PAGE_READONLY
501#define __P101 PAGE_READONLY_X
502#define __P110 PAGE_COPY
503#define __P111 PAGE_COPY_X
504
505#define __S000 PAGE_NONE
506#define __S001 PAGE_READONLY_X
507#define __S010 PAGE_SHARED
508#define __S011 PAGE_SHARED_X
509#define __S100 PAGE_READONLY
510#define __S101 PAGE_READONLY_X
511#define __S110 PAGE_SHARED
512#define __S111 PAGE_SHARED_X
513 102
514#ifndef __ASSEMBLY__ 103#ifndef __ASSEMBLY__
515/* Make sure we get a link error if PMD_PAGE_SIZE is ever called on a
516 * kernel without large page PMD support */
517extern unsigned long bad_call_to_PMD_PAGE_SIZE(void);
518
519/*
520 * Conversions between PTE values and page frame numbers.
521 */
522
523/* in some case we want to additionaly adjust where the pfn is in the pte to
524 * allow room for more flags */
525#if defined(CONFIG_FSL_BOOKE) && defined(CONFIG_PTE_64BIT)
526#define PFN_SHIFT_OFFSET (PAGE_SHIFT + 8)
527#else
528#define PFN_SHIFT_OFFSET (PAGE_SHIFT)
529#endif
530 104
531#define pte_pfn(x) (pte_val(x) >> PFN_SHIFT_OFFSET)
532#define pte_page(x) pfn_to_page(pte_pfn(x))
533
534#define pfn_pte(pfn, prot) __pte(((pte_basic_t)(pfn) << PFN_SHIFT_OFFSET) |\
535 pgprot_val(prot))
536#define mk_pte(page, prot) pfn_pte(page_to_pfn(page), prot)
537#endif /* __ASSEMBLY__ */
538
539#define pte_none(pte) ((pte_val(pte) & ~_PTE_NONE_MASK) == 0)
540#define pte_present(pte) (pte_val(pte) & _PAGE_PRESENT)
541#define pte_clear(mm, addr, ptep) \ 105#define pte_clear(mm, addr, ptep) \
542 do { pte_update(ptep, ~_PAGE_HASHPTE, 0); } while (0) 106 do { pte_update(ptep, ~_PAGE_HASHPTE, 0); } while (0)
543 107
@@ -546,43 +110,6 @@ extern unsigned long bad_call_to_PMD_PAGE_SIZE(void);
546#define pmd_present(pmd) (pmd_val(pmd) & _PMD_PRESENT_MASK) 110#define pmd_present(pmd) (pmd_val(pmd) & _PMD_PRESENT_MASK)
547#define pmd_clear(pmdp) do { pmd_val(*(pmdp)) = 0; } while (0) 111#define pmd_clear(pmdp) do { pmd_val(*(pmdp)) = 0; } while (0)
548 112
549#ifndef __ASSEMBLY__
550/*
551 * The following only work if pte_present() is true.
552 * Undefined behaviour if not..
553 */
554static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_RW; }
555static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; }
556static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; }
557static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; }
558static inline int pte_special(pte_t pte) { return pte_val(pte) & _PAGE_SPECIAL; }
559
560static inline pte_t pte_wrprotect(pte_t pte) {
561 pte_val(pte) &= ~(_PAGE_RW | _PAGE_HWWRITE); return pte; }
562static inline pte_t pte_mkclean(pte_t pte) {
563 pte_val(pte) &= ~(_PAGE_DIRTY | _PAGE_HWWRITE); return pte; }
564static inline pte_t pte_mkold(pte_t pte) {
565 pte_val(pte) &= ~_PAGE_ACCESSED; return pte; }
566
567static inline pte_t pte_mkwrite(pte_t pte) {
568 pte_val(pte) |= _PAGE_RW; return pte; }
569static inline pte_t pte_mkdirty(pte_t pte) {
570 pte_val(pte) |= _PAGE_DIRTY; return pte; }
571static inline pte_t pte_mkyoung(pte_t pte) {
572 pte_val(pte) |= _PAGE_ACCESSED; return pte; }
573static inline pte_t pte_mkspecial(pte_t pte) {
574 pte_val(pte) |= _PAGE_SPECIAL; return pte; }
575static inline pgprot_t pte_pgprot(pte_t pte)
576{
577 return __pgprot(pte_val(pte) & PAGE_PROT_BITS);
578}
579
580static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
581{
582 pte_val(pte) = (pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot);
583 return pte;
584}
585
586/* 113/*
587 * When flushing the tlb entry for a page, we also need to flush the hash 114 * When flushing the tlb entry for a page, we also need to flush the hash
588 * table entry. flush_hash_pages is assembler (for speed) in hashtable.S. 115 * table entry. flush_hash_pages is assembler (for speed) in hashtable.S.
@@ -599,11 +126,19 @@ extern void flush_hash_entry(struct mm_struct *mm, pte_t *ptep,
599 unsigned long address); 126 unsigned long address);
600 127
601/* 128/*
602 * Atomic PTE updates. 129 * PTE updates. This function is called whenever an existing
130 * valid PTE is updated. This does -not- include set_pte_at()
131 * which nowadays only sets a new PTE.
603 * 132 *
604 * pte_update clears and sets bit atomically, and returns 133 * Depending on the type of MMU, we may need to use atomic updates
605 * the old pte value. In the 64-bit PTE case we lock around the 134 * and the PTE may be either 32 or 64 bit wide. In the later case,
606 * low PTE word since we expect ALL flag bits to be there 135 * when using atomic updates, only the low part of the PTE is
136 * accessed atomically.
137 *
138 * In addition, on 44x, we also maintain a global flag indicating
139 * that an executable user mapping was modified, which is needed
140 * to properly flush the virtually tagged instruction cache of
141 * those implementations.
607 */ 142 */
608#ifndef CONFIG_PTE_64BIT 143#ifndef CONFIG_PTE_64BIT
609static inline unsigned long pte_update(pte_t *p, 144static inline unsigned long pte_update(pte_t *p,
@@ -668,44 +203,6 @@ static inline unsigned long long pte_update(pte_t *p,
668#endif /* CONFIG_PTE_64BIT */ 203#endif /* CONFIG_PTE_64BIT */
669 204
670/* 205/*
671 * set_pte stores a linux PTE into the linux page table.
672 * On machines which use an MMU hash table we avoid changing the
673 * _PAGE_HASHPTE bit.
674 */
675
676static inline void __set_pte_at(struct mm_struct *mm, unsigned long addr,
677 pte_t *ptep, pte_t pte)
678{
679#if (_PAGE_HASHPTE != 0) && defined(CONFIG_SMP) && !defined(CONFIG_PTE_64BIT)
680 pte_update(ptep, ~_PAGE_HASHPTE, pte_val(pte) & ~_PAGE_HASHPTE);
681#elif defined(CONFIG_PTE_64BIT) && defined(CONFIG_SMP)
682#if _PAGE_HASHPTE != 0
683 if (pte_val(*ptep) & _PAGE_HASHPTE)
684 flush_hash_entry(mm, ptep, addr);
685#endif
686 __asm__ __volatile__("\
687 stw%U0%X0 %2,%0\n\
688 eieio\n\
689 stw%U0%X0 %L2,%1"
690 : "=m" (*ptep), "=m" (*((unsigned char *)ptep+4))
691 : "r" (pte) : "memory");
692#else
693 *ptep = __pte((pte_val(*ptep) & _PAGE_HASHPTE)
694 | (pte_val(pte) & ~_PAGE_HASHPTE));
695#endif
696}
697
698
699static inline void set_pte_at(struct mm_struct *mm, unsigned long addr,
700 pte_t *ptep, pte_t pte)
701{
702#if defined(CONFIG_PTE_64BIT) && defined(CONFIG_SMP) && defined(CONFIG_DEBUG_VM)
703 WARN_ON(pte_present(*ptep));
704#endif
705 __set_pte_at(mm, addr, ptep, pte);
706}
707
708/*
709 * 2.6 calls this without flushing the TLB entry; this is wrong 206 * 2.6 calls this without flushing the TLB entry; this is wrong
710 * for our hash-based implementation, we fix that up here. 207 * for our hash-based implementation, we fix that up here.
711 */ 208 */
@@ -745,24 +242,14 @@ static inline void huge_ptep_set_wrprotect(struct mm_struct *mm,
745} 242}
746 243
747 244
748#define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS 245static inline void __ptep_set_access_flags(pte_t *ptep, pte_t entry)
749static inline void __ptep_set_access_flags(pte_t *ptep, pte_t entry, int dirty)
750{ 246{
751 unsigned long bits = pte_val(entry) & 247 unsigned long bits = pte_val(entry) &
752 (_PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_RW); 248 (_PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_RW |
249 _PAGE_HWEXEC | _PAGE_EXEC);
753 pte_update(ptep, 0, bits); 250 pte_update(ptep, 0, bits);
754} 251}
755 252
756#define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \
757({ \
758 int __changed = !pte_same(*(__ptep), __entry); \
759 if (__changed) { \
760 __ptep_set_access_flags(__ptep, __entry, __dirty); \
761 flush_tlb_page_nohash(__vma, __address); \
762 } \
763 __changed; \
764})
765
766#define __HAVE_ARCH_PTE_SAME 253#define __HAVE_ARCH_PTE_SAME
767#define pte_same(A,B) (((pte_val(A) ^ pte_val(B)) & ~_PAGE_HASHPTE) == 0) 254#define pte_same(A,B) (((pte_val(A) ^ pte_val(B)) & ~_PAGE_HASHPTE) == 0)
768 255
diff --git a/arch/powerpc/include/asm/pgtable-4k.h b/arch/powerpc/include/asm/pgtable-ppc64-4k.h
index 1dbca4e7de67..6eefdcffa359 100644
--- a/arch/powerpc/include/asm/pgtable-4k.h
+++ b/arch/powerpc/include/asm/pgtable-ppc64-4k.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_POWERPC_PGTABLE_4K_H 1#ifndef _ASM_POWERPC_PGTABLE_PPC64_4K_H
2#define _ASM_POWERPC_PGTABLE_4K_H 2#define _ASM_POWERPC_PGTABLE_PPC64_4K_H
3/* 3/*
4 * Entries per page directory level. The PTE level must use a 64b record 4 * Entries per page directory level. The PTE level must use a 64b record
5 * for each page table entry. The PMD and PGD level use a 32b record for 5 * for each page table entry. The PMD and PGD level use a 32b record for
@@ -40,28 +40,6 @@
40#define PGDIR_SIZE (1UL << PGDIR_SHIFT) 40#define PGDIR_SIZE (1UL << PGDIR_SHIFT)
41#define PGDIR_MASK (~(PGDIR_SIZE-1)) 41#define PGDIR_MASK (~(PGDIR_SIZE-1))
42 42
43/* PTE bits */
44#define _PAGE_HASHPTE 0x0400 /* software: pte has an associated HPTE */
45#define _PAGE_SECONDARY 0x8000 /* software: HPTE is in secondary group */
46#define _PAGE_GROUP_IX 0x7000 /* software: HPTE index within group */
47#define _PAGE_F_SECOND _PAGE_SECONDARY
48#define _PAGE_F_GIX _PAGE_GROUP_IX
49#define _PAGE_SPECIAL 0x10000 /* software: special page */
50#define __HAVE_ARCH_PTE_SPECIAL
51
52/* PTE flags to conserve for HPTE identification */
53#define _PAGE_HPTEFLAGS (_PAGE_BUSY | _PAGE_HASHPTE | \
54 _PAGE_SECONDARY | _PAGE_GROUP_IX)
55
56/* There is no 4K PFN hack on 4K pages */
57#define _PAGE_4K_PFN 0
58
59/* PAGE_MASK gives the right answer below, but only by accident */
60/* It should be preserving the high 48 bits and then specifically */
61/* preserving _PAGE_SECONDARY | _PAGE_GROUP_IX */
62#define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY | \
63 _PAGE_HPTEFLAGS | _PAGE_SPECIAL)
64
65/* Bits to mask out from a PMD to get to the PTE page */ 43/* Bits to mask out from a PMD to get to the PTE page */
66#define PMD_MASKED_BITS 0 44#define PMD_MASKED_BITS 0
67/* Bits to mask out from a PUD to get to the PMD page */ 45/* Bits to mask out from a PUD to get to the PMD page */
@@ -69,30 +47,6 @@
69/* Bits to mask out from a PGD to get to the PUD page */ 47/* Bits to mask out from a PGD to get to the PUD page */
70#define PGD_MASKED_BITS 0 48#define PGD_MASKED_BITS 0
71 49
72/* shift to put page number into pte */
73#define PTE_RPN_SHIFT (17)
74
75#ifdef STRICT_MM_TYPECHECKS
76#define __real_pte(e,p) ((real_pte_t){(e)})
77#define __rpte_to_pte(r) ((r).pte)
78#else
79#define __real_pte(e,p) (e)
80#define __rpte_to_pte(r) (__pte(r))
81#endif
82#define __rpte_to_hidx(r,index) (pte_val(__rpte_to_pte(r)) >> 12)
83
84#define pte_iterate_hashed_subpages(rpte, psize, va, index, shift) \
85 do { \
86 index = 0; \
87 shift = mmu_psize_defs[psize].shift; \
88
89#define pte_iterate_hashed_end() } while(0)
90
91#ifdef CONFIG_PPC_HAS_HASH_64K
92#define pte_pagesize_index(mm, addr, pte) get_slice_psize(mm, addr)
93#else
94#define pte_pagesize_index(mm, addr, pte) MMU_PAGE_4K
95#endif
96 50
97/* 51/*
98 * 4-level page tables related bits 52 * 4-level page tables related bits
@@ -112,6 +66,9 @@
112#define pud_ERROR(e) \ 66#define pud_ERROR(e) \
113 printk("%s:%d: bad pud %08lx.\n", __FILE__, __LINE__, pud_val(e)) 67 printk("%s:%d: bad pud %08lx.\n", __FILE__, __LINE__, pud_val(e))
114 68
69/*
70 * On all 4K setups, remap_4k_pfn() equates to remap_pfn_range() */
115#define remap_4k_pfn(vma, addr, pfn, prot) \ 71#define remap_4k_pfn(vma, addr, pfn, prot) \
116 remap_pfn_range((vma), (addr), (pfn), PAGE_SIZE, (prot)) 72 remap_pfn_range((vma), (addr), (pfn), PAGE_SIZE, (prot))
117#endif /* _ASM_POWERPC_PGTABLE_4K_H */ 73
74#endif /* _ASM_POWERPC_PGTABLE_PPC64_4K_H */
diff --git a/arch/powerpc/include/asm/pgtable-ppc64-64k.h b/arch/powerpc/include/asm/pgtable-ppc64-64k.h
new file mode 100644
index 000000000000..6cc085b945a5
--- /dev/null
+++ b/arch/powerpc/include/asm/pgtable-ppc64-64k.h
@@ -0,0 +1,42 @@
1#ifndef _ASM_POWERPC_PGTABLE_PPC64_64K_H
2#define _ASM_POWERPC_PGTABLE_PPC64_64K_H
3
4#include <asm-generic/pgtable-nopud.h>
5
6
7#define PTE_INDEX_SIZE 12
8#define PMD_INDEX_SIZE 12
9#define PUD_INDEX_SIZE 0
10#define PGD_INDEX_SIZE 4
11
12#ifndef __ASSEMBLY__
13
14#define PTE_TABLE_SIZE (sizeof(real_pte_t) << PTE_INDEX_SIZE)
15#define PMD_TABLE_SIZE (sizeof(pmd_t) << PMD_INDEX_SIZE)
16#define PGD_TABLE_SIZE (sizeof(pgd_t) << PGD_INDEX_SIZE)
17
18#define PTRS_PER_PTE (1 << PTE_INDEX_SIZE)
19#define PTRS_PER_PMD (1 << PMD_INDEX_SIZE)
20#define PTRS_PER_PGD (1 << PGD_INDEX_SIZE)
21
22/* With 4k base page size, hugepage PTEs go at the PMD level */
23#define MIN_HUGEPTE_SHIFT PAGE_SHIFT
24
25/* PMD_SHIFT determines what a second-level page table entry can map */
26#define PMD_SHIFT (PAGE_SHIFT + PTE_INDEX_SIZE)
27#define PMD_SIZE (1UL << PMD_SHIFT)
28#define PMD_MASK (~(PMD_SIZE-1))
29
30/* PGDIR_SHIFT determines what a third-level page table entry can map */
31#define PGDIR_SHIFT (PMD_SHIFT + PMD_INDEX_SIZE)
32#define PGDIR_SIZE (1UL << PGDIR_SHIFT)
33#define PGDIR_MASK (~(PGDIR_SIZE-1))
34
35#endif /* __ASSEMBLY__ */
36
37/* Bits to mask out from a PMD to get to the PTE page */
38#define PMD_MASKED_BITS 0x1ff
39/* Bits to mask out from a PGD/PUD to get to the PMD page */
40#define PUD_MASKED_BITS 0x1ff
41
42#endif /* _ASM_POWERPC_PGTABLE_PPC64_64K_H */
diff --git a/arch/powerpc/include/asm/pgtable-ppc64.h b/arch/powerpc/include/asm/pgtable-ppc64.h
index b0f18be81d9f..c40db05f21e0 100644
--- a/arch/powerpc/include/asm/pgtable-ppc64.h
+++ b/arch/powerpc/include/asm/pgtable-ppc64.h
@@ -11,9 +11,9 @@
11#endif /* __ASSEMBLY__ */ 11#endif /* __ASSEMBLY__ */
12 12
13#ifdef CONFIG_PPC_64K_PAGES 13#ifdef CONFIG_PPC_64K_PAGES
14#include <asm/pgtable-64k.h> 14#include <asm/pgtable-ppc64-64k.h>
15#else 15#else
16#include <asm/pgtable-4k.h> 16#include <asm/pgtable-ppc64-4k.h>
17#endif 17#endif
18 18
19#define FIRST_USER_ADDRESS 0 19#define FIRST_USER_ADDRESS 0
@@ -25,6 +25,8 @@
25 PUD_INDEX_SIZE + PGD_INDEX_SIZE + PAGE_SHIFT) 25 PUD_INDEX_SIZE + PGD_INDEX_SIZE + PAGE_SHIFT)
26#define PGTABLE_RANGE (ASM_CONST(1) << PGTABLE_EADDR_SIZE) 26#define PGTABLE_RANGE (ASM_CONST(1) << PGTABLE_EADDR_SIZE)
27 27
28
29/* Some sanity checking */
28#if TASK_SIZE_USER64 > PGTABLE_RANGE 30#if TASK_SIZE_USER64 > PGTABLE_RANGE
29#error TASK_SIZE_USER64 exceeds pagetable range 31#error TASK_SIZE_USER64 exceeds pagetable range
30#endif 32#endif
@@ -33,7 +35,6 @@
33#error TASK_SIZE_USER64 exceeds user VSID range 35#error TASK_SIZE_USER64 exceeds user VSID range
34#endif 36#endif
35 37
36
37/* 38/*
38 * Define the address range of the vmalloc VM area. 39 * Define the address range of the vmalloc VM area.
39 */ 40 */
@@ -76,83 +77,12 @@
76 77
77 78
78/* 79/*
79 * Common bits in a linux-style PTE. These match the bits in the 80 * Include the PTE bits definitions
80 * (hardware-defined) PowerPC PTE as closely as possible. Additional
81 * bits may be defined in pgtable-*.h
82 */ 81 */
83#define _PAGE_PRESENT 0x0001 /* software: pte contains a translation */ 82#include <asm/pte-hash64.h>
84#define _PAGE_USER 0x0002 /* matches one of the PP bits */ 83#include <asm/pte-common.h>
85#define _PAGE_FILE 0x0002 /* (!present only) software: pte holds file offset */
86#define _PAGE_EXEC 0x0004 /* No execute on POWER4 and newer (we invert) */
87#define _PAGE_GUARDED 0x0008
88#define _PAGE_COHERENT 0x0010 /* M: enforce memory coherence (SMP systems) */
89#define _PAGE_NO_CACHE 0x0020 /* I: cache inhibit */
90#define _PAGE_WRITETHRU 0x0040 /* W: cache write-through */
91#define _PAGE_DIRTY 0x0080 /* C: page changed */
92#define _PAGE_ACCESSED 0x0100 /* R: page referenced */
93#define _PAGE_RW 0x0200 /* software: user write access allowed */
94#define _PAGE_BUSY 0x0800 /* software: PTE & hash are busy */
95
96/* Strong Access Ordering */
97#define _PAGE_SAO (_PAGE_WRITETHRU | _PAGE_NO_CACHE | _PAGE_COHERENT)
98
99#define _PAGE_BASE (_PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_COHERENT)
100
101#define _PAGE_WRENABLE (_PAGE_RW | _PAGE_DIRTY)
102
103/* __pgprot defined in arch/powerpc/include/asm/page.h */
104#define PAGE_NONE __pgprot(_PAGE_PRESENT | _PAGE_ACCESSED)
105
106#define PAGE_SHARED __pgprot(_PAGE_BASE | _PAGE_RW | _PAGE_USER)
107#define PAGE_SHARED_X __pgprot(_PAGE_BASE | _PAGE_RW | _PAGE_USER | _PAGE_EXEC)
108#define PAGE_COPY __pgprot(_PAGE_BASE | _PAGE_USER)
109#define PAGE_COPY_X __pgprot(_PAGE_BASE | _PAGE_USER | _PAGE_EXEC)
110#define PAGE_READONLY __pgprot(_PAGE_BASE | _PAGE_USER)
111#define PAGE_READONLY_X __pgprot(_PAGE_BASE | _PAGE_USER | _PAGE_EXEC)
112#define PAGE_KERNEL __pgprot(_PAGE_BASE | _PAGE_WRENABLE)
113#define PAGE_KERNEL_CI __pgprot(_PAGE_PRESENT | _PAGE_ACCESSED | \
114 _PAGE_WRENABLE | _PAGE_NO_CACHE | _PAGE_GUARDED)
115#define PAGE_KERNEL_EXEC __pgprot(_PAGE_BASE | _PAGE_WRENABLE | _PAGE_EXEC)
116
117#define PAGE_AGP __pgprot(_PAGE_BASE | _PAGE_WRENABLE | _PAGE_NO_CACHE)
118#define HAVE_PAGE_AGP
119
120#define PAGE_PROT_BITS (_PAGE_GUARDED | _PAGE_COHERENT | \
121 _PAGE_NO_CACHE | _PAGE_WRITETHRU | \
122 _PAGE_4K_PFN | _PAGE_RW | _PAGE_USER | \
123 _PAGE_ACCESSED | _PAGE_DIRTY | _PAGE_EXEC)
124/* PTEIDX nibble */
125#define _PTEIDX_SECONDARY 0x8
126#define _PTEIDX_GROUP_IX 0x7
127 84
128 85
129/*
130 * POWER4 and newer have per page execute protection, older chips can only
131 * do this on a segment (256MB) basis.
132 *
133 * Also, write permissions imply read permissions.
134 * This is the closest we can get..
135 *
136 * Note due to the way vm flags are laid out, the bits are XWR
137 */
138#define __P000 PAGE_NONE
139#define __P001 PAGE_READONLY
140#define __P010 PAGE_COPY
141#define __P011 PAGE_COPY
142#define __P100 PAGE_READONLY_X
143#define __P101 PAGE_READONLY_X
144#define __P110 PAGE_COPY_X
145#define __P111 PAGE_COPY_X
146
147#define __S000 PAGE_NONE
148#define __S001 PAGE_READONLY
149#define __S010 PAGE_SHARED
150#define __S011 PAGE_SHARED
151#define __S100 PAGE_READONLY_X
152#define __S101 PAGE_READONLY_X
153#define __S110 PAGE_SHARED_X
154#define __S111 PAGE_SHARED_X
155
156#ifdef CONFIG_PPC_MM_SLICES 86#ifdef CONFIG_PPC_MM_SLICES
157#define HAVE_ARCH_UNMAPPED_AREA 87#define HAVE_ARCH_UNMAPPED_AREA
158#define HAVE_ARCH_UNMAPPED_AREA_TOPDOWN 88#define HAVE_ARCH_UNMAPPED_AREA_TOPDOWN
@@ -161,32 +91,38 @@
161#ifndef __ASSEMBLY__ 91#ifndef __ASSEMBLY__
162 92
163/* 93/*
164 * Conversion functions: convert a page and protection to a page entry, 94 * This is the default implementation of various PTE accessors, it's
165 * and a page entry and page directory to the page they refer to. 95 * used in all cases except Book3S with 64K pages where we have a
166 * 96 * concept of sub-pages
167 * mk_pte takes a (struct page *) as input
168 */ 97 */
169#define mk_pte(page, pgprot) pfn_pte(page_to_pfn(page), (pgprot)) 98#ifndef __real_pte
170 99
171static inline pte_t pfn_pte(unsigned long pfn, pgprot_t pgprot) 100#ifdef STRICT_MM_TYPECHECKS
172{ 101#define __real_pte(e,p) ((real_pte_t){(e)})
173 pte_t pte; 102#define __rpte_to_pte(r) ((r).pte)
103#else
104#define __real_pte(e,p) (e)
105#define __rpte_to_pte(r) (__pte(r))
106#endif
107#define __rpte_to_hidx(r,index) (pte_val(__rpte_to_pte(r)) >> 12)
174 108
109#define pte_iterate_hashed_subpages(rpte, psize, va, index, shift) \
110 do { \
111 index = 0; \
112 shift = mmu_psize_defs[psize].shift; \
175 113
176 pte_val(pte) = (pfn << PTE_RPN_SHIFT) | pgprot_val(pgprot); 114#define pte_iterate_hashed_end() } while(0)
177 return pte;
178}
179 115
180#define pte_modify(_pte, newprot) \ 116#ifdef CONFIG_PPC_HAS_HASH_64K
181 (__pte((pte_val(_pte) & _PAGE_CHG_MASK) | pgprot_val(newprot))) 117#define pte_pagesize_index(mm, addr, pte) get_slice_psize(mm, addr)
118#else
119#define pte_pagesize_index(mm, addr, pte) MMU_PAGE_4K
120#endif
182 121
183#define pte_none(pte) ((pte_val(pte) & ~_PAGE_HPTEFLAGS) == 0) 122#endif /* __real_pte */
184#define pte_present(pte) (pte_val(pte) & _PAGE_PRESENT)
185 123
186/* pte_clear moved to later in this file */
187 124
188#define pte_pfn(x) ((unsigned long)((pte_val(x)>>PTE_RPN_SHIFT))) 125/* pte_clear moved to later in this file */
189#define pte_page(x) pfn_to_page(pte_pfn(x))
190 126
191#define PMD_BAD_BITS (PTE_TABLE_SIZE-1) 127#define PMD_BAD_BITS (PTE_TABLE_SIZE-1)
192#define PUD_BAD_BITS (PMD_TABLE_SIZE-1) 128#define PUD_BAD_BITS (PMD_TABLE_SIZE-1)
@@ -235,36 +171,6 @@ static inline pte_t pfn_pte(unsigned long pfn, pgprot_t pgprot)
235/* This now only contains the vmalloc pages */ 171/* This now only contains the vmalloc pages */
236#define pgd_offset_k(address) pgd_offset(&init_mm, address) 172#define pgd_offset_k(address) pgd_offset(&init_mm, address)
237 173
238/*
239 * The following only work if pte_present() is true.
240 * Undefined behaviour if not..
241 */
242static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_RW;}
243static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY;}
244static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED;}
245static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE;}
246static inline int pte_special(pte_t pte) { return pte_val(pte) & _PAGE_SPECIAL; }
247
248static inline pte_t pte_wrprotect(pte_t pte) {
249 pte_val(pte) &= ~(_PAGE_RW); return pte; }
250static inline pte_t pte_mkclean(pte_t pte) {
251 pte_val(pte) &= ~(_PAGE_DIRTY); return pte; }
252static inline pte_t pte_mkold(pte_t pte) {
253 pte_val(pte) &= ~_PAGE_ACCESSED; return pte; }
254static inline pte_t pte_mkwrite(pte_t pte) {
255 pte_val(pte) |= _PAGE_RW; return pte; }
256static inline pte_t pte_mkdirty(pte_t pte) {
257 pte_val(pte) |= _PAGE_DIRTY; return pte; }
258static inline pte_t pte_mkyoung(pte_t pte) {
259 pte_val(pte) |= _PAGE_ACCESSED; return pte; }
260static inline pte_t pte_mkhuge(pte_t pte) {
261 return pte; }
262static inline pte_t pte_mkspecial(pte_t pte) {
263 pte_val(pte) |= _PAGE_SPECIAL; return pte; }
264static inline pgprot_t pte_pgprot(pte_t pte)
265{
266 return __pgprot(pte_val(pte) & PAGE_PROT_BITS);
267}
268 174
269/* Atomic PTE updates */ 175/* Atomic PTE updates */
270static inline unsigned long pte_update(struct mm_struct *mm, 176static inline unsigned long pte_update(struct mm_struct *mm,
@@ -272,6 +178,7 @@ static inline unsigned long pte_update(struct mm_struct *mm,
272 pte_t *ptep, unsigned long clr, 178 pte_t *ptep, unsigned long clr,
273 int huge) 179 int huge)
274{ 180{
181#ifdef PTE_ATOMIC_UPDATES
275 unsigned long old, tmp; 182 unsigned long old, tmp;
276 183
277 __asm__ __volatile__( 184 __asm__ __volatile__(
@@ -284,6 +191,13 @@ static inline unsigned long pte_update(struct mm_struct *mm,
284 : "=&r" (old), "=&r" (tmp), "=m" (*ptep) 191 : "=&r" (old), "=&r" (tmp), "=m" (*ptep)
285 : "r" (ptep), "r" (clr), "m" (*ptep), "i" (_PAGE_BUSY) 192 : "r" (ptep), "r" (clr), "m" (*ptep), "i" (_PAGE_BUSY)
286 : "cc" ); 193 : "cc" );
194#else
195 unsigned long old = pte_val(*ptep);
196 *ptep = __pte(old & ~clr);
197#endif
198 /* huge pages use the old page table lock */
199 if (!huge)
200 assert_pte_locked(mm, addr);
287 201
288 if (old & _PAGE_HASHPTE) 202 if (old & _PAGE_HASHPTE)
289 hpte_need_flush(mm, addr, ptep, old, huge); 203 hpte_need_flush(mm, addr, ptep, old, huge);
@@ -359,26 +273,17 @@ static inline void pte_clear(struct mm_struct *mm, unsigned long addr,
359 pte_update(mm, addr, ptep, ~0UL, 0); 273 pte_update(mm, addr, ptep, ~0UL, 0);
360} 274}
361 275
362/*
363 * set_pte stores a linux PTE into the linux page table.
364 */
365static inline void set_pte_at(struct mm_struct *mm, unsigned long addr,
366 pte_t *ptep, pte_t pte)
367{
368 if (pte_present(*ptep))
369 pte_clear(mm, addr, ptep);
370 pte = __pte(pte_val(pte) & ~_PAGE_HPTEFLAGS);
371 *ptep = pte;
372}
373 276
374/* Set the dirty and/or accessed bits atomically in a linux PTE, this 277/* Set the dirty and/or accessed bits atomically in a linux PTE, this
375 * function doesn't need to flush the hash entry 278 * function doesn't need to flush the hash entry
376 */ 279 */
377#define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS 280static inline void __ptep_set_access_flags(pte_t *ptep, pte_t entry)
378static inline void __ptep_set_access_flags(pte_t *ptep, pte_t entry, int dirty)
379{ 281{
380 unsigned long bits = pte_val(entry) & 282 unsigned long bits = pte_val(entry) &
381 (_PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_RW | _PAGE_EXEC); 283 (_PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_RW |
284 _PAGE_EXEC | _PAGE_HWEXEC);
285
286#ifdef PTE_ATOMIC_UPDATES
382 unsigned long old, tmp; 287 unsigned long old, tmp;
383 288
384 __asm__ __volatile__( 289 __asm__ __volatile__(
@@ -391,16 +296,11 @@ static inline void __ptep_set_access_flags(pte_t *ptep, pte_t entry, int dirty)
391 :"=&r" (old), "=&r" (tmp), "=m" (*ptep) 296 :"=&r" (old), "=&r" (tmp), "=m" (*ptep)
392 :"r" (bits), "r" (ptep), "m" (*ptep), "i" (_PAGE_BUSY) 297 :"r" (bits), "r" (ptep), "m" (*ptep), "i" (_PAGE_BUSY)
393 :"cc"); 298 :"cc");
299#else
300 unsigned long old = pte_val(*ptep);
301 *ptep = __pte(old | bits);
302#endif
394} 303}
395#define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \
396({ \
397 int __changed = !pte_same(*(__ptep), __entry); \
398 if (__changed) { \
399 __ptep_set_access_flags(__ptep, __entry, __dirty); \
400 flush_tlb_page_nohash(__vma, __address); \
401 } \
402 __changed; \
403})
404 304
405#define __HAVE_ARCH_PTE_SAME 305#define __HAVE_ARCH_PTE_SAME
406#define pte_same(A,B) (((pte_val(A) ^ pte_val(B)) & ~_PAGE_HPTEFLAGS) == 0) 306#define pte_same(A,B) (((pte_val(A) ^ pte_val(B)) & ~_PAGE_HPTEFLAGS) == 0)
diff --git a/arch/powerpc/include/asm/pgtable.h b/arch/powerpc/include/asm/pgtable.h
index 07f55e601696..eb17da781128 100644
--- a/arch/powerpc/include/asm/pgtable.h
+++ b/arch/powerpc/include/asm/pgtable.h
@@ -6,7 +6,17 @@
6#include <asm/processor.h> /* For TASK_SIZE */ 6#include <asm/processor.h> /* For TASK_SIZE */
7#include <asm/mmu.h> 7#include <asm/mmu.h>
8#include <asm/page.h> 8#include <asm/page.h>
9
9struct mm_struct; 10struct mm_struct;
11
12#ifdef CONFIG_DEBUG_VM
13extern void assert_pte_locked(struct mm_struct *mm, unsigned long addr);
14#else /* CONFIG_DEBUG_VM */
15static inline void assert_pte_locked(struct mm_struct *mm, unsigned long addr)
16{
17}
18#endif /* !CONFIG_DEBUG_VM */
19
10#endif /* !__ASSEMBLY__ */ 20#endif /* !__ASSEMBLY__ */
11 21
12#if defined(CONFIG_PPC64) 22#if defined(CONFIG_PPC64)
@@ -17,6 +27,130 @@ struct mm_struct;
17 27
18#ifndef __ASSEMBLY__ 28#ifndef __ASSEMBLY__
19 29
30/* Generic accessors to PTE bits */
31static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_RW; }
32static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; }
33static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; }
34static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; }
35static inline int pte_special(pte_t pte) { return pte_val(pte) & _PAGE_SPECIAL; }
36static inline int pte_present(pte_t pte) { return pte_val(pte) & _PAGE_PRESENT; }
37static inline int pte_none(pte_t pte) { return (pte_val(pte) & ~_PTE_NONE_MASK) == 0; }
38static inline pgprot_t pte_pgprot(pte_t pte) { return __pgprot(pte_val(pte) & PAGE_PROT_BITS); }
39
40/* Conversion functions: convert a page and protection to a page entry,
41 * and a page entry and page directory to the page they refer to.
42 *
43 * Even if PTEs can be unsigned long long, a PFN is always an unsigned
44 * long for now.
45 */
46static inline pte_t pfn_pte(unsigned long pfn, pgprot_t pgprot) {
47 return __pte(((pte_basic_t)(pfn) << PTE_RPN_SHIFT) |
48 pgprot_val(pgprot)); }
49static inline unsigned long pte_pfn(pte_t pte) {
50 return pte_val(pte) >> PTE_RPN_SHIFT; }
51
52/* Keep these as a macros to avoid include dependency mess */
53#define pte_page(x) pfn_to_page(pte_pfn(x))
54#define mk_pte(page, pgprot) pfn_pte(page_to_pfn(page), (pgprot))
55
56/* Generic modifiers for PTE bits */
57static inline pte_t pte_wrprotect(pte_t pte) {
58 pte_val(pte) &= ~(_PAGE_RW | _PAGE_HWWRITE); return pte; }
59static inline pte_t pte_mkclean(pte_t pte) {
60 pte_val(pte) &= ~(_PAGE_DIRTY | _PAGE_HWWRITE); return pte; }
61static inline pte_t pte_mkold(pte_t pte) {
62 pte_val(pte) &= ~_PAGE_ACCESSED; return pte; }
63static inline pte_t pte_mkwrite(pte_t pte) {
64 pte_val(pte) |= _PAGE_RW; return pte; }
65static inline pte_t pte_mkdirty(pte_t pte) {
66 pte_val(pte) |= _PAGE_DIRTY; return pte; }
67static inline pte_t pte_mkyoung(pte_t pte) {
68 pte_val(pte) |= _PAGE_ACCESSED; return pte; }
69static inline pte_t pte_mkspecial(pte_t pte) {
70 pte_val(pte) |= _PAGE_SPECIAL; return pte; }
71static inline pte_t pte_mkhuge(pte_t pte) {
72 return pte; }
73static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
74{
75 pte_val(pte) = (pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot);
76 return pte;
77}
78
79
80/* Insert a PTE, top-level function is out of line. It uses an inline
81 * low level function in the respective pgtable-* files
82 */
83extern void set_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *ptep,
84 pte_t pte);
85
86/* This low level function performs the actual PTE insertion
87 * Setting the PTE depends on the MMU type and other factors. It's
88 * an horrible mess that I'm not going to try to clean up now but
89 * I'm keeping it in one place rather than spread around
90 */
91static inline void __set_pte_at(struct mm_struct *mm, unsigned long addr,
92 pte_t *ptep, pte_t pte, int percpu)
93{
94#if defined(CONFIG_PPC_STD_MMU_32) && defined(CONFIG_SMP) && !defined(CONFIG_PTE_64BIT)
95 /* First case is 32-bit Hash MMU in SMP mode with 32-bit PTEs. We use the
96 * helper pte_update() which does an atomic update. We need to do that
97 * because a concurrent invalidation can clear _PAGE_HASHPTE. If it's a
98 * per-CPU PTE such as a kmap_atomic, we do a simple update preserving
99 * the hash bits instead (ie, same as the non-SMP case)
100 */
101 if (percpu)
102 *ptep = __pte((pte_val(*ptep) & _PAGE_HASHPTE)
103 | (pte_val(pte) & ~_PAGE_HASHPTE));
104 else
105 pte_update(ptep, ~_PAGE_HASHPTE, pte_val(pte));
106
107#elif defined(CONFIG_PPC32) && defined(CONFIG_PTE_64BIT) && defined(CONFIG_SMP)
108 /* Second case is 32-bit with 64-bit PTE in SMP mode. In this case, we
109 * can just store as long as we do the two halves in the right order
110 * with a barrier in between. This is possible because we take care,
111 * in the hash code, to pre-invalidate if the PTE was already hashed,
112 * which synchronizes us with any concurrent invalidation.
113 * In the percpu case, we also fallback to the simple update preserving
114 * the hash bits
115 */
116 if (percpu) {
117 *ptep = __pte((pte_val(*ptep) & _PAGE_HASHPTE)
118 | (pte_val(pte) & ~_PAGE_HASHPTE));
119 return;
120 }
121#if _PAGE_HASHPTE != 0
122 if (pte_val(*ptep) & _PAGE_HASHPTE)
123 flush_hash_entry(mm, ptep, addr);
124#endif
125 __asm__ __volatile__("\
126 stw%U0%X0 %2,%0\n\
127 eieio\n\
128 stw%U0%X0 %L2,%1"
129 : "=m" (*ptep), "=m" (*((unsigned char *)ptep+4))
130 : "r" (pte) : "memory");
131
132#elif defined(CONFIG_PPC_STD_MMU_32)
133 /* Third case is 32-bit hash table in UP mode, we need to preserve
134 * the _PAGE_HASHPTE bit since we may not have invalidated the previous
135 * translation in the hash yet (done in a subsequent flush_tlb_xxx())
136 * and see we need to keep track that this PTE needs invalidating
137 */
138 *ptep = __pte((pte_val(*ptep) & _PAGE_HASHPTE)
139 | (pte_val(pte) & ~_PAGE_HASHPTE));
140
141#else
142 /* Anything else just stores the PTE normally. That covers all 64-bit
143 * cases, and 32-bit non-hash with 64-bit PTEs in UP mode
144 */
145 *ptep = pte;
146#endif
147}
148
149
150#define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
151extern int ptep_set_access_flags(struct vm_area_struct *vma, unsigned long address,
152 pte_t *ptep, pte_t entry, int dirty);
153
20/* 154/*
21 * Macro to mark a page protection value as "uncacheable". 155 * Macro to mark a page protection value as "uncacheable".
22 */ 156 */
diff --git a/arch/powerpc/include/asm/ppc-opcode.h b/arch/powerpc/include/asm/ppc-opcode.h
new file mode 100644
index 000000000000..f4a4db8d5555
--- /dev/null
+++ b/arch/powerpc/include/asm/ppc-opcode.h
@@ -0,0 +1,73 @@
1/*
2 * Copyright 2009 Freescale Semicondutor, Inc.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
8 *
9 * provides masks and opcode images for use by code generation, emulation
10 * and for instructions that older assemblers might not know about
11 */
12#ifndef _ASM_POWERPC_PPC_OPCODE_H
13#define _ASM_POWERPC_PPC_OPCODE_H
14
15#include <linux/stringify.h>
16#include <asm/asm-compat.h>
17
18/* sorted alphabetically */
19#define PPC_INST_DCBA 0x7c0005ec
20#define PPC_INST_DCBA_MASK 0xfc0007fe
21#define PPC_INST_DCBAL 0x7c2005ec
22#define PPC_INST_DCBZL 0x7c2007ec
23#define PPC_INST_ISEL 0x7c00001e
24#define PPC_INST_ISEL_MASK 0xfc00003e
25#define PPC_INST_LSWI 0x7c0004aa
26#define PPC_INST_LSWX 0x7c00042a
27#define PPC_INST_LWSYNC 0x7c2004ac
28#define PPC_INST_MCRXR 0x7c000400
29#define PPC_INST_MCRXR_MASK 0xfc0007fe
30#define PPC_INST_MFSPR_PVR 0x7c1f42a6
31#define PPC_INST_MFSPR_PVR_MASK 0xfc1fffff
32#define PPC_INST_MSGSND 0x7c00019c
33#define PPC_INST_NOP 0x60000000
34#define PPC_INST_POPCNTB 0x7c0000f4
35#define PPC_INST_POPCNTB_MASK 0xfc0007fe
36#define PPC_INST_RFCI 0x4c000066
37#define PPC_INST_RFDI 0x4c00004e
38#define PPC_INST_RFMCI 0x4c00004c
39
40#define PPC_INST_STRING 0x7c00042a
41#define PPC_INST_STRING_MASK 0xfc0007fe
42#define PPC_INST_STRING_GEN_MASK 0xfc00067e
43
44#define PPC_INST_STSWI 0x7c0005aa
45#define PPC_INST_STSWX 0x7c00052a
46#define PPC_INST_TLBILX 0x7c000626
47#define PPC_INST_WAIT 0x7c00007c
48
49/* macros to insert fields into opcodes */
50#define __PPC_RA(a) ((a & 0x1f) << 16)
51#define __PPC_RB(b) ((b & 0x1f) << 11)
52#define __PPC_T_TLB(t) ((t & 0x3) << 21)
53#define __PPC_WC(w) ((w & 0x3) << 21)
54
55/* Deal with instructions that older assemblers aren't aware of */
56#define PPC_DCBAL(a, b) stringify_in_c(.long PPC_INST_DCBAL | \
57 __PPC_RA(a) | __PPC_RB(b))
58#define PPC_DCBZL(a, b) stringify_in_c(.long PPC_INST_DCBZL | \
59 __PPC_RA(a) | __PPC_RB(b))
60#define PPC_MSGSND(b) stringify_in_c(.long PPC_INST_MSGSND | \
61 __PPC_RB(b))
62#define PPC_RFCI stringify_in_c(.long PPC_INST_RFCI)
63#define PPC_RFDI stringify_in_c(.long PPC_INST_RFDI)
64#define PPC_RFMCI stringify_in_c(.long PPC_INST_RFMCI)
65#define PPC_TLBILX(t, a, b) stringify_in_c(.long PPC_INST_TLBILX | \
66 __PPC_T_TLB(t) | __PPC_RA(a) | __PPC_RB(b))
67#define PPC_TLBILX_ALL(a, b) PPC_TLBILX(0, a, b)
68#define PPC_TLBILX_PID(a, b) PPC_TLBILX(1, a, b)
69#define PPC_TLBILX_VA(a, b) PPC_TLBILX(3, a, b)
70#define PPC_WAIT(w) stringify_in_c(.long PPC_INST_WAIT | \
71 __PPC_WC(w))
72
73#endif /* _ASM_POWERPC_PPC_OPCODE_H */
diff --git a/arch/powerpc/include/asm/ppc_asm.h b/arch/powerpc/include/asm/ppc_asm.h
index 1a0d628eb114..f59a66684aed 100644
--- a/arch/powerpc/include/asm/ppc_asm.h
+++ b/arch/powerpc/include/asm/ppc_asm.h
@@ -7,6 +7,7 @@
7#include <linux/stringify.h> 7#include <linux/stringify.h>
8#include <asm/asm-compat.h> 8#include <asm/asm-compat.h>
9#include <asm/processor.h> 9#include <asm/processor.h>
10#include <asm/ppc-opcode.h>
10 11
11#ifndef __ASSEMBLY__ 12#ifndef __ASSEMBLY__
12#error __FILE__ should only be used in assembler files 13#error __FILE__ should only be used in assembler files
@@ -167,11 +168,6 @@ END_FTR_SECTION_IFCLR(CPU_FTR_PURR); \
167#define HMT_MEDIUM_HIGH or 5,5,5 # medium high priority 168#define HMT_MEDIUM_HIGH or 5,5,5 # medium high priority
168#define HMT_HIGH or 3,3,3 169#define HMT_HIGH or 3,3,3
169 170
170/* handle instructions that older assemblers may not know */
171#define RFCI .long 0x4c000066 /* rfci instruction */
172#define RFDI .long 0x4c00004e /* rfdi instruction */
173#define RFMCI .long 0x4c00004c /* rfmci instruction */
174
175#ifdef __KERNEL__ 171#ifdef __KERNEL__
176#ifdef CONFIG_PPC64 172#ifdef CONFIG_PPC64
177 173
diff --git a/arch/powerpc/include/asm/processor.h b/arch/powerpc/include/asm/processor.h
index d3466490104a..9eed29eee604 100644
--- a/arch/powerpc/include/asm/processor.h
+++ b/arch/powerpc/include/asm/processor.h
@@ -313,6 +313,25 @@ static inline void prefetchw(const void *x)
313#define HAVE_ARCH_PICK_MMAP_LAYOUT 313#define HAVE_ARCH_PICK_MMAP_LAYOUT
314#endif 314#endif
315 315
316#ifdef CONFIG_PPC64
317static inline unsigned long get_clean_sp(struct pt_regs *regs, int is_32)
318{
319 unsigned long sp;
320
321 if (is_32)
322 sp = regs->gpr[1] & 0x0ffffffffUL;
323 else
324 sp = regs->gpr[1];
325
326 return sp;
327}
328#else
329static inline unsigned long get_clean_sp(struct pt_regs *regs, int is_32)
330{
331 return regs->gpr[1];
332}
333#endif
334
316#endif /* __KERNEL__ */ 335#endif /* __KERNEL__ */
317#endif /* __ASSEMBLY__ */ 336#endif /* __ASSEMBLY__ */
318#endif /* _ASM_POWERPC_PROCESSOR_H */ 337#endif /* _ASM_POWERPC_PROCESSOR_H */
diff --git a/arch/powerpc/include/asm/ps3av.h b/arch/powerpc/include/asm/ps3av.h
index cd24ac16660a..0427b0b53d2d 100644
--- a/arch/powerpc/include/asm/ps3av.h
+++ b/arch/powerpc/include/asm/ps3av.h
@@ -730,7 +730,7 @@ extern int ps3av_cmd_av_get_hw_conf(struct ps3av_pkt_av_get_hw_conf *);
730extern int ps3av_cmd_video_get_monitor_info(struct ps3av_pkt_av_get_monitor_info *, 730extern int ps3av_cmd_video_get_monitor_info(struct ps3av_pkt_av_get_monitor_info *,
731 u32); 731 u32);
732 732
733extern int ps3av_set_video_mode(u32); 733extern int ps3av_set_video_mode(int);
734extern int ps3av_set_audio_mode(u32, u32, u32, u32, u32); 734extern int ps3av_set_audio_mode(u32, u32, u32, u32, u32);
735extern int ps3av_get_auto_mode(void); 735extern int ps3av_get_auto_mode(void);
736extern int ps3av_get_mode(void); 736extern int ps3av_get_mode(void);
diff --git a/arch/powerpc/include/asm/ps3fb.h b/arch/powerpc/include/asm/ps3fb.h
index e7233a849680..90dbefb8cfc4 100644
--- a/arch/powerpc/include/asm/ps3fb.h
+++ b/arch/powerpc/include/asm/ps3fb.h
@@ -21,6 +21,7 @@
21 21
22#include <linux/types.h> 22#include <linux/types.h>
23#include <linux/ioctl.h> 23#include <linux/ioctl.h>
24#include <linux/types.h>
24 25
25/* ioctl */ 26/* ioctl */
26#define PS3FB_IOCTL_SETMODE _IOW('r', 1, int) /* set video mode */ 27#define PS3FB_IOCTL_SETMODE _IOW('r', 1, int) /* set video mode */
diff --git a/arch/powerpc/include/asm/pte-40x.h b/arch/powerpc/include/asm/pte-40x.h
new file mode 100644
index 000000000000..07630faae029
--- /dev/null
+++ b/arch/powerpc/include/asm/pte-40x.h
@@ -0,0 +1,64 @@
1#ifndef _ASM_POWERPC_PTE_40x_H
2#define _ASM_POWERPC_PTE_40x_H
3#ifdef __KERNEL__
4
5/*
6 * At present, all PowerPC 400-class processors share a similar TLB
7 * architecture. The instruction and data sides share a unified,
8 * 64-entry, fully-associative TLB which is maintained totally under
9 * software control. In addition, the instruction side has a
10 * hardware-managed, 4-entry, fully-associative TLB which serves as a
11 * first level to the shared TLB. These two TLBs are known as the UTLB
12 * and ITLB, respectively (see "mmu.h" for definitions).
13 *
14 * There are several potential gotchas here. The 40x hardware TLBLO
15 * field looks like this:
16 *
17 * 0 1 2 3 4 ... 18 19 20 21 22 23 24 25 26 27 28 29 30 31
18 * RPN..................... 0 0 EX WR ZSEL....... W I M G
19 *
20 * Where possible we make the Linux PTE bits match up with this
21 *
22 * - bits 20 and 21 must be cleared, because we use 4k pages (40x can
23 * support down to 1k pages), this is done in the TLBMiss exception
24 * handler.
25 * - We use only zones 0 (for kernel pages) and 1 (for user pages)
26 * of the 16 available. Bit 24-26 of the TLB are cleared in the TLB
27 * miss handler. Bit 27 is PAGE_USER, thus selecting the correct
28 * zone.
29 * - PRESENT *must* be in the bottom two bits because swap cache
30 * entries use the top 30 bits. Because 40x doesn't support SMP
31 * anyway, M is irrelevant so we borrow it for PAGE_PRESENT. Bit 30
32 * is cleared in the TLB miss handler before the TLB entry is loaded.
33 * - All other bits of the PTE are loaded into TLBLO without
34 * modification, leaving us only the bits 20, 21, 24, 25, 26, 30 for
35 * software PTE bits. We actually use use bits 21, 24, 25, and
36 * 30 respectively for the software bits: ACCESSED, DIRTY, RW, and
37 * PRESENT.
38 */
39
40#define _PAGE_GUARDED 0x001 /* G: page is guarded from prefetch */
41#define _PAGE_FILE 0x001 /* when !present: nonlinear file mapping */
42#define _PAGE_PRESENT 0x002 /* software: PTE contains a translation */
43#define _PAGE_NO_CACHE 0x004 /* I: caching is inhibited */
44#define _PAGE_WRITETHRU 0x008 /* W: caching is write-through */
45#define _PAGE_USER 0x010 /* matches one of the zone permission bits */
46#define _PAGE_RW 0x040 /* software: Writes permitted */
47#define _PAGE_DIRTY 0x080 /* software: dirty page */
48#define _PAGE_HWWRITE 0x100 /* hardware: Dirty & RW, set in exception */
49#define _PAGE_HWEXEC 0x200 /* hardware: EX permission */
50#define _PAGE_ACCESSED 0x400 /* software: R: page referenced */
51
52#define _PMD_PRESENT 0x400 /* PMD points to page of PTEs */
53#define _PMD_BAD 0x802
54#define _PMD_SIZE 0x0e0 /* size field, != 0 for large-page PMD entry */
55#define _PMD_SIZE_4M 0x0c0
56#define _PMD_SIZE_16M 0x0e0
57
58#define PMD_PAGE_SIZE(pmdval) (1024 << (((pmdval) & _PMD_SIZE) >> 4))
59
60/* Until my rework is finished, 40x still needs atomic PTE updates */
61#define PTE_ATOMIC_UPDATES 1
62
63#endif /* __KERNEL__ */
64#endif /* _ASM_POWERPC_PTE_40x_H */
diff --git a/arch/powerpc/include/asm/pte-44x.h b/arch/powerpc/include/asm/pte-44x.h
new file mode 100644
index 000000000000..37e98bcf83e0
--- /dev/null
+++ b/arch/powerpc/include/asm/pte-44x.h
@@ -0,0 +1,102 @@
1#ifndef _ASM_POWERPC_PTE_44x_H
2#define _ASM_POWERPC_PTE_44x_H
3#ifdef __KERNEL__
4
5/*
6 * Definitions for PPC440
7 *
8 * Because of the 3 word TLB entries to support 36-bit addressing,
9 * the attribute are difficult to map in such a fashion that they
10 * are easily loaded during exception processing. I decided to
11 * organize the entry so the ERPN is the only portion in the
12 * upper word of the PTE and the attribute bits below are packed
13 * in as sensibly as they can be in the area below a 4KB page size
14 * oriented RPN. This at least makes it easy to load the RPN and
15 * ERPN fields in the TLB. -Matt
16 *
17 * This isn't entirely true anymore, at least some bits are now
18 * easier to move into the TLB from the PTE. -BenH.
19 *
20 * Note that these bits preclude future use of a page size
21 * less than 4KB.
22 *
23 *
24 * PPC 440 core has following TLB attribute fields;
25 *
26 * TLB1:
27 * 0 1 2 3 4 ... 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
28 * RPN................................. - - - - - - ERPN.......
29 *
30 * TLB2:
31 * 0 1 2 3 4 ... 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
32 * - - - - - - U0 U1 U2 U3 W I M G E - UX UW UR SX SW SR
33 *
34 * Newer 440 cores (440x6 as used on AMCC 460EX/460GT) have additional
35 * TLB2 storage attibute fields. Those are:
36 *
37 * TLB2:
38 * 0...10 11 12 13 14 15 16...31
39 * no change WL1 IL1I IL1D IL2I IL2D no change
40 *
41 * There are some constrains and options, to decide mapping software bits
42 * into TLB entry.
43 *
44 * - PRESENT *must* be in the bottom three bits because swap cache
45 * entries use the top 29 bits for TLB2.
46 *
47 * - FILE *must* be in the bottom three bits because swap cache
48 * entries use the top 29 bits for TLB2.
49 *
50 * - CACHE COHERENT bit (M) has no effect on original PPC440 cores,
51 * because it doesn't support SMP. However, some later 460 variants
52 * have -some- form of SMP support and so I keep the bit there for
53 * future use
54 *
55 * With the PPC 44x Linux implementation, the 0-11th LSBs of the PTE are used
56 * for memory protection related functions (see PTE structure in
57 * include/asm-ppc/mmu.h). The _PAGE_XXX definitions in this file map to the
58 * above bits. Note that the bit values are CPU specific, not architecture
59 * specific.
60 *
61 * The kernel PTE entry holds an arch-dependent swp_entry structure under
62 * certain situations. In other words, in such situations some portion of
63 * the PTE bits are used as a swp_entry. In the PPC implementation, the
64 * 3-24th LSB are shared with swp_entry, however the 0-2nd three LSB still
65 * hold protection values. That means the three protection bits are
66 * reserved for both PTE and SWAP entry at the most significant three
67 * LSBs.
68 *
69 * There are three protection bits available for SWAP entry:
70 * _PAGE_PRESENT
71 * _PAGE_FILE
72 * _PAGE_HASHPTE (if HW has)
73 *
74 * So those three bits have to be inside of 0-2nd LSB of PTE.
75 *
76 */
77
78#define _PAGE_PRESENT 0x00000001 /* S: PTE valid */
79#define _PAGE_RW 0x00000002 /* S: Write permission */
80#define _PAGE_FILE 0x00000004 /* S: nonlinear file mapping */
81#define _PAGE_HWEXEC 0x00000004 /* H: Execute permission */
82#define _PAGE_ACCESSED 0x00000008 /* S: Page referenced */
83#define _PAGE_DIRTY 0x00000010 /* S: Page dirty */
84#define _PAGE_SPECIAL 0x00000020 /* S: Special page */
85#define _PAGE_USER 0x00000040 /* S: User page */
86#define _PAGE_ENDIAN 0x00000080 /* H: E bit */
87#define _PAGE_GUARDED 0x00000100 /* H: G bit */
88#define _PAGE_COHERENT 0x00000200 /* H: M bit */
89#define _PAGE_NO_CACHE 0x00000400 /* H: I bit */
90#define _PAGE_WRITETHRU 0x00000800 /* H: W bit */
91
92/* TODO: Add large page lowmem mapping support */
93#define _PMD_PRESENT 0
94#define _PMD_PRESENT_MASK (PAGE_MASK)
95#define _PMD_BAD (~PAGE_MASK)
96
97/* ERPN in a PTE never gets cleared, ignore it */
98#define _PTE_NONE_MASK 0xffffffff00000000ULL
99
100
101#endif /* __KERNEL__ */
102#endif /* _ASM_POWERPC_PTE_44x_H */
diff --git a/arch/powerpc/include/asm/pte-8xx.h b/arch/powerpc/include/asm/pte-8xx.h
new file mode 100644
index 000000000000..8c6e31251034
--- /dev/null
+++ b/arch/powerpc/include/asm/pte-8xx.h
@@ -0,0 +1,67 @@
1#ifndef _ASM_POWERPC_PTE_8xx_H
2#define _ASM_POWERPC_PTE_8xx_H
3#ifdef __KERNEL__
4
5/*
6 * The PowerPC MPC8xx uses a TLB with hardware assisted, software tablewalk.
7 * We also use the two level tables, but we can put the real bits in them
8 * needed for the TLB and tablewalk. These definitions require Mx_CTR.PPM = 0,
9 * Mx_CTR.PPCS = 0, and MD_CTR.TWAM = 1. The level 2 descriptor has
10 * additional page protection (when Mx_CTR.PPCS = 1) that allows TLB hit
11 * based upon user/super access. The TLB does not have accessed nor write
12 * protect. We assume that if the TLB get loaded with an entry it is
13 * accessed, and overload the changed bit for write protect. We use
14 * two bits in the software pte that are supposed to be set to zero in
15 * the TLB entry (24 and 25) for these indicators. Although the level 1
16 * descriptor contains the guarded and writethrough/copyback bits, we can
17 * set these at the page level since they get copied from the Mx_TWC
18 * register when the TLB entry is loaded. We will use bit 27 for guard, since
19 * that is where it exists in the MD_TWC, and bit 26 for writethrough.
20 * These will get masked from the level 2 descriptor at TLB load time, and
21 * copied to the MD_TWC before it gets loaded.
22 * Large page sizes added. We currently support two sizes, 4K and 8M.
23 * This also allows a TLB hander optimization because we can directly
24 * load the PMD into MD_TWC. The 8M pages are only used for kernel
25 * mapping of well known areas. The PMD (PGD) entries contain control
26 * flags in addition to the address, so care must be taken that the
27 * software no longer assumes these are only pointers.
28 */
29
30/* Definitions for 8xx embedded chips. */
31#define _PAGE_PRESENT 0x0001 /* Page is valid */
32#define _PAGE_FILE 0x0002 /* when !present: nonlinear file mapping */
33#define _PAGE_NO_CACHE 0x0002 /* I: cache inhibit */
34#define _PAGE_SHARED 0x0004 /* No ASID (context) compare */
35
36/* These five software bits must be masked out when the entry is loaded
37 * into the TLB.
38 */
39#define _PAGE_EXEC 0x0008 /* software: i-cache coherency required */
40#define _PAGE_GUARDED 0x0010 /* software: guarded access */
41#define _PAGE_DIRTY 0x0020 /* software: page changed */
42#define _PAGE_RW 0x0040 /* software: user write access allowed */
43#define _PAGE_ACCESSED 0x0080 /* software: page referenced */
44
45/* Setting any bits in the nibble with the follow two controls will
46 * require a TLB exception handler change. It is assumed unused bits
47 * are always zero.
48 */
49#define _PAGE_HWWRITE 0x0100 /* h/w write enable: never set in Linux PTE */
50#define _PAGE_USER 0x0800 /* One of the PP bits, the other is USER&~RW */
51
52#define _PMD_PRESENT 0x0001
53#define _PMD_BAD 0x0ff0
54#define _PMD_PAGE_MASK 0x000c
55#define _PMD_PAGE_8M 0x000c
56
57#define _PTE_NONE_MASK _PAGE_ACCESSED
58
59/* Until my rework is finished, 8xx still needs atomic PTE updates */
60#define PTE_ATOMIC_UPDATES 1
61
62/* We need to add _PAGE_SHARED to kernel pages */
63#define _PAGE_KERNEL_RO (_PAGE_SHARED)
64#define _PAGE_KERNEL_RW (_PAGE_DIRTY | _PAGE_RW | _PAGE_HWWRITE)
65
66#endif /* __KERNEL__ */
67#endif /* _ASM_POWERPC_PTE_8xx_H */
diff --git a/arch/powerpc/include/asm/pte-common.h b/arch/powerpc/include/asm/pte-common.h
new file mode 100644
index 000000000000..d9740e886801
--- /dev/null
+++ b/arch/powerpc/include/asm/pte-common.h
@@ -0,0 +1,180 @@
1/* Included from asm/pgtable-*.h only ! */
2
3/*
4 * Some bits are only used on some cpu families... Make sure that all
5 * the undefined gets a sensible default
6 */
7#ifndef _PAGE_HASHPTE
8#define _PAGE_HASHPTE 0
9#endif
10#ifndef _PAGE_SHARED
11#define _PAGE_SHARED 0
12#endif
13#ifndef _PAGE_HWWRITE
14#define _PAGE_HWWRITE 0
15#endif
16#ifndef _PAGE_HWEXEC
17#define _PAGE_HWEXEC 0
18#endif
19#ifndef _PAGE_EXEC
20#define _PAGE_EXEC 0
21#endif
22#ifndef _PAGE_ENDIAN
23#define _PAGE_ENDIAN 0
24#endif
25#ifndef _PAGE_COHERENT
26#define _PAGE_COHERENT 0
27#endif
28#ifndef _PAGE_WRITETHRU
29#define _PAGE_WRITETHRU 0
30#endif
31#ifndef _PAGE_SPECIAL
32#define _PAGE_SPECIAL 0
33#endif
34#ifndef _PAGE_4K_PFN
35#define _PAGE_4K_PFN 0
36#endif
37#ifndef _PAGE_PSIZE
38#define _PAGE_PSIZE 0
39#endif
40#ifndef _PMD_PRESENT_MASK
41#define _PMD_PRESENT_MASK _PMD_PRESENT
42#endif
43#ifndef _PMD_SIZE
44#define _PMD_SIZE 0
45#define PMD_PAGE_SIZE(pmd) bad_call_to_PMD_PAGE_SIZE()
46#endif
47#ifndef _PAGE_KERNEL_RO
48#define _PAGE_KERNEL_RO 0
49#endif
50#ifndef _PAGE_KERNEL_RW
51#define _PAGE_KERNEL_RW (_PAGE_DIRTY | _PAGE_RW | _PAGE_HWWRITE)
52#endif
53#ifndef _PAGE_HPTEFLAGS
54#define _PAGE_HPTEFLAGS _PAGE_HASHPTE
55#endif
56#ifndef _PTE_NONE_MASK
57#define _PTE_NONE_MASK _PAGE_HPTEFLAGS
58#endif
59
60/* Make sure we get a link error if PMD_PAGE_SIZE is ever called on a
61 * kernel without large page PMD support
62 */
63#ifndef __ASSEMBLY__
64extern unsigned long bad_call_to_PMD_PAGE_SIZE(void);
65#endif /* __ASSEMBLY__ */
66
67/* Location of the PFN in the PTE. Most 32-bit platforms use the same
68 * as _PAGE_SHIFT here (ie, naturally aligned).
69 * Platform who don't just pre-define the value so we don't override it here
70 */
71#ifndef PTE_RPN_SHIFT
72#define PTE_RPN_SHIFT (PAGE_SHIFT)
73#endif
74
75/* The mask convered by the RPN must be a ULL on 32-bit platforms with
76 * 64-bit PTEs
77 */
78#if defined(CONFIG_PPC32) && defined(CONFIG_PTE_64BIT)
79#define PTE_RPN_MAX (1ULL << (64 - PTE_RPN_SHIFT))
80#define PTE_RPN_MASK (~((1ULL<<PTE_RPN_SHIFT)-1))
81#else
82#define PTE_RPN_MAX (1UL << (32 - PTE_RPN_SHIFT))
83#define PTE_RPN_MASK (~((1UL<<PTE_RPN_SHIFT)-1))
84#endif
85
86/* _PAGE_CHG_MASK masks of bits that are to be preserved accross
87 * pgprot changes
88 */
89#define _PAGE_CHG_MASK (PTE_RPN_MASK | _PAGE_HPTEFLAGS | _PAGE_DIRTY | \
90 _PAGE_ACCESSED | _PAGE_SPECIAL)
91
92/* Mask of bits returned by pte_pgprot() */
93#define PAGE_PROT_BITS (_PAGE_GUARDED | _PAGE_COHERENT | _PAGE_NO_CACHE | \
94 _PAGE_WRITETHRU | _PAGE_ENDIAN | _PAGE_4K_PFN | \
95 _PAGE_USER | _PAGE_ACCESSED | \
96 _PAGE_RW | _PAGE_HWWRITE | _PAGE_DIRTY | \
97 _PAGE_EXEC | _PAGE_HWEXEC)
98
99/*
100 * We define 2 sets of base prot bits, one for basic pages (ie,
101 * cacheable kernel and user pages) and one for non cacheable
102 * pages. We always set _PAGE_COHERENT when SMP is enabled or
103 * the processor might need it for DMA coherency.
104 */
105#define _PAGE_BASE_NC (_PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_PSIZE)
106#if defined(CONFIG_SMP) || defined(CONFIG_PPC_STD_MMU)
107#define _PAGE_BASE (_PAGE_BASE_NC | _PAGE_COHERENT)
108#else
109#define _PAGE_BASE (_PAGE_BASE_NC)
110#endif
111
112/* Permission masks used to generate the __P and __S table,
113 *
114 * Note:__pgprot is defined in arch/powerpc/include/asm/page.h
115 *
116 * Write permissions imply read permissions for now (we could make write-only
117 * pages on BookE but we don't bother for now). Execute permission control is
118 * possible on platforms that define _PAGE_EXEC
119 *
120 * Note due to the way vm flags are laid out, the bits are XWR
121 */
122#define PAGE_NONE __pgprot(_PAGE_BASE)
123#define PAGE_SHARED __pgprot(_PAGE_BASE | _PAGE_USER | _PAGE_RW)
124#define PAGE_SHARED_X __pgprot(_PAGE_BASE | _PAGE_USER | _PAGE_RW | _PAGE_EXEC)
125#define PAGE_COPY __pgprot(_PAGE_BASE | _PAGE_USER)
126#define PAGE_COPY_X __pgprot(_PAGE_BASE | _PAGE_USER | _PAGE_EXEC)
127#define PAGE_READONLY __pgprot(_PAGE_BASE | _PAGE_USER)
128#define PAGE_READONLY_X __pgprot(_PAGE_BASE | _PAGE_USER | _PAGE_EXEC)
129
130#define __P000 PAGE_NONE
131#define __P001 PAGE_READONLY
132#define __P010 PAGE_COPY
133#define __P011 PAGE_COPY
134#define __P100 PAGE_READONLY_X
135#define __P101 PAGE_READONLY_X
136#define __P110 PAGE_COPY_X
137#define __P111 PAGE_COPY_X
138
139#define __S000 PAGE_NONE
140#define __S001 PAGE_READONLY
141#define __S010 PAGE_SHARED
142#define __S011 PAGE_SHARED
143#define __S100 PAGE_READONLY_X
144#define __S101 PAGE_READONLY_X
145#define __S110 PAGE_SHARED_X
146#define __S111 PAGE_SHARED_X
147
148/* Permission masks used for kernel mappings */
149#define PAGE_KERNEL __pgprot(_PAGE_BASE | _PAGE_KERNEL_RW)
150#define PAGE_KERNEL_NC __pgprot(_PAGE_BASE_NC | _PAGE_KERNEL_RW | \
151 _PAGE_NO_CACHE)
152#define PAGE_KERNEL_NCG __pgprot(_PAGE_BASE_NC | _PAGE_KERNEL_RW | \
153 _PAGE_NO_CACHE | _PAGE_GUARDED)
154#define PAGE_KERNEL_X __pgprot(_PAGE_BASE | _PAGE_KERNEL_RW | _PAGE_EXEC)
155#define PAGE_KERNEL_RO __pgprot(_PAGE_BASE | _PAGE_KERNEL_RO)
156#define PAGE_KERNEL_ROX __pgprot(_PAGE_BASE | _PAGE_KERNEL_RO | _PAGE_EXEC)
157
158/* Protection used for kernel text. We want the debuggers to be able to
159 * set breakpoints anywhere, so don't write protect the kernel text
160 * on platforms where such control is possible.
161 */
162#if defined(CONFIG_KGDB) || defined(CONFIG_XMON) || defined(CONFIG_BDI_SWITCH) ||\
163 defined(CONFIG_KPROBES)
164#define PAGE_KERNEL_TEXT PAGE_KERNEL_X
165#else
166#define PAGE_KERNEL_TEXT PAGE_KERNEL_ROX
167#endif
168
169/* Make modules code happy. We don't set RO yet */
170#define PAGE_KERNEL_EXEC PAGE_KERNEL_X
171
172/* Advertise special mapping type for AGP */
173#define PAGE_AGP (PAGE_KERNEL_NC)
174#define HAVE_PAGE_AGP
175
176/* Advertise support for _PAGE_SPECIAL */
177#ifdef _PAGE_SPECIAL
178#define __HAVE_ARCH_PTE_SPECIAL
179#endif
180
diff --git a/arch/powerpc/include/asm/pte-fsl-booke.h b/arch/powerpc/include/asm/pte-fsl-booke.h
new file mode 100644
index 000000000000..10820f58acf5
--- /dev/null
+++ b/arch/powerpc/include/asm/pte-fsl-booke.h
@@ -0,0 +1,48 @@
1#ifndef _ASM_POWERPC_PTE_FSL_BOOKE_H
2#define _ASM_POWERPC_PTE_FSL_BOOKE_H
3#ifdef __KERNEL__
4
5/* PTE bit definitions for Freescale BookE SW loaded TLB MMU based
6 * processors
7 *
8 MMU Assist Register 3:
9
10 32 33 34 35 36 ... 50 51 52 53 54 55 56 57 58 59 60 61 62 63
11 RPN...................... 0 0 U0 U1 U2 U3 UX SX UW SW UR SR
12
13 - PRESENT *must* be in the bottom three bits because swap cache
14 entries use the top 29 bits.
15
16 - FILE *must* be in the bottom three bits because swap cache
17 entries use the top 29 bits.
18*/
19
20/* Definitions for FSL Book-E Cores */
21#define _PAGE_PRESENT 0x00001 /* S: PTE contains a translation */
22#define _PAGE_USER 0x00002 /* S: User page (maps to UR) */
23#define _PAGE_FILE 0x00002 /* S: when !present: nonlinear file mapping */
24#define _PAGE_RW 0x00004 /* S: Write permission (SW) */
25#define _PAGE_DIRTY 0x00008 /* S: Page dirty */
26#define _PAGE_HWEXEC 0x00010 /* H: SX permission */
27#define _PAGE_ACCESSED 0x00020 /* S: Page referenced */
28
29#define _PAGE_ENDIAN 0x00040 /* H: E bit */
30#define _PAGE_GUARDED 0x00080 /* H: G bit */
31#define _PAGE_COHERENT 0x00100 /* H: M bit */
32#define _PAGE_NO_CACHE 0x00200 /* H: I bit */
33#define _PAGE_WRITETHRU 0x00400 /* H: W bit */
34#define _PAGE_SPECIAL 0x00800 /* S: Special page */
35
36#ifdef CONFIG_PTE_64BIT
37/* ERPN in a PTE never gets cleared, ignore it */
38#define _PTE_NONE_MASK 0xffffffffffff0000ULL
39/* We extend the size of the PTE flags area when using 64-bit PTEs */
40#define PTE_RPN_SHIFT (PAGE_SHIFT + 8)
41#endif
42
43#define _PMD_PRESENT 0
44#define _PMD_PRESENT_MASK (PAGE_MASK)
45#define _PMD_BAD (~PAGE_MASK)
46
47#endif /* __KERNEL__ */
48#endif /* _ASM_POWERPC_PTE_FSL_BOOKE_H */
diff --git a/arch/powerpc/include/asm/pte-hash32.h b/arch/powerpc/include/asm/pte-hash32.h
new file mode 100644
index 000000000000..16e571c7f9ef
--- /dev/null
+++ b/arch/powerpc/include/asm/pte-hash32.h
@@ -0,0 +1,48 @@
1#ifndef _ASM_POWERPC_PTE_HASH32_H
2#define _ASM_POWERPC_PTE_HASH32_H
3#ifdef __KERNEL__
4
5/*
6 * The "classic" 32-bit implementation of the PowerPC MMU uses a hash
7 * table containing PTEs, together with a set of 16 segment registers,
8 * to define the virtual to physical address mapping.
9 *
10 * We use the hash table as an extended TLB, i.e. a cache of currently
11 * active mappings. We maintain a two-level page table tree, much
12 * like that used by the i386, for the sake of the Linux memory
13 * management code. Low-level assembler code in hash_low_32.S
14 * (procedure hash_page) is responsible for extracting ptes from the
15 * tree and putting them into the hash table when necessary, and
16 * updating the accessed and modified bits in the page table tree.
17 */
18
19#define _PAGE_PRESENT 0x001 /* software: pte contains a translation */
20#define _PAGE_HASHPTE 0x002 /* hash_page has made an HPTE for this pte */
21#define _PAGE_FILE 0x004 /* when !present: nonlinear file mapping */
22#define _PAGE_USER 0x004 /* usermode access allowed */
23#define _PAGE_GUARDED 0x008 /* G: prohibit speculative access */
24#define _PAGE_COHERENT 0x010 /* M: enforce memory coherence (SMP systems) */
25#define _PAGE_NO_CACHE 0x020 /* I: cache inhibit */
26#define _PAGE_WRITETHRU 0x040 /* W: cache write-through */
27#define _PAGE_DIRTY 0x080 /* C: page changed */
28#define _PAGE_ACCESSED 0x100 /* R: page referenced */
29#define _PAGE_EXEC 0x200 /* software: i-cache coherency required */
30#define _PAGE_RW 0x400 /* software: user write access allowed */
31#define _PAGE_SPECIAL 0x800 /* software: Special page */
32
33#ifdef CONFIG_PTE_64BIT
34/* We never clear the high word of the pte */
35#define _PTE_NONE_MASK (0xffffffff00000000ULL | _PAGE_HASHPTE)
36#else
37#define _PTE_NONE_MASK _PAGE_HASHPTE
38#endif
39
40#define _PMD_PRESENT 0
41#define _PMD_PRESENT_MASK (PAGE_MASK)
42#define _PMD_BAD (~PAGE_MASK)
43
44/* Hash table based platforms need atomic updates of the linux PTE */
45#define PTE_ATOMIC_UPDATES 1
46
47#endif /* __KERNEL__ */
48#endif /* _ASM_POWERPC_PTE_HASH32_H */
diff --git a/arch/powerpc/include/asm/pte-hash64-4k.h b/arch/powerpc/include/asm/pte-hash64-4k.h
new file mode 100644
index 000000000000..c134e809aac3
--- /dev/null
+++ b/arch/powerpc/include/asm/pte-hash64-4k.h
@@ -0,0 +1,17 @@
1/* To be include by pgtable-hash64.h only */
2
3/* PTE bits */
4#define _PAGE_HASHPTE 0x0400 /* software: pte has an associated HPTE */
5#define _PAGE_SECONDARY 0x8000 /* software: HPTE is in secondary group */
6#define _PAGE_GROUP_IX 0x7000 /* software: HPTE index within group */
7#define _PAGE_F_SECOND _PAGE_SECONDARY
8#define _PAGE_F_GIX _PAGE_GROUP_IX
9#define _PAGE_SPECIAL 0x10000 /* software: special page */
10
11/* PTE flags to conserve for HPTE identification */
12#define _PAGE_HPTEFLAGS (_PAGE_BUSY | _PAGE_HASHPTE | \
13 _PAGE_SECONDARY | _PAGE_GROUP_IX)
14
15/* shift to put page number into pte */
16#define PTE_RPN_SHIFT (17)
17
diff --git a/arch/powerpc/include/asm/pgtable-64k.h b/arch/powerpc/include/asm/pte-hash64-64k.h
index 7389003349a6..e05d26fa372f 100644
--- a/arch/powerpc/include/asm/pgtable-64k.h
+++ b/arch/powerpc/include/asm/pte-hash64-64k.h
@@ -1,76 +1,6 @@
1#ifndef _ASM_POWERPC_PGTABLE_64K_H 1/* To be include by pgtable-hash64.h only */
2#define _ASM_POWERPC_PGTABLE_64K_H
3
4#include <asm-generic/pgtable-nopud.h>
5
6
7#define PTE_INDEX_SIZE 12
8#define PMD_INDEX_SIZE 12
9#define PUD_INDEX_SIZE 0
10#define PGD_INDEX_SIZE 4
11
12#ifndef __ASSEMBLY__
13#define PTE_TABLE_SIZE (sizeof(real_pte_t) << PTE_INDEX_SIZE)
14#define PMD_TABLE_SIZE (sizeof(pmd_t) << PMD_INDEX_SIZE)
15#define PGD_TABLE_SIZE (sizeof(pgd_t) << PGD_INDEX_SIZE)
16
17#define PTRS_PER_PTE (1 << PTE_INDEX_SIZE)
18#define PTRS_PER_PMD (1 << PMD_INDEX_SIZE)
19#define PTRS_PER_PGD (1 << PGD_INDEX_SIZE)
20
21#ifdef CONFIG_PPC_SUBPAGE_PROT
22/*
23 * For the sub-page protection option, we extend the PGD with one of
24 * these. Basically we have a 3-level tree, with the top level being
25 * the protptrs array. To optimize speed and memory consumption when
26 * only addresses < 4GB are being protected, pointers to the first
27 * four pages of sub-page protection words are stored in the low_prot
28 * array.
29 * Each page of sub-page protection words protects 1GB (4 bytes
30 * protects 64k). For the 3-level tree, each page of pointers then
31 * protects 8TB.
32 */
33struct subpage_prot_table {
34 unsigned long maxaddr; /* only addresses < this are protected */
35 unsigned int **protptrs[2];
36 unsigned int *low_prot[4];
37};
38
39#undef PGD_TABLE_SIZE
40#define PGD_TABLE_SIZE ((sizeof(pgd_t) << PGD_INDEX_SIZE) + \
41 sizeof(struct subpage_prot_table))
42
43#define SBP_L1_BITS (PAGE_SHIFT - 2)
44#define SBP_L2_BITS (PAGE_SHIFT - 3)
45#define SBP_L1_COUNT (1 << SBP_L1_BITS)
46#define SBP_L2_COUNT (1 << SBP_L2_BITS)
47#define SBP_L2_SHIFT (PAGE_SHIFT + SBP_L1_BITS)
48#define SBP_L3_SHIFT (SBP_L2_SHIFT + SBP_L2_BITS)
49
50extern void subpage_prot_free(pgd_t *pgd);
51
52static inline struct subpage_prot_table *pgd_subpage_prot(pgd_t *pgd)
53{
54 return (struct subpage_prot_table *)(pgd + PTRS_PER_PGD);
55}
56#endif /* CONFIG_PPC_SUBPAGE_PROT */
57#endif /* __ASSEMBLY__ */
58
59/* With 4k base page size, hugepage PTEs go at the PMD level */
60#define MIN_HUGEPTE_SHIFT PAGE_SHIFT
61
62/* PMD_SHIFT determines what a second-level page table entry can map */
63#define PMD_SHIFT (PAGE_SHIFT + PTE_INDEX_SIZE)
64#define PMD_SIZE (1UL << PMD_SHIFT)
65#define PMD_MASK (~(PMD_SIZE-1))
66
67/* PGDIR_SHIFT determines what a third-level page table entry can map */
68#define PGDIR_SHIFT (PMD_SHIFT + PMD_INDEX_SIZE)
69#define PGDIR_SIZE (1UL << PGDIR_SHIFT)
70#define PGDIR_MASK (~(PGDIR_SIZE-1))
71 2
72/* Additional PTE bits (don't change without checking asm in hash_low.S) */ 3/* Additional PTE bits (don't change without checking asm in hash_low.S) */
73#define __HAVE_ARCH_PTE_SPECIAL
74#define _PAGE_SPECIAL 0x00000400 /* software: special page */ 4#define _PAGE_SPECIAL 0x00000400 /* software: special page */
75#define _PAGE_HPTE_SUB 0x0ffff000 /* combo only: sub pages HPTE bits */ 5#define _PAGE_HPTE_SUB 0x0ffff000 /* combo only: sub pages HPTE bits */
76#define _PAGE_HPTE_SUB0 0x08000000 /* combo only: first sub page */ 6#define _PAGE_HPTE_SUB0 0x08000000 /* combo only: first sub page */
@@ -107,21 +37,15 @@ static inline struct subpage_prot_table *pgd_subpage_prot(pgd_t *pgd)
107 * of addressable physical space, or 46 bits for the special 4k PFNs. 37 * of addressable physical space, or 46 bits for the special 4k PFNs.
108 */ 38 */
109#define PTE_RPN_SHIFT (30) 39#define PTE_RPN_SHIFT (30)
110#define PTE_RPN_MAX (1UL << (64 - PTE_RPN_SHIFT))
111#define PTE_RPN_MASK (~((1UL<<PTE_RPN_SHIFT)-1))
112
113/* _PAGE_CHG_MASK masks of bits that are to be preserved accross
114 * pgprot changes
115 */
116#define _PAGE_CHG_MASK (PTE_RPN_MASK | _PAGE_HPTEFLAGS | _PAGE_DIRTY | \
117 _PAGE_ACCESSED | _PAGE_SPECIAL)
118 40
119/* Bits to mask out from a PMD to get to the PTE page */ 41#ifndef __ASSEMBLY__
120#define PMD_MASKED_BITS 0x1ff
121/* Bits to mask out from a PGD/PUD to get to the PMD page */
122#define PUD_MASKED_BITS 0x1ff
123 42
124/* Manipulate "rpte" values */ 43/*
44 * With 64K pages on hash table, we have a special PTE format that
45 * uses a second "half" of the page table to encode sub-page information
46 * in order to deal with 64K made of 4K HW pages. Thus we override the
47 * generic accessors and iterators here
48 */
125#define __real_pte(e,p) ((real_pte_t) { \ 49#define __real_pte(e,p) ((real_pte_t) { \
126 (e), pte_val(*((p) + PTRS_PER_PTE)) }) 50 (e), pte_val(*((p) + PTRS_PER_PTE)) })
127#define __rpte_to_hidx(r,index) ((pte_val((r).pte) & _PAGE_COMBO) ? \ 51#define __rpte_to_hidx(r,index) ((pte_val((r).pte) & _PAGE_COMBO) ? \
@@ -130,7 +54,6 @@ static inline struct subpage_prot_table *pgd_subpage_prot(pgd_t *pgd)
130#define __rpte_sub_valid(rpte, index) \ 54#define __rpte_sub_valid(rpte, index) \
131 (pte_val(rpte.pte) & (_PAGE_HPTE_SUB0 >> (index))) 55 (pte_val(rpte.pte) & (_PAGE_HPTE_SUB0 >> (index)))
132 56
133
134/* Trick: we set __end to va + 64k, which happens works for 57/* Trick: we set __end to va + 64k, which happens works for
135 * a 16M page as well as we want only one iteration 58 * a 16M page as well as we want only one iteration
136 */ 59 */
@@ -152,4 +75,41 @@ static inline struct subpage_prot_table *pgd_subpage_prot(pgd_t *pgd)
152 remap_pfn_range((vma), (addr), (pfn), PAGE_SIZE, \ 75 remap_pfn_range((vma), (addr), (pfn), PAGE_SIZE, \
153 __pgprot(pgprot_val((prot)) | _PAGE_4K_PFN)) 76 __pgprot(pgprot_val((prot)) | _PAGE_4K_PFN))
154 77
155#endif /* _ASM_POWERPC_PGTABLE_64K_H */ 78
79#ifdef CONFIG_PPC_SUBPAGE_PROT
80/*
81 * For the sub-page protection option, we extend the PGD with one of
82 * these. Basically we have a 3-level tree, with the top level being
83 * the protptrs array. To optimize speed and memory consumption when
84 * only addresses < 4GB are being protected, pointers to the first
85 * four pages of sub-page protection words are stored in the low_prot
86 * array.
87 * Each page of sub-page protection words protects 1GB (4 bytes
88 * protects 64k). For the 3-level tree, each page of pointers then
89 * protects 8TB.
90 */
91struct subpage_prot_table {
92 unsigned long maxaddr; /* only addresses < this are protected */
93 unsigned int **protptrs[2];
94 unsigned int *low_prot[4];
95};
96
97#undef PGD_TABLE_SIZE
98#define PGD_TABLE_SIZE ((sizeof(pgd_t) << PGD_INDEX_SIZE) + \
99 sizeof(struct subpage_prot_table))
100
101#define SBP_L1_BITS (PAGE_SHIFT - 2)
102#define SBP_L2_BITS (PAGE_SHIFT - 3)
103#define SBP_L1_COUNT (1 << SBP_L1_BITS)
104#define SBP_L2_COUNT (1 << SBP_L2_BITS)
105#define SBP_L2_SHIFT (PAGE_SHIFT + SBP_L1_BITS)
106#define SBP_L3_SHIFT (SBP_L2_SHIFT + SBP_L2_BITS)
107
108extern void subpage_prot_free(pgd_t *pgd);
109
110static inline struct subpage_prot_table *pgd_subpage_prot(pgd_t *pgd)
111{
112 return (struct subpage_prot_table *)(pgd + PTRS_PER_PGD);
113}
114#endif /* CONFIG_PPC_SUBPAGE_PROT */
115#endif /* __ASSEMBLY__ */
diff --git a/arch/powerpc/include/asm/pte-hash64.h b/arch/powerpc/include/asm/pte-hash64.h
new file mode 100644
index 000000000000..0419eeb53274
--- /dev/null
+++ b/arch/powerpc/include/asm/pte-hash64.h
@@ -0,0 +1,54 @@
1#ifndef _ASM_POWERPC_PTE_HASH64_H
2#define _ASM_POWERPC_PTE_HASH64_H
3#ifdef __KERNEL__
4
5/*
6 * Common bits between 4K and 64K pages in a linux-style PTE.
7 * These match the bits in the (hardware-defined) PowerPC PTE as closely
8 * as possible. Additional bits may be defined in pgtable-hash64-*.h
9 *
10 * Note: We only support user read/write permissions. Supervisor always
11 * have full read/write to pages above PAGE_OFFSET (pages below that
12 * always use the user access permissions).
13 *
14 * We could create separate kernel read-only if we used the 3 PP bits
15 * combinations that newer processors provide but we currently don't.
16 */
17#define _PAGE_PRESENT 0x0001 /* software: pte contains a translation */
18#define _PAGE_USER 0x0002 /* matches one of the PP bits */
19#define _PAGE_FILE 0x0002 /* (!present only) software: pte holds file offset */
20#define _PAGE_EXEC 0x0004 /* No execute on POWER4 and newer (we invert) */
21#define _PAGE_GUARDED 0x0008
22#define _PAGE_COHERENT 0x0010 /* M: enforce memory coherence (SMP systems) */
23#define _PAGE_NO_CACHE 0x0020 /* I: cache inhibit */
24#define _PAGE_WRITETHRU 0x0040 /* W: cache write-through */
25#define _PAGE_DIRTY 0x0080 /* C: page changed */
26#define _PAGE_ACCESSED 0x0100 /* R: page referenced */
27#define _PAGE_RW 0x0200 /* software: user write access allowed */
28#define _PAGE_BUSY 0x0800 /* software: PTE & hash are busy */
29
30/* No separate kernel read-only */
31#define _PAGE_KERNEL_RW (_PAGE_RW | _PAGE_DIRTY) /* user access blocked by key */
32#define _PAGE_KERNEL_RO _PAGE_KERNEL_RW
33
34/* Strong Access Ordering */
35#define _PAGE_SAO (_PAGE_WRITETHRU | _PAGE_NO_CACHE | _PAGE_COHERENT)
36
37/* No page size encoding in the linux PTE */
38#define _PAGE_PSIZE 0
39
40/* PTEIDX nibble */
41#define _PTEIDX_SECONDARY 0x8
42#define _PTEIDX_GROUP_IX 0x7
43
44/* Hash table based platforms need atomic updates of the linux PTE */
45#define PTE_ATOMIC_UPDATES 1
46
47#ifdef CONFIG_PPC_64K_PAGES
48#include <asm/pte-hash64-64k.h>
49#else
50#include <asm/pte-hash64-4k.h>
51#endif
52
53#endif /* __KERNEL__ */
54#endif /* _ASM_POWERPC_PTE_HASH64_H */
diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
index f484a343efba..c9ff1ec97479 100644
--- a/arch/powerpc/include/asm/reg.h
+++ b/arch/powerpc/include/asm/reg.h
@@ -155,6 +155,8 @@
155#define CTRL_RUNLATCH 0x1 155#define CTRL_RUNLATCH 0x1
156#define SPRN_DABR 0x3F5 /* Data Address Breakpoint Register */ 156#define SPRN_DABR 0x3F5 /* Data Address Breakpoint Register */
157#define DABR_TRANSLATION (1UL << 2) 157#define DABR_TRANSLATION (1UL << 2)
158#define DABR_DATA_WRITE (1UL << 1)
159#define DABR_DATA_READ (1UL << 0)
158#define SPRN_DABR2 0x13D /* e300 */ 160#define SPRN_DABR2 0x13D /* e300 */
159#define SPRN_DABRX 0x3F7 /* Data Address Breakpoint Register Extension */ 161#define SPRN_DABRX 0x3F7 /* Data Address Breakpoint Register Extension */
160#define DABRX_USER (1UL << 0) 162#define DABRX_USER (1UL << 0)
diff --git a/arch/powerpc/include/asm/reg_booke.h b/arch/powerpc/include/asm/reg_booke.h
index 67453766bff1..a56f4d61aa72 100644
--- a/arch/powerpc/include/asm/reg_booke.h
+++ b/arch/powerpc/include/asm/reg_booke.h
@@ -10,6 +10,7 @@
10#define __ASM_POWERPC_REG_BOOKE_H__ 10#define __ASM_POWERPC_REG_BOOKE_H__
11 11
12/* Machine State Register (MSR) Fields */ 12/* Machine State Register (MSR) Fields */
13#define MSR_GS (1<<28) /* Guest state */
13#define MSR_UCLE (1<<26) /* User-mode cache lock enable */ 14#define MSR_UCLE (1<<26) /* User-mode cache lock enable */
14#define MSR_SPE (1<<25) /* Enable SPE */ 15#define MSR_SPE (1<<25) /* Enable SPE */
15#define MSR_DWE (1<<10) /* Debug Wait Enable */ 16#define MSR_DWE (1<<10) /* Debug Wait Enable */
@@ -110,6 +111,7 @@
110#define SPRN_L1CSR0 0x3F2 /* L1 Cache Control and Status Register 0 */ 111#define SPRN_L1CSR0 0x3F2 /* L1 Cache Control and Status Register 0 */
111#define SPRN_L1CSR1 0x3F3 /* L1 Cache Control and Status Register 1 */ 112#define SPRN_L1CSR1 0x3F3 /* L1 Cache Control and Status Register 1 */
112#define SPRN_MMUCSR0 0x3F4 /* MMU Control and Status Register 0 */ 113#define SPRN_MMUCSR0 0x3F4 /* MMU Control and Status Register 0 */
114#define SPRN_MMUCFG 0x3F7 /* MMU Configuration Register */
113#define SPRN_PIT 0x3DB /* Programmable Interval Timer */ 115#define SPRN_PIT 0x3DB /* Programmable Interval Timer */
114#define SPRN_BUCSR 0x3F5 /* Branch Unit Control and Status */ 116#define SPRN_BUCSR 0x3F5 /* Branch Unit Control and Status */
115#define SPRN_L2CSR0 0x3F9 /* L2 Data Cache Control and Status Register 0 */ 117#define SPRN_L2CSR0 0x3F9 /* L2 Data Cache Control and Status Register 0 */
diff --git a/arch/powerpc/include/asm/system.h b/arch/powerpc/include/asm/system.h
index 2a4be19a92c4..f612798e1c93 100644
--- a/arch/powerpc/include/asm/system.h
+++ b/arch/powerpc/include/asm/system.h
@@ -531,7 +531,7 @@ __cmpxchg_local(volatile void *ptr, unsigned long old, unsigned long new,
531#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n)) 531#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))
532#endif 532#endif
533 533
534#define arch_align_stack(x) (x) 534extern unsigned long arch_align_stack(unsigned long sp);
535 535
536/* Used in very early kernel initialization. */ 536/* Used in very early kernel initialization. */
537extern unsigned long reloc_offset(void); 537extern unsigned long reloc_offset(void);
diff --git a/arch/powerpc/include/asm/thread_info.h b/arch/powerpc/include/asm/thread_info.h
index 9665a26a253a..9aba5a38a7c4 100644
--- a/arch/powerpc/include/asm/thread_info.h
+++ b/arch/powerpc/include/asm/thread_info.h
@@ -12,8 +12,10 @@
12 12
13/* We have 8k stacks on ppc32 and 16k on ppc64 */ 13/* We have 8k stacks on ppc32 and 16k on ppc64 */
14 14
15#ifdef CONFIG_PPC64 15#if defined(CONFIG_PPC64)
16#define THREAD_SHIFT 14 16#define THREAD_SHIFT 14
17#elif defined(CONFIG_PPC_256K_PAGES)
18#define THREAD_SHIFT 15
17#else 19#else
18#define THREAD_SHIFT 13 20#define THREAD_SHIFT 13
19#endif 21#endif
@@ -154,6 +156,13 @@ static inline void set_restore_sigmask(void)
154 ti->local_flags |= _TLF_RESTORE_SIGMASK; 156 ti->local_flags |= _TLF_RESTORE_SIGMASK;
155 set_bit(TIF_SIGPENDING, &ti->flags); 157 set_bit(TIF_SIGPENDING, &ti->flags);
156} 158}
159
160#ifdef CONFIG_PPC64
161#define is_32bit_task() (test_thread_flag(TIF_32BIT))
162#else
163#define is_32bit_task() (1)
164#endif
165
157#endif /* !__ASSEMBLY__ */ 166#endif /* !__ASSEMBLY__ */
158 167
159#endif /* __KERNEL__ */ 168#endif /* __KERNEL__ */
diff --git a/arch/powerpc/include/asm/topology.h b/arch/powerpc/include/asm/topology.h
index 375258559ae6..054a16d68082 100644
--- a/arch/powerpc/include/asm/topology.h
+++ b/arch/powerpc/include/asm/topology.h
@@ -24,11 +24,6 @@ static inline cpumask_t node_to_cpumask(int node)
24 24
25#define cpumask_of_node(node) (&numa_cpumask_lookup_table[node]) 25#define cpumask_of_node(node) (&numa_cpumask_lookup_table[node])
26 26
27static inline int node_to_first_cpu(int node)
28{
29 return cpumask_first(cpumask_of_node(node));
30}
31
32int of_node_to_nid(struct device_node *device); 27int of_node_to_nid(struct device_node *device);
33 28
34struct pci_bus; 29struct pci_bus;
diff --git a/arch/powerpc/include/asm/udbg.h b/arch/powerpc/include/asm/udbg.h
index 6418ceea44b7..cd21e5e6b04f 100644
--- a/arch/powerpc/include/asm/udbg.h
+++ b/arch/powerpc/include/asm/udbg.h
@@ -15,6 +15,7 @@
15#include <linux/init.h> 15#include <linux/init.h>
16 16
17extern void (*udbg_putc)(char c); 17extern void (*udbg_putc)(char c);
18extern void (*udbg_flush)(void);
18extern int (*udbg_getc)(void); 19extern int (*udbg_getc)(void);
19extern int (*udbg_getc_poll)(void); 20extern int (*udbg_getc_poll)(void);
20 21
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile
index 8d1a419df35d..71901fbda4a5 100644
--- a/arch/powerpc/kernel/Makefile
+++ b/arch/powerpc/kernel/Makefile
@@ -18,12 +18,10 @@ CFLAGS_REMOVE_cputable.o = -pg -mno-sched-epilog
18CFLAGS_REMOVE_prom_init.o = -pg -mno-sched-epilog 18CFLAGS_REMOVE_prom_init.o = -pg -mno-sched-epilog
19CFLAGS_REMOVE_btext.o = -pg -mno-sched-epilog 19CFLAGS_REMOVE_btext.o = -pg -mno-sched-epilog
20CFLAGS_REMOVE_prom.o = -pg -mno-sched-epilog 20CFLAGS_REMOVE_prom.o = -pg -mno-sched-epilog
21 21# do not trace tracer code
22ifdef CONFIG_DYNAMIC_FTRACE
23# dynamic ftrace setup.
24CFLAGS_REMOVE_ftrace.o = -pg -mno-sched-epilog 22CFLAGS_REMOVE_ftrace.o = -pg -mno-sched-epilog
25endif 23# timers used by tracing
26 24CFLAGS_REMOVE_time.o = -pg -mno-sched-epilog
27endif 25endif
28 26
29obj-y := cputable.o ptrace.o syscalls.o \ 27obj-y := cputable.o ptrace.o syscalls.o \
@@ -61,6 +59,7 @@ obj-$(CONFIG_HIBERNATION) += swsusp.o suspend.o \
61obj64-$(CONFIG_HIBERNATION) += swsusp_asm64.o 59obj64-$(CONFIG_HIBERNATION) += swsusp_asm64.o
62obj-$(CONFIG_MODULES) += module.o module_$(CONFIG_WORD_SIZE).o 60obj-$(CONFIG_MODULES) += module.o module_$(CONFIG_WORD_SIZE).o
63obj-$(CONFIG_44x) += cpu_setup_44x.o 61obj-$(CONFIG_44x) += cpu_setup_44x.o
62obj-$(CONFIG_FSL_BOOKE) += cpu_setup_fsl_booke.o dbell.o
64 63
65extra-$(CONFIG_PPC_STD_MMU) := head_32.o 64extra-$(CONFIG_PPC_STD_MMU) := head_32.o
66extra-$(CONFIG_PPC64) := head_64.o 65extra-$(CONFIG_PPC64) := head_64.o
@@ -76,7 +75,7 @@ obj-y += time.o prom.o traps.o setup-common.o \
76obj-$(CONFIG_PPC32) += entry_32.o setup_32.o 75obj-$(CONFIG_PPC32) += entry_32.o setup_32.o
77obj-$(CONFIG_PPC64) += dma-iommu.o iommu.o 76obj-$(CONFIG_PPC64) += dma-iommu.o iommu.o
78obj-$(CONFIG_KGDB) += kgdb.o 77obj-$(CONFIG_KGDB) += kgdb.o
79obj-$(CONFIG_PPC_MULTIPLATFORM) += prom_init.o 78obj-$(CONFIG_PPC_OF_BOOT_TRAMPOLINE) += prom_init.o
80obj-$(CONFIG_MODULES) += ppc_ksyms.o 79obj-$(CONFIG_MODULES) += ppc_ksyms.o
81obj-$(CONFIG_BOOTX_TEXT) += btext.o 80obj-$(CONFIG_BOOTX_TEXT) += btext.o
82obj-$(CONFIG_SMP) += smp.o 81obj-$(CONFIG_SMP) += smp.o
@@ -94,6 +93,7 @@ obj-$(CONFIG_AUDIT) += audit.o
94obj64-$(CONFIG_AUDIT) += compat_audit.o 93obj64-$(CONFIG_AUDIT) += compat_audit.o
95 94
96obj-$(CONFIG_DYNAMIC_FTRACE) += ftrace.o 95obj-$(CONFIG_DYNAMIC_FTRACE) += ftrace.o
96obj-$(CONFIG_FUNCTION_GRAPH_TRACER) += ftrace.o
97 97
98obj-$(CONFIG_8XX_MINIMAL_FPEMU) += softemu8xx.o 98obj-$(CONFIG_8XX_MINIMAL_FPEMU) += softemu8xx.o
99 99
diff --git a/arch/powerpc/kernel/align.c b/arch/powerpc/kernel/align.c
index 73cb6a3229ae..5ffcfaa77d6a 100644
--- a/arch/powerpc/kernel/align.c
+++ b/arch/powerpc/kernel/align.c
@@ -187,7 +187,7 @@ static struct aligninfo aligninfo[128] = {
187 { 4, ST+F+S+U }, /* 11 1 1010: stfsux */ 187 { 4, ST+F+S+U }, /* 11 1 1010: stfsux */
188 { 8, ST+F+U }, /* 11 1 1011: stfdux */ 188 { 8, ST+F+U }, /* 11 1 1011: stfdux */
189 INVALID, /* 11 1 1100 */ 189 INVALID, /* 11 1 1100 */
190 INVALID, /* 11 1 1101 */ 190 { 4, LD+F }, /* 11 1 1101: lfiwzx */
191 INVALID, /* 11 1 1110 */ 191 INVALID, /* 11 1 1110 */
192 INVALID, /* 11 1 1111 */ 192 INVALID, /* 11 1 1111 */
193}; 193};
diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c
index 42fe4da4e8ae..1e40bc053946 100644
--- a/arch/powerpc/kernel/asm-offsets.c
+++ b/arch/powerpc/kernel/asm-offsets.c
@@ -284,9 +284,6 @@ int main(void)
284#endif /* ! CONFIG_PPC64 */ 284#endif /* ! CONFIG_PPC64 */
285 285
286 /* About the CPU features table */ 286 /* About the CPU features table */
287 DEFINE(CPU_SPEC_ENTRY_SIZE, sizeof(struct cpu_spec));
288 DEFINE(CPU_SPEC_PVR_MASK, offsetof(struct cpu_spec, pvr_mask));
289 DEFINE(CPU_SPEC_PVR_VALUE, offsetof(struct cpu_spec, pvr_value));
290 DEFINE(CPU_SPEC_FEATURES, offsetof(struct cpu_spec, cpu_features)); 287 DEFINE(CPU_SPEC_FEATURES, offsetof(struct cpu_spec, cpu_features));
291 DEFINE(CPU_SPEC_SETUP, offsetof(struct cpu_spec, cpu_setup)); 288 DEFINE(CPU_SPEC_SETUP, offsetof(struct cpu_spec, cpu_setup));
292 DEFINE(CPU_SPEC_RESTORE, offsetof(struct cpu_spec, cpu_restore)); 289 DEFINE(CPU_SPEC_RESTORE, offsetof(struct cpu_spec, cpu_restore));
diff --git a/arch/powerpc/kernel/cpu_setup_44x.S b/arch/powerpc/kernel/cpu_setup_44x.S
index 10b4ab1008af..7d606f89a839 100644
--- a/arch/powerpc/kernel/cpu_setup_44x.S
+++ b/arch/powerpc/kernel/cpu_setup_44x.S
@@ -34,6 +34,7 @@ _GLOBAL(__setup_cpu_440grx)
34 blr 34 blr
35_GLOBAL(__setup_cpu_460ex) 35_GLOBAL(__setup_cpu_460ex)
36_GLOBAL(__setup_cpu_460gt) 36_GLOBAL(__setup_cpu_460gt)
37_GLOBAL(__setup_cpu_460sx)
37 mflr r4 38 mflr r4
38 bl __init_fpu_44x 39 bl __init_fpu_44x
39 bl __fixup_440A_mcheck 40 bl __fixup_440A_mcheck
diff --git a/arch/powerpc/kernel/cpu_setup_6xx.S b/arch/powerpc/kernel/cpu_setup_6xx.S
index 72d1d7395254..54f767e31a1a 100644
--- a/arch/powerpc/kernel/cpu_setup_6xx.S
+++ b/arch/powerpc/kernel/cpu_setup_6xx.S
@@ -15,9 +15,14 @@
15#include <asm/ppc_asm.h> 15#include <asm/ppc_asm.h>
16#include <asm/asm-offsets.h> 16#include <asm/asm-offsets.h>
17#include <asm/cache.h> 17#include <asm/cache.h>
18#include <asm/mmu.h>
18 19
19_GLOBAL(__setup_cpu_603) 20_GLOBAL(__setup_cpu_603)
20 mflr r4 21 mflr r4
22BEGIN_MMU_FTR_SECTION
23 li r10,0
24 mtspr SPRN_SPRG4,r10 /* init SW LRU tracking */
25END_MMU_FTR_SECTION_IFSET(MMU_FTR_NEED_DTLB_SW_LRU)
21BEGIN_FTR_SECTION 26BEGIN_FTR_SECTION
22 bl __init_fpu_registers 27 bl __init_fpu_registers
23END_FTR_SECTION_IFCLR(CPU_FTR_FPU_UNAVAILABLE) 28END_FTR_SECTION_IFCLR(CPU_FTR_FPU_UNAVAILABLE)
diff --git a/arch/powerpc/kernel/cpu_setup_fsl_booke.S b/arch/powerpc/kernel/cpu_setup_fsl_booke.S
new file mode 100644
index 000000000000..eb4b9adcedb4
--- /dev/null
+++ b/arch/powerpc/kernel/cpu_setup_fsl_booke.S
@@ -0,0 +1,31 @@
1/*
2 * This file contains low level CPU setup functions.
3 * Kumar Gala <galak@kernel.crashing.org>
4 * Copyright 2009 Freescale Semiconductor, Inc.
5 *
6 * Based on cpu_setup_6xx code by
7 * Benjamin Herrenschmidt <benh@kernel.crashing.org>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version
12 * 2 of the License, or (at your option) any later version.
13 *
14 */
15
16#include <asm/processor.h>
17#include <asm/cputable.h>
18#include <asm/ppc_asm.h>
19
20_GLOBAL(__setup_cpu_e200)
21 /* enable dedicated debug exception handling resources (Debug APU) */
22 mfspr r3,SPRN_HID0
23 ori r3,r3,HID0_DAPUEN@l
24 mtspr SPRN_HID0,r3
25 b __setup_e200_ivors
26_GLOBAL(__setup_cpu_e500v1)
27_GLOBAL(__setup_cpu_e500v2)
28 b __setup_e500_ivors
29_GLOBAL(__setup_cpu_e500mc)
30 b __setup_e500mc_ivors
31
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
index 923f87aff20a..cd1b687544f3 100644
--- a/arch/powerpc/kernel/cputable.c
+++ b/arch/powerpc/kernel/cputable.c
@@ -35,6 +35,10 @@ const char *powerpc_base_platform;
35 * and ppc64 35 * and ppc64
36 */ 36 */
37#ifdef CONFIG_PPC32 37#ifdef CONFIG_PPC32
38extern void __setup_cpu_e200(unsigned long offset, struct cpu_spec* spec);
39extern void __setup_cpu_e500v1(unsigned long offset, struct cpu_spec* spec);
40extern void __setup_cpu_e500v2(unsigned long offset, struct cpu_spec* spec);
41extern void __setup_cpu_e500mc(unsigned long offset, struct cpu_spec* spec);
38extern void __setup_cpu_440ep(unsigned long offset, struct cpu_spec* spec); 42extern void __setup_cpu_440ep(unsigned long offset, struct cpu_spec* spec);
39extern void __setup_cpu_440epx(unsigned long offset, struct cpu_spec* spec); 43extern void __setup_cpu_440epx(unsigned long offset, struct cpu_spec* spec);
40extern void __setup_cpu_440gx(unsigned long offset, struct cpu_spec* spec); 44extern void __setup_cpu_440gx(unsigned long offset, struct cpu_spec* spec);
@@ -43,6 +47,7 @@ extern void __setup_cpu_440spe(unsigned long offset, struct cpu_spec* spec);
43extern void __setup_cpu_440x5(unsigned long offset, struct cpu_spec* spec); 47extern void __setup_cpu_440x5(unsigned long offset, struct cpu_spec* spec);
44extern void __setup_cpu_460ex(unsigned long offset, struct cpu_spec* spec); 48extern void __setup_cpu_460ex(unsigned long offset, struct cpu_spec* spec);
45extern void __setup_cpu_460gt(unsigned long offset, struct cpu_spec* spec); 49extern void __setup_cpu_460gt(unsigned long offset, struct cpu_spec* spec);
50extern void __setup_cpu_460sx(unsigned long offset, struct cpu_spec *spec);
46extern void __setup_cpu_603(unsigned long offset, struct cpu_spec* spec); 51extern void __setup_cpu_603(unsigned long offset, struct cpu_spec* spec);
47extern void __setup_cpu_604(unsigned long offset, struct cpu_spec* spec); 52extern void __setup_cpu_604(unsigned long offset, struct cpu_spec* spec);
48extern void __setup_cpu_750(unsigned long offset, struct cpu_spec* spec); 53extern void __setup_cpu_750(unsigned long offset, struct cpu_spec* spec);
@@ -726,6 +731,8 @@ static struct cpu_spec __initdata cpu_specs[] = {
726 .cpu_setup = __setup_cpu_750, 731 .cpu_setup = __setup_cpu_750,
727 .machine_check = machine_check_generic, 732 .machine_check = machine_check_generic,
728 .platform = "ppc750", 733 .platform = "ppc750",
734 .oprofile_cpu_type = "ppc/750",
735 .oprofile_type = PPC_OPROFILE_G4,
729 }, 736 },
730 { /* 750FX rev 2.0 must disable HID0[DPM] */ 737 { /* 750FX rev 2.0 must disable HID0[DPM] */
731 .pvr_mask = 0xffffffff, 738 .pvr_mask = 0xffffffff,
@@ -741,6 +748,8 @@ static struct cpu_spec __initdata cpu_specs[] = {
741 .cpu_setup = __setup_cpu_750, 748 .cpu_setup = __setup_cpu_750,
742 .machine_check = machine_check_generic, 749 .machine_check = machine_check_generic,
743 .platform = "ppc750", 750 .platform = "ppc750",
751 .oprofile_cpu_type = "ppc/750",
752 .oprofile_type = PPC_OPROFILE_G4,
744 }, 753 },
745 { /* 750FX (All revs except 2.0) */ 754 { /* 750FX (All revs except 2.0) */
746 .pvr_mask = 0xffff0000, 755 .pvr_mask = 0xffff0000,
@@ -756,6 +765,8 @@ static struct cpu_spec __initdata cpu_specs[] = {
756 .cpu_setup = __setup_cpu_750fx, 765 .cpu_setup = __setup_cpu_750fx,
757 .machine_check = machine_check_generic, 766 .machine_check = machine_check_generic,
758 .platform = "ppc750", 767 .platform = "ppc750",
768 .oprofile_cpu_type = "ppc/750",
769 .oprofile_type = PPC_OPROFILE_G4,
759 }, 770 },
760 { /* 750GX */ 771 { /* 750GX */
761 .pvr_mask = 0xffff0000, 772 .pvr_mask = 0xffff0000,
@@ -771,6 +782,8 @@ static struct cpu_spec __initdata cpu_specs[] = {
771 .cpu_setup = __setup_cpu_750fx, 782 .cpu_setup = __setup_cpu_750fx,
772 .machine_check = machine_check_generic, 783 .machine_check = machine_check_generic,
773 .platform = "ppc750", 784 .platform = "ppc750",
785 .oprofile_cpu_type = "ppc/750",
786 .oprofile_type = PPC_OPROFILE_G4,
774 }, 787 },
775 { /* 740/750 (L2CR bit need fixup for 740) */ 788 { /* 740/750 (L2CR bit need fixup for 740) */
776 .pvr_mask = 0xffff0000, 789 .pvr_mask = 0xffff0000,
@@ -1077,7 +1090,8 @@ static struct cpu_spec __initdata cpu_specs[] = {
1077 .cpu_name = "e300c2", 1090 .cpu_name = "e300c2",
1078 .cpu_features = CPU_FTRS_E300C2, 1091 .cpu_features = CPU_FTRS_E300C2,
1079 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, 1092 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
1080 .mmu_features = MMU_FTR_USE_HIGH_BATS, 1093 .mmu_features = MMU_FTR_USE_HIGH_BATS |
1094 MMU_FTR_NEED_DTLB_SW_LRU,
1081 .icache_bsize = 32, 1095 .icache_bsize = 32,
1082 .dcache_bsize = 32, 1096 .dcache_bsize = 32,
1083 .cpu_setup = __setup_cpu_603, 1097 .cpu_setup = __setup_cpu_603,
@@ -1090,7 +1104,8 @@ static struct cpu_spec __initdata cpu_specs[] = {
1090 .cpu_name = "e300c3", 1104 .cpu_name = "e300c3",
1091 .cpu_features = CPU_FTRS_E300, 1105 .cpu_features = CPU_FTRS_E300,
1092 .cpu_user_features = COMMON_USER, 1106 .cpu_user_features = COMMON_USER,
1093 .mmu_features = MMU_FTR_USE_HIGH_BATS, 1107 .mmu_features = MMU_FTR_USE_HIGH_BATS |
1108 MMU_FTR_NEED_DTLB_SW_LRU,
1094 .icache_bsize = 32, 1109 .icache_bsize = 32,
1095 .dcache_bsize = 32, 1110 .dcache_bsize = 32,
1096 .cpu_setup = __setup_cpu_603, 1111 .cpu_setup = __setup_cpu_603,
@@ -1105,7 +1120,8 @@ static struct cpu_spec __initdata cpu_specs[] = {
1105 .cpu_name = "e300c4", 1120 .cpu_name = "e300c4",
1106 .cpu_features = CPU_FTRS_E300, 1121 .cpu_features = CPU_FTRS_E300,
1107 .cpu_user_features = COMMON_USER, 1122 .cpu_user_features = COMMON_USER,
1108 .mmu_features = MMU_FTR_USE_HIGH_BATS, 1123 .mmu_features = MMU_FTR_USE_HIGH_BATS |
1124 MMU_FTR_NEED_DTLB_SW_LRU,
1109 .icache_bsize = 32, 1125 .icache_bsize = 32,
1110 .dcache_bsize = 32, 1126 .dcache_bsize = 32,
1111 .cpu_setup = __setup_cpu_603, 1127 .cpu_setup = __setup_cpu_603,
@@ -1634,6 +1650,19 @@ static struct cpu_spec __initdata cpu_specs[] = {
1634 .machine_check = machine_check_440A, 1650 .machine_check = machine_check_440A,
1635 .platform = "ppc440", 1651 .platform = "ppc440",
1636 }, 1652 },
1653 { /* 460SX */
1654 .pvr_mask = 0xffffff00,
1655 .pvr_value = 0x13541800,
1656 .cpu_name = "460SX",
1657 .cpu_features = CPU_FTRS_44X,
1658 .cpu_user_features = COMMON_USER_BOOKE,
1659 .mmu_features = MMU_FTR_TYPE_44x,
1660 .icache_bsize = 32,
1661 .dcache_bsize = 32,
1662 .cpu_setup = __setup_cpu_460sx,
1663 .machine_check = machine_check_440A,
1664 .platform = "ppc440",
1665 },
1637 { /* default match */ 1666 { /* default match */
1638 .pvr_mask = 0x00000000, 1667 .pvr_mask = 0x00000000,
1639 .pvr_value = 0x00000000, 1668 .pvr_value = 0x00000000,
@@ -1687,6 +1716,7 @@ static struct cpu_spec __initdata cpu_specs[] = {
1687 PPC_FEATURE_UNIFIED_CACHE, 1716 PPC_FEATURE_UNIFIED_CACHE,
1688 .mmu_features = MMU_FTR_TYPE_FSL_E, 1717 .mmu_features = MMU_FTR_TYPE_FSL_E,
1689 .dcache_bsize = 32, 1718 .dcache_bsize = 32,
1719 .cpu_setup = __setup_cpu_e200,
1690 .machine_check = machine_check_e200, 1720 .machine_check = machine_check_e200,
1691 .platform = "ppc5554", 1721 .platform = "ppc5554",
1692 } 1722 }
@@ -1706,6 +1736,7 @@ static struct cpu_spec __initdata cpu_specs[] = {
1706 .num_pmcs = 4, 1736 .num_pmcs = 4,
1707 .oprofile_cpu_type = "ppc/e500", 1737 .oprofile_cpu_type = "ppc/e500",
1708 .oprofile_type = PPC_OPROFILE_FSL_EMB, 1738 .oprofile_type = PPC_OPROFILE_FSL_EMB,
1739 .cpu_setup = __setup_cpu_e500v1,
1709 .machine_check = machine_check_e500, 1740 .machine_check = machine_check_e500,
1710 .platform = "ppc8540", 1741 .platform = "ppc8540",
1711 }, 1742 },
@@ -1724,6 +1755,7 @@ static struct cpu_spec __initdata cpu_specs[] = {
1724 .num_pmcs = 4, 1755 .num_pmcs = 4,
1725 .oprofile_cpu_type = "ppc/e500", 1756 .oprofile_cpu_type = "ppc/e500",
1726 .oprofile_type = PPC_OPROFILE_FSL_EMB, 1757 .oprofile_type = PPC_OPROFILE_FSL_EMB,
1758 .cpu_setup = __setup_cpu_e500v2,
1727 .machine_check = machine_check_e500, 1759 .machine_check = machine_check_e500,
1728 .platform = "ppc8548", 1760 .platform = "ppc8548",
1729 }, 1761 },
@@ -1733,12 +1765,14 @@ static struct cpu_spec __initdata cpu_specs[] = {
1733 .cpu_name = "e500mc", 1765 .cpu_name = "e500mc",
1734 .cpu_features = CPU_FTRS_E500MC, 1766 .cpu_features = CPU_FTRS_E500MC,
1735 .cpu_user_features = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU, 1767 .cpu_user_features = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU,
1736 .mmu_features = MMU_FTR_TYPE_FSL_E | MMU_FTR_BIG_PHYS, 1768 .mmu_features = MMU_FTR_TYPE_FSL_E | MMU_FTR_BIG_PHYS |
1769 MMU_FTR_USE_TLBILX,
1737 .icache_bsize = 64, 1770 .icache_bsize = 64,
1738 .dcache_bsize = 64, 1771 .dcache_bsize = 64,
1739 .num_pmcs = 4, 1772 .num_pmcs = 4,
1740 .oprofile_cpu_type = "ppc/e500", /* xxx - galak, e500mc? */ 1773 .oprofile_cpu_type = "ppc/e500", /* xxx - galak, e500mc? */
1741 .oprofile_type = PPC_OPROFILE_FSL_EMB, 1774 .oprofile_type = PPC_OPROFILE_FSL_EMB,
1775 .cpu_setup = __setup_cpu_e500mc,
1742 .machine_check = machine_check_e500, 1776 .machine_check = machine_check_e500,
1743 .platform = "ppce500mc", 1777 .platform = "ppce500mc",
1744 }, 1778 },
@@ -1762,74 +1796,84 @@ static struct cpu_spec __initdata cpu_specs[] = {
1762 1796
1763static struct cpu_spec the_cpu_spec; 1797static struct cpu_spec the_cpu_spec;
1764 1798
1765struct cpu_spec * __init identify_cpu(unsigned long offset, unsigned int pvr) 1799static void __init setup_cpu_spec(unsigned long offset, struct cpu_spec *s)
1766{ 1800{
1767 struct cpu_spec *s = cpu_specs;
1768 struct cpu_spec *t = &the_cpu_spec; 1801 struct cpu_spec *t = &the_cpu_spec;
1769 int i; 1802 struct cpu_spec old;
1770 1803
1771 s = PTRRELOC(s);
1772 t = PTRRELOC(t); 1804 t = PTRRELOC(t);
1805 old = *t;
1773 1806
1774 for (i = 0; i < ARRAY_SIZE(cpu_specs); i++,s++) 1807 /* Copy everything, then do fixups */
1775 if ((pvr & s->pvr_mask) == s->pvr_value) { 1808 *t = *s;
1776 /* 1809
1777 * If we are overriding a previous value derived 1810 /*
1778 * from the real PVR with a new value obtained 1811 * If we are overriding a previous value derived from the real
1779 * using a logical PVR value, don't modify the 1812 * PVR with a new value obtained using a logical PVR value,
1780 * performance monitor fields. 1813 * don't modify the performance monitor fields.
1781 */ 1814 */
1782 if (t->num_pmcs && !s->num_pmcs) { 1815 if (old.num_pmcs && !s->num_pmcs) {
1783 t->cpu_name = s->cpu_name; 1816 t->num_pmcs = old.num_pmcs;
1784 t->cpu_features = s->cpu_features; 1817 t->pmc_type = old.pmc_type;
1785 t->cpu_user_features = s->cpu_user_features; 1818 t->oprofile_type = old.oprofile_type;
1786 t->icache_bsize = s->icache_bsize; 1819 t->oprofile_mmcra_sihv = old.oprofile_mmcra_sihv;
1787 t->dcache_bsize = s->dcache_bsize; 1820 t->oprofile_mmcra_sipr = old.oprofile_mmcra_sipr;
1788 t->cpu_setup = s->cpu_setup; 1821 t->oprofile_mmcra_clear = old.oprofile_mmcra_clear;
1789 t->cpu_restore = s->cpu_restore; 1822
1790 t->platform = s->platform; 1823 /*
1791 /* 1824 * If we have passed through this logic once before and
1792 * If we have passed through this logic once 1825 * have pulled the default case because the real PVR was
1793 * before and have pulled the default case 1826 * not found inside cpu_specs[], then we are possibly
1794 * because the real PVR was not found inside 1827 * running in compatibility mode. In that case, let the
1795 * cpu_specs[], then we are possibly running in 1828 * oprofiler know which set of compatibility counters to
1796 * compatibility mode. In that case, let the 1829 * pull from by making sure the oprofile_cpu_type string
1797 * oprofiler know which set of compatibility 1830 * is set to that of compatibility mode. If the
1798 * counters to pull from by making sure the 1831 * oprofile_cpu_type already has a value, then we are
1799 * oprofile_cpu_type string is set to that of 1832 * possibly overriding a real PVR with a logical one,
1800 * compatibility mode. If the oprofile_cpu_type 1833 * and, in that case, keep the current value for
1801 * already has a value, then we are possibly 1834 * oprofile_cpu_type.
1802 * overriding a real PVR with a logical one, and, 1835 */
1803 * in that case, keep the current value for 1836 if (old.oprofile_cpu_type == NULL)
1804 * oprofile_cpu_type. 1837 t->oprofile_cpu_type = s->oprofile_cpu_type;
1805 */ 1838 }
1806 if (t->oprofile_cpu_type == NULL)
1807 t->oprofile_cpu_type = s->oprofile_cpu_type;
1808 } else
1809 *t = *s;
1810 *PTRRELOC(&cur_cpu_spec) = &the_cpu_spec;
1811 1839
1812 /* 1840 *PTRRELOC(&cur_cpu_spec) = &the_cpu_spec;
1813 * Set the base platform string once; assumes 1841
1814 * we're called with real pvr first. 1842 /*
1815 */ 1843 * Set the base platform string once; assumes
1816 if (*PTRRELOC(&powerpc_base_platform) == NULL) 1844 * we're called with real pvr first.
1817 *PTRRELOC(&powerpc_base_platform) = t->platform; 1845 */
1846 if (*PTRRELOC(&powerpc_base_platform) == NULL)
1847 *PTRRELOC(&powerpc_base_platform) = t->platform;
1818 1848
1819#if defined(CONFIG_PPC64) || defined(CONFIG_BOOKE) 1849#if defined(CONFIG_PPC64) || defined(CONFIG_BOOKE)
1820 /* ppc64 and booke expect identify_cpu to also call 1850 /* ppc64 and booke expect identify_cpu to also call setup_cpu for
1821 * setup_cpu for that processor. I will consolidate 1851 * that processor. I will consolidate that at a later time, for now,
1822 * that at a later time, for now, just use #ifdef. 1852 * just use #ifdef. We also don't need to PTRRELOC the function
1823 * we also don't need to PTRRELOC the function pointer 1853 * pointer on ppc64 and booke as we are running at 0 in real mode
1824 * on ppc64 and booke as we are running at 0 in real 1854 * on ppc64 and reloc_offset is always 0 on booke.
1825 * mode on ppc64 and reloc_offset is always 0 on booke. 1855 */
1826 */ 1856 if (s->cpu_setup) {
1827 if (s->cpu_setup) { 1857 s->cpu_setup(offset, s);
1828 s->cpu_setup(offset, s); 1858 }
1829 }
1830#endif /* CONFIG_PPC64 || CONFIG_BOOKE */ 1859#endif /* CONFIG_PPC64 || CONFIG_BOOKE */
1860}
1861
1862struct cpu_spec * __init identify_cpu(unsigned long offset, unsigned int pvr)
1863{
1864 struct cpu_spec *s = cpu_specs;
1865 int i;
1866
1867 s = PTRRELOC(s);
1868
1869 for (i = 0; i < ARRAY_SIZE(cpu_specs); i++,s++) {
1870 if ((pvr & s->pvr_mask) == s->pvr_value) {
1871 setup_cpu_spec(offset, s);
1831 return s; 1872 return s;
1832 } 1873 }
1874 }
1875
1833 BUG(); 1876 BUG();
1877
1834 return NULL; 1878 return NULL;
1835} 1879}
diff --git a/arch/powerpc/kernel/crash_dump.c b/arch/powerpc/kernel/crash_dump.c
index 19671aca6591..5fb667a60894 100644
--- a/arch/powerpc/kernel/crash_dump.c
+++ b/arch/powerpc/kernel/crash_dump.c
@@ -48,7 +48,7 @@ static void __init create_trampoline(unsigned long addr)
48 * branch to "addr" we jump to ("addr" + 32 MB). Although it requires 48 * branch to "addr" we jump to ("addr" + 32 MB). Although it requires
49 * two instructions it doesn't require any registers. 49 * two instructions it doesn't require any registers.
50 */ 50 */
51 patch_instruction(p, PPC_NOP_INSTR); 51 patch_instruction(p, PPC_INST_NOP);
52 patch_branch(++p, addr + PHYSICAL_START, 0); 52 patch_branch(++p, addr + PHYSICAL_START, 0);
53} 53}
54 54
diff --git a/arch/powerpc/kernel/dbell.c b/arch/powerpc/kernel/dbell.c
new file mode 100644
index 000000000000..1493734cd871
--- /dev/null
+++ b/arch/powerpc/kernel/dbell.c
@@ -0,0 +1,44 @@
1/*
2 * Author: Kumar Gala <galak@kernel.crashing.org>
3 *
4 * Copyright 2009 Freescale Semiconductor Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
10 */
11
12#include <linux/stddef.h>
13#include <linux/kernel.h>
14#include <linux/smp.h>
15#include <linux/threads.h>
16
17#include <asm/dbell.h>
18
19#ifdef CONFIG_SMP
20unsigned long dbell_smp_message[NR_CPUS];
21
22void smp_dbell_message_pass(int target, int msg)
23{
24 int i;
25
26 if(target < NR_CPUS) {
27 set_bit(msg, &dbell_smp_message[target]);
28 ppc_msgsnd(PPC_DBELL, 0, target);
29 }
30 else if(target == MSG_ALL_BUT_SELF) {
31 for_each_online_cpu(i) {
32 if (i == smp_processor_id())
33 continue;
34 set_bit(msg, &dbell_smp_message[i]);
35 ppc_msgsnd(PPC_DBELL, 0, i);
36 }
37 }
38 else { /* target == MSG_ALL */
39 for_each_online_cpu(i)
40 set_bit(msg, &dbell_smp_message[i]);
41 ppc_msgsnd(PPC_DBELL, PPC_DBELL_MSG_BRDCAST, 0);
42 }
43}
44#endif
diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S
index 6f7eb7e00c79..4dd38f129153 100644
--- a/arch/powerpc/kernel/entry_32.S
+++ b/arch/powerpc/kernel/entry_32.S
@@ -63,7 +63,7 @@ debug_transfer_to_handler:
63 63
64 .globl crit_transfer_to_handler 64 .globl crit_transfer_to_handler
65crit_transfer_to_handler: 65crit_transfer_to_handler:
66#ifdef CONFIG_FSL_BOOKE 66#ifdef CONFIG_PPC_BOOK3E_MMU
67 mfspr r0,SPRN_MAS0 67 mfspr r0,SPRN_MAS0
68 stw r0,MAS0(r11) 68 stw r0,MAS0(r11)
69 mfspr r0,SPRN_MAS1 69 mfspr r0,SPRN_MAS1
@@ -78,7 +78,7 @@ crit_transfer_to_handler:
78 mfspr r0,SPRN_MAS7 78 mfspr r0,SPRN_MAS7
79 stw r0,MAS7(r11) 79 stw r0,MAS7(r11)
80#endif /* CONFIG_PHYS_64BIT */ 80#endif /* CONFIG_PHYS_64BIT */
81#endif /* CONFIG_FSL_BOOKE */ 81#endif /* CONFIG_PPC_BOOK3E_MMU */
82#ifdef CONFIG_44x 82#ifdef CONFIG_44x
83 mfspr r0,SPRN_MMUCR 83 mfspr r0,SPRN_MMUCR
84 stw r0,MMUCR(r11) 84 stw r0,MMUCR(r11)
@@ -914,7 +914,7 @@ exc_exit_restart_end:
914 mtspr SPRN_##exc_lvl_srr0,r9; \ 914 mtspr SPRN_##exc_lvl_srr0,r9; \
915 mtspr SPRN_##exc_lvl_srr1,r10; 915 mtspr SPRN_##exc_lvl_srr1,r10;
916 916
917#if defined(CONFIG_FSL_BOOKE) 917#if defined(CONFIG_PPC_BOOK3E_MMU)
918#ifdef CONFIG_PHYS_64BIT 918#ifdef CONFIG_PHYS_64BIT
919#define RESTORE_MAS7 \ 919#define RESTORE_MAS7 \
920 lwz r11,MAS7(r1); \ 920 lwz r11,MAS7(r1); \
@@ -956,7 +956,7 @@ ret_from_crit_exc:
956 lwz r10,crit_srr1@l(r10); 956 lwz r10,crit_srr1@l(r10);
957 mtspr SPRN_SRR0,r9; 957 mtspr SPRN_SRR0,r9;
958 mtspr SPRN_SRR1,r10; 958 mtspr SPRN_SRR1,r10;
959 RET_FROM_EXC_LEVEL(SPRN_CSRR0, SPRN_CSRR1, RFCI) 959 RET_FROM_EXC_LEVEL(SPRN_CSRR0, SPRN_CSRR1, PPC_RFCI)
960#endif /* CONFIG_40x */ 960#endif /* CONFIG_40x */
961 961
962#ifdef CONFIG_BOOKE 962#ifdef CONFIG_BOOKE
@@ -967,7 +967,7 @@ ret_from_crit_exc:
967 stw r10,KSP_LIMIT(r9) 967 stw r10,KSP_LIMIT(r9)
968 RESTORE_xSRR(SRR0,SRR1); 968 RESTORE_xSRR(SRR0,SRR1);
969 RESTORE_MMU_REGS; 969 RESTORE_MMU_REGS;
970 RET_FROM_EXC_LEVEL(SPRN_CSRR0, SPRN_CSRR1, RFCI) 970 RET_FROM_EXC_LEVEL(SPRN_CSRR0, SPRN_CSRR1, PPC_RFCI)
971 971
972 .globl ret_from_debug_exc 972 .globl ret_from_debug_exc
973ret_from_debug_exc: 973ret_from_debug_exc:
@@ -981,7 +981,7 @@ ret_from_debug_exc:
981 RESTORE_xSRR(SRR0,SRR1); 981 RESTORE_xSRR(SRR0,SRR1);
982 RESTORE_xSRR(CSRR0,CSRR1); 982 RESTORE_xSRR(CSRR0,CSRR1);
983 RESTORE_MMU_REGS; 983 RESTORE_MMU_REGS;
984 RET_FROM_EXC_LEVEL(SPRN_DSRR0, SPRN_DSRR1, RFDI) 984 RET_FROM_EXC_LEVEL(SPRN_DSRR0, SPRN_DSRR1, PPC_RFDI)
985 985
986 .globl ret_from_mcheck_exc 986 .globl ret_from_mcheck_exc
987ret_from_mcheck_exc: 987ret_from_mcheck_exc:
@@ -992,7 +992,7 @@ ret_from_mcheck_exc:
992 RESTORE_xSRR(CSRR0,CSRR1); 992 RESTORE_xSRR(CSRR0,CSRR1);
993 RESTORE_xSRR(DSRR0,DSRR1); 993 RESTORE_xSRR(DSRR0,DSRR1);
994 RESTORE_MMU_REGS; 994 RESTORE_MMU_REGS;
995 RET_FROM_EXC_LEVEL(SPRN_MCSRR0, SPRN_MCSRR1, RFMCI) 995 RET_FROM_EXC_LEVEL(SPRN_MCSRR0, SPRN_MCSRR1, PPC_RFMCI)
996#endif /* CONFIG_BOOKE */ 996#endif /* CONFIG_BOOKE */
997 997
998/* 998/*
@@ -1176,59 +1176,27 @@ _GLOBAL(_mcount)
1176 bctr 1176 bctr
1177 1177
1178_GLOBAL(ftrace_caller) 1178_GLOBAL(ftrace_caller)
1179 /* Based off of objdump optput from glibc */ 1179 MCOUNT_SAVE_FRAME
1180 stwu r1,-48(r1) 1180 /* r3 ends up with link register */
1181 stw r3, 12(r1)
1182 stw r4, 16(r1)
1183 stw r5, 20(r1)
1184 stw r6, 24(r1)
1185 mflr r3
1186 lwz r4, 52(r1)
1187 mfcr r5
1188 stw r7, 28(r1)
1189 stw r8, 32(r1)
1190 stw r9, 36(r1)
1191 stw r10,40(r1)
1192 stw r3, 44(r1)
1193 stw r5, 8(r1)
1194 subi r3, r3, MCOUNT_INSN_SIZE 1181 subi r3, r3, MCOUNT_INSN_SIZE
1195.globl ftrace_call 1182.globl ftrace_call
1196ftrace_call: 1183ftrace_call:
1197 bl ftrace_stub 1184 bl ftrace_stub
1198 nop 1185 nop
1199 lwz r6, 8(r1) 1186#ifdef CONFIG_FUNCTION_GRAPH_TRACER
1200 lwz r0, 44(r1) 1187.globl ftrace_graph_call
1201 lwz r3, 12(r1) 1188ftrace_graph_call:
1202 mtctr r0 1189 b ftrace_graph_stub
1203 lwz r4, 16(r1) 1190_GLOBAL(ftrace_graph_stub)
1204 mtcr r6 1191#endif
1205 lwz r5, 20(r1) 1192 MCOUNT_RESTORE_FRAME
1206 lwz r6, 24(r1) 1193 /* old link register ends up in ctr reg */
1207 lwz r0, 52(r1)
1208 lwz r7, 28(r1)
1209 lwz r8, 32(r1)
1210 mtlr r0
1211 lwz r9, 36(r1)
1212 lwz r10,40(r1)
1213 addi r1, r1, 48
1214 bctr 1194 bctr
1215#else 1195#else
1216_GLOBAL(mcount) 1196_GLOBAL(mcount)
1217_GLOBAL(_mcount) 1197_GLOBAL(_mcount)
1218 stwu r1,-48(r1) 1198
1219 stw r3, 12(r1) 1199 MCOUNT_SAVE_FRAME
1220 stw r4, 16(r1)
1221 stw r5, 20(r1)
1222 stw r6, 24(r1)
1223 mflr r3
1224 lwz r4, 52(r1)
1225 mfcr r5
1226 stw r7, 28(r1)
1227 stw r8, 32(r1)
1228 stw r9, 36(r1)
1229 stw r10,40(r1)
1230 stw r3, 44(r1)
1231 stw r5, 8(r1)
1232 1200
1233 subi r3, r3, MCOUNT_INSN_SIZE 1201 subi r3, r3, MCOUNT_INSN_SIZE
1234 LOAD_REG_ADDR(r5, ftrace_trace_function) 1202 LOAD_REG_ADDR(r5, ftrace_trace_function)
@@ -1236,28 +1204,55 @@ _GLOBAL(_mcount)
1236 1204
1237 mtctr r5 1205 mtctr r5
1238 bctrl 1206 bctrl
1239
1240 nop 1207 nop
1241 1208
1242 lwz r6, 8(r1) 1209#ifdef CONFIG_FUNCTION_GRAPH_TRACER
1243 lwz r0, 44(r1) 1210 b ftrace_graph_caller
1244 lwz r3, 12(r1) 1211#endif
1245 mtctr r0 1212 MCOUNT_RESTORE_FRAME
1246 lwz r4, 16(r1)
1247 mtcr r6
1248 lwz r5, 20(r1)
1249 lwz r6, 24(r1)
1250 lwz r0, 52(r1)
1251 lwz r7, 28(r1)
1252 lwz r8, 32(r1)
1253 mtlr r0
1254 lwz r9, 36(r1)
1255 lwz r10,40(r1)
1256 addi r1, r1, 48
1257 bctr 1213 bctr
1258#endif 1214#endif
1259 1215
1260_GLOBAL(ftrace_stub) 1216_GLOBAL(ftrace_stub)
1261 blr 1217 blr
1262 1218
1219#ifdef CONFIG_FUNCTION_GRAPH_TRACER
1220_GLOBAL(ftrace_graph_caller)
1221 /* load r4 with local address */
1222 lwz r4, 44(r1)
1223 subi r4, r4, MCOUNT_INSN_SIZE
1224
1225 /* get the parent address */
1226 addi r3, r1, 52
1227
1228 bl prepare_ftrace_return
1229 nop
1230
1231 MCOUNT_RESTORE_FRAME
1232 /* old link register ends up in ctr reg */
1233 bctr
1234
1235_GLOBAL(return_to_handler)
1236 /* need to save return values */
1237 stwu r1, -32(r1)
1238 stw r3, 20(r1)
1239 stw r4, 16(r1)
1240 stw r31, 12(r1)
1241 mr r31, r1
1242
1243 bl ftrace_return_to_handler
1244 nop
1245
1246 /* return value has real return address */
1247 mtlr r3
1248
1249 lwz r3, 20(r1)
1250 lwz r4, 16(r1)
1251 lwz r31,12(r1)
1252 lwz r1, 0(r1)
1253
1254 /* Jump back to real return address */
1255 blr
1256#endif /* CONFIG_FUNCTION_GRAPH_TRACER */
1257
1263#endif /* CONFIG_MCOUNT */ 1258#endif /* CONFIG_MCOUNT */
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
index 383ed6eb0085..abfc32330479 100644
--- a/arch/powerpc/kernel/entry_64.S
+++ b/arch/powerpc/kernel/entry_64.S
@@ -908,6 +908,12 @@ _GLOBAL(ftrace_caller)
908ftrace_call: 908ftrace_call:
909 bl ftrace_stub 909 bl ftrace_stub
910 nop 910 nop
911#ifdef CONFIG_FUNCTION_GRAPH_TRACER
912.globl ftrace_graph_call
913ftrace_graph_call:
914 b ftrace_graph_stub
915_GLOBAL(ftrace_graph_stub)
916#endif
911 ld r0, 128(r1) 917 ld r0, 128(r1)
912 mtlr r0 918 mtlr r0
913 addi r1, r1, 112 919 addi r1, r1, 112
@@ -931,13 +937,90 @@ _GLOBAL(_mcount)
931 ld r5,0(r5) 937 ld r5,0(r5)
932 mtctr r5 938 mtctr r5
933 bctrl 939 bctrl
934
935 nop 940 nop
941
942
943#ifdef CONFIG_FUNCTION_GRAPH_TRACER
944 b ftrace_graph_caller
945#endif
936 ld r0, 128(r1) 946 ld r0, 128(r1)
937 mtlr r0 947 mtlr r0
938 addi r1, r1, 112 948 addi r1, r1, 112
939_GLOBAL(ftrace_stub) 949_GLOBAL(ftrace_stub)
940 blr 950 blr
941 951
942#endif 952#endif /* CONFIG_DYNAMIC_FTRACE */
943#endif 953
954#ifdef CONFIG_FUNCTION_GRAPH_TRACER
955_GLOBAL(ftrace_graph_caller)
956 /* load r4 with local address */
957 ld r4, 128(r1)
958 subi r4, r4, MCOUNT_INSN_SIZE
959
960 /* get the parent address */
961 ld r11, 112(r1)
962 addi r3, r11, 16
963
964 bl .prepare_ftrace_return
965 nop
966
967 ld r0, 128(r1)
968 mtlr r0
969 addi r1, r1, 112
970 blr
971
972_GLOBAL(return_to_handler)
973 /* need to save return values */
974 std r4, -24(r1)
975 std r3, -16(r1)
976 std r31, -8(r1)
977 mr r31, r1
978 stdu r1, -112(r1)
979
980 bl .ftrace_return_to_handler
981 nop
982
983 /* return value has real return address */
984 mtlr r3
985
986 ld r1, 0(r1)
987 ld r4, -24(r1)
988 ld r3, -16(r1)
989 ld r31, -8(r1)
990
991 /* Jump back to real return address */
992 blr
993
994_GLOBAL(mod_return_to_handler)
995 /* need to save return values */
996 std r4, -32(r1)
997 std r3, -24(r1)
998 /* save TOC */
999 std r2, -16(r1)
1000 std r31, -8(r1)
1001 mr r31, r1
1002 stdu r1, -112(r1)
1003
1004 /*
1005 * We are in a module using the module's TOC.
1006 * Switch to our TOC to run inside the core kernel.
1007 */
1008 LOAD_REG_IMMEDIATE(r4,ftrace_return_to_handler)
1009 ld r2, 8(r4)
1010
1011 bl .ftrace_return_to_handler
1012 nop
1013
1014 /* return value has real return address */
1015 mtlr r3
1016
1017 ld r1, 0(r1)
1018 ld r4, -32(r1)
1019 ld r3, -24(r1)
1020 ld r2, -16(r1)
1021 ld r31, -8(r1)
1022
1023 /* Jump back to real return address */
1024 blr
1025#endif /* CONFIG_FUNCTION_GRAPH_TRACER */
1026#endif /* CONFIG_FUNCTION_TRACER */
diff --git a/arch/powerpc/kernel/ftrace.c b/arch/powerpc/kernel/ftrace.c
index 60c60ccf5e3c..5b5d16b2cac8 100644
--- a/arch/powerpc/kernel/ftrace.c
+++ b/arch/powerpc/kernel/ftrace.c
@@ -5,6 +5,9 @@
5 * 5 *
6 * Thanks goes out to P.A. Semi, Inc for supplying me with a PPC64 box. 6 * Thanks goes out to P.A. Semi, Inc for supplying me with a PPC64 box.
7 * 7 *
8 * Added function graph tracer code, taken from x86 that was written
9 * by Frederic Weisbecker, and ported to PPC by Steven Rostedt.
10 *
8 */ 11 */
9 12
10#include <linux/spinlock.h> 13#include <linux/spinlock.h>
@@ -20,14 +23,6 @@
20#include <asm/code-patching.h> 23#include <asm/code-patching.h>
21#include <asm/ftrace.h> 24#include <asm/ftrace.h>
22 25
23#if 0
24#define DEBUGP printk
25#else
26#define DEBUGP(fmt , ...) do { } while (0)
27#endif
28
29static unsigned int ftrace_nop = PPC_NOP_INSTR;
30
31#ifdef CONFIG_PPC32 26#ifdef CONFIG_PPC32
32# define GET_ADDR(addr) addr 27# define GET_ADDR(addr) addr
33#else 28#else
@@ -35,37 +30,23 @@ static unsigned int ftrace_nop = PPC_NOP_INSTR;
35# define GET_ADDR(addr) (*(unsigned long *)addr) 30# define GET_ADDR(addr) (*(unsigned long *)addr)
36#endif 31#endif
37 32
38 33#ifdef CONFIG_DYNAMIC_FTRACE
39static unsigned int ftrace_calc_offset(long ip, long addr) 34static unsigned int ftrace_nop_replace(void)
40{ 35{
41 return (int)(addr - ip); 36 return PPC_INST_NOP;
42} 37}
43 38
44static unsigned char *ftrace_nop_replace(void) 39static unsigned int
40ftrace_call_replace(unsigned long ip, unsigned long addr, int link)
45{ 41{
46 return (char *)&ftrace_nop; 42 unsigned int op;
47}
48
49static unsigned char *ftrace_call_replace(unsigned long ip, unsigned long addr)
50{
51 static unsigned int op;
52 43
53 /*
54 * It would be nice to just use create_function_call, but that will
55 * update the code itself. Here we need to just return the
56 * instruction that is going to be modified, without modifying the
57 * code.
58 */
59 addr = GET_ADDR(addr); 44 addr = GET_ADDR(addr);
60 45
61 /* Set to "bl addr" */ 46 /* if (link) set op to 'bl' else 'b' */
62 op = 0x48000001 | (ftrace_calc_offset(ip, addr) & 0x03fffffc); 47 op = create_branch((unsigned int *)ip, addr, link ? 1 : 0);
63 48
64 /* 49 return op;
65 * No locking needed, this must be called via kstop_machine
66 * which in essence is like running on a uniprocessor machine.
67 */
68 return (unsigned char *)&op;
69} 50}
70 51
71#ifdef CONFIG_PPC64 52#ifdef CONFIG_PPC64
@@ -77,10 +58,9 @@ static unsigned char *ftrace_call_replace(unsigned long ip, unsigned long addr)
77#endif 58#endif
78 59
79static int 60static int
80ftrace_modify_code(unsigned long ip, unsigned char *old_code, 61ftrace_modify_code(unsigned long ip, unsigned int old, unsigned int new)
81 unsigned char *new_code)
82{ 62{
83 unsigned char replaced[MCOUNT_INSN_SIZE]; 63 unsigned int replaced;
84 64
85 /* 65 /*
86 * Note: Due to modules and __init, code can 66 * Note: Due to modules and __init, code can
@@ -93,15 +73,15 @@ ftrace_modify_code(unsigned long ip, unsigned char *old_code,
93 */ 73 */
94 74
95 /* read the text we want to modify */ 75 /* read the text we want to modify */
96 if (probe_kernel_read(replaced, (void *)ip, MCOUNT_INSN_SIZE)) 76 if (probe_kernel_read(&replaced, (void *)ip, MCOUNT_INSN_SIZE))
97 return -EFAULT; 77 return -EFAULT;
98 78
99 /* Make sure it is what we expect it to be */ 79 /* Make sure it is what we expect it to be */
100 if (memcmp(replaced, old_code, MCOUNT_INSN_SIZE) != 0) 80 if (replaced != old)
101 return -EINVAL; 81 return -EINVAL;
102 82
103 /* replace the text with the new text */ 83 /* replace the text with the new text */
104 if (probe_kernel_write((void *)ip, new_code, MCOUNT_INSN_SIZE)) 84 if (probe_kernel_write((void *)ip, &new, MCOUNT_INSN_SIZE))
105 return -EPERM; 85 return -EPERM;
106 86
107 flush_icache_range(ip, ip + 8); 87 flush_icache_range(ip, ip + 8);
@@ -119,6 +99,8 @@ static int test_24bit_addr(unsigned long ip, unsigned long addr)
119 return create_branch((unsigned int *)ip, addr, 0); 99 return create_branch((unsigned int *)ip, addr, 0);
120} 100}
121 101
102#ifdef CONFIG_MODULES
103
122static int is_bl_op(unsigned int op) 104static int is_bl_op(unsigned int op)
123{ 105{
124 return (op & 0xfc000003) == 0x48000001; 106 return (op & 0xfc000003) == 0x48000001;
@@ -175,7 +157,7 @@ __ftrace_make_nop(struct module *mod,
175 * 0xe8, 0x4c, 0x00, 0x28, ld r2,40(r12) 157 * 0xe8, 0x4c, 0x00, 0x28, ld r2,40(r12)
176 */ 158 */
177 159
178 DEBUGP("ip:%lx jumps to %lx r2: %lx", ip, tramp, mod->arch.toc); 160 pr_debug("ip:%lx jumps to %lx r2: %lx", ip, tramp, mod->arch.toc);
179 161
180 /* Find where the trampoline jumps to */ 162 /* Find where the trampoline jumps to */
181 if (probe_kernel_read(jmp, (void *)tramp, sizeof(jmp))) { 163 if (probe_kernel_read(jmp, (void *)tramp, sizeof(jmp))) {
@@ -183,7 +165,7 @@ __ftrace_make_nop(struct module *mod,
183 return -EFAULT; 165 return -EFAULT;
184 } 166 }
185 167
186 DEBUGP(" %08x %08x", jmp[0], jmp[1]); 168 pr_debug(" %08x %08x", jmp[0], jmp[1]);
187 169
188 /* verify that this is what we expect it to be */ 170 /* verify that this is what we expect it to be */
189 if (((jmp[0] & 0xffff0000) != 0x3d820000) || 171 if (((jmp[0] & 0xffff0000) != 0x3d820000) ||
@@ -199,18 +181,18 @@ __ftrace_make_nop(struct module *mod,
199 offset = ((unsigned)((unsigned short)jmp[0]) << 16) + 181 offset = ((unsigned)((unsigned short)jmp[0]) << 16) +
200 (int)((short)jmp[1]); 182 (int)((short)jmp[1]);
201 183
202 DEBUGP(" %x ", offset); 184 pr_debug(" %x ", offset);
203 185
204 /* get the address this jumps too */ 186 /* get the address this jumps too */
205 tramp = mod->arch.toc + offset + 32; 187 tramp = mod->arch.toc + offset + 32;
206 DEBUGP("toc: %lx", tramp); 188 pr_debug("toc: %lx", tramp);
207 189
208 if (probe_kernel_read(jmp, (void *)tramp, 8)) { 190 if (probe_kernel_read(jmp, (void *)tramp, 8)) {
209 printk(KERN_ERR "Failed to read %lx\n", tramp); 191 printk(KERN_ERR "Failed to read %lx\n", tramp);
210 return -EFAULT; 192 return -EFAULT;
211 } 193 }
212 194
213 DEBUGP(" %08x %08x\n", jmp[0], jmp[1]); 195 pr_debug(" %08x %08x\n", jmp[0], jmp[1]);
214 196
215 ptr = ((unsigned long)jmp[0] << 32) + jmp[1]; 197 ptr = ((unsigned long)jmp[0] << 32) + jmp[1];
216 198
@@ -287,7 +269,7 @@ __ftrace_make_nop(struct module *mod,
287 * 0x4e, 0x80, 0x04, 0x20 bctr 269 * 0x4e, 0x80, 0x04, 0x20 bctr
288 */ 270 */
289 271
290 DEBUGP("ip:%lx jumps to %lx", ip, tramp); 272 pr_debug("ip:%lx jumps to %lx", ip, tramp);
291 273
292 /* Find where the trampoline jumps to */ 274 /* Find where the trampoline jumps to */
293 if (probe_kernel_read(jmp, (void *)tramp, sizeof(jmp))) { 275 if (probe_kernel_read(jmp, (void *)tramp, sizeof(jmp))) {
@@ -295,7 +277,7 @@ __ftrace_make_nop(struct module *mod,
295 return -EFAULT; 277 return -EFAULT;
296 } 278 }
297 279
298 DEBUGP(" %08x %08x ", jmp[0], jmp[1]); 280 pr_debug(" %08x %08x ", jmp[0], jmp[1]);
299 281
300 /* verify that this is what we expect it to be */ 282 /* verify that this is what we expect it to be */
301 if (((jmp[0] & 0xffff0000) != 0x3d600000) || 283 if (((jmp[0] & 0xffff0000) != 0x3d600000) ||
@@ -311,7 +293,7 @@ __ftrace_make_nop(struct module *mod,
311 if (tramp & 0x8000) 293 if (tramp & 0x8000)
312 tramp -= 0x10000; 294 tramp -= 0x10000;
313 295
314 DEBUGP(" %x ", tramp); 296 pr_debug(" %x ", tramp);
315 297
316 if (tramp != addr) { 298 if (tramp != addr) {
317 printk(KERN_ERR 299 printk(KERN_ERR
@@ -320,7 +302,7 @@ __ftrace_make_nop(struct module *mod,
320 return -EINVAL; 302 return -EINVAL;
321 } 303 }
322 304
323 op = PPC_NOP_INSTR; 305 op = PPC_INST_NOP;
324 306
325 if (probe_kernel_write((void *)ip, &op, MCOUNT_INSN_SIZE)) 307 if (probe_kernel_write((void *)ip, &op, MCOUNT_INSN_SIZE))
326 return -EPERM; 308 return -EPERM;
@@ -330,12 +312,13 @@ __ftrace_make_nop(struct module *mod,
330 return 0; 312 return 0;
331} 313}
332#endif /* PPC64 */ 314#endif /* PPC64 */
315#endif /* CONFIG_MODULES */
333 316
334int ftrace_make_nop(struct module *mod, 317int ftrace_make_nop(struct module *mod,
335 struct dyn_ftrace *rec, unsigned long addr) 318 struct dyn_ftrace *rec, unsigned long addr)
336{ 319{
337 unsigned char *old, *new;
338 unsigned long ip = rec->ip; 320 unsigned long ip = rec->ip;
321 unsigned int old, new;
339 322
340 /* 323 /*
341 * If the calling address is more that 24 bits away, 324 * If the calling address is more that 24 bits away,
@@ -344,11 +327,12 @@ int ftrace_make_nop(struct module *mod,
344 */ 327 */
345 if (test_24bit_addr(ip, addr)) { 328 if (test_24bit_addr(ip, addr)) {
346 /* within range */ 329 /* within range */
347 old = ftrace_call_replace(ip, addr); 330 old = ftrace_call_replace(ip, addr, 1);
348 new = ftrace_nop_replace(); 331 new = ftrace_nop_replace();
349 return ftrace_modify_code(ip, old, new); 332 return ftrace_modify_code(ip, old, new);
350 } 333 }
351 334
335#ifdef CONFIG_MODULES
352 /* 336 /*
353 * Out of range jumps are called from modules. 337 * Out of range jumps are called from modules.
354 * We should either already have a pointer to the module 338 * We should either already have a pointer to the module
@@ -373,9 +357,13 @@ int ftrace_make_nop(struct module *mod,
373 mod = rec->arch.mod; 357 mod = rec->arch.mod;
374 358
375 return __ftrace_make_nop(mod, rec, addr); 359 return __ftrace_make_nop(mod, rec, addr);
376 360#else
361 /* We should not get here without modules */
362 return -EINVAL;
363#endif /* CONFIG_MODULES */
377} 364}
378 365
366#ifdef CONFIG_MODULES
379#ifdef CONFIG_PPC64 367#ifdef CONFIG_PPC64
380static int 368static int
381__ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr) 369__ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr)
@@ -392,7 +380,7 @@ __ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr)
392 * b +8; ld r2,40(r1) 380 * b +8; ld r2,40(r1)
393 */ 381 */
394 if (((op[0] != 0x48000008) || (op[1] != 0xe8410028)) && 382 if (((op[0] != 0x48000008) || (op[1] != 0xe8410028)) &&
395 ((op[0] != PPC_NOP_INSTR) || (op[1] != PPC_NOP_INSTR))) { 383 ((op[0] != PPC_INST_NOP) || (op[1] != PPC_INST_NOP))) {
396 printk(KERN_ERR "Expected NOPs but have %x %x\n", op[0], op[1]); 384 printk(KERN_ERR "Expected NOPs but have %x %x\n", op[0], op[1]);
397 return -EINVAL; 385 return -EINVAL;
398 } 386 }
@@ -414,7 +402,7 @@ __ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr)
414 /* ld r2,40(r1) */ 402 /* ld r2,40(r1) */
415 op[1] = 0xe8410028; 403 op[1] = 0xe8410028;
416 404
417 DEBUGP("write to %lx\n", rec->ip); 405 pr_debug("write to %lx\n", rec->ip);
418 406
419 if (probe_kernel_write((void *)ip, op, MCOUNT_INSN_SIZE * 2)) 407 if (probe_kernel_write((void *)ip, op, MCOUNT_INSN_SIZE * 2))
420 return -EPERM; 408 return -EPERM;
@@ -435,7 +423,7 @@ __ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr)
435 return -EFAULT; 423 return -EFAULT;
436 424
437 /* It should be pointing to a nop */ 425 /* It should be pointing to a nop */
438 if (op != PPC_NOP_INSTR) { 426 if (op != PPC_INST_NOP) {
439 printk(KERN_ERR "Expected NOP but have %x\n", op); 427 printk(KERN_ERR "Expected NOP but have %x\n", op);
440 return -EINVAL; 428 return -EINVAL;
441 } 429 }
@@ -454,7 +442,7 @@ __ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr)
454 return -EINVAL; 442 return -EINVAL;
455 } 443 }
456 444
457 DEBUGP("write to %lx\n", rec->ip); 445 pr_debug("write to %lx\n", rec->ip);
458 446
459 if (probe_kernel_write((void *)ip, &op, MCOUNT_INSN_SIZE)) 447 if (probe_kernel_write((void *)ip, &op, MCOUNT_INSN_SIZE))
460 return -EPERM; 448 return -EPERM;
@@ -464,11 +452,12 @@ __ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr)
464 return 0; 452 return 0;
465} 453}
466#endif /* CONFIG_PPC64 */ 454#endif /* CONFIG_PPC64 */
455#endif /* CONFIG_MODULES */
467 456
468int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr) 457int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr)
469{ 458{
470 unsigned char *old, *new;
471 unsigned long ip = rec->ip; 459 unsigned long ip = rec->ip;
460 unsigned int old, new;
472 461
473 /* 462 /*
474 * If the calling address is more that 24 bits away, 463 * If the calling address is more that 24 bits away,
@@ -478,10 +467,11 @@ int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr)
478 if (test_24bit_addr(ip, addr)) { 467 if (test_24bit_addr(ip, addr)) {
479 /* within range */ 468 /* within range */
480 old = ftrace_nop_replace(); 469 old = ftrace_nop_replace();
481 new = ftrace_call_replace(ip, addr); 470 new = ftrace_call_replace(ip, addr, 1);
482 return ftrace_modify_code(ip, old, new); 471 return ftrace_modify_code(ip, old, new);
483 } 472 }
484 473
474#ifdef CONFIG_MODULES
485 /* 475 /*
486 * Out of range jumps are called from modules. 476 * Out of range jumps are called from modules.
487 * Being that we are converting from nop, it had better 477 * Being that we are converting from nop, it had better
@@ -493,16 +483,20 @@ int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr)
493 } 483 }
494 484
495 return __ftrace_make_call(rec, addr); 485 return __ftrace_make_call(rec, addr);
486#else
487 /* We should not get here without modules */
488 return -EINVAL;
489#endif /* CONFIG_MODULES */
496} 490}
497 491
498int ftrace_update_ftrace_func(ftrace_func_t func) 492int ftrace_update_ftrace_func(ftrace_func_t func)
499{ 493{
500 unsigned long ip = (unsigned long)(&ftrace_call); 494 unsigned long ip = (unsigned long)(&ftrace_call);
501 unsigned char old[MCOUNT_INSN_SIZE], *new; 495 unsigned int old, new;
502 int ret; 496 int ret;
503 497
504 memcpy(old, &ftrace_call, MCOUNT_INSN_SIZE); 498 old = *(unsigned int *)&ftrace_call;
505 new = ftrace_call_replace(ip, (unsigned long)func); 499 new = ftrace_call_replace(ip, (unsigned long)func, 1);
506 ret = ftrace_modify_code(ip, old, new); 500 ret = ftrace_modify_code(ip, old, new);
507 501
508 return ret; 502 return ret;
@@ -517,3 +511,115 @@ int __init ftrace_dyn_arch_init(void *data)
517 511
518 return 0; 512 return 0;
519} 513}
514#endif /* CONFIG_DYNAMIC_FTRACE */
515
516#ifdef CONFIG_FUNCTION_GRAPH_TRACER
517
518#ifdef CONFIG_DYNAMIC_FTRACE
519extern void ftrace_graph_call(void);
520extern void ftrace_graph_stub(void);
521
522int ftrace_enable_ftrace_graph_caller(void)
523{
524 unsigned long ip = (unsigned long)(&ftrace_graph_call);
525 unsigned long addr = (unsigned long)(&ftrace_graph_caller);
526 unsigned long stub = (unsigned long)(&ftrace_graph_stub);
527 unsigned int old, new;
528
529 old = ftrace_call_replace(ip, stub, 0);
530 new = ftrace_call_replace(ip, addr, 0);
531
532 return ftrace_modify_code(ip, old, new);
533}
534
535int ftrace_disable_ftrace_graph_caller(void)
536{
537 unsigned long ip = (unsigned long)(&ftrace_graph_call);
538 unsigned long addr = (unsigned long)(&ftrace_graph_caller);
539 unsigned long stub = (unsigned long)(&ftrace_graph_stub);
540 unsigned int old, new;
541
542 old = ftrace_call_replace(ip, addr, 0);
543 new = ftrace_call_replace(ip, stub, 0);
544
545 return ftrace_modify_code(ip, old, new);
546}
547#endif /* CONFIG_DYNAMIC_FTRACE */
548
549#ifdef CONFIG_PPC64
550extern void mod_return_to_handler(void);
551#endif
552
553/*
554 * Hook the return address and push it in the stack of return addrs
555 * in current thread info.
556 */
557void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr)
558{
559 unsigned long old;
560 unsigned long long calltime;
561 int faulted;
562 struct ftrace_graph_ent trace;
563 unsigned long return_hooker = (unsigned long)&return_to_handler;
564
565 if (unlikely(atomic_read(&current->tracing_graph_pause)))
566 return;
567
568#if CONFIG_PPC64
569 /* non core kernel code needs to save and restore the TOC */
570 if (REGION_ID(self_addr) != KERNEL_REGION_ID)
571 return_hooker = (unsigned long)&mod_return_to_handler;
572#endif
573
574 return_hooker = GET_ADDR(return_hooker);
575
576 /*
577 * Protect against fault, even if it shouldn't
578 * happen. This tool is too much intrusive to
579 * ignore such a protection.
580 */
581 asm volatile(
582 "1: " PPC_LL "%[old], 0(%[parent])\n"
583 "2: " PPC_STL "%[return_hooker], 0(%[parent])\n"
584 " li %[faulted], 0\n"
585 "3:\n"
586
587 ".section .fixup, \"ax\"\n"
588 "4: li %[faulted], 1\n"
589 " b 3b\n"
590 ".previous\n"
591
592 ".section __ex_table,\"a\"\n"
593 PPC_LONG_ALIGN "\n"
594 PPC_LONG "1b,4b\n"
595 PPC_LONG "2b,4b\n"
596 ".previous"
597
598 : [old] "=r" (old), [faulted] "=r" (faulted)
599 : [parent] "r" (parent), [return_hooker] "r" (return_hooker)
600 : "memory"
601 );
602
603 if (unlikely(faulted)) {
604 ftrace_graph_stop();
605 WARN_ON(1);
606 return;
607 }
608
609 calltime = cpu_clock(raw_smp_processor_id());
610
611 if (ftrace_push_return_trace(old, calltime,
612 self_addr, &trace.depth) == -EBUSY) {
613 *parent = old;
614 return;
615 }
616
617 trace.func = self_addr;
618
619 /* Only trace if the calling function expects to */
620 if (!ftrace_graph_entry(&trace)) {
621 current->curr_ret_stack--;
622 *parent = old;
623 }
624}
625#endif /* CONFIG_FUNCTION_GRAPH_TRACER */
diff --git a/arch/powerpc/kernel/head_32.S b/arch/powerpc/kernel/head_32.S
index d794a637e421..54e68c11ae15 100644
--- a/arch/powerpc/kernel/head_32.S
+++ b/arch/powerpc/kernel/head_32.S
@@ -108,18 +108,21 @@ __start:
108 * because OF may have I/O devices mapped into that area 108 * because OF may have I/O devices mapped into that area
109 * (particularly on CHRP). 109 * (particularly on CHRP).
110 */ 110 */
111#ifdef CONFIG_PPC_MULTIPLATFORM
112 cmpwi 0,r5,0 111 cmpwi 0,r5,0
113 beq 1f 112 beq 1f
114 113
114#ifdef CONFIG_PPC_OF_BOOT_TRAMPOLINE
115 /* find out where we are now */ 115 /* find out where we are now */
116 bcl 20,31,$+4 116 bcl 20,31,$+4
1170: mflr r8 /* r8 = runtime addr here */ 1170: mflr r8 /* r8 = runtime addr here */
118 addis r8,r8,(_stext - 0b)@ha 118 addis r8,r8,(_stext - 0b)@ha
119 addi r8,r8,(_stext - 0b)@l /* current runtime base addr */ 119 addi r8,r8,(_stext - 0b)@l /* current runtime base addr */
120 bl prom_init 120 bl prom_init
121#endif /* CONFIG_PPC_OF_BOOT_TRAMPOLINE */
122
123 /* We never return. We also hit that trap if trying to boot
124 * from OF while CONFIG_PPC_OF_BOOT_TRAMPOLINE isn't selected */
121 trap 125 trap
122#endif
123 126
124/* 127/*
125 * Check for BootX signature when supporting PowerMac and branch to 128 * Check for BootX signature when supporting PowerMac and branch to
@@ -472,12 +475,11 @@ SystemCall:
472 . = 0x1000 475 . = 0x1000
473InstructionTLBMiss: 476InstructionTLBMiss:
474/* 477/*
475 * r0: stored ctr 478 * r0: scratch
476 * r1: linux style pte ( later becomes ppc hardware pte ) 479 * r1: linux style pte ( later becomes ppc hardware pte )
477 * r2: ptr to linux-style pte 480 * r2: ptr to linux-style pte
478 * r3: scratch 481 * r3: scratch
479 */ 482 */
480 mfctr r0
481 /* Get PTE (linux-style) and check access */ 483 /* Get PTE (linux-style) and check access */
482 mfspr r3,SPRN_IMISS 484 mfspr r3,SPRN_IMISS
483 lis r1,PAGE_OFFSET@h /* check if kernel address */ 485 lis r1,PAGE_OFFSET@h /* check if kernel address */
@@ -496,28 +498,27 @@ InstructionTLBMiss:
496 rlwinm. r2,r2,0,0,19 /* extract address of pte page */ 498 rlwinm. r2,r2,0,0,19 /* extract address of pte page */
497 beq- InstructionAddressInvalid /* return if no mapping */ 499 beq- InstructionAddressInvalid /* return if no mapping */
498 rlwimi r2,r3,22,20,29 /* insert next 10 bits of address */ 500 rlwimi r2,r3,22,20,29 /* insert next 10 bits of address */
499 lwz r3,0(r2) /* get linux-style pte */ 501 lwz r0,0(r2) /* get linux-style pte */
500 andc. r1,r1,r3 /* check access & ~permission */ 502 andc. r1,r1,r0 /* check access & ~permission */
501 bne- InstructionAddressInvalid /* return if access not permitted */ 503 bne- InstructionAddressInvalid /* return if access not permitted */
502 ori r3,r3,_PAGE_ACCESSED /* set _PAGE_ACCESSED in pte */ 504 ori r0,r0,_PAGE_ACCESSED /* set _PAGE_ACCESSED in pte */
503 /* 505 /*
504 * NOTE! We are assuming this is not an SMP system, otherwise 506 * NOTE! We are assuming this is not an SMP system, otherwise
505 * we would need to update the pte atomically with lwarx/stwcx. 507 * we would need to update the pte atomically with lwarx/stwcx.
506 */ 508 */
507 stw r3,0(r2) /* update PTE (accessed bit) */ 509 stw r0,0(r2) /* update PTE (accessed bit) */
508 /* Convert linux-style PTE to low word of PPC-style PTE */ 510 /* Convert linux-style PTE to low word of PPC-style PTE */
509 rlwinm r1,r3,32-10,31,31 /* _PAGE_RW -> PP lsb */ 511 rlwinm r1,r0,32-10,31,31 /* _PAGE_RW -> PP lsb */
510 rlwinm r2,r3,32-7,31,31 /* _PAGE_DIRTY -> PP lsb */ 512 rlwinm r2,r0,32-7,31,31 /* _PAGE_DIRTY -> PP lsb */
511 and r1,r1,r2 /* writable if _RW and _DIRTY */ 513 and r1,r1,r2 /* writable if _RW and _DIRTY */
512 rlwimi r3,r3,32-1,30,30 /* _PAGE_USER -> PP msb */ 514 rlwimi r0,r0,32-1,30,30 /* _PAGE_USER -> PP msb */
513 rlwimi r3,r3,32-1,31,31 /* _PAGE_USER -> PP lsb */ 515 rlwimi r0,r0,32-1,31,31 /* _PAGE_USER -> PP lsb */
514 ori r1,r1,0xe04 /* clear out reserved bits */ 516 ori r1,r1,0xe04 /* clear out reserved bits */
515 andc r1,r3,r1 /* PP = user? (rw&dirty? 2: 3): 0 */ 517 andc r1,r0,r1 /* PP = user? (rw&dirty? 2: 3): 0 */
516BEGIN_FTR_SECTION 518BEGIN_FTR_SECTION
517 rlwinm r1,r1,0,~_PAGE_COHERENT /* clear M (coherence not required) */ 519 rlwinm r1,r1,0,~_PAGE_COHERENT /* clear M (coherence not required) */
518END_FTR_SECTION_IFCLR(CPU_FTR_NEED_COHERENT) 520END_FTR_SECTION_IFCLR(CPU_FTR_NEED_COHERENT)
519 mtspr SPRN_RPA,r1 521 mtspr SPRN_RPA,r1
520 mfspr r3,SPRN_IMISS
521 tlbli r3 522 tlbli r3
522 mfspr r3,SPRN_SRR1 /* Need to restore CR0 */ 523 mfspr r3,SPRN_SRR1 /* Need to restore CR0 */
523 mtcrf 0x80,r3 524 mtcrf 0x80,r3
@@ -528,7 +529,6 @@ InstructionAddressInvalid:
528 529
529 addis r1,r1,0x2000 530 addis r1,r1,0x2000
530 mtspr SPRN_DSISR,r1 /* (shouldn't be needed) */ 531 mtspr SPRN_DSISR,r1 /* (shouldn't be needed) */
531 mtctr r0 /* Restore CTR */
532 andi. r2,r3,0xFFFF /* Clear upper bits of SRR1 */ 532 andi. r2,r3,0xFFFF /* Clear upper bits of SRR1 */
533 or r2,r2,r1 533 or r2,r2,r1
534 mtspr SPRN_SRR1,r2 534 mtspr SPRN_SRR1,r2
@@ -549,12 +549,11 @@ InstructionAddressInvalid:
549 . = 0x1100 549 . = 0x1100
550DataLoadTLBMiss: 550DataLoadTLBMiss:
551/* 551/*
552 * r0: stored ctr 552 * r0: scratch
553 * r1: linux style pte ( later becomes ppc hardware pte ) 553 * r1: linux style pte ( later becomes ppc hardware pte )
554 * r2: ptr to linux-style pte 554 * r2: ptr to linux-style pte
555 * r3: scratch 555 * r3: scratch
556 */ 556 */
557 mfctr r0
558 /* Get PTE (linux-style) and check access */ 557 /* Get PTE (linux-style) and check access */
559 mfspr r3,SPRN_DMISS 558 mfspr r3,SPRN_DMISS
560 lis r1,PAGE_OFFSET@h /* check if kernel address */ 559 lis r1,PAGE_OFFSET@h /* check if kernel address */
@@ -573,38 +572,48 @@ DataLoadTLBMiss:
573 rlwinm. r2,r2,0,0,19 /* extract address of pte page */ 572 rlwinm. r2,r2,0,0,19 /* extract address of pte page */
574 beq- DataAddressInvalid /* return if no mapping */ 573 beq- DataAddressInvalid /* return if no mapping */
575 rlwimi r2,r3,22,20,29 /* insert next 10 bits of address */ 574 rlwimi r2,r3,22,20,29 /* insert next 10 bits of address */
576 lwz r3,0(r2) /* get linux-style pte */ 575 lwz r0,0(r2) /* get linux-style pte */
577 andc. r1,r1,r3 /* check access & ~permission */ 576 andc. r1,r1,r0 /* check access & ~permission */
578 bne- DataAddressInvalid /* return if access not permitted */ 577 bne- DataAddressInvalid /* return if access not permitted */
579 ori r3,r3,_PAGE_ACCESSED /* set _PAGE_ACCESSED in pte */ 578 ori r0,r0,_PAGE_ACCESSED /* set _PAGE_ACCESSED in pte */
580 /* 579 /*
581 * NOTE! We are assuming this is not an SMP system, otherwise 580 * NOTE! We are assuming this is not an SMP system, otherwise
582 * we would need to update the pte atomically with lwarx/stwcx. 581 * we would need to update the pte atomically with lwarx/stwcx.
583 */ 582 */
584 stw r3,0(r2) /* update PTE (accessed bit) */ 583 stw r0,0(r2) /* update PTE (accessed bit) */
585 /* Convert linux-style PTE to low word of PPC-style PTE */ 584 /* Convert linux-style PTE to low word of PPC-style PTE */
586 rlwinm r1,r3,32-10,31,31 /* _PAGE_RW -> PP lsb */ 585 rlwinm r1,r0,32-10,31,31 /* _PAGE_RW -> PP lsb */
587 rlwinm r2,r3,32-7,31,31 /* _PAGE_DIRTY -> PP lsb */ 586 rlwinm r2,r0,32-7,31,31 /* _PAGE_DIRTY -> PP lsb */
588 and r1,r1,r2 /* writable if _RW and _DIRTY */ 587 and r1,r1,r2 /* writable if _RW and _DIRTY */
589 rlwimi r3,r3,32-1,30,30 /* _PAGE_USER -> PP msb */ 588 rlwimi r0,r0,32-1,30,30 /* _PAGE_USER -> PP msb */
590 rlwimi r3,r3,32-1,31,31 /* _PAGE_USER -> PP lsb */ 589 rlwimi r0,r0,32-1,31,31 /* _PAGE_USER -> PP lsb */
591 ori r1,r1,0xe04 /* clear out reserved bits */ 590 ori r1,r1,0xe04 /* clear out reserved bits */
592 andc r1,r3,r1 /* PP = user? (rw&dirty? 2: 3): 0 */ 591 andc r1,r0,r1 /* PP = user? (rw&dirty? 2: 3): 0 */
593BEGIN_FTR_SECTION 592BEGIN_FTR_SECTION
594 rlwinm r1,r1,0,~_PAGE_COHERENT /* clear M (coherence not required) */ 593 rlwinm r1,r1,0,~_PAGE_COHERENT /* clear M (coherence not required) */
595END_FTR_SECTION_IFCLR(CPU_FTR_NEED_COHERENT) 594END_FTR_SECTION_IFCLR(CPU_FTR_NEED_COHERENT)
596 mtspr SPRN_RPA,r1 595 mtspr SPRN_RPA,r1
597 mfspr r3,SPRN_DMISS 596 mfspr r2,SPRN_SRR1 /* Need to restore CR0 */
597 mtcrf 0x80,r2
598BEGIN_MMU_FTR_SECTION
599 li r0,1
600 mfspr r1,SPRN_SPRG4
601 rlwinm r2,r3,20,27,31 /* Get Address bits 15:19 */
602 slw r0,r0,r2
603 xor r1,r0,r1
604 srw r0,r1,r2
605 mtspr SPRN_SPRG4,r1
606 mfspr r2,SPRN_SRR1
607 rlwimi r2,r0,31-14,14,14
608 mtspr SPRN_SRR1,r2
609END_MMU_FTR_SECTION_IFSET(MMU_FTR_NEED_DTLB_SW_LRU)
598 tlbld r3 610 tlbld r3
599 mfspr r3,SPRN_SRR1 /* Need to restore CR0 */
600 mtcrf 0x80,r3
601 rfi 611 rfi
602DataAddressInvalid: 612DataAddressInvalid:
603 mfspr r3,SPRN_SRR1 613 mfspr r3,SPRN_SRR1
604 rlwinm r1,r3,9,6,6 /* Get load/store bit */ 614 rlwinm r1,r3,9,6,6 /* Get load/store bit */
605 addis r1,r1,0x2000 615 addis r1,r1,0x2000
606 mtspr SPRN_DSISR,r1 616 mtspr SPRN_DSISR,r1
607 mtctr r0 /* Restore CTR */
608 andi. r2,r3,0xFFFF /* Clear upper bits of SRR1 */ 617 andi. r2,r3,0xFFFF /* Clear upper bits of SRR1 */
609 mtspr SPRN_SRR1,r2 618 mtspr SPRN_SRR1,r2
610 mfspr r1,SPRN_DMISS /* Get failing address */ 619 mfspr r1,SPRN_DMISS /* Get failing address */
@@ -624,12 +633,11 @@ DataAddressInvalid:
624 . = 0x1200 633 . = 0x1200
625DataStoreTLBMiss: 634DataStoreTLBMiss:
626/* 635/*
627 * r0: stored ctr 636 * r0: scratch
628 * r1: linux style pte ( later becomes ppc hardware pte ) 637 * r1: linux style pte ( later becomes ppc hardware pte )
629 * r2: ptr to linux-style pte 638 * r2: ptr to linux-style pte
630 * r3: scratch 639 * r3: scratch
631 */ 640 */
632 mfctr r0
633 /* Get PTE (linux-style) and check access */ 641 /* Get PTE (linux-style) and check access */
634 mfspr r3,SPRN_DMISS 642 mfspr r3,SPRN_DMISS
635 lis r1,PAGE_OFFSET@h /* check if kernel address */ 643 lis r1,PAGE_OFFSET@h /* check if kernel address */
@@ -648,27 +656,38 @@ DataStoreTLBMiss:
648 rlwinm. r2,r2,0,0,19 /* extract address of pte page */ 656 rlwinm. r2,r2,0,0,19 /* extract address of pte page */
649 beq- DataAddressInvalid /* return if no mapping */ 657 beq- DataAddressInvalid /* return if no mapping */
650 rlwimi r2,r3,22,20,29 /* insert next 10 bits of address */ 658 rlwimi r2,r3,22,20,29 /* insert next 10 bits of address */
651 lwz r3,0(r2) /* get linux-style pte */ 659 lwz r0,0(r2) /* get linux-style pte */
652 andc. r1,r1,r3 /* check access & ~permission */ 660 andc. r1,r1,r0 /* check access & ~permission */
653 bne- DataAddressInvalid /* return if access not permitted */ 661 bne- DataAddressInvalid /* return if access not permitted */
654 ori r3,r3,_PAGE_ACCESSED|_PAGE_DIRTY 662 ori r0,r0,_PAGE_ACCESSED|_PAGE_DIRTY
655 /* 663 /*
656 * NOTE! We are assuming this is not an SMP system, otherwise 664 * NOTE! We are assuming this is not an SMP system, otherwise
657 * we would need to update the pte atomically with lwarx/stwcx. 665 * we would need to update the pte atomically with lwarx/stwcx.
658 */ 666 */
659 stw r3,0(r2) /* update PTE (accessed/dirty bits) */ 667 stw r0,0(r2) /* update PTE (accessed/dirty bits) */
660 /* Convert linux-style PTE to low word of PPC-style PTE */ 668 /* Convert linux-style PTE to low word of PPC-style PTE */
661 rlwimi r3,r3,32-1,30,30 /* _PAGE_USER -> PP msb */ 669 rlwimi r0,r0,32-1,30,30 /* _PAGE_USER -> PP msb */
662 li r1,0xe05 /* clear out reserved bits & PP lsb */ 670 li r1,0xe05 /* clear out reserved bits & PP lsb */
663 andc r1,r3,r1 /* PP = user? 2: 0 */ 671 andc r1,r0,r1 /* PP = user? 2: 0 */
664BEGIN_FTR_SECTION 672BEGIN_FTR_SECTION
665 rlwinm r1,r1,0,~_PAGE_COHERENT /* clear M (coherence not required) */ 673 rlwinm r1,r1,0,~_PAGE_COHERENT /* clear M (coherence not required) */
666END_FTR_SECTION_IFCLR(CPU_FTR_NEED_COHERENT) 674END_FTR_SECTION_IFCLR(CPU_FTR_NEED_COHERENT)
667 mtspr SPRN_RPA,r1 675 mtspr SPRN_RPA,r1
668 mfspr r3,SPRN_DMISS 676 mfspr r2,SPRN_SRR1 /* Need to restore CR0 */
677 mtcrf 0x80,r2
678BEGIN_MMU_FTR_SECTION
679 li r0,1
680 mfspr r1,SPRN_SPRG4
681 rlwinm r2,r3,20,27,31 /* Get Address bits 15:19 */
682 slw r0,r0,r2
683 xor r1,r0,r1
684 srw r0,r1,r2
685 mtspr SPRN_SPRG4,r1
686 mfspr r2,SPRN_SRR1
687 rlwimi r2,r0,31-14,14,14
688 mtspr SPRN_SRR1,r2
689END_MMU_FTR_SECTION_IFSET(MMU_FTR_NEED_DTLB_SW_LRU)
669 tlbld r3 690 tlbld r3
670 mfspr r3,SPRN_SRR1 /* Need to restore CR0 */
671 mtcrf 0x80,r3
672 rfi 691 rfi
673 692
674#ifndef CONFIG_ALTIVEC 693#ifndef CONFIG_ALTIVEC
diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S
index ebaedafc8e67..50ef505b8fb6 100644
--- a/arch/powerpc/kernel/head_64.S
+++ b/arch/powerpc/kernel/head_64.S
@@ -1360,6 +1360,7 @@ _GLOBAL(__start_initialization_multiplatform)
1360 b .__after_prom_start 1360 b .__after_prom_start
1361 1361
1362_INIT_STATIC(__boot_from_prom) 1362_INIT_STATIC(__boot_from_prom)
1363#ifdef CONFIG_PPC_OF_BOOT_TRAMPOLINE
1363 /* Save parameters */ 1364 /* Save parameters */
1364 mr r31,r3 1365 mr r31,r3
1365 mr r30,r4 1366 mr r30,r4
@@ -1390,7 +1391,10 @@ _INIT_STATIC(__boot_from_prom)
1390 /* Do all of the interaction with OF client interface */ 1391 /* Do all of the interaction with OF client interface */
1391 mr r8,r26 1392 mr r8,r26
1392 bl .prom_init 1393 bl .prom_init
1393 /* We never return */ 1394#endif /* #CONFIG_PPC_OF_BOOT_TRAMPOLINE */
1395
1396 /* We never return. We also hit that trap if trying to boot
1397 * from OF while CONFIG_PPC_OF_BOOT_TRAMPOLINE isn't selected */
1394 trap 1398 trap
1395 1399
1396_STATIC(__after_prom_start) 1400_STATIC(__after_prom_start)
diff --git a/arch/powerpc/kernel/head_booke.h b/arch/powerpc/kernel/head_booke.h
index fce2df988504..95f39f1e68d4 100644
--- a/arch/powerpc/kernel/head_booke.h
+++ b/arch/powerpc/kernel/head_booke.h
@@ -10,6 +10,15 @@
10 mtspr SPRN_IVOR##vector_number,r26; \ 10 mtspr SPRN_IVOR##vector_number,r26; \
11 sync 11 sync
12 12
13#if (THREAD_SHIFT < 15)
14#define ALLOC_STACK_FRAME(reg, val) \
15 addi reg,reg,val
16#else
17#define ALLOC_STACK_FRAME(reg, val) \
18 addis reg,reg,val@ha; \
19 addi reg,reg,val@l
20#endif
21
13#define NORMAL_EXCEPTION_PROLOG \ 22#define NORMAL_EXCEPTION_PROLOG \
14 mtspr SPRN_SPRG0,r10; /* save two registers to work with */\ 23 mtspr SPRN_SPRG0,r10; /* save two registers to work with */\
15 mtspr SPRN_SPRG1,r11; \ 24 mtspr SPRN_SPRG1,r11; \
@@ -20,7 +29,7 @@
20 beq 1f; \ 29 beq 1f; \
21 mfspr r1,SPRN_SPRG3; /* if from user, start at top of */\ 30 mfspr r1,SPRN_SPRG3; /* if from user, start at top of */\
22 lwz r1,THREAD_INFO-THREAD(r1); /* this thread's kernel stack */\ 31 lwz r1,THREAD_INFO-THREAD(r1); /* this thread's kernel stack */\
23 addi r1,r1,THREAD_SIZE; \ 32 ALLOC_STACK_FRAME(r1, THREAD_SIZE); \
241: subi r1,r1,INT_FRAME_SIZE; /* Allocate an exception frame */\ 331: subi r1,r1,INT_FRAME_SIZE; /* Allocate an exception frame */\
25 mr r11,r1; \ 34 mr r11,r1; \
26 stw r10,_CCR(r11); /* save various registers */\ 35 stw r10,_CCR(r11); /* save various registers */\
@@ -70,10 +79,10 @@
70 79
71/* only on e500mc/e200 */ 80/* only on e500mc/e200 */
72#define DEBUG_STACK_BASE dbgirq_ctx 81#define DEBUG_STACK_BASE dbgirq_ctx
73#ifdef CONFIG_PPC_E500MC 82#ifdef CONFIG_E200
74#define DEBUG_SPRG SPRN_SPRG9
75#else
76#define DEBUG_SPRG SPRN_SPRG6W 83#define DEBUG_SPRG SPRN_SPRG6W
84#else
85#define DEBUG_SPRG SPRN_SPRG9
77#endif 86#endif
78 87
79#define EXC_LVL_FRAME_OVERHEAD (THREAD_SIZE - INT_FRAME_SIZE - EXC_LVL_SIZE) 88#define EXC_LVL_FRAME_OVERHEAD (THREAD_SIZE - INT_FRAME_SIZE - EXC_LVL_SIZE)
@@ -279,7 +288,7 @@ label:
279 lwz r11,GPR11(r8); \ 288 lwz r11,GPR11(r8); \
280 mfspr r8,DEBUG_SPRG; \ 289 mfspr r8,DEBUG_SPRG; \
281 \ 290 \
282 RFDI; \ 291 PPC_RFDI; \
283 b .; \ 292 b .; \
284 \ 293 \
285 /* continue normal handling for a debug exception... */ \ 294 /* continue normal handling for a debug exception... */ \
diff --git a/arch/powerpc/kernel/head_fsl_booke.S b/arch/powerpc/kernel/head_fsl_booke.S
index 36ffb3504a4f..4c22620d009b 100644
--- a/arch/powerpc/kernel/head_fsl_booke.S
+++ b/arch/powerpc/kernel/head_fsl_booke.S
@@ -103,10 +103,15 @@ invstr: mflr r6 /* Make it accessible */
103 or r7,r7,r4 103 or r7,r7,r4
104 mtspr SPRN_MAS6,r7 104 mtspr SPRN_MAS6,r7
105 tlbsx 0,r6 /* search MSR[IS], SPID=PID0 */ 105 tlbsx 0,r6 /* search MSR[IS], SPID=PID0 */
106#ifndef CONFIG_E200
107 mfspr r7,SPRN_MAS1 106 mfspr r7,SPRN_MAS1
108 andis. r7,r7,MAS1_VALID@h 107 andis. r7,r7,MAS1_VALID@h
109 bne match_TLB 108 bne match_TLB
109
110 mfspr r7,SPRN_MMUCFG
111 rlwinm r7,r7,21,28,31 /* extract MMUCFG[NPIDS] */
112 cmpwi r7,3
113 bne match_TLB /* skip if NPIDS != 3 */
114
110 mfspr r7,SPRN_PID1 115 mfspr r7,SPRN_PID1
111 slwi r7,r7,16 116 slwi r7,r7,16
112 or r7,r7,r4 117 or r7,r7,r4
@@ -120,7 +125,7 @@ invstr: mflr r6 /* Make it accessible */
120 or r7,r7,r4 125 or r7,r7,r4
121 mtspr SPRN_MAS6,r7 126 mtspr SPRN_MAS6,r7
122 tlbsx 0,r6 /* Fall through, we had to match */ 127 tlbsx 0,r6 /* Fall through, we had to match */
123#endif 128
124match_TLB: 129match_TLB:
125 mfspr r7,SPRN_MAS0 130 mfspr r7,SPRN_MAS0
126 rlwinm r3,r7,16,20,31 /* Extract MAS0(Entry) */ 131 rlwinm r3,r7,16,20,31 /* Extract MAS0(Entry) */
@@ -168,7 +173,7 @@ skpinv: addi r6,r6,1 /* Increment */
168 173
169 /* grab and fixup the RPN */ 174 /* grab and fixup the RPN */
170 mfspr r6,SPRN_MAS1 /* extract MAS1[SIZE] */ 175 mfspr r6,SPRN_MAS1 /* extract MAS1[SIZE] */
171 rlwinm r6,r6,25,27,30 176 rlwinm r6,r6,25,27,31
172 li r8,-1 177 li r8,-1
173 addi r6,r6,10 178 addi r6,r6,10
174 slw r6,r8,r6 /* convert to mask */ 179 slw r6,r8,r6 /* convert to mask */
@@ -194,7 +199,7 @@ skpinv: addi r6,r6,1 /* Increment */
194 xori r6,r4,1 /* Setup TMP mapping in the other Address space */ 199 xori r6,r4,1 /* Setup TMP mapping in the other Address space */
195 slwi r6,r6,12 200 slwi r6,r6,12
196 oris r6,r6,(MAS1_VALID|MAS1_IPROT)@h 201 oris r6,r6,(MAS1_VALID|MAS1_IPROT)@h
197 ori r6,r6,(MAS1_TSIZE(BOOKE_PAGESZ_4K))@l 202 ori r6,r6,(MAS1_TSIZE(BOOK3E_PAGESZ_4K))@l
198 mtspr SPRN_MAS1,r6 203 mtspr SPRN_MAS1,r6
199 mfspr r6,SPRN_MAS2 204 mfspr r6,SPRN_MAS2
200 li r7,0 /* temp EPN = 0 */ 205 li r7,0 /* temp EPN = 0 */
@@ -215,14 +220,19 @@ skpinv: addi r6,r6,1 /* Increment */
215 220
216/* 4. Clear out PIDs & Search info */ 221/* 4. Clear out PIDs & Search info */
217 li r6,0 222 li r6,0
223 mtspr SPRN_MAS6,r6
218 mtspr SPRN_PID0,r6 224 mtspr SPRN_PID0,r6
219#ifndef CONFIG_E200 225
226 mfspr r7,SPRN_MMUCFG
227 rlwinm r7,r7,21,28,31 /* extract MMUCFG[NPIDS] */
228 cmpwi r7,3
229 bne 2f /* skip if NPIDS != 3 */
230
220 mtspr SPRN_PID1,r6 231 mtspr SPRN_PID1,r6
221 mtspr SPRN_PID2,r6 232 mtspr SPRN_PID2,r6
222#endif
223 mtspr SPRN_MAS6,r6
224 233
225/* 5. Invalidate mapping we started in */ 234/* 5. Invalidate mapping we started in */
2352:
226 lis r7,0x1000 /* Set MAS0(TLBSEL) = 1 */ 236 lis r7,0x1000 /* Set MAS0(TLBSEL) = 1 */
227 rlwimi r7,r3,16,4,15 /* Setup MAS0 = TLBSEL | ESEL(r3) */ 237 rlwimi r7,r3,16,4,15 /* Setup MAS0 = TLBSEL | ESEL(r3) */
228 mtspr SPRN_MAS0,r7 238 mtspr SPRN_MAS0,r7
@@ -247,10 +257,10 @@ skpinv: addi r6,r6,1 /* Increment */
247 lis r6,0x1000 /* Set MAS0(TLBSEL) = TLB1(1), ESEL = 0 */ 257 lis r6,0x1000 /* Set MAS0(TLBSEL) = TLB1(1), ESEL = 0 */
248 mtspr SPRN_MAS0,r6 258 mtspr SPRN_MAS0,r6
249 lis r6,(MAS1_VALID|MAS1_IPROT)@h 259 lis r6,(MAS1_VALID|MAS1_IPROT)@h
250 ori r6,r6,(MAS1_TSIZE(BOOKE_PAGESZ_64M))@l 260 ori r6,r6,(MAS1_TSIZE(BOOK3E_PAGESZ_64M))@l
251 mtspr SPRN_MAS1,r6 261 mtspr SPRN_MAS1,r6
252 lis r6,MAS2_VAL(PAGE_OFFSET, BOOKE_PAGESZ_64M, M_IF_SMP)@h 262 lis r6,MAS2_VAL(PAGE_OFFSET, BOOK3E_PAGESZ_64M, M_IF_SMP)@h
253 ori r6,r6,MAS2_VAL(PAGE_OFFSET, BOOKE_PAGESZ_64M, M_IF_SMP)@l 263 ori r6,r6,MAS2_VAL(PAGE_OFFSET, BOOK3E_PAGESZ_64M, M_IF_SMP)@l
254 mtspr SPRN_MAS2,r6 264 mtspr SPRN_MAS2,r6
255 mtspr SPRN_MAS3,r8 265 mtspr SPRN_MAS3,r8
256 tlbwe 266 tlbwe
@@ -298,26 +308,14 @@ skpinv: addi r6,r6,1 /* Increment */
298 SET_IVOR(12, WatchdogTimer); 308 SET_IVOR(12, WatchdogTimer);
299 SET_IVOR(13, DataTLBError); 309 SET_IVOR(13, DataTLBError);
300 SET_IVOR(14, InstructionTLBError); 310 SET_IVOR(14, InstructionTLBError);
301 SET_IVOR(15, DebugDebug);
302#if defined(CONFIG_E500) && !defined(CONFIG_PPC_E500MC)
303 SET_IVOR(15, DebugCrit); 311 SET_IVOR(15, DebugCrit);
304#endif
305 SET_IVOR(32, SPEUnavailable);
306 SET_IVOR(33, SPEFloatingPointData);
307 SET_IVOR(34, SPEFloatingPointRound);
308#ifndef CONFIG_E200
309 SET_IVOR(35, PerformanceMonitor);
310#endif
311#ifdef CONFIG_PPC_E500MC
312 SET_IVOR(36, Doorbell);
313#endif
314 312
315 /* Establish the interrupt vector base */ 313 /* Establish the interrupt vector base */
316 lis r4,interrupt_base@h /* IVPR only uses the high 16-bits */ 314 lis r4,interrupt_base@h /* IVPR only uses the high 16-bits */
317 mtspr SPRN_IVPR,r4 315 mtspr SPRN_IVPR,r4
318 316
319 /* Setup the defaults for TLB entries */ 317 /* Setup the defaults for TLB entries */
320 li r2,(MAS4_TSIZED(BOOKE_PAGESZ_4K))@l 318 li r2,(MAS4_TSIZED(BOOK3E_PAGESZ_4K))@l
321#ifdef CONFIG_E200 319#ifdef CONFIG_E200
322 oris r2,r2,MAS4_TLBSELD(1)@h 320 oris r2,r2,MAS4_TLBSELD(1)@h
323#endif 321#endif
@@ -329,12 +327,6 @@ skpinv: addi r6,r6,1 /* Increment */
329 oris r2,r2,HID0_DOZE@h 327 oris r2,r2,HID0_DOZE@h
330 mtspr SPRN_HID0, r2 328 mtspr SPRN_HID0, r2
331#endif 329#endif
332#ifdef CONFIG_E200
333 /* enable dedicated debug exception handling resources (Debug APU) */
334 mfspr r2,SPRN_HID0
335 ori r2,r2,HID0_DAPUEN@l
336 mtspr SPRN_HID0,r2
337#endif
338 330
339#if !defined(CONFIG_BDI_SWITCH) 331#if !defined(CONFIG_BDI_SWITCH)
340 /* 332 /*
@@ -706,15 +698,13 @@ interrupt_base:
706 /* Performance Monitor */ 698 /* Performance Monitor */
707 EXCEPTION(0x2060, PerformanceMonitor, performance_monitor_exception, EXC_XFER_STD) 699 EXCEPTION(0x2060, PerformanceMonitor, performance_monitor_exception, EXC_XFER_STD)
708 700
709#ifdef CONFIG_PPC_E500MC 701 EXCEPTION(0x2070, Doorbell, doorbell_exception, EXC_XFER_STD)
710 EXCEPTION(0x2070, Doorbell, unknown_exception, EXC_XFER_STD) 702
711#endif 703 CRITICAL_EXCEPTION(0x2080, CriticalDoorbell, unknown_exception)
712 704
713 /* Debug Interrupt */ 705 /* Debug Interrupt */
714 DEBUG_DEBUG_EXCEPTION 706 DEBUG_DEBUG_EXCEPTION
715#if defined(CONFIG_E500) && !defined(CONFIG_PPC_E500MC)
716 DEBUG_CRIT_EXCEPTION 707 DEBUG_CRIT_EXCEPTION
717#endif
718 708
719/* 709/*
720 * Local functions 710 * Local functions
@@ -897,6 +887,47 @@ KernelSPE:
897 * Global functions 887 * Global functions
898 */ 888 */
899 889
890/* Adjust or setup IVORs for e200 */
891_GLOBAL(__setup_e200_ivors)
892 li r3,DebugDebug@l
893 mtspr SPRN_IVOR15,r3
894 li r3,SPEUnavailable@l
895 mtspr SPRN_IVOR32,r3
896 li r3,SPEFloatingPointData@l
897 mtspr SPRN_IVOR33,r3
898 li r3,SPEFloatingPointRound@l
899 mtspr SPRN_IVOR34,r3
900 sync
901 blr
902
903/* Adjust or setup IVORs for e500v1/v2 */
904_GLOBAL(__setup_e500_ivors)
905 li r3,DebugCrit@l
906 mtspr SPRN_IVOR15,r3
907 li r3,SPEUnavailable@l
908 mtspr SPRN_IVOR32,r3
909 li r3,SPEFloatingPointData@l
910 mtspr SPRN_IVOR33,r3
911 li r3,SPEFloatingPointRound@l
912 mtspr SPRN_IVOR34,r3
913 li r3,PerformanceMonitor@l
914 mtspr SPRN_IVOR35,r3
915 sync
916 blr
917
918/* Adjust or setup IVORs for e500mc */
919_GLOBAL(__setup_e500mc_ivors)
920 li r3,DebugDebug@l
921 mtspr SPRN_IVOR15,r3
922 li r3,PerformanceMonitor@l
923 mtspr SPRN_IVOR35,r3
924 li r3,Doorbell@l
925 mtspr SPRN_IVOR36,r3
926 li r3,CriticalDoorbell@l
927 mtspr SPRN_IVOR37,r3
928 sync
929 blr
930
900/* 931/*
901 * extern void loadcam_entry(unsigned int index) 932 * extern void loadcam_entry(unsigned int index)
902 * 933 *
@@ -1089,7 +1120,7 @@ __secondary_start:
1089 mtspr SPRN_SPRG3,r4 1120 mtspr SPRN_SPRG3,r4
1090 1121
1091 /* Setup the defaults for TLB entries */ 1122 /* Setup the defaults for TLB entries */
1092 li r4,(MAS4_TSIZED(BOOKE_PAGESZ_4K))@l 1123 li r4,(MAS4_TSIZED(BOOK3E_PAGESZ_4K))@l
1093 mtspr SPRN_MAS4,r4 1124 mtspr SPRN_MAS4,r4
1094 1125
1095 /* Jump to start_secondary */ 1126 /* Jump to start_secondary */
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index 1b55ffdf0026..5576147e57b6 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -171,7 +171,7 @@ int show_interrupts(struct seq_file *p, void *v)
171{ 171{
172 int i = *(loff_t *)v, j; 172 int i = *(loff_t *)v, j;
173 struct irqaction *action; 173 struct irqaction *action;
174 irq_desc_t *desc; 174 struct irq_desc *desc;
175 unsigned long flags; 175 unsigned long flags;
176 176
177 if (i == 0) { 177 if (i == 0) {
@@ -1038,7 +1038,7 @@ arch_initcall(irq_late_init);
1038static int virq_debug_show(struct seq_file *m, void *private) 1038static int virq_debug_show(struct seq_file *m, void *private)
1039{ 1039{
1040 unsigned long flags; 1040 unsigned long flags;
1041 irq_desc_t *desc; 1041 struct irq_desc *desc;
1042 const char *p; 1042 const char *p;
1043 char none[] = "none"; 1043 char none[] = "none";
1044 int i; 1044 int i;
diff --git a/arch/powerpc/kernel/module_64.c b/arch/powerpc/kernel/module_64.c
index 8992b031a7b6..8fbb12508bf3 100644
--- a/arch/powerpc/kernel/module_64.c
+++ b/arch/powerpc/kernel/module_64.c
@@ -329,7 +329,7 @@ static unsigned long stub_for_addr(Elf64_Shdr *sechdrs,
329 restore r2. */ 329 restore r2. */
330static int restore_r2(u32 *instruction, struct module *me) 330static int restore_r2(u32 *instruction, struct module *me)
331{ 331{
332 if (*instruction != PPC_NOP_INSTR) { 332 if (*instruction != PPC_INST_NOP) {
333 printk("%s: Expect noop after relocate, got %08x\n", 333 printk("%s: Expect noop after relocate, got %08x\n",
334 me->name, *instruction); 334 me->name, *instruction);
335 return 0; 335 return 0;
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index 0f4181272311..9c69e7e145c5 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -38,6 +38,7 @@
38#include <asm/eeh.h> 38#include <asm/eeh.h>
39 39
40static DEFINE_SPINLOCK(hose_spinlock); 40static DEFINE_SPINLOCK(hose_spinlock);
41LIST_HEAD(hose_list);
41 42
42/* XXX kill that some day ... */ 43/* XXX kill that some day ... */
43static int global_phb_number; /* Global phb counter */ 44static int global_phb_number; /* Global phb counter */
@@ -49,7 +50,7 @@ resource_size_t isa_mem_base;
49unsigned int ppc_pci_flags = 0; 50unsigned int ppc_pci_flags = 0;
50 51
51 52
52static struct dma_mapping_ops *pci_dma_ops; 53static struct dma_mapping_ops *pci_dma_ops = &dma_direct_ops;
53 54
54void set_pci_dma_ops(struct dma_mapping_ops *dma_ops) 55void set_pci_dma_ops(struct dma_mapping_ops *dma_ops)
55{ 56{
@@ -113,19 +114,24 @@ void pcibios_free_controller(struct pci_controller *phb)
113 kfree(phb); 114 kfree(phb);
114} 115}
115 116
117static resource_size_t pcibios_io_size(const struct pci_controller *hose)
118{
119#ifdef CONFIG_PPC64
120 return hose->pci_io_size;
121#else
122 return hose->io_resource.end - hose->io_resource.start + 1;
123#endif
124}
125
116int pcibios_vaddr_is_ioport(void __iomem *address) 126int pcibios_vaddr_is_ioport(void __iomem *address)
117{ 127{
118 int ret = 0; 128 int ret = 0;
119 struct pci_controller *hose; 129 struct pci_controller *hose;
120 unsigned long size; 130 resource_size_t size;
121 131
122 spin_lock(&hose_spinlock); 132 spin_lock(&hose_spinlock);
123 list_for_each_entry(hose, &hose_list, list_node) { 133 list_for_each_entry(hose, &hose_list, list_node) {
124#ifdef CONFIG_PPC64 134 size = pcibios_io_size(hose);
125 size = hose->pci_io_size;
126#else
127 size = hose->io_resource.end - hose->io_resource.start + 1;
128#endif
129 if (address >= hose->io_base_virt && 135 if (address >= hose->io_base_virt &&
130 address < (hose->io_base_virt + size)) { 136 address < (hose->io_base_virt + size)) {
131 ret = 1; 137 ret = 1;
@@ -136,6 +142,29 @@ int pcibios_vaddr_is_ioport(void __iomem *address)
136 return ret; 142 return ret;
137} 143}
138 144
145unsigned long pci_address_to_pio(phys_addr_t address)
146{
147 struct pci_controller *hose;
148 resource_size_t size;
149 unsigned long ret = ~0;
150
151 spin_lock(&hose_spinlock);
152 list_for_each_entry(hose, &hose_list, list_node) {
153 size = pcibios_io_size(hose);
154 if (address >= hose->io_base_phys &&
155 address < (hose->io_base_phys + size)) {
156 unsigned long base =
157 (unsigned long)hose->io_base_virt - _IO_BASE;
158 ret = base + (address - hose->io_base_phys);
159 break;
160 }
161 }
162 spin_unlock(&hose_spinlock);
163
164 return ret;
165}
166EXPORT_SYMBOL_GPL(pci_address_to_pio);
167
139/* 168/*
140 * Return the domain number for this bus. 169 * Return the domain number for this bus.
141 */ 170 */
@@ -1453,7 +1482,7 @@ void __init pcibios_resource_survey(void)
1453 * we proceed to assigning things that were left unassigned 1482 * we proceed to assigning things that were left unassigned
1454 */ 1483 */
1455 if (!(ppc_pci_flags & PPC_PCI_PROBE_ONLY)) { 1484 if (!(ppc_pci_flags & PPC_PCI_PROBE_ONLY)) {
1456 pr_debug("PCI: Assigning unassigned resouces...\n"); 1485 pr_debug("PCI: Assigning unassigned resources...\n");
1457 pci_assign_unassigned_resources(); 1486 pci_assign_unassigned_resources();
1458 } 1487 }
1459 1488
diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c
index 132cd80afa21..d473634e39e3 100644
--- a/arch/powerpc/kernel/pci_32.c
+++ b/arch/powerpc/kernel/pci_32.c
@@ -20,6 +20,7 @@
20#include <asm/prom.h> 20#include <asm/prom.h>
21#include <asm/sections.h> 21#include <asm/sections.h>
22#include <asm/pci-bridge.h> 22#include <asm/pci-bridge.h>
23#include <asm/ppc-pci.h>
23#include <asm/byteorder.h> 24#include <asm/byteorder.h>
24#include <asm/uaccess.h> 25#include <asm/uaccess.h>
25#include <asm/machdep.h> 26#include <asm/machdep.h>
@@ -43,8 +44,6 @@ static u8* pci_to_OF_bus_map;
43 */ 44 */
44static int pci_assign_all_buses; 45static int pci_assign_all_buses;
45 46
46LIST_HEAD(hose_list);
47
48static int pci_bus_count; 47static int pci_bus_count;
49 48
50/* This will remain NULL for now, until isa-bridge.c is made common 49/* This will remain NULL for now, until isa-bridge.c is made common
@@ -219,16 +218,23 @@ scan_OF_pci_childs(struct device_node *parent, pci_OF_scan_iterator filter, void
219static struct device_node *scan_OF_for_pci_dev(struct device_node *parent, 218static struct device_node *scan_OF_for_pci_dev(struct device_node *parent,
220 unsigned int devfn) 219 unsigned int devfn)
221{ 220{
222 struct device_node *np; 221 struct device_node *np, *cnp;
223 const u32 *reg; 222 const u32 *reg;
224 unsigned int psize; 223 unsigned int psize;
225 224
226 for_each_child_of_node(parent, np) { 225 for_each_child_of_node(parent, np) {
227 reg = of_get_property(np, "reg", &psize); 226 reg = of_get_property(np, "reg", &psize);
228 if (reg == NULL || psize < 4) 227 if (reg && psize >= 4 && ((reg[0] >> 8) & 0xff) == devfn)
229 continue;
230 if (((reg[0] >> 8) & 0xff) == devfn)
231 return np; 228 return np;
229
230 /* Note: some OFs create a parent node "multifunc-device" as
231 * a fake root for all functions of a multi-function device,
232 * we go down them as well. */
233 if (!strcmp(np->name, "multifunc-device")) {
234 cnp = scan_OF_for_pci_dev(np, devfn);
235 if (cnp)
236 return cnp;
237 }
232 } 238 }
233 return NULL; 239 return NULL;
234} 240}
@@ -491,24 +497,6 @@ long sys_pciconfig_iobase(long which, unsigned long bus, unsigned long devfn)
491 return result; 497 return result;
492} 498}
493 499
494unsigned long pci_address_to_pio(phys_addr_t address)
495{
496 struct pci_controller *hose, *tmp;
497
498 list_for_each_entry_safe(hose, tmp, &hose_list, list_node) {
499 unsigned int size = hose->io_resource.end -
500 hose->io_resource.start + 1;
501 if (address >= hose->io_base_phys &&
502 address < (hose->io_base_phys + size)) {
503 unsigned long base =
504 (unsigned long)hose->io_base_virt - _IO_BASE;
505 return base + (address - hose->io_base_phys);
506 }
507 }
508 return (unsigned int)-1;
509}
510EXPORT_SYMBOL(pci_address_to_pio);
511
512/* 500/*
513 * Null PCI config access functions, for the case when we can't 501 * Null PCI config access functions, for the case when we can't
514 * find a hose. 502 * find a hose.
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c
index ea8eda8c87cf..be574fc0d92f 100644
--- a/arch/powerpc/kernel/pci_64.c
+++ b/arch/powerpc/kernel/pci_64.c
@@ -43,8 +43,6 @@ unsigned long pci_probe_only = 1;
43unsigned long pci_io_base = ISA_IO_BASE; 43unsigned long pci_io_base = ISA_IO_BASE;
44EXPORT_SYMBOL(pci_io_base); 44EXPORT_SYMBOL(pci_io_base);
45 45
46LIST_HEAD(hose_list);
47
48static void fixup_broken_pcnet32(struct pci_dev* dev) 46static void fixup_broken_pcnet32(struct pci_dev* dev)
49{ 47{
50 if ((dev->class>>8 == PCI_CLASS_NETWORK_ETHERNET)) { 48 if ((dev->class>>8 == PCI_CLASS_NETWORK_ETHERNET)) {
@@ -524,23 +522,6 @@ int __devinit pcibios_map_io_space(struct pci_bus *bus)
524} 522}
525EXPORT_SYMBOL_GPL(pcibios_map_io_space); 523EXPORT_SYMBOL_GPL(pcibios_map_io_space);
526 524
527unsigned long pci_address_to_pio(phys_addr_t address)
528{
529 struct pci_controller *hose, *tmp;
530
531 list_for_each_entry_safe(hose, tmp, &hose_list, list_node) {
532 if (address >= hose->io_base_phys &&
533 address < (hose->io_base_phys + hose->pci_io_size)) {
534 unsigned long base =
535 (unsigned long)hose->io_base_virt - _IO_BASE;
536 return base + (address - hose->io_base_phys);
537 }
538 }
539 return (unsigned int)-1;
540}
541EXPORT_SYMBOL_GPL(pci_address_to_pio);
542
543
544#define IOBASE_BRIDGE_NUMBER 0 525#define IOBASE_BRIDGE_NUMBER 0
545#define IOBASE_MEMORY 1 526#define IOBASE_MEMORY 1
546#define IOBASE_IO 2 527#define IOBASE_IO 2
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index fb7049c054c0..eac064948780 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -33,7 +33,10 @@
33#include <linux/mqueue.h> 33#include <linux/mqueue.h>
34#include <linux/hardirq.h> 34#include <linux/hardirq.h>
35#include <linux/utsname.h> 35#include <linux/utsname.h>
36#include <linux/ftrace.h>
36#include <linux/kernel_stat.h> 37#include <linux/kernel_stat.h>
38#include <linux/personality.h>
39#include <linux/random.h>
37 40
38#include <asm/pgtable.h> 41#include <asm/pgtable.h>
39#include <asm/uaccess.h> 42#include <asm/uaccess.h>
@@ -1008,6 +1011,14 @@ void show_stack(struct task_struct *tsk, unsigned long *stack)
1008 unsigned long sp, ip, lr, newsp; 1011 unsigned long sp, ip, lr, newsp;
1009 int count = 0; 1012 int count = 0;
1010 int firstframe = 1; 1013 int firstframe = 1;
1014#ifdef CONFIG_FUNCTION_GRAPH_TRACER
1015 int curr_frame = current->curr_ret_stack;
1016 extern void return_to_handler(void);
1017 unsigned long addr = (unsigned long)return_to_handler;
1018#ifdef CONFIG_PPC64
1019 addr = *(unsigned long*)addr;
1020#endif
1021#endif
1011 1022
1012 sp = (unsigned long) stack; 1023 sp = (unsigned long) stack;
1013 if (tsk == NULL) 1024 if (tsk == NULL)
@@ -1030,6 +1041,13 @@ void show_stack(struct task_struct *tsk, unsigned long *stack)
1030 ip = stack[STACK_FRAME_LR_SAVE]; 1041 ip = stack[STACK_FRAME_LR_SAVE];
1031 if (!firstframe || ip != lr) { 1042 if (!firstframe || ip != lr) {
1032 printk("["REG"] ["REG"] %pS", sp, ip, (void *)ip); 1043 printk("["REG"] ["REG"] %pS", sp, ip, (void *)ip);
1044#ifdef CONFIG_FUNCTION_GRAPH_TRACER
1045 if (ip == addr && curr_frame >= 0) {
1046 printk(" (%pS)",
1047 (void *)current->ret_stack[curr_frame].ret);
1048 curr_frame--;
1049 }
1050#endif
1033 if (firstframe) 1051 if (firstframe)
1034 printk(" (unreliable)"); 1052 printk(" (unreliable)");
1035 printk("\n"); 1053 printk("\n");
@@ -1122,3 +1140,43 @@ void thread_info_cache_init(void)
1122} 1140}
1123 1141
1124#endif /* THREAD_SHIFT < PAGE_SHIFT */ 1142#endif /* THREAD_SHIFT < PAGE_SHIFT */
1143
1144unsigned long arch_align_stack(unsigned long sp)
1145{
1146 if (!(current->personality & ADDR_NO_RANDOMIZE) && randomize_va_space)
1147 sp -= get_random_int() & ~PAGE_MASK;
1148 return sp & ~0xf;
1149}
1150
1151static inline unsigned long brk_rnd(void)
1152{
1153 unsigned long rnd = 0;
1154
1155 /* 8MB for 32bit, 1GB for 64bit */
1156 if (is_32bit_task())
1157 rnd = (long)(get_random_int() % (1<<(23-PAGE_SHIFT)));
1158 else
1159 rnd = (long)(get_random_int() % (1<<(30-PAGE_SHIFT)));
1160
1161 return rnd << PAGE_SHIFT;
1162}
1163
1164unsigned long arch_randomize_brk(struct mm_struct *mm)
1165{
1166 unsigned long ret = PAGE_ALIGN(mm->brk + brk_rnd());
1167
1168 if (ret < mm->brk)
1169 return mm->brk;
1170
1171 return ret;
1172}
1173
1174unsigned long randomize_et_dyn(unsigned long base)
1175{
1176 unsigned long ret = PAGE_ALIGN(base + brk_rnd());
1177
1178 if (ret < base)
1179 return base;
1180
1181 return ret;
1182}
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index f00f83109ab3..5ec6a9e23933 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -1075,11 +1075,6 @@ static void __init early_reserve_mem(void)
1075 DBG("reserving: %llx -> %llx\n", base, size); 1075 DBG("reserving: %llx -> %llx\n", base, size);
1076 lmb_reserve(base, size); 1076 lmb_reserve(base, size);
1077 } 1077 }
1078
1079#if 0
1080 DBG("memory reserved, lmbs :\n");
1081 lmb_dump_all();
1082#endif
1083} 1078}
1084 1079
1085#ifdef CONFIG_PHYP_DUMP 1080#ifdef CONFIG_PHYP_DUMP
@@ -1221,6 +1216,7 @@ void __init early_init_devtree(void *params)
1221 lmb_enforce_memory_limit(limit); 1216 lmb_enforce_memory_limit(limit);
1222 1217
1223 lmb_analyze(); 1218 lmb_analyze();
1219 lmb_dump_all();
1224 1220
1225 DBG("Phys. mem: %lx\n", lmb_phys_mem_size()); 1221 DBG("Phys. mem: %lx\n", lmb_phys_mem_size());
1226 1222
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index 7f1b33d5e30d..2e026c0407d4 100644
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -2283,6 +2283,8 @@ unsigned long __init prom_init(unsigned long r3, unsigned long r4,
2283 */ 2283 */
2284 prom_init_stdout(); 2284 prom_init_stdout();
2285 2285
2286 prom_printf("Preparing to boot %s", RELOC(linux_banner));
2287
2286 /* 2288 /*
2287 * Get default machine type. At this point, we do not differentiate 2289 * Get default machine type. At this point, we do not differentiate
2288 * between pSeries SMP and pSeries LPAR 2290 * between pSeries SMP and pSeries LPAR
diff --git a/arch/powerpc/kernel/prom_init_check.sh b/arch/powerpc/kernel/prom_init_check.sh
index ea3a2ec03ffa..1ac136b128f0 100644
--- a/arch/powerpc/kernel/prom_init_check.sh
+++ b/arch/powerpc/kernel/prom_init_check.sh
@@ -20,7 +20,7 @@ WHITELIST="add_reloc_offset __bss_start __bss_stop copy_and_flush
20_end enter_prom memcpy memset reloc_offset __secondary_hold 20_end enter_prom memcpy memset reloc_offset __secondary_hold
21__secondary_hold_acknowledge __secondary_hold_spinloop __start 21__secondary_hold_acknowledge __secondary_hold_spinloop __start
22strcmp strcpy strlcpy strlen strncmp strstr logo_linux_clut224 22strcmp strcpy strlcpy strlen strncmp strstr logo_linux_clut224
23reloc_got2 kernstart_addr memstart_addr" 23reloc_got2 kernstart_addr memstart_addr linux_banner"
24 24
25NM="$1" 25NM="$1"
26OBJ="$2" 26OBJ="$2"
diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c
index fdfe14c4bdef..ee4c7609b649 100644
--- a/arch/powerpc/kernel/rtas.c
+++ b/arch/powerpc/kernel/rtas.c
@@ -46,6 +46,7 @@ EXPORT_SYMBOL(rtas);
46 46
47struct rtas_suspend_me_data { 47struct rtas_suspend_me_data {
48 atomic_t working; /* number of cpus accessing this struct */ 48 atomic_t working; /* number of cpus accessing this struct */
49 atomic_t done;
49 int token; /* ibm,suspend-me */ 50 int token; /* ibm,suspend-me */
50 int error; 51 int error;
51 struct completion *complete; /* wait on this until working == 0 */ 52 struct completion *complete; /* wait on this until working == 0 */
@@ -689,7 +690,7 @@ static int ibm_suspend_me_token = RTAS_UNKNOWN_SERVICE;
689#ifdef CONFIG_PPC_PSERIES 690#ifdef CONFIG_PPC_PSERIES
690static void rtas_percpu_suspend_me(void *info) 691static void rtas_percpu_suspend_me(void *info)
691{ 692{
692 long rc; 693 long rc = H_SUCCESS;
693 unsigned long msr_save; 694 unsigned long msr_save;
694 int cpu; 695 int cpu;
695 struct rtas_suspend_me_data *data = 696 struct rtas_suspend_me_data *data =
@@ -701,7 +702,8 @@ static void rtas_percpu_suspend_me(void *info)
701 msr_save = mfmsr(); 702 msr_save = mfmsr();
702 mtmsr(msr_save & ~(MSR_EE)); 703 mtmsr(msr_save & ~(MSR_EE));
703 704
704 rc = plpar_hcall_norets(H_JOIN); 705 while (rc == H_SUCCESS && !atomic_read(&data->done))
706 rc = plpar_hcall_norets(H_JOIN);
705 707
706 mtmsr(msr_save); 708 mtmsr(msr_save);
707 709
@@ -724,6 +726,9 @@ static void rtas_percpu_suspend_me(void *info)
724 smp_processor_id(), rc); 726 smp_processor_id(), rc);
725 data->error = rc; 727 data->error = rc;
726 } 728 }
729
730 atomic_set(&data->done, 1);
731
727 /* This cpu did the suspend or got an error; in either case, 732 /* This cpu did the suspend or got an error; in either case,
728 * we need to prod all other other cpus out of join state. 733 * we need to prod all other other cpus out of join state.
729 * Extra prods are harmless. 734 * Extra prods are harmless.
@@ -766,6 +771,7 @@ static int rtas_ibm_suspend_me(struct rtas_args *args)
766 } 771 }
767 772
768 atomic_set(&data.working, 0); 773 atomic_set(&data.working, 0);
774 atomic_set(&data.done, 0);
769 data.token = rtas_token("ibm,suspend-me"); 775 data.token = rtas_token("ibm,suspend-me");
770 data.error = 0; 776 data.error = 0;
771 data.complete = &done; 777 data.complete = &done;
diff --git a/arch/powerpc/kernel/rtas_flash.c b/arch/powerpc/kernel/rtas_flash.c
index 149cb112cd1a..13011a96a977 100644
--- a/arch/powerpc/kernel/rtas_flash.c
+++ b/arch/powerpc/kernel/rtas_flash.c
@@ -669,7 +669,6 @@ static void remove_flash_pde(struct proc_dir_entry *dp)
669{ 669{
670 if (dp) { 670 if (dp) {
671 kfree(dp->data); 671 kfree(dp->data);
672 dp->owner = NULL;
673 remove_proc_entry(dp->name, dp->parent); 672 remove_proc_entry(dp->name, dp->parent);
674 } 673 }
675} 674}
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index 705fc4bf3800..9774f9fed96e 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -35,6 +35,8 @@
35#include <linux/debugfs.h> 35#include <linux/debugfs.h>
36#include <linux/percpu.h> 36#include <linux/percpu.h>
37#include <linux/lmb.h> 37#include <linux/lmb.h>
38#include <linux/of_platform.h>
39#include <linux/platform_device.h>
38#include <asm/io.h> 40#include <asm/io.h>
39#include <asm/prom.h> 41#include <asm/prom.h>
40#include <asm/processor.h> 42#include <asm/processor.h>
@@ -669,3 +671,37 @@ static int powerpc_debugfs_init(void)
669} 671}
670arch_initcall(powerpc_debugfs_init); 672arch_initcall(powerpc_debugfs_init);
671#endif 673#endif
674
675static int ppc_dflt_bus_notify(struct notifier_block *nb,
676 unsigned long action, void *data)
677{
678 struct device *dev = data;
679
680 /* We are only intereted in device addition */
681 if (action != BUS_NOTIFY_ADD_DEVICE)
682 return 0;
683
684 set_dma_ops(dev, &dma_direct_ops);
685
686 return NOTIFY_DONE;
687}
688
689static struct notifier_block ppc_dflt_plat_bus_notifier = {
690 .notifier_call = ppc_dflt_bus_notify,
691 .priority = INT_MAX,
692};
693
694static struct notifier_block ppc_dflt_of_bus_notifier = {
695 .notifier_call = ppc_dflt_bus_notify,
696 .priority = INT_MAX,
697};
698
699static int __init setup_bus_notifier(void)
700{
701 bus_register_notifier(&platform_bus_type, &ppc_dflt_plat_bus_notifier);
702 bus_register_notifier(&of_platform_bus_type, &ppc_dflt_of_bus_notifier);
703
704 return 0;
705}
706
707arch_initcall(setup_bus_notifier);
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 2d34196bba8c..c410c606955d 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -202,8 +202,6 @@ void __init early_setup(unsigned long dt_ptr)
202 202
203 /* Fix up paca fields required for the boot cpu */ 203 /* Fix up paca fields required for the boot cpu */
204 get_paca()->cpu_start = 1; 204 get_paca()->cpu_start = 1;
205 get_paca()->stab_real = __pa((u64)&initial_stab);
206 get_paca()->stab_addr = (u64)&initial_stab;
207 205
208 /* Probe the machine type */ 206 /* Probe the machine type */
209 probe_machine(); 207 probe_machine();
@@ -212,20 +210,8 @@ void __init early_setup(unsigned long dt_ptr)
212 210
213 DBG("Found, Initializing memory management...\n"); 211 DBG("Found, Initializing memory management...\n");
214 212
215 /* 213 /* Initialize the hash table or TLB handling */
216 * Initialize the MMU Hash table and create the linear mapping 214 early_init_mmu();
217 * of memory. Has to be done before stab/slb initialization as
218 * this is currently where the page size encoding is obtained
219 */
220 htab_initialize();
221
222 /*
223 * Initialize stab / SLB management except on iSeries
224 */
225 if (cpu_has_feature(CPU_FTR_SLB))
226 slb_initialize();
227 else if (!firmware_has_feature(FW_FEATURE_ISERIES))
228 stab_initialize(get_paca()->stab_real);
229 215
230 DBG(" <- early_setup()\n"); 216 DBG(" <- early_setup()\n");
231} 217}
@@ -233,22 +219,11 @@ void __init early_setup(unsigned long dt_ptr)
233#ifdef CONFIG_SMP 219#ifdef CONFIG_SMP
234void early_setup_secondary(void) 220void early_setup_secondary(void)
235{ 221{
236 struct paca_struct *lpaca = get_paca();
237
238 /* Mark interrupts enabled in PACA */ 222 /* Mark interrupts enabled in PACA */
239 lpaca->soft_enabled = 0; 223 get_paca()->soft_enabled = 0;
240 224
241 /* Initialize hash table for that CPU */ 225 /* Initialize the hash table or TLB handling */
242 htab_initialize_secondary(); 226 early_init_mmu_secondary();
243
244 /* Initialize STAB/SLB. We use a virtual address as it works
245 * in real mode on pSeries and we want a virutal address on
246 * iSeries anyway
247 */
248 if (cpu_has_feature(CPU_FTR_SLB))
249 slb_initialize();
250 else
251 stab_initialize(lpaca->stab_addr);
252} 227}
253 228
254#endif /* CONFIG_SMP */ 229#endif /* CONFIG_SMP */
@@ -578,13 +553,6 @@ void ppc64_boot_msg(unsigned int src, const char *msg)
578 printk("[boot]%04x %s\n", src, msg); 553 printk("[boot]%04x %s\n", src, msg);
579} 554}
580 555
581/* Print a termination message (print only -- does not stop the kernel) */
582void ppc64_terminate_msg(unsigned int src, const char *msg)
583{
584 ppc64_do_msg(PPC64_LINUX_FUNCTION|PPC64_TERM_MESSAGE|src, msg);
585 printk("[terminate]%04x %s\n", src, msg);
586}
587
588void cpu_die(void) 556void cpu_die(void)
589{ 557{
590 if (ppc_md.cpu_die) 558 if (ppc_md.cpu_die)
diff --git a/arch/powerpc/kernel/signal.c b/arch/powerpc/kernel/signal.c
index a54405ebd7b0..00b5078da9a3 100644
--- a/arch/powerpc/kernel/signal.c
+++ b/arch/powerpc/kernel/signal.c
@@ -26,12 +26,12 @@ int show_unhandled_signals = 0;
26 * Allocate space for the signal frame 26 * Allocate space for the signal frame
27 */ 27 */
28void __user * get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, 28void __user * get_sigframe(struct k_sigaction *ka, struct pt_regs *regs,
29 size_t frame_size) 29 size_t frame_size, int is_32)
30{ 30{
31 unsigned long oldsp, newsp; 31 unsigned long oldsp, newsp;
32 32
33 /* Default to using normal stack */ 33 /* Default to using normal stack */
34 oldsp = regs->gpr[1]; 34 oldsp = get_clean_sp(regs, is_32);
35 35
36 /* Check for alt stack */ 36 /* Check for alt stack */
37 if ((ka->sa.sa_flags & SA_ONSTACK) && 37 if ((ka->sa.sa_flags & SA_ONSTACK) &&
diff --git a/arch/powerpc/kernel/signal.h b/arch/powerpc/kernel/signal.h
index b427bf8e1d8f..6c0ddfc0603e 100644
--- a/arch/powerpc/kernel/signal.h
+++ b/arch/powerpc/kernel/signal.h
@@ -15,7 +15,7 @@
15extern void do_signal(struct pt_regs *regs, unsigned long thread_info_flags); 15extern void do_signal(struct pt_regs *regs, unsigned long thread_info_flags);
16 16
17extern void __user * get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, 17extern void __user * get_sigframe(struct k_sigaction *ka, struct pt_regs *regs,
18 size_t frame_size); 18 size_t frame_size, int is_32);
19extern void restore_sigmask(sigset_t *set); 19extern void restore_sigmask(sigset_t *set);
20 20
21extern int handle_signal32(unsigned long sig, struct k_sigaction *ka, 21extern int handle_signal32(unsigned long sig, struct k_sigaction *ka,
@@ -39,22 +39,12 @@ extern unsigned long copy_vsx_from_user(struct task_struct *task,
39 39
40#ifdef CONFIG_PPC64 40#ifdef CONFIG_PPC64
41 41
42static inline int is_32bit_task(void)
43{
44 return test_thread_flag(TIF_32BIT);
45}
46
47extern int handle_rt_signal64(int signr, struct k_sigaction *ka, 42extern int handle_rt_signal64(int signr, struct k_sigaction *ka,
48 siginfo_t *info, sigset_t *set, 43 siginfo_t *info, sigset_t *set,
49 struct pt_regs *regs); 44 struct pt_regs *regs);
50 45
51#else /* CONFIG_PPC64 */ 46#else /* CONFIG_PPC64 */
52 47
53static inline int is_32bit_task(void)
54{
55 return 1;
56}
57
58static inline int handle_rt_signal64(int signr, struct k_sigaction *ka, 48static inline int handle_rt_signal64(int signr, struct k_sigaction *ka,
59 siginfo_t *info, sigset_t *set, 49 siginfo_t *info, sigset_t *set,
60 struct pt_regs *regs) 50 struct pt_regs *regs)
diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c
index b13abf305996..d670429a1608 100644
--- a/arch/powerpc/kernel/signal_32.c
+++ b/arch/powerpc/kernel/signal_32.c
@@ -836,7 +836,7 @@ int handle_rt_signal32(unsigned long sig, struct k_sigaction *ka,
836 836
837 /* Set up Signal Frame */ 837 /* Set up Signal Frame */
838 /* Put a Real Time Context onto stack */ 838 /* Put a Real Time Context onto stack */
839 rt_sf = get_sigframe(ka, regs, sizeof(*rt_sf)); 839 rt_sf = get_sigframe(ka, regs, sizeof(*rt_sf), 1);
840 addr = rt_sf; 840 addr = rt_sf;
841 if (unlikely(rt_sf == NULL)) 841 if (unlikely(rt_sf == NULL))
842 goto badframe; 842 goto badframe;
@@ -1182,7 +1182,7 @@ int handle_signal32(unsigned long sig, struct k_sigaction *ka,
1182 unsigned long newsp = 0; 1182 unsigned long newsp = 0;
1183 1183
1184 /* Set up Signal Frame */ 1184 /* Set up Signal Frame */
1185 frame = get_sigframe(ka, regs, sizeof(*frame)); 1185 frame = get_sigframe(ka, regs, sizeof(*frame), 1);
1186 if (unlikely(frame == NULL)) 1186 if (unlikely(frame == NULL))
1187 goto badframe; 1187 goto badframe;
1188 sc = (struct sigcontext __user *) &frame->sctx; 1188 sc = (struct sigcontext __user *) &frame->sctx;
diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c
index e132891d3cea..2fe6fc64b614 100644
--- a/arch/powerpc/kernel/signal_64.c
+++ b/arch/powerpc/kernel/signal_64.c
@@ -402,7 +402,7 @@ int handle_rt_signal64(int signr, struct k_sigaction *ka, siginfo_t *info,
402 unsigned long newsp = 0; 402 unsigned long newsp = 0;
403 long err = 0; 403 long err = 0;
404 404
405 frame = get_sigframe(ka, regs, sizeof(*frame)); 405 frame = get_sigframe(ka, regs, sizeof(*frame), 0);
406 if (unlikely(frame == NULL)) 406 if (unlikely(frame == NULL))
407 goto badframe; 407 goto badframe;
408 408
diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kernel/sysfs.c
index 4a2ee08af6a7..f41aec85aa49 100644
--- a/arch/powerpc/kernel/sysfs.c
+++ b/arch/powerpc/kernel/sysfs.c
@@ -134,44 +134,23 @@ void ppc_enable_pmcs(void)
134} 134}
135EXPORT_SYMBOL(ppc_enable_pmcs); 135EXPORT_SYMBOL(ppc_enable_pmcs);
136 136
137#if defined(CONFIG_6xx) || defined(CONFIG_PPC64)
138/* XXX convert to rusty's on_one_cpu */
139static unsigned long run_on_cpu(unsigned long cpu,
140 unsigned long (*func)(unsigned long),
141 unsigned long arg)
142{
143 cpumask_t old_affinity = current->cpus_allowed;
144 unsigned long ret;
145
146 /* should return -EINVAL to userspace */
147 if (set_cpus_allowed(current, cpumask_of_cpu(cpu)))
148 return 0;
149
150 ret = func(arg);
151
152 set_cpus_allowed(current, old_affinity);
153
154 return ret;
155}
156#endif
157
158#define SYSFS_PMCSETUP(NAME, ADDRESS) \ 137#define SYSFS_PMCSETUP(NAME, ADDRESS) \
159static unsigned long read_##NAME(unsigned long junk) \ 138static void read_##NAME(void *val) \
160{ \ 139{ \
161 return mfspr(ADDRESS); \ 140 *(unsigned long *)val = mfspr(ADDRESS); \
162} \ 141} \
163static unsigned long write_##NAME(unsigned long val) \ 142static void write_##NAME(void *val) \
164{ \ 143{ \
165 ppc_enable_pmcs(); \ 144 ppc_enable_pmcs(); \
166 mtspr(ADDRESS, val); \ 145 mtspr(ADDRESS, *(unsigned long *)val); \
167 return 0; \
168} \ 146} \
169static ssize_t show_##NAME(struct sys_device *dev, \ 147static ssize_t show_##NAME(struct sys_device *dev, \
170 struct sysdev_attribute *attr, \ 148 struct sysdev_attribute *attr, \
171 char *buf) \ 149 char *buf) \
172{ \ 150{ \
173 struct cpu *cpu = container_of(dev, struct cpu, sysdev); \ 151 struct cpu *cpu = container_of(dev, struct cpu, sysdev); \
174 unsigned long val = run_on_cpu(cpu->sysdev.id, read_##NAME, 0); \ 152 unsigned long val; \
153 smp_call_function_single(cpu->sysdev.id, read_##NAME, &val, 1); \
175 return sprintf(buf, "%lx\n", val); \ 154 return sprintf(buf, "%lx\n", val); \
176} \ 155} \
177static ssize_t __used \ 156static ssize_t __used \
@@ -183,7 +162,7 @@ static ssize_t __used \
183 int ret = sscanf(buf, "%lx", &val); \ 162 int ret = sscanf(buf, "%lx", &val); \
184 if (ret != 1) \ 163 if (ret != 1) \
185 return -EINVAL; \ 164 return -EINVAL; \
186 run_on_cpu(cpu->sysdev.id, write_##NAME, val); \ 165 smp_call_function_single(cpu->sysdev.id, write_##NAME, &val, 1); \
187 return count; \ 166 return count; \
188} 167}
189 168
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index 5457e9575685..678fbff0d206 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -52,6 +52,10 @@
52#include <asm/processor.h> 52#include <asm/processor.h>
53#endif 53#endif
54#include <asm/kexec.h> 54#include <asm/kexec.h>
55#include <asm/ppc-opcode.h>
56#ifdef CONFIG_FSL_BOOKE
57#include <asm/dbell.h>
58#endif
55 59
56#if defined(CONFIG_DEBUGGER) || defined(CONFIG_KEXEC) 60#if defined(CONFIG_DEBUGGER) || defined(CONFIG_KEXEC)
57int (*__debugger)(struct pt_regs *regs); 61int (*__debugger)(struct pt_regs *regs);
@@ -637,29 +641,6 @@ static void parse_fpe(struct pt_regs *regs)
637 * bits is faster and easier. 641 * bits is faster and easier.
638 * 642 *
639 */ 643 */
640#define INST_MFSPR_PVR 0x7c1f42a6
641#define INST_MFSPR_PVR_MASK 0xfc1fffff
642
643#define INST_DCBA 0x7c0005ec
644#define INST_DCBA_MASK 0xfc0007fe
645
646#define INST_MCRXR 0x7c000400
647#define INST_MCRXR_MASK 0xfc0007fe
648
649#define INST_STRING 0x7c00042a
650#define INST_STRING_MASK 0xfc0007fe
651#define INST_STRING_GEN_MASK 0xfc00067e
652#define INST_LSWI 0x7c0004aa
653#define INST_LSWX 0x7c00042a
654#define INST_STSWI 0x7c0005aa
655#define INST_STSWX 0x7c00052a
656
657#define INST_POPCNTB 0x7c0000f4
658#define INST_POPCNTB_MASK 0xfc0007fe
659
660#define INST_ISEL 0x7c00001e
661#define INST_ISEL_MASK 0xfc00003e
662
663static int emulate_string_inst(struct pt_regs *regs, u32 instword) 644static int emulate_string_inst(struct pt_regs *regs, u32 instword)
664{ 645{
665 u8 rT = (instword >> 21) & 0x1f; 646 u8 rT = (instword >> 21) & 0x1f;
@@ -670,20 +651,20 @@ static int emulate_string_inst(struct pt_regs *regs, u32 instword)
670 int pos = 0; 651 int pos = 0;
671 652
672 /* Early out if we are an invalid form of lswx */ 653 /* Early out if we are an invalid form of lswx */
673 if ((instword & INST_STRING_MASK) == INST_LSWX) 654 if ((instword & PPC_INST_STRING_MASK) == PPC_INST_LSWX)
674 if ((rT == rA) || (rT == NB_RB)) 655 if ((rT == rA) || (rT == NB_RB))
675 return -EINVAL; 656 return -EINVAL;
676 657
677 EA = (rA == 0) ? 0 : regs->gpr[rA]; 658 EA = (rA == 0) ? 0 : regs->gpr[rA];
678 659
679 switch (instword & INST_STRING_MASK) { 660 switch (instword & PPC_INST_STRING_MASK) {
680 case INST_LSWX: 661 case PPC_INST_LSWX:
681 case INST_STSWX: 662 case PPC_INST_STSWX:
682 EA += NB_RB; 663 EA += NB_RB;
683 num_bytes = regs->xer & 0x7f; 664 num_bytes = regs->xer & 0x7f;
684 break; 665 break;
685 case INST_LSWI: 666 case PPC_INST_LSWI:
686 case INST_STSWI: 667 case PPC_INST_STSWI:
687 num_bytes = (NB_RB == 0) ? 32 : NB_RB; 668 num_bytes = (NB_RB == 0) ? 32 : NB_RB;
688 break; 669 break;
689 default: 670 default:
@@ -695,9 +676,9 @@ static int emulate_string_inst(struct pt_regs *regs, u32 instword)
695 u8 val; 676 u8 val;
696 u32 shift = 8 * (3 - (pos & 0x3)); 677 u32 shift = 8 * (3 - (pos & 0x3));
697 678
698 switch ((instword & INST_STRING_MASK)) { 679 switch ((instword & PPC_INST_STRING_MASK)) {
699 case INST_LSWX: 680 case PPC_INST_LSWX:
700 case INST_LSWI: 681 case PPC_INST_LSWI:
701 if (get_user(val, (u8 __user *)EA)) 682 if (get_user(val, (u8 __user *)EA))
702 return -EFAULT; 683 return -EFAULT;
703 /* first time updating this reg, 684 /* first time updating this reg,
@@ -706,8 +687,8 @@ static int emulate_string_inst(struct pt_regs *regs, u32 instword)
706 regs->gpr[rT] = 0; 687 regs->gpr[rT] = 0;
707 regs->gpr[rT] |= val << shift; 688 regs->gpr[rT] |= val << shift;
708 break; 689 break;
709 case INST_STSWI: 690 case PPC_INST_STSWI:
710 case INST_STSWX: 691 case PPC_INST_STSWX:
711 val = regs->gpr[rT] >> shift; 692 val = regs->gpr[rT] >> shift;
712 if (put_user(val, (u8 __user *)EA)) 693 if (put_user(val, (u8 __user *)EA))
713 return -EFAULT; 694 return -EFAULT;
@@ -775,18 +756,18 @@ static int emulate_instruction(struct pt_regs *regs)
775 return -EFAULT; 756 return -EFAULT;
776 757
777 /* Emulate the mfspr rD, PVR. */ 758 /* Emulate the mfspr rD, PVR. */
778 if ((instword & INST_MFSPR_PVR_MASK) == INST_MFSPR_PVR) { 759 if ((instword & PPC_INST_MFSPR_PVR_MASK) == PPC_INST_MFSPR_PVR) {
779 rd = (instword >> 21) & 0x1f; 760 rd = (instword >> 21) & 0x1f;
780 regs->gpr[rd] = mfspr(SPRN_PVR); 761 regs->gpr[rd] = mfspr(SPRN_PVR);
781 return 0; 762 return 0;
782 } 763 }
783 764
784 /* Emulating the dcba insn is just a no-op. */ 765 /* Emulating the dcba insn is just a no-op. */
785 if ((instword & INST_DCBA_MASK) == INST_DCBA) 766 if ((instword & PPC_INST_DCBA_MASK) == PPC_INST_DCBA)
786 return 0; 767 return 0;
787 768
788 /* Emulate the mcrxr insn. */ 769 /* Emulate the mcrxr insn. */
789 if ((instword & INST_MCRXR_MASK) == INST_MCRXR) { 770 if ((instword & PPC_INST_MCRXR_MASK) == PPC_INST_MCRXR) {
790 int shift = (instword >> 21) & 0x1c; 771 int shift = (instword >> 21) & 0x1c;
791 unsigned long msk = 0xf0000000UL >> shift; 772 unsigned long msk = 0xf0000000UL >> shift;
792 773
@@ -796,16 +777,16 @@ static int emulate_instruction(struct pt_regs *regs)
796 } 777 }
797 778
798 /* Emulate load/store string insn. */ 779 /* Emulate load/store string insn. */
799 if ((instword & INST_STRING_GEN_MASK) == INST_STRING) 780 if ((instword & PPC_INST_STRING_GEN_MASK) == PPC_INST_STRING)
800 return emulate_string_inst(regs, instword); 781 return emulate_string_inst(regs, instword);
801 782
802 /* Emulate the popcntb (Population Count Bytes) instruction. */ 783 /* Emulate the popcntb (Population Count Bytes) instruction. */
803 if ((instword & INST_POPCNTB_MASK) == INST_POPCNTB) { 784 if ((instword & PPC_INST_POPCNTB_MASK) == PPC_INST_POPCNTB) {
804 return emulate_popcntb_inst(regs, instword); 785 return emulate_popcntb_inst(regs, instword);
805 } 786 }
806 787
807 /* Emulate isel (Integer Select) instruction */ 788 /* Emulate isel (Integer Select) instruction */
808 if ((instword & INST_ISEL_MASK) == INST_ISEL) { 789 if ((instword & PPC_INST_ISEL_MASK) == PPC_INST_ISEL) {
809 return emulate_isel(regs, instword); 790 return emulate_isel(regs, instword);
810 } 791 }
811 792
@@ -1144,6 +1125,24 @@ void vsx_assist_exception(struct pt_regs *regs)
1144#endif /* CONFIG_VSX */ 1125#endif /* CONFIG_VSX */
1145 1126
1146#ifdef CONFIG_FSL_BOOKE 1127#ifdef CONFIG_FSL_BOOKE
1128
1129void doorbell_exception(struct pt_regs *regs)
1130{
1131#ifdef CONFIG_SMP
1132 int cpu = smp_processor_id();
1133 int msg;
1134
1135 if (num_online_cpus() < 2)
1136 return;
1137
1138 for (msg = 0; msg < 4; msg++)
1139 if (test_and_clear_bit(msg, &dbell_smp_message[cpu]))
1140 smp_message_recv(msg);
1141#else
1142 printk(KERN_WARNING "Received doorbell on non-smp system\n");
1143#endif
1144}
1145
1147void CacheLockingException(struct pt_regs *regs, unsigned long address, 1146void CacheLockingException(struct pt_regs *regs, unsigned long address,
1148 unsigned long error_code) 1147 unsigned long error_code)
1149{ 1148{
diff --git a/arch/powerpc/kernel/udbg.c b/arch/powerpc/kernel/udbg.c
index 7d6c9bb8c77f..fc9af47e2128 100644
--- a/arch/powerpc/kernel/udbg.c
+++ b/arch/powerpc/kernel/udbg.c
@@ -18,6 +18,7 @@
18#include <asm/udbg.h> 18#include <asm/udbg.h>
19 19
20void (*udbg_putc)(char c); 20void (*udbg_putc)(char c);
21void (*udbg_flush)(void);
21int (*udbg_getc)(void); 22int (*udbg_getc)(void);
22int (*udbg_getc_poll)(void); 23int (*udbg_getc_poll)(void);
23 24
@@ -76,6 +77,9 @@ void udbg_puts(const char *s)
76 while ((c = *s++) != '\0') 77 while ((c = *s++) != '\0')
77 udbg_putc(c); 78 udbg_putc(c);
78 } 79 }
80
81 if (udbg_flush)
82 udbg_flush();
79 } 83 }
80#if 0 84#if 0
81 else { 85 else {
@@ -98,6 +102,9 @@ int udbg_write(const char *s, int n)
98 } 102 }
99 } 103 }
100 104
105 if (udbg_flush)
106 udbg_flush();
107
101 return n - remain; 108 return n - remain;
102} 109}
103 110
diff --git a/arch/powerpc/kernel/udbg_16550.c b/arch/powerpc/kernel/udbg_16550.c
index 7b7da8cfd5e8..0362a891e54e 100644
--- a/arch/powerpc/kernel/udbg_16550.c
+++ b/arch/powerpc/kernel/udbg_16550.c
@@ -48,14 +48,21 @@ struct NS16550 {
48 48
49static struct NS16550 __iomem *udbg_comport; 49static struct NS16550 __iomem *udbg_comport;
50 50
51static void udbg_550_putc(char c) 51static void udbg_550_flush(void)
52{ 52{
53 if (udbg_comport) { 53 if (udbg_comport) {
54 while ((in_8(&udbg_comport->lsr) & LSR_THRE) == 0) 54 while ((in_8(&udbg_comport->lsr) & LSR_THRE) == 0)
55 /* wait for idle */; 55 /* wait for idle */;
56 out_8(&udbg_comport->thr, c); 56 }
57}
58
59static void udbg_550_putc(char c)
60{
61 if (udbg_comport) {
57 if (c == '\n') 62 if (c == '\n')
58 udbg_550_putc('\r'); 63 udbg_550_putc('\r');
64 udbg_550_flush();
65 out_8(&udbg_comport->thr, c);
59 } 66 }
60} 67}
61 68
@@ -108,6 +115,7 @@ void udbg_init_uart(void __iomem *comport, unsigned int speed,
108 /* Clear & enable FIFOs */ 115 /* Clear & enable FIFOs */
109 out_8(&udbg_comport->fcr ,0x07); 116 out_8(&udbg_comport->fcr ,0x07);
110 udbg_putc = udbg_550_putc; 117 udbg_putc = udbg_550_putc;
118 udbg_flush = udbg_550_flush;
111 udbg_getc = udbg_550_getc; 119 udbg_getc = udbg_550_getc;
112 udbg_getc_poll = udbg_550_getc_poll; 120 udbg_getc_poll = udbg_550_getc_poll;
113 } 121 }
@@ -149,14 +157,21 @@ unsigned int udbg_probe_uart_speed(void __iomem *comport, unsigned int clock)
149} 157}
150 158
151#ifdef CONFIG_PPC_MAPLE 159#ifdef CONFIG_PPC_MAPLE
152void udbg_maple_real_putc(char c) 160void udbg_maple_real_flush(void)
153{ 161{
154 if (udbg_comport) { 162 if (udbg_comport) {
155 while ((real_readb(&udbg_comport->lsr) & LSR_THRE) == 0) 163 while ((real_readb(&udbg_comport->lsr) & LSR_THRE) == 0)
156 /* wait for idle */; 164 /* wait for idle */;
157 real_writeb(c, &udbg_comport->thr); eieio(); 165 }
166}
167
168void udbg_maple_real_putc(char c)
169{
170 if (udbg_comport) {
158 if (c == '\n') 171 if (c == '\n')
159 udbg_maple_real_putc('\r'); 172 udbg_maple_real_putc('\r');
173 udbg_maple_real_flush();
174 real_writeb(c, &udbg_comport->thr); eieio();
160 } 175 }
161} 176}
162 177
@@ -165,20 +180,28 @@ void __init udbg_init_maple_realmode(void)
165 udbg_comport = (struct NS16550 __iomem *)0xf40003f8; 180 udbg_comport = (struct NS16550 __iomem *)0xf40003f8;
166 181
167 udbg_putc = udbg_maple_real_putc; 182 udbg_putc = udbg_maple_real_putc;
183 udbg_flush = udbg_maple_real_flush;
168 udbg_getc = NULL; 184 udbg_getc = NULL;
169 udbg_getc_poll = NULL; 185 udbg_getc_poll = NULL;
170} 186}
171#endif /* CONFIG_PPC_MAPLE */ 187#endif /* CONFIG_PPC_MAPLE */
172 188
173#ifdef CONFIG_PPC_PASEMI 189#ifdef CONFIG_PPC_PASEMI
174void udbg_pas_real_putc(char c) 190void udbg_pas_real_flush(void)
175{ 191{
176 if (udbg_comport) { 192 if (udbg_comport) {
177 while ((real_205_readb(&udbg_comport->lsr) & LSR_THRE) == 0) 193 while ((real_205_readb(&udbg_comport->lsr) & LSR_THRE) == 0)
178 /* wait for idle */; 194 /* wait for idle */;
179 real_205_writeb(c, &udbg_comport->thr); eieio(); 195 }
196}
197
198void udbg_pas_real_putc(char c)
199{
200 if (udbg_comport) {
180 if (c == '\n') 201 if (c == '\n')
181 udbg_pas_real_putc('\r'); 202 udbg_pas_real_putc('\r');
203 udbg_pas_real_flush();
204 real_205_writeb(c, &udbg_comport->thr); eieio();
182 } 205 }
183} 206}
184 207
@@ -187,6 +210,7 @@ void udbg_init_pas_realmode(void)
187 udbg_comport = (struct NS16550 __iomem *)0xfcff03f8UL; 210 udbg_comport = (struct NS16550 __iomem *)0xfcff03f8UL;
188 211
189 udbg_putc = udbg_pas_real_putc; 212 udbg_putc = udbg_pas_real_putc;
213 udbg_flush = udbg_pas_real_flush;
190 udbg_getc = NULL; 214 udbg_getc = NULL;
191 udbg_getc_poll = NULL; 215 udbg_getc_poll = NULL;
192} 216}
@@ -195,14 +219,21 @@ void udbg_init_pas_realmode(void)
195#ifdef CONFIG_PPC_EARLY_DEBUG_44x 219#ifdef CONFIG_PPC_EARLY_DEBUG_44x
196#include <platforms/44x/44x.h> 220#include <platforms/44x/44x.h>
197 221
198static void udbg_44x_as1_putc(char c) 222static int udbg_44x_as1_flush(void)
199{ 223{
200 if (udbg_comport) { 224 if (udbg_comport) {
201 while ((as1_readb(&udbg_comport->lsr) & LSR_THRE) == 0) 225 while ((as1_readb(&udbg_comport->lsr) & LSR_THRE) == 0)
202 /* wait for idle */; 226 /* wait for idle */;
203 as1_writeb(c, &udbg_comport->thr); eieio(); 227 }
228}
229
230static void udbg_44x_as1_putc(char c)
231{
232 if (udbg_comport) {
204 if (c == '\n') 233 if (c == '\n')
205 udbg_44x_as1_putc('\r'); 234 udbg_44x_as1_putc('\r');
235 udbg_44x_as1_flush();
236 as1_writeb(c, &udbg_comport->thr); eieio();
206 } 237 }
207} 238}
208 239
@@ -222,19 +253,27 @@ void __init udbg_init_44x_as1(void)
222 (struct NS16550 __iomem *)PPC44x_EARLY_DEBUG_VIRTADDR; 253 (struct NS16550 __iomem *)PPC44x_EARLY_DEBUG_VIRTADDR;
223 254
224 udbg_putc = udbg_44x_as1_putc; 255 udbg_putc = udbg_44x_as1_putc;
256 udbg_flush = udbg_44x_as1_flush;
225 udbg_getc = udbg_44x_as1_getc; 257 udbg_getc = udbg_44x_as1_getc;
226} 258}
227#endif /* CONFIG_PPC_EARLY_DEBUG_44x */ 259#endif /* CONFIG_PPC_EARLY_DEBUG_44x */
228 260
229#ifdef CONFIG_PPC_EARLY_DEBUG_40x 261#ifdef CONFIG_PPC_EARLY_DEBUG_40x
230static void udbg_40x_real_putc(char c) 262static void udbg_40x_real_flush(void)
231{ 263{
232 if (udbg_comport) { 264 if (udbg_comport) {
233 while ((real_readb(&udbg_comport->lsr) & LSR_THRE) == 0) 265 while ((real_readb(&udbg_comport->lsr) & LSR_THRE) == 0)
234 /* wait for idle */; 266 /* wait for idle */;
235 real_writeb(c, &udbg_comport->thr); eieio(); 267 }
268}
269
270static void udbg_40x_real_putc(char c)
271{
272 if (udbg_comport) {
236 if (c == '\n') 273 if (c == '\n')
237 udbg_40x_real_putc('\r'); 274 udbg_40x_real_putc('\r');
275 udbg_40x_real_flush();
276 real_writeb(c, &udbg_comport->thr); eieio();
238 } 277 }
239} 278}
240 279
@@ -254,6 +293,7 @@ void __init udbg_init_40x_realmode(void)
254 CONFIG_PPC_EARLY_DEBUG_40x_PHYSADDR; 293 CONFIG_PPC_EARLY_DEBUG_40x_PHYSADDR;
255 294
256 udbg_putc = udbg_40x_real_putc; 295 udbg_putc = udbg_40x_real_putc;
296 udbg_flush = udbg_40x_real_flush;
257 udbg_getc = udbg_40x_real_getc; 297 udbg_getc = udbg_40x_real_getc;
258 udbg_getc_poll = NULL; 298 udbg_getc_poll = NULL;
259} 299}
diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S
index 67f07f453385..b9ef1644a722 100644
--- a/arch/powerpc/kernel/vmlinux.lds.S
+++ b/arch/powerpc/kernel/vmlinux.lds.S
@@ -58,6 +58,7 @@ SECTIONS
58 SCHED_TEXT 58 SCHED_TEXT
59 LOCK_TEXT 59 LOCK_TEXT
60 KPROBES_TEXT 60 KPROBES_TEXT
61 IRQENTRY_TEXT
61 62
62#ifdef CONFIG_PPC32 63#ifdef CONFIG_PPC32
63 *(.got1) 64 *(.got1)
diff --git a/arch/powerpc/lib/dma-noncoherent.c b/arch/powerpc/lib/dma-noncoherent.c
index b7dc4c19f582..005a28d380af 100644
--- a/arch/powerpc/lib/dma-noncoherent.c
+++ b/arch/powerpc/lib/dma-noncoherent.c
@@ -29,121 +29,11 @@
29#include <linux/types.h> 29#include <linux/types.h>
30#include <linux/highmem.h> 30#include <linux/highmem.h>
31#include <linux/dma-mapping.h> 31#include <linux/dma-mapping.h>
32#include <linux/vmalloc.h>
32 33
33#include <asm/tlbflush.h> 34#include <asm/tlbflush.h>
34 35
35/* 36/*
36 * This address range defaults to a value that is safe for all
37 * platforms which currently set CONFIG_NOT_COHERENT_CACHE. It
38 * can be further configured for specific applications under
39 * the "Advanced Setup" menu. -Matt
40 */
41#define CONSISTENT_BASE (CONFIG_CONSISTENT_START)
42#define CONSISTENT_END (CONFIG_CONSISTENT_START + CONFIG_CONSISTENT_SIZE)
43#define CONSISTENT_OFFSET(x) (((unsigned long)(x) - CONSISTENT_BASE) >> PAGE_SHIFT)
44
45/*
46 * This is the page table (2MB) covering uncached, DMA consistent allocations
47 */
48static pte_t *consistent_pte;
49static DEFINE_SPINLOCK(consistent_lock);
50
51/*
52 * VM region handling support.
53 *
54 * This should become something generic, handling VM region allocations for
55 * vmalloc and similar (ioremap, module space, etc).
56 *
57 * I envisage vmalloc()'s supporting vm_struct becoming:
58 *
59 * struct vm_struct {
60 * struct vm_region region;
61 * unsigned long flags;
62 * struct page **pages;
63 * unsigned int nr_pages;
64 * unsigned long phys_addr;
65 * };
66 *
67 * get_vm_area() would then call vm_region_alloc with an appropriate
68 * struct vm_region head (eg):
69 *
70 * struct vm_region vmalloc_head = {
71 * .vm_list = LIST_HEAD_INIT(vmalloc_head.vm_list),
72 * .vm_start = VMALLOC_START,
73 * .vm_end = VMALLOC_END,
74 * };
75 *
76 * However, vmalloc_head.vm_start is variable (typically, it is dependent on
77 * the amount of RAM found at boot time.) I would imagine that get_vm_area()
78 * would have to initialise this each time prior to calling vm_region_alloc().
79 */
80struct ppc_vm_region {
81 struct list_head vm_list;
82 unsigned long vm_start;
83 unsigned long vm_end;
84};
85
86static struct ppc_vm_region consistent_head = {
87 .vm_list = LIST_HEAD_INIT(consistent_head.vm_list),
88 .vm_start = CONSISTENT_BASE,
89 .vm_end = CONSISTENT_END,
90};
91
92static struct ppc_vm_region *
93ppc_vm_region_alloc(struct ppc_vm_region *head, size_t size, gfp_t gfp)
94{
95 unsigned long addr = head->vm_start, end = head->vm_end - size;
96 unsigned long flags;
97 struct ppc_vm_region *c, *new;
98
99 new = kmalloc(sizeof(struct ppc_vm_region), gfp);
100 if (!new)
101 goto out;
102
103 spin_lock_irqsave(&consistent_lock, flags);
104
105 list_for_each_entry(c, &head->vm_list, vm_list) {
106 if ((addr + size) < addr)
107 goto nospc;
108 if ((addr + size) <= c->vm_start)
109 goto found;
110 addr = c->vm_end;
111 if (addr > end)
112 goto nospc;
113 }
114
115 found:
116 /*
117 * Insert this entry _before_ the one we found.
118 */
119 list_add_tail(&new->vm_list, &c->vm_list);
120 new->vm_start = addr;
121 new->vm_end = addr + size;
122
123 spin_unlock_irqrestore(&consistent_lock, flags);
124 return new;
125
126 nospc:
127 spin_unlock_irqrestore(&consistent_lock, flags);
128 kfree(new);
129 out:
130 return NULL;
131}
132
133static struct ppc_vm_region *ppc_vm_region_find(struct ppc_vm_region *head, unsigned long addr)
134{
135 struct ppc_vm_region *c;
136
137 list_for_each_entry(c, &head->vm_list, vm_list) {
138 if (c->vm_start == addr)
139 goto out;
140 }
141 c = NULL;
142 out:
143 return c;
144}
145
146/*
147 * Allocate DMA-coherent memory space and return both the kernel remapped 37 * Allocate DMA-coherent memory space and return both the kernel remapped
148 * virtual and bus address for that space. 38 * virtual and bus address for that space.
149 */ 39 */
@@ -151,21 +41,21 @@ void *
151__dma_alloc_coherent(size_t size, dma_addr_t *handle, gfp_t gfp) 41__dma_alloc_coherent(size_t size, dma_addr_t *handle, gfp_t gfp)
152{ 42{
153 struct page *page; 43 struct page *page;
154 struct ppc_vm_region *c;
155 unsigned long order; 44 unsigned long order;
45 int i;
46 unsigned int nr_pages = PAGE_ALIGN(size)>>PAGE_SHIFT;
47 unsigned int array_size = nr_pages * sizeof(struct page *);
48 struct page **pages;
49 struct page *end;
156 u64 mask = 0x00ffffff, limit; /* ISA default */ 50 u64 mask = 0x00ffffff, limit; /* ISA default */
51 struct vm_struct *area;
157 52
158 if (!consistent_pte) { 53 BUG_ON(!mem_init_done);
159 printk(KERN_ERR "%s: not initialised\n", __func__);
160 dump_stack();
161 return NULL;
162 }
163
164 size = PAGE_ALIGN(size); 54 size = PAGE_ALIGN(size);
165 limit = (mask + 1) & ~mask; 55 limit = (mask + 1) & ~mask;
166 if ((limit && size >= limit) || size >= (CONSISTENT_END - CONSISTENT_BASE)) { 56 if (limit && size >= limit) {
167 printk(KERN_WARNING "coherent allocation too big (requested %#x mask %#Lx)\n", 57 printk(KERN_WARNING "coherent allocation too big (requested "
168 size, mask); 58 "%#x mask %#Lx)\n", size, mask);
169 return NULL; 59 return NULL;
170 } 60 }
171 61
@@ -178,6 +68,8 @@ __dma_alloc_coherent(size_t size, dma_addr_t *handle, gfp_t gfp)
178 if (!page) 68 if (!page)
179 goto no_page; 69 goto no_page;
180 70
71 end = page + (1 << order);
72
181 /* 73 /*
182 * Invalidate any data that might be lurking in the 74 * Invalidate any data that might be lurking in the
183 * kernel direct-mapped region for device DMA. 75 * kernel direct-mapped region for device DMA.
@@ -188,48 +80,59 @@ __dma_alloc_coherent(size_t size, dma_addr_t *handle, gfp_t gfp)
188 flush_dcache_range(kaddr, kaddr + size); 80 flush_dcache_range(kaddr, kaddr + size);
189 } 81 }
190 82
83 split_page(page, order);
84
191 /* 85 /*
192 * Allocate a virtual address in the consistent mapping region. 86 * Set the "dma handle"
193 */ 87 */
194 c = ppc_vm_region_alloc(&consistent_head, size, 88 *handle = page_to_phys(page);
195 gfp & ~(__GFP_DMA | __GFP_HIGHMEM)); 89
196 if (c) { 90 area = get_vm_area_caller(size, VM_IOREMAP,
197 unsigned long vaddr = c->vm_start; 91 __builtin_return_address(1));
198 pte_t *pte = consistent_pte + CONSISTENT_OFFSET(vaddr); 92 if (!area)
199 struct page *end = page + (1 << order); 93 goto out_free_pages;
200 94
201 split_page(page, order); 95 if (array_size > PAGE_SIZE) {
202 96 pages = vmalloc(array_size);
203 /* 97 area->flags |= VM_VPAGES;
204 * Set the "dma handle" 98 } else {
205 */ 99 pages = kmalloc(array_size, GFP_KERNEL);
206 *handle = page_to_phys(page); 100 }
101 if (!pages)
102 goto out_free_area;
207 103
208 do { 104 area->pages = pages;
209 BUG_ON(!pte_none(*pte)); 105 area->nr_pages = nr_pages;
210 106
211 SetPageReserved(page); 107 for (i = 0; i < nr_pages; i++)
212 set_pte_at(&init_mm, vaddr, 108 pages[i] = page + i;
213 pte, mk_pte(page, pgprot_noncached(PAGE_KERNEL)));
214 page++;
215 pte++;
216 vaddr += PAGE_SIZE;
217 } while (size -= PAGE_SIZE);
218 109
219 /* 110 if (map_vm_area(area, pgprot_noncached(PAGE_KERNEL), &pages))
220 * Free the otherwise unused pages. 111 goto out_unmap;
221 */
222 while (page < end) {
223 __free_page(page);
224 page++;
225 }
226 112
227 return (void *)c->vm_start; 113 /*
114 * Free the otherwise unused pages.
115 */
116 page += nr_pages;
117 while (page < end) {
118 __free_page(page);
119 page++;
228 } 120 }
229 121
122 return area->addr;
123out_unmap:
124 vunmap(area->addr);
125 if (array_size > PAGE_SIZE)
126 vfree(pages);
127 else
128 kfree(pages);
129 goto out_free_pages;
130out_free_area:
131 free_vm_area(area);
132out_free_pages:
230 if (page) 133 if (page)
231 __free_pages(page, order); 134 __free_pages(page, order);
232 no_page: 135no_page:
233 return NULL; 136 return NULL;
234} 137}
235EXPORT_SYMBOL(__dma_alloc_coherent); 138EXPORT_SYMBOL(__dma_alloc_coherent);
@@ -239,104 +142,12 @@ EXPORT_SYMBOL(__dma_alloc_coherent);
239 */ 142 */
240void __dma_free_coherent(size_t size, void *vaddr) 143void __dma_free_coherent(size_t size, void *vaddr)
241{ 144{
242 struct ppc_vm_region *c; 145 vfree(vaddr);
243 unsigned long flags, addr;
244 pte_t *ptep;
245
246 size = PAGE_ALIGN(size);
247
248 spin_lock_irqsave(&consistent_lock, flags);
249
250 c = ppc_vm_region_find(&consistent_head, (unsigned long)vaddr);
251 if (!c)
252 goto no_area;
253
254 if ((c->vm_end - c->vm_start) != size) {
255 printk(KERN_ERR "%s: freeing wrong coherent size (%ld != %d)\n",
256 __func__, c->vm_end - c->vm_start, size);
257 dump_stack();
258 size = c->vm_end - c->vm_start;
259 }
260
261 ptep = consistent_pte + CONSISTENT_OFFSET(c->vm_start);
262 addr = c->vm_start;
263 do {
264 pte_t pte = ptep_get_and_clear(&init_mm, addr, ptep);
265 unsigned long pfn;
266
267 ptep++;
268 addr += PAGE_SIZE;
269 146
270 if (!pte_none(pte) && pte_present(pte)) {
271 pfn = pte_pfn(pte);
272
273 if (pfn_valid(pfn)) {
274 struct page *page = pfn_to_page(pfn);
275 ClearPageReserved(page);
276
277 __free_page(page);
278 continue;
279 }
280 }
281
282 printk(KERN_CRIT "%s: bad page in kernel page table\n",
283 __func__);
284 } while (size -= PAGE_SIZE);
285
286 flush_tlb_kernel_range(c->vm_start, c->vm_end);
287
288 list_del(&c->vm_list);
289
290 spin_unlock_irqrestore(&consistent_lock, flags);
291
292 kfree(c);
293 return;
294
295 no_area:
296 spin_unlock_irqrestore(&consistent_lock, flags);
297 printk(KERN_ERR "%s: trying to free invalid coherent area: %p\n",
298 __func__, vaddr);
299 dump_stack();
300} 147}
301EXPORT_SYMBOL(__dma_free_coherent); 148EXPORT_SYMBOL(__dma_free_coherent);
302 149
303/* 150/*
304 * Initialise the consistent memory allocation.
305 */
306static int __init dma_alloc_init(void)
307{
308 pgd_t *pgd;
309 pud_t *pud;
310 pmd_t *pmd;
311 pte_t *pte;
312 int ret = 0;
313
314 do {
315 pgd = pgd_offset(&init_mm, CONSISTENT_BASE);
316 pud = pud_alloc(&init_mm, pgd, CONSISTENT_BASE);
317 pmd = pmd_alloc(&init_mm, pud, CONSISTENT_BASE);
318 if (!pmd) {
319 printk(KERN_ERR "%s: no pmd tables\n", __func__);
320 ret = -ENOMEM;
321 break;
322 }
323
324 pte = pte_alloc_kernel(pmd, CONSISTENT_BASE);
325 if (!pte) {
326 printk(KERN_ERR "%s: no pte tables\n", __func__);
327 ret = -ENOMEM;
328 break;
329 }
330
331 consistent_pte = pte;
332 } while (0);
333
334 return ret;
335}
336
337core_initcall(dma_alloc_init);
338
339/*
340 * make an area consistent. 151 * make an area consistent.
341 */ 152 */
342void __dma_sync(void *vaddr, size_t size, int direction) 153void __dma_sync(void *vaddr, size_t size, int direction)
diff --git a/arch/powerpc/lib/feature-fixups.c b/arch/powerpc/lib/feature-fixups.c
index 8c5a03be31e0..7e8865bcd683 100644
--- a/arch/powerpc/lib/feature-fixups.c
+++ b/arch/powerpc/lib/feature-fixups.c
@@ -85,7 +85,7 @@ static int patch_feature_section(unsigned long value, struct fixup_entry *fcur)
85 } 85 }
86 86
87 for (; dest < end; dest++) 87 for (; dest < end; dest++)
88 patch_instruction(dest, PPC_NOP_INSTR); 88 patch_instruction(dest, PPC_INST_NOP);
89 89
90 return 0; 90 return 0;
91} 91}
@@ -122,7 +122,7 @@ void do_lwsync_fixups(unsigned long value, void *fixup_start, void *fixup_end)
122 122
123 for (; start < end; start++) { 123 for (; start < end; start++) {
124 dest = (void *)start + *start; 124 dest = (void *)start + *start;
125 patch_instruction(dest, PPC_LWSYNC_INSTR); 125 patch_instruction(dest, PPC_INST_LWSYNC);
126 } 126 }
127} 127}
128 128
diff --git a/arch/powerpc/math-emu/Makefile b/arch/powerpc/math-emu/Makefile
index f9e506a735ae..0c16ab947f1f 100644
--- a/arch/powerpc/math-emu/Makefile
+++ b/arch/powerpc/math-emu/Makefile
@@ -1,6 +1,4 @@
1 1
2obj-y := math.o fmr.o lfd.o stfd.o
3
4obj-$(CONFIG_MATH_EMULATION) += fabs.o fadd.o fadds.o fcmpo.o fcmpu.o \ 2obj-$(CONFIG_MATH_EMULATION) += fabs.o fadd.o fadds.o fcmpo.o fcmpu.o \
5 fctiw.o fctiwz.o fdiv.o fdivs.o \ 3 fctiw.o fctiwz.o fdiv.o fdivs.o \
6 fmadd.o fmadds.o fmsub.o fmsubs.o \ 4 fmadd.o fmadds.o fmsub.o fmsubs.o \
@@ -9,7 +7,8 @@ obj-$(CONFIG_MATH_EMULATION) += fabs.o fadd.o fadds.o fcmpo.o fcmpu.o \
9 fres.o frsp.o frsqrte.o fsel.o lfs.o \ 7 fres.o frsp.o frsqrte.o fsel.o lfs.o \
10 fsqrt.o fsqrts.o fsub.o fsubs.o \ 8 fsqrt.o fsqrts.o fsub.o fsubs.o \
11 mcrfs.o mffs.o mtfsb0.o mtfsb1.o \ 9 mcrfs.o mffs.o mtfsb0.o mtfsb1.o \
12 mtfsf.o mtfsfi.o stfiwx.o stfs.o 10 mtfsf.o mtfsfi.o stfiwx.o stfs.o \
11 math.o fmr.o lfd.o stfd.o
13 12
14obj-$(CONFIG_SPE) += math_efp.o 13obj-$(CONFIG_SPE) += math_efp.o
15 14
diff --git a/arch/powerpc/mm/Makefile b/arch/powerpc/mm/Makefile
index 953cc4a1cde5..17290bcedc5e 100644
--- a/arch/powerpc/mm/Makefile
+++ b/arch/powerpc/mm/Makefile
@@ -6,7 +6,7 @@ ifeq ($(CONFIG_PPC64),y)
6EXTRA_CFLAGS += -mno-minimal-toc 6EXTRA_CFLAGS += -mno-minimal-toc
7endif 7endif
8 8
9obj-y := fault.o mem.o pgtable.o \ 9obj-y := fault.o mem.o pgtable.o gup.o \
10 init_$(CONFIG_WORD_SIZE).o \ 10 init_$(CONFIG_WORD_SIZE).o \
11 pgtable_$(CONFIG_WORD_SIZE).o 11 pgtable_$(CONFIG_WORD_SIZE).o
12obj-$(CONFIG_PPC_MMU_NOHASH) += mmu_context_nohash.o tlb_nohash.o \ 12obj-$(CONFIG_PPC_MMU_NOHASH) += mmu_context_nohash.o tlb_nohash.o \
@@ -14,7 +14,7 @@ obj-$(CONFIG_PPC_MMU_NOHASH) += mmu_context_nohash.o tlb_nohash.o \
14hash-$(CONFIG_PPC_NATIVE) := hash_native_64.o 14hash-$(CONFIG_PPC_NATIVE) := hash_native_64.o
15obj-$(CONFIG_PPC64) += hash_utils_64.o \ 15obj-$(CONFIG_PPC64) += hash_utils_64.o \
16 slb_low.o slb.o stab.o \ 16 slb_low.o slb.o stab.o \
17 gup.o mmap.o $(hash-y) 17 mmap_64.o $(hash-y)
18obj-$(CONFIG_PPC_STD_MMU_32) += ppc_mmu_32.o 18obj-$(CONFIG_PPC_STD_MMU_32) += ppc_mmu_32.o
19obj-$(CONFIG_PPC_STD_MMU) += hash_low_$(CONFIG_WORD_SIZE).o \ 19obj-$(CONFIG_PPC_STD_MMU) += hash_low_$(CONFIG_WORD_SIZE).o \
20 tlb_hash$(CONFIG_WORD_SIZE).o \ 20 tlb_hash$(CONFIG_WORD_SIZE).o \
diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c
index 91c7b8636b8a..76993941cac9 100644
--- a/arch/powerpc/mm/fault.c
+++ b/arch/powerpc/mm/fault.c
@@ -253,45 +253,33 @@ good_area:
253#endif /* CONFIG_8xx */ 253#endif /* CONFIG_8xx */
254 254
255 if (is_exec) { 255 if (is_exec) {
256#if !(defined(CONFIG_4xx) || defined(CONFIG_BOOKE)) 256#ifdef CONFIG_PPC_STD_MMU
257 /* protection fault */ 257 /* Protection fault on exec go straight to failure on
258 * Hash based MMUs as they either don't support per-page
259 * execute permission, or if they do, it's handled already
260 * at the hash level. This test would probably have to
261 * be removed if we change the way this works to make hash
262 * processors use the same I/D cache coherency mechanism
263 * as embedded.
264 */
258 if (error_code & DSISR_PROTFAULT) 265 if (error_code & DSISR_PROTFAULT)
259 goto bad_area; 266 goto bad_area;
267#endif /* CONFIG_PPC_STD_MMU */
268
260 /* 269 /*
261 * Allow execution from readable areas if the MMU does not 270 * Allow execution from readable areas if the MMU does not
262 * provide separate controls over reading and executing. 271 * provide separate controls over reading and executing.
272 *
273 * Note: That code used to not be enabled for 4xx/BookE.
274 * It is now as I/D cache coherency for these is done at
275 * set_pte_at() time and I see no reason why the test
276 * below wouldn't be valid on those processors. This -may-
277 * break programs compiled with a really old ABI though.
263 */ 278 */
264 if (!(vma->vm_flags & VM_EXEC) && 279 if (!(vma->vm_flags & VM_EXEC) &&
265 (cpu_has_feature(CPU_FTR_NOEXECUTE) || 280 (cpu_has_feature(CPU_FTR_NOEXECUTE) ||
266 !(vma->vm_flags & (VM_READ | VM_WRITE)))) 281 !(vma->vm_flags & (VM_READ | VM_WRITE))))
267 goto bad_area; 282 goto bad_area;
268#else
269 pte_t *ptep;
270 pmd_t *pmdp;
271
272 /* Since 4xx/Book-E supports per-page execute permission,
273 * we lazily flush dcache to icache. */
274 ptep = NULL;
275 if (get_pteptr(mm, address, &ptep, &pmdp)) {
276 spinlock_t *ptl = pte_lockptr(mm, pmdp);
277 spin_lock(ptl);
278 if (pte_present(*ptep)) {
279 struct page *page = pte_page(*ptep);
280
281 if (!test_bit(PG_arch_1, &page->flags)) {
282 flush_dcache_icache_page(page);
283 set_bit(PG_arch_1, &page->flags);
284 }
285 pte_update(ptep, 0, _PAGE_HWEXEC |
286 _PAGE_ACCESSED);
287 local_flush_tlb_page(vma, address);
288 pte_unmap_unlock(ptep, ptl);
289 up_read(&mm->mmap_sem);
290 return 0;
291 }
292 pte_unmap_unlock(ptep, ptl);
293 }
294#endif
295 /* a write */ 283 /* a write */
296 } else if (is_write) { 284 } else if (is_write) {
297 if (!(vma->vm_flags & VM_WRITE)) 285 if (!(vma->vm_flags & VM_WRITE))
diff --git a/arch/powerpc/mm/fsl_booke_mmu.c b/arch/powerpc/mm/fsl_booke_mmu.c
index ea6e41e39d9f..bb3d65998e6b 100644
--- a/arch/powerpc/mm/fsl_booke_mmu.c
+++ b/arch/powerpc/mm/fsl_booke_mmu.c
@@ -56,10 +56,14 @@
56 56
57extern void loadcam_entry(unsigned int index); 57extern void loadcam_entry(unsigned int index);
58unsigned int tlbcam_index; 58unsigned int tlbcam_index;
59static unsigned long __cam0, __cam1, __cam2; 59static unsigned long cam[CONFIG_LOWMEM_CAM_NUM];
60 60
61#define NUM_TLBCAMS (16) 61#define NUM_TLBCAMS (16)
62 62
63#if defined(CONFIG_LOWMEM_CAM_NUM_BOOL) && (CONFIG_LOWMEM_CAM_NUM >= NUM_TLBCAMS)
64#error "LOWMEM_CAM_NUM must be less than NUM_TLBCAMS"
65#endif
66
63struct tlbcam TLBCAM[NUM_TLBCAMS]; 67struct tlbcam TLBCAM[NUM_TLBCAMS];
64 68
65struct tlbcamrange { 69struct tlbcamrange {
@@ -107,7 +111,7 @@ void settlbcam(int index, unsigned long virt, phys_addr_t phys,
107 unsigned int tsize, lz; 111 unsigned int tsize, lz;
108 112
109 asm ("cntlzw %0,%1" : "=r" (lz) : "r" (size)); 113 asm ("cntlzw %0,%1" : "=r" (lz) : "r" (size));
110 tsize = (21 - lz) / 2; 114 tsize = 21 - lz;
111 115
112#ifdef CONFIG_SMP 116#ifdef CONFIG_SMP
113 if ((flags & _PAGE_NO_CACHE) == 0) 117 if ((flags & _PAGE_NO_CACHE) == 0)
@@ -152,19 +156,19 @@ void invalidate_tlbcam_entry(int index)
152 loadcam_entry(index); 156 loadcam_entry(index);
153} 157}
154 158
155void __init cam_mapin_ram(unsigned long cam0, unsigned long cam1, 159unsigned long __init mmu_mapin_ram(void)
156 unsigned long cam2)
157{ 160{
158 settlbcam(0, PAGE_OFFSET, memstart_addr, cam0, _PAGE_KERNEL, 0); 161 unsigned long virt = PAGE_OFFSET;
159 tlbcam_index++; 162 phys_addr_t phys = memstart_addr;
160 if (cam1) { 163
161 tlbcam_index++; 164 while (cam[tlbcam_index] && tlbcam_index < ARRAY_SIZE(cam)) {
162 settlbcam(1, PAGE_OFFSET+cam0, memstart_addr+cam0, cam1, _PAGE_KERNEL, 0); 165 settlbcam(tlbcam_index, virt, phys, cam[tlbcam_index], PAGE_KERNEL_X, 0);
163 } 166 virt += cam[tlbcam_index];
164 if (cam2) { 167 phys += cam[tlbcam_index];
165 tlbcam_index++; 168 tlbcam_index++;
166 settlbcam(2, PAGE_OFFSET+cam0+cam1, memstart_addr+cam0+cam1, cam2, _PAGE_KERNEL, 0);
167 } 169 }
170
171 return virt - PAGE_OFFSET;
168} 172}
169 173
170/* 174/*
@@ -175,51 +179,46 @@ void __init MMU_init_hw(void)
175 flush_instruction_cache(); 179 flush_instruction_cache();
176} 180}
177 181
178unsigned long __init mmu_mapin_ram(void)
179{
180 cam_mapin_ram(__cam0, __cam1, __cam2);
181
182 return __cam0 + __cam1 + __cam2;
183}
184
185
186void __init 182void __init
187adjust_total_lowmem(void) 183adjust_total_lowmem(void)
188{ 184{
189 phys_addr_t max_lowmem_size = __max_low_memory;
190 phys_addr_t cam_max_size = 0x10000000;
191 phys_addr_t ram; 185 phys_addr_t ram;
186 unsigned int max_cam = (mfspr(SPRN_TLB1CFG) >> 16) & 0xff;
187 char buf[ARRAY_SIZE(cam) * 5 + 1], *p = buf;
188 int i;
189 unsigned long virt = PAGE_OFFSET & 0xffffffffUL;
190 unsigned long phys = memstart_addr & 0xffffffffUL;
192 191
193 /* adjust CAM size to max_lowmem_size */ 192 /* Convert (4^max) kB to (2^max) bytes */
194 if (max_lowmem_size < cam_max_size) 193 max_cam = max_cam * 2 + 10;
195 cam_max_size = max_lowmem_size;
196 194
197 /* adjust lowmem size to max_lowmem_size */ 195 /* adjust lowmem size to __max_low_memory */
198 ram = min(max_lowmem_size, total_lowmem); 196 ram = min((phys_addr_t)__max_low_memory, (phys_addr_t)total_lowmem);
199 197
200 /* Calculate CAM values */ 198 /* Calculate CAM values */
201 __cam0 = 1UL << 2 * (__ilog2(ram) / 2); 199 __max_low_memory = 0;
202 if (__cam0 > cam_max_size) 200 for (i = 0; ram && i < ARRAY_SIZE(cam); i++) {
203 __cam0 = cam_max_size; 201 unsigned int camsize = __ilog2(ram) & ~1U;
204 ram -= __cam0; 202 unsigned int align = __ffs(virt | phys) & ~1U;
205 if (ram) { 203
206 __cam1 = 1UL << 2 * (__ilog2(ram) / 2); 204 if (camsize > align)
207 if (__cam1 > cam_max_size) 205 camsize = align;
208 __cam1 = cam_max_size; 206 if (camsize > max_cam)
209 ram -= __cam1; 207 camsize = max_cam;
210 } 208
211 if (ram) { 209 cam[i] = 1UL << camsize;
212 __cam2 = 1UL << 2 * (__ilog2(ram) / 2); 210 ram -= cam[i];
213 if (__cam2 > cam_max_size) 211 __max_low_memory += cam[i];
214 __cam2 = cam_max_size; 212 virt += cam[i];
215 ram -= __cam2; 213 phys += cam[i];
214
215 p += sprintf(p, "%lu/", cam[i] >> 20);
216 } 216 }
217 for (; i < ARRAY_SIZE(cam); i++)
218 p += sprintf(p, "0/");
219 p[-1] = '\0';
217 220
218 printk(KERN_INFO "Memory CAM mapping: CAM0=%ldMb, CAM1=%ldMb," 221 pr_info("Memory CAM mapping: %s Mb, residual: %dMb\n", buf,
219 " CAM2=%ldMb residual: %ldMb\n", 222 (unsigned int)((total_lowmem - __max_low_memory) >> 20));
220 __cam0 >> 20, __cam1 >> 20, __cam2 >> 20,
221 (long int)((total_lowmem - __cam0 - __cam1 - __cam2)
222 >> 20));
223 __max_low_memory = __cam0 + __cam1 + __cam2;
224 __initial_memory_limit_addr = memstart_addr + __max_low_memory; 223 __initial_memory_limit_addr = memstart_addr + __max_low_memory;
225} 224}
diff --git a/arch/powerpc/mm/gup.c b/arch/powerpc/mm/gup.c
index 28a114db3ba0..bc400c78c97f 100644
--- a/arch/powerpc/mm/gup.c
+++ b/arch/powerpc/mm/gup.c
@@ -14,6 +14,8 @@
14#include <linux/rwsem.h> 14#include <linux/rwsem.h>
15#include <asm/pgtable.h> 15#include <asm/pgtable.h>
16 16
17#ifdef __HAVE_ARCH_PTE_SPECIAL
18
17/* 19/*
18 * The performance critical leaf functions are made noinline otherwise gcc 20 * The performance critical leaf functions are made noinline otherwise gcc
19 * inlines everything into a single function which results in too much 21 * inlines everything into a single function which results in too much
@@ -151,8 +153,11 @@ int get_user_pages_fast(unsigned long start, int nr_pages, int write,
151 unsigned long addr, len, end; 153 unsigned long addr, len, end;
152 unsigned long next; 154 unsigned long next;
153 pgd_t *pgdp; 155 pgd_t *pgdp;
154 int psize, nr = 0; 156 int nr = 0;
157#ifdef CONFIG_PPC64
155 unsigned int shift; 158 unsigned int shift;
159 int psize;
160#endif
156 161
157 pr_debug("%s(%lx,%x,%s)\n", __func__, start, nr_pages, write ? "write" : "read"); 162 pr_debug("%s(%lx,%x,%s)\n", __func__, start, nr_pages, write ? "write" : "read");
158 163
@@ -205,8 +210,13 @@ int get_user_pages_fast(unsigned long start, int nr_pages, int write,
205 */ 210 */
206 local_irq_disable(); 211 local_irq_disable();
207 212
213#ifdef CONFIG_PPC64
214 /* Those bits are related to hugetlbfs implementation and only exist
215 * on 64-bit for now
216 */
208 psize = get_slice_psize(mm, addr); 217 psize = get_slice_psize(mm, addr);
209 shift = mmu_psize_defs[psize].shift; 218 shift = mmu_psize_defs[psize].shift;
219#endif /* CONFIG_PPC64 */
210 220
211#ifdef CONFIG_HUGETLB_PAGE 221#ifdef CONFIG_HUGETLB_PAGE
212 if (unlikely(mmu_huge_psizes[psize])) { 222 if (unlikely(mmu_huge_psizes[psize])) {
@@ -236,7 +246,9 @@ int get_user_pages_fast(unsigned long start, int nr_pages, int write,
236 do { 246 do {
237 pgd_t pgd = *pgdp; 247 pgd_t pgd = *pgdp;
238 248
249#ifdef CONFIG_PPC64
239 VM_BUG_ON(shift != mmu_psize_defs[get_slice_psize(mm, addr)].shift); 250 VM_BUG_ON(shift != mmu_psize_defs[get_slice_psize(mm, addr)].shift);
251#endif
240 pr_debug(" %016lx: normal pgd %p\n", addr, 252 pr_debug(" %016lx: normal pgd %p\n", addr,
241 (void *)pgd_val(pgd)); 253 (void *)pgd_val(pgd));
242 next = pgd_addr_end(addr, end); 254 next = pgd_addr_end(addr, end);
@@ -279,3 +291,5 @@ slow_irqon:
279 return ret; 291 return ret;
280 } 292 }
281} 293}
294
295#endif /* __HAVE_ARCH_PTE_SPECIAL */
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c
index 8d5b4758c13a..db556d25c3a7 100644
--- a/arch/powerpc/mm/hash_utils_64.c
+++ b/arch/powerpc/mm/hash_utils_64.c
@@ -516,7 +516,7 @@ static int __init htab_dt_scan_pftsize(unsigned long node,
516 516
517static unsigned long __init htab_get_table_size(void) 517static unsigned long __init htab_get_table_size(void)
518{ 518{
519 unsigned long mem_size, rnd_mem_size, pteg_count; 519 unsigned long mem_size, rnd_mem_size, pteg_count, psize;
520 520
521 /* If hash size isn't already provided by the platform, we try to 521 /* If hash size isn't already provided by the platform, we try to
522 * retrieve it from the device-tree. If it's not there neither, we 522 * retrieve it from the device-tree. If it's not there neither, we
@@ -534,7 +534,8 @@ static unsigned long __init htab_get_table_size(void)
534 rnd_mem_size <<= 1; 534 rnd_mem_size <<= 1;
535 535
536 /* # pages / 2 */ 536 /* # pages / 2 */
537 pteg_count = max(rnd_mem_size >> (12 + 1), 1UL << 11); 537 psize = mmu_psize_defs[mmu_virtual_psize].shift;
538 pteg_count = max(rnd_mem_size >> (psize + 1), 1UL << 11);
538 539
539 return pteg_count << 7; 540 return pteg_count << 7;
540} 541}
@@ -589,7 +590,7 @@ static void __init htab_finish_init(void)
589 make_bl(htab_call_hpte_updatepp, ppc_md.hpte_updatepp); 590 make_bl(htab_call_hpte_updatepp, ppc_md.hpte_updatepp);
590} 591}
591 592
592void __init htab_initialize(void) 593static void __init htab_initialize(void)
593{ 594{
594 unsigned long table; 595 unsigned long table;
595 unsigned long pteg_count; 596 unsigned long pteg_count;
@@ -731,11 +732,43 @@ void __init htab_initialize(void)
731#undef KB 732#undef KB
732#undef MB 733#undef MB
733 734
734void htab_initialize_secondary(void) 735void __init early_init_mmu(void)
735{ 736{
737 /* Setup initial STAB address in the PACA */
738 get_paca()->stab_real = __pa((u64)&initial_stab);
739 get_paca()->stab_addr = (u64)&initial_stab;
740
741 /* Initialize the MMU Hash table and create the linear mapping
742 * of memory. Has to be done before stab/slb initialization as
743 * this is currently where the page size encoding is obtained
744 */
745 htab_initialize();
746
747 /* Initialize stab / SLB management except on iSeries
748 */
749 if (cpu_has_feature(CPU_FTR_SLB))
750 slb_initialize();
751 else if (!firmware_has_feature(FW_FEATURE_ISERIES))
752 stab_initialize(get_paca()->stab_real);
753}
754
755#ifdef CONFIG_SMP
756void __init early_init_mmu_secondary(void)
757{
758 /* Initialize hash table for that CPU */
736 if (!firmware_has_feature(FW_FEATURE_LPAR)) 759 if (!firmware_has_feature(FW_FEATURE_LPAR))
737 mtspr(SPRN_SDR1, _SDR1); 760 mtspr(SPRN_SDR1, _SDR1);
761
762 /* Initialize STAB/SLB. We use a virtual address as it works
763 * in real mode on pSeries and we want a virutal address on
764 * iSeries anyway
765 */
766 if (cpu_has_feature(CPU_FTR_SLB))
767 slb_initialize();
768 else
769 stab_initialize(get_paca()->stab_addr);
738} 770}
771#endif /* CONFIG_SMP */
739 772
740/* 773/*
741 * Called by asm hashtable.S for doing lazy icache flush 774 * Called by asm hashtable.S for doing lazy icache flush
@@ -858,7 +891,7 @@ int hash_page(unsigned long ea, unsigned long access, unsigned long trap)
858 unsigned long vsid; 891 unsigned long vsid;
859 struct mm_struct *mm; 892 struct mm_struct *mm;
860 pte_t *ptep; 893 pte_t *ptep;
861 cpumask_t tmp; 894 const struct cpumask *tmp;
862 int rc, user_region = 0, local = 0; 895 int rc, user_region = 0, local = 0;
863 int psize, ssize; 896 int psize, ssize;
864 897
@@ -906,8 +939,8 @@ int hash_page(unsigned long ea, unsigned long access, unsigned long trap)
906 return 1; 939 return 1;
907 940
908 /* Check CPU locality */ 941 /* Check CPU locality */
909 tmp = cpumask_of_cpu(smp_processor_id()); 942 tmp = cpumask_of(smp_processor_id());
910 if (user_region && cpus_equal(mm->cpu_vm_mask, tmp)) 943 if (user_region && cpumask_equal(mm_cpumask(mm), tmp))
911 local = 1; 944 local = 1;
912 945
913#ifdef CONFIG_HUGETLB_PAGE 946#ifdef CONFIG_HUGETLB_PAGE
@@ -1023,7 +1056,6 @@ void hash_preload(struct mm_struct *mm, unsigned long ea,
1023 unsigned long vsid; 1056 unsigned long vsid;
1024 void *pgdir; 1057 void *pgdir;
1025 pte_t *ptep; 1058 pte_t *ptep;
1026 cpumask_t mask;
1027 unsigned long flags; 1059 unsigned long flags;
1028 int local = 0; 1060 int local = 0;
1029 int ssize; 1061 int ssize;
@@ -1066,8 +1098,7 @@ void hash_preload(struct mm_struct *mm, unsigned long ea,
1066 local_irq_save(flags); 1098 local_irq_save(flags);
1067 1099
1068 /* Is that local to this CPU ? */ 1100 /* Is that local to this CPU ? */
1069 mask = cpumask_of_cpu(smp_processor_id()); 1101 if (cpumask_equal(mm_cpumask(mm), cpumask_of(smp_processor_id())))
1070 if (cpus_equal(mm->cpu_vm_mask, mask))
1071 local = 1; 1102 local = 1;
1072 1103
1073 /* Hash it in */ 1104 /* Hash it in */
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
index f00f09a77f12..f668fa9ba804 100644
--- a/arch/powerpc/mm/mem.c
+++ b/arch/powerpc/mm/mem.c
@@ -472,40 +472,7 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long address,
472{ 472{
473#ifdef CONFIG_PPC_STD_MMU 473#ifdef CONFIG_PPC_STD_MMU
474 unsigned long access = 0, trap; 474 unsigned long access = 0, trap;
475#endif
476 unsigned long pfn = pte_pfn(pte);
477
478 /* handle i-cache coherency */
479 if (!cpu_has_feature(CPU_FTR_COHERENT_ICACHE) &&
480 !cpu_has_feature(CPU_FTR_NOEXECUTE) &&
481 pfn_valid(pfn)) {
482 struct page *page = pfn_to_page(pfn);
483#ifdef CONFIG_8xx
484 /* On 8xx, cache control instructions (particularly
485 * "dcbst" from flush_dcache_icache) fault as write
486 * operation if there is an unpopulated TLB entry
487 * for the address in question. To workaround that,
488 * we invalidate the TLB here, thus avoiding dcbst
489 * misbehaviour.
490 */
491 _tlbil_va(address, 0 /* 8xx doesn't care about PID */);
492#endif
493 /* The _PAGE_USER test should really be _PAGE_EXEC, but
494 * older glibc versions execute some code from no-exec
495 * pages, which for now we are supporting. If exec-only
496 * pages are ever implemented, this will have to change.
497 */
498 if (!PageReserved(page) && (pte_val(pte) & _PAGE_USER)
499 && !test_bit(PG_arch_1, &page->flags)) {
500 if (vma->vm_mm == current->active_mm) {
501 __flush_dcache_icache((void *) address);
502 } else
503 flush_dcache_icache_page(page);
504 set_bit(PG_arch_1, &page->flags);
505 }
506 }
507 475
508#ifdef CONFIG_PPC_STD_MMU
509 /* We only want HPTEs for linux PTEs that have _PAGE_ACCESSED set */ 476 /* We only want HPTEs for linux PTEs that have _PAGE_ACCESSED set */
510 if (!pte_young(pte) || address >= TASK_SIZE) 477 if (!pte_young(pte) || address >= TASK_SIZE)
511 return; 478 return;
diff --git a/arch/powerpc/mm/mmap.c b/arch/powerpc/mm/mmap_64.c
index 86010fc7d3b1..0d957a4c70fe 100644
--- a/arch/powerpc/mm/mmap.c
+++ b/arch/powerpc/mm/mmap_64.c
@@ -24,36 +24,26 @@
24 24
25#include <linux/personality.h> 25#include <linux/personality.h>
26#include <linux/mm.h> 26#include <linux/mm.h>
27#include <linux/random.h>
27#include <linux/sched.h> 28#include <linux/sched.h>
28 29
29/* 30/*
30 * Top of mmap area (just below the process stack). 31 * Top of mmap area (just below the process stack).
31 * 32 *
32 * Leave an at least ~128 MB hole. 33 * Leave at least a ~128 MB hole on 32bit applications.
34 *
35 * On 64bit applications we randomise the stack by 1GB so we need to
36 * space our mmap start address by a further 1GB, otherwise there is a
37 * chance the mmap area will end up closer to the stack than our ulimit
38 * requires.
33 */ 39 */
34#define MIN_GAP (128*1024*1024) 40#define MIN_GAP32 (128*1024*1024)
41#define MIN_GAP64 ((128 + 1024)*1024*1024UL)
42#define MIN_GAP ((is_32bit_task()) ? MIN_GAP32 : MIN_GAP64)
35#define MAX_GAP (TASK_SIZE/6*5) 43#define MAX_GAP (TASK_SIZE/6*5)
36 44
37static inline unsigned long mmap_base(void)
38{
39 unsigned long gap = current->signal->rlim[RLIMIT_STACK].rlim_cur;
40
41 if (gap < MIN_GAP)
42 gap = MIN_GAP;
43 else if (gap > MAX_GAP)
44 gap = MAX_GAP;
45
46 return TASK_SIZE - (gap & PAGE_MASK);
47}
48
49static inline int mmap_is_legacy(void) 45static inline int mmap_is_legacy(void)
50{ 46{
51 /*
52 * Force standard allocation for 64 bit programs.
53 */
54 if (!test_thread_flag(TIF_32BIT))
55 return 1;
56
57 if (current->personality & ADDR_COMPAT_LAYOUT) 47 if (current->personality & ADDR_COMPAT_LAYOUT)
58 return 1; 48 return 1;
59 49
@@ -64,6 +54,40 @@ static inline int mmap_is_legacy(void)
64} 54}
65 55
66/* 56/*
57 * Since get_random_int() returns the same value within a 1 jiffy window,
58 * we will almost always get the same randomisation for the stack and mmap
59 * region. This will mean the relative distance between stack and mmap will
60 * be the same.
61 *
62 * To avoid this we can shift the randomness by 1 bit.
63 */
64static unsigned long mmap_rnd(void)
65{
66 unsigned long rnd = 0;
67
68 if (current->flags & PF_RANDOMIZE) {
69 /* 8MB for 32bit, 1GB for 64bit */
70 if (is_32bit_task())
71 rnd = (long)(get_random_int() % (1<<(22-PAGE_SHIFT)));
72 else
73 rnd = (long)(get_random_int() % (1<<(29-PAGE_SHIFT)));
74 }
75 return (rnd << PAGE_SHIFT) * 2;
76}
77
78static inline unsigned long mmap_base(void)
79{
80 unsigned long gap = current->signal->rlim[RLIMIT_STACK].rlim_cur;
81
82 if (gap < MIN_GAP)
83 gap = MIN_GAP;
84 else if (gap > MAX_GAP)
85 gap = MAX_GAP;
86
87 return PAGE_ALIGN(TASK_SIZE - gap - mmap_rnd());
88}
89
90/*
67 * This function, called very early during the creation of a new 91 * This function, called very early during the creation of a new
68 * process VM image, sets up which VM layout function to use: 92 * process VM image, sets up which VM layout function to use:
69 */ 93 */
diff --git a/arch/powerpc/mm/mmu_context_nohash.c b/arch/powerpc/mm/mmu_context_nohash.c
index 52a0cfc38b64..a70e311bd457 100644
--- a/arch/powerpc/mm/mmu_context_nohash.c
+++ b/arch/powerpc/mm/mmu_context_nohash.c
@@ -97,7 +97,7 @@ static unsigned int steal_context_smp(unsigned int id)
97 mm->context.id = MMU_NO_CONTEXT; 97 mm->context.id = MMU_NO_CONTEXT;
98 98
99 /* Mark it stale on all CPUs that used this mm */ 99 /* Mark it stale on all CPUs that used this mm */
100 for_each_cpu_mask_nr(cpu, mm->cpu_vm_mask) 100 for_each_cpu(cpu, mm_cpumask(mm))
101 __set_bit(id, stale_map[cpu]); 101 __set_bit(id, stale_map[cpu]);
102 return id; 102 return id;
103 } 103 }
@@ -380,7 +380,7 @@ void __init mmu_context_init(void)
380#endif 380#endif
381 381
382 printk(KERN_INFO 382 printk(KERN_INFO
383 "MMU: Allocated %d bytes of context maps for %d contexts\n", 383 "MMU: Allocated %zu bytes of context maps for %d contexts\n",
384 2 * CTX_MAP_SIZE + (sizeof(void *) * (last_context + 1)), 384 2 * CTX_MAP_SIZE + (sizeof(void *) * (last_context + 1)),
385 last_context - first_context + 1); 385 last_context - first_context + 1);
386 386
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index 5ac08b8ab654..9047145095aa 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -158,35 +158,6 @@ static void unmap_cpu_from_node(unsigned long cpu)
158} 158}
159#endif /* CONFIG_HOTPLUG_CPU */ 159#endif /* CONFIG_HOTPLUG_CPU */
160 160
161static struct device_node * __cpuinit find_cpu_node(unsigned int cpu)
162{
163 unsigned int hw_cpuid = get_hard_smp_processor_id(cpu);
164 struct device_node *cpu_node = NULL;
165 const unsigned int *interrupt_server, *reg;
166 int len;
167
168 while ((cpu_node = of_find_node_by_type(cpu_node, "cpu")) != NULL) {
169 /* Try interrupt server first */
170 interrupt_server = of_get_property(cpu_node,
171 "ibm,ppc-interrupt-server#s", &len);
172
173 len = len / sizeof(u32);
174
175 if (interrupt_server && (len > 0)) {
176 while (len--) {
177 if (interrupt_server[len] == hw_cpuid)
178 return cpu_node;
179 }
180 } else {
181 reg = of_get_property(cpu_node, "reg", &len);
182 if (reg && (len > 0) && (reg[0] == hw_cpuid))
183 return cpu_node;
184 }
185 }
186
187 return NULL;
188}
189
190/* must hold reference to node during call */ 161/* must hold reference to node during call */
191static const int *of_get_associativity(struct device_node *dev) 162static const int *of_get_associativity(struct device_node *dev)
192{ 163{
@@ -290,7 +261,7 @@ static int __init find_min_common_depth(void)
290 ref_points = of_get_property(rtas_root, 261 ref_points = of_get_property(rtas_root,
291 "ibm,associativity-reference-points", &len); 262 "ibm,associativity-reference-points", &len);
292 263
293 if ((len >= 1) && ref_points) { 264 if ((len >= 2 * sizeof(unsigned int)) && ref_points) {
294 depth = ref_points[1]; 265 depth = ref_points[1];
295 } else { 266 } else {
296 dbg("NUMA: ibm,associativity-reference-points not found.\n"); 267 dbg("NUMA: ibm,associativity-reference-points not found.\n");
@@ -470,7 +441,7 @@ static int of_drconf_to_nid_single(struct of_drconf_cell *drmem,
470static int __cpuinit numa_setup_cpu(unsigned long lcpu) 441static int __cpuinit numa_setup_cpu(unsigned long lcpu)
471{ 442{
472 int nid = 0; 443 int nid = 0;
473 struct device_node *cpu = find_cpu_node(lcpu); 444 struct device_node *cpu = of_get_cpu_node(lcpu, NULL);
474 445
475 if (!cpu) { 446 if (!cpu) {
476 WARN_ON(1); 447 WARN_ON(1);
@@ -652,7 +623,7 @@ static int __init parse_numa_properties(void)
652 for_each_present_cpu(i) { 623 for_each_present_cpu(i) {
653 int nid; 624 int nid;
654 625
655 cpu = find_cpu_node(i); 626 cpu = of_get_cpu_node(i, NULL);
656 BUG_ON(!cpu); 627 BUG_ON(!cpu);
657 nid = of_node_to_nid_single(cpu); 628 nid = of_node_to_nid_single(cpu);
658 of_node_put(cpu); 629 of_node_put(cpu);
@@ -1041,57 +1012,32 @@ early_param("numa", early_numa);
1041 1012
1042#ifdef CONFIG_MEMORY_HOTPLUG 1013#ifdef CONFIG_MEMORY_HOTPLUG
1043/* 1014/*
1044 * Validate the node associated with the memory section we are 1015 * Find the node associated with a hot added memory section for
1045 * trying to add. 1016 * memory represented in the device tree by the property
1046 */ 1017 * ibm,dynamic-reconfiguration-memory/ibm,dynamic-memory.
1047int valid_hot_add_scn(int *nid, unsigned long start, u32 lmb_size,
1048 unsigned long scn_addr)
1049{
1050 nodemask_t nodes;
1051
1052 if (*nid < 0 || !node_online(*nid))
1053 *nid = any_online_node(NODE_MASK_ALL);
1054
1055 if ((scn_addr >= start) && (scn_addr < (start + lmb_size))) {
1056 nodes_setall(nodes);
1057 while (NODE_DATA(*nid)->node_spanned_pages == 0) {
1058 node_clear(*nid, nodes);
1059 *nid = any_online_node(nodes);
1060 }
1061
1062 return 1;
1063 }
1064
1065 return 0;
1066}
1067
1068/*
1069 * Find the node associated with a hot added memory section represented
1070 * by the ibm,dynamic-reconfiguration-memory node.
1071 */ 1018 */
1072static int hot_add_drconf_scn_to_nid(struct device_node *memory, 1019static int hot_add_drconf_scn_to_nid(struct device_node *memory,
1073 unsigned long scn_addr) 1020 unsigned long scn_addr)
1074{ 1021{
1075 const u32 *dm; 1022 const u32 *dm;
1076 unsigned int n, rc; 1023 unsigned int drconf_cell_cnt, rc;
1077 unsigned long lmb_size; 1024 unsigned long lmb_size;
1078 int default_nid = any_online_node(NODE_MASK_ALL);
1079 int nid;
1080 struct assoc_arrays aa; 1025 struct assoc_arrays aa;
1026 int nid = -1;
1081 1027
1082 n = of_get_drconf_memory(memory, &dm); 1028 drconf_cell_cnt = of_get_drconf_memory(memory, &dm);
1083 if (!n) 1029 if (!drconf_cell_cnt)
1084 return default_nid;; 1030 return -1;
1085 1031
1086 lmb_size = of_get_lmb_size(memory); 1032 lmb_size = of_get_lmb_size(memory);
1087 if (!lmb_size) 1033 if (!lmb_size)
1088 return default_nid; 1034 return -1;
1089 1035
1090 rc = of_get_assoc_arrays(memory, &aa); 1036 rc = of_get_assoc_arrays(memory, &aa);
1091 if (rc) 1037 if (rc)
1092 return default_nid; 1038 return -1;
1093 1039
1094 for (; n != 0; --n) { 1040 for (; drconf_cell_cnt != 0; --drconf_cell_cnt) {
1095 struct of_drconf_cell drmem; 1041 struct of_drconf_cell drmem;
1096 1042
1097 read_drconf_cell(&drmem, &dm); 1043 read_drconf_cell(&drmem, &dm);
@@ -1102,15 +1048,57 @@ static int hot_add_drconf_scn_to_nid(struct device_node *memory,
1102 || !(drmem.flags & DRCONF_MEM_ASSIGNED)) 1048 || !(drmem.flags & DRCONF_MEM_ASSIGNED))
1103 continue; 1049 continue;
1104 1050
1051 if ((scn_addr < drmem.base_addr)
1052 || (scn_addr >= (drmem.base_addr + lmb_size)))
1053 continue;
1054
1105 nid = of_drconf_to_nid_single(&drmem, &aa); 1055 nid = of_drconf_to_nid_single(&drmem, &aa);
1056 break;
1057 }
1058
1059 return nid;
1060}
1106 1061
1107 if (valid_hot_add_scn(&nid, drmem.base_addr, lmb_size, 1062/*
1108 scn_addr)) 1063 * Find the node associated with a hot added memory section for memory
1109 return nid; 1064 * represented in the device tree as a node (i.e. memory@XXXX) for
1065 * each lmb.
1066 */
1067int hot_add_node_scn_to_nid(unsigned long scn_addr)
1068{
1069 struct device_node *memory = NULL;
1070 int nid = -1;
1071
1072 while ((memory = of_find_node_by_type(memory, "memory")) != NULL) {
1073 unsigned long start, size;
1074 int ranges;
1075 const unsigned int *memcell_buf;
1076 unsigned int len;
1077
1078 memcell_buf = of_get_property(memory, "reg", &len);
1079 if (!memcell_buf || len <= 0)
1080 continue;
1081
1082 /* ranges in cell */
1083 ranges = (len >> 2) / (n_mem_addr_cells + n_mem_size_cells);
1084
1085 while (ranges--) {
1086 start = read_n_cells(n_mem_addr_cells, &memcell_buf);
1087 size = read_n_cells(n_mem_size_cells, &memcell_buf);
1088
1089 if ((scn_addr < start) || (scn_addr >= (start + size)))
1090 continue;
1091
1092 nid = of_node_to_nid_single(memory);
1093 break;
1094 }
1095
1096 of_node_put(memory);
1097 if (nid >= 0)
1098 break;
1110 } 1099 }
1111 1100
1112 BUG(); /* section address should be found above */ 1101 return nid;
1113 return 0;
1114} 1102}
1115 1103
1116/* 1104/*
@@ -1121,7 +1109,7 @@ static int hot_add_drconf_scn_to_nid(struct device_node *memory,
1121int hot_add_scn_to_nid(unsigned long scn_addr) 1109int hot_add_scn_to_nid(unsigned long scn_addr)
1122{ 1110{
1123 struct device_node *memory = NULL; 1111 struct device_node *memory = NULL;
1124 int nid; 1112 int nid, found = 0;
1125 1113
1126 if (!numa_enabled || (min_common_depth < 0)) 1114 if (!numa_enabled || (min_common_depth < 0))
1127 return any_online_node(NODE_MASK_ALL); 1115 return any_online_node(NODE_MASK_ALL);
@@ -1130,35 +1118,25 @@ int hot_add_scn_to_nid(unsigned long scn_addr)
1130 if (memory) { 1118 if (memory) {
1131 nid = hot_add_drconf_scn_to_nid(memory, scn_addr); 1119 nid = hot_add_drconf_scn_to_nid(memory, scn_addr);
1132 of_node_put(memory); 1120 of_node_put(memory);
1133 return nid; 1121 } else {
1122 nid = hot_add_node_scn_to_nid(scn_addr);
1134 } 1123 }
1135 1124
1136 while ((memory = of_find_node_by_type(memory, "memory")) != NULL) { 1125 if (nid < 0 || !node_online(nid))
1137 unsigned long start, size; 1126 nid = any_online_node(NODE_MASK_ALL);
1138 int ranges;
1139 const unsigned int *memcell_buf;
1140 unsigned int len;
1141
1142 memcell_buf = of_get_property(memory, "reg", &len);
1143 if (!memcell_buf || len <= 0)
1144 continue;
1145 1127
1146 /* ranges in cell */ 1128 if (NODE_DATA(nid)->node_spanned_pages)
1147 ranges = (len >> 2) / (n_mem_addr_cells + n_mem_size_cells); 1129 return nid;
1148ha_new_range:
1149 start = read_n_cells(n_mem_addr_cells, &memcell_buf);
1150 size = read_n_cells(n_mem_size_cells, &memcell_buf);
1151 nid = of_node_to_nid_single(memory);
1152 1130
1153 if (valid_hot_add_scn(&nid, start, size, scn_addr)) { 1131 for_each_online_node(nid) {
1154 of_node_put(memory); 1132 if (NODE_DATA(nid)->node_spanned_pages) {
1155 return nid; 1133 found = 1;
1134 break;
1156 } 1135 }
1157
1158 if (--ranges) /* process all ranges in cell */
1159 goto ha_new_range;
1160 } 1136 }
1161 BUG(); /* section address should be found above */ 1137
1162 return 0; 1138 BUG_ON(!found);
1139 return nid;
1163} 1140}
1141
1164#endif /* CONFIG_MEMORY_HOTPLUG */ 1142#endif /* CONFIG_MEMORY_HOTPLUG */
diff --git a/arch/powerpc/mm/pgtable.c b/arch/powerpc/mm/pgtable.c
index 6d94116fdea1..f5c6fd42265c 100644
--- a/arch/powerpc/mm/pgtable.c
+++ b/arch/powerpc/mm/pgtable.c
@@ -1,5 +1,6 @@
1/* 1/*
2 * This file contains common routines for dealing with free of page tables 2 * This file contains common routines for dealing with free of page tables
3 * Along with common page table handling code
3 * 4 *
4 * Derived from arch/powerpc/mm/tlb_64.c: 5 * Derived from arch/powerpc/mm/tlb_64.c:
5 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org) 6 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
@@ -81,11 +82,10 @@ static void pte_free_submit(struct pte_freelist_batch *batch)
81void pgtable_free_tlb(struct mmu_gather *tlb, pgtable_free_t pgf) 82void pgtable_free_tlb(struct mmu_gather *tlb, pgtable_free_t pgf)
82{ 83{
83 /* This is safe since tlb_gather_mmu has disabled preemption */ 84 /* This is safe since tlb_gather_mmu has disabled preemption */
84 cpumask_t local_cpumask = cpumask_of_cpu(smp_processor_id());
85 struct pte_freelist_batch **batchp = &__get_cpu_var(pte_freelist_cur); 85 struct pte_freelist_batch **batchp = &__get_cpu_var(pte_freelist_cur);
86 86
87 if (atomic_read(&tlb->mm->mm_users) < 2 || 87 if (atomic_read(&tlb->mm->mm_users) < 2 ||
88 cpus_equal(tlb->mm->cpu_vm_mask, local_cpumask)) { 88 cpumask_equal(mm_cpumask(tlb->mm), cpumask_of(smp_processor_id()))){
89 pgtable_free(pgf); 89 pgtable_free(pgf);
90 return; 90 return;
91 } 91 }
@@ -115,3 +115,133 @@ void pte_free_finish(void)
115 pte_free_submit(*batchp); 115 pte_free_submit(*batchp);
116 *batchp = NULL; 116 *batchp = NULL;
117} 117}
118
119/*
120 * Handle i/d cache flushing, called from set_pte_at() or ptep_set_access_flags()
121 */
122static pte_t do_dcache_icache_coherency(pte_t pte)
123{
124 unsigned long pfn = pte_pfn(pte);
125 struct page *page;
126
127 if (unlikely(!pfn_valid(pfn)))
128 return pte;
129 page = pfn_to_page(pfn);
130
131 if (!PageReserved(page) && !test_bit(PG_arch_1, &page->flags)) {
132 pr_debug("do_dcache_icache_coherency... flushing\n");
133 flush_dcache_icache_page(page);
134 set_bit(PG_arch_1, &page->flags);
135 }
136 else
137 pr_debug("do_dcache_icache_coherency... already clean\n");
138 return __pte(pte_val(pte) | _PAGE_HWEXEC);
139}
140
141static inline int is_exec_fault(void)
142{
143 return current->thread.regs && TRAP(current->thread.regs) == 0x400;
144}
145
146/* We only try to do i/d cache coherency on stuff that looks like
147 * reasonably "normal" PTEs. We currently require a PTE to be present
148 * and we avoid _PAGE_SPECIAL and _PAGE_NO_CACHE
149 */
150static inline int pte_looks_normal(pte_t pte)
151{
152 return (pte_val(pte) &
153 (_PAGE_PRESENT | _PAGE_SPECIAL | _PAGE_NO_CACHE)) ==
154 (_PAGE_PRESENT);
155}
156
157#if defined(CONFIG_PPC_STD_MMU)
158/* Server-style MMU handles coherency when hashing if HW exec permission
159 * is supposed per page (currently 64-bit only). Else, we always flush
160 * valid PTEs in set_pte.
161 */
162static inline int pte_need_exec_flush(pte_t pte, int set_pte)
163{
164 return set_pte && pte_looks_normal(pte) &&
165 !(cpu_has_feature(CPU_FTR_COHERENT_ICACHE) ||
166 cpu_has_feature(CPU_FTR_NOEXECUTE));
167}
168#elif _PAGE_HWEXEC == 0
169/* Embedded type MMU without HW exec support (8xx only so far), we flush
170 * the cache for any present PTE
171 */
172static inline int pte_need_exec_flush(pte_t pte, int set_pte)
173{
174 return set_pte && pte_looks_normal(pte);
175}
176#else
177/* Other embedded CPUs with HW exec support per-page, we flush on exec
178 * fault if HWEXEC is not set
179 */
180static inline int pte_need_exec_flush(pte_t pte, int set_pte)
181{
182 return pte_looks_normal(pte) && is_exec_fault() &&
183 !(pte_val(pte) & _PAGE_HWEXEC);
184}
185#endif
186
187/*
188 * set_pte stores a linux PTE into the linux page table.
189 */
190void set_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *ptep, pte_t pte)
191{
192#ifdef CONFIG_DEBUG_VM
193 WARN_ON(pte_present(*ptep));
194#endif
195 /* Note: mm->context.id might not yet have been assigned as
196 * this context might not have been activated yet when this
197 * is called.
198 */
199 pte = __pte(pte_val(pte) & ~_PAGE_HPTEFLAGS);
200 if (pte_need_exec_flush(pte, 1))
201 pte = do_dcache_icache_coherency(pte);
202
203 /* Perform the setting of the PTE */
204 __set_pte_at(mm, addr, ptep, pte, 0);
205}
206
207/*
208 * This is called when relaxing access to a PTE. It's also called in the page
209 * fault path when we don't hit any of the major fault cases, ie, a minor
210 * update of _PAGE_ACCESSED, _PAGE_DIRTY, etc... The generic code will have
211 * handled those two for us, we additionally deal with missing execute
212 * permission here on some processors
213 */
214int ptep_set_access_flags(struct vm_area_struct *vma, unsigned long address,
215 pte_t *ptep, pte_t entry, int dirty)
216{
217 int changed;
218 if (!dirty && pte_need_exec_flush(entry, 0))
219 entry = do_dcache_icache_coherency(entry);
220 changed = !pte_same(*(ptep), entry);
221 if (changed) {
222 assert_pte_locked(vma->vm_mm, address);
223 __ptep_set_access_flags(ptep, entry);
224 flush_tlb_page_nohash(vma, address);
225 }
226 return changed;
227}
228
229#ifdef CONFIG_DEBUG_VM
230void assert_pte_locked(struct mm_struct *mm, unsigned long addr)
231{
232 pgd_t *pgd;
233 pud_t *pud;
234 pmd_t *pmd;
235
236 if (mm == &init_mm)
237 return;
238 pgd = mm->pgd + pgd_index(addr);
239 BUG_ON(pgd_none(*pgd));
240 pud = pud_offset(pgd, addr);
241 BUG_ON(pud_none(*pud));
242 pmd = pmd_offset(pud, addr);
243 BUG_ON(!pmd_present(*pmd));
244 BUG_ON(!spin_is_locked(pte_lockptr(mm, pmd)));
245}
246#endif /* CONFIG_DEBUG_VM */
247
diff --git a/arch/powerpc/mm/pgtable_32.c b/arch/powerpc/mm/pgtable_32.c
index 58bcaeba728d..430d0908fa50 100644
--- a/arch/powerpc/mm/pgtable_32.c
+++ b/arch/powerpc/mm/pgtable_32.c
@@ -129,7 +129,8 @@ pgtable_t pte_alloc_one(struct mm_struct *mm, unsigned long address)
129void __iomem * 129void __iomem *
130ioremap(phys_addr_t addr, unsigned long size) 130ioremap(phys_addr_t addr, unsigned long size)
131{ 131{
132 return __ioremap(addr, size, _PAGE_NO_CACHE | _PAGE_GUARDED); 132 return __ioremap_caller(addr, size, _PAGE_NO_CACHE | _PAGE_GUARDED,
133 __builtin_return_address(0));
133} 134}
134EXPORT_SYMBOL(ioremap); 135EXPORT_SYMBOL(ioremap);
135 136
@@ -143,20 +144,27 @@ ioremap_flags(phys_addr_t addr, unsigned long size, unsigned long flags)
143 /* we don't want to let _PAGE_USER and _PAGE_EXEC leak out */ 144 /* we don't want to let _PAGE_USER and _PAGE_EXEC leak out */
144 flags &= ~(_PAGE_USER | _PAGE_EXEC | _PAGE_HWEXEC); 145 flags &= ~(_PAGE_USER | _PAGE_EXEC | _PAGE_HWEXEC);
145 146
146 return __ioremap(addr, size, flags); 147 return __ioremap_caller(addr, size, flags, __builtin_return_address(0));
147} 148}
148EXPORT_SYMBOL(ioremap_flags); 149EXPORT_SYMBOL(ioremap_flags);
149 150
150void __iomem * 151void __iomem *
151__ioremap(phys_addr_t addr, unsigned long size, unsigned long flags) 152__ioremap(phys_addr_t addr, unsigned long size, unsigned long flags)
152{ 153{
154 return __ioremap_caller(addr, size, flags, __builtin_return_address(0));
155}
156
157void __iomem *
158__ioremap_caller(phys_addr_t addr, unsigned long size, unsigned long flags,
159 void *caller)
160{
153 unsigned long v, i; 161 unsigned long v, i;
154 phys_addr_t p; 162 phys_addr_t p;
155 int err; 163 int err;
156 164
157 /* Make sure we have the base flags */ 165 /* Make sure we have the base flags */
158 if ((flags & _PAGE_PRESENT) == 0) 166 if ((flags & _PAGE_PRESENT) == 0)
159 flags |= _PAGE_KERNEL; 167 flags |= PAGE_KERNEL;
160 168
161 /* Non-cacheable page cannot be coherent */ 169 /* Non-cacheable page cannot be coherent */
162 if (flags & _PAGE_NO_CACHE) 170 if (flags & _PAGE_NO_CACHE)
@@ -212,7 +220,7 @@ __ioremap(phys_addr_t addr, unsigned long size, unsigned long flags)
212 220
213 if (mem_init_done) { 221 if (mem_init_done) {
214 struct vm_struct *area; 222 struct vm_struct *area;
215 area = get_vm_area(size, VM_IOREMAP); 223 area = get_vm_area_caller(size, VM_IOREMAP, caller);
216 if (area == 0) 224 if (area == 0)
217 return NULL; 225 return NULL;
218 v = (unsigned long) area->addr; 226 v = (unsigned long) area->addr;
@@ -288,7 +296,7 @@ void __init mapin_ram(void)
288 p = memstart_addr + s; 296 p = memstart_addr + s;
289 for (; s < total_lowmem; s += PAGE_SIZE) { 297 for (; s < total_lowmem; s += PAGE_SIZE) {
290 ktext = ((char *) v >= _stext && (char *) v < etext); 298 ktext = ((char *) v >= _stext && (char *) v < etext);
291 f = ktext ?_PAGE_RAM_TEXT : _PAGE_RAM; 299 f = ktext ? PAGE_KERNEL_TEXT : PAGE_KERNEL;
292 map_page(v, p, f); 300 map_page(v, p, f);
293#ifdef CONFIG_PPC_STD_MMU_32 301#ifdef CONFIG_PPC_STD_MMU_32
294 if (ktext) 302 if (ktext)
diff --git a/arch/powerpc/mm/pgtable_64.c b/arch/powerpc/mm/pgtable_64.c
index 365e61ae5dbc..bfa7db6b2fd5 100644
--- a/arch/powerpc/mm/pgtable_64.c
+++ b/arch/powerpc/mm/pgtable_64.c
@@ -144,8 +144,8 @@ void __iounmap_at(void *ea, unsigned long size)
144 unmap_kernel_range((unsigned long)ea, size); 144 unmap_kernel_range((unsigned long)ea, size);
145} 145}
146 146
147void __iomem * __ioremap(phys_addr_t addr, unsigned long size, 147void __iomem * __ioremap_caller(phys_addr_t addr, unsigned long size,
148 unsigned long flags) 148 unsigned long flags, void *caller)
149{ 149{
150 phys_addr_t paligned; 150 phys_addr_t paligned;
151 void __iomem *ret; 151 void __iomem *ret;
@@ -168,8 +168,9 @@ void __iomem * __ioremap(phys_addr_t addr, unsigned long size,
168 if (mem_init_done) { 168 if (mem_init_done) {
169 struct vm_struct *area; 169 struct vm_struct *area;
170 170
171 area = __get_vm_area(size, VM_IOREMAP, 171 area = __get_vm_area_caller(size, VM_IOREMAP,
172 ioremap_bot, IOREMAP_END); 172 ioremap_bot, IOREMAP_END,
173 caller);
173 if (area == NULL) 174 if (area == NULL)
174 return NULL; 175 return NULL;
175 ret = __ioremap_at(paligned, area->addr, size, flags); 176 ret = __ioremap_at(paligned, area->addr, size, flags);
@@ -186,19 +187,27 @@ void __iomem * __ioremap(phys_addr_t addr, unsigned long size,
186 return ret; 187 return ret;
187} 188}
188 189
190void __iomem * __ioremap(phys_addr_t addr, unsigned long size,
191 unsigned long flags)
192{
193 return __ioremap_caller(addr, size, flags, __builtin_return_address(0));
194}
189 195
190void __iomem * ioremap(phys_addr_t addr, unsigned long size) 196void __iomem * ioremap(phys_addr_t addr, unsigned long size)
191{ 197{
192 unsigned long flags = _PAGE_NO_CACHE | _PAGE_GUARDED; 198 unsigned long flags = _PAGE_NO_CACHE | _PAGE_GUARDED;
199 void *caller = __builtin_return_address(0);
193 200
194 if (ppc_md.ioremap) 201 if (ppc_md.ioremap)
195 return ppc_md.ioremap(addr, size, flags); 202 return ppc_md.ioremap(addr, size, flags, caller);
196 return __ioremap(addr, size, flags); 203 return __ioremap_caller(addr, size, flags, caller);
197} 204}
198 205
199void __iomem * ioremap_flags(phys_addr_t addr, unsigned long size, 206void __iomem * ioremap_flags(phys_addr_t addr, unsigned long size,
200 unsigned long flags) 207 unsigned long flags)
201{ 208{
209 void *caller = __builtin_return_address(0);
210
202 /* writeable implies dirty for kernel addresses */ 211 /* writeable implies dirty for kernel addresses */
203 if (flags & _PAGE_RW) 212 if (flags & _PAGE_RW)
204 flags |= _PAGE_DIRTY; 213 flags |= _PAGE_DIRTY;
@@ -207,8 +216,8 @@ void __iomem * ioremap_flags(phys_addr_t addr, unsigned long size,
207 flags &= ~(_PAGE_USER | _PAGE_EXEC); 216 flags &= ~(_PAGE_USER | _PAGE_EXEC);
208 217
209 if (ppc_md.ioremap) 218 if (ppc_md.ioremap)
210 return ppc_md.ioremap(addr, size, flags); 219 return ppc_md.ioremap(addr, size, flags, caller);
211 return __ioremap(addr, size, flags); 220 return __ioremap_caller(addr, size, flags, caller);
212} 221}
213 222
214 223
diff --git a/arch/powerpc/mm/ppc_mmu_32.c b/arch/powerpc/mm/ppc_mmu_32.c
index fe65c405412c..2d2a87e10154 100644
--- a/arch/powerpc/mm/ppc_mmu_32.c
+++ b/arch/powerpc/mm/ppc_mmu_32.c
@@ -74,9 +74,6 @@ unsigned long p_mapped_by_bats(phys_addr_t pa)
74 74
75unsigned long __init mmu_mapin_ram(void) 75unsigned long __init mmu_mapin_ram(void)
76{ 76{
77#ifdef CONFIG_POWER4
78 return 0;
79#else
80 unsigned long tot, bl, done; 77 unsigned long tot, bl, done;
81 unsigned long max_size = (256<<20); 78 unsigned long max_size = (256<<20);
82 79
@@ -95,7 +92,7 @@ unsigned long __init mmu_mapin_ram(void)
95 break; 92 break;
96 } 93 }
97 94
98 setbat(2, PAGE_OFFSET, 0, bl, _PAGE_RAM); 95 setbat(2, PAGE_OFFSET, 0, bl, PAGE_KERNEL_X);
99 done = (unsigned long)bat_addrs[2].limit - PAGE_OFFSET + 1; 96 done = (unsigned long)bat_addrs[2].limit - PAGE_OFFSET + 1;
100 if ((done < tot) && !bat_addrs[3].limit) { 97 if ((done < tot) && !bat_addrs[3].limit) {
101 /* use BAT3 to cover a bit more */ 98 /* use BAT3 to cover a bit more */
@@ -103,12 +100,11 @@ unsigned long __init mmu_mapin_ram(void)
103 for (bl = 128<<10; bl < max_size; bl <<= 1) 100 for (bl = 128<<10; bl < max_size; bl <<= 1)
104 if (bl * 2 > tot) 101 if (bl * 2 > tot)
105 break; 102 break;
106 setbat(3, PAGE_OFFSET+done, done, bl, _PAGE_RAM); 103 setbat(3, PAGE_OFFSET+done, done, bl, PAGE_KERNEL_X);
107 done = (unsigned long)bat_addrs[3].limit - PAGE_OFFSET + 1; 104 done = (unsigned long)bat_addrs[3].limit - PAGE_OFFSET + 1;
108 } 105 }
109 106
110 return done; 107 return done;
111#endif
112} 108}
113 109
114/* 110/*
@@ -136,9 +132,7 @@ void __init setbat(int index, unsigned long virt, phys_addr_t phys,
136 wimgxpp |= (flags & _PAGE_RW)? BPP_RW: BPP_RX; 132 wimgxpp |= (flags & _PAGE_RW)? BPP_RW: BPP_RX;
137 bat[1].batu = virt | (bl << 2) | 2; /* Vs=1, Vp=0 */ 133 bat[1].batu = virt | (bl << 2) | 2; /* Vs=1, Vp=0 */
138 bat[1].batl = BAT_PHYS_ADDR(phys) | wimgxpp; 134 bat[1].batl = BAT_PHYS_ADDR(phys) | wimgxpp;
139#ifndef CONFIG_KGDB /* want user access for breakpoints */
140 if (flags & _PAGE_USER) 135 if (flags & _PAGE_USER)
141#endif
142 bat[1].batu |= 1; /* Vp = 1 */ 136 bat[1].batu |= 1; /* Vp = 1 */
143 if (flags & _PAGE_GUARDED) { 137 if (flags & _PAGE_GUARDED) {
144 /* G bit must be zero in IBATs */ 138 /* G bit must be zero in IBATs */
diff --git a/arch/powerpc/mm/tlb_hash64.c b/arch/powerpc/mm/tlb_hash64.c
index c931bc7d1079..1be1b5e59796 100644
--- a/arch/powerpc/mm/tlb_hash64.c
+++ b/arch/powerpc/mm/tlb_hash64.c
@@ -139,12 +139,12 @@ void hpte_need_flush(struct mm_struct *mm, unsigned long addr,
139 */ 139 */
140void __flush_tlb_pending(struct ppc64_tlb_batch *batch) 140void __flush_tlb_pending(struct ppc64_tlb_batch *batch)
141{ 141{
142 cpumask_t tmp; 142 const struct cpumask *tmp;
143 int i, local = 0; 143 int i, local = 0;
144 144
145 i = batch->index; 145 i = batch->index;
146 tmp = cpumask_of_cpu(smp_processor_id()); 146 tmp = cpumask_of(smp_processor_id());
147 if (cpus_equal(batch->mm->cpu_vm_mask, tmp)) 147 if (cpumask_equal(mm_cpumask(batch->mm), tmp))
148 local = 1; 148 local = 1;
149 if (i == 1) 149 if (i == 1)
150 flush_hash_page(batch->vaddr[0], batch->pte[0], 150 flush_hash_page(batch->vaddr[0], batch->pte[0],
diff --git a/arch/powerpc/mm/tlb_nohash.c b/arch/powerpc/mm/tlb_nohash.c
index 39ac22b13c73..7af72970faed 100644
--- a/arch/powerpc/mm/tlb_nohash.c
+++ b/arch/powerpc/mm/tlb_nohash.c
@@ -132,11 +132,11 @@ void flush_tlb_mm(struct mm_struct *mm)
132 pid = mm->context.id; 132 pid = mm->context.id;
133 if (unlikely(pid == MMU_NO_CONTEXT)) 133 if (unlikely(pid == MMU_NO_CONTEXT))
134 goto no_context; 134 goto no_context;
135 cpu_mask = mm->cpu_vm_mask; 135 if (!cpumask_equal(mm_cpumask(mm), cpumask_of(smp_processor_id()))) {
136 cpu_clear(smp_processor_id(), cpu_mask);
137 if (!cpus_empty(cpu_mask)) {
138 struct tlb_flush_param p = { .pid = pid }; 136 struct tlb_flush_param p = { .pid = pid };
139 smp_call_function_mask(cpu_mask, do_flush_tlb_mm_ipi, &p, 1); 137 /* Ignores smp_processor_id() even if set. */
138 smp_call_function_many(mm_cpumask(mm),
139 do_flush_tlb_mm_ipi, &p, 1);
140 } 140 }
141 _tlbil_pid(pid); 141 _tlbil_pid(pid);
142 no_context: 142 no_context:
@@ -146,16 +146,15 @@ EXPORT_SYMBOL(flush_tlb_mm);
146 146
147void flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr) 147void flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr)
148{ 148{
149 cpumask_t cpu_mask; 149 struct cpumask *cpu_mask;
150 unsigned int pid; 150 unsigned int pid;
151 151
152 preempt_disable(); 152 preempt_disable();
153 pid = vma ? vma->vm_mm->context.id : 0; 153 pid = vma ? vma->vm_mm->context.id : 0;
154 if (unlikely(pid == MMU_NO_CONTEXT)) 154 if (unlikely(pid == MMU_NO_CONTEXT))
155 goto bail; 155 goto bail;
156 cpu_mask = vma->vm_mm->cpu_vm_mask; 156 cpu_mask = mm_cpumask(vma->vm_mm);
157 cpu_clear(smp_processor_id(), cpu_mask); 157 if (!cpumask_equal(cpu_mask, cpumask_of(smp_processor_id()))) {
158 if (!cpus_empty(cpu_mask)) {
159 /* If broadcast tlbivax is supported, use it */ 158 /* If broadcast tlbivax is supported, use it */
160 if (mmu_has_feature(MMU_FTR_USE_TLBIVAX_BCAST)) { 159 if (mmu_has_feature(MMU_FTR_USE_TLBIVAX_BCAST)) {
161 int lock = mmu_has_feature(MMU_FTR_LOCK_BCAST_INVAL); 160 int lock = mmu_has_feature(MMU_FTR_LOCK_BCAST_INVAL);
@@ -167,7 +166,8 @@ void flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr)
167 goto bail; 166 goto bail;
168 } else { 167 } else {
169 struct tlb_flush_param p = { .pid = pid, .addr = vmaddr }; 168 struct tlb_flush_param p = { .pid = pid, .addr = vmaddr };
170 smp_call_function_mask(cpu_mask, 169 /* Ignores smp_processor_id() even if set in cpu_mask */
170 smp_call_function_many(cpu_mask,
171 do_flush_tlb_page_ipi, &p, 1); 171 do_flush_tlb_page_ipi, &p, 1);
172 } 172 }
173 } 173 }
diff --git a/arch/powerpc/mm/tlb_nohash_low.S b/arch/powerpc/mm/tlb_nohash_low.S
index f900a39e6ec4..788b87c36f77 100644
--- a/arch/powerpc/mm/tlb_nohash_low.S
+++ b/arch/powerpc/mm/tlb_nohash_low.S
@@ -118,25 +118,50 @@ _GLOBAL(_tlbil_pid)
118 118
119#elif defined(CONFIG_FSL_BOOKE) 119#elif defined(CONFIG_FSL_BOOKE)
120/* 120/*
121 * FSL BookE implementations. Currently _pid and _all are the 121 * FSL BookE implementations.
122 * same. This will change when tlbilx is actually supported and 122 *
123 * performs invalidate-by-PID. This change will be driven by 123 * Since feature sections are using _SECTION_ELSE we need
124 * mmu_features conditional 124 * to have the larger code path before the _SECTION_ELSE
125 */ 125 */
126 126
127#define MMUCSR0_TLBFI (MMUCSR0_TLB0FI | MMUCSR0_TLB1FI | \
128 MMUCSR0_TLB2FI | MMUCSR0_TLB3FI)
127/* 129/*
128 * Flush MMU TLB on the local processor 130 * Flush MMU TLB on the local processor
129 */ 131 */
130_GLOBAL(_tlbil_pid)
131_GLOBAL(_tlbil_all) 132_GLOBAL(_tlbil_all)
132#define MMUCSR0_TLBFI (MMUCSR0_TLB0FI | MMUCSR0_TLB1FI | \ 133BEGIN_MMU_FTR_SECTION
133 MMUCSR0_TLB2FI | MMUCSR0_TLB3FI) 134 li r3,(MMUCSR0_TLBFI)@l
135 mtspr SPRN_MMUCSR0, r3
1361:
137 mfspr r3,SPRN_MMUCSR0
138 andi. r3,r3,MMUCSR0_TLBFI@l
139 bne 1b
140MMU_FTR_SECTION_ELSE
141 PPC_TLBILX_ALL(0,0)
142ALT_MMU_FTR_SECTION_END_IFCLR(MMU_FTR_USE_TLBILX)
143 msync
144 isync
145 blr
146
147_GLOBAL(_tlbil_pid)
148BEGIN_MMU_FTR_SECTION
149 slwi r3,r3,16
150 mfmsr r10
151 wrteei 0
152 mfspr r4,SPRN_MAS6 /* save MAS6 */
153 mtspr SPRN_MAS6,r3
154 PPC_TLBILX_PID(0,0)
155 mtspr SPRN_MAS6,r4 /* restore MAS6 */
156 wrtee r10
157MMU_FTR_SECTION_ELSE
134 li r3,(MMUCSR0_TLBFI)@l 158 li r3,(MMUCSR0_TLBFI)@l
135 mtspr SPRN_MMUCSR0, r3 159 mtspr SPRN_MMUCSR0, r3
1361: 1601:
137 mfspr r3,SPRN_MMUCSR0 161 mfspr r3,SPRN_MMUCSR0
138 andi. r3,r3,MMUCSR0_TLBFI@l 162 andi. r3,r3,MMUCSR0_TLBFI@l
139 bne 1b 163 bne 1b
164ALT_MMU_FTR_SECTION_END_IFSET(MMU_FTR_USE_TLBILX)
140 msync 165 msync
141 isync 166 isync
142 blr 167 blr
@@ -149,7 +174,9 @@ _GLOBAL(_tlbil_va)
149 mfmsr r10 174 mfmsr r10
150 wrteei 0 175 wrteei 0
151 slwi r4,r4,16 176 slwi r4,r4,16
177 ori r4,r4,(MAS6_ISIZE(BOOK3E_PAGESZ_4K))@l
152 mtspr SPRN_MAS6,r4 /* assume AS=0 for now */ 178 mtspr SPRN_MAS6,r4 /* assume AS=0 for now */
179BEGIN_MMU_FTR_SECTION
153 tlbsx 0,r3 180 tlbsx 0,r3
154 mfspr r4,SPRN_MAS1 /* check valid */ 181 mfspr r4,SPRN_MAS1 /* check valid */
155 andis. r3,r4,MAS1_VALID@h 182 andis. r3,r4,MAS1_VALID@h
@@ -157,6 +184,9 @@ _GLOBAL(_tlbil_va)
157 rlwinm r4,r4,0,1,31 184 rlwinm r4,r4,0,1,31
158 mtspr SPRN_MAS1,r4 185 mtspr SPRN_MAS1,r4
159 tlbwe 186 tlbwe
187MMU_FTR_SECTION_ELSE
188 PPC_TLBILX_VA(0,r3)
189ALT_MMU_FTR_SECTION_END_IFCLR(MMU_FTR_USE_TLBILX)
160 msync 190 msync
161 isync 191 isync
1621: wrtee r10 1921: wrtee r10
diff --git a/arch/powerpc/oprofile/op_model_7450.c b/arch/powerpc/oprofile/op_model_7450.c
index cc599eb8768b..f8d36f940e88 100644
--- a/arch/powerpc/oprofile/op_model_7450.c
+++ b/arch/powerpc/oprofile/op_model_7450.c
@@ -29,7 +29,7 @@
29static unsigned long reset_value[OP_MAX_COUNTER]; 29static unsigned long reset_value[OP_MAX_COUNTER];
30 30
31static int oprofile_running; 31static int oprofile_running;
32static u32 mmcr0_val, mmcr1_val, mmcr2_val; 32static u32 mmcr0_val, mmcr1_val, mmcr2_val, num_pmcs;
33 33
34#define MMCR0_PMC1_SHIFT 6 34#define MMCR0_PMC1_SHIFT 6
35#define MMCR0_PMC2_SHIFT 0 35#define MMCR0_PMC2_SHIFT 0
@@ -88,13 +88,12 @@ static int fsl7450_cpu_setup(struct op_counter_config *ctr)
88 88
89 mtspr(SPRN_MMCR0, mmcr0_val); 89 mtspr(SPRN_MMCR0, mmcr0_val);
90 mtspr(SPRN_MMCR1, mmcr1_val); 90 mtspr(SPRN_MMCR1, mmcr1_val);
91 mtspr(SPRN_MMCR2, mmcr2_val); 91 if (num_pmcs > 4)
92 mtspr(SPRN_MMCR2, mmcr2_val);
92 93
93 return 0; 94 return 0;
94} 95}
95 96
96#define NUM_CTRS 6
97
98/* Configures the global settings for the countes on all CPUs. */ 97/* Configures the global settings for the countes on all CPUs. */
99static int fsl7450_reg_setup(struct op_counter_config *ctr, 98static int fsl7450_reg_setup(struct op_counter_config *ctr,
100 struct op_system_config *sys, 99 struct op_system_config *sys,
@@ -102,12 +101,13 @@ static int fsl7450_reg_setup(struct op_counter_config *ctr,
102{ 101{
103 int i; 102 int i;
104 103
104 num_pmcs = num_ctrs;
105 /* Our counters count up, and "count" refers to 105 /* Our counters count up, and "count" refers to
106 * how much before the next interrupt, and we interrupt 106 * how much before the next interrupt, and we interrupt
107 * on overflow. So we calculate the starting value 107 * on overflow. So we calculate the starting value
108 * which will give us "count" until overflow. 108 * which will give us "count" until overflow.
109 * Then we set the events on the enabled counters */ 109 * Then we set the events on the enabled counters */
110 for (i = 0; i < NUM_CTRS; ++i) 110 for (i = 0; i < num_ctrs; ++i)
111 reset_value[i] = 0x80000000UL - ctr[i].count; 111 reset_value[i] = 0x80000000UL - ctr[i].count;
112 112
113 /* Set events for Counters 1 & 2 */ 113 /* Set events for Counters 1 & 2 */
@@ -123,9 +123,10 @@ static int fsl7450_reg_setup(struct op_counter_config *ctr,
123 123
124 /* Set events for Counters 3-6 */ 124 /* Set events for Counters 3-6 */
125 mmcr1_val = mmcr1_event3(ctr[2].event) 125 mmcr1_val = mmcr1_event3(ctr[2].event)
126 | mmcr1_event4(ctr[3].event) 126 | mmcr1_event4(ctr[3].event);
127 | mmcr1_event5(ctr[4].event) 127 if (num_ctrs > 4)
128 | mmcr1_event6(ctr[5].event); 128 mmcr1_val |= mmcr1_event5(ctr[4].event)
129 | mmcr1_event6(ctr[5].event);
129 130
130 mmcr2_val = 0; 131 mmcr2_val = 0;
131 132
@@ -139,7 +140,7 @@ static int fsl7450_start(struct op_counter_config *ctr)
139 140
140 mtmsr(mfmsr() | MSR_PMM); 141 mtmsr(mfmsr() | MSR_PMM);
141 142
142 for (i = 0; i < NUM_CTRS; ++i) { 143 for (i = 0; i < num_pmcs; ++i) {
143 if (ctr[i].enabled) 144 if (ctr[i].enabled)
144 classic_ctr_write(i, reset_value[i]); 145 classic_ctr_write(i, reset_value[i]);
145 else 146 else
@@ -184,7 +185,7 @@ static void fsl7450_handle_interrupt(struct pt_regs *regs,
184 pc = mfspr(SPRN_SIAR); 185 pc = mfspr(SPRN_SIAR);
185 is_kernel = is_kernel_addr(pc); 186 is_kernel = is_kernel_addr(pc);
186 187
187 for (i = 0; i < NUM_CTRS; ++i) { 188 for (i = 0; i < num_pmcs; ++i) {
188 val = classic_ctr_read(i); 189 val = classic_ctr_read(i);
189 if (val < 0) { 190 if (val < 0) {
190 if (oprofile_running && ctr[i].enabled) { 191 if (oprofile_running && ctr[i].enabled) {
diff --git a/arch/powerpc/platforms/44x/Kconfig b/arch/powerpc/platforms/44x/Kconfig
index 3496bc05058e..bf5c7ff2e6e5 100644
--- a/arch/powerpc/platforms/44x/Kconfig
+++ b/arch/powerpc/platforms/44x/Kconfig
@@ -118,6 +118,17 @@ config GLACIER
118 help 118 help
119 This option enables support for the AMCC PPC460GT evaluation board. 119 This option enables support for the AMCC PPC460GT evaluation board.
120 120
121config REDWOOD
122 bool "Redwood"
123 depends on 44x
124 default n
125 select PPC44x_SIMPLE
126 select 460SX
127 select PCI
128 select PPC4xx_PCI_EXPRESS
129 help
130 This option enables support for the AMCC PPC460SX Redwood board.
131
121config YOSEMITE 132config YOSEMITE
122 bool "Yosemite" 133 bool "Yosemite"
123 depends on 44x 134 depends on 44x
@@ -220,6 +231,14 @@ config 460EX
220 select IBM_NEW_EMAC_EMAC4 231 select IBM_NEW_EMAC_EMAC4
221 select IBM_NEW_EMAC_TAH 232 select IBM_NEW_EMAC_TAH
222 233
234config 460SX
235 bool
236 select PPC_FPU
237 select IBM_NEW_EMAC_EMAC4
238 select IBM_NEW_EMAC_RGMII
239 select IBM_NEW_EMAC_ZMII
240 select IBM_NEW_EMAC_TAH
241
223# 44x errata/workaround config symbols, selected by the CPU models above 242# 44x errata/workaround config symbols, selected by the CPU models above
224config IBM440EP_ERR42 243config IBM440EP_ERR42
225 bool 244 bool
diff --git a/arch/powerpc/platforms/44x/ppc44x_simple.c b/arch/powerpc/platforms/44x/ppc44x_simple.c
index 76fdc51dac8b..5bcd441885e8 100644
--- a/arch/powerpc/platforms/44x/ppc44x_simple.c
+++ b/arch/powerpc/platforms/44x/ppc44x_simple.c
@@ -57,6 +57,7 @@ static char *board[] __initdata = {
57 "ibm,ebony", 57 "ibm,ebony",
58 "amcc,katmai", 58 "amcc,katmai",
59 "amcc,rainier", 59 "amcc,rainier",
60 "amcc,redwood",
60 "amcc,sequoia", 61 "amcc,sequoia",
61 "amcc,taishan", 62 "amcc,taishan",
62 "amcc,yosemite" 63 "amcc,yosemite"
diff --git a/arch/powerpc/platforms/512x/Kconfig b/arch/powerpc/platforms/512x/Kconfig
index 326852c78b8f..4dac9b0525a4 100644
--- a/arch/powerpc/platforms/512x/Kconfig
+++ b/arch/powerpc/platforms/512x/Kconfig
@@ -12,7 +12,7 @@ config PPC_MPC5121
12 12
13config MPC5121_ADS 13config MPC5121_ADS
14 bool "Freescale MPC5121E ADS" 14 bool "Freescale MPC5121E ADS"
15 depends on PPC_MULTIPLATFORM && PPC32 15 depends on 6xx
16 select DEFAULT_UIMAGE 16 select DEFAULT_UIMAGE
17 select PPC_MPC5121 17 select PPC_MPC5121
18 select MPC5121_ADS_CPLD 18 select MPC5121_ADS_CPLD
@@ -21,7 +21,7 @@ config MPC5121_ADS
21 21
22config MPC5121_GENERIC 22config MPC5121_GENERIC
23 bool "Generic support for simple MPC5121 based boards" 23 bool "Generic support for simple MPC5121 based boards"
24 depends on PPC_MULTIPLATFORM && PPC32 24 depends on 6xx
25 select DEFAULT_UIMAGE 25 select DEFAULT_UIMAGE
26 select PPC_MPC5121 26 select PPC_MPC5121
27 help 27 help
diff --git a/arch/powerpc/platforms/52xx/Kconfig b/arch/powerpc/platforms/52xx/Kconfig
index 696a5ee4962d..8b8e9560a315 100644
--- a/arch/powerpc/platforms/52xx/Kconfig
+++ b/arch/powerpc/platforms/52xx/Kconfig
@@ -1,6 +1,6 @@
1config PPC_MPC52xx 1config PPC_MPC52xx
2 bool "52xx-based boards" 2 bool "52xx-based boards"
3 depends on PPC_MULTIPLATFORM && PPC32 3 depends on 6xx
4 select PPC_CLOCK 4 select PPC_CLOCK
5 select PPC_PCI_CHOICE 5 select PPC_PCI_CHOICE
6 6
@@ -21,7 +21,13 @@ config PPC_MPC5200_SIMPLE
21 and if there is a PCI bus node defined in the device tree. 21 and if there is a PCI bus node defined in the device tree.
22 22
23 Boards that are compatible with this generic platform support 23 Boards that are compatible with this generic platform support
24 are: 'tqc,tqm5200', 'promess,motionpro', 'schindler,cm5200'. 24 are:
25 intercontrol,digsy-mtc
26 phytec,pcm030
27 phytec,pcm032
28 promess,motionpro
29 schindler,cm5200
30 tqc,tqm5200
25 31
26config PPC_EFIKA 32config PPC_EFIKA
27 bool "bPlan Efika 5k2. MPC5200B based computer" 33 bool "bPlan Efika 5k2. MPC5200B based computer"
@@ -35,6 +41,11 @@ config PPC_LITE5200
35 depends on PPC_MPC52xx 41 depends on PPC_MPC52xx
36 select DEFAULT_UIMAGE 42 select DEFAULT_UIMAGE
37 43
44config PPC_MEDIA5200
45 bool "Freescale Media5200 Eval Board"
46 depends on PPC_MPC52xx
47 select DEFAULT_UIMAGE
48
38config PPC_MPC5200_BUGFIX 49config PPC_MPC5200_BUGFIX
39 bool "MPC5200 (L25R) bugfix support" 50 bool "MPC5200 (L25R) bugfix support"
40 depends on PPC_MPC52xx 51 depends on PPC_MPC52xx
diff --git a/arch/powerpc/platforms/52xx/Makefile b/arch/powerpc/platforms/52xx/Makefile
index b8a52062738a..bfd4f52cf3dd 100644
--- a/arch/powerpc/platforms/52xx/Makefile
+++ b/arch/powerpc/platforms/52xx/Makefile
@@ -1,12 +1,13 @@
1# 1#
2# Makefile for 52xx based boards 2# Makefile for 52xx based boards
3# 3#
4obj-y += mpc52xx_pic.o mpc52xx_common.o 4obj-y += mpc52xx_pic.o mpc52xx_common.o mpc52xx_gpt.o
5obj-$(CONFIG_PCI) += mpc52xx_pci.o 5obj-$(CONFIG_PCI) += mpc52xx_pci.o
6 6
7obj-$(CONFIG_PPC_MPC5200_SIMPLE) += mpc5200_simple.o 7obj-$(CONFIG_PPC_MPC5200_SIMPLE) += mpc5200_simple.o
8obj-$(CONFIG_PPC_EFIKA) += efika.o 8obj-$(CONFIG_PPC_EFIKA) += efika.o
9obj-$(CONFIG_PPC_LITE5200) += lite5200.o 9obj-$(CONFIG_PPC_LITE5200) += lite5200.o
10obj-$(CONFIG_PPC_MEDIA5200) += media5200.o
10 11
11obj-$(CONFIG_PM) += mpc52xx_sleep.o mpc52xx_pm.o 12obj-$(CONFIG_PM) += mpc52xx_sleep.o mpc52xx_pm.o
12ifeq ($(CONFIG_PPC_LITE5200),y) 13ifeq ($(CONFIG_PPC_LITE5200),y)
diff --git a/arch/powerpc/platforms/52xx/media5200.c b/arch/powerpc/platforms/52xx/media5200.c
new file mode 100644
index 000000000000..68e4f1696d14
--- /dev/null
+++ b/arch/powerpc/platforms/52xx/media5200.c
@@ -0,0 +1,273 @@
1/*
2 * Support for 'media5200-platform' compatible boards.
3 *
4 * Copyright (C) 2008 Secret Lab Technologies Ltd.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
10 *
11 * Description:
12 * This code implements support for the Freescape Media5200 platform
13 * (built around the MPC5200 SoC).
14 *
15 * Notable characteristic of the Media5200 is the presence of an FPGA
16 * that has all external IRQ lines routed through it. This file implements
17 * a cascaded interrupt controller driver which attaches itself to the
18 * Virtual IRQ subsystem after the primary mpc5200 interrupt controller
19 * is initialized.
20 *
21 */
22
23#undef DEBUG
24
25#include <linux/irq.h>
26#include <linux/interrupt.h>
27#include <linux/io.h>
28#include <asm/time.h>
29#include <asm/prom.h>
30#include <asm/machdep.h>
31#include <asm/mpc52xx.h>
32
33static struct of_device_id mpc5200_gpio_ids[] __initdata = {
34 { .compatible = "fsl,mpc5200-gpio", },
35 { .compatible = "mpc5200-gpio", },
36 {}
37};
38
39/* FPGA register set */
40#define MEDIA5200_IRQ_ENABLE (0x40c)
41#define MEDIA5200_IRQ_STATUS (0x410)
42#define MEDIA5200_NUM_IRQS (6)
43#define MEDIA5200_IRQ_SHIFT (32 - MEDIA5200_NUM_IRQS)
44
45struct media5200_irq {
46 void __iomem *regs;
47 spinlock_t lock;
48 struct irq_host *irqhost;
49};
50struct media5200_irq media5200_irq;
51
52static void media5200_irq_unmask(unsigned int virq)
53{
54 unsigned long flags;
55 u32 val;
56
57 spin_lock_irqsave(&media5200_irq.lock, flags);
58 val = in_be32(media5200_irq.regs + MEDIA5200_IRQ_ENABLE);
59 val |= 1 << (MEDIA5200_IRQ_SHIFT + irq_map[virq].hwirq);
60 out_be32(media5200_irq.regs + MEDIA5200_IRQ_ENABLE, val);
61 spin_unlock_irqrestore(&media5200_irq.lock, flags);
62}
63
64static void media5200_irq_mask(unsigned int virq)
65{
66 unsigned long flags;
67 u32 val;
68
69 spin_lock_irqsave(&media5200_irq.lock, flags);
70 val = in_be32(media5200_irq.regs + MEDIA5200_IRQ_ENABLE);
71 val &= ~(1 << (MEDIA5200_IRQ_SHIFT + irq_map[virq].hwirq));
72 out_be32(media5200_irq.regs + MEDIA5200_IRQ_ENABLE, val);
73 spin_unlock_irqrestore(&media5200_irq.lock, flags);
74}
75
76static struct irq_chip media5200_irq_chip = {
77 .typename = "Media5200 FPGA",
78 .unmask = media5200_irq_unmask,
79 .mask = media5200_irq_mask,
80 .mask_ack = media5200_irq_mask,
81};
82
83void media5200_irq_cascade(unsigned int virq, struct irq_desc *desc)
84{
85 int sub_virq, val;
86 u32 status, enable;
87
88 /* Mask off the cascaded IRQ */
89 spin_lock(&desc->lock);
90 desc->chip->mask(virq);
91 spin_unlock(&desc->lock);
92
93 /* Ask the FPGA for IRQ status. If 'val' is 0, then no irqs
94 * are pending. 'ffs()' is 1 based */
95 status = in_be32(media5200_irq.regs + MEDIA5200_IRQ_ENABLE);
96 enable = in_be32(media5200_irq.regs + MEDIA5200_IRQ_STATUS);
97 val = ffs((status & enable) >> MEDIA5200_IRQ_SHIFT);
98 if (val) {
99 sub_virq = irq_linear_revmap(media5200_irq.irqhost, val - 1);
100 /* pr_debug("%s: virq=%i s=%.8x e=%.8x hwirq=%i subvirq=%i\n",
101 * __func__, virq, status, enable, val - 1, sub_virq);
102 */
103 generic_handle_irq(sub_virq);
104 }
105
106 /* Processing done; can reenable the cascade now */
107 spin_lock(&desc->lock);
108 desc->chip->ack(virq);
109 if (!(desc->status & IRQ_DISABLED))
110 desc->chip->unmask(virq);
111 spin_unlock(&desc->lock);
112}
113
114static int media5200_irq_map(struct irq_host *h, unsigned int virq,
115 irq_hw_number_t hw)
116{
117 struct irq_desc *desc = get_irq_desc(virq);
118
119 pr_debug("%s: h=%p, virq=%i, hwirq=%i\n", __func__, h, virq, (int)hw);
120 set_irq_chip_data(virq, &media5200_irq);
121 set_irq_chip_and_handler(virq, &media5200_irq_chip, handle_level_irq);
122 set_irq_type(virq, IRQ_TYPE_LEVEL_LOW);
123 desc->status &= ~(IRQ_TYPE_SENSE_MASK | IRQ_LEVEL);
124 desc->status |= IRQ_TYPE_LEVEL_LOW | IRQ_LEVEL;
125
126 return 0;
127}
128
129static int media5200_irq_xlate(struct irq_host *h, struct device_node *ct,
130 u32 *intspec, unsigned int intsize,
131 irq_hw_number_t *out_hwirq,
132 unsigned int *out_flags)
133{
134 if (intsize != 2)
135 return -1;
136
137 pr_debug("%s: bank=%i, number=%i\n", __func__, intspec[0], intspec[1]);
138 *out_hwirq = intspec[1];
139 *out_flags = IRQ_TYPE_NONE;
140 return 0;
141}
142
143static struct irq_host_ops media5200_irq_ops = {
144 .map = media5200_irq_map,
145 .xlate = media5200_irq_xlate,
146};
147
148/*
149 * Setup Media5200 IRQ mapping
150 */
151static void __init media5200_init_irq(void)
152{
153 struct device_node *fpga_np;
154 int cascade_virq;
155
156 /* First setup the regular MPC5200 interrupt controller */
157 mpc52xx_init_irq();
158
159 /* Now find the FPGA IRQ */
160 fpga_np = of_find_compatible_node(NULL, NULL, "fsl,media5200-fpga");
161 if (!fpga_np)
162 goto out;
163 pr_debug("%s: found fpga node: %s\n", __func__, fpga_np->full_name);
164
165 media5200_irq.regs = of_iomap(fpga_np, 0);
166 if (!media5200_irq.regs)
167 goto out;
168 pr_debug("%s: mapped to %p\n", __func__, media5200_irq.regs);
169
170 cascade_virq = irq_of_parse_and_map(fpga_np, 0);
171 if (!cascade_virq)
172 goto out;
173 pr_debug("%s: cascaded on virq=%i\n", __func__, cascade_virq);
174
175 /* Disable all FPGA IRQs */
176 out_be32(media5200_irq.regs + MEDIA5200_IRQ_ENABLE, 0);
177
178 spin_lock_init(&media5200_irq.lock);
179
180 media5200_irq.irqhost = irq_alloc_host(fpga_np, IRQ_HOST_MAP_LINEAR,
181 MEDIA5200_NUM_IRQS,
182 &media5200_irq_ops, -1);
183 if (!media5200_irq.irqhost)
184 goto out;
185 pr_debug("%s: allocated irqhost\n", __func__);
186
187 media5200_irq.irqhost->host_data = &media5200_irq;
188
189 set_irq_data(cascade_virq, &media5200_irq);
190 set_irq_chained_handler(cascade_virq, media5200_irq_cascade);
191
192 return;
193
194 out:
195 pr_err("Could not find Media5200 FPGA; PCI interrupts will not work\n");
196}
197
198/*
199 * Setup the architecture
200 */
201static void __init media5200_setup_arch(void)
202{
203
204 struct device_node *np;
205 struct mpc52xx_gpio __iomem *gpio;
206 u32 port_config;
207
208 if (ppc_md.progress)
209 ppc_md.progress("media5200_setup_arch()", 0);
210
211 /* Map important registers from the internal memory map */
212 mpc52xx_map_common_devices();
213
214 /* Some mpc5200 & mpc5200b related configuration */
215 mpc5200_setup_xlb_arbiter();
216
217 mpc52xx_setup_pci();
218
219 np = of_find_matching_node(NULL, mpc5200_gpio_ids);
220 gpio = of_iomap(np, 0);
221 of_node_put(np);
222 if (!gpio) {
223 printk(KERN_ERR "%s() failed. expect abnormal behavior\n",
224 __func__);
225 return;
226 }
227
228 /* Set port config */
229 port_config = in_be32(&gpio->port_config);
230
231 port_config &= ~0x03000000; /* ATA CS is on csb_4/5 */
232 port_config |= 0x01000000;
233
234 out_be32(&gpio->port_config, port_config);
235
236 /* Unmap zone */
237 iounmap(gpio);
238
239}
240
241/* list of the supported boards */
242static char *board[] __initdata = {
243 "fsl,media5200",
244 NULL
245};
246
247/*
248 * Called very early, MMU is off, device-tree isn't unflattened
249 */
250static int __init media5200_probe(void)
251{
252 unsigned long node = of_get_flat_dt_root();
253 int i = 0;
254
255 while (board[i]) {
256 if (of_flat_dt_is_compatible(node, board[i]))
257 break;
258 i++;
259 }
260
261 return (board[i] != NULL);
262}
263
264define_machine(media5200_platform) {
265 .name = "media5200-platform",
266 .probe = media5200_probe,
267 .setup_arch = media5200_setup_arch,
268 .init = mpc52xx_declare_of_platform_devices,
269 .init_IRQ = media5200_init_irq,
270 .get_irq = mpc52xx_get_irq,
271 .restart = mpc52xx_restart,
272 .calibrate_decr = generic_calibrate_decr,
273};
diff --git a/arch/powerpc/platforms/52xx/mpc5200_simple.c b/arch/powerpc/platforms/52xx/mpc5200_simple.c
index a3bda0b9f1ff..c31e5b534f0a 100644
--- a/arch/powerpc/platforms/52xx/mpc5200_simple.c
+++ b/arch/powerpc/platforms/52xx/mpc5200_simple.c
@@ -50,8 +50,10 @@ static void __init mpc5200_simple_setup_arch(void)
50 50
51/* list of the supported boards */ 51/* list of the supported boards */
52static char *board[] __initdata = { 52static char *board[] __initdata = {
53 "promess,motionpro", 53 "intercontrol,digsy-mtc",
54 "phytec,pcm030", 54 "phytec,pcm030",
55 "phytec,pcm032",
56 "promess,motionpro",
55 "schindler,cm5200", 57 "schindler,cm5200",
56 "tqc,tqm5200", 58 "tqc,tqm5200",
57 NULL 59 NULL
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_common.c b/arch/powerpc/platforms/52xx/mpc52xx_common.c
index 98367a0255f3..8e3dd5a0f228 100644
--- a/arch/powerpc/platforms/52xx/mpc52xx_common.c
+++ b/arch/powerpc/platforms/52xx/mpc52xx_common.c
@@ -28,9 +28,10 @@ static struct of_device_id mpc52xx_xlb_ids[] __initdata = {
28static struct of_device_id mpc52xx_bus_ids[] __initdata = { 28static struct of_device_id mpc52xx_bus_ids[] __initdata = {
29 { .compatible = "fsl,mpc5200-immr", }, 29 { .compatible = "fsl,mpc5200-immr", },
30 { .compatible = "fsl,mpc5200b-immr", }, 30 { .compatible = "fsl,mpc5200b-immr", },
31 { .compatible = "fsl,lpb", }, 31 { .compatible = "simple-bus", },
32 32
33 /* depreciated matches; shouldn't be used in new device trees */ 33 /* depreciated matches; shouldn't be used in new device trees */
34 { .compatible = "fsl,lpb", },
34 { .type = "builtin", .compatible = "mpc5200", }, /* efika */ 35 { .type = "builtin", .compatible = "mpc5200", }, /* efika */
35 { .type = "soc", .compatible = "mpc5200", }, /* lite5200 */ 36 { .type = "soc", .compatible = "mpc5200", }, /* lite5200 */
36 {} 37 {}
@@ -205,6 +206,43 @@ int mpc52xx_set_psc_clkdiv(int psc_id, int clkdiv)
205EXPORT_SYMBOL(mpc52xx_set_psc_clkdiv); 206EXPORT_SYMBOL(mpc52xx_set_psc_clkdiv);
206 207
207/** 208/**
209 * mpc52xx_get_xtal_freq - Get SYS_XTAL_IN frequency for a device
210 *
211 * @node: device node
212 *
213 * Returns the frequency of the external oscillator clock connected
214 * to the SYS_XTAL_IN pin, or 0 if it cannot be determined.
215 */
216unsigned int mpc52xx_get_xtal_freq(struct device_node *node)
217{
218 u32 val;
219 unsigned int freq;
220
221 if (!mpc52xx_cdm)
222 return 0;
223
224 freq = mpc52xx_find_ipb_freq(node);
225 if (!freq)
226 return 0;
227
228 if (in_8(&mpc52xx_cdm->ipb_clk_sel) & 0x1)
229 freq *= 2;
230
231 val = in_be32(&mpc52xx_cdm->rstcfg);
232 if (val & (1 << 5))
233 freq *= 8;
234 else
235 freq *= 4;
236 if (val & (1 << 6))
237 freq /= 12;
238 else
239 freq /= 16;
240
241 return freq;
242}
243EXPORT_SYMBOL(mpc52xx_get_xtal_freq);
244
245/**
208 * mpc52xx_restart: ppc_md->restart hook for mpc5200 using the watchdog timer 246 * mpc52xx_restart: ppc_md->restart hook for mpc5200 using the watchdog timer
209 */ 247 */
210void 248void
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_gpio.c b/arch/powerpc/platforms/52xx/mpc52xx_gpio.c
index 07f89ae46d04..2b8d8ef32e4e 100644
--- a/arch/powerpc/platforms/52xx/mpc52xx_gpio.c
+++ b/arch/powerpc/platforms/52xx/mpc52xx_gpio.c
@@ -354,88 +354,6 @@ static struct of_platform_driver mpc52xx_simple_gpiochip_driver = {
354 .remove = mpc52xx_gpiochip_remove, 354 .remove = mpc52xx_gpiochip_remove,
355}; 355};
356 356
357/*
358 * GPIO LIB API implementation for gpt GPIOs.
359 *
360 * Each gpt only has a single GPIO.
361 */
362static int mpc52xx_gpt_gpio_get(struct gpio_chip *gc, unsigned int gpio)
363{
364 struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc);
365 struct mpc52xx_gpt __iomem *regs = mm_gc->regs;
366
367 return (in_be32(&regs->status) & (1 << (31 - 23))) ? 1 : 0;
368}
369
370static void
371mpc52xx_gpt_gpio_set(struct gpio_chip *gc, unsigned int gpio, int val)
372{
373 struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc);
374 struct mpc52xx_gpt __iomem *regs = mm_gc->regs;
375
376 if (val)
377 out_be32(&regs->mode, 0x34);
378 else
379 out_be32(&regs->mode, 0x24);
380
381 pr_debug("%s: gpio: %d val: %d\n", __func__, gpio, val);
382}
383
384static int mpc52xx_gpt_gpio_dir_in(struct gpio_chip *gc, unsigned int gpio)
385{
386 struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc);
387 struct mpc52xx_gpt __iomem *regs = mm_gc->regs;
388
389 out_be32(&regs->mode, 0x04);
390
391 return 0;
392}
393
394static int
395mpc52xx_gpt_gpio_dir_out(struct gpio_chip *gc, unsigned int gpio, int val)
396{
397 mpc52xx_gpt_gpio_set(gc, gpio, val);
398 pr_debug("%s: gpio: %d val: %d\n", __func__, gpio, val);
399
400 return 0;
401}
402
403static int __devinit mpc52xx_gpt_gpiochip_probe(struct of_device *ofdev,
404 const struct of_device_id *match)
405{
406 struct of_mm_gpio_chip *mmchip;
407 struct of_gpio_chip *chip;
408
409 mmchip = kzalloc(sizeof(*mmchip), GFP_KERNEL);
410 if (!mmchip)
411 return -ENOMEM;
412
413 chip = &mmchip->of_gc;
414
415 chip->gpio_cells = 2;
416 chip->gc.ngpio = 1;
417 chip->gc.direction_input = mpc52xx_gpt_gpio_dir_in;
418 chip->gc.direction_output = mpc52xx_gpt_gpio_dir_out;
419 chip->gc.get = mpc52xx_gpt_gpio_get;
420 chip->gc.set = mpc52xx_gpt_gpio_set;
421
422 return of_mm_gpiochip_add(ofdev->node, mmchip);
423}
424
425static const struct of_device_id mpc52xx_gpt_gpiochip_match[] = {
426 {
427 .compatible = "fsl,mpc5200-gpt-gpio",
428 },
429 {}
430};
431
432static struct of_platform_driver mpc52xx_gpt_gpiochip_driver = {
433 .name = "gpio_gpt",
434 .match_table = mpc52xx_gpt_gpiochip_match,
435 .probe = mpc52xx_gpt_gpiochip_probe,
436 .remove = mpc52xx_gpiochip_remove,
437};
438
439static int __init mpc52xx_gpio_init(void) 357static int __init mpc52xx_gpio_init(void)
440{ 358{
441 if (of_register_platform_driver(&mpc52xx_wkup_gpiochip_driver)) 359 if (of_register_platform_driver(&mpc52xx_wkup_gpiochip_driver))
@@ -444,9 +362,6 @@ static int __init mpc52xx_gpio_init(void)
444 if (of_register_platform_driver(&mpc52xx_simple_gpiochip_driver)) 362 if (of_register_platform_driver(&mpc52xx_simple_gpiochip_driver))
445 printk(KERN_ERR "Unable to register simple GPIO driver\n"); 363 printk(KERN_ERR "Unable to register simple GPIO driver\n");
446 364
447 if (of_register_platform_driver(&mpc52xx_gpt_gpiochip_driver))
448 printk(KERN_ERR "Unable to register gpt GPIO driver\n");
449
450 return 0; 365 return 0;
451} 366}
452 367
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_gpt.c b/arch/powerpc/platforms/52xx/mpc52xx_gpt.c
new file mode 100644
index 000000000000..bfbcd418e690
--- /dev/null
+++ b/arch/powerpc/platforms/52xx/mpc52xx_gpt.c
@@ -0,0 +1,396 @@
1/*
2 * MPC5200 General Purpose Timer device driver
3 *
4 * Copyright (c) 2009 Secret Lab Technologies Ltd.
5 * Copyright (c) 2008 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 *
12 * This file is a driver for the the General Purpose Timer (gpt) devices
13 * found on the MPC5200 SoC. Each timer has an IO pin which can be used
14 * for GPIO or can be used to raise interrupts. The timer function can
15 * be used independently from the IO pin, or it can be used to control
16 * output signals or measure input signals.
17 *
18 * This driver supports the GPIO and IRQ controller functions of the GPT
19 * device. Timer functions are not yet supported, nor is the watchdog
20 * timer.
21 *
22 * To use the GPIO function, the following two properties must be added
23 * to the device tree node for the gpt device (typically in the .dts file
24 * for the board):
25 * gpio-controller;
26 * #gpio-cells = < 2 >;
27 * This driver will register the GPIO pin if it finds the gpio-controller
28 * property in the device tree.
29 *
30 * To use the IRQ controller function, the following two properties must
31 * be added to the device tree node for the gpt device:
32 * interrupt-controller;
33 * #interrupt-cells = < 1 >;
34 * The IRQ controller binding only uses one cell to specify the interrupt,
35 * and the IRQ flags are encoded in the cell. A cell is not used to encode
36 * the IRQ number because the GPT only has a single IRQ source. For flags,
37 * a value of '1' means rising edge sensitive and '2' means falling edge.
38 *
39 * The GPIO and the IRQ controller functions can be used at the same time,
40 * but in this use case the IO line will only work as an input. Trying to
41 * use it as a GPIO output will not work.
42 *
43 * When using the GPIO line as an output, it can either be driven as normal
44 * IO, or it can be an Open Collector (OC) output. At the moment it is the
45 * responsibility of either the bootloader or the platform setup code to set
46 * the output mode. This driver does not change the output mode setting.
47 */
48
49#include <linux/irq.h>
50#include <linux/interrupt.h>
51#include <linux/io.h>
52#include <linux/of.h>
53#include <linux/of_platform.h>
54#include <linux/of_gpio.h>
55#include <linux/kernel.h>
56#include <asm/mpc52xx.h>
57
58MODULE_DESCRIPTION("Freescale MPC52xx gpt driver");
59MODULE_AUTHOR("Sascha Hauer, Grant Likely");
60MODULE_LICENSE("GPL");
61
62/**
63 * struct mpc52xx_gpt - Private data structure for MPC52xx GPT driver
64 * @dev: pointer to device structure
65 * @regs: virtual address of GPT registers
66 * @lock: spinlock to coordinate between different functions.
67 * @of_gc: of_gpio_chip instance structure; used when GPIO is enabled
68 * @irqhost: Pointer to irq_host instance; used when IRQ mode is supported
69 */
70struct mpc52xx_gpt_priv {
71 struct device *dev;
72 struct mpc52xx_gpt __iomem *regs;
73 spinlock_t lock;
74 struct irq_host *irqhost;
75
76#if defined(CONFIG_GPIOLIB)
77 struct of_gpio_chip of_gc;
78#endif
79};
80
81#define MPC52xx_GPT_MODE_MS_MASK (0x07)
82#define MPC52xx_GPT_MODE_MS_IC (0x01)
83#define MPC52xx_GPT_MODE_MS_OC (0x02)
84#define MPC52xx_GPT_MODE_MS_PWM (0x03)
85#define MPC52xx_GPT_MODE_MS_GPIO (0x04)
86
87#define MPC52xx_GPT_MODE_GPIO_MASK (0x30)
88#define MPC52xx_GPT_MODE_GPIO_OUT_LOW (0x20)
89#define MPC52xx_GPT_MODE_GPIO_OUT_HIGH (0x30)
90
91#define MPC52xx_GPT_MODE_IRQ_EN (0x0100)
92
93#define MPC52xx_GPT_MODE_ICT_MASK (0x030000)
94#define MPC52xx_GPT_MODE_ICT_RISING (0x010000)
95#define MPC52xx_GPT_MODE_ICT_FALLING (0x020000)
96#define MPC52xx_GPT_MODE_ICT_TOGGLE (0x030000)
97
98#define MPC52xx_GPT_STATUS_IRQMASK (0x000f)
99
100/* ---------------------------------------------------------------------
101 * Cascaded interrupt controller hooks
102 */
103
104static void mpc52xx_gpt_irq_unmask(unsigned int virq)
105{
106 struct mpc52xx_gpt_priv *gpt = get_irq_chip_data(virq);
107 unsigned long flags;
108
109 spin_lock_irqsave(&gpt->lock, flags);
110 setbits32(&gpt->regs->mode, MPC52xx_GPT_MODE_IRQ_EN);
111 spin_unlock_irqrestore(&gpt->lock, flags);
112}
113
114static void mpc52xx_gpt_irq_mask(unsigned int virq)
115{
116 struct mpc52xx_gpt_priv *gpt = get_irq_chip_data(virq);
117 unsigned long flags;
118
119 spin_lock_irqsave(&gpt->lock, flags);
120 clrbits32(&gpt->regs->mode, MPC52xx_GPT_MODE_IRQ_EN);
121 spin_unlock_irqrestore(&gpt->lock, flags);
122}
123
124static void mpc52xx_gpt_irq_ack(unsigned int virq)
125{
126 struct mpc52xx_gpt_priv *gpt = get_irq_chip_data(virq);
127
128 out_be32(&gpt->regs->status, MPC52xx_GPT_STATUS_IRQMASK);
129}
130
131static int mpc52xx_gpt_irq_set_type(unsigned int virq, unsigned int flow_type)
132{
133 struct mpc52xx_gpt_priv *gpt = get_irq_chip_data(virq);
134 unsigned long flags;
135 u32 reg;
136
137 dev_dbg(gpt->dev, "%s: virq=%i type=%x\n", __func__, virq, flow_type);
138
139 spin_lock_irqsave(&gpt->lock, flags);
140 reg = in_be32(&gpt->regs->mode) & ~MPC52xx_GPT_MODE_ICT_MASK;
141 if (flow_type & IRQF_TRIGGER_RISING)
142 reg |= MPC52xx_GPT_MODE_ICT_RISING;
143 if (flow_type & IRQF_TRIGGER_FALLING)
144 reg |= MPC52xx_GPT_MODE_ICT_FALLING;
145 out_be32(&gpt->regs->mode, reg);
146 spin_unlock_irqrestore(&gpt->lock, flags);
147
148 return 0;
149}
150
151static struct irq_chip mpc52xx_gpt_irq_chip = {
152 .typename = "MPC52xx GPT",
153 .unmask = mpc52xx_gpt_irq_unmask,
154 .mask = mpc52xx_gpt_irq_mask,
155 .ack = mpc52xx_gpt_irq_ack,
156 .set_type = mpc52xx_gpt_irq_set_type,
157};
158
159void mpc52xx_gpt_irq_cascade(unsigned int virq, struct irq_desc *desc)
160{
161 struct mpc52xx_gpt_priv *gpt = get_irq_data(virq);
162 int sub_virq;
163 u32 status;
164
165 status = in_be32(&gpt->regs->status) & MPC52xx_GPT_STATUS_IRQMASK;
166 if (status) {
167 sub_virq = irq_linear_revmap(gpt->irqhost, 0);
168 generic_handle_irq(sub_virq);
169 }
170}
171
172static int mpc52xx_gpt_irq_map(struct irq_host *h, unsigned int virq,
173 irq_hw_number_t hw)
174{
175 struct mpc52xx_gpt_priv *gpt = h->host_data;
176
177 dev_dbg(gpt->dev, "%s: h=%p, virq=%i\n", __func__, h, virq);
178 set_irq_chip_data(virq, gpt);
179 set_irq_chip_and_handler(virq, &mpc52xx_gpt_irq_chip, handle_edge_irq);
180
181 return 0;
182}
183
184static int mpc52xx_gpt_irq_xlate(struct irq_host *h, struct device_node *ct,
185 u32 *intspec, unsigned int intsize,
186 irq_hw_number_t *out_hwirq,
187 unsigned int *out_flags)
188{
189 struct mpc52xx_gpt_priv *gpt = h->host_data;
190
191 dev_dbg(gpt->dev, "%s: flags=%i\n", __func__, intspec[0]);
192
193 if ((intsize < 1) || (intspec[0] < 1) || (intspec[0] > 3)) {
194 dev_err(gpt->dev, "bad irq specifier in %s\n", ct->full_name);
195 return -EINVAL;
196 }
197
198 *out_hwirq = 0; /* The GPT only has 1 IRQ line */
199 *out_flags = intspec[0];
200
201 return 0;
202}
203
204static struct irq_host_ops mpc52xx_gpt_irq_ops = {
205 .map = mpc52xx_gpt_irq_map,
206 .xlate = mpc52xx_gpt_irq_xlate,
207};
208
209static void
210mpc52xx_gpt_irq_setup(struct mpc52xx_gpt_priv *gpt, struct device_node *node)
211{
212 int cascade_virq;
213 unsigned long flags;
214
215 /* Only setup cascaded IRQ if device tree claims the GPT is
216 * an interrupt controller */
217 if (!of_find_property(node, "interrupt-controller", NULL))
218 return;
219
220 cascade_virq = irq_of_parse_and_map(node, 0);
221
222 gpt->irqhost = irq_alloc_host(node, IRQ_HOST_MAP_LINEAR, 1,
223 &mpc52xx_gpt_irq_ops, -1);
224 if (!gpt->irqhost) {
225 dev_err(gpt->dev, "irq_alloc_host() failed\n");
226 return;
227 }
228
229 gpt->irqhost->host_data = gpt;
230
231 set_irq_data(cascade_virq, gpt);
232 set_irq_chained_handler(cascade_virq, mpc52xx_gpt_irq_cascade);
233
234 /* Set to Input Capture mode */
235 spin_lock_irqsave(&gpt->lock, flags);
236 clrsetbits_be32(&gpt->regs->mode, MPC52xx_GPT_MODE_MS_MASK,
237 MPC52xx_GPT_MODE_MS_IC);
238 spin_unlock_irqrestore(&gpt->lock, flags);
239
240 dev_dbg(gpt->dev, "%s() complete. virq=%i\n", __func__, cascade_virq);
241}
242
243
244/* ---------------------------------------------------------------------
245 * GPIOLIB hooks
246 */
247#if defined(CONFIG_GPIOLIB)
248static inline struct mpc52xx_gpt_priv *gc_to_mpc52xx_gpt(struct gpio_chip *gc)
249{
250 return container_of(to_of_gpio_chip(gc), struct mpc52xx_gpt_priv,of_gc);
251}
252
253static int mpc52xx_gpt_gpio_get(struct gpio_chip *gc, unsigned int gpio)
254{
255 struct mpc52xx_gpt_priv *gpt = gc_to_mpc52xx_gpt(gc);
256
257 return (in_be32(&gpt->regs->status) >> 8) & 1;
258}
259
260static void
261mpc52xx_gpt_gpio_set(struct gpio_chip *gc, unsigned int gpio, int v)
262{
263 struct mpc52xx_gpt_priv *gpt = gc_to_mpc52xx_gpt(gc);
264 unsigned long flags;
265 u32 r;
266
267 dev_dbg(gpt->dev, "%s: gpio:%d v:%d\n", __func__, gpio, v);
268 r = v ? MPC52xx_GPT_MODE_GPIO_OUT_HIGH : MPC52xx_GPT_MODE_GPIO_OUT_LOW;
269
270 spin_lock_irqsave(&gpt->lock, flags);
271 clrsetbits_be32(&gpt->regs->mode, MPC52xx_GPT_MODE_GPIO_MASK, r);
272 spin_unlock_irqrestore(&gpt->lock, flags);
273}
274
275static int mpc52xx_gpt_gpio_dir_in(struct gpio_chip *gc, unsigned int gpio)
276{
277 struct mpc52xx_gpt_priv *gpt = gc_to_mpc52xx_gpt(gc);
278 unsigned long flags;
279
280 dev_dbg(gpt->dev, "%s: gpio:%d\n", __func__, gpio);
281
282 spin_lock_irqsave(&gpt->lock, flags);
283 clrbits32(&gpt->regs->mode, MPC52xx_GPT_MODE_GPIO_MASK);
284 spin_unlock_irqrestore(&gpt->lock, flags);
285
286 return 0;
287}
288
289static int
290mpc52xx_gpt_gpio_dir_out(struct gpio_chip *gc, unsigned int gpio, int val)
291{
292 mpc52xx_gpt_gpio_set(gc, gpio, val);
293 return 0;
294}
295
296static void
297mpc52xx_gpt_gpio_setup(struct mpc52xx_gpt_priv *gpt, struct device_node *node)
298{
299 int rc;
300
301 /* Only setup GPIO if the device tree claims the GPT is
302 * a GPIO controller */
303 if (!of_find_property(node, "gpio-controller", NULL))
304 return;
305
306 gpt->of_gc.gc.label = kstrdup(node->full_name, GFP_KERNEL);
307 if (!gpt->of_gc.gc.label) {
308 dev_err(gpt->dev, "out of memory\n");
309 return;
310 }
311
312 gpt->of_gc.gpio_cells = 2;
313 gpt->of_gc.gc.ngpio = 1;
314 gpt->of_gc.gc.direction_input = mpc52xx_gpt_gpio_dir_in;
315 gpt->of_gc.gc.direction_output = mpc52xx_gpt_gpio_dir_out;
316 gpt->of_gc.gc.get = mpc52xx_gpt_gpio_get;
317 gpt->of_gc.gc.set = mpc52xx_gpt_gpio_set;
318 gpt->of_gc.gc.base = -1;
319 gpt->of_gc.xlate = of_gpio_simple_xlate;
320 node->data = &gpt->of_gc;
321 of_node_get(node);
322
323 /* Setup external pin in GPIO mode */
324 clrsetbits_be32(&gpt->regs->mode, MPC52xx_GPT_MODE_MS_MASK,
325 MPC52xx_GPT_MODE_MS_GPIO);
326
327 rc = gpiochip_add(&gpt->of_gc.gc);
328 if (rc)
329 dev_err(gpt->dev, "gpiochip_add() failed; rc=%i\n", rc);
330
331 dev_dbg(gpt->dev, "%s() complete.\n", __func__);
332}
333#else /* defined(CONFIG_GPIOLIB) */
334static void
335mpc52xx_gpt_gpio_setup(struct mpc52xx_gpt_priv *p, struct device_node *np) { }
336#endif /* defined(CONFIG_GPIOLIB) */
337
338/* ---------------------------------------------------------------------
339 * of_platform bus binding code
340 */
341static int __devinit mpc52xx_gpt_probe(struct of_device *ofdev,
342 const struct of_device_id *match)
343{
344 struct mpc52xx_gpt_priv *gpt;
345
346 gpt = kzalloc(sizeof *gpt, GFP_KERNEL);
347 if (!gpt)
348 return -ENOMEM;
349
350 spin_lock_init(&gpt->lock);
351 gpt->dev = &ofdev->dev;
352 gpt->regs = of_iomap(ofdev->node, 0);
353 if (!gpt->regs) {
354 kfree(gpt);
355 return -ENOMEM;
356 }
357
358 dev_set_drvdata(&ofdev->dev, gpt);
359
360 mpc52xx_gpt_gpio_setup(gpt, ofdev->node);
361 mpc52xx_gpt_irq_setup(gpt, ofdev->node);
362
363 return 0;
364}
365
366static int mpc52xx_gpt_remove(struct of_device *ofdev)
367{
368 return -EBUSY;
369}
370
371static const struct of_device_id mpc52xx_gpt_match[] = {
372 { .compatible = "fsl,mpc5200-gpt", },
373
374 /* Depreciated compatible values; don't use for new dts files */
375 { .compatible = "fsl,mpc5200-gpt-gpio", },
376 { .compatible = "mpc5200-gpt", },
377 {}
378};
379
380static struct of_platform_driver mpc52xx_gpt_driver = {
381 .name = "mpc52xx-gpt",
382 .match_table = mpc52xx_gpt_match,
383 .probe = mpc52xx_gpt_probe,
384 .remove = mpc52xx_gpt_remove,
385};
386
387static int __init mpc52xx_gpt_init(void)
388{
389 if (of_register_platform_driver(&mpc52xx_gpt_driver))
390 pr_err("error registering MPC52xx GPT driver\n");
391
392 return 0;
393}
394
395/* Make sure GPIOs and IRQs get set up before anyone tries to use them */
396subsys_initcall(mpc52xx_gpt_init);
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_pic.c b/arch/powerpc/platforms/52xx/mpc52xx_pic.c
index 0a093f03c758..480f806fd0a9 100644
--- a/arch/powerpc/platforms/52xx/mpc52xx_pic.c
+++ b/arch/powerpc/platforms/52xx/mpc52xx_pic.c
@@ -163,8 +163,6 @@ static void mpc52xx_extirq_mask(unsigned int virq)
163 irq = irq_map[virq].hwirq; 163 irq = irq_map[virq].hwirq;
164 l2irq = irq & MPC52xx_IRQ_L2_MASK; 164 l2irq = irq & MPC52xx_IRQ_L2_MASK;
165 165
166 pr_debug("%s: irq=%x. l2=%d\n", __func__, irq, l2irq);
167
168 io_be_clrbit(&intr->ctrl, 11 - l2irq); 166 io_be_clrbit(&intr->ctrl, 11 - l2irq);
169} 167}
170 168
@@ -176,8 +174,6 @@ static void mpc52xx_extirq_unmask(unsigned int virq)
176 irq = irq_map[virq].hwirq; 174 irq = irq_map[virq].hwirq;
177 l2irq = irq & MPC52xx_IRQ_L2_MASK; 175 l2irq = irq & MPC52xx_IRQ_L2_MASK;
178 176
179 pr_debug("%s: irq=%x. l2=%d\n", __func__, irq, l2irq);
180
181 io_be_setbit(&intr->ctrl, 11 - l2irq); 177 io_be_setbit(&intr->ctrl, 11 - l2irq);
182} 178}
183 179
@@ -189,17 +185,15 @@ static void mpc52xx_extirq_ack(unsigned int virq)
189 irq = irq_map[virq].hwirq; 185 irq = irq_map[virq].hwirq;
190 l2irq = irq & MPC52xx_IRQ_L2_MASK; 186 l2irq = irq & MPC52xx_IRQ_L2_MASK;
191 187
192 pr_debug("%s: irq=%x. l2=%d\n", __func__, irq, l2irq);
193
194 io_be_setbit(&intr->ctrl, 27-l2irq); 188 io_be_setbit(&intr->ctrl, 27-l2irq);
195} 189}
196 190
197static int mpc52xx_extirq_set_type(unsigned int virq, unsigned int flow_type) 191static int mpc52xx_extirq_set_type(unsigned int virq, unsigned int flow_type)
198{ 192{
199 struct irq_desc *desc = get_irq_desc(virq);
200 u32 ctrl_reg, type; 193 u32 ctrl_reg, type;
201 int irq; 194 int irq;
202 int l2irq; 195 int l2irq;
196 void *handler = handle_level_irq;
203 197
204 irq = irq_map[virq].hwirq; 198 irq = irq_map[virq].hwirq;
205 l2irq = irq & MPC52xx_IRQ_L2_MASK; 199 l2irq = irq & MPC52xx_IRQ_L2_MASK;
@@ -207,32 +201,21 @@ static int mpc52xx_extirq_set_type(unsigned int virq, unsigned int flow_type)
207 pr_debug("%s: irq=%x. l2=%d flow_type=%d\n", __func__, irq, l2irq, flow_type); 201 pr_debug("%s: irq=%x. l2=%d flow_type=%d\n", __func__, irq, l2irq, flow_type);
208 202
209 switch (flow_type) { 203 switch (flow_type) {
210 case IRQF_TRIGGER_HIGH: 204 case IRQF_TRIGGER_HIGH: type = 0; break;
211 type = 0; 205 case IRQF_TRIGGER_RISING: type = 1; handler = handle_edge_irq; break;
212 break; 206 case IRQF_TRIGGER_FALLING: type = 2; handler = handle_edge_irq; break;
213 case IRQF_TRIGGER_RISING: 207 case IRQF_TRIGGER_LOW: type = 3; break;
214 type = 1;
215 break;
216 case IRQF_TRIGGER_FALLING:
217 type = 2;
218 break;
219 case IRQF_TRIGGER_LOW:
220 type = 3;
221 break;
222 default: 208 default:
223 type = 0; 209 type = 0;
224 } 210 }
225 211
226 desc->status &= ~(IRQ_TYPE_SENSE_MASK | IRQ_LEVEL);
227 desc->status |= flow_type & IRQ_TYPE_SENSE_MASK;
228 if (flow_type & (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW))
229 desc->status |= IRQ_LEVEL;
230
231 ctrl_reg = in_be32(&intr->ctrl); 212 ctrl_reg = in_be32(&intr->ctrl);
232 ctrl_reg &= ~(0x3 << (22 - (l2irq * 2))); 213 ctrl_reg &= ~(0x3 << (22 - (l2irq * 2)));
233 ctrl_reg |= (type << (22 - (l2irq * 2))); 214 ctrl_reg |= (type << (22 - (l2irq * 2)));
234 out_be32(&intr->ctrl, ctrl_reg); 215 out_be32(&intr->ctrl, ctrl_reg);
235 216
217 __set_irq_handler_unlocked(virq, handler);
218
236 return 0; 219 return 0;
237} 220}
238 221
@@ -247,6 +230,11 @@ static struct irq_chip mpc52xx_extirq_irqchip = {
247/* 230/*
248 * Main interrupt irq_chip 231 * Main interrupt irq_chip
249 */ 232 */
233static int mpc52xx_null_set_type(unsigned int virq, unsigned int flow_type)
234{
235 return 0; /* Do nothing so that the sense mask will get updated */
236}
237
250static void mpc52xx_main_mask(unsigned int virq) 238static void mpc52xx_main_mask(unsigned int virq)
251{ 239{
252 int irq; 240 int irq;
@@ -255,8 +243,6 @@ static void mpc52xx_main_mask(unsigned int virq)
255 irq = irq_map[virq].hwirq; 243 irq = irq_map[virq].hwirq;
256 l2irq = irq & MPC52xx_IRQ_L2_MASK; 244 l2irq = irq & MPC52xx_IRQ_L2_MASK;
257 245
258 pr_debug("%s: irq=%x. l2=%d\n", __func__, irq, l2irq);
259
260 io_be_setbit(&intr->main_mask, 16 - l2irq); 246 io_be_setbit(&intr->main_mask, 16 - l2irq);
261} 247}
262 248
@@ -268,8 +254,6 @@ static void mpc52xx_main_unmask(unsigned int virq)
268 irq = irq_map[virq].hwirq; 254 irq = irq_map[virq].hwirq;
269 l2irq = irq & MPC52xx_IRQ_L2_MASK; 255 l2irq = irq & MPC52xx_IRQ_L2_MASK;
270 256
271 pr_debug("%s: irq=%x. l2=%d\n", __func__, irq, l2irq);
272
273 io_be_clrbit(&intr->main_mask, 16 - l2irq); 257 io_be_clrbit(&intr->main_mask, 16 - l2irq);
274} 258}
275 259
@@ -278,6 +262,7 @@ static struct irq_chip mpc52xx_main_irqchip = {
278 .mask = mpc52xx_main_mask, 262 .mask = mpc52xx_main_mask,
279 .mask_ack = mpc52xx_main_mask, 263 .mask_ack = mpc52xx_main_mask,
280 .unmask = mpc52xx_main_unmask, 264 .unmask = mpc52xx_main_unmask,
265 .set_type = mpc52xx_null_set_type,
281}; 266};
282 267
283/* 268/*
@@ -291,8 +276,6 @@ static void mpc52xx_periph_mask(unsigned int virq)
291 irq = irq_map[virq].hwirq; 276 irq = irq_map[virq].hwirq;
292 l2irq = irq & MPC52xx_IRQ_L2_MASK; 277 l2irq = irq & MPC52xx_IRQ_L2_MASK;
293 278
294 pr_debug("%s: irq=%x. l2=%d\n", __func__, irq, l2irq);
295
296 io_be_setbit(&intr->per_mask, 31 - l2irq); 279 io_be_setbit(&intr->per_mask, 31 - l2irq);
297} 280}
298 281
@@ -304,8 +287,6 @@ static void mpc52xx_periph_unmask(unsigned int virq)
304 irq = irq_map[virq].hwirq; 287 irq = irq_map[virq].hwirq;
305 l2irq = irq & MPC52xx_IRQ_L2_MASK; 288 l2irq = irq & MPC52xx_IRQ_L2_MASK;
306 289
307 pr_debug("%s: irq=%x. l2=%d\n", __func__, irq, l2irq);
308
309 io_be_clrbit(&intr->per_mask, 31 - l2irq); 290 io_be_clrbit(&intr->per_mask, 31 - l2irq);
310} 291}
311 292
@@ -314,6 +295,7 @@ static struct irq_chip mpc52xx_periph_irqchip = {
314 .mask = mpc52xx_periph_mask, 295 .mask = mpc52xx_periph_mask,
315 .mask_ack = mpc52xx_periph_mask, 296 .mask_ack = mpc52xx_periph_mask,
316 .unmask = mpc52xx_periph_unmask, 297 .unmask = mpc52xx_periph_unmask,
298 .set_type = mpc52xx_null_set_type,
317}; 299};
318 300
319/* 301/*
@@ -327,8 +309,6 @@ static void mpc52xx_sdma_mask(unsigned int virq)
327 irq = irq_map[virq].hwirq; 309 irq = irq_map[virq].hwirq;
328 l2irq = irq & MPC52xx_IRQ_L2_MASK; 310 l2irq = irq & MPC52xx_IRQ_L2_MASK;
329 311
330 pr_debug("%s: irq=%x. l2=%d\n", __func__, irq, l2irq);
331
332 io_be_setbit(&sdma->IntMask, l2irq); 312 io_be_setbit(&sdma->IntMask, l2irq);
333} 313}
334 314
@@ -340,8 +320,6 @@ static void mpc52xx_sdma_unmask(unsigned int virq)
340 irq = irq_map[virq].hwirq; 320 irq = irq_map[virq].hwirq;
341 l2irq = irq & MPC52xx_IRQ_L2_MASK; 321 l2irq = irq & MPC52xx_IRQ_L2_MASK;
342 322
343 pr_debug("%s: irq=%x. l2=%d\n", __func__, irq, l2irq);
344
345 io_be_clrbit(&sdma->IntMask, l2irq); 323 io_be_clrbit(&sdma->IntMask, l2irq);
346} 324}
347 325
@@ -353,8 +331,6 @@ static void mpc52xx_sdma_ack(unsigned int virq)
353 irq = irq_map[virq].hwirq; 331 irq = irq_map[virq].hwirq;
354 l2irq = irq & MPC52xx_IRQ_L2_MASK; 332 l2irq = irq & MPC52xx_IRQ_L2_MASK;
355 333
356 pr_debug("%s: irq=%x. l2=%d\n", __func__, irq, l2irq);
357
358 out_be32(&sdma->IntPend, 1 << l2irq); 334 out_be32(&sdma->IntPend, 1 << l2irq);
359} 335}
360 336
@@ -363,9 +339,19 @@ static struct irq_chip mpc52xx_sdma_irqchip = {
363 .mask = mpc52xx_sdma_mask, 339 .mask = mpc52xx_sdma_mask,
364 .unmask = mpc52xx_sdma_unmask, 340 .unmask = mpc52xx_sdma_unmask,
365 .ack = mpc52xx_sdma_ack, 341 .ack = mpc52xx_sdma_ack,
342 .set_type = mpc52xx_null_set_type,
366}; 343};
367 344
368/** 345/**
346 * mpc52xx_is_extirq - Returns true if hwirq number is for an external IRQ
347 */
348static int mpc52xx_is_extirq(int l1, int l2)
349{
350 return ((l1 == 0) && (l2 == 0)) ||
351 ((l1 == 1) && (l2 >= 1) && (l2 <= 3));
352}
353
354/**
369 * mpc52xx_irqhost_xlate - translate virq# from device tree interrupts property 355 * mpc52xx_irqhost_xlate - translate virq# from device tree interrupts property
370 */ 356 */
371static int mpc52xx_irqhost_xlate(struct irq_host *h, struct device_node *ct, 357static int mpc52xx_irqhost_xlate(struct irq_host *h, struct device_node *ct,
@@ -383,38 +369,23 @@ static int mpc52xx_irqhost_xlate(struct irq_host *h, struct device_node *ct,
383 369
384 intrvect_l1 = (int)intspec[0]; 370 intrvect_l1 = (int)intspec[0];
385 intrvect_l2 = (int)intspec[1]; 371 intrvect_l2 = (int)intspec[1];
386 intrvect_type = (int)intspec[2]; 372 intrvect_type = (int)intspec[2] & 0x3;
387 373
388 intrvect_linux = (intrvect_l1 << MPC52xx_IRQ_L1_OFFSET) & 374 intrvect_linux = (intrvect_l1 << MPC52xx_IRQ_L1_OFFSET) &
389 MPC52xx_IRQ_L1_MASK; 375 MPC52xx_IRQ_L1_MASK;
390 intrvect_linux |= intrvect_l2 & MPC52xx_IRQ_L2_MASK; 376 intrvect_linux |= intrvect_l2 & MPC52xx_IRQ_L2_MASK;
391 377
392 pr_debug("return %x, l1=%d, l2=%d\n", intrvect_linux, intrvect_l1,
393 intrvect_l2);
394
395 *out_hwirq = intrvect_linux; 378 *out_hwirq = intrvect_linux;
396 *out_flags = mpc52xx_map_senses[intrvect_type]; 379 *out_flags = IRQ_TYPE_LEVEL_LOW;
380 if (mpc52xx_is_extirq(intrvect_l1, intrvect_l2))
381 *out_flags = mpc52xx_map_senses[intrvect_type];
397 382
383 pr_debug("return %x, l1=%d, l2=%d\n", intrvect_linux, intrvect_l1,
384 intrvect_l2);
398 return 0; 385 return 0;
399} 386}
400 387
401/** 388/**
402 * mpc52xx_irqx_gettype - determine the IRQ sense type (level/edge)
403 *
404 * Only external IRQs need this.
405 */
406static int mpc52xx_irqx_gettype(int irq)
407{
408 int type;
409 u32 ctrl_reg;
410
411 ctrl_reg = in_be32(&intr->ctrl);
412 type = (ctrl_reg >> (22 - irq * 2)) & 0x3;
413
414 return mpc52xx_map_senses[type];
415}
416
417/**
418 * mpc52xx_irqhost_map - Hook to map from virq to an irq_chip structure 389 * mpc52xx_irqhost_map - Hook to map from virq to an irq_chip structure
419 */ 390 */
420static int mpc52xx_irqhost_map(struct irq_host *h, unsigned int virq, 391static int mpc52xx_irqhost_map(struct irq_host *h, unsigned int virq,
@@ -422,68 +393,46 @@ static int mpc52xx_irqhost_map(struct irq_host *h, unsigned int virq,
422{ 393{
423 int l1irq; 394 int l1irq;
424 int l2irq; 395 int l2irq;
425 struct irq_chip *good_irqchip; 396 struct irq_chip *irqchip;
426 void *good_handle; 397 void *hndlr;
427 int type; 398 int type;
399 u32 reg;
428 400
429 l1irq = (irq & MPC52xx_IRQ_L1_MASK) >> MPC52xx_IRQ_L1_OFFSET; 401 l1irq = (irq & MPC52xx_IRQ_L1_MASK) >> MPC52xx_IRQ_L1_OFFSET;
430 l2irq = irq & MPC52xx_IRQ_L2_MASK; 402 l2irq = irq & MPC52xx_IRQ_L2_MASK;
431 403
432 /* 404 /*
433 * Most of ours IRQs will be level low 405 * External IRQs are handled differently by the hardware so they are
434 * Only external IRQs on some platform may be others 406 * handled by a dedicated irq_chip structure.
435 */ 407 */
436 type = IRQ_TYPE_LEVEL_LOW; 408 if (mpc52xx_is_extirq(l1irq, l2irq)) {
409 reg = in_be32(&intr->ctrl);
410 type = mpc52xx_map_senses[(reg >> (22 - l2irq * 2)) & 0x3];
411 if ((type == IRQ_TYPE_EDGE_FALLING) ||
412 (type == IRQ_TYPE_EDGE_RISING))
413 hndlr = handle_edge_irq;
414 else
415 hndlr = handle_level_irq;
416
417 set_irq_chip_and_handler(virq, &mpc52xx_extirq_irqchip, hndlr);
418 pr_debug("%s: External IRQ%i virq=%x, hw=%x. type=%x\n",
419 __func__, l2irq, virq, (int)irq, type);
420 return 0;
421 }
437 422
423 /* It is an internal SOC irq. Choose the correct irq_chip */
438 switch (l1irq) { 424 switch (l1irq) {
439 case MPC52xx_IRQ_L1_CRIT: 425 case MPC52xx_IRQ_L1_MAIN: irqchip = &mpc52xx_main_irqchip; break;
440 pr_debug("%s: Critical. l2=%x\n", __func__, l2irq); 426 case MPC52xx_IRQ_L1_PERP: irqchip = &mpc52xx_periph_irqchip; break;
441 427 case MPC52xx_IRQ_L1_SDMA: irqchip = &mpc52xx_sdma_irqchip; break;
442 BUG_ON(l2irq != 0);
443
444 type = mpc52xx_irqx_gettype(l2irq);
445 good_irqchip = &mpc52xx_extirq_irqchip;
446 break;
447
448 case MPC52xx_IRQ_L1_MAIN:
449 pr_debug("%s: Main IRQ[1-3] l2=%x\n", __func__, l2irq);
450
451 if ((l2irq >= 1) && (l2irq <= 3)) {
452 type = mpc52xx_irqx_gettype(l2irq);
453 good_irqchip = &mpc52xx_extirq_irqchip;
454 } else {
455 good_irqchip = &mpc52xx_main_irqchip;
456 }
457 break;
458
459 case MPC52xx_IRQ_L1_PERP:
460 pr_debug("%s: Peripherals. l2=%x\n", __func__, l2irq);
461 good_irqchip = &mpc52xx_periph_irqchip;
462 break;
463
464 case MPC52xx_IRQ_L1_SDMA:
465 pr_debug("%s: SDMA. l2=%x\n", __func__, l2irq);
466 good_irqchip = &mpc52xx_sdma_irqchip;
467 break;
468
469 default: 428 default:
470 pr_err("%s: invalid virq requested (0x%x)\n", __func__, virq); 429 pr_err("%s: invalid irq: virq=%i, l1=%i, l2=%i\n",
430 __func__, virq, l1irq, l2irq);
471 return -EINVAL; 431 return -EINVAL;
472 } 432 }
473 433
474 switch (type) { 434 set_irq_chip_and_handler(virq, irqchip, handle_level_irq);
475 case IRQ_TYPE_EDGE_FALLING: 435 pr_debug("%s: virq=%x, l1=%i, l2=%i\n", __func__, virq, l1irq, l2irq);
476 case IRQ_TYPE_EDGE_RISING:
477 good_handle = handle_edge_irq;
478 break;
479 default:
480 good_handle = handle_level_irq;
481 }
482
483 set_irq_chip_and_handler(virq, good_irqchip, good_handle);
484
485 pr_debug("%s: virq=%x, hw=%x. type=%x\n", __func__, virq,
486 (int)irq, type);
487 436
488 return 0; 437 return 0;
489} 438}
@@ -522,6 +471,8 @@ void __init mpc52xx_init_irq(void)
522 panic(__FILE__ ": find_and_map failed on 'mpc5200-bestcomm'. " 471 panic(__FILE__ ": find_and_map failed on 'mpc5200-bestcomm'. "
523 "Check node !"); 472 "Check node !");
524 473
474 pr_debug("MPC5200 IRQ controller mapped to 0x%p\n", intr);
475
525 /* Disable all interrupt sources. */ 476 /* Disable all interrupt sources. */
526 out_be32(&sdma->IntPend, 0xffffffff); /* 1 means clear pending */ 477 out_be32(&sdma->IntPend, 0xffffffff); /* 1 means clear pending */
527 out_be32(&sdma->IntMask, 0xffffffff); /* 1 means disabled */ 478 out_be32(&sdma->IntMask, 0xffffffff); /* 1 means disabled */
@@ -613,8 +564,5 @@ unsigned int mpc52xx_get_irq(void)
613 } 564 }
614 } 565 }
615 566
616 pr_debug("%s: irq=%x. virq=%d\n", __func__, irq,
617 irq_linear_revmap(mpc52xx_irqhost, irq));
618
619 return irq_linear_revmap(mpc52xx_irqhost, irq); 567 return irq_linear_revmap(mpc52xx_irqhost, irq);
620} 568}
diff --git a/arch/powerpc/platforms/82xx/Kconfig b/arch/powerpc/platforms/82xx/Kconfig
index 30f008b2f92e..7c7df4003820 100644
--- a/arch/powerpc/platforms/82xx/Kconfig
+++ b/arch/powerpc/platforms/82xx/Kconfig
@@ -1,6 +1,6 @@
1menuconfig PPC_82xx 1menuconfig PPC_82xx
2 bool "82xx-based boards (PQ II)" 2 bool "82xx-based boards (PQ II)"
3 depends on 6xx && PPC_MULTIPLATFORM 3 depends on 6xx
4 4
5if PPC_82xx 5if PPC_82xx
6 6
diff --git a/arch/powerpc/platforms/83xx/Kconfig b/arch/powerpc/platforms/83xx/Kconfig
index 83c664afc897..437d29a59d72 100644
--- a/arch/powerpc/platforms/83xx/Kconfig
+++ b/arch/powerpc/platforms/83xx/Kconfig
@@ -1,6 +1,6 @@
1menuconfig PPC_83xx 1menuconfig PPC_83xx
2 bool "83xx-based boards" 2 bool "83xx-based boards"
3 depends on 6xx && PPC_MULTIPLATFORM 3 depends on 6xx
4 select PPC_UDBG_16550 4 select PPC_UDBG_16550
5 select PPC_PCI_CHOICE 5 select PPC_PCI_CHOICE
6 select FSL_PCI if PCI 6 select FSL_PCI if PCI
diff --git a/arch/powerpc/platforms/83xx/asp834x.c b/arch/powerpc/platforms/83xx/asp834x.c
index bb30d67ad0a2..aa0d84d22585 100644
--- a/arch/powerpc/platforms/83xx/asp834x.c
+++ b/arch/powerpc/platforms/83xx/asp834x.c
@@ -58,6 +58,7 @@ static struct __initdata of_device_id asp8347_ids[] = {
58 { .type = "soc", }, 58 { .type = "soc", },
59 { .compatible = "soc", }, 59 { .compatible = "soc", },
60 { .compatible = "simple-bus", }, 60 { .compatible = "simple-bus", },
61 { .compatible = "gianfar", },
61 {}, 62 {},
62}; 63};
63 64
diff --git a/arch/powerpc/platforms/83xx/mpc831x_rdb.c b/arch/powerpc/platforms/83xx/mpc831x_rdb.c
index 91a2c80b9d72..0b4f883b20eb 100644
--- a/arch/powerpc/platforms/83xx/mpc831x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc831x_rdb.c
@@ -38,6 +38,8 @@ static void __init mpc831x_rdb_setup_arch(void)
38#ifdef CONFIG_PCI 38#ifdef CONFIG_PCI
39 for_each_compatible_node(np, "pci", "fsl,mpc8349-pci") 39 for_each_compatible_node(np, "pci", "fsl,mpc8349-pci")
40 mpc83xx_add_bridge(np); 40 mpc83xx_add_bridge(np);
41 for_each_compatible_node(np, "pci", "fsl,mpc8314-pcie")
42 mpc83xx_add_bridge(np);
41#endif 43#endif
42 mpc831x_usb_cfg(); 44 mpc831x_usb_cfg();
43} 45}
diff --git a/arch/powerpc/platforms/83xx/mpc834x_itx.c b/arch/powerpc/platforms/83xx/mpc834x_itx.c
index 76092d37c7d9..81e44fa1c644 100644
--- a/arch/powerpc/platforms/83xx/mpc834x_itx.c
+++ b/arch/powerpc/platforms/83xx/mpc834x_itx.c
@@ -42,6 +42,7 @@
42static struct of_device_id __initdata mpc834x_itx_ids[] = { 42static struct of_device_id __initdata mpc834x_itx_ids[] = {
43 { .compatible = "fsl,pq2pro-localbus", }, 43 { .compatible = "fsl,pq2pro-localbus", },
44 { .compatible = "simple-bus", }, 44 { .compatible = "simple-bus", },
45 { .compatible = "gianfar", },
45 {}, 46 {},
46}; 47};
47 48
diff --git a/arch/powerpc/platforms/83xx/mpc834x_mds.c b/arch/powerpc/platforms/83xx/mpc834x_mds.c
index fc3f2ed1f3e9..d0a634b056ca 100644
--- a/arch/powerpc/platforms/83xx/mpc834x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc834x_mds.c
@@ -112,6 +112,7 @@ static struct of_device_id mpc834x_ids[] = {
112 { .type = "soc", }, 112 { .type = "soc", },
113 { .compatible = "soc", }, 113 { .compatible = "soc", },
114 { .compatible = "simple-bus", }, 114 { .compatible = "simple-bus", },
115 { .compatible = "gianfar", },
115 {}, 116 {},
116}; 117};
117 118
diff --git a/arch/powerpc/platforms/83xx/mpc837x_mds.c b/arch/powerpc/platforms/83xx/mpc837x_mds.c
index 530ef990ca7c..51df7e754698 100644
--- a/arch/powerpc/platforms/83xx/mpc837x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc837x_mds.c
@@ -84,14 +84,10 @@ static void __init mpc837x_mds_setup_arch(void)
84 ppc_md.progress("mpc837x_mds_setup_arch()", 0); 84 ppc_md.progress("mpc837x_mds_setup_arch()", 0);
85 85
86#ifdef CONFIG_PCI 86#ifdef CONFIG_PCI
87 for_each_compatible_node(np, "pci", "fsl,mpc8349-pci") { 87 for_each_compatible_node(np, "pci", "fsl,mpc8349-pci")
88 if (!of_device_is_available(np)) { 88 mpc83xx_add_bridge(np);
89 pr_warning("%s: disabled by the firmware.\n", 89 for_each_compatible_node(np, "pci", "fsl,mpc8314-pcie")
90 np->full_name);
91 continue;
92 }
93 mpc83xx_add_bridge(np); 90 mpc83xx_add_bridge(np);
94 }
95#endif 91#endif
96 mpc837xmds_usb_cfg(); 92 mpc837xmds_usb_cfg();
97} 93}
@@ -100,6 +96,7 @@ static struct of_device_id mpc837x_ids[] = {
100 { .type = "soc", }, 96 { .type = "soc", },
101 { .compatible = "soc", }, 97 { .compatible = "soc", },
102 { .compatible = "simple-bus", }, 98 { .compatible = "simple-bus", },
99 { .compatible = "gianfar", },
103 {}, 100 {},
104}; 101};
105 102
diff --git a/arch/powerpc/platforms/83xx/mpc837x_rdb.c b/arch/powerpc/platforms/83xx/mpc837x_rdb.c
index 1d096545322b..76f3b32a155e 100644
--- a/arch/powerpc/platforms/83xx/mpc837x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc837x_rdb.c
@@ -38,6 +38,8 @@ static void __init mpc837x_rdb_setup_arch(void)
38#ifdef CONFIG_PCI 38#ifdef CONFIG_PCI
39 for_each_compatible_node(np, "pci", "fsl,mpc8349-pci") 39 for_each_compatible_node(np, "pci", "fsl,mpc8349-pci")
40 mpc83xx_add_bridge(np); 40 mpc83xx_add_bridge(np);
41 for_each_compatible_node(np, "pci", "fsl,mpc8314-pcie")
42 mpc83xx_add_bridge(np);
41#endif 43#endif
42 mpc837x_usb_cfg(); 44 mpc837x_usb_cfg();
43} 45}
@@ -46,6 +48,7 @@ static struct of_device_id mpc837x_ids[] = {
46 { .type = "soc", }, 48 { .type = "soc", },
47 { .compatible = "soc", }, 49 { .compatible = "soc", },
48 { .compatible = "simple-bus", }, 50 { .compatible = "simple-bus", },
51 { .compatible = "gianfar", },
49 {}, 52 {},
50}; 53};
51 54
diff --git a/arch/powerpc/platforms/83xx/sbc834x.c b/arch/powerpc/platforms/83xx/sbc834x.c
index 156c4e218009..49023dbe1576 100644
--- a/arch/powerpc/platforms/83xx/sbc834x.c
+++ b/arch/powerpc/platforms/83xx/sbc834x.c
@@ -84,6 +84,7 @@ static struct __initdata of_device_id sbc834x_ids[] = {
84 { .type = "soc", }, 84 { .type = "soc", },
85 { .compatible = "soc", }, 85 { .compatible = "soc", },
86 { .compatible = "simple-bus", }, 86 { .compatible = "simple-bus", },
87 { .compatible = "gianfar", },
87 {}, 88 {},
88}; 89};
89 90
diff --git a/arch/powerpc/platforms/83xx/usb.c b/arch/powerpc/platforms/83xx/usb.c
index cc99c280aad9..11e1fac17c7f 100644
--- a/arch/powerpc/platforms/83xx/usb.c
+++ b/arch/powerpc/platforms/83xx/usb.c
@@ -14,6 +14,7 @@
14#include <linux/stddef.h> 14#include <linux/stddef.h>
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/errno.h> 16#include <linux/errno.h>
17#include <linux/of.h>
17 18
18#include <asm/io.h> 19#include <asm/io.h>
19#include <asm/prom.h> 20#include <asm/prom.h>
@@ -210,7 +211,7 @@ int mpc837x_usb_cfg(void)
210 int ret = 0; 211 int ret = 0;
211 212
212 np = of_find_compatible_node(NULL, NULL, "fsl-usb2-dr"); 213 np = of_find_compatible_node(NULL, NULL, "fsl-usb2-dr");
213 if (!np) 214 if (!np || !of_device_is_available(np))
214 return -ENODEV; 215 return -ENODEV;
215 prop = of_get_property(np, "phy_type", NULL); 216 prop = of_get_property(np, "phy_type", NULL);
216 217
diff --git a/arch/powerpc/platforms/85xx/Kconfig b/arch/powerpc/platforms/85xx/Kconfig
index b79dc710ed34..7f066adc068c 100644
--- a/arch/powerpc/platforms/85xx/Kconfig
+++ b/arch/powerpc/platforms/85xx/Kconfig
@@ -51,6 +51,12 @@ config MPC85xx_DS
51 help 51 help
52 This option enables support for the MPC85xx DS (MPC8544 DS) board 52 This option enables support for the MPC85xx DS (MPC8544 DS) board
53 53
54config SOCRATES
55 bool "Socrates"
56 select DEFAULT_UIMAGE
57 help
58 This option enables support for the Socrates board.
59
54config KSI8560 60config KSI8560
55 bool "Emerson KSI8560" 61 bool "Emerson KSI8560"
56 select DEFAULT_UIMAGE 62 select DEFAULT_UIMAGE
diff --git a/arch/powerpc/platforms/85xx/Makefile b/arch/powerpc/platforms/85xx/Makefile
index f0798c09980f..a857b35b9828 100644
--- a/arch/powerpc/platforms/85xx/Makefile
+++ b/arch/powerpc/platforms/85xx/Makefile
@@ -13,4 +13,5 @@ obj-$(CONFIG_STX_GP3) += stx_gp3.o
13obj-$(CONFIG_TQM85xx) += tqm85xx.o 13obj-$(CONFIG_TQM85xx) += tqm85xx.o
14obj-$(CONFIG_SBC8560) += sbc8560.o 14obj-$(CONFIG_SBC8560) += sbc8560.o
15obj-$(CONFIG_SBC8548) += sbc8548.o 15obj-$(CONFIG_SBC8548) += sbc8548.o
16obj-$(CONFIG_SOCRATES) += socrates.o socrates_fpga_pic.o
16obj-$(CONFIG_KSI8560) += ksi8560.o 17obj-$(CONFIG_KSI8560) += ksi8560.o
diff --git a/arch/powerpc/platforms/85xx/ksi8560.c b/arch/powerpc/platforms/85xx/ksi8560.c
index 81cee7bbf2d2..f4d36b5a2e00 100644
--- a/arch/powerpc/platforms/85xx/ksi8560.c
+++ b/arch/powerpc/platforms/85xx/ksi8560.c
@@ -106,8 +106,6 @@ static void __init ksi8560_pic_init(void)
106 cpm2_pic_init(np); 106 cpm2_pic_init(np);
107 of_node_put(np); 107 of_node_put(np);
108 set_irq_chained_handler(irq, cpm2_cascade); 108 set_irq_chained_handler(irq, cpm2_cascade);
109
110 setup_irq(0, NULL);
111#endif 109#endif
112} 110}
113 111
@@ -221,6 +219,7 @@ static struct of_device_id __initdata of_bus_ids[] = {
221 { .type = "simple-bus", }, 219 { .type = "simple-bus", },
222 { .name = "cpm", }, 220 { .name = "cpm", },
223 { .name = "localbus", }, 221 { .name = "localbus", },
222 { .compatible = "gianfar", },
224 {}, 223 {},
225}; 224};
226 225
diff --git a/arch/powerpc/platforms/85xx/mpc8536_ds.c b/arch/powerpc/platforms/85xx/mpc8536_ds.c
index 1bf5aefdfeb1..63efca20d7bd 100644
--- a/arch/powerpc/platforms/85xx/mpc8536_ds.c
+++ b/arch/powerpc/platforms/85xx/mpc8536_ds.c
@@ -92,6 +92,7 @@ static struct of_device_id __initdata mpc8536_ds_ids[] = {
92 { .type = "soc", }, 92 { .type = "soc", },
93 { .compatible = "soc", }, 93 { .compatible = "soc", },
94 { .compatible = "simple-bus", }, 94 { .compatible = "simple-bus", },
95 { .compatible = "gianfar", },
95 {}, 96 {},
96}; 97};
97 98
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ads.c b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
index 21f009023e26..9438a892afc4 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_ads.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
@@ -226,6 +226,7 @@ static struct of_device_id __initdata of_bus_ids[] = {
226 { .name = "cpm", }, 226 { .name = "cpm", },
227 { .name = "localbus", }, 227 { .name = "localbus", },
228 { .compatible = "simple-bus", }, 228 { .compatible = "simple-bus", },
229 { .compatible = "gianfar", },
229 {}, 230 {},
230}; 231};
231 232
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_cds.c b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
index aeb6a5bc5522..458d91fba91d 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_cds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
@@ -179,7 +179,6 @@ static irqreturn_t mpc85xx_8259_cascade_action(int irq, void *dev_id)
179static struct irqaction mpc85xxcds_8259_irqaction = { 179static struct irqaction mpc85xxcds_8259_irqaction = {
180 .handler = mpc85xx_8259_cascade_action, 180 .handler = mpc85xx_8259_cascade_action,
181 .flags = IRQF_SHARED, 181 .flags = IRQF_SHARED,
182 .mask = CPU_MASK_NONE,
183 .name = "8259 cascade", 182 .name = "8259 cascade",
184}; 183};
185#endif /* PPC_I8259 */ 184#endif /* PPC_I8259 */
@@ -336,6 +335,7 @@ static struct of_device_id __initdata of_bus_ids[] = {
336 { .type = "soc", }, 335 { .type = "soc", },
337 { .compatible = "soc", }, 336 { .compatible = "soc", },
338 { .compatible = "simple-bus", }, 337 { .compatible = "simple-bus", },
338 { .compatible = "gianfar", },
339 {}, 339 {},
340}; 340};
341 341
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ds.c b/arch/powerpc/platforms/85xx/mpc85xx_ds.c
index 7326d904202c..de66de7a9ca2 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_ds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_ds.c
@@ -204,6 +204,7 @@ static struct of_device_id __initdata mpc85xxds_ids[] = {
204 { .type = "soc", }, 204 { .type = "soc", },
205 { .compatible = "soc", }, 205 { .compatible = "soc", },
206 { .compatible = "simple-bus", }, 206 { .compatible = "simple-bus", },
207 { .compatible = "gianfar", },
207 {}, 208 {},
208}; 209};
209 210
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
index 658a36fab3ab..7dd029034aec 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
@@ -265,6 +265,7 @@ static struct of_device_id mpc85xx_ids[] = {
265 { .compatible = "simple-bus", }, 265 { .compatible = "simple-bus", },
266 { .type = "qe", }, 266 { .type = "qe", },
267 { .compatible = "fsl,qe", }, 267 { .compatible = "fsl,qe", },
268 { .compatible = "gianfar", },
268 {}, 269 {},
269}; 270};
270 271
diff --git a/arch/powerpc/platforms/85xx/sbc8548.c b/arch/powerpc/platforms/85xx/sbc8548.c
index 7ec77ce12dad..ecdd8c09e4ed 100644
--- a/arch/powerpc/platforms/85xx/sbc8548.c
+++ b/arch/powerpc/platforms/85xx/sbc8548.c
@@ -154,6 +154,7 @@ static struct of_device_id __initdata of_bus_ids[] = {
154 { .name = "soc", }, 154 { .name = "soc", },
155 { .type = "soc", }, 155 { .type = "soc", },
156 { .compatible = "simple-bus", }, 156 { .compatible = "simple-bus", },
157 { .compatible = "gianfar", },
157 {}, 158 {},
158}; 159};
159 160
diff --git a/arch/powerpc/platforms/85xx/sbc8560.c b/arch/powerpc/platforms/85xx/sbc8560.c
index 472f254a19d2..cc27807a8b64 100644
--- a/arch/powerpc/platforms/85xx/sbc8560.c
+++ b/arch/powerpc/platforms/85xx/sbc8560.c
@@ -213,6 +213,7 @@ static struct of_device_id __initdata of_bus_ids[] = {
213 { .name = "cpm", }, 213 { .name = "cpm", },
214 { .name = "localbus", }, 214 { .name = "localbus", },
215 { .compatible = "simple-bus", }, 215 { .compatible = "simple-bus", },
216 { .compatible = "gianfar", },
216 {}, 217 {},
217}; 218};
218 219
diff --git a/arch/powerpc/platforms/85xx/smp.c b/arch/powerpc/platforms/85xx/smp.c
index 79a0df17078b..cc0b0db8a6f3 100644
--- a/arch/powerpc/platforms/85xx/smp.c
+++ b/arch/powerpc/platforms/85xx/smp.c
@@ -21,6 +21,7 @@
21#include <asm/page.h> 21#include <asm/page.h>
22#include <asm/mpic.h> 22#include <asm/mpic.h>
23#include <asm/cacheflush.h> 23#include <asm/cacheflush.h>
24#include <asm/dbell.h>
24 25
25#include <sysdev/fsl_soc.h> 26#include <sysdev/fsl_soc.h>
26 27
@@ -80,10 +81,8 @@ smp_85xx_kick_cpu(int nr)
80} 81}
81 82
82static void __init 83static void __init
83smp_85xx_setup_cpu(int cpu_nr) 84smp_85xx_basic_setup(int cpu_nr)
84{ 85{
85 mpic_setup_this_cpu();
86
87 /* Clear any pending timer interrupts */ 86 /* Clear any pending timer interrupts */
88 mtspr(SPRN_TSR, TSR_ENW | TSR_WIS | TSR_DIS | TSR_FIS); 87 mtspr(SPRN_TSR, TSR_ENW | TSR_WIS | TSR_DIS | TSR_FIS);
89 88
@@ -91,15 +90,43 @@ smp_85xx_setup_cpu(int cpu_nr)
91 mtspr(SPRN_TCR, TCR_DIE); 90 mtspr(SPRN_TCR, TCR_DIE);
92} 91}
93 92
93static void __init
94smp_85xx_setup_cpu(int cpu_nr)
95{
96 mpic_setup_this_cpu();
97
98 smp_85xx_basic_setup(cpu_nr);
99}
100
94struct smp_ops_t smp_85xx_ops = { 101struct smp_ops_t smp_85xx_ops = {
95 .message_pass = smp_mpic_message_pass,
96 .probe = smp_mpic_probe,
97 .kick_cpu = smp_85xx_kick_cpu, 102 .kick_cpu = smp_85xx_kick_cpu,
98 .setup_cpu = smp_85xx_setup_cpu,
99}; 103};
100 104
101void __init 105static int __init smp_dummy_probe(void)
102mpc85xx_smp_init(void)
103{ 106{
107 return NR_CPUS;
108}
109
110void __init mpc85xx_smp_init(void)
111{
112 struct device_node *np;
113
114 smp_85xx_ops.message_pass = NULL;
115
116 np = of_find_node_by_type(NULL, "open-pic");
117 if (np) {
118 smp_85xx_ops.probe = smp_mpic_probe;
119 smp_85xx_ops.setup_cpu = smp_85xx_setup_cpu;
120 smp_85xx_ops.message_pass = smp_mpic_message_pass;
121 } else {
122 smp_85xx_ops.probe = smp_dummy_probe;
123 smp_85xx_ops.setup_cpu = smp_85xx_basic_setup;
124 }
125
126 if (cpu_has_feature(CPU_FTR_DBELL))
127 smp_85xx_ops.message_pass = smp_dbell_message_pass;
128
129 BUG_ON(!smp_85xx_ops.message_pass);
130
104 smp_ops = &smp_85xx_ops; 131 smp_ops = &smp_85xx_ops;
105} 132}
diff --git a/arch/powerpc/platforms/85xx/socrates.c b/arch/powerpc/platforms/85xx/socrates.c
new file mode 100644
index 000000000000..d0e8443b12c6
--- /dev/null
+++ b/arch/powerpc/platforms/85xx/socrates.c
@@ -0,0 +1,133 @@
1/*
2 * Copyright (c) 2008 Emcraft Systems
3 * Sergei Poselenov <sposelenov@emcraft.com>
4 *
5 * Based on MPC8560 ADS and arch/ppc tqm85xx ports
6 *
7 * Maintained by Kumar Gala (see MAINTAINERS for contact information)
8 *
9 * Copyright 2008 Freescale Semiconductor Inc.
10 *
11 * Copyright (c) 2005-2006 DENX Software Engineering
12 * Stefan Roese <sr@denx.de>
13 *
14 * Based on original work by
15 * Kumar Gala <kumar.gala@freescale.com>
16 * Copyright 2004 Freescale Semiconductor Inc.
17 *
18 * This program is free software; you can redistribute it and/or modify it
19 * under the terms of the GNU General Public License as published by the
20 * Free Software Foundation; either version 2 of the License, or (at your
21 * option) any later version.
22 */
23
24#include <linux/stddef.h>
25#include <linux/kernel.h>
26#include <linux/pci.h>
27#include <linux/kdev_t.h>
28#include <linux/delay.h>
29#include <linux/seq_file.h>
30#include <linux/of_platform.h>
31
32#include <asm/system.h>
33#include <asm/time.h>
34#include <asm/machdep.h>
35#include <asm/pci-bridge.h>
36#include <asm/mpic.h>
37#include <asm/prom.h>
38#include <mm/mmu_decl.h>
39#include <asm/udbg.h>
40
41#include <sysdev/fsl_soc.h>
42#include <sysdev/fsl_pci.h>
43
44#include "socrates_fpga_pic.h"
45
46static void __init socrates_pic_init(void)
47{
48 struct mpic *mpic;
49 struct resource r;
50 struct device_node *np;
51
52 np = of_find_node_by_type(NULL, "open-pic");
53 if (!np) {
54 printk(KERN_ERR "Could not find open-pic node\n");
55 return;
56 }
57
58 if (of_address_to_resource(np, 0, &r)) {
59 printk(KERN_ERR "Could not map mpic register space\n");
60 of_node_put(np);
61 return;
62 }
63
64 mpic = mpic_alloc(np, r.start,
65 MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
66 0, 256, " OpenPIC ");
67 BUG_ON(mpic == NULL);
68 of_node_put(np);
69
70 mpic_init(mpic);
71
72 np = of_find_compatible_node(NULL, NULL, "abb,socrates-fpga-pic");
73 if (!np) {
74 printk(KERN_ERR "Could not find socrates-fpga-pic node\n");
75 return;
76 }
77 socrates_fpga_pic_init(np);
78 of_node_put(np);
79}
80
81/*
82 * Setup the architecture
83 */
84static void __init socrates_setup_arch(void)
85{
86#ifdef CONFIG_PCI
87 struct device_node *np;
88#endif
89
90 if (ppc_md.progress)
91 ppc_md.progress("socrates_setup_arch()", 0);
92
93#ifdef CONFIG_PCI
94 for_each_compatible_node(np, "pci", "fsl,mpc8540-pci")
95 fsl_add_bridge(np, 1);
96#endif
97}
98
99static struct of_device_id __initdata socrates_of_bus_ids[] = {
100 { .compatible = "simple-bus", },
101 { .compatible = "gianfar", },
102 {},
103};
104
105static void __init socrates_init(void)
106{
107 of_platform_bus_probe(NULL, socrates_of_bus_ids, NULL);
108}
109
110/*
111 * Called very early, device-tree isn't unflattened
112 */
113static int __init socrates_probe(void)
114{
115 unsigned long root = of_get_flat_dt_root();
116
117 if (of_flat_dt_is_compatible(root, "abb,socrates"))
118 return 1;
119
120 return 0;
121}
122
123define_machine(socrates) {
124 .name = "Socrates",
125 .probe = socrates_probe,
126 .setup_arch = socrates_setup_arch,
127 .init = socrates_init,
128 .init_IRQ = socrates_pic_init,
129 .get_irq = mpic_get_irq,
130 .restart = fsl_rstcr_restart,
131 .calibrate_decr = generic_calibrate_decr,
132 .progress = udbg_progress,
133};
diff --git a/arch/powerpc/platforms/85xx/socrates_fpga_pic.c b/arch/powerpc/platforms/85xx/socrates_fpga_pic.c
new file mode 100644
index 000000000000..60edf63d0157
--- /dev/null
+++ b/arch/powerpc/platforms/85xx/socrates_fpga_pic.c
@@ -0,0 +1,327 @@
1/*
2 * Copyright (C) 2008 Ilya Yanok, Emcraft Systems
3 *
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 */
10
11#include <linux/irq.h>
12#include <linux/of_platform.h>
13#include <linux/io.h>
14
15/*
16 * The FPGA supports 9 interrupt sources, which can be routed to 3
17 * interrupt request lines of the MPIC. The line to be used can be
18 * specified through the third cell of FDT property "interrupts".
19 */
20
21#define SOCRATES_FPGA_NUM_IRQS 9
22
23#define FPGA_PIC_IRQCFG (0x0)
24#define FPGA_PIC_IRQMASK(n) (0x4 + 0x4 * (n))
25
26#define SOCRATES_FPGA_IRQ_MASK ((1 << SOCRATES_FPGA_NUM_IRQS) - 1)
27
28struct socrates_fpga_irq_info {
29 unsigned int irq_line;
30 int type;
31};
32
33/*
34 * Interrupt routing and type table
35 *
36 * IRQ_TYPE_NONE means the interrupt type is configurable,
37 * otherwise it's fixed to the specified value.
38 */
39static struct socrates_fpga_irq_info fpga_irqs[SOCRATES_FPGA_NUM_IRQS] = {
40 [0] = {0, IRQ_TYPE_NONE},
41 [1] = {0, IRQ_TYPE_LEVEL_HIGH},
42 [2] = {0, IRQ_TYPE_LEVEL_LOW},
43 [3] = {0, IRQ_TYPE_NONE},
44 [4] = {0, IRQ_TYPE_NONE},
45 [5] = {0, IRQ_TYPE_NONE},
46 [6] = {0, IRQ_TYPE_NONE},
47 [7] = {0, IRQ_TYPE_NONE},
48 [8] = {0, IRQ_TYPE_LEVEL_HIGH},
49};
50
51#define socrates_fpga_irq_to_hw(virq) ((unsigned int)irq_map[virq].hwirq)
52
53static DEFINE_SPINLOCK(socrates_fpga_pic_lock);
54
55static void __iomem *socrates_fpga_pic_iobase;
56static struct irq_host *socrates_fpga_pic_irq_host;
57static unsigned int socrates_fpga_irqs[3];
58
59static inline uint32_t socrates_fpga_pic_read(int reg)
60{
61 return in_be32(socrates_fpga_pic_iobase + reg);
62}
63
64static inline void socrates_fpga_pic_write(int reg, uint32_t val)
65{
66 out_be32(socrates_fpga_pic_iobase + reg, val);
67}
68
69static inline unsigned int socrates_fpga_pic_get_irq(unsigned int irq)
70{
71 uint32_t cause;
72 unsigned long flags;
73 int i;
74
75 /* Check irq line routed to the MPIC */
76 for (i = 0; i < 3; i++) {
77 if (irq == socrates_fpga_irqs[i])
78 break;
79 }
80 if (i == 3)
81 return NO_IRQ;
82
83 spin_lock_irqsave(&socrates_fpga_pic_lock, flags);
84 cause = socrates_fpga_pic_read(FPGA_PIC_IRQMASK(i));
85 spin_unlock_irqrestore(&socrates_fpga_pic_lock, flags);
86 for (i = SOCRATES_FPGA_NUM_IRQS - 1; i >= 0; i--) {
87 if (cause >> (i + 16))
88 break;
89 }
90 return irq_linear_revmap(socrates_fpga_pic_irq_host,
91 (irq_hw_number_t)i);
92}
93
94void socrates_fpga_pic_cascade(unsigned int irq, struct irq_desc *desc)
95{
96 unsigned int cascade_irq;
97
98 /*
99 * See if we actually have an interrupt, call generic handling code if
100 * we do.
101 */
102 cascade_irq = socrates_fpga_pic_get_irq(irq);
103
104 if (cascade_irq != NO_IRQ)
105 generic_handle_irq(cascade_irq);
106 desc->chip->eoi(irq);
107
108}
109
110static void socrates_fpga_pic_ack(unsigned int virq)
111{
112 unsigned long flags;
113 unsigned int hwirq, irq_line;
114 uint32_t mask;
115
116 hwirq = socrates_fpga_irq_to_hw(virq);
117
118 irq_line = fpga_irqs[hwirq].irq_line;
119 spin_lock_irqsave(&socrates_fpga_pic_lock, flags);
120 mask = socrates_fpga_pic_read(FPGA_PIC_IRQMASK(irq_line))
121 & SOCRATES_FPGA_IRQ_MASK;
122 mask |= (1 << (hwirq + 16));
123 socrates_fpga_pic_write(FPGA_PIC_IRQMASK(irq_line), mask);
124 spin_unlock_irqrestore(&socrates_fpga_pic_lock, flags);
125}
126
127static void socrates_fpga_pic_mask(unsigned int virq)
128{
129 unsigned long flags;
130 unsigned int hwirq;
131 int irq_line;
132 u32 mask;
133
134 hwirq = socrates_fpga_irq_to_hw(virq);
135
136 irq_line = fpga_irqs[hwirq].irq_line;
137 spin_lock_irqsave(&socrates_fpga_pic_lock, flags);
138 mask = socrates_fpga_pic_read(FPGA_PIC_IRQMASK(irq_line))
139 & SOCRATES_FPGA_IRQ_MASK;
140 mask &= ~(1 << hwirq);
141 socrates_fpga_pic_write(FPGA_PIC_IRQMASK(irq_line), mask);
142 spin_unlock_irqrestore(&socrates_fpga_pic_lock, flags);
143}
144
145static void socrates_fpga_pic_mask_ack(unsigned int virq)
146{
147 unsigned long flags;
148 unsigned int hwirq;
149 int irq_line;
150 u32 mask;
151
152 hwirq = socrates_fpga_irq_to_hw(virq);
153
154 irq_line = fpga_irqs[hwirq].irq_line;
155 spin_lock_irqsave(&socrates_fpga_pic_lock, flags);
156 mask = socrates_fpga_pic_read(FPGA_PIC_IRQMASK(irq_line))
157 & SOCRATES_FPGA_IRQ_MASK;
158 mask &= ~(1 << hwirq);
159 mask |= (1 << (hwirq + 16));
160 socrates_fpga_pic_write(FPGA_PIC_IRQMASK(irq_line), mask);
161 spin_unlock_irqrestore(&socrates_fpga_pic_lock, flags);
162}
163
164static void socrates_fpga_pic_unmask(unsigned int virq)
165{
166 unsigned long flags;
167 unsigned int hwirq;
168 int irq_line;
169 u32 mask;
170
171 hwirq = socrates_fpga_irq_to_hw(virq);
172
173 irq_line = fpga_irqs[hwirq].irq_line;
174 spin_lock_irqsave(&socrates_fpga_pic_lock, flags);
175 mask = socrates_fpga_pic_read(FPGA_PIC_IRQMASK(irq_line))
176 & SOCRATES_FPGA_IRQ_MASK;
177 mask |= (1 << hwirq);
178 socrates_fpga_pic_write(FPGA_PIC_IRQMASK(irq_line), mask);
179 spin_unlock_irqrestore(&socrates_fpga_pic_lock, flags);
180}
181
182static void socrates_fpga_pic_eoi(unsigned int virq)
183{
184 unsigned long flags;
185 unsigned int hwirq;
186 int irq_line;
187 u32 mask;
188
189 hwirq = socrates_fpga_irq_to_hw(virq);
190
191 irq_line = fpga_irqs[hwirq].irq_line;
192 spin_lock_irqsave(&socrates_fpga_pic_lock, flags);
193 mask = socrates_fpga_pic_read(FPGA_PIC_IRQMASK(irq_line))
194 & SOCRATES_FPGA_IRQ_MASK;
195 mask |= (1 << (hwirq + 16));
196 socrates_fpga_pic_write(FPGA_PIC_IRQMASK(irq_line), mask);
197 spin_unlock_irqrestore(&socrates_fpga_pic_lock, flags);
198}
199
200static int socrates_fpga_pic_set_type(unsigned int virq,
201 unsigned int flow_type)
202{
203 unsigned long flags;
204 unsigned int hwirq;
205 int polarity;
206 u32 mask;
207
208 hwirq = socrates_fpga_irq_to_hw(virq);
209
210 if (fpga_irqs[hwirq].type != IRQ_TYPE_NONE)
211 return -EINVAL;
212
213 switch (flow_type & IRQ_TYPE_SENSE_MASK) {
214 case IRQ_TYPE_LEVEL_HIGH:
215 polarity = 1;
216 break;
217 case IRQ_TYPE_LEVEL_LOW:
218 polarity = 0;
219 break;
220 default:
221 return -EINVAL;
222 }
223 spin_lock_irqsave(&socrates_fpga_pic_lock, flags);
224 mask = socrates_fpga_pic_read(FPGA_PIC_IRQCFG);
225 if (polarity)
226 mask |= (1 << hwirq);
227 else
228 mask &= ~(1 << hwirq);
229 socrates_fpga_pic_write(FPGA_PIC_IRQCFG, mask);
230 spin_unlock_irqrestore(&socrates_fpga_pic_lock, flags);
231 return 0;
232}
233
234static struct irq_chip socrates_fpga_pic_chip = {
235 .typename = " FPGA-PIC ",
236 .ack = socrates_fpga_pic_ack,
237 .mask = socrates_fpga_pic_mask,
238 .mask_ack = socrates_fpga_pic_mask_ack,
239 .unmask = socrates_fpga_pic_unmask,
240 .eoi = socrates_fpga_pic_eoi,
241 .set_type = socrates_fpga_pic_set_type,
242};
243
244static int socrates_fpga_pic_host_map(struct irq_host *h, unsigned int virq,
245 irq_hw_number_t hwirq)
246{
247 /* All interrupts are LEVEL sensitive */
248 get_irq_desc(virq)->status |= IRQ_LEVEL;
249 set_irq_chip_and_handler(virq, &socrates_fpga_pic_chip,
250 handle_fasteoi_irq);
251
252 return 0;
253}
254
255static int socrates_fpga_pic_host_xlate(struct irq_host *h,
256 struct device_node *ct, u32 *intspec, unsigned int intsize,
257 irq_hw_number_t *out_hwirq, unsigned int *out_flags)
258{
259 struct socrates_fpga_irq_info *fpga_irq = &fpga_irqs[intspec[0]];
260
261 *out_hwirq = intspec[0];
262 if (fpga_irq->type == IRQ_TYPE_NONE) {
263 /* type is configurable */
264 if (intspec[1] != IRQ_TYPE_LEVEL_LOW &&
265 intspec[1] != IRQ_TYPE_LEVEL_HIGH) {
266 pr_warning("FPGA PIC: invalid irq type, "
267 "setting default active low\n");
268 *out_flags = IRQ_TYPE_LEVEL_LOW;
269 } else {
270 *out_flags = intspec[1];
271 }
272 } else {
273 /* type is fixed */
274 *out_flags = fpga_irq->type;
275 }
276
277 /* Use specified interrupt routing */
278 if (intspec[2] <= 2)
279 fpga_irq->irq_line = intspec[2];
280 else
281 pr_warning("FPGA PIC: invalid irq routing\n");
282
283 return 0;
284}
285
286static struct irq_host_ops socrates_fpga_pic_host_ops = {
287 .map = socrates_fpga_pic_host_map,
288 .xlate = socrates_fpga_pic_host_xlate,
289};
290
291void socrates_fpga_pic_init(struct device_node *pic)
292{
293 unsigned long flags;
294 int i;
295
296 /* Setup an irq_host structure */
297 socrates_fpga_pic_irq_host = irq_alloc_host(pic, IRQ_HOST_MAP_LINEAR,
298 SOCRATES_FPGA_NUM_IRQS, &socrates_fpga_pic_host_ops,
299 SOCRATES_FPGA_NUM_IRQS);
300 if (socrates_fpga_pic_irq_host == NULL) {
301 pr_err("FPGA PIC: Unable to allocate host\n");
302 return;
303 }
304
305 for (i = 0; i < 3; i++) {
306 socrates_fpga_irqs[i] = irq_of_parse_and_map(pic, i);
307 if (socrates_fpga_irqs[i] == NO_IRQ) {
308 pr_warning("FPGA PIC: can't get irq%d.\n", i);
309 continue;
310 }
311 set_irq_chained_handler(socrates_fpga_irqs[i],
312 socrates_fpga_pic_cascade);
313 }
314
315 socrates_fpga_pic_iobase = of_iomap(pic, 0);
316
317 spin_lock_irqsave(&socrates_fpga_pic_lock, flags);
318 socrates_fpga_pic_write(FPGA_PIC_IRQMASK(0),
319 SOCRATES_FPGA_IRQ_MASK << 16);
320 socrates_fpga_pic_write(FPGA_PIC_IRQMASK(1),
321 SOCRATES_FPGA_IRQ_MASK << 16);
322 socrates_fpga_pic_write(FPGA_PIC_IRQMASK(2),
323 SOCRATES_FPGA_IRQ_MASK << 16);
324 spin_unlock_irqrestore(&socrates_fpga_pic_lock, flags);
325
326 pr_info("FPGA PIC: Setting up Socrates FPGA PIC\n");
327}
diff --git a/arch/powerpc/platforms/85xx/socrates_fpga_pic.h b/arch/powerpc/platforms/85xx/socrates_fpga_pic.h
new file mode 100644
index 000000000000..21d7d8e42199
--- /dev/null
+++ b/arch/powerpc/platforms/85xx/socrates_fpga_pic.h
@@ -0,0 +1,16 @@
1/*
2 * Copyright (C) 2008 Ilya Yanok, Emcraft Systems
3 *
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 */
10
11#ifndef SOCRATES_FPGA_PIC_H
12#define SOCRATES_FPGA_PIC_H
13
14void socrates_fpga_pic_init(struct device_node *pic);
15
16#endif
diff --git a/arch/powerpc/platforms/85xx/stx_gp3.c b/arch/powerpc/platforms/85xx/stx_gp3.c
index 0cca8f5cb272..f559918f3c6f 100644
--- a/arch/powerpc/platforms/85xx/stx_gp3.c
+++ b/arch/powerpc/platforms/85xx/stx_gp3.c
@@ -145,6 +145,7 @@ static void stx_gp3_show_cpuinfo(struct seq_file *m)
145 145
146static struct of_device_id __initdata of_bus_ids[] = { 146static struct of_device_id __initdata of_bus_ids[] = {
147 { .compatible = "simple-bus", }, 147 { .compatible = "simple-bus", },
148 { .compatible = "gianfar", },
148 {}, 149 {},
149}; 150};
150 151
diff --git a/arch/powerpc/platforms/85xx/tqm85xx.c b/arch/powerpc/platforms/85xx/tqm85xx.c
index 2933a8e827d9..5b0ab9966e90 100644
--- a/arch/powerpc/platforms/85xx/tqm85xx.c
+++ b/arch/powerpc/platforms/85xx/tqm85xx.c
@@ -153,6 +153,7 @@ static void tqm85xx_show_cpuinfo(struct seq_file *m)
153 153
154static struct of_device_id __initdata of_bus_ids[] = { 154static struct of_device_id __initdata of_bus_ids[] = {
155 { .compatible = "simple-bus", }, 155 { .compatible = "simple-bus", },
156 { .compatible = "gianfar", },
156 {}, 157 {},
157}; 158};
158 159
diff --git a/arch/powerpc/platforms/86xx/Kconfig b/arch/powerpc/platforms/86xx/Kconfig
index 8e5693935975..fdaf4ddaa955 100644
--- a/arch/powerpc/platforms/86xx/Kconfig
+++ b/arch/powerpc/platforms/86xx/Kconfig
@@ -1,7 +1,7 @@
1config PPC_86xx 1config PPC_86xx
2menuconfig PPC_86xx 2menuconfig PPC_86xx
3 bool "86xx-based boards" 3 bool "86xx-based boards"
4 depends on 6xx && PPC_MULTIPLATFORM 4 depends on 6xx
5 select FSL_SOC 5 select FSL_SOC
6 select ALTIVEC 6 select ALTIVEC
7 help 7 help
@@ -31,6 +31,22 @@ config MPC8610_HPCD
31 help 31 help
32 This option enables support for the MPC8610 HPCD board. 32 This option enables support for the MPC8610 HPCD board.
33 33
34config GEF_PPC9A
35 bool "GE Fanuc PPC9A"
36 select DEFAULT_UIMAGE
37 select GENERIC_GPIO
38 select ARCH_REQUIRE_GPIOLIB
39 help
40 This option enables support for GE Fanuc's PPC9A.
41
42config GEF_SBC310
43 bool "GE Fanuc SBC310"
44 select DEFAULT_UIMAGE
45 select GENERIC_GPIO
46 select ARCH_REQUIRE_GPIOLIB
47 help
48 This option enables support for GE Fanuc's SBC310.
49
34config GEF_SBC610 50config GEF_SBC610
35 bool "GE Fanuc SBC610" 51 bool "GE Fanuc SBC610"
36 select DEFAULT_UIMAGE 52 select DEFAULT_UIMAGE
@@ -48,7 +64,7 @@ config MPC8641
48 select FSL_PCI if PCI 64 select FSL_PCI if PCI
49 select PPC_UDBG_16550 65 select PPC_UDBG_16550
50 select MPIC 66 select MPIC
51 default y if MPC8641_HPCN || SBC8641D || GEF_SBC610 67 default y if MPC8641_HPCN || SBC8641D || GEF_SBC610 || GEF_SBC310 || GEF_PPC9A
52 68
53config MPC8610 69config MPC8610
54 bool 70 bool
diff --git a/arch/powerpc/platforms/86xx/Makefile b/arch/powerpc/platforms/86xx/Makefile
index 31e540c2ebbc..4b0d7b1aa005 100644
--- a/arch/powerpc/platforms/86xx/Makefile
+++ b/arch/powerpc/platforms/86xx/Makefile
@@ -9,3 +9,5 @@ obj-$(CONFIG_SBC8641D) += sbc8641d.o
9obj-$(CONFIG_MPC8610_HPCD) += mpc8610_hpcd.o 9obj-$(CONFIG_MPC8610_HPCD) += mpc8610_hpcd.o
10gef-gpio-$(CONFIG_GPIOLIB) += gef_gpio.o 10gef-gpio-$(CONFIG_GPIOLIB) += gef_gpio.o
11obj-$(CONFIG_GEF_SBC610) += gef_sbc610.o gef_pic.o $(gef-gpio-y) 11obj-$(CONFIG_GEF_SBC610) += gef_sbc610.o gef_pic.o $(gef-gpio-y)
12obj-$(CONFIG_GEF_SBC310) += gef_sbc310.o gef_pic.o $(gef-gpio-y)
13obj-$(CONFIG_GEF_PPC9A) += gef_ppc9a.o gef_pic.o $(gef-gpio-y)
diff --git a/arch/powerpc/platforms/86xx/gef_gpio.c b/arch/powerpc/platforms/86xx/gef_gpio.c
index 85b2800f4cb7..b2ea8875adba 100644
--- a/arch/powerpc/platforms/86xx/gef_gpio.c
+++ b/arch/powerpc/platforms/86xx/gef_gpio.c
@@ -37,8 +37,6 @@
37#define GEF_GPIO_OVERRUN 0x1C 37#define GEF_GPIO_OVERRUN 0x1C
38#define GEF_GPIO_MODE 0x20 38#define GEF_GPIO_MODE 0x20
39 39
40#define NUM_GPIO 19
41
42static void _gef_gpio_set(void __iomem *reg, unsigned int offset, int value) 40static void _gef_gpio_set(void __iomem *reg, unsigned int offset, int value)
43{ 41{
44 unsigned int data; 42 unsigned int data;
@@ -103,10 +101,10 @@ static void gef_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
103static int __init gef_gpio_init(void) 101static int __init gef_gpio_init(void)
104{ 102{
105 struct device_node *np; 103 struct device_node *np;
104 int retval;
105 struct of_mm_gpio_chip *gef_gpio_chip;
106 106
107 for_each_compatible_node(np, NULL, "gef,sbc610-gpio") { 107 for_each_compatible_node(np, NULL, "gef,sbc610-gpio") {
108 int retval;
109 struct of_mm_gpio_chip *gef_gpio_chip;
110 108
111 pr_debug("%s: Initialising GEF GPIO\n", np->full_name); 109 pr_debug("%s: Initialising GEF GPIO\n", np->full_name);
112 110
@@ -120,7 +118,35 @@ static int __init gef_gpio_init(void)
120 118
121 /* Setup pointers to chip functions */ 119 /* Setup pointers to chip functions */
122 gef_gpio_chip->of_gc.gpio_cells = 2; 120 gef_gpio_chip->of_gc.gpio_cells = 2;
123 gef_gpio_chip->of_gc.gc.ngpio = NUM_GPIO; 121 gef_gpio_chip->of_gc.gc.ngpio = 19;
122 gef_gpio_chip->of_gc.gc.direction_input = gef_gpio_dir_in;
123 gef_gpio_chip->of_gc.gc.direction_output = gef_gpio_dir_out;
124 gef_gpio_chip->of_gc.gc.get = gef_gpio_get;
125 gef_gpio_chip->of_gc.gc.set = gef_gpio_set;
126
127 /* This function adds a memory mapped GPIO chip */
128 retval = of_mm_gpiochip_add(np, gef_gpio_chip);
129 if (retval) {
130 kfree(gef_gpio_chip);
131 pr_err("%s: Unable to add GPIO\n", np->full_name);
132 }
133 }
134
135 for_each_compatible_node(np, NULL, "gef,sbc310-gpio") {
136
137 pr_debug("%s: Initialising GEF GPIO\n", np->full_name);
138
139 /* Allocate chip structure */
140 gef_gpio_chip = kzalloc(sizeof(*gef_gpio_chip), GFP_KERNEL);
141 if (!gef_gpio_chip) {
142 pr_err("%s: Unable to allocate structure\n",
143 np->full_name);
144 continue;
145 }
146
147 /* Setup pointers to chip functions */
148 gef_gpio_chip->of_gc.gpio_cells = 2;
149 gef_gpio_chip->of_gc.gc.ngpio = 6;
124 gef_gpio_chip->of_gc.gc.direction_input = gef_gpio_dir_in; 150 gef_gpio_chip->of_gc.gc.direction_input = gef_gpio_dir_in;
125 gef_gpio_chip->of_gc.gc.direction_output = gef_gpio_dir_out; 151 gef_gpio_chip->of_gc.gc.direction_output = gef_gpio_dir_out;
126 gef_gpio_chip->of_gc.gc.get = gef_gpio_get; 152 gef_gpio_chip->of_gc.gc.get = gef_gpio_get;
diff --git a/arch/powerpc/platforms/86xx/gef_ppc9a.c b/arch/powerpc/platforms/86xx/gef_ppc9a.c
new file mode 100644
index 000000000000..d79104669cdc
--- /dev/null
+++ b/arch/powerpc/platforms/86xx/gef_ppc9a.c
@@ -0,0 +1,224 @@
1/*
2 * GE Fanuc PPC9A board support
3 *
4 * Author: Martyn Welch <martyn.welch@gefanuc.com>
5 *
6 * Copyright 2008 GE Fanuc Intelligent Platforms Embedded Systems, Inc.
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 *
13 * Based on: mpc86xx_hpcn.c (MPC86xx HPCN board specific routines)
14 * Copyright 2006 Freescale Semiconductor Inc.
15 *
16 * NEC fixup adapted from arch/mips/pci/fixup-lm2e.c
17 */
18
19#include <linux/stddef.h>
20#include <linux/kernel.h>
21#include <linux/pci.h>
22#include <linux/kdev_t.h>
23#include <linux/delay.h>
24#include <linux/seq_file.h>
25#include <linux/of_platform.h>
26
27#include <asm/system.h>
28#include <asm/time.h>
29#include <asm/machdep.h>
30#include <asm/pci-bridge.h>
31#include <asm/mpc86xx.h>
32#include <asm/prom.h>
33#include <mm/mmu_decl.h>
34#include <asm/udbg.h>
35
36#include <asm/mpic.h>
37
38#include <sysdev/fsl_pci.h>
39#include <sysdev/fsl_soc.h>
40
41#include "mpc86xx.h"
42#include "gef_pic.h"
43
44#undef DEBUG
45
46#ifdef DEBUG
47#define DBG (fmt...) do { printk(KERN_ERR "PPC9A: " fmt); } while (0)
48#else
49#define DBG (fmt...) do { } while (0)
50#endif
51
52void __iomem *ppc9a_regs;
53
54static void __init gef_ppc9a_init_irq(void)
55{
56 struct device_node *cascade_node = NULL;
57
58 mpc86xx_init_irq();
59
60 /*
61 * There is a simple interrupt handler in the main FPGA, this needs
62 * to be cascaded into the MPIC
63 */
64 cascade_node = of_find_compatible_node(NULL, NULL, "gef,fpga-pic-1.00");
65 if (!cascade_node) {
66 printk(KERN_WARNING "PPC9A: No FPGA PIC\n");
67 return;
68 }
69
70 gef_pic_init(cascade_node);
71 of_node_put(cascade_node);
72}
73
74static void __init gef_ppc9a_setup_arch(void)
75{
76 struct device_node *regs;
77#ifdef CONFIG_PCI
78 struct device_node *np;
79
80 for_each_compatible_node(np, "pci", "fsl,mpc8641-pcie") {
81 fsl_add_bridge(np, 1);
82 }
83#endif
84
85 printk(KERN_INFO "GE Fanuc Intelligent Platforms PPC9A 6U VME SBC\n");
86
87#ifdef CONFIG_SMP
88 mpc86xx_smp_init();
89#endif
90
91 /* Remap basic board registers */
92 regs = of_find_compatible_node(NULL, NULL, "gef,ppc9a-fpga-regs");
93 if (regs) {
94 ppc9a_regs = of_iomap(regs, 0);
95 if (ppc9a_regs == NULL)
96 printk(KERN_WARNING "Unable to map board registers\n");
97 of_node_put(regs);
98 }
99}
100
101/* Return the PCB revision */
102static unsigned int gef_ppc9a_get_pcb_rev(void)
103{
104 unsigned int reg;
105
106 reg = ioread32(ppc9a_regs);
107 return (reg >> 8) & 0xff;
108}
109
110/* Return the board (software) revision */
111static unsigned int gef_ppc9a_get_board_rev(void)
112{
113 unsigned int reg;
114
115 reg = ioread32(ppc9a_regs);
116 return (reg >> 16) & 0xff;
117}
118
119/* Return the FPGA revision */
120static unsigned int gef_ppc9a_get_fpga_rev(void)
121{
122 unsigned int reg;
123
124 reg = ioread32(ppc9a_regs);
125 return (reg >> 24) & 0xf;
126}
127
128static void gef_ppc9a_show_cpuinfo(struct seq_file *m)
129{
130 uint svid = mfspr(SPRN_SVR);
131
132 seq_printf(m, "Vendor\t\t: GE Fanuc Intelligent Platforms\n");
133
134 seq_printf(m, "Revision\t: %u%c\n", gef_ppc9a_get_pcb_rev(),
135 ('A' + gef_ppc9a_get_board_rev() - 1));
136 seq_printf(m, "FPGA Revision\t: %u\n", gef_ppc9a_get_fpga_rev());
137
138 seq_printf(m, "SVR\t\t: 0x%x\n", svid);
139}
140
141static void __init gef_ppc9a_nec_fixup(struct pci_dev *pdev)
142{
143 unsigned int val;
144
145 /* Do not do the fixup on other platforms! */
146 if (!machine_is(gef_ppc9a))
147 return;
148
149 printk(KERN_INFO "Running NEC uPD720101 Fixup\n");
150
151 /* Ensure ports 1, 2, 3, 4 & 5 are enabled */
152 pci_read_config_dword(pdev, 0xe0, &val);
153 pci_write_config_dword(pdev, 0xe0, (val & ~7) | 0x5);
154
155 /* System clock is 48-MHz Oscillator and EHCI Enabled. */
156 pci_write_config_dword(pdev, 0xe4, 1 << 5);
157}
158DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_USB,
159 gef_ppc9a_nec_fixup);
160
161/*
162 * Called very early, device-tree isn't unflattened
163 *
164 * This function is called to determine whether the BSP is compatible with the
165 * supplied device-tree, which is assumed to be the correct one for the actual
166 * board. It is expected thati, in the future, a kernel may support multiple
167 * boards.
168 */
169static int __init gef_ppc9a_probe(void)
170{
171 unsigned long root = of_get_flat_dt_root();
172
173 if (of_flat_dt_is_compatible(root, "gef,ppc9a"))
174 return 1;
175
176 return 0;
177}
178
179static long __init mpc86xx_time_init(void)
180{
181 unsigned int temp;
182
183 /* Set the time base to zero */
184 mtspr(SPRN_TBWL, 0);
185 mtspr(SPRN_TBWU, 0);
186
187 temp = mfspr(SPRN_HID0);
188 temp |= HID0_TBEN;
189 mtspr(SPRN_HID0, temp);
190 asm volatile("isync");
191
192 return 0;
193}
194
195static __initdata struct of_device_id of_bus_ids[] = {
196 { .compatible = "simple-bus", },
197 { .compatible = "gianfar", },
198 {},
199};
200
201static int __init declare_of_platform_devices(void)
202{
203 printk(KERN_DEBUG "Probe platform devices\n");
204 of_platform_bus_probe(NULL, of_bus_ids, NULL);
205
206 return 0;
207}
208machine_device_initcall(gef_ppc9a, declare_of_platform_devices);
209
210define_machine(gef_ppc9a) {
211 .name = "GE Fanuc PPC9A",
212 .probe = gef_ppc9a_probe,
213 .setup_arch = gef_ppc9a_setup_arch,
214 .init_IRQ = gef_ppc9a_init_irq,
215 .show_cpuinfo = gef_ppc9a_show_cpuinfo,
216 .get_irq = mpic_get_irq,
217 .restart = fsl_rstcr_restart,
218 .time_init = mpc86xx_time_init,
219 .calibrate_decr = generic_calibrate_decr,
220 .progress = udbg_progress,
221#ifdef CONFIG_PCI
222 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
223#endif
224};
diff --git a/arch/powerpc/platforms/86xx/gef_sbc310.c b/arch/powerpc/platforms/86xx/gef_sbc310.c
new file mode 100644
index 000000000000..af14f852d747
--- /dev/null
+++ b/arch/powerpc/platforms/86xx/gef_sbc310.c
@@ -0,0 +1,235 @@
1/*
2 * GE Fanuc SBC310 board support
3 *
4 * Author: Martyn Welch <martyn.welch@gefanuc.com>
5 *
6 * Copyright 2008 GE Fanuc Intelligent Platforms Embedded Systems, Inc.
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 *
13 * Based on: mpc86xx_hpcn.c (MPC86xx HPCN board specific routines)
14 * Copyright 2006 Freescale Semiconductor Inc.
15 *
16 * NEC fixup adapted from arch/mips/pci/fixup-lm2e.c
17 */
18
19#include <linux/stddef.h>
20#include <linux/kernel.h>
21#include <linux/pci.h>
22#include <linux/kdev_t.h>
23#include <linux/delay.h>
24#include <linux/seq_file.h>
25#include <linux/of_platform.h>
26
27#include <asm/system.h>
28#include <asm/time.h>
29#include <asm/machdep.h>
30#include <asm/pci-bridge.h>
31#include <asm/mpc86xx.h>
32#include <asm/prom.h>
33#include <mm/mmu_decl.h>
34#include <asm/udbg.h>
35
36#include <asm/mpic.h>
37
38#include <sysdev/fsl_pci.h>
39#include <sysdev/fsl_soc.h>
40
41#include "mpc86xx.h"
42#include "gef_pic.h"
43
44#undef DEBUG
45
46#ifdef DEBUG
47#define DBG (fmt...) do { printk(KERN_ERR "SBC310: " fmt); } while (0)
48#else
49#define DBG (fmt...) do { } while (0)
50#endif
51
52void __iomem *sbc310_regs;
53
54static void __init gef_sbc310_init_irq(void)
55{
56 struct device_node *cascade_node = NULL;
57
58 mpc86xx_init_irq();
59
60 /*
61 * There is a simple interrupt handler in the main FPGA, this needs
62 * to be cascaded into the MPIC
63 */
64 cascade_node = of_find_compatible_node(NULL, NULL, "gef,fpga-pic");
65 if (!cascade_node) {
66 printk(KERN_WARNING "SBC310: No FPGA PIC\n");
67 return;
68 }
69
70 gef_pic_init(cascade_node);
71 of_node_put(cascade_node);
72}
73
74static void __init gef_sbc310_setup_arch(void)
75{
76 struct device_node *regs;
77#ifdef CONFIG_PCI
78 struct device_node *np;
79
80 for_each_compatible_node(np, "pci", "fsl,mpc8641-pcie") {
81 fsl_add_bridge(np, 1);
82 }
83#endif
84
85 printk(KERN_INFO "GE Fanuc Intelligent Platforms SBC310 6U VPX SBC\n");
86
87#ifdef CONFIG_SMP
88 mpc86xx_smp_init();
89#endif
90
91 /* Remap basic board registers */
92 regs = of_find_compatible_node(NULL, NULL, "gef,fpga-regs");
93 if (regs) {
94 sbc310_regs = of_iomap(regs, 0);
95 if (sbc310_regs == NULL)
96 printk(KERN_WARNING "Unable to map board registers\n");
97 of_node_put(regs);
98 }
99}
100
101/* Return the PCB revision */
102static unsigned int gef_sbc310_get_board_id(void)
103{
104 unsigned int reg;
105
106 reg = ioread32(sbc310_regs);
107 return reg & 0xff;
108}
109
110/* Return the PCB revision */
111static unsigned int gef_sbc310_get_pcb_rev(void)
112{
113 unsigned int reg;
114
115 reg = ioread32(sbc310_regs);
116 return (reg >> 8) & 0xff;
117}
118
119/* Return the board (software) revision */
120static unsigned int gef_sbc310_get_board_rev(void)
121{
122 unsigned int reg;
123
124 reg = ioread32(sbc310_regs);
125 return (reg >> 16) & 0xff;
126}
127
128/* Return the FPGA revision */
129static unsigned int gef_sbc310_get_fpga_rev(void)
130{
131 unsigned int reg;
132
133 reg = ioread32(sbc310_regs);
134 return (reg >> 24) & 0xf;
135}
136
137static void gef_sbc310_show_cpuinfo(struct seq_file *m)
138{
139 uint svid = mfspr(SPRN_SVR);
140
141 seq_printf(m, "Vendor\t\t: GE Fanuc Intelligent Platforms\n");
142
143 seq_printf(m, "Board ID\t: 0x%2.2x\n", gef_sbc310_get_board_id());
144 seq_printf(m, "Revision\t: %u%c\n", gef_sbc310_get_pcb_rev(),
145 ('A' + gef_sbc310_get_board_rev() - 1));
146 seq_printf(m, "FPGA Revision\t: %u\n", gef_sbc310_get_fpga_rev());
147
148 seq_printf(m, "SVR\t\t: 0x%x\n", svid);
149
150}
151
152static void __init gef_sbc310_nec_fixup(struct pci_dev *pdev)
153{
154 unsigned int val;
155
156 /* Do not do the fixup on other platforms! */
157 if (!machine_is(gef_sbc310))
158 return;
159
160 printk(KERN_INFO "Running NEC uPD720101 Fixup\n");
161
162 /* Ensure only ports 1 & 2 are enabled */
163 pci_read_config_dword(pdev, 0xe0, &val);
164 pci_write_config_dword(pdev, 0xe0, (val & ~7) | 0x2);
165
166 /* System clock is 48-MHz Oscillator and EHCI Enabled. */
167 pci_write_config_dword(pdev, 0xe4, 1 << 5);
168}
169DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_USB,
170 gef_sbc310_nec_fixup);
171
172/*
173 * Called very early, device-tree isn't unflattened
174 *
175 * This function is called to determine whether the BSP is compatible with the
176 * supplied device-tree, which is assumed to be the correct one for the actual
177 * board. It is expected thati, in the future, a kernel may support multiple
178 * boards.
179 */
180static int __init gef_sbc310_probe(void)
181{
182 unsigned long root = of_get_flat_dt_root();
183
184 if (of_flat_dt_is_compatible(root, "gef,sbc310"))
185 return 1;
186
187 return 0;
188}
189
190static long __init mpc86xx_time_init(void)
191{
192 unsigned int temp;
193
194 /* Set the time base to zero */
195 mtspr(SPRN_TBWL, 0);
196 mtspr(SPRN_TBWU, 0);
197
198 temp = mfspr(SPRN_HID0);
199 temp |= HID0_TBEN;
200 mtspr(SPRN_HID0, temp);
201 asm volatile("isync");
202
203 return 0;
204}
205
206static __initdata struct of_device_id of_bus_ids[] = {
207 { .compatible = "simple-bus", },
208 { .compatible = "gianfar", },
209 {},
210};
211
212static int __init declare_of_platform_devices(void)
213{
214 printk(KERN_DEBUG "Probe platform devices\n");
215 of_platform_bus_probe(NULL, of_bus_ids, NULL);
216
217 return 0;
218}
219machine_device_initcall(gef_sbc310, declare_of_platform_devices);
220
221define_machine(gef_sbc310) {
222 .name = "GE Fanuc SBC310",
223 .probe = gef_sbc310_probe,
224 .setup_arch = gef_sbc310_setup_arch,
225 .init_IRQ = gef_sbc310_init_irq,
226 .show_cpuinfo = gef_sbc310_show_cpuinfo,
227 .get_irq = mpic_get_irq,
228 .restart = fsl_rstcr_restart,
229 .time_init = mpc86xx_time_init,
230 .calibrate_decr = generic_calibrate_decr,
231 .progress = udbg_progress,
232#ifdef CONFIG_PCI
233 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
234#endif
235};
diff --git a/arch/powerpc/platforms/86xx/gef_sbc610.c b/arch/powerpc/platforms/86xx/gef_sbc610.c
index d6b772ba3b8f..ea2360639652 100644
--- a/arch/powerpc/platforms/86xx/gef_sbc610.c
+++ b/arch/powerpc/platforms/86xx/gef_sbc610.c
@@ -194,6 +194,7 @@ static long __init mpc86xx_time_init(void)
194 194
195static __initdata struct of_device_id of_bus_ids[] = { 195static __initdata struct of_device_id of_bus_ids[] = {
196 { .compatible = "simple-bus", }, 196 { .compatible = "simple-bus", },
197 { .compatible = "gianfar", },
197 {}, 198 {},
198}; 199};
199 200
diff --git a/arch/powerpc/platforms/86xx/mpc8610_hpcd.c b/arch/powerpc/platforms/86xx/mpc8610_hpcd.c
index e8d54ac5292c..3f49a6f893a3 100644
--- a/arch/powerpc/platforms/86xx/mpc8610_hpcd.c
+++ b/arch/powerpc/platforms/86xx/mpc8610_hpcd.c
@@ -46,6 +46,7 @@ static unsigned char *pixis_bdcfg0, *pixis_arch;
46static struct of_device_id __initdata mpc8610_ids[] = { 46static struct of_device_id __initdata mpc8610_ids[] = {
47 { .compatible = "fsl,mpc8610-immr", }, 47 { .compatible = "fsl,mpc8610-immr", },
48 { .compatible = "simple-bus", }, 48 { .compatible = "simple-bus", },
49 { .compatible = "gianfar", },
49 {} 50 {}
50}; 51};
51 52
diff --git a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
index 27e0e682d8e1..c4ec49b5f7f8 100644
--- a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
+++ b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
@@ -148,6 +148,7 @@ mpc86xx_time_init(void)
148static __initdata struct of_device_id of_bus_ids[] = { 148static __initdata struct of_device_id of_bus_ids[] = {
149 { .compatible = "simple-bus", }, 149 { .compatible = "simple-bus", },
150 { .compatible = "fsl,rapidio-delta", }, 150 { .compatible = "fsl,rapidio-delta", },
151 { .compatible = "gianfar", },
151 {}, 152 {},
152}; 153};
153 154
diff --git a/arch/powerpc/platforms/86xx/sbc8641d.c b/arch/powerpc/platforms/86xx/sbc8641d.c
index 5fd7ed40986f..2886a36fc085 100644
--- a/arch/powerpc/platforms/86xx/sbc8641d.c
+++ b/arch/powerpc/platforms/86xx/sbc8641d.c
@@ -103,6 +103,7 @@ mpc86xx_time_init(void)
103 103
104static __initdata struct of_device_id of_bus_ids[] = { 104static __initdata struct of_device_id of_bus_ids[] = {
105 { .compatible = "simple-bus", }, 105 { .compatible = "simple-bus", },
106 { .compatible = "gianfar", },
106 {}, 107 {},
107}; 108};
108 109
diff --git a/arch/powerpc/platforms/8xx/m8xx_setup.c b/arch/powerpc/platforms/8xx/m8xx_setup.c
index 0d9f75c74f8c..385acfc48397 100644
--- a/arch/powerpc/platforms/8xx/m8xx_setup.c
+++ b/arch/powerpc/platforms/8xx/m8xx_setup.c
@@ -44,7 +44,6 @@ static irqreturn_t timebase_interrupt(int irq, void *dev)
44 44
45static struct irqaction tbint_irqaction = { 45static struct irqaction tbint_irqaction = {
46 .handler = timebase_interrupt, 46 .handler = timebase_interrupt,
47 .mask = CPU_MASK_NONE,
48 .name = "tbint", 47 .name = "tbint",
49}; 48};
50 49
diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig
index 200b9cb900ea..ffa2a9fd53d0 100644
--- a/arch/powerpc/platforms/Kconfig
+++ b/arch/powerpc/platforms/Kconfig
@@ -1,14 +1,5 @@
1menu "Platform support" 1menu "Platform support"
2 2
3config PPC_MULTIPLATFORM
4 bool
5 depends on PPC64 || 6xx
6 default y
7
8config CLASSIC32
9 def_bool y
10 depends on 6xx && PPC_MULTIPLATFORM
11
12source "arch/powerpc/platforms/pseries/Kconfig" 3source "arch/powerpc/platforms/pseries/Kconfig"
13source "arch/powerpc/platforms/iseries/Kconfig" 4source "arch/powerpc/platforms/iseries/Kconfig"
14source "arch/powerpc/platforms/chrp/Kconfig" 5source "arch/powerpc/platforms/chrp/Kconfig"
@@ -28,15 +19,28 @@ source "arch/powerpc/platforms/86xx/Kconfig"
28source "arch/powerpc/platforms/embedded6xx/Kconfig" 19source "arch/powerpc/platforms/embedded6xx/Kconfig"
29source "arch/powerpc/platforms/44x/Kconfig" 20source "arch/powerpc/platforms/44x/Kconfig"
30source "arch/powerpc/platforms/40x/Kconfig" 21source "arch/powerpc/platforms/40x/Kconfig"
22source "arch/powerpc/platforms/amigaone/Kconfig"
31 23
32config PPC_NATIVE 24config PPC_NATIVE
33 bool 25 bool
34 depends on PPC_MULTIPLATFORM 26 depends on 6xx || PPC64
35 help 27 help
36 Support for running natively on the hardware, i.e. without 28 Support for running natively on the hardware, i.e. without
37 a hypervisor. This option is not user-selectable but should 29 a hypervisor. This option is not user-selectable but should
38 be selected by all platforms that need it. 30 be selected by all platforms that need it.
39 31
32config PPC_OF_BOOT_TRAMPOLINE
33 bool "Support booting from Open Firmware or yaboot"
34 depends on 6xx || PPC64
35 default y
36 help
37 Support from booting from Open Firmware or yaboot using an
38 Open Firmware client interface. This enables the kernel to
39 communicate with open firmware to retrieve system informations
40 such as the device tree.
41
42 In case of doubt, say Y
43
40config UDBG_RTAS_CONSOLE 44config UDBG_RTAS_CONSOLE
41 bool "RTAS based debug console" 45 bool "RTAS based debug console"
42 depends on PPC_RTAS 46 depends on PPC_RTAS
@@ -70,7 +74,7 @@ config PPC_I8259
70 74
71config U3_DART 75config U3_DART
72 bool 76 bool
73 depends on PPC_MULTIPLATFORM && PPC64 77 depends on PPC64
74 default n 78 default n
75 79
76config PPC_RTAS 80config PPC_RTAS
@@ -91,15 +95,6 @@ config RTAS_FLASH
91 tristate "Firmware flash interface" 95 tristate "Firmware flash interface"
92 depends on PPC64 && RTAS_PROC 96 depends on PPC64 && RTAS_PROC
93 97
94config PPC_PMI
95 tristate "Support for PMI"
96 depends on PPC_IBM_CELL_BLADE
97 help
98 PMI (Platform Management Interrupt) is a way to
99 communicate with the BMC (Baseboard Management Controller).
100 It is used in some IBM Cell blades.
101 default m
102
103config MMIO_NVRAM 98config MMIO_NVRAM
104 bool 99 bool
105 default n 100 default n
@@ -196,7 +191,7 @@ config PPC601_SYNC_FIX
196 191
197config TAU 192config TAU
198 bool "On-chip CPU temperature sensor support" 193 bool "On-chip CPU temperature sensor support"
199 depends on CLASSIC32 194 depends on 6xx
200 help 195 help
201 G3 and G4 processors have an on-chip temperature sensor called the 196 G3 and G4 processors have an on-chip temperature sensor called the
202 'Thermal Assist Unit (TAU)', which, in theory, can measure the on-die 197 'Thermal Assist Unit (TAU)', which, in theory, can measure the on-die
@@ -274,7 +269,7 @@ config CPM2
274 269
275config AXON_RAM 270config AXON_RAM
276 tristate "Axon DDR2 memory device driver" 271 tristate "Axon DDR2 memory device driver"
277 depends on PPC_IBM_CELL_BLADE 272 depends on PPC_IBM_CELL_BLADE && BLOCK
278 default m 273 default m
279 help 274 help
280 It registers one block device per Axon's DDR2 memory bank found 275 It registers one block device per Axon's DDR2 memory bank found
diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype
index e868b5c50723..9da795e49337 100644
--- a/arch/powerpc/platforms/Kconfig.cputype
+++ b/arch/powerpc/platforms/Kconfig.cputype
@@ -57,9 +57,17 @@ config E200
57 57
58endchoice 58endchoice
59 59
60# Until we have a choice of exclusive CPU types on 64-bit, we always
61# use PPC_BOOK3S. On 32-bit, this is equivalent to 6xx which is
62# "classic" MMU
63
64config PPC_BOOK3S
65 def_bool y
66 depends on PPC64 || 6xx
67
60config POWER4_ONLY 68config POWER4_ONLY
61 bool "Optimize for POWER4" 69 bool "Optimize for POWER4"
62 depends on PPC64 70 depends on PPC64 && PPC_BOOK3S
63 default n 71 default n
64 ---help--- 72 ---help---
65 Cause the compiler to optimize for POWER4/POWER5/PPC970 processors. 73 Cause the compiler to optimize for POWER4/POWER5/PPC970 processors.
@@ -68,16 +76,16 @@ config POWER4_ONLY
68 76
69config POWER3 77config POWER3
70 bool 78 bool
71 depends on PPC64 79 depends on PPC64 && PPC_BOOK3S
72 default y if !POWER4_ONLY 80 default y if !POWER4_ONLY
73 81
74config POWER4 82config POWER4
75 depends on PPC64 83 depends on PPC64 && PPC_BOOK3S
76 def_bool y 84 def_bool y
77 85
78config TUNE_CELL 86config TUNE_CELL
79 bool "Optimize for Cell Broadband Engine" 87 bool "Optimize for Cell Broadband Engine"
80 depends on PPC64 88 depends on PPC64 && PPC_BOOK3S
81 help 89 help
82 Cause the compiler to optimize for the PPE of the Cell Broadband 90 Cause the compiler to optimize for the PPE of the Cell Broadband
83 Engine. This will make the code run considerably faster on Cell 91 Engine. This will make the code run considerably faster on Cell
@@ -147,7 +155,7 @@ config PHYS_64BIT
147 155
148config ALTIVEC 156config ALTIVEC
149 bool "AltiVec Support" 157 bool "AltiVec Support"
150 depends on CLASSIC32 || POWER4 158 depends on 6xx || POWER4
151 ---help--- 159 ---help---
152 This option enables kernel support for the Altivec extensions to the 160 This option enables kernel support for the Altivec extensions to the
153 PowerPC processor. The kernel currently supports saving and restoring 161 PowerPC processor. The kernel currently supports saving and restoring
@@ -210,6 +218,10 @@ config PPC_MMU_NOHASH
210 def_bool y 218 def_bool y
211 depends on !PPC_STD_MMU 219 depends on !PPC_STD_MMU
212 220
221config PPC_BOOK3E_MMU
222 def_bool y
223 depends on FSL_BOOKE
224
213config PPC_MM_SLICES 225config PPC_MM_SLICES
214 bool 226 bool
215 default y if HUGETLB_PAGE || (PPC_STD_MMU_64 && PPC_64K_PAGES) 227 default y if HUGETLB_PAGE || (PPC_STD_MMU_64 && PPC_64K_PAGES)
diff --git a/arch/powerpc/platforms/Makefile b/arch/powerpc/platforms/Makefile
index 8079e0b4fd69..f7419198e635 100644
--- a/arch/powerpc/platforms/Makefile
+++ b/arch/powerpc/platforms/Makefile
@@ -19,3 +19,4 @@ obj-$(CONFIG_PPC_PASEMI) += pasemi/
19obj-$(CONFIG_PPC_CELL) += cell/ 19obj-$(CONFIG_PPC_CELL) += cell/
20obj-$(CONFIG_PPC_PS3) += ps3/ 20obj-$(CONFIG_PPC_PS3) += ps3/
21obj-$(CONFIG_EMBEDDED6xx) += embedded6xx/ 21obj-$(CONFIG_EMBEDDED6xx) += embedded6xx/
22obj-$(CONFIG_AMIGAONE) += amigaone/
diff --git a/arch/powerpc/platforms/amigaone/Kconfig b/arch/powerpc/platforms/amigaone/Kconfig
new file mode 100644
index 000000000000..022476717718
--- /dev/null
+++ b/arch/powerpc/platforms/amigaone/Kconfig
@@ -0,0 +1,18 @@
1config AMIGAONE
2 bool "Eyetech AmigaOne/MAI Teron"
3 depends on 6xx && BROKEN_ON_SMP
4 select PPC_I8259
5 select PPC_INDIRECT_PCI
6 select PPC_UDBG_16550
7 select PCI
8 select NOT_COHERENT_CACHE
9 select CHECK_CACHE_COHERENCY
10 select DEFAULT_UIMAGE
11 select PCSPKR_PLATFORM
12 help
13 Select AmigaOne for the following machines:
14 - AmigaOne SE/Teron CX (G3 only)
15 - AmigaOne XE/Teron PX
16 - uA1/Teron mini
17 More information is available at:
18 <http://amigaone-linux.sourceforge.net/>.
diff --git a/arch/powerpc/platforms/amigaone/Makefile b/arch/powerpc/platforms/amigaone/Makefile
new file mode 100644
index 000000000000..e6885b3b2ee7
--- /dev/null
+++ b/arch/powerpc/platforms/amigaone/Makefile
@@ -0,0 +1 @@
obj-y += setup.o
diff --git a/arch/powerpc/platforms/amigaone/setup.c b/arch/powerpc/platforms/amigaone/setup.c
new file mode 100644
index 000000000000..443035366c12
--- /dev/null
+++ b/arch/powerpc/platforms/amigaone/setup.c
@@ -0,0 +1,170 @@
1/*
2 * AmigaOne platform setup
3 *
4 * Copyright 2008 Gerhard Pircher (gerhard_pircher@gmx.net)
5 *
6 * Based on original amigaone_setup.c source code
7 * Copyright 2003 by Hans-Joerg Frieden and Thomas Frieden
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
15#include <linux/kernel.h>
16#include <linux/seq_file.h>
17#include <linux/utsrelease.h>
18
19#include <asm/machdep.h>
20#include <asm/cputable.h>
21#include <asm/prom.h>
22#include <asm/pci-bridge.h>
23#include <asm/i8259.h>
24#include <asm/time.h>
25#include <asm/udbg.h>
26
27extern void __flush_disable_L1(void);
28
29void amigaone_show_cpuinfo(struct seq_file *m)
30{
31 seq_printf(m, "vendor\t\t: Eyetech Ltd.\n");
32}
33
34static int __init amigaone_add_bridge(struct device_node *dev)
35{
36 const u32 *cfg_addr, *cfg_data;
37 int len;
38 const int *bus_range;
39 struct pci_controller *hose;
40
41 printk(KERN_INFO "Adding PCI host bridge %s\n", dev->full_name);
42
43 cfg_addr = of_get_address(dev, 0, NULL, NULL);
44 cfg_data = of_get_address(dev, 1, NULL, NULL);
45 if ((cfg_addr == NULL) || (cfg_data == NULL))
46 return -ENODEV;
47
48 bus_range = of_get_property(dev, "bus-range", &len);
49 if ((bus_range == NULL) || (len < 2 * sizeof(int)))
50 printk(KERN_WARNING "Can't get bus-range for %s, assume"
51 " bus 0\n", dev->full_name);
52
53 hose = pcibios_alloc_controller(dev);
54 if (hose == NULL)
55 return -ENOMEM;
56
57 hose->first_busno = bus_range ? bus_range[0] : 0;
58 hose->last_busno = bus_range ? bus_range[1] : 0xff;
59
60 setup_indirect_pci(hose, cfg_addr[0], cfg_data[0], 0);
61
62 /* Interpret the "ranges" property */
63 /* This also maps the I/O region and sets isa_io/mem_base */
64 pci_process_bridge_OF_ranges(hose, dev, 1);
65
66 return 0;
67}
68
69void __init amigaone_setup_arch(void)
70{
71 struct device_node *np;
72 int phb = -ENODEV;
73
74 /* Lookup PCI host bridges. */
75 for_each_compatible_node(np, "pci", "mai-logic,articia-s")
76 phb = amigaone_add_bridge(np);
77
78 BUG_ON(phb != 0);
79
80 if (ppc_md.progress)
81 ppc_md.progress("Linux/PPC "UTS_RELEASE"\n", 0);
82}
83
84void __init amigaone_init_IRQ(void)
85{
86 struct device_node *pic, *np = NULL;
87 const unsigned long *prop = NULL;
88 unsigned long int_ack = 0;
89
90 /* Search for ISA interrupt controller. */
91 pic = of_find_compatible_node(NULL, "interrupt-controller",
92 "pnpPNP,000");
93 BUG_ON(pic == NULL);
94
95 /* Look for interrupt acknowledge address in the PCI root node. */
96 np = of_find_compatible_node(NULL, "pci", "mai-logic,articia-s");
97 if (np) {
98 prop = of_get_property(np, "8259-interrupt-acknowledge", NULL);
99 if (prop)
100 int_ack = prop[0];
101 of_node_put(np);
102 }
103
104 if (int_ack == 0)
105 printk(KERN_WARNING "Cannot find PCI interrupt acknowledge"
106 " address, polling\n");
107
108 i8259_init(pic, int_ack);
109 ppc_md.get_irq = i8259_irq;
110 irq_set_default_host(i8259_get_host());
111}
112
113void __init amigaone_init(void)
114{
115 request_region(0x00, 0x20, "dma1");
116 request_region(0x40, 0x20, "timer");
117 request_region(0x80, 0x10, "dma page reg");
118 request_region(0xc0, 0x20, "dma2");
119}
120
121void amigaone_restart(char *cmd)
122{
123 local_irq_disable();
124
125 /* Flush and disable caches. */
126 __flush_disable_L1();
127
128 /* Set SRR0 to the reset vector and turn on MSR_IP. */
129 mtspr(SPRN_SRR0, 0xfff00100);
130 mtspr(SPRN_SRR1, MSR_IP);
131
132 /* Do an rfi to jump back to firmware. */
133 __asm__ __volatile__("rfi" : : : "memory");
134
135 /* Not reached. */
136 while (1);
137}
138
139static int __init amigaone_probe(void)
140{
141 unsigned long root = of_get_flat_dt_root();
142
143 if (of_flat_dt_is_compatible(root, "eyetech,amigaone")) {
144 /*
145 * Coherent memory access cause complete system lockup! Thus
146 * disable this CPU feature, even if the CPU needs it.
147 */
148 cur_cpu_spec->cpu_features &= ~CPU_FTR_NEED_COHERENT;
149
150 ISA_DMA_THRESHOLD = 0x00ffffff;
151 DMA_MODE_READ = 0x44;
152 DMA_MODE_WRITE = 0x48;
153
154 return 1;
155 }
156
157 return 0;
158}
159
160define_machine(amigaone) {
161 .name = "AmigaOne",
162 .probe = amigaone_probe,
163 .setup_arch = amigaone_setup_arch,
164 .init = amigaone_init,
165 .show_cpuinfo = amigaone_show_cpuinfo,
166 .init_IRQ = amigaone_init_IRQ,
167 .restart = amigaone_restart,
168 .calibrate_decr = generic_calibrate_decr,
169 .progress = udbg_progress,
170};
diff --git a/arch/powerpc/platforms/cell/Kconfig b/arch/powerpc/platforms/cell/Kconfig
index 5cc3279559a4..40e24c39ad06 100644
--- a/arch/powerpc/platforms/cell/Kconfig
+++ b/arch/powerpc/platforms/cell/Kconfig
@@ -23,7 +23,7 @@ config PPC_CELL_NATIVE
23 23
24config PPC_IBM_CELL_BLADE 24config PPC_IBM_CELL_BLADE
25 bool "IBM Cell Blade" 25 bool "IBM Cell Blade"
26 depends on PPC_MULTIPLATFORM && PPC64 26 depends on PPC64 && PPC_BOOK3S
27 select PPC_CELL_NATIVE 27 select PPC_CELL_NATIVE
28 select MMIO_NVRAM 28 select MMIO_NVRAM
29 select PPC_UDBG_16550 29 select PPC_UDBG_16550
@@ -31,7 +31,7 @@ config PPC_IBM_CELL_BLADE
31 31
32config PPC_CELLEB 32config PPC_CELLEB
33 bool "Toshiba's Cell Reference Set 'Celleb' Architecture" 33 bool "Toshiba's Cell Reference Set 'Celleb' Architecture"
34 depends on PPC_MULTIPLATFORM && PPC64 34 depends on PPC64 && PPC_BOOK3S
35 select PPC_CELL_NATIVE 35 select PPC_CELL_NATIVE
36 select HAS_TXX9_SERIAL 36 select HAS_TXX9_SERIAL
37 select PPC_UDBG_BEAT 37 select PPC_UDBG_BEAT
@@ -40,9 +40,14 @@ config PPC_CELLEB
40 40
41config PPC_CELL_QPACE 41config PPC_CELL_QPACE
42 bool "IBM Cell - QPACE" 42 bool "IBM Cell - QPACE"
43 depends on PPC_MULTIPLATFORM && PPC64 43 depends on PPC64 && PPC_BOOK3S
44 select PPC_CELL_COMMON 44 select PPC_CELL_COMMON
45 45
46config AXON_MSI
47 bool
48 depends on PPC_IBM_CELL_BLADE && PCI_MSI
49 default y
50
46menu "Cell Broadband Engine options" 51menu "Cell Broadband Engine options"
47 depends on PPC_CELL 52 depends on PPC_CELL
48 53
@@ -98,7 +103,7 @@ config PPC_IBM_CELL_RESETBUTTON
98 103
99config PPC_IBM_CELL_POWERBUTTON 104config PPC_IBM_CELL_POWERBUTTON
100 tristate "IBM Cell Blade power button" 105 tristate "IBM Cell Blade power button"
101 depends on PPC_IBM_CELL_BLADE && PPC_PMI && INPUT_EVDEV 106 depends on PPC_IBM_CELL_BLADE && INPUT_EVDEV
102 default y 107 default y
103 help 108 help
104 Support Powerbutton on IBM Cell blades. 109 Support Powerbutton on IBM Cell blades.
@@ -118,9 +123,9 @@ config CBE_CPUFREQ
118 For details, take a look at <file:Documentation/cpu-freq/>. 123 For details, take a look at <file:Documentation/cpu-freq/>.
119 If you don't have such processor, say N 124 If you don't have such processor, say N
120 125
121config CBE_CPUFREQ_PMI 126config CBE_CPUFREQ_PMI_ENABLE
122 tristate "CBE frequency scaling using PMI interface" 127 bool "CBE frequency scaling using PMI interface"
123 depends on CBE_CPUFREQ && PPC_PMI && EXPERIMENTAL 128 depends on CBE_CPUFREQ && EXPERIMENTAL
124 default n 129 default n
125 help 130 help
126 Select this, if you want to use the PMI interface 131 Select this, if you want to use the PMI interface
@@ -128,6 +133,20 @@ config CBE_CPUFREQ_PMI
128 processor will not only be able to run at lower speed, 133 processor will not only be able to run at lower speed,
129 but also at lower core voltage. 134 but also at lower core voltage.
130 135
136config CBE_CPUFREQ_PMI
137 tristate
138 depends on CBE_CPUFREQ_PMI_ENABLE
139 default CBE_CPUFREQ
140
141config PPC_PMI
142 tristate
143 default y
144 depends on CBE_CPUFREQ_PMI || PPC_IBM_CELL_POWERBUTTON
145 help
146 PMI (Platform Management Interrupt) is a way to
147 communicate with the BMC (Baseboard Management Controller).
148 It is used in some IBM Cell blades.
149
131config CBE_CPUFREQ_SPU_GOVERNOR 150config CBE_CPUFREQ_SPU_GOVERNOR
132 tristate "CBE frequency scaling based on SPU usage" 151 tristate "CBE frequency scaling based on SPU usage"
133 depends on SPU_FS && CPU_FREQ 152 depends on SPU_FS && CPU_FREQ
diff --git a/arch/powerpc/platforms/cell/Makefile b/arch/powerpc/platforms/cell/Makefile
index 43eccb270301..83fafe922641 100644
--- a/arch/powerpc/platforms/cell/Makefile
+++ b/arch/powerpc/platforms/cell/Makefile
@@ -28,7 +28,7 @@ obj-$(CONFIG_SPU_BASE) += spu_callbacks.o spu_base.o \
28 $(spu-manage-y) \ 28 $(spu-manage-y) \
29 spufs/ 29 spufs/
30 30
31obj-$(CONFIG_PCI_MSI) += axon_msi.o 31obj-$(CONFIG_AXON_MSI) += axon_msi.o
32 32
33# qpace setup 33# qpace setup
34obj-$(CONFIG_PPC_CELL_QPACE) += qpace_setup.o 34obj-$(CONFIG_PPC_CELL_QPACE) += qpace_setup.o
diff --git a/arch/powerpc/platforms/cell/io-workarounds.c b/arch/powerpc/platforms/cell/io-workarounds.c
index 059cad6c3f69..5c1118e31940 100644
--- a/arch/powerpc/platforms/cell/io-workarounds.c
+++ b/arch/powerpc/platforms/cell/io-workarounds.c
@@ -131,10 +131,10 @@ static const struct ppc_pci_io __devinitconst iowa_pci_io = {
131}; 131};
132 132
133static void __iomem *iowa_ioremap(phys_addr_t addr, unsigned long size, 133static void __iomem *iowa_ioremap(phys_addr_t addr, unsigned long size,
134 unsigned long flags) 134 unsigned long flags, void *caller)
135{ 135{
136 struct iowa_bus *bus; 136 struct iowa_bus *bus;
137 void __iomem *res = __ioremap(addr, size, flags); 137 void __iomem *res = __ioremap_caller(addr, size, flags, caller);
138 int busno; 138 int busno;
139 139
140 bus = iowa_pci_find(0, (unsigned long)addr); 140 bus = iowa_pci_find(0, (unsigned long)addr);
diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c
index ee5033eddf01..5744527a7f2a 100644
--- a/arch/powerpc/platforms/cell/iommu.c
+++ b/arch/powerpc/platforms/cell/iommu.c
@@ -74,7 +74,7 @@
74#define IOC_IO_ExcpStat_V 0x8000000000000000ul 74#define IOC_IO_ExcpStat_V 0x8000000000000000ul
75#define IOC_IO_ExcpStat_SPF_Mask 0x6000000000000000ul 75#define IOC_IO_ExcpStat_SPF_Mask 0x6000000000000000ul
76#define IOC_IO_ExcpStat_SPF_S 0x6000000000000000ul 76#define IOC_IO_ExcpStat_SPF_S 0x6000000000000000ul
77#define IOC_IO_ExcpStat_SPF_P 0x4000000000000000ul 77#define IOC_IO_ExcpStat_SPF_P 0x2000000000000000ul
78#define IOC_IO_ExcpStat_ADDR_Mask 0x00000007fffff000ul 78#define IOC_IO_ExcpStat_ADDR_Mask 0x00000007fffff000ul
79#define IOC_IO_ExcpStat_RW_Mask 0x0000000000000800ul 79#define IOC_IO_ExcpStat_RW_Mask 0x0000000000000800ul
80#define IOC_IO_ExcpStat_IOID_Mask 0x00000000000007fful 80#define IOC_IO_ExcpStat_IOID_Mask 0x00000000000007fful
@@ -247,17 +247,18 @@ static void tce_free_cell(struct iommu_table *tbl, long index, long npages)
247 247
248static irqreturn_t ioc_interrupt(int irq, void *data) 248static irqreturn_t ioc_interrupt(int irq, void *data)
249{ 249{
250 unsigned long stat; 250 unsigned long stat, spf;
251 struct cbe_iommu *iommu = data; 251 struct cbe_iommu *iommu = data;
252 252
253 stat = in_be64(iommu->xlate_regs + IOC_IO_ExcpStat); 253 stat = in_be64(iommu->xlate_regs + IOC_IO_ExcpStat);
254 spf = stat & IOC_IO_ExcpStat_SPF_Mask;
254 255
255 /* Might want to rate limit it */ 256 /* Might want to rate limit it */
256 printk(KERN_ERR "iommu: DMA exception 0x%016lx\n", stat); 257 printk(KERN_ERR "iommu: DMA exception 0x%016lx\n", stat);
257 printk(KERN_ERR " V=%d, SPF=[%c%c], RW=%s, IOID=0x%04x\n", 258 printk(KERN_ERR " V=%d, SPF=[%c%c], RW=%s, IOID=0x%04x\n",
258 !!(stat & IOC_IO_ExcpStat_V), 259 !!(stat & IOC_IO_ExcpStat_V),
259 (stat & IOC_IO_ExcpStat_SPF_S) ? 'S' : ' ', 260 (spf == IOC_IO_ExcpStat_SPF_S) ? 'S' : ' ',
260 (stat & IOC_IO_ExcpStat_SPF_P) ? 'P' : ' ', 261 (spf == IOC_IO_ExcpStat_SPF_P) ? 'P' : ' ',
261 (stat & IOC_IO_ExcpStat_RW_Mask) ? "Read" : "Write", 262 (stat & IOC_IO_ExcpStat_RW_Mask) ? "Read" : "Write",
262 (unsigned int)(stat & IOC_IO_ExcpStat_IOID_Mask)); 263 (unsigned int)(stat & IOC_IO_ExcpStat_IOID_Mask));
263 printk(KERN_ERR " page=0x%016lx\n", 264 printk(KERN_ERR " page=0x%016lx\n",
diff --git a/arch/powerpc/platforms/cell/qpace_setup.c b/arch/powerpc/platforms/cell/qpace_setup.c
index be84e6a16b30..c5ce02e84c8e 100644
--- a/arch/powerpc/platforms/cell/qpace_setup.c
+++ b/arch/powerpc/platforms/cell/qpace_setup.c
@@ -81,16 +81,6 @@ static int __init qpace_publish_devices(void)
81} 81}
82machine_subsys_initcall(qpace, qpace_publish_devices); 82machine_subsys_initcall(qpace, qpace_publish_devices);
83 83
84extern int qpace_notify(struct device *dev)
85{
86 /* set dma_ops for of_platform bus */
87 if (dev->bus && dev->bus->name
88 && !strcmp(dev->bus->name, "of_platform"))
89 set_dma_ops(dev, &dma_direct_ops);
90
91 return 0;
92}
93
94static void __init qpace_setup_arch(void) 84static void __init qpace_setup_arch(void)
95{ 85{
96#ifdef CONFIG_SPU_BASE 86#ifdef CONFIG_SPU_BASE
@@ -115,9 +105,6 @@ static void __init qpace_setup_arch(void)
115#ifdef CONFIG_DUMMY_CONSOLE 105#ifdef CONFIG_DUMMY_CONSOLE
116 conswitchp = &dummy_con; 106 conswitchp = &dummy_con;
117#endif 107#endif
118
119 /* set notifier function */
120 platform_notify = &qpace_notify;
121} 108}
122 109
123static int __init qpace_probe(void) 110static int __init qpace_probe(void)
@@ -141,6 +128,8 @@ define_machine(qpace) {
141 .power_off = rtas_power_off, 128 .power_off = rtas_power_off,
142 .halt = rtas_halt, 129 .halt = rtas_halt,
143 .get_boot_time = rtas_get_boot_time, 130 .get_boot_time = rtas_get_boot_time,
131 .get_rtc_time = rtas_get_rtc_time,
132 .set_rtc_time = rtas_set_rtc_time,
144 .calibrate_decr = generic_calibrate_decr, 133 .calibrate_decr = generic_calibrate_decr,
145 .progress = qpace_progress, 134 .progress = qpace_progress,
146 .init_IRQ = iic_init_IRQ, 135 .init_IRQ = iic_init_IRQ,
diff --git a/arch/powerpc/platforms/cell/spu_base.c b/arch/powerpc/platforms/cell/spu_base.c
index e487ad68ac11..9abd210d87c1 100644
--- a/arch/powerpc/platforms/cell/spu_base.c
+++ b/arch/powerpc/platforms/cell/spu_base.c
@@ -114,7 +114,7 @@ static inline void mm_needs_global_tlbie(struct mm_struct *mm)
114 int nr = (NR_CPUS > 1) ? NR_CPUS : NR_CPUS + 1; 114 int nr = (NR_CPUS > 1) ? NR_CPUS : NR_CPUS + 1;
115 115
116 /* Global TLBIE broadcast required with SPEs. */ 116 /* Global TLBIE broadcast required with SPEs. */
117 __cpus_setall(&mm->cpu_vm_mask, nr); 117 bitmap_fill(cpumask_bits(mm_cpumask(mm)), nr);
118} 118}
119 119
120void spu_associate_mm(struct spu *spu, struct mm_struct *mm) 120void spu_associate_mm(struct spu *spu, struct mm_struct *mm)
diff --git a/arch/powerpc/platforms/cell/spu_fault.c b/arch/powerpc/platforms/cell/spu_fault.c
index c8b1cd42905d..95d8dadf2d87 100644
--- a/arch/powerpc/platforms/cell/spu_fault.c
+++ b/arch/powerpc/platforms/cell/spu_fault.c
@@ -39,60 +39,56 @@ int spu_handle_mm_fault(struct mm_struct *mm, unsigned long ea,
39 unsigned long is_write; 39 unsigned long is_write;
40 int ret; 40 int ret;
41 41
42#if 0 42 if (mm == NULL)
43 if (!IS_VALID_EA(ea)) {
44 return -EFAULT; 43 return -EFAULT;
45 } 44
46#endif /* XXX */ 45 if (mm->pgd == NULL)
47 if (mm == NULL) {
48 return -EFAULT;
49 }
50 if (mm->pgd == NULL) {
51 return -EFAULT; 46 return -EFAULT;
52 }
53 47
54 down_read(&mm->mmap_sem); 48 down_read(&mm->mmap_sem);
49 ret = -EFAULT;
55 vma = find_vma(mm, ea); 50 vma = find_vma(mm, ea);
56 if (!vma) 51 if (!vma)
57 goto bad_area; 52 goto out_unlock;
58 if (vma->vm_start <= ea) 53
59 goto good_area; 54 if (ea < vma->vm_start) {
60 if (!(vma->vm_flags & VM_GROWSDOWN)) 55 if (!(vma->vm_flags & VM_GROWSDOWN))
61 goto bad_area; 56 goto out_unlock;
62 if (expand_stack(vma, ea)) 57 if (expand_stack(vma, ea))
63 goto bad_area; 58 goto out_unlock;
64good_area: 59 }
60
65 is_write = dsisr & MFC_DSISR_ACCESS_PUT; 61 is_write = dsisr & MFC_DSISR_ACCESS_PUT;
66 if (is_write) { 62 if (is_write) {
67 if (!(vma->vm_flags & VM_WRITE)) 63 if (!(vma->vm_flags & VM_WRITE))
68 goto bad_area; 64 goto out_unlock;
69 } else { 65 } else {
70 if (dsisr & MFC_DSISR_ACCESS_DENIED) 66 if (dsisr & MFC_DSISR_ACCESS_DENIED)
71 goto bad_area; 67 goto out_unlock;
72 if (!(vma->vm_flags & (VM_READ | VM_EXEC))) 68 if (!(vma->vm_flags & (VM_READ | VM_EXEC)))
73 goto bad_area; 69 goto out_unlock;
74 } 70 }
71
75 ret = 0; 72 ret = 0;
76 *flt = handle_mm_fault(mm, vma, ea, is_write); 73 *flt = handle_mm_fault(mm, vma, ea, is_write);
77 if (unlikely(*flt & VM_FAULT_ERROR)) { 74 if (unlikely(*flt & VM_FAULT_ERROR)) {
78 if (*flt & VM_FAULT_OOM) { 75 if (*flt & VM_FAULT_OOM) {
79 ret = -ENOMEM; 76 ret = -ENOMEM;
80 goto bad_area; 77 goto out_unlock;
81 } else if (*flt & VM_FAULT_SIGBUS) { 78 } else if (*flt & VM_FAULT_SIGBUS) {
82 ret = -EFAULT; 79 ret = -EFAULT;
83 goto bad_area; 80 goto out_unlock;
84 } 81 }
85 BUG(); 82 BUG();
86 } 83 }
84
87 if (*flt & VM_FAULT_MAJOR) 85 if (*flt & VM_FAULT_MAJOR)
88 current->maj_flt++; 86 current->maj_flt++;
89 else 87 else
90 current->min_flt++; 88 current->min_flt++;
91 up_read(&mm->mmap_sem);
92 return ret;
93 89
94bad_area: 90out_unlock:
95 up_read(&mm->mmap_sem); 91 up_read(&mm->mmap_sem);
96 return -EFAULT; 92 return ret;
97} 93}
98EXPORT_SYMBOL_GPL(spu_handle_mm_fault); 94EXPORT_SYMBOL_GPL(spu_handle_mm_fault);
diff --git a/arch/powerpc/platforms/cell/spufs/context.c b/arch/powerpc/platforms/cell/spufs/context.c
index 6653ddbed048..db5398c0339f 100644
--- a/arch/powerpc/platforms/cell/spufs/context.c
+++ b/arch/powerpc/platforms/cell/spufs/context.c
@@ -35,6 +35,8 @@ atomic_t nr_spu_contexts = ATOMIC_INIT(0);
35struct spu_context *alloc_spu_context(struct spu_gang *gang) 35struct spu_context *alloc_spu_context(struct spu_gang *gang)
36{ 36{
37 struct spu_context *ctx; 37 struct spu_context *ctx;
38 struct timespec ts;
39
38 ctx = kzalloc(sizeof *ctx, GFP_KERNEL); 40 ctx = kzalloc(sizeof *ctx, GFP_KERNEL);
39 if (!ctx) 41 if (!ctx)
40 goto out; 42 goto out;
@@ -64,6 +66,8 @@ struct spu_context *alloc_spu_context(struct spu_gang *gang)
64 __spu_update_sched_info(ctx); 66 __spu_update_sched_info(ctx);
65 spu_set_timeslice(ctx); 67 spu_set_timeslice(ctx);
66 ctx->stats.util_state = SPU_UTIL_IDLE_LOADED; 68 ctx->stats.util_state = SPU_UTIL_IDLE_LOADED;
69 ktime_get_ts(&ts);
70 ctx->stats.tstamp = timespec_to_ns(&ts);
67 71
68 atomic_inc(&nr_spu_contexts); 72 atomic_inc(&nr_spu_contexts);
69 goto out; 73 goto out;
diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c
index 0da7f2bf5ee1..d6a519e6e1c1 100644
--- a/arch/powerpc/platforms/cell/spufs/file.c
+++ b/arch/powerpc/platforms/cell/spufs/file.c
@@ -568,16 +568,17 @@ spufs_regs_write(struct file *file, const char __user *buffer,
568 struct spu_lscsa *lscsa = ctx->csa.lscsa; 568 struct spu_lscsa *lscsa = ctx->csa.lscsa;
569 int ret; 569 int ret;
570 570
571 size = min_t(ssize_t, sizeof lscsa->gprs - *pos, size); 571 if (*pos >= sizeof(lscsa->gprs))
572 if (size <= 0)
573 return -EFBIG; 572 return -EFBIG;
573
574 size = min_t(ssize_t, sizeof(lscsa->gprs) - *pos, size);
574 *pos += size; 575 *pos += size;
575 576
576 ret = spu_acquire_saved(ctx); 577 ret = spu_acquire_saved(ctx);
577 if (ret) 578 if (ret)
578 return ret; 579 return ret;
579 580
580 ret = copy_from_user(lscsa->gprs + *pos - size, 581 ret = copy_from_user((char *)lscsa->gprs + *pos - size,
581 buffer, size) ? -EFAULT : size; 582 buffer, size) ? -EFAULT : size;
582 583
583 spu_release_saved(ctx); 584 spu_release_saved(ctx);
@@ -623,10 +624,11 @@ spufs_fpcr_write(struct file *file, const char __user * buffer,
623 struct spu_lscsa *lscsa = ctx->csa.lscsa; 624 struct spu_lscsa *lscsa = ctx->csa.lscsa;
624 int ret; 625 int ret;
625 626
626 size = min_t(ssize_t, sizeof(lscsa->fpcr) - *pos, size); 627 if (*pos >= sizeof(lscsa->fpcr))
627 if (size <= 0)
628 return -EFBIG; 628 return -EFBIG;
629 629
630 size = min_t(ssize_t, sizeof(lscsa->fpcr) - *pos, size);
631
630 ret = spu_acquire_saved(ctx); 632 ret = spu_acquire_saved(ctx);
631 if (ret) 633 if (ret)
632 return ret; 634 return ret;
@@ -2665,7 +2667,7 @@ static const struct file_operations spufs_ctx_fops = {
2665 .release = single_release, 2667 .release = single_release,
2666}; 2668};
2667 2669
2668struct spufs_tree_descr spufs_dir_contents[] = { 2670const struct spufs_tree_descr spufs_dir_contents[] = {
2669 { "capabilities", &spufs_caps_fops, 0444, }, 2671 { "capabilities", &spufs_caps_fops, 0444, },
2670 { "mem", &spufs_mem_fops, 0666, LS_SIZE, }, 2672 { "mem", &spufs_mem_fops, 0666, LS_SIZE, },
2671 { "regs", &spufs_regs_fops, 0666, sizeof(struct spu_reg128[128]), }, 2673 { "regs", &spufs_regs_fops, 0666, sizeof(struct spu_reg128[128]), },
@@ -2706,7 +2708,7 @@ struct spufs_tree_descr spufs_dir_contents[] = {
2706 {}, 2708 {},
2707}; 2709};
2708 2710
2709struct spufs_tree_descr spufs_dir_nosched_contents[] = { 2711const struct spufs_tree_descr spufs_dir_nosched_contents[] = {
2710 { "capabilities", &spufs_caps_fops, 0444, }, 2712 { "capabilities", &spufs_caps_fops, 0444, },
2711 { "mem", &spufs_mem_fops, 0666, LS_SIZE, }, 2713 { "mem", &spufs_mem_fops, 0666, LS_SIZE, },
2712 { "mbox", &spufs_mbox_fops, 0444, }, 2714 { "mbox", &spufs_mbox_fops, 0444, },
@@ -2731,12 +2733,12 @@ struct spufs_tree_descr spufs_dir_nosched_contents[] = {
2731 {}, 2733 {},
2732}; 2734};
2733 2735
2734struct spufs_tree_descr spufs_dir_debug_contents[] = { 2736const struct spufs_tree_descr spufs_dir_debug_contents[] = {
2735 { ".ctx", &spufs_ctx_fops, 0444, }, 2737 { ".ctx", &spufs_ctx_fops, 0444, },
2736 {}, 2738 {},
2737}; 2739};
2738 2740
2739struct spufs_coredump_reader spufs_coredump_read[] = { 2741const struct spufs_coredump_reader spufs_coredump_read[] = {
2740 { "regs", __spufs_regs_read, NULL, sizeof(struct spu_reg128[128])}, 2742 { "regs", __spufs_regs_read, NULL, sizeof(struct spu_reg128[128])},
2741 { "fpcr", __spufs_fpcr_read, NULL, sizeof(struct spu_reg128) }, 2743 { "fpcr", __spufs_fpcr_read, NULL, sizeof(struct spu_reg128) },
2742 { "lslr", NULL, spufs_lslr_get, 19 }, 2744 { "lslr", NULL, spufs_lslr_get, 19 },
diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c
index e309ef70a531..64f068540d0d 100644
--- a/arch/powerpc/platforms/cell/spufs/inode.c
+++ b/arch/powerpc/platforms/cell/spufs/inode.c
@@ -186,8 +186,9 @@ static int spufs_rmdir(struct inode *parent, struct dentry *dir)
186 return simple_rmdir(parent, dir); 186 return simple_rmdir(parent, dir);
187} 187}
188 188
189static int spufs_fill_dir(struct dentry *dir, struct spufs_tree_descr *files, 189static int spufs_fill_dir(struct dentry *dir,
190 int mode, struct spu_context *ctx) 190 const struct spufs_tree_descr *files, int mode,
191 struct spu_context *ctx)
191{ 192{
192 struct dentry *dentry, *tmp; 193 struct dentry *dentry, *tmp;
193 int ret; 194 int ret;
diff --git a/arch/powerpc/platforms/cell/spufs/run.c b/arch/powerpc/platforms/cell/spufs/run.c
index c58bd36b0c5b..4ddf769a64e5 100644
--- a/arch/powerpc/platforms/cell/spufs/run.c
+++ b/arch/powerpc/platforms/cell/spufs/run.c
@@ -117,6 +117,9 @@ static int spu_setup_isolated(struct spu_context *ctx)
117 cond_resched(); 117 cond_resched();
118 } 118 }
119 119
120 /* clear purge status */
121 out_be64(mfc_cntl, 0);
122
120 /* put the SPE in kernel mode to allow access to the loader */ 123 /* put the SPE in kernel mode to allow access to the loader */
121 sr1 = spu_mfc_sr1_get(ctx->spu); 124 sr1 = spu_mfc_sr1_get(ctx->spu);
122 sr1 &= ~MFC_STATE1_PROBLEM_STATE_MASK; 125 sr1 &= ~MFC_STATE1_PROBLEM_STATE_MASK;
diff --git a/arch/powerpc/platforms/cell/spufs/spufs.h b/arch/powerpc/platforms/cell/spufs/spufs.h
index 3bf908e2873a..ae31573bea4a 100644
--- a/arch/powerpc/platforms/cell/spufs/spufs.h
+++ b/arch/powerpc/platforms/cell/spufs/spufs.h
@@ -241,9 +241,9 @@ struct spufs_tree_descr {
241 size_t size; 241 size_t size;
242}; 242};
243 243
244extern struct spufs_tree_descr spufs_dir_contents[]; 244extern const struct spufs_tree_descr spufs_dir_contents[];
245extern struct spufs_tree_descr spufs_dir_nosched_contents[]; 245extern const struct spufs_tree_descr spufs_dir_nosched_contents[];
246extern struct spufs_tree_descr spufs_dir_debug_contents[]; 246extern const struct spufs_tree_descr spufs_dir_debug_contents[];
247 247
248/* system call implementation */ 248/* system call implementation */
249extern struct spufs_calls spufs_calls; 249extern struct spufs_calls spufs_calls;
@@ -358,7 +358,7 @@ struct spufs_coredump_reader {
358 u64 (*get)(struct spu_context *ctx); 358 u64 (*get)(struct spu_context *ctx);
359 size_t size; 359 size_t size;
360}; 360};
361extern struct spufs_coredump_reader spufs_coredump_read[]; 361extern const struct spufs_coredump_reader spufs_coredump_read[];
362extern int spufs_coredump_num_notes; 362extern int spufs_coredump_num_notes;
363 363
364extern int spu_init_csa(struct spu_state *csa); 364extern int spu_init_csa(struct spu_state *csa);
diff --git a/arch/powerpc/platforms/chrp/Kconfig b/arch/powerpc/platforms/chrp/Kconfig
index 22b4b4e3b6f0..37d438bd5b7a 100644
--- a/arch/powerpc/platforms/chrp/Kconfig
+++ b/arch/powerpc/platforms/chrp/Kconfig
@@ -1,6 +1,6 @@
1config PPC_CHRP 1config PPC_CHRP
2 bool "Common Hardware Reference Platform (CHRP) based machines" 2 bool "Common Hardware Reference Platform (CHRP) based machines"
3 depends on PPC_MULTIPLATFORM && PPC32 3 depends on 6xx
4 select MPIC 4 select MPIC
5 select PPC_I8259 5 select PPC_I8259
6 select PPC_INDIRECT_PCI 6 select PPC_INDIRECT_PCI
diff --git a/arch/powerpc/platforms/chrp/pegasos_eth.c b/arch/powerpc/platforms/chrp/pegasos_eth.c
index 130ff72d99dd..039fc8e82199 100644
--- a/arch/powerpc/platforms/chrp/pegasos_eth.c
+++ b/arch/powerpc/platforms/chrp/pegasos_eth.c
@@ -21,8 +21,8 @@
21#define PEGASOS2_SRAM_BASE (0xf2000000) 21#define PEGASOS2_SRAM_BASE (0xf2000000)
22#define PEGASOS2_SRAM_SIZE (256*1024) 22#define PEGASOS2_SRAM_SIZE (256*1024)
23 23
24#define PEGASOS2_SRAM_BASE_ETH0 (PEGASOS2_SRAM_BASE) 24#define PEGASOS2_SRAM_BASE_ETH_PORT0 (PEGASOS2_SRAM_BASE)
25#define PEGASOS2_SRAM_BASE_ETH1 (PEGASOS2_SRAM_BASE_ETH0 + (PEGASOS2_SRAM_SIZE / 2) ) 25#define PEGASOS2_SRAM_BASE_ETH_PORT1 (PEGASOS2_SRAM_BASE_ETH_PORT0 + (PEGASOS2_SRAM_SIZE / 2) )
26 26
27 27
28#define PEGASOS2_SRAM_RXRING_SIZE (PEGASOS2_SRAM_SIZE/4) 28#define PEGASOS2_SRAM_RXRING_SIZE (PEGASOS2_SRAM_SIZE/4)
@@ -47,75 +47,42 @@ static struct platform_device mv643xx_eth_shared_device = {
47 .resource = mv643xx_eth_shared_resources, 47 .resource = mv643xx_eth_shared_resources,
48}; 48};
49 49
50static struct resource mv643xx_eth0_resources[] = { 50static struct resource mv643xx_eth_port1_resources[] = {
51 [0] = { 51 [0] = {
52 .name = "eth0 irq", 52 .name = "eth port1 irq",
53 .start = 9, 53 .start = 9,
54 .end = 9, 54 .end = 9,
55 .flags = IORESOURCE_IRQ, 55 .flags = IORESOURCE_IRQ,
56 }, 56 },
57}; 57};
58 58
59 59static struct mv643xx_eth_platform_data eth_port1_pd = {
60static struct mv643xx_eth_platform_data eth0_pd = {
61 .shared = &mv643xx_eth_shared_device,
62 .port_number = 0,
63
64 .tx_sram_addr = PEGASOS2_SRAM_BASE_ETH0,
65 .tx_sram_size = PEGASOS2_SRAM_TXRING_SIZE,
66 .tx_queue_size = PEGASOS2_SRAM_TXRING_SIZE/16,
67
68 .rx_sram_addr = PEGASOS2_SRAM_BASE_ETH0 + PEGASOS2_SRAM_TXRING_SIZE,
69 .rx_sram_size = PEGASOS2_SRAM_RXRING_SIZE,
70 .rx_queue_size = PEGASOS2_SRAM_RXRING_SIZE/16,
71};
72
73static struct platform_device eth0_device = {
74 .name = MV643XX_ETH_NAME,
75 .id = 0,
76 .num_resources = ARRAY_SIZE(mv643xx_eth0_resources),
77 .resource = mv643xx_eth0_resources,
78 .dev = {
79 .platform_data = &eth0_pd,
80 },
81};
82
83static struct resource mv643xx_eth1_resources[] = {
84 [0] = {
85 .name = "eth1 irq",
86 .start = 9,
87 .end = 9,
88 .flags = IORESOURCE_IRQ,
89 },
90};
91
92static struct mv643xx_eth_platform_data eth1_pd = {
93 .shared = &mv643xx_eth_shared_device, 60 .shared = &mv643xx_eth_shared_device,
94 .port_number = 1, 61 .port_number = 1,
62 .phy_addr = MV643XX_ETH_PHY_ADDR(7),
95 63
96 .tx_sram_addr = PEGASOS2_SRAM_BASE_ETH1, 64 .tx_sram_addr = PEGASOS2_SRAM_BASE_ETH_PORT1,
97 .tx_sram_size = PEGASOS2_SRAM_TXRING_SIZE, 65 .tx_sram_size = PEGASOS2_SRAM_TXRING_SIZE,
98 .tx_queue_size = PEGASOS2_SRAM_TXRING_SIZE/16, 66 .tx_queue_size = PEGASOS2_SRAM_TXRING_SIZE/16,
99 67
100 .rx_sram_addr = PEGASOS2_SRAM_BASE_ETH1 + PEGASOS2_SRAM_TXRING_SIZE, 68 .rx_sram_addr = PEGASOS2_SRAM_BASE_ETH_PORT1 + PEGASOS2_SRAM_TXRING_SIZE,
101 .rx_sram_size = PEGASOS2_SRAM_RXRING_SIZE, 69 .rx_sram_size = PEGASOS2_SRAM_RXRING_SIZE,
102 .rx_queue_size = PEGASOS2_SRAM_RXRING_SIZE/16, 70 .rx_queue_size = PEGASOS2_SRAM_RXRING_SIZE/16,
103}; 71};
104 72
105static struct platform_device eth1_device = { 73static struct platform_device eth_port1_device = {
106 .name = MV643XX_ETH_NAME, 74 .name = MV643XX_ETH_NAME,
107 .id = 1, 75 .id = 1,
108 .num_resources = ARRAY_SIZE(mv643xx_eth1_resources), 76 .num_resources = ARRAY_SIZE(mv643xx_eth_port1_resources),
109 .resource = mv643xx_eth1_resources, 77 .resource = mv643xx_eth_port1_resources,
110 .dev = { 78 .dev = {
111 .platform_data = &eth1_pd, 79 .platform_data = &eth_port1_pd,
112 }, 80 },
113}; 81};
114 82
115static struct platform_device *mv643xx_eth_pd_devs[] __initdata = { 83static struct platform_device *mv643xx_eth_pd_devs[] __initdata = {
116 &mv643xx_eth_shared_device, 84 &mv643xx_eth_shared_device,
117 &eth0_device, 85 &eth_port1_device,
118 &eth1_device,
119}; 86};
120 87
121/***********/ 88/***********/
@@ -191,15 +158,10 @@ static int __init mv643xx_eth_add_pds(void)
191 158
192 if ( Enable_SRAM() < 0) 159 if ( Enable_SRAM() < 0)
193 { 160 {
194 eth0_pd.tx_sram_addr = 0; 161 eth_port1_pd.tx_sram_addr = 0;
195 eth0_pd.tx_sram_size = 0; 162 eth_port1_pd.tx_sram_size = 0;
196 eth0_pd.rx_sram_addr = 0; 163 eth_port1_pd.rx_sram_addr = 0;
197 eth0_pd.rx_sram_size = 0; 164 eth_port1_pd.rx_sram_size = 0;
198
199 eth1_pd.tx_sram_addr = 0;
200 eth1_pd.tx_sram_size = 0;
201 eth1_pd.rx_sram_addr = 0;
202 eth1_pd.rx_sram_size = 0;
203 165
204#ifdef BE_VERBOSE 166#ifdef BE_VERBOSE
205 printk("Pegasos II/Marvell MV64361: Can't enable the " 167 printk("Pegasos II/Marvell MV64361: Can't enable the "
diff --git a/arch/powerpc/platforms/chrp/setup.c b/arch/powerpc/platforms/chrp/setup.c
index 272d79a8d289..cd4ad9aea760 100644
--- a/arch/powerpc/platforms/chrp/setup.c
+++ b/arch/powerpc/platforms/chrp/setup.c
@@ -472,7 +472,6 @@ static void __init chrp_find_openpic(void)
472#if defined(CONFIG_VT) && defined(CONFIG_INPUT_ADBHID) && defined(CONFIG_XMON) 472#if defined(CONFIG_VT) && defined(CONFIG_INPUT_ADBHID) && defined(CONFIG_XMON)
473static struct irqaction xmon_irqaction = { 473static struct irqaction xmon_irqaction = {
474 .handler = xmon_irq, 474 .handler = xmon_irq,
475 .mask = CPU_MASK_NONE,
476 .name = "XMON break", 475 .name = "XMON break",
477}; 476};
478#endif 477#endif
diff --git a/arch/powerpc/platforms/embedded6xx/Kconfig b/arch/powerpc/platforms/embedded6xx/Kconfig
index 4f9f8184d164..291ac9d8cbee 100644
--- a/arch/powerpc/platforms/embedded6xx/Kconfig
+++ b/arch/powerpc/platforms/embedded6xx/Kconfig
@@ -1,6 +1,6 @@
1config EMBEDDED6xx 1config EMBEDDED6xx
2 bool "Embedded 6xx/7xx/7xxx-based boards" 2 bool "Embedded 6xx/7xx/7xxx-based boards"
3 depends on PPC32 && BROKEN_ON_SMP && PPC_MULTIPLATFORM 3 depends on 6xx && BROKEN_ON_SMP
4 4
5config LINKSTATION 5config LINKSTATION
6 bool "Linkstation / Kurobox(HG) from Buffalo" 6 bool "Linkstation / Kurobox(HG) from Buffalo"
diff --git a/arch/powerpc/platforms/iseries/Kconfig b/arch/powerpc/platforms/iseries/Kconfig
index 7ddd0a2c8027..647e87787437 100644
--- a/arch/powerpc/platforms/iseries/Kconfig
+++ b/arch/powerpc/platforms/iseries/Kconfig
@@ -1,6 +1,6 @@
1config PPC_ISERIES 1config PPC_ISERIES
2 bool "IBM Legacy iSeries" 2 bool "IBM Legacy iSeries"
3 depends on PPC_MULTIPLATFORM && PPC64 3 depends on PPC64 && PPC_BOOK3S
4 select PPC_INDIRECT_IO 4 select PPC_INDIRECT_IO
5 select PPC_PCI_CHOICE if EMBEDDED 5 select PPC_PCI_CHOICE if EMBEDDED
6 6
diff --git a/arch/powerpc/platforms/iseries/irq.c b/arch/powerpc/platforms/iseries/irq.c
index 701d9297c207..94f444758836 100644
--- a/arch/powerpc/platforms/iseries/irq.c
+++ b/arch/powerpc/platforms/iseries/irq.c
@@ -214,7 +214,7 @@ void __init iSeries_activate_IRQs()
214 unsigned long flags; 214 unsigned long flags;
215 215
216 for_each_irq (irq) { 216 for_each_irq (irq) {
217 irq_desc_t *desc = get_irq_desc(irq); 217 struct irq_desc *desc = get_irq_desc(irq);
218 218
219 if (desc && desc->chip && desc->chip->startup) { 219 if (desc && desc->chip && desc->chip->startup) {
220 spin_lock_irqsave(&desc->lock, flags); 220 spin_lock_irqsave(&desc->lock, flags);
diff --git a/arch/powerpc/platforms/iseries/setup.c b/arch/powerpc/platforms/iseries/setup.c
index 24519b96d6ad..a6cd3394feaa 100644
--- a/arch/powerpc/platforms/iseries/setup.c
+++ b/arch/powerpc/platforms/iseries/setup.c
@@ -617,7 +617,7 @@ static void iseries_dedicated_idle(void)
617} 617}
618 618
619static void __iomem *iseries_ioremap(phys_addr_t address, unsigned long size, 619static void __iomem *iseries_ioremap(phys_addr_t address, unsigned long size,
620 unsigned long flags) 620 unsigned long flags, void *caller)
621{ 621{
622 return (void __iomem *)address; 622 return (void __iomem *)address;
623} 623}
diff --git a/arch/powerpc/platforms/maple/Kconfig b/arch/powerpc/platforms/maple/Kconfig
index a6467a5591fa..1ea621a94c3b 100644
--- a/arch/powerpc/platforms/maple/Kconfig
+++ b/arch/powerpc/platforms/maple/Kconfig
@@ -1,5 +1,5 @@
1config PPC_MAPLE 1config PPC_MAPLE
2 depends on PPC_MULTIPLATFORM && PPC64 2 depends on PPC64 && PPC_BOOK3S
3 bool "Maple 970FX Evaluation Board" 3 bool "Maple 970FX Evaluation Board"
4 select PCI 4 select PCI
5 select MPIC 5 select MPIC
diff --git a/arch/powerpc/platforms/pasemi/Kconfig b/arch/powerpc/platforms/pasemi/Kconfig
index 348e0619e3e5..a2aeb327d185 100644
--- a/arch/powerpc/platforms/pasemi/Kconfig
+++ b/arch/powerpc/platforms/pasemi/Kconfig
@@ -1,5 +1,5 @@
1config PPC_PASEMI 1config PPC_PASEMI
2 depends on PPC_MULTIPLATFORM && PPC64 2 depends on PPC64 && PPC_BOOK3S
3 bool "PA Semi SoC-based platforms" 3 bool "PA Semi SoC-based platforms"
4 default n 4 default n
5 select MPIC 5 select MPIC
diff --git a/arch/powerpc/platforms/powermac/Kconfig b/arch/powerpc/platforms/powermac/Kconfig
index 055990ca8ce6..1e1a0873e1dd 100644
--- a/arch/powerpc/platforms/powermac/Kconfig
+++ b/arch/powerpc/platforms/powermac/Kconfig
@@ -1,6 +1,6 @@
1config PPC_PMAC 1config PPC_PMAC
2 bool "Apple PowerMac based machines" 2 bool "Apple PowerMac based machines"
3 depends on PPC_MULTIPLATFORM 3 depends on PPC_BOOK3S
4 select MPIC 4 select MPIC
5 select PCI 5 select PCI
6 select PPC_INDIRECT_PCI if PPC32 6 select PPC_INDIRECT_PCI if PPC32
diff --git a/arch/powerpc/platforms/powermac/cpufreq_64.c b/arch/powerpc/platforms/powermac/cpufreq_64.c
index beb38333b6d2..22ecfbe7183d 100644
--- a/arch/powerpc/platforms/powermac/cpufreq_64.c
+++ b/arch/powerpc/platforms/powermac/cpufreq_64.c
@@ -86,6 +86,7 @@ static int (*g5_query_freq)(void);
86 86
87static DEFINE_MUTEX(g5_switch_mutex); 87static DEFINE_MUTEX(g5_switch_mutex);
88 88
89static unsigned long transition_latency;
89 90
90#ifdef CONFIG_PMAC_SMU 91#ifdef CONFIG_PMAC_SMU
91 92
@@ -357,7 +358,7 @@ static unsigned int g5_cpufreq_get_speed(unsigned int cpu)
357 358
358static int g5_cpufreq_cpu_init(struct cpufreq_policy *policy) 359static int g5_cpufreq_cpu_init(struct cpufreq_policy *policy)
359{ 360{
360 policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL; 361 policy->cpuinfo.transition_latency = transition_latency;
361 policy->cur = g5_cpu_freqs[g5_query_freq()].frequency; 362 policy->cur = g5_cpu_freqs[g5_query_freq()].frequency;
362 /* secondary CPUs are tied to the primary one by the 363 /* secondary CPUs are tied to the primary one by the
363 * cpufreq core if in the secondary policy we tell it that 364 * cpufreq core if in the secondary policy we tell it that
@@ -500,6 +501,7 @@ static int __init g5_neo2_cpufreq_init(struct device_node *cpus)
500 g5_cpu_freqs[1].frequency = max_freq/2; 501 g5_cpu_freqs[1].frequency = max_freq/2;
501 502
502 /* Set callbacks */ 503 /* Set callbacks */
504 transition_latency = 12000;
503 g5_switch_freq = g5_scom_switch_freq; 505 g5_switch_freq = g5_scom_switch_freq;
504 g5_query_freq = g5_scom_query_freq; 506 g5_query_freq = g5_scom_query_freq;
505 freq_method = "SCOM"; 507 freq_method = "SCOM";
@@ -675,6 +677,7 @@ static int __init g5_pm72_cpufreq_init(struct device_node *cpus)
675 g5_cpu_freqs[1].frequency = min_freq; 677 g5_cpu_freqs[1].frequency = min_freq;
676 678
677 /* Set callbacks */ 679 /* Set callbacks */
680 transition_latency = CPUFREQ_ETERNAL;
678 g5_switch_volt = g5_pfunc_switch_volt; 681 g5_switch_volt = g5_pfunc_switch_volt;
679 g5_switch_freq = g5_pfunc_switch_freq; 682 g5_switch_freq = g5_pfunc_switch_freq;
680 g5_query_freq = g5_pfunc_query_freq; 683 g5_query_freq = g5_pfunc_query_freq;
diff --git a/arch/powerpc/platforms/powermac/pic.c b/arch/powerpc/platforms/powermac/pic.c
index 6d149ae8ffa7..7039d8f1d3ba 100644
--- a/arch/powerpc/platforms/powermac/pic.c
+++ b/arch/powerpc/platforms/powermac/pic.c
@@ -266,7 +266,6 @@ static unsigned int pmac_pic_get_irq(void)
266static struct irqaction xmon_action = { 266static struct irqaction xmon_action = {
267 .handler = xmon_irq, 267 .handler = xmon_irq,
268 .flags = 0, 268 .flags = 0,
269 .mask = CPU_MASK_NONE,
270 .name = "NMI - XMON" 269 .name = "NMI - XMON"
271}; 270};
272#endif 271#endif
@@ -274,7 +273,6 @@ static struct irqaction xmon_action = {
274static struct irqaction gatwick_cascade_action = { 273static struct irqaction gatwick_cascade_action = {
275 .handler = gatwick_action, 274 .handler = gatwick_action,
276 .flags = IRQF_DISABLED, 275 .flags = IRQF_DISABLED,
277 .mask = CPU_MASK_NONE,
278 .name = "cascade", 276 .name = "cascade",
279}; 277};
280 278
diff --git a/arch/powerpc/platforms/powermac/pic.h b/arch/powerpc/platforms/powermac/pic.h
index c44c89f5e532..d622a8345aaa 100644
--- a/arch/powerpc/platforms/powermac/pic.h
+++ b/arch/powerpc/platforms/powermac/pic.h
@@ -3,7 +3,7 @@
3 3
4#include <linux/irq.h> 4#include <linux/irq.h>
5 5
6extern struct hw_interrupt_type pmac_pic; 6extern struct irq_chip pmac_pic;
7 7
8extern void pmac_pic_init(void); 8extern void pmac_pic_init(void);
9extern int pmac_get_irq(void); 9extern int pmac_get_irq(void);
diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c
index 9b78f5300c24..45936c9ed0ec 100644
--- a/arch/powerpc/platforms/powermac/setup.c
+++ b/arch/powerpc/platforms/powermac/setup.c
@@ -746,4 +746,7 @@ define_machine(powermac) {
746#if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_PPC64) 746#if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_PPC64)
747 .cpu_die = pmac_cpu_die, 747 .cpu_die = pmac_cpu_die,
748#endif 748#endif
749#if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_PPC32)
750 .cpu_die = generic_mach_cpu_die,
751#endif
749}; 752};
diff --git a/arch/powerpc/platforms/powermac/smp.c b/arch/powerpc/platforms/powermac/smp.c
index bd8817b00fa4..cf1dbe758890 100644
--- a/arch/powerpc/platforms/powermac/smp.c
+++ b/arch/powerpc/platforms/powermac/smp.c
@@ -385,7 +385,6 @@ static void __init psurge_dual_sync_tb(int cpu_nr)
385static struct irqaction psurge_irqaction = { 385static struct irqaction psurge_irqaction = {
386 .handler = psurge_primary_intr, 386 .handler = psurge_primary_intr,
387 .flags = IRQF_DISABLED, 387 .flags = IRQF_DISABLED,
388 .mask = CPU_MASK_NONE,
389 .name = "primary IPI", 388 .name = "primary IPI",
390}; 389};
391 390
diff --git a/arch/powerpc/platforms/prep/Kconfig b/arch/powerpc/platforms/prep/Kconfig
index 29d411279b0c..bf8330ef2e76 100644
--- a/arch/powerpc/platforms/prep/Kconfig
+++ b/arch/powerpc/platforms/prep/Kconfig
@@ -1,6 +1,6 @@
1config PPC_PREP 1config PPC_PREP
2 bool "PowerPC Reference Platform (PReP) based machines" 2 bool "PowerPC Reference Platform (PReP) based machines"
3 depends on PPC_MULTIPLATFORM && PPC32 && BROKEN 3 depends on 6xx && BROKEN
4 select MPIC 4 select MPIC
5 select PPC_I8259 5 select PPC_I8259
6 select PPC_INDIRECT_PCI 6 select PPC_INDIRECT_PCI
diff --git a/arch/powerpc/platforms/ps3/Kconfig b/arch/powerpc/platforms/ps3/Kconfig
index 740ef56a1550..dfe316b161a9 100644
--- a/arch/powerpc/platforms/ps3/Kconfig
+++ b/arch/powerpc/platforms/ps3/Kconfig
@@ -1,6 +1,6 @@
1config PPC_PS3 1config PPC_PS3
2 bool "Sony PS3" 2 bool "Sony PS3"
3 depends on PPC_MULTIPLATFORM && PPC64 3 depends on PPC64 && PPC_BOOK3S
4 select PPC_CELL 4 select PPC_CELL
5 select USB_ARCH_HAS_OHCI 5 select USB_ARCH_HAS_OHCI
6 select USB_OHCI_LITTLE_ENDIAN 6 select USB_OHCI_LITTLE_ENDIAN
diff --git a/arch/powerpc/platforms/ps3/mm.c b/arch/powerpc/platforms/ps3/mm.c
index d281cc0bca71..9a2b6d948610 100644
--- a/arch/powerpc/platforms/ps3/mm.c
+++ b/arch/powerpc/platforms/ps3/mm.c
@@ -311,7 +311,7 @@ static int __init ps3_mm_add_memory(void)
311 result = add_memory(0, start_addr, map.r1.size); 311 result = add_memory(0, start_addr, map.r1.size);
312 312
313 if (result) { 313 if (result) {
314 DBG("%s:%d: add_memory failed: (%d)\n", 314 pr_err("%s:%d: add_memory failed: (%d)\n",
315 __func__, __LINE__, result); 315 __func__, __LINE__, result);
316 return result; 316 return result;
317 } 317 }
@@ -322,7 +322,7 @@ static int __init ps3_mm_add_memory(void)
322 result = online_pages(start_pfn, nr_pages); 322 result = online_pages(start_pfn, nr_pages);
323 323
324 if (result) 324 if (result)
325 DBG("%s:%d: online_pages failed: (%d)\n", 325 pr_err("%s:%d: online_pages failed: (%d)\n",
326 __func__, __LINE__, result); 326 __func__, __LINE__, result);
327 327
328 return result; 328 return result;
diff --git a/arch/powerpc/platforms/pseries/Kconfig b/arch/powerpc/platforms/pseries/Kconfig
index ddc2a307cd50..f0e6f28427bd 100644
--- a/arch/powerpc/platforms/pseries/Kconfig
+++ b/arch/powerpc/platforms/pseries/Kconfig
@@ -1,5 +1,5 @@
1config PPC_PSERIES 1config PPC_PSERIES
2 depends on PPC_MULTIPLATFORM && PPC64 2 depends on PPC64 && PPC_BOOK3S
3 bool "IBM pSeries & new (POWER5-based) iSeries" 3 bool "IBM pSeries & new (POWER5-based) iSeries"
4 select MPIC 4 select MPIC
5 select PPC_I8259 5 select PPC_I8259
@@ -25,6 +25,11 @@ config EEH
25 depends on PPC_PSERIES && PCI 25 depends on PPC_PSERIES && PCI
26 default y if !EMBEDDED 26 default y if !EMBEDDED
27 27
28config PSERIES_MSI
29 bool
30 depends on PCI_MSI && EEH
31 default y
32
28config SCANLOG 33config SCANLOG
29 tristate "Scanlog dump interface" 34 tristate "Scanlog dump interface"
30 depends on RTAS_PROC && PPC_PSERIES 35 depends on RTAS_PROC && PPC_PSERIES
@@ -63,3 +68,13 @@ config CMM
63 makes sense for a system running in an LPAR where the unused pages 68 makes sense for a system running in an LPAR where the unused pages
64 will be reused for other LPARs. The interface allows firmware to 69 will be reused for other LPARs. The interface allows firmware to
65 balance memory across many LPARs. 70 balance memory across many LPARs.
71
72config DTL
73 bool "Dispatch Trace Log"
74 depends on PPC_SPLPAR && DEBUG_FS
75 help
76 SPLPAR machines can log hypervisor preempt & dispatch events to a
77 kernel buffer. Saying Y here will enable logging these events,
78 which are accessible through a debugfs file.
79
80 Say N if you are unsure.
diff --git a/arch/powerpc/platforms/pseries/Makefile b/arch/powerpc/platforms/pseries/Makefile
index dfe574af2dc0..790c0b872d4f 100644
--- a/arch/powerpc/platforms/pseries/Makefile
+++ b/arch/powerpc/platforms/pseries/Makefile
@@ -15,7 +15,7 @@ obj-$(CONFIG_SCANLOG) += scanlog.o
15obj-$(CONFIG_EEH) += eeh.o eeh_cache.o eeh_driver.o eeh_event.o eeh_sysfs.o 15obj-$(CONFIG_EEH) += eeh.o eeh_cache.o eeh_driver.o eeh_event.o eeh_sysfs.o
16obj-$(CONFIG_KEXEC) += kexec.o 16obj-$(CONFIG_KEXEC) += kexec.o
17obj-$(CONFIG_PCI) += pci.o pci_dlpar.o 17obj-$(CONFIG_PCI) += pci.o pci_dlpar.o
18obj-$(CONFIG_PCI_MSI) += msi.o 18obj-$(CONFIG_PSERIES_MSI) += msi.o
19 19
20obj-$(CONFIG_HOTPLUG_CPU) += hotplug-cpu.o 20obj-$(CONFIG_HOTPLUG_CPU) += hotplug-cpu.o
21obj-$(CONFIG_MEMORY_HOTPLUG) += hotplug-memory.o 21obj-$(CONFIG_MEMORY_HOTPLUG) += hotplug-memory.o
@@ -25,3 +25,4 @@ obj-$(CONFIG_HVCS) += hvcserver.o
25obj-$(CONFIG_HCALL_STATS) += hvCall_inst.o 25obj-$(CONFIG_HCALL_STATS) += hvCall_inst.o
26obj-$(CONFIG_PHYP_DUMP) += phyp_dump.o 26obj-$(CONFIG_PHYP_DUMP) += phyp_dump.o
27obj-$(CONFIG_CMM) += cmm.o 27obj-$(CONFIG_CMM) += cmm.o
28obj-$(CONFIG_DTL) += dtl.o
diff --git a/arch/powerpc/platforms/pseries/dtl.c b/arch/powerpc/platforms/pseries/dtl.c
new file mode 100644
index 000000000000..fafcaa0e81ef
--- /dev/null
+++ b/arch/powerpc/platforms/pseries/dtl.c
@@ -0,0 +1,278 @@
1/*
2 * Virtual Processor Dispatch Trace Log
3 *
4 * (C) Copyright IBM Corporation 2009
5 *
6 * Author: Jeremy Kerr <jk@ozlabs.org>
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, or (at your option)
11 * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
21 */
22
23#include <linux/init.h>
24#include <linux/debugfs.h>
25#include <asm/smp.h>
26#include <asm/system.h>
27#include <asm/uaccess.h>
28
29#include "plpar_wrappers.h"
30
31/*
32 * Layout of entries in the hypervisor's DTL buffer. Although we don't
33 * actually access the internals of an entry (we only need to know the size),
34 * we might as well define it here for reference.
35 */
36struct dtl_entry {
37 u8 dispatch_reason;
38 u8 preempt_reason;
39 u16 processor_id;
40 u32 enqueue_to_dispatch_time;
41 u32 ready_to_enqueue_time;
42 u32 waiting_to_ready_time;
43 u64 timebase;
44 u64 fault_addr;
45 u64 srr0;
46 u64 srr1;
47};
48
49struct dtl {
50 struct dtl_entry *buf;
51 struct dentry *file;
52 int cpu;
53 int buf_entries;
54 u64 last_idx;
55};
56static DEFINE_PER_CPU(struct dtl, dtl);
57
58/*
59 * Dispatch trace log event mask:
60 * 0x7: 0x1: voluntary virtual processor waits
61 * 0x2: time-slice preempts
62 * 0x4: virtual partition memory page faults
63 */
64static u8 dtl_event_mask = 0x7;
65
66
67/*
68 * Size of per-cpu log buffers. Default is just under 16 pages worth.
69 */
70static int dtl_buf_entries = (16 * 85);
71
72
73static int dtl_enable(struct dtl *dtl)
74{
75 unsigned long addr;
76 int ret, hwcpu;
77
78 /* only allow one reader */
79 if (dtl->buf)
80 return -EBUSY;
81
82 /* we need to store the original allocation size for use during read */
83 dtl->buf_entries = dtl_buf_entries;
84
85 dtl->buf = kmalloc_node(dtl->buf_entries * sizeof(struct dtl_entry),
86 GFP_KERNEL, cpu_to_node(dtl->cpu));
87 if (!dtl->buf) {
88 printk(KERN_WARNING "%s: buffer alloc failed for cpu %d\n",
89 __func__, dtl->cpu);
90 return -ENOMEM;
91 }
92
93 /* Register our dtl buffer with the hypervisor. The HV expects the
94 * buffer size to be passed in the second word of the buffer */
95 ((u32 *)dtl->buf)[1] = dtl->buf_entries * sizeof(struct dtl_entry);
96
97 hwcpu = get_hard_smp_processor_id(dtl->cpu);
98 addr = __pa(dtl->buf);
99 ret = register_dtl(hwcpu, addr);
100 if (ret) {
101 printk(KERN_WARNING "%s: DTL registration for cpu %d (hw %d) "
102 "failed with %d\n", __func__, dtl->cpu, hwcpu, ret);
103 kfree(dtl->buf);
104 return -EIO;
105 }
106
107 /* set our initial buffer indices */
108 dtl->last_idx = lppaca[dtl->cpu].dtl_idx = 0;
109
110 /* ensure that our updates to the lppaca fields have occurred before
111 * we actually enable the logging */
112 smp_wmb();
113
114 /* enable event logging */
115 lppaca[dtl->cpu].dtl_enable_mask = dtl_event_mask;
116
117 return 0;
118}
119
120static void dtl_disable(struct dtl *dtl)
121{
122 int hwcpu = get_hard_smp_processor_id(dtl->cpu);
123
124 lppaca[dtl->cpu].dtl_enable_mask = 0x0;
125
126 unregister_dtl(hwcpu, __pa(dtl->buf));
127
128 kfree(dtl->buf);
129 dtl->buf = NULL;
130 dtl->buf_entries = 0;
131}
132
133/* file interface */
134
135static int dtl_file_open(struct inode *inode, struct file *filp)
136{
137 struct dtl *dtl = inode->i_private;
138 int rc;
139
140 rc = dtl_enable(dtl);
141 if (rc)
142 return rc;
143
144 filp->private_data = dtl;
145 return 0;
146}
147
148static int dtl_file_release(struct inode *inode, struct file *filp)
149{
150 struct dtl *dtl = inode->i_private;
151 dtl_disable(dtl);
152 return 0;
153}
154
155static ssize_t dtl_file_read(struct file *filp, char __user *buf, size_t len,
156 loff_t *pos)
157{
158 int rc, cur_idx, last_idx, n_read, n_req, read_size;
159 struct dtl *dtl;
160
161 if ((len % sizeof(struct dtl_entry)) != 0)
162 return -EINVAL;
163
164 dtl = filp->private_data;
165
166 /* requested number of entries to read */
167 n_req = len / sizeof(struct dtl_entry);
168
169 /* actual number of entries read */
170 n_read = 0;
171
172 cur_idx = lppaca[dtl->cpu].dtl_idx;
173 last_idx = dtl->last_idx;
174
175 if (cur_idx - last_idx > dtl->buf_entries) {
176 pr_debug("%s: hv buffer overflow for cpu %d, samples lost\n",
177 __func__, dtl->cpu);
178 }
179
180 cur_idx %= dtl->buf_entries;
181 last_idx %= dtl->buf_entries;
182
183 /* read the tail of the buffer if we've wrapped */
184 if (last_idx > cur_idx) {
185 read_size = min(n_req, dtl->buf_entries - last_idx);
186
187 rc = copy_to_user(buf, &dtl->buf[last_idx],
188 read_size * sizeof(struct dtl_entry));
189 if (rc)
190 return -EFAULT;
191
192 last_idx = 0;
193 n_req -= read_size;
194 n_read += read_size;
195 buf += read_size * sizeof(struct dtl_entry);
196 }
197
198 /* .. and now the head */
199 read_size = min(n_req, cur_idx - last_idx);
200 rc = copy_to_user(buf, &dtl->buf[last_idx],
201 read_size * sizeof(struct dtl_entry));
202 if (rc)
203 return -EFAULT;
204
205 n_read += read_size;
206 dtl->last_idx += n_read;
207
208 return n_read * sizeof(struct dtl_entry);
209}
210
211static struct file_operations dtl_fops = {
212 .open = dtl_file_open,
213 .release = dtl_file_release,
214 .read = dtl_file_read,
215 .llseek = no_llseek,
216};
217
218static struct dentry *dtl_dir;
219
220static int dtl_setup_file(struct dtl *dtl)
221{
222 char name[10];
223
224 sprintf(name, "cpu-%d", dtl->cpu);
225
226 dtl->file = debugfs_create_file(name, 0400, dtl_dir, dtl, &dtl_fops);
227 if (!dtl->file)
228 return -ENOMEM;
229
230 return 0;
231}
232
233static int dtl_init(void)
234{
235 struct dentry *event_mask_file, *buf_entries_file;
236 int rc, i;
237
238 if (!firmware_has_feature(FW_FEATURE_SPLPAR))
239 return -ENODEV;
240
241 /* set up common debugfs structure */
242
243 rc = -ENOMEM;
244 dtl_dir = debugfs_create_dir("dtl", powerpc_debugfs_root);
245 if (!dtl_dir) {
246 printk(KERN_WARNING "%s: can't create dtl root dir\n",
247 __func__);
248 goto err;
249 }
250
251 event_mask_file = debugfs_create_x8("dtl_event_mask", 0600,
252 dtl_dir, &dtl_event_mask);
253 buf_entries_file = debugfs_create_u32("dtl_buf_entries", 0600,
254 dtl_dir, &dtl_buf_entries);
255
256 if (!event_mask_file || !buf_entries_file) {
257 printk(KERN_WARNING "%s: can't create dtl files\n", __func__);
258 goto err_remove_dir;
259 }
260
261 /* set up the per-cpu log structures */
262 for_each_possible_cpu(i) {
263 struct dtl *dtl = &per_cpu(dtl, i);
264 dtl->cpu = i;
265
266 rc = dtl_setup_file(dtl);
267 if (rc)
268 goto err_remove_dir;
269 }
270
271 return 0;
272
273err_remove_dir:
274 debugfs_remove_recursive(dtl_dir);
275err:
276 return rc;
277}
278arch_initcall(dtl_init);
diff --git a/arch/powerpc/platforms/pseries/eeh_driver.c b/arch/powerpc/platforms/pseries/eeh_driver.c
index 0ad56ff7b4a0..380420f8c400 100644
--- a/arch/powerpc/platforms/pseries/eeh_driver.c
+++ b/arch/powerpc/platforms/pseries/eeh_driver.c
@@ -79,6 +79,40 @@ static int irq_in_use(unsigned int irq)
79 return rc; 79 return rc;
80} 80}
81 81
82/**
83 * eeh_disable_irq - disable interrupt for the recovering device
84 */
85static void eeh_disable_irq(struct pci_dev *dev)
86{
87 struct device_node *dn = pci_device_to_OF_node(dev);
88
89 /* Don't disable MSI and MSI-X interrupts. They are
90 * effectively disabled by the DMA Stopped state
91 * when an EEH error occurs.
92 */
93 if (dev->msi_enabled || dev->msix_enabled)
94 return;
95
96 if (!irq_in_use(dev->irq))
97 return;
98
99 PCI_DN(dn)->eeh_mode |= EEH_MODE_IRQ_DISABLED;
100 disable_irq_nosync(dev->irq);
101}
102
103/**
104 * eeh_enable_irq - enable interrupt for the recovering device
105 */
106static void eeh_enable_irq(struct pci_dev *dev)
107{
108 struct device_node *dn = pci_device_to_OF_node(dev);
109
110 if ((PCI_DN(dn)->eeh_mode) & EEH_MODE_IRQ_DISABLED) {
111 PCI_DN(dn)->eeh_mode &= ~EEH_MODE_IRQ_DISABLED;
112 enable_irq(dev->irq);
113 }
114}
115
82/* ------------------------------------------------------- */ 116/* ------------------------------------------------------- */
83/** 117/**
84 * eeh_report_error - report pci error to each device driver 118 * eeh_report_error - report pci error to each device driver
@@ -98,11 +132,8 @@ static void eeh_report_error(struct pci_dev *dev, void *userdata)
98 if (!driver) 132 if (!driver)
99 return; 133 return;
100 134
101 if (irq_in_use (dev->irq)) { 135 eeh_disable_irq(dev);
102 struct device_node *dn = pci_device_to_OF_node(dev); 136
103 PCI_DN(dn)->eeh_mode |= EEH_MODE_IRQ_DISABLED;
104 disable_irq_nosync(dev->irq);
105 }
106 if (!driver->err_handler || 137 if (!driver->err_handler ||
107 !driver->err_handler->error_detected) 138 !driver->err_handler->error_detected)
108 return; 139 return;
@@ -147,15 +178,12 @@ static void eeh_report_reset(struct pci_dev *dev, void *userdata)
147{ 178{
148 enum pci_ers_result rc, *res = userdata; 179 enum pci_ers_result rc, *res = userdata;
149 struct pci_driver *driver = dev->driver; 180 struct pci_driver *driver = dev->driver;
150 struct device_node *dn = pci_device_to_OF_node(dev);
151 181
152 if (!driver) 182 if (!driver)
153 return; 183 return;
154 184
155 if ((PCI_DN(dn)->eeh_mode) & EEH_MODE_IRQ_DISABLED) { 185 eeh_enable_irq(dev);
156 PCI_DN(dn)->eeh_mode &= ~EEH_MODE_IRQ_DISABLED; 186
157 enable_irq(dev->irq);
158 }
159 if (!driver->err_handler || 187 if (!driver->err_handler ||
160 !driver->err_handler->slot_reset) 188 !driver->err_handler->slot_reset)
161 return; 189 return;
@@ -174,17 +202,14 @@ static void eeh_report_reset(struct pci_dev *dev, void *userdata)
174static void eeh_report_resume(struct pci_dev *dev, void *userdata) 202static void eeh_report_resume(struct pci_dev *dev, void *userdata)
175{ 203{
176 struct pci_driver *driver = dev->driver; 204 struct pci_driver *driver = dev->driver;
177 struct device_node *dn = pci_device_to_OF_node(dev);
178 205
179 dev->error_state = pci_channel_io_normal; 206 dev->error_state = pci_channel_io_normal;
180 207
181 if (!driver) 208 if (!driver)
182 return; 209 return;
183 210
184 if ((PCI_DN(dn)->eeh_mode) & EEH_MODE_IRQ_DISABLED) { 211 eeh_enable_irq(dev);
185 PCI_DN(dn)->eeh_mode &= ~EEH_MODE_IRQ_DISABLED; 212
186 enable_irq(dev->irq);
187 }
188 if (!driver->err_handler || 213 if (!driver->err_handler ||
189 !driver->err_handler->resume) 214 !driver->err_handler->resume)
190 return; 215 return;
@@ -208,15 +233,12 @@ static void eeh_report_failure(struct pci_dev *dev, void *userdata)
208 if (!driver) 233 if (!driver)
209 return; 234 return;
210 235
211 if (irq_in_use (dev->irq)) { 236 eeh_disable_irq(dev);
212 struct device_node *dn = pci_device_to_OF_node(dev); 237
213 PCI_DN(dn)->eeh_mode |= EEH_MODE_IRQ_DISABLED; 238 if (!driver->err_handler ||
214 disable_irq_nosync(dev->irq); 239 !driver->err_handler->error_detected)
215 }
216 if (!driver->err_handler)
217 return;
218 if (!driver->err_handler->error_detected)
219 return; 240 return;
241
220 driver->err_handler->error_detected(dev, pci_channel_io_perm_failure); 242 driver->err_handler->error_detected(dev, pci_channel_io_perm_failure);
221} 243}
222 244
diff --git a/arch/powerpc/platforms/pseries/msi.c b/arch/powerpc/platforms/pseries/msi.c
index f15222bbe136..bf2e1ac41308 100644
--- a/arch/powerpc/platforms/pseries/msi.c
+++ b/arch/powerpc/platforms/pseries/msi.c
@@ -71,11 +71,13 @@ static int rtas_change_msi(struct pci_dn *pdn, u32 func, u32 num_irqs)
71 } while (rtas_busy_delay(rc)); 71 } while (rtas_busy_delay(rc));
72 72
73 /* 73 /*
74 * If the RTAS call succeeded, check the number of irqs is actually 74 * If the RTAS call succeeded, return the number of irqs allocated.
75 * what we asked for. If not, return an error. 75 * If not, make sure we return a negative error code.
76 */ 76 */
77 if (rc == 0 && rtas_ret[0] != num_irqs) 77 if (rc == 0)
78 rc = -ENOSPC; 78 rc = rtas_ret[0];
79 else if (rc > 0)
80 rc = -rc;
79 81
80 pr_debug("rtas_msi: ibm,change_msi(func=%d,num=%d), got %d rc = %d\n", 82 pr_debug("rtas_msi: ibm,change_msi(func=%d,num=%d), got %d rc = %d\n",
81 func, num_irqs, rtas_ret[0], rc); 83 func, num_irqs, rtas_ret[0], rc);
@@ -91,7 +93,7 @@ static void rtas_disable_msi(struct pci_dev *pdev)
91 if (!pdn) 93 if (!pdn)
92 return; 94 return;
93 95
94 if (rtas_change_msi(pdn, RTAS_CHANGE_FN, 0)) 96 if (rtas_change_msi(pdn, RTAS_CHANGE_FN, 0) != 0)
95 pr_debug("rtas_msi: Setting MSIs to 0 failed!\n"); 97 pr_debug("rtas_msi: Setting MSIs to 0 failed!\n");
96} 98}
97 99
@@ -132,7 +134,7 @@ static void rtas_teardown_msi_irqs(struct pci_dev *pdev)
132 rtas_disable_msi(pdev); 134 rtas_disable_msi(pdev);
133} 135}
134 136
135static int check_req_msi(struct pci_dev *pdev, int nvec) 137static int check_req(struct pci_dev *pdev, int nvec, char *prop_name)
136{ 138{
137 struct device_node *dn; 139 struct device_node *dn;
138 struct pci_dn *pdn; 140 struct pci_dn *pdn;
@@ -144,26 +146,235 @@ static int check_req_msi(struct pci_dev *pdev, int nvec)
144 146
145 dn = pdn->node; 147 dn = pdn->node;
146 148
147 req_msi = of_get_property(dn, "ibm,req#msi", NULL); 149 req_msi = of_get_property(dn, prop_name, NULL);
148 if (!req_msi) { 150 if (!req_msi) {
149 pr_debug("rtas_msi: No ibm,req#msi on %s\n", dn->full_name); 151 pr_debug("rtas_msi: No %s on %s\n", prop_name, dn->full_name);
150 return -ENOENT; 152 return -ENOENT;
151 } 153 }
152 154
153 if (*req_msi < nvec) { 155 if (*req_msi < nvec) {
154 pr_debug("rtas_msi: ibm,req#msi requests < %d MSIs\n", nvec); 156 pr_debug("rtas_msi: %s requests < %d MSIs\n", prop_name, nvec);
155 return -ENOSPC; 157
158 if (*req_msi == 0) /* Be paranoid */
159 return -ENOSPC;
160
161 return *req_msi;
156 } 162 }
157 163
158 return 0; 164 return 0;
159} 165}
160 166
167static int check_req_msi(struct pci_dev *pdev, int nvec)
168{
169 return check_req(pdev, nvec, "ibm,req#msi");
170}
171
172static int check_req_msix(struct pci_dev *pdev, int nvec)
173{
174 return check_req(pdev, nvec, "ibm,req#msi-x");
175}
176
177/* Quota calculation */
178
179static struct device_node *find_pe_total_msi(struct pci_dev *dev, int *total)
180{
181 struct device_node *dn;
182 const u32 *p;
183
184 dn = of_node_get(pci_device_to_OF_node(dev));
185 while (dn) {
186 p = of_get_property(dn, "ibm,pe-total-#msi", NULL);
187 if (p) {
188 pr_debug("rtas_msi: found prop on dn %s\n",
189 dn->full_name);
190 *total = *p;
191 return dn;
192 }
193
194 dn = of_get_next_parent(dn);
195 }
196
197 return NULL;
198}
199
200static struct device_node *find_pe_dn(struct pci_dev *dev, int *total)
201{
202 struct device_node *dn;
203
204 /* Found our PE and assume 8 at that point. */
205
206 dn = pci_device_to_OF_node(dev);
207 if (!dn)
208 return NULL;
209
210 dn = find_device_pe(dn);
211 if (!dn)
212 return NULL;
213
214 /* We actually want the parent */
215 dn = of_get_parent(dn);
216 if (!dn)
217 return NULL;
218
219 /* Hardcode of 8 for old firmwares */
220 *total = 8;
221 pr_debug("rtas_msi: using PE dn %s\n", dn->full_name);
222
223 return dn;
224}
225
226struct msi_counts {
227 struct device_node *requestor;
228 int num_devices;
229 int request;
230 int quota;
231 int spare;
232 int over_quota;
233};
234
235static void *count_non_bridge_devices(struct device_node *dn, void *data)
236{
237 struct msi_counts *counts = data;
238 const u32 *p;
239 u32 class;
240
241 pr_debug("rtas_msi: counting %s\n", dn->full_name);
242
243 p = of_get_property(dn, "class-code", NULL);
244 class = p ? *p : 0;
245
246 if ((class >> 8) != PCI_CLASS_BRIDGE_PCI)
247 counts->num_devices++;
248
249 return NULL;
250}
251
252static void *count_spare_msis(struct device_node *dn, void *data)
253{
254 struct msi_counts *counts = data;
255 const u32 *p;
256 int req;
257
258 if (dn == counts->requestor)
259 req = counts->request;
260 else {
261 /* We don't know if a driver will try to use MSI or MSI-X,
262 * so we just have to punt and use the larger of the two. */
263 req = 0;
264 p = of_get_property(dn, "ibm,req#msi", NULL);
265 if (p)
266 req = *p;
267
268 p = of_get_property(dn, "ibm,req#msi-x", NULL);
269 if (p)
270 req = max(req, (int)*p);
271 }
272
273 if (req < counts->quota)
274 counts->spare += counts->quota - req;
275 else if (req > counts->quota)
276 counts->over_quota++;
277
278 return NULL;
279}
280
281static int msi_quota_for_device(struct pci_dev *dev, int request)
282{
283 struct device_node *pe_dn;
284 struct msi_counts counts;
285 int total;
286
287 pr_debug("rtas_msi: calc quota for %s, request %d\n", pci_name(dev),
288 request);
289
290 pe_dn = find_pe_total_msi(dev, &total);
291 if (!pe_dn)
292 pe_dn = find_pe_dn(dev, &total);
293
294 if (!pe_dn) {
295 pr_err("rtas_msi: couldn't find PE for %s\n", pci_name(dev));
296 goto out;
297 }
298
299 pr_debug("rtas_msi: found PE %s\n", pe_dn->full_name);
300
301 memset(&counts, 0, sizeof(struct msi_counts));
302
303 /* Work out how many devices we have below this PE */
304 traverse_pci_devices(pe_dn, count_non_bridge_devices, &counts);
305
306 if (counts.num_devices == 0) {
307 pr_err("rtas_msi: found 0 devices under PE for %s\n",
308 pci_name(dev));
309 goto out;
310 }
311
312 counts.quota = total / counts.num_devices;
313 if (request <= counts.quota)
314 goto out;
315
316 /* else, we have some more calculating to do */
317 counts.requestor = pci_device_to_OF_node(dev);
318 counts.request = request;
319 traverse_pci_devices(pe_dn, count_spare_msis, &counts);
320
321 /* If the quota isn't an integer multiple of the total, we can
322 * use the remainder as spare MSIs for anyone that wants them. */
323 counts.spare += total % counts.num_devices;
324
325 /* Divide any spare by the number of over-quota requestors */
326 if (counts.over_quota)
327 counts.quota += counts.spare / counts.over_quota;
328
329 /* And finally clamp the request to the possibly adjusted quota */
330 request = min(counts.quota, request);
331
332 pr_debug("rtas_msi: request clamped to quota %d\n", request);
333out:
334 of_node_put(pe_dn);
335
336 return request;
337}
338
161static int rtas_msi_check_device(struct pci_dev *pdev, int nvec, int type) 339static int rtas_msi_check_device(struct pci_dev *pdev, int nvec, int type)
162{ 340{
341 int quota, rc;
342
163 if (type == PCI_CAP_ID_MSIX) 343 if (type == PCI_CAP_ID_MSIX)
164 pr_debug("rtas_msi: MSI-X untested, trying anyway.\n"); 344 rc = check_req_msix(pdev, nvec);
345 else
346 rc = check_req_msi(pdev, nvec);
347
348 if (rc)
349 return rc;
350
351 quota = msi_quota_for_device(pdev, nvec);
165 352
166 return check_req_msi(pdev, nvec); 353 if (quota && quota < nvec)
354 return quota;
355
356 return 0;
357}
358
359static int check_msix_entries(struct pci_dev *pdev)
360{
361 struct msi_desc *entry;
362 int expected;
363
364 /* There's no way for us to express to firmware that we want
365 * a discontiguous, or non-zero based, range of MSI-X entries.
366 * So we must reject such requests. */
367
368 expected = 0;
369 list_for_each_entry(entry, &pdev->msi_list, list) {
370 if (entry->msi_attrib.entry_nr != expected) {
371 pr_debug("rtas_msi: bad MSI-X entries.\n");
372 return -EINVAL;
373 }
374 expected++;
375 }
376
377 return 0;
167} 378}
168 379
169static int rtas_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type) 380static int rtas_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
@@ -177,6 +388,9 @@ static int rtas_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
177 if (!pdn) 388 if (!pdn)
178 return -ENODEV; 389 return -ENODEV;
179 390
391 if (type == PCI_CAP_ID_MSIX && check_msix_entries(pdev))
392 return -EINVAL;
393
180 /* 394 /*
181 * Try the new more explicit firmware interface, if that fails fall 395 * Try the new more explicit firmware interface, if that fails fall
182 * back to the old interface. The old interface is known to never 396 * back to the old interface. The old interface is known to never
@@ -185,21 +399,21 @@ static int rtas_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
185 if (type == PCI_CAP_ID_MSI) { 399 if (type == PCI_CAP_ID_MSI) {
186 rc = rtas_change_msi(pdn, RTAS_CHANGE_MSI_FN, nvec); 400 rc = rtas_change_msi(pdn, RTAS_CHANGE_MSI_FN, nvec);
187 401
188 if (rc) { 402 if (rc < 0) {
189 pr_debug("rtas_msi: trying the old firmware call.\n"); 403 pr_debug("rtas_msi: trying the old firmware call.\n");
190 rc = rtas_change_msi(pdn, RTAS_CHANGE_FN, nvec); 404 rc = rtas_change_msi(pdn, RTAS_CHANGE_FN, nvec);
191 } 405 }
192 } else 406 } else
193 rc = rtas_change_msi(pdn, RTAS_CHANGE_MSIX_FN, nvec); 407 rc = rtas_change_msi(pdn, RTAS_CHANGE_MSIX_FN, nvec);
194 408
195 if (rc) { 409 if (rc != nvec) {
196 pr_debug("rtas_msi: rtas_change_msi() failed\n"); 410 pr_debug("rtas_msi: rtas_change_msi() failed\n");
197 return rc; 411 return rc;
198 } 412 }
199 413
200 i = 0; 414 i = 0;
201 list_for_each_entry(entry, &pdev->msi_list, list) { 415 list_for_each_entry(entry, &pdev->msi_list, list) {
202 hwirq = rtas_query_irq_number(pdn, i); 416 hwirq = rtas_query_irq_number(pdn, i++);
203 if (hwirq < 0) { 417 if (hwirq < 0) {
204 pr_debug("rtas_msi: error (%d) getting hwirq\n", rc); 418 pr_debug("rtas_msi: error (%d) getting hwirq\n", rc);
205 return hwirq; 419 return hwirq;
@@ -234,8 +448,8 @@ static void rtas_msi_pci_irq_fixup(struct pci_dev *pdev)
234 } 448 }
235 449
236 /* No MSI -> MSIs can't have been assigned by fw, leave LSI */ 450 /* No MSI -> MSIs can't have been assigned by fw, leave LSI */
237 if (check_req_msi(pdev, 1)) { 451 if (check_req_msi(pdev, 1) && check_req_msix(pdev, 1)) {
238 dev_dbg(&pdev->dev, "rtas_msi: no req#msi, nothing to do.\n"); 452 dev_dbg(&pdev->dev, "rtas_msi: no req#msi/x, nothing to do.\n");
239 return; 453 return;
240 } 454 }
241 455
diff --git a/arch/powerpc/platforms/pseries/pci_dlpar.c b/arch/powerpc/platforms/pseries/pci_dlpar.c
index 5e1ed3d60ee5..ad152a0e3946 100644
--- a/arch/powerpc/platforms/pseries/pci_dlpar.c
+++ b/arch/powerpc/platforms/pseries/pci_dlpar.c
@@ -137,11 +137,9 @@ EXPORT_SYMBOL_GPL(pcibios_add_pci_devices);
137struct pci_controller * __devinit init_phb_dynamic(struct device_node *dn) 137struct pci_controller * __devinit init_phb_dynamic(struct device_node *dn)
138{ 138{
139 struct pci_controller *phb; 139 struct pci_controller *phb;
140 int primary;
141 140
142 pr_debug("PCI: Initializing new hotplug PHB %s\n", dn->full_name); 141 pr_debug("PCI: Initializing new hotplug PHB %s\n", dn->full_name);
143 142
144 primary = list_empty(&hose_list);
145 phb = pcibios_alloc_controller(dn); 143 phb = pcibios_alloc_controller(dn);
146 if (!phb) 144 if (!phb)
147 return NULL; 145 return NULL;
diff --git a/arch/powerpc/platforms/pseries/plpar_wrappers.h b/arch/powerpc/platforms/pseries/plpar_wrappers.h
index d967c1893ab5..a24a6b2333b2 100644
--- a/arch/powerpc/platforms/pseries/plpar_wrappers.h
+++ b/arch/powerpc/platforms/pseries/plpar_wrappers.h
@@ -43,6 +43,16 @@ static inline long register_slb_shadow(unsigned long cpu, unsigned long vpa)
43 return vpa_call(0x3, cpu, vpa); 43 return vpa_call(0x3, cpu, vpa);
44} 44}
45 45
46static inline long unregister_dtl(unsigned long cpu, unsigned long vpa)
47{
48 return vpa_call(0x6, cpu, vpa);
49}
50
51static inline long register_dtl(unsigned long cpu, unsigned long vpa)
52{
53 return vpa_call(0x2, cpu, vpa);
54}
55
46static inline long plpar_page_set_loaned(unsigned long vpa) 56static inline long plpar_page_set_loaned(unsigned long vpa)
47{ 57{
48 unsigned long cmo_page_sz = cmo_get_page_size(); 58 unsigned long cmo_page_sz = cmo_get_page_size();
diff --git a/arch/powerpc/platforms/pseries/reconfig.c b/arch/powerpc/platforms/pseries/reconfig.c
index c591a25b0b0d..b6f1b137d427 100644
--- a/arch/powerpc/platforms/pseries/reconfig.c
+++ b/arch/powerpc/platforms/pseries/reconfig.c
@@ -468,9 +468,13 @@ static int do_update_property(char *buf, size_t bufsize)
468 468
469 rc = blocking_notifier_call_chain(&pSeries_reconfig_chain, 469 rc = blocking_notifier_call_chain(&pSeries_reconfig_chain,
470 action, value); 470 action, value);
471 if (rc == NOTIFY_BAD) {
472 rc = prom_update_property(np, oldprop, newprop);
473 return -ENOMEM;
474 }
471 } 475 }
472 476
473 return rc; 477 return 0;
474} 478}
475 479
476/** 480/**
diff --git a/arch/powerpc/sysdev/cpm1.c b/arch/powerpc/sysdev/cpm1.c
index 490473ce8103..82424cd7e128 100644
--- a/arch/powerpc/sysdev/cpm1.c
+++ b/arch/powerpc/sysdev/cpm1.c
@@ -119,7 +119,6 @@ static irqreturn_t cpm_error_interrupt(int irq, void *dev)
119 119
120static struct irqaction cpm_error_irqaction = { 120static struct irqaction cpm_error_irqaction = {
121 .handler = cpm_error_interrupt, 121 .handler = cpm_error_interrupt,
122 .mask = CPU_MASK_NONE,
123 .name = "error", 122 .name = "error",
124}; 123};
125 124
diff --git a/arch/powerpc/sysdev/cpm2.c b/arch/powerpc/sysdev/cpm2.c
index f1c3395633b9..fd969f0e3121 100644
--- a/arch/powerpc/sysdev/cpm2.c
+++ b/arch/powerpc/sysdev/cpm2.c
@@ -52,6 +52,7 @@ cpm_cpm2_t __iomem *cpmp; /* Pointer to comm processor space */
52 * the communication processor devices. 52 * the communication processor devices.
53 */ 53 */
54cpm2_map_t __iomem *cpm2_immr; 54cpm2_map_t __iomem *cpm2_immr;
55EXPORT_SYMBOL(cpm2_immr);
55 56
56#define CPM_MAP_SIZE (0x40000) /* 256k - the PQ3 reserve this amount 57#define CPM_MAP_SIZE (0x40000) /* 256k - the PQ3 reserve this amount
57 of space for CPM as it is larger 58 of space for CPM as it is larger
@@ -129,7 +130,8 @@ void __cpm2_setbrg(uint brg, uint rate, uint clk, int div16, int src)
129 brg -= 4; 130 brg -= 4;
130 } 131 }
131 bp += brg; 132 bp += brg;
132 val = (((clk / rate) - 1) << 1) | CPM_BRG_EN | src; 133 /* Round the clock divider to the nearest integer. */
134 val = (((clk * 2 / rate) - 1) & ~1) | CPM_BRG_EN | src;
133 if (div16) 135 if (div16)
134 val |= CPM_BRG_DIV16; 136 val |= CPM_BRG_DIV16;
135 137
diff --git a/arch/powerpc/sysdev/cpm_common.c b/arch/powerpc/sysdev/cpm_common.c
index 00d3d17c84a3..e4b6d66d93de 100644
--- a/arch/powerpc/sysdev/cpm_common.c
+++ b/arch/powerpc/sysdev/cpm_common.c
@@ -56,7 +56,7 @@ void __init udbg_init_cpm(void)
56{ 56{
57 if (cpm_udbg_txdesc) { 57 if (cpm_udbg_txdesc) {
58#ifdef CONFIG_CPM2 58#ifdef CONFIG_CPM2
59 setbat(1, 0xf0000000, 0xf0000000, 1024*1024, _PAGE_IO); 59 setbat(1, 0xf0000000, 0xf0000000, 1024*1024, PAGE_KERNEL_NCG);
60#endif 60#endif
61 udbg_putc = udbg_putc_cpm; 61 udbg_putc = udbg_putc_cpm;
62 } 62 }
diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
index 9817f63723dd..78021d8afc53 100644
--- a/arch/powerpc/sysdev/fsl_pci.c
+++ b/arch/powerpc/sysdev/fsl_pci.c
@@ -1,12 +1,16 @@
1/* 1/*
2 * MPC83xx/85xx/86xx PCI/PCIE support routing. 2 * MPC83xx/85xx/86xx PCI/PCIE support routing.
3 * 3 *
4 * Copyright 2007,2008 Freescale Semiconductor, Inc 4 * Copyright 2007-2009 Freescale Semiconductor, Inc.
5 * Copyright 2008-2009 MontaVista Software, Inc.
5 * 6 *
6 * Initial author: Xianghua Xiao <x.xiao@freescale.com> 7 * Initial author: Xianghua Xiao <x.xiao@freescale.com>
7 * Recode: ZHANG WEI <wei.zhang@freescale.com> 8 * Recode: ZHANG WEI <wei.zhang@freescale.com>
8 * Rewrite the routing for Frescale PCI and PCI Express 9 * Rewrite the routing for Frescale PCI and PCI Express
9 * Roy Zang <tie-fei.zang@freescale.com> 10 * Roy Zang <tie-fei.zang@freescale.com>
11 * MPC83xx PCI-Express support:
12 * Tony Li <tony.li@freescale.com>
13 * Anton Vorontsov <avorontsov@ru.mvista.com>
10 * 14 *
11 * 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
12 * 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
@@ -27,6 +31,29 @@
27#include <sysdev/fsl_soc.h> 31#include <sysdev/fsl_soc.h>
28#include <sysdev/fsl_pci.h> 32#include <sysdev/fsl_pci.h>
29 33
34static int fsl_pcie_bus_fixup;
35
36static void __init quirk_fsl_pcie_header(struct pci_dev *dev)
37{
38 /* if we aren't a PCIe don't bother */
39 if (!pci_find_capability(dev, PCI_CAP_ID_EXP))
40 return;
41
42 dev->class = PCI_CLASS_BRIDGE_PCI << 8;
43 fsl_pcie_bus_fixup = 1;
44 return;
45}
46
47static int __init fsl_pcie_check_link(struct pci_controller *hose)
48{
49 u32 val;
50
51 early_read_config_dword(hose, 0, 0, PCIE_LTSSM, &val);
52 if (val < PCIE_LTSSM_L0)
53 return 1;
54 return 0;
55}
56
30#if defined(CONFIG_PPC_85xx) || defined(CONFIG_PPC_86xx) 57#if defined(CONFIG_PPC_85xx) || defined(CONFIG_PPC_86xx)
31static int __init setup_one_atmu(struct ccsr_pci __iomem *pci, 58static int __init setup_one_atmu(struct ccsr_pci __iomem *pci,
32 unsigned int index, const struct resource *res, 59 unsigned int index, const struct resource *res,
@@ -159,28 +186,6 @@ static void __init setup_pci_pcsrbar(struct pci_controller *hose)
159#endif 186#endif
160} 187}
161 188
162static int fsl_pcie_bus_fixup;
163
164static void __init quirk_fsl_pcie_header(struct pci_dev *dev)
165{
166 /* if we aren't a PCIe don't bother */
167 if (!pci_find_capability(dev, PCI_CAP_ID_EXP))
168 return ;
169
170 dev->class = PCI_CLASS_BRIDGE_PCI << 8;
171 fsl_pcie_bus_fixup = 1;
172 return ;
173}
174
175static int __init fsl_pcie_check_link(struct pci_controller *hose)
176{
177 u32 val;
178 early_read_config_dword(hose, 0, 0, PCIE_LTSSM, &val);
179 if (val < PCIE_LTSSM_L0)
180 return 1;
181 return 0;
182}
183
184void fsl_pcibios_fixup_bus(struct pci_bus *bus) 189void fsl_pcibios_fixup_bus(struct pci_bus *bus)
185{ 190{
186 struct pci_controller *hose = (struct pci_controller *) bus->sysdata; 191 struct pci_controller *hose = (struct pci_controller *) bus->sysdata;
@@ -294,8 +299,184 @@ DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8610, quirk_fsl_pcie_header);
294#endif /* CONFIG_PPC_85xx || CONFIG_PPC_86xx */ 299#endif /* CONFIG_PPC_85xx || CONFIG_PPC_86xx */
295 300
296#if defined(CONFIG_PPC_83xx) || defined(CONFIG_PPC_MPC512x) 301#if defined(CONFIG_PPC_83xx) || defined(CONFIG_PPC_MPC512x)
302DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8314E, quirk_fsl_pcie_header);
303DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8314, quirk_fsl_pcie_header);
304DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8315E, quirk_fsl_pcie_header);
305DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8315, quirk_fsl_pcie_header);
306DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8377E, quirk_fsl_pcie_header);
307DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8377, quirk_fsl_pcie_header);
308DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8378E, quirk_fsl_pcie_header);
309DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8378, quirk_fsl_pcie_header);
310
311struct mpc83xx_pcie_priv {
312 void __iomem *cfg_type0;
313 void __iomem *cfg_type1;
314 u32 dev_base;
315};
316
317/*
318 * With the convention of u-boot, the PCIE outbound window 0 serves
319 * as configuration transactions outbound.
320 */
321#define PEX_OUTWIN0_BAR 0xCA4
322#define PEX_OUTWIN0_TAL 0xCA8
323#define PEX_OUTWIN0_TAH 0xCAC
324
325static int mpc83xx_pcie_exclude_device(struct pci_bus *bus, unsigned int devfn)
326{
327 struct pci_controller *hose = bus->sysdata;
328
329 if (hose->indirect_type & PPC_INDIRECT_TYPE_NO_PCIE_LINK)
330 return PCIBIOS_DEVICE_NOT_FOUND;
331 /*
332 * Workaround for the HW bug: for Type 0 configure transactions the
333 * PCI-E controller does not check the device number bits and just
334 * assumes that the device number bits are 0.
335 */
336 if (bus->number == hose->first_busno ||
337 bus->primary == hose->first_busno) {
338 if (devfn & 0xf8)
339 return PCIBIOS_DEVICE_NOT_FOUND;
340 }
341
342 if (ppc_md.pci_exclude_device) {
343 if (ppc_md.pci_exclude_device(hose, bus->number, devfn))
344 return PCIBIOS_DEVICE_NOT_FOUND;
345 }
346
347 return PCIBIOS_SUCCESSFUL;
348}
349
350static void __iomem *mpc83xx_pcie_remap_cfg(struct pci_bus *bus,
351 unsigned int devfn, int offset)
352{
353 struct pci_controller *hose = bus->sysdata;
354 struct mpc83xx_pcie_priv *pcie = hose->dn->data;
355 u8 bus_no = bus->number - hose->first_busno;
356 u32 dev_base = bus_no << 24 | devfn << 16;
357 int ret;
358
359 ret = mpc83xx_pcie_exclude_device(bus, devfn);
360 if (ret)
361 return NULL;
362
363 offset &= 0xfff;
364
365 /* Type 0 */
366 if (bus->number == hose->first_busno)
367 return pcie->cfg_type0 + offset;
368
369 if (pcie->dev_base == dev_base)
370 goto mapped;
371
372 out_le32(pcie->cfg_type0 + PEX_OUTWIN0_TAL, dev_base);
373
374 pcie->dev_base = dev_base;
375mapped:
376 return pcie->cfg_type1 + offset;
377}
378
379static int mpc83xx_pcie_read_config(struct pci_bus *bus, unsigned int devfn,
380 int offset, int len, u32 *val)
381{
382 void __iomem *cfg_addr;
383
384 cfg_addr = mpc83xx_pcie_remap_cfg(bus, devfn, offset);
385 if (!cfg_addr)
386 return PCIBIOS_DEVICE_NOT_FOUND;
387
388 switch (len) {
389 case 1:
390 *val = in_8(cfg_addr);
391 break;
392 case 2:
393 *val = in_le16(cfg_addr);
394 break;
395 default:
396 *val = in_le32(cfg_addr);
397 break;
398 }
399
400 return PCIBIOS_SUCCESSFUL;
401}
402
403static int mpc83xx_pcie_write_config(struct pci_bus *bus, unsigned int devfn,
404 int offset, int len, u32 val)
405{
406 void __iomem *cfg_addr;
407
408 cfg_addr = mpc83xx_pcie_remap_cfg(bus, devfn, offset);
409 if (!cfg_addr)
410 return PCIBIOS_DEVICE_NOT_FOUND;
411
412 switch (len) {
413 case 1:
414 out_8(cfg_addr, val);
415 break;
416 case 2:
417 out_le16(cfg_addr, val);
418 break;
419 default:
420 out_le32(cfg_addr, val);
421 break;
422 }
423
424 return PCIBIOS_SUCCESSFUL;
425}
426
427static struct pci_ops mpc83xx_pcie_ops = {
428 .read = mpc83xx_pcie_read_config,
429 .write = mpc83xx_pcie_write_config,
430};
431
432static int __init mpc83xx_pcie_setup(struct pci_controller *hose,
433 struct resource *reg)
434{
435 struct mpc83xx_pcie_priv *pcie;
436 u32 cfg_bar;
437 int ret = -ENOMEM;
438
439 pcie = zalloc_maybe_bootmem(sizeof(*pcie), GFP_KERNEL);
440 if (!pcie)
441 return ret;
442
443 pcie->cfg_type0 = ioremap(reg->start, resource_size(reg));
444 if (!pcie->cfg_type0)
445 goto err0;
446
447 cfg_bar = in_le32(pcie->cfg_type0 + PEX_OUTWIN0_BAR);
448 if (!cfg_bar) {
449 /* PCI-E isn't configured. */
450 ret = -ENODEV;
451 goto err1;
452 }
453
454 pcie->cfg_type1 = ioremap(cfg_bar, 0x1000);
455 if (!pcie->cfg_type1)
456 goto err1;
457
458 WARN_ON(hose->dn->data);
459 hose->dn->data = pcie;
460 hose->ops = &mpc83xx_pcie_ops;
461
462 out_le32(pcie->cfg_type0 + PEX_OUTWIN0_TAH, 0);
463 out_le32(pcie->cfg_type0 + PEX_OUTWIN0_TAL, 0);
464
465 if (fsl_pcie_check_link(hose))
466 hose->indirect_type |= PPC_INDIRECT_TYPE_NO_PCIE_LINK;
467
468 return 0;
469err1:
470 iounmap(pcie->cfg_type0);
471err0:
472 kfree(pcie);
473 return ret;
474
475}
476
297int __init mpc83xx_add_bridge(struct device_node *dev) 477int __init mpc83xx_add_bridge(struct device_node *dev)
298{ 478{
479 int ret;
299 int len; 480 int len;
300 struct pci_controller *hose; 481 struct pci_controller *hose;
301 struct resource rsrc_reg; 482 struct resource rsrc_reg;
@@ -303,6 +484,11 @@ int __init mpc83xx_add_bridge(struct device_node *dev)
303 const int *bus_range; 484 const int *bus_range;
304 int primary; 485 int primary;
305 486
487 if (!of_device_is_available(dev)) {
488 pr_warning("%s: disabled by the firmware.\n",
489 dev->full_name);
490 return -ENODEV;
491 }
306 pr_debug("Adding PCI host bridge %s\n", dev->full_name); 492 pr_debug("Adding PCI host bridge %s\n", dev->full_name);
307 493
308 /* Fetch host bridge registers address */ 494 /* Fetch host bridge registers address */
@@ -350,7 +536,14 @@ int __init mpc83xx_add_bridge(struct device_node *dev)
350 hose->first_busno = bus_range ? bus_range[0] : 0; 536 hose->first_busno = bus_range ? bus_range[0] : 0;
351 hose->last_busno = bus_range ? bus_range[1] : 0xff; 537 hose->last_busno = bus_range ? bus_range[1] : 0xff;
352 538
353 setup_indirect_pci(hose, rsrc_cfg.start, rsrc_cfg.start + 4, 0); 539 if (of_device_is_compatible(dev, "fsl,mpc8314-pcie")) {
540 ret = mpc83xx_pcie_setup(hose, &rsrc_reg);
541 if (ret)
542 goto err0;
543 } else {
544 setup_indirect_pci(hose, rsrc_cfg.start,
545 rsrc_cfg.start + 4, 0);
546 }
354 547
355 printk(KERN_INFO "Found FSL PCI host bridge at 0x%016llx. " 548 printk(KERN_INFO "Found FSL PCI host bridge at 0x%016llx. "
356 "Firmware bus number: %d->%d\n", 549 "Firmware bus number: %d->%d\n",
@@ -365,5 +558,8 @@ int __init mpc83xx_add_bridge(struct device_node *dev)
365 pci_process_bridge_OF_ranges(hose, dev, primary); 558 pci_process_bridge_OF_ranges(hose, dev, primary);
366 559
367 return 0; 560 return 0;
561err0:
562 pcibios_free_controller(hose);
563 return ret;
368} 564}
369#endif /* CONFIG_PPC_83xx */ 565#endif /* CONFIG_PPC_83xx */
diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c
index 115cb16351fd..a01c89d3f9bd 100644
--- a/arch/powerpc/sysdev/fsl_soc.c
+++ b/arch/powerpc/sysdev/fsl_soc.c
@@ -22,6 +22,7 @@
22#include <linux/module.h> 22#include <linux/module.h>
23#include <linux/device.h> 23#include <linux/device.h>
24#include <linux/platform_device.h> 24#include <linux/platform_device.h>
25#include <linux/of.h>
25#include <linux/of_platform.h> 26#include <linux/of_platform.h>
26#include <linux/phy.h> 27#include <linux/phy.h>
27#include <linux/phy_fixed.h> 28#include <linux/phy_fixed.h>
@@ -328,6 +329,9 @@ static int __init fsl_usb_of_init(void)
328 struct fsl_usb2_platform_data usb_data; 329 struct fsl_usb2_platform_data usb_data;
329 const unsigned char *prop = NULL; 330 const unsigned char *prop = NULL;
330 331
332 if (!of_device_is_available(np))
333 continue;
334
331 memset(&r, 0, sizeof(r)); 335 memset(&r, 0, sizeof(r));
332 memset(&usb_data, 0, sizeof(usb_data)); 336 memset(&usb_data, 0, sizeof(usb_data));
333 337
diff --git a/arch/powerpc/sysdev/ipic.c b/arch/powerpc/sysdev/ipic.c
index 9a89cd3e80a2..a86d3ce01ead 100644
--- a/arch/powerpc/sysdev/ipic.c
+++ b/arch/powerpc/sysdev/ipic.c
@@ -568,8 +568,7 @@ static void ipic_ack_irq(unsigned int virq)
568 568
569 spin_lock_irqsave(&ipic_lock, flags); 569 spin_lock_irqsave(&ipic_lock, flags);
570 570
571 temp = ipic_read(ipic->regs, ipic_info[src].ack); 571 temp = 1 << (31 - ipic_info[src].bit);
572 temp |= (1 << (31 - ipic_info[src].bit));
573 ipic_write(ipic->regs, ipic_info[src].ack, temp); 572 ipic_write(ipic->regs, ipic_info[src].ack, temp);
574 573
575 /* mb() can't guarantee that ack is finished. But it does finish 574 /* mb() can't guarantee that ack is finished. But it does finish
@@ -592,8 +591,7 @@ static void ipic_mask_irq_and_ack(unsigned int virq)
592 temp &= ~(1 << (31 - ipic_info[src].bit)); 591 temp &= ~(1 << (31 - ipic_info[src].bit));
593 ipic_write(ipic->regs, ipic_info[src].mask, temp); 592 ipic_write(ipic->regs, ipic_info[src].mask, temp);
594 593
595 temp = ipic_read(ipic->regs, ipic_info[src].ack); 594 temp = 1 << (31 - ipic_info[src].bit);
596 temp |= (1 << (31 - ipic_info[src].bit));
597 ipic_write(ipic->regs, ipic_info[src].ack, temp); 595 ipic_write(ipic->regs, ipic_info[src].ack, temp);
598 596
599 /* mb() can't guarantee that ack is finished. But it does finish 597 /* mb() can't guarantee that ack is finished. But it does finish
diff --git a/arch/powerpc/sysdev/msi_bitmap.c b/arch/powerpc/sysdev/msi_bitmap.c
index f84217b8863a..5a32cbef9b6c 100644
--- a/arch/powerpc/sysdev/msi_bitmap.c
+++ b/arch/powerpc/sysdev/msi_bitmap.c
@@ -141,7 +141,7 @@ void msi_bitmap_free(struct msi_bitmap *bmp)
141#define check(x) \ 141#define check(x) \
142 if (!(x)) printk("msi_bitmap: test failed at line %d\n", __LINE__); 142 if (!(x)) printk("msi_bitmap: test failed at line %d\n", __LINE__);
143 143
144void test_basics(void) 144void __init test_basics(void)
145{ 145{
146 struct msi_bitmap bmp; 146 struct msi_bitmap bmp;
147 int i, size = 512; 147 int i, size = 512;
@@ -186,7 +186,7 @@ void test_basics(void)
186 kfree(bmp.bitmap); 186 kfree(bmp.bitmap);
187} 187}
188 188
189void test_of_node(void) 189void __init test_of_node(void)
190{ 190{
191 u32 prop_data[] = { 10, 10, 25, 3, 40, 1, 100, 100, 200, 20 }; 191 u32 prop_data[] = { 10, 10, 25, 3, 40, 1, 100, 100, 200, 20 };
192 const char *expected_str = "0-9,20-24,28-39,41-99,220-255"; 192 const char *expected_str = "0-9,20-24,28-39,41-99,220-255";
@@ -234,7 +234,7 @@ void test_of_node(void)
234 kfree(bmp.bitmap); 234 kfree(bmp.bitmap);
235} 235}
236 236
237int msi_bitmap_selftest(void) 237int __init msi_bitmap_selftest(void)
238{ 238{
239 printk(KERN_DEBUG "Running MSI bitmap self-tests ...\n"); 239 printk(KERN_DEBUG "Running MSI bitmap self-tests ...\n");
240 240
diff --git a/arch/powerpc/sysdev/pmi.c b/arch/powerpc/sysdev/pmi.c
index c858749263e0..aaa915998eb6 100644
--- a/arch/powerpc/sysdev/pmi.c
+++ b/arch/powerpc/sysdev/pmi.c
@@ -50,7 +50,7 @@ struct pmi_data {
50 50
51static struct pmi_data *data; 51static struct pmi_data *data;
52 52
53static int pmi_irq_handler(int irq, void *dev_id) 53static irqreturn_t pmi_irq_handler(int irq, void *dev_id)
54{ 54{
55 u8 type; 55 u8 type;
56 int rc; 56 int rc;
diff --git a/arch/powerpc/sysdev/ppc4xx_pci.c b/arch/powerpc/sysdev/ppc4xx_pci.c
index 5558d932b4d5..6a2d473c345a 100644
--- a/arch/powerpc/sysdev/ppc4xx_pci.c
+++ b/arch/powerpc/sysdev/ppc4xx_pci.c
@@ -1839,6 +1839,8 @@ static int __init ppc4xx_pci_find_bridges(void)
1839{ 1839{
1840 struct device_node *np; 1840 struct device_node *np;
1841 1841
1842 ppc_pci_flags |= PPC_PCI_ENABLE_PROC_DOMAINS | PPC_PCI_COMPAT_DOMAIN_0;
1843
1842#ifdef CONFIG_PPC4xx_PCI_EXPRESS 1844#ifdef CONFIG_PPC4xx_PCI_EXPRESS
1843 for_each_compatible_node(np, NULL, "ibm,plb-pciex") 1845 for_each_compatible_node(np, NULL, "ibm,plb-pciex")
1844 ppc4xx_probe_pciex_bridge(np); 1846 ppc4xx_probe_pciex_bridge(np);
diff --git a/arch/sh/boards/board-ap325rxa.c b/arch/sh/boards/board-ap325rxa.c
index a64e38841c49..e27655b8a98d 100644
--- a/arch/sh/boards/board-ap325rxa.c
+++ b/arch/sh/boards/board-ap325rxa.c
@@ -310,7 +310,8 @@ static struct platform_device camera_device = {
310 310
311static struct sh_mobile_ceu_info sh_mobile_ceu_info = { 311static struct sh_mobile_ceu_info sh_mobile_ceu_info = {
312 .flags = SOCAM_PCLK_SAMPLE_RISING | SOCAM_HSYNC_ACTIVE_HIGH | 312 .flags = SOCAM_PCLK_SAMPLE_RISING | SOCAM_HSYNC_ACTIVE_HIGH |
313 SOCAM_VSYNC_ACTIVE_HIGH | SOCAM_MASTER | SOCAM_DATAWIDTH_8, 313 SOCAM_VSYNC_ACTIVE_HIGH | SOCAM_DATA_ACTIVE_HIGH | SOCAM_MASTER |
314 SOCAM_DATAWIDTH_8,
314}; 315};
315 316
316static struct resource ceu_resources[] = { 317static struct resource ceu_resources[] = {
diff --git a/arch/sh/boards/mach-migor/setup.c b/arch/sh/boards/mach-migor/setup.c
index bc35b4cae6b3..4fd6a727873c 100644
--- a/arch/sh/boards/mach-migor/setup.c
+++ b/arch/sh/boards/mach-migor/setup.c
@@ -352,8 +352,9 @@ static int tw9910_power(struct device *dev, int mode)
352} 352}
353 353
354static struct sh_mobile_ceu_info sh_mobile_ceu_info = { 354static struct sh_mobile_ceu_info sh_mobile_ceu_info = {
355 .flags = SOCAM_MASTER | SOCAM_DATAWIDTH_8 | SOCAM_PCLK_SAMPLE_RISING \ 355 .flags = SOCAM_MASTER | SOCAM_DATAWIDTH_8 | SOCAM_PCLK_SAMPLE_RISING
356 | SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_VSYNC_ACTIVE_HIGH, 356 | SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_VSYNC_ACTIVE_HIGH
357 | SOCAM_DATA_ACTIVE_HIGH,
357}; 358};
358 359
359static struct resource migor_ceu_resources[] = { 360static struct resource migor_ceu_resources[] = {
diff --git a/arch/sh/include/asm/topology.h b/arch/sh/include/asm/topology.h
index 066f0fba590e..a3f239545897 100644
--- a/arch/sh/include/asm/topology.h
+++ b/arch/sh/include/asm/topology.h
@@ -33,7 +33,6 @@
33 33
34#define node_to_cpumask(node) ((void)node, cpu_online_map) 34#define node_to_cpumask(node) ((void)node, cpu_online_map)
35#define cpumask_of_node(node) ((void)node, cpu_online_mask) 35#define cpumask_of_node(node) ((void)node, cpu_online_mask)
36#define node_to_first_cpu(node) ((void)(node),0)
37 36
38#define pcibus_to_node(bus) ((void)(bus), -1) 37#define pcibus_to_node(bus) ((void)(bus), -1)
39#define pcibus_to_cpumask(bus) (pcibus_to_node(bus) == -1 ? \ 38#define pcibus_to_cpumask(bus) (pcibus_to_node(bus) == -1 ? \
diff --git a/arch/sh/kernel/time_64.c b/arch/sh/kernel/time_64.c
index 59d2a03e8b3c..988c77c37231 100644
--- a/arch/sh/kernel/time_64.c
+++ b/arch/sh/kernel/time_64.c
@@ -284,7 +284,6 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id)
284static struct irqaction irq0 = { 284static struct irqaction irq0 = {
285 .handler = timer_interrupt, 285 .handler = timer_interrupt,
286 .flags = IRQF_DISABLED, 286 .flags = IRQF_DISABLED,
287 .mask = CPU_MASK_NONE,
288 .name = "timer", 287 .name = "timer",
289}; 288};
290 289
diff --git a/arch/sh/kernel/timers/timer-cmt.c b/arch/sh/kernel/timers/timer-cmt.c
index c127293271e1..9aa348658ae3 100644
--- a/arch/sh/kernel/timers/timer-cmt.c
+++ b/arch/sh/kernel/timers/timer-cmt.c
@@ -109,7 +109,6 @@ static struct irqaction cmt_irq = {
109 .name = "timer", 109 .name = "timer",
110 .handler = cmt_timer_interrupt, 110 .handler = cmt_timer_interrupt,
111 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, 111 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
112 .mask = CPU_MASK_NONE,
113}; 112};
114 113
115static void cmt_clk_init(struct clk *clk) 114static void cmt_clk_init(struct clk *clk)
diff --git a/arch/sh/kernel/timers/timer-mtu2.c b/arch/sh/kernel/timers/timer-mtu2.c
index 9a77ae86b403..9b0ef0126479 100644
--- a/arch/sh/kernel/timers/timer-mtu2.c
+++ b/arch/sh/kernel/timers/timer-mtu2.c
@@ -115,7 +115,6 @@ static struct irqaction mtu2_irq = {
115 .name = "timer", 115 .name = "timer",
116 .handler = mtu2_timer_interrupt, 116 .handler = mtu2_timer_interrupt,
117 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, 117 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
118 .mask = CPU_MASK_NONE,
119}; 118};
120 119
121static unsigned int divisors[] = { 1, 4, 16, 64, 1, 1, 256 }; 120static unsigned int divisors[] = { 1, 4, 16, 64, 1, 1, 256 };
diff --git a/arch/sh/kernel/timers/timer-tmu.c b/arch/sh/kernel/timers/timer-tmu.c
index 10b5a6f17cc0..c5d3396f5960 100644
--- a/arch/sh/kernel/timers/timer-tmu.c
+++ b/arch/sh/kernel/timers/timer-tmu.c
@@ -162,7 +162,6 @@ static struct irqaction tmu0_irq = {
162 .name = "periodic/oneshot timer", 162 .name = "periodic/oneshot timer",
163 .handler = tmu_timer_interrupt, 163 .handler = tmu_timer_interrupt,
164 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, 164 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
165 .mask = CPU_MASK_NONE,
166}; 165};
167 166
168static void __init tmu_clk_init(struct clk *clk) 167static void __init tmu_clk_init(struct clk *clk)
diff --git a/arch/sparc/include/asm/mmu_context_64.h b/arch/sparc/include/asm/mmu_context_64.h
index 5693ab482606..666a73fef28d 100644
--- a/arch/sparc/include/asm/mmu_context_64.h
+++ b/arch/sparc/include/asm/mmu_context_64.h
@@ -121,8 +121,8 @@ static inline void switch_mm(struct mm_struct *old_mm, struct mm_struct *mm, str
121 * local TLB. 121 * local TLB.
122 */ 122 */
123 cpu = smp_processor_id(); 123 cpu = smp_processor_id();
124 if (!ctx_valid || !cpu_isset(cpu, mm->cpu_vm_mask)) { 124 if (!ctx_valid || !cpumask_test_cpu(cpu, mm_cpumask(mm))) {
125 cpu_set(cpu, mm->cpu_vm_mask); 125 cpumask_set_cpu(cpu, mm_cpumask(mm));
126 __flush_tlb_mm(CTX_HWBITS(mm->context), 126 __flush_tlb_mm(CTX_HWBITS(mm->context),
127 SECONDARY_CONTEXT); 127 SECONDARY_CONTEXT);
128 } 128 }
@@ -141,8 +141,8 @@ static inline void activate_mm(struct mm_struct *active_mm, struct mm_struct *mm
141 if (!CTX_VALID(mm->context)) 141 if (!CTX_VALID(mm->context))
142 get_new_mmu_context(mm); 142 get_new_mmu_context(mm);
143 cpu = smp_processor_id(); 143 cpu = smp_processor_id();
144 if (!cpu_isset(cpu, mm->cpu_vm_mask)) 144 if (!cpumask_test_cpu(cpu, mm_cpumask(mm)))
145 cpu_set(cpu, mm->cpu_vm_mask); 145 cpumask_set_cpu(cpu, mm_cpumask(mm));
146 146
147 load_secondary_context(mm); 147 load_secondary_context(mm);
148 __flush_tlb_mm(CTX_HWBITS(mm->context), SECONDARY_CONTEXT); 148 __flush_tlb_mm(CTX_HWBITS(mm->context), SECONDARY_CONTEXT);
diff --git a/arch/sparc/include/asm/smp_64.h b/arch/sparc/include/asm/smp_64.h
index 57224dd37b3a..becb6bf353a9 100644
--- a/arch/sparc/include/asm/smp_64.h
+++ b/arch/sparc/include/asm/smp_64.h
@@ -35,7 +35,8 @@ extern cpumask_t cpu_core_map[NR_CPUS];
35extern int sparc64_multi_core; 35extern int sparc64_multi_core;
36 36
37extern void arch_send_call_function_single_ipi(int cpu); 37extern void arch_send_call_function_single_ipi(int cpu);
38extern void arch_send_call_function_ipi(cpumask_t mask); 38extern void arch_send_call_function_ipi_mask(const struct cpumask *mask);
39#define arch_send_call_function_ipi_mask arch_send_call_function_ipi_mask
39 40
40/* 41/*
41 * General functions that each host system must provide. 42 * General functions that each host system must provide.
diff --git a/arch/sparc/include/asm/system_32.h b/arch/sparc/include/asm/system_32.h
index 79c1ae2b42a3..751c8c17f5a0 100644
--- a/arch/sparc/include/asm/system_32.h
+++ b/arch/sparc/include/asm/system_32.h
@@ -126,7 +126,7 @@ extern void flushw_all(void);
126#define switch_to(prev, next, last) do { \ 126#define switch_to(prev, next, last) do { \
127 SWITCH_ENTER(prev); \ 127 SWITCH_ENTER(prev); \
128 SWITCH_DO_LAZY_FPU(next); \ 128 SWITCH_DO_LAZY_FPU(next); \
129 cpu_set(smp_processor_id(), next->active_mm->cpu_vm_mask); \ 129 cpumask_set_cpu(smp_processor_id(), mm_cpumask(next->active_mm)); \
130 __asm__ __volatile__( \ 130 __asm__ __volatile__( \
131 "sethi %%hi(here - 0x8), %%o7\n\t" \ 131 "sethi %%hi(here - 0x8), %%o7\n\t" \
132 "mov %%g6, %%g3\n\t" \ 132 "mov %%g6, %%g3\n\t" \
diff --git a/arch/sparc/include/asm/topology_64.h b/arch/sparc/include/asm/topology_64.h
index 5bc0b8fd6374..e5ea8d332421 100644
--- a/arch/sparc/include/asm/topology_64.h
+++ b/arch/sparc/include/asm/topology_64.h
@@ -28,11 +28,6 @@ static inline cpumask_t node_to_cpumask(int node)
28#define node_to_cpumask_ptr_next(v, node) \ 28#define node_to_cpumask_ptr_next(v, node) \
29 v = &(numa_cpumask_lookup_table[node]) 29 v = &(numa_cpumask_lookup_table[node])
30 30
31static inline int node_to_first_cpu(int node)
32{
33 return cpumask_first(cpumask_of_node(node));
34}
35
36struct pci_bus; 31struct pci_bus;
37#ifdef CONFIG_PCI 32#ifdef CONFIG_PCI
38extern int pcibus_to_node(struct pci_bus *pbus); 33extern int pcibus_to_node(struct pci_bus *pbus);
@@ -43,13 +38,9 @@ static inline int pcibus_to_node(struct pci_bus *pbus)
43} 38}
44#endif 39#endif
45 40
46#define pcibus_to_cpumask(bus) \
47 (pcibus_to_node(bus) == -1 ? \
48 CPU_MASK_ALL : \
49 node_to_cpumask(pcibus_to_node(bus)))
50#define cpumask_of_pcibus(bus) \ 41#define cpumask_of_pcibus(bus) \
51 (pcibus_to_node(bus) == -1 ? \ 42 (pcibus_to_node(bus) == -1 ? \
52 CPU_MASK_ALL_PTR : \ 43 cpu_all_mask : \
53 cpumask_of_node(pcibus_to_node(bus))) 44 cpumask_of_node(pcibus_to_node(bus)))
54 45
55#define SD_NODE_INIT (struct sched_domain) { \ 46#define SD_NODE_INIT (struct sched_domain) { \
@@ -89,7 +80,6 @@ static inline int pcibus_to_node(struct pci_bus *pbus)
89#define smt_capable() (sparc64_multi_core) 80#define smt_capable() (sparc64_multi_core)
90#endif /* CONFIG_SMP */ 81#endif /* CONFIG_SMP */
91 82
92#define cpu_coregroup_map(cpu) (cpu_core_map[cpu])
93#define cpu_coregroup_mask(cpu) (&cpu_core_map[cpu]) 83#define cpu_coregroup_mask(cpu) (&cpu_core_map[cpu])
94 84
95#endif /* _ASM_SPARC64_TOPOLOGY_H */ 85#endif /* _ASM_SPARC64_TOPOLOGY_H */
diff --git a/arch/sparc/kernel/ds.c b/arch/sparc/kernel/ds.c
index 57c39843fb2a..90350f838f05 100644
--- a/arch/sparc/kernel/ds.c
+++ b/arch/sparc/kernel/ds.c
@@ -653,7 +653,7 @@ static void __cpuinit dr_cpu_data(struct ds_info *dp,
653 if (cpu_list[i] == CPU_SENTINEL) 653 if (cpu_list[i] == CPU_SENTINEL)
654 continue; 654 continue;
655 655
656 if (cpu_list[i] < NR_CPUS) 656 if (cpu_list[i] < nr_cpu_ids)
657 cpu_set(cpu_list[i], mask); 657 cpu_set(cpu_list[i], mask);
658 } 658 }
659 659
diff --git a/arch/sparc/kernel/irq_32.c b/arch/sparc/kernel/irq_32.c
index 44dd5ee64339..ad800b80c718 100644
--- a/arch/sparc/kernel/irq_32.c
+++ b/arch/sparc/kernel/irq_32.c
@@ -439,7 +439,6 @@ static int request_fast_irq(unsigned int irq,
439 flush_cache_all(); 439 flush_cache_all();
440 440
441 action->flags = irqflags; 441 action->flags = irqflags;
442 cpus_clear(action->mask);
443 action->name = devname; 442 action->name = devname;
444 action->dev_id = NULL; 443 action->dev_id = NULL;
445 action->next = NULL; 444 action->next = NULL;
@@ -574,7 +573,6 @@ int request_irq(unsigned int irq,
574 573
575 action->handler = handler; 574 action->handler = handler;
576 action->flags = irqflags; 575 action->flags = irqflags;
577 cpus_clear(action->mask);
578 action->name = devname; 576 action->name = devname;
579 action->next = NULL; 577 action->next = NULL;
580 action->dev_id = dev_id; 578 action->dev_id = dev_id;
diff --git a/arch/sparc/kernel/irq_64.c b/arch/sparc/kernel/irq_64.c
index d0d6a515499a..5deabe921a47 100644
--- a/arch/sparc/kernel/irq_64.c
+++ b/arch/sparc/kernel/irq_64.c
@@ -266,12 +266,12 @@ static int irq_choose_cpu(unsigned int virt_irq)
266 spin_lock_irqsave(&irq_rover_lock, flags); 266 spin_lock_irqsave(&irq_rover_lock, flags);
267 267
268 while (!cpu_online(irq_rover)) { 268 while (!cpu_online(irq_rover)) {
269 if (++irq_rover >= NR_CPUS) 269 if (++irq_rover >= nr_cpu_ids)
270 irq_rover = 0; 270 irq_rover = 0;
271 } 271 }
272 cpuid = irq_rover; 272 cpuid = irq_rover;
273 do { 273 do {
274 if (++irq_rover >= NR_CPUS) 274 if (++irq_rover >= nr_cpu_ids)
275 irq_rover = 0; 275 irq_rover = 0;
276 } while (!cpu_online(irq_rover)); 276 } while (!cpu_online(irq_rover));
277 277
diff --git a/arch/sparc/kernel/led.c b/arch/sparc/kernel/led.c
index adaaed4ea2fb..00d034ea2164 100644
--- a/arch/sparc/kernel/led.c
+++ b/arch/sparc/kernel/led.c
@@ -126,7 +126,6 @@ static int __init led_init(void)
126 led = proc_create("led", 0, NULL, &led_proc_fops); 126 led = proc_create("led", 0, NULL, &led_proc_fops);
127 if (!led) 127 if (!led)
128 return -ENOMEM; 128 return -ENOMEM;
129 led->owner = THIS_MODULE;
130 129
131 printk(KERN_INFO 130 printk(KERN_INFO
132 "led: version %s, Lars Kotthoff <metalhead@metalhead.ws>\n", 131 "led: version %s, Lars Kotthoff <metalhead@metalhead.ws>\n",
diff --git a/arch/sparc/kernel/mdesc.c b/arch/sparc/kernel/mdesc.c
index 3f79f0c23a08..f0e6ed23a468 100644
--- a/arch/sparc/kernel/mdesc.c
+++ b/arch/sparc/kernel/mdesc.c
@@ -567,7 +567,7 @@ static void __init report_platform_properties(void)
567 max_cpu = NR_CPUS; 567 max_cpu = NR_CPUS;
568 } 568 }
569 for (i = 0; i < max_cpu; i++) 569 for (i = 0; i < max_cpu; i++)
570 cpu_set(i, cpu_possible_map); 570 set_cpu_possible(i, true);
571 } 571 }
572#endif 572#endif
573 573
diff --git a/arch/sparc/kernel/nmi.c b/arch/sparc/kernel/nmi.c
index f3577223c863..2c0cc72d295b 100644
--- a/arch/sparc/kernel/nmi.c
+++ b/arch/sparc/kernel/nmi.c
@@ -13,6 +13,7 @@
13#include <linux/module.h> 13#include <linux/module.h>
14#include <linux/kprobes.h> 14#include <linux/kprobes.h>
15#include <linux/kernel_stat.h> 15#include <linux/kernel_stat.h>
16#include <linux/reboot.h>
16#include <linux/slab.h> 17#include <linux/slab.h>
17#include <linux/kdebug.h> 18#include <linux/kdebug.h>
18#include <linux/delay.h> 19#include <linux/delay.h>
@@ -206,13 +207,33 @@ void nmi_adjust_hz(unsigned int new_hz)
206} 207}
207EXPORT_SYMBOL_GPL(nmi_adjust_hz); 208EXPORT_SYMBOL_GPL(nmi_adjust_hz);
208 209
210static int nmi_shutdown(struct notifier_block *nb, unsigned long cmd, void *p)
211{
212 on_each_cpu(stop_watchdog, NULL, 1);
213 return 0;
214}
215
216static struct notifier_block nmi_reboot_notifier = {
217 .notifier_call = nmi_shutdown,
218};
219
209int __init nmi_init(void) 220int __init nmi_init(void)
210{ 221{
222 int err;
223
211 nmi_usable = 1; 224 nmi_usable = 1;
212 225
213 on_each_cpu(start_watchdog, NULL, 1); 226 on_each_cpu(start_watchdog, NULL, 1);
214 227
215 return check_nmi_watchdog(); 228 err = check_nmi_watchdog();
229 if (!err) {
230 err = register_reboot_notifier(&nmi_reboot_notifier);
231 if (err) {
232 nmi_usable = 0;
233 on_each_cpu(stop_watchdog, NULL, 1);
234 }
235 }
236 return err;
216} 237}
217 238
218static int __init setup_nmi_watchdog(char *str) 239static int __init setup_nmi_watchdog(char *str)
diff --git a/arch/sparc/kernel/prom_64.c b/arch/sparc/kernel/prom_64.c
index edecca7b8116..ca55c7012f77 100644
--- a/arch/sparc/kernel/prom_64.c
+++ b/arch/sparc/kernel/prom_64.c
@@ -518,8 +518,8 @@ void __init of_fill_in_cpu_data(void)
518 } 518 }
519 519
520#ifdef CONFIG_SMP 520#ifdef CONFIG_SMP
521 cpu_set(cpuid, cpu_present_map); 521 set_cpu_present(cpuid, true);
522 cpu_set(cpuid, cpu_possible_map); 522 set_cpu_possible(cpuid, true);
523#endif 523#endif
524 } 524 }
525 525
diff --git a/arch/sparc/kernel/smp_32.c b/arch/sparc/kernel/smp_32.c
index 1e5ac4e282e1..132d81fb2616 100644
--- a/arch/sparc/kernel/smp_32.c
+++ b/arch/sparc/kernel/smp_32.c
@@ -70,13 +70,12 @@ void __init smp_cpus_done(unsigned int max_cpus)
70 extern void smp4m_smp_done(void); 70 extern void smp4m_smp_done(void);
71 extern void smp4d_smp_done(void); 71 extern void smp4d_smp_done(void);
72 unsigned long bogosum = 0; 72 unsigned long bogosum = 0;
73 int cpu, num; 73 int cpu, num = 0;
74 74
75 for (cpu = 0, num = 0; cpu < NR_CPUS; cpu++) 75 for_each_online_cpu(cpu) {
76 if (cpu_online(cpu)) { 76 num++;
77 num++; 77 bogosum += cpu_data(cpu).udelay_val;
78 bogosum += cpu_data(cpu).udelay_val; 78 }
79 }
80 79
81 printk("Total of %d processors activated (%lu.%02lu BogoMIPS).\n", 80 printk("Total of %d processors activated (%lu.%02lu BogoMIPS).\n",
82 num, bogosum/(500000/HZ), 81 num, bogosum/(500000/HZ),
@@ -144,7 +143,7 @@ void smp_flush_tlb_all(void)
144void smp_flush_cache_mm(struct mm_struct *mm) 143void smp_flush_cache_mm(struct mm_struct *mm)
145{ 144{
146 if(mm->context != NO_CONTEXT) { 145 if(mm->context != NO_CONTEXT) {
147 cpumask_t cpu_mask = mm->cpu_vm_mask; 146 cpumask_t cpu_mask = *mm_cpumask(mm);
148 cpu_clear(smp_processor_id(), cpu_mask); 147 cpu_clear(smp_processor_id(), cpu_mask);
149 if (!cpus_empty(cpu_mask)) 148 if (!cpus_empty(cpu_mask))
150 xc1((smpfunc_t) BTFIXUP_CALL(local_flush_cache_mm), (unsigned long) mm); 149 xc1((smpfunc_t) BTFIXUP_CALL(local_flush_cache_mm), (unsigned long) mm);
@@ -155,12 +154,13 @@ void smp_flush_cache_mm(struct mm_struct *mm)
155void smp_flush_tlb_mm(struct mm_struct *mm) 154void smp_flush_tlb_mm(struct mm_struct *mm)
156{ 155{
157 if(mm->context != NO_CONTEXT) { 156 if(mm->context != NO_CONTEXT) {
158 cpumask_t cpu_mask = mm->cpu_vm_mask; 157 cpumask_t cpu_mask = *mm_cpumask(mm);
159 cpu_clear(smp_processor_id(), cpu_mask); 158 cpu_clear(smp_processor_id(), cpu_mask);
160 if (!cpus_empty(cpu_mask)) { 159 if (!cpus_empty(cpu_mask)) {
161 xc1((smpfunc_t) BTFIXUP_CALL(local_flush_tlb_mm), (unsigned long) mm); 160 xc1((smpfunc_t) BTFIXUP_CALL(local_flush_tlb_mm), (unsigned long) mm);
162 if(atomic_read(&mm->mm_users) == 1 && current->active_mm == mm) 161 if(atomic_read(&mm->mm_users) == 1 && current->active_mm == mm)
163 mm->cpu_vm_mask = cpumask_of_cpu(smp_processor_id()); 162 cpumask_copy(mm_cpumask(mm),
163 cpumask_of(smp_processor_id()));
164 } 164 }
165 local_flush_tlb_mm(mm); 165 local_flush_tlb_mm(mm);
166 } 166 }
@@ -172,7 +172,7 @@ void smp_flush_cache_range(struct vm_area_struct *vma, unsigned long start,
172 struct mm_struct *mm = vma->vm_mm; 172 struct mm_struct *mm = vma->vm_mm;
173 173
174 if (mm->context != NO_CONTEXT) { 174 if (mm->context != NO_CONTEXT) {
175 cpumask_t cpu_mask = mm->cpu_vm_mask; 175 cpumask_t cpu_mask = *mm_cpumask(mm);
176 cpu_clear(smp_processor_id(), cpu_mask); 176 cpu_clear(smp_processor_id(), cpu_mask);
177 if (!cpus_empty(cpu_mask)) 177 if (!cpus_empty(cpu_mask))
178 xc3((smpfunc_t) BTFIXUP_CALL(local_flush_cache_range), (unsigned long) vma, start, end); 178 xc3((smpfunc_t) BTFIXUP_CALL(local_flush_cache_range), (unsigned long) vma, start, end);
@@ -186,7 +186,7 @@ void smp_flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
186 struct mm_struct *mm = vma->vm_mm; 186 struct mm_struct *mm = vma->vm_mm;
187 187
188 if (mm->context != NO_CONTEXT) { 188 if (mm->context != NO_CONTEXT) {
189 cpumask_t cpu_mask = mm->cpu_vm_mask; 189 cpumask_t cpu_mask = *mm_cpumask(mm);
190 cpu_clear(smp_processor_id(), cpu_mask); 190 cpu_clear(smp_processor_id(), cpu_mask);
191 if (!cpus_empty(cpu_mask)) 191 if (!cpus_empty(cpu_mask))
192 xc3((smpfunc_t) BTFIXUP_CALL(local_flush_tlb_range), (unsigned long) vma, start, end); 192 xc3((smpfunc_t) BTFIXUP_CALL(local_flush_tlb_range), (unsigned long) vma, start, end);
@@ -199,7 +199,7 @@ void smp_flush_cache_page(struct vm_area_struct *vma, unsigned long page)
199 struct mm_struct *mm = vma->vm_mm; 199 struct mm_struct *mm = vma->vm_mm;
200 200
201 if(mm->context != NO_CONTEXT) { 201 if(mm->context != NO_CONTEXT) {
202 cpumask_t cpu_mask = mm->cpu_vm_mask; 202 cpumask_t cpu_mask = *mm_cpumask(mm);
203 cpu_clear(smp_processor_id(), cpu_mask); 203 cpu_clear(smp_processor_id(), cpu_mask);
204 if (!cpus_empty(cpu_mask)) 204 if (!cpus_empty(cpu_mask))
205 xc2((smpfunc_t) BTFIXUP_CALL(local_flush_cache_page), (unsigned long) vma, page); 205 xc2((smpfunc_t) BTFIXUP_CALL(local_flush_cache_page), (unsigned long) vma, page);
@@ -212,7 +212,7 @@ void smp_flush_tlb_page(struct vm_area_struct *vma, unsigned long page)
212 struct mm_struct *mm = vma->vm_mm; 212 struct mm_struct *mm = vma->vm_mm;
213 213
214 if(mm->context != NO_CONTEXT) { 214 if(mm->context != NO_CONTEXT) {
215 cpumask_t cpu_mask = mm->cpu_vm_mask; 215 cpumask_t cpu_mask = *mm_cpumask(mm);
216 cpu_clear(smp_processor_id(), cpu_mask); 216 cpu_clear(smp_processor_id(), cpu_mask);
217 if (!cpus_empty(cpu_mask)) 217 if (!cpus_empty(cpu_mask))
218 xc2((smpfunc_t) BTFIXUP_CALL(local_flush_tlb_page), (unsigned long) vma, page); 218 xc2((smpfunc_t) BTFIXUP_CALL(local_flush_tlb_page), (unsigned long) vma, page);
@@ -241,7 +241,7 @@ void smp_flush_page_to_ram(unsigned long page)
241 241
242void smp_flush_sig_insns(struct mm_struct *mm, unsigned long insn_addr) 242void smp_flush_sig_insns(struct mm_struct *mm, unsigned long insn_addr)
243{ 243{
244 cpumask_t cpu_mask = mm->cpu_vm_mask; 244 cpumask_t cpu_mask = *mm_cpumask(mm);
245 cpu_clear(smp_processor_id(), cpu_mask); 245 cpu_clear(smp_processor_id(), cpu_mask);
246 if (!cpus_empty(cpu_mask)) 246 if (!cpus_empty(cpu_mask))
247 xc2((smpfunc_t) BTFIXUP_CALL(local_flush_sig_insns), (unsigned long) mm, insn_addr); 247 xc2((smpfunc_t) BTFIXUP_CALL(local_flush_sig_insns), (unsigned long) mm, insn_addr);
@@ -332,8 +332,8 @@ void __init smp_setup_cpu_possible_map(void)
332 instance = 0; 332 instance = 0;
333 while (!cpu_find_by_instance(instance, NULL, &mid)) { 333 while (!cpu_find_by_instance(instance, NULL, &mid)) {
334 if (mid < NR_CPUS) { 334 if (mid < NR_CPUS) {
335 cpu_set(mid, cpu_possible_map); 335 set_cpu_possible(mid, true);
336 cpu_set(mid, cpu_present_map); 336 set_cpu_present(mid, true);
337 } 337 }
338 instance++; 338 instance++;
339 } 339 }
@@ -351,8 +351,8 @@ void __init smp_prepare_boot_cpu(void)
351 printk("boot cpu id != 0, this could work but is untested\n"); 351 printk("boot cpu id != 0, this could work but is untested\n");
352 352
353 current_thread_info()->cpu = cpuid; 353 current_thread_info()->cpu = cpuid;
354 cpu_set(cpuid, cpu_online_map); 354 set_cpu_online(cpuid, true);
355 cpu_set(cpuid, cpu_possible_map); 355 set_cpu_possible(cpuid, true);
356} 356}
357 357
358int __cpuinit __cpu_up(unsigned int cpu) 358int __cpuinit __cpu_up(unsigned int cpu)
diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c
index 79457f682b5a..708e12a26b05 100644
--- a/arch/sparc/kernel/smp_64.c
+++ b/arch/sparc/kernel/smp_64.c
@@ -808,9 +808,9 @@ static void smp_start_sync_tick_client(int cpu)
808 808
809extern unsigned long xcall_call_function; 809extern unsigned long xcall_call_function;
810 810
811void arch_send_call_function_ipi(cpumask_t mask) 811void arch_send_call_function_ipi_mask(const struct cpumask *mask)
812{ 812{
813 xcall_deliver((u64) &xcall_call_function, 0, 0, &mask); 813 xcall_deliver((u64) &xcall_call_function, 0, 0, mask);
814} 814}
815 815
816extern unsigned long xcall_call_function_single; 816extern unsigned long xcall_call_function_single;
@@ -850,7 +850,7 @@ static void tsb_sync(void *info)
850 850
851void smp_tsb_sync(struct mm_struct *mm) 851void smp_tsb_sync(struct mm_struct *mm)
852{ 852{
853 smp_call_function_mask(mm->cpu_vm_mask, tsb_sync, mm, 1); 853 smp_call_function_many(mm_cpumask(mm), tsb_sync, mm, 1);
854} 854}
855 855
856extern unsigned long xcall_flush_tlb_mm; 856extern unsigned long xcall_flush_tlb_mm;
@@ -1055,13 +1055,13 @@ void smp_flush_tlb_mm(struct mm_struct *mm)
1055 int cpu = get_cpu(); 1055 int cpu = get_cpu();
1056 1056
1057 if (atomic_read(&mm->mm_users) == 1) { 1057 if (atomic_read(&mm->mm_users) == 1) {
1058 mm->cpu_vm_mask = cpumask_of_cpu(cpu); 1058 cpumask_copy(mm_cpumask(mm), cpumask_of(cpu));
1059 goto local_flush_and_out; 1059 goto local_flush_and_out;
1060 } 1060 }
1061 1061
1062 smp_cross_call_masked(&xcall_flush_tlb_mm, 1062 smp_cross_call_masked(&xcall_flush_tlb_mm,
1063 ctx, 0, 0, 1063 ctx, 0, 0,
1064 &mm->cpu_vm_mask); 1064 mm_cpumask(mm));
1065 1065
1066local_flush_and_out: 1066local_flush_and_out:
1067 __flush_tlb_mm(ctx, SECONDARY_CONTEXT); 1067 __flush_tlb_mm(ctx, SECONDARY_CONTEXT);
@@ -1075,11 +1075,11 @@ void smp_flush_tlb_pending(struct mm_struct *mm, unsigned long nr, unsigned long
1075 int cpu = get_cpu(); 1075 int cpu = get_cpu();
1076 1076
1077 if (mm == current->mm && atomic_read(&mm->mm_users) == 1) 1077 if (mm == current->mm && atomic_read(&mm->mm_users) == 1)
1078 mm->cpu_vm_mask = cpumask_of_cpu(cpu); 1078 cpumask_copy(mm_cpumask(mm), cpumask_of(cpu));
1079 else 1079 else
1080 smp_cross_call_masked(&xcall_flush_tlb_pending, 1080 smp_cross_call_masked(&xcall_flush_tlb_pending,
1081 ctx, nr, (unsigned long) vaddrs, 1081 ctx, nr, (unsigned long) vaddrs,
1082 &mm->cpu_vm_mask); 1082 mm_cpumask(mm));
1083 1083
1084 __flush_tlb_pending(ctx, nr, vaddrs); 1084 __flush_tlb_pending(ctx, nr, vaddrs);
1085 1085
diff --git a/arch/sparc/kernel/sun4d_irq.c b/arch/sparc/kernel/sun4d_irq.c
index 3369fef5b4b3..ab036a72de5a 100644
--- a/arch/sparc/kernel/sun4d_irq.c
+++ b/arch/sparc/kernel/sun4d_irq.c
@@ -326,7 +326,6 @@ int sun4d_request_irq(unsigned int irq,
326 326
327 action->handler = handler; 327 action->handler = handler;
328 action->flags = irqflags; 328 action->flags = irqflags;
329 cpus_clear(action->mask);
330 action->name = devname; 329 action->name = devname;
331 action->next = NULL; 330 action->next = NULL;
332 action->dev_id = dev_id; 331 action->dev_id = dev_id;
diff --git a/arch/sparc/kernel/sun4d_smp.c b/arch/sparc/kernel/sun4d_smp.c
index 50afaed99c8a..54fb02468f0d 100644
--- a/arch/sparc/kernel/sun4d_smp.c
+++ b/arch/sparc/kernel/sun4d_smp.c
@@ -150,7 +150,7 @@ void __cpuinit smp4d_callin(void)
150 spin_lock_irqsave(&sun4d_imsk_lock, flags); 150 spin_lock_irqsave(&sun4d_imsk_lock, flags);
151 cc_set_imsk(cc_get_imsk() & ~0x4000); /* Allow PIL 14 as well */ 151 cc_set_imsk(cc_get_imsk() & ~0x4000); /* Allow PIL 14 as well */
152 spin_unlock_irqrestore(&sun4d_imsk_lock, flags); 152 spin_unlock_irqrestore(&sun4d_imsk_lock, flags);
153 cpu_set(cpuid, cpu_online_map); 153 set_cpu_online(cpuid, true);
154 154
155} 155}
156 156
@@ -228,11 +228,10 @@ void __init smp4d_smp_done(void)
228 /* setup cpu list for irq rotation */ 228 /* setup cpu list for irq rotation */
229 first = 0; 229 first = 0;
230 prev = &first; 230 prev = &first;
231 for (i = 0; i < NR_CPUS; i++) 231 for_each_online_cpu(i) {
232 if (cpu_online(i)) { 232 *prev = i;
233 *prev = i; 233 prev = &cpu_data(i).next;
234 prev = &cpu_data(i).next; 234 }
235 }
236 *prev = first; 235 *prev = first;
237 local_flush_cache_all(); 236 local_flush_cache_all();
238 237
diff --git a/arch/sparc/kernel/sun4m_smp.c b/arch/sparc/kernel/sun4m_smp.c
index 8040376c4890..960b113d0006 100644
--- a/arch/sparc/kernel/sun4m_smp.c
+++ b/arch/sparc/kernel/sun4m_smp.c
@@ -113,7 +113,7 @@ void __cpuinit smp4m_callin(void)
113 113
114 local_irq_enable(); 114 local_irq_enable();
115 115
116 cpu_set(cpuid, cpu_online_map); 116 set_cpu_online(cpuid, true);
117} 117}
118 118
119/* 119/*
@@ -186,11 +186,9 @@ void __init smp4m_smp_done(void)
186 /* setup cpu list for irq rotation */ 186 /* setup cpu list for irq rotation */
187 first = 0; 187 first = 0;
188 prev = &first; 188 prev = &first;
189 for (i = 0; i < NR_CPUS; i++) { 189 for_each_online_cpu(i) {
190 if (cpu_online(i)) { 190 *prev = i;
191 *prev = i; 191 prev = &cpu_data(i).next;
192 prev = &cpu_data(i).next;
193 }
194 } 192 }
195 *prev = first; 193 *prev = first;
196 local_flush_cache_all(); 194 local_flush_cache_all();
diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c
index 00373ce2d8fb..2c8dfeb7ab04 100644
--- a/arch/sparc/mm/init_64.c
+++ b/arch/sparc/mm/init_64.c
@@ -1092,7 +1092,7 @@ static void __init numa_parse_mdesc_group_cpus(struct mdesc_handle *md,
1092 if (strcmp(name, "cpu")) 1092 if (strcmp(name, "cpu"))
1093 continue; 1093 continue;
1094 id = mdesc_get_property(md, target, "id", NULL); 1094 id = mdesc_get_property(md, target, "id", NULL);
1095 if (*id < NR_CPUS) 1095 if (*id < nr_cpu_ids)
1096 cpu_set(*id, *mask); 1096 cpu_set(*id, *mask);
1097 } 1097 }
1098} 1098}
diff --git a/arch/sparc/mm/srmmu.c b/arch/sparc/mm/srmmu.c
index fe7ed08390bb..06c9a7d98206 100644
--- a/arch/sparc/mm/srmmu.c
+++ b/arch/sparc/mm/srmmu.c
@@ -1425,7 +1425,7 @@ static void __init init_vac_layout(void)
1425 min_line_size = vac_line_size; 1425 min_line_size = vac_line_size;
1426 //FIXME: cpus not contiguous!! 1426 //FIXME: cpus not contiguous!!
1427 cpu++; 1427 cpu++;
1428 if (cpu >= NR_CPUS || !cpu_online(cpu)) 1428 if (cpu >= nr_cpu_ids || !cpu_online(cpu))
1429 break; 1429 break;
1430#else 1430#else
1431 break; 1431 break;
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 06c02c00d7d9..45161b816313 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -40,6 +40,7 @@ config X86
40 select HAVE_GENERIC_DMA_COHERENT if X86_32 40 select HAVE_GENERIC_DMA_COHERENT if X86_32
41 select HAVE_EFFICIENT_UNALIGNED_ACCESS 41 select HAVE_EFFICIENT_UNALIGNED_ACCESS
42 select USER_STACKTRACE_SUPPORT 42 select USER_STACKTRACE_SUPPORT
43 select HAVE_DMA_API_DEBUG
43 select HAVE_KERNEL_GZIP 44 select HAVE_KERNEL_GZIP
44 select HAVE_KERNEL_BZIP2 45 select HAVE_KERNEL_BZIP2
45 select HAVE_KERNEL_LZMA 46 select HAVE_KERNEL_LZMA
@@ -786,6 +787,11 @@ config X86_MCE_AMD
786 Additional support for AMD specific MCE features such as 787 Additional support for AMD specific MCE features such as
787 the DRAM Error Threshold. 788 the DRAM Error Threshold.
788 789
790config X86_MCE_THRESHOLD
791 depends on X86_MCE_AMD || X86_MCE_INTEL
792 bool
793 default y
794
789config X86_MCE_NONFATAL 795config X86_MCE_NONFATAL
790 tristate "Check for non-fatal errors on AMD Athlon/Duron / Intel Pentium 4" 796 tristate "Check for non-fatal errors on AMD Athlon/Duron / Intel Pentium 4"
791 depends on X86_32 && X86_MCE 797 depends on X86_32 && X86_MCE
@@ -929,6 +935,12 @@ config X86_CPUID
929 with major 203 and minors 0 to 31 for /dev/cpu/0/cpuid to 935 with major 203 and minors 0 to 31 for /dev/cpu/0/cpuid to
930 /dev/cpu/31/cpuid. 936 /dev/cpu/31/cpuid.
931 937
938config X86_CPU_DEBUG
939 tristate "/sys/kernel/debug/x86/cpu/* - CPU Debug support"
940 ---help---
941 If you select this option, this will provide various x86 CPUs
942 information through debugfs.
943
932choice 944choice
933 prompt "High Memory Support" 945 prompt "High Memory Support"
934 default HIGHMEM4G if !X86_NUMAQ 946 default HIGHMEM4G if !X86_NUMAQ
@@ -1121,7 +1133,7 @@ config NUMA_EMU
1121 1133
1122config NODES_SHIFT 1134config NODES_SHIFT
1123 int "Maximum NUMA Nodes (as a power of 2)" if !MAXSMP 1135 int "Maximum NUMA Nodes (as a power of 2)" if !MAXSMP
1124 range 1 9 if X86_64 1136 range 1 9
1125 default "9" if MAXSMP 1137 default "9" if MAXSMP
1126 default "6" if X86_64 1138 default "6" if X86_64
1127 default "4" if X86_NUMAQ 1139 default "4" if X86_NUMAQ
@@ -1429,7 +1441,7 @@ config CRASH_DUMP
1429config KEXEC_JUMP 1441config KEXEC_JUMP
1430 bool "kexec jump (EXPERIMENTAL)" 1442 bool "kexec jump (EXPERIMENTAL)"
1431 depends on EXPERIMENTAL 1443 depends on EXPERIMENTAL
1432 depends on KEXEC && HIBERNATION && X86_32 1444 depends on KEXEC && HIBERNATION
1433 ---help--- 1445 ---help---
1434 Jump between original kernel and kexeced kernel and invoke 1446 Jump between original kernel and kexeced kernel and invoke
1435 code in physical address mode via KEXEC 1447 code in physical address mode via KEXEC
diff --git a/arch/x86/Kconfig.cpu b/arch/x86/Kconfig.cpu
index a95eaf0e582a..924e156a85ab 100644
--- a/arch/x86/Kconfig.cpu
+++ b/arch/x86/Kconfig.cpu
@@ -456,24 +456,9 @@ config CPU_SUP_AMD
456 456
457 If unsure, say N. 457 If unsure, say N.
458 458
459config CPU_SUP_CENTAUR_32 459config CPU_SUP_CENTAUR
460 default y 460 default y
461 bool "Support Centaur processors" if PROCESSOR_SELECT 461 bool "Support Centaur processors" if PROCESSOR_SELECT
462 depends on !64BIT
463 ---help---
464 This enables detection, tunings and quirks for Centaur processors
465
466 You need this enabled if you want your kernel to run on a
467 Centaur CPU. Disabling this option on other types of CPUs
468 makes the kernel a tiny bit smaller. Disabling it on a Centaur
469 CPU might render the kernel unbootable.
470
471 If unsure, say N.
472
473config CPU_SUP_CENTAUR_64
474 default y
475 bool "Support Centaur processors" if PROCESSOR_SELECT
476 depends on 64BIT
477 ---help--- 462 ---help---
478 This enables detection, tunings and quirks for Centaur processors 463 This enables detection, tunings and quirks for Centaur processors
479 464
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index 1836191839ee..f05d8c91d9e5 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -153,34 +153,23 @@ endif
153 153
154boot := arch/x86/boot 154boot := arch/x86/boot
155 155
156PHONY += zImage bzImage compressed zlilo bzlilo \ 156BOOT_TARGETS = bzlilo bzdisk fdimage fdimage144 fdimage288 isoimage install
157 zdisk bzdisk fdimage fdimage144 fdimage288 isoimage install 157
158PHONY += bzImage $(BOOT_TARGETS)
158 159
159# Default kernel to build 160# Default kernel to build
160all: bzImage 161all: bzImage
161 162
162# KBUILD_IMAGE specify target image being built 163# KBUILD_IMAGE specify target image being built
163 KBUILD_IMAGE := $(boot)/bzImage 164KBUILD_IMAGE := $(boot)/bzImage
164zImage zlilo zdisk: KBUILD_IMAGE := $(boot)/zImage
165 165
166zImage bzImage: vmlinux 166bzImage: vmlinux
167 $(Q)$(MAKE) $(build)=$(boot) $(KBUILD_IMAGE) 167 $(Q)$(MAKE) $(build)=$(boot) $(KBUILD_IMAGE)
168 $(Q)mkdir -p $(objtree)/arch/$(UTS_MACHINE)/boot 168 $(Q)mkdir -p $(objtree)/arch/$(UTS_MACHINE)/boot
169 $(Q)ln -fsn ../../x86/boot/bzImage $(objtree)/arch/$(UTS_MACHINE)/boot/$@ 169 $(Q)ln -fsn ../../x86/boot/bzImage $(objtree)/arch/$(UTS_MACHINE)/boot/$@
170 170
171compressed: zImage 171$(BOOT_TARGETS): vmlinux
172 172 $(Q)$(MAKE) $(build)=$(boot) $@
173zlilo bzlilo: vmlinux
174 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) zlilo
175
176zdisk bzdisk: vmlinux
177 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) zdisk
178
179fdimage fdimage144 fdimage288 isoimage: vmlinux
180 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) $@
181
182install:
183 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) install
184 173
185PHONY += vdso_install 174PHONY += vdso_install
186vdso_install: 175vdso_install:
@@ -205,7 +194,3 @@ define archhelp
205 echo ' FDARGS="..." arguments for the booted kernel' 194 echo ' FDARGS="..." arguments for the booted kernel'
206 echo ' FDINITRD=file initrd for the booted kernel' 195 echo ' FDINITRD=file initrd for the booted kernel'
207endef 196endef
208
209CLEAN_FILES += arch/x86/boot/fdimage \
210 arch/x86/boot/image.iso \
211 arch/x86/boot/mtools.conf
diff --git a/arch/x86/boot/Makefile b/arch/x86/boot/Makefile
index c70eff69a1fb..fb737ce5888d 100644
--- a/arch/x86/boot/Makefile
+++ b/arch/x86/boot/Makefile
@@ -6,26 +6,24 @@
6# for more details. 6# for more details.
7# 7#
8# Copyright (C) 1994 by Linus Torvalds 8# Copyright (C) 1994 by Linus Torvalds
9# Changed by many, many contributors over the years.
9# 10#
10 11
11# ROOT_DEV specifies the default root-device when making the image. 12# ROOT_DEV specifies the default root-device when making the image.
12# This can be either FLOPPY, CURRENT, /dev/xxxx or empty, in which case 13# This can be either FLOPPY, CURRENT, /dev/xxxx or empty, in which case
13# the default of FLOPPY is used by 'build'. 14# the default of FLOPPY is used by 'build'.
14 15
15ROOT_DEV := CURRENT 16ROOT_DEV := CURRENT
16 17
17# If you want to preset the SVGA mode, uncomment the next line and 18# If you want to preset the SVGA mode, uncomment the next line and
18# set SVGA_MODE to whatever number you want. 19# set SVGA_MODE to whatever number you want.
19# Set it to -DSVGA_MODE=NORMAL_VGA if you just want the EGA/VGA mode. 20# Set it to -DSVGA_MODE=NORMAL_VGA if you just want the EGA/VGA mode.
20# The number is the same as you would ordinarily press at bootup. 21# The number is the same as you would ordinarily press at bootup.
21 22
22SVGA_MODE := -DSVGA_MODE=NORMAL_VGA 23SVGA_MODE := -DSVGA_MODE=NORMAL_VGA
23 24
24# If you want the RAM disk device, define this to be the size in blocks. 25targets := vmlinux.bin setup.bin setup.elf bzImage
25 26targets += fdimage fdimage144 fdimage288 image.iso mtools.conf
26#RAMDISK := -DRAMDISK=512
27
28targets := vmlinux.bin setup.bin setup.elf zImage bzImage
29subdir- := compressed 27subdir- := compressed
30 28
31setup-y += a20.o cmdline.o copy.o cpu.o cpucheck.o edd.o 29setup-y += a20.o cmdline.o copy.o cpu.o cpucheck.o edd.o
@@ -71,17 +69,13 @@ KBUILD_CFLAGS := $(LINUXINCLUDE) -g -Os -D_SETUP -D__KERNEL__ \
71KBUILD_CFLAGS += $(call cc-option,-m32) 69KBUILD_CFLAGS += $(call cc-option,-m32)
72KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__ 70KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
73 71
74$(obj)/zImage: asflags-y := $(SVGA_MODE) $(RAMDISK) 72$(obj)/bzImage: asflags-y := $(SVGA_MODE)
75$(obj)/bzImage: ccflags-y := -D__BIG_KERNEL__
76$(obj)/bzImage: asflags-y := $(SVGA_MODE) $(RAMDISK) -D__BIG_KERNEL__
77$(obj)/bzImage: BUILDFLAGS := -b
78 73
79quiet_cmd_image = BUILD $@ 74quiet_cmd_image = BUILD $@
80cmd_image = $(obj)/tools/build $(BUILDFLAGS) $(obj)/setup.bin \ 75cmd_image = $(obj)/tools/build $(obj)/setup.bin $(obj)/vmlinux.bin \
81 $(obj)/vmlinux.bin $(ROOT_DEV) > $@ 76 $(ROOT_DEV) > $@
82 77
83$(obj)/zImage $(obj)/bzImage: $(obj)/setup.bin \ 78$(obj)/bzImage: $(obj)/setup.bin $(obj)/vmlinux.bin $(obj)/tools/build FORCE
84 $(obj)/vmlinux.bin $(obj)/tools/build FORCE
85 $(call if_changed,image) 79 $(call if_changed,image)
86 @echo 'Kernel: $@ is ready' ' (#'`cat .version`')' 80 @echo 'Kernel: $@ is ready' ' (#'`cat .version`')'
87 81
@@ -116,9 +110,11 @@ $(obj)/setup.bin: $(obj)/setup.elf FORCE
116$(obj)/compressed/vmlinux: FORCE 110$(obj)/compressed/vmlinux: FORCE
117 $(Q)$(MAKE) $(build)=$(obj)/compressed $@ 111 $(Q)$(MAKE) $(build)=$(obj)/compressed $@
118 112
119# Set this if you want to pass append arguments to the zdisk/fdimage/isoimage kernel 113# Set this if you want to pass append arguments to the
114# bzdisk/fdimage/isoimage kernel
120FDARGS = 115FDARGS =
121# Set this if you want an initrd included with the zdisk/fdimage/isoimage kernel 116# Set this if you want an initrd included with the
117# bzdisk/fdimage/isoimage kernel
122FDINITRD = 118FDINITRD =
123 119
124image_cmdline = default linux $(FDARGS) $(if $(FDINITRD),initrd=initrd.img,) 120image_cmdline = default linux $(FDARGS) $(if $(FDINITRD),initrd=initrd.img,)
@@ -127,7 +123,7 @@ $(obj)/mtools.conf: $(src)/mtools.conf.in
127 sed -e 's|@OBJ@|$(obj)|g' < $< > $@ 123 sed -e 's|@OBJ@|$(obj)|g' < $< > $@
128 124
129# This requires write access to /dev/fd0 125# This requires write access to /dev/fd0
130zdisk: $(BOOTIMAGE) $(obj)/mtools.conf 126bzdisk: $(obj)/bzImage $(obj)/mtools.conf
131 MTOOLSRC=$(obj)/mtools.conf mformat a: ; sync 127 MTOOLSRC=$(obj)/mtools.conf mformat a: ; sync
132 syslinux /dev/fd0 ; sync 128 syslinux /dev/fd0 ; sync
133 echo '$(image_cmdline)' | \ 129 echo '$(image_cmdline)' | \
@@ -135,10 +131,10 @@ zdisk: $(BOOTIMAGE) $(obj)/mtools.conf
135 if [ -f '$(FDINITRD)' ] ; then \ 131 if [ -f '$(FDINITRD)' ] ; then \
136 MTOOLSRC=$(obj)/mtools.conf mcopy '$(FDINITRD)' a:initrd.img ; \ 132 MTOOLSRC=$(obj)/mtools.conf mcopy '$(FDINITRD)' a:initrd.img ; \
137 fi 133 fi
138 MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) a:linux ; sync 134 MTOOLSRC=$(obj)/mtools.conf mcopy $(obj)/bzImage a:linux ; sync
139 135
140# These require being root or having syslinux 2.02 or higher installed 136# These require being root or having syslinux 2.02 or higher installed
141fdimage fdimage144: $(BOOTIMAGE) $(obj)/mtools.conf 137fdimage fdimage144: $(obj)/bzImage $(obj)/mtools.conf
142 dd if=/dev/zero of=$(obj)/fdimage bs=1024 count=1440 138 dd if=/dev/zero of=$(obj)/fdimage bs=1024 count=1440
143 MTOOLSRC=$(obj)/mtools.conf mformat v: ; sync 139 MTOOLSRC=$(obj)/mtools.conf mformat v: ; sync
144 syslinux $(obj)/fdimage ; sync 140 syslinux $(obj)/fdimage ; sync
@@ -147,9 +143,9 @@ fdimage fdimage144: $(BOOTIMAGE) $(obj)/mtools.conf
147 if [ -f '$(FDINITRD)' ] ; then \ 143 if [ -f '$(FDINITRD)' ] ; then \
148 MTOOLSRC=$(obj)/mtools.conf mcopy '$(FDINITRD)' v:initrd.img ; \ 144 MTOOLSRC=$(obj)/mtools.conf mcopy '$(FDINITRD)' v:initrd.img ; \
149 fi 145 fi
150 MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) v:linux ; sync 146 MTOOLSRC=$(obj)/mtools.conf mcopy $(obj)/bzImage v:linux ; sync
151 147
152fdimage288: $(BOOTIMAGE) $(obj)/mtools.conf 148fdimage288: $(obj)/bzImage $(obj)/mtools.conf
153 dd if=/dev/zero of=$(obj)/fdimage bs=1024 count=2880 149 dd if=/dev/zero of=$(obj)/fdimage bs=1024 count=2880
154 MTOOLSRC=$(obj)/mtools.conf mformat w: ; sync 150 MTOOLSRC=$(obj)/mtools.conf mformat w: ; sync
155 syslinux $(obj)/fdimage ; sync 151 syslinux $(obj)/fdimage ; sync
@@ -158,9 +154,9 @@ fdimage288: $(BOOTIMAGE) $(obj)/mtools.conf
158 if [ -f '$(FDINITRD)' ] ; then \ 154 if [ -f '$(FDINITRD)' ] ; then \
159 MTOOLSRC=$(obj)/mtools.conf mcopy '$(FDINITRD)' w:initrd.img ; \ 155 MTOOLSRC=$(obj)/mtools.conf mcopy '$(FDINITRD)' w:initrd.img ; \
160 fi 156 fi
161 MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) w:linux ; sync 157 MTOOLSRC=$(obj)/mtools.conf mcopy $(obj)/bzImage w:linux ; sync
162 158
163isoimage: $(BOOTIMAGE) 159isoimage: $(obj)/bzImage
164 -rm -rf $(obj)/isoimage 160 -rm -rf $(obj)/isoimage
165 mkdir $(obj)/isoimage 161 mkdir $(obj)/isoimage
166 for i in lib lib64 share end ; do \ 162 for i in lib lib64 share end ; do \
@@ -170,7 +166,7 @@ isoimage: $(BOOTIMAGE)
170 fi ; \ 166 fi ; \
171 if [ $$i = end ] ; then exit 1 ; fi ; \ 167 if [ $$i = end ] ; then exit 1 ; fi ; \
172 done 168 done
173 cp $(BOOTIMAGE) $(obj)/isoimage/linux 169 cp $(obj)/bzImage $(obj)/isoimage/linux
174 echo '$(image_cmdline)' > $(obj)/isoimage/isolinux.cfg 170 echo '$(image_cmdline)' > $(obj)/isoimage/isolinux.cfg
175 if [ -f '$(FDINITRD)' ] ; then \ 171 if [ -f '$(FDINITRD)' ] ; then \
176 cp '$(FDINITRD)' $(obj)/isoimage/initrd.img ; \ 172 cp '$(FDINITRD)' $(obj)/isoimage/initrd.img ; \
@@ -181,12 +177,13 @@ isoimage: $(BOOTIMAGE)
181 isohybrid $(obj)/image.iso 2>/dev/null || true 177 isohybrid $(obj)/image.iso 2>/dev/null || true
182 rm -rf $(obj)/isoimage 178 rm -rf $(obj)/isoimage
183 179
184zlilo: $(BOOTIMAGE) 180bzlilo: $(obj)/bzImage
185 if [ -f $(INSTALL_PATH)/vmlinuz ]; then mv $(INSTALL_PATH)/vmlinuz $(INSTALL_PATH)/vmlinuz.old; fi 181 if [ -f $(INSTALL_PATH)/vmlinuz ]; then mv $(INSTALL_PATH)/vmlinuz $(INSTALL_PATH)/vmlinuz.old; fi
186 if [ -f $(INSTALL_PATH)/System.map ]; then mv $(INSTALL_PATH)/System.map $(INSTALL_PATH)/System.old; fi 182 if [ -f $(INSTALL_PATH)/System.map ]; then mv $(INSTALL_PATH)/System.map $(INSTALL_PATH)/System.old; fi
187 cat $(BOOTIMAGE) > $(INSTALL_PATH)/vmlinuz 183 cat $(obj)/bzImage > $(INSTALL_PATH)/vmlinuz
188 cp System.map $(INSTALL_PATH)/ 184 cp System.map $(INSTALL_PATH)/
189 if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi 185 if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi
190 186
191install: 187install:
192 sh $(srctree)/$(src)/install.sh $(KERNELRELEASE) $(BOOTIMAGE) System.map "$(INSTALL_PATH)" 188 sh $(srctree)/$(src)/install.sh $(KERNELRELEASE) $(obj)/bzImage \
189 System.map "$(INSTALL_PATH)"
diff --git a/arch/x86/boot/header.S b/arch/x86/boot/header.S
index 7ccff4884a23..5d84d1c74e4c 100644
--- a/arch/x86/boot/header.S
+++ b/arch/x86/boot/header.S
@@ -24,12 +24,8 @@
24#include "boot.h" 24#include "boot.h"
25#include "offsets.h" 25#include "offsets.h"
26 26
27SETUPSECTS = 4 /* default nr of setup-sectors */
28BOOTSEG = 0x07C0 /* original address of boot-sector */ 27BOOTSEG = 0x07C0 /* original address of boot-sector */
29SYSSEG = DEF_SYSSEG /* system loaded at 0x10000 (65536) */ 28SYSSEG = 0x1000 /* historical load address >> 4 */
30SYSSIZE = DEF_SYSSIZE /* system size: # of 16-byte clicks */
31 /* to be loaded */
32ROOT_DEV = 0 /* ROOT_DEV is now written by "build" */
33 29
34#ifndef SVGA_MODE 30#ifndef SVGA_MODE
35#define SVGA_MODE ASK_VGA 31#define SVGA_MODE ASK_VGA
@@ -97,12 +93,12 @@ bugger_off_msg:
97 .section ".header", "a" 93 .section ".header", "a"
98 .globl hdr 94 .globl hdr
99hdr: 95hdr:
100setup_sects: .byte SETUPSECTS 96setup_sects: .byte 0 /* Filled in by build.c */
101root_flags: .word ROOT_RDONLY 97root_flags: .word ROOT_RDONLY
102syssize: .long SYSSIZE 98syssize: .long 0 /* Filled in by build.c */
103ram_size: .word RAMDISK 99ram_size: .word 0 /* Obsolete */
104vid_mode: .word SVGA_MODE 100vid_mode: .word SVGA_MODE
105root_dev: .word ROOT_DEV 101root_dev: .word 0 /* Filled in by build.c */
106boot_flag: .word 0xAA55 102boot_flag: .word 0xAA55
107 103
108 # offset 512, entry point 104 # offset 512, entry point
@@ -123,14 +119,15 @@ _start:
123 # or else old loadlin-1.5 will fail) 119 # or else old loadlin-1.5 will fail)
124 .globl realmode_swtch 120 .globl realmode_swtch
125realmode_swtch: .word 0, 0 # default_switch, SETUPSEG 121realmode_swtch: .word 0, 0 # default_switch, SETUPSEG
126start_sys_seg: .word SYSSEG 122start_sys_seg: .word SYSSEG # obsolete and meaningless, but just
123 # in case something decided to "use" it
127 .word kernel_version-512 # pointing to kernel version string 124 .word kernel_version-512 # pointing to kernel version string
128 # above section of header is compatible 125 # above section of header is compatible
129 # with loadlin-1.5 (header v1.5). Don't 126 # with loadlin-1.5 (header v1.5). Don't
130 # change it. 127 # change it.
131 128
132type_of_loader: .byte 0 # = 0, old one (LILO, Loadlin, 129type_of_loader: .byte 0 # 0 means ancient bootloader, newer
133 # Bootlin, SYSLX, bootsect...) 130 # bootloaders know to change this.
134 # See Documentation/i386/boot.txt for 131 # See Documentation/i386/boot.txt for
135 # assigned ids 132 # assigned ids
136 133
@@ -142,11 +139,7 @@ CAN_USE_HEAP = 0x80 # If set, the loader also has set
142 # space behind setup.S can be used for 139 # space behind setup.S can be used for
143 # heap purposes. 140 # heap purposes.
144 # Only the loader knows what is free 141 # Only the loader knows what is free
145#ifndef __BIG_KERNEL__
146 .byte 0
147#else
148 .byte LOADED_HIGH 142 .byte LOADED_HIGH
149#endif
150 143
151setup_move_size: .word 0x8000 # size to move, when setup is not 144setup_move_size: .word 0x8000 # size to move, when setup is not
152 # loaded at 0x90000. We will move setup 145 # loaded at 0x90000. We will move setup
@@ -157,11 +150,7 @@ setup_move_size: .word 0x8000 # size to move, when setup is not
157 150
158code32_start: # here loaders can put a different 151code32_start: # here loaders can put a different
159 # start address for 32-bit code. 152 # start address for 32-bit code.
160#ifndef __BIG_KERNEL__
161 .long 0x1000 # 0x1000 = default for zImage
162#else
163 .long 0x100000 # 0x100000 = default for big kernel 153 .long 0x100000 # 0x100000 = default for big kernel
164#endif
165 154
166ramdisk_image: .long 0 # address of loaded ramdisk image 155ramdisk_image: .long 0 # address of loaded ramdisk image
167 # Here the loader puts the 32-bit 156 # Here the loader puts the 32-bit
diff --git a/arch/x86/boot/pm.c b/arch/x86/boot/pm.c
index 85a1cd8a8ff8..8062f8915250 100644
--- a/arch/x86/boot/pm.c
+++ b/arch/x86/boot/pm.c
@@ -33,47 +33,6 @@ static void realmode_switch_hook(void)
33} 33}
34 34
35/* 35/*
36 * A zImage kernel is loaded at 0x10000 but wants to run at 0x1000.
37 * A bzImage kernel is loaded and runs at 0x100000.
38 */
39static void move_kernel_around(void)
40{
41 /* Note: rely on the compile-time option here rather than
42 the LOADED_HIGH flag. The Qemu kernel loader unconditionally
43 sets the loadflags to zero. */
44#ifndef __BIG_KERNEL__
45 u16 dst_seg, src_seg;
46 u32 syssize;
47
48 dst_seg = 0x1000 >> 4;
49 src_seg = 0x10000 >> 4;
50 syssize = boot_params.hdr.syssize; /* Size in 16-byte paragraphs */
51
52 while (syssize) {
53 int paras = (syssize >= 0x1000) ? 0x1000 : syssize;
54 int dwords = paras << 2;
55
56 asm volatile("pushw %%es ; "
57 "pushw %%ds ; "
58 "movw %1,%%es ; "
59 "movw %2,%%ds ; "
60 "xorw %%di,%%di ; "
61 "xorw %%si,%%si ; "
62 "rep;movsl ; "
63 "popw %%ds ; "
64 "popw %%es"
65 : "+c" (dwords)
66 : "r" (dst_seg), "r" (src_seg)
67 : "esi", "edi");
68
69 syssize -= paras;
70 dst_seg += paras;
71 src_seg += paras;
72 }
73#endif
74}
75
76/*
77 * Disable all interrupts at the legacy PIC. 36 * Disable all interrupts at the legacy PIC.
78 */ 37 */
79static void mask_all_interrupts(void) 38static void mask_all_interrupts(void)
@@ -147,9 +106,6 @@ void go_to_protected_mode(void)
147 /* Hook before leaving real mode, also disables interrupts */ 106 /* Hook before leaving real mode, also disables interrupts */
148 realmode_switch_hook(); 107 realmode_switch_hook();
149 108
150 /* Move the kernel/setup to their final resting places */
151 move_kernel_around();
152
153 /* Enable the A20 gate */ 109 /* Enable the A20 gate */
154 if (enable_a20()) { 110 if (enable_a20()) {
155 puts("A20 gate not responding, unable to boot...\n"); 111 puts("A20 gate not responding, unable to boot...\n");
diff --git a/arch/x86/boot/pmjump.S b/arch/x86/boot/pmjump.S
index 019c17a75851..3e0edc6d2a20 100644
--- a/arch/x86/boot/pmjump.S
+++ b/arch/x86/boot/pmjump.S
@@ -47,6 +47,7 @@ GLOBAL(protected_mode_jump)
47ENDPROC(protected_mode_jump) 47ENDPROC(protected_mode_jump)
48 48
49 .code32 49 .code32
50 .section ".text32","ax"
50GLOBAL(in_pm32) 51GLOBAL(in_pm32)
51 # Set up data segments for flat 32-bit mode 52 # Set up data segments for flat 32-bit mode
52 movl %ecx, %ds 53 movl %ecx, %ds
diff --git a/arch/x86/boot/setup.ld b/arch/x86/boot/setup.ld
index df9234b3a5e0..bb8dc2de7969 100644
--- a/arch/x86/boot/setup.ld
+++ b/arch/x86/boot/setup.ld
@@ -17,7 +17,8 @@ SECTIONS
17 .header : { *(.header) } 17 .header : { *(.header) }
18 .inittext : { *(.inittext) } 18 .inittext : { *(.inittext) }
19 .initdata : { *(.initdata) } 19 .initdata : { *(.initdata) }
20 .text : { *(.text*) } 20 .text : { *(.text) }
21 .text32 : { *(.text32) }
21 22
22 . = ALIGN(16); 23 . = ALIGN(16);
23 .rodata : { *(.rodata*) } 24 .rodata : { *(.rodata*) }
diff --git a/arch/x86/boot/tools/build.c b/arch/x86/boot/tools/build.c
index 44dc1923c0e3..ee3a4ea923ac 100644
--- a/arch/x86/boot/tools/build.c
+++ b/arch/x86/boot/tools/build.c
@@ -130,7 +130,7 @@ static void die(const char * str, ...)
130 130
131static void usage(void) 131static void usage(void)
132{ 132{
133 die("Usage: build [-b] setup system [rootdev] [> image]"); 133 die("Usage: build setup system [rootdev] [> image]");
134} 134}
135 135
136int main(int argc, char ** argv) 136int main(int argc, char ** argv)
@@ -145,11 +145,6 @@ int main(int argc, char ** argv)
145 void *kernel; 145 void *kernel;
146 u32 crc = 0xffffffffUL; 146 u32 crc = 0xffffffffUL;
147 147
148 if (argc > 2 && !strcmp(argv[1], "-b"))
149 {
150 is_big_kernel = 1;
151 argc--, argv++;
152 }
153 if ((argc < 3) || (argc > 4)) 148 if ((argc < 3) || (argc > 4))
154 usage(); 149 usage();
155 if (argc > 3) { 150 if (argc > 3) {
@@ -216,8 +211,6 @@ int main(int argc, char ** argv)
216 die("Unable to mmap '%s': %m", argv[2]); 211 die("Unable to mmap '%s': %m", argv[2]);
217 /* Number of 16-byte paragraphs, including space for a 4-byte CRC */ 212 /* Number of 16-byte paragraphs, including space for a 4-byte CRC */
218 sys_size = (sz + 15 + 4) / 16; 213 sys_size = (sz + 15 + 4) / 16;
219 if (!is_big_kernel && sys_size > DEF_SYSSIZE)
220 die("System is too big. Try using bzImage or modules.");
221 214
222 /* Patch the setup code with the appropriate size parameters */ 215 /* Patch the setup code with the appropriate size parameters */
223 buf[0x1f1] = setup_sectors-1; 216 buf[0x1f1] = setup_sectors-1;
diff --git a/arch/x86/boot/video-vga.c b/arch/x86/boot/video-vga.c
index 5d4742ed4aa2..95d86ce0421c 100644
--- a/arch/x86/boot/video-vga.c
+++ b/arch/x86/boot/video-vga.c
@@ -129,41 +129,45 @@ u16 vga_crtc(void)
129 return (inb(0x3cc) & 1) ? 0x3d4 : 0x3b4; 129 return (inb(0x3cc) & 1) ? 0x3d4 : 0x3b4;
130} 130}
131 131
132static void vga_set_480_scanlines(int end) 132static void vga_set_480_scanlines(int lines)
133{ 133{
134 u16 crtc; 134 u16 crtc; /* CRTC base address */
135 u8 csel; 135 u8 csel; /* CRTC miscellaneous output register */
136 u8 ovfw; /* CRTC overflow register */
137 int end = lines-1;
136 138
137 crtc = vga_crtc(); 139 crtc = vga_crtc();
138 140
141 ovfw = 0x3c | ((end >> (8-1)) & 0x02) | ((end >> (9-6)) & 0x40);
142
139 out_idx(0x0c, crtc, 0x11); /* Vertical sync end, unlock CR0-7 */ 143 out_idx(0x0c, crtc, 0x11); /* Vertical sync end, unlock CR0-7 */
140 out_idx(0x0b, crtc, 0x06); /* Vertical total */ 144 out_idx(0x0b, crtc, 0x06); /* Vertical total */
141 out_idx(0x3e, crtc, 0x07); /* Vertical overflow */ 145 out_idx(ovfw, crtc, 0x07); /* Vertical overflow */
142 out_idx(0xea, crtc, 0x10); /* Vertical sync start */ 146 out_idx(0xea, crtc, 0x10); /* Vertical sync start */
143 out_idx(end, crtc, 0x12); /* Vertical display end */ 147 out_idx(end, crtc, 0x12); /* Vertical display end */
144 out_idx(0xe7, crtc, 0x15); /* Vertical blank start */ 148 out_idx(0xe7, crtc, 0x15); /* Vertical blank start */
145 out_idx(0x04, crtc, 0x16); /* Vertical blank end */ 149 out_idx(0x04, crtc, 0x16); /* Vertical blank end */
146 csel = inb(0x3cc); 150 csel = inb(0x3cc);
147 csel &= 0x0d; 151 csel &= 0x0d;
148 csel |= 0xe2; 152 csel |= 0xe2;
149 outb(csel, 0x3cc); 153 outb(csel, 0x3c2);
150} 154}
151 155
152static void vga_set_80x30(void) 156static void vga_set_80x30(void)
153{ 157{
154 vga_set_480_scanlines(0xdf); 158 vga_set_480_scanlines(30*16);
155} 159}
156 160
157static void vga_set_80x34(void) 161static void vga_set_80x34(void)
158{ 162{
159 vga_set_14font(); 163 vga_set_14font();
160 vga_set_480_scanlines(0xdb); 164 vga_set_480_scanlines(34*14);
161} 165}
162 166
163static void vga_set_80x60(void) 167static void vga_set_80x60(void)
164{ 168{
165 vga_set_8font(); 169 vga_set_8font();
166 vga_set_480_scanlines(0xdf); 170 vga_set_480_scanlines(60*8);
167} 171}
168 172
169static int vga_set_mode(struct mode_info *mode) 173static int vga_set_mode(struct mode_info *mode)
diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
index 4ef949c1972e..df8a300dfe6c 100644
--- a/arch/x86/include/asm/apic.h
+++ b/arch/x86/include/asm/apic.h
@@ -75,7 +75,7 @@ static inline void default_inquire_remote_apic(int apicid)
75#define setup_secondary_clock setup_secondary_APIC_clock 75#define setup_secondary_clock setup_secondary_APIC_clock
76#endif 76#endif
77 77
78#ifdef CONFIG_X86_VSMP 78#ifdef CONFIG_X86_64
79extern int is_vsmp_box(void); 79extern int is_vsmp_box(void);
80#else 80#else
81static inline int is_vsmp_box(void) 81static inline int is_vsmp_box(void)
@@ -108,6 +108,16 @@ extern void native_apic_icr_write(u32 low, u32 id);
108extern u64 native_apic_icr_read(void); 108extern u64 native_apic_icr_read(void);
109 109
110#ifdef CONFIG_X86_X2APIC 110#ifdef CONFIG_X86_X2APIC
111/*
112 * Make previous memory operations globally visible before
113 * sending the IPI through x2apic wrmsr. We need a serializing instruction or
114 * mfence for this.
115 */
116static inline void x2apic_wrmsr_fence(void)
117{
118 asm volatile("mfence" : : : "memory");
119}
120
111static inline void native_apic_msr_write(u32 reg, u32 v) 121static inline void native_apic_msr_write(u32 reg, u32 v)
112{ 122{
113 if (reg == APIC_DFR || reg == APIC_ID || reg == APIC_LDR || 123 if (reg == APIC_DFR || reg == APIC_ID || reg == APIC_LDR ||
@@ -184,6 +194,9 @@ static inline int x2apic_enabled(void)
184{ 194{
185 return 0; 195 return 0;
186} 196}
197
198#define x2apic 0
199
187#endif 200#endif
188 201
189extern int get_physical_broadcast(void); 202extern int get_physical_broadcast(void);
@@ -379,6 +392,7 @@ static inline u32 safe_apic_wait_icr_idle(void)
379 392
380static inline void ack_APIC_irq(void) 393static inline void ack_APIC_irq(void)
381{ 394{
395#ifdef CONFIG_X86_LOCAL_APIC
382 /* 396 /*
383 * ack_APIC_irq() actually gets compiled as a single instruction 397 * ack_APIC_irq() actually gets compiled as a single instruction
384 * ... yummie. 398 * ... yummie.
@@ -386,6 +400,7 @@ static inline void ack_APIC_irq(void)
386 400
387 /* Docs say use 0 for future compatibility */ 401 /* Docs say use 0 for future compatibility */
388 apic_write(APIC_EOI, 0); 402 apic_write(APIC_EOI, 0);
403#endif
389} 404}
390 405
391static inline unsigned default_get_apic_id(unsigned long x) 406static inline unsigned default_get_apic_id(unsigned long x)
@@ -474,10 +489,19 @@ static inline int default_apic_id_registered(void)
474 return physid_isset(read_apic_id(), phys_cpu_present_map); 489 return physid_isset(read_apic_id(), phys_cpu_present_map);
475} 490}
476 491
492static inline int default_phys_pkg_id(int cpuid_apic, int index_msb)
493{
494 return cpuid_apic >> index_msb;
495}
496
497extern int default_apicid_to_node(int logical_apicid);
498
499#endif
500
477static inline unsigned int 501static inline unsigned int
478default_cpu_mask_to_apicid(const struct cpumask *cpumask) 502default_cpu_mask_to_apicid(const struct cpumask *cpumask)
479{ 503{
480 return cpumask_bits(cpumask)[0]; 504 return cpumask_bits(cpumask)[0] & APIC_ALL_CPUS;
481} 505}
482 506
483static inline unsigned int 507static inline unsigned int
@@ -491,15 +515,6 @@ default_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
491 return (unsigned int)(mask1 & mask2 & mask3); 515 return (unsigned int)(mask1 & mask2 & mask3);
492} 516}
493 517
494static inline int default_phys_pkg_id(int cpuid_apic, int index_msb)
495{
496 return cpuid_apic >> index_msb;
497}
498
499extern int default_apicid_to_node(int logical_apicid);
500
501#endif
502
503static inline unsigned long default_check_apicid_used(physid_mask_t bitmap, int apicid) 518static inline unsigned long default_check_apicid_used(physid_mask_t bitmap, int apicid)
504{ 519{
505 return physid_isset(apicid, bitmap); 520 return physid_isset(apicid, bitmap);
diff --git a/arch/x86/include/asm/apicdef.h b/arch/x86/include/asm/apicdef.h
index 63134e31e8b9..bc9514fb3b13 100644
--- a/arch/x86/include/asm/apicdef.h
+++ b/arch/x86/include/asm/apicdef.h
@@ -53,6 +53,7 @@
53#define APIC_ESR_SENDILL 0x00020 53#define APIC_ESR_SENDILL 0x00020
54#define APIC_ESR_RECVILL 0x00040 54#define APIC_ESR_RECVILL 0x00040
55#define APIC_ESR_ILLREGA 0x00080 55#define APIC_ESR_ILLREGA 0x00080
56#define APIC_LVTCMCI 0x2f0
56#define APIC_ICR 0x300 57#define APIC_ICR 0x300
57#define APIC_DEST_SELF 0x40000 58#define APIC_DEST_SELF 0x40000
58#define APIC_DEST_ALLINC 0x80000 59#define APIC_DEST_ALLINC 0x80000
diff --git a/arch/x86/include/asm/boot.h b/arch/x86/include/asm/boot.h
index 6526cf08b0e4..6ba23dd9fc92 100644
--- a/arch/x86/include/asm/boot.h
+++ b/arch/x86/include/asm/boot.h
@@ -1,10 +1,6 @@
1#ifndef _ASM_X86_BOOT_H 1#ifndef _ASM_X86_BOOT_H
2#define _ASM_X86_BOOT_H 2#define _ASM_X86_BOOT_H
3 3
4/* Don't touch these, unless you really know what you're doing. */
5#define DEF_SYSSEG 0x1000
6#define DEF_SYSSIZE 0x7F00
7
8/* Internal svga startup constants */ 4/* Internal svga startup constants */
9#define NORMAL_VGA 0xffff /* 80x25 mode */ 5#define NORMAL_VGA 0xffff /* 80x25 mode */
10#define EXTENDED_VGA 0xfffe /* 80x50 mode */ 6#define EXTENDED_VGA 0xfffe /* 80x50 mode */
diff --git a/arch/x86/include/asm/cacheflush.h b/arch/x86/include/asm/cacheflush.h
index 5b301b7ff5f4..b3894bf52fcd 100644
--- a/arch/x86/include/asm/cacheflush.h
+++ b/arch/x86/include/asm/cacheflush.h
@@ -90,6 +90,9 @@ int set_memory_4k(unsigned long addr, int numpages);
90int set_memory_array_uc(unsigned long *addr, int addrinarray); 90int set_memory_array_uc(unsigned long *addr, int addrinarray);
91int set_memory_array_wb(unsigned long *addr, int addrinarray); 91int set_memory_array_wb(unsigned long *addr, int addrinarray);
92 92
93int set_pages_array_uc(struct page **pages, int addrinarray);
94int set_pages_array_wb(struct page **pages, int addrinarray);
95
93/* 96/*
94 * For legacy compatibility with the old APIs, a few functions 97 * For legacy compatibility with the old APIs, a few functions
95 * are provided that work on a "struct page". 98 * are provided that work on a "struct page".
diff --git a/arch/x86/include/asm/cpu_debug.h b/arch/x86/include/asm/cpu_debug.h
new file mode 100755
index 000000000000..222802029fa6
--- /dev/null
+++ b/arch/x86/include/asm/cpu_debug.h
@@ -0,0 +1,226 @@
1#ifndef _ASM_X86_CPU_DEBUG_H
2#define _ASM_X86_CPU_DEBUG_H
3
4/*
5 * CPU x86 architecture debug
6 *
7 * Copyright(C) 2009 Jaswinder Singh Rajput
8 */
9
10/* Register flags */
11enum cpu_debug_bit {
12/* Model Specific Registers (MSRs) */
13 CPU_MC_BIT, /* Machine Check */
14 CPU_MONITOR_BIT, /* Monitor */
15 CPU_TIME_BIT, /* Time */
16 CPU_PMC_BIT, /* Performance Monitor */
17 CPU_PLATFORM_BIT, /* Platform */
18 CPU_APIC_BIT, /* APIC */
19 CPU_POWERON_BIT, /* Power-on */
20 CPU_CONTROL_BIT, /* Control */
21 CPU_FEATURES_BIT, /* Features control */
22 CPU_LBRANCH_BIT, /* Last Branch */
23 CPU_BIOS_BIT, /* BIOS */
24 CPU_FREQ_BIT, /* Frequency */
25 CPU_MTTR_BIT, /* MTRR */
26 CPU_PERF_BIT, /* Performance */
27 CPU_CACHE_BIT, /* Cache */
28 CPU_SYSENTER_BIT, /* Sysenter */
29 CPU_THERM_BIT, /* Thermal */
30 CPU_MISC_BIT, /* Miscellaneous */
31 CPU_DEBUG_BIT, /* Debug */
32 CPU_PAT_BIT, /* PAT */
33 CPU_VMX_BIT, /* VMX */
34 CPU_CALL_BIT, /* System Call */
35 CPU_BASE_BIT, /* BASE Address */
36 CPU_VER_BIT, /* Version ID */
37 CPU_CONF_BIT, /* Configuration */
38 CPU_SMM_BIT, /* System mgmt mode */
39 CPU_SVM_BIT, /*Secure Virtual Machine*/
40 CPU_OSVM_BIT, /* OS-Visible Workaround*/
41/* Standard Registers */
42 CPU_TSS_BIT, /* Task Stack Segment */
43 CPU_CR_BIT, /* Control Registers */
44 CPU_DT_BIT, /* Descriptor Table */
45/* End of Registers flags */
46 CPU_REG_ALL_BIT, /* Select all Registers */
47};
48
49#define CPU_REG_ALL (~0) /* Select all Registers */
50
51#define CPU_MC (1 << CPU_MC_BIT)
52#define CPU_MONITOR (1 << CPU_MONITOR_BIT)
53#define CPU_TIME (1 << CPU_TIME_BIT)
54#define CPU_PMC (1 << CPU_PMC_BIT)
55#define CPU_PLATFORM (1 << CPU_PLATFORM_BIT)
56#define CPU_APIC (1 << CPU_APIC_BIT)
57#define CPU_POWERON (1 << CPU_POWERON_BIT)
58#define CPU_CONTROL (1 << CPU_CONTROL_BIT)
59#define CPU_FEATURES (1 << CPU_FEATURES_BIT)
60#define CPU_LBRANCH (1 << CPU_LBRANCH_BIT)
61#define CPU_BIOS (1 << CPU_BIOS_BIT)
62#define CPU_FREQ (1 << CPU_FREQ_BIT)
63#define CPU_MTRR (1 << CPU_MTTR_BIT)
64#define CPU_PERF (1 << CPU_PERF_BIT)
65#define CPU_CACHE (1 << CPU_CACHE_BIT)
66#define CPU_SYSENTER (1 << CPU_SYSENTER_BIT)
67#define CPU_THERM (1 << CPU_THERM_BIT)
68#define CPU_MISC (1 << CPU_MISC_BIT)
69#define CPU_DEBUG (1 << CPU_DEBUG_BIT)
70#define CPU_PAT (1 << CPU_PAT_BIT)
71#define CPU_VMX (1 << CPU_VMX_BIT)
72#define CPU_CALL (1 << CPU_CALL_BIT)
73#define CPU_BASE (1 << CPU_BASE_BIT)
74#define CPU_VER (1 << CPU_VER_BIT)
75#define CPU_CONF (1 << CPU_CONF_BIT)
76#define CPU_SMM (1 << CPU_SMM_BIT)
77#define CPU_SVM (1 << CPU_SVM_BIT)
78#define CPU_OSVM (1 << CPU_OSVM_BIT)
79#define CPU_TSS (1 << CPU_TSS_BIT)
80#define CPU_CR (1 << CPU_CR_BIT)
81#define CPU_DT (1 << CPU_DT_BIT)
82
83/* Register file flags */
84enum cpu_file_bit {
85 CPU_INDEX_BIT, /* index */
86 CPU_VALUE_BIT, /* value */
87};
88
89#define CPU_FILE_VALUE (1 << CPU_VALUE_BIT)
90
91/*
92 * DisplayFamily_DisplayModel Processor Families/Processor Number Series
93 * -------------------------- ------------------------------------------
94 * 05_01, 05_02, 05_04 Pentium, Pentium with MMX
95 *
96 * 06_01 Pentium Pro
97 * 06_03, 06_05 Pentium II Xeon, Pentium II
98 * 06_07, 06_08, 06_0A, 06_0B Pentium III Xeon, Pentum III
99 *
100 * 06_09, 060D Pentium M
101 *
102 * 06_0E Core Duo, Core Solo
103 *
104 * 06_0F Xeon 3000, 3200, 5100, 5300, 7300 series,
105 * Core 2 Quad, Core 2 Extreme, Core 2 Duo,
106 * Pentium dual-core
107 * 06_17 Xeon 5200, 5400 series, Core 2 Quad Q9650
108 *
109 * 06_1C Atom
110 *
111 * 0F_00, 0F_01, 0F_02 Xeon, Xeon MP, Pentium 4
112 * 0F_03, 0F_04 Xeon, Xeon MP, Pentium 4, Pentium D
113 *
114 * 0F_06 Xeon 7100, 5000 Series, Xeon MP,
115 * Pentium 4, Pentium D
116 */
117
118/* Register processors bits */
119enum cpu_processor_bit {
120 CPU_NONE,
121/* Intel */
122 CPU_INTEL_PENTIUM_BIT,
123 CPU_INTEL_P6_BIT,
124 CPU_INTEL_PENTIUM_M_BIT,
125 CPU_INTEL_CORE_BIT,
126 CPU_INTEL_CORE2_BIT,
127 CPU_INTEL_ATOM_BIT,
128 CPU_INTEL_XEON_P4_BIT,
129 CPU_INTEL_XEON_MP_BIT,
130/* AMD */
131 CPU_AMD_K6_BIT,
132 CPU_AMD_K7_BIT,
133 CPU_AMD_K8_BIT,
134 CPU_AMD_0F_BIT,
135 CPU_AMD_10_BIT,
136 CPU_AMD_11_BIT,
137};
138
139#define CPU_INTEL_PENTIUM (1 << CPU_INTEL_PENTIUM_BIT)
140#define CPU_INTEL_P6 (1 << CPU_INTEL_P6_BIT)
141#define CPU_INTEL_PENTIUM_M (1 << CPU_INTEL_PENTIUM_M_BIT)
142#define CPU_INTEL_CORE (1 << CPU_INTEL_CORE_BIT)
143#define CPU_INTEL_CORE2 (1 << CPU_INTEL_CORE2_BIT)
144#define CPU_INTEL_ATOM (1 << CPU_INTEL_ATOM_BIT)
145#define CPU_INTEL_XEON_P4 (1 << CPU_INTEL_XEON_P4_BIT)
146#define CPU_INTEL_XEON_MP (1 << CPU_INTEL_XEON_MP_BIT)
147
148#define CPU_INTEL_PX (CPU_INTEL_P6 | CPU_INTEL_PENTIUM_M)
149#define CPU_INTEL_COREX (CPU_INTEL_CORE | CPU_INTEL_CORE2)
150#define CPU_INTEL_XEON (CPU_INTEL_XEON_P4 | CPU_INTEL_XEON_MP)
151#define CPU_CO_AT (CPU_INTEL_CORE | CPU_INTEL_ATOM)
152#define CPU_C2_AT (CPU_INTEL_CORE2 | CPU_INTEL_ATOM)
153#define CPU_CX_AT (CPU_INTEL_COREX | CPU_INTEL_ATOM)
154#define CPU_CX_XE (CPU_INTEL_COREX | CPU_INTEL_XEON)
155#define CPU_P6_XE (CPU_INTEL_P6 | CPU_INTEL_XEON)
156#define CPU_PM_CO_AT (CPU_INTEL_PENTIUM_M | CPU_CO_AT)
157#define CPU_C2_AT_XE (CPU_C2_AT | CPU_INTEL_XEON)
158#define CPU_CX_AT_XE (CPU_CX_AT | CPU_INTEL_XEON)
159#define CPU_P6_CX_AT (CPU_INTEL_P6 | CPU_CX_AT)
160#define CPU_P6_CX_XE (CPU_P6_XE | CPU_INTEL_COREX)
161#define CPU_P6_CX_AT_XE (CPU_INTEL_P6 | CPU_CX_AT_XE)
162#define CPU_PM_CX_AT_XE (CPU_INTEL_PENTIUM_M | CPU_CX_AT_XE)
163#define CPU_PM_CX_AT (CPU_INTEL_PENTIUM_M | CPU_CX_AT)
164#define CPU_PM_CX_XE (CPU_INTEL_PENTIUM_M | CPU_CX_XE)
165#define CPU_PX_CX_AT (CPU_INTEL_PX | CPU_CX_AT)
166#define CPU_PX_CX_AT_XE (CPU_INTEL_PX | CPU_CX_AT_XE)
167
168/* Select all supported Intel CPUs */
169#define CPU_INTEL_ALL (CPU_INTEL_PENTIUM | CPU_PX_CX_AT_XE)
170
171#define CPU_AMD_K6 (1 << CPU_AMD_K6_BIT)
172#define CPU_AMD_K7 (1 << CPU_AMD_K7_BIT)
173#define CPU_AMD_K8 (1 << CPU_AMD_K8_BIT)
174#define CPU_AMD_0F (1 << CPU_AMD_0F_BIT)
175#define CPU_AMD_10 (1 << CPU_AMD_10_BIT)
176#define CPU_AMD_11 (1 << CPU_AMD_11_BIT)
177
178#define CPU_K10_PLUS (CPU_AMD_10 | CPU_AMD_11)
179#define CPU_K0F_PLUS (CPU_AMD_0F | CPU_K10_PLUS)
180#define CPU_K8_PLUS (CPU_AMD_K8 | CPU_K0F_PLUS)
181#define CPU_K7_PLUS (CPU_AMD_K7 | CPU_K8_PLUS)
182
183/* Select all supported AMD CPUs */
184#define CPU_AMD_ALL (CPU_AMD_K6 | CPU_K7_PLUS)
185
186/* Select all supported CPUs */
187#define CPU_ALL (CPU_INTEL_ALL | CPU_AMD_ALL)
188
189#define MAX_CPU_FILES 512
190
191struct cpu_private {
192 unsigned cpu;
193 unsigned type;
194 unsigned reg;
195 unsigned file;
196};
197
198struct cpu_debug_base {
199 char *name; /* Register name */
200 unsigned flag; /* Register flag */
201 unsigned write; /* Register write flag */
202};
203
204/*
205 * Currently it looks similar to cpu_debug_base but once we add more files
206 * cpu_file_base will go in different direction
207 */
208struct cpu_file_base {
209 char *name; /* Register file name */
210 unsigned flag; /* Register file flag */
211 unsigned write; /* Register write flag */
212};
213
214struct cpu_cpuX_base {
215 struct dentry *dentry; /* Register dentry */
216 int init; /* Register index file */
217};
218
219struct cpu_debug_range {
220 unsigned min; /* Register range min */
221 unsigned max; /* Register range max */
222 unsigned flag; /* Supported flags */
223 unsigned model; /* Supported models */
224};
225
226#endif /* _ASM_X86_CPU_DEBUG_H */
diff --git a/arch/x86/include/asm/desc.h b/arch/x86/include/asm/desc.h
index dc27705f5443..5623c50d67b2 100644
--- a/arch/x86/include/asm/desc.h
+++ b/arch/x86/include/asm/desc.h
@@ -91,7 +91,6 @@ static inline int desc_empty(const void *ptr)
91#define store_gdt(dtr) native_store_gdt(dtr) 91#define store_gdt(dtr) native_store_gdt(dtr)
92#define store_idt(dtr) native_store_idt(dtr) 92#define store_idt(dtr) native_store_idt(dtr)
93#define store_tr(tr) (tr = native_store_tr()) 93#define store_tr(tr) (tr = native_store_tr())
94#define store_ldt(ldt) asm("sldt %0":"=m" (ldt))
95 94
96#define load_TLS(t, cpu) native_load_tls(t, cpu) 95#define load_TLS(t, cpu) native_load_tls(t, cpu)
97#define set_ldt native_set_ldt 96#define set_ldt native_set_ldt
@@ -112,6 +111,8 @@ static inline void paravirt_free_ldt(struct desc_struct *ldt, unsigned entries)
112} 111}
113#endif /* CONFIG_PARAVIRT */ 112#endif /* CONFIG_PARAVIRT */
114 113
114#define store_ldt(ldt) asm("sldt %0" : "=m"(ldt))
115
115static inline void native_write_idt_entry(gate_desc *idt, int entry, 116static inline void native_write_idt_entry(gate_desc *idt, int entry,
116 const gate_desc *gate) 117 const gate_desc *gate)
117{ 118{
diff --git a/arch/x86/include/asm/device.h b/arch/x86/include/asm/device.h
index 3c034f48fdb0..4994a20acbcb 100644
--- a/arch/x86/include/asm/device.h
+++ b/arch/x86/include/asm/device.h
@@ -6,7 +6,7 @@ struct dev_archdata {
6 void *acpi_handle; 6 void *acpi_handle;
7#endif 7#endif
8#ifdef CONFIG_X86_64 8#ifdef CONFIG_X86_64
9struct dma_mapping_ops *dma_ops; 9struct dma_map_ops *dma_ops;
10#endif 10#endif
11#ifdef CONFIG_DMAR 11#ifdef CONFIG_DMAR
12 void *iommu; /* hook for IOMMU specific extension */ 12 void *iommu; /* hook for IOMMU specific extension */
diff --git a/arch/x86/include/asm/dma-mapping.h b/arch/x86/include/asm/dma-mapping.h
index 132a134d12f2..cea7b74963e9 100644
--- a/arch/x86/include/asm/dma-mapping.h
+++ b/arch/x86/include/asm/dma-mapping.h
@@ -7,6 +7,8 @@
7 */ 7 */
8 8
9#include <linux/scatterlist.h> 9#include <linux/scatterlist.h>
10#include <linux/dma-debug.h>
11#include <linux/dma-attrs.h>
10#include <asm/io.h> 12#include <asm/io.h>
11#include <asm/swiotlb.h> 13#include <asm/swiotlb.h>
12#include <asm-generic/dma-coherent.h> 14#include <asm-generic/dma-coherent.h>
@@ -16,47 +18,9 @@ extern int iommu_merge;
16extern struct device x86_dma_fallback_dev; 18extern struct device x86_dma_fallback_dev;
17extern int panic_on_overflow; 19extern int panic_on_overflow;
18 20
19struct dma_mapping_ops { 21extern struct dma_map_ops *dma_ops;
20 int (*mapping_error)(struct device *dev, 22
21 dma_addr_t dma_addr); 23static inline struct dma_map_ops *get_dma_ops(struct device *dev)
22 void* (*alloc_coherent)(struct device *dev, size_t size,
23 dma_addr_t *dma_handle, gfp_t gfp);
24 void (*free_coherent)(struct device *dev, size_t size,
25 void *vaddr, dma_addr_t dma_handle);
26 dma_addr_t (*map_single)(struct device *hwdev, phys_addr_t ptr,
27 size_t size, int direction);
28 void (*unmap_single)(struct device *dev, dma_addr_t addr,
29 size_t size, int direction);
30 void (*sync_single_for_cpu)(struct device *hwdev,
31 dma_addr_t dma_handle, size_t size,
32 int direction);
33 void (*sync_single_for_device)(struct device *hwdev,
34 dma_addr_t dma_handle, size_t size,
35 int direction);
36 void (*sync_single_range_for_cpu)(struct device *hwdev,
37 dma_addr_t dma_handle, unsigned long offset,
38 size_t size, int direction);
39 void (*sync_single_range_for_device)(struct device *hwdev,
40 dma_addr_t dma_handle, unsigned long offset,
41 size_t size, int direction);
42 void (*sync_sg_for_cpu)(struct device *hwdev,
43 struct scatterlist *sg, int nelems,
44 int direction);
45 void (*sync_sg_for_device)(struct device *hwdev,
46 struct scatterlist *sg, int nelems,
47 int direction);
48 int (*map_sg)(struct device *hwdev, struct scatterlist *sg,
49 int nents, int direction);
50 void (*unmap_sg)(struct device *hwdev,
51 struct scatterlist *sg, int nents,
52 int direction);
53 int (*dma_supported)(struct device *hwdev, u64 mask);
54 int is_phys;
55};
56
57extern struct dma_mapping_ops *dma_ops;
58
59static inline struct dma_mapping_ops *get_dma_ops(struct device *dev)
60{ 24{
61#ifdef CONFIG_X86_32 25#ifdef CONFIG_X86_32
62 return dma_ops; 26 return dma_ops;
@@ -71,7 +35,7 @@ static inline struct dma_mapping_ops *get_dma_ops(struct device *dev)
71/* Make sure we keep the same behaviour */ 35/* Make sure we keep the same behaviour */
72static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) 36static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
73{ 37{
74 struct dma_mapping_ops *ops = get_dma_ops(dev); 38 struct dma_map_ops *ops = get_dma_ops(dev);
75 if (ops->mapping_error) 39 if (ops->mapping_error)
76 return ops->mapping_error(dev, dma_addr); 40 return ops->mapping_error(dev, dma_addr);
77 41
@@ -90,137 +54,167 @@ extern void *dma_generic_alloc_coherent(struct device *dev, size_t size,
90 54
91static inline dma_addr_t 55static inline dma_addr_t
92dma_map_single(struct device *hwdev, void *ptr, size_t size, 56dma_map_single(struct device *hwdev, void *ptr, size_t size,
93 int direction) 57 enum dma_data_direction dir)
94{ 58{
95 struct dma_mapping_ops *ops = get_dma_ops(hwdev); 59 struct dma_map_ops *ops = get_dma_ops(hwdev);
96 60 dma_addr_t addr;
97 BUG_ON(!valid_dma_direction(direction)); 61
98 return ops->map_single(hwdev, virt_to_phys(ptr), size, direction); 62 BUG_ON(!valid_dma_direction(dir));
63 addr = ops->map_page(hwdev, virt_to_page(ptr),
64 (unsigned long)ptr & ~PAGE_MASK, size,
65 dir, NULL);
66 debug_dma_map_page(hwdev, virt_to_page(ptr),
67 (unsigned long)ptr & ~PAGE_MASK, size,
68 dir, addr, true);
69 return addr;
99} 70}
100 71
101static inline void 72static inline void
102dma_unmap_single(struct device *dev, dma_addr_t addr, size_t size, 73dma_unmap_single(struct device *dev, dma_addr_t addr, size_t size,
103 int direction) 74 enum dma_data_direction dir)
104{ 75{
105 struct dma_mapping_ops *ops = get_dma_ops(dev); 76 struct dma_map_ops *ops = get_dma_ops(dev);
106 77
107 BUG_ON(!valid_dma_direction(direction)); 78 BUG_ON(!valid_dma_direction(dir));
108 if (ops->unmap_single) 79 if (ops->unmap_page)
109 ops->unmap_single(dev, addr, size, direction); 80 ops->unmap_page(dev, addr, size, dir, NULL);
81 debug_dma_unmap_page(dev, addr, size, dir, true);
110} 82}
111 83
112static inline int 84static inline int
113dma_map_sg(struct device *hwdev, struct scatterlist *sg, 85dma_map_sg(struct device *hwdev, struct scatterlist *sg,
114 int nents, int direction) 86 int nents, enum dma_data_direction dir)
115{ 87{
116 struct dma_mapping_ops *ops = get_dma_ops(hwdev); 88 struct dma_map_ops *ops = get_dma_ops(hwdev);
89 int ents;
90
91 BUG_ON(!valid_dma_direction(dir));
92 ents = ops->map_sg(hwdev, sg, nents, dir, NULL);
93 debug_dma_map_sg(hwdev, sg, nents, ents, dir);
117 94
118 BUG_ON(!valid_dma_direction(direction)); 95 return ents;
119 return ops->map_sg(hwdev, sg, nents, direction);
120} 96}
121 97
122static inline void 98static inline void
123dma_unmap_sg(struct device *hwdev, struct scatterlist *sg, int nents, 99dma_unmap_sg(struct device *hwdev, struct scatterlist *sg, int nents,
124 int direction) 100 enum dma_data_direction dir)
125{ 101{
126 struct dma_mapping_ops *ops = get_dma_ops(hwdev); 102 struct dma_map_ops *ops = get_dma_ops(hwdev);
127 103
128 BUG_ON(!valid_dma_direction(direction)); 104 BUG_ON(!valid_dma_direction(dir));
105 debug_dma_unmap_sg(hwdev, sg, nents, dir);
129 if (ops->unmap_sg) 106 if (ops->unmap_sg)
130 ops->unmap_sg(hwdev, sg, nents, direction); 107 ops->unmap_sg(hwdev, sg, nents, dir, NULL);
131} 108}
132 109
133static inline void 110static inline void
134dma_sync_single_for_cpu(struct device *hwdev, dma_addr_t dma_handle, 111dma_sync_single_for_cpu(struct device *hwdev, dma_addr_t dma_handle,
135 size_t size, int direction) 112 size_t size, enum dma_data_direction dir)
136{ 113{
137 struct dma_mapping_ops *ops = get_dma_ops(hwdev); 114 struct dma_map_ops *ops = get_dma_ops(hwdev);
138 115
139 BUG_ON(!valid_dma_direction(direction)); 116 BUG_ON(!valid_dma_direction(dir));
140 if (ops->sync_single_for_cpu) 117 if (ops->sync_single_for_cpu)
141 ops->sync_single_for_cpu(hwdev, dma_handle, size, direction); 118 ops->sync_single_for_cpu(hwdev, dma_handle, size, dir);
119 debug_dma_sync_single_for_cpu(hwdev, dma_handle, size, dir);
142 flush_write_buffers(); 120 flush_write_buffers();
143} 121}
144 122
145static inline void 123static inline void
146dma_sync_single_for_device(struct device *hwdev, dma_addr_t dma_handle, 124dma_sync_single_for_device(struct device *hwdev, dma_addr_t dma_handle,
147 size_t size, int direction) 125 size_t size, enum dma_data_direction dir)
148{ 126{
149 struct dma_mapping_ops *ops = get_dma_ops(hwdev); 127 struct dma_map_ops *ops = get_dma_ops(hwdev);
150 128
151 BUG_ON(!valid_dma_direction(direction)); 129 BUG_ON(!valid_dma_direction(dir));
152 if (ops->sync_single_for_device) 130 if (ops->sync_single_for_device)
153 ops->sync_single_for_device(hwdev, dma_handle, size, direction); 131 ops->sync_single_for_device(hwdev, dma_handle, size, dir);
132 debug_dma_sync_single_for_device(hwdev, dma_handle, size, dir);
154 flush_write_buffers(); 133 flush_write_buffers();
155} 134}
156 135
157static inline void 136static inline void
158dma_sync_single_range_for_cpu(struct device *hwdev, dma_addr_t dma_handle, 137dma_sync_single_range_for_cpu(struct device *hwdev, dma_addr_t dma_handle,
159 unsigned long offset, size_t size, int direction) 138 unsigned long offset, size_t size,
139 enum dma_data_direction dir)
160{ 140{
161 struct dma_mapping_ops *ops = get_dma_ops(hwdev); 141 struct dma_map_ops *ops = get_dma_ops(hwdev);
162 142
163 BUG_ON(!valid_dma_direction(direction)); 143 BUG_ON(!valid_dma_direction(dir));
164 if (ops->sync_single_range_for_cpu) 144 if (ops->sync_single_range_for_cpu)
165 ops->sync_single_range_for_cpu(hwdev, dma_handle, offset, 145 ops->sync_single_range_for_cpu(hwdev, dma_handle, offset,
166 size, direction); 146 size, dir);
147 debug_dma_sync_single_range_for_cpu(hwdev, dma_handle,
148 offset, size, dir);
167 flush_write_buffers(); 149 flush_write_buffers();
168} 150}
169 151
170static inline void 152static inline void
171dma_sync_single_range_for_device(struct device *hwdev, dma_addr_t dma_handle, 153dma_sync_single_range_for_device(struct device *hwdev, dma_addr_t dma_handle,
172 unsigned long offset, size_t size, 154 unsigned long offset, size_t size,
173 int direction) 155 enum dma_data_direction dir)
174{ 156{
175 struct dma_mapping_ops *ops = get_dma_ops(hwdev); 157 struct dma_map_ops *ops = get_dma_ops(hwdev);
176 158
177 BUG_ON(!valid_dma_direction(direction)); 159 BUG_ON(!valid_dma_direction(dir));
178 if (ops->sync_single_range_for_device) 160 if (ops->sync_single_range_for_device)
179 ops->sync_single_range_for_device(hwdev, dma_handle, 161 ops->sync_single_range_for_device(hwdev, dma_handle,
180 offset, size, direction); 162 offset, size, dir);
163 debug_dma_sync_single_range_for_device(hwdev, dma_handle,
164 offset, size, dir);
181 flush_write_buffers(); 165 flush_write_buffers();
182} 166}
183 167
184static inline void 168static inline void
185dma_sync_sg_for_cpu(struct device *hwdev, struct scatterlist *sg, 169dma_sync_sg_for_cpu(struct device *hwdev, struct scatterlist *sg,
186 int nelems, int direction) 170 int nelems, enum dma_data_direction dir)
187{ 171{
188 struct dma_mapping_ops *ops = get_dma_ops(hwdev); 172 struct dma_map_ops *ops = get_dma_ops(hwdev);
189 173
190 BUG_ON(!valid_dma_direction(direction)); 174 BUG_ON(!valid_dma_direction(dir));
191 if (ops->sync_sg_for_cpu) 175 if (ops->sync_sg_for_cpu)
192 ops->sync_sg_for_cpu(hwdev, sg, nelems, direction); 176 ops->sync_sg_for_cpu(hwdev, sg, nelems, dir);
177 debug_dma_sync_sg_for_cpu(hwdev, sg, nelems, dir);
193 flush_write_buffers(); 178 flush_write_buffers();
194} 179}
195 180
196static inline void 181static inline void
197dma_sync_sg_for_device(struct device *hwdev, struct scatterlist *sg, 182dma_sync_sg_for_device(struct device *hwdev, struct scatterlist *sg,
198 int nelems, int direction) 183 int nelems, enum dma_data_direction dir)
199{ 184{
200 struct dma_mapping_ops *ops = get_dma_ops(hwdev); 185 struct dma_map_ops *ops = get_dma_ops(hwdev);
201 186
202 BUG_ON(!valid_dma_direction(direction)); 187 BUG_ON(!valid_dma_direction(dir));
203 if (ops->sync_sg_for_device) 188 if (ops->sync_sg_for_device)
204 ops->sync_sg_for_device(hwdev, sg, nelems, direction); 189 ops->sync_sg_for_device(hwdev, sg, nelems, dir);
190 debug_dma_sync_sg_for_device(hwdev, sg, nelems, dir);
205 191
206 flush_write_buffers(); 192 flush_write_buffers();
207} 193}
208 194
209static inline dma_addr_t dma_map_page(struct device *dev, struct page *page, 195static inline dma_addr_t dma_map_page(struct device *dev, struct page *page,
210 size_t offset, size_t size, 196 size_t offset, size_t size,
211 int direction) 197 enum dma_data_direction dir)
212{ 198{
213 struct dma_mapping_ops *ops = get_dma_ops(dev); 199 struct dma_map_ops *ops = get_dma_ops(dev);
200 dma_addr_t addr;
214 201
215 BUG_ON(!valid_dma_direction(direction)); 202 BUG_ON(!valid_dma_direction(dir));
216 return ops->map_single(dev, page_to_phys(page) + offset, 203 addr = ops->map_page(dev, page, offset, size, dir, NULL);
217 size, direction); 204 debug_dma_map_page(dev, page, offset, size, dir, addr, false);
205
206 return addr;
218} 207}
219 208
220static inline void dma_unmap_page(struct device *dev, dma_addr_t addr, 209static inline void dma_unmap_page(struct device *dev, dma_addr_t addr,
221 size_t size, int direction) 210 size_t size, enum dma_data_direction dir)
222{ 211{
223 dma_unmap_single(dev, addr, size, direction); 212 struct dma_map_ops *ops = get_dma_ops(dev);
213
214 BUG_ON(!valid_dma_direction(dir));
215 if (ops->unmap_page)
216 ops->unmap_page(dev, addr, size, dir, NULL);
217 debug_dma_unmap_page(dev, addr, size, dir, false);
224} 218}
225 219
226static inline void 220static inline void
@@ -266,7 +260,7 @@ static inline void *
266dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, 260dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle,
267 gfp_t gfp) 261 gfp_t gfp)
268{ 262{
269 struct dma_mapping_ops *ops = get_dma_ops(dev); 263 struct dma_map_ops *ops = get_dma_ops(dev);
270 void *memory; 264 void *memory;
271 265
272 gfp &= ~(__GFP_DMA | __GFP_HIGHMEM | __GFP_DMA32); 266 gfp &= ~(__GFP_DMA | __GFP_HIGHMEM | __GFP_DMA32);
@@ -285,20 +279,24 @@ dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle,
285 if (!ops->alloc_coherent) 279 if (!ops->alloc_coherent)
286 return NULL; 280 return NULL;
287 281
288 return ops->alloc_coherent(dev, size, dma_handle, 282 memory = ops->alloc_coherent(dev, size, dma_handle,
289 dma_alloc_coherent_gfp_flags(dev, gfp)); 283 dma_alloc_coherent_gfp_flags(dev, gfp));
284 debug_dma_alloc_coherent(dev, size, *dma_handle, memory);
285
286 return memory;
290} 287}
291 288
292static inline void dma_free_coherent(struct device *dev, size_t size, 289static inline void dma_free_coherent(struct device *dev, size_t size,
293 void *vaddr, dma_addr_t bus) 290 void *vaddr, dma_addr_t bus)
294{ 291{
295 struct dma_mapping_ops *ops = get_dma_ops(dev); 292 struct dma_map_ops *ops = get_dma_ops(dev);
296 293
297 WARN_ON(irqs_disabled()); /* for portability */ 294 WARN_ON(irqs_disabled()); /* for portability */
298 295
299 if (dma_release_from_coherent(dev, get_order(size), vaddr)) 296 if (dma_release_from_coherent(dev, get_order(size), vaddr))
300 return; 297 return;
301 298
299 debug_dma_free_coherent(dev, size, vaddr, bus);
302 if (ops->free_coherent) 300 if (ops->free_coherent)
303 ops->free_coherent(dev, size, vaddr, bus); 301 ops->free_coherent(dev, size, vaddr, bus);
304} 302}
diff --git a/arch/x86/include/asm/dmi.h b/arch/x86/include/asm/dmi.h
index bc68212c6bc0..fd8f9e2ca35f 100644
--- a/arch/x86/include/asm/dmi.h
+++ b/arch/x86/include/asm/dmi.h
@@ -1,22 +1,15 @@
1#ifndef _ASM_X86_DMI_H 1#ifndef _ASM_X86_DMI_H
2#define _ASM_X86_DMI_H 2#define _ASM_X86_DMI_H
3 3
4#include <asm/io.h> 4#include <linux/compiler.h>
5 5#include <linux/init.h>
6#define DMI_MAX_DATA 2048
7 6
8extern int dmi_alloc_index; 7#include <asm/io.h>
9extern char dmi_alloc_data[DMI_MAX_DATA]; 8#include <asm/setup.h>
10 9
11/* This is so early that there is no good way to allocate dynamic memory. 10static __always_inline __init void *dmi_alloc(unsigned len)
12 Allocate data in an BSS array. */
13static inline void *dmi_alloc(unsigned len)
14{ 11{
15 int idx = dmi_alloc_index; 12 return extend_brk(len, sizeof(int));
16 if ((dmi_alloc_index + len) > DMI_MAX_DATA)
17 return NULL;
18 dmi_alloc_index += len;
19 return dmi_alloc_data + idx;
20} 13}
21 14
22/* Use early IO mappings for DMI because it's initialized early */ 15/* Use early IO mappings for DMI because it's initialized early */
diff --git a/arch/x86/include/asm/e820.h b/arch/x86/include/asm/e820.h
index 00d41ce4c844..7ecba4d85089 100644
--- a/arch/x86/include/asm/e820.h
+++ b/arch/x86/include/asm/e820.h
@@ -72,7 +72,7 @@ extern int e820_all_mapped(u64 start, u64 end, unsigned type);
72extern void e820_add_region(u64 start, u64 size, int type); 72extern void e820_add_region(u64 start, u64 size, int type);
73extern void e820_print_map(char *who); 73extern void e820_print_map(char *who);
74extern int 74extern int
75sanitize_e820_map(struct e820entry *biosmap, int max_nr_map, int *pnr_map); 75sanitize_e820_map(struct e820entry *biosmap, int max_nr_map, u32 *pnr_map);
76extern u64 e820_update_range(u64 start, u64 size, unsigned old_type, 76extern u64 e820_update_range(u64 start, u64 size, unsigned old_type,
77 unsigned new_type); 77 unsigned new_type);
78extern u64 e820_remove_range(u64 start, u64 size, unsigned old_type, 78extern u64 e820_remove_range(u64 start, u64 size, unsigned old_type,
diff --git a/arch/x86/include/asm/entry_arch.h b/arch/x86/include/asm/entry_arch.h
index 854d538ae857..c2e6bedaf258 100644
--- a/arch/x86/include/asm/entry_arch.h
+++ b/arch/x86/include/asm/entry_arch.h
@@ -33,6 +33,8 @@ BUILD_INTERRUPT3(invalidate_interrupt7,INVALIDATE_TLB_VECTOR_START+7,
33 smp_invalidate_interrupt) 33 smp_invalidate_interrupt)
34#endif 34#endif
35 35
36BUILD_INTERRUPT(generic_interrupt, GENERIC_INTERRUPT_VECTOR)
37
36/* 38/*
37 * every pentium local APIC has two 'local interrupts', with a 39 * every pentium local APIC has two 'local interrupts', with a
38 * soft-definable vector attached to both interrupts, one of 40 * soft-definable vector attached to both interrupts, one of
diff --git a/arch/x86/include/asm/ftrace.h b/arch/x86/include/asm/ftrace.h
index b55b4a7fbefd..db24c2278be0 100644
--- a/arch/x86/include/asm/ftrace.h
+++ b/arch/x86/include/asm/ftrace.h
@@ -55,29 +55,4 @@ struct dyn_arch_ftrace {
55#endif /* __ASSEMBLY__ */ 55#endif /* __ASSEMBLY__ */
56#endif /* CONFIG_FUNCTION_TRACER */ 56#endif /* CONFIG_FUNCTION_TRACER */
57 57
58#ifdef CONFIG_FUNCTION_GRAPH_TRACER
59
60#ifndef __ASSEMBLY__
61
62/*
63 * Stack of return addresses for functions
64 * of a thread.
65 * Used in struct thread_info
66 */
67struct ftrace_ret_stack {
68 unsigned long ret;
69 unsigned long func;
70 unsigned long long calltime;
71};
72
73/*
74 * Primary handler of a function return.
75 * It relays on ftrace_return_to_handler.
76 * Defined in entry_32/64.S
77 */
78extern void return_to_handler(void);
79
80#endif /* __ASSEMBLY__ */
81#endif /* CONFIG_FUNCTION_GRAPH_TRACER */
82
83#endif /* _ASM_X86_FTRACE_H */ 58#endif /* _ASM_X86_FTRACE_H */
diff --git a/arch/x86/include/asm/hardirq.h b/arch/x86/include/asm/hardirq.h
index 176f058e7159..039db6aa8e02 100644
--- a/arch/x86/include/asm/hardirq.h
+++ b/arch/x86/include/asm/hardirq.h
@@ -12,6 +12,7 @@ typedef struct {
12 unsigned int apic_timer_irqs; /* arch dependent */ 12 unsigned int apic_timer_irqs; /* arch dependent */
13 unsigned int irq_spurious_count; 13 unsigned int irq_spurious_count;
14#endif 14#endif
15 unsigned int generic_irqs; /* arch dependent */
15#ifdef CONFIG_SMP 16#ifdef CONFIG_SMP
16 unsigned int irq_resched_count; 17 unsigned int irq_resched_count;
17 unsigned int irq_call_count; 18 unsigned int irq_call_count;
diff --git a/arch/x86/include/asm/highmem.h b/arch/x86/include/asm/highmem.h
index bf9276bea660..014c2b85ae45 100644
--- a/arch/x86/include/asm/highmem.h
+++ b/arch/x86/include/asm/highmem.h
@@ -63,6 +63,7 @@ void *kmap_atomic_prot(struct page *page, enum km_type type, pgprot_t prot);
63void *kmap_atomic(struct page *page, enum km_type type); 63void *kmap_atomic(struct page *page, enum km_type type);
64void kunmap_atomic(void *kvaddr, enum km_type type); 64void kunmap_atomic(void *kvaddr, enum km_type type);
65void *kmap_atomic_pfn(unsigned long pfn, enum km_type type); 65void *kmap_atomic_pfn(unsigned long pfn, enum km_type type);
66void *kmap_atomic_prot_pfn(unsigned long pfn, enum km_type type, pgprot_t prot);
66struct page *kmap_atomic_to_page(void *ptr); 67struct page *kmap_atomic_to_page(void *ptr);
67 68
68#ifndef CONFIG_PARAVIRT 69#ifndef CONFIG_PARAVIRT
diff --git a/arch/x86/include/asm/hw_irq.h b/arch/x86/include/asm/hw_irq.h
index 370e1c83bb49..b762ea49bd70 100644
--- a/arch/x86/include/asm/hw_irq.h
+++ b/arch/x86/include/asm/hw_irq.h
@@ -27,6 +27,7 @@
27 27
28/* Interrupt handlers registered during init_IRQ */ 28/* Interrupt handlers registered during init_IRQ */
29extern void apic_timer_interrupt(void); 29extern void apic_timer_interrupt(void);
30extern void generic_interrupt(void);
30extern void error_interrupt(void); 31extern void error_interrupt(void);
31extern void spurious_interrupt(void); 32extern void spurious_interrupt(void);
32extern void thermal_interrupt(void); 33extern void thermal_interrupt(void);
diff --git a/arch/x86/include/asm/init.h b/arch/x86/include/asm/init.h
new file mode 100644
index 000000000000..36fb1a6a5109
--- /dev/null
+++ b/arch/x86/include/asm/init.h
@@ -0,0 +1,18 @@
1#ifndef _ASM_X86_INIT_32_H
2#define _ASM_X86_INIT_32_H
3
4#ifdef CONFIG_X86_32
5extern void __init early_ioremap_page_table_range_init(void);
6#endif
7
8extern unsigned long __init
9kernel_physical_mapping_init(unsigned long start,
10 unsigned long end,
11 unsigned long page_size_mask);
12
13
14extern unsigned long __initdata e820_table_start;
15extern unsigned long __meminitdata e820_table_end;
16extern unsigned long __meminitdata e820_table_top;
17
18#endif /* _ASM_X86_INIT_32_H */
diff --git a/arch/x86/include/asm/io_apic.h b/arch/x86/include/asm/io_apic.h
index 59cb4a1317b7..373cc2bbcad2 100644
--- a/arch/x86/include/asm/io_apic.h
+++ b/arch/x86/include/asm/io_apic.h
@@ -162,7 +162,8 @@ extern int (*ioapic_renumber_irq)(int ioapic, int irq);
162extern void ioapic_init_mappings(void); 162extern void ioapic_init_mappings(void);
163 163
164#ifdef CONFIG_X86_64 164#ifdef CONFIG_X86_64
165extern int save_mask_IO_APIC_setup(void); 165extern int save_IO_APIC_setup(void);
166extern void mask_IO_APIC_setup(void);
166extern void restore_IO_APIC_setup(void); 167extern void restore_IO_APIC_setup(void);
167extern void reinit_intr_remapped_IO_APIC(int); 168extern void reinit_intr_remapped_IO_APIC(int);
168#endif 169#endif
@@ -172,7 +173,7 @@ extern void probe_nr_irqs_gsi(void);
172extern int setup_ioapic_entry(int apic, int irq, 173extern int setup_ioapic_entry(int apic, int irq,
173 struct IO_APIC_route_entry *entry, 174 struct IO_APIC_route_entry *entry,
174 unsigned int destination, int trigger, 175 unsigned int destination, int trigger,
175 int polarity, int vector); 176 int polarity, int vector, int pin);
176extern void ioapic_write_entry(int apic, int pin, 177extern void ioapic_write_entry(int apic, int pin,
177 struct IO_APIC_route_entry e); 178 struct IO_APIC_route_entry e);
178#else /* !CONFIG_X86_IO_APIC */ 179#else /* !CONFIG_X86_IO_APIC */
diff --git a/arch/x86/include/asm/iommu.h b/arch/x86/include/asm/iommu.h
index a6ee9e6f530f..af326a2975b5 100644
--- a/arch/x86/include/asm/iommu.h
+++ b/arch/x86/include/asm/iommu.h
@@ -3,7 +3,7 @@
3 3
4extern void pci_iommu_shutdown(void); 4extern void pci_iommu_shutdown(void);
5extern void no_iommu_init(void); 5extern void no_iommu_init(void);
6extern struct dma_mapping_ops nommu_dma_ops; 6extern struct dma_map_ops nommu_dma_ops;
7extern int force_iommu, no_iommu; 7extern int force_iommu, no_iommu;
8extern int iommu_detected; 8extern int iommu_detected;
9 9
diff --git a/arch/x86/include/asm/irq.h b/arch/x86/include/asm/irq.h
index 107eb2196691..f38481bcd455 100644
--- a/arch/x86/include/asm/irq.h
+++ b/arch/x86/include/asm/irq.h
@@ -36,6 +36,7 @@ static inline int irq_canonicalize(int irq)
36extern void fixup_irqs(void); 36extern void fixup_irqs(void);
37#endif 37#endif
38 38
39extern void (*generic_interrupt_extension)(void);
39extern void init_IRQ(void); 40extern void init_IRQ(void);
40extern void native_init_IRQ(void); 41extern void native_init_IRQ(void);
41extern bool handle_irq(unsigned irq, struct pt_regs *regs); 42extern bool handle_irq(unsigned irq, struct pt_regs *regs);
diff --git a/arch/x86/include/asm/irq_remapping.h b/arch/x86/include/asm/irq_remapping.h
index 20e1fd588dbf..0396760fccb8 100644
--- a/arch/x86/include/asm/irq_remapping.h
+++ b/arch/x86/include/asm/irq_remapping.h
@@ -1,8 +1,6 @@
1#ifndef _ASM_X86_IRQ_REMAPPING_H 1#ifndef _ASM_X86_IRQ_REMAPPING_H
2#define _ASM_X86_IRQ_REMAPPING_H 2#define _ASM_X86_IRQ_REMAPPING_H
3 3
4extern int x2apic;
5
6#define IRTE_DEST(dest) ((x2apic) ? dest : dest << 8) 4#define IRTE_DEST(dest) ((x2apic) ? dest : dest << 8)
7 5
8#endif /* _ASM_X86_IRQ_REMAPPING_H */ 6#endif /* _ASM_X86_IRQ_REMAPPING_H */
diff --git a/arch/x86/include/asm/irq_vectors.h b/arch/x86/include/asm/irq_vectors.h
index 8a285f356f8a..3cbd79bbb47c 100644
--- a/arch/x86/include/asm/irq_vectors.h
+++ b/arch/x86/include/asm/irq_vectors.h
@@ -112,6 +112,11 @@
112#define LOCAL_PERF_VECTOR 0xee 112#define LOCAL_PERF_VECTOR 0xee
113 113
114/* 114/*
115 * Generic system vector for platform specific use
116 */
117#define GENERIC_INTERRUPT_VECTOR 0xed
118
119/*
115 * First APIC vector available to drivers: (vectors 0x30-0xee) we 120 * First APIC vector available to drivers: (vectors 0x30-0xee) we
116 * start at 0x31(0x41) to spread out vectors evenly between priority 121 * start at 0x31(0x41) to spread out vectors evenly between priority
117 * levels. (0x80 is the syscall vector) 122 * levels. (0x80 is the syscall vector)
diff --git a/arch/x86/include/asm/kexec.h b/arch/x86/include/asm/kexec.h
index 0ceb6d19ed30..317ff1703d0b 100644
--- a/arch/x86/include/asm/kexec.h
+++ b/arch/x86/include/asm/kexec.h
@@ -9,13 +9,13 @@
9# define PAGES_NR 4 9# define PAGES_NR 4
10#else 10#else
11# define PA_CONTROL_PAGE 0 11# define PA_CONTROL_PAGE 0
12# define PA_TABLE_PAGE 1 12# define VA_CONTROL_PAGE 1
13# define PAGES_NR 2 13# define PA_TABLE_PAGE 2
14# define PA_SWAP_PAGE 3
15# define PAGES_NR 4
14#endif 16#endif
15 17
16#ifdef CONFIG_X86_32
17# define KEXEC_CONTROL_CODE_MAX_SIZE 2048 18# define KEXEC_CONTROL_CODE_MAX_SIZE 2048
18#endif
19 19
20#ifndef __ASSEMBLY__ 20#ifndef __ASSEMBLY__
21 21
@@ -136,10 +136,11 @@ relocate_kernel(unsigned long indirection_page,
136 unsigned int has_pae, 136 unsigned int has_pae,
137 unsigned int preserve_context); 137 unsigned int preserve_context);
138#else 138#else
139NORET_TYPE void 139unsigned long
140relocate_kernel(unsigned long indirection_page, 140relocate_kernel(unsigned long indirection_page,
141 unsigned long page_list, 141 unsigned long page_list,
142 unsigned long start_address) ATTRIB_NORET; 142 unsigned long start_address,
143 unsigned int preserve_context);
143#endif 144#endif
144 145
145#define ARCH_HAS_KIMAGE_ARCH 146#define ARCH_HAS_KIMAGE_ARCH
diff --git a/arch/x86/include/asm/lguest_hcall.h b/arch/x86/include/asm/lguest_hcall.h
index 43894428c3c2..0f4ee7148afe 100644
--- a/arch/x86/include/asm/lguest_hcall.h
+++ b/arch/x86/include/asm/lguest_hcall.h
@@ -26,36 +26,20 @@
26 26
27#ifndef __ASSEMBLY__ 27#ifndef __ASSEMBLY__
28#include <asm/hw_irq.h> 28#include <asm/hw_irq.h>
29#include <asm/kvm_para.h>
29 30
30/*G:031 But first, how does our Guest contact the Host to ask for privileged 31/*G:031 But first, how does our Guest contact the Host to ask for privileged
31 * operations? There are two ways: the direct way is to make a "hypercall", 32 * operations? There are two ways: the direct way is to make a "hypercall",
32 * to make requests of the Host Itself. 33 * to make requests of the Host Itself.
33 * 34 *
34 * Our hypercall mechanism uses the highest unused trap code (traps 32 and 35 * We use the KVM hypercall mechanism. Eighteen hypercalls are
35 * above are used by real hardware interrupts). Fifteen hypercalls are
36 * available: the hypercall number is put in the %eax register, and the 36 * available: the hypercall number is put in the %eax register, and the
37 * arguments (when required) are placed in %edx, %ebx and %ecx. If a return 37 * arguments (when required) are placed in %ebx, %ecx and %edx. If a return
38 * value makes sense, it's returned in %eax. 38 * value makes sense, it's returned in %eax.
39 * 39 *
40 * Grossly invalid calls result in Sudden Death at the hands of the vengeful 40 * Grossly invalid calls result in Sudden Death at the hands of the vengeful
41 * Host, rather than returning failure. This reflects Winston Churchill's 41 * Host, rather than returning failure. This reflects Winston Churchill's
42 * definition of a gentleman: "someone who is only rude intentionally". */ 42 * definition of a gentleman: "someone who is only rude intentionally". */
43static inline unsigned long
44hcall(unsigned long call,
45 unsigned long arg1, unsigned long arg2, unsigned long arg3)
46{
47 /* "int" is the Intel instruction to trigger a trap. */
48 asm volatile("int $" __stringify(LGUEST_TRAP_ENTRY)
49 /* The call in %eax (aka "a") might be overwritten */
50 : "=a"(call)
51 /* The arguments are in %eax, %edx, %ebx & %ecx */
52 : "a"(call), "d"(arg1), "b"(arg2), "c"(arg3)
53 /* "memory" means this might write somewhere in memory.
54 * This isn't true for all calls, but it's safe to tell
55 * gcc that it might happen so it doesn't get clever. */
56 : "memory");
57 return call;
58}
59/*:*/ 43/*:*/
60 44
61/* Can't use our min() macro here: needs to be a constant */ 45/* Can't use our min() macro here: needs to be a constant */
@@ -64,7 +48,7 @@ hcall(unsigned long call,
64#define LHCALL_RING_SIZE 64 48#define LHCALL_RING_SIZE 64
65struct hcall_args { 49struct hcall_args {
66 /* These map directly onto eax, ebx, ecx, edx in struct lguest_regs */ 50 /* These map directly onto eax, ebx, ecx, edx in struct lguest_regs */
67 unsigned long arg0, arg2, arg3, arg1; 51 unsigned long arg0, arg1, arg2, arg3;
68}; 52};
69 53
70#endif /* !__ASSEMBLY__ */ 54#endif /* !__ASSEMBLY__ */
diff --git a/arch/x86/include/asm/linkage.h b/arch/x86/include/asm/linkage.h
index 9320e2a8a26a..12d55e773eb6 100644
--- a/arch/x86/include/asm/linkage.h
+++ b/arch/x86/include/asm/linkage.h
@@ -1,14 +1,11 @@
1#ifndef _ASM_X86_LINKAGE_H 1#ifndef _ASM_X86_LINKAGE_H
2#define _ASM_X86_LINKAGE_H 2#define _ASM_X86_LINKAGE_H
3 3
4#include <linux/stringify.h>
5
4#undef notrace 6#undef notrace
5#define notrace __attribute__((no_instrument_function)) 7#define notrace __attribute__((no_instrument_function))
6 8
7#ifdef CONFIG_X86_64
8#define __ALIGN .p2align 4,,15
9#define __ALIGN_STR ".p2align 4,,15"
10#endif
11
12#ifdef CONFIG_X86_32 9#ifdef CONFIG_X86_32
13#define asmlinkage CPP_ASMLINKAGE __attribute__((regparm(0))) 10#define asmlinkage CPP_ASMLINKAGE __attribute__((regparm(0)))
14/* 11/*
@@ -50,16 +47,20 @@
50 __asmlinkage_protect_n(ret, "g" (arg1), "g" (arg2), "g" (arg3), \ 47 __asmlinkage_protect_n(ret, "g" (arg1), "g" (arg2), "g" (arg3), \
51 "g" (arg4), "g" (arg5), "g" (arg6)) 48 "g" (arg4), "g" (arg5), "g" (arg6))
52 49
53#endif 50#endif /* CONFIG_X86_32 */
51
52#ifdef __ASSEMBLY__
54 53
55#define GLOBAL(name) \ 54#define GLOBAL(name) \
56 .globl name; \ 55 .globl name; \
57 name: 56 name:
58 57
59#ifdef CONFIG_X86_ALIGNMENT_16 58#if defined(CONFIG_X86_64) || defined(CONFIG_X86_ALIGNMENT_16)
60#define __ALIGN .align 16,0x90 59#define __ALIGN .p2align 4, 0x90
61#define __ALIGN_STR ".align 16,0x90" 60#define __ALIGN_STR __stringify(__ALIGN)
62#endif 61#endif
63 62
63#endif /* __ASSEMBLY__ */
64
64#endif /* _ASM_X86_LINKAGE_H */ 65#endif /* _ASM_X86_LINKAGE_H */
65 66
diff --git a/arch/x86/include/asm/mce.h b/arch/x86/include/asm/mce.h
index 32c6e17b960b..563933e06a35 100644
--- a/arch/x86/include/asm/mce.h
+++ b/arch/x86/include/asm/mce.h
@@ -11,6 +11,8 @@
11 */ 11 */
12 12
13#define MCG_CTL_P (1UL<<8) /* MCG_CAP register available */ 13#define MCG_CTL_P (1UL<<8) /* MCG_CAP register available */
14#define MCG_EXT_P (1ULL<<9) /* Extended registers available */
15#define MCG_CMCI_P (1ULL<<10) /* CMCI supported */
14 16
15#define MCG_STATUS_RIPV (1UL<<0) /* restart ip valid */ 17#define MCG_STATUS_RIPV (1UL<<0) /* restart ip valid */
16#define MCG_STATUS_EIPV (1UL<<1) /* ip points to correct instruction */ 18#define MCG_STATUS_EIPV (1UL<<1) /* ip points to correct instruction */
@@ -90,14 +92,29 @@ extern int mce_disabled;
90 92
91#include <asm/atomic.h> 93#include <asm/atomic.h>
92 94
95void mce_setup(struct mce *m);
93void mce_log(struct mce *m); 96void mce_log(struct mce *m);
94DECLARE_PER_CPU(struct sys_device, device_mce); 97DECLARE_PER_CPU(struct sys_device, device_mce);
95extern void (*threshold_cpu_callback)(unsigned long action, unsigned int cpu); 98extern void (*threshold_cpu_callback)(unsigned long action, unsigned int cpu);
96 99
100/*
101 * To support more than 128 would need to escape the predefined
102 * Linux defined extended banks first.
103 */
104#define MAX_NR_BANKS (MCE_EXTENDED_BANK - 1)
105
97#ifdef CONFIG_X86_MCE_INTEL 106#ifdef CONFIG_X86_MCE_INTEL
98void mce_intel_feature_init(struct cpuinfo_x86 *c); 107void mce_intel_feature_init(struct cpuinfo_x86 *c);
108void cmci_clear(void);
109void cmci_reenable(void);
110void cmci_rediscover(int dying);
111void cmci_recheck(void);
99#else 112#else
100static inline void mce_intel_feature_init(struct cpuinfo_x86 *c) { } 113static inline void mce_intel_feature_init(struct cpuinfo_x86 *c) { }
114static inline void cmci_clear(void) {}
115static inline void cmci_reenable(void) {}
116static inline void cmci_rediscover(int dying) {}
117static inline void cmci_recheck(void) {}
101#endif 118#endif
102 119
103#ifdef CONFIG_X86_MCE_AMD 120#ifdef CONFIG_X86_MCE_AMD
@@ -106,11 +123,23 @@ void mce_amd_feature_init(struct cpuinfo_x86 *c);
106static inline void mce_amd_feature_init(struct cpuinfo_x86 *c) { } 123static inline void mce_amd_feature_init(struct cpuinfo_x86 *c) { }
107#endif 124#endif
108 125
109void mce_log_therm_throt_event(unsigned int cpu, __u64 status); 126extern int mce_available(struct cpuinfo_x86 *c);
127
128void mce_log_therm_throt_event(__u64 status);
110 129
111extern atomic_t mce_entry; 130extern atomic_t mce_entry;
112 131
113extern void do_machine_check(struct pt_regs *, long); 132extern void do_machine_check(struct pt_regs *, long);
133
134typedef DECLARE_BITMAP(mce_banks_t, MAX_NR_BANKS);
135DECLARE_PER_CPU(mce_banks_t, mce_poll_banks);
136
137enum mcp_flags {
138 MCP_TIMESTAMP = (1 << 0), /* log time stamp */
139 MCP_UC = (1 << 1), /* log uncorrected errors */
140};
141extern void machine_check_poll(enum mcp_flags flags, mce_banks_t *b);
142
114extern int mce_notify_user(void); 143extern int mce_notify_user(void);
115 144
116#endif /* !CONFIG_X86_32 */ 145#endif /* !CONFIG_X86_32 */
@@ -120,8 +149,8 @@ extern void mcheck_init(struct cpuinfo_x86 *c);
120#else 149#else
121#define mcheck_init(c) do { } while (0) 150#define mcheck_init(c) do { } while (0)
122#endif 151#endif
123extern void stop_mce(void); 152
124extern void restart_mce(void); 153extern void (*mce_threshold_vector)(void);
125 154
126#endif /* __KERNEL__ */ 155#endif /* __KERNEL__ */
127#endif /* _ASM_X86_MCE_H */ 156#endif /* _ASM_X86_MCE_H */
diff --git a/arch/x86/include/asm/msidef.h b/arch/x86/include/asm/msidef.h
index 6706b3006f13..4cc48af23fef 100644
--- a/arch/x86/include/asm/msidef.h
+++ b/arch/x86/include/asm/msidef.h
@@ -47,6 +47,7 @@
47#define MSI_ADDR_DEST_ID_MASK 0x00ffff0 47#define MSI_ADDR_DEST_ID_MASK 0x00ffff0
48#define MSI_ADDR_DEST_ID(dest) (((dest) << MSI_ADDR_DEST_ID_SHIFT) & \ 48#define MSI_ADDR_DEST_ID(dest) (((dest) << MSI_ADDR_DEST_ID_SHIFT) & \
49 MSI_ADDR_DEST_ID_MASK) 49 MSI_ADDR_DEST_ID_MASK)
50#define MSI_ADDR_EXT_DEST_ID(dest) ((dest) & 0xffffff00)
50 51
51#define MSI_ADDR_IR_EXT_INT (1 << 4) 52#define MSI_ADDR_IR_EXT_INT (1 << 4)
52#define MSI_ADDR_IR_SHV (1 << 3) 53#define MSI_ADDR_IR_SHV (1 << 3)
diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-index.h
index f4e505f286bc..ec41fc16c167 100644
--- a/arch/x86/include/asm/msr-index.h
+++ b/arch/x86/include/asm/msr-index.h
@@ -81,6 +81,11 @@
81#define MSR_IA32_MC0_ADDR 0x00000402 81#define MSR_IA32_MC0_ADDR 0x00000402
82#define MSR_IA32_MC0_MISC 0x00000403 82#define MSR_IA32_MC0_MISC 0x00000403
83 83
84/* These are consecutive and not in the normal 4er MCE bank block */
85#define MSR_IA32_MC0_CTL2 0x00000280
86#define CMCI_EN (1ULL << 30)
87#define CMCI_THRESHOLD_MASK 0xffffULL
88
84#define MSR_P6_PERFCTR0 0x000000c1 89#define MSR_P6_PERFCTR0 0x000000c1
85#define MSR_P6_PERFCTR1 0x000000c2 90#define MSR_P6_PERFCTR1 0x000000c2
86#define MSR_P6_EVNTSEL0 0x00000186 91#define MSR_P6_EVNTSEL0 0x00000186
diff --git a/arch/x86/include/asm/page_32_types.h b/arch/x86/include/asm/page_32_types.h
index f1e4a79a6e41..0f915ae649a7 100644
--- a/arch/x86/include/asm/page_32_types.h
+++ b/arch/x86/include/asm/page_32_types.h
@@ -39,6 +39,11 @@
39#define __VIRTUAL_MASK_SHIFT 32 39#define __VIRTUAL_MASK_SHIFT 32
40#endif /* CONFIG_X86_PAE */ 40#endif /* CONFIG_X86_PAE */
41 41
42/*
43 * Kernel image size is limited to 512 MB (see in arch/x86/kernel/head_32.S)
44 */
45#define KERNEL_IMAGE_SIZE (512 * 1024 * 1024)
46
42#ifndef __ASSEMBLY__ 47#ifndef __ASSEMBLY__
43 48
44/* 49/*
diff --git a/arch/x86/include/asm/page_types.h b/arch/x86/include/asm/page_types.h
index 2d625da6603c..826ad37006ab 100644
--- a/arch/x86/include/asm/page_types.h
+++ b/arch/x86/include/asm/page_types.h
@@ -40,14 +40,8 @@
40 40
41#ifndef __ASSEMBLY__ 41#ifndef __ASSEMBLY__
42 42
43struct pgprot;
44
45extern int page_is_ram(unsigned long pagenr); 43extern int page_is_ram(unsigned long pagenr);
46extern int devmem_is_allowed(unsigned long pagenr); 44extern int devmem_is_allowed(unsigned long pagenr);
47extern void map_devmem(unsigned long pfn, unsigned long size,
48 struct pgprot vma_prot);
49extern void unmap_devmem(unsigned long pfn, unsigned long size,
50 struct pgprot vma_prot);
51 45
52extern unsigned long max_low_pfn_mapped; 46extern unsigned long max_low_pfn_mapped;
53extern unsigned long max_pfn_mapped; 47extern unsigned long max_pfn_mapped;
diff --git a/arch/x86/include/asm/paravirt.h b/arch/x86/include/asm/paravirt.h
index 0617d5cc9712..7727aa8b7dda 100644
--- a/arch/x86/include/asm/paravirt.h
+++ b/arch/x86/include/asm/paravirt.h
@@ -317,8 +317,6 @@ struct pv_mmu_ops {
317#if PAGETABLE_LEVELS >= 3 317#if PAGETABLE_LEVELS >= 3
318#ifdef CONFIG_X86_PAE 318#ifdef CONFIG_X86_PAE
319 void (*set_pte_atomic)(pte_t *ptep, pte_t pteval); 319 void (*set_pte_atomic)(pte_t *ptep, pte_t pteval);
320 void (*set_pte_present)(struct mm_struct *mm, unsigned long addr,
321 pte_t *ptep, pte_t pte);
322 void (*pte_clear)(struct mm_struct *mm, unsigned long addr, 320 void (*pte_clear)(struct mm_struct *mm, unsigned long addr,
323 pte_t *ptep); 321 pte_t *ptep);
324 void (*pmd_clear)(pmd_t *pmdp); 322 void (*pmd_clear)(pmd_t *pmdp);
@@ -389,7 +387,7 @@ extern struct pv_lock_ops pv_lock_ops;
389 387
390#define paravirt_type(op) \ 388#define paravirt_type(op) \
391 [paravirt_typenum] "i" (PARAVIRT_PATCH(op)), \ 389 [paravirt_typenum] "i" (PARAVIRT_PATCH(op)), \
392 [paravirt_opptr] "m" (op) 390 [paravirt_opptr] "i" (&(op))
393#define paravirt_clobber(clobber) \ 391#define paravirt_clobber(clobber) \
394 [paravirt_clobber] "i" (clobber) 392 [paravirt_clobber] "i" (clobber)
395 393
@@ -443,7 +441,7 @@ int paravirt_disable_iospace(void);
443 * offset into the paravirt_patch_template structure, and can therefore be 441 * offset into the paravirt_patch_template structure, and can therefore be
444 * freely converted back into a structure offset. 442 * freely converted back into a structure offset.
445 */ 443 */
446#define PARAVIRT_CALL "call *%[paravirt_opptr];" 444#define PARAVIRT_CALL "call *%c[paravirt_opptr];"
447 445
448/* 446/*
449 * These macros are intended to wrap calls through one of the paravirt 447 * These macros are intended to wrap calls through one of the paravirt
@@ -1365,13 +1363,6 @@ static inline void set_pte_atomic(pte_t *ptep, pte_t pte)
1365 pte.pte, pte.pte >> 32); 1363 pte.pte, pte.pte >> 32);
1366} 1364}
1367 1365
1368static inline void set_pte_present(struct mm_struct *mm, unsigned long addr,
1369 pte_t *ptep, pte_t pte)
1370{
1371 /* 5 arg words */
1372 pv_mmu_ops.set_pte_present(mm, addr, ptep, pte);
1373}
1374
1375static inline void pte_clear(struct mm_struct *mm, unsigned long addr, 1366static inline void pte_clear(struct mm_struct *mm, unsigned long addr,
1376 pte_t *ptep) 1367 pte_t *ptep)
1377{ 1368{
@@ -1388,12 +1379,6 @@ static inline void set_pte_atomic(pte_t *ptep, pte_t pte)
1388 set_pte(ptep, pte); 1379 set_pte(ptep, pte);
1389} 1380}
1390 1381
1391static inline void set_pte_present(struct mm_struct *mm, unsigned long addr,
1392 pte_t *ptep, pte_t pte)
1393{
1394 set_pte(ptep, pte);
1395}
1396
1397static inline void pte_clear(struct mm_struct *mm, unsigned long addr, 1382static inline void pte_clear(struct mm_struct *mm, unsigned long addr,
1398 pte_t *ptep) 1383 pte_t *ptep)
1399{ 1384{
diff --git a/arch/x86/include/asm/pat.h b/arch/x86/include/asm/pat.h
index b0e70056838e..2cd07b9422f4 100644
--- a/arch/x86/include/asm/pat.h
+++ b/arch/x86/include/asm/pat.h
@@ -2,6 +2,7 @@
2#define _ASM_X86_PAT_H 2#define _ASM_X86_PAT_H
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5#include <asm/pgtable_types.h>
5 6
6#ifdef CONFIG_X86_PAT 7#ifdef CONFIG_X86_PAT
7extern int pat_enabled; 8extern int pat_enabled;
@@ -17,5 +18,9 @@ extern int free_memtype(u64 start, u64 end);
17 18
18extern int kernel_map_sync_memtype(u64 base, unsigned long size, 19extern int kernel_map_sync_memtype(u64 base, unsigned long size,
19 unsigned long flag); 20 unsigned long flag);
21extern void map_devmem(unsigned long pfn, unsigned long size,
22 struct pgprot vma_prot);
23extern void unmap_devmem(unsigned long pfn, unsigned long size,
24 struct pgprot vma_prot);
20 25
21#endif /* _ASM_X86_PAT_H */ 26#endif /* _ASM_X86_PAT_H */
diff --git a/arch/x86/include/asm/pgtable-2level.h b/arch/x86/include/asm/pgtable-2level.h
index c1774ac9da7a..2334982b339e 100644
--- a/arch/x86/include/asm/pgtable-2level.h
+++ b/arch/x86/include/asm/pgtable-2level.h
@@ -26,13 +26,6 @@ static inline void native_set_pte_atomic(pte_t *ptep, pte_t pte)
26 native_set_pte(ptep, pte); 26 native_set_pte(ptep, pte);
27} 27}
28 28
29static inline void native_set_pte_present(struct mm_struct *mm,
30 unsigned long addr,
31 pte_t *ptep, pte_t pte)
32{
33 native_set_pte(ptep, pte);
34}
35
36static inline void native_pmd_clear(pmd_t *pmdp) 29static inline void native_pmd_clear(pmd_t *pmdp)
37{ 30{
38 native_set_pmd(pmdp, __pmd(0)); 31 native_set_pmd(pmdp, __pmd(0));
diff --git a/arch/x86/include/asm/pgtable-3level.h b/arch/x86/include/asm/pgtable-3level.h
index 3f13cdf61156..177b0165ea01 100644
--- a/arch/x86/include/asm/pgtable-3level.h
+++ b/arch/x86/include/asm/pgtable-3level.h
@@ -31,23 +31,6 @@ static inline void native_set_pte(pte_t *ptep, pte_t pte)
31 ptep->pte_low = pte.pte_low; 31 ptep->pte_low = pte.pte_low;
32} 32}
33 33
34/*
35 * Since this is only called on user PTEs, and the page fault handler
36 * must handle the already racy situation of simultaneous page faults,
37 * we are justified in merely clearing the PTE present bit, followed
38 * by a set. The ordering here is important.
39 */
40static inline void native_set_pte_present(struct mm_struct *mm,
41 unsigned long addr,
42 pte_t *ptep, pte_t pte)
43{
44 ptep->pte_low = 0;
45 smp_wmb();
46 ptep->pte_high = pte.pte_high;
47 smp_wmb();
48 ptep->pte_low = pte.pte_low;
49}
50
51static inline void native_set_pte_atomic(pte_t *ptep, pte_t pte) 34static inline void native_set_pte_atomic(pte_t *ptep, pte_t pte)
52{ 35{
53 set_64bit((unsigned long long *)(ptep), native_pte_val(pte)); 36 set_64bit((unsigned long long *)(ptep), native_pte_val(pte));
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
index d0812e155f1d..29d96d168bc0 100644
--- a/arch/x86/include/asm/pgtable.h
+++ b/arch/x86/include/asm/pgtable.h
@@ -31,8 +31,6 @@ extern struct list_head pgd_list;
31#define set_pte(ptep, pte) native_set_pte(ptep, pte) 31#define set_pte(ptep, pte) native_set_pte(ptep, pte)
32#define set_pte_at(mm, addr, ptep, pte) native_set_pte_at(mm, addr, ptep, pte) 32#define set_pte_at(mm, addr, ptep, pte) native_set_pte_at(mm, addr, ptep, pte)
33 33
34#define set_pte_present(mm, addr, ptep, pte) \
35 native_set_pte_present(mm, addr, ptep, pte)
36#define set_pte_atomic(ptep, pte) \ 34#define set_pte_atomic(ptep, pte) \
37 native_set_pte_atomic(ptep, pte) 35 native_set_pte_atomic(ptep, pte)
38 36
diff --git a/arch/x86/include/asm/pgtable_32.h b/arch/x86/include/asm/pgtable_32.h
index 97612fc7632f..31bd120cf2a2 100644
--- a/arch/x86/include/asm/pgtable_32.h
+++ b/arch/x86/include/asm/pgtable_32.h
@@ -42,9 +42,6 @@ extern void set_pmd_pfn(unsigned long, unsigned long, pgprot_t);
42 */ 42 */
43#undef TEST_ACCESS_OK 43#undef TEST_ACCESS_OK
44 44
45/* The boot page tables (all created as a single array) */
46extern unsigned long pg0[];
47
48#ifdef CONFIG_X86_PAE 45#ifdef CONFIG_X86_PAE
49# include <asm/pgtable-3level.h> 46# include <asm/pgtable-3level.h>
50#else 47#else
diff --git a/arch/x86/include/asm/pgtable_32_types.h b/arch/x86/include/asm/pgtable_32_types.h
index bd8df3b2fe04..2733fad45f98 100644
--- a/arch/x86/include/asm/pgtable_32_types.h
+++ b/arch/x86/include/asm/pgtable_32_types.h
@@ -25,6 +25,11 @@
25 * area for the same reason. ;) 25 * area for the same reason. ;)
26 */ 26 */
27#define VMALLOC_OFFSET (8 * 1024 * 1024) 27#define VMALLOC_OFFSET (8 * 1024 * 1024)
28
29#ifndef __ASSEMBLER__
30extern bool __vmalloc_start_set; /* set once high_memory is set */
31#endif
32
28#define VMALLOC_START ((unsigned long)high_memory + VMALLOC_OFFSET) 33#define VMALLOC_START ((unsigned long)high_memory + VMALLOC_OFFSET)
29#ifdef CONFIG_X86_PAE 34#ifdef CONFIG_X86_PAE
30#define LAST_PKMAP 512 35#define LAST_PKMAP 512
diff --git a/arch/x86/include/asm/pgtable_types.h b/arch/x86/include/asm/pgtable_types.h
index 4d258ad76a0f..b8238dc8786d 100644
--- a/arch/x86/include/asm/pgtable_types.h
+++ b/arch/x86/include/asm/pgtable_types.h
@@ -273,6 +273,7 @@ typedef struct page *pgtable_t;
273 273
274extern pteval_t __supported_pte_mask; 274extern pteval_t __supported_pte_mask;
275extern int nx_enabled; 275extern int nx_enabled;
276extern void set_nx(void);
276 277
277#define pgprot_writecombine pgprot_writecombine 278#define pgprot_writecombine pgprot_writecombine
278extern pgprot_t pgprot_writecombine(pgprot_t prot); 279extern pgprot_t pgprot_writecombine(pgprot_t prot);
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
index 76139506c3e4..ae85a8d66a30 100644
--- a/arch/x86/include/asm/processor.h
+++ b/arch/x86/include/asm/processor.h
@@ -75,9 +75,9 @@ struct cpuinfo_x86 {
75#else 75#else
76 /* Number of 4K pages in DTLB/ITLB combined(in pages): */ 76 /* Number of 4K pages in DTLB/ITLB combined(in pages): */
77 int x86_tlbsize; 77 int x86_tlbsize;
78#endif
78 __u8 x86_virt_bits; 79 __u8 x86_virt_bits;
79 __u8 x86_phys_bits; 80 __u8 x86_phys_bits;
80#endif
81 /* CPUID returned core id bits: */ 81 /* CPUID returned core id bits: */
82 __u8 x86_coreid_bits; 82 __u8 x86_coreid_bits;
83 /* Max extended CPUID function supported: */ 83 /* Max extended CPUID function supported: */
@@ -391,6 +391,9 @@ DECLARE_PER_CPU(union irq_stack_union, irq_stack_union);
391DECLARE_INIT_PER_CPU(irq_stack_union); 391DECLARE_INIT_PER_CPU(irq_stack_union);
392 392
393DECLARE_PER_CPU(char *, irq_stack_ptr); 393DECLARE_PER_CPU(char *, irq_stack_ptr);
394DECLARE_PER_CPU(unsigned int, irq_count);
395extern unsigned long kernel_eflags;
396extern asmlinkage void ignore_sysret(void);
394#else /* X86_64 */ 397#else /* X86_64 */
395#ifdef CONFIG_CC_STACKPROTECTOR 398#ifdef CONFIG_CC_STACKPROTECTOR
396DECLARE_PER_CPU(unsigned long, stack_canary); 399DECLARE_PER_CPU(unsigned long, stack_canary);
diff --git a/arch/x86/include/asm/sections.h b/arch/x86/include/asm/sections.h
index 2b8c5160388f..1b7ee5d673c2 100644
--- a/arch/x86/include/asm/sections.h
+++ b/arch/x86/include/asm/sections.h
@@ -1 +1,8 @@
1#ifndef _ASM_X86_SECTIONS_H
2#define _ASM_X86_SECTIONS_H
3
1#include <asm-generic/sections.h> 4#include <asm-generic/sections.h>
5
6extern char __brk_base[], __brk_limit[];
7
8#endif /* _ASM_X86_SECTIONS_H */
diff --git a/arch/x86/include/asm/setup.h b/arch/x86/include/asm/setup.h
index 05c6f6b11fd5..bdc2ada05ae0 100644
--- a/arch/x86/include/asm/setup.h
+++ b/arch/x86/include/asm/setup.h
@@ -64,7 +64,7 @@ extern void x86_quirk_time_init(void);
64#include <asm/bootparam.h> 64#include <asm/bootparam.h>
65 65
66/* Interrupt control for vSMPowered x86_64 systems */ 66/* Interrupt control for vSMPowered x86_64 systems */
67#ifdef CONFIG_X86_VSMP 67#ifdef CONFIG_X86_64
68void vsmp_init(void); 68void vsmp_init(void);
69#else 69#else
70static inline void vsmp_init(void) { } 70static inline void vsmp_init(void) { }
@@ -100,20 +100,51 @@ extern struct boot_params boot_params;
100 */ 100 */
101#define LOWMEMSIZE() (0x9f000) 101#define LOWMEMSIZE() (0x9f000)
102 102
103/* exceedingly early brk-like allocator */
104extern unsigned long _brk_end;
105void *extend_brk(size_t size, size_t align);
106
107/*
108 * Reserve space in the brk section. The name must be unique within
109 * the file, and somewhat descriptive. The size is in bytes. Must be
110 * used at file scope.
111 *
112 * (This uses a temp function to wrap the asm so we can pass it the
113 * size parameter; otherwise we wouldn't be able to. We can't use a
114 * "section" attribute on a normal variable because it always ends up
115 * being @progbits, which ends up allocating space in the vmlinux
116 * executable.)
117 */
118#define RESERVE_BRK(name,sz) \
119 static void __section(.discard) __used \
120 __brk_reservation_fn_##name##__(void) { \
121 asm volatile ( \
122 ".pushsection .brk_reservation,\"aw\",@nobits;" \
123 ".brk." #name ":" \
124 " 1:.skip %c0;" \
125 " .size .brk." #name ", . - 1b;" \
126 " .popsection" \
127 : : "i" (sz)); \
128 }
129
103#ifdef __i386__ 130#ifdef __i386__
104 131
105void __init i386_start_kernel(void); 132void __init i386_start_kernel(void);
106extern void probe_roms(void); 133extern void probe_roms(void);
107 134
108extern unsigned long init_pg_tables_start;
109extern unsigned long init_pg_tables_end;
110
111#else 135#else
112void __init x86_64_start_kernel(char *real_mode); 136void __init x86_64_start_kernel(char *real_mode);
113void __init x86_64_start_reservations(char *real_mode_data); 137void __init x86_64_start_reservations(char *real_mode_data);
114 138
115#endif /* __i386__ */ 139#endif /* __i386__ */
116#endif /* _SETUP */ 140#endif /* _SETUP */
141#else
142#define RESERVE_BRK(name,sz) \
143 .pushsection .brk_reservation,"aw",@nobits; \
144.brk.name: \
1451: .skip sz; \
146 .size .brk.name,.-1b; \
147 .popsection
117#endif /* __ASSEMBLY__ */ 148#endif /* __ASSEMBLY__ */
118#endif /* __KERNEL__ */ 149#endif /* __KERNEL__ */
119 150
diff --git a/arch/x86/include/asm/timer.h b/arch/x86/include/asm/timer.h
index a81195eaa2b3..bd37ed444a21 100644
--- a/arch/x86/include/asm/timer.h
+++ b/arch/x86/include/asm/timer.h
@@ -12,9 +12,9 @@ unsigned long native_calibrate_tsc(void);
12 12
13#ifdef CONFIG_X86_32 13#ifdef CONFIG_X86_32
14extern int timer_ack; 14extern int timer_ack;
15extern int recalibrate_cpu_khz(void);
16extern irqreturn_t timer_interrupt(int irq, void *dev_id); 15extern irqreturn_t timer_interrupt(int irq, void *dev_id);
17#endif /* CONFIG_X86_32 */ 16#endif /* CONFIG_X86_32 */
17extern int recalibrate_cpu_khz(void);
18 18
19extern int no_timer_check; 19extern int no_timer_check;
20 20
diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topology.h
index 77cfb2cfb386..744299c0b774 100644
--- a/arch/x86/include/asm/topology.h
+++ b/arch/x86/include/asm/topology.h
@@ -217,10 +217,6 @@ static inline cpumask_t node_to_cpumask(int node)
217{ 217{
218 return cpu_online_map; 218 return cpu_online_map;
219} 219}
220static inline int node_to_first_cpu(int node)
221{
222 return first_cpu(cpu_online_map);
223}
224 220
225static inline void setup_node_to_cpumask_map(void) { } 221static inline void setup_node_to_cpumask_map(void) { }
226 222
@@ -237,14 +233,6 @@ static inline void setup_node_to_cpumask_map(void) { }
237 233
238#include <asm-generic/topology.h> 234#include <asm-generic/topology.h>
239 235
240#ifdef CONFIG_NUMA
241/* Returns the number of the first CPU on Node 'node'. */
242static inline int node_to_first_cpu(int node)
243{
244 return cpumask_first(cpumask_of_node(node));
245}
246#endif
247
248extern cpumask_t cpu_coregroup_map(int cpu); 236extern cpumask_t cpu_coregroup_map(int cpu);
249extern const struct cpumask *cpu_coregroup_mask(int cpu); 237extern const struct cpumask *cpu_coregroup_mask(int cpu);
250 238
diff --git a/arch/x86/include/asm/uv/uv_hub.h b/arch/x86/include/asm/uv/uv_hub.h
index 777327ef05c1..9f4dfba33b28 100644
--- a/arch/x86/include/asm/uv/uv_hub.h
+++ b/arch/x86/include/asm/uv/uv_hub.h
@@ -199,6 +199,10 @@ DECLARE_PER_CPU(struct uv_hub_info_s, __uv_hub_info);
199#define SCIR_CPU_ACTIVITY 0x02 /* not idle */ 199#define SCIR_CPU_ACTIVITY 0x02 /* not idle */
200#define SCIR_CPU_HB_INTERVAL (HZ) /* once per second */ 200#define SCIR_CPU_HB_INTERVAL (HZ) /* once per second */
201 201
202/* Loop through all installed blades */
203#define for_each_possible_blade(bid) \
204 for ((bid) = 0; (bid) < uv_num_possible_blades(); (bid)++)
205
202/* 206/*
203 * Macros for converting between kernel virtual addresses, socket local physical 207 * Macros for converting between kernel virtual addresses, socket local physical
204 * addresses, and UV global physical addresses. 208 * addresses, and UV global physical addresses.
diff --git a/arch/x86/include/asm/xen/hypercall.h b/arch/x86/include/asm/xen/hypercall.h
index 5e79ca694326..9c371e4a9fa6 100644
--- a/arch/x86/include/asm/xen/hypercall.h
+++ b/arch/x86/include/asm/xen/hypercall.h
@@ -296,6 +296,8 @@ HYPERVISOR_get_debugreg(int reg)
296static inline int 296static inline int
297HYPERVISOR_update_descriptor(u64 ma, u64 desc) 297HYPERVISOR_update_descriptor(u64 ma, u64 desc)
298{ 298{
299 if (sizeof(u64) == sizeof(long))
300 return _hypercall2(int, update_descriptor, ma, desc);
299 return _hypercall4(int, update_descriptor, ma, ma>>32, desc, desc>>32); 301 return _hypercall4(int, update_descriptor, ma, ma>>32, desc, desc>>32);
300} 302}
301 303
diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile
index 95f216bbfaf1..c611ad64137f 100644
--- a/arch/x86/kernel/Makefile
+++ b/arch/x86/kernel/Makefile
@@ -70,7 +70,6 @@ obj-$(CONFIG_FUNCTION_GRAPH_TRACER) += ftrace.o
70obj-$(CONFIG_KEXEC) += machine_kexec_$(BITS).o 70obj-$(CONFIG_KEXEC) += machine_kexec_$(BITS).o
71obj-$(CONFIG_KEXEC) += relocate_kernel_$(BITS).o crash.o 71obj-$(CONFIG_KEXEC) += relocate_kernel_$(BITS).o crash.o
72obj-$(CONFIG_CRASH_DUMP) += crash_dump_$(BITS).o 72obj-$(CONFIG_CRASH_DUMP) += crash_dump_$(BITS).o
73obj-$(CONFIG_X86_VSMP) += vsmp_64.o
74obj-$(CONFIG_KPROBES) += kprobes.o 73obj-$(CONFIG_KPROBES) += kprobes.o
75obj-$(CONFIG_MODULES) += module_$(BITS).o 74obj-$(CONFIG_MODULES) += module_$(BITS).o
76obj-$(CONFIG_EFI) += efi.o efi_$(BITS).o efi_stub_$(BITS).o 75obj-$(CONFIG_EFI) += efi.o efi_$(BITS).o efi_stub_$(BITS).o
@@ -106,12 +105,12 @@ obj-$(CONFIG_MICROCODE) += microcode.o
106 105
107obj-$(CONFIG_X86_CHECK_BIOS_CORRUPTION) += check.o 106obj-$(CONFIG_X86_CHECK_BIOS_CORRUPTION) += check.o
108 107
109obj-$(CONFIG_SWIOTLB) += pci-swiotlb_64.o # NB rename without _64 108obj-$(CONFIG_SWIOTLB) += pci-swiotlb.o
110 109
111### 110###
112# 64 bit specific files 111# 64 bit specific files
113ifeq ($(CONFIG_X86_64),y) 112ifeq ($(CONFIG_X86_64),y)
114 obj-$(CONFIG_X86_UV) += tlb_uv.o bios_uv.o uv_irq.o uv_sysfs.o 113 obj-$(CONFIG_X86_UV) += tlb_uv.o bios_uv.o uv_irq.o uv_sysfs.o uv_time.o
115 obj-$(CONFIG_X86_PM_TIMER) += pmtimer_64.o 114 obj-$(CONFIG_X86_PM_TIMER) += pmtimer_64.o
116 obj-$(CONFIG_AUDIT) += audit_64.o 115 obj-$(CONFIG_AUDIT) += audit_64.o
117 116
@@ -120,4 +119,5 @@ ifeq ($(CONFIG_X86_64),y)
120 obj-$(CONFIG_AMD_IOMMU) += amd_iommu_init.o amd_iommu.o 119 obj-$(CONFIG_AMD_IOMMU) += amd_iommu_init.o amd_iommu.o
121 120
122 obj-$(CONFIG_PCI_MMCONFIG) += mmconf-fam10h_64.o 121 obj-$(CONFIG_PCI_MMCONFIG) += mmconf-fam10h_64.o
122 obj-y += vsmp_64.o
123endif 123endif
diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c
index 6907b8e85d52..4c80f1557433 100644
--- a/arch/x86/kernel/alternative.c
+++ b/arch/x86/kernel/alternative.c
@@ -414,9 +414,17 @@ void __init alternative_instructions(void)
414 that might execute the to be patched code. 414 that might execute the to be patched code.
415 Other CPUs are not running. */ 415 Other CPUs are not running. */
416 stop_nmi(); 416 stop_nmi();
417#ifdef CONFIG_X86_MCE 417
418 stop_mce(); 418 /*
419#endif 419 * Don't stop machine check exceptions while patching.
420 * MCEs only happen when something got corrupted and in this
421 * case we must do something about the corruption.
422 * Ignoring it is worse than a unlikely patching race.
423 * Also machine checks tend to be broadcast and if one CPU
424 * goes into machine check the others follow quickly, so we don't
425 * expect a machine check to cause undue problems during to code
426 * patching.
427 */
420 428
421 apply_alternatives(__alt_instructions, __alt_instructions_end); 429 apply_alternatives(__alt_instructions, __alt_instructions_end);
422 430
@@ -456,9 +464,6 @@ void __init alternative_instructions(void)
456 (unsigned long)__smp_locks_end); 464 (unsigned long)__smp_locks_end);
457 465
458 restart_nmi(); 466 restart_nmi();
459#ifdef CONFIG_X86_MCE
460 restart_mce();
461#endif
462} 467}
463 468
464/** 469/**
diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c
index 5113c080f0c4..c5962fe3796f 100644
--- a/arch/x86/kernel/amd_iommu.c
+++ b/arch/x86/kernel/amd_iommu.c
@@ -22,10 +22,9 @@
22#include <linux/bitops.h> 22#include <linux/bitops.h>
23#include <linux/debugfs.h> 23#include <linux/debugfs.h>
24#include <linux/scatterlist.h> 24#include <linux/scatterlist.h>
25#include <linux/dma-mapping.h>
25#include <linux/iommu-helper.h> 26#include <linux/iommu-helper.h>
26#ifdef CONFIG_IOMMU_API
27#include <linux/iommu.h> 27#include <linux/iommu.h>
28#endif
29#include <asm/proto.h> 28#include <asm/proto.h>
30#include <asm/iommu.h> 29#include <asm/iommu.h>
31#include <asm/gart.h> 30#include <asm/gart.h>
@@ -1297,8 +1296,10 @@ static void __unmap_single(struct amd_iommu *iommu,
1297/* 1296/*
1298 * The exported map_single function for dma_ops. 1297 * The exported map_single function for dma_ops.
1299 */ 1298 */
1300static dma_addr_t map_single(struct device *dev, phys_addr_t paddr, 1299static dma_addr_t map_page(struct device *dev, struct page *page,
1301 size_t size, int dir) 1300 unsigned long offset, size_t size,
1301 enum dma_data_direction dir,
1302 struct dma_attrs *attrs)
1302{ 1303{
1303 unsigned long flags; 1304 unsigned long flags;
1304 struct amd_iommu *iommu; 1305 struct amd_iommu *iommu;
@@ -1306,6 +1307,7 @@ static dma_addr_t map_single(struct device *dev, phys_addr_t paddr,
1306 u16 devid; 1307 u16 devid;
1307 dma_addr_t addr; 1308 dma_addr_t addr;
1308 u64 dma_mask; 1309 u64 dma_mask;
1310 phys_addr_t paddr = page_to_phys(page) + offset;
1309 1311
1310 INC_STATS_COUNTER(cnt_map_single); 1312 INC_STATS_COUNTER(cnt_map_single);
1311 1313
@@ -1340,8 +1342,8 @@ out:
1340/* 1342/*
1341 * The exported unmap_single function for dma_ops. 1343 * The exported unmap_single function for dma_ops.
1342 */ 1344 */
1343static void unmap_single(struct device *dev, dma_addr_t dma_addr, 1345static void unmap_page(struct device *dev, dma_addr_t dma_addr, size_t size,
1344 size_t size, int dir) 1346 enum dma_data_direction dir, struct dma_attrs *attrs)
1345{ 1347{
1346 unsigned long flags; 1348 unsigned long flags;
1347 struct amd_iommu *iommu; 1349 struct amd_iommu *iommu;
@@ -1390,7 +1392,8 @@ static int map_sg_no_iommu(struct device *dev, struct scatterlist *sglist,
1390 * lists). 1392 * lists).
1391 */ 1393 */
1392static int map_sg(struct device *dev, struct scatterlist *sglist, 1394static int map_sg(struct device *dev, struct scatterlist *sglist,
1393 int nelems, int dir) 1395 int nelems, enum dma_data_direction dir,
1396 struct dma_attrs *attrs)
1394{ 1397{
1395 unsigned long flags; 1398 unsigned long flags;
1396 struct amd_iommu *iommu; 1399 struct amd_iommu *iommu;
@@ -1457,7 +1460,8 @@ unmap:
1457 * lists). 1460 * lists).
1458 */ 1461 */
1459static void unmap_sg(struct device *dev, struct scatterlist *sglist, 1462static void unmap_sg(struct device *dev, struct scatterlist *sglist,
1460 int nelems, int dir) 1463 int nelems, enum dma_data_direction dir,
1464 struct dma_attrs *attrs)
1461{ 1465{
1462 unsigned long flags; 1466 unsigned long flags;
1463 struct amd_iommu *iommu; 1467 struct amd_iommu *iommu;
@@ -1644,11 +1648,11 @@ static void prealloc_protection_domains(void)
1644 } 1648 }
1645} 1649}
1646 1650
1647static struct dma_mapping_ops amd_iommu_dma_ops = { 1651static struct dma_map_ops amd_iommu_dma_ops = {
1648 .alloc_coherent = alloc_coherent, 1652 .alloc_coherent = alloc_coherent,
1649 .free_coherent = free_coherent, 1653 .free_coherent = free_coherent,
1650 .map_single = map_single, 1654 .map_page = map_page,
1651 .unmap_single = unmap_single, 1655 .unmap_page = unmap_page,
1652 .map_sg = map_sg, 1656 .map_sg = map_sg,
1653 .unmap_sg = unmap_sg, 1657 .unmap_sg = unmap_sg,
1654 .dma_supported = amd_iommu_dma_supported, 1658 .dma_supported = amd_iommu_dma_supported,
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index f9cecdfd05c5..85eb8e100818 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -46,6 +46,7 @@
46#include <asm/idle.h> 46#include <asm/idle.h>
47#include <asm/mtrr.h> 47#include <asm/mtrr.h>
48#include <asm/smp.h> 48#include <asm/smp.h>
49#include <asm/mce.h>
49 50
50unsigned int num_processors; 51unsigned int num_processors;
51 52
@@ -808,7 +809,7 @@ void clear_local_APIC(void)
808 u32 v; 809 u32 v;
809 810
810 /* APIC hasn't been mapped yet */ 811 /* APIC hasn't been mapped yet */
811 if (!apic_phys) 812 if (!x2apic && !apic_phys)
812 return; 813 return;
813 814
814 maxlvt = lapic_get_maxlvt(); 815 maxlvt = lapic_get_maxlvt();
@@ -842,6 +843,14 @@ void clear_local_APIC(void)
842 apic_write(APIC_LVTTHMR, v | APIC_LVT_MASKED); 843 apic_write(APIC_LVTTHMR, v | APIC_LVT_MASKED);
843 } 844 }
844#endif 845#endif
846#ifdef CONFIG_X86_MCE_INTEL
847 if (maxlvt >= 6) {
848 v = apic_read(APIC_LVTCMCI);
849 if (!(v & APIC_LVT_MASKED))
850 apic_write(APIC_LVTCMCI, v | APIC_LVT_MASKED);
851 }
852#endif
853
845 /* 854 /*
846 * Clean APIC state for other OSs: 855 * Clean APIC state for other OSs:
847 */ 856 */
@@ -1241,6 +1250,12 @@ void __cpuinit setup_local_APIC(void)
1241 apic_write(APIC_LVT1, value); 1250 apic_write(APIC_LVT1, value);
1242 1251
1243 preempt_enable(); 1252 preempt_enable();
1253
1254#ifdef CONFIG_X86_MCE_INTEL
1255 /* Recheck CMCI information after local APIC is up on CPU #0 */
1256 if (smp_processor_id() == 0)
1257 cmci_recheck();
1258#endif
1244} 1259}
1245 1260
1246void __cpuinit end_local_APIC_setup(void) 1261void __cpuinit end_local_APIC_setup(void)
@@ -1319,15 +1334,16 @@ void __init enable_IR_x2apic(void)
1319 return; 1334 return;
1320 } 1335 }
1321 1336
1322 local_irq_save(flags); 1337 ret = save_IO_APIC_setup();
1323 mask_8259A();
1324
1325 ret = save_mask_IO_APIC_setup();
1326 if (ret) { 1338 if (ret) {
1327 pr_info("Saving IO-APIC state failed: %d\n", ret); 1339 pr_info("Saving IO-APIC state failed: %d\n", ret);
1328 goto end; 1340 goto end;
1329 } 1341 }
1330 1342
1343 local_irq_save(flags);
1344 mask_IO_APIC_setup();
1345 mask_8259A();
1346
1331 ret = enable_intr_remapping(1); 1347 ret = enable_intr_remapping(1);
1332 1348
1333 if (ret && x2apic_preenabled) { 1349 if (ret && x2apic_preenabled) {
@@ -1352,10 +1368,10 @@ end_restore:
1352 else 1368 else
1353 reinit_intr_remapped_IO_APIC(x2apic_preenabled); 1369 reinit_intr_remapped_IO_APIC(x2apic_preenabled);
1354 1370
1355end:
1356 unmask_8259A(); 1371 unmask_8259A();
1357 local_irq_restore(flags); 1372 local_irq_restore(flags);
1358 1373
1374end:
1359 if (!ret) { 1375 if (!ret) {
1360 if (!x2apic_preenabled) 1376 if (!x2apic_preenabled)
1361 pr_info("Enabled x2apic and interrupt-remapping\n"); 1377 pr_info("Enabled x2apic and interrupt-remapping\n");
@@ -1508,12 +1524,10 @@ void __init early_init_lapic_mapping(void)
1508 */ 1524 */
1509void __init init_apic_mappings(void) 1525void __init init_apic_mappings(void)
1510{ 1526{
1511#ifdef CONFIG_X86_X2APIC
1512 if (x2apic) { 1527 if (x2apic) {
1513 boot_cpu_physical_apicid = read_apic_id(); 1528 boot_cpu_physical_apicid = read_apic_id();
1514 return; 1529 return;
1515 } 1530 }
1516#endif
1517 1531
1518 /* 1532 /*
1519 * If no local APIC can be found then set up a fake all 1533 * If no local APIC can be found then set up a fake all
@@ -1957,12 +1971,9 @@ static int lapic_resume(struct sys_device *dev)
1957 1971
1958 local_irq_save(flags); 1972 local_irq_save(flags);
1959 1973
1960#ifdef CONFIG_X86_X2APIC
1961 if (x2apic) 1974 if (x2apic)
1962 enable_x2apic(); 1975 enable_x2apic();
1963 else 1976 else {
1964#endif
1965 {
1966 /* 1977 /*
1967 * Make sure the APICBASE points to the right address 1978 * Make sure the APICBASE points to the right address
1968 * 1979 *
diff --git a/arch/x86/kernel/apic/apic_flat_64.c b/arch/x86/kernel/apic/apic_flat_64.c
index f933822dba18..0014714ea97b 100644
--- a/arch/x86/kernel/apic/apic_flat_64.c
+++ b/arch/x86/kernel/apic/apic_flat_64.c
@@ -159,20 +159,6 @@ static int flat_apic_id_registered(void)
159 return physid_isset(read_xapic_id(), phys_cpu_present_map); 159 return physid_isset(read_xapic_id(), phys_cpu_present_map);
160} 160}
161 161
162static unsigned int flat_cpu_mask_to_apicid(const struct cpumask *cpumask)
163{
164 return cpumask_bits(cpumask)[0] & APIC_ALL_CPUS;
165}
166
167static unsigned int flat_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
168 const struct cpumask *andmask)
169{
170 unsigned long mask1 = cpumask_bits(cpumask)[0] & APIC_ALL_CPUS;
171 unsigned long mask2 = cpumask_bits(andmask)[0] & APIC_ALL_CPUS;
172
173 return mask1 & mask2;
174}
175
176static int flat_phys_pkg_id(int initial_apic_id, int index_msb) 162static int flat_phys_pkg_id(int initial_apic_id, int index_msb)
177{ 163{
178 return hard_smp_processor_id() >> index_msb; 164 return hard_smp_processor_id() >> index_msb;
@@ -213,8 +199,8 @@ struct apic apic_flat = {
213 .set_apic_id = set_apic_id, 199 .set_apic_id = set_apic_id,
214 .apic_id_mask = 0xFFu << 24, 200 .apic_id_mask = 0xFFu << 24,
215 201
216 .cpu_mask_to_apicid = flat_cpu_mask_to_apicid, 202 .cpu_mask_to_apicid = default_cpu_mask_to_apicid,
217 .cpu_mask_to_apicid_and = flat_cpu_mask_to_apicid_and, 203 .cpu_mask_to_apicid_and = default_cpu_mask_to_apicid_and,
218 204
219 .send_IPI_mask = flat_send_IPI_mask, 205 .send_IPI_mask = flat_send_IPI_mask,
220 .send_IPI_mask_allbutself = flat_send_IPI_mask_allbutself, 206 .send_IPI_mask_allbutself = flat_send_IPI_mask_allbutself,
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index 00e6071cefc4..da99ffcdfde6 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -389,6 +389,8 @@ struct io_apic {
389 unsigned int index; 389 unsigned int index;
390 unsigned int unused[3]; 390 unsigned int unused[3];
391 unsigned int data; 391 unsigned int data;
392 unsigned int unused2[11];
393 unsigned int eoi;
392}; 394};
393 395
394static __attribute_const__ struct io_apic __iomem *io_apic_base(int idx) 396static __attribute_const__ struct io_apic __iomem *io_apic_base(int idx)
@@ -397,6 +399,12 @@ static __attribute_const__ struct io_apic __iomem *io_apic_base(int idx)
397 + (mp_ioapics[idx].apicaddr & ~PAGE_MASK); 399 + (mp_ioapics[idx].apicaddr & ~PAGE_MASK);
398} 400}
399 401
402static inline void io_apic_eoi(unsigned int apic, unsigned int vector)
403{
404 struct io_apic __iomem *io_apic = io_apic_base(apic);
405 writel(vector, &io_apic->eoi);
406}
407
400static inline unsigned int io_apic_read(unsigned int apic, unsigned int reg) 408static inline unsigned int io_apic_read(unsigned int apic, unsigned int reg)
401{ 409{
402 struct io_apic __iomem *io_apic = io_apic_base(apic); 410 struct io_apic __iomem *io_apic = io_apic_base(apic);
@@ -546,16 +554,12 @@ static void __target_IO_APIC_irq(unsigned int irq, unsigned int dest, struct irq
546 554
547 apic = entry->apic; 555 apic = entry->apic;
548 pin = entry->pin; 556 pin = entry->pin;
549#ifdef CONFIG_INTR_REMAP
550 /* 557 /*
551 * With interrupt-remapping, destination information comes 558 * With interrupt-remapping, destination information comes
552 * from interrupt-remapping table entry. 559 * from interrupt-remapping table entry.
553 */ 560 */
554 if (!irq_remapped(irq)) 561 if (!irq_remapped(irq))
555 io_apic_write(apic, 0x11 + pin*2, dest); 562 io_apic_write(apic, 0x11 + pin*2, dest);
556#else
557 io_apic_write(apic, 0x11 + pin*2, dest);
558#endif
559 reg = io_apic_read(apic, 0x10 + pin*2); 563 reg = io_apic_read(apic, 0x10 + pin*2);
560 reg &= ~IO_APIC_REDIR_VECTOR_MASK; 564 reg &= ~IO_APIC_REDIR_VECTOR_MASK;
561 reg |= vector; 565 reg |= vector;
@@ -588,10 +592,12 @@ set_desc_affinity(struct irq_desc *desc, const struct cpumask *mask)
588 if (assign_irq_vector(irq, cfg, mask)) 592 if (assign_irq_vector(irq, cfg, mask))
589 return BAD_APICID; 593 return BAD_APICID;
590 594
591 cpumask_and(desc->affinity, cfg->domain, mask); 595 /* check that before desc->addinity get updated */
592 set_extra_move_desc(desc, mask); 596 set_extra_move_desc(desc, mask);
593 597
594 return apic->cpu_mask_to_apicid_and(desc->affinity, cpu_online_mask); 598 cpumask_copy(desc->affinity, mask);
599
600 return apic->cpu_mask_to_apicid_and(desc->affinity, cfg->domain);
595} 601}
596 602
597static void 603static void
@@ -849,9 +855,9 @@ __setup("pirq=", ioapic_pirq_setup);
849static struct IO_APIC_route_entry *early_ioapic_entries[MAX_IO_APICS]; 855static struct IO_APIC_route_entry *early_ioapic_entries[MAX_IO_APICS];
850 856
851/* 857/*
852 * Saves and masks all the unmasked IO-APIC RTE's 858 * Saves all the IO-APIC RTE's
853 */ 859 */
854int save_mask_IO_APIC_setup(void) 860int save_IO_APIC_setup(void)
855{ 861{
856 union IO_APIC_reg_01 reg_01; 862 union IO_APIC_reg_01 reg_01;
857 unsigned long flags; 863 unsigned long flags;
@@ -876,16 +882,9 @@ int save_mask_IO_APIC_setup(void)
876 } 882 }
877 883
878 for (apic = 0; apic < nr_ioapics; apic++) 884 for (apic = 0; apic < nr_ioapics; apic++)
879 for (pin = 0; pin < nr_ioapic_registers[apic]; pin++) { 885 for (pin = 0; pin < nr_ioapic_registers[apic]; pin++)
880 struct IO_APIC_route_entry entry; 886 early_ioapic_entries[apic][pin] =
881
882 entry = early_ioapic_entries[apic][pin] =
883 ioapic_read_entry(apic, pin); 887 ioapic_read_entry(apic, pin);
884 if (!entry.mask) {
885 entry.mask = 1;
886 ioapic_write_entry(apic, pin, entry);
887 }
888 }
889 888
890 return 0; 889 return 0;
891 890
@@ -898,6 +897,25 @@ nomem:
898 return -ENOMEM; 897 return -ENOMEM;
899} 898}
900 899
900void mask_IO_APIC_setup(void)
901{
902 int apic, pin;
903
904 for (apic = 0; apic < nr_ioapics; apic++) {
905 if (!early_ioapic_entries[apic])
906 break;
907 for (pin = 0; pin < nr_ioapic_registers[apic]; pin++) {
908 struct IO_APIC_route_entry entry;
909
910 entry = early_ioapic_entries[apic][pin];
911 if (!entry.mask) {
912 entry.mask = 1;
913 ioapic_write_entry(apic, pin, entry);
914 }
915 }
916 }
917}
918
901void restore_IO_APIC_setup(void) 919void restore_IO_APIC_setup(void)
902{ 920{
903 int apic, pin; 921 int apic, pin;
@@ -1411,9 +1429,7 @@ void __setup_vector_irq(int cpu)
1411} 1429}
1412 1430
1413static struct irq_chip ioapic_chip; 1431static struct irq_chip ioapic_chip;
1414#ifdef CONFIG_INTR_REMAP
1415static struct irq_chip ir_ioapic_chip; 1432static struct irq_chip ir_ioapic_chip;
1416#endif
1417 1433
1418#define IOAPIC_AUTO -1 1434#define IOAPIC_AUTO -1
1419#define IOAPIC_EDGE 0 1435#define IOAPIC_EDGE 0
@@ -1452,7 +1468,6 @@ static void ioapic_register_intr(int irq, struct irq_desc *desc, unsigned long t
1452 else 1468 else
1453 desc->status &= ~IRQ_LEVEL; 1469 desc->status &= ~IRQ_LEVEL;
1454 1470
1455#ifdef CONFIG_INTR_REMAP
1456 if (irq_remapped(irq)) { 1471 if (irq_remapped(irq)) {
1457 desc->status |= IRQ_MOVE_PCNTXT; 1472 desc->status |= IRQ_MOVE_PCNTXT;
1458 if (trigger) 1473 if (trigger)
@@ -1464,7 +1479,7 @@ static void ioapic_register_intr(int irq, struct irq_desc *desc, unsigned long t
1464 handle_edge_irq, "edge"); 1479 handle_edge_irq, "edge");
1465 return; 1480 return;
1466 } 1481 }
1467#endif 1482
1468 if ((trigger == IOAPIC_AUTO && IO_APIC_irq_trigger(irq)) || 1483 if ((trigger == IOAPIC_AUTO && IO_APIC_irq_trigger(irq)) ||
1469 trigger == IOAPIC_LEVEL) 1484 trigger == IOAPIC_LEVEL)
1470 set_irq_chip_and_handler_name(irq, &ioapic_chip, 1485 set_irq_chip_and_handler_name(irq, &ioapic_chip,
@@ -1478,14 +1493,13 @@ static void ioapic_register_intr(int irq, struct irq_desc *desc, unsigned long t
1478int setup_ioapic_entry(int apic_id, int irq, 1493int setup_ioapic_entry(int apic_id, int irq,
1479 struct IO_APIC_route_entry *entry, 1494 struct IO_APIC_route_entry *entry,
1480 unsigned int destination, int trigger, 1495 unsigned int destination, int trigger,
1481 int polarity, int vector) 1496 int polarity, int vector, int pin)
1482{ 1497{
1483 /* 1498 /*
1484 * add it to the IO-APIC irq-routing table: 1499 * add it to the IO-APIC irq-routing table:
1485 */ 1500 */
1486 memset(entry,0,sizeof(*entry)); 1501 memset(entry,0,sizeof(*entry));
1487 1502
1488#ifdef CONFIG_INTR_REMAP
1489 if (intr_remapping_enabled) { 1503 if (intr_remapping_enabled) {
1490 struct intel_iommu *iommu = map_ioapic_to_ir(apic_id); 1504 struct intel_iommu *iommu = map_ioapic_to_ir(apic_id);
1491 struct irte irte; 1505 struct irte irte;
@@ -1504,7 +1518,14 @@ int setup_ioapic_entry(int apic_id, int irq,
1504 1518
1505 irte.present = 1; 1519 irte.present = 1;
1506 irte.dst_mode = apic->irq_dest_mode; 1520 irte.dst_mode = apic->irq_dest_mode;
1507 irte.trigger_mode = trigger; 1521 /*
1522 * Trigger mode in the IRTE will always be edge, and the
1523 * actual level or edge trigger will be setup in the IO-APIC
1524 * RTE. This will help simplify level triggered irq migration.
1525 * For more details, see the comments above explainig IO-APIC
1526 * irq migration in the presence of interrupt-remapping.
1527 */
1528 irte.trigger_mode = 0;
1508 irte.dlvry_mode = apic->irq_delivery_mode; 1529 irte.dlvry_mode = apic->irq_delivery_mode;
1509 irte.vector = vector; 1530 irte.vector = vector;
1510 irte.dest_id = IRTE_DEST(destination); 1531 irte.dest_id = IRTE_DEST(destination);
@@ -1515,18 +1536,21 @@ int setup_ioapic_entry(int apic_id, int irq,
1515 ir_entry->zero = 0; 1536 ir_entry->zero = 0;
1516 ir_entry->format = 1; 1537 ir_entry->format = 1;
1517 ir_entry->index = (index & 0x7fff); 1538 ir_entry->index = (index & 0x7fff);
1518 } else 1539 /*
1519#endif 1540 * IO-APIC RTE will be configured with virtual vector.
1520 { 1541 * irq handler will do the explicit EOI to the io-apic.
1542 */
1543 ir_entry->vector = pin;
1544 } else {
1521 entry->delivery_mode = apic->irq_delivery_mode; 1545 entry->delivery_mode = apic->irq_delivery_mode;
1522 entry->dest_mode = apic->irq_dest_mode; 1546 entry->dest_mode = apic->irq_dest_mode;
1523 entry->dest = destination; 1547 entry->dest = destination;
1548 entry->vector = vector;
1524 } 1549 }
1525 1550
1526 entry->mask = 0; /* enable IRQ */ 1551 entry->mask = 0; /* enable IRQ */
1527 entry->trigger = trigger; 1552 entry->trigger = trigger;
1528 entry->polarity = polarity; 1553 entry->polarity = polarity;
1529 entry->vector = vector;
1530 1554
1531 /* Mask level triggered irqs. 1555 /* Mask level triggered irqs.
1532 * Use IRQ_DELAYED_DISABLE for edge triggered irqs. 1556 * Use IRQ_DELAYED_DISABLE for edge triggered irqs.
@@ -1561,7 +1585,7 @@ static void setup_IO_APIC_irq(int apic_id, int pin, unsigned int irq, struct irq
1561 1585
1562 1586
1563 if (setup_ioapic_entry(mp_ioapics[apic_id].apicid, irq, &entry, 1587 if (setup_ioapic_entry(mp_ioapics[apic_id].apicid, irq, &entry,
1564 dest, trigger, polarity, cfg->vector)) { 1588 dest, trigger, polarity, cfg->vector, pin)) {
1565 printk("Failed to setup ioapic entry for ioapic %d, pin %d\n", 1589 printk("Failed to setup ioapic entry for ioapic %d, pin %d\n",
1566 mp_ioapics[apic_id].apicid, pin); 1590 mp_ioapics[apic_id].apicid, pin);
1567 __clear_irq_vector(irq, cfg); 1591 __clear_irq_vector(irq, cfg);
@@ -1642,10 +1666,8 @@ static void __init setup_timer_IRQ0_pin(unsigned int apic_id, unsigned int pin,
1642{ 1666{
1643 struct IO_APIC_route_entry entry; 1667 struct IO_APIC_route_entry entry;
1644 1668
1645#ifdef CONFIG_INTR_REMAP
1646 if (intr_remapping_enabled) 1669 if (intr_remapping_enabled)
1647 return; 1670 return;
1648#endif
1649 1671
1650 memset(&entry, 0, sizeof(entry)); 1672 memset(&entry, 0, sizeof(entry));
1651 1673
@@ -2040,8 +2062,13 @@ void disable_IO_APIC(void)
2040 * If the i8259 is routed through an IOAPIC 2062 * If the i8259 is routed through an IOAPIC
2041 * Put that IOAPIC in virtual wire mode 2063 * Put that IOAPIC in virtual wire mode
2042 * so legacy interrupts can be delivered. 2064 * so legacy interrupts can be delivered.
2065 *
2066 * With interrupt-remapping, for now we will use virtual wire A mode,
2067 * as virtual wire B is little complex (need to configure both
2068 * IOAPIC RTE aswell as interrupt-remapping table entry).
2069 * As this gets called during crash dump, keep this simple for now.
2043 */ 2070 */
2044 if (ioapic_i8259.pin != -1) { 2071 if (ioapic_i8259.pin != -1 && !intr_remapping_enabled) {
2045 struct IO_APIC_route_entry entry; 2072 struct IO_APIC_route_entry entry;
2046 2073
2047 memset(&entry, 0, sizeof(entry)); 2074 memset(&entry, 0, sizeof(entry));
@@ -2061,7 +2088,10 @@ void disable_IO_APIC(void)
2061 ioapic_write_entry(ioapic_i8259.apic, ioapic_i8259.pin, entry); 2088 ioapic_write_entry(ioapic_i8259.apic, ioapic_i8259.pin, entry);
2062 } 2089 }
2063 2090
2064 disconnect_bsp_APIC(ioapic_i8259.pin != -1); 2091 /*
2092 * Use virtual wire A mode when interrupt remapping is enabled.
2093 */
2094 disconnect_bsp_APIC(!intr_remapping_enabled && ioapic_i8259.pin != -1);
2065} 2095}
2066 2096
2067#ifdef CONFIG_X86_32 2097#ifdef CONFIG_X86_32
@@ -2303,37 +2333,24 @@ static int ioapic_retrigger_irq(unsigned int irq)
2303#ifdef CONFIG_SMP 2333#ifdef CONFIG_SMP
2304 2334
2305#ifdef CONFIG_INTR_REMAP 2335#ifdef CONFIG_INTR_REMAP
2306static void ir_irq_migration(struct work_struct *work);
2307
2308static DECLARE_DELAYED_WORK(ir_migration_work, ir_irq_migration);
2309 2336
2310/* 2337/*
2311 * Migrate the IO-APIC irq in the presence of intr-remapping. 2338 * Migrate the IO-APIC irq in the presence of intr-remapping.
2312 * 2339 *
2313 * For edge triggered, irq migration is a simple atomic update(of vector 2340 * For both level and edge triggered, irq migration is a simple atomic
2314 * and cpu destination) of IRTE and flush the hardware cache. 2341 * update(of vector and cpu destination) of IRTE and flush the hardware cache.
2315 *
2316 * For level triggered, we need to modify the io-apic RTE aswell with the update
2317 * vector information, along with modifying IRTE with vector and destination.
2318 * So irq migration for level triggered is little bit more complex compared to
2319 * edge triggered migration. But the good news is, we use the same algorithm
2320 * for level triggered migration as we have today, only difference being,
2321 * we now initiate the irq migration from process context instead of the
2322 * interrupt context.
2323 * 2342 *
2324 * In future, when we do a directed EOI (combined with cpu EOI broadcast 2343 * For level triggered, we eliminate the io-apic RTE modification (with the
2325 * suppression) to the IO-APIC, level triggered irq migration will also be 2344 * updated vector information), by using a virtual vector (io-apic pin number).
2326 * as simple as edge triggered migration and we can do the irq migration 2345 * Real vector that is used for interrupting cpu will be coming from
2327 * with a simple atomic update to IO-APIC RTE. 2346 * the interrupt-remapping table entry.
2328 */ 2347 */
2329static void 2348static void
2330migrate_ioapic_irq_desc(struct irq_desc *desc, const struct cpumask *mask) 2349migrate_ioapic_irq_desc(struct irq_desc *desc, const struct cpumask *mask)
2331{ 2350{
2332 struct irq_cfg *cfg; 2351 struct irq_cfg *cfg;
2333 struct irte irte; 2352 struct irte irte;
2334 int modify_ioapic_rte;
2335 unsigned int dest; 2353 unsigned int dest;
2336 unsigned long flags;
2337 unsigned int irq; 2354 unsigned int irq;
2338 2355
2339 if (!cpumask_intersects(mask, cpu_online_mask)) 2356 if (!cpumask_intersects(mask, cpu_online_mask))
@@ -2351,13 +2368,6 @@ migrate_ioapic_irq_desc(struct irq_desc *desc, const struct cpumask *mask)
2351 2368
2352 dest = apic->cpu_mask_to_apicid_and(cfg->domain, mask); 2369 dest = apic->cpu_mask_to_apicid_and(cfg->domain, mask);
2353 2370
2354 modify_ioapic_rte = desc->status & IRQ_LEVEL;
2355 if (modify_ioapic_rte) {
2356 spin_lock_irqsave(&ioapic_lock, flags);
2357 __target_IO_APIC_irq(irq, dest, cfg);
2358 spin_unlock_irqrestore(&ioapic_lock, flags);
2359 }
2360
2361 irte.vector = cfg->vector; 2371 irte.vector = cfg->vector;
2362 irte.dest_id = IRTE_DEST(dest); 2372 irte.dest_id = IRTE_DEST(dest);
2363 2373
@@ -2372,73 +2382,12 @@ migrate_ioapic_irq_desc(struct irq_desc *desc, const struct cpumask *mask)
2372 cpumask_copy(desc->affinity, mask); 2382 cpumask_copy(desc->affinity, mask);
2373} 2383}
2374 2384
2375static int migrate_irq_remapped_level_desc(struct irq_desc *desc)
2376{
2377 int ret = -1;
2378 struct irq_cfg *cfg = desc->chip_data;
2379
2380 mask_IO_APIC_irq_desc(desc);
2381
2382 if (io_apic_level_ack_pending(cfg)) {
2383 /*
2384 * Interrupt in progress. Migrating irq now will change the
2385 * vector information in the IO-APIC RTE and that will confuse
2386 * the EOI broadcast performed by cpu.
2387 * So, delay the irq migration to the next instance.
2388 */
2389 schedule_delayed_work(&ir_migration_work, 1);
2390 goto unmask;
2391 }
2392
2393 /* everthing is clear. we have right of way */
2394 migrate_ioapic_irq_desc(desc, desc->pending_mask);
2395
2396 ret = 0;
2397 desc->status &= ~IRQ_MOVE_PENDING;
2398 cpumask_clear(desc->pending_mask);
2399
2400unmask:
2401 unmask_IO_APIC_irq_desc(desc);
2402
2403 return ret;
2404}
2405
2406static void ir_irq_migration(struct work_struct *work)
2407{
2408 unsigned int irq;
2409 struct irq_desc *desc;
2410
2411 for_each_irq_desc(irq, desc) {
2412 if (desc->status & IRQ_MOVE_PENDING) {
2413 unsigned long flags;
2414
2415 spin_lock_irqsave(&desc->lock, flags);
2416 if (!desc->chip->set_affinity ||
2417 !(desc->status & IRQ_MOVE_PENDING)) {
2418 desc->status &= ~IRQ_MOVE_PENDING;
2419 spin_unlock_irqrestore(&desc->lock, flags);
2420 continue;
2421 }
2422
2423 desc->chip->set_affinity(irq, desc->pending_mask);
2424 spin_unlock_irqrestore(&desc->lock, flags);
2425 }
2426 }
2427}
2428
2429/* 2385/*
2430 * Migrates the IRQ destination in the process context. 2386 * Migrates the IRQ destination in the process context.
2431 */ 2387 */
2432static void set_ir_ioapic_affinity_irq_desc(struct irq_desc *desc, 2388static void set_ir_ioapic_affinity_irq_desc(struct irq_desc *desc,
2433 const struct cpumask *mask) 2389 const struct cpumask *mask)
2434{ 2390{
2435 if (desc->status & IRQ_LEVEL) {
2436 desc->status |= IRQ_MOVE_PENDING;
2437 cpumask_copy(desc->pending_mask, mask);
2438 migrate_irq_remapped_level_desc(desc);
2439 return;
2440 }
2441
2442 migrate_ioapic_irq_desc(desc, mask); 2391 migrate_ioapic_irq_desc(desc, mask);
2443} 2392}
2444static void set_ir_ioapic_affinity_irq(unsigned int irq, 2393static void set_ir_ioapic_affinity_irq(unsigned int irq,
@@ -2448,6 +2397,11 @@ static void set_ir_ioapic_affinity_irq(unsigned int irq,
2448 2397
2449 set_ir_ioapic_affinity_irq_desc(desc, mask); 2398 set_ir_ioapic_affinity_irq_desc(desc, mask);
2450} 2399}
2400#else
2401static inline void set_ir_ioapic_affinity_irq_desc(struct irq_desc *desc,
2402 const struct cpumask *mask)
2403{
2404}
2451#endif 2405#endif
2452 2406
2453asmlinkage void smp_irq_move_cleanup_interrupt(void) 2407asmlinkage void smp_irq_move_cleanup_interrupt(void)
@@ -2461,6 +2415,7 @@ asmlinkage void smp_irq_move_cleanup_interrupt(void)
2461 me = smp_processor_id(); 2415 me = smp_processor_id();
2462 for (vector = FIRST_EXTERNAL_VECTOR; vector < NR_VECTORS; vector++) { 2416 for (vector = FIRST_EXTERNAL_VECTOR; vector < NR_VECTORS; vector++) {
2463 unsigned int irq; 2417 unsigned int irq;
2418 unsigned int irr;
2464 struct irq_desc *desc; 2419 struct irq_desc *desc;
2465 struct irq_cfg *cfg; 2420 struct irq_cfg *cfg;
2466 irq = __get_cpu_var(vector_irq)[vector]; 2421 irq = __get_cpu_var(vector_irq)[vector];
@@ -2480,6 +2435,18 @@ asmlinkage void smp_irq_move_cleanup_interrupt(void)
2480 if (vector == cfg->vector && cpumask_test_cpu(me, cfg->domain)) 2435 if (vector == cfg->vector && cpumask_test_cpu(me, cfg->domain))
2481 goto unlock; 2436 goto unlock;
2482 2437
2438 irr = apic_read(APIC_IRR + (vector / 32 * 0x10));
2439 /*
2440 * Check if the vector that needs to be cleanedup is
2441 * registered at the cpu's IRR. If so, then this is not
2442 * the best time to clean it up. Lets clean it up in the
2443 * next attempt by sending another IRQ_MOVE_CLEANUP_VECTOR
2444 * to myself.
2445 */
2446 if (irr & (1 << (vector % 32))) {
2447 apic->send_IPI_self(IRQ_MOVE_CLEANUP_VECTOR);
2448 goto unlock;
2449 }
2483 __get_cpu_var(vector_irq)[vector] = -1; 2450 __get_cpu_var(vector_irq)[vector] = -1;
2484 cfg->move_cleanup_count--; 2451 cfg->move_cleanup_count--;
2485unlock: 2452unlock:
@@ -2529,9 +2496,44 @@ static inline void irq_complete_move(struct irq_desc **descp) {}
2529#endif 2496#endif
2530 2497
2531#ifdef CONFIG_INTR_REMAP 2498#ifdef CONFIG_INTR_REMAP
2499static void __eoi_ioapic_irq(unsigned int irq, struct irq_cfg *cfg)
2500{
2501 int apic, pin;
2502 struct irq_pin_list *entry;
2503
2504 entry = cfg->irq_2_pin;
2505 for (;;) {
2506
2507 if (!entry)
2508 break;
2509
2510 apic = entry->apic;
2511 pin = entry->pin;
2512 io_apic_eoi(apic, pin);
2513 entry = entry->next;
2514 }
2515}
2516
2517static void
2518eoi_ioapic_irq(struct irq_desc *desc)
2519{
2520 struct irq_cfg *cfg;
2521 unsigned long flags;
2522 unsigned int irq;
2523
2524 irq = desc->irq;
2525 cfg = desc->chip_data;
2526
2527 spin_lock_irqsave(&ioapic_lock, flags);
2528 __eoi_ioapic_irq(irq, cfg);
2529 spin_unlock_irqrestore(&ioapic_lock, flags);
2530}
2531
2532static void ack_x2apic_level(unsigned int irq) 2532static void ack_x2apic_level(unsigned int irq)
2533{ 2533{
2534 struct irq_desc *desc = irq_to_desc(irq);
2534 ack_x2APIC_irq(); 2535 ack_x2APIC_irq();
2536 eoi_ioapic_irq(desc);
2535} 2537}
2536 2538
2537static void ack_x2apic_edge(unsigned int irq) 2539static void ack_x2apic_edge(unsigned int irq)
@@ -2662,20 +2664,20 @@ static struct irq_chip ioapic_chip __read_mostly = {
2662 .retrigger = ioapic_retrigger_irq, 2664 .retrigger = ioapic_retrigger_irq,
2663}; 2665};
2664 2666
2665#ifdef CONFIG_INTR_REMAP
2666static struct irq_chip ir_ioapic_chip __read_mostly = { 2667static struct irq_chip ir_ioapic_chip __read_mostly = {
2667 .name = "IR-IO-APIC", 2668 .name = "IR-IO-APIC",
2668 .startup = startup_ioapic_irq, 2669 .startup = startup_ioapic_irq,
2669 .mask = mask_IO_APIC_irq, 2670 .mask = mask_IO_APIC_irq,
2670 .unmask = unmask_IO_APIC_irq, 2671 .unmask = unmask_IO_APIC_irq,
2672#ifdef CONFIG_INTR_REMAP
2671 .ack = ack_x2apic_edge, 2673 .ack = ack_x2apic_edge,
2672 .eoi = ack_x2apic_level, 2674 .eoi = ack_x2apic_level,
2673#ifdef CONFIG_SMP 2675#ifdef CONFIG_SMP
2674 .set_affinity = set_ir_ioapic_affinity_irq, 2676 .set_affinity = set_ir_ioapic_affinity_irq,
2675#endif 2677#endif
2678#endif
2676 .retrigger = ioapic_retrigger_irq, 2679 .retrigger = ioapic_retrigger_irq,
2677}; 2680};
2678#endif
2679 2681
2680static inline void init_IO_APIC_traps(void) 2682static inline void init_IO_APIC_traps(void)
2681{ 2683{
@@ -2901,10 +2903,8 @@ static inline void __init check_timer(void)
2901 * 8259A. 2903 * 8259A.
2902 */ 2904 */
2903 if (pin1 == -1) { 2905 if (pin1 == -1) {
2904#ifdef CONFIG_INTR_REMAP
2905 if (intr_remapping_enabled) 2906 if (intr_remapping_enabled)
2906 panic("BIOS bug: timer not connected to IO-APIC"); 2907 panic("BIOS bug: timer not connected to IO-APIC");
2907#endif
2908 pin1 = pin2; 2908 pin1 = pin2;
2909 apic1 = apic2; 2909 apic1 = apic2;
2910 no_pin1 = 1; 2910 no_pin1 = 1;
@@ -2940,10 +2940,8 @@ static inline void __init check_timer(void)
2940 clear_IO_APIC_pin(0, pin1); 2940 clear_IO_APIC_pin(0, pin1);
2941 goto out; 2941 goto out;
2942 } 2942 }
2943#ifdef CONFIG_INTR_REMAP
2944 if (intr_remapping_enabled) 2943 if (intr_remapping_enabled)
2945 panic("timer doesn't work through Interrupt-remapped IO-APIC"); 2944 panic("timer doesn't work through Interrupt-remapped IO-APIC");
2946#endif
2947 local_irq_disable(); 2945 local_irq_disable();
2948 clear_IO_APIC_pin(apic1, pin1); 2946 clear_IO_APIC_pin(apic1, pin1);
2949 if (!no_pin1) 2947 if (!no_pin1)
@@ -3237,9 +3235,7 @@ void destroy_irq(unsigned int irq)
3237 if (desc) 3235 if (desc)
3238 desc->chip_data = cfg; 3236 desc->chip_data = cfg;
3239 3237
3240#ifdef CONFIG_INTR_REMAP
3241 free_irte(irq); 3238 free_irte(irq);
3242#endif
3243 spin_lock_irqsave(&vector_lock, flags); 3239 spin_lock_irqsave(&vector_lock, flags);
3244 __clear_irq_vector(irq, cfg); 3240 __clear_irq_vector(irq, cfg);
3245 spin_unlock_irqrestore(&vector_lock, flags); 3241 spin_unlock_irqrestore(&vector_lock, flags);
@@ -3265,7 +3261,6 @@ static int msi_compose_msg(struct pci_dev *pdev, unsigned int irq, struct msi_ms
3265 3261
3266 dest = apic->cpu_mask_to_apicid_and(cfg->domain, apic->target_cpus()); 3262 dest = apic->cpu_mask_to_apicid_and(cfg->domain, apic->target_cpus());
3267 3263
3268#ifdef CONFIG_INTR_REMAP
3269 if (irq_remapped(irq)) { 3264 if (irq_remapped(irq)) {
3270 struct irte irte; 3265 struct irte irte;
3271 int ir_index; 3266 int ir_index;
@@ -3291,10 +3286,13 @@ static int msi_compose_msg(struct pci_dev *pdev, unsigned int irq, struct msi_ms
3291 MSI_ADDR_IR_SHV | 3286 MSI_ADDR_IR_SHV |
3292 MSI_ADDR_IR_INDEX1(ir_index) | 3287 MSI_ADDR_IR_INDEX1(ir_index) |
3293 MSI_ADDR_IR_INDEX2(ir_index); 3288 MSI_ADDR_IR_INDEX2(ir_index);
3294 } else 3289 } else {
3295#endif 3290 if (x2apic_enabled())
3296 { 3291 msg->address_hi = MSI_ADDR_BASE_HI |
3297 msg->address_hi = MSI_ADDR_BASE_HI; 3292 MSI_ADDR_EXT_DEST_ID(dest);
3293 else
3294 msg->address_hi = MSI_ADDR_BASE_HI;
3295
3298 msg->address_lo = 3296 msg->address_lo =
3299 MSI_ADDR_BASE_LO | 3297 MSI_ADDR_BASE_LO |
3300 ((apic->irq_dest_mode == 0) ? 3298 ((apic->irq_dest_mode == 0) ?
@@ -3394,15 +3392,16 @@ static struct irq_chip msi_chip = {
3394 .retrigger = ioapic_retrigger_irq, 3392 .retrigger = ioapic_retrigger_irq,
3395}; 3393};
3396 3394
3397#ifdef CONFIG_INTR_REMAP
3398static struct irq_chip msi_ir_chip = { 3395static struct irq_chip msi_ir_chip = {
3399 .name = "IR-PCI-MSI", 3396 .name = "IR-PCI-MSI",
3400 .unmask = unmask_msi_irq, 3397 .unmask = unmask_msi_irq,
3401 .mask = mask_msi_irq, 3398 .mask = mask_msi_irq,
3399#ifdef CONFIG_INTR_REMAP
3402 .ack = ack_x2apic_edge, 3400 .ack = ack_x2apic_edge,
3403#ifdef CONFIG_SMP 3401#ifdef CONFIG_SMP
3404 .set_affinity = ir_set_msi_irq_affinity, 3402 .set_affinity = ir_set_msi_irq_affinity,
3405#endif 3403#endif
3404#endif
3406 .retrigger = ioapic_retrigger_irq, 3405 .retrigger = ioapic_retrigger_irq,
3407}; 3406};
3408 3407
@@ -3432,7 +3431,6 @@ static int msi_alloc_irte(struct pci_dev *dev, int irq, int nvec)
3432 } 3431 }
3433 return index; 3432 return index;
3434} 3433}
3435#endif
3436 3434
3437static int setup_msi_irq(struct pci_dev *dev, struct msi_desc *msidesc, int irq) 3435static int setup_msi_irq(struct pci_dev *dev, struct msi_desc *msidesc, int irq)
3438{ 3436{
@@ -3446,7 +3444,6 @@ static int setup_msi_irq(struct pci_dev *dev, struct msi_desc *msidesc, int irq)
3446 set_irq_msi(irq, msidesc); 3444 set_irq_msi(irq, msidesc);
3447 write_msi_msg(irq, &msg); 3445 write_msi_msg(irq, &msg);
3448 3446
3449#ifdef CONFIG_INTR_REMAP
3450 if (irq_remapped(irq)) { 3447 if (irq_remapped(irq)) {
3451 struct irq_desc *desc = irq_to_desc(irq); 3448 struct irq_desc *desc = irq_to_desc(irq);
3452 /* 3449 /*
@@ -3455,7 +3452,6 @@ static int setup_msi_irq(struct pci_dev *dev, struct msi_desc *msidesc, int irq)
3455 desc->status |= IRQ_MOVE_PCNTXT; 3452 desc->status |= IRQ_MOVE_PCNTXT;
3456 set_irq_chip_and_handler_name(irq, &msi_ir_chip, handle_edge_irq, "edge"); 3453 set_irq_chip_and_handler_name(irq, &msi_ir_chip, handle_edge_irq, "edge");
3457 } else 3454 } else
3458#endif
3459 set_irq_chip_and_handler_name(irq, &msi_chip, handle_edge_irq, "edge"); 3455 set_irq_chip_and_handler_name(irq, &msi_chip, handle_edge_irq, "edge");
3460 3456
3461 dev_printk(KERN_DEBUG, &dev->dev, "irq %d for MSI/MSI-X\n", irq); 3457 dev_printk(KERN_DEBUG, &dev->dev, "irq %d for MSI/MSI-X\n", irq);
@@ -3469,11 +3465,8 @@ int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
3469 int ret, sub_handle; 3465 int ret, sub_handle;
3470 struct msi_desc *msidesc; 3466 struct msi_desc *msidesc;
3471 unsigned int irq_want; 3467 unsigned int irq_want;
3472 3468 struct intel_iommu *iommu = NULL;
3473#ifdef CONFIG_INTR_REMAP
3474 struct intel_iommu *iommu = 0;
3475 int index = 0; 3469 int index = 0;
3476#endif
3477 3470
3478 irq_want = nr_irqs_gsi; 3471 irq_want = nr_irqs_gsi;
3479 sub_handle = 0; 3472 sub_handle = 0;
@@ -3482,7 +3475,6 @@ int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
3482 if (irq == 0) 3475 if (irq == 0)
3483 return -1; 3476 return -1;
3484 irq_want = irq + 1; 3477 irq_want = irq + 1;
3485#ifdef CONFIG_INTR_REMAP
3486 if (!intr_remapping_enabled) 3478 if (!intr_remapping_enabled)
3487 goto no_ir; 3479 goto no_ir;
3488 3480
@@ -3510,7 +3502,6 @@ int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
3510 set_irte_irq(irq, iommu, index, sub_handle); 3502 set_irte_irq(irq, iommu, index, sub_handle);
3511 } 3503 }
3512no_ir: 3504no_ir:
3513#endif
3514 ret = setup_msi_irq(dev, msidesc, irq); 3505 ret = setup_msi_irq(dev, msidesc, irq);
3515 if (ret < 0) 3506 if (ret < 0)
3516 goto error; 3507 goto error;
@@ -3528,7 +3519,7 @@ void arch_teardown_msi_irq(unsigned int irq)
3528 destroy_irq(irq); 3519 destroy_irq(irq);
3529} 3520}
3530 3521
3531#ifdef CONFIG_DMAR 3522#if defined (CONFIG_DMAR) || defined (CONFIG_INTR_REMAP)
3532#ifdef CONFIG_SMP 3523#ifdef CONFIG_SMP
3533static void dmar_msi_set_affinity(unsigned int irq, const struct cpumask *mask) 3524static void dmar_msi_set_affinity(unsigned int irq, const struct cpumask *mask)
3534{ 3525{
@@ -3609,7 +3600,7 @@ static void hpet_msi_set_affinity(unsigned int irq, const struct cpumask *mask)
3609 3600
3610#endif /* CONFIG_SMP */ 3601#endif /* CONFIG_SMP */
3611 3602
3612struct irq_chip hpet_msi_type = { 3603static struct irq_chip hpet_msi_type = {
3613 .name = "HPET_MSI", 3604 .name = "HPET_MSI",
3614 .unmask = hpet_msi_unmask, 3605 .unmask = hpet_msi_unmask,
3615 .mask = hpet_msi_mask, 3606 .mask = hpet_msi_mask,
@@ -4045,11 +4036,9 @@ void __init setup_ioapic_dest(void)
4045 else 4036 else
4046 mask = apic->target_cpus(); 4037 mask = apic->target_cpus();
4047 4038
4048#ifdef CONFIG_INTR_REMAP
4049 if (intr_remapping_enabled) 4039 if (intr_remapping_enabled)
4050 set_ir_ioapic_affinity_irq_desc(desc, mask); 4040 set_ir_ioapic_affinity_irq_desc(desc, mask);
4051 else 4041 else
4052#endif
4053 set_ioapic_affinity_irq_desc(desc, mask); 4042 set_ioapic_affinity_irq_desc(desc, mask);
4054 } 4043 }
4055 4044
@@ -4142,9 +4131,12 @@ static int __init ioapic_insert_resources(void)
4142 struct resource *r = ioapic_resources; 4131 struct resource *r = ioapic_resources;
4143 4132
4144 if (!r) { 4133 if (!r) {
4145 printk(KERN_ERR 4134 if (nr_ioapics > 0) {
4146 "IO APIC resources could be not be allocated.\n"); 4135 printk(KERN_ERR
4147 return -1; 4136 "IO APIC resources couldn't be allocated.\n");
4137 return -1;
4138 }
4139 return 0;
4148 } 4140 }
4149 4141
4150 for (i = 0; i < nr_ioapics; i++) { 4142 for (i = 0; i < nr_ioapics; i++) {
diff --git a/arch/x86/kernel/apic/probe_64.c b/arch/x86/kernel/apic/probe_64.c
index 8d7748efe6a8..1783652bb0e5 100644
--- a/arch/x86/kernel/apic/probe_64.c
+++ b/arch/x86/kernel/apic/probe_64.c
@@ -68,6 +68,13 @@ void __init default_setup_apic_routing(void)
68 apic = &apic_physflat; 68 apic = &apic_physflat;
69 printk(KERN_INFO "Setting APIC routing to %s\n", apic->name); 69 printk(KERN_INFO "Setting APIC routing to %s\n", apic->name);
70 } 70 }
71
72 /*
73 * Now that apic routing model is selected, configure the
74 * fault handling for intr remapping.
75 */
76 if (intr_remapping_enabled)
77 enable_drhd_fault_handling();
71} 78}
72 79
73/* Same for both flat and physical. */ 80/* Same for both flat and physical. */
diff --git a/arch/x86/kernel/apic/x2apic_cluster.c b/arch/x86/kernel/apic/x2apic_cluster.c
index 8fb87b6dd633..4a903e2f0d17 100644
--- a/arch/x86/kernel/apic/x2apic_cluster.c
+++ b/arch/x86/kernel/apic/x2apic_cluster.c
@@ -57,6 +57,8 @@ static void x2apic_send_IPI_mask(const struct cpumask *mask, int vector)
57 unsigned long query_cpu; 57 unsigned long query_cpu;
58 unsigned long flags; 58 unsigned long flags;
59 59
60 x2apic_wrmsr_fence();
61
60 local_irq_save(flags); 62 local_irq_save(flags);
61 for_each_cpu(query_cpu, mask) { 63 for_each_cpu(query_cpu, mask) {
62 __x2apic_send_IPI_dest( 64 __x2apic_send_IPI_dest(
@@ -73,6 +75,8 @@ static void
73 unsigned long query_cpu; 75 unsigned long query_cpu;
74 unsigned long flags; 76 unsigned long flags;
75 77
78 x2apic_wrmsr_fence();
79
76 local_irq_save(flags); 80 local_irq_save(flags);
77 for_each_cpu(query_cpu, mask) { 81 for_each_cpu(query_cpu, mask) {
78 if (query_cpu == this_cpu) 82 if (query_cpu == this_cpu)
@@ -90,6 +94,8 @@ static void x2apic_send_IPI_allbutself(int vector)
90 unsigned long query_cpu; 94 unsigned long query_cpu;
91 unsigned long flags; 95 unsigned long flags;
92 96
97 x2apic_wrmsr_fence();
98
93 local_irq_save(flags); 99 local_irq_save(flags);
94 for_each_online_cpu(query_cpu) { 100 for_each_online_cpu(query_cpu) {
95 if (query_cpu == this_cpu) 101 if (query_cpu == this_cpu)
diff --git a/arch/x86/kernel/apic/x2apic_phys.c b/arch/x86/kernel/apic/x2apic_phys.c
index 23625b9f98b2..a284359627e7 100644
--- a/arch/x86/kernel/apic/x2apic_phys.c
+++ b/arch/x86/kernel/apic/x2apic_phys.c
@@ -58,6 +58,8 @@ static void x2apic_send_IPI_mask(const struct cpumask *mask, int vector)
58 unsigned long query_cpu; 58 unsigned long query_cpu;
59 unsigned long flags; 59 unsigned long flags;
60 60
61 x2apic_wrmsr_fence();
62
61 local_irq_save(flags); 63 local_irq_save(flags);
62 for_each_cpu(query_cpu, mask) { 64 for_each_cpu(query_cpu, mask) {
63 __x2apic_send_IPI_dest(per_cpu(x86_cpu_to_apicid, query_cpu), 65 __x2apic_send_IPI_dest(per_cpu(x86_cpu_to_apicid, query_cpu),
@@ -73,6 +75,8 @@ static void
73 unsigned long query_cpu; 75 unsigned long query_cpu;
74 unsigned long flags; 76 unsigned long flags;
75 77
78 x2apic_wrmsr_fence();
79
76 local_irq_save(flags); 80 local_irq_save(flags);
77 for_each_cpu(query_cpu, mask) { 81 for_each_cpu(query_cpu, mask) {
78 if (query_cpu != this_cpu) 82 if (query_cpu != this_cpu)
@@ -89,6 +93,8 @@ static void x2apic_send_IPI_allbutself(int vector)
89 unsigned long query_cpu; 93 unsigned long query_cpu;
90 unsigned long flags; 94 unsigned long flags;
91 95
96 x2apic_wrmsr_fence();
97
92 local_irq_save(flags); 98 local_irq_save(flags);
93 for_each_online_cpu(query_cpu) { 99 for_each_online_cpu(query_cpu) {
94 if (query_cpu == this_cpu) 100 if (query_cpu == this_cpu)
diff --git a/arch/x86/kernel/apm_32.c b/arch/x86/kernel/apm_32.c
index 10033fe718e0..ac7783a67432 100644
--- a/arch/x86/kernel/apm_32.c
+++ b/arch/x86/kernel/apm_32.c
@@ -1190,8 +1190,10 @@ static int suspend(int vetoable)
1190 struct apm_user *as; 1190 struct apm_user *as;
1191 1191
1192 device_suspend(PMSG_SUSPEND); 1192 device_suspend(PMSG_SUSPEND);
1193 local_irq_disable(); 1193
1194 device_power_down(PMSG_SUSPEND); 1194 device_power_down(PMSG_SUSPEND);
1195
1196 local_irq_disable();
1195 sysdev_suspend(PMSG_SUSPEND); 1197 sysdev_suspend(PMSG_SUSPEND);
1196 1198
1197 local_irq_enable(); 1199 local_irq_enable();
@@ -1209,9 +1211,12 @@ static int suspend(int vetoable)
1209 if (err != APM_SUCCESS) 1211 if (err != APM_SUCCESS)
1210 apm_error("suspend", err); 1212 apm_error("suspend", err);
1211 err = (err == APM_SUCCESS) ? 0 : -EIO; 1213 err = (err == APM_SUCCESS) ? 0 : -EIO;
1214
1212 sysdev_resume(); 1215 sysdev_resume();
1213 device_power_up(PMSG_RESUME);
1214 local_irq_enable(); 1216 local_irq_enable();
1217
1218 device_power_up(PMSG_RESUME);
1219
1215 device_resume(PMSG_RESUME); 1220 device_resume(PMSG_RESUME);
1216 queue_event(APM_NORMAL_RESUME, NULL); 1221 queue_event(APM_NORMAL_RESUME, NULL);
1217 spin_lock(&user_list_lock); 1222 spin_lock(&user_list_lock);
@@ -1228,8 +1233,9 @@ static void standby(void)
1228{ 1233{
1229 int err; 1234 int err;
1230 1235
1231 local_irq_disable();
1232 device_power_down(PMSG_SUSPEND); 1236 device_power_down(PMSG_SUSPEND);
1237
1238 local_irq_disable();
1233 sysdev_suspend(PMSG_SUSPEND); 1239 sysdev_suspend(PMSG_SUSPEND);
1234 local_irq_enable(); 1240 local_irq_enable();
1235 1241
@@ -1239,8 +1245,9 @@ static void standby(void)
1239 1245
1240 local_irq_disable(); 1246 local_irq_disable();
1241 sysdev_resume(); 1247 sysdev_resume();
1242 device_power_up(PMSG_RESUME);
1243 local_irq_enable(); 1248 local_irq_enable();
1249
1250 device_power_up(PMSG_RESUME);
1244} 1251}
1245 1252
1246static apm_event_t get_event(void) 1253static apm_event_t get_event(void)
diff --git a/arch/x86/kernel/check.c b/arch/x86/kernel/check.c
index 2ac0ab71412a..fc999e6fc46a 100644
--- a/arch/x86/kernel/check.c
+++ b/arch/x86/kernel/check.c
@@ -83,15 +83,15 @@ void __init setup_bios_corruption_check(void)
83 u64 size; 83 u64 size;
84 addr = find_e820_area_size(addr, &size, PAGE_SIZE); 84 addr = find_e820_area_size(addr, &size, PAGE_SIZE);
85 85
86 if (addr == 0) 86 if (!(addr + 1))
87 break;
88
89 if (addr >= corruption_check_size)
87 break; 90 break;
88 91
89 if ((addr + size) > corruption_check_size) 92 if ((addr + size) > corruption_check_size)
90 size = corruption_check_size - addr; 93 size = corruption_check_size - addr;
91 94
92 if (size == 0)
93 break;
94
95 e820_update_range(addr, size, E820_RAM, E820_RESERVED); 95 e820_update_range(addr, size, E820_RAM, E820_RESERVED);
96 scan_areas[num_scan_areas].addr = addr; 96 scan_areas[num_scan_areas].addr = addr;
97 scan_areas[num_scan_areas].size = size; 97 scan_areas[num_scan_areas].size = size;
diff --git a/arch/x86/kernel/cpu/Makefile b/arch/x86/kernel/cpu/Makefile
index 82db7f45e2de..4e242f9a06e4 100644
--- a/arch/x86/kernel/cpu/Makefile
+++ b/arch/x86/kernel/cpu/Makefile
@@ -14,11 +14,12 @@ obj-y += vmware.o hypervisor.o
14obj-$(CONFIG_X86_32) += bugs.o cmpxchg.o 14obj-$(CONFIG_X86_32) += bugs.o cmpxchg.o
15obj-$(CONFIG_X86_64) += bugs_64.o 15obj-$(CONFIG_X86_64) += bugs_64.o
16 16
17obj-$(CONFIG_X86_CPU_DEBUG) += cpu_debug.o
18
17obj-$(CONFIG_CPU_SUP_INTEL) += intel.o 19obj-$(CONFIG_CPU_SUP_INTEL) += intel.o
18obj-$(CONFIG_CPU_SUP_AMD) += amd.o 20obj-$(CONFIG_CPU_SUP_AMD) += amd.o
19obj-$(CONFIG_CPU_SUP_CYRIX_32) += cyrix.o 21obj-$(CONFIG_CPU_SUP_CYRIX_32) += cyrix.o
20obj-$(CONFIG_CPU_SUP_CENTAUR_32) += centaur.o 22obj-$(CONFIG_CPU_SUP_CENTAUR) += centaur.o
21obj-$(CONFIG_CPU_SUP_CENTAUR_64) += centaur_64.o
22obj-$(CONFIG_CPU_SUP_TRANSMETA_32) += transmeta.o 23obj-$(CONFIG_CPU_SUP_TRANSMETA_32) += transmeta.o
23obj-$(CONFIG_CPU_SUP_UMC_32) += umc.o 24obj-$(CONFIG_CPU_SUP_UMC_32) += umc.o
24 25
diff --git a/arch/x86/kernel/cpu/addon_cpuid_features.c b/arch/x86/kernel/cpu/addon_cpuid_features.c
index 6882a735d9c0..8220ae69849d 100644
--- a/arch/x86/kernel/cpu/addon_cpuid_features.c
+++ b/arch/x86/kernel/cpu/addon_cpuid_features.c
@@ -29,7 +29,7 @@ void __cpuinit init_scattered_cpuid_features(struct cpuinfo_x86 *c)
29 u32 regs[4]; 29 u32 regs[4];
30 const struct cpuid_bit *cb; 30 const struct cpuid_bit *cb;
31 31
32 static const struct cpuid_bit 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 { 0, 0, 0, 0 } 34 { 0, 0, 0, 0 }
35 }; 35 };
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index 25423a5b80ed..7e4a459daa64 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -5,6 +5,7 @@
5#include <asm/io.h> 5#include <asm/io.h>
6#include <asm/processor.h> 6#include <asm/processor.h>
7#include <asm/apic.h> 7#include <asm/apic.h>
8#include <asm/cpu.h>
8 9
9#ifdef CONFIG_X86_64 10#ifdef CONFIG_X86_64
10# include <asm/numa_64.h> 11# include <asm/numa_64.h>
@@ -141,6 +142,55 @@ static void __cpuinit init_amd_k6(struct cpuinfo_x86 *c)
141 } 142 }
142} 143}
143 144
145static void __cpuinit amd_k7_smp_check(struct cpuinfo_x86 *c)
146{
147#ifdef CONFIG_SMP
148 /* calling is from identify_secondary_cpu() ? */
149 if (c->cpu_index == boot_cpu_id)
150 return;
151
152 /*
153 * Certain Athlons might work (for various values of 'work') in SMP
154 * but they are not certified as MP capable.
155 */
156 /* Athlon 660/661 is valid. */
157 if ((c->x86_model == 6) && ((c->x86_mask == 0) ||
158 (c->x86_mask == 1)))
159 goto valid_k7;
160
161 /* Duron 670 is valid */
162 if ((c->x86_model == 7) && (c->x86_mask == 0))
163 goto valid_k7;
164
165 /*
166 * Athlon 662, Duron 671, and Athlon >model 7 have capability
167 * bit. It's worth noting that the A5 stepping (662) of some
168 * Athlon XP's have the MP bit set.
169 * See http://www.heise.de/newsticker/data/jow-18.10.01-000 for
170 * more.
171 */
172 if (((c->x86_model == 6) && (c->x86_mask >= 2)) ||
173 ((c->x86_model == 7) && (c->x86_mask >= 1)) ||
174 (c->x86_model > 7))
175 if (cpu_has_mp)
176 goto valid_k7;
177
178 /* If we get here, not a certified SMP capable AMD system. */
179
180 /*
181 * Don't taint if we are running SMP kernel on a single non-MP
182 * approved Athlon
183 */
184 WARN_ONCE(1, "WARNING: This combination of AMD"
185 "processors is not suitable for SMP.\n");
186 if (!test_taint(TAINT_UNSAFE_SMP))
187 add_taint(TAINT_UNSAFE_SMP);
188
189valid_k7:
190 ;
191#endif
192}
193
144static void __cpuinit init_amd_k7(struct cpuinfo_x86 *c) 194static void __cpuinit init_amd_k7(struct cpuinfo_x86 *c)
145{ 195{
146 u32 l, h; 196 u32 l, h;
@@ -175,6 +225,8 @@ static void __cpuinit init_amd_k7(struct cpuinfo_x86 *c)
175 } 225 }
176 226
177 set_cpu_cap(c, X86_FEATURE_K7); 227 set_cpu_cap(c, X86_FEATURE_K7);
228
229 amd_k7_smp_check(c);
178} 230}
179#endif 231#endif
180 232
@@ -450,7 +502,7 @@ static unsigned int __cpuinit amd_size_cache(struct cpuinfo_x86 *c, unsigned int
450} 502}
451#endif 503#endif
452 504
453static struct cpu_dev amd_cpu_dev __cpuinitdata = { 505static const struct cpu_dev __cpuinitconst amd_cpu_dev = {
454 .c_vendor = "AMD", 506 .c_vendor = "AMD",
455 .c_ident = { "AuthenticAMD" }, 507 .c_ident = { "AuthenticAMD" },
456#ifdef CONFIG_X86_32 508#ifdef CONFIG_X86_32
diff --git a/arch/x86/kernel/cpu/centaur.c b/arch/x86/kernel/cpu/centaur.c
index 89bfdd9cacc6..c95e831bb095 100644
--- a/arch/x86/kernel/cpu/centaur.c
+++ b/arch/x86/kernel/cpu/centaur.c
@@ -1,11 +1,11 @@
1#include <linux/bitops.h>
1#include <linux/kernel.h> 2#include <linux/kernel.h>
2#include <linux/init.h> 3#include <linux/init.h>
3#include <linux/bitops.h>
4 4
5#include <asm/processor.h> 5#include <asm/processor.h>
6#include <asm/msr.h>
7#include <asm/e820.h> 6#include <asm/e820.h>
8#include <asm/mtrr.h> 7#include <asm/mtrr.h>
8#include <asm/msr.h>
9 9
10#include "cpu.h" 10#include "cpu.h"
11 11
@@ -276,7 +276,7 @@ static void __cpuinit init_c3(struct cpuinfo_x86 *c)
276 */ 276 */
277 c->x86_capability[5] = cpuid_edx(0xC0000001); 277 c->x86_capability[5] = cpuid_edx(0xC0000001);
278 } 278 }
279 279#ifdef CONFIG_X86_32
280 /* Cyrix III family needs CX8 & PGE explicitly enabled. */ 280 /* Cyrix III family needs CX8 & PGE explicitly enabled. */
281 if (c->x86_model >= 6 && c->x86_model <= 9) { 281 if (c->x86_model >= 6 && c->x86_model <= 9) {
282 rdmsr(MSR_VIA_FCR, lo, hi); 282 rdmsr(MSR_VIA_FCR, lo, hi);
@@ -288,6 +288,11 @@ static void __cpuinit init_c3(struct cpuinfo_x86 *c)
288 /* Before Nehemiah, the C3's had 3dNOW! */ 288 /* Before Nehemiah, the C3's had 3dNOW! */
289 if (c->x86_model >= 6 && c->x86_model < 9) 289 if (c->x86_model >= 6 && c->x86_model < 9)
290 set_cpu_cap(c, X86_FEATURE_3DNOW); 290 set_cpu_cap(c, X86_FEATURE_3DNOW);
291#endif
292 if (c->x86 == 0x6 && c->x86_model >= 0xf) {
293 c->x86_cache_alignment = c->x86_clflush_size * 2;
294 set_cpu_cap(c, X86_FEATURE_REP_GOOD);
295 }
291 296
292 display_cacheinfo(c); 297 display_cacheinfo(c);
293} 298}
@@ -316,16 +321,25 @@ enum {
316static void __cpuinit early_init_centaur(struct cpuinfo_x86 *c) 321static void __cpuinit early_init_centaur(struct cpuinfo_x86 *c)
317{ 322{
318 switch (c->x86) { 323 switch (c->x86) {
324#ifdef CONFIG_X86_32
319 case 5: 325 case 5:
320 /* Emulate MTRRs using Centaur's MCR. */ 326 /* Emulate MTRRs using Centaur's MCR. */
321 set_cpu_cap(c, X86_FEATURE_CENTAUR_MCR); 327 set_cpu_cap(c, X86_FEATURE_CENTAUR_MCR);
322 break; 328 break;
329#endif
330 case 6:
331 if (c->x86_model >= 0xf)
332 set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC);
333 break;
323 } 334 }
335#ifdef CONFIG_X86_64
336 set_cpu_cap(c, X86_FEATURE_SYSENTER32);
337#endif
324} 338}
325 339
326static void __cpuinit init_centaur(struct cpuinfo_x86 *c) 340static void __cpuinit init_centaur(struct cpuinfo_x86 *c)
327{ 341{
328 342#ifdef CONFIG_X86_32
329 char *name; 343 char *name;
330 u32 fcr_set = 0; 344 u32 fcr_set = 0;
331 u32 fcr_clr = 0; 345 u32 fcr_clr = 0;
@@ -337,8 +351,10 @@ static void __cpuinit init_centaur(struct cpuinfo_x86 *c)
337 * 3DNow is IDd by bit 31 in extended CPUID (1*32+31) anyway 351 * 3DNow is IDd by bit 31 in extended CPUID (1*32+31) anyway
338 */ 352 */
339 clear_cpu_cap(c, 0*32+31); 353 clear_cpu_cap(c, 0*32+31);
340 354#endif
355 early_init_centaur(c);
341 switch (c->x86) { 356 switch (c->x86) {
357#ifdef CONFIG_X86_32
342 case 5: 358 case 5:
343 switch (c->x86_model) { 359 switch (c->x86_model) {
344 case 4: 360 case 4:
@@ -442,16 +458,20 @@ static void __cpuinit init_centaur(struct cpuinfo_x86 *c)
442 } 458 }
443 sprintf(c->x86_model_id, "WinChip %s", name); 459 sprintf(c->x86_model_id, "WinChip %s", name);
444 break; 460 break;
445 461#endif
446 case 6: 462 case 6:
447 init_c3(c); 463 init_c3(c);
448 break; 464 break;
449 } 465 }
466#ifdef CONFIG_X86_64
467 set_cpu_cap(c, X86_FEATURE_LFENCE_RDTSC);
468#endif
450} 469}
451 470
452static unsigned int __cpuinit 471static unsigned int __cpuinit
453centaur_size_cache(struct cpuinfo_x86 *c, unsigned int size) 472centaur_size_cache(struct cpuinfo_x86 *c, unsigned int size)
454{ 473{
474#ifdef CONFIG_X86_32
455 /* VIA C3 CPUs (670-68F) need further shifting. */ 475 /* VIA C3 CPUs (670-68F) need further shifting. */
456 if ((c->x86 == 6) && ((c->x86_model == 7) || (c->x86_model == 8))) 476 if ((c->x86 == 6) && ((c->x86_model == 7) || (c->x86_model == 8)))
457 size >>= 8; 477 size >>= 8;
@@ -464,11 +484,11 @@ centaur_size_cache(struct cpuinfo_x86 *c, unsigned int size)
464 if ((c->x86 == 6) && (c->x86_model == 9) && 484 if ((c->x86 == 6) && (c->x86_model == 9) &&
465 (c->x86_mask == 1) && (size == 65)) 485 (c->x86_mask == 1) && (size == 65))
466 size -= 1; 486 size -= 1;
467 487#endif
468 return size; 488 return size;
469} 489}
470 490
471static struct cpu_dev centaur_cpu_dev __cpuinitdata = { 491static const struct cpu_dev __cpuinitconst centaur_cpu_dev = {
472 .c_vendor = "Centaur", 492 .c_vendor = "Centaur",
473 .c_ident = { "CentaurHauls" }, 493 .c_ident = { "CentaurHauls" },
474 .c_early_init = early_init_centaur, 494 .c_early_init = early_init_centaur,
diff --git a/arch/x86/kernel/cpu/centaur_64.c b/arch/x86/kernel/cpu/centaur_64.c
deleted file mode 100644
index a1625f5a1e78..000000000000
--- a/arch/x86/kernel/cpu/centaur_64.c
+++ /dev/null
@@ -1,37 +0,0 @@
1#include <linux/init.h>
2#include <linux/smp.h>
3
4#include <asm/cpufeature.h>
5#include <asm/processor.h>
6
7#include "cpu.h"
8
9static void __cpuinit early_init_centaur(struct cpuinfo_x86 *c)
10{
11 if (c->x86 == 0x6 && c->x86_model >= 0xf)
12 set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC);
13
14 set_cpu_cap(c, X86_FEATURE_SYSENTER32);
15}
16
17static void __cpuinit init_centaur(struct cpuinfo_x86 *c)
18{
19 early_init_centaur(c);
20
21 if (c->x86 == 0x6 && c->x86_model >= 0xf) {
22 c->x86_cache_alignment = c->x86_clflush_size * 2;
23 set_cpu_cap(c, X86_FEATURE_REP_GOOD);
24 }
25 set_cpu_cap(c, X86_FEATURE_LFENCE_RDTSC);
26}
27
28static struct cpu_dev centaur_cpu_dev __cpuinitdata = {
29 .c_vendor = "Centaur",
30 .c_ident = { "CentaurHauls" },
31 .c_early_init = early_init_centaur,
32 .c_init = init_centaur,
33 .c_x86_vendor = X86_VENDOR_CENTAUR,
34};
35
36cpu_dev_register(centaur_cpu_dev);
37
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index 826d5c876278..e2962cc1e27b 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -1,52 +1,52 @@
1#include <linux/init.h>
2#include <linux/kernel.h>
3#include <linux/sched.h>
4#include <linux/string.h>
5#include <linux/bootmem.h> 1#include <linux/bootmem.h>
2#include <linux/linkage.h>
6#include <linux/bitops.h> 3#include <linux/bitops.h>
4#include <linux/kernel.h>
7#include <linux/module.h> 5#include <linux/module.h>
8#include <linux/kgdb.h> 6#include <linux/percpu.h>
9#include <linux/topology.h> 7#include <linux/string.h>
10#include <linux/delay.h> 8#include <linux/delay.h>
9#include <linux/sched.h>
10#include <linux/init.h>
11#include <linux/kgdb.h>
11#include <linux/smp.h> 12#include <linux/smp.h>
12#include <linux/percpu.h> 13#include <linux/io.h>
13#include <asm/i387.h> 14
14#include <asm/msr.h> 15#include <asm/stackprotector.h>
15#include <asm/io.h>
16#include <asm/linkage.h>
17#include <asm/mmu_context.h> 16#include <asm/mmu_context.h>
17#include <asm/hypervisor.h>
18#include <asm/processor.h>
19#include <asm/sections.h>
20#include <asm/topology.h>
21#include <asm/cpumask.h>
22#include <asm/pgtable.h>
23#include <asm/atomic.h>
24#include <asm/proto.h>
25#include <asm/setup.h>
26#include <asm/apic.h>
27#include <asm/desc.h>
28#include <asm/i387.h>
18#include <asm/mtrr.h> 29#include <asm/mtrr.h>
30#include <asm/numa.h>
31#include <asm/asm.h>
32#include <asm/cpu.h>
19#include <asm/mce.h> 33#include <asm/mce.h>
34#include <asm/msr.h>
20#include <asm/pat.h> 35#include <asm/pat.h>
21#include <asm/asm.h>
22#include <asm/numa.h>
23#include <asm/smp.h> 36#include <asm/smp.h>
24#include <asm/cpu.h>
25#include <asm/cpumask.h>
26#include <asm/apic.h>
27 37
28#ifdef CONFIG_X86_LOCAL_APIC 38#ifdef CONFIG_X86_LOCAL_APIC
29#include <asm/uv/uv.h> 39#include <asm/uv/uv.h>
30#endif 40#endif
31 41
32#include <asm/pgtable.h>
33#include <asm/processor.h>
34#include <asm/desc.h>
35#include <asm/atomic.h>
36#include <asm/proto.h>
37#include <asm/sections.h>
38#include <asm/setup.h>
39#include <asm/hypervisor.h>
40#include <asm/stackprotector.h>
41
42#include "cpu.h" 42#include "cpu.h"
43 43
44#ifdef CONFIG_X86_64 44#ifdef CONFIG_X86_64
45 45
46/* all of these masks are initialized in setup_cpu_local_masks() */ 46/* all of these masks are initialized in setup_cpu_local_masks() */
47cpumask_var_t cpu_callin_mask;
48cpumask_var_t cpu_callout_mask;
49cpumask_var_t cpu_initialized_mask; 47cpumask_var_t cpu_initialized_mask;
48cpumask_var_t cpu_callout_mask;
49cpumask_var_t cpu_callin_mask;
50 50
51/* representing cpus for which sibling maps can be computed */ 51/* representing cpus for which sibling maps can be computed */
52cpumask_var_t cpu_sibling_setup_mask; 52cpumask_var_t cpu_sibling_setup_mask;
@@ -62,15 +62,15 @@ void __init setup_cpu_local_masks(void)
62 62
63#else /* CONFIG_X86_32 */ 63#else /* CONFIG_X86_32 */
64 64
65cpumask_t cpu_callin_map; 65cpumask_t cpu_sibling_setup_map;
66cpumask_t cpu_callout_map; 66cpumask_t cpu_callout_map;
67cpumask_t cpu_initialized; 67cpumask_t cpu_initialized;
68cpumask_t cpu_sibling_setup_map; 68cpumask_t cpu_callin_map;
69 69
70#endif /* CONFIG_X86_32 */ 70#endif /* CONFIG_X86_32 */
71 71
72 72
73static struct cpu_dev *this_cpu __cpuinitdata; 73static const struct cpu_dev *this_cpu __cpuinitdata;
74 74
75DEFINE_PER_CPU_PAGE_ALIGNED(struct gdt_page, gdt_page) = { .gdt = { 75DEFINE_PER_CPU_PAGE_ALIGNED(struct gdt_page, gdt_page) = { .gdt = {
76#ifdef CONFIG_X86_64 76#ifdef CONFIG_X86_64
@@ -79,48 +79,48 @@ DEFINE_PER_CPU_PAGE_ALIGNED(struct gdt_page, gdt_page) = { .gdt = {
79 * IRET will check the segment types kkeil 2000/10/28 79 * IRET will check the segment types kkeil 2000/10/28
80 * Also sysret mandates a special GDT layout 80 * Also sysret mandates a special GDT layout
81 * 81 *
82 * The TLS descriptors are currently at a different place compared to i386. 82 * TLS descriptors are currently at a different place compared to i386.
83 * Hopefully nobody expects them at a fixed place (Wine?) 83 * Hopefully nobody expects them at a fixed place (Wine?)
84 */ 84 */
85 [GDT_ENTRY_KERNEL32_CS] = { { { 0x0000ffff, 0x00cf9b00 } } }, 85 [GDT_ENTRY_KERNEL32_CS] = { { { 0x0000ffff, 0x00cf9b00 } } },
86 [GDT_ENTRY_KERNEL_CS] = { { { 0x0000ffff, 0x00af9b00 } } }, 86 [GDT_ENTRY_KERNEL_CS] = { { { 0x0000ffff, 0x00af9b00 } } },
87 [GDT_ENTRY_KERNEL_DS] = { { { 0x0000ffff, 0x00cf9300 } } }, 87 [GDT_ENTRY_KERNEL_DS] = { { { 0x0000ffff, 0x00cf9300 } } },
88 [GDT_ENTRY_DEFAULT_USER32_CS] = { { { 0x0000ffff, 0x00cffb00 } } }, 88 [GDT_ENTRY_DEFAULT_USER32_CS] = { { { 0x0000ffff, 0x00cffb00 } } },
89 [GDT_ENTRY_DEFAULT_USER_DS] = { { { 0x0000ffff, 0x00cff300 } } }, 89 [GDT_ENTRY_DEFAULT_USER_DS] = { { { 0x0000ffff, 0x00cff300 } } },
90 [GDT_ENTRY_DEFAULT_USER_CS] = { { { 0x0000ffff, 0x00affb00 } } }, 90 [GDT_ENTRY_DEFAULT_USER_CS] = { { { 0x0000ffff, 0x00affb00 } } },
91#else 91#else
92 [GDT_ENTRY_KERNEL_CS] = { { { 0x0000ffff, 0x00cf9a00 } } }, 92 [GDT_ENTRY_KERNEL_CS] = { { { 0x0000ffff, 0x00cf9a00 } } },
93 [GDT_ENTRY_KERNEL_DS] = { { { 0x0000ffff, 0x00cf9200 } } }, 93 [GDT_ENTRY_KERNEL_DS] = { { { 0x0000ffff, 0x00cf9200 } } },
94 [GDT_ENTRY_DEFAULT_USER_CS] = { { { 0x0000ffff, 0x00cffa00 } } }, 94 [GDT_ENTRY_DEFAULT_USER_CS] = { { { 0x0000ffff, 0x00cffa00 } } },
95 [GDT_ENTRY_DEFAULT_USER_DS] = { { { 0x0000ffff, 0x00cff200 } } }, 95 [GDT_ENTRY_DEFAULT_USER_DS] = { { { 0x0000ffff, 0x00cff200 } } },
96 /* 96 /*
97 * Segments used for calling PnP BIOS have byte granularity. 97 * Segments used for calling PnP BIOS have byte granularity.
98 * They code segments and data segments have fixed 64k limits, 98 * They code segments and data segments have fixed 64k limits,
99 * the transfer segment sizes are set at run time. 99 * the transfer segment sizes are set at run time.
100 */ 100 */
101 /* 32-bit code */ 101 /* 32-bit code */
102 [GDT_ENTRY_PNPBIOS_CS32] = { { { 0x0000ffff, 0x00409a00 } } }, 102 [GDT_ENTRY_PNPBIOS_CS32] = { { { 0x0000ffff, 0x00409a00 } } },
103 /* 16-bit code */ 103 /* 16-bit code */
104 [GDT_ENTRY_PNPBIOS_CS16] = { { { 0x0000ffff, 0x00009a00 } } }, 104 [GDT_ENTRY_PNPBIOS_CS16] = { { { 0x0000ffff, 0x00009a00 } } },
105 /* 16-bit data */ 105 /* 16-bit data */
106 [GDT_ENTRY_PNPBIOS_DS] = { { { 0x0000ffff, 0x00009200 } } }, 106 [GDT_ENTRY_PNPBIOS_DS] = { { { 0x0000ffff, 0x00009200 } } },
107 /* 16-bit data */ 107 /* 16-bit data */
108 [GDT_ENTRY_PNPBIOS_TS1] = { { { 0x00000000, 0x00009200 } } }, 108 [GDT_ENTRY_PNPBIOS_TS1] = { { { 0x00000000, 0x00009200 } } },
109 /* 16-bit data */ 109 /* 16-bit data */
110 [GDT_ENTRY_PNPBIOS_TS2] = { { { 0x00000000, 0x00009200 } } }, 110 [GDT_ENTRY_PNPBIOS_TS2] = { { { 0x00000000, 0x00009200 } } },
111 /* 111 /*
112 * The APM segments have byte granularity and their bases 112 * The APM segments have byte granularity and their bases
113 * are set at run time. All have 64k limits. 113 * are set at run time. All have 64k limits.
114 */ 114 */
115 /* 32-bit code */ 115 /* 32-bit code */
116 [GDT_ENTRY_APMBIOS_BASE] = { { { 0x0000ffff, 0x00409a00 } } }, 116 [GDT_ENTRY_APMBIOS_BASE] = { { { 0x0000ffff, 0x00409a00 } } },
117 /* 16-bit code */ 117 /* 16-bit code */
118 [GDT_ENTRY_APMBIOS_BASE+1] = { { { 0x0000ffff, 0x00009a00 } } }, 118 [GDT_ENTRY_APMBIOS_BASE+1] = { { { 0x0000ffff, 0x00009a00 } } },
119 /* data */ 119 /* data */
120 [GDT_ENTRY_APMBIOS_BASE+2] = { { { 0x0000ffff, 0x00409200 } } }, 120 [GDT_ENTRY_APMBIOS_BASE+2] = { { { 0x0000ffff, 0x00409200 } } },
121 121
122 [GDT_ENTRY_ESPFIX_SS] = { { { 0x00000000, 0x00c09200 } } }, 122 [GDT_ENTRY_ESPFIX_SS] = { { { 0x00000000, 0x00c09200 } } },
123 [GDT_ENTRY_PERCPU] = { { { 0x0000ffff, 0x00cf9200 } } }, 123 [GDT_ENTRY_PERCPU] = { { { 0x0000ffff, 0x00cf9200 } } },
124 GDT_STACK_CANARY_INIT 124 GDT_STACK_CANARY_INIT
125#endif 125#endif
126} }; 126} };
@@ -164,16 +164,17 @@ static inline int flag_is_changeable_p(u32 flag)
164 * the CPUID. Add "volatile" to not allow gcc to 164 * the CPUID. Add "volatile" to not allow gcc to
165 * optimize the subsequent calls to this function. 165 * optimize the subsequent calls to this function.
166 */ 166 */
167 asm volatile ("pushfl\n\t" 167 asm volatile ("pushfl \n\t"
168 "pushfl\n\t" 168 "pushfl \n\t"
169 "popl %0\n\t" 169 "popl %0 \n\t"
170 "movl %0,%1\n\t" 170 "movl %0, %1 \n\t"
171 "xorl %2,%0\n\t" 171 "xorl %2, %0 \n\t"
172 "pushl %0\n\t" 172 "pushl %0 \n\t"
173 "popfl\n\t" 173 "popfl \n\t"
174 "pushfl\n\t" 174 "pushfl \n\t"
175 "popl %0\n\t" 175 "popl %0 \n\t"
176 "popfl\n\t" 176 "popfl \n\t"
177
177 : "=&r" (f1), "=&r" (f2) 178 : "=&r" (f1), "=&r" (f2)
178 : "ir" (flag)); 179 : "ir" (flag));
179 180
@@ -188,18 +189,22 @@ static int __cpuinit have_cpuid_p(void)
188 189
189static void __cpuinit squash_the_stupid_serial_number(struct cpuinfo_x86 *c) 190static void __cpuinit squash_the_stupid_serial_number(struct cpuinfo_x86 *c)
190{ 191{
191 if (cpu_has(c, X86_FEATURE_PN) && disable_x86_serial_nr) { 192 unsigned long lo, hi;
192 /* Disable processor serial number */ 193
193 unsigned long lo, hi; 194 if (!cpu_has(c, X86_FEATURE_PN) || !disable_x86_serial_nr)
194 rdmsr(MSR_IA32_BBL_CR_CTL, lo, hi); 195 return;
195 lo |= 0x200000; 196
196 wrmsr(MSR_IA32_BBL_CR_CTL, lo, hi); 197 /* Disable processor serial number: */
197 printk(KERN_NOTICE "CPU serial number disabled.\n"); 198
198 clear_cpu_cap(c, X86_FEATURE_PN); 199 rdmsr(MSR_IA32_BBL_CR_CTL, lo, hi);
199 200 lo |= 0x200000;
200 /* Disabling the serial number may affect the cpuid level */ 201 wrmsr(MSR_IA32_BBL_CR_CTL, lo, hi);
201 c->cpuid_level = cpuid_eax(0); 202
202 } 203 printk(KERN_NOTICE "CPU serial number disabled.\n");
204 clear_cpu_cap(c, X86_FEATURE_PN);
205
206 /* Disabling the serial number may affect the cpuid level */
207 c->cpuid_level = cpuid_eax(0);
203} 208}
204 209
205static int __init x86_serial_nr_setup(char *s) 210static int __init x86_serial_nr_setup(char *s)
@@ -232,6 +237,7 @@ struct cpuid_dependent_feature {
232 u32 feature; 237 u32 feature;
233 u32 level; 238 u32 level;
234}; 239};
240
235static const struct cpuid_dependent_feature __cpuinitconst 241static const struct cpuid_dependent_feature __cpuinitconst
236cpuid_dependent_features[] = { 242cpuid_dependent_features[] = {
237 { X86_FEATURE_MWAIT, 0x00000005 }, 243 { X86_FEATURE_MWAIT, 0x00000005 },
@@ -243,7 +249,11 @@ cpuid_dependent_features[] = {
243static void __cpuinit filter_cpuid_features(struct cpuinfo_x86 *c, bool warn) 249static void __cpuinit filter_cpuid_features(struct cpuinfo_x86 *c, bool warn)
244{ 250{
245 const struct cpuid_dependent_feature *df; 251 const struct cpuid_dependent_feature *df;
252
246 for (df = cpuid_dependent_features; df->feature; df++) { 253 for (df = cpuid_dependent_features; df->feature; df++) {
254
255 if (!cpu_has(c, df->feature))
256 continue;
247 /* 257 /*
248 * Note: cpuid_level is set to -1 if unavailable, but 258 * Note: cpuid_level is set to -1 if unavailable, but
249 * extended_extended_level is set to 0 if unavailable 259 * extended_extended_level is set to 0 if unavailable
@@ -251,32 +261,32 @@ static void __cpuinit filter_cpuid_features(struct cpuinfo_x86 *c, bool warn)
251 * when signed; hence the weird messing around with 261 * when signed; hence the weird messing around with
252 * signs here... 262 * signs here...
253 */ 263 */
254 if (cpu_has(c, df->feature) && 264 if (!((s32)df->level < 0 ?
255 ((s32)df->level < 0 ?
256 (u32)df->level > (u32)c->extended_cpuid_level : 265 (u32)df->level > (u32)c->extended_cpuid_level :
257 (s32)df->level > (s32)c->cpuid_level)) { 266 (s32)df->level > (s32)c->cpuid_level))
258 clear_cpu_cap(c, df->feature); 267 continue;
259 if (warn) 268
260 printk(KERN_WARNING 269 clear_cpu_cap(c, df->feature);
261 "CPU: CPU feature %s disabled " 270 if (!warn)
262 "due to lack of CPUID level 0x%x\n", 271 continue;
263 x86_cap_flags[df->feature], 272
264 df->level); 273 printk(KERN_WARNING
265 } 274 "CPU: CPU feature %s disabled, no CPUID level 0x%x\n",
275 x86_cap_flags[df->feature], df->level);
266 } 276 }
267} 277}
268 278
269/* 279/*
270 * Naming convention should be: <Name> [(<Codename>)] 280 * Naming convention should be: <Name> [(<Codename>)]
271 * This table only is used unless init_<vendor>() below doesn't set it; 281 * This table only is used unless init_<vendor>() below doesn't set it;
272 * in particular, if CPUID levels 0x80000002..4 are supported, this isn't used 282 * in particular, if CPUID levels 0x80000002..4 are supported, this
273 * 283 * isn't used
274 */ 284 */
275 285
276/* Look up CPU names by table lookup. */ 286/* Look up CPU names by table lookup. */
277static char __cpuinit *table_lookup_model(struct cpuinfo_x86 *c) 287static const char *__cpuinit table_lookup_model(struct cpuinfo_x86 *c)
278{ 288{
279 struct cpu_model_info *info; 289 const struct cpu_model_info *info;
280 290
281 if (c->x86_model >= 16) 291 if (c->x86_model >= 16)
282 return NULL; /* Range check */ 292 return NULL; /* Range check */
@@ -307,8 +317,10 @@ void load_percpu_segment(int cpu)
307 load_stack_canary_segment(); 317 load_stack_canary_segment();
308} 318}
309 319
310/* Current gdt points %fs at the "master" per-cpu area: after this, 320/*
311 * it's on the real one. */ 321 * Current gdt points %fs at the "master" per-cpu area: after this,
322 * it's on the real one.
323 */
312void switch_to_new_gdt(int cpu) 324void switch_to_new_gdt(int cpu)
313{ 325{
314 struct desc_ptr gdt_descr; 326 struct desc_ptr gdt_descr;
@@ -321,7 +333,7 @@ void switch_to_new_gdt(int cpu)
321 load_percpu_segment(cpu); 333 load_percpu_segment(cpu);
322} 334}
323 335
324static struct cpu_dev *cpu_devs[X86_VENDOR_NUM] = {}; 336static const struct cpu_dev *__cpuinitdata cpu_devs[X86_VENDOR_NUM] = {};
325 337
326static void __cpuinit default_init(struct cpuinfo_x86 *c) 338static void __cpuinit default_init(struct cpuinfo_x86 *c)
327{ 339{
@@ -340,7 +352,7 @@ static void __cpuinit default_init(struct cpuinfo_x86 *c)
340#endif 352#endif
341} 353}
342 354
343static struct cpu_dev __cpuinitdata default_cpu = { 355static const struct cpu_dev __cpuinitconst default_cpu = {
344 .c_init = default_init, 356 .c_init = default_init,
345 .c_vendor = "Unknown", 357 .c_vendor = "Unknown",
346 .c_x86_vendor = X86_VENDOR_UNKNOWN, 358 .c_x86_vendor = X86_VENDOR_UNKNOWN,
@@ -354,22 +366,24 @@ static void __cpuinit get_model_name(struct cpuinfo_x86 *c)
354 if (c->extended_cpuid_level < 0x80000004) 366 if (c->extended_cpuid_level < 0x80000004)
355 return; 367 return;
356 368
357 v = (unsigned int *) c->x86_model_id; 369 v = (unsigned int *)c->x86_model_id;
358 cpuid(0x80000002, &v[0], &v[1], &v[2], &v[3]); 370 cpuid(0x80000002, &v[0], &v[1], &v[2], &v[3]);
359 cpuid(0x80000003, &v[4], &v[5], &v[6], &v[7]); 371 cpuid(0x80000003, &v[4], &v[5], &v[6], &v[7]);
360 cpuid(0x80000004, &v[8], &v[9], &v[10], &v[11]); 372 cpuid(0x80000004, &v[8], &v[9], &v[10], &v[11]);
361 c->x86_model_id[48] = 0; 373 c->x86_model_id[48] = 0;
362 374
363 /* Intel chips right-justify this string for some dumb reason; 375 /*
364 undo that brain damage */ 376 * Intel chips right-justify this string for some dumb reason;
377 * undo that brain damage:
378 */
365 p = q = &c->x86_model_id[0]; 379 p = q = &c->x86_model_id[0];
366 while (*p == ' ') 380 while (*p == ' ')
367 p++; 381 p++;
368 if (p != q) { 382 if (p != q) {
369 while (*p) 383 while (*p)
370 *q++ = *p++; 384 *q++ = *p++;
371 while (q <= &c->x86_model_id[48]) 385 while (q <= &c->x86_model_id[48])
372 *q++ = '\0'; /* Zero-pad the rest */ 386 *q++ = '\0'; /* Zero-pad the rest */
373 } 387 }
374} 388}
375 389
@@ -438,27 +452,30 @@ void __cpuinit detect_ht(struct cpuinfo_x86 *c)
438 452
439 if (smp_num_siblings == 1) { 453 if (smp_num_siblings == 1) {
440 printk(KERN_INFO "CPU: Hyper-Threading is disabled\n"); 454 printk(KERN_INFO "CPU: Hyper-Threading is disabled\n");
441 } else if (smp_num_siblings > 1) { 455 goto out;
456 }
442 457
443 if (smp_num_siblings > nr_cpu_ids) { 458 if (smp_num_siblings <= 1)
444 printk(KERN_WARNING "CPU: Unsupported number of siblings %d", 459 goto out;
445 smp_num_siblings); 460
446 smp_num_siblings = 1; 461 if (smp_num_siblings > nr_cpu_ids) {
447 return; 462 pr_warning("CPU: Unsupported number of siblings %d",
448 } 463 smp_num_siblings);
464 smp_num_siblings = 1;
465 return;
466 }
449 467
450 index_msb = get_count_order(smp_num_siblings); 468 index_msb = get_count_order(smp_num_siblings);
451 c->phys_proc_id = apic->phys_pkg_id(c->initial_apicid, index_msb); 469 c->phys_proc_id = apic->phys_pkg_id(c->initial_apicid, index_msb);
452 470
453 smp_num_siblings = smp_num_siblings / c->x86_max_cores; 471 smp_num_siblings = smp_num_siblings / c->x86_max_cores;
454 472
455 index_msb = get_count_order(smp_num_siblings); 473 index_msb = get_count_order(smp_num_siblings);
456 474
457 core_bits = get_count_order(c->x86_max_cores); 475 core_bits = get_count_order(c->x86_max_cores);
458 476
459 c->cpu_core_id = apic->phys_pkg_id(c->initial_apicid, index_msb) & 477 c->cpu_core_id = apic->phys_pkg_id(c->initial_apicid, index_msb) &
460 ((1 << core_bits) - 1); 478 ((1 << core_bits) - 1);
461 }
462 479
463out: 480out:
464 if ((c->x86_max_cores * smp_num_siblings) > 1) { 481 if ((c->x86_max_cores * smp_num_siblings) > 1) {
@@ -473,8 +490,8 @@ out:
473static void __cpuinit get_cpu_vendor(struct cpuinfo_x86 *c) 490static void __cpuinit get_cpu_vendor(struct cpuinfo_x86 *c)
474{ 491{
475 char *v = c->x86_vendor_id; 492 char *v = c->x86_vendor_id;
476 int i;
477 static int printed; 493 static int printed;
494 int i;
478 495
479 for (i = 0; i < X86_VENDOR_NUM; i++) { 496 for (i = 0; i < X86_VENDOR_NUM; i++) {
480 if (!cpu_devs[i]) 497 if (!cpu_devs[i])
@@ -483,6 +500,7 @@ static void __cpuinit get_cpu_vendor(struct cpuinfo_x86 *c)
483 if (!strcmp(v, cpu_devs[i]->c_ident[0]) || 500 if (!strcmp(v, cpu_devs[i]->c_ident[0]) ||
484 (cpu_devs[i]->c_ident[1] && 501 (cpu_devs[i]->c_ident[1] &&
485 !strcmp(v, cpu_devs[i]->c_ident[1]))) { 502 !strcmp(v, cpu_devs[i]->c_ident[1]))) {
503
486 this_cpu = cpu_devs[i]; 504 this_cpu = cpu_devs[i];
487 c->x86_vendor = this_cpu->c_x86_vendor; 505 c->x86_vendor = this_cpu->c_x86_vendor;
488 return; 506 return;
@@ -491,7 +509,9 @@ static void __cpuinit get_cpu_vendor(struct cpuinfo_x86 *c)
491 509
492 if (!printed) { 510 if (!printed) {
493 printed++; 511 printed++;
494 printk(KERN_ERR "CPU: vendor_id '%s' unknown, using generic init.\n", v); 512 printk(KERN_ERR
513 "CPU: vendor_id '%s' unknown, using generic init.\n", v);
514
495 printk(KERN_ERR "CPU: Your system may be unstable.\n"); 515 printk(KERN_ERR "CPU: Your system may be unstable.\n");
496 } 516 }
497 517
@@ -511,14 +531,17 @@ void __cpuinit cpu_detect(struct cpuinfo_x86 *c)
511 /* Intel-defined flags: level 0x00000001 */ 531 /* Intel-defined flags: level 0x00000001 */
512 if (c->cpuid_level >= 0x00000001) { 532 if (c->cpuid_level >= 0x00000001) {
513 u32 junk, tfms, cap0, misc; 533 u32 junk, tfms, cap0, misc;
534
514 cpuid(0x00000001, &tfms, &misc, &junk, &cap0); 535 cpuid(0x00000001, &tfms, &misc, &junk, &cap0);
515 c->x86 = (tfms >> 8) & 0xf; 536 c->x86 = (tfms >> 8) & 0xf;
516 c->x86_model = (tfms >> 4) & 0xf; 537 c->x86_model = (tfms >> 4) & 0xf;
517 c->x86_mask = tfms & 0xf; 538 c->x86_mask = tfms & 0xf;
539
518 if (c->x86 == 0xf) 540 if (c->x86 == 0xf)
519 c->x86 += (tfms >> 20) & 0xff; 541 c->x86 += (tfms >> 20) & 0xff;
520 if (c->x86 >= 0x6) 542 if (c->x86 >= 0x6)
521 c->x86_model += ((tfms >> 16) & 0xf) << 4; 543 c->x86_model += ((tfms >> 16) & 0xf) << 4;
544
522 if (cap0 & (1<<19)) { 545 if (cap0 & (1<<19)) {
523 c->x86_clflush_size = ((misc >> 8) & 0xff) * 8; 546 c->x86_clflush_size = ((misc >> 8) & 0xff) * 8;
524 c->x86_cache_alignment = c->x86_clflush_size; 547 c->x86_cache_alignment = c->x86_clflush_size;
@@ -534,6 +557,7 @@ static void __cpuinit get_cpu_cap(struct cpuinfo_x86 *c)
534 /* Intel-defined flags: level 0x00000001 */ 557 /* Intel-defined flags: level 0x00000001 */
535 if (c->cpuid_level >= 0x00000001) { 558 if (c->cpuid_level >= 0x00000001) {
536 u32 capability, excap; 559 u32 capability, excap;
560
537 cpuid(0x00000001, &tfms, &ebx, &excap, &capability); 561 cpuid(0x00000001, &tfms, &ebx, &excap, &capability);
538 c->x86_capability[0] = capability; 562 c->x86_capability[0] = capability;
539 c->x86_capability[4] = excap; 563 c->x86_capability[4] = excap;
@@ -542,6 +566,7 @@ static void __cpuinit get_cpu_cap(struct cpuinfo_x86 *c)
542 /* AMD-defined flags: level 0x80000001 */ 566 /* AMD-defined flags: level 0x80000001 */
543 xlvl = cpuid_eax(0x80000000); 567 xlvl = cpuid_eax(0x80000000);
544 c->extended_cpuid_level = xlvl; 568 c->extended_cpuid_level = xlvl;
569
545 if ((xlvl & 0xffff0000) == 0x80000000) { 570 if ((xlvl & 0xffff0000) == 0x80000000) {
546 if (xlvl >= 0x80000001) { 571 if (xlvl >= 0x80000001) {
547 c->x86_capability[1] = cpuid_edx(0x80000001); 572 c->x86_capability[1] = cpuid_edx(0x80000001);
@@ -549,13 +574,15 @@ static void __cpuinit get_cpu_cap(struct cpuinfo_x86 *c)
549 } 574 }
550 } 575 }
551 576
552#ifdef CONFIG_X86_64
553 if (c->extended_cpuid_level >= 0x80000008) { 577 if (c->extended_cpuid_level >= 0x80000008) {
554 u32 eax = cpuid_eax(0x80000008); 578 u32 eax = cpuid_eax(0x80000008);
555 579
556 c->x86_virt_bits = (eax >> 8) & 0xff; 580 c->x86_virt_bits = (eax >> 8) & 0xff;
557 c->x86_phys_bits = eax & 0xff; 581 c->x86_phys_bits = eax & 0xff;
558 } 582 }
583#ifdef CONFIG_X86_32
584 else if (cpu_has(c, X86_FEATURE_PAE) || cpu_has(c, X86_FEATURE_PSE36))
585 c->x86_phys_bits = 36;
559#endif 586#endif
560 587
561 if (c->extended_cpuid_level >= 0x80000007) 588 if (c->extended_cpuid_level >= 0x80000007)
@@ -602,8 +629,12 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c)
602{ 629{
603#ifdef CONFIG_X86_64 630#ifdef CONFIG_X86_64
604 c->x86_clflush_size = 64; 631 c->x86_clflush_size = 64;
632 c->x86_phys_bits = 36;
633 c->x86_virt_bits = 48;
605#else 634#else
606 c->x86_clflush_size = 32; 635 c->x86_clflush_size = 32;
636 c->x86_phys_bits = 32;
637 c->x86_virt_bits = 32;
607#endif 638#endif
608 c->x86_cache_alignment = c->x86_clflush_size; 639 c->x86_cache_alignment = c->x86_clflush_size;
609 640
@@ -634,12 +665,12 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c)
634 665
635void __init early_cpu_init(void) 666void __init early_cpu_init(void)
636{ 667{
637 struct cpu_dev **cdev; 668 const struct cpu_dev *const *cdev;
638 int count = 0; 669 int count = 0;
639 670
640 printk("KERNEL supported cpus:\n"); 671 printk(KERN_INFO "KERNEL supported cpus:\n");
641 for (cdev = __x86_cpu_dev_start; cdev < __x86_cpu_dev_end; cdev++) { 672 for (cdev = __x86_cpu_dev_start; cdev < __x86_cpu_dev_end; cdev++) {
642 struct cpu_dev *cpudev = *cdev; 673 const struct cpu_dev *cpudev = *cdev;
643 unsigned int j; 674 unsigned int j;
644 675
645 if (count >= X86_VENDOR_NUM) 676 if (count >= X86_VENDOR_NUM)
@@ -650,7 +681,7 @@ void __init early_cpu_init(void)
650 for (j = 0; j < 2; j++) { 681 for (j = 0; j < 2; j++) {
651 if (!cpudev->c_ident[j]) 682 if (!cpudev->c_ident[j])
652 continue; 683 continue;
653 printk(" %s %s\n", cpudev->c_vendor, 684 printk(KERN_INFO " %s %s\n", cpudev->c_vendor,
654 cpudev->c_ident[j]); 685 cpudev->c_ident[j]);
655 } 686 }
656 } 687 }
@@ -726,9 +757,13 @@ static void __cpuinit identify_cpu(struct cpuinfo_x86 *c)
726 c->x86_coreid_bits = 0; 757 c->x86_coreid_bits = 0;
727#ifdef CONFIG_X86_64 758#ifdef CONFIG_X86_64
728 c->x86_clflush_size = 64; 759 c->x86_clflush_size = 64;
760 c->x86_phys_bits = 36;
761 c->x86_virt_bits = 48;
729#else 762#else
730 c->cpuid_level = -1; /* CPUID not detected */ 763 c->cpuid_level = -1; /* CPUID not detected */
731 c->x86_clflush_size = 32; 764 c->x86_clflush_size = 32;
765 c->x86_phys_bits = 32;
766 c->x86_virt_bits = 32;
732#endif 767#endif
733 c->x86_cache_alignment = c->x86_clflush_size; 768 c->x86_cache_alignment = c->x86_clflush_size;
734 memset(&c->x86_capability, 0, sizeof c->x86_capability); 769 memset(&c->x86_capability, 0, sizeof c->x86_capability);
@@ -759,8 +794,8 @@ static void __cpuinit identify_cpu(struct cpuinfo_x86 *c)
759 squash_the_stupid_serial_number(c); 794 squash_the_stupid_serial_number(c);
760 795
761 /* 796 /*
762 * The vendor-specific functions might have changed features. Now 797 * The vendor-specific functions might have changed features.
763 * we do "generic changes." 798 * Now we do "generic changes."
764 */ 799 */
765 800
766 /* Filter out anything that depends on CPUID levels we don't have */ 801 /* Filter out anything that depends on CPUID levels we don't have */
@@ -768,7 +803,7 @@ static void __cpuinit identify_cpu(struct cpuinfo_x86 *c)
768 803
769 /* If the model name is still unset, do table lookup. */ 804 /* If the model name is still unset, do table lookup. */
770 if (!c->x86_model_id[0]) { 805 if (!c->x86_model_id[0]) {
771 char *p; 806 const char *p;
772 p = table_lookup_model(c); 807 p = table_lookup_model(c);
773 if (p) 808 if (p)
774 strcpy(c->x86_model_id, p); 809 strcpy(c->x86_model_id, p);
@@ -843,11 +878,11 @@ void __cpuinit identify_secondary_cpu(struct cpuinfo_x86 *c)
843} 878}
844 879
845struct msr_range { 880struct msr_range {
846 unsigned min; 881 unsigned min;
847 unsigned max; 882 unsigned max;
848}; 883};
849 884
850static struct msr_range msr_range_array[] __cpuinitdata = { 885static const struct msr_range msr_range_array[] __cpuinitconst = {
851 { 0x00000000, 0x00000418}, 886 { 0x00000000, 0x00000418},
852 { 0xc0000000, 0xc000040b}, 887 { 0xc0000000, 0xc000040b},
853 { 0xc0010000, 0xc0010142}, 888 { 0xc0010000, 0xc0010142},
@@ -856,14 +891,15 @@ static struct msr_range msr_range_array[] __cpuinitdata = {
856 891
857static void __cpuinit print_cpu_msr(void) 892static void __cpuinit print_cpu_msr(void)
858{ 893{
894 unsigned index_min, index_max;
859 unsigned index; 895 unsigned index;
860 u64 val; 896 u64 val;
861 int i; 897 int i;
862 unsigned index_min, index_max;
863 898
864 for (i = 0; i < ARRAY_SIZE(msr_range_array); i++) { 899 for (i = 0; i < ARRAY_SIZE(msr_range_array); i++) {
865 index_min = msr_range_array[i].min; 900 index_min = msr_range_array[i].min;
866 index_max = msr_range_array[i].max; 901 index_max = msr_range_array[i].max;
902
867 for (index = index_min; index < index_max; index++) { 903 for (index = index_min; index < index_max; index++) {
868 if (rdmsrl_amd_safe(index, &val)) 904 if (rdmsrl_amd_safe(index, &val))
869 continue; 905 continue;
@@ -873,6 +909,7 @@ static void __cpuinit print_cpu_msr(void)
873} 909}
874 910
875static int show_msr __cpuinitdata; 911static int show_msr __cpuinitdata;
912
876static __init int setup_show_msr(char *arg) 913static __init int setup_show_msr(char *arg)
877{ 914{
878 int num; 915 int num;
@@ -894,12 +931,14 @@ __setup("noclflush", setup_noclflush);
894 931
895void __cpuinit print_cpu_info(struct cpuinfo_x86 *c) 932void __cpuinit print_cpu_info(struct cpuinfo_x86 *c)
896{ 933{
897 char *vendor = NULL; 934 const char *vendor = NULL;
898 935
899 if (c->x86_vendor < X86_VENDOR_NUM) 936 if (c->x86_vendor < X86_VENDOR_NUM) {
900 vendor = this_cpu->c_vendor; 937 vendor = this_cpu->c_vendor;
901 else if (c->cpuid_level >= 0) 938 } else {
902 vendor = c->x86_vendor_id; 939 if (c->cpuid_level >= 0)
940 vendor = c->x86_vendor_id;
941 }
903 942
904 if (vendor && !strstr(c->x86_model_id, vendor)) 943 if (vendor && !strstr(c->x86_model_id, vendor))
905 printk(KERN_CONT "%s ", vendor); 944 printk(KERN_CONT "%s ", vendor);
@@ -926,10 +965,12 @@ void __cpuinit print_cpu_info(struct cpuinfo_x86 *c)
926static __init int setup_disablecpuid(char *arg) 965static __init int setup_disablecpuid(char *arg)
927{ 966{
928 int bit; 967 int bit;
968
929 if (get_option(&arg, &bit) && bit < NCAPINTS*32) 969 if (get_option(&arg, &bit) && bit < NCAPINTS*32)
930 setup_clear_cpu_cap(bit); 970 setup_clear_cpu_cap(bit);
931 else 971 else
932 return 0; 972 return 0;
973
933 return 1; 974 return 1;
934} 975}
935__setup("clearcpuid=", setup_disablecpuid); 976__setup("clearcpuid=", setup_disablecpuid);
@@ -939,6 +980,7 @@ struct desc_ptr idt_descr = { 256 * 16 - 1, (unsigned long) idt_table };
939 980
940DEFINE_PER_CPU_FIRST(union irq_stack_union, 981DEFINE_PER_CPU_FIRST(union irq_stack_union,
941 irq_stack_union) __aligned(PAGE_SIZE); 982 irq_stack_union) __aligned(PAGE_SIZE);
983
942DEFINE_PER_CPU(char *, irq_stack_ptr) = 984DEFINE_PER_CPU(char *, irq_stack_ptr) =
943 init_per_cpu_var(irq_stack_union.irq_stack) + IRQ_STACK_SIZE - 64; 985 init_per_cpu_var(irq_stack_union.irq_stack) + IRQ_STACK_SIZE - 64;
944 986
@@ -948,12 +990,21 @@ EXPORT_PER_CPU_SYMBOL(kernel_stack);
948 990
949DEFINE_PER_CPU(unsigned int, irq_count) = -1; 991DEFINE_PER_CPU(unsigned int, irq_count) = -1;
950 992
993/*
994 * Special IST stacks which the CPU switches to when it calls
995 * an IST-marked descriptor entry. Up to 7 stacks (hardware
996 * limit), all of them are 4K, except the debug stack which
997 * is 8K.
998 */
999static const unsigned int exception_stack_sizes[N_EXCEPTION_STACKS] = {
1000 [0 ... N_EXCEPTION_STACKS - 1] = EXCEPTION_STKSZ,
1001 [DEBUG_STACK - 1] = DEBUG_STKSZ
1002};
1003
951static DEFINE_PER_CPU_PAGE_ALIGNED(char, exception_stacks 1004static DEFINE_PER_CPU_PAGE_ALIGNED(char, exception_stacks
952 [(N_EXCEPTION_STACKS - 1) * EXCEPTION_STKSZ + DEBUG_STKSZ]) 1005 [(N_EXCEPTION_STACKS - 1) * EXCEPTION_STKSZ + DEBUG_STKSZ])
953 __aligned(PAGE_SIZE); 1006 __aligned(PAGE_SIZE);
954 1007
955extern asmlinkage void ignore_sysret(void);
956
957/* May not be marked __init: used by software suspend */ 1008/* May not be marked __init: used by software suspend */
958void syscall_init(void) 1009void syscall_init(void)
959{ 1010{
@@ -983,7 +1034,7 @@ unsigned long kernel_eflags;
983 */ 1034 */
984DEFINE_PER_CPU(struct orig_ist, orig_ist); 1035DEFINE_PER_CPU(struct orig_ist, orig_ist);
985 1036
986#else /* x86_64 */ 1037#else /* CONFIG_X86_64 */
987 1038
988#ifdef CONFIG_CC_STACKPROTECTOR 1039#ifdef CONFIG_CC_STACKPROTECTOR
989DEFINE_PER_CPU(unsigned long, stack_canary); 1040DEFINE_PER_CPU(unsigned long, stack_canary);
@@ -995,9 +1046,26 @@ struct pt_regs * __cpuinit idle_regs(struct pt_regs *regs)
995 memset(regs, 0, sizeof(struct pt_regs)); 1046 memset(regs, 0, sizeof(struct pt_regs));
996 regs->fs = __KERNEL_PERCPU; 1047 regs->fs = __KERNEL_PERCPU;
997 regs->gs = __KERNEL_STACK_CANARY; 1048 regs->gs = __KERNEL_STACK_CANARY;
1049
998 return regs; 1050 return regs;
999} 1051}
1000#endif /* x86_64 */ 1052#endif /* CONFIG_X86_64 */
1053
1054/*
1055 * Clear all 6 debug registers:
1056 */
1057static void clear_all_debug_regs(void)
1058{
1059 int i;
1060
1061 for (i = 0; i < 8; i++) {
1062 /* Ignore db4, db5 */
1063 if ((i == 4) || (i == 5))
1064 continue;
1065
1066 set_debugreg(0, i);
1067 }
1068}
1001 1069
1002/* 1070/*
1003 * cpu_init() initializes state that is per-CPU. Some data is already 1071 * cpu_init() initializes state that is per-CPU. Some data is already
@@ -1007,15 +1075,20 @@ struct pt_regs * __cpuinit idle_regs(struct pt_regs *regs)
1007 * A lot of state is already set up in PDA init for 64 bit 1075 * A lot of state is already set up in PDA init for 64 bit
1008 */ 1076 */
1009#ifdef CONFIG_X86_64 1077#ifdef CONFIG_X86_64
1078
1010void __cpuinit cpu_init(void) 1079void __cpuinit cpu_init(void)
1011{ 1080{
1012 int cpu = stack_smp_processor_id(); 1081 struct orig_ist *orig_ist;
1013 struct tss_struct *t = &per_cpu(init_tss, cpu);
1014 struct orig_ist *orig_ist = &per_cpu(orig_ist, cpu);
1015 unsigned long v;
1016 struct task_struct *me; 1082 struct task_struct *me;
1083 struct tss_struct *t;
1084 unsigned long v;
1085 int cpu;
1017 int i; 1086 int i;
1018 1087
1088 cpu = stack_smp_processor_id();
1089 t = &per_cpu(init_tss, cpu);
1090 orig_ist = &per_cpu(orig_ist, cpu);
1091
1019#ifdef CONFIG_NUMA 1092#ifdef CONFIG_NUMA
1020 if (cpu != 0 && percpu_read(node_number) == 0 && 1093 if (cpu != 0 && percpu_read(node_number) == 0 &&
1021 cpu_to_node(cpu) != NUMA_NO_NODE) 1094 cpu_to_node(cpu) != NUMA_NO_NODE)
@@ -1056,19 +1129,17 @@ void __cpuinit cpu_init(void)
1056 * set up and load the per-CPU TSS 1129 * set up and load the per-CPU TSS
1057 */ 1130 */
1058 if (!orig_ist->ist[0]) { 1131 if (!orig_ist->ist[0]) {
1059 static const unsigned int sizes[N_EXCEPTION_STACKS] = {
1060 [0 ... N_EXCEPTION_STACKS - 1] = EXCEPTION_STKSZ,
1061 [DEBUG_STACK - 1] = DEBUG_STKSZ
1062 };
1063 char *estacks = per_cpu(exception_stacks, cpu); 1132 char *estacks = per_cpu(exception_stacks, cpu);
1133
1064 for (v = 0; v < N_EXCEPTION_STACKS; v++) { 1134 for (v = 0; v < N_EXCEPTION_STACKS; v++) {
1065 estacks += sizes[v]; 1135 estacks += exception_stack_sizes[v];
1066 orig_ist->ist[v] = t->x86_tss.ist[v] = 1136 orig_ist->ist[v] = t->x86_tss.ist[v] =
1067 (unsigned long)estacks; 1137 (unsigned long)estacks;
1068 } 1138 }
1069 } 1139 }
1070 1140
1071 t->x86_tss.io_bitmap_base = offsetof(struct tss_struct, io_bitmap); 1141 t->x86_tss.io_bitmap_base = offsetof(struct tss_struct, io_bitmap);
1142
1072 /* 1143 /*
1073 * <= is required because the CPU will access up to 1144 * <= is required because the CPU will access up to
1074 * 8 bits beyond the end of the IO permission bitmap. 1145 * 8 bits beyond the end of the IO permission bitmap.
@@ -1078,8 +1149,7 @@ void __cpuinit cpu_init(void)
1078 1149
1079 atomic_inc(&init_mm.mm_count); 1150 atomic_inc(&init_mm.mm_count);
1080 me->active_mm = &init_mm; 1151 me->active_mm = &init_mm;
1081 if (me->mm) 1152 BUG_ON(me->mm);
1082 BUG();
1083 enter_lazy_tlb(&init_mm, me); 1153 enter_lazy_tlb(&init_mm, me);
1084 1154
1085 load_sp0(t, &current->thread); 1155 load_sp0(t, &current->thread);
@@ -1098,17 +1168,7 @@ void __cpuinit cpu_init(void)
1098 arch_kgdb_ops.correct_hw_break(); 1168 arch_kgdb_ops.correct_hw_break();
1099 else 1169 else
1100#endif 1170#endif
1101 { 1171 clear_all_debug_regs();
1102 /*
1103 * Clear all 6 debug registers:
1104 */
1105 set_debugreg(0UL, 0);
1106 set_debugreg(0UL, 1);
1107 set_debugreg(0UL, 2);
1108 set_debugreg(0UL, 3);
1109 set_debugreg(0UL, 6);
1110 set_debugreg(0UL, 7);
1111 }
1112 1172
1113 fpu_init(); 1173 fpu_init();
1114 1174
@@ -1129,7 +1189,8 @@ void __cpuinit cpu_init(void)
1129 1189
1130 if (cpumask_test_and_set_cpu(cpu, cpu_initialized_mask)) { 1190 if (cpumask_test_and_set_cpu(cpu, cpu_initialized_mask)) {
1131 printk(KERN_WARNING "CPU#%d already initialized!\n", cpu); 1191 printk(KERN_WARNING "CPU#%d already initialized!\n", cpu);
1132 for (;;) local_irq_enable(); 1192 for (;;)
1193 local_irq_enable();
1133 } 1194 }
1134 1195
1135 printk(KERN_INFO "Initializing CPU#%d\n", cpu); 1196 printk(KERN_INFO "Initializing CPU#%d\n", cpu);
@@ -1145,8 +1206,7 @@ void __cpuinit cpu_init(void)
1145 */ 1206 */
1146 atomic_inc(&init_mm.mm_count); 1207 atomic_inc(&init_mm.mm_count);
1147 curr->active_mm = &init_mm; 1208 curr->active_mm = &init_mm;
1148 if (curr->mm) 1209 BUG_ON(curr->mm);
1149 BUG();
1150 enter_lazy_tlb(&init_mm, curr); 1210 enter_lazy_tlb(&init_mm, curr);
1151 1211
1152 load_sp0(t, thread); 1212 load_sp0(t, thread);
@@ -1159,13 +1219,7 @@ void __cpuinit cpu_init(void)
1159 __set_tss_desc(cpu, GDT_ENTRY_DOUBLEFAULT_TSS, &doublefault_tss); 1219 __set_tss_desc(cpu, GDT_ENTRY_DOUBLEFAULT_TSS, &doublefault_tss);
1160#endif 1220#endif
1161 1221
1162 /* Clear all 6 debug registers: */ 1222 clear_all_debug_regs();
1163 set_debugreg(0, 0);
1164 set_debugreg(0, 1);
1165 set_debugreg(0, 2);
1166 set_debugreg(0, 3);
1167 set_debugreg(0, 6);
1168 set_debugreg(0, 7);
1169 1223
1170 /* 1224 /*
1171 * Force FPU initialization: 1225 * Force FPU initialization:
@@ -1185,6 +1239,4 @@ void __cpuinit cpu_init(void)
1185 1239
1186 xsave_init(); 1240 xsave_init();
1187} 1241}
1188
1189
1190#endif 1242#endif
diff --git a/arch/x86/kernel/cpu/cpu.h b/arch/x86/kernel/cpu/cpu.h
index de4094a39210..6de9a908e400 100644
--- a/arch/x86/kernel/cpu/cpu.h
+++ b/arch/x86/kernel/cpu/cpu.h
@@ -3,33 +3,34 @@
3#define ARCH_X86_CPU_H 3#define ARCH_X86_CPU_H
4 4
5struct cpu_model_info { 5struct cpu_model_info {
6 int vendor; 6 int vendor;
7 int family; 7 int family;
8 char *model_names[16]; 8 const char *model_names[16];
9}; 9};
10 10
11/* attempt to consolidate cpu attributes */ 11/* attempt to consolidate cpu attributes */
12struct cpu_dev { 12struct cpu_dev {
13 char * c_vendor; 13 const char *c_vendor;
14 14
15 /* some have two possibilities for cpuid string */ 15 /* some have two possibilities for cpuid string */
16 char * c_ident[2]; 16 const char *c_ident[2];
17 17
18 struct cpu_model_info c_models[4]; 18 struct cpu_model_info c_models[4];
19 19
20 void (*c_early_init)(struct cpuinfo_x86 *c); 20 void (*c_early_init)(struct cpuinfo_x86 *);
21 void (*c_init)(struct cpuinfo_x86 * c); 21 void (*c_init)(struct cpuinfo_x86 *);
22 void (*c_identify)(struct cpuinfo_x86 * c); 22 void (*c_identify)(struct cpuinfo_x86 *);
23 unsigned int (*c_size_cache)(struct cpuinfo_x86 * c, unsigned int size); 23 unsigned int (*c_size_cache)(struct cpuinfo_x86 *, unsigned int);
24 int c_x86_vendor; 24 int c_x86_vendor;
25}; 25};
26 26
27#define cpu_dev_register(cpu_devX) \ 27#define cpu_dev_register(cpu_devX) \
28 static struct cpu_dev *__cpu_dev_##cpu_devX __used \ 28 static const struct cpu_dev *const __cpu_dev_##cpu_devX __used \
29 __attribute__((__section__(".x86_cpu_dev.init"))) = \ 29 __attribute__((__section__(".x86_cpu_dev.init"))) = \
30 &cpu_devX; 30 &cpu_devX;
31 31
32extern struct cpu_dev *__x86_cpu_dev_start[], *__x86_cpu_dev_end[]; 32extern const struct cpu_dev *const __x86_cpu_dev_start[],
33 *const __x86_cpu_dev_end[];
33 34
34extern void display_cacheinfo(struct cpuinfo_x86 *c); 35extern void display_cacheinfo(struct cpuinfo_x86 *c);
35 36
diff --git a/arch/x86/kernel/cpu/cpu_debug.c b/arch/x86/kernel/cpu/cpu_debug.c
new file mode 100755
index 000000000000..46e29ab96c6a
--- /dev/null
+++ b/arch/x86/kernel/cpu/cpu_debug.c
@@ -0,0 +1,901 @@
1/*
2 * CPU x86 architecture debug code
3 *
4 * Copyright(C) 2009 Jaswinder Singh Rajput
5 *
6 * For licencing details see kernel-base/COPYING
7 */
8
9#include <linux/interrupt.h>
10#include <linux/compiler.h>
11#include <linux/seq_file.h>
12#include <linux/debugfs.h>
13#include <linux/kprobes.h>
14#include <linux/uaccess.h>
15#include <linux/kernel.h>
16#include <linux/module.h>
17#include <linux/percpu.h>
18#include <linux/signal.h>
19#include <linux/errno.h>
20#include <linux/sched.h>
21#include <linux/types.h>
22#include <linux/init.h>
23#include <linux/slab.h>
24#include <linux/smp.h>
25
26#include <asm/cpu_debug.h>
27#include <asm/paravirt.h>
28#include <asm/system.h>
29#include <asm/traps.h>
30#include <asm/apic.h>
31#include <asm/desc.h>
32
33static DEFINE_PER_CPU(struct cpu_cpuX_base, cpu_arr[CPU_REG_ALL_BIT]);
34static DEFINE_PER_CPU(struct cpu_private *, priv_arr[MAX_CPU_FILES]);
35static DEFINE_PER_CPU(unsigned, cpu_modelflag);
36static DEFINE_PER_CPU(int, cpu_priv_count);
37static DEFINE_PER_CPU(unsigned, cpu_model);
38
39static DEFINE_MUTEX(cpu_debug_lock);
40
41static struct dentry *cpu_debugfs_dir;
42
43static struct cpu_debug_base cpu_base[] = {
44 { "mc", CPU_MC, 0 },
45 { "monitor", CPU_MONITOR, 0 },
46 { "time", CPU_TIME, 0 },
47 { "pmc", CPU_PMC, 1 },
48 { "platform", CPU_PLATFORM, 0 },
49 { "apic", CPU_APIC, 0 },
50 { "poweron", CPU_POWERON, 0 },
51 { "control", CPU_CONTROL, 0 },
52 { "features", CPU_FEATURES, 0 },
53 { "lastbranch", CPU_LBRANCH, 0 },
54 { "bios", CPU_BIOS, 0 },
55 { "freq", CPU_FREQ, 0 },
56 { "mtrr", CPU_MTRR, 0 },
57 { "perf", CPU_PERF, 0 },
58 { "cache", CPU_CACHE, 0 },
59 { "sysenter", CPU_SYSENTER, 0 },
60 { "therm", CPU_THERM, 0 },
61 { "misc", CPU_MISC, 0 },
62 { "debug", CPU_DEBUG, 0 },
63 { "pat", CPU_PAT, 0 },
64 { "vmx", CPU_VMX, 0 },
65 { "call", CPU_CALL, 0 },
66 { "base", CPU_BASE, 0 },
67 { "ver", CPU_VER, 0 },
68 { "conf", CPU_CONF, 0 },
69 { "smm", CPU_SMM, 0 },
70 { "svm", CPU_SVM, 0 },
71 { "osvm", CPU_OSVM, 0 },
72 { "tss", CPU_TSS, 0 },
73 { "cr", CPU_CR, 0 },
74 { "dt", CPU_DT, 0 },
75 { "registers", CPU_REG_ALL, 0 },
76};
77
78static struct cpu_file_base cpu_file[] = {
79 { "index", CPU_REG_ALL, 0 },
80 { "value", CPU_REG_ALL, 1 },
81};
82
83/* Intel Registers Range */
84static struct cpu_debug_range cpu_intel_range[] = {
85 { 0x00000000, 0x00000001, CPU_MC, CPU_INTEL_ALL },
86 { 0x00000006, 0x00000007, CPU_MONITOR, CPU_CX_AT_XE },
87 { 0x00000010, 0x00000010, CPU_TIME, CPU_INTEL_ALL },
88 { 0x00000011, 0x00000013, CPU_PMC, CPU_INTEL_PENTIUM },
89 { 0x00000017, 0x00000017, CPU_PLATFORM, CPU_PX_CX_AT_XE },
90 { 0x0000001B, 0x0000001B, CPU_APIC, CPU_P6_CX_AT_XE },
91
92 { 0x0000002A, 0x0000002A, CPU_POWERON, CPU_PX_CX_AT_XE },
93 { 0x0000002B, 0x0000002B, CPU_POWERON, CPU_INTEL_XEON },
94 { 0x0000002C, 0x0000002C, CPU_FREQ, CPU_INTEL_XEON },
95 { 0x0000003A, 0x0000003A, CPU_CONTROL, CPU_CX_AT_XE },
96
97 { 0x00000040, 0x00000043, CPU_LBRANCH, CPU_PM_CX_AT_XE },
98 { 0x00000044, 0x00000047, CPU_LBRANCH, CPU_PM_CO_AT },
99 { 0x00000060, 0x00000063, CPU_LBRANCH, CPU_C2_AT },
100 { 0x00000064, 0x00000067, CPU_LBRANCH, CPU_INTEL_ATOM },
101
102 { 0x00000079, 0x00000079, CPU_BIOS, CPU_P6_CX_AT_XE },
103 { 0x00000088, 0x0000008A, CPU_CACHE, CPU_INTEL_P6 },
104 { 0x0000008B, 0x0000008B, CPU_BIOS, CPU_P6_CX_AT_XE },
105 { 0x0000009B, 0x0000009B, CPU_MONITOR, CPU_INTEL_XEON },
106
107 { 0x000000C1, 0x000000C2, CPU_PMC, CPU_P6_CX_AT },
108 { 0x000000CD, 0x000000CD, CPU_FREQ, CPU_CX_AT },
109 { 0x000000E7, 0x000000E8, CPU_PERF, CPU_CX_AT },
110 { 0x000000FE, 0x000000FE, CPU_MTRR, CPU_P6_CX_XE },
111
112 { 0x00000116, 0x00000116, CPU_CACHE, CPU_INTEL_P6 },
113 { 0x00000118, 0x00000118, CPU_CACHE, CPU_INTEL_P6 },
114 { 0x00000119, 0x00000119, CPU_CACHE, CPU_INTEL_PX },
115 { 0x0000011A, 0x0000011B, CPU_CACHE, CPU_INTEL_P6 },
116 { 0x0000011E, 0x0000011E, CPU_CACHE, CPU_PX_CX_AT },
117
118 { 0x00000174, 0x00000176, CPU_SYSENTER, CPU_P6_CX_AT_XE },
119 { 0x00000179, 0x0000017A, CPU_MC, CPU_PX_CX_AT_XE },
120 { 0x0000017B, 0x0000017B, CPU_MC, CPU_P6_XE },
121 { 0x00000186, 0x00000187, CPU_PMC, CPU_P6_CX_AT },
122 { 0x00000198, 0x00000199, CPU_PERF, CPU_PM_CX_AT_XE },
123 { 0x0000019A, 0x0000019A, CPU_TIME, CPU_PM_CX_AT_XE },
124 { 0x0000019B, 0x0000019D, CPU_THERM, CPU_PM_CX_AT_XE },
125 { 0x000001A0, 0x000001A0, CPU_MISC, CPU_PM_CX_AT_XE },
126
127 { 0x000001C9, 0x000001C9, CPU_LBRANCH, CPU_PM_CX_AT },
128 { 0x000001D7, 0x000001D8, CPU_LBRANCH, CPU_INTEL_XEON },
129 { 0x000001D9, 0x000001D9, CPU_DEBUG, CPU_CX_AT_XE },
130 { 0x000001DA, 0x000001DA, CPU_LBRANCH, CPU_INTEL_XEON },
131 { 0x000001DB, 0x000001DB, CPU_LBRANCH, CPU_P6_XE },
132 { 0x000001DC, 0x000001DC, CPU_LBRANCH, CPU_INTEL_P6 },
133 { 0x000001DD, 0x000001DE, CPU_LBRANCH, CPU_PX_CX_AT_XE },
134 { 0x000001E0, 0x000001E0, CPU_LBRANCH, CPU_INTEL_P6 },
135
136 { 0x00000200, 0x0000020F, CPU_MTRR, CPU_P6_CX_XE },
137 { 0x00000250, 0x00000250, CPU_MTRR, CPU_P6_CX_XE },
138 { 0x00000258, 0x00000259, CPU_MTRR, CPU_P6_CX_XE },
139 { 0x00000268, 0x0000026F, CPU_MTRR, CPU_P6_CX_XE },
140 { 0x00000277, 0x00000277, CPU_PAT, CPU_C2_AT_XE },
141 { 0x000002FF, 0x000002FF, CPU_MTRR, CPU_P6_CX_XE },
142
143 { 0x00000300, 0x00000308, CPU_PMC, CPU_INTEL_XEON },
144 { 0x00000309, 0x0000030B, CPU_PMC, CPU_C2_AT_XE },
145 { 0x0000030C, 0x00000311, CPU_PMC, CPU_INTEL_XEON },
146 { 0x00000345, 0x00000345, CPU_PMC, CPU_C2_AT },
147 { 0x00000360, 0x00000371, CPU_PMC, CPU_INTEL_XEON },
148 { 0x0000038D, 0x00000390, CPU_PMC, CPU_C2_AT },
149 { 0x000003A0, 0x000003BE, CPU_PMC, CPU_INTEL_XEON },
150 { 0x000003C0, 0x000003CD, CPU_PMC, CPU_INTEL_XEON },
151 { 0x000003E0, 0x000003E1, CPU_PMC, CPU_INTEL_XEON },
152 { 0x000003F0, 0x000003F0, CPU_PMC, CPU_INTEL_XEON },
153 { 0x000003F1, 0x000003F1, CPU_PMC, CPU_C2_AT_XE },
154 { 0x000003F2, 0x000003F2, CPU_PMC, CPU_INTEL_XEON },
155
156 { 0x00000400, 0x00000402, CPU_MC, CPU_PM_CX_AT_XE },
157 { 0x00000403, 0x00000403, CPU_MC, CPU_INTEL_XEON },
158 { 0x00000404, 0x00000406, CPU_MC, CPU_PM_CX_AT_XE },
159 { 0x00000407, 0x00000407, CPU_MC, CPU_INTEL_XEON },
160 { 0x00000408, 0x0000040A, CPU_MC, CPU_PM_CX_AT_XE },
161 { 0x0000040B, 0x0000040B, CPU_MC, CPU_INTEL_XEON },
162 { 0x0000040C, 0x0000040E, CPU_MC, CPU_PM_CX_XE },
163 { 0x0000040F, 0x0000040F, CPU_MC, CPU_INTEL_XEON },
164 { 0x00000410, 0x00000412, CPU_MC, CPU_PM_CX_AT_XE },
165 { 0x00000413, 0x00000417, CPU_MC, CPU_CX_AT_XE },
166 { 0x00000480, 0x0000048B, CPU_VMX, CPU_CX_AT_XE },
167
168 { 0x00000600, 0x00000600, CPU_DEBUG, CPU_PM_CX_AT_XE },
169 { 0x00000680, 0x0000068F, CPU_LBRANCH, CPU_INTEL_XEON },
170 { 0x000006C0, 0x000006CF, CPU_LBRANCH, CPU_INTEL_XEON },
171
172 { 0x000107CC, 0x000107D3, CPU_PMC, CPU_INTEL_XEON_MP },
173
174 { 0xC0000080, 0xC0000080, CPU_FEATURES, CPU_INTEL_XEON },
175 { 0xC0000081, 0xC0000082, CPU_CALL, CPU_INTEL_XEON },
176 { 0xC0000084, 0xC0000084, CPU_CALL, CPU_INTEL_XEON },
177 { 0xC0000100, 0xC0000102, CPU_BASE, CPU_INTEL_XEON },
178};
179
180/* AMD Registers Range */
181static struct cpu_debug_range cpu_amd_range[] = {
182 { 0x00000000, 0x00000001, CPU_MC, CPU_K10_PLUS, },
183 { 0x00000010, 0x00000010, CPU_TIME, CPU_K8_PLUS, },
184 { 0x0000001B, 0x0000001B, CPU_APIC, CPU_K8_PLUS, },
185 { 0x0000002A, 0x0000002A, CPU_POWERON, CPU_K7_PLUS },
186 { 0x0000008B, 0x0000008B, CPU_VER, CPU_K8_PLUS },
187 { 0x000000FE, 0x000000FE, CPU_MTRR, CPU_K8_PLUS, },
188
189 { 0x00000174, 0x00000176, CPU_SYSENTER, CPU_K8_PLUS, },
190 { 0x00000179, 0x0000017B, CPU_MC, CPU_K8_PLUS, },
191 { 0x000001D9, 0x000001D9, CPU_DEBUG, CPU_K8_PLUS, },
192 { 0x000001DB, 0x000001DE, CPU_LBRANCH, CPU_K8_PLUS, },
193
194 { 0x00000200, 0x0000020F, CPU_MTRR, CPU_K8_PLUS, },
195 { 0x00000250, 0x00000250, CPU_MTRR, CPU_K8_PLUS, },
196 { 0x00000258, 0x00000259, CPU_MTRR, CPU_K8_PLUS, },
197 { 0x00000268, 0x0000026F, CPU_MTRR, CPU_K8_PLUS, },
198 { 0x00000277, 0x00000277, CPU_PAT, CPU_K8_PLUS, },
199 { 0x000002FF, 0x000002FF, CPU_MTRR, CPU_K8_PLUS, },
200
201 { 0x00000400, 0x00000413, CPU_MC, CPU_K8_PLUS, },
202
203 { 0xC0000080, 0xC0000080, CPU_FEATURES, CPU_AMD_ALL, },
204 { 0xC0000081, 0xC0000084, CPU_CALL, CPU_K8_PLUS, },
205 { 0xC0000100, 0xC0000102, CPU_BASE, CPU_K8_PLUS, },
206 { 0xC0000103, 0xC0000103, CPU_TIME, CPU_K10_PLUS, },
207
208 { 0xC0010000, 0xC0010007, CPU_PMC, CPU_K8_PLUS, },
209 { 0xC0010010, 0xC0010010, CPU_CONF, CPU_K7_PLUS, },
210 { 0xC0010015, 0xC0010015, CPU_CONF, CPU_K7_PLUS, },
211 { 0xC0010016, 0xC001001A, CPU_MTRR, CPU_K8_PLUS, },
212 { 0xC001001D, 0xC001001D, CPU_MTRR, CPU_K8_PLUS, },
213 { 0xC001001F, 0xC001001F, CPU_CONF, CPU_K8_PLUS, },
214 { 0xC0010030, 0xC0010035, CPU_BIOS, CPU_K8_PLUS, },
215 { 0xC0010044, 0xC0010048, CPU_MC, CPU_K8_PLUS, },
216 { 0xC0010050, 0xC0010056, CPU_SMM, CPU_K0F_PLUS, },
217 { 0xC0010058, 0xC0010058, CPU_CONF, CPU_K10_PLUS, },
218 { 0xC0010060, 0xC0010060, CPU_CACHE, CPU_AMD_11, },
219 { 0xC0010061, 0xC0010068, CPU_SMM, CPU_K10_PLUS, },
220 { 0xC0010069, 0xC001006B, CPU_SMM, CPU_AMD_11, },
221 { 0xC0010070, 0xC0010071, CPU_SMM, CPU_K10_PLUS, },
222 { 0xC0010111, 0xC0010113, CPU_SMM, CPU_K8_PLUS, },
223 { 0xC0010114, 0xC0010118, CPU_SVM, CPU_K10_PLUS, },
224 { 0xC0010140, 0xC0010141, CPU_OSVM, CPU_K10_PLUS, },
225 { 0xC0011022, 0xC0011023, CPU_CONF, CPU_K10_PLUS, },
226};
227
228
229/* Intel */
230static int get_intel_modelflag(unsigned model)
231{
232 int flag;
233
234 switch (model) {
235 case 0x0501:
236 case 0x0502:
237 case 0x0504:
238 flag = CPU_INTEL_PENTIUM;
239 break;
240 case 0x0601:
241 case 0x0603:
242 case 0x0605:
243 case 0x0607:
244 case 0x0608:
245 case 0x060A:
246 case 0x060B:
247 flag = CPU_INTEL_P6;
248 break;
249 case 0x0609:
250 case 0x060D:
251 flag = CPU_INTEL_PENTIUM_M;
252 break;
253 case 0x060E:
254 flag = CPU_INTEL_CORE;
255 break;
256 case 0x060F:
257 case 0x0617:
258 flag = CPU_INTEL_CORE2;
259 break;
260 case 0x061C:
261 flag = CPU_INTEL_ATOM;
262 break;
263 case 0x0F00:
264 case 0x0F01:
265 case 0x0F02:
266 case 0x0F03:
267 case 0x0F04:
268 flag = CPU_INTEL_XEON_P4;
269 break;
270 case 0x0F06:
271 flag = CPU_INTEL_XEON_MP;
272 break;
273 default:
274 flag = CPU_NONE;
275 break;
276 }
277
278 return flag;
279}
280
281/* AMD */
282static int get_amd_modelflag(unsigned model)
283{
284 int flag;
285
286 switch (model >> 8) {
287 case 0x6:
288 flag = CPU_AMD_K6;
289 break;
290 case 0x7:
291 flag = CPU_AMD_K7;
292 break;
293 case 0x8:
294 flag = CPU_AMD_K8;
295 break;
296 case 0xf:
297 flag = CPU_AMD_0F;
298 break;
299 case 0x10:
300 flag = CPU_AMD_10;
301 break;
302 case 0x11:
303 flag = CPU_AMD_11;
304 break;
305 default:
306 flag = CPU_NONE;
307 break;
308 }
309
310 return flag;
311}
312
313static int get_cpu_modelflag(unsigned cpu)
314{
315 int flag;
316
317 flag = per_cpu(cpu_model, cpu);
318
319 switch (flag >> 16) {
320 case X86_VENDOR_INTEL:
321 flag = get_intel_modelflag(flag);
322 break;
323 case X86_VENDOR_AMD:
324 flag = get_amd_modelflag(flag & 0xffff);
325 break;
326 default:
327 flag = CPU_NONE;
328 break;
329 }
330
331 return flag;
332}
333
334static int get_cpu_range_count(unsigned cpu)
335{
336 int index;
337
338 switch (per_cpu(cpu_model, cpu) >> 16) {
339 case X86_VENDOR_INTEL:
340 index = ARRAY_SIZE(cpu_intel_range);
341 break;
342 case X86_VENDOR_AMD:
343 index = ARRAY_SIZE(cpu_amd_range);
344 break;
345 default:
346 index = 0;
347 break;
348 }
349
350 return index;
351}
352
353static int is_typeflag_valid(unsigned cpu, unsigned flag)
354{
355 unsigned vendor, modelflag;
356 int i, index;
357
358 /* Standard Registers should be always valid */
359 if (flag >= CPU_TSS)
360 return 1;
361
362 modelflag = per_cpu(cpu_modelflag, cpu);
363 vendor = per_cpu(cpu_model, cpu) >> 16;
364 index = get_cpu_range_count(cpu);
365
366 for (i = 0; i < index; i++) {
367 switch (vendor) {
368 case X86_VENDOR_INTEL:
369 if ((cpu_intel_range[i].model & modelflag) &&
370 (cpu_intel_range[i].flag & flag))
371 return 1;
372 break;
373 case X86_VENDOR_AMD:
374 if ((cpu_amd_range[i].model & modelflag) &&
375 (cpu_amd_range[i].flag & flag))
376 return 1;
377 break;
378 }
379 }
380
381 /* Invalid */
382 return 0;
383}
384
385static unsigned get_cpu_range(unsigned cpu, unsigned *min, unsigned *max,
386 int index, unsigned flag)
387{
388 unsigned modelflag;
389
390 modelflag = per_cpu(cpu_modelflag, cpu);
391 *max = 0;
392 switch (per_cpu(cpu_model, cpu) >> 16) {
393 case X86_VENDOR_INTEL:
394 if ((cpu_intel_range[index].model & modelflag) &&
395 (cpu_intel_range[index].flag & flag)) {
396 *min = cpu_intel_range[index].min;
397 *max = cpu_intel_range[index].max;
398 }
399 break;
400 case X86_VENDOR_AMD:
401 if ((cpu_amd_range[index].model & modelflag) &&
402 (cpu_amd_range[index].flag & flag)) {
403 *min = cpu_amd_range[index].min;
404 *max = cpu_amd_range[index].max;
405 }
406 break;
407 }
408
409 return *max;
410}
411
412/* This function can also be called with seq = NULL for printk */
413static void print_cpu_data(struct seq_file *seq, unsigned type,
414 u32 low, u32 high)
415{
416 struct cpu_private *priv;
417 u64 val = high;
418
419 if (seq) {
420 priv = seq->private;
421 if (priv->file) {
422 val = (val << 32) | low;
423 seq_printf(seq, "0x%llx\n", val);
424 } else
425 seq_printf(seq, " %08x: %08x_%08x\n",
426 type, high, low);
427 } else
428 printk(KERN_INFO " %08x: %08x_%08x\n", type, high, low);
429}
430
431/* This function can also be called with seq = NULL for printk */
432static void print_msr(struct seq_file *seq, unsigned cpu, unsigned flag)
433{
434 unsigned msr, msr_min, msr_max;
435 struct cpu_private *priv;
436 u32 low, high;
437 int i, range;
438
439 if (seq) {
440 priv = seq->private;
441 if (priv->file) {
442 if (!rdmsr_safe_on_cpu(priv->cpu, priv->reg,
443 &low, &high))
444 print_cpu_data(seq, priv->reg, low, high);
445 return;
446 }
447 }
448
449 range = get_cpu_range_count(cpu);
450
451 for (i = 0; i < range; i++) {
452 if (!get_cpu_range(cpu, &msr_min, &msr_max, i, flag))
453 continue;
454
455 for (msr = msr_min; msr <= msr_max; msr++) {
456 if (rdmsr_safe_on_cpu(cpu, msr, &low, &high))
457 continue;
458 print_cpu_data(seq, msr, low, high);
459 }
460 }
461}
462
463static void print_tss(void *arg)
464{
465 struct pt_regs *regs = task_pt_regs(current);
466 struct seq_file *seq = arg;
467 unsigned int seg;
468
469 seq_printf(seq, " RAX\t: %016lx\n", regs->ax);
470 seq_printf(seq, " RBX\t: %016lx\n", regs->bx);
471 seq_printf(seq, " RCX\t: %016lx\n", regs->cx);
472 seq_printf(seq, " RDX\t: %016lx\n", regs->dx);
473
474 seq_printf(seq, " RSI\t: %016lx\n", regs->si);
475 seq_printf(seq, " RDI\t: %016lx\n", regs->di);
476 seq_printf(seq, " RBP\t: %016lx\n", regs->bp);
477 seq_printf(seq, " ESP\t: %016lx\n", regs->sp);
478
479#ifdef CONFIG_X86_64
480 seq_printf(seq, " R08\t: %016lx\n", regs->r8);
481 seq_printf(seq, " R09\t: %016lx\n", regs->r9);
482 seq_printf(seq, " R10\t: %016lx\n", regs->r10);
483 seq_printf(seq, " R11\t: %016lx\n", regs->r11);
484 seq_printf(seq, " R12\t: %016lx\n", regs->r12);
485 seq_printf(seq, " R13\t: %016lx\n", regs->r13);
486 seq_printf(seq, " R14\t: %016lx\n", regs->r14);
487 seq_printf(seq, " R15\t: %016lx\n", regs->r15);
488#endif
489
490 asm("movl %%cs,%0" : "=r" (seg));
491 seq_printf(seq, " CS\t: %04x\n", seg);
492 asm("movl %%ds,%0" : "=r" (seg));
493 seq_printf(seq, " DS\t: %04x\n", seg);
494 seq_printf(seq, " SS\t: %04lx\n", regs->ss & 0xffff);
495 asm("movl %%es,%0" : "=r" (seg));
496 seq_printf(seq, " ES\t: %04x\n", seg);
497 asm("movl %%fs,%0" : "=r" (seg));
498 seq_printf(seq, " FS\t: %04x\n", seg);
499 asm("movl %%gs,%0" : "=r" (seg));
500 seq_printf(seq, " GS\t: %04x\n", seg);
501
502 seq_printf(seq, " EFLAGS\t: %016lx\n", regs->flags);
503
504 seq_printf(seq, " EIP\t: %016lx\n", regs->ip);
505}
506
507static void print_cr(void *arg)
508{
509 struct seq_file *seq = arg;
510
511 seq_printf(seq, " cr0\t: %016lx\n", read_cr0());
512 seq_printf(seq, " cr2\t: %016lx\n", read_cr2());
513 seq_printf(seq, " cr3\t: %016lx\n", read_cr3());
514 seq_printf(seq, " cr4\t: %016lx\n", read_cr4_safe());
515#ifdef CONFIG_X86_64
516 seq_printf(seq, " cr8\t: %016lx\n", read_cr8());
517#endif
518}
519
520static void print_desc_ptr(char *str, struct seq_file *seq, struct desc_ptr dt)
521{
522 seq_printf(seq, " %s\t: %016llx\n", str, (u64)(dt.address | dt.size));
523}
524
525static void print_dt(void *seq)
526{
527 struct desc_ptr dt;
528 unsigned long ldt;
529
530 /* IDT */
531 store_idt((struct desc_ptr *)&dt);
532 print_desc_ptr("IDT", seq, dt);
533
534 /* GDT */
535 store_gdt((struct desc_ptr *)&dt);
536 print_desc_ptr("GDT", seq, dt);
537
538 /* LDT */
539 store_ldt(ldt);
540 seq_printf(seq, " LDT\t: %016lx\n", ldt);
541
542 /* TR */
543 store_tr(ldt);
544 seq_printf(seq, " TR\t: %016lx\n", ldt);
545}
546
547static void print_dr(void *arg)
548{
549 struct seq_file *seq = arg;
550 unsigned long dr;
551 int i;
552
553 for (i = 0; i < 8; i++) {
554 /* Ignore db4, db5 */
555 if ((i == 4) || (i == 5))
556 continue;
557 get_debugreg(dr, i);
558 seq_printf(seq, " dr%d\t: %016lx\n", i, dr);
559 }
560
561 seq_printf(seq, "\n MSR\t:\n");
562}
563
564static void print_apic(void *arg)
565{
566 struct seq_file *seq = arg;
567
568#ifdef CONFIG_X86_LOCAL_APIC
569 seq_printf(seq, " LAPIC\t:\n");
570 seq_printf(seq, " ID\t\t: %08x\n", apic_read(APIC_ID) >> 24);
571 seq_printf(seq, " LVR\t\t: %08x\n", apic_read(APIC_LVR));
572 seq_printf(seq, " TASKPRI\t: %08x\n", apic_read(APIC_TASKPRI));
573 seq_printf(seq, " ARBPRI\t\t: %08x\n", apic_read(APIC_ARBPRI));
574 seq_printf(seq, " PROCPRI\t: %08x\n", apic_read(APIC_PROCPRI));
575 seq_printf(seq, " LDR\t\t: %08x\n", apic_read(APIC_LDR));
576 seq_printf(seq, " DFR\t\t: %08x\n", apic_read(APIC_DFR));
577 seq_printf(seq, " SPIV\t\t: %08x\n", apic_read(APIC_SPIV));
578 seq_printf(seq, " ISR\t\t: %08x\n", apic_read(APIC_ISR));
579 seq_printf(seq, " ESR\t\t: %08x\n", apic_read(APIC_ESR));
580 seq_printf(seq, " ICR\t\t: %08x\n", apic_read(APIC_ICR));
581 seq_printf(seq, " ICR2\t\t: %08x\n", apic_read(APIC_ICR2));
582 seq_printf(seq, " LVTT\t\t: %08x\n", apic_read(APIC_LVTT));
583 seq_printf(seq, " LVTTHMR\t: %08x\n", apic_read(APIC_LVTTHMR));
584 seq_printf(seq, " LVTPC\t\t: %08x\n", apic_read(APIC_LVTPC));
585 seq_printf(seq, " LVT0\t\t: %08x\n", apic_read(APIC_LVT0));
586 seq_printf(seq, " LVT1\t\t: %08x\n", apic_read(APIC_LVT1));
587 seq_printf(seq, " LVTERR\t\t: %08x\n", apic_read(APIC_LVTERR));
588 seq_printf(seq, " TMICT\t\t: %08x\n", apic_read(APIC_TMICT));
589 seq_printf(seq, " TMCCT\t\t: %08x\n", apic_read(APIC_TMCCT));
590 seq_printf(seq, " TDCR\t\t: %08x\n", apic_read(APIC_TDCR));
591#endif /* CONFIG_X86_LOCAL_APIC */
592
593 seq_printf(seq, "\n MSR\t:\n");
594}
595
596static int cpu_seq_show(struct seq_file *seq, void *v)
597{
598 struct cpu_private *priv = seq->private;
599
600 if (priv == NULL)
601 return -EINVAL;
602
603 switch (cpu_base[priv->type].flag) {
604 case CPU_TSS:
605 smp_call_function_single(priv->cpu, print_tss, seq, 1);
606 break;
607 case CPU_CR:
608 smp_call_function_single(priv->cpu, print_cr, seq, 1);
609 break;
610 case CPU_DT:
611 smp_call_function_single(priv->cpu, print_dt, seq, 1);
612 break;
613 case CPU_DEBUG:
614 if (priv->file == CPU_INDEX_BIT)
615 smp_call_function_single(priv->cpu, print_dr, seq, 1);
616 print_msr(seq, priv->cpu, cpu_base[priv->type].flag);
617 break;
618 case CPU_APIC:
619 if (priv->file == CPU_INDEX_BIT)
620 smp_call_function_single(priv->cpu, print_apic, seq, 1);
621 print_msr(seq, priv->cpu, cpu_base[priv->type].flag);
622 break;
623
624 default:
625 print_msr(seq, priv->cpu, cpu_base[priv->type].flag);
626 break;
627 }
628 seq_printf(seq, "\n");
629
630 return 0;
631}
632
633static void *cpu_seq_start(struct seq_file *seq, loff_t *pos)
634{
635 if (*pos == 0) /* One time is enough ;-) */
636 return seq;
637
638 return NULL;
639}
640
641static void *cpu_seq_next(struct seq_file *seq, void *v, loff_t *pos)
642{
643 (*pos)++;
644
645 return cpu_seq_start(seq, pos);
646}
647
648static void cpu_seq_stop(struct seq_file *seq, void *v)
649{
650}
651
652static const struct seq_operations cpu_seq_ops = {
653 .start = cpu_seq_start,
654 .next = cpu_seq_next,
655 .stop = cpu_seq_stop,
656 .show = cpu_seq_show,
657};
658
659static int cpu_seq_open(struct inode *inode, struct file *file)
660{
661 struct cpu_private *priv = inode->i_private;
662 struct seq_file *seq;
663 int err;
664
665 err = seq_open(file, &cpu_seq_ops);
666 if (!err) {
667 seq = file->private_data;
668 seq->private = priv;
669 }
670
671 return err;
672}
673
674static int write_msr(struct cpu_private *priv, u64 val)
675{
676 u32 low, high;
677
678 high = (val >> 32) & 0xffffffff;
679 low = val & 0xffffffff;
680
681 if (!wrmsr_safe_on_cpu(priv->cpu, priv->reg, low, high))
682 return 0;
683
684 return -EPERM;
685}
686
687static int write_cpu_register(struct cpu_private *priv, const char *buf)
688{
689 int ret = -EPERM;
690 u64 val;
691
692 ret = strict_strtoull(buf, 0, &val);
693 if (ret < 0)
694 return ret;
695
696 /* Supporting only MSRs */
697 if (priv->type < CPU_TSS_BIT)
698 return write_msr(priv, val);
699
700 return ret;
701}
702
703static ssize_t cpu_write(struct file *file, const char __user *ubuf,
704 size_t count, loff_t *off)
705{
706 struct seq_file *seq = file->private_data;
707 struct cpu_private *priv = seq->private;
708 char buf[19];
709
710 if ((priv == NULL) || (count >= sizeof(buf)))
711 return -EINVAL;
712
713 if (copy_from_user(&buf, ubuf, count))
714 return -EFAULT;
715
716 buf[count] = 0;
717
718 if ((cpu_base[priv->type].write) && (cpu_file[priv->file].write))
719 if (!write_cpu_register(priv, buf))
720 return count;
721
722 return -EACCES;
723}
724
725static const struct file_operations cpu_fops = {
726 .owner = THIS_MODULE,
727 .open = cpu_seq_open,
728 .read = seq_read,
729 .write = cpu_write,
730 .llseek = seq_lseek,
731 .release = seq_release,
732};
733
734static int cpu_create_file(unsigned cpu, unsigned type, unsigned reg,
735 unsigned file, struct dentry *dentry)
736{
737 struct cpu_private *priv = NULL;
738
739 /* Already intialized */
740 if (file == CPU_INDEX_BIT)
741 if (per_cpu(cpu_arr[type].init, cpu))
742 return 0;
743
744 priv = kzalloc(sizeof(*priv), GFP_KERNEL);
745 if (priv == NULL)
746 return -ENOMEM;
747
748 priv->cpu = cpu;
749 priv->type = type;
750 priv->reg = reg;
751 priv->file = file;
752 mutex_lock(&cpu_debug_lock);
753 per_cpu(priv_arr[type], cpu) = priv;
754 per_cpu(cpu_priv_count, cpu)++;
755 mutex_unlock(&cpu_debug_lock);
756
757 if (file)
758 debugfs_create_file(cpu_file[file].name, S_IRUGO,
759 dentry, (void *)priv, &cpu_fops);
760 else {
761 debugfs_create_file(cpu_base[type].name, S_IRUGO,
762 per_cpu(cpu_arr[type].dentry, cpu),
763 (void *)priv, &cpu_fops);
764 mutex_lock(&cpu_debug_lock);
765 per_cpu(cpu_arr[type].init, cpu) = 1;
766 mutex_unlock(&cpu_debug_lock);
767 }
768
769 return 0;
770}
771
772static int cpu_init_regfiles(unsigned cpu, unsigned int type, unsigned reg,
773 struct dentry *dentry)
774{
775 unsigned file;
776 int err = 0;
777
778 for (file = 0; file < ARRAY_SIZE(cpu_file); file++) {
779 err = cpu_create_file(cpu, type, reg, file, dentry);
780 if (err)
781 return err;
782 }
783
784 return err;
785}
786
787static int cpu_init_msr(unsigned cpu, unsigned type, struct dentry *dentry)
788{
789 struct dentry *cpu_dentry = NULL;
790 unsigned reg, reg_min, reg_max;
791 int i, range, err = 0;
792 char reg_dir[12];
793 u32 low, high;
794
795 range = get_cpu_range_count(cpu);
796
797 for (i = 0; i < range; i++) {
798 if (!get_cpu_range(cpu, &reg_min, &reg_max, i,
799 cpu_base[type].flag))
800 continue;
801
802 for (reg = reg_min; reg <= reg_max; reg++) {
803 if (rdmsr_safe_on_cpu(cpu, reg, &low, &high))
804 continue;
805
806 sprintf(reg_dir, "0x%x", reg);
807 cpu_dentry = debugfs_create_dir(reg_dir, dentry);
808 err = cpu_init_regfiles(cpu, type, reg, cpu_dentry);
809 if (err)
810 return err;
811 }
812 }
813
814 return err;
815}
816
817static int cpu_init_allreg(unsigned cpu, struct dentry *dentry)
818{
819 struct dentry *cpu_dentry = NULL;
820 unsigned type;
821 int err = 0;
822
823 for (type = 0; type < ARRAY_SIZE(cpu_base) - 1; type++) {
824 if (!is_typeflag_valid(cpu, cpu_base[type].flag))
825 continue;
826 cpu_dentry = debugfs_create_dir(cpu_base[type].name, dentry);
827 per_cpu(cpu_arr[type].dentry, cpu) = cpu_dentry;
828
829 if (type < CPU_TSS_BIT)
830 err = cpu_init_msr(cpu, type, cpu_dentry);
831 else
832 err = cpu_create_file(cpu, type, 0, CPU_INDEX_BIT,
833 cpu_dentry);
834 if (err)
835 return err;
836 }
837
838 return err;
839}
840
841static int cpu_init_cpu(void)
842{
843 struct dentry *cpu_dentry = NULL;
844 struct cpuinfo_x86 *cpui;
845 char cpu_dir[12];
846 unsigned cpu;
847 int err = 0;
848
849 for (cpu = 0; cpu < nr_cpu_ids; cpu++) {
850 cpui = &cpu_data(cpu);
851 if (!cpu_has(cpui, X86_FEATURE_MSR))
852 continue;
853 per_cpu(cpu_model, cpu) = ((cpui->x86_vendor << 16) |
854 (cpui->x86 << 8) |
855 (cpui->x86_model));
856 per_cpu(cpu_modelflag, cpu) = get_cpu_modelflag(cpu);
857
858 sprintf(cpu_dir, "cpu%d", cpu);
859 cpu_dentry = debugfs_create_dir(cpu_dir, cpu_debugfs_dir);
860 err = cpu_init_allreg(cpu, cpu_dentry);
861
862 pr_info("cpu%d(%d) debug files %d\n",
863 cpu, nr_cpu_ids, per_cpu(cpu_priv_count, cpu));
864 if (per_cpu(cpu_priv_count, cpu) > MAX_CPU_FILES) {
865 pr_err("Register files count %d exceeds limit %d\n",
866 per_cpu(cpu_priv_count, cpu), MAX_CPU_FILES);
867 per_cpu(cpu_priv_count, cpu) = MAX_CPU_FILES;
868 err = -ENFILE;
869 }
870 if (err)
871 return err;
872 }
873
874 return err;
875}
876
877static int __init cpu_debug_init(void)
878{
879 cpu_debugfs_dir = debugfs_create_dir("cpu", arch_debugfs_dir);
880
881 return cpu_init_cpu();
882}
883
884static void __exit cpu_debug_exit(void)
885{
886 int i, cpu;
887
888 if (cpu_debugfs_dir)
889 debugfs_remove_recursive(cpu_debugfs_dir);
890
891 for (cpu = 0; cpu < nr_cpu_ids; cpu++)
892 for (i = 0; i < per_cpu(cpu_priv_count, cpu); i++)
893 kfree(per_cpu(priv_arr[i], cpu));
894}
895
896module_init(cpu_debug_init);
897module_exit(cpu_debug_exit);
898
899MODULE_AUTHOR("Jaswinder Singh Rajput");
900MODULE_DESCRIPTION("CPU Debug module");
901MODULE_LICENSE("GPL");
diff --git a/arch/x86/kernel/cpu/cyrix.c b/arch/x86/kernel/cpu/cyrix.c
index ffd0f5ed071a..593171e967ef 100644
--- a/arch/x86/kernel/cpu/cyrix.c
+++ b/arch/x86/kernel/cpu/cyrix.c
@@ -61,23 +61,23 @@ static void __cpuinit do_cyrix_devid(unsigned char *dir0, unsigned char *dir1)
61 */ 61 */
62static unsigned char Cx86_dir0_msb __cpuinitdata = 0; 62static unsigned char Cx86_dir0_msb __cpuinitdata = 0;
63 63
64static char Cx86_model[][9] __cpuinitdata = { 64static const char __cpuinitconst Cx86_model[][9] = {
65 "Cx486", "Cx486", "5x86 ", "6x86", "MediaGX ", "6x86MX ", 65 "Cx486", "Cx486", "5x86 ", "6x86", "MediaGX ", "6x86MX ",
66 "M II ", "Unknown" 66 "M II ", "Unknown"
67}; 67};
68static char Cx486_name[][5] __cpuinitdata = { 68static const char __cpuinitconst Cx486_name[][5] = {
69 "SLC", "DLC", "SLC2", "DLC2", "SRx", "DRx", 69 "SLC", "DLC", "SLC2", "DLC2", "SRx", "DRx",
70 "SRx2", "DRx2" 70 "SRx2", "DRx2"
71}; 71};
72static char Cx486S_name[][4] __cpuinitdata = { 72static const char __cpuinitconst Cx486S_name[][4] = {
73 "S", "S2", "Se", "S2e" 73 "S", "S2", "Se", "S2e"
74}; 74};
75static char Cx486D_name[][4] __cpuinitdata = { 75static const char __cpuinitconst Cx486D_name[][4] = {
76 "DX", "DX2", "?", "?", "?", "DX4" 76 "DX", "DX2", "?", "?", "?", "DX4"
77}; 77};
78static char Cx86_cb[] __cpuinitdata = "?.5x Core/Bus Clock"; 78static char Cx86_cb[] __cpuinitdata = "?.5x Core/Bus Clock";
79static char cyrix_model_mult1[] __cpuinitdata = "12??43"; 79static const char __cpuinitconst cyrix_model_mult1[] = "12??43";
80static char cyrix_model_mult2[] __cpuinitdata = "12233445"; 80static const char __cpuinitconst cyrix_model_mult2[] = "12233445";
81 81
82/* 82/*
83 * Reset the slow-loop (SLOP) bit on the 686(L) which is set by some old 83 * Reset the slow-loop (SLOP) bit on the 686(L) which is set by some old
@@ -435,7 +435,7 @@ static void __cpuinit cyrix_identify(struct cpuinfo_x86 *c)
435 } 435 }
436} 436}
437 437
438static struct cpu_dev cyrix_cpu_dev __cpuinitdata = { 438static const struct cpu_dev __cpuinitconst cyrix_cpu_dev = {
439 .c_vendor = "Cyrix", 439 .c_vendor = "Cyrix",
440 .c_ident = { "CyrixInstead" }, 440 .c_ident = { "CyrixInstead" },
441 .c_early_init = early_init_cyrix, 441 .c_early_init = early_init_cyrix,
@@ -446,7 +446,7 @@ static struct cpu_dev cyrix_cpu_dev __cpuinitdata = {
446 446
447cpu_dev_register(cyrix_cpu_dev); 447cpu_dev_register(cyrix_cpu_dev);
448 448
449static struct cpu_dev nsc_cpu_dev __cpuinitdata = { 449static const struct cpu_dev __cpuinitconst nsc_cpu_dev = {
450 .c_vendor = "NSC", 450 .c_vendor = "NSC",
451 .c_ident = { "Geode by NSC" }, 451 .c_ident = { "Geode by NSC" },
452 .c_init = init_nsc, 452 .c_init = init_nsc,
diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c
index 1a89a2b68d15..7437fa133c02 100644
--- a/arch/x86/kernel/cpu/intel.c
+++ b/arch/x86/kernel/cpu/intel.c
@@ -14,6 +14,7 @@
14#include <asm/uaccess.h> 14#include <asm/uaccess.h>
15#include <asm/ds.h> 15#include <asm/ds.h>
16#include <asm/bugs.h> 16#include <asm/bugs.h>
17#include <asm/cpu.h>
17 18
18#ifdef CONFIG_X86_64 19#ifdef CONFIG_X86_64
19#include <asm/topology.h> 20#include <asm/topology.h>
@@ -54,6 +55,11 @@ static void __cpuinit early_init_intel(struct cpuinfo_x86 *c)
54 c->x86_cache_alignment = 128; 55 c->x86_cache_alignment = 128;
55#endif 56#endif
56 57
58 /* CPUID workaround for 0F33/0F34 CPU */
59 if (c->x86 == 0xF && c->x86_model == 0x3
60 && (c->x86_mask == 0x3 || c->x86_mask == 0x4))
61 c->x86_phys_bits = 36;
62
57 /* 63 /*
58 * c->x86_power is 8000_0007 edx. Bit 8 is TSC runs at constant rate 64 * c->x86_power is 8000_0007 edx. Bit 8 is TSC runs at constant rate
59 * with P/T states and does not stop in deep C-states. 65 * with P/T states and does not stop in deep C-states.
@@ -116,6 +122,28 @@ static void __cpuinit trap_init_f00f_bug(void)
116} 122}
117#endif 123#endif
118 124
125static void __cpuinit intel_smp_check(struct cpuinfo_x86 *c)
126{
127#ifdef CONFIG_SMP
128 /* calling is from identify_secondary_cpu() ? */
129 if (c->cpu_index == boot_cpu_id)
130 return;
131
132 /*
133 * Mask B, Pentium, but not Pentium MMX
134 */
135 if (c->x86 == 5 &&
136 c->x86_mask >= 1 && c->x86_mask <= 4 &&
137 c->x86_model <= 3) {
138 /*
139 * Remember we have B step Pentia with bugs
140 */
141 WARN_ONCE(1, "WARNING: SMP operation may be unreliable"
142 "with B stepping processors.\n");
143 }
144#endif
145}
146
119static void __cpuinit intel_workarounds(struct cpuinfo_x86 *c) 147static void __cpuinit intel_workarounds(struct cpuinfo_x86 *c)
120{ 148{
121 unsigned long lo, hi; 149 unsigned long lo, hi;
@@ -192,6 +220,8 @@ static void __cpuinit intel_workarounds(struct cpuinfo_x86 *c)
192#ifdef CONFIG_X86_NUMAQ 220#ifdef CONFIG_X86_NUMAQ
193 numaq_tsc_disable(); 221 numaq_tsc_disable();
194#endif 222#endif
223
224 intel_smp_check(c);
195} 225}
196#else 226#else
197static void __cpuinit intel_workarounds(struct cpuinfo_x86 *c) 227static void __cpuinit intel_workarounds(struct cpuinfo_x86 *c)
@@ -391,7 +421,7 @@ static unsigned int __cpuinit intel_size_cache(struct cpuinfo_x86 *c, unsigned i
391} 421}
392#endif 422#endif
393 423
394static struct cpu_dev intel_cpu_dev __cpuinitdata = { 424static const struct cpu_dev __cpuinitconst intel_cpu_dev = {
395 .c_vendor = "Intel", 425 .c_vendor = "Intel",
396 .c_ident = { "GenuineIntel" }, 426 .c_ident = { "GenuineIntel" },
397#ifdef CONFIG_X86_32 427#ifdef CONFIG_X86_32
diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c
index 7293508d8f5c..c471eb1a389c 100644
--- a/arch/x86/kernel/cpu/intel_cacheinfo.c
+++ b/arch/x86/kernel/cpu/intel_cacheinfo.c
@@ -32,7 +32,7 @@ struct _cache_table
32}; 32};
33 33
34/* all the cache descriptor types we care about (no TLB or trace cache entries) */ 34/* all the cache descriptor types we care about (no TLB or trace cache entries) */
35static struct _cache_table cache_table[] __cpuinitdata = 35static const struct _cache_table __cpuinitconst cache_table[] =
36{ 36{
37 { 0x06, LVL_1_INST, 8 }, /* 4-way set assoc, 32 byte line size */ 37 { 0x06, LVL_1_INST, 8 }, /* 4-way set assoc, 32 byte line size */
38 { 0x08, LVL_1_INST, 16 }, /* 4-way set assoc, 32 byte line size */ 38 { 0x08, LVL_1_INST, 16 }, /* 4-way set assoc, 32 byte line size */
@@ -206,15 +206,15 @@ union l3_cache {
206 unsigned val; 206 unsigned val;
207}; 207};
208 208
209static unsigned short assocs[] __cpuinitdata = { 209static const unsigned short __cpuinitconst assocs[] = {
210 [1] = 1, [2] = 2, [4] = 4, [6] = 8, 210 [1] = 1, [2] = 2, [4] = 4, [6] = 8,
211 [8] = 16, [0xa] = 32, [0xb] = 48, 211 [8] = 16, [0xa] = 32, [0xb] = 48,
212 [0xc] = 64, 212 [0xc] = 64,
213 [0xf] = 0xffff // ?? 213 [0xf] = 0xffff // ??
214}; 214};
215 215
216static unsigned char levels[] __cpuinitdata = { 1, 1, 2, 3 }; 216static const unsigned char __cpuinitconst levels[] = { 1, 1, 2, 3 };
217static unsigned char types[] __cpuinitdata = { 1, 2, 3, 3 }; 217static const unsigned char __cpuinitconst types[] = { 1, 2, 3, 3 };
218 218
219static void __cpuinit 219static void __cpuinit
220amd_cpuid4(int leaf, union _cpuid4_leaf_eax *eax, 220amd_cpuid4(int leaf, union _cpuid4_leaf_eax *eax,
diff --git a/arch/x86/kernel/cpu/mcheck/Makefile b/arch/x86/kernel/cpu/mcheck/Makefile
index d7d2323bbb69..b2f89829bbe8 100644
--- a/arch/x86/kernel/cpu/mcheck/Makefile
+++ b/arch/x86/kernel/cpu/mcheck/Makefile
@@ -4,3 +4,4 @@ obj-$(CONFIG_X86_32) += k7.o p4.o p5.o p6.o winchip.o
4obj-$(CONFIG_X86_MCE_INTEL) += mce_intel_64.o 4obj-$(CONFIG_X86_MCE_INTEL) += mce_intel_64.o
5obj-$(CONFIG_X86_MCE_AMD) += mce_amd_64.o 5obj-$(CONFIG_X86_MCE_AMD) += mce_amd_64.o
6obj-$(CONFIG_X86_MCE_NONFATAL) += non-fatal.o 6obj-$(CONFIG_X86_MCE_NONFATAL) += non-fatal.o
7obj-$(CONFIG_X86_MCE_THRESHOLD) += threshold.o
diff --git a/arch/x86/kernel/cpu/mcheck/mce_32.c b/arch/x86/kernel/cpu/mcheck/mce_32.c
index dfaebce3633e..3552119b091d 100644
--- a/arch/x86/kernel/cpu/mcheck/mce_32.c
+++ b/arch/x86/kernel/cpu/mcheck/mce_32.c
@@ -60,20 +60,6 @@ void mcheck_init(struct cpuinfo_x86 *c)
60 } 60 }
61} 61}
62 62
63static unsigned long old_cr4 __initdata;
64
65void __init stop_mce(void)
66{
67 old_cr4 = read_cr4();
68 clear_in_cr4(X86_CR4_MCE);
69}
70
71void __init restart_mce(void)
72{
73 if (old_cr4 & X86_CR4_MCE)
74 set_in_cr4(X86_CR4_MCE);
75}
76
77static int __init mcheck_disable(char *str) 63static int __init mcheck_disable(char *str)
78{ 64{
79 mce_disabled = 1; 65 mce_disabled = 1;
diff --git a/arch/x86/kernel/cpu/mcheck/mce_64.c b/arch/x86/kernel/cpu/mcheck/mce_64.c
index fe79985ce0f2..ca14604611ec 100644
--- a/arch/x86/kernel/cpu/mcheck/mce_64.c
+++ b/arch/x86/kernel/cpu/mcheck/mce_64.c
@@ -3,6 +3,8 @@
3 * K8 parts Copyright 2002,2003 Andi Kleen, SuSE Labs. 3 * K8 parts Copyright 2002,2003 Andi Kleen, SuSE Labs.
4 * Rest from unknown author(s). 4 * Rest from unknown author(s).
5 * 2004 Andi Kleen. Rewrote most of it. 5 * 2004 Andi Kleen. Rewrote most of it.
6 * Copyright 2008 Intel Corporation
7 * Author: Andi Kleen
6 */ 8 */
7 9
8#include <linux/init.h> 10#include <linux/init.h>
@@ -24,6 +26,9 @@
24#include <linux/ctype.h> 26#include <linux/ctype.h>
25#include <linux/kmod.h> 27#include <linux/kmod.h>
26#include <linux/kdebug.h> 28#include <linux/kdebug.h>
29#include <linux/kobject.h>
30#include <linux/sysfs.h>
31#include <linux/ratelimit.h>
27#include <asm/processor.h> 32#include <asm/processor.h>
28#include <asm/msr.h> 33#include <asm/msr.h>
29#include <asm/mce.h> 34#include <asm/mce.h>
@@ -32,7 +37,6 @@
32#include <asm/idle.h> 37#include <asm/idle.h>
33 38
34#define MISC_MCELOG_MINOR 227 39#define MISC_MCELOG_MINOR 227
35#define NR_SYSFS_BANKS 6
36 40
37atomic_t mce_entry; 41atomic_t mce_entry;
38 42
@@ -47,7 +51,7 @@ static int mce_dont_init;
47 */ 51 */
48static int tolerant = 1; 52static int tolerant = 1;
49static int banks; 53static int banks;
50static unsigned long bank[NR_SYSFS_BANKS] = { [0 ... NR_SYSFS_BANKS-1] = ~0UL }; 54static u64 *bank;
51static unsigned long notify_user; 55static unsigned long notify_user;
52static int rip_msr; 56static int rip_msr;
53static int mce_bootlog = -1; 57static int mce_bootlog = -1;
@@ -58,6 +62,19 @@ static char *trigger_argv[2] = { trigger, NULL };
58 62
59static DECLARE_WAIT_QUEUE_HEAD(mce_wait); 63static DECLARE_WAIT_QUEUE_HEAD(mce_wait);
60 64
65/* MCA banks polled by the period polling timer for corrected events */
66DEFINE_PER_CPU(mce_banks_t, mce_poll_banks) = {
67 [0 ... BITS_TO_LONGS(MAX_NR_BANKS)-1] = ~0UL
68};
69
70/* Do initial initialization of a struct mce */
71void mce_setup(struct mce *m)
72{
73 memset(m, 0, sizeof(struct mce));
74 m->cpu = smp_processor_id();
75 rdtscll(m->tsc);
76}
77
61/* 78/*
62 * Lockless MCE logging infrastructure. 79 * Lockless MCE logging infrastructure.
63 * This avoids deadlocks on printk locks without having to break locks. Also 80 * This avoids deadlocks on printk locks without having to break locks. Also
@@ -119,11 +136,11 @@ static void print_mce(struct mce *m)
119 print_symbol("{%s}", m->ip); 136 print_symbol("{%s}", m->ip);
120 printk("\n"); 137 printk("\n");
121 } 138 }
122 printk(KERN_EMERG "TSC %Lx ", m->tsc); 139 printk(KERN_EMERG "TSC %llx ", m->tsc);
123 if (m->addr) 140 if (m->addr)
124 printk("ADDR %Lx ", m->addr); 141 printk("ADDR %llx ", m->addr);
125 if (m->misc) 142 if (m->misc)
126 printk("MISC %Lx ", m->misc); 143 printk("MISC %llx ", m->misc);
127 printk("\n"); 144 printk("\n");
128 printk(KERN_EMERG "This is not a software problem!\n"); 145 printk(KERN_EMERG "This is not a software problem!\n");
129 printk(KERN_EMERG "Run through mcelog --ascii to decode " 146 printk(KERN_EMERG "Run through mcelog --ascii to decode "
@@ -149,8 +166,10 @@ static void mce_panic(char *msg, struct mce *backup, unsigned long start)
149 panic(msg); 166 panic(msg);
150} 167}
151 168
152static int mce_available(struct cpuinfo_x86 *c) 169int mce_available(struct cpuinfo_x86 *c)
153{ 170{
171 if (mce_dont_init)
172 return 0;
154 return cpu_has(c, X86_FEATURE_MCE) && cpu_has(c, X86_FEATURE_MCA); 173 return cpu_has(c, X86_FEATURE_MCE) && cpu_has(c, X86_FEATURE_MCA);
155} 174}
156 175
@@ -172,7 +191,77 @@ static inline void mce_get_rip(struct mce *m, struct pt_regs *regs)
172} 191}
173 192
174/* 193/*
175 * The actual machine check handler 194 * Poll for corrected events or events that happened before reset.
195 * Those are just logged through /dev/mcelog.
196 *
197 * This is executed in standard interrupt context.
198 */
199void machine_check_poll(enum mcp_flags flags, mce_banks_t *b)
200{
201 struct mce m;
202 int i;
203
204 mce_setup(&m);
205
206 rdmsrl(MSR_IA32_MCG_STATUS, m.mcgstatus);
207 for (i = 0; i < banks; i++) {
208 if (!bank[i] || !test_bit(i, *b))
209 continue;
210
211 m.misc = 0;
212 m.addr = 0;
213 m.bank = i;
214 m.tsc = 0;
215
216 barrier();
217 rdmsrl(MSR_IA32_MC0_STATUS + i*4, m.status);
218 if (!(m.status & MCI_STATUS_VAL))
219 continue;
220
221 /*
222 * Uncorrected events are handled by the exception handler
223 * when it is enabled. But when the exception is disabled log
224 * everything.
225 *
226 * TBD do the same check for MCI_STATUS_EN here?
227 */
228 if ((m.status & MCI_STATUS_UC) && !(flags & MCP_UC))
229 continue;
230
231 if (m.status & MCI_STATUS_MISCV)
232 rdmsrl(MSR_IA32_MC0_MISC + i*4, m.misc);
233 if (m.status & MCI_STATUS_ADDRV)
234 rdmsrl(MSR_IA32_MC0_ADDR + i*4, m.addr);
235
236 if (!(flags & MCP_TIMESTAMP))
237 m.tsc = 0;
238 /*
239 * Don't get the IP here because it's unlikely to
240 * have anything to do with the actual error location.
241 */
242
243 mce_log(&m);
244 add_taint(TAINT_MACHINE_CHECK);
245
246 /*
247 * Clear state for this bank.
248 */
249 wrmsrl(MSR_IA32_MC0_STATUS+4*i, 0);
250 }
251
252 /*
253 * Don't clear MCG_STATUS here because it's only defined for
254 * exceptions.
255 */
256}
257
258/*
259 * The actual machine check handler. This only handles real
260 * exceptions when something got corrupted coming in through int 18.
261 *
262 * This is executed in NMI context not subject to normal locking rules. This
263 * implies that most kernel services cannot be safely used. Don't even
264 * think about putting a printk in there!
176 */ 265 */
177void do_machine_check(struct pt_regs * regs, long error_code) 266void do_machine_check(struct pt_regs * regs, long error_code)
178{ 267{
@@ -190,17 +279,18 @@ void do_machine_check(struct pt_regs * regs, long error_code)
190 * error. 279 * error.
191 */ 280 */
192 int kill_it = 0; 281 int kill_it = 0;
282 DECLARE_BITMAP(toclear, MAX_NR_BANKS);
193 283
194 atomic_inc(&mce_entry); 284 atomic_inc(&mce_entry);
195 285
196 if ((regs 286 if (notify_die(DIE_NMI, "machine check", regs, error_code,
197 && notify_die(DIE_NMI, "machine check", regs, error_code,
198 18, SIGKILL) == NOTIFY_STOP) 287 18, SIGKILL) == NOTIFY_STOP)
199 || !banks) 288 goto out2;
289 if (!banks)
200 goto out2; 290 goto out2;
201 291
202 memset(&m, 0, sizeof(struct mce)); 292 mce_setup(&m);
203 m.cpu = smp_processor_id(); 293
204 rdmsrl(MSR_IA32_MCG_STATUS, m.mcgstatus); 294 rdmsrl(MSR_IA32_MCG_STATUS, m.mcgstatus);
205 /* if the restart IP is not valid, we're done for */ 295 /* if the restart IP is not valid, we're done for */
206 if (!(m.mcgstatus & MCG_STATUS_RIPV)) 296 if (!(m.mcgstatus & MCG_STATUS_RIPV))
@@ -210,18 +300,32 @@ void do_machine_check(struct pt_regs * regs, long error_code)
210 barrier(); 300 barrier();
211 301
212 for (i = 0; i < banks; i++) { 302 for (i = 0; i < banks; i++) {
213 if (i < NR_SYSFS_BANKS && !bank[i]) 303 __clear_bit(i, toclear);
304 if (!bank[i])
214 continue; 305 continue;
215 306
216 m.misc = 0; 307 m.misc = 0;
217 m.addr = 0; 308 m.addr = 0;
218 m.bank = i; 309 m.bank = i;
219 m.tsc = 0;
220 310
221 rdmsrl(MSR_IA32_MC0_STATUS + i*4, m.status); 311 rdmsrl(MSR_IA32_MC0_STATUS + i*4, m.status);
222 if ((m.status & MCI_STATUS_VAL) == 0) 312 if ((m.status & MCI_STATUS_VAL) == 0)
223 continue; 313 continue;
224 314
315 /*
316 * Non uncorrected errors are handled by machine_check_poll
317 * Leave them alone.
318 */
319 if ((m.status & MCI_STATUS_UC) == 0)
320 continue;
321
322 /*
323 * Set taint even when machine check was not enabled.
324 */
325 add_taint(TAINT_MACHINE_CHECK);
326
327 __set_bit(i, toclear);
328
225 if (m.status & MCI_STATUS_EN) { 329 if (m.status & MCI_STATUS_EN) {
226 /* if PCC was set, there's no way out */ 330 /* if PCC was set, there's no way out */
227 no_way_out |= !!(m.status & MCI_STATUS_PCC); 331 no_way_out |= !!(m.status & MCI_STATUS_PCC);
@@ -235,6 +339,12 @@ void do_machine_check(struct pt_regs * regs, long error_code)
235 no_way_out = 1; 339 no_way_out = 1;
236 kill_it = 1; 340 kill_it = 1;
237 } 341 }
342 } else {
343 /*
344 * Machine check event was not enabled. Clear, but
345 * ignore.
346 */
347 continue;
238 } 348 }
239 349
240 if (m.status & MCI_STATUS_MISCV) 350 if (m.status & MCI_STATUS_MISCV)
@@ -243,10 +353,7 @@ void do_machine_check(struct pt_regs * regs, long error_code)
243 rdmsrl(MSR_IA32_MC0_ADDR + i*4, m.addr); 353 rdmsrl(MSR_IA32_MC0_ADDR + i*4, m.addr);
244 354
245 mce_get_rip(&m, regs); 355 mce_get_rip(&m, regs);
246 if (error_code >= 0) 356 mce_log(&m);
247 rdtscll(m.tsc);
248 if (error_code != -2)
249 mce_log(&m);
250 357
251 /* Did this bank cause the exception? */ 358 /* Did this bank cause the exception? */
252 /* Assume that the bank with uncorrectable errors did it, 359 /* Assume that the bank with uncorrectable errors did it,
@@ -255,14 +362,8 @@ void do_machine_check(struct pt_regs * regs, long error_code)
255 panicm = m; 362 panicm = m;
256 panicm_found = 1; 363 panicm_found = 1;
257 } 364 }
258
259 add_taint(TAINT_MACHINE_CHECK);
260 } 365 }
261 366
262 /* Never do anything final in the polling timer */
263 if (!regs)
264 goto out;
265
266 /* If we didn't find an uncorrectable error, pick 367 /* If we didn't find an uncorrectable error, pick
267 the last one (shouldn't happen, just being safe). */ 368 the last one (shouldn't happen, just being safe). */
268 if (!panicm_found) 369 if (!panicm_found)
@@ -309,10 +410,11 @@ void do_machine_check(struct pt_regs * regs, long error_code)
309 /* notify userspace ASAP */ 410 /* notify userspace ASAP */
310 set_thread_flag(TIF_MCE_NOTIFY); 411 set_thread_flag(TIF_MCE_NOTIFY);
311 412
312 out:
313 /* the last thing we do is clear state */ 413 /* the last thing we do is clear state */
314 for (i = 0; i < banks; i++) 414 for (i = 0; i < banks; i++) {
315 wrmsrl(MSR_IA32_MC0_STATUS+4*i, 0); 415 if (test_bit(i, toclear))
416 wrmsrl(MSR_IA32_MC0_STATUS+4*i, 0);
417 }
316 wrmsrl(MSR_IA32_MCG_STATUS, 0); 418 wrmsrl(MSR_IA32_MCG_STATUS, 0);
317 out2: 419 out2:
318 atomic_dec(&mce_entry); 420 atomic_dec(&mce_entry);
@@ -332,15 +434,13 @@ void do_machine_check(struct pt_regs * regs, long error_code)
332 * and historically has been the register value of the 434 * and historically has been the register value of the
333 * MSR_IA32_THERMAL_STATUS (Intel) msr. 435 * MSR_IA32_THERMAL_STATUS (Intel) msr.
334 */ 436 */
335void mce_log_therm_throt_event(unsigned int cpu, __u64 status) 437void mce_log_therm_throt_event(__u64 status)
336{ 438{
337 struct mce m; 439 struct mce m;
338 440
339 memset(&m, 0, sizeof(m)); 441 mce_setup(&m);
340 m.cpu = cpu;
341 m.bank = MCE_THERMAL_BANK; 442 m.bank = MCE_THERMAL_BANK;
342 m.status = status; 443 m.status = status;
343 rdtscll(m.tsc);
344 mce_log(&m); 444 mce_log(&m);
345} 445}
346#endif /* CONFIG_X86_MCE_INTEL */ 446#endif /* CONFIG_X86_MCE_INTEL */
@@ -353,18 +453,18 @@ void mce_log_therm_throt_event(unsigned int cpu, __u64 status)
353 453
354static int check_interval = 5 * 60; /* 5 minutes */ 454static int check_interval = 5 * 60; /* 5 minutes */
355static int next_interval; /* in jiffies */ 455static int next_interval; /* in jiffies */
356static void mcheck_timer(struct work_struct *work); 456static void mcheck_timer(unsigned long);
357static DECLARE_DELAYED_WORK(mcheck_work, mcheck_timer); 457static DEFINE_PER_CPU(struct timer_list, mce_timer);
358 458
359static void mcheck_check_cpu(void *info) 459static void mcheck_timer(unsigned long data)
360{ 460{
361 if (mce_available(&current_cpu_data)) 461 struct timer_list *t = &per_cpu(mce_timer, data);
362 do_machine_check(NULL, 0);
363}
364 462
365static void mcheck_timer(struct work_struct *work) 463 WARN_ON(smp_processor_id() != data);
366{ 464
367 on_each_cpu(mcheck_check_cpu, NULL, 1); 465 if (mce_available(&current_cpu_data))
466 machine_check_poll(MCP_TIMESTAMP,
467 &__get_cpu_var(mce_poll_banks));
368 468
369 /* 469 /*
370 * Alert userspace if needed. If we logged an MCE, reduce the 470 * Alert userspace if needed. If we logged an MCE, reduce the
@@ -377,31 +477,41 @@ static void mcheck_timer(struct work_struct *work)
377 (int)round_jiffies_relative(check_interval*HZ)); 477 (int)round_jiffies_relative(check_interval*HZ));
378 } 478 }
379 479
380 schedule_delayed_work(&mcheck_work, next_interval); 480 t->expires = jiffies + next_interval;
481 add_timer(t);
482}
483
484static void mce_do_trigger(struct work_struct *work)
485{
486 call_usermodehelper(trigger, trigger_argv, NULL, UMH_NO_WAIT);
381} 487}
382 488
489static DECLARE_WORK(mce_trigger_work, mce_do_trigger);
490
383/* 491/*
384 * This is only called from process context. This is where we do 492 * Notify the user(s) about new machine check events.
385 * anything we need to alert userspace about new MCEs. This is called 493 * Can be called from interrupt context, but not from machine check/NMI
386 * directly from the poller and also from entry.S and idle, thanks to 494 * context.
387 * TIF_MCE_NOTIFY.
388 */ 495 */
389int mce_notify_user(void) 496int mce_notify_user(void)
390{ 497{
498 /* Not more than two messages every minute */
499 static DEFINE_RATELIMIT_STATE(ratelimit, 60*HZ, 2);
500
391 clear_thread_flag(TIF_MCE_NOTIFY); 501 clear_thread_flag(TIF_MCE_NOTIFY);
392 if (test_and_clear_bit(0, &notify_user)) { 502 if (test_and_clear_bit(0, &notify_user)) {
393 static unsigned long last_print;
394 unsigned long now = jiffies;
395
396 wake_up_interruptible(&mce_wait); 503 wake_up_interruptible(&mce_wait);
397 if (trigger[0])
398 call_usermodehelper(trigger, trigger_argv, NULL,
399 UMH_NO_WAIT);
400 504
401 if (time_after_eq(now, last_print + (check_interval*HZ))) { 505 /*
402 last_print = now; 506 * There is no risk of missing notifications because
507 * work_pending is always cleared before the function is
508 * executed.
509 */
510 if (trigger[0] && !work_pending(&mce_trigger_work))
511 schedule_work(&mce_trigger_work);
512
513 if (__ratelimit(&ratelimit))
403 printk(KERN_INFO "Machine check events logged\n"); 514 printk(KERN_INFO "Machine check events logged\n");
404 }
405 515
406 return 1; 516 return 1;
407 } 517 }
@@ -425,63 +535,78 @@ static struct notifier_block mce_idle_notifier = {
425 535
426static __init int periodic_mcheck_init(void) 536static __init int periodic_mcheck_init(void)
427{ 537{
428 next_interval = check_interval * HZ; 538 idle_notifier_register(&mce_idle_notifier);
429 if (next_interval) 539 return 0;
430 schedule_delayed_work(&mcheck_work,
431 round_jiffies_relative(next_interval));
432 idle_notifier_register(&mce_idle_notifier);
433 return 0;
434} 540}
435__initcall(periodic_mcheck_init); 541__initcall(periodic_mcheck_init);
436 542
437
438/* 543/*
439 * Initialize Machine Checks for a CPU. 544 * Initialize Machine Checks for a CPU.
440 */ 545 */
441static void mce_init(void *dummy) 546static int mce_cap_init(void)
442{ 547{
443 u64 cap; 548 u64 cap;
444 int i; 549 unsigned b;
445 550
446 rdmsrl(MSR_IA32_MCG_CAP, cap); 551 rdmsrl(MSR_IA32_MCG_CAP, cap);
447 banks = cap & 0xff; 552 b = cap & 0xff;
448 if (banks > MCE_EXTENDED_BANK) { 553 if (b > MAX_NR_BANKS) {
449 banks = MCE_EXTENDED_BANK; 554 printk(KERN_WARNING
450 printk(KERN_INFO "MCE: warning: using only %d banks\n", 555 "MCE: Using only %u machine check banks out of %u\n",
451 MCE_EXTENDED_BANK); 556 MAX_NR_BANKS, b);
557 b = MAX_NR_BANKS;
452 } 558 }
559
560 /* Don't support asymmetric configurations today */
561 WARN_ON(banks != 0 && b != banks);
562 banks = b;
563 if (!bank) {
564 bank = kmalloc(banks * sizeof(u64), GFP_KERNEL);
565 if (!bank)
566 return -ENOMEM;
567 memset(bank, 0xff, banks * sizeof(u64));
568 }
569
453 /* Use accurate RIP reporting if available. */ 570 /* Use accurate RIP reporting if available. */
454 if ((cap & (1<<9)) && ((cap >> 16) & 0xff) >= 9) 571 if ((cap & (1<<9)) && ((cap >> 16) & 0xff) >= 9)
455 rip_msr = MSR_IA32_MCG_EIP; 572 rip_msr = MSR_IA32_MCG_EIP;
456 573
457 /* Log the machine checks left over from the previous reset. 574 return 0;
458 This also clears all registers */ 575}
459 do_machine_check(NULL, mce_bootlog ? -1 : -2); 576
577static void mce_init(void *dummy)
578{
579 u64 cap;
580 int i;
581 mce_banks_t all_banks;
582
583 /*
584 * Log the machine checks left over from the previous reset.
585 */
586 bitmap_fill(all_banks, MAX_NR_BANKS);
587 machine_check_poll(MCP_UC, &all_banks);
460 588
461 set_in_cr4(X86_CR4_MCE); 589 set_in_cr4(X86_CR4_MCE);
462 590
591 rdmsrl(MSR_IA32_MCG_CAP, cap);
463 if (cap & MCG_CTL_P) 592 if (cap & MCG_CTL_P)
464 wrmsr(MSR_IA32_MCG_CTL, 0xffffffff, 0xffffffff); 593 wrmsr(MSR_IA32_MCG_CTL, 0xffffffff, 0xffffffff);
465 594
466 for (i = 0; i < banks; i++) { 595 for (i = 0; i < banks; i++) {
467 if (i < NR_SYSFS_BANKS) 596 wrmsrl(MSR_IA32_MC0_CTL+4*i, bank[i]);
468 wrmsrl(MSR_IA32_MC0_CTL+4*i, bank[i]);
469 else
470 wrmsrl(MSR_IA32_MC0_CTL+4*i, ~0UL);
471
472 wrmsrl(MSR_IA32_MC0_STATUS+4*i, 0); 597 wrmsrl(MSR_IA32_MC0_STATUS+4*i, 0);
473 } 598 }
474} 599}
475 600
476/* Add per CPU specific workarounds here */ 601/* Add per CPU specific workarounds here */
477static void __cpuinit mce_cpu_quirks(struct cpuinfo_x86 *c) 602static void mce_cpu_quirks(struct cpuinfo_x86 *c)
478{ 603{
479 /* This should be disabled by the BIOS, but isn't always */ 604 /* This should be disabled by the BIOS, but isn't always */
480 if (c->x86_vendor == X86_VENDOR_AMD) { 605 if (c->x86_vendor == X86_VENDOR_AMD) {
481 if(c->x86 == 15) 606 if (c->x86 == 15 && banks > 4)
482 /* disable GART TBL walk error reporting, which trips off 607 /* disable GART TBL walk error reporting, which trips off
483 incorrectly with the IOMMU & 3ware & Cerberus. */ 608 incorrectly with the IOMMU & 3ware & Cerberus. */
484 clear_bit(10, &bank[4]); 609 clear_bit(10, (unsigned long *)&bank[4]);
485 if(c->x86 <= 17 && mce_bootlog < 0) 610 if(c->x86 <= 17 && mce_bootlog < 0)
486 /* Lots of broken BIOS around that don't clear them 611 /* Lots of broken BIOS around that don't clear them
487 by default and leave crap in there. Don't log. */ 612 by default and leave crap in there. Don't log. */
@@ -504,20 +629,38 @@ static void mce_cpu_features(struct cpuinfo_x86 *c)
504 } 629 }
505} 630}
506 631
632static void mce_init_timer(void)
633{
634 struct timer_list *t = &__get_cpu_var(mce_timer);
635
636 /* data race harmless because everyone sets to the same value */
637 if (!next_interval)
638 next_interval = check_interval * HZ;
639 if (!next_interval)
640 return;
641 setup_timer(t, mcheck_timer, smp_processor_id());
642 t->expires = round_jiffies(jiffies + next_interval);
643 add_timer(t);
644}
645
507/* 646/*
508 * Called for each booted CPU to set up machine checks. 647 * Called for each booted CPU to set up machine checks.
509 * Must be called with preempt off. 648 * Must be called with preempt off.
510 */ 649 */
511void __cpuinit mcheck_init(struct cpuinfo_x86 *c) 650void __cpuinit mcheck_init(struct cpuinfo_x86 *c)
512{ 651{
513 mce_cpu_quirks(c); 652 if (!mce_available(c))
653 return;
514 654
515 if (mce_dont_init || 655 if (mce_cap_init() < 0) {
516 !mce_available(c)) 656 mce_dont_init = 1;
517 return; 657 return;
658 }
659 mce_cpu_quirks(c);
518 660
519 mce_init(NULL); 661 mce_init(NULL);
520 mce_cpu_features(c); 662 mce_cpu_features(c);
663 mce_init_timer();
521} 664}
522 665
523/* 666/*
@@ -573,7 +716,7 @@ static ssize_t mce_read(struct file *filp, char __user *ubuf, size_t usize,
573{ 716{
574 unsigned long *cpu_tsc; 717 unsigned long *cpu_tsc;
575 static DEFINE_MUTEX(mce_read_mutex); 718 static DEFINE_MUTEX(mce_read_mutex);
576 unsigned next; 719 unsigned prev, next;
577 char __user *buf = ubuf; 720 char __user *buf = ubuf;
578 int i, err; 721 int i, err;
579 722
@@ -592,25 +735,32 @@ static ssize_t mce_read(struct file *filp, char __user *ubuf, size_t usize,
592 } 735 }
593 736
594 err = 0; 737 err = 0;
595 for (i = 0; i < next; i++) { 738 prev = 0;
596 unsigned long start = jiffies; 739 do {
597 740 for (i = prev; i < next; i++) {
598 while (!mcelog.entry[i].finished) { 741 unsigned long start = jiffies;
599 if (time_after_eq(jiffies, start + 2)) { 742
600 memset(mcelog.entry + i,0, sizeof(struct mce)); 743 while (!mcelog.entry[i].finished) {
601 goto timeout; 744 if (time_after_eq(jiffies, start + 2)) {
745 memset(mcelog.entry + i, 0,
746 sizeof(struct mce));
747 goto timeout;
748 }
749 cpu_relax();
602 } 750 }
603 cpu_relax(); 751 smp_rmb();
752 err |= copy_to_user(buf, mcelog.entry + i,
753 sizeof(struct mce));
754 buf += sizeof(struct mce);
755timeout:
756 ;
604 } 757 }
605 smp_rmb();
606 err |= copy_to_user(buf, mcelog.entry + i, sizeof(struct mce));
607 buf += sizeof(struct mce);
608 timeout:
609 ;
610 }
611 758
612 memset(mcelog.entry, 0, next * sizeof(struct mce)); 759 memset(mcelog.entry + prev, 0,
613 mcelog.next = 0; 760 (next - prev) * sizeof(struct mce));
761 prev = next;
762 next = cmpxchg(&mcelog.next, prev, 0);
763 } while (next != prev);
614 764
615 synchronize_sched(); 765 synchronize_sched();
616 766
@@ -680,20 +830,6 @@ static struct miscdevice mce_log_device = {
680 &mce_chrdev_ops, 830 &mce_chrdev_ops,
681}; 831};
682 832
683static unsigned long old_cr4 __initdata;
684
685void __init stop_mce(void)
686{
687 old_cr4 = read_cr4();
688 clear_in_cr4(X86_CR4_MCE);
689}
690
691void __init restart_mce(void)
692{
693 if (old_cr4 & X86_CR4_MCE)
694 set_in_cr4(X86_CR4_MCE);
695}
696
697/* 833/*
698 * Old style boot options parsing. Only for compatibility. 834 * Old style boot options parsing. Only for compatibility.
699 */ 835 */
@@ -703,8 +839,7 @@ static int __init mcheck_disable(char *str)
703 return 1; 839 return 1;
704} 840}
705 841
706/* mce=off disables machine check. Note you can re-enable it later 842/* mce=off disables machine check.
707 using sysfs.
708 mce=TOLERANCELEVEL (number, see above) 843 mce=TOLERANCELEVEL (number, see above)
709 mce=bootlog Log MCEs from before booting. Disabled by default on AMD. 844 mce=bootlog Log MCEs from before booting. Disabled by default on AMD.
710 mce=nobootlog Don't log MCEs from before booting. */ 845 mce=nobootlog Don't log MCEs from before booting. */
@@ -728,6 +863,29 @@ __setup("mce=", mcheck_enable);
728 * Sysfs support 863 * Sysfs support
729 */ 864 */
730 865
866/*
867 * Disable machine checks on suspend and shutdown. We can't really handle
868 * them later.
869 */
870static int mce_disable(void)
871{
872 int i;
873
874 for (i = 0; i < banks; i++)
875 wrmsrl(MSR_IA32_MC0_CTL + i*4, 0);
876 return 0;
877}
878
879static int mce_suspend(struct sys_device *dev, pm_message_t state)
880{
881 return mce_disable();
882}
883
884static int mce_shutdown(struct sys_device *dev)
885{
886 return mce_disable();
887}
888
731/* On resume clear all MCE state. Don't want to see leftovers from the BIOS. 889/* On resume clear all MCE state. Don't want to see leftovers from the BIOS.
732 Only one CPU is active at this time, the others get readded later using 890 Only one CPU is active at this time, the others get readded later using
733 CPU hotplug. */ 891 CPU hotplug. */
@@ -738,20 +896,24 @@ static int mce_resume(struct sys_device *dev)
738 return 0; 896 return 0;
739} 897}
740 898
899static void mce_cpu_restart(void *data)
900{
901 del_timer_sync(&__get_cpu_var(mce_timer));
902 if (mce_available(&current_cpu_data))
903 mce_init(NULL);
904 mce_init_timer();
905}
906
741/* Reinit MCEs after user configuration changes */ 907/* Reinit MCEs after user configuration changes */
742static void mce_restart(void) 908static void mce_restart(void)
743{ 909{
744 if (next_interval)
745 cancel_delayed_work(&mcheck_work);
746 /* Timer race is harmless here */
747 on_each_cpu(mce_init, NULL, 1);
748 next_interval = check_interval * HZ; 910 next_interval = check_interval * HZ;
749 if (next_interval) 911 on_each_cpu(mce_cpu_restart, NULL, 1);
750 schedule_delayed_work(&mcheck_work,
751 round_jiffies_relative(next_interval));
752} 912}
753 913
754static struct sysdev_class mce_sysclass = { 914static struct sysdev_class mce_sysclass = {
915 .suspend = mce_suspend,
916 .shutdown = mce_shutdown,
755 .resume = mce_resume, 917 .resume = mce_resume,
756 .name = "machinecheck", 918 .name = "machinecheck",
757}; 919};
@@ -778,16 +940,26 @@ void (*threshold_cpu_callback)(unsigned long action, unsigned int cpu) __cpuinit
778 } \ 940 } \
779 static SYSDEV_ATTR(name, 0644, show_ ## name, set_ ## name); 941 static SYSDEV_ATTR(name, 0644, show_ ## name, set_ ## name);
780 942
781/* 943static struct sysdev_attribute *bank_attrs;
782 * TBD should generate these dynamically based on number of available banks. 944
783 * Have only 6 contol banks in /sysfs until then. 945static ssize_t show_bank(struct sys_device *s, struct sysdev_attribute *attr,
784 */ 946 char *buf)
785ACCESSOR(bank0ctl,bank[0],mce_restart()) 947{
786ACCESSOR(bank1ctl,bank[1],mce_restart()) 948 u64 b = bank[attr - bank_attrs];
787ACCESSOR(bank2ctl,bank[2],mce_restart()) 949 return sprintf(buf, "%llx\n", b);
788ACCESSOR(bank3ctl,bank[3],mce_restart()) 950}
789ACCESSOR(bank4ctl,bank[4],mce_restart()) 951
790ACCESSOR(bank5ctl,bank[5],mce_restart()) 952static ssize_t set_bank(struct sys_device *s, struct sysdev_attribute *attr,
953 const char *buf, size_t siz)
954{
955 char *end;
956 u64 new = simple_strtoull(buf, &end, 0);
957 if (end == buf)
958 return -EINVAL;
959 bank[attr - bank_attrs] = new;
960 mce_restart();
961 return end-buf;
962}
791 963
792static ssize_t show_trigger(struct sys_device *s, struct sysdev_attribute *attr, 964static ssize_t show_trigger(struct sys_device *s, struct sysdev_attribute *attr,
793 char *buf) 965 char *buf)
@@ -814,8 +986,6 @@ static SYSDEV_ATTR(trigger, 0644, show_trigger, set_trigger);
814static SYSDEV_INT_ATTR(tolerant, 0644, tolerant); 986static SYSDEV_INT_ATTR(tolerant, 0644, tolerant);
815ACCESSOR(check_interval,check_interval,mce_restart()) 987ACCESSOR(check_interval,check_interval,mce_restart())
816static struct sysdev_attribute *mce_attributes[] = { 988static struct sysdev_attribute *mce_attributes[] = {
817 &attr_bank0ctl, &attr_bank1ctl, &attr_bank2ctl,
818 &attr_bank3ctl, &attr_bank4ctl, &attr_bank5ctl,
819 &attr_tolerant.attr, &attr_check_interval, &attr_trigger, 989 &attr_tolerant.attr, &attr_check_interval, &attr_trigger,
820 NULL 990 NULL
821}; 991};
@@ -845,11 +1015,22 @@ static __cpuinit int mce_create_device(unsigned int cpu)
845 if (err) 1015 if (err)
846 goto error; 1016 goto error;
847 } 1017 }
1018 for (i = 0; i < banks; i++) {
1019 err = sysdev_create_file(&per_cpu(device_mce, cpu),
1020 &bank_attrs[i]);
1021 if (err)
1022 goto error2;
1023 }
848 cpu_set(cpu, mce_device_initialized); 1024 cpu_set(cpu, mce_device_initialized);
849 1025
850 return 0; 1026 return 0;
1027error2:
1028 while (--i >= 0) {
1029 sysdev_remove_file(&per_cpu(device_mce, cpu),
1030 &bank_attrs[i]);
1031 }
851error: 1032error:
852 while (i--) { 1033 while (--i >= 0) {
853 sysdev_remove_file(&per_cpu(device_mce,cpu), 1034 sysdev_remove_file(&per_cpu(device_mce,cpu),
854 mce_attributes[i]); 1035 mce_attributes[i]);
855 } 1036 }
@@ -868,15 +1049,46 @@ static __cpuinit void mce_remove_device(unsigned int cpu)
868 for (i = 0; mce_attributes[i]; i++) 1049 for (i = 0; mce_attributes[i]; i++)
869 sysdev_remove_file(&per_cpu(device_mce,cpu), 1050 sysdev_remove_file(&per_cpu(device_mce,cpu),
870 mce_attributes[i]); 1051 mce_attributes[i]);
1052 for (i = 0; i < banks; i++)
1053 sysdev_remove_file(&per_cpu(device_mce, cpu),
1054 &bank_attrs[i]);
871 sysdev_unregister(&per_cpu(device_mce,cpu)); 1055 sysdev_unregister(&per_cpu(device_mce,cpu));
872 cpu_clear(cpu, mce_device_initialized); 1056 cpu_clear(cpu, mce_device_initialized);
873} 1057}
874 1058
1059/* Make sure there are no machine checks on offlined CPUs. */
1060static void mce_disable_cpu(void *h)
1061{
1062 int i;
1063 unsigned long action = *(unsigned long *)h;
1064
1065 if (!mce_available(&current_cpu_data))
1066 return;
1067 if (!(action & CPU_TASKS_FROZEN))
1068 cmci_clear();
1069 for (i = 0; i < banks; i++)
1070 wrmsrl(MSR_IA32_MC0_CTL + i*4, 0);
1071}
1072
1073static void mce_reenable_cpu(void *h)
1074{
1075 int i;
1076 unsigned long action = *(unsigned long *)h;
1077
1078 if (!mce_available(&current_cpu_data))
1079 return;
1080 if (!(action & CPU_TASKS_FROZEN))
1081 cmci_reenable();
1082 for (i = 0; i < banks; i++)
1083 wrmsrl(MSR_IA32_MC0_CTL + i*4, bank[i]);
1084}
1085
875/* Get notified when a cpu comes on/off. Be hotplug friendly. */ 1086/* Get notified when a cpu comes on/off. Be hotplug friendly. */
876static int __cpuinit mce_cpu_callback(struct notifier_block *nfb, 1087static int __cpuinit mce_cpu_callback(struct notifier_block *nfb,
877 unsigned long action, void *hcpu) 1088 unsigned long action, void *hcpu)
878{ 1089{
879 unsigned int cpu = (unsigned long)hcpu; 1090 unsigned int cpu = (unsigned long)hcpu;
1091 struct timer_list *t = &per_cpu(mce_timer, cpu);
880 1092
881 switch (action) { 1093 switch (action) {
882 case CPU_ONLINE: 1094 case CPU_ONLINE:
@@ -891,6 +1103,21 @@ static int __cpuinit mce_cpu_callback(struct notifier_block *nfb,
891 threshold_cpu_callback(action, cpu); 1103 threshold_cpu_callback(action, cpu);
892 mce_remove_device(cpu); 1104 mce_remove_device(cpu);
893 break; 1105 break;
1106 case CPU_DOWN_PREPARE:
1107 case CPU_DOWN_PREPARE_FROZEN:
1108 del_timer_sync(t);
1109 smp_call_function_single(cpu, mce_disable_cpu, &action, 1);
1110 break;
1111 case CPU_DOWN_FAILED:
1112 case CPU_DOWN_FAILED_FROZEN:
1113 t->expires = round_jiffies(jiffies + next_interval);
1114 add_timer_on(t, cpu);
1115 smp_call_function_single(cpu, mce_reenable_cpu, &action, 1);
1116 break;
1117 case CPU_POST_DEAD:
1118 /* intentionally ignoring frozen here */
1119 cmci_rediscover(cpu);
1120 break;
894 } 1121 }
895 return NOTIFY_OK; 1122 return NOTIFY_OK;
896} 1123}
@@ -899,6 +1126,34 @@ static struct notifier_block mce_cpu_notifier __cpuinitdata = {
899 .notifier_call = mce_cpu_callback, 1126 .notifier_call = mce_cpu_callback,
900}; 1127};
901 1128
1129static __init int mce_init_banks(void)
1130{
1131 int i;
1132
1133 bank_attrs = kzalloc(sizeof(struct sysdev_attribute) * banks,
1134 GFP_KERNEL);
1135 if (!bank_attrs)
1136 return -ENOMEM;
1137
1138 for (i = 0; i < banks; i++) {
1139 struct sysdev_attribute *a = &bank_attrs[i];
1140 a->attr.name = kasprintf(GFP_KERNEL, "bank%d", i);
1141 if (!a->attr.name)
1142 goto nomem;
1143 a->attr.mode = 0644;
1144 a->show = show_bank;
1145 a->store = set_bank;
1146 }
1147 return 0;
1148
1149nomem:
1150 while (--i >= 0)
1151 kfree(bank_attrs[i].attr.name);
1152 kfree(bank_attrs);
1153 bank_attrs = NULL;
1154 return -ENOMEM;
1155}
1156
902static __init int mce_init_device(void) 1157static __init int mce_init_device(void)
903{ 1158{
904 int err; 1159 int err;
@@ -906,6 +1161,11 @@ static __init int mce_init_device(void)
906 1161
907 if (!mce_available(&boot_cpu_data)) 1162 if (!mce_available(&boot_cpu_data))
908 return -EIO; 1163 return -EIO;
1164
1165 err = mce_init_banks();
1166 if (err)
1167 return err;
1168
909 err = sysdev_class_register(&mce_sysclass); 1169 err = sysdev_class_register(&mce_sysclass);
910 if (err) 1170 if (err)
911 return err; 1171 return err;
diff --git a/arch/x86/kernel/cpu/mcheck/mce_amd_64.c b/arch/x86/kernel/cpu/mcheck/mce_amd_64.c
index 9817506dd469..7d01be868870 100644
--- a/arch/x86/kernel/cpu/mcheck/mce_amd_64.c
+++ b/arch/x86/kernel/cpu/mcheck/mce_amd_64.c
@@ -79,6 +79,8 @@ static unsigned char shared_bank[NR_BANKS] = {
79 79
80static DEFINE_PER_CPU(unsigned char, bank_map); /* see which banks are on */ 80static DEFINE_PER_CPU(unsigned char, bank_map); /* see which banks are on */
81 81
82static void amd_threshold_interrupt(void);
83
82/* 84/*
83 * CPU Initialization 85 * CPU Initialization
84 */ 86 */
@@ -90,7 +92,8 @@ struct thresh_restart {
90}; 92};
91 93
92/* must be called with correct cpu affinity */ 94/* must be called with correct cpu affinity */
93static long threshold_restart_bank(void *_tr) 95/* Called via smp_call_function_single() */
96static void threshold_restart_bank(void *_tr)
94{ 97{
95 struct thresh_restart *tr = _tr; 98 struct thresh_restart *tr = _tr;
96 u32 mci_misc_hi, mci_misc_lo; 99 u32 mci_misc_hi, mci_misc_lo;
@@ -117,7 +120,6 @@ static long threshold_restart_bank(void *_tr)
117 120
118 mci_misc_hi |= MASK_COUNT_EN_HI; 121 mci_misc_hi |= MASK_COUNT_EN_HI;
119 wrmsr(tr->b->address, mci_misc_lo, mci_misc_hi); 122 wrmsr(tr->b->address, mci_misc_lo, mci_misc_hi);
120 return 0;
121} 123}
122 124
123/* cpu init entry point, called from mce.c with preempt off */ 125/* cpu init entry point, called from mce.c with preempt off */
@@ -174,6 +176,8 @@ void mce_amd_feature_init(struct cpuinfo_x86 *c)
174 tr.reset = 0; 176 tr.reset = 0;
175 tr.old_limit = 0; 177 tr.old_limit = 0;
176 threshold_restart_bank(&tr); 178 threshold_restart_bank(&tr);
179
180 mce_threshold_vector = amd_threshold_interrupt;
177 } 181 }
178 } 182 }
179} 183}
@@ -187,19 +191,13 @@ void mce_amd_feature_init(struct cpuinfo_x86 *c)
187 * the interrupt goes off when error_count reaches threshold_limit. 191 * the interrupt goes off when error_count reaches threshold_limit.
188 * the handler will simply log mcelog w/ software defined bank number. 192 * the handler will simply log mcelog w/ software defined bank number.
189 */ 193 */
190asmlinkage void mce_threshold_interrupt(void) 194static void amd_threshold_interrupt(void)
191{ 195{
192 unsigned int bank, block; 196 unsigned int bank, block;
193 struct mce m; 197 struct mce m;
194 u32 low = 0, high = 0, address = 0; 198 u32 low = 0, high = 0, address = 0;
195 199
196 ack_APIC_irq(); 200 mce_setup(&m);
197 exit_idle();
198 irq_enter();
199
200 memset(&m, 0, sizeof(m));
201 rdtscll(m.tsc);
202 m.cpu = smp_processor_id();
203 201
204 /* assume first bank caused it */ 202 /* assume first bank caused it */
205 for (bank = 0; bank < NR_BANKS; ++bank) { 203 for (bank = 0; bank < NR_BANKS; ++bank) {
@@ -233,7 +231,8 @@ asmlinkage void mce_threshold_interrupt(void)
233 231
234 /* Log the machine check that caused the threshold 232 /* Log the machine check that caused the threshold
235 event. */ 233 event. */
236 do_machine_check(NULL, 0); 234 machine_check_poll(MCP_TIMESTAMP,
235 &__get_cpu_var(mce_poll_banks));
237 236
238 if (high & MASK_OVERFLOW_HI) { 237 if (high & MASK_OVERFLOW_HI) {
239 rdmsrl(address, m.misc); 238 rdmsrl(address, m.misc);
@@ -243,13 +242,10 @@ asmlinkage void mce_threshold_interrupt(void)
243 + bank * NR_BLOCKS 242 + bank * NR_BLOCKS
244 + block; 243 + block;
245 mce_log(&m); 244 mce_log(&m);
246 goto out; 245 return;
247 } 246 }
248 } 247 }
249 } 248 }
250out:
251 inc_irq_stat(irq_threshold_count);
252 irq_exit();
253} 249}
254 250
255/* 251/*
@@ -283,7 +279,7 @@ static ssize_t store_interrupt_enable(struct threshold_block *b,
283 tr.b = b; 279 tr.b = b;
284 tr.reset = 0; 280 tr.reset = 0;
285 tr.old_limit = 0; 281 tr.old_limit = 0;
286 work_on_cpu(b->cpu, threshold_restart_bank, &tr); 282 smp_call_function_single(b->cpu, threshold_restart_bank, &tr, 1);
287 283
288 return end - buf; 284 return end - buf;
289} 285}
@@ -305,23 +301,32 @@ static ssize_t store_threshold_limit(struct threshold_block *b,
305 tr.b = b; 301 tr.b = b;
306 tr.reset = 0; 302 tr.reset = 0;
307 303
308 work_on_cpu(b->cpu, threshold_restart_bank, &tr); 304 smp_call_function_single(b->cpu, threshold_restart_bank, &tr, 1);
309 305
310 return end - buf; 306 return end - buf;
311} 307}
312 308
313static long local_error_count(void *_b) 309struct threshold_block_cross_cpu {
310 struct threshold_block *tb;
311 long retval;
312};
313
314static void local_error_count_handler(void *_tbcc)
314{ 315{
315 struct threshold_block *b = _b; 316 struct threshold_block_cross_cpu *tbcc = _tbcc;
317 struct threshold_block *b = tbcc->tb;
316 u32 low, high; 318 u32 low, high;
317 319
318 rdmsr(b->address, low, high); 320 rdmsr(b->address, low, high);
319 return (high & 0xFFF) - (THRESHOLD_MAX - b->threshold_limit); 321 tbcc->retval = (high & 0xFFF) - (THRESHOLD_MAX - b->threshold_limit);
320} 322}
321 323
322static ssize_t show_error_count(struct threshold_block *b, char *buf) 324static ssize_t show_error_count(struct threshold_block *b, char *buf)
323{ 325{
324 return sprintf(buf, "%lx\n", work_on_cpu(b->cpu, local_error_count, b)); 326 struct threshold_block_cross_cpu tbcc = { .tb = b, };
327
328 smp_call_function_single(b->cpu, local_error_count_handler, &tbcc, 1);
329 return sprintf(buf, "%lx\n", tbcc.retval);
325} 330}
326 331
327static ssize_t store_error_count(struct threshold_block *b, 332static ssize_t store_error_count(struct threshold_block *b,
@@ -329,7 +334,7 @@ static ssize_t store_error_count(struct threshold_block *b,
329{ 334{
330 struct thresh_restart tr = { .b = b, .reset = 1, .old_limit = 0 }; 335 struct thresh_restart tr = { .b = b, .reset = 1, .old_limit = 0 };
331 336
332 work_on_cpu(b->cpu, threshold_restart_bank, &tr); 337 smp_call_function_single(b->cpu, threshold_restart_bank, &tr, 1);
333 return 1; 338 return 1;
334} 339}
335 340
@@ -398,7 +403,7 @@ static __cpuinit int allocate_threshold_blocks(unsigned int cpu,
398 if ((bank >= NR_BANKS) || (block >= NR_BLOCKS)) 403 if ((bank >= NR_BANKS) || (block >= NR_BLOCKS))
399 return 0; 404 return 0;
400 405
401 if (rdmsr_safe(address, &low, &high)) 406 if (rdmsr_safe_on_cpu(cpu, address, &low, &high))
402 return 0; 407 return 0;
403 408
404 if (!(high & MASK_VALID_HI)) { 409 if (!(high & MASK_VALID_HI)) {
@@ -462,12 +467,11 @@ out_free:
462 return err; 467 return err;
463} 468}
464 469
465static __cpuinit long local_allocate_threshold_blocks(void *_bank) 470static __cpuinit long
471local_allocate_threshold_blocks(int cpu, unsigned int bank)
466{ 472{
467 unsigned int *bank = _bank; 473 return allocate_threshold_blocks(cpu, bank, 0,
468 474 MSR_IA32_MC0_MISC + bank * 4);
469 return allocate_threshold_blocks(smp_processor_id(), *bank, 0,
470 MSR_IA32_MC0_MISC + *bank * 4);
471} 475}
472 476
473/* symlinks sibling shared banks to first core. first core owns dir/files. */ 477/* symlinks sibling shared banks to first core. first core owns dir/files. */
@@ -530,7 +534,7 @@ static __cpuinit int threshold_create_bank(unsigned int cpu, unsigned int bank)
530 534
531 per_cpu(threshold_banks, cpu)[bank] = b; 535 per_cpu(threshold_banks, cpu)[bank] = b;
532 536
533 err = work_on_cpu(cpu, local_allocate_threshold_blocks, &bank); 537 err = local_allocate_threshold_blocks(cpu, bank);
534 if (err) 538 if (err)
535 goto out_free; 539 goto out_free;
536 540
diff --git a/arch/x86/kernel/cpu/mcheck/mce_intel_64.c b/arch/x86/kernel/cpu/mcheck/mce_intel_64.c
index aa5e287c98e0..57df3d383470 100644
--- a/arch/x86/kernel/cpu/mcheck/mce_intel_64.c
+++ b/arch/x86/kernel/cpu/mcheck/mce_intel_64.c
@@ -1,6 +1,8 @@
1/* 1/*
2 * Intel specific MCE features. 2 * Intel specific MCE features.
3 * Copyright 2004 Zwane Mwaikambo <zwane@linuxpower.ca> 3 * Copyright 2004 Zwane Mwaikambo <zwane@linuxpower.ca>
4 * Copyright (C) 2008, 2009 Intel Corporation
5 * Author: Andi Kleen
4 */ 6 */
5 7
6#include <linux/init.h> 8#include <linux/init.h>
@@ -13,6 +15,7 @@
13#include <asm/hw_irq.h> 15#include <asm/hw_irq.h>
14#include <asm/idle.h> 16#include <asm/idle.h>
15#include <asm/therm_throt.h> 17#include <asm/therm_throt.h>
18#include <asm/apic.h>
16 19
17asmlinkage void smp_thermal_interrupt(void) 20asmlinkage void smp_thermal_interrupt(void)
18{ 21{
@@ -25,7 +28,7 @@ asmlinkage void smp_thermal_interrupt(void)
25 28
26 rdmsrl(MSR_IA32_THERM_STATUS, msr_val); 29 rdmsrl(MSR_IA32_THERM_STATUS, msr_val);
27 if (therm_throt_process(msr_val & 1)) 30 if (therm_throt_process(msr_val & 1))
28 mce_log_therm_throt_event(smp_processor_id(), msr_val); 31 mce_log_therm_throt_event(msr_val);
29 32
30 inc_irq_stat(irq_thermal_count); 33 inc_irq_stat(irq_thermal_count);
31 irq_exit(); 34 irq_exit();
@@ -85,7 +88,209 @@ static void intel_init_thermal(struct cpuinfo_x86 *c)
85 return; 88 return;
86} 89}
87 90
91/*
92 * Support for Intel Correct Machine Check Interrupts. This allows
93 * the CPU to raise an interrupt when a corrected machine check happened.
94 * Normally we pick those up using a regular polling timer.
95 * Also supports reliable discovery of shared banks.
96 */
97
98static DEFINE_PER_CPU(mce_banks_t, mce_banks_owned);
99
100/*
101 * cmci_discover_lock protects against parallel discovery attempts
102 * which could race against each other.
103 */
104static DEFINE_SPINLOCK(cmci_discover_lock);
105
106#define CMCI_THRESHOLD 1
107
108static int cmci_supported(int *banks)
109{
110 u64 cap;
111
112 /*
113 * Vendor check is not strictly needed, but the initial
114 * initialization is vendor keyed and this
115 * makes sure none of the backdoors are entered otherwise.
116 */
117 if (boot_cpu_data.x86_vendor != X86_VENDOR_INTEL)
118 return 0;
119 if (!cpu_has_apic || lapic_get_maxlvt() < 6)
120 return 0;
121 rdmsrl(MSR_IA32_MCG_CAP, cap);
122 *banks = min_t(unsigned, MAX_NR_BANKS, cap & 0xff);
123 return !!(cap & MCG_CMCI_P);
124}
125
126/*
127 * The interrupt handler. This is called on every event.
128 * Just call the poller directly to log any events.
129 * This could in theory increase the threshold under high load,
130 * but doesn't for now.
131 */
132static void intel_threshold_interrupt(void)
133{
134 machine_check_poll(MCP_TIMESTAMP, &__get_cpu_var(mce_banks_owned));
135 mce_notify_user();
136}
137
138static void print_update(char *type, int *hdr, int num)
139{
140 if (*hdr == 0)
141 printk(KERN_INFO "CPU %d MCA banks", smp_processor_id());
142 *hdr = 1;
143 printk(KERN_CONT " %s:%d", type, num);
144}
145
146/*
147 * Enable CMCI (Corrected Machine Check Interrupt) for available MCE banks
148 * on this CPU. Use the algorithm recommended in the SDM to discover shared
149 * banks.
150 */
151static void cmci_discover(int banks, int boot)
152{
153 unsigned long *owned = (void *)&__get_cpu_var(mce_banks_owned);
154 int hdr = 0;
155 int i;
156
157 spin_lock(&cmci_discover_lock);
158 for (i = 0; i < banks; i++) {
159 u64 val;
160
161 if (test_bit(i, owned))
162 continue;
163
164 rdmsrl(MSR_IA32_MC0_CTL2 + i, val);
165
166 /* Already owned by someone else? */
167 if (val & CMCI_EN) {
168 if (test_and_clear_bit(i, owned) || boot)
169 print_update("SHD", &hdr, i);
170 __clear_bit(i, __get_cpu_var(mce_poll_banks));
171 continue;
172 }
173
174 val |= CMCI_EN | CMCI_THRESHOLD;
175 wrmsrl(MSR_IA32_MC0_CTL2 + i, val);
176 rdmsrl(MSR_IA32_MC0_CTL2 + i, val);
177
178 /* Did the enable bit stick? -- the bank supports CMCI */
179 if (val & CMCI_EN) {
180 if (!test_and_set_bit(i, owned) || boot)
181 print_update("CMCI", &hdr, i);
182 __clear_bit(i, __get_cpu_var(mce_poll_banks));
183 } else {
184 WARN_ON(!test_bit(i, __get_cpu_var(mce_poll_banks)));
185 }
186 }
187 spin_unlock(&cmci_discover_lock);
188 if (hdr)
189 printk(KERN_CONT "\n");
190}
191
192/*
193 * Just in case we missed an event during initialization check
194 * all the CMCI owned banks.
195 */
196void cmci_recheck(void)
197{
198 unsigned long flags;
199 int banks;
200
201 if (!mce_available(&current_cpu_data) || !cmci_supported(&banks))
202 return;
203 local_irq_save(flags);
204 machine_check_poll(MCP_TIMESTAMP, &__get_cpu_var(mce_banks_owned));
205 local_irq_restore(flags);
206}
207
208/*
209 * Disable CMCI on this CPU for all banks it owns when it goes down.
210 * This allows other CPUs to claim the banks on rediscovery.
211 */
212void cmci_clear(void)
213{
214 int i;
215 int banks;
216 u64 val;
217
218 if (!cmci_supported(&banks))
219 return;
220 spin_lock(&cmci_discover_lock);
221 for (i = 0; i < banks; i++) {
222 if (!test_bit(i, __get_cpu_var(mce_banks_owned)))
223 continue;
224 /* Disable CMCI */
225 rdmsrl(MSR_IA32_MC0_CTL2 + i, val);
226 val &= ~(CMCI_EN|CMCI_THRESHOLD_MASK);
227 wrmsrl(MSR_IA32_MC0_CTL2 + i, val);
228 __clear_bit(i, __get_cpu_var(mce_banks_owned));
229 }
230 spin_unlock(&cmci_discover_lock);
231}
232
233/*
234 * After a CPU went down cycle through all the others and rediscover
235 * Must run in process context.
236 */
237void cmci_rediscover(int dying)
238{
239 int banks;
240 int cpu;
241 cpumask_var_t old;
242
243 if (!cmci_supported(&banks))
244 return;
245 if (!alloc_cpumask_var(&old, GFP_KERNEL))
246 return;
247 cpumask_copy(old, &current->cpus_allowed);
248
249 for_each_online_cpu (cpu) {
250 if (cpu == dying)
251 continue;
252 if (set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu)))
253 continue;
254 /* Recheck banks in case CPUs don't all have the same */
255 if (cmci_supported(&banks))
256 cmci_discover(banks, 0);
257 }
258
259 set_cpus_allowed_ptr(current, old);
260 free_cpumask_var(old);
261}
262
263/*
264 * Reenable CMCI on this CPU in case a CPU down failed.
265 */
266void cmci_reenable(void)
267{
268 int banks;
269 if (cmci_supported(&banks))
270 cmci_discover(banks, 0);
271}
272
273static void intel_init_cmci(void)
274{
275 int banks;
276
277 if (!cmci_supported(&banks))
278 return;
279
280 mce_threshold_vector = intel_threshold_interrupt;
281 cmci_discover(banks, 1);
282 /*
283 * For CPU #0 this runs with still disabled APIC, but that's
284 * ok because only the vector is set up. We still do another
285 * check for the banks later for CPU #0 just to make sure
286 * to not miss any events.
287 */
288 apic_write(APIC_LVTCMCI, THRESHOLD_APIC_VECTOR|APIC_DM_FIXED);
289 cmci_recheck();
290}
291
88void mce_intel_feature_init(struct cpuinfo_x86 *c) 292void mce_intel_feature_init(struct cpuinfo_x86 *c)
89{ 293{
90 intel_init_thermal(c); 294 intel_init_thermal(c);
295 intel_init_cmci();
91} 296}
diff --git a/arch/x86/kernel/cpu/mcheck/threshold.c b/arch/x86/kernel/cpu/mcheck/threshold.c
new file mode 100644
index 000000000000..23ee9e730f78
--- /dev/null
+++ b/arch/x86/kernel/cpu/mcheck/threshold.c
@@ -0,0 +1,29 @@
1/*
2 * Common corrected MCE threshold handler code:
3 */
4#include <linux/interrupt.h>
5#include <linux/kernel.h>
6
7#include <asm/irq_vectors.h>
8#include <asm/apic.h>
9#include <asm/idle.h>
10#include <asm/mce.h>
11
12static void default_threshold_interrupt(void)
13{
14 printk(KERN_ERR "Unexpected threshold interrupt at vector %x\n",
15 THRESHOLD_APIC_VECTOR);
16}
17
18void (*mce_threshold_vector)(void) = default_threshold_interrupt;
19
20asmlinkage void mce_threshold_interrupt(void)
21{
22 exit_idle();
23 irq_enter();
24 inc_irq_stat(irq_threshold_count);
25 mce_threshold_vector();
26 irq_exit();
27 /* Ack only at the end to avoid potential reentry */
28 ack_APIC_irq();
29}
diff --git a/arch/x86/kernel/cpu/mtrr/Makefile b/arch/x86/kernel/cpu/mtrr/Makefile
index 191fc0533649..f4361b56f8e9 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 1obj-y := main.o if.o generic.o state.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/cleanup.c b/arch/x86/kernel/cpu/mtrr/cleanup.c
new file mode 100644
index 000000000000..ce0fe4b5c04f
--- /dev/null
+++ b/arch/x86/kernel/cpu/mtrr/cleanup.c
@@ -0,0 +1,1101 @@
1/* MTRR (Memory Type Range Register) cleanup
2
3 Copyright (C) 2009 Yinghai Lu
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public
16 License along with this library; if not, write to the Free
17 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18*/
19
20#include <linux/module.h>
21#include <linux/init.h>
22#include <linux/pci.h>
23#include <linux/smp.h>
24#include <linux/cpu.h>
25#include <linux/mutex.h>
26#include <linux/sort.h>
27
28#include <asm/e820.h>
29#include <asm/mtrr.h>
30#include <asm/uaccess.h>
31#include <asm/processor.h>
32#include <asm/msr.h>
33#include <asm/kvm_para.h>
34#include "mtrr.h"
35
36/* should be related to MTRR_VAR_RANGES nums */
37#define RANGE_NUM 256
38
39struct res_range {
40 unsigned long start;
41 unsigned long end;
42};
43
44static int __init
45add_range(struct res_range *range, int nr_range, unsigned long start,
46 unsigned long end)
47{
48 /* out of slots */
49 if (nr_range >= RANGE_NUM)
50 return nr_range;
51
52 range[nr_range].start = start;
53 range[nr_range].end = end;
54
55 nr_range++;
56
57 return nr_range;
58}
59
60static int __init
61add_range_with_merge(struct res_range *range, int nr_range, unsigned long start,
62 unsigned long end)
63{
64 int i;
65
66 /* try to merge it with old one */
67 for (i = 0; i < nr_range; i++) {
68 unsigned long final_start, final_end;
69 unsigned long common_start, common_end;
70
71 if (!range[i].end)
72 continue;
73
74 common_start = max(range[i].start, start);
75 common_end = min(range[i].end, end);
76 if (common_start > common_end + 1)
77 continue;
78
79 final_start = min(range[i].start, start);
80 final_end = max(range[i].end, end);
81
82 range[i].start = final_start;
83 range[i].end = final_end;
84 return nr_range;
85 }
86
87 /* need to add that */
88 return add_range(range, nr_range, start, end);
89}
90
91static void __init
92subtract_range(struct res_range *range, unsigned long start, unsigned long end)
93{
94 int i, j;
95
96 for (j = 0; j < RANGE_NUM; j++) {
97 if (!range[j].end)
98 continue;
99
100 if (start <= range[j].start && end >= range[j].end) {
101 range[j].start = 0;
102 range[j].end = 0;
103 continue;
104 }
105
106 if (start <= range[j].start && end < range[j].end &&
107 range[j].start < end + 1) {
108 range[j].start = end + 1;
109 continue;
110 }
111
112
113 if (start > range[j].start && end >= range[j].end &&
114 range[j].end > start - 1) {
115 range[j].end = start - 1;
116 continue;
117 }
118
119 if (start > range[j].start && end < range[j].end) {
120 /* find the new spare */
121 for (i = 0; i < RANGE_NUM; i++) {
122 if (range[i].end == 0)
123 break;
124 }
125 if (i < RANGE_NUM) {
126 range[i].end = range[j].end;
127 range[i].start = end + 1;
128 } else {
129 printk(KERN_ERR "run of slot in ranges\n");
130 }
131 range[j].end = start - 1;
132 continue;
133 }
134 }
135}
136
137static int __init cmp_range(const void *x1, const void *x2)
138{
139 const struct res_range *r1 = x1;
140 const struct res_range *r2 = x2;
141 long start1, start2;
142
143 start1 = r1->start;
144 start2 = r2->start;
145
146 return start1 - start2;
147}
148
149struct var_mtrr_range_state {
150 unsigned long base_pfn;
151 unsigned long size_pfn;
152 mtrr_type type;
153};
154
155static struct var_mtrr_range_state __initdata range_state[RANGE_NUM];
156static int __initdata debug_print;
157
158static int __init
159x86_get_mtrr_mem_range(struct res_range *range, int nr_range,
160 unsigned long extra_remove_base,
161 unsigned long extra_remove_size)
162{
163 unsigned long base, size;
164 mtrr_type type;
165 int i;
166
167 for (i = 0; i < num_var_ranges; i++) {
168 type = range_state[i].type;
169 if (type != MTRR_TYPE_WRBACK)
170 continue;
171 base = range_state[i].base_pfn;
172 size = range_state[i].size_pfn;
173 nr_range = add_range_with_merge(range, nr_range, base,
174 base + size - 1);
175 }
176 if (debug_print) {
177 printk(KERN_DEBUG "After WB checking\n");
178 for (i = 0; i < nr_range; i++)
179 printk(KERN_DEBUG "MTRR MAP PFN: %016lx - %016lx\n",
180 range[i].start, range[i].end + 1);
181 }
182
183 /* take out UC ranges */
184 for (i = 0; i < num_var_ranges; i++) {
185 type = range_state[i].type;
186 if (type != MTRR_TYPE_UNCACHABLE &&
187 type != MTRR_TYPE_WRPROT)
188 continue;
189 size = range_state[i].size_pfn;
190 if (!size)
191 continue;
192 base = range_state[i].base_pfn;
193 if (base < (1<<(20-PAGE_SHIFT)) && mtrr_state.have_fixed &&
194 (mtrr_state.enabled & 1)) {
195 /* Var MTRR contains UC entry below 1M? Skip it: */
196 printk(KERN_WARNING "WARNING: BIOS bug: VAR MTRR %d "
197 "contains strange UC entry under 1M, check "
198 "with your system vendor!\n", i);
199 if (base + size <= (1<<(20-PAGE_SHIFT)))
200 continue;
201 size -= (1<<(20-PAGE_SHIFT)) - base;
202 base = 1<<(20-PAGE_SHIFT);
203 }
204 subtract_range(range, base, base + size - 1);
205 }
206 if (extra_remove_size)
207 subtract_range(range, extra_remove_base,
208 extra_remove_base + extra_remove_size - 1);
209
210 /* get new range num */
211 nr_range = 0;
212 for (i = 0; i < RANGE_NUM; i++) {
213 if (!range[i].end)
214 continue;
215 nr_range++;
216 }
217 if (debug_print) {
218 printk(KERN_DEBUG "After UC checking\n");
219 for (i = 0; i < nr_range; i++)
220 printk(KERN_DEBUG "MTRR MAP PFN: %016lx - %016lx\n",
221 range[i].start, range[i].end + 1);
222 }
223
224 /* sort the ranges */
225 sort(range, nr_range, sizeof(struct res_range), cmp_range, NULL);
226 if (debug_print) {
227 printk(KERN_DEBUG "After sorting\n");
228 for (i = 0; i < nr_range; i++)
229 printk(KERN_DEBUG "MTRR MAP PFN: %016lx - %016lx\n",
230 range[i].start, range[i].end + 1);
231 }
232
233 /* clear those is not used */
234 for (i = nr_range; i < RANGE_NUM; i++)
235 memset(&range[i], 0, sizeof(range[i]));
236
237 return nr_range;
238}
239
240static struct res_range __initdata range[RANGE_NUM];
241static int __initdata nr_range;
242
243#ifdef CONFIG_MTRR_SANITIZER
244
245static unsigned long __init sum_ranges(struct res_range *range, int nr_range)
246{
247 unsigned long sum;
248 int i;
249
250 sum = 0;
251 for (i = 0; i < nr_range; i++)
252 sum += range[i].end + 1 - range[i].start;
253
254 return sum;
255}
256
257static int enable_mtrr_cleanup __initdata =
258 CONFIG_MTRR_SANITIZER_ENABLE_DEFAULT;
259
260static int __init disable_mtrr_cleanup_setup(char *str)
261{
262 enable_mtrr_cleanup = 0;
263 return 0;
264}
265early_param("disable_mtrr_cleanup", disable_mtrr_cleanup_setup);
266
267static int __init enable_mtrr_cleanup_setup(char *str)
268{
269 enable_mtrr_cleanup = 1;
270 return 0;
271}
272early_param("enable_mtrr_cleanup", enable_mtrr_cleanup_setup);
273
274static int __init mtrr_cleanup_debug_setup(char *str)
275{
276 debug_print = 1;
277 return 0;
278}
279early_param("mtrr_cleanup_debug", mtrr_cleanup_debug_setup);
280
281struct var_mtrr_state {
282 unsigned long range_startk;
283 unsigned long range_sizek;
284 unsigned long chunk_sizek;
285 unsigned long gran_sizek;
286 unsigned int reg;
287};
288
289static void __init
290set_var_mtrr(unsigned int reg, unsigned long basek, unsigned long sizek,
291 unsigned char type, unsigned int address_bits)
292{
293 u32 base_lo, base_hi, mask_lo, mask_hi;
294 u64 base, mask;
295
296 if (!sizek) {
297 fill_mtrr_var_range(reg, 0, 0, 0, 0);
298 return;
299 }
300
301 mask = (1ULL << address_bits) - 1;
302 mask &= ~((((u64)sizek) << 10) - 1);
303
304 base = ((u64)basek) << 10;
305
306 base |= type;
307 mask |= 0x800;
308
309 base_lo = base & ((1ULL<<32) - 1);
310 base_hi = base >> 32;
311
312 mask_lo = mask & ((1ULL<<32) - 1);
313 mask_hi = mask >> 32;
314
315 fill_mtrr_var_range(reg, base_lo, base_hi, mask_lo, mask_hi);
316}
317
318static void __init
319save_var_mtrr(unsigned int reg, unsigned long basek, unsigned long sizek,
320 unsigned char type)
321{
322 range_state[reg].base_pfn = basek >> (PAGE_SHIFT - 10);
323 range_state[reg].size_pfn = sizek >> (PAGE_SHIFT - 10);
324 range_state[reg].type = type;
325}
326
327static void __init
328set_var_mtrr_all(unsigned int address_bits)
329{
330 unsigned long basek, sizek;
331 unsigned char type;
332 unsigned int reg;
333
334 for (reg = 0; reg < num_var_ranges; reg++) {
335 basek = range_state[reg].base_pfn << (PAGE_SHIFT - 10);
336 sizek = range_state[reg].size_pfn << (PAGE_SHIFT - 10);
337 type = range_state[reg].type;
338
339 set_var_mtrr(reg, basek, sizek, type, address_bits);
340 }
341}
342
343static unsigned long to_size_factor(unsigned long sizek, char *factorp)
344{
345 char factor;
346 unsigned long base = sizek;
347
348 if (base & ((1<<10) - 1)) {
349 /* not MB alignment */
350 factor = 'K';
351 } else if (base & ((1<<20) - 1)) {
352 factor = 'M';
353 base >>= 10;
354 } else {
355 factor = 'G';
356 base >>= 20;
357 }
358
359 *factorp = factor;
360
361 return base;
362}
363
364static unsigned int __init
365range_to_mtrr(unsigned int reg, unsigned long range_startk,
366 unsigned long range_sizek, unsigned char type)
367{
368 if (!range_sizek || (reg >= num_var_ranges))
369 return reg;
370
371 while (range_sizek) {
372 unsigned long max_align, align;
373 unsigned long sizek;
374
375 /* Compute the maximum size I can make a range */
376 if (range_startk)
377 max_align = ffs(range_startk) - 1;
378 else
379 max_align = 32;
380 align = fls(range_sizek) - 1;
381 if (align > max_align)
382 align = max_align;
383
384 sizek = 1 << align;
385 if (debug_print) {
386 char start_factor = 'K', size_factor = 'K';
387 unsigned long start_base, size_base;
388
389 start_base = to_size_factor(range_startk,
390 &start_factor),
391 size_base = to_size_factor(sizek, &size_factor),
392
393 printk(KERN_DEBUG "Setting variable MTRR %d, "
394 "base: %ld%cB, range: %ld%cB, type %s\n",
395 reg, start_base, start_factor,
396 size_base, size_factor,
397 (type == MTRR_TYPE_UNCACHABLE) ? "UC" :
398 ((type == MTRR_TYPE_WRBACK) ? "WB" : "Other")
399 );
400 }
401 save_var_mtrr(reg++, range_startk, sizek, type);
402 range_startk += sizek;
403 range_sizek -= sizek;
404 if (reg >= num_var_ranges)
405 break;
406 }
407 return reg;
408}
409
410static unsigned __init
411range_to_mtrr_with_hole(struct var_mtrr_state *state, unsigned long basek,
412 unsigned long sizek)
413{
414 unsigned long hole_basek, hole_sizek;
415 unsigned long second_basek, second_sizek;
416 unsigned long range0_basek, range0_sizek;
417 unsigned long range_basek, range_sizek;
418 unsigned long chunk_sizek;
419 unsigned long gran_sizek;
420
421 hole_basek = 0;
422 hole_sizek = 0;
423 second_basek = 0;
424 second_sizek = 0;
425 chunk_sizek = state->chunk_sizek;
426 gran_sizek = state->gran_sizek;
427
428 /* align with gran size, prevent small block used up MTRRs */
429 range_basek = ALIGN(state->range_startk, gran_sizek);
430 if ((range_basek > basek) && basek)
431 return second_sizek;
432 state->range_sizek -= (range_basek - state->range_startk);
433 range_sizek = ALIGN(state->range_sizek, gran_sizek);
434
435 while (range_sizek > state->range_sizek) {
436 range_sizek -= gran_sizek;
437 if (!range_sizek)
438 return 0;
439 }
440 state->range_sizek = range_sizek;
441
442 /* try to append some small hole */
443 range0_basek = state->range_startk;
444 range0_sizek = ALIGN(state->range_sizek, chunk_sizek);
445
446 /* no increase */
447 if (range0_sizek == state->range_sizek) {
448 if (debug_print)
449 printk(KERN_DEBUG "rangeX: %016lx - %016lx\n",
450 range0_basek<<10,
451 (range0_basek + state->range_sizek)<<10);
452 state->reg = range_to_mtrr(state->reg, range0_basek,
453 state->range_sizek, MTRR_TYPE_WRBACK);
454 return 0;
455 }
456
457 /* only cut back, when it is not the last */
458 if (sizek) {
459 while (range0_basek + range0_sizek > (basek + sizek)) {
460 if (range0_sizek >= chunk_sizek)
461 range0_sizek -= chunk_sizek;
462 else
463 range0_sizek = 0;
464
465 if (!range0_sizek)
466 break;
467 }
468 }
469
470second_try:
471 range_basek = range0_basek + range0_sizek;
472
473 /* one hole in the middle */
474 if (range_basek > basek && range_basek <= (basek + sizek))
475 second_sizek = range_basek - basek;
476
477 if (range0_sizek > state->range_sizek) {
478
479 /* one hole in middle or at end */
480 hole_sizek = range0_sizek - state->range_sizek - second_sizek;
481
482 /* hole size should be less than half of range0 size */
483 if (hole_sizek >= (range0_sizek >> 1) &&
484 range0_sizek >= chunk_sizek) {
485 range0_sizek -= chunk_sizek;
486 second_sizek = 0;
487 hole_sizek = 0;
488
489 goto second_try;
490 }
491 }
492
493 if (range0_sizek) {
494 if (debug_print)
495 printk(KERN_DEBUG "range0: %016lx - %016lx\n",
496 range0_basek<<10,
497 (range0_basek + range0_sizek)<<10);
498 state->reg = range_to_mtrr(state->reg, range0_basek,
499 range0_sizek, MTRR_TYPE_WRBACK);
500 }
501
502 if (range0_sizek < state->range_sizek) {
503 /* need to handle left over */
504 range_sizek = state->range_sizek - range0_sizek;
505
506 if (debug_print)
507 printk(KERN_DEBUG "range: %016lx - %016lx\n",
508 range_basek<<10,
509 (range_basek + range_sizek)<<10);
510 state->reg = range_to_mtrr(state->reg, range_basek,
511 range_sizek, MTRR_TYPE_WRBACK);
512 }
513
514 if (hole_sizek) {
515 hole_basek = range_basek - hole_sizek - second_sizek;
516 if (debug_print)
517 printk(KERN_DEBUG "hole: %016lx - %016lx\n",
518 hole_basek<<10,
519 (hole_basek + hole_sizek)<<10);
520 state->reg = range_to_mtrr(state->reg, hole_basek,
521 hole_sizek, MTRR_TYPE_UNCACHABLE);
522 }
523
524 return second_sizek;
525}
526
527static void __init
528set_var_mtrr_range(struct var_mtrr_state *state, unsigned long base_pfn,
529 unsigned long size_pfn)
530{
531 unsigned long basek, sizek;
532 unsigned long second_sizek = 0;
533
534 if (state->reg >= num_var_ranges)
535 return;
536
537 basek = base_pfn << (PAGE_SHIFT - 10);
538 sizek = size_pfn << (PAGE_SHIFT - 10);
539
540 /* See if I can merge with the last range */
541 if ((basek <= 1024) ||
542 (state->range_startk + state->range_sizek == basek)) {
543 unsigned long endk = basek + sizek;
544 state->range_sizek = endk - state->range_startk;
545 return;
546 }
547 /* Write the range mtrrs */
548 if (state->range_sizek != 0)
549 second_sizek = range_to_mtrr_with_hole(state, basek, sizek);
550
551 /* Allocate an msr */
552 state->range_startk = basek + second_sizek;
553 state->range_sizek = sizek - second_sizek;
554}
555
556/* mininum size of mtrr block that can take hole */
557static u64 mtrr_chunk_size __initdata = (256ULL<<20);
558
559static int __init parse_mtrr_chunk_size_opt(char *p)
560{
561 if (!p)
562 return -EINVAL;
563 mtrr_chunk_size = memparse(p, &p);
564 return 0;
565}
566early_param("mtrr_chunk_size", parse_mtrr_chunk_size_opt);
567
568/* granity of mtrr of block */
569static u64 mtrr_gran_size __initdata;
570
571static int __init parse_mtrr_gran_size_opt(char *p)
572{
573 if (!p)
574 return -EINVAL;
575 mtrr_gran_size = memparse(p, &p);
576 return 0;
577}
578early_param("mtrr_gran_size", parse_mtrr_gran_size_opt);
579
580static int nr_mtrr_spare_reg __initdata =
581 CONFIG_MTRR_SANITIZER_SPARE_REG_NR_DEFAULT;
582
583static int __init parse_mtrr_spare_reg(char *arg)
584{
585 if (arg)
586 nr_mtrr_spare_reg = simple_strtoul(arg, NULL, 0);
587 return 0;
588}
589
590early_param("mtrr_spare_reg_nr", parse_mtrr_spare_reg);
591
592static int __init
593x86_setup_var_mtrrs(struct res_range *range, int nr_range,
594 u64 chunk_size, u64 gran_size)
595{
596 struct var_mtrr_state var_state;
597 int i;
598 int num_reg;
599
600 var_state.range_startk = 0;
601 var_state.range_sizek = 0;
602 var_state.reg = 0;
603 var_state.chunk_sizek = chunk_size >> 10;
604 var_state.gran_sizek = gran_size >> 10;
605
606 memset(range_state, 0, sizeof(range_state));
607
608 /* Write the range etc */
609 for (i = 0; i < nr_range; i++)
610 set_var_mtrr_range(&var_state, range[i].start,
611 range[i].end - range[i].start + 1);
612
613 /* Write the last range */
614 if (var_state.range_sizek != 0)
615 range_to_mtrr_with_hole(&var_state, 0, 0);
616
617 num_reg = var_state.reg;
618 /* Clear out the extra MTRR's */
619 while (var_state.reg < num_var_ranges) {
620 save_var_mtrr(var_state.reg, 0, 0, 0);
621 var_state.reg++;
622 }
623
624 return num_reg;
625}
626
627struct mtrr_cleanup_result {
628 unsigned long gran_sizek;
629 unsigned long chunk_sizek;
630 unsigned long lose_cover_sizek;
631 unsigned int num_reg;
632 int bad;
633};
634
635/*
636 * gran_size: 64K, 128K, 256K, 512K, 1M, 2M, ..., 2G
637 * chunk size: gran_size, ..., 2G
638 * so we need (1+16)*8
639 */
640#define NUM_RESULT 136
641#define PSHIFT (PAGE_SHIFT - 10)
642
643static struct mtrr_cleanup_result __initdata result[NUM_RESULT];
644static unsigned long __initdata min_loss_pfn[RANGE_NUM];
645
646static void __init print_out_mtrr_range_state(void)
647{
648 int i;
649 char start_factor = 'K', size_factor = 'K';
650 unsigned long start_base, size_base;
651 mtrr_type type;
652
653 for (i = 0; i < num_var_ranges; i++) {
654
655 size_base = range_state[i].size_pfn << (PAGE_SHIFT - 10);
656 if (!size_base)
657 continue;
658
659 size_base = to_size_factor(size_base, &size_factor),
660 start_base = range_state[i].base_pfn << (PAGE_SHIFT - 10);
661 start_base = to_size_factor(start_base, &start_factor),
662 type = range_state[i].type;
663
664 printk(KERN_DEBUG "reg %d, base: %ld%cB, range: %ld%cB, type %s\n",
665 i, start_base, start_factor,
666 size_base, size_factor,
667 (type == MTRR_TYPE_UNCACHABLE) ? "UC" :
668 ((type == MTRR_TYPE_WRPROT) ? "WP" :
669 ((type == MTRR_TYPE_WRBACK) ? "WB" : "Other"))
670 );
671 }
672}
673
674static int __init mtrr_need_cleanup(void)
675{
676 int i;
677 mtrr_type type;
678 unsigned long size;
679 /* extra one for all 0 */
680 int num[MTRR_NUM_TYPES + 1];
681
682 /* check entries number */
683 memset(num, 0, sizeof(num));
684 for (i = 0; i < num_var_ranges; i++) {
685 type = range_state[i].type;
686 size = range_state[i].size_pfn;
687 if (type >= MTRR_NUM_TYPES)
688 continue;
689 if (!size)
690 type = MTRR_NUM_TYPES;
691 if (type == MTRR_TYPE_WRPROT)
692 type = MTRR_TYPE_UNCACHABLE;
693 num[type]++;
694 }
695
696 /* check if we got UC entries */
697 if (!num[MTRR_TYPE_UNCACHABLE])
698 return 0;
699
700 /* check if we only had WB and UC */
701 if (num[MTRR_TYPE_WRBACK] + num[MTRR_TYPE_UNCACHABLE] !=
702 num_var_ranges - num[MTRR_NUM_TYPES])
703 return 0;
704
705 return 1;
706}
707
708static unsigned long __initdata range_sums;
709static void __init mtrr_calc_range_state(u64 chunk_size, u64 gran_size,
710 unsigned long extra_remove_base,
711 unsigned long extra_remove_size,
712 int i)
713{
714 int num_reg;
715 static struct res_range range_new[RANGE_NUM];
716 static int nr_range_new;
717 unsigned long range_sums_new;
718
719 /* convert ranges to var ranges state */
720 num_reg = x86_setup_var_mtrrs(range, nr_range,
721 chunk_size, gran_size);
722
723 /* we got new setting in range_state, check it */
724 memset(range_new, 0, sizeof(range_new));
725 nr_range_new = x86_get_mtrr_mem_range(range_new, 0,
726 extra_remove_base, extra_remove_size);
727 range_sums_new = sum_ranges(range_new, nr_range_new);
728
729 result[i].chunk_sizek = chunk_size >> 10;
730 result[i].gran_sizek = gran_size >> 10;
731 result[i].num_reg = num_reg;
732 if (range_sums < range_sums_new) {
733 result[i].lose_cover_sizek =
734 (range_sums_new - range_sums) << PSHIFT;
735 result[i].bad = 1;
736 } else
737 result[i].lose_cover_sizek =
738 (range_sums - range_sums_new) << PSHIFT;
739
740 /* double check it */
741 if (!result[i].bad && !result[i].lose_cover_sizek) {
742 if (nr_range_new != nr_range ||
743 memcmp(range, range_new, sizeof(range)))
744 result[i].bad = 1;
745 }
746
747 if (!result[i].bad && (range_sums - range_sums_new <
748 min_loss_pfn[num_reg])) {
749 min_loss_pfn[num_reg] =
750 range_sums - range_sums_new;
751 }
752}
753
754static void __init mtrr_print_out_one_result(int i)
755{
756 char gran_factor, chunk_factor, lose_factor;
757 unsigned long gran_base, chunk_base, lose_base;
758
759 gran_base = to_size_factor(result[i].gran_sizek, &gran_factor),
760 chunk_base = to_size_factor(result[i].chunk_sizek, &chunk_factor),
761 lose_base = to_size_factor(result[i].lose_cover_sizek, &lose_factor),
762 printk(KERN_INFO "%sgran_size: %ld%c \tchunk_size: %ld%c \t",
763 result[i].bad ? "*BAD*" : " ",
764 gran_base, gran_factor, chunk_base, chunk_factor);
765 printk(KERN_CONT "num_reg: %d \tlose cover RAM: %s%ld%c\n",
766 result[i].num_reg, result[i].bad ? "-" : "",
767 lose_base, lose_factor);
768}
769
770static int __init mtrr_search_optimal_index(void)
771{
772 int i;
773 int num_reg_good;
774 int index_good;
775
776 if (nr_mtrr_spare_reg >= num_var_ranges)
777 nr_mtrr_spare_reg = num_var_ranges - 1;
778 num_reg_good = -1;
779 for (i = num_var_ranges - nr_mtrr_spare_reg; i > 0; i--) {
780 if (!min_loss_pfn[i])
781 num_reg_good = i;
782 }
783
784 index_good = -1;
785 if (num_reg_good != -1) {
786 for (i = 0; i < NUM_RESULT; i++) {
787 if (!result[i].bad &&
788 result[i].num_reg == num_reg_good &&
789 !result[i].lose_cover_sizek) {
790 index_good = i;
791 break;
792 }
793 }
794 }
795
796 return index_good;
797}
798
799
800int __init mtrr_cleanup(unsigned address_bits)
801{
802 unsigned long extra_remove_base, extra_remove_size;
803 unsigned long base, size, def, dummy;
804 mtrr_type type;
805 u64 chunk_size, gran_size;
806 int index_good;
807 int i;
808
809 if (!is_cpu(INTEL) || enable_mtrr_cleanup < 1)
810 return 0;
811 rdmsr(MTRRdefType_MSR, def, dummy);
812 def &= 0xff;
813 if (def != MTRR_TYPE_UNCACHABLE)
814 return 0;
815
816 /* get it and store it aside */
817 memset(range_state, 0, sizeof(range_state));
818 for (i = 0; i < num_var_ranges; i++) {
819 mtrr_if->get(i, &base, &size, &type);
820 range_state[i].base_pfn = base;
821 range_state[i].size_pfn = size;
822 range_state[i].type = type;
823 }
824
825 /* check if we need handle it and can handle it */
826 if (!mtrr_need_cleanup())
827 return 0;
828
829 /* print original var MTRRs at first, for debugging: */
830 printk(KERN_DEBUG "original variable MTRRs\n");
831 print_out_mtrr_range_state();
832
833 memset(range, 0, sizeof(range));
834 extra_remove_size = 0;
835 extra_remove_base = 1 << (32 - PAGE_SHIFT);
836 if (mtrr_tom2)
837 extra_remove_size =
838 (mtrr_tom2 >> PAGE_SHIFT) - extra_remove_base;
839 nr_range = x86_get_mtrr_mem_range(range, 0, extra_remove_base,
840 extra_remove_size);
841 /*
842 * [0, 1M) should always be coverred by var mtrr with WB
843 * and fixed mtrrs should take effective before var mtrr for it
844 */
845 nr_range = add_range_with_merge(range, nr_range, 0,
846 (1ULL<<(20 - PAGE_SHIFT)) - 1);
847 /* sort the ranges */
848 sort(range, nr_range, sizeof(struct res_range), cmp_range, NULL);
849
850 range_sums = sum_ranges(range, nr_range);
851 printk(KERN_INFO "total RAM coverred: %ldM\n",
852 range_sums >> (20 - PAGE_SHIFT));
853
854 if (mtrr_chunk_size && mtrr_gran_size) {
855 i = 0;
856 mtrr_calc_range_state(mtrr_chunk_size, mtrr_gran_size,
857 extra_remove_base, extra_remove_size, i);
858
859 mtrr_print_out_one_result(i);
860
861 if (!result[i].bad) {
862 set_var_mtrr_all(address_bits);
863 printk(KERN_DEBUG "New variable MTRRs\n");
864 print_out_mtrr_range_state();
865 return 1;
866 }
867 printk(KERN_INFO "invalid mtrr_gran_size or mtrr_chunk_size, "
868 "will find optimal one\n");
869 }
870
871 i = 0;
872 memset(min_loss_pfn, 0xff, sizeof(min_loss_pfn));
873 memset(result, 0, sizeof(result));
874 for (gran_size = (1ULL<<16); gran_size < (1ULL<<32); gran_size <<= 1) {
875
876 for (chunk_size = gran_size; chunk_size < (1ULL<<32);
877 chunk_size <<= 1) {
878
879 if (i >= NUM_RESULT)
880 continue;
881
882 mtrr_calc_range_state(chunk_size, gran_size,
883 extra_remove_base, extra_remove_size, i);
884 if (debug_print) {
885 mtrr_print_out_one_result(i);
886 printk(KERN_INFO "\n");
887 }
888
889 i++;
890 }
891 }
892
893 /* try to find the optimal index */
894 index_good = mtrr_search_optimal_index();
895
896 if (index_good != -1) {
897 printk(KERN_INFO "Found optimal setting for mtrr clean up\n");
898 i = index_good;
899 mtrr_print_out_one_result(i);
900
901 /* convert ranges to var ranges state */
902 chunk_size = result[i].chunk_sizek;
903 chunk_size <<= 10;
904 gran_size = result[i].gran_sizek;
905 gran_size <<= 10;
906 x86_setup_var_mtrrs(range, nr_range, chunk_size, gran_size);
907 set_var_mtrr_all(address_bits);
908 printk(KERN_DEBUG "New variable MTRRs\n");
909 print_out_mtrr_range_state();
910 return 1;
911 } else {
912 /* print out all */
913 for (i = 0; i < NUM_RESULT; i++)
914 mtrr_print_out_one_result(i);
915 }
916
917 printk(KERN_INFO "mtrr_cleanup: can not find optimal value\n");
918 printk(KERN_INFO "please specify mtrr_gran_size/mtrr_chunk_size\n");
919
920 return 0;
921}
922#else
923int __init mtrr_cleanup(unsigned address_bits)
924{
925 return 0;
926}
927#endif
928
929static int disable_mtrr_trim;
930
931static int __init disable_mtrr_trim_setup(char *str)
932{
933 disable_mtrr_trim = 1;
934 return 0;
935}
936early_param("disable_mtrr_trim", disable_mtrr_trim_setup);
937
938/*
939 * Newer AMD K8s and later CPUs have a special magic MSR way to force WB
940 * for memory >4GB. Check for that here.
941 * Note this won't check if the MTRRs < 4GB where the magic bit doesn't
942 * apply to are wrong, but so far we don't know of any such case in the wild.
943 */
944#define Tom2Enabled (1U << 21)
945#define Tom2ForceMemTypeWB (1U << 22)
946
947int __init amd_special_default_mtrr(void)
948{
949 u32 l, h;
950
951 if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD)
952 return 0;
953 if (boot_cpu_data.x86 < 0xf || boot_cpu_data.x86 > 0x11)
954 return 0;
955 /* In case some hypervisor doesn't pass SYSCFG through */
956 if (rdmsr_safe(MSR_K8_SYSCFG, &l, &h) < 0)
957 return 0;
958 /*
959 * Memory between 4GB and top of mem is forced WB by this magic bit.
960 * Reserved before K8RevF, but should be zero there.
961 */
962 if ((l & (Tom2Enabled | Tom2ForceMemTypeWB)) ==
963 (Tom2Enabled | Tom2ForceMemTypeWB))
964 return 1;
965 return 0;
966}
967
968static u64 __init real_trim_memory(unsigned long start_pfn,
969 unsigned long limit_pfn)
970{
971 u64 trim_start, trim_size;
972 trim_start = start_pfn;
973 trim_start <<= PAGE_SHIFT;
974 trim_size = limit_pfn;
975 trim_size <<= PAGE_SHIFT;
976 trim_size -= trim_start;
977
978 return e820_update_range(trim_start, trim_size, E820_RAM,
979 E820_RESERVED);
980}
981/**
982 * mtrr_trim_uncached_memory - trim RAM not covered by MTRRs
983 * @end_pfn: ending page frame number
984 *
985 * Some buggy BIOSes don't setup the MTRRs properly for systems with certain
986 * memory configurations. This routine checks that the highest MTRR matches
987 * the end of memory, to make sure the MTRRs having a write back type cover
988 * all of the memory the kernel is intending to use. If not, it'll trim any
989 * memory off the end by adjusting end_pfn, removing it from the kernel's
990 * allocation pools, warning the user with an obnoxious message.
991 */
992int __init mtrr_trim_uncached_memory(unsigned long end_pfn)
993{
994 unsigned long i, base, size, highest_pfn = 0, def, dummy;
995 mtrr_type type;
996 u64 total_trim_size;
997
998 /* extra one for all 0 */
999 int num[MTRR_NUM_TYPES + 1];
1000 /*
1001 * Make sure we only trim uncachable memory on machines that
1002 * support the Intel MTRR architecture:
1003 */
1004 if (!is_cpu(INTEL) || disable_mtrr_trim)
1005 return 0;
1006 rdmsr(MTRRdefType_MSR, def, dummy);
1007 def &= 0xff;
1008 if (def != MTRR_TYPE_UNCACHABLE)
1009 return 0;
1010
1011 /* get it and store it aside */
1012 memset(range_state, 0, sizeof(range_state));
1013 for (i = 0; i < num_var_ranges; i++) {
1014 mtrr_if->get(i, &base, &size, &type);
1015 range_state[i].base_pfn = base;
1016 range_state[i].size_pfn = size;
1017 range_state[i].type = type;
1018 }
1019
1020 /* Find highest cached pfn */
1021 for (i = 0; i < num_var_ranges; i++) {
1022 type = range_state[i].type;
1023 if (type != MTRR_TYPE_WRBACK)
1024 continue;
1025 base = range_state[i].base_pfn;
1026 size = range_state[i].size_pfn;
1027 if (highest_pfn < base + size)
1028 highest_pfn = base + size;
1029 }
1030
1031 /* kvm/qemu doesn't have mtrr set right, don't trim them all */
1032 if (!highest_pfn) {
1033 printk(KERN_INFO "CPU MTRRs all blank - virtualized system.\n");
1034 return 0;
1035 }
1036
1037 /* check entries number */
1038 memset(num, 0, sizeof(num));
1039 for (i = 0; i < num_var_ranges; i++) {
1040 type = range_state[i].type;
1041 if (type >= MTRR_NUM_TYPES)
1042 continue;
1043 size = range_state[i].size_pfn;
1044 if (!size)
1045 type = MTRR_NUM_TYPES;
1046 num[type]++;
1047 }
1048
1049 /* no entry for WB? */
1050 if (!num[MTRR_TYPE_WRBACK])
1051 return 0;
1052
1053 /* check if we only had WB and UC */
1054 if (num[MTRR_TYPE_WRBACK] + num[MTRR_TYPE_UNCACHABLE] !=
1055 num_var_ranges - num[MTRR_NUM_TYPES])
1056 return 0;
1057
1058 memset(range, 0, sizeof(range));
1059 nr_range = 0;
1060 if (mtrr_tom2) {
1061 range[nr_range].start = (1ULL<<(32 - PAGE_SHIFT));
1062 range[nr_range].end = (mtrr_tom2 >> PAGE_SHIFT) - 1;
1063 if (highest_pfn < range[nr_range].end + 1)
1064 highest_pfn = range[nr_range].end + 1;
1065 nr_range++;
1066 }
1067 nr_range = x86_get_mtrr_mem_range(range, nr_range, 0, 0);
1068
1069 total_trim_size = 0;
1070 /* check the head */
1071 if (range[0].start)
1072 total_trim_size += real_trim_memory(0, range[0].start);
1073 /* check the holes */
1074 for (i = 0; i < nr_range - 1; i++) {
1075 if (range[i].end + 1 < range[i+1].start)
1076 total_trim_size += real_trim_memory(range[i].end + 1,
1077 range[i+1].start);
1078 }
1079 /* check the top */
1080 i = nr_range - 1;
1081 if (range[i].end + 1 < end_pfn)
1082 total_trim_size += real_trim_memory(range[i].end + 1,
1083 end_pfn);
1084
1085 if (total_trim_size) {
1086 printk(KERN_WARNING "WARNING: BIOS bug: CPU MTRRs don't cover"
1087 " all of memory, losing %lluMB of RAM.\n",
1088 total_trim_size >> 20);
1089
1090 if (!changed_by_mtrr_cleanup)
1091 WARN_ON(1);
1092
1093 printk(KERN_INFO "update e820 for mtrr\n");
1094 update_e820();
1095
1096 return 1;
1097 }
1098
1099 return 0;
1100}
1101
diff --git a/arch/x86/kernel/cpu/mtrr/generic.c b/arch/x86/kernel/cpu/mtrr/generic.c
index 0c0a455fe95c..37f28fc7cf95 100644
--- a/arch/x86/kernel/cpu/mtrr/generic.c
+++ b/arch/x86/kernel/cpu/mtrr/generic.c
@@ -33,13 +33,31 @@ u64 mtrr_tom2;
33struct mtrr_state_type mtrr_state = {}; 33struct mtrr_state_type mtrr_state = {};
34EXPORT_SYMBOL_GPL(mtrr_state); 34EXPORT_SYMBOL_GPL(mtrr_state);
35 35
36static int __initdata mtrr_show; 36/**
37static int __init mtrr_debug(char *opt) 37 * BIOS is expected to clear MtrrFixDramModEn bit, see for example
38 * "BIOS and Kernel Developer's Guide for the AMD Athlon 64 and AMD
39 * Opteron Processors" (26094 Rev. 3.30 February 2006), section
40 * "13.2.1.2 SYSCFG Register": "The MtrrFixDramModEn bit should be set
41 * to 1 during BIOS initalization of the fixed MTRRs, then cleared to
42 * 0 for operation."
43 */
44static inline void k8_check_syscfg_dram_mod_en(void)
38{ 45{
39 mtrr_show = 1; 46 u32 lo, hi;
40 return 0; 47
48 if (!((boot_cpu_data.x86_vendor == X86_VENDOR_AMD) &&
49 (boot_cpu_data.x86 >= 0x0f)))
50 return;
51
52 rdmsr(MSR_K8_SYSCFG, lo, hi);
53 if (lo & K8_MTRRFIXRANGE_DRAM_MODIFY) {
54 printk(KERN_ERR FW_WARN "MTRR: CPU %u: SYSCFG[MtrrFixDramModEn]"
55 " not cleared by BIOS, clearing this bit\n",
56 smp_processor_id());
57 lo &= ~K8_MTRRFIXRANGE_DRAM_MODIFY;
58 mtrr_wrmsr(MSR_K8_SYSCFG, lo, hi);
59 }
41} 60}
42early_param("mtrr.show", mtrr_debug);
43 61
44/* 62/*
45 * Returns the effective MTRR type for the region 63 * Returns the effective MTRR type for the region
@@ -174,6 +192,8 @@ get_fixed_ranges(mtrr_type * frs)
174 unsigned int *p = (unsigned int *) frs; 192 unsigned int *p = (unsigned int *) frs;
175 int i; 193 int i;
176 194
195 k8_check_syscfg_dram_mod_en();
196
177 rdmsr(MTRRfix64K_00000_MSR, p[0], p[1]); 197 rdmsr(MTRRfix64K_00000_MSR, p[0], p[1]);
178 198
179 for (i = 0; i < 2; i++) 199 for (i = 0; i < 2; i++)
@@ -188,18 +208,94 @@ void mtrr_save_fixed_ranges(void *info)
188 get_fixed_ranges(mtrr_state.fixed_ranges); 208 get_fixed_ranges(mtrr_state.fixed_ranges);
189} 209}
190 210
191static void print_fixed(unsigned base, unsigned step, const mtrr_type*types) 211static unsigned __initdata last_fixed_start;
212static unsigned __initdata last_fixed_end;
213static mtrr_type __initdata last_fixed_type;
214
215static void __init print_fixed_last(void)
216{
217 if (!last_fixed_end)
218 return;
219
220 printk(KERN_DEBUG " %05X-%05X %s\n", last_fixed_start,
221 last_fixed_end - 1, mtrr_attrib_to_str(last_fixed_type));
222
223 last_fixed_end = 0;
224}
225
226static void __init update_fixed_last(unsigned base, unsigned end,
227 mtrr_type type)
228{
229 last_fixed_start = base;
230 last_fixed_end = end;
231 last_fixed_type = type;
232}
233
234static void __init print_fixed(unsigned base, unsigned step,
235 const mtrr_type *types)
192{ 236{
193 unsigned i; 237 unsigned i;
194 238
195 for (i = 0; i < 8; ++i, ++types, base += step) 239 for (i = 0; i < 8; ++i, ++types, base += step) {
196 printk(KERN_INFO "MTRR %05X-%05X %s\n", 240 if (last_fixed_end == 0) {
197 base, base + step - 1, mtrr_attrib_to_str(*types)); 241 update_fixed_last(base, base + step, *types);
242 continue;
243 }
244 if (last_fixed_end == base && last_fixed_type == *types) {
245 last_fixed_end = base + step;
246 continue;
247 }
248 /* new segments: gap or different type */
249 print_fixed_last();
250 update_fixed_last(base, base + step, *types);
251 }
198} 252}
199 253
200static void prepare_set(void); 254static void prepare_set(void);
201static void post_set(void); 255static void post_set(void);
202 256
257static void __init print_mtrr_state(void)
258{
259 unsigned int i;
260 int high_width;
261
262 printk(KERN_DEBUG "MTRR default type: %s\n",
263 mtrr_attrib_to_str(mtrr_state.def_type));
264 if (mtrr_state.have_fixed) {
265 printk(KERN_DEBUG "MTRR fixed ranges %sabled:\n",
266 mtrr_state.enabled & 1 ? "en" : "dis");
267 print_fixed(0x00000, 0x10000, mtrr_state.fixed_ranges + 0);
268 for (i = 0; i < 2; ++i)
269 print_fixed(0x80000 + i * 0x20000, 0x04000, mtrr_state.fixed_ranges + (i + 1) * 8);
270 for (i = 0; i < 8; ++i)
271 print_fixed(0xC0000 + i * 0x08000, 0x01000, mtrr_state.fixed_ranges + (i + 3) * 8);
272
273 /* tail */
274 print_fixed_last();
275 }
276 printk(KERN_DEBUG "MTRR variable ranges %sabled:\n",
277 mtrr_state.enabled & 2 ? "en" : "dis");
278 high_width = ((size_or_mask ? ffs(size_or_mask) - 1 : 32) - (32 - PAGE_SHIFT) + 3) / 4;
279 for (i = 0; i < num_var_ranges; ++i) {
280 if (mtrr_state.var_ranges[i].mask_lo & (1 << 11))
281 printk(KERN_DEBUG " %u base %0*X%05X000 mask %0*X%05X000 %s\n",
282 i,
283 high_width,
284 mtrr_state.var_ranges[i].base_hi,
285 mtrr_state.var_ranges[i].base_lo >> 12,
286 high_width,
287 mtrr_state.var_ranges[i].mask_hi,
288 mtrr_state.var_ranges[i].mask_lo >> 12,
289 mtrr_attrib_to_str(mtrr_state.var_ranges[i].base_lo & 0xff));
290 else
291 printk(KERN_DEBUG " %u disabled\n", i);
292 }
293 if (mtrr_tom2) {
294 printk(KERN_DEBUG "TOM2: %016llx aka %lldM\n",
295 mtrr_tom2, mtrr_tom2>>20);
296 }
297}
298
203/* Grab all of the MTRR state for this CPU into *state */ 299/* Grab all of the MTRR state for this CPU into *state */
204void __init get_mtrr_state(void) 300void __init get_mtrr_state(void)
205{ 301{
@@ -231,41 +327,9 @@ void __init get_mtrr_state(void)
231 mtrr_tom2 |= low; 327 mtrr_tom2 |= low;
232 mtrr_tom2 &= 0xffffff800000ULL; 328 mtrr_tom2 &= 0xffffff800000ULL;
233 } 329 }
234 if (mtrr_show) { 330
235 int high_width; 331 print_mtrr_state();
236 332
237 printk(KERN_INFO "MTRR default type: %s\n", mtrr_attrib_to_str(mtrr_state.def_type));
238 if (mtrr_state.have_fixed) {
239 printk(KERN_INFO "MTRR fixed ranges %sabled:\n",
240 mtrr_state.enabled & 1 ? "en" : "dis");
241 print_fixed(0x00000, 0x10000, mtrr_state.fixed_ranges + 0);
242 for (i = 0; i < 2; ++i)
243 print_fixed(0x80000 + i * 0x20000, 0x04000, mtrr_state.fixed_ranges + (i + 1) * 8);
244 for (i = 0; i < 8; ++i)
245 print_fixed(0xC0000 + i * 0x08000, 0x01000, mtrr_state.fixed_ranges + (i + 3) * 8);
246 }
247 printk(KERN_INFO "MTRR variable ranges %sabled:\n",
248 mtrr_state.enabled & 2 ? "en" : "dis");
249 high_width = ((size_or_mask ? ffs(size_or_mask) - 1 : 32) - (32 - PAGE_SHIFT) + 3) / 4;
250 for (i = 0; i < num_var_ranges; ++i) {
251 if (mtrr_state.var_ranges[i].mask_lo & (1 << 11))
252 printk(KERN_INFO "MTRR %u base %0*X%05X000 mask %0*X%05X000 %s\n",
253 i,
254 high_width,
255 mtrr_state.var_ranges[i].base_hi,
256 mtrr_state.var_ranges[i].base_lo >> 12,
257 high_width,
258 mtrr_state.var_ranges[i].mask_hi,
259 mtrr_state.var_ranges[i].mask_lo >> 12,
260 mtrr_attrib_to_str(mtrr_state.var_ranges[i].base_lo & 0xff));
261 else
262 printk(KERN_INFO "MTRR %u disabled\n", i);
263 }
264 if (mtrr_tom2) {
265 printk(KERN_INFO "TOM2: %016llx aka %lldM\n",
266 mtrr_tom2, mtrr_tom2>>20);
267 }
268 }
269 mtrr_state_set = 1; 333 mtrr_state_set = 1;
270 334
271 /* PAT setup for BP. We need to go through sync steps here */ 335 /* PAT setup for BP. We need to go through sync steps here */
@@ -308,27 +372,10 @@ void mtrr_wrmsr(unsigned msr, unsigned a, unsigned b)
308} 372}
309 373
310/** 374/**
311 * Enable and allow read/write of extended fixed-range MTRR bits on K8 CPUs
312 * see AMD publication no. 24593, chapter 3.2.1 for more information
313 */
314static inline void k8_enable_fixed_iorrs(void)
315{
316 unsigned lo, hi;
317
318 rdmsr(MSR_K8_SYSCFG, lo, hi);
319 mtrr_wrmsr(MSR_K8_SYSCFG, lo
320 | K8_MTRRFIXRANGE_DRAM_ENABLE
321 | K8_MTRRFIXRANGE_DRAM_MODIFY, hi);
322}
323
324/**
325 * set_fixed_range - checks & updates a fixed-range MTRR if it differs from the value it should have 375 * set_fixed_range - checks & updates a fixed-range MTRR if it differs from the value it should have
326 * @msr: MSR address of the MTTR which should be checked and updated 376 * @msr: MSR address of the MTTR which should be checked and updated
327 * @changed: pointer which indicates whether the MTRR needed to be changed 377 * @changed: pointer which indicates whether the MTRR needed to be changed
328 * @msrwords: pointer to the MSR values which the MSR should have 378 * @msrwords: pointer to the MSR values which the MSR should have
329 *
330 * If K8 extentions are wanted, update the K8 SYSCFG MSR also.
331 * See AMD publication no. 24593, chapter 7.8.1, page 233 for more information.
332 */ 379 */
333static void set_fixed_range(int msr, bool *changed, unsigned int *msrwords) 380static void set_fixed_range(int msr, bool *changed, unsigned int *msrwords)
334{ 381{
@@ -337,10 +384,6 @@ static void set_fixed_range(int msr, bool *changed, unsigned int *msrwords)
337 rdmsr(msr, lo, hi); 384 rdmsr(msr, lo, hi);
338 385
339 if (lo != msrwords[0] || hi != msrwords[1]) { 386 if (lo != msrwords[0] || hi != msrwords[1]) {
340 if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD &&
341 (boot_cpu_data.x86 >= 0x0f && boot_cpu_data.x86 <= 0x11) &&
342 ((msrwords[0] | msrwords[1]) & K8_MTRR_RDMEM_WRMEM_MASK))
343 k8_enable_fixed_iorrs();
344 mtrr_wrmsr(msr, msrwords[0], msrwords[1]); 387 mtrr_wrmsr(msr, msrwords[0], msrwords[1]);
345 *changed = true; 388 *changed = true;
346 } 389 }
@@ -376,22 +419,31 @@ static void generic_get_mtrr(unsigned int reg, unsigned long *base,
376{ 419{
377 unsigned int mask_lo, mask_hi, base_lo, base_hi; 420 unsigned int mask_lo, mask_hi, base_lo, base_hi;
378 unsigned int tmp, hi; 421 unsigned int tmp, hi;
422 int cpu;
423
424 /*
425 * get_mtrr doesn't need to update mtrr_state, also it could be called
426 * from any cpu, so try to print it out directly.
427 */
428 cpu = get_cpu();
379 429
380 rdmsr(MTRRphysMask_MSR(reg), mask_lo, mask_hi); 430 rdmsr(MTRRphysMask_MSR(reg), mask_lo, mask_hi);
431
381 if ((mask_lo & 0x800) == 0) { 432 if ((mask_lo & 0x800) == 0) {
382 /* Invalid (i.e. free) range */ 433 /* Invalid (i.e. free) range */
383 *base = 0; 434 *base = 0;
384 *size = 0; 435 *size = 0;
385 *type = 0; 436 *type = 0;
386 return; 437 goto out_put_cpu;
387 } 438 }
388 439
389 rdmsr(MTRRphysBase_MSR(reg), base_lo, base_hi); 440 rdmsr(MTRRphysBase_MSR(reg), base_lo, base_hi);
390 441
391 /* Work out the shifted address mask. */ 442 /* Work out the shifted address mask: */
392 tmp = mask_hi << (32 - PAGE_SHIFT) | mask_lo >> PAGE_SHIFT; 443 tmp = mask_hi << (32 - PAGE_SHIFT) | mask_lo >> PAGE_SHIFT;
393 mask_lo = size_or_mask | tmp; 444 mask_lo = size_or_mask | tmp;
394 /* Expand tmp with high bits to all 1s*/ 445
446 /* Expand tmp with high bits to all 1s: */
395 hi = fls(tmp); 447 hi = fls(tmp);
396 if (hi > 0) { 448 if (hi > 0) {
397 tmp |= ~((1<<(hi - 1)) - 1); 449 tmp |= ~((1<<(hi - 1)) - 1);
@@ -402,11 +454,19 @@ static void generic_get_mtrr(unsigned int reg, unsigned long *base,
402 } 454 }
403 } 455 }
404 456
405 /* This works correctly if size is a power of two, i.e. a 457 /*
406 contiguous range. */ 458 * This works correctly if size is a power of two, i.e. a
459 * contiguous range:
460 */
407 *size = -mask_lo; 461 *size = -mask_lo;
408 *base = base_hi << (32 - PAGE_SHIFT) | base_lo >> PAGE_SHIFT; 462 *base = base_hi << (32 - PAGE_SHIFT) | base_lo >> PAGE_SHIFT;
409 *type = base_lo & 0xff; 463 *type = base_lo & 0xff;
464
465 printk(KERN_DEBUG " get_mtrr: cpu%d reg%02d base=%010lx size=%010lx %s\n",
466 cpu, reg, *base, *size,
467 mtrr_attrib_to_str(*type & 0xff));
468out_put_cpu:
469 put_cpu();
410} 470}
411 471
412/** 472/**
@@ -419,6 +479,8 @@ static int set_fixed_ranges(mtrr_type * frs)
419 bool changed = false; 479 bool changed = false;
420 int block=-1, range; 480 int block=-1, range;
421 481
482 k8_check_syscfg_dram_mod_en();
483
422 while (fixed_range_blocks[++block].ranges) 484 while (fixed_range_blocks[++block].ranges)
423 for (range=0; range < fixed_range_blocks[block].ranges; range++) 485 for (range=0; range < fixed_range_blocks[block].ranges; range++)
424 set_fixed_range(fixed_range_blocks[block].base_msr + range, 486 set_fixed_range(fixed_range_blocks[block].base_msr + range,
diff --git a/arch/x86/kernel/cpu/mtrr/if.c b/arch/x86/kernel/cpu/mtrr/if.c
index 4c4214690dd1..fb73a52913a4 100644
--- a/arch/x86/kernel/cpu/mtrr/if.c
+++ b/arch/x86/kernel/cpu/mtrr/if.c
@@ -377,10 +377,6 @@ static const struct file_operations mtrr_fops = {
377 .release = mtrr_close, 377 .release = mtrr_close,
378}; 378};
379 379
380
381static struct proc_dir_entry *proc_root_mtrr;
382
383
384static int mtrr_seq_show(struct seq_file *seq, void *offset) 380static int mtrr_seq_show(struct seq_file *seq, void *offset)
385{ 381{
386 char factor; 382 char factor;
@@ -423,11 +419,7 @@ static int __init mtrr_if_init(void)
423 (!cpu_has(c, X86_FEATURE_CENTAUR_MCR))) 419 (!cpu_has(c, X86_FEATURE_CENTAUR_MCR)))
424 return -ENODEV; 420 return -ENODEV;
425 421
426 proc_root_mtrr = 422 proc_create("mtrr", S_IWUSR | S_IRUGO, NULL, &mtrr_fops);
427 proc_create("mtrr", S_IWUSR | S_IRUGO, NULL, &mtrr_fops);
428
429 if (proc_root_mtrr)
430 proc_root_mtrr->owner = THIS_MODULE;
431 return 0; 423 return 0;
432} 424}
433 425
diff --git a/arch/x86/kernel/cpu/mtrr/main.c b/arch/x86/kernel/cpu/mtrr/main.c
index 236a401b8259..03cda01f57c7 100644
--- a/arch/x86/kernel/cpu/mtrr/main.c
+++ b/arch/x86/kernel/cpu/mtrr/main.c
@@ -574,7 +574,7 @@ struct mtrr_value {
574 unsigned long lsize; 574 unsigned long lsize;
575}; 575};
576 576
577static struct mtrr_value mtrr_state[MTRR_MAX_VAR_RANGES]; 577static struct mtrr_value mtrr_value[MTRR_MAX_VAR_RANGES];
578 578
579static int mtrr_save(struct sys_device * sysdev, pm_message_t state) 579static int mtrr_save(struct sys_device * sysdev, pm_message_t state)
580{ 580{
@@ -582,9 +582,9 @@ static int mtrr_save(struct sys_device * sysdev, pm_message_t state)
582 582
583 for (i = 0; i < num_var_ranges; i++) { 583 for (i = 0; i < num_var_ranges; i++) {
584 mtrr_if->get(i, 584 mtrr_if->get(i,
585 &mtrr_state[i].lbase, 585 &mtrr_value[i].lbase,
586 &mtrr_state[i].lsize, 586 &mtrr_value[i].lsize,
587 &mtrr_state[i].ltype); 587 &mtrr_value[i].ltype);
588 } 588 }
589 return 0; 589 return 0;
590} 590}
@@ -594,11 +594,11 @@ static int mtrr_restore(struct sys_device * sysdev)
594 int i; 594 int i;
595 595
596 for (i = 0; i < num_var_ranges; i++) { 596 for (i = 0; i < num_var_ranges; i++) {
597 if (mtrr_state[i].lsize) 597 if (mtrr_value[i].lsize)
598 set_mtrr(i, 598 set_mtrr(i,
599 mtrr_state[i].lbase, 599 mtrr_value[i].lbase,
600 mtrr_state[i].lsize, 600 mtrr_value[i].lsize,
601 mtrr_state[i].ltype); 601 mtrr_value[i].ltype);
602 } 602 }
603 return 0; 603 return 0;
604} 604}
@@ -610,1058 +610,7 @@ static struct sysdev_driver mtrr_sysdev_driver = {
610 .resume = mtrr_restore, 610 .resume = mtrr_restore,
611}; 611};
612 612
613/* should be related to MTRR_VAR_RANGES nums */ 613int __initdata changed_by_mtrr_cleanup;
614#define RANGE_NUM 256
615
616struct res_range {
617 unsigned long start;
618 unsigned long end;
619};
620
621static int __init
622add_range(struct res_range *range, int nr_range, unsigned long start,
623 unsigned long end)
624{
625 /* out of slots */
626 if (nr_range >= RANGE_NUM)
627 return nr_range;
628
629 range[nr_range].start = start;
630 range[nr_range].end = end;
631
632 nr_range++;
633
634 return nr_range;
635}
636
637static int __init
638add_range_with_merge(struct res_range *range, int nr_range, unsigned long start,
639 unsigned long end)
640{
641 int i;
642
643 /* try to merge it with old one */
644 for (i = 0; i < nr_range; i++) {
645 unsigned long final_start, final_end;
646 unsigned long common_start, common_end;
647
648 if (!range[i].end)
649 continue;
650
651 common_start = max(range[i].start, start);
652 common_end = min(range[i].end, end);
653 if (common_start > common_end + 1)
654 continue;
655
656 final_start = min(range[i].start, start);
657 final_end = max(range[i].end, end);
658
659 range[i].start = final_start;
660 range[i].end = final_end;
661 return nr_range;
662 }
663
664 /* need to add that */
665 return add_range(range, nr_range, start, end);
666}
667
668static void __init
669subtract_range(struct res_range *range, unsigned long start, unsigned long end)
670{
671 int i, j;
672
673 for (j = 0; j < RANGE_NUM; j++) {
674 if (!range[j].end)
675 continue;
676
677 if (start <= range[j].start && end >= range[j].end) {
678 range[j].start = 0;
679 range[j].end = 0;
680 continue;
681 }
682
683 if (start <= range[j].start && end < range[j].end &&
684 range[j].start < end + 1) {
685 range[j].start = end + 1;
686 continue;
687 }
688
689
690 if (start > range[j].start && end >= range[j].end &&
691 range[j].end > start - 1) {
692 range[j].end = start - 1;
693 continue;
694 }
695
696 if (start > range[j].start && end < range[j].end) {
697 /* find the new spare */
698 for (i = 0; i < RANGE_NUM; i++) {
699 if (range[i].end == 0)
700 break;
701 }
702 if (i < RANGE_NUM) {
703 range[i].end = range[j].end;
704 range[i].start = end + 1;
705 } else {
706 printk(KERN_ERR "run of slot in ranges\n");
707 }
708 range[j].end = start - 1;
709 continue;
710 }
711 }
712}
713
714static int __init cmp_range(const void *x1, const void *x2)
715{
716 const struct res_range *r1 = x1;
717 const struct res_range *r2 = x2;
718 long start1, start2;
719
720 start1 = r1->start;
721 start2 = r2->start;
722
723 return start1 - start2;
724}
725
726struct var_mtrr_range_state {
727 unsigned long base_pfn;
728 unsigned long size_pfn;
729 mtrr_type type;
730};
731
732static struct var_mtrr_range_state __initdata range_state[RANGE_NUM];
733static int __initdata debug_print;
734
735static int __init
736x86_get_mtrr_mem_range(struct res_range *range, int nr_range,
737 unsigned long extra_remove_base,
738 unsigned long extra_remove_size)
739{
740 unsigned long i, base, size;
741 mtrr_type type;
742
743 for (i = 0; i < num_var_ranges; i++) {
744 type = range_state[i].type;
745 if (type != MTRR_TYPE_WRBACK)
746 continue;
747 base = range_state[i].base_pfn;
748 size = range_state[i].size_pfn;
749 nr_range = add_range_with_merge(range, nr_range, base,
750 base + size - 1);
751 }
752 if (debug_print) {
753 printk(KERN_DEBUG "After WB checking\n");
754 for (i = 0; i < nr_range; i++)
755 printk(KERN_DEBUG "MTRR MAP PFN: %016lx - %016lx\n",
756 range[i].start, range[i].end + 1);
757 }
758
759 /* take out UC ranges */
760 for (i = 0; i < num_var_ranges; i++) {
761 type = range_state[i].type;
762 if (type != MTRR_TYPE_UNCACHABLE &&
763 type != MTRR_TYPE_WRPROT)
764 continue;
765 size = range_state[i].size_pfn;
766 if (!size)
767 continue;
768 base = range_state[i].base_pfn;
769 subtract_range(range, base, base + size - 1);
770 }
771 if (extra_remove_size)
772 subtract_range(range, extra_remove_base,
773 extra_remove_base + extra_remove_size - 1);
774
775 /* get new range num */
776 nr_range = 0;
777 for (i = 0; i < RANGE_NUM; i++) {
778 if (!range[i].end)
779 continue;
780 nr_range++;
781 }
782 if (debug_print) {
783 printk(KERN_DEBUG "After UC checking\n");
784 for (i = 0; i < nr_range; i++)
785 printk(KERN_DEBUG "MTRR MAP PFN: %016lx - %016lx\n",
786 range[i].start, range[i].end + 1);
787 }
788
789 /* sort the ranges */
790 sort(range, nr_range, sizeof(struct res_range), cmp_range, NULL);
791 if (debug_print) {
792 printk(KERN_DEBUG "After sorting\n");
793 for (i = 0; i < nr_range; i++)
794 printk(KERN_DEBUG "MTRR MAP PFN: %016lx - %016lx\n",
795 range[i].start, range[i].end + 1);
796 }
797
798 /* clear those is not used */
799 for (i = nr_range; i < RANGE_NUM; i++)
800 memset(&range[i], 0, sizeof(range[i]));
801
802 return nr_range;
803}
804
805static struct res_range __initdata range[RANGE_NUM];
806static int __initdata nr_range;
807
808#ifdef CONFIG_MTRR_SANITIZER
809
810static unsigned long __init sum_ranges(struct res_range *range, int nr_range)
811{
812 unsigned long sum;
813 int i;
814
815 sum = 0;
816 for (i = 0; i < nr_range; i++)
817 sum += range[i].end + 1 - range[i].start;
818
819 return sum;
820}
821
822static int enable_mtrr_cleanup __initdata =
823 CONFIG_MTRR_SANITIZER_ENABLE_DEFAULT;
824
825static int __init disable_mtrr_cleanup_setup(char *str)
826{
827 enable_mtrr_cleanup = 0;
828 return 0;
829}
830early_param("disable_mtrr_cleanup", disable_mtrr_cleanup_setup);
831
832static int __init enable_mtrr_cleanup_setup(char *str)
833{
834 enable_mtrr_cleanup = 1;
835 return 0;
836}
837early_param("enable_mtrr_cleanup", enable_mtrr_cleanup_setup);
838
839static int __init mtrr_cleanup_debug_setup(char *str)
840{
841 debug_print = 1;
842 return 0;
843}
844early_param("mtrr_cleanup_debug", mtrr_cleanup_debug_setup);
845
846struct var_mtrr_state {
847 unsigned long range_startk;
848 unsigned long range_sizek;
849 unsigned long chunk_sizek;
850 unsigned long gran_sizek;
851 unsigned int reg;
852};
853
854static void __init
855set_var_mtrr(unsigned int reg, unsigned long basek, unsigned long sizek,
856 unsigned char type, unsigned int address_bits)
857{
858 u32 base_lo, base_hi, mask_lo, mask_hi;
859 u64 base, mask;
860
861 if (!sizek) {
862 fill_mtrr_var_range(reg, 0, 0, 0, 0);
863 return;
864 }
865
866 mask = (1ULL << address_bits) - 1;
867 mask &= ~((((u64)sizek) << 10) - 1);
868
869 base = ((u64)basek) << 10;
870
871 base |= type;
872 mask |= 0x800;
873
874 base_lo = base & ((1ULL<<32) - 1);
875 base_hi = base >> 32;
876
877 mask_lo = mask & ((1ULL<<32) - 1);
878 mask_hi = mask >> 32;
879
880 fill_mtrr_var_range(reg, base_lo, base_hi, mask_lo, mask_hi);
881}
882
883static void __init
884save_var_mtrr(unsigned int reg, unsigned long basek, unsigned long sizek,
885 unsigned char type)
886{
887 range_state[reg].base_pfn = basek >> (PAGE_SHIFT - 10);
888 range_state[reg].size_pfn = sizek >> (PAGE_SHIFT - 10);
889 range_state[reg].type = type;
890}
891
892static void __init
893set_var_mtrr_all(unsigned int address_bits)
894{
895 unsigned long basek, sizek;
896 unsigned char type;
897 unsigned int reg;
898
899 for (reg = 0; reg < num_var_ranges; reg++) {
900 basek = range_state[reg].base_pfn << (PAGE_SHIFT - 10);
901 sizek = range_state[reg].size_pfn << (PAGE_SHIFT - 10);
902 type = range_state[reg].type;
903
904 set_var_mtrr(reg, basek, sizek, type, address_bits);
905 }
906}
907
908static unsigned long to_size_factor(unsigned long sizek, char *factorp)
909{
910 char factor;
911 unsigned long base = sizek;
912
913 if (base & ((1<<10) - 1)) {
914 /* not MB alignment */
915 factor = 'K';
916 } else if (base & ((1<<20) - 1)){
917 factor = 'M';
918 base >>= 10;
919 } else {
920 factor = 'G';
921 base >>= 20;
922 }
923
924 *factorp = factor;
925
926 return base;
927}
928
929static unsigned int __init
930range_to_mtrr(unsigned int reg, unsigned long range_startk,
931 unsigned long range_sizek, unsigned char type)
932{
933 if (!range_sizek || (reg >= num_var_ranges))
934 return reg;
935
936 while (range_sizek) {
937 unsigned long max_align, align;
938 unsigned long sizek;
939
940 /* Compute the maximum size I can make a range */
941 if (range_startk)
942 max_align = ffs(range_startk) - 1;
943 else
944 max_align = 32;
945 align = fls(range_sizek) - 1;
946 if (align > max_align)
947 align = max_align;
948
949 sizek = 1 << align;
950 if (debug_print) {
951 char start_factor = 'K', size_factor = 'K';
952 unsigned long start_base, size_base;
953
954 start_base = to_size_factor(range_startk, &start_factor),
955 size_base = to_size_factor(sizek, &size_factor),
956
957 printk(KERN_DEBUG "Setting variable MTRR %d, "
958 "base: %ld%cB, range: %ld%cB, type %s\n",
959 reg, start_base, start_factor,
960 size_base, size_factor,
961 (type == MTRR_TYPE_UNCACHABLE)?"UC":
962 ((type == MTRR_TYPE_WRBACK)?"WB":"Other")
963 );
964 }
965 save_var_mtrr(reg++, range_startk, sizek, type);
966 range_startk += sizek;
967 range_sizek -= sizek;
968 if (reg >= num_var_ranges)
969 break;
970 }
971 return reg;
972}
973
974static unsigned __init
975range_to_mtrr_with_hole(struct var_mtrr_state *state, unsigned long basek,
976 unsigned long sizek)
977{
978 unsigned long hole_basek, hole_sizek;
979 unsigned long second_basek, second_sizek;
980 unsigned long range0_basek, range0_sizek;
981 unsigned long range_basek, range_sizek;
982 unsigned long chunk_sizek;
983 unsigned long gran_sizek;
984
985 hole_basek = 0;
986 hole_sizek = 0;
987 second_basek = 0;
988 second_sizek = 0;
989 chunk_sizek = state->chunk_sizek;
990 gran_sizek = state->gran_sizek;
991
992 /* align with gran size, prevent small block used up MTRRs */
993 range_basek = ALIGN(state->range_startk, gran_sizek);
994 if ((range_basek > basek) && basek)
995 return second_sizek;
996 state->range_sizek -= (range_basek - state->range_startk);
997 range_sizek = ALIGN(state->range_sizek, gran_sizek);
998
999 while (range_sizek > state->range_sizek) {
1000 range_sizek -= gran_sizek;
1001 if (!range_sizek)
1002 return 0;
1003 }
1004 state->range_sizek = range_sizek;
1005
1006 /* try to append some small hole */
1007 range0_basek = state->range_startk;
1008 range0_sizek = ALIGN(state->range_sizek, chunk_sizek);
1009
1010 /* no increase */
1011 if (range0_sizek == state->range_sizek) {
1012 if (debug_print)
1013 printk(KERN_DEBUG "rangeX: %016lx - %016lx\n",
1014 range0_basek<<10,
1015 (range0_basek + state->range_sizek)<<10);
1016 state->reg = range_to_mtrr(state->reg, range0_basek,
1017 state->range_sizek, MTRR_TYPE_WRBACK);
1018 return 0;
1019 }
1020
1021 /* only cut back, when it is not the last */
1022 if (sizek) {
1023 while (range0_basek + range0_sizek > (basek + sizek)) {
1024 if (range0_sizek >= chunk_sizek)
1025 range0_sizek -= chunk_sizek;
1026 else
1027 range0_sizek = 0;
1028
1029 if (!range0_sizek)
1030 break;
1031 }
1032 }
1033
1034second_try:
1035 range_basek = range0_basek + range0_sizek;
1036
1037 /* one hole in the middle */
1038 if (range_basek > basek && range_basek <= (basek + sizek))
1039 second_sizek = range_basek - basek;
1040
1041 if (range0_sizek > state->range_sizek) {
1042
1043 /* one hole in middle or at end */
1044 hole_sizek = range0_sizek - state->range_sizek - second_sizek;
1045
1046 /* hole size should be less than half of range0 size */
1047 if (hole_sizek >= (range0_sizek >> 1) &&
1048 range0_sizek >= chunk_sizek) {
1049 range0_sizek -= chunk_sizek;
1050 second_sizek = 0;
1051 hole_sizek = 0;
1052
1053 goto second_try;
1054 }
1055 }
1056
1057 if (range0_sizek) {
1058 if (debug_print)
1059 printk(KERN_DEBUG "range0: %016lx - %016lx\n",
1060 range0_basek<<10,
1061 (range0_basek + range0_sizek)<<10);
1062 state->reg = range_to_mtrr(state->reg, range0_basek,
1063 range0_sizek, MTRR_TYPE_WRBACK);
1064 }
1065
1066 if (range0_sizek < state->range_sizek) {
1067 /* need to handle left over */
1068 range_sizek = state->range_sizek - range0_sizek;
1069
1070 if (debug_print)
1071 printk(KERN_DEBUG "range: %016lx - %016lx\n",
1072 range_basek<<10,
1073 (range_basek + range_sizek)<<10);
1074 state->reg = range_to_mtrr(state->reg, range_basek,
1075 range_sizek, MTRR_TYPE_WRBACK);
1076 }
1077
1078 if (hole_sizek) {
1079 hole_basek = range_basek - hole_sizek - second_sizek;
1080 if (debug_print)
1081 printk(KERN_DEBUG "hole: %016lx - %016lx\n",
1082 hole_basek<<10,
1083 (hole_basek + hole_sizek)<<10);
1084 state->reg = range_to_mtrr(state->reg, hole_basek,
1085 hole_sizek, MTRR_TYPE_UNCACHABLE);
1086 }
1087
1088 return second_sizek;
1089}
1090
1091static void __init
1092set_var_mtrr_range(struct var_mtrr_state *state, unsigned long base_pfn,
1093 unsigned long size_pfn)
1094{
1095 unsigned long basek, sizek;
1096 unsigned long second_sizek = 0;
1097
1098 if (state->reg >= num_var_ranges)
1099 return;
1100
1101 basek = base_pfn << (PAGE_SHIFT - 10);
1102 sizek = size_pfn << (PAGE_SHIFT - 10);
1103
1104 /* See if I can merge with the last range */
1105 if ((basek <= 1024) ||
1106 (state->range_startk + state->range_sizek == basek)) {
1107 unsigned long endk = basek + sizek;
1108 state->range_sizek = endk - state->range_startk;
1109 return;
1110 }
1111 /* Write the range mtrrs */
1112 if (state->range_sizek != 0)
1113 second_sizek = range_to_mtrr_with_hole(state, basek, sizek);
1114
1115 /* Allocate an msr */
1116 state->range_startk = basek + second_sizek;
1117 state->range_sizek = sizek - second_sizek;
1118}
1119
1120/* mininum size of mtrr block that can take hole */
1121static u64 mtrr_chunk_size __initdata = (256ULL<<20);
1122
1123static int __init parse_mtrr_chunk_size_opt(char *p)
1124{
1125 if (!p)
1126 return -EINVAL;
1127 mtrr_chunk_size = memparse(p, &p);
1128 return 0;
1129}
1130early_param("mtrr_chunk_size", parse_mtrr_chunk_size_opt);
1131
1132/* granity of mtrr of block */
1133static u64 mtrr_gran_size __initdata;
1134
1135static int __init parse_mtrr_gran_size_opt(char *p)
1136{
1137 if (!p)
1138 return -EINVAL;
1139 mtrr_gran_size = memparse(p, &p);
1140 return 0;
1141}
1142early_param("mtrr_gran_size", parse_mtrr_gran_size_opt);
1143
1144static int nr_mtrr_spare_reg __initdata =
1145 CONFIG_MTRR_SANITIZER_SPARE_REG_NR_DEFAULT;
1146
1147static int __init parse_mtrr_spare_reg(char *arg)
1148{
1149 if (arg)
1150 nr_mtrr_spare_reg = simple_strtoul(arg, NULL, 0);
1151 return 0;
1152}
1153
1154early_param("mtrr_spare_reg_nr", parse_mtrr_spare_reg);
1155
1156static int __init
1157x86_setup_var_mtrrs(struct res_range *range, int nr_range,
1158 u64 chunk_size, u64 gran_size)
1159{
1160 struct var_mtrr_state var_state;
1161 int i;
1162 int num_reg;
1163
1164 var_state.range_startk = 0;
1165 var_state.range_sizek = 0;
1166 var_state.reg = 0;
1167 var_state.chunk_sizek = chunk_size >> 10;
1168 var_state.gran_sizek = gran_size >> 10;
1169
1170 memset(range_state, 0, sizeof(range_state));
1171
1172 /* Write the range etc */
1173 for (i = 0; i < nr_range; i++)
1174 set_var_mtrr_range(&var_state, range[i].start,
1175 range[i].end - range[i].start + 1);
1176
1177 /* Write the last range */
1178 if (var_state.range_sizek != 0)
1179 range_to_mtrr_with_hole(&var_state, 0, 0);
1180
1181 num_reg = var_state.reg;
1182 /* Clear out the extra MTRR's */
1183 while (var_state.reg < num_var_ranges) {
1184 save_var_mtrr(var_state.reg, 0, 0, 0);
1185 var_state.reg++;
1186 }
1187
1188 return num_reg;
1189}
1190
1191struct mtrr_cleanup_result {
1192 unsigned long gran_sizek;
1193 unsigned long chunk_sizek;
1194 unsigned long lose_cover_sizek;
1195 unsigned int num_reg;
1196 int bad;
1197};
1198
1199/*
1200 * gran_size: 64K, 128K, 256K, 512K, 1M, 2M, ..., 2G
1201 * chunk size: gran_size, ..., 2G
1202 * so we need (1+16)*8
1203 */
1204#define NUM_RESULT 136
1205#define PSHIFT (PAGE_SHIFT - 10)
1206
1207static struct mtrr_cleanup_result __initdata result[NUM_RESULT];
1208static unsigned long __initdata min_loss_pfn[RANGE_NUM];
1209
1210static void __init print_out_mtrr_range_state(void)
1211{
1212 int i;
1213 char start_factor = 'K', size_factor = 'K';
1214 unsigned long start_base, size_base;
1215 mtrr_type type;
1216
1217 for (i = 0; i < num_var_ranges; i++) {
1218
1219 size_base = range_state[i].size_pfn << (PAGE_SHIFT - 10);
1220 if (!size_base)
1221 continue;
1222
1223 size_base = to_size_factor(size_base, &size_factor),
1224 start_base = range_state[i].base_pfn << (PAGE_SHIFT - 10);
1225 start_base = to_size_factor(start_base, &start_factor),
1226 type = range_state[i].type;
1227
1228 printk(KERN_DEBUG "reg %d, base: %ld%cB, range: %ld%cB, type %s\n",
1229 i, start_base, start_factor,
1230 size_base, size_factor,
1231 (type == MTRR_TYPE_UNCACHABLE) ? "UC" :
1232 ((type == MTRR_TYPE_WRPROT) ? "WP" :
1233 ((type == MTRR_TYPE_WRBACK) ? "WB" : "Other"))
1234 );
1235 }
1236}
1237
1238static int __init mtrr_need_cleanup(void)
1239{
1240 int i;
1241 mtrr_type type;
1242 unsigned long size;
1243 /* extra one for all 0 */
1244 int num[MTRR_NUM_TYPES + 1];
1245
1246 /* check entries number */
1247 memset(num, 0, sizeof(num));
1248 for (i = 0; i < num_var_ranges; i++) {
1249 type = range_state[i].type;
1250 size = range_state[i].size_pfn;
1251 if (type >= MTRR_NUM_TYPES)
1252 continue;
1253 if (!size)
1254 type = MTRR_NUM_TYPES;
1255 if (type == MTRR_TYPE_WRPROT)
1256 type = MTRR_TYPE_UNCACHABLE;
1257 num[type]++;
1258 }
1259
1260 /* check if we got UC entries */
1261 if (!num[MTRR_TYPE_UNCACHABLE])
1262 return 0;
1263
1264 /* check if we only had WB and UC */
1265 if (num[MTRR_TYPE_WRBACK] + num[MTRR_TYPE_UNCACHABLE] !=
1266 num_var_ranges - num[MTRR_NUM_TYPES])
1267 return 0;
1268
1269 return 1;
1270}
1271
1272static unsigned long __initdata range_sums;
1273static void __init mtrr_calc_range_state(u64 chunk_size, u64 gran_size,
1274 unsigned long extra_remove_base,
1275 unsigned long extra_remove_size,
1276 int i)
1277{
1278 int num_reg;
1279 static struct res_range range_new[RANGE_NUM];
1280 static int nr_range_new;
1281 unsigned long range_sums_new;
1282
1283 /* convert ranges to var ranges state */
1284 num_reg = x86_setup_var_mtrrs(range, nr_range,
1285 chunk_size, gran_size);
1286
1287 /* we got new setting in range_state, check it */
1288 memset(range_new, 0, sizeof(range_new));
1289 nr_range_new = x86_get_mtrr_mem_range(range_new, 0,
1290 extra_remove_base, extra_remove_size);
1291 range_sums_new = sum_ranges(range_new, nr_range_new);
1292
1293 result[i].chunk_sizek = chunk_size >> 10;
1294 result[i].gran_sizek = gran_size >> 10;
1295 result[i].num_reg = num_reg;
1296 if (range_sums < range_sums_new) {
1297 result[i].lose_cover_sizek =
1298 (range_sums_new - range_sums) << PSHIFT;
1299 result[i].bad = 1;
1300 } else
1301 result[i].lose_cover_sizek =
1302 (range_sums - range_sums_new) << PSHIFT;
1303
1304 /* double check it */
1305 if (!result[i].bad && !result[i].lose_cover_sizek) {
1306 if (nr_range_new != nr_range ||
1307 memcmp(range, range_new, sizeof(range)))
1308 result[i].bad = 1;
1309 }
1310
1311 if (!result[i].bad && (range_sums - range_sums_new <
1312 min_loss_pfn[num_reg])) {
1313 min_loss_pfn[num_reg] =
1314 range_sums - range_sums_new;
1315 }
1316}
1317
1318static void __init mtrr_print_out_one_result(int i)
1319{
1320 char gran_factor, chunk_factor, lose_factor;
1321 unsigned long gran_base, chunk_base, lose_base;
1322
1323 gran_base = to_size_factor(result[i].gran_sizek, &gran_factor),
1324 chunk_base = to_size_factor(result[i].chunk_sizek, &chunk_factor),
1325 lose_base = to_size_factor(result[i].lose_cover_sizek, &lose_factor),
1326 printk(KERN_INFO "%sgran_size: %ld%c \tchunk_size: %ld%c \t",
1327 result[i].bad ? "*BAD*" : " ",
1328 gran_base, gran_factor, chunk_base, chunk_factor);
1329 printk(KERN_CONT "num_reg: %d \tlose cover RAM: %s%ld%c\n",
1330 result[i].num_reg, result[i].bad ? "-" : "",
1331 lose_base, lose_factor);
1332}
1333
1334static int __init mtrr_search_optimal_index(void)
1335{
1336 int i;
1337 int num_reg_good;
1338 int index_good;
1339
1340 if (nr_mtrr_spare_reg >= num_var_ranges)
1341 nr_mtrr_spare_reg = num_var_ranges - 1;
1342 num_reg_good = -1;
1343 for (i = num_var_ranges - nr_mtrr_spare_reg; i > 0; i--) {
1344 if (!min_loss_pfn[i])
1345 num_reg_good = i;
1346 }
1347
1348 index_good = -1;
1349 if (num_reg_good != -1) {
1350 for (i = 0; i < NUM_RESULT; i++) {
1351 if (!result[i].bad &&
1352 result[i].num_reg == num_reg_good &&
1353 !result[i].lose_cover_sizek) {
1354 index_good = i;
1355 break;
1356 }
1357 }
1358 }
1359
1360 return index_good;
1361}
1362
1363
1364static int __init mtrr_cleanup(unsigned address_bits)
1365{
1366 unsigned long extra_remove_base, extra_remove_size;
1367 unsigned long base, size, def, dummy;
1368 mtrr_type type;
1369 u64 chunk_size, gran_size;
1370 int index_good;
1371 int i;
1372
1373 if (!is_cpu(INTEL) || enable_mtrr_cleanup < 1)
1374 return 0;
1375 rdmsr(MTRRdefType_MSR, def, dummy);
1376 def &= 0xff;
1377 if (def != MTRR_TYPE_UNCACHABLE)
1378 return 0;
1379
1380 /* get it and store it aside */
1381 memset(range_state, 0, sizeof(range_state));
1382 for (i = 0; i < num_var_ranges; i++) {
1383 mtrr_if->get(i, &base, &size, &type);
1384 range_state[i].base_pfn = base;
1385 range_state[i].size_pfn = size;
1386 range_state[i].type = type;
1387 }
1388
1389 /* check if we need handle it and can handle it */
1390 if (!mtrr_need_cleanup())
1391 return 0;
1392
1393 /* print original var MTRRs at first, for debugging: */
1394 printk(KERN_DEBUG "original variable MTRRs\n");
1395 print_out_mtrr_range_state();
1396
1397 memset(range, 0, sizeof(range));
1398 extra_remove_size = 0;
1399 extra_remove_base = 1 << (32 - PAGE_SHIFT);
1400 if (mtrr_tom2)
1401 extra_remove_size =
1402 (mtrr_tom2 >> PAGE_SHIFT) - extra_remove_base;
1403 nr_range = x86_get_mtrr_mem_range(range, 0, extra_remove_base,
1404 extra_remove_size);
1405 /*
1406 * [0, 1M) should always be coverred by var mtrr with WB
1407 * and fixed mtrrs should take effective before var mtrr for it
1408 */
1409 nr_range = add_range_with_merge(range, nr_range, 0,
1410 (1ULL<<(20 - PAGE_SHIFT)) - 1);
1411 /* sort the ranges */
1412 sort(range, nr_range, sizeof(struct res_range), cmp_range, NULL);
1413
1414 range_sums = sum_ranges(range, nr_range);
1415 printk(KERN_INFO "total RAM coverred: %ldM\n",
1416 range_sums >> (20 - PAGE_SHIFT));
1417
1418 if (mtrr_chunk_size && mtrr_gran_size) {
1419 i = 0;
1420 mtrr_calc_range_state(mtrr_chunk_size, mtrr_gran_size,
1421 extra_remove_base, extra_remove_size, i);
1422
1423 mtrr_print_out_one_result(i);
1424
1425 if (!result[i].bad) {
1426 set_var_mtrr_all(address_bits);
1427 return 1;
1428 }
1429 printk(KERN_INFO "invalid mtrr_gran_size or mtrr_chunk_size, "
1430 "will find optimal one\n");
1431 }
1432
1433 i = 0;
1434 memset(min_loss_pfn, 0xff, sizeof(min_loss_pfn));
1435 memset(result, 0, sizeof(result));
1436 for (gran_size = (1ULL<<16); gran_size < (1ULL<<32); gran_size <<= 1) {
1437
1438 for (chunk_size = gran_size; chunk_size < (1ULL<<32);
1439 chunk_size <<= 1) {
1440
1441 if (i >= NUM_RESULT)
1442 continue;
1443
1444 mtrr_calc_range_state(chunk_size, gran_size,
1445 extra_remove_base, extra_remove_size, i);
1446 if (debug_print) {
1447 mtrr_print_out_one_result(i);
1448 printk(KERN_INFO "\n");
1449 }
1450
1451 i++;
1452 }
1453 }
1454
1455 /* try to find the optimal index */
1456 index_good = mtrr_search_optimal_index();
1457
1458 if (index_good != -1) {
1459 printk(KERN_INFO "Found optimal setting for mtrr clean up\n");
1460 i = index_good;
1461 mtrr_print_out_one_result(i);
1462
1463 /* convert ranges to var ranges state */
1464 chunk_size = result[i].chunk_sizek;
1465 chunk_size <<= 10;
1466 gran_size = result[i].gran_sizek;
1467 gran_size <<= 10;
1468 x86_setup_var_mtrrs(range, nr_range, chunk_size, gran_size);
1469 set_var_mtrr_all(address_bits);
1470 printk(KERN_DEBUG "New variable MTRRs\n");
1471 print_out_mtrr_range_state();
1472 return 1;
1473 } else {
1474 /* print out all */
1475 for (i = 0; i < NUM_RESULT; i++)
1476 mtrr_print_out_one_result(i);
1477 }
1478
1479 printk(KERN_INFO "mtrr_cleanup: can not find optimal value\n");
1480 printk(KERN_INFO "please specify mtrr_gran_size/mtrr_chunk_size\n");
1481
1482 return 0;
1483}
1484#else
1485static int __init mtrr_cleanup(unsigned address_bits)
1486{
1487 return 0;
1488}
1489#endif
1490
1491static int __initdata changed_by_mtrr_cleanup;
1492
1493static int disable_mtrr_trim;
1494
1495static int __init disable_mtrr_trim_setup(char *str)
1496{
1497 disable_mtrr_trim = 1;
1498 return 0;
1499}
1500early_param("disable_mtrr_trim", disable_mtrr_trim_setup);
1501
1502/*
1503 * Newer AMD K8s and later CPUs have a special magic MSR way to force WB
1504 * for memory >4GB. Check for that here.
1505 * Note this won't check if the MTRRs < 4GB where the magic bit doesn't
1506 * apply to are wrong, but so far we don't know of any such case in the wild.
1507 */
1508#define Tom2Enabled (1U << 21)
1509#define Tom2ForceMemTypeWB (1U << 22)
1510
1511int __init amd_special_default_mtrr(void)
1512{
1513 u32 l, h;
1514
1515 if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD)
1516 return 0;
1517 if (boot_cpu_data.x86 < 0xf || boot_cpu_data.x86 > 0x11)
1518 return 0;
1519 /* In case some hypervisor doesn't pass SYSCFG through */
1520 if (rdmsr_safe(MSR_K8_SYSCFG, &l, &h) < 0)
1521 return 0;
1522 /*
1523 * Memory between 4GB and top of mem is forced WB by this magic bit.
1524 * Reserved before K8RevF, but should be zero there.
1525 */
1526 if ((l & (Tom2Enabled | Tom2ForceMemTypeWB)) ==
1527 (Tom2Enabled | Tom2ForceMemTypeWB))
1528 return 1;
1529 return 0;
1530}
1531
1532static u64 __init real_trim_memory(unsigned long start_pfn,
1533 unsigned long limit_pfn)
1534{
1535 u64 trim_start, trim_size;
1536 trim_start = start_pfn;
1537 trim_start <<= PAGE_SHIFT;
1538 trim_size = limit_pfn;
1539 trim_size <<= PAGE_SHIFT;
1540 trim_size -= trim_start;
1541
1542 return e820_update_range(trim_start, trim_size, E820_RAM,
1543 E820_RESERVED);
1544}
1545/**
1546 * mtrr_trim_uncached_memory - trim RAM not covered by MTRRs
1547 * @end_pfn: ending page frame number
1548 *
1549 * Some buggy BIOSes don't setup the MTRRs properly for systems with certain
1550 * memory configurations. This routine checks that the highest MTRR matches
1551 * the end of memory, to make sure the MTRRs having a write back type cover
1552 * all of the memory the kernel is intending to use. If not, it'll trim any
1553 * memory off the end by adjusting end_pfn, removing it from the kernel's
1554 * allocation pools, warning the user with an obnoxious message.
1555 */
1556int __init mtrr_trim_uncached_memory(unsigned long end_pfn)
1557{
1558 unsigned long i, base, size, highest_pfn = 0, def, dummy;
1559 mtrr_type type;
1560 u64 total_trim_size;
1561
1562 /* extra one for all 0 */
1563 int num[MTRR_NUM_TYPES + 1];
1564 /*
1565 * Make sure we only trim uncachable memory on machines that
1566 * support the Intel MTRR architecture:
1567 */
1568 if (!is_cpu(INTEL) || disable_mtrr_trim)
1569 return 0;
1570 rdmsr(MTRRdefType_MSR, def, dummy);
1571 def &= 0xff;
1572 if (def != MTRR_TYPE_UNCACHABLE)
1573 return 0;
1574
1575 /* get it and store it aside */
1576 memset(range_state, 0, sizeof(range_state));
1577 for (i = 0; i < num_var_ranges; i++) {
1578 mtrr_if->get(i, &base, &size, &type);
1579 range_state[i].base_pfn = base;
1580 range_state[i].size_pfn = size;
1581 range_state[i].type = type;
1582 }
1583
1584 /* Find highest cached pfn */
1585 for (i = 0; i < num_var_ranges; i++) {
1586 type = range_state[i].type;
1587 if (type != MTRR_TYPE_WRBACK)
1588 continue;
1589 base = range_state[i].base_pfn;
1590 size = range_state[i].size_pfn;
1591 if (highest_pfn < base + size)
1592 highest_pfn = base + size;
1593 }
1594
1595 /* kvm/qemu doesn't have mtrr set right, don't trim them all */
1596 if (!highest_pfn) {
1597 printk(KERN_INFO "CPU MTRRs all blank - virtualized system.\n");
1598 return 0;
1599 }
1600
1601 /* check entries number */
1602 memset(num, 0, sizeof(num));
1603 for (i = 0; i < num_var_ranges; i++) {
1604 type = range_state[i].type;
1605 if (type >= MTRR_NUM_TYPES)
1606 continue;
1607 size = range_state[i].size_pfn;
1608 if (!size)
1609 type = MTRR_NUM_TYPES;
1610 num[type]++;
1611 }
1612
1613 /* no entry for WB? */
1614 if (!num[MTRR_TYPE_WRBACK])
1615 return 0;
1616
1617 /* check if we only had WB and UC */
1618 if (num[MTRR_TYPE_WRBACK] + num[MTRR_TYPE_UNCACHABLE] !=
1619 num_var_ranges - num[MTRR_NUM_TYPES])
1620 return 0;
1621
1622 memset(range, 0, sizeof(range));
1623 nr_range = 0;
1624 if (mtrr_tom2) {
1625 range[nr_range].start = (1ULL<<(32 - PAGE_SHIFT));
1626 range[nr_range].end = (mtrr_tom2 >> PAGE_SHIFT) - 1;
1627 if (highest_pfn < range[nr_range].end + 1)
1628 highest_pfn = range[nr_range].end + 1;
1629 nr_range++;
1630 }
1631 nr_range = x86_get_mtrr_mem_range(range, nr_range, 0, 0);
1632
1633 total_trim_size = 0;
1634 /* check the head */
1635 if (range[0].start)
1636 total_trim_size += real_trim_memory(0, range[0].start);
1637 /* check the holes */
1638 for (i = 0; i < nr_range - 1; i++) {
1639 if (range[i].end + 1 < range[i+1].start)
1640 total_trim_size += real_trim_memory(range[i].end + 1,
1641 range[i+1].start);
1642 }
1643 /* check the top */
1644 i = nr_range - 1;
1645 if (range[i].end + 1 < end_pfn)
1646 total_trim_size += real_trim_memory(range[i].end + 1,
1647 end_pfn);
1648
1649 if (total_trim_size) {
1650 printk(KERN_WARNING "WARNING: BIOS bug: CPU MTRRs don't cover"
1651 " all of memory, losing %lluMB of RAM.\n",
1652 total_trim_size >> 20);
1653
1654 if (!changed_by_mtrr_cleanup)
1655 WARN_ON(1);
1656
1657 printk(KERN_INFO "update e820 for mtrr\n");
1658 update_e820();
1659
1660 return 1;
1661 }
1662
1663 return 0;
1664}
1665 614
1666/** 615/**
1667 * mtrr_bp_init - initialize mtrrs on the boot CPU 616 * mtrr_bp_init - initialize mtrrs on the boot CPU
diff --git a/arch/x86/kernel/cpu/mtrr/mtrr.h b/arch/x86/kernel/cpu/mtrr/mtrr.h
index ffd60409cc6d..77f67f7b347a 100644
--- a/arch/x86/kernel/cpu/mtrr/mtrr.h
+++ b/arch/x86/kernel/cpu/mtrr/mtrr.h
@@ -79,6 +79,7 @@ extern struct mtrr_ops * mtrr_if;
79 79
80extern unsigned int num_var_ranges; 80extern unsigned int num_var_ranges;
81extern u64 mtrr_tom2; 81extern u64 mtrr_tom2;
82extern struct mtrr_state_type mtrr_state;
82 83
83void mtrr_state_warn(void); 84void mtrr_state_warn(void);
84const char *mtrr_attrib_to_str(int x); 85const char *mtrr_attrib_to_str(int x);
@@ -88,3 +89,6 @@ void mtrr_wrmsr(unsigned, unsigned, unsigned);
88int amd_init_mtrr(void); 89int amd_init_mtrr(void);
89int cyrix_init_mtrr(void); 90int cyrix_init_mtrr(void);
90int centaur_init_mtrr(void); 91int centaur_init_mtrr(void);
92
93extern int changed_by_mtrr_cleanup;
94extern int mtrr_cleanup(unsigned address_bits);
diff --git a/arch/x86/kernel/cpu/transmeta.c b/arch/x86/kernel/cpu/transmeta.c
index 52b3fefbd5af..bb62b3e5caad 100644
--- a/arch/x86/kernel/cpu/transmeta.c
+++ b/arch/x86/kernel/cpu/transmeta.c
@@ -98,7 +98,7 @@ static void __cpuinit init_transmeta(struct cpuinfo_x86 *c)
98#endif 98#endif
99} 99}
100 100
101static struct cpu_dev transmeta_cpu_dev __cpuinitdata = { 101static const struct cpu_dev __cpuinitconst transmeta_cpu_dev = {
102 .c_vendor = "Transmeta", 102 .c_vendor = "Transmeta",
103 .c_ident = { "GenuineTMx86", "TransmetaCPU" }, 103 .c_ident = { "GenuineTMx86", "TransmetaCPU" },
104 .c_early_init = early_init_transmeta, 104 .c_early_init = early_init_transmeta,
diff --git a/arch/x86/kernel/cpu/umc.c b/arch/x86/kernel/cpu/umc.c
index e777f79e0960..fd2c37bf7acb 100644
--- a/arch/x86/kernel/cpu/umc.c
+++ b/arch/x86/kernel/cpu/umc.c
@@ -8,7 +8,7 @@
8 * so no special init takes place. 8 * so no special init takes place.
9 */ 9 */
10 10
11static struct cpu_dev umc_cpu_dev __cpuinitdata = { 11static const struct cpu_dev __cpuinitconst umc_cpu_dev = {
12 .c_vendor = "UMC", 12 .c_vendor = "UMC",
13 .c_ident = { "UMC UMC UMC" }, 13 .c_ident = { "UMC UMC UMC" },
14 .c_models = { 14 .c_models = {
diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c
index 87d103ded1c3..dd2130b0fb3e 100644
--- a/arch/x86/kernel/dumpstack.c
+++ b/arch/x86/kernel/dumpstack.c
@@ -10,6 +10,7 @@
10#include <linux/kdebug.h> 10#include <linux/kdebug.h>
11#include <linux/module.h> 11#include <linux/module.h>
12#include <linux/ptrace.h> 12#include <linux/ptrace.h>
13#include <linux/ftrace.h>
13#include <linux/kexec.h> 14#include <linux/kexec.h>
14#include <linux/bug.h> 15#include <linux/bug.h>
15#include <linux/nmi.h> 16#include <linux/nmi.h>
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index 508bec1cee27..ef2c3563357d 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -110,19 +110,50 @@ int __init e820_all_mapped(u64 start, u64 end, unsigned type)
110/* 110/*
111 * Add a memory region to the kernel e820 map. 111 * Add a memory region to the kernel e820 map.
112 */ 112 */
113void __init e820_add_region(u64 start, u64 size, int type) 113static void __init __e820_add_region(struct e820map *e820x, u64 start, u64 size,
114 int type)
114{ 115{
115 int x = e820.nr_map; 116 int x = e820x->nr_map;
116 117
117 if (x == ARRAY_SIZE(e820.map)) { 118 if (x == ARRAY_SIZE(e820x->map)) {
118 printk(KERN_ERR "Ooops! Too many entries in the memory map!\n"); 119 printk(KERN_ERR "Ooops! Too many entries in the memory map!\n");
119 return; 120 return;
120 } 121 }
121 122
122 e820.map[x].addr = start; 123 e820x->map[x].addr = start;
123 e820.map[x].size = size; 124 e820x->map[x].size = size;
124 e820.map[x].type = type; 125 e820x->map[x].type = type;
125 e820.nr_map++; 126 e820x->nr_map++;
127}
128
129void __init e820_add_region(u64 start, u64 size, int type)
130{
131 __e820_add_region(&e820, start, size, type);
132}
133
134static void __init e820_print_type(u32 type)
135{
136 switch (type) {
137 case E820_RAM:
138 case E820_RESERVED_KERN:
139 printk(KERN_CONT "(usable)");
140 break;
141 case E820_RESERVED:
142 printk(KERN_CONT "(reserved)");
143 break;
144 case E820_ACPI:
145 printk(KERN_CONT "(ACPI data)");
146 break;
147 case E820_NVS:
148 printk(KERN_CONT "(ACPI NVS)");
149 break;
150 case E820_UNUSABLE:
151 printk(KERN_CONT "(unusable)");
152 break;
153 default:
154 printk(KERN_CONT "type %u", type);
155 break;
156 }
126} 157}
127 158
128void __init e820_print_map(char *who) 159void __init e820_print_map(char *who)
@@ -134,27 +165,8 @@ void __init e820_print_map(char *who)
134 (unsigned long long) e820.map[i].addr, 165 (unsigned long long) e820.map[i].addr,
135 (unsigned long long) 166 (unsigned long long)
136 (e820.map[i].addr + e820.map[i].size)); 167 (e820.map[i].addr + e820.map[i].size));
137 switch (e820.map[i].type) { 168 e820_print_type(e820.map[i].type);
138 case E820_RAM: 169 printk(KERN_CONT "\n");
139 case E820_RESERVED_KERN:
140 printk(KERN_CONT "(usable)\n");
141 break;
142 case E820_RESERVED:
143 printk(KERN_CONT "(reserved)\n");
144 break;
145 case E820_ACPI:
146 printk(KERN_CONT "(ACPI data)\n");
147 break;
148 case E820_NVS:
149 printk(KERN_CONT "(ACPI NVS)\n");
150 break;
151 case E820_UNUSABLE:
152 printk("(unusable)\n");
153 break;
154 default:
155 printk(KERN_CONT "type %u\n", e820.map[i].type);
156 break;
157 }
158 } 170 }
159} 171}
160 172
@@ -221,7 +233,7 @@ void __init e820_print_map(char *who)
221 */ 233 */
222 234
223int __init sanitize_e820_map(struct e820entry *biosmap, int max_nr_map, 235int __init sanitize_e820_map(struct e820entry *biosmap, int max_nr_map,
224 int *pnr_map) 236 u32 *pnr_map)
225{ 237{
226 struct change_member { 238 struct change_member {
227 struct e820entry *pbios; /* pointer to original bios entry */ 239 struct e820entry *pbios; /* pointer to original bios entry */
@@ -417,11 +429,12 @@ static int __init append_e820_map(struct e820entry *biosmap, int nr_map)
417 return __append_e820_map(biosmap, nr_map); 429 return __append_e820_map(biosmap, nr_map);
418} 430}
419 431
420static u64 __init e820_update_range_map(struct e820map *e820x, u64 start, 432static u64 __init __e820_update_range(struct e820map *e820x, u64 start,
421 u64 size, unsigned old_type, 433 u64 size, unsigned old_type,
422 unsigned new_type) 434 unsigned new_type)
423{ 435{
424 int i; 436 u64 end;
437 unsigned int i;
425 u64 real_updated_size = 0; 438 u64 real_updated_size = 0;
426 439
427 BUG_ON(old_type == new_type); 440 BUG_ON(old_type == new_type);
@@ -429,27 +442,55 @@ static u64 __init e820_update_range_map(struct e820map *e820x, u64 start,
429 if (size > (ULLONG_MAX - start)) 442 if (size > (ULLONG_MAX - start))
430 size = ULLONG_MAX - start; 443 size = ULLONG_MAX - start;
431 444
432 for (i = 0; i < e820.nr_map; i++) { 445 end = start + size;
446 printk(KERN_DEBUG "e820 update range: %016Lx - %016Lx ",
447 (unsigned long long) start,
448 (unsigned long long) end);
449 e820_print_type(old_type);
450 printk(KERN_CONT " ==> ");
451 e820_print_type(new_type);
452 printk(KERN_CONT "\n");
453
454 for (i = 0; i < e820x->nr_map; i++) {
433 struct e820entry *ei = &e820x->map[i]; 455 struct e820entry *ei = &e820x->map[i];
434 u64 final_start, final_end; 456 u64 final_start, final_end;
457 u64 ei_end;
458
435 if (ei->type != old_type) 459 if (ei->type != old_type)
436 continue; 460 continue;
437 /* totally covered? */ 461
438 if (ei->addr >= start && 462 ei_end = ei->addr + ei->size;
439 (ei->addr + ei->size) <= (start + size)) { 463 /* totally covered by new range? */
464 if (ei->addr >= start && ei_end <= end) {
440 ei->type = new_type; 465 ei->type = new_type;
441 real_updated_size += ei->size; 466 real_updated_size += ei->size;
442 continue; 467 continue;
443 } 468 }
469
470 /* new range is totally covered? */
471 if (ei->addr < start && ei_end > end) {
472 __e820_add_region(e820x, start, size, new_type);
473 __e820_add_region(e820x, end, ei_end - end, ei->type);
474 ei->size = start - ei->addr;
475 real_updated_size += size;
476 continue;
477 }
478
444 /* partially covered */ 479 /* partially covered */
445 final_start = max(start, ei->addr); 480 final_start = max(start, ei->addr);
446 final_end = min(start + size, ei->addr + ei->size); 481 final_end = min(end, ei_end);
447 if (final_start >= final_end) 482 if (final_start >= final_end)
448 continue; 483 continue;
449 e820_add_region(final_start, final_end - final_start, 484
450 new_type); 485 __e820_add_region(e820x, final_start, final_end - final_start,
486 new_type);
487
451 real_updated_size += final_end - final_start; 488 real_updated_size += final_end - final_start;
452 489
490 /*
491 * left range could be head or tail, so need to update
492 * size at first.
493 */
453 ei->size -= final_end - final_start; 494 ei->size -= final_end - final_start;
454 if (ei->addr < final_start) 495 if (ei->addr < final_start)
455 continue; 496 continue;
@@ -461,13 +502,13 @@ static u64 __init e820_update_range_map(struct e820map *e820x, u64 start,
461u64 __init e820_update_range(u64 start, u64 size, unsigned old_type, 502u64 __init e820_update_range(u64 start, u64 size, unsigned old_type,
462 unsigned new_type) 503 unsigned new_type)
463{ 504{
464 return e820_update_range_map(&e820, start, size, old_type, new_type); 505 return __e820_update_range(&e820, start, size, old_type, new_type);
465} 506}
466 507
467static u64 __init e820_update_range_saved(u64 start, u64 size, 508static u64 __init e820_update_range_saved(u64 start, u64 size,
468 unsigned old_type, unsigned new_type) 509 unsigned old_type, unsigned new_type)
469{ 510{
470 return e820_update_range_map(&e820_saved, start, size, old_type, 511 return __e820_update_range(&e820_saved, start, size, old_type,
471 new_type); 512 new_type);
472} 513}
473 514
@@ -511,7 +552,7 @@ u64 __init e820_remove_range(u64 start, u64 size, unsigned old_type,
511 552
512void __init update_e820(void) 553void __init update_e820(void)
513{ 554{
514 int nr_map; 555 u32 nr_map;
515 556
516 nr_map = e820.nr_map; 557 nr_map = e820.nr_map;
517 if (sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &nr_map)) 558 if (sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &nr_map))
@@ -522,7 +563,7 @@ void __init update_e820(void)
522} 563}
523static void __init update_e820_saved(void) 564static void __init update_e820_saved(void)
524{ 565{
525 int nr_map; 566 u32 nr_map;
526 567
527 nr_map = e820_saved.nr_map; 568 nr_map = e820_saved.nr_map;
528 if (sanitize_e820_map(e820_saved.map, ARRAY_SIZE(e820_saved.map), &nr_map)) 569 if (sanitize_e820_map(e820_saved.map, ARRAY_SIZE(e820_saved.map), &nr_map))
@@ -1020,8 +1061,8 @@ u64 __init find_e820_area_size(u64 start, u64 *sizep, u64 align)
1020 continue; 1061 continue;
1021 return addr; 1062 return addr;
1022 } 1063 }
1023 return -1UL;
1024 1064
1065 return -1ULL;
1025} 1066}
1026 1067
1027/* 1068/*
@@ -1034,13 +1075,22 @@ u64 __init early_reserve_e820(u64 startt, u64 sizet, u64 align)
1034 u64 start; 1075 u64 start;
1035 1076
1036 start = startt; 1077 start = startt;
1037 while (size < sizet) 1078 while (size < sizet && (start + 1))
1038 start = find_e820_area_size(start, &size, align); 1079 start = find_e820_area_size(start, &size, align);
1039 1080
1040 if (size < sizet) 1081 if (size < sizet)
1041 return 0; 1082 return 0;
1042 1083
1084#ifdef CONFIG_X86_32
1085 if (start >= MAXMEM)
1086 return 0;
1087 if (start + size > MAXMEM)
1088 size = MAXMEM - start;
1089#endif
1090
1043 addr = round_down(start + size - sizet, align); 1091 addr = round_down(start + size - sizet, align);
1092 if (addr < start)
1093 return 0;
1044 e820_update_range(addr, sizet, E820_RAM, E820_RESERVED); 1094 e820_update_range(addr, sizet, E820_RAM, E820_RESERVED);
1045 e820_update_range_saved(addr, sizet, E820_RAM, E820_RESERVED); 1095 e820_update_range_saved(addr, sizet, E820_RAM, E820_RESERVED);
1046 printk(KERN_INFO "update e820 for early_reserve_e820\n"); 1096 printk(KERN_INFO "update e820 for early_reserve_e820\n");
@@ -1253,7 +1303,7 @@ early_param("memmap", parse_memmap_opt);
1253void __init finish_e820_parsing(void) 1303void __init finish_e820_parsing(void)
1254{ 1304{
1255 if (userdef) { 1305 if (userdef) {
1256 int nr = e820.nr_map; 1306 u32 nr = e820.nr_map;
1257 1307
1258 if (sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &nr) < 0) 1308 if (sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &nr) < 0)
1259 early_panic("Invalid user supplied memory map"); 1309 early_panic("Invalid user supplied memory map");
@@ -1336,7 +1386,7 @@ void __init e820_reserve_resources_late(void)
1336char *__init default_machine_specific_memory_setup(void) 1386char *__init default_machine_specific_memory_setup(void)
1337{ 1387{
1338 char *who = "BIOS-e820"; 1388 char *who = "BIOS-e820";
1339 int new_nr; 1389 u32 new_nr;
1340 /* 1390 /*
1341 * Try to copy the BIOS-supplied E820-map. 1391 * Try to copy the BIOS-supplied E820-map.
1342 * 1392 *
diff --git a/arch/x86/kernel/early_printk.c b/arch/x86/kernel/early_printk.c
index 639ad98238a2..335f049d110f 100644
--- a/arch/x86/kernel/early_printk.c
+++ b/arch/x86/kernel/early_printk.c
@@ -250,7 +250,7 @@ static int dbgp_wait_until_complete(void)
250 return (ctrl & DBGP_ERROR) ? -DBGP_ERRCODE(ctrl) : DBGP_LEN(ctrl); 250 return (ctrl & DBGP_ERROR) ? -DBGP_ERRCODE(ctrl) : DBGP_LEN(ctrl);
251} 251}
252 252
253static void dbgp_mdelay(int ms) 253static void __init dbgp_mdelay(int ms)
254{ 254{
255 int i; 255 int i;
256 256
@@ -311,7 +311,7 @@ static void dbgp_set_data(const void *buf, int size)
311 writel(hi, &ehci_debug->data47); 311 writel(hi, &ehci_debug->data47);
312} 312}
313 313
314static void dbgp_get_data(void *buf, int size) 314static void __init dbgp_get_data(void *buf, int size)
315{ 315{
316 unsigned char *bytes = buf; 316 unsigned char *bytes = buf;
317 u32 lo, hi; 317 u32 lo, hi;
@@ -355,7 +355,7 @@ static int dbgp_bulk_write(unsigned devnum, unsigned endpoint,
355 return ret; 355 return ret;
356} 356}
357 357
358static int dbgp_bulk_read(unsigned devnum, unsigned endpoint, void *data, 358static int __init dbgp_bulk_read(unsigned devnum, unsigned endpoint, void *data,
359 int size) 359 int size)
360{ 360{
361 u32 pids, addr, ctrl; 361 u32 pids, addr, ctrl;
@@ -386,8 +386,8 @@ static int dbgp_bulk_read(unsigned devnum, unsigned endpoint, void *data,
386 return ret; 386 return ret;
387} 387}
388 388
389static int dbgp_control_msg(unsigned devnum, int requesttype, int request, 389static int __init dbgp_control_msg(unsigned devnum, int requesttype,
390 int value, int index, void *data, int size) 390 int request, int value, int index, void *data, int size)
391{ 391{
392 u32 pids, addr, ctrl; 392 u32 pids, addr, ctrl;
393 struct usb_ctrlrequest req; 393 struct usb_ctrlrequest req;
@@ -489,7 +489,7 @@ static u32 __init find_dbgp(int ehci_num, u32 *rbus, u32 *rslot, u32 *rfunc)
489 return 0; 489 return 0;
490} 490}
491 491
492static int ehci_reset_port(int port) 492static int __init ehci_reset_port(int port)
493{ 493{
494 u32 portsc; 494 u32 portsc;
495 u32 delay_time, delay; 495 u32 delay_time, delay;
@@ -532,7 +532,7 @@ static int ehci_reset_port(int port)
532 return -EBUSY; 532 return -EBUSY;
533} 533}
534 534
535static int ehci_wait_for_port(int port) 535static int __init ehci_wait_for_port(int port)
536{ 536{
537 u32 status; 537 u32 status;
538 int ret, reps; 538 int ret, reps;
@@ -557,13 +557,13 @@ static inline void dbgp_printk(const char *fmt, ...) { }
557 557
558typedef void (*set_debug_port_t)(int port); 558typedef void (*set_debug_port_t)(int port);
559 559
560static void default_set_debug_port(int port) 560static void __init default_set_debug_port(int port)
561{ 561{
562} 562}
563 563
564static set_debug_port_t set_debug_port = default_set_debug_port; 564static set_debug_port_t __initdata set_debug_port = default_set_debug_port;
565 565
566static void nvidia_set_debug_port(int port) 566static void __init nvidia_set_debug_port(int port)
567{ 567{
568 u32 dword; 568 u32 dword;
569 dword = read_pci_config(ehci_dev.bus, ehci_dev.slot, ehci_dev.func, 569 dword = read_pci_config(ehci_dev.bus, ehci_dev.slot, ehci_dev.func,
diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S
index 899e8938e79f..c929add475c9 100644
--- a/arch/x86/kernel/entry_32.S
+++ b/arch/x86/kernel/entry_32.S
@@ -442,8 +442,7 @@ sysenter_past_esp:
442 442
443 GET_THREAD_INFO(%ebp) 443 GET_THREAD_INFO(%ebp)
444 444
445 /* Note, _TIF_SECCOMP is bit number 8, and so it needs testw and not testb */ 445 testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags(%ebp)
446 testw $_TIF_WORK_SYSCALL_ENTRY,TI_flags(%ebp)
447 jnz sysenter_audit 446 jnz sysenter_audit
448sysenter_do_call: 447sysenter_do_call:
449 cmpl $(nr_syscalls), %eax 448 cmpl $(nr_syscalls), %eax
@@ -454,7 +453,7 @@ sysenter_do_call:
454 DISABLE_INTERRUPTS(CLBR_ANY) 453 DISABLE_INTERRUPTS(CLBR_ANY)
455 TRACE_IRQS_OFF 454 TRACE_IRQS_OFF
456 movl TI_flags(%ebp), %ecx 455 movl TI_flags(%ebp), %ecx
457 testw $_TIF_ALLWORK_MASK, %cx 456 testl $_TIF_ALLWORK_MASK, %ecx
458 jne sysexit_audit 457 jne sysexit_audit
459sysenter_exit: 458sysenter_exit:
460/* if something modifies registers it must also disable sysexit */ 459/* if something modifies registers it must also disable sysexit */
@@ -468,7 +467,7 @@ sysenter_exit:
468 467
469#ifdef CONFIG_AUDITSYSCALL 468#ifdef CONFIG_AUDITSYSCALL
470sysenter_audit: 469sysenter_audit:
471 testw $(_TIF_WORK_SYSCALL_ENTRY & ~_TIF_SYSCALL_AUDIT),TI_flags(%ebp) 470 testl $(_TIF_WORK_SYSCALL_ENTRY & ~_TIF_SYSCALL_AUDIT),TI_flags(%ebp)
472 jnz syscall_trace_entry 471 jnz syscall_trace_entry
473 addl $4,%esp 472 addl $4,%esp
474 CFI_ADJUST_CFA_OFFSET -4 473 CFI_ADJUST_CFA_OFFSET -4
@@ -485,7 +484,7 @@ sysenter_audit:
485 jmp sysenter_do_call 484 jmp sysenter_do_call
486 485
487sysexit_audit: 486sysexit_audit:
488 testw $(_TIF_ALLWORK_MASK & ~_TIF_SYSCALL_AUDIT), %cx 487 testl $(_TIF_ALLWORK_MASK & ~_TIF_SYSCALL_AUDIT), %ecx
489 jne syscall_exit_work 488 jne syscall_exit_work
490 TRACE_IRQS_ON 489 TRACE_IRQS_ON
491 ENABLE_INTERRUPTS(CLBR_ANY) 490 ENABLE_INTERRUPTS(CLBR_ANY)
@@ -498,7 +497,7 @@ sysexit_audit:
498 DISABLE_INTERRUPTS(CLBR_ANY) 497 DISABLE_INTERRUPTS(CLBR_ANY)
499 TRACE_IRQS_OFF 498 TRACE_IRQS_OFF
500 movl TI_flags(%ebp), %ecx 499 movl TI_flags(%ebp), %ecx
501 testw $(_TIF_ALLWORK_MASK & ~_TIF_SYSCALL_AUDIT), %cx 500 testl $(_TIF_ALLWORK_MASK & ~_TIF_SYSCALL_AUDIT), %ecx
502 jne syscall_exit_work 501 jne syscall_exit_work
503 movl PT_EAX(%esp),%eax /* reload syscall return value */ 502 movl PT_EAX(%esp),%eax /* reload syscall return value */
504 jmp sysenter_exit 503 jmp sysenter_exit
@@ -523,8 +522,7 @@ ENTRY(system_call)
523 SAVE_ALL 522 SAVE_ALL
524 GET_THREAD_INFO(%ebp) 523 GET_THREAD_INFO(%ebp)
525 # system call tracing in operation / emulation 524 # system call tracing in operation / emulation
526 /* Note, _TIF_SECCOMP is bit number 8, and so it needs testw and not testb */ 525 testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags(%ebp)
527 testw $_TIF_WORK_SYSCALL_ENTRY,TI_flags(%ebp)
528 jnz syscall_trace_entry 526 jnz syscall_trace_entry
529 cmpl $(nr_syscalls), %eax 527 cmpl $(nr_syscalls), %eax
530 jae syscall_badsys 528 jae syscall_badsys
@@ -538,7 +536,7 @@ syscall_exit:
538 # between sampling and the iret 536 # between sampling and the iret
539 TRACE_IRQS_OFF 537 TRACE_IRQS_OFF
540 movl TI_flags(%ebp), %ecx 538 movl TI_flags(%ebp), %ecx
541 testw $_TIF_ALLWORK_MASK, %cx # current->work 539 testl $_TIF_ALLWORK_MASK, %ecx # current->work
542 jne syscall_exit_work 540 jne syscall_exit_work
543 541
544restore_all: 542restore_all:
@@ -673,7 +671,7 @@ END(syscall_trace_entry)
673 # perform syscall exit tracing 671 # perform syscall exit tracing
674 ALIGN 672 ALIGN
675syscall_exit_work: 673syscall_exit_work:
676 testb $_TIF_WORK_SYSCALL_EXIT, %cl 674 testl $_TIF_WORK_SYSCALL_EXIT, %ecx
677 jz work_pending 675 jz work_pending
678 TRACE_IRQS_ON 676 TRACE_IRQS_ON
679 ENABLE_INTERRUPTS(CLBR_ANY) # could let syscall_trace_leave() call 677 ENABLE_INTERRUPTS(CLBR_ANY) # could let syscall_trace_leave() call
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
index 83d1836b9467..a331ec38af9e 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -368,6 +368,7 @@ ENTRY(save_rest)
368END(save_rest) 368END(save_rest)
369 369
370/* save complete stack frame */ 370/* save complete stack frame */
371 .pushsection .kprobes.text, "ax"
371ENTRY(save_paranoid) 372ENTRY(save_paranoid)
372 XCPT_FRAME 1 RDI+8 373 XCPT_FRAME 1 RDI+8
373 cld 374 cld
@@ -396,6 +397,7 @@ ENTRY(save_paranoid)
3961: ret 3971: ret
397 CFI_ENDPROC 398 CFI_ENDPROC
398END(save_paranoid) 399END(save_paranoid)
400 .popsection
399 401
400/* 402/*
401 * A newly forked process directly context switches into this address. 403 * A newly forked process directly context switches into this address.
@@ -416,7 +418,6 @@ ENTRY(ret_from_fork)
416 418
417 GET_THREAD_INFO(%rcx) 419 GET_THREAD_INFO(%rcx)
418 420
419 CFI_REMEMBER_STATE
420 RESTORE_REST 421 RESTORE_REST
421 422
422 testl $3, CS-ARGOFFSET(%rsp) # from kernel_thread? 423 testl $3, CS-ARGOFFSET(%rsp) # from kernel_thread?
@@ -428,7 +429,6 @@ ENTRY(ret_from_fork)
428 RESTORE_TOP_OF_STACK %rdi, -ARGOFFSET 429 RESTORE_TOP_OF_STACK %rdi, -ARGOFFSET
429 jmp ret_from_sys_call # go to the SYSRET fastpath 430 jmp ret_from_sys_call # go to the SYSRET fastpath
430 431
431 CFI_RESTORE_STATE
432 CFI_ENDPROC 432 CFI_ENDPROC
433END(ret_from_fork) 433END(ret_from_fork)
434 434
@@ -984,6 +984,8 @@ apicinterrupt UV_BAU_MESSAGE \
984#endif 984#endif
985apicinterrupt LOCAL_TIMER_VECTOR \ 985apicinterrupt LOCAL_TIMER_VECTOR \
986 apic_timer_interrupt smp_apic_timer_interrupt 986 apic_timer_interrupt smp_apic_timer_interrupt
987apicinterrupt GENERIC_INTERRUPT_VECTOR \
988 generic_interrupt smp_generic_interrupt
987 989
988#ifdef CONFIG_SMP 990#ifdef CONFIG_SMP
989apicinterrupt INVALIDATE_TLB_VECTOR_START+0 \ 991apicinterrupt INVALIDATE_TLB_VECTOR_START+0 \
diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c
index 231bdd3c5b1c..76f7141e0f91 100644
--- a/arch/x86/kernel/ftrace.c
+++ b/arch/x86/kernel/ftrace.c
@@ -389,79 +389,6 @@ void ftrace_nmi_exit(void)
389 389
390#endif /* !CONFIG_DYNAMIC_FTRACE */ 390#endif /* !CONFIG_DYNAMIC_FTRACE */
391 391
392/* Add a function return address to the trace stack on thread info.*/
393static int push_return_trace(unsigned long ret, unsigned long long time,
394 unsigned long func, int *depth)
395{
396 int index;
397
398 if (!current->ret_stack)
399 return -EBUSY;
400
401 /* The return trace stack is full */
402 if (current->curr_ret_stack == FTRACE_RETFUNC_DEPTH - 1) {
403 atomic_inc(&current->trace_overrun);
404 return -EBUSY;
405 }
406
407 index = ++current->curr_ret_stack;
408 barrier();
409 current->ret_stack[index].ret = ret;
410 current->ret_stack[index].func = func;
411 current->ret_stack[index].calltime = time;
412 *depth = index;
413
414 return 0;
415}
416
417/* Retrieve a function return address to the trace stack on thread info.*/
418static void pop_return_trace(struct ftrace_graph_ret *trace, unsigned long *ret)
419{
420 int index;
421
422 index = current->curr_ret_stack;
423
424 if (unlikely(index < 0)) {
425 ftrace_graph_stop();
426 WARN_ON(1);
427 /* Might as well panic, otherwise we have no where to go */
428 *ret = (unsigned long)panic;
429 return;
430 }
431
432 *ret = current->ret_stack[index].ret;
433 trace->func = current->ret_stack[index].func;
434 trace->calltime = current->ret_stack[index].calltime;
435 trace->overrun = atomic_read(&current->trace_overrun);
436 trace->depth = index;
437 barrier();
438 current->curr_ret_stack--;
439
440}
441
442/*
443 * Send the trace to the ring-buffer.
444 * @return the original return address.
445 */
446unsigned long ftrace_return_to_handler(void)
447{
448 struct ftrace_graph_ret trace;
449 unsigned long ret;
450
451 pop_return_trace(&trace, &ret);
452 trace.rettime = cpu_clock(raw_smp_processor_id());
453 ftrace_graph_return(&trace);
454
455 if (unlikely(!ret)) {
456 ftrace_graph_stop();
457 WARN_ON(1);
458 /* Might as well panic. What else to do? */
459 ret = (unsigned long)panic;
460 }
461
462 return ret;
463}
464
465/* 392/*
466 * Hook the return address and push it in the stack of return addrs 393 * Hook the return address and push it in the stack of return addrs
467 * in current thread info. 394 * in current thread info.
@@ -521,7 +448,7 @@ void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr)
521 448
522 calltime = cpu_clock(raw_smp_processor_id()); 449 calltime = cpu_clock(raw_smp_processor_id());
523 450
524 if (push_return_trace(old, calltime, 451 if (ftrace_push_return_trace(old, calltime,
525 self_addr, &trace.depth) == -EBUSY) { 452 self_addr, &trace.depth) == -EBUSY) {
526 *parent = old; 453 *parent = old;
527 return; 454 return;
diff --git a/arch/x86/kernel/head32.c b/arch/x86/kernel/head32.c
index ac108d1fe182..3f8579f8d42c 100644
--- a/arch/x86/kernel/head32.c
+++ b/arch/x86/kernel/head32.c
@@ -18,7 +18,7 @@ void __init i386_start_kernel(void)
18{ 18{
19 reserve_trampoline_memory(); 19 reserve_trampoline_memory();
20 20
21 reserve_early(__pa_symbol(&_text), __pa_symbol(&_end), "TEXT DATA BSS"); 21 reserve_early(__pa_symbol(&_text), __pa_symbol(&__bss_stop), "TEXT DATA BSS");
22 22
23#ifdef CONFIG_BLK_DEV_INITRD 23#ifdef CONFIG_BLK_DEV_INITRD
24 /* Reserve INITRD */ 24 /* Reserve INITRD */
@@ -29,9 +29,6 @@ void __init i386_start_kernel(void)
29 reserve_early(ramdisk_image, ramdisk_end, "RAMDISK"); 29 reserve_early(ramdisk_image, ramdisk_end, "RAMDISK");
30 } 30 }
31#endif 31#endif
32 reserve_early(init_pg_tables_start, init_pg_tables_end,
33 "INIT_PG_TABLE");
34
35 reserve_ebda_region(); 32 reserve_ebda_region();
36 33
37 /* 34 /*
diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c
index f5b272247690..70eaa852c732 100644
--- a/arch/x86/kernel/head64.c
+++ b/arch/x86/kernel/head64.c
@@ -100,7 +100,7 @@ void __init x86_64_start_reservations(char *real_mode_data)
100 100
101 reserve_trampoline_memory(); 101 reserve_trampoline_memory();
102 102
103 reserve_early(__pa_symbol(&_text), __pa_symbol(&_end), "TEXT DATA BSS"); 103 reserve_early(__pa_symbol(&_text), __pa_symbol(&__bss_stop), "TEXT DATA BSS");
104 104
105#ifdef CONFIG_BLK_DEV_INITRD 105#ifdef CONFIG_BLK_DEV_INITRD
106 /* Reserve INITRD */ 106 /* Reserve INITRD */
diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S
index c32ca19d591a..30683883e0cd 100644
--- a/arch/x86/kernel/head_32.S
+++ b/arch/x86/kernel/head_32.S
@@ -38,42 +38,40 @@
38#define X86_VENDOR_ID new_cpu_data+CPUINFO_x86_vendor_id 38#define X86_VENDOR_ID new_cpu_data+CPUINFO_x86_vendor_id
39 39
40/* 40/*
41 * This is how much memory *in addition to the memory covered up to 41 * This is how much memory in addition to the memory covered up to
42 * and including _end* we need mapped initially. 42 * and including _end we need mapped initially.
43 * We need: 43 * We need:
44 * - one bit for each possible page, but only in low memory, which means 44 * (KERNEL_IMAGE_SIZE/4096) / 1024 pages (worst case, non PAE)
45 * 2^32/4096/8 = 128K worst case (4G/4G split.) 45 * (KERNEL_IMAGE_SIZE/4096) / 512 + 4 pages (worst case for PAE)
46 * - enough space to map all low memory, which means
47 * (2^32/4096) / 1024 pages (worst case, non PAE)
48 * (2^32/4096) / 512 + 4 pages (worst case for PAE)
49 * - a few pages for allocator use before the kernel pagetable has
50 * been set up
51 * 46 *
52 * Modulo rounding, each megabyte assigned here requires a kilobyte of 47 * Modulo rounding, each megabyte assigned here requires a kilobyte of
53 * memory, which is currently unreclaimed. 48 * memory, which is currently unreclaimed.
54 * 49 *
55 * This should be a multiple of a page. 50 * This should be a multiple of a page.
51 *
52 * KERNEL_IMAGE_SIZE should be greater than pa(_end)
53 * and small than max_low_pfn, otherwise will waste some page table entries
56 */ 54 */
57LOW_PAGES = 1<<(32-PAGE_SHIFT_asm)
58
59/*
60 * To preserve the DMA pool in PAGEALLOC kernels, we'll allocate
61 * pagetables from above the 16MB DMA limit, so we'll have to set
62 * up pagetables 16MB more (worst-case):
63 */
64#ifdef CONFIG_DEBUG_PAGEALLOC
65LOW_PAGES = LOW_PAGES + 0x1000000
66#endif
67 55
68#if PTRS_PER_PMD > 1 56#if PTRS_PER_PMD > 1
69PAGE_TABLE_SIZE = (LOW_PAGES / PTRS_PER_PMD) + PTRS_PER_PGD 57#define PAGE_TABLE_SIZE(pages) (((pages) / PTRS_PER_PMD) + PTRS_PER_PGD)
70#else 58#else
71PAGE_TABLE_SIZE = (LOW_PAGES / PTRS_PER_PGD) 59#define PAGE_TABLE_SIZE(pages) ((pages) / PTRS_PER_PGD)
72#endif 60#endif
73BOOTBITMAP_SIZE = LOW_PAGES / 8
74ALLOCATOR_SLOP = 4
75 61
76INIT_MAP_BEYOND_END = BOOTBITMAP_SIZE + (PAGE_TABLE_SIZE + ALLOCATOR_SLOP)*PAGE_SIZE_asm 62/* Enough space to fit pagetables for the low memory linear map */
63MAPPING_BEYOND_END = \
64 PAGE_TABLE_SIZE(((1<<32) - __PAGE_OFFSET) >> PAGE_SHIFT) << PAGE_SHIFT
65
66/*
67 * Worst-case size of the kernel mapping we need to make:
68 * the worst-case size of the kernel itself, plus the extra we need
69 * to map for the linear map.
70 */
71KERNEL_PAGES = (KERNEL_IMAGE_SIZE + MAPPING_BEYOND_END)>>PAGE_SHIFT
72
73INIT_MAP_SIZE = PAGE_TABLE_SIZE(KERNEL_PAGES) * PAGE_SIZE_asm
74RESERVE_BRK(pagetables, INIT_MAP_SIZE)
77 75
78/* 76/*
79 * 32-bit kernel entrypoint; only used by the boot CPU. On entry, 77 * 32-bit kernel entrypoint; only used by the boot CPU. On entry,
@@ -166,10 +164,10 @@ num_subarch_entries = (. - subarch_entries) / 4
166 164
167/* 165/*
168 * Initialize page tables. This creates a PDE and a set of page 166 * Initialize page tables. This creates a PDE and a set of page
169 * tables, which are located immediately beyond _end. The variable 167 * tables, which are located immediately beyond __brk_base. The variable
170 * init_pg_tables_end is set up to point to the first "safe" location. 168 * _brk_end is set up to point to the first "safe" location.
171 * Mappings are created both at virtual address 0 (identity mapping) 169 * Mappings are created both at virtual address 0 (identity mapping)
172 * and PAGE_OFFSET for up to _end+sizeof(page tables)+INIT_MAP_BEYOND_END. 170 * and PAGE_OFFSET for up to _end.
173 * 171 *
174 * Note that the stack is not yet set up! 172 * Note that the stack is not yet set up!
175 */ 173 */
@@ -190,8 +188,7 @@ default_entry:
190 188
191 xorl %ebx,%ebx /* %ebx is kept at zero */ 189 xorl %ebx,%ebx /* %ebx is kept at zero */
192 190
193 movl $pa(pg0), %edi 191 movl $pa(__brk_base), %edi
194 movl %edi, pa(init_pg_tables_start)
195 movl $pa(swapper_pg_pmd), %edx 192 movl $pa(swapper_pg_pmd), %edx
196 movl $PTE_IDENT_ATTR, %eax 193 movl $PTE_IDENT_ATTR, %eax
19710: 19410:
@@ -209,14 +206,14 @@ default_entry:
209 loop 11b 206 loop 11b
210 207
211 /* 208 /*
212 * End condition: we must map up to and including INIT_MAP_BEYOND_END 209 * End condition: we must map up to the end + MAPPING_BEYOND_END.
213 * bytes beyond the end of our own page tables.
214 */ 210 */
215 leal (INIT_MAP_BEYOND_END+PTE_IDENT_ATTR)(%edi),%ebp 211 movl $pa(_end) + MAPPING_BEYOND_END + PTE_IDENT_ATTR, %ebp
216 cmpl %ebp,%eax 212 cmpl %ebp,%eax
217 jb 10b 213 jb 10b
2181: 2141:
219 movl %edi,pa(init_pg_tables_end) 215 addl $__PAGE_OFFSET, %edi
216 movl %edi, pa(_brk_end)
220 shrl $12, %eax 217 shrl $12, %eax
221 movl %eax, pa(max_pfn_mapped) 218 movl %eax, pa(max_pfn_mapped)
222 219
@@ -227,8 +224,7 @@ default_entry:
227 224
228page_pde_offset = (__PAGE_OFFSET >> 20); 225page_pde_offset = (__PAGE_OFFSET >> 20);
229 226
230 movl $pa(pg0), %edi 227 movl $pa(__brk_base), %edi
231 movl %edi, pa(init_pg_tables_start)
232 movl $pa(swapper_pg_dir), %edx 228 movl $pa(swapper_pg_dir), %edx
233 movl $PTE_IDENT_ATTR, %eax 229 movl $PTE_IDENT_ATTR, %eax
23410: 23010:
@@ -242,14 +238,13 @@ page_pde_offset = (__PAGE_OFFSET >> 20);
242 addl $0x1000,%eax 238 addl $0x1000,%eax
243 loop 11b 239 loop 11b
244 /* 240 /*
245 * End condition: we must map up to and including INIT_MAP_BEYOND_END 241 * End condition: we must map up to the end + MAPPING_BEYOND_END.
246 * bytes beyond the end of our own page tables; the +0x007 is
247 * the attribute bits
248 */ 242 */
249 leal (INIT_MAP_BEYOND_END+PTE_IDENT_ATTR)(%edi),%ebp 243 movl $pa(_end) + MAPPING_BEYOND_END + PTE_IDENT_ATTR, %ebp
250 cmpl %ebp,%eax 244 cmpl %ebp,%eax
251 jb 10b 245 jb 10b
252 movl %edi,pa(init_pg_tables_end) 246 addl $__PAGE_OFFSET, %edi
247 movl %edi, pa(_brk_end)
253 shrl $12, %eax 248 shrl $12, %eax
254 movl %eax, pa(max_pfn_mapped) 249 movl %eax, pa(max_pfn_mapped)
255 250
@@ -636,6 +631,7 @@ swapper_pg_fixmap:
636 .fill 1024,4,0 631 .fill 1024,4,0
637ENTRY(empty_zero_page) 632ENTRY(empty_zero_page)
638 .fill 4096,1,0 633 .fill 4096,1,0
634
639/* 635/*
640 * This starts the data section. 636 * This starts the data section.
641 */ 637 */
diff --git a/arch/x86/kernel/i8253.c b/arch/x86/kernel/i8253.c
index 10f92fb532f3..3475440baa54 100644
--- a/arch/x86/kernel/i8253.c
+++ b/arch/x86/kernel/i8253.c
@@ -3,17 +3,17 @@
3 * 3 *
4 */ 4 */
5#include <linux/clockchips.h> 5#include <linux/clockchips.h>
6#include <linux/init.h>
7#include <linux/interrupt.h> 6#include <linux/interrupt.h>
7#include <linux/spinlock.h>
8#include <linux/jiffies.h> 8#include <linux/jiffies.h>
9#include <linux/module.h> 9#include <linux/module.h>
10#include <linux/spinlock.h> 10#include <linux/delay.h>
11#include <linux/init.h>
12#include <linux/io.h>
11 13
12#include <asm/smp.h>
13#include <asm/delay.h>
14#include <asm/i8253.h> 14#include <asm/i8253.h>
15#include <asm/io.h>
16#include <asm/hpet.h> 15#include <asm/hpet.h>
16#include <asm/smp.h>
17 17
18DEFINE_SPINLOCK(i8253_lock); 18DEFINE_SPINLOCK(i8253_lock);
19EXPORT_SYMBOL(i8253_lock); 19EXPORT_SYMBOL(i8253_lock);
@@ -40,7 +40,7 @@ static void init_pit_timer(enum clock_event_mode mode,
40{ 40{
41 spin_lock(&i8253_lock); 41 spin_lock(&i8253_lock);
42 42
43 switch(mode) { 43 switch (mode) {
44 case CLOCK_EVT_MODE_PERIODIC: 44 case CLOCK_EVT_MODE_PERIODIC:
45 /* binary, mode 2, LSB/MSB, ch 0 */ 45 /* binary, mode 2, LSB/MSB, ch 0 */
46 outb_pit(0x34, PIT_MODE); 46 outb_pit(0x34, PIT_MODE);
@@ -95,7 +95,7 @@ static int pit_next_event(unsigned long delta, struct clock_event_device *evt)
95 * registered. This mechanism replaces the previous #ifdef LOCAL_APIC - 95 * registered. This mechanism replaces the previous #ifdef LOCAL_APIC -
96 * !using_apic_timer decisions in do_timer_interrupt_hook() 96 * !using_apic_timer decisions in do_timer_interrupt_hook()
97 */ 97 */
98static struct clock_event_device pit_clockevent = { 98static struct clock_event_device pit_ce = {
99 .name = "pit", 99 .name = "pit",
100 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, 100 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
101 .set_mode = init_pit_timer, 101 .set_mode = init_pit_timer,
@@ -114,15 +114,13 @@ void __init setup_pit_timer(void)
114 * Start pit with the boot cpu mask and make it global after the 114 * Start pit with the boot cpu mask and make it global after the
115 * IO_APIC has been initialized. 115 * IO_APIC has been initialized.
116 */ 116 */
117 pit_clockevent.cpumask = cpumask_of(smp_processor_id()); 117 pit_ce.cpumask = cpumask_of(smp_processor_id());
118 pit_clockevent.mult = div_sc(CLOCK_TICK_RATE, NSEC_PER_SEC, 118 pit_ce.mult = div_sc(CLOCK_TICK_RATE, NSEC_PER_SEC, pit_ce.shift);
119 pit_clockevent.shift); 119 pit_ce.max_delta_ns = clockevent_delta2ns(0x7FFF, &pit_ce);
120 pit_clockevent.max_delta_ns = 120 pit_ce.min_delta_ns = clockevent_delta2ns(0xF, &pit_ce);
121 clockevent_delta2ns(0x7FFF, &pit_clockevent); 121
122 pit_clockevent.min_delta_ns = 122 clockevents_register_device(&pit_ce);
123 clockevent_delta2ns(0xF, &pit_clockevent); 123 global_clock_event = &pit_ce;
124 clockevents_register_device(&pit_clockevent);
125 global_clock_event = &pit_clockevent;
126} 124}
127 125
128#ifndef CONFIG_X86_64 126#ifndef CONFIG_X86_64
@@ -133,11 +131,11 @@ void __init setup_pit_timer(void)
133 */ 131 */
134static cycle_t pit_read(void) 132static cycle_t pit_read(void)
135{ 133{
134 static int old_count;
135 static u32 old_jifs;
136 unsigned long flags; 136 unsigned long flags;
137 int count; 137 int count;
138 u32 jifs; 138 u32 jifs;
139 static int old_count;
140 static u32 old_jifs;
141 139
142 spin_lock_irqsave(&i8253_lock, flags); 140 spin_lock_irqsave(&i8253_lock, flags);
143 /* 141 /*
@@ -179,9 +177,9 @@ static cycle_t pit_read(void)
179 * Previous attempts to handle these cases intelligently were 177 * Previous attempts to handle these cases intelligently were
180 * buggy, so we just do the simple thing now. 178 * buggy, so we just do the simple thing now.
181 */ 179 */
182 if (count > old_count && jifs == old_jifs) { 180 if (count > old_count && jifs == old_jifs)
183 count = old_count; 181 count = old_count;
184 } 182
185 old_count = count; 183 old_count = count;
186 old_jifs = jifs; 184 old_jifs = jifs;
187 185
@@ -192,13 +190,13 @@ static cycle_t pit_read(void)
192 return (cycle_t)(jifs * LATCH) + count; 190 return (cycle_t)(jifs * LATCH) + count;
193} 191}
194 192
195static struct clocksource clocksource_pit = { 193static struct clocksource pit_cs = {
196 .name = "pit", 194 .name = "pit",
197 .rating = 110, 195 .rating = 110,
198 .read = pit_read, 196 .read = pit_read,
199 .mask = CLOCKSOURCE_MASK(32), 197 .mask = CLOCKSOURCE_MASK(32),
200 .mult = 0, 198 .mult = 0,
201 .shift = 20, 199 .shift = 20,
202}; 200};
203 201
204static void pit_disable_clocksource(void) 202static void pit_disable_clocksource(void)
@@ -206,9 +204,9 @@ static void pit_disable_clocksource(void)
206 /* 204 /*
207 * Use mult to check whether it is registered or not 205 * Use mult to check whether it is registered or not
208 */ 206 */
209 if (clocksource_pit.mult) { 207 if (pit_cs.mult) {
210 clocksource_unregister(&clocksource_pit); 208 clocksource_unregister(&pit_cs);
211 clocksource_pit.mult = 0; 209 pit_cs.mult = 0;
212 } 210 }
213} 211}
214 212
@@ -222,13 +220,13 @@ static int __init init_pit_clocksource(void)
222 * - when local APIC timer is active (PIT is switched off) 220 * - when local APIC timer is active (PIT is switched off)
223 */ 221 */
224 if (num_possible_cpus() > 1 || is_hpet_enabled() || 222 if (num_possible_cpus() > 1 || is_hpet_enabled() ||
225 pit_clockevent.mode != CLOCK_EVT_MODE_PERIODIC) 223 pit_ce.mode != CLOCK_EVT_MODE_PERIODIC)
226 return 0; 224 return 0;
227 225
228 clocksource_pit.mult = clocksource_hz2mult(CLOCK_TICK_RATE, 226 pit_cs.mult = clocksource_hz2mult(CLOCK_TICK_RATE, pit_cs.shift);
229 clocksource_pit.shift); 227
230 return clocksource_register(&clocksource_pit); 228 return clocksource_register(&pit_cs);
231} 229}
232arch_initcall(init_pit_clocksource); 230arch_initcall(init_pit_clocksource);
233 231
234#endif 232#endif /* !CONFIG_X86_64 */
diff --git a/arch/x86/kernel/io_delay.c b/arch/x86/kernel/io_delay.c
index 720d2607aacb..a979b5bd2fc0 100644
--- a/arch/x86/kernel/io_delay.c
+++ b/arch/x86/kernel/io_delay.c
@@ -7,10 +7,10 @@
7 */ 7 */
8#include <linux/kernel.h> 8#include <linux/kernel.h>
9#include <linux/module.h> 9#include <linux/module.h>
10#include <linux/init.h>
11#include <linux/delay.h> 10#include <linux/delay.h>
11#include <linux/init.h>
12#include <linux/dmi.h> 12#include <linux/dmi.h>
13#include <asm/io.h> 13#include <linux/io.h>
14 14
15int io_delay_type __read_mostly = CONFIG_DEFAULT_IO_DELAY_TYPE; 15int io_delay_type __read_mostly = CONFIG_DEFAULT_IO_DELAY_TYPE;
16 16
@@ -47,8 +47,7 @@ EXPORT_SYMBOL(native_io_delay);
47static int __init dmi_io_delay_0xed_port(const struct dmi_system_id *id) 47static int __init dmi_io_delay_0xed_port(const struct dmi_system_id *id)
48{ 48{
49 if (io_delay_type == CONFIG_IO_DELAY_TYPE_0X80) { 49 if (io_delay_type == CONFIG_IO_DELAY_TYPE_0X80) {
50 printk(KERN_NOTICE "%s: using 0xed I/O delay port\n", 50 pr_notice("%s: using 0xed I/O delay port\n", id->ident);
51 id->ident);
52 io_delay_type = CONFIG_IO_DELAY_TYPE_0XED; 51 io_delay_type = CONFIG_IO_DELAY_TYPE_0XED;
53 } 52 }
54 53
@@ -64,40 +63,40 @@ static struct dmi_system_id __initdata io_delay_0xed_port_dmi_table[] = {
64 .callback = dmi_io_delay_0xed_port, 63 .callback = dmi_io_delay_0xed_port,
65 .ident = "Compaq Presario V6000", 64 .ident = "Compaq Presario V6000",
66 .matches = { 65 .matches = {
67 DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"), 66 DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"),
68 DMI_MATCH(DMI_BOARD_NAME, "30B7") 67 DMI_MATCH(DMI_BOARD_NAME, "30B7")
69 } 68 }
70 }, 69 },
71 { 70 {
72 .callback = dmi_io_delay_0xed_port, 71 .callback = dmi_io_delay_0xed_port,
73 .ident = "HP Pavilion dv9000z", 72 .ident = "HP Pavilion dv9000z",
74 .matches = { 73 .matches = {
75 DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"), 74 DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"),
76 DMI_MATCH(DMI_BOARD_NAME, "30B9") 75 DMI_MATCH(DMI_BOARD_NAME, "30B9")
77 } 76 }
78 }, 77 },
79 { 78 {
80 .callback = dmi_io_delay_0xed_port, 79 .callback = dmi_io_delay_0xed_port,
81 .ident = "HP Pavilion dv6000", 80 .ident = "HP Pavilion dv6000",
82 .matches = { 81 .matches = {
83 DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"), 82 DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"),
84 DMI_MATCH(DMI_BOARD_NAME, "30B8") 83 DMI_MATCH(DMI_BOARD_NAME, "30B8")
85 } 84 }
86 }, 85 },
87 { 86 {
88 .callback = dmi_io_delay_0xed_port, 87 .callback = dmi_io_delay_0xed_port,
89 .ident = "HP Pavilion tx1000", 88 .ident = "HP Pavilion tx1000",
90 .matches = { 89 .matches = {
91 DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"), 90 DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"),
92 DMI_MATCH(DMI_BOARD_NAME, "30BF") 91 DMI_MATCH(DMI_BOARD_NAME, "30BF")
93 } 92 }
94 }, 93 },
95 { 94 {
96 .callback = dmi_io_delay_0xed_port, 95 .callback = dmi_io_delay_0xed_port,
97 .ident = "Presario F700", 96 .ident = "Presario F700",
98 .matches = { 97 .matches = {
99 DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"), 98 DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"),
100 DMI_MATCH(DMI_BOARD_NAME, "30D3") 99 DMI_MATCH(DMI_BOARD_NAME, "30D3")
101 } 100 }
102 }, 101 },
103 { } 102 { }
diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c
index f13ca1650aaf..3aaf7b9e3a8b 100644
--- a/arch/x86/kernel/irq.c
+++ b/arch/x86/kernel/irq.c
@@ -15,6 +15,9 @@
15 15
16atomic_t irq_err_count; 16atomic_t irq_err_count;
17 17
18/* Function pointer for generic interrupt vector handling */
19void (*generic_interrupt_extension)(void) = NULL;
20
18/* 21/*
19 * 'what should we do if we get a hw irq event on an illegal vector'. 22 * 'what should we do if we get a hw irq event on an illegal vector'.
20 * each architecture has to answer this themselves. 23 * each architecture has to answer this themselves.
@@ -42,55 +45,60 @@ void ack_bad_irq(unsigned int irq)
42/* 45/*
43 * /proc/interrupts printing: 46 * /proc/interrupts printing:
44 */ 47 */
45static int show_other_interrupts(struct seq_file *p) 48static int show_other_interrupts(struct seq_file *p, int prec)
46{ 49{
47 int j; 50 int j;
48 51
49 seq_printf(p, "NMI: "); 52 seq_printf(p, "%*s: ", prec, "NMI");
50 for_each_online_cpu(j) 53 for_each_online_cpu(j)
51 seq_printf(p, "%10u ", irq_stats(j)->__nmi_count); 54 seq_printf(p, "%10u ", irq_stats(j)->__nmi_count);
52 seq_printf(p, " Non-maskable interrupts\n"); 55 seq_printf(p, " Non-maskable interrupts\n");
53#ifdef CONFIG_X86_LOCAL_APIC 56#ifdef CONFIG_X86_LOCAL_APIC
54 seq_printf(p, "LOC: "); 57 seq_printf(p, "%*s: ", prec, "LOC");
55 for_each_online_cpu(j) 58 for_each_online_cpu(j)
56 seq_printf(p, "%10u ", irq_stats(j)->apic_timer_irqs); 59 seq_printf(p, "%10u ", irq_stats(j)->apic_timer_irqs);
57 seq_printf(p, " Local timer interrupts\n"); 60 seq_printf(p, " Local timer interrupts\n");
61
62 seq_printf(p, "%*s: ", prec, "SPU");
63 for_each_online_cpu(j)
64 seq_printf(p, "%10u ", irq_stats(j)->irq_spurious_count);
65 seq_printf(p, " Spurious interrupts\n");
58#endif 66#endif
67 if (generic_interrupt_extension) {
68 seq_printf(p, "PLT: ");
69 for_each_online_cpu(j)
70 seq_printf(p, "%10u ", irq_stats(j)->generic_irqs);
71 seq_printf(p, " Platform interrupts\n");
72 }
59#ifdef CONFIG_SMP 73#ifdef CONFIG_SMP
60 seq_printf(p, "RES: "); 74 seq_printf(p, "%*s: ", prec, "RES");
61 for_each_online_cpu(j) 75 for_each_online_cpu(j)
62 seq_printf(p, "%10u ", irq_stats(j)->irq_resched_count); 76 seq_printf(p, "%10u ", irq_stats(j)->irq_resched_count);
63 seq_printf(p, " Rescheduling interrupts\n"); 77 seq_printf(p, " Rescheduling interrupts\n");
64 seq_printf(p, "CAL: "); 78 seq_printf(p, "%*s: ", prec, "CAL");
65 for_each_online_cpu(j) 79 for_each_online_cpu(j)
66 seq_printf(p, "%10u ", irq_stats(j)->irq_call_count); 80 seq_printf(p, "%10u ", irq_stats(j)->irq_call_count);
67 seq_printf(p, " Function call interrupts\n"); 81 seq_printf(p, " Function call interrupts\n");
68 seq_printf(p, "TLB: "); 82 seq_printf(p, "%*s: ", prec, "TLB");
69 for_each_online_cpu(j) 83 for_each_online_cpu(j)
70 seq_printf(p, "%10u ", irq_stats(j)->irq_tlb_count); 84 seq_printf(p, "%10u ", irq_stats(j)->irq_tlb_count);
71 seq_printf(p, " TLB shootdowns\n"); 85 seq_printf(p, " TLB shootdowns\n");
72#endif 86#endif
73#ifdef CONFIG_X86_MCE 87#ifdef CONFIG_X86_MCE
74 seq_printf(p, "TRM: "); 88 seq_printf(p, "%*s: ", prec, "TRM");
75 for_each_online_cpu(j) 89 for_each_online_cpu(j)
76 seq_printf(p, "%10u ", irq_stats(j)->irq_thermal_count); 90 seq_printf(p, "%10u ", irq_stats(j)->irq_thermal_count);
77 seq_printf(p, " Thermal event interrupts\n"); 91 seq_printf(p, " Thermal event interrupts\n");
78# ifdef CONFIG_X86_64 92# ifdef CONFIG_X86_64
79 seq_printf(p, "THR: "); 93 seq_printf(p, "%*s: ", prec, "THR");
80 for_each_online_cpu(j) 94 for_each_online_cpu(j)
81 seq_printf(p, "%10u ", irq_stats(j)->irq_threshold_count); 95 seq_printf(p, "%10u ", irq_stats(j)->irq_threshold_count);
82 seq_printf(p, " Threshold APIC interrupts\n"); 96 seq_printf(p, " Threshold APIC interrupts\n");
83# endif 97# endif
84#endif 98#endif
85#ifdef CONFIG_X86_LOCAL_APIC 99 seq_printf(p, "%*s: %10u\n", prec, "ERR", atomic_read(&irq_err_count));
86 seq_printf(p, "SPU: ");
87 for_each_online_cpu(j)
88 seq_printf(p, "%10u ", irq_stats(j)->irq_spurious_count);
89 seq_printf(p, " Spurious interrupts\n");
90#endif
91 seq_printf(p, "ERR: %10u\n", atomic_read(&irq_err_count));
92#if defined(CONFIG_X86_IO_APIC) 100#if defined(CONFIG_X86_IO_APIC)
93 seq_printf(p, "MIS: %10u\n", atomic_read(&irq_mis_count)); 101 seq_printf(p, "%*s: %10u\n", prec, "MIS", atomic_read(&irq_mis_count));
94#endif 102#endif
95 return 0; 103 return 0;
96} 104}
@@ -98,19 +106,22 @@ static int show_other_interrupts(struct seq_file *p)
98int show_interrupts(struct seq_file *p, void *v) 106int show_interrupts(struct seq_file *p, void *v)
99{ 107{
100 unsigned long flags, any_count = 0; 108 unsigned long flags, any_count = 0;
101 int i = *(loff_t *) v, j; 109 int i = *(loff_t *) v, j, prec;
102 struct irqaction *action; 110 struct irqaction *action;
103 struct irq_desc *desc; 111 struct irq_desc *desc;
104 112
105 if (i > nr_irqs) 113 if (i > nr_irqs)
106 return 0; 114 return 0;
107 115
116 for (prec = 3, j = 1000; prec < 10 && j <= nr_irqs; ++prec)
117 j *= 10;
118
108 if (i == nr_irqs) 119 if (i == nr_irqs)
109 return show_other_interrupts(p); 120 return show_other_interrupts(p, prec);
110 121
111 /* print header */ 122 /* print header */
112 if (i == 0) { 123 if (i == 0) {
113 seq_printf(p, " "); 124 seq_printf(p, "%*s", prec + 8, "");
114 for_each_online_cpu(j) 125 for_each_online_cpu(j)
115 seq_printf(p, "CPU%-8d", j); 126 seq_printf(p, "CPU%-8d", j);
116 seq_putc(p, '\n'); 127 seq_putc(p, '\n');
@@ -121,23 +132,15 @@ int show_interrupts(struct seq_file *p, void *v)
121 return 0; 132 return 0;
122 133
123 spin_lock_irqsave(&desc->lock, flags); 134 spin_lock_irqsave(&desc->lock, flags);
124#ifndef CONFIG_SMP
125 any_count = kstat_irqs(i);
126#else
127 for_each_online_cpu(j) 135 for_each_online_cpu(j)
128 any_count |= kstat_irqs_cpu(i, j); 136 any_count |= kstat_irqs_cpu(i, j);
129#endif
130 action = desc->action; 137 action = desc->action;
131 if (!action && !any_count) 138 if (!action && !any_count)
132 goto out; 139 goto out;
133 140
134 seq_printf(p, "%3d: ", i); 141 seq_printf(p, "%*d: ", prec, i);
135#ifndef CONFIG_SMP
136 seq_printf(p, "%10u ", kstat_irqs(i));
137#else
138 for_each_online_cpu(j) 142 for_each_online_cpu(j)
139 seq_printf(p, "%10u ", kstat_irqs_cpu(i, j)); 143 seq_printf(p, "%10u ", kstat_irqs_cpu(i, j));
140#endif
141 seq_printf(p, " %8s", desc->chip->name); 144 seq_printf(p, " %8s", desc->chip->name);
142 seq_printf(p, "-%-8s", desc->name); 145 seq_printf(p, "-%-8s", desc->name);
143 146
@@ -162,7 +165,10 @@ u64 arch_irq_stat_cpu(unsigned int cpu)
162 165
163#ifdef CONFIG_X86_LOCAL_APIC 166#ifdef CONFIG_X86_LOCAL_APIC
164 sum += irq_stats(cpu)->apic_timer_irqs; 167 sum += irq_stats(cpu)->apic_timer_irqs;
168 sum += irq_stats(cpu)->irq_spurious_count;
165#endif 169#endif
170 if (generic_interrupt_extension)
171 sum += irq_stats(cpu)->generic_irqs;
166#ifdef CONFIG_SMP 172#ifdef CONFIG_SMP
167 sum += irq_stats(cpu)->irq_resched_count; 173 sum += irq_stats(cpu)->irq_resched_count;
168 sum += irq_stats(cpu)->irq_call_count; 174 sum += irq_stats(cpu)->irq_call_count;
@@ -174,9 +180,6 @@ u64 arch_irq_stat_cpu(unsigned int cpu)
174 sum += irq_stats(cpu)->irq_threshold_count; 180 sum += irq_stats(cpu)->irq_threshold_count;
175#endif 181#endif
176#endif 182#endif
177#ifdef CONFIG_X86_LOCAL_APIC
178 sum += irq_stats(cpu)->irq_spurious_count;
179#endif
180 return sum; 183 return sum;
181} 184}
182 185
@@ -226,4 +229,27 @@ unsigned int __irq_entry do_IRQ(struct pt_regs *regs)
226 return 1; 229 return 1;
227} 230}
228 231
232/*
233 * Handler for GENERIC_INTERRUPT_VECTOR.
234 */
235void smp_generic_interrupt(struct pt_regs *regs)
236{
237 struct pt_regs *old_regs = set_irq_regs(regs);
238
239 ack_APIC_irq();
240
241 exit_idle();
242
243 irq_enter();
244
245 inc_irq_stat(generic_irqs);
246
247 if (generic_interrupt_extension)
248 generic_interrupt_extension();
249
250 irq_exit();
251
252 set_irq_regs(old_regs);
253}
254
229EXPORT_SYMBOL_GPL(vector_used_by_percpu_irq); 255EXPORT_SYMBOL_GPL(vector_used_by_percpu_irq);
diff --git a/arch/x86/kernel/irqinit_32.c b/arch/x86/kernel/irqinit_32.c
index 50b8c3a3006c..368b0a8836f9 100644
--- a/arch/x86/kernel/irqinit_32.c
+++ b/arch/x86/kernel/irqinit_32.c
@@ -50,7 +50,6 @@ static irqreturn_t math_error_irq(int cpl, void *dev_id)
50 */ 50 */
51static struct irqaction fpu_irq = { 51static struct irqaction fpu_irq = {
52 .handler = math_error_irq, 52 .handler = math_error_irq,
53 .mask = CPU_MASK_NONE,
54 .name = "fpu", 53 .name = "fpu",
55}; 54};
56 55
@@ -83,7 +82,6 @@ void __init init_ISA_irqs(void)
83 */ 82 */
84static struct irqaction irq2 = { 83static struct irqaction irq2 = {
85 .handler = no_action, 84 .handler = no_action,
86 .mask = CPU_MASK_NONE,
87 .name = "cascade", 85 .name = "cascade",
88}; 86};
89 87
@@ -175,6 +173,9 @@ void __init native_init_IRQ(void)
175 /* self generated IPI for local APIC timer */ 173 /* self generated IPI for local APIC timer */
176 alloc_intr_gate(LOCAL_TIMER_VECTOR, apic_timer_interrupt); 174 alloc_intr_gate(LOCAL_TIMER_VECTOR, apic_timer_interrupt);
177 175
176 /* generic IPI for platform specific use */
177 alloc_intr_gate(GENERIC_INTERRUPT_VECTOR, generic_interrupt);
178
178 /* IPI vectors for APIC spurious and error interrupts */ 179 /* IPI vectors for APIC spurious and error interrupts */
179 alloc_intr_gate(SPURIOUS_APIC_VECTOR, spurious_interrupt); 180 alloc_intr_gate(SPURIOUS_APIC_VECTOR, spurious_interrupt);
180 alloc_intr_gate(ERROR_APIC_VECTOR, error_interrupt); 181 alloc_intr_gate(ERROR_APIC_VECTOR, error_interrupt);
diff --git a/arch/x86/kernel/irqinit_64.c b/arch/x86/kernel/irqinit_64.c
index da481a1e3f30..8cd10537fd46 100644
--- a/arch/x86/kernel/irqinit_64.c
+++ b/arch/x86/kernel/irqinit_64.c
@@ -45,7 +45,6 @@
45 45
46static struct irqaction irq2 = { 46static struct irqaction irq2 = {
47 .handler = no_action, 47 .handler = no_action,
48 .mask = CPU_MASK_NONE,
49 .name = "cascade", 48 .name = "cascade",
50}; 49};
51DEFINE_PER_CPU(vector_irq_t, vector_irq) = { 50DEFINE_PER_CPU(vector_irq_t, vector_irq) = {
@@ -147,6 +146,9 @@ static void __init apic_intr_init(void)
147 /* self generated IPI for local APIC timer */ 146 /* self generated IPI for local APIC timer */
148 alloc_intr_gate(LOCAL_TIMER_VECTOR, apic_timer_interrupt); 147 alloc_intr_gate(LOCAL_TIMER_VECTOR, apic_timer_interrupt);
149 148
149 /* generic IPI for platform specific use */
150 alloc_intr_gate(GENERIC_INTERRUPT_VECTOR, generic_interrupt);
151
150 /* IPI vectors for APIC spurious and error interrupts */ 152 /* IPI vectors for APIC spurious and error interrupts */
151 alloc_intr_gate(SPURIOUS_APIC_VECTOR, spurious_interrupt); 153 alloc_intr_gate(SPURIOUS_APIC_VECTOR, spurious_interrupt);
152 alloc_intr_gate(ERROR_APIC_VECTOR, error_interrupt); 154 alloc_intr_gate(ERROR_APIC_VECTOR, error_interrupt);
diff --git a/arch/x86/kernel/kdebugfs.c b/arch/x86/kernel/kdebugfs.c
index ff7d3b0124f1..e444357375ce 100644
--- a/arch/x86/kernel/kdebugfs.c
+++ b/arch/x86/kernel/kdebugfs.c
@@ -8,11 +8,11 @@
8 */ 8 */
9#include <linux/debugfs.h> 9#include <linux/debugfs.h>
10#include <linux/uaccess.h> 10#include <linux/uaccess.h>
11#include <linux/stat.h> 11#include <linux/module.h>
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/stat.h>
13#include <linux/io.h> 14#include <linux/io.h>
14#include <linux/mm.h> 15#include <linux/mm.h>
15#include <linux/module.h>
16 16
17#include <asm/setup.h> 17#include <asm/setup.h>
18 18
@@ -26,9 +26,8 @@ struct setup_data_node {
26 u32 len; 26 u32 len;
27}; 27};
28 28
29static ssize_t 29static ssize_t setup_data_read(struct file *file, char __user *user_buf,
30setup_data_read(struct file *file, char __user *user_buf, size_t count, 30 size_t count, loff_t *ppos)
31 loff_t *ppos)
32{ 31{
33 struct setup_data_node *node = file->private_data; 32 struct setup_data_node *node = file->private_data;
34 unsigned long remain; 33 unsigned long remain;
@@ -39,20 +38,21 @@ setup_data_read(struct file *file, char __user *user_buf, size_t count,
39 38
40 if (pos < 0) 39 if (pos < 0)
41 return -EINVAL; 40 return -EINVAL;
41
42 if (pos >= node->len) 42 if (pos >= node->len)
43 return 0; 43 return 0;
44 44
45 if (count > node->len - pos) 45 if (count > node->len - pos)
46 count = node->len - pos; 46 count = node->len - pos;
47
47 pa = node->paddr + sizeof(struct setup_data) + pos; 48 pa = node->paddr + sizeof(struct setup_data) + pos;
48 pg = pfn_to_page((pa + count - 1) >> PAGE_SHIFT); 49 pg = pfn_to_page((pa + count - 1) >> PAGE_SHIFT);
49 if (PageHighMem(pg)) { 50 if (PageHighMem(pg)) {
50 p = ioremap_cache(pa, count); 51 p = ioremap_cache(pa, count);
51 if (!p) 52 if (!p)
52 return -ENXIO; 53 return -ENXIO;
53 } else { 54 } else
54 p = __va(pa); 55 p = __va(pa);
55 }
56 56
57 remain = copy_to_user(user_buf, p, count); 57 remain = copy_to_user(user_buf, p, count);
58 58
@@ -70,12 +70,13 @@ setup_data_read(struct file *file, char __user *user_buf, size_t count,
70static int setup_data_open(struct inode *inode, struct file *file) 70static int setup_data_open(struct inode *inode, struct file *file)
71{ 71{
72 file->private_data = inode->i_private; 72 file->private_data = inode->i_private;
73
73 return 0; 74 return 0;
74} 75}
75 76
76static const struct file_operations fops_setup_data = { 77static const struct file_operations fops_setup_data = {
77 .read = setup_data_read, 78 .read = setup_data_read,
78 .open = setup_data_open, 79 .open = setup_data_open,
79}; 80};
80 81
81static int __init 82static int __init
@@ -84,57 +85,50 @@ create_setup_data_node(struct dentry *parent, int no,
84{ 85{
85 struct dentry *d, *type, *data; 86 struct dentry *d, *type, *data;
86 char buf[16]; 87 char buf[16];
87 int error;
88 88
89 sprintf(buf, "%d", no); 89 sprintf(buf, "%d", no);
90 d = debugfs_create_dir(buf, parent); 90 d = debugfs_create_dir(buf, parent);
91 if (!d) { 91 if (!d)
92 error = -ENOMEM; 92 return -ENOMEM;
93 goto err_return; 93
94 }
95 type = debugfs_create_x32("type", S_IRUGO, d, &node->type); 94 type = debugfs_create_x32("type", S_IRUGO, d, &node->type);
96 if (!type) { 95 if (!type)
97 error = -ENOMEM;
98 goto err_dir; 96 goto err_dir;
99 } 97
100 data = debugfs_create_file("data", S_IRUGO, d, node, &fops_setup_data); 98 data = debugfs_create_file("data", S_IRUGO, d, node, &fops_setup_data);
101 if (!data) { 99 if (!data)
102 error = -ENOMEM;
103 goto err_type; 100 goto err_type;
104 } 101
105 return 0; 102 return 0;
106 103
107err_type: 104err_type:
108 debugfs_remove(type); 105 debugfs_remove(type);
109err_dir: 106err_dir:
110 debugfs_remove(d); 107 debugfs_remove(d);
111err_return: 108 return -ENOMEM;
112 return error;
113} 109}
114 110
115static int __init create_setup_data_nodes(struct dentry *parent) 111static int __init create_setup_data_nodes(struct dentry *parent)
116{ 112{
117 struct setup_data_node *node; 113 struct setup_data_node *node;
118 struct setup_data *data; 114 struct setup_data *data;
119 int error, no = 0; 115 int error = -ENOMEM;
120 struct dentry *d; 116 struct dentry *d;
121 struct page *pg; 117 struct page *pg;
122 u64 pa_data; 118 u64 pa_data;
119 int no = 0;
123 120
124 d = debugfs_create_dir("setup_data", parent); 121 d = debugfs_create_dir("setup_data", parent);
125 if (!d) { 122 if (!d)
126 error = -ENOMEM; 123 return -ENOMEM;
127 goto err_return;
128 }
129 124
130 pa_data = boot_params.hdr.setup_data; 125 pa_data = boot_params.hdr.setup_data;
131 126
132 while (pa_data) { 127 while (pa_data) {
133 node = kmalloc(sizeof(*node), GFP_KERNEL); 128 node = kmalloc(sizeof(*node), GFP_KERNEL);
134 if (!node) { 129 if (!node)
135 error = -ENOMEM;
136 goto err_dir; 130 goto err_dir;
137 } 131
138 pg = pfn_to_page((pa_data+sizeof(*data)-1) >> PAGE_SHIFT); 132 pg = pfn_to_page((pa_data+sizeof(*data)-1) >> PAGE_SHIFT);
139 if (PageHighMem(pg)) { 133 if (PageHighMem(pg)) {
140 data = ioremap_cache(pa_data, sizeof(*data)); 134 data = ioremap_cache(pa_data, sizeof(*data));
@@ -143,9 +137,8 @@ static int __init create_setup_data_nodes(struct dentry *parent)
143 error = -ENXIO; 137 error = -ENXIO;
144 goto err_dir; 138 goto err_dir;
145 } 139 }
146 } else { 140 } else
147 data = __va(pa_data); 141 data = __va(pa_data);
148 }
149 142
150 node->paddr = pa_data; 143 node->paddr = pa_data;
151 node->type = data->type; 144 node->type = data->type;
@@ -159,11 +152,11 @@ static int __init create_setup_data_nodes(struct dentry *parent)
159 goto err_dir; 152 goto err_dir;
160 no++; 153 no++;
161 } 154 }
155
162 return 0; 156 return 0;
163 157
164err_dir: 158err_dir:
165 debugfs_remove(d); 159 debugfs_remove(d);
166err_return:
167 return error; 160 return error;
168} 161}
169 162
@@ -175,28 +168,26 @@ static struct debugfs_blob_wrapper boot_params_blob = {
175static int __init boot_params_kdebugfs_init(void) 168static int __init boot_params_kdebugfs_init(void)
176{ 169{
177 struct dentry *dbp, *version, *data; 170 struct dentry *dbp, *version, *data;
178 int error; 171 int error = -ENOMEM;
179 172
180 dbp = debugfs_create_dir("boot_params", NULL); 173 dbp = debugfs_create_dir("boot_params", NULL);
181 if (!dbp) { 174 if (!dbp)
182 error = -ENOMEM; 175 return -ENOMEM;
183 goto err_return; 176
184 }
185 version = debugfs_create_x16("version", S_IRUGO, dbp, 177 version = debugfs_create_x16("version", S_IRUGO, dbp,
186 &boot_params.hdr.version); 178 &boot_params.hdr.version);
187 if (!version) { 179 if (!version)
188 error = -ENOMEM;
189 goto err_dir; 180 goto err_dir;
190 } 181
191 data = debugfs_create_blob("data", S_IRUGO, dbp, 182 data = debugfs_create_blob("data", S_IRUGO, dbp,
192 &boot_params_blob); 183 &boot_params_blob);
193 if (!data) { 184 if (!data)
194 error = -ENOMEM;
195 goto err_version; 185 goto err_version;
196 } 186
197 error = create_setup_data_nodes(dbp); 187 error = create_setup_data_nodes(dbp);
198 if (error) 188 if (error)
199 goto err_data; 189 goto err_data;
190
200 return 0; 191 return 0;
201 192
202err_data: 193err_data:
@@ -205,10 +196,9 @@ err_version:
205 debugfs_remove(version); 196 debugfs_remove(version);
206err_dir: 197err_dir:
207 debugfs_remove(dbp); 198 debugfs_remove(dbp);
208err_return:
209 return error; 199 return error;
210} 200}
211#endif 201#endif /* CONFIG_DEBUG_BOOT_PARAMS */
212 202
213static int __init arch_kdebugfs_init(void) 203static int __init arch_kdebugfs_init(void)
214{ 204{
diff --git a/arch/x86/kernel/kprobes.c b/arch/x86/kernel/kprobes.c
index 4558dd3918cf..55b94614e348 100644
--- a/arch/x86/kernel/kprobes.c
+++ b/arch/x86/kernel/kprobes.c
@@ -193,7 +193,7 @@ static int __kprobes can_boost(kprobe_opcode_t *opcodes)
193 kprobe_opcode_t opcode; 193 kprobe_opcode_t opcode;
194 kprobe_opcode_t *orig_opcodes = opcodes; 194 kprobe_opcode_t *orig_opcodes = opcodes;
195 195
196 if (search_exception_tables(opcodes)) 196 if (search_exception_tables((unsigned long)opcodes))
197 return 0; /* Page fault may occur on this address. */ 197 return 0; /* Page fault may occur on this address. */
198 198
199retry: 199retry:
diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
index 478bca986eca..33019ddb56b4 100644
--- a/arch/x86/kernel/kvm.c
+++ b/arch/x86/kernel/kvm.c
@@ -138,12 +138,6 @@ static void kvm_set_pte_atomic(pte_t *ptep, pte_t pte)
138 kvm_mmu_write(ptep, pte_val(pte)); 138 kvm_mmu_write(ptep, pte_val(pte));
139} 139}
140 140
141static void kvm_set_pte_present(struct mm_struct *mm, unsigned long addr,
142 pte_t *ptep, pte_t pte)
143{
144 kvm_mmu_write(ptep, pte_val(pte));
145}
146
147static void kvm_pte_clear(struct mm_struct *mm, 141static void kvm_pte_clear(struct mm_struct *mm,
148 unsigned long addr, pte_t *ptep) 142 unsigned long addr, pte_t *ptep)
149{ 143{
@@ -220,7 +214,6 @@ static void paravirt_ops_setup(void)
220#if PAGETABLE_LEVELS >= 3 214#if PAGETABLE_LEVELS >= 3
221#ifdef CONFIG_X86_PAE 215#ifdef CONFIG_X86_PAE
222 pv_mmu_ops.set_pte_atomic = kvm_set_pte_atomic; 216 pv_mmu_ops.set_pte_atomic = kvm_set_pte_atomic;
223 pv_mmu_ops.set_pte_present = kvm_set_pte_present;
224 pv_mmu_ops.pte_clear = kvm_pte_clear; 217 pv_mmu_ops.pte_clear = kvm_pte_clear;
225 pv_mmu_ops.pmd_clear = kvm_pmd_clear; 218 pv_mmu_ops.pmd_clear = kvm_pmd_clear;
226#endif 219#endif
diff --git a/arch/x86/kernel/machine_kexec_32.c b/arch/x86/kernel/machine_kexec_32.c
index f5fc8c781a62..e7368c1da01d 100644
--- a/arch/x86/kernel/machine_kexec_32.c
+++ b/arch/x86/kernel/machine_kexec_32.c
@@ -14,12 +14,12 @@
14#include <linux/ftrace.h> 14#include <linux/ftrace.h>
15#include <linux/suspend.h> 15#include <linux/suspend.h>
16#include <linux/gfp.h> 16#include <linux/gfp.h>
17#include <linux/io.h>
17 18
18#include <asm/pgtable.h> 19#include <asm/pgtable.h>
19#include <asm/pgalloc.h> 20#include <asm/pgalloc.h>
20#include <asm/tlbflush.h> 21#include <asm/tlbflush.h>
21#include <asm/mmu_context.h> 22#include <asm/mmu_context.h>
22#include <asm/io.h>
23#include <asm/apic.h> 23#include <asm/apic.h>
24#include <asm/cpufeature.h> 24#include <asm/cpufeature.h>
25#include <asm/desc.h> 25#include <asm/desc.h>
@@ -63,7 +63,7 @@ static void load_segments(void)
63 "\tmovl %%eax,%%fs\n" 63 "\tmovl %%eax,%%fs\n"
64 "\tmovl %%eax,%%gs\n" 64 "\tmovl %%eax,%%gs\n"
65 "\tmovl %%eax,%%ss\n" 65 "\tmovl %%eax,%%ss\n"
66 ::: "eax", "memory"); 66 : : : "eax", "memory");
67#undef STR 67#undef STR
68#undef __STR 68#undef __STR
69} 69}
@@ -205,7 +205,8 @@ void machine_kexec(struct kimage *image)
205 205
206 if (image->preserve_context) { 206 if (image->preserve_context) {
207#ifdef CONFIG_X86_IO_APIC 207#ifdef CONFIG_X86_IO_APIC
208 /* We need to put APICs in legacy mode so that we can 208 /*
209 * We need to put APICs in legacy mode so that we can
209 * get timer interrupts in second kernel. kexec/kdump 210 * get timer interrupts in second kernel. kexec/kdump
210 * paths already have calls to disable_IO_APIC() in 211 * paths already have calls to disable_IO_APIC() in
211 * one form or other. kexec jump path also need 212 * one form or other. kexec jump path also need
@@ -227,7 +228,8 @@ void machine_kexec(struct kimage *image)
227 page_list[PA_SWAP_PAGE] = (page_to_pfn(image->swap_page) 228 page_list[PA_SWAP_PAGE] = (page_to_pfn(image->swap_page)
228 << PAGE_SHIFT); 229 << PAGE_SHIFT);
229 230
230 /* The segment registers are funny things, they have both a 231 /*
232 * The segment registers are funny things, they have both a
231 * visible and an invisible part. Whenever the visible part is 233 * visible and an invisible part. Whenever the visible part is
232 * set to a specific selector, the invisible part is loaded 234 * set to a specific selector, the invisible part is loaded
233 * with from a table in memory. At no other time is the 235 * with from a table in memory. At no other time is the
@@ -237,11 +239,12 @@ void machine_kexec(struct kimage *image)
237 * segments, before I zap the gdt with an invalid value. 239 * segments, before I zap the gdt with an invalid value.
238 */ 240 */
239 load_segments(); 241 load_segments();
240 /* The gdt & idt are now invalid. 242 /*
243 * The gdt & idt are now invalid.
241 * If you want to load them you must set up your own idt & gdt. 244 * If you want to load them you must set up your own idt & gdt.
242 */ 245 */
243 set_gdt(phys_to_virt(0),0); 246 set_gdt(phys_to_virt(0), 0);
244 set_idt(phys_to_virt(0),0); 247 set_idt(phys_to_virt(0), 0);
245 248
246 /* now call it */ 249 /* now call it */
247 image->start = relocate_kernel_ptr((unsigned long)image->head, 250 image->start = relocate_kernel_ptr((unsigned long)image->head,
diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c
index 6993d51b7fd8..89cea4d44679 100644
--- a/arch/x86/kernel/machine_kexec_64.c
+++ b/arch/x86/kernel/machine_kexec_64.c
@@ -12,11 +12,47 @@
12#include <linux/reboot.h> 12#include <linux/reboot.h>
13#include <linux/numa.h> 13#include <linux/numa.h>
14#include <linux/ftrace.h> 14#include <linux/ftrace.h>
15#include <linux/io.h>
16#include <linux/suspend.h>
15 17
16#include <asm/pgtable.h> 18#include <asm/pgtable.h>
17#include <asm/tlbflush.h> 19#include <asm/tlbflush.h>
18#include <asm/mmu_context.h> 20#include <asm/mmu_context.h>
19#include <asm/io.h> 21
22static int init_one_level2_page(struct kimage *image, pgd_t *pgd,
23 unsigned long addr)
24{
25 pud_t *pud;
26 pmd_t *pmd;
27 struct page *page;
28 int result = -ENOMEM;
29
30 addr &= PMD_MASK;
31 pgd += pgd_index(addr);
32 if (!pgd_present(*pgd)) {
33 page = kimage_alloc_control_pages(image, 0);
34 if (!page)
35 goto out;
36 pud = (pud_t *)page_address(page);
37 memset(pud, 0, PAGE_SIZE);
38 set_pgd(pgd, __pgd(__pa(pud) | _KERNPG_TABLE));
39 }
40 pud = pud_offset(pgd, addr);
41 if (!pud_present(*pud)) {
42 page = kimage_alloc_control_pages(image, 0);
43 if (!page)
44 goto out;
45 pmd = (pmd_t *)page_address(page);
46 memset(pmd, 0, PAGE_SIZE);
47 set_pud(pud, __pud(__pa(pmd) | _KERNPG_TABLE));
48 }
49 pmd = pmd_offset(pud, addr);
50 if (!pmd_present(*pmd))
51 set_pmd(pmd, __pmd(addr | __PAGE_KERNEL_LARGE_EXEC));
52 result = 0;
53out:
54 return result;
55}
20 56
21static void init_level2_page(pmd_t *level2p, unsigned long addr) 57static void init_level2_page(pmd_t *level2p, unsigned long addr)
22{ 58{
@@ -83,9 +119,8 @@ static int init_level4_page(struct kimage *image, pgd_t *level4p,
83 } 119 }
84 level3p = (pud_t *)page_address(page); 120 level3p = (pud_t *)page_address(page);
85 result = init_level3_page(image, level3p, addr, last_addr); 121 result = init_level3_page(image, level3p, addr, last_addr);
86 if (result) { 122 if (result)
87 goto out; 123 goto out;
88 }
89 set_pgd(level4p++, __pgd(__pa(level3p) | _KERNPG_TABLE)); 124 set_pgd(level4p++, __pgd(__pa(level3p) | _KERNPG_TABLE));
90 addr += PGDIR_SIZE; 125 addr += PGDIR_SIZE;
91 } 126 }
@@ -156,6 +191,13 @@ static int init_pgtable(struct kimage *image, unsigned long start_pgtable)
156 result = init_level4_page(image, level4p, 0, max_pfn << PAGE_SHIFT); 191 result = init_level4_page(image, level4p, 0, max_pfn << PAGE_SHIFT);
157 if (result) 192 if (result)
158 return result; 193 return result;
194 /*
195 * image->start may be outside 0 ~ max_pfn, for example when
196 * jump back to original kernel from kexeced kernel
197 */
198 result = init_one_level2_page(image, level4p, image->start);
199 if (result)
200 return result;
159 return init_transition_pgtable(image, level4p); 201 return init_transition_pgtable(image, level4p);
160} 202}
161 203
@@ -229,20 +271,45 @@ void machine_kexec(struct kimage *image)
229{ 271{
230 unsigned long page_list[PAGES_NR]; 272 unsigned long page_list[PAGES_NR];
231 void *control_page; 273 void *control_page;
274 int save_ftrace_enabled;
232 275
233 tracer_disable(); 276#ifdef CONFIG_KEXEC_JUMP
277 if (kexec_image->preserve_context)
278 save_processor_state();
279#endif
280
281 save_ftrace_enabled = __ftrace_enabled_save();
234 282
235 /* Interrupts aren't acceptable while we reboot */ 283 /* Interrupts aren't acceptable while we reboot */
236 local_irq_disable(); 284 local_irq_disable();
237 285
286 if (image->preserve_context) {
287#ifdef CONFIG_X86_IO_APIC
288 /*
289 * We need to put APICs in legacy mode so that we can
290 * get timer interrupts in second kernel. kexec/kdump
291 * paths already have calls to disable_IO_APIC() in
292 * one form or other. kexec jump path also need
293 * one.
294 */
295 disable_IO_APIC();
296#endif
297 }
298
238 control_page = page_address(image->control_code_page) + PAGE_SIZE; 299 control_page = page_address(image->control_code_page) + PAGE_SIZE;
239 memcpy(control_page, relocate_kernel, PAGE_SIZE); 300 memcpy(control_page, relocate_kernel, KEXEC_CONTROL_CODE_MAX_SIZE);
240 301
241 page_list[PA_CONTROL_PAGE] = virt_to_phys(control_page); 302 page_list[PA_CONTROL_PAGE] = virt_to_phys(control_page);
303 page_list[VA_CONTROL_PAGE] = (unsigned long)control_page;
242 page_list[PA_TABLE_PAGE] = 304 page_list[PA_TABLE_PAGE] =
243 (unsigned long)__pa(page_address(image->control_code_page)); 305 (unsigned long)__pa(page_address(image->control_code_page));
244 306
245 /* The segment registers are funny things, they have both a 307 if (image->type == KEXEC_TYPE_DEFAULT)
308 page_list[PA_SWAP_PAGE] = (page_to_pfn(image->swap_page)
309 << PAGE_SHIFT);
310
311 /*
312 * The segment registers are funny things, they have both a
246 * visible and an invisible part. Whenever the visible part is 313 * visible and an invisible part. Whenever the visible part is
247 * set to a specific selector, the invisible part is loaded 314 * set to a specific selector, the invisible part is loaded
248 * with from a table in memory. At no other time is the 315 * with from a table in memory. At no other time is the
@@ -252,15 +319,25 @@ void machine_kexec(struct kimage *image)
252 * segments, before I zap the gdt with an invalid value. 319 * segments, before I zap the gdt with an invalid value.
253 */ 320 */
254 load_segments(); 321 load_segments();
255 /* The gdt & idt are now invalid. 322 /*
323 * The gdt & idt are now invalid.
256 * If you want to load them you must set up your own idt & gdt. 324 * If you want to load them you must set up your own idt & gdt.
257 */ 325 */
258 set_gdt(phys_to_virt(0),0); 326 set_gdt(phys_to_virt(0), 0);
259 set_idt(phys_to_virt(0),0); 327 set_idt(phys_to_virt(0), 0);
260 328
261 /* now call it */ 329 /* now call it */
262 relocate_kernel((unsigned long)image->head, (unsigned long)page_list, 330 image->start = relocate_kernel((unsigned long)image->head,
263 image->start); 331 (unsigned long)page_list,
332 image->start,
333 image->preserve_context);
334
335#ifdef CONFIG_KEXEC_JUMP
336 if (kexec_image->preserve_context)
337 restore_processor_state();
338#endif
339
340 __ftrace_enabled_restore(save_ftrace_enabled);
264} 341}
265 342
266void arch_crash_save_vmcoreinfo(void) 343void arch_crash_save_vmcoreinfo(void)
diff --git a/arch/x86/kernel/mfgpt_32.c b/arch/x86/kernel/mfgpt_32.c
index 8815f3c7fec7..846510b78a09 100644
--- a/arch/x86/kernel/mfgpt_32.c
+++ b/arch/x86/kernel/mfgpt_32.c
@@ -348,7 +348,6 @@ static irqreturn_t mfgpt_tick(int irq, void *dev_id)
348static struct irqaction mfgptirq = { 348static struct irqaction mfgptirq = {
349 .handler = mfgpt_tick, 349 .handler = mfgpt_tick,
350 .flags = IRQF_DISABLED | IRQF_NOBALANCING, 350 .flags = IRQF_DISABLED | IRQF_NOBALANCING,
351 .mask = CPU_MASK_NONE,
352 .name = "mfgpt-timer" 351 .name = "mfgpt-timer"
353}; 352};
354 353
diff --git a/arch/x86/kernel/mmconf-fam10h_64.c b/arch/x86/kernel/mmconf-fam10h_64.c
index 666e43df51f9..712d15fdc416 100644
--- a/arch/x86/kernel/mmconf-fam10h_64.c
+++ b/arch/x86/kernel/mmconf-fam10h_64.c
@@ -226,7 +226,7 @@ static int __devinit set_check_enable_amd_mmconf(const struct dmi_system_id *d)
226 return 0; 226 return 0;
227} 227}
228 228
229static struct dmi_system_id __devinitdata mmconf_dmi_table[] = { 229static const struct dmi_system_id __cpuinitconst mmconf_dmi_table[] = {
230 { 230 {
231 .callback = set_check_enable_amd_mmconf, 231 .callback = set_check_enable_amd_mmconf,
232 .ident = "Sun Microsystems Machine", 232 .ident = "Sun Microsystems Machine",
diff --git a/arch/x86/kernel/mpparse.c b/arch/x86/kernel/mpparse.c
index 37cb1bda1baf..dce99dca6cf8 100644
--- a/arch/x86/kernel/mpparse.c
+++ b/arch/x86/kernel/mpparse.c
@@ -109,9 +109,6 @@ static void __init MP_bus_info(struct mpc_bus *m)
109 } else 109 } else
110 printk(KERN_WARNING "Unknown bustype %s - ignoring\n", str); 110 printk(KERN_WARNING "Unknown bustype %s - ignoring\n", str);
111} 111}
112#endif
113
114#ifdef CONFIG_X86_IO_APIC
115 112
116static int bad_ioapic(unsigned long address) 113static int bad_ioapic(unsigned long address)
117{ 114{
@@ -224,8 +221,12 @@ static void __init MP_intsrc_info(struct mpc_intsrc *m)
224 if (++mp_irq_entries == MAX_IRQ_SOURCES) 221 if (++mp_irq_entries == MAX_IRQ_SOURCES)
225 panic("Max # of irq sources exceeded!!\n"); 222 panic("Max # of irq sources exceeded!!\n");
226} 223}
224#else /* CONFIG_X86_IO_APIC */
225static inline void __init MP_bus_info(struct mpc_bus *m) {}
226static inline void __init MP_ioapic_info(struct mpc_ioapic *m) {}
227static inline void __init MP_intsrc_info(struct mpc_intsrc *m) {}
228#endif /* CONFIG_X86_IO_APIC */
227 229
228#endif
229 230
230static void __init MP_lintsrc_info(struct mpc_lintsrc *m) 231static void __init MP_lintsrc_info(struct mpc_lintsrc *m)
231{ 232{
@@ -275,6 +276,20 @@ static int __init smp_check_mpc(struct mpc_table *mpc, char *oem, char *str)
275 return 1; 276 return 1;
276} 277}
277 278
279static void skip_entry(unsigned char **ptr, int *count, int size)
280{
281 *ptr += size;
282 *count += size;
283}
284
285static void __init smp_dump_mptable(struct mpc_table *mpc, unsigned char *mpt)
286{
287 printk(KERN_ERR "Your mptable is wrong, contact your HW vendor!\n"
288 "type %x\n", *mpt);
289 print_hex_dump(KERN_ERR, " ", DUMP_PREFIX_ADDRESS, 16,
290 1, mpc, mpc->length, 1);
291}
292
278static int __init smp_read_mpc(struct mpc_table *mpc, unsigned early) 293static int __init smp_read_mpc(struct mpc_table *mpc, unsigned early)
279{ 294{
280 char str[16]; 295 char str[16];
@@ -310,61 +325,30 @@ static int __init smp_read_mpc(struct mpc_table *mpc, unsigned early)
310 while (count < mpc->length) { 325 while (count < mpc->length) {
311 switch (*mpt) { 326 switch (*mpt) {
312 case MP_PROCESSOR: 327 case MP_PROCESSOR:
313 { 328 /* ACPI may have already provided this data */
314 struct mpc_cpu *m = (struct mpc_cpu *)mpt; 329 if (!acpi_lapic)
315 /* ACPI may have already provided this data */ 330 MP_processor_info((struct mpc_cpu *)mpt);
316 if (!acpi_lapic) 331 skip_entry(&mpt, &count, sizeof(struct mpc_cpu));
317 MP_processor_info(m); 332 break;
318 mpt += sizeof(*m);
319 count += sizeof(*m);
320 break;
321 }
322 case MP_BUS: 333 case MP_BUS:
323 { 334 MP_bus_info((struct mpc_bus *)mpt);
324 struct mpc_bus *m = (struct mpc_bus *)mpt; 335 skip_entry(&mpt, &count, sizeof(struct mpc_bus));
325#ifdef CONFIG_X86_IO_APIC 336 break;
326 MP_bus_info(m);
327#endif
328 mpt += sizeof(*m);
329 count += sizeof(*m);
330 break;
331 }
332 case MP_IOAPIC: 337 case MP_IOAPIC:
333 { 338 MP_ioapic_info((struct mpc_ioapic *)mpt);
334#ifdef CONFIG_X86_IO_APIC 339 skip_entry(&mpt, &count, sizeof(struct mpc_ioapic));
335 struct mpc_ioapic *m = (struct mpc_ioapic *)mpt; 340 break;
336 MP_ioapic_info(m);
337#endif
338 mpt += sizeof(struct mpc_ioapic);
339 count += sizeof(struct mpc_ioapic);
340 break;
341 }
342 case MP_INTSRC: 341 case MP_INTSRC:
343 { 342 MP_intsrc_info((struct mpc_intsrc *)mpt);
344#ifdef CONFIG_X86_IO_APIC 343 skip_entry(&mpt, &count, sizeof(struct mpc_intsrc));
345 struct mpc_intsrc *m = (struct mpc_intsrc *)mpt; 344 break;
346
347 MP_intsrc_info(m);
348#endif
349 mpt += sizeof(struct mpc_intsrc);
350 count += sizeof(struct mpc_intsrc);
351 break;
352 }
353 case MP_LINTSRC: 345 case MP_LINTSRC:
354 { 346 MP_lintsrc_info((struct mpc_lintsrc *)mpt);
355 struct mpc_lintsrc *m = 347 skip_entry(&mpt, &count, sizeof(struct mpc_lintsrc));
356 (struct mpc_lintsrc *)mpt; 348 break;
357 MP_lintsrc_info(m);
358 mpt += sizeof(*m);
359 count += sizeof(*m);
360 break;
361 }
362 default: 349 default:
363 /* wrong mptable */ 350 /* wrong mptable */
364 printk(KERN_ERR "Your mptable is wrong, contact your HW vendor!\n"); 351 smp_dump_mptable(mpc, mpt);
365 printk(KERN_ERR "type %x\n", *mpt);
366 print_hex_dump(KERN_ERR, " ", DUMP_PREFIX_ADDRESS, 16,
367 1, mpc, mpc->length, 1);
368 count = mpc->length; 352 count = mpc->length;
369 break; 353 break;
370 } 354 }
@@ -558,6 +542,68 @@ static inline void __init construct_default_ISA_mptable(int mpc_default_type)
558 542
559static struct mpf_intel *mpf_found; 543static struct mpf_intel *mpf_found;
560 544
545static unsigned long __init get_mpc_size(unsigned long physptr)
546{
547 struct mpc_table *mpc;
548 unsigned long size;
549
550 mpc = early_ioremap(physptr, PAGE_SIZE);
551 size = mpc->length;
552 early_iounmap(mpc, PAGE_SIZE);
553 apic_printk(APIC_VERBOSE, " mpc: %lx-%lx\n", physptr, physptr + size);
554
555 return size;
556}
557
558static int __init check_physptr(struct mpf_intel *mpf, unsigned int early)
559{
560 struct mpc_table *mpc;
561 unsigned long size;
562
563 size = get_mpc_size(mpf->physptr);
564 mpc = early_ioremap(mpf->physptr, size);
565 /*
566 * Read the physical hardware table. Anything here will
567 * override the defaults.
568 */
569 if (!smp_read_mpc(mpc, early)) {
570#ifdef CONFIG_X86_LOCAL_APIC
571 smp_found_config = 0;
572#endif
573 printk(KERN_ERR "BIOS bug, MP table errors detected!...\n"
574 "... disabling SMP support. (tell your hw vendor)\n");
575 early_iounmap(mpc, size);
576 return -1;
577 }
578 early_iounmap(mpc, size);
579
580 if (early)
581 return -1;
582
583#ifdef CONFIG_X86_IO_APIC
584 /*
585 * If there are no explicit MP IRQ entries, then we are
586 * broken. We set up most of the low 16 IO-APIC pins to
587 * ISA defaults and hope it will work.
588 */
589 if (!mp_irq_entries) {
590 struct mpc_bus bus;
591
592 printk(KERN_ERR "BIOS bug, no explicit IRQ entries, "
593 "using default mptable. (tell your hw vendor)\n");
594
595 bus.type = MP_BUS;
596 bus.busid = 0;
597 memcpy(bus.bustype, "ISA ", 6);
598 MP_bus_info(&bus);
599
600 construct_default_ioirq_mptable(0);
601 }
602#endif
603
604 return 0;
605}
606
561/* 607/*
562 * Scan the memory blocks for an SMP configuration block. 608 * Scan the memory blocks for an SMP configuration block.
563 */ 609 */
@@ -611,45 +657,8 @@ static void __init __get_smp_config(unsigned int early)
611 construct_default_ISA_mptable(mpf->feature1); 657 construct_default_ISA_mptable(mpf->feature1);
612 658
613 } else if (mpf->physptr) { 659 } else if (mpf->physptr) {
614 660 if (check_physptr(mpf, early))
615 /*
616 * Read the physical hardware table. Anything here will
617 * override the defaults.
618 */
619 if (!smp_read_mpc(phys_to_virt(mpf->physptr), early)) {
620#ifdef CONFIG_X86_LOCAL_APIC
621 smp_found_config = 0;
622#endif
623 printk(KERN_ERR
624 "BIOS bug, MP table errors detected!...\n");
625 printk(KERN_ERR "... disabling SMP support. "
626 "(tell your hw vendor)\n");
627 return;
628 }
629
630 if (early)
631 return; 661 return;
632#ifdef CONFIG_X86_IO_APIC
633 /*
634 * If there are no explicit MP IRQ entries, then we are
635 * broken. We set up most of the low 16 IO-APIC pins to
636 * ISA defaults and hope it will work.
637 */
638 if (!mp_irq_entries) {
639 struct mpc_bus bus;
640
641 printk(KERN_ERR "BIOS bug, no explicit IRQ entries, "
642 "using default mptable. "
643 "(tell your hw vendor)\n");
644
645 bus.type = MP_BUS;
646 bus.busid = 0;
647 memcpy(bus.bustype, "ISA ", 6);
648 MP_bus_info(&bus);
649
650 construct_default_ioirq_mptable(0);
651 }
652#endif
653 } else 662 } else
654 BUG(); 663 BUG();
655 664
@@ -670,6 +679,31 @@ void __init get_smp_config(void)
670 __get_smp_config(0); 679 __get_smp_config(0);
671} 680}
672 681
682static void smp_reserve_bootmem(struct mpf_intel *mpf)
683{
684 unsigned long size = get_mpc_size(mpf->physptr);
685#ifdef CONFIG_X86_32
686 /*
687 * We cannot access to MPC table to compute table size yet,
688 * as only few megabytes from the bottom is mapped now.
689 * PC-9800's MPC table places on the very last of physical
690 * memory; so that simply reserving PAGE_SIZE from mpf->physptr
691 * yields BUG() in reserve_bootmem.
692 * also need to make sure physptr is below than max_low_pfn
693 * we don't need reserve the area above max_low_pfn
694 */
695 unsigned long end = max_low_pfn * PAGE_SIZE;
696
697 if (mpf->physptr < end) {
698 if (mpf->physptr + size > end)
699 size = end - mpf->physptr;
700 reserve_bootmem_generic(mpf->physptr, size, BOOTMEM_DEFAULT);
701 }
702#else
703 reserve_bootmem_generic(mpf->physptr, size, BOOTMEM_DEFAULT);
704#endif
705}
706
673static int __init smp_scan_config(unsigned long base, unsigned long length, 707static int __init smp_scan_config(unsigned long base, unsigned long length,
674 unsigned reserve) 708 unsigned reserve)
675{ 709{
@@ -697,36 +731,10 @@ static int __init smp_scan_config(unsigned long base, unsigned long length,
697 731
698 if (!reserve) 732 if (!reserve)
699 return 1; 733 return 1;
700 reserve_bootmem_generic(virt_to_phys(mpf), PAGE_SIZE, 734 reserve_bootmem_generic(virt_to_phys(mpf), sizeof(*mpf),
701 BOOTMEM_DEFAULT);
702 if (mpf->physptr) {
703 unsigned long size = PAGE_SIZE;
704#ifdef CONFIG_X86_32
705 /*
706 * We cannot access to MPC table to compute
707 * table size yet, as only few megabytes from
708 * the bottom is mapped now.
709 * PC-9800's MPC table places on the very last
710 * of physical memory; so that simply reserving
711 * PAGE_SIZE from mpf->physptr yields BUG()
712 * in reserve_bootmem.
713 * also need to make sure physptr is below than
714 * max_low_pfn
715 * we don't need reserve the area above max_low_pfn
716 */
717 unsigned long end = max_low_pfn * PAGE_SIZE;
718
719 if (mpf->physptr < end) {
720 if (mpf->physptr + size > end)
721 size = end - mpf->physptr;
722 reserve_bootmem_generic(mpf->physptr, size,
723 BOOTMEM_DEFAULT);
724 }
725#else
726 reserve_bootmem_generic(mpf->physptr, size,
727 BOOTMEM_DEFAULT); 735 BOOTMEM_DEFAULT);
728#endif 736 if (mpf->physptr)
729 } 737 smp_reserve_bootmem(mpf);
730 738
731 return 1; 739 return 1;
732 } 740 }
@@ -829,7 +837,57 @@ static int __init get_MP_intsrc_index(struct mpc_intsrc *m)
829#define SPARE_SLOT_NUM 20 837#define SPARE_SLOT_NUM 20
830 838
831static struct mpc_intsrc __initdata *m_spare[SPARE_SLOT_NUM]; 839static struct mpc_intsrc __initdata *m_spare[SPARE_SLOT_NUM];
832#endif 840
841static void check_irq_src(struct mpc_intsrc *m, int *nr_m_spare)
842{
843 int i;
844
845 apic_printk(APIC_VERBOSE, "OLD ");
846 print_MP_intsrc_info(m);
847
848 i = get_MP_intsrc_index(m);
849 if (i > 0) {
850 assign_to_mpc_intsrc(&mp_irqs[i], m);
851 apic_printk(APIC_VERBOSE, "NEW ");
852 print_mp_irq_info(&mp_irqs[i]);
853 return;
854 }
855 if (!i) {
856 /* legacy, do nothing */
857 return;
858 }
859 if (*nr_m_spare < SPARE_SLOT_NUM) {
860 /*
861 * not found (-1), or duplicated (-2) are invalid entries,
862 * we need to use the slot later
863 */
864 m_spare[*nr_m_spare] = m;
865 *nr_m_spare += 1;
866 }
867}
868#else /* CONFIG_X86_IO_APIC */
869static inline void check_irq_src(struct mpc_intsrc *m, int *nr_m_spare) {}
870#endif /* CONFIG_X86_IO_APIC */
871
872static int check_slot(unsigned long mpc_new_phys, unsigned long mpc_new_length,
873 int count)
874{
875 if (!mpc_new_phys) {
876 pr_info("No spare slots, try to append...take your risk, "
877 "new mpc_length %x\n", count);
878 } else {
879 if (count <= mpc_new_length)
880 pr_info("No spare slots, try to append..., "
881 "new mpc_length %x\n", count);
882 else {
883 pr_err("mpc_new_length %lx is too small\n",
884 mpc_new_length);
885 return -1;
886 }
887 }
888
889 return 0;
890}
833 891
834static int __init replace_intsrc_all(struct mpc_table *mpc, 892static int __init replace_intsrc_all(struct mpc_table *mpc,
835 unsigned long mpc_new_phys, 893 unsigned long mpc_new_phys,
@@ -837,77 +895,33 @@ static int __init replace_intsrc_all(struct mpc_table *mpc,
837{ 895{
838#ifdef CONFIG_X86_IO_APIC 896#ifdef CONFIG_X86_IO_APIC
839 int i; 897 int i;
840 int nr_m_spare = 0;
841#endif 898#endif
842
843 int count = sizeof(*mpc); 899 int count = sizeof(*mpc);
900 int nr_m_spare = 0;
844 unsigned char *mpt = ((unsigned char *)mpc) + count; 901 unsigned char *mpt = ((unsigned char *)mpc) + count;
845 902
846 printk(KERN_INFO "mpc_length %x\n", mpc->length); 903 printk(KERN_INFO "mpc_length %x\n", mpc->length);
847 while (count < mpc->length) { 904 while (count < mpc->length) {
848 switch (*mpt) { 905 switch (*mpt) {
849 case MP_PROCESSOR: 906 case MP_PROCESSOR:
850 { 907 skip_entry(&mpt, &count, sizeof(struct mpc_cpu));
851 struct mpc_cpu *m = (struct mpc_cpu *)mpt; 908 break;
852 mpt += sizeof(*m);
853 count += sizeof(*m);
854 break;
855 }
856 case MP_BUS: 909 case MP_BUS:
857 { 910 skip_entry(&mpt, &count, sizeof(struct mpc_bus));
858 struct mpc_bus *m = (struct mpc_bus *)mpt; 911 break;
859 mpt += sizeof(*m);
860 count += sizeof(*m);
861 break;
862 }
863 case MP_IOAPIC: 912 case MP_IOAPIC:
864 { 913 skip_entry(&mpt, &count, sizeof(struct mpc_ioapic));
865 mpt += sizeof(struct mpc_ioapic); 914 break;
866 count += sizeof(struct mpc_ioapic);
867 break;
868 }
869 case MP_INTSRC: 915 case MP_INTSRC:
870 { 916 check_irq_src((struct mpc_intsrc *)mpt, &nr_m_spare);
871#ifdef CONFIG_X86_IO_APIC 917 skip_entry(&mpt, &count, sizeof(struct mpc_intsrc));
872 struct mpc_intsrc *m = (struct mpc_intsrc *)mpt; 918 break;
873
874 printk(KERN_INFO "OLD ");
875 print_MP_intsrc_info(m);
876 i = get_MP_intsrc_index(m);
877 if (i > 0) {
878 assign_to_mpc_intsrc(&mp_irqs[i], m);
879 printk(KERN_INFO "NEW ");
880 print_mp_irq_info(&mp_irqs[i]);
881 } else if (!i) {
882 /* legacy, do nothing */
883 } else if (nr_m_spare < SPARE_SLOT_NUM) {
884 /*
885 * not found (-1), or duplicated (-2)
886 * are invalid entries,
887 * we need to use the slot later
888 */
889 m_spare[nr_m_spare] = m;
890 nr_m_spare++;
891 }
892#endif
893 mpt += sizeof(struct mpc_intsrc);
894 count += sizeof(struct mpc_intsrc);
895 break;
896 }
897 case MP_LINTSRC: 919 case MP_LINTSRC:
898 { 920 skip_entry(&mpt, &count, sizeof(struct mpc_lintsrc));
899 struct mpc_lintsrc *m = 921 break;
900 (struct mpc_lintsrc *)mpt;
901 mpt += sizeof(*m);
902 count += sizeof(*m);
903 break;
904 }
905 default: 922 default:
906 /* wrong mptable */ 923 /* wrong mptable */
907 printk(KERN_ERR "Your mptable is wrong, contact your HW vendor!\n"); 924 smp_dump_mptable(mpc, mpt);
908 printk(KERN_ERR "type %x\n", *mpt);
909 print_hex_dump(KERN_ERR, " ", DUMP_PREFIX_ADDRESS, 16,
910 1, mpc, mpc->length, 1);
911 goto out; 925 goto out;
912 } 926 }
913 } 927 }
@@ -924,23 +938,15 @@ static int __init replace_intsrc_all(struct mpc_table *mpc,
924 continue; 938 continue;
925 939
926 if (nr_m_spare > 0) { 940 if (nr_m_spare > 0) {
927 printk(KERN_INFO "*NEW* found "); 941 apic_printk(APIC_VERBOSE, "*NEW* found\n");
928 nr_m_spare--; 942 nr_m_spare--;
929 assign_to_mpc_intsrc(&mp_irqs[i], m_spare[nr_m_spare]); 943 assign_to_mpc_intsrc(&mp_irqs[i], m_spare[nr_m_spare]);
930 m_spare[nr_m_spare] = NULL; 944 m_spare[nr_m_spare] = NULL;
931 } else { 945 } else {
932 struct mpc_intsrc *m = (struct mpc_intsrc *)mpt; 946 struct mpc_intsrc *m = (struct mpc_intsrc *)mpt;
933 count += sizeof(struct mpc_intsrc); 947 count += sizeof(struct mpc_intsrc);
934 if (!mpc_new_phys) { 948 if (!check_slot(mpc_new_phys, mpc_new_length, count))
935 printk(KERN_INFO "No spare slots, try to append...take your risk, new mpc_length %x\n", count); 949 goto out;
936 } else {
937 if (count <= mpc_new_length)
938 printk(KERN_INFO "No spare slots, try to append..., new mpc_length %x\n", count);
939 else {
940 printk(KERN_ERR "mpc_new_length %lx is too small\n", mpc_new_length);
941 goto out;
942 }
943 }
944 assign_to_mpc_intsrc(&mp_irqs[i], m); 950 assign_to_mpc_intsrc(&mp_irqs[i], m);
945 mpc->length = count; 951 mpc->length = count;
946 mpt += sizeof(struct mpc_intsrc); 952 mpt += sizeof(struct mpc_intsrc);
diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c
index 63dd358d8ee1..8e45f4464880 100644
--- a/arch/x86/kernel/paravirt.c
+++ b/arch/x86/kernel/paravirt.c
@@ -470,7 +470,6 @@ struct pv_mmu_ops pv_mmu_ops = {
470#if PAGETABLE_LEVELS >= 3 470#if PAGETABLE_LEVELS >= 3
471#ifdef CONFIG_X86_PAE 471#ifdef CONFIG_X86_PAE
472 .set_pte_atomic = native_set_pte_atomic, 472 .set_pte_atomic = native_set_pte_atomic,
473 .set_pte_present = native_set_pte_present,
474 .pte_clear = native_pte_clear, 473 .pte_clear = native_pte_clear,
475 .pmd_clear = native_pmd_clear, 474 .pmd_clear = native_pmd_clear,
476#endif 475#endif
diff --git a/arch/x86/kernel/pci-calgary_64.c b/arch/x86/kernel/pci-calgary_64.c
index d28bbdc35e4e..755c21e906f3 100644
--- a/arch/x86/kernel/pci-calgary_64.c
+++ b/arch/x86/kernel/pci-calgary_64.c
@@ -380,8 +380,9 @@ static inline struct iommu_table *find_iommu_table(struct device *dev)
380 return tbl; 380 return tbl;
381} 381}
382 382
383static void calgary_unmap_sg(struct device *dev, 383static void calgary_unmap_sg(struct device *dev, struct scatterlist *sglist,
384 struct scatterlist *sglist, int nelems, int direction) 384 int nelems,enum dma_data_direction dir,
385 struct dma_attrs *attrs)
385{ 386{
386 struct iommu_table *tbl = find_iommu_table(dev); 387 struct iommu_table *tbl = find_iommu_table(dev);
387 struct scatterlist *s; 388 struct scatterlist *s;
@@ -404,7 +405,8 @@ static void calgary_unmap_sg(struct device *dev,
404} 405}
405 406
406static int calgary_map_sg(struct device *dev, struct scatterlist *sg, 407static int calgary_map_sg(struct device *dev, struct scatterlist *sg,
407 int nelems, int direction) 408 int nelems, enum dma_data_direction dir,
409 struct dma_attrs *attrs)
408{ 410{
409 struct iommu_table *tbl = find_iommu_table(dev); 411 struct iommu_table *tbl = find_iommu_table(dev);
410 struct scatterlist *s; 412 struct scatterlist *s;
@@ -429,15 +431,14 @@ static int calgary_map_sg(struct device *dev, struct scatterlist *sg,
429 s->dma_address = (entry << PAGE_SHIFT) | s->offset; 431 s->dma_address = (entry << PAGE_SHIFT) | s->offset;
430 432
431 /* insert into HW table */ 433 /* insert into HW table */
432 tce_build(tbl, entry, npages, vaddr & PAGE_MASK, 434 tce_build(tbl, entry, npages, vaddr & PAGE_MASK, dir);
433 direction);
434 435
435 s->dma_length = s->length; 436 s->dma_length = s->length;
436 } 437 }
437 438
438 return nelems; 439 return nelems;
439error: 440error:
440 calgary_unmap_sg(dev, sg, nelems, direction); 441 calgary_unmap_sg(dev, sg, nelems, dir, NULL);
441 for_each_sg(sg, s, nelems, i) { 442 for_each_sg(sg, s, nelems, i) {
442 sg->dma_address = bad_dma_address; 443 sg->dma_address = bad_dma_address;
443 sg->dma_length = 0; 444 sg->dma_length = 0;
@@ -445,10 +446,12 @@ error:
445 return 0; 446 return 0;
446} 447}
447 448
448static dma_addr_t calgary_map_single(struct device *dev, phys_addr_t paddr, 449static dma_addr_t calgary_map_page(struct device *dev, struct page *page,
449 size_t size, int direction) 450 unsigned long offset, size_t size,
451 enum dma_data_direction dir,
452 struct dma_attrs *attrs)
450{ 453{
451 void *vaddr = phys_to_virt(paddr); 454 void *vaddr = page_address(page) + offset;
452 unsigned long uaddr; 455 unsigned long uaddr;
453 unsigned int npages; 456 unsigned int npages;
454 struct iommu_table *tbl = find_iommu_table(dev); 457 struct iommu_table *tbl = find_iommu_table(dev);
@@ -456,17 +459,18 @@ static dma_addr_t calgary_map_single(struct device *dev, phys_addr_t paddr,
456 uaddr = (unsigned long)vaddr; 459 uaddr = (unsigned long)vaddr;
457 npages = iommu_num_pages(uaddr, size, PAGE_SIZE); 460 npages = iommu_num_pages(uaddr, size, PAGE_SIZE);
458 461
459 return iommu_alloc(dev, tbl, vaddr, npages, direction); 462 return iommu_alloc(dev, tbl, vaddr, npages, dir);
460} 463}
461 464
462static void calgary_unmap_single(struct device *dev, dma_addr_t dma_handle, 465static void calgary_unmap_page(struct device *dev, dma_addr_t dma_addr,
463 size_t size, int direction) 466 size_t size, enum dma_data_direction dir,
467 struct dma_attrs *attrs)
464{ 468{
465 struct iommu_table *tbl = find_iommu_table(dev); 469 struct iommu_table *tbl = find_iommu_table(dev);
466 unsigned int npages; 470 unsigned int npages;
467 471
468 npages = iommu_num_pages(dma_handle, size, PAGE_SIZE); 472 npages = iommu_num_pages(dma_addr, size, PAGE_SIZE);
469 iommu_free(tbl, dma_handle, npages); 473 iommu_free(tbl, dma_addr, npages);
470} 474}
471 475
472static void* calgary_alloc_coherent(struct device *dev, size_t size, 476static void* calgary_alloc_coherent(struct device *dev, size_t size,
@@ -515,13 +519,13 @@ static void calgary_free_coherent(struct device *dev, size_t size,
515 free_pages((unsigned long)vaddr, get_order(size)); 519 free_pages((unsigned long)vaddr, get_order(size));
516} 520}
517 521
518static struct dma_mapping_ops calgary_dma_ops = { 522static struct dma_map_ops calgary_dma_ops = {
519 .alloc_coherent = calgary_alloc_coherent, 523 .alloc_coherent = calgary_alloc_coherent,
520 .free_coherent = calgary_free_coherent, 524 .free_coherent = calgary_free_coherent,
521 .map_single = calgary_map_single,
522 .unmap_single = calgary_unmap_single,
523 .map_sg = calgary_map_sg, 525 .map_sg = calgary_map_sg,
524 .unmap_sg = calgary_unmap_sg, 526 .unmap_sg = calgary_unmap_sg,
527 .map_page = calgary_map_page,
528 .unmap_page = calgary_unmap_page,
525}; 529};
526 530
527static inline void __iomem * busno_to_bbar(unsigned char num) 531static inline void __iomem * busno_to_bbar(unsigned char num)
diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c
index b25428533141..c7c4776ff630 100644
--- a/arch/x86/kernel/pci-dma.c
+++ b/arch/x86/kernel/pci-dma.c
@@ -1,4 +1,5 @@
1#include <linux/dma-mapping.h> 1#include <linux/dma-mapping.h>
2#include <linux/dma-debug.h>
2#include <linux/dmar.h> 3#include <linux/dmar.h>
3#include <linux/bootmem.h> 4#include <linux/bootmem.h>
4#include <linux/pci.h> 5#include <linux/pci.h>
@@ -12,7 +13,7 @@
12 13
13static int forbid_dac __read_mostly; 14static int forbid_dac __read_mostly;
14 15
15struct dma_mapping_ops *dma_ops; 16struct dma_map_ops *dma_ops;
16EXPORT_SYMBOL(dma_ops); 17EXPORT_SYMBOL(dma_ops);
17 18
18static int iommu_sac_force __read_mostly; 19static int iommu_sac_force __read_mostly;
@@ -44,6 +45,9 @@ struct device x86_dma_fallback_dev = {
44}; 45};
45EXPORT_SYMBOL(x86_dma_fallback_dev); 46EXPORT_SYMBOL(x86_dma_fallback_dev);
46 47
48/* Number of entries preallocated for DMA-API debugging */
49#define PREALLOC_DMA_DEBUG_ENTRIES 32768
50
47int dma_set_mask(struct device *dev, u64 mask) 51int dma_set_mask(struct device *dev, u64 mask)
48{ 52{
49 if (!dev->dma_mask || !dma_supported(dev, mask)) 53 if (!dev->dma_mask || !dma_supported(dev, mask))
@@ -224,7 +228,7 @@ early_param("iommu", iommu_setup);
224 228
225int dma_supported(struct device *dev, u64 mask) 229int dma_supported(struct device *dev, u64 mask)
226{ 230{
227 struct dma_mapping_ops *ops = get_dma_ops(dev); 231 struct dma_map_ops *ops = get_dma_ops(dev);
228 232
229#ifdef CONFIG_PCI 233#ifdef CONFIG_PCI
230 if (mask > 0xffffffff && forbid_dac > 0) { 234 if (mask > 0xffffffff && forbid_dac > 0) {
@@ -265,6 +269,12 @@ EXPORT_SYMBOL(dma_supported);
265 269
266static int __init pci_iommu_init(void) 270static int __init pci_iommu_init(void)
267{ 271{
272 dma_debug_init(PREALLOC_DMA_DEBUG_ENTRIES);
273
274#ifdef CONFIG_PCI
275 dma_debug_add_bus(&pci_bus_type);
276#endif
277
268 calgary_iommu_init(); 278 calgary_iommu_init();
269 279
270 intel_iommu_init(); 280 intel_iommu_init();
diff --git a/arch/x86/kernel/pci-gart_64.c b/arch/x86/kernel/pci-gart_64.c
index d5768b1af080..b284b58c035c 100644
--- a/arch/x86/kernel/pci-gart_64.c
+++ b/arch/x86/kernel/pci-gart_64.c
@@ -255,10 +255,13 @@ static dma_addr_t dma_map_area(struct device *dev, dma_addr_t phys_mem,
255} 255}
256 256
257/* Map a single area into the IOMMU */ 257/* Map a single area into the IOMMU */
258static dma_addr_t 258static dma_addr_t gart_map_page(struct device *dev, struct page *page,
259gart_map_single(struct device *dev, phys_addr_t paddr, size_t size, int dir) 259 unsigned long offset, size_t size,
260 enum dma_data_direction dir,
261 struct dma_attrs *attrs)
260{ 262{
261 unsigned long bus; 263 unsigned long bus;
264 phys_addr_t paddr = page_to_phys(page) + offset;
262 265
263 if (!dev) 266 if (!dev)
264 dev = &x86_dma_fallback_dev; 267 dev = &x86_dma_fallback_dev;
@@ -275,8 +278,9 @@ gart_map_single(struct device *dev, phys_addr_t paddr, size_t size, int dir)
275/* 278/*
276 * Free a DMA mapping. 279 * Free a DMA mapping.
277 */ 280 */
278static void gart_unmap_single(struct device *dev, dma_addr_t dma_addr, 281static void gart_unmap_page(struct device *dev, dma_addr_t dma_addr,
279 size_t size, int direction) 282 size_t size, enum dma_data_direction dir,
283 struct dma_attrs *attrs)
280{ 284{
281 unsigned long iommu_page; 285 unsigned long iommu_page;
282 int npages; 286 int npages;
@@ -298,8 +302,8 @@ static void gart_unmap_single(struct device *dev, dma_addr_t dma_addr,
298/* 302/*
299 * Wrapper for pci_unmap_single working with scatterlists. 303 * Wrapper for pci_unmap_single working with scatterlists.
300 */ 304 */
301static void 305static void gart_unmap_sg(struct device *dev, struct scatterlist *sg, int nents,
302gart_unmap_sg(struct device *dev, struct scatterlist *sg, int nents, int dir) 306 enum dma_data_direction dir, struct dma_attrs *attrs)
303{ 307{
304 struct scatterlist *s; 308 struct scatterlist *s;
305 int i; 309 int i;
@@ -307,7 +311,7 @@ gart_unmap_sg(struct device *dev, struct scatterlist *sg, int nents, int dir)
307 for_each_sg(sg, s, nents, i) { 311 for_each_sg(sg, s, nents, i) {
308 if (!s->dma_length || !s->length) 312 if (!s->dma_length || !s->length)
309 break; 313 break;
310 gart_unmap_single(dev, s->dma_address, s->dma_length, dir); 314 gart_unmap_page(dev, s->dma_address, s->dma_length, dir, NULL);
311 } 315 }
312} 316}
313 317
@@ -329,7 +333,7 @@ static int dma_map_sg_nonforce(struct device *dev, struct scatterlist *sg,
329 addr = dma_map_area(dev, addr, s->length, dir, 0); 333 addr = dma_map_area(dev, addr, s->length, dir, 0);
330 if (addr == bad_dma_address) { 334 if (addr == bad_dma_address) {
331 if (i > 0) 335 if (i > 0)
332 gart_unmap_sg(dev, sg, i, dir); 336 gart_unmap_sg(dev, sg, i, dir, NULL);
333 nents = 0; 337 nents = 0;
334 sg[0].dma_length = 0; 338 sg[0].dma_length = 0;
335 break; 339 break;
@@ -400,8 +404,8 @@ dma_map_cont(struct device *dev, struct scatterlist *start, int nelems,
400 * DMA map all entries in a scatterlist. 404 * DMA map all entries in a scatterlist.
401 * Merge chunks that have page aligned sizes into a continuous mapping. 405 * Merge chunks that have page aligned sizes into a continuous mapping.
402 */ 406 */
403static int 407static int gart_map_sg(struct device *dev, struct scatterlist *sg, int nents,
404gart_map_sg(struct device *dev, struct scatterlist *sg, int nents, int dir) 408 enum dma_data_direction dir, struct dma_attrs *attrs)
405{ 409{
406 struct scatterlist *s, *ps, *start_sg, *sgmap; 410 struct scatterlist *s, *ps, *start_sg, *sgmap;
407 int need = 0, nextneed, i, out, start; 411 int need = 0, nextneed, i, out, start;
@@ -468,7 +472,7 @@ gart_map_sg(struct device *dev, struct scatterlist *sg, int nents, int dir)
468 472
469error: 473error:
470 flush_gart(); 474 flush_gart();
471 gart_unmap_sg(dev, sg, out, dir); 475 gart_unmap_sg(dev, sg, out, dir, NULL);
472 476
473 /* When it was forced or merged try again in a dumb way */ 477 /* When it was forced or merged try again in a dumb way */
474 if (force_iommu || iommu_merge) { 478 if (force_iommu || iommu_merge) {
@@ -521,7 +525,7 @@ static void
521gart_free_coherent(struct device *dev, size_t size, void *vaddr, 525gart_free_coherent(struct device *dev, size_t size, void *vaddr,
522 dma_addr_t dma_addr) 526 dma_addr_t dma_addr)
523{ 527{
524 gart_unmap_single(dev, dma_addr, size, DMA_BIDIRECTIONAL); 528 gart_unmap_page(dev, dma_addr, size, DMA_BIDIRECTIONAL, NULL);
525 free_pages((unsigned long)vaddr, get_order(size)); 529 free_pages((unsigned long)vaddr, get_order(size));
526} 530}
527 531
@@ -707,11 +711,11 @@ static __init int init_k8_gatt(struct agp_kern_info *info)
707 return -1; 711 return -1;
708} 712}
709 713
710static struct dma_mapping_ops gart_dma_ops = { 714static struct dma_map_ops gart_dma_ops = {
711 .map_single = gart_map_single,
712 .unmap_single = gart_unmap_single,
713 .map_sg = gart_map_sg, 715 .map_sg = gart_map_sg,
714 .unmap_sg = gart_unmap_sg, 716 .unmap_sg = gart_unmap_sg,
717 .map_page = gart_map_page,
718 .unmap_page = gart_unmap_page,
715 .alloc_coherent = gart_alloc_coherent, 719 .alloc_coherent = gart_alloc_coherent,
716 .free_coherent = gart_free_coherent, 720 .free_coherent = gart_free_coherent,
717}; 721};
diff --git a/arch/x86/kernel/pci-nommu.c b/arch/x86/kernel/pci-nommu.c
index c70ab5a5d4c8..c6d703b39326 100644
--- a/arch/x86/kernel/pci-nommu.c
+++ b/arch/x86/kernel/pci-nommu.c
@@ -1,14 +1,14 @@
1/* Fallback functions when the main IOMMU code is not compiled in. This 1/* Fallback functions when the main IOMMU code is not compiled in. This
2 code is roughly equivalent to i386. */ 2 code is roughly equivalent to i386. */
3#include <linux/mm.h>
4#include <linux/init.h>
5#include <linux/pci.h>
6#include <linux/string.h>
7#include <linux/dma-mapping.h> 3#include <linux/dma-mapping.h>
8#include <linux/scatterlist.h> 4#include <linux/scatterlist.h>
5#include <linux/string.h>
6#include <linux/init.h>
7#include <linux/pci.h>
8#include <linux/mm.h>
9 9
10#include <asm/iommu.h>
11#include <asm/processor.h> 10#include <asm/processor.h>
11#include <asm/iommu.h>
12#include <asm/dma.h> 12#include <asm/dma.h>
13 13
14static int 14static int
@@ -25,19 +25,19 @@ check_addr(char *name, struct device *hwdev, dma_addr_t bus, size_t size)
25 return 1; 25 return 1;
26} 26}
27 27
28static dma_addr_t 28static dma_addr_t nommu_map_page(struct device *dev, struct page *page,
29nommu_map_single(struct device *hwdev, phys_addr_t paddr, size_t size, 29 unsigned long offset, size_t size,
30 int direction) 30 enum dma_data_direction dir,
31 struct dma_attrs *attrs)
31{ 32{
32 dma_addr_t bus = paddr; 33 dma_addr_t bus = page_to_phys(page) + offset;
33 WARN_ON(size == 0); 34 WARN_ON(size == 0);
34 if (!check_addr("map_single", hwdev, bus, size)) 35 if (!check_addr("map_single", dev, bus, size))
35 return bad_dma_address; 36 return bad_dma_address;
36 flush_write_buffers(); 37 flush_write_buffers();
37 return bus; 38 return bus;
38} 39}
39 40
40
41/* Map a set of buffers described by scatterlist in streaming 41/* Map a set of buffers described by scatterlist in streaming
42 * mode for DMA. This is the scatter-gather version of the 42 * mode for DMA. This is the scatter-gather version of the
43 * above pci_map_single interface. Here the scatter gather list 43 * above pci_map_single interface. Here the scatter gather list
@@ -54,7 +54,8 @@ nommu_map_single(struct device *hwdev, phys_addr_t paddr, size_t size,
54 * the same here. 54 * the same here.
55 */ 55 */
56static int nommu_map_sg(struct device *hwdev, struct scatterlist *sg, 56static int nommu_map_sg(struct device *hwdev, struct scatterlist *sg,
57 int nents, int direction) 57 int nents, enum dma_data_direction dir,
58 struct dma_attrs *attrs)
58{ 59{
59 struct scatterlist *s; 60 struct scatterlist *s;
60 int i; 61 int i;
@@ -78,12 +79,12 @@ static void nommu_free_coherent(struct device *dev, size_t size, void *vaddr,
78 free_pages((unsigned long)vaddr, get_order(size)); 79 free_pages((unsigned long)vaddr, get_order(size));
79} 80}
80 81
81struct dma_mapping_ops nommu_dma_ops = { 82struct dma_map_ops nommu_dma_ops = {
82 .alloc_coherent = dma_generic_alloc_coherent, 83 .alloc_coherent = dma_generic_alloc_coherent,
83 .free_coherent = nommu_free_coherent, 84 .free_coherent = nommu_free_coherent,
84 .map_single = nommu_map_single, 85 .map_sg = nommu_map_sg,
85 .map_sg = nommu_map_sg, 86 .map_page = nommu_map_page,
86 .is_phys = 1, 87 .is_phys = 1,
87}; 88};
88 89
89void __init no_iommu_init(void) 90void __init no_iommu_init(void)
diff --git a/arch/x86/kernel/pci-swiotlb_64.c b/arch/x86/kernel/pci-swiotlb.c
index d59c91747665..34f12e9996ed 100644
--- a/arch/x86/kernel/pci-swiotlb_64.c
+++ b/arch/x86/kernel/pci-swiotlb.c
@@ -33,18 +33,11 @@ phys_addr_t swiotlb_bus_to_phys(dma_addr_t baddr)
33 return baddr; 33 return baddr;
34} 34}
35 35
36int __weak swiotlb_arch_range_needs_mapping(void *ptr, size_t size) 36int __weak swiotlb_arch_range_needs_mapping(phys_addr_t paddr, size_t size)
37{ 37{
38 return 0; 38 return 0;
39} 39}
40 40
41static dma_addr_t
42swiotlb_map_single_phys(struct device *hwdev, phys_addr_t paddr, size_t size,
43 int direction)
44{
45 return swiotlb_map_single(hwdev, phys_to_virt(paddr), size, direction);
46}
47
48static void *x86_swiotlb_alloc_coherent(struct device *hwdev, size_t size, 41static void *x86_swiotlb_alloc_coherent(struct device *hwdev, size_t size,
49 dma_addr_t *dma_handle, gfp_t flags) 42 dma_addr_t *dma_handle, gfp_t flags)
50{ 43{
@@ -57,20 +50,20 @@ static void *x86_swiotlb_alloc_coherent(struct device *hwdev, size_t size,
57 return swiotlb_alloc_coherent(hwdev, size, dma_handle, flags); 50 return swiotlb_alloc_coherent(hwdev, size, dma_handle, flags);
58} 51}
59 52
60struct dma_mapping_ops swiotlb_dma_ops = { 53struct dma_map_ops swiotlb_dma_ops = {
61 .mapping_error = swiotlb_dma_mapping_error, 54 .mapping_error = swiotlb_dma_mapping_error,
62 .alloc_coherent = x86_swiotlb_alloc_coherent, 55 .alloc_coherent = x86_swiotlb_alloc_coherent,
63 .free_coherent = swiotlb_free_coherent, 56 .free_coherent = swiotlb_free_coherent,
64 .map_single = swiotlb_map_single_phys,
65 .unmap_single = swiotlb_unmap_single,
66 .sync_single_for_cpu = swiotlb_sync_single_for_cpu, 57 .sync_single_for_cpu = swiotlb_sync_single_for_cpu,
67 .sync_single_for_device = swiotlb_sync_single_for_device, 58 .sync_single_for_device = swiotlb_sync_single_for_device,
68 .sync_single_range_for_cpu = swiotlb_sync_single_range_for_cpu, 59 .sync_single_range_for_cpu = swiotlb_sync_single_range_for_cpu,
69 .sync_single_range_for_device = swiotlb_sync_single_range_for_device, 60 .sync_single_range_for_device = swiotlb_sync_single_range_for_device,
70 .sync_sg_for_cpu = swiotlb_sync_sg_for_cpu, 61 .sync_sg_for_cpu = swiotlb_sync_sg_for_cpu,
71 .sync_sg_for_device = swiotlb_sync_sg_for_device, 62 .sync_sg_for_device = swiotlb_sync_sg_for_device,
72 .map_sg = swiotlb_map_sg, 63 .map_sg = swiotlb_map_sg_attrs,
73 .unmap_sg = swiotlb_unmap_sg, 64 .unmap_sg = swiotlb_unmap_sg_attrs,
65 .map_page = swiotlb_map_page,
66 .unmap_page = swiotlb_unmap_page,
74 .dma_supported = NULL, 67 .dma_supported = NULL,
75}; 68};
76 69
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
index 6afa5232dbb7..156f87582c6c 100644
--- a/arch/x86/kernel/process.c
+++ b/arch/x86/kernel/process.c
@@ -65,11 +65,11 @@ void exit_thread(void)
65{ 65{
66 struct task_struct *me = current; 66 struct task_struct *me = current;
67 struct thread_struct *t = &me->thread; 67 struct thread_struct *t = &me->thread;
68 unsigned long *bp = t->io_bitmap_ptr;
68 69
69 if (me->thread.io_bitmap_ptr) { 70 if (bp) {
70 struct tss_struct *tss = &per_cpu(init_tss, get_cpu()); 71 struct tss_struct *tss = &per_cpu(init_tss, get_cpu());
71 72
72 kfree(t->io_bitmap_ptr);
73 t->io_bitmap_ptr = NULL; 73 t->io_bitmap_ptr = NULL;
74 clear_thread_flag(TIF_IO_BITMAP); 74 clear_thread_flag(TIF_IO_BITMAP);
75 /* 75 /*
@@ -78,6 +78,7 @@ void exit_thread(void)
78 memset(tss->io_bitmap, 0xff, t->io_bitmap_max); 78 memset(tss->io_bitmap, 0xff, t->io_bitmap_max);
79 t->io_bitmap_max = 0; 79 t->io_bitmap_max = 0;
80 put_cpu(); 80 put_cpu();
81 kfree(bp);
81 } 82 }
82 83
83 ds_exit_thread(current); 84 ds_exit_thread(current);
diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c
index 3d9672e59c16..19378715f415 100644
--- a/arch/x86/kernel/ptrace.c
+++ b/arch/x86/kernel/ptrace.c
@@ -685,9 +685,8 @@ static int ptrace_bts_config(struct task_struct *child,
685 if (!cfg.signal) 685 if (!cfg.signal)
686 return -EINVAL; 686 return -EINVAL;
687 687
688 return -EOPNOTSUPP;
689
690 child->thread.bts_ovfl_signal = cfg.signal; 688 child->thread.bts_ovfl_signal = cfg.signal;
689 return -EOPNOTSUPP;
691 } 690 }
692 691
693 if ((cfg.flags & PTRACE_BTS_O_ALLOC) && 692 if ((cfg.flags & PTRACE_BTS_O_ALLOC) &&
diff --git a/arch/x86/kernel/quirks.c b/arch/x86/kernel/quirks.c
index 697d1b78cfbf..e95022e4f5d5 100644
--- a/arch/x86/kernel/quirks.c
+++ b/arch/x86/kernel/quirks.c
@@ -74,8 +74,7 @@ static void ich_force_hpet_resume(void)
74 if (!force_hpet_address) 74 if (!force_hpet_address)
75 return; 75 return;
76 76
77 if (rcba_base == NULL) 77 BUG_ON(rcba_base == NULL);
78 BUG();
79 78
80 /* read the Function Disable register, dword mode only */ 79 /* read the Function Disable register, dword mode only */
81 val = readl(rcba_base + 0x3404); 80 val = readl(rcba_base + 0x3404);
diff --git a/arch/x86/kernel/relocate_kernel_32.S b/arch/x86/kernel/relocate_kernel_32.S
index 2064d0aa8d28..41235531b11c 100644
--- a/arch/x86/kernel/relocate_kernel_32.S
+++ b/arch/x86/kernel/relocate_kernel_32.S
@@ -17,7 +17,8 @@
17 17
18#define PTR(x) (x << 2) 18#define PTR(x) (x << 2)
19 19
20/* control_page + KEXEC_CONTROL_CODE_MAX_SIZE 20/*
21 * control_page + KEXEC_CONTROL_CODE_MAX_SIZE
21 * ~ control_page + PAGE_SIZE are used as data storage and stack for 22 * ~ control_page + PAGE_SIZE are used as data storage and stack for
22 * jumping back 23 * jumping back
23 */ 24 */
@@ -76,8 +77,10 @@ relocate_kernel:
76 movl %eax, CP_PA_SWAP_PAGE(%edi) 77 movl %eax, CP_PA_SWAP_PAGE(%edi)
77 movl %ebx, CP_PA_BACKUP_PAGES_MAP(%edi) 78 movl %ebx, CP_PA_BACKUP_PAGES_MAP(%edi)
78 79
79 /* get physical address of control page now */ 80 /*
80 /* this is impossible after page table switch */ 81 * get physical address of control page now
82 * this is impossible after page table switch
83 */
81 movl PTR(PA_CONTROL_PAGE)(%ebp), %edi 84 movl PTR(PA_CONTROL_PAGE)(%ebp), %edi
82 85
83 /* switch to new set of page tables */ 86 /* switch to new set of page tables */
@@ -97,7 +100,8 @@ identity_mapped:
97 /* store the start address on the stack */ 100 /* store the start address on the stack */
98 pushl %edx 101 pushl %edx
99 102
100 /* Set cr0 to a known state: 103 /*
104 * Set cr0 to a known state:
101 * - Paging disabled 105 * - Paging disabled
102 * - Alignment check disabled 106 * - Alignment check disabled
103 * - Write protect disabled 107 * - Write protect disabled
@@ -113,7 +117,8 @@ identity_mapped:
113 /* clear cr4 if applicable */ 117 /* clear cr4 if applicable */
114 testl %ecx, %ecx 118 testl %ecx, %ecx
115 jz 1f 119 jz 1f
116 /* Set cr4 to a known state: 120 /*
121 * Set cr4 to a known state:
117 * Setting everything to zero seems safe. 122 * Setting everything to zero seems safe.
118 */ 123 */
119 xorl %eax, %eax 124 xorl %eax, %eax
@@ -132,15 +137,18 @@ identity_mapped:
132 call swap_pages 137 call swap_pages
133 addl $8, %esp 138 addl $8, %esp
134 139
135 /* To be certain of avoiding problems with self-modifying code 140 /*
141 * To be certain of avoiding problems with self-modifying code
136 * I need to execute a serializing instruction here. 142 * I need to execute a serializing instruction here.
137 * So I flush the TLB, it's handy, and not processor dependent. 143 * So I flush the TLB, it's handy, and not processor dependent.
138 */ 144 */
139 xorl %eax, %eax 145 xorl %eax, %eax
140 movl %eax, %cr3 146 movl %eax, %cr3
141 147
142 /* set all of the registers to known values */ 148 /*
143 /* leave %esp alone */ 149 * set all of the registers to known values
150 * leave %esp alone
151 */
144 152
145 testl %esi, %esi 153 testl %esi, %esi
146 jnz 1f 154 jnz 1f
diff --git a/arch/x86/kernel/relocate_kernel_64.S b/arch/x86/kernel/relocate_kernel_64.S
index d32cfb27a479..4de8f5b3d476 100644
--- a/arch/x86/kernel/relocate_kernel_64.S
+++ b/arch/x86/kernel/relocate_kernel_64.S
@@ -19,29 +19,77 @@
19#define PTR(x) (x << 3) 19#define PTR(x) (x << 3)
20#define PAGE_ATTR (_PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED | _PAGE_DIRTY) 20#define PAGE_ATTR (_PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED | _PAGE_DIRTY)
21 21
22/*
23 * control_page + KEXEC_CONTROL_CODE_MAX_SIZE
24 * ~ control_page + PAGE_SIZE are used as data storage and stack for
25 * jumping back
26 */
27#define DATA(offset) (KEXEC_CONTROL_CODE_MAX_SIZE+(offset))
28
29/* Minimal CPU state */
30#define RSP DATA(0x0)
31#define CR0 DATA(0x8)
32#define CR3 DATA(0x10)
33#define CR4 DATA(0x18)
34
35/* other data */
36#define CP_PA_TABLE_PAGE DATA(0x20)
37#define CP_PA_SWAP_PAGE DATA(0x28)
38#define CP_PA_BACKUP_PAGES_MAP DATA(0x30)
39
22 .text 40 .text
23 .align PAGE_SIZE 41 .align PAGE_SIZE
24 .code64 42 .code64
25 .globl relocate_kernel 43 .globl relocate_kernel
26relocate_kernel: 44relocate_kernel:
27 /* %rdi indirection_page 45 /*
46 * %rdi indirection_page
28 * %rsi page_list 47 * %rsi page_list
29 * %rdx start address 48 * %rdx start address
49 * %rcx preserve_context
30 */ 50 */
31 51
52 /* Save the CPU context, used for jumping back */
53 pushq %rbx
54 pushq %rbp
55 pushq %r12
56 pushq %r13
57 pushq %r14
58 pushq %r15
59 pushf
60
61 movq PTR(VA_CONTROL_PAGE)(%rsi), %r11
62 movq %rsp, RSP(%r11)
63 movq %cr0, %rax
64 movq %rax, CR0(%r11)
65 movq %cr3, %rax
66 movq %rax, CR3(%r11)
67 movq %cr4, %rax
68 movq %rax, CR4(%r11)
69
32 /* zero out flags, and disable interrupts */ 70 /* zero out flags, and disable interrupts */
33 pushq $0 71 pushq $0
34 popfq 72 popfq
35 73
36 /* get physical address of control page now */ 74 /*
37 /* this is impossible after page table switch */ 75 * get physical address of control page now
76 * this is impossible after page table switch
77 */
38 movq PTR(PA_CONTROL_PAGE)(%rsi), %r8 78 movq PTR(PA_CONTROL_PAGE)(%rsi), %r8
39 79
40 /* get physical address of page table now too */ 80 /* get physical address of page table now too */
41 movq PTR(PA_TABLE_PAGE)(%rsi), %rcx 81 movq PTR(PA_TABLE_PAGE)(%rsi), %r9
82
83 /* get physical address of swap page now */
84 movq PTR(PA_SWAP_PAGE)(%rsi), %r10
85
86 /* save some information for jumping back */
87 movq %r9, CP_PA_TABLE_PAGE(%r11)
88 movq %r10, CP_PA_SWAP_PAGE(%r11)
89 movq %rdi, CP_PA_BACKUP_PAGES_MAP(%r11)
42 90
43 /* Switch to the identity mapped page tables */ 91 /* Switch to the identity mapped page tables */
44 movq %rcx, %cr3 92 movq %r9, %cr3
45 93
46 /* setup a new stack at the end of the physical control page */ 94 /* setup a new stack at the end of the physical control page */
47 lea PAGE_SIZE(%r8), %rsp 95 lea PAGE_SIZE(%r8), %rsp
@@ -55,7 +103,8 @@ identity_mapped:
55 /* store the start address on the stack */ 103 /* store the start address on the stack */
56 pushq %rdx 104 pushq %rdx
57 105
58 /* Set cr0 to a known state: 106 /*
107 * Set cr0 to a known state:
59 * - Paging enabled 108 * - Paging enabled
60 * - Alignment check disabled 109 * - Alignment check disabled
61 * - Write protect disabled 110 * - Write protect disabled
@@ -68,7 +117,8 @@ identity_mapped:
68 orl $(X86_CR0_PG | X86_CR0_PE), %eax 117 orl $(X86_CR0_PG | X86_CR0_PE), %eax
69 movq %rax, %cr0 118 movq %rax, %cr0
70 119
71 /* Set cr4 to a known state: 120 /*
121 * Set cr4 to a known state:
72 * - physical address extension enabled 122 * - physical address extension enabled
73 */ 123 */
74 movq $X86_CR4_PAE, %rax 124 movq $X86_CR4_PAE, %rax
@@ -78,9 +128,87 @@ identity_mapped:
781: 1281:
79 129
80 /* Flush the TLB (needed?) */ 130 /* Flush the TLB (needed?) */
81 movq %rcx, %cr3 131 movq %r9, %cr3
132
133 movq %rcx, %r11
134 call swap_pages
135
136 /*
137 * To be certain of avoiding problems with self-modifying code
138 * I need to execute a serializing instruction here.
139 * So I flush the TLB by reloading %cr3 here, it's handy,
140 * and not processor dependent.
141 */
142 movq %cr3, %rax
143 movq %rax, %cr3
144
145 /*
146 * set all of the registers to known values
147 * leave %rsp alone
148 */
149
150 testq %r11, %r11
151 jnz 1f
152 xorq %rax, %rax
153 xorq %rbx, %rbx
154 xorq %rcx, %rcx
155 xorq %rdx, %rdx
156 xorq %rsi, %rsi
157 xorq %rdi, %rdi
158 xorq %rbp, %rbp
159 xorq %r8, %r8
160 xorq %r9, %r9
161 xorq %r10, %r9
162 xorq %r11, %r11
163 xorq %r12, %r12
164 xorq %r13, %r13
165 xorq %r14, %r14
166 xorq %r15, %r15
167
168 ret
169
1701:
171 popq %rdx
172 leaq PAGE_SIZE(%r10), %rsp
173 call *%rdx
174
175 /* get the re-entry point of the peer system */
176 movq 0(%rsp), %rbp
177 call 1f
1781:
179 popq %r8
180 subq $(1b - relocate_kernel), %r8
181 movq CP_PA_SWAP_PAGE(%r8), %r10
182 movq CP_PA_BACKUP_PAGES_MAP(%r8), %rdi
183 movq CP_PA_TABLE_PAGE(%r8), %rax
184 movq %rax, %cr3
185 lea PAGE_SIZE(%r8), %rsp
186 call swap_pages
187 movq $virtual_mapped, %rax
188 pushq %rax
189 ret
190
191virtual_mapped:
192 movq RSP(%r8), %rsp
193 movq CR4(%r8), %rax
194 movq %rax, %cr4
195 movq CR3(%r8), %rax
196 movq CR0(%r8), %r8
197 movq %rax, %cr3
198 movq %r8, %cr0
199 movq %rbp, %rax
200
201 popf
202 popq %r15
203 popq %r14
204 popq %r13
205 popq %r12
206 popq %rbp
207 popq %rbx
208 ret
82 209
83 /* Do the copies */ 210 /* Do the copies */
211swap_pages:
84 movq %rdi, %rcx /* Put the page_list in %rcx */ 212 movq %rdi, %rcx /* Put the page_list in %rcx */
85 xorq %rdi, %rdi 213 xorq %rdi, %rdi
86 xorq %rsi, %rsi 214 xorq %rsi, %rsi
@@ -112,36 +240,27 @@ identity_mapped:
112 movq %rcx, %rsi /* For ever source page do a copy */ 240 movq %rcx, %rsi /* For ever source page do a copy */
113 andq $0xfffffffffffff000, %rsi 241 andq $0xfffffffffffff000, %rsi
114 242
243 movq %rdi, %rdx
244 movq %rsi, %rax
245
246 movq %r10, %rdi
115 movq $512, %rcx 247 movq $512, %rcx
116 rep ; movsq 248 rep ; movsq
117 jmp 0b
1183:
119
120 /* To be certain of avoiding problems with self-modifying code
121 * I need to execute a serializing instruction here.
122 * So I flush the TLB by reloading %cr3 here, it's handy,
123 * and not processor dependent.
124 */
125 movq %cr3, %rax
126 movq %rax, %cr3
127 249
128 /* set all of the registers to known values */ 250 movq %rax, %rdi
129 /* leave %rsp alone */ 251 movq %rdx, %rsi
252 movq $512, %rcx
253 rep ; movsq
130 254
131 xorq %rax, %rax 255 movq %rdx, %rdi
132 xorq %rbx, %rbx 256 movq %r10, %rsi
133 xorq %rcx, %rcx 257 movq $512, %rcx
134 xorq %rdx, %rdx 258 rep ; movsq
135 xorq %rsi, %rsi
136 xorq %rdi, %rdi
137 xorq %rbp, %rbp
138 xorq %r8, %r8
139 xorq %r9, %r9
140 xorq %r10, %r9
141 xorq %r11, %r11
142 xorq %r12, %r12
143 xorq %r13, %r13
144 xorq %r14, %r14
145 xorq %r15, %r15
146 259
260 lea PAGE_SIZE(%rax), %rsi
261 jmp 0b
2623:
147 ret 263 ret
264
265 .globl kexec_control_code_size
266.set kexec_control_code_size, . - relocate_kernel
diff --git a/arch/x86/kernel/rtc.c b/arch/x86/kernel/rtc.c
index dd6f2b71561b..5d465b207e72 100644
--- a/arch/x86/kernel/rtc.c
+++ b/arch/x86/kernel/rtc.c
@@ -1,14 +1,14 @@
1/* 1/*
2 * RTC related functions 2 * RTC related functions
3 */ 3 */
4#include <linux/platform_device.h>
5#include <linux/mc146818rtc.h>
4#include <linux/acpi.h> 6#include <linux/acpi.h>
5#include <linux/bcd.h> 7#include <linux/bcd.h>
6#include <linux/mc146818rtc.h>
7#include <linux/platform_device.h>
8#include <linux/pnp.h> 8#include <linux/pnp.h>
9 9
10#include <asm/time.h>
11#include <asm/vsyscall.h> 10#include <asm/vsyscall.h>
11#include <asm/time.h>
12 12
13#ifdef CONFIG_X86_32 13#ifdef CONFIG_X86_32
14/* 14/*
@@ -16,9 +16,9 @@
16 * register we are working with. It is required for NMI access to the 16 * register we are working with. It is required for NMI access to the
17 * CMOS/RTC registers. See include/asm-i386/mc146818rtc.h for details. 17 * CMOS/RTC registers. See include/asm-i386/mc146818rtc.h for details.
18 */ 18 */
19volatile unsigned long cmos_lock = 0; 19volatile unsigned long cmos_lock;
20EXPORT_SYMBOL(cmos_lock); 20EXPORT_SYMBOL(cmos_lock);
21#endif 21#endif /* CONFIG_X86_32 */
22 22
23/* For two digit years assume time is always after that */ 23/* For two digit years assume time is always after that */
24#define CMOS_YEARS_OFFS 2000 24#define CMOS_YEARS_OFFS 2000
@@ -38,9 +38,9 @@ EXPORT_SYMBOL(rtc_lock);
38 */ 38 */
39int mach_set_rtc_mmss(unsigned long nowtime) 39int mach_set_rtc_mmss(unsigned long nowtime)
40{ 40{
41 int retval = 0;
42 int real_seconds, real_minutes, cmos_minutes; 41 int real_seconds, real_minutes, cmos_minutes;
43 unsigned char save_control, save_freq_select; 42 unsigned char save_control, save_freq_select;
43 int retval = 0;
44 44
45 /* tell the clock it's being set */ 45 /* tell the clock it's being set */
46 save_control = CMOS_READ(RTC_CONTROL); 46 save_control = CMOS_READ(RTC_CONTROL);
@@ -72,8 +72,8 @@ int mach_set_rtc_mmss(unsigned long nowtime)
72 real_seconds = bin2bcd(real_seconds); 72 real_seconds = bin2bcd(real_seconds);
73 real_minutes = bin2bcd(real_minutes); 73 real_minutes = bin2bcd(real_minutes);
74 } 74 }
75 CMOS_WRITE(real_seconds,RTC_SECONDS); 75 CMOS_WRITE(real_seconds, RTC_SECONDS);
76 CMOS_WRITE(real_minutes,RTC_MINUTES); 76 CMOS_WRITE(real_minutes, RTC_MINUTES);
77 } else { 77 } else {
78 printk(KERN_WARNING 78 printk(KERN_WARNING
79 "set_rtc_mmss: can't update from %d to %d\n", 79 "set_rtc_mmss: can't update from %d to %d\n",
@@ -151,6 +151,7 @@ unsigned char rtc_cmos_read(unsigned char addr)
151 outb(addr, RTC_PORT(0)); 151 outb(addr, RTC_PORT(0));
152 val = inb(RTC_PORT(1)); 152 val = inb(RTC_PORT(1));
153 lock_cmos_suffix(addr); 153 lock_cmos_suffix(addr);
154
154 return val; 155 return val;
155} 156}
156EXPORT_SYMBOL(rtc_cmos_read); 157EXPORT_SYMBOL(rtc_cmos_read);
@@ -166,8 +167,8 @@ EXPORT_SYMBOL(rtc_cmos_write);
166 167
167static int set_rtc_mmss(unsigned long nowtime) 168static int set_rtc_mmss(unsigned long nowtime)
168{ 169{
169 int retval;
170 unsigned long flags; 170 unsigned long flags;
171 int retval;
171 172
172 spin_lock_irqsave(&rtc_lock, flags); 173 spin_lock_irqsave(&rtc_lock, flags);
173 retval = set_wallclock(nowtime); 174 retval = set_wallclock(nowtime);
@@ -242,6 +243,7 @@ static __init int add_rtc_cmos(void)
242 platform_device_register(&rtc_device); 243 platform_device_register(&rtc_device);
243 dev_info(&rtc_device.dev, 244 dev_info(&rtc_device.dev,
244 "registered platform RTC device (no PNP device found)\n"); 245 "registered platform RTC device (no PNP device found)\n");
246
245 return 0; 247 return 0;
246} 248}
247device_initcall(add_rtc_cmos); 249device_initcall(add_rtc_cmos);
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index b746deb9ebc6..b4158439bf63 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -112,8 +112,13 @@
112#define ARCH_SETUP 112#define ARCH_SETUP
113#endif 113#endif
114 114
115RESERVE_BRK(dmi_alloc, 65536);
116
115unsigned int boot_cpu_id __read_mostly; 117unsigned int boot_cpu_id __read_mostly;
116 118
119static __initdata unsigned long _brk_start = (unsigned long)__brk_base;
120unsigned long _brk_end = (unsigned long)__brk_base;
121
117#ifdef CONFIG_X86_64 122#ifdef CONFIG_X86_64
118int default_cpu_present_to_apicid(int mps_cpu) 123int default_cpu_present_to_apicid(int mps_cpu)
119{ 124{
@@ -158,12 +163,6 @@ static struct resource bss_resource = {
158 163
159 164
160#ifdef CONFIG_X86_32 165#ifdef CONFIG_X86_32
161/* This value is set up by the early boot code to point to the value
162 immediately after the boot time page tables. It contains a *physical*
163 address, and must not be in the .bss segment! */
164unsigned long init_pg_tables_start __initdata = ~0UL;
165unsigned long init_pg_tables_end __initdata = ~0UL;
166
167static struct resource video_ram_resource = { 166static struct resource video_ram_resource = {
168 .name = "Video RAM area", 167 .name = "Video RAM area",
169 .start = 0xa0000, 168 .start = 0xa0000,
@@ -202,7 +201,9 @@ struct ist_info ist_info;
202#endif 201#endif
203 202
204#else 203#else
205struct cpuinfo_x86 boot_cpu_data __read_mostly; 204struct cpuinfo_x86 boot_cpu_data __read_mostly = {
205 .x86_phys_bits = MAX_PHYSMEM_BITS,
206};
206EXPORT_SYMBOL(boot_cpu_data); 207EXPORT_SYMBOL(boot_cpu_data);
207#endif 208#endif
208 209
@@ -217,12 +218,6 @@ unsigned long mmu_cr4_features = X86_CR4_PAE;
217int bootloader_type; 218int bootloader_type;
218 219
219/* 220/*
220 * Early DMI memory
221 */
222int dmi_alloc_index;
223char dmi_alloc_data[DMI_MAX_DATA];
224
225/*
226 * Setup options 221 * Setup options
227 */ 222 */
228struct screen_info screen_info; 223struct screen_info screen_info;
@@ -267,6 +262,35 @@ static inline void copy_edd(void)
267} 262}
268#endif 263#endif
269 264
265void * __init extend_brk(size_t size, size_t align)
266{
267 size_t mask = align - 1;
268 void *ret;
269
270 BUG_ON(_brk_start == 0);
271 BUG_ON(align & mask);
272
273 _brk_end = (_brk_end + mask) & ~mask;
274 BUG_ON((char *)(_brk_end + size) > __brk_limit);
275
276 ret = (void *)_brk_end;
277 _brk_end += size;
278
279 memset(ret, 0, size);
280
281 return ret;
282}
283
284static void __init reserve_brk(void)
285{
286 if (_brk_end > _brk_start)
287 reserve_early(__pa(_brk_start), __pa(_brk_end), "BRK");
288
289 /* Mark brk area as locked down and no longer taking any
290 new allocations */
291 _brk_start = 0;
292}
293
270#ifdef CONFIG_BLK_DEV_INITRD 294#ifdef CONFIG_BLK_DEV_INITRD
271 295
272#ifdef CONFIG_X86_32 296#ifdef CONFIG_X86_32
@@ -715,11 +739,7 @@ void __init setup_arch(char **cmdline_p)
715 init_mm.start_code = (unsigned long) _text; 739 init_mm.start_code = (unsigned long) _text;
716 init_mm.end_code = (unsigned long) _etext; 740 init_mm.end_code = (unsigned long) _etext;
717 init_mm.end_data = (unsigned long) _edata; 741 init_mm.end_data = (unsigned long) _edata;
718#ifdef CONFIG_X86_32 742 init_mm.brk = _brk_end;
719 init_mm.brk = init_pg_tables_end + PAGE_OFFSET;
720#else
721 init_mm.brk = (unsigned long) &_end;
722#endif
723 743
724 code_resource.start = virt_to_phys(_text); 744 code_resource.start = virt_to_phys(_text);
725 code_resource.end = virt_to_phys(_etext)-1; 745 code_resource.end = virt_to_phys(_etext)-1;
@@ -840,6 +860,8 @@ void __init setup_arch(char **cmdline_p)
840 setup_bios_corruption_check(); 860 setup_bios_corruption_check();
841#endif 861#endif
842 862
863 reserve_brk();
864
843 /* max_pfn_mapped is updated here */ 865 /* max_pfn_mapped is updated here */
844 max_low_pfn_mapped = init_memory_mapping(0, max_low_pfn<<PAGE_SHIFT); 866 max_low_pfn_mapped = init_memory_mapping(0, max_low_pfn<<PAGE_SHIFT);
845 max_pfn_mapped = max_low_pfn_mapped; 867 max_pfn_mapped = max_low_pfn_mapped;
@@ -1027,7 +1049,6 @@ void __init x86_quirk_trap_init(void)
1027static struct irqaction irq0 = { 1049static struct irqaction irq0 = {
1028 .handler = timer_interrupt, 1050 .handler = timer_interrupt,
1029 .flags = IRQF_DISABLED | IRQF_NOBALANCING | IRQF_IRQPOLL | IRQF_TIMER, 1051 .flags = IRQF_DISABLED | IRQF_NOBALANCING | IRQF_IRQPOLL | IRQF_TIMER,
1030 .mask = CPU_MASK_NONE,
1031 .name = "timer" 1052 .name = "timer"
1032}; 1053};
1033 1054
diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c
index d2cc6428c587..dfcc74ab0ab6 100644
--- a/arch/x86/kernel/signal.c
+++ b/arch/x86/kernel/signal.c
@@ -211,31 +211,27 @@ get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, size_t frame_size,
211{ 211{
212 /* Default to using normal stack */ 212 /* Default to using normal stack */
213 unsigned long sp = regs->sp; 213 unsigned long sp = regs->sp;
214 int onsigstack = on_sig_stack(sp);
214 215
215#ifdef CONFIG_X86_64 216#ifdef CONFIG_X86_64
216 /* redzone */ 217 /* redzone */
217 sp -= 128; 218 sp -= 128;
218#endif /* CONFIG_X86_64 */ 219#endif /* CONFIG_X86_64 */
219 220
220 /* 221 if (!onsigstack) {
221 * If we are on the alternate signal stack and would overflow it, don't. 222 /* This is the X/Open sanctioned signal stack switching. */
222 * Return an always-bogus address instead so we will die with SIGSEGV. 223 if (ka->sa.sa_flags & SA_ONSTACK) {
223 */ 224 if (sas_ss_flags(sp) == 0)
224 if (on_sig_stack(sp) && !likely(on_sig_stack(sp - frame_size))) 225 sp = current->sas_ss_sp + current->sas_ss_size;
225 return (void __user *) -1L; 226 } else {
226
227 /* This is the X/Open sanctioned signal stack switching. */
228 if (ka->sa.sa_flags & SA_ONSTACK) {
229 if (sas_ss_flags(sp) == 0)
230 sp = current->sas_ss_sp + current->sas_ss_size;
231 } else {
232#ifdef CONFIG_X86_32 227#ifdef CONFIG_X86_32
233 /* This is the legacy signal stack switching. */ 228 /* This is the legacy signal stack switching. */
234 if ((regs->ss & 0xffff) != __USER_DS && 229 if ((regs->ss & 0xffff) != __USER_DS &&
235 !(ka->sa.sa_flags & SA_RESTORER) && 230 !(ka->sa.sa_flags & SA_RESTORER) &&
236 ka->sa.sa_restorer) 231 ka->sa.sa_restorer)
237 sp = (unsigned long) ka->sa.sa_restorer; 232 sp = (unsigned long) ka->sa.sa_restorer;
238#endif /* CONFIG_X86_32 */ 233#endif /* CONFIG_X86_32 */
234 }
239 } 235 }
240 236
241 if (used_math()) { 237 if (used_math()) {
@@ -244,12 +240,22 @@ get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, size_t frame_size,
244 sp = round_down(sp, 64); 240 sp = round_down(sp, 64);
245#endif /* CONFIG_X86_64 */ 241#endif /* CONFIG_X86_64 */
246 *fpstate = (void __user *)sp; 242 *fpstate = (void __user *)sp;
247
248 if (save_i387_xstate(*fpstate) < 0)
249 return (void __user *)-1L;
250 } 243 }
251 244
252 return (void __user *)align_sigframe(sp - frame_size); 245 sp = align_sigframe(sp - frame_size);
246
247 /*
248 * If we are on the alternate signal stack and would overflow it, don't.
249 * Return an always-bogus address instead so we will die with SIGSEGV.
250 */
251 if (onsigstack && !likely(on_sig_stack(sp)))
252 return (void __user *)-1L;
253
254 /* save i387 state */
255 if (used_math() && save_i387_xstate(*fpstate) < 0)
256 return (void __user *)-1L;
257
258 return (void __user *)sp;
253} 259}
254 260
255#ifdef CONFIG_X86_32 261#ifdef CONFIG_X86_32
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 249334f5080a..ef7d10170c30 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -114,10 +114,6 @@ EXPORT_PER_CPU_SYMBOL(cpu_info);
114 114
115atomic_t init_deasserted; 115atomic_t init_deasserted;
116 116
117
118/* Set if we find a B stepping CPU */
119static int __cpuinitdata smp_b_stepping;
120
121#if defined(CONFIG_NUMA) && defined(CONFIG_X86_32) 117#if defined(CONFIG_NUMA) && defined(CONFIG_X86_32)
122 118
123/* which logical CPUs are on which nodes */ 119/* which logical CPUs are on which nodes */
@@ -271,8 +267,6 @@ static void __cpuinit smp_callin(void)
271 cpumask_set_cpu(cpuid, cpu_callin_mask); 267 cpumask_set_cpu(cpuid, cpu_callin_mask);
272} 268}
273 269
274static int __cpuinitdata unsafe_smp;
275
276/* 270/*
277 * Activate a secondary processor. 271 * Activate a secondary processor.
278 */ 272 */
@@ -340,76 +334,6 @@ notrace static void __cpuinit start_secondary(void *unused)
340 cpu_idle(); 334 cpu_idle();
341} 335}
342 336
343static void __cpuinit smp_apply_quirks(struct cpuinfo_x86 *c)
344{
345 /*
346 * Mask B, Pentium, but not Pentium MMX
347 */
348 if (c->x86_vendor == X86_VENDOR_INTEL &&
349 c->x86 == 5 &&
350 c->x86_mask >= 1 && c->x86_mask <= 4 &&
351 c->x86_model <= 3)
352 /*
353 * Remember we have B step Pentia with bugs
354 */
355 smp_b_stepping = 1;
356
357 /*
358 * Certain Athlons might work (for various values of 'work') in SMP
359 * but they are not certified as MP capable.
360 */
361 if ((c->x86_vendor == X86_VENDOR_AMD) && (c->x86 == 6)) {
362
363 if (num_possible_cpus() == 1)
364 goto valid_k7;
365
366 /* Athlon 660/661 is valid. */
367 if ((c->x86_model == 6) && ((c->x86_mask == 0) ||
368 (c->x86_mask == 1)))
369 goto valid_k7;
370
371 /* Duron 670 is valid */
372 if ((c->x86_model == 7) && (c->x86_mask == 0))
373 goto valid_k7;
374
375 /*
376 * Athlon 662, Duron 671, and Athlon >model 7 have capability
377 * bit. It's worth noting that the A5 stepping (662) of some
378 * Athlon XP's have the MP bit set.
379 * See http://www.heise.de/newsticker/data/jow-18.10.01-000 for
380 * more.
381 */
382 if (((c->x86_model == 6) && (c->x86_mask >= 2)) ||
383 ((c->x86_model == 7) && (c->x86_mask >= 1)) ||
384 (c->x86_model > 7))
385 if (cpu_has_mp)
386 goto valid_k7;
387
388 /* If we get here, not a certified SMP capable AMD system. */
389 unsafe_smp = 1;
390 }
391
392valid_k7:
393 ;
394}
395
396static void __cpuinit smp_checks(void)
397{
398 if (smp_b_stepping)
399 printk(KERN_WARNING "WARNING: SMP operation may be unreliable"
400 "with B stepping processors.\n");
401
402 /*
403 * Don't taint if we are running SMP kernel on a single non-MP
404 * approved Athlon
405 */
406 if (unsafe_smp && num_online_cpus() > 1) {
407 printk(KERN_INFO "WARNING: This combination of AMD"
408 "processors is not suitable for SMP.\n");
409 add_taint(TAINT_UNSAFE_SMP);
410 }
411}
412
413/* 337/*
414 * The bootstrap kernel entry code has set these up. Save them for 338 * The bootstrap kernel entry code has set these up. Save them for
415 * a given CPU 339 * a given CPU
@@ -423,7 +347,6 @@ void __cpuinit smp_store_cpu_info(int id)
423 c->cpu_index = id; 347 c->cpu_index = id;
424 if (id != 0) 348 if (id != 0)
425 identify_secondary_cpu(c); 349 identify_secondary_cpu(c);
426 smp_apply_quirks(c);
427} 350}
428 351
429 352
@@ -1193,7 +1116,6 @@ void __init native_smp_cpus_done(unsigned int max_cpus)
1193 pr_debug("Boot done.\n"); 1116 pr_debug("Boot done.\n");
1194 1117
1195 impress_friends(); 1118 impress_friends();
1196 smp_checks();
1197#ifdef CONFIG_X86_IO_APIC 1119#ifdef CONFIG_X86_IO_APIC
1198 setup_ioapic_dest(); 1120 setup_ioapic_dest();
1199#endif 1121#endif
diff --git a/arch/x86/kernel/time_64.c b/arch/x86/kernel/time_64.c
index 241ec3923f61..5ba343e61844 100644
--- a/arch/x86/kernel/time_64.c
+++ b/arch/x86/kernel/time_64.c
@@ -116,7 +116,6 @@ unsigned long __init calibrate_cpu(void)
116static struct irqaction irq0 = { 116static struct irqaction irq0 = {
117 .handler = timer_interrupt, 117 .handler = timer_interrupt,
118 .flags = IRQF_DISABLED | IRQF_IRQPOLL | IRQF_NOBALANCING | IRQF_TIMER, 118 .flags = IRQF_DISABLED | IRQF_IRQPOLL | IRQF_NOBALANCING | IRQF_TIMER,
119 .mask = CPU_MASK_NONE,
120 .name = "timer" 119 .name = "timer"
121}; 120};
122 121
@@ -125,7 +124,6 @@ void __init hpet_time_init(void)
125 if (!hpet_enable()) 124 if (!hpet_enable())
126 setup_pit_timer(); 125 setup_pit_timer();
127 126
128 irq0.mask = cpumask_of_cpu(0);
129 setup_irq(0, &irq0); 127 setup_irq(0, &irq0);
130} 128}
131 129
diff --git a/arch/x86/kernel/tlb_uv.c b/arch/x86/kernel/tlb_uv.c
index d038b9c45cf8..79c073247284 100644
--- a/arch/x86/kernel/tlb_uv.c
+++ b/arch/x86/kernel/tlb_uv.c
@@ -750,7 +750,7 @@ static int __init uv_bau_init(void)
750 int node; 750 int node;
751 int nblades; 751 int nblades;
752 int last_blade; 752 int last_blade;
753 int cur_cpu = 0; 753 int cur_cpu;
754 754
755 if (!is_uv_system()) 755 if (!is_uv_system())
756 return 0; 756 return 0;
@@ -760,6 +760,7 @@ static int __init uv_bau_init(void)
760 uv_mmask = (1UL << uv_hub_info->n_val) - 1; 760 uv_mmask = (1UL << uv_hub_info->n_val) - 1;
761 nblades = 0; 761 nblades = 0;
762 last_blade = -1; 762 last_blade = -1;
763 cur_cpu = 0;
763 for_each_online_node(node) { 764 for_each_online_node(node) {
764 blade = uv_node_to_blade_id(node); 765 blade = uv_node_to_blade_id(node);
765 if (blade == last_blade) 766 if (blade == last_blade)
diff --git a/arch/x86/kernel/topology.c b/arch/x86/kernel/topology.c
index 0fcc95a354f7..7e4515957a1c 100644
--- a/arch/x86/kernel/topology.c
+++ b/arch/x86/kernel/topology.c
@@ -25,10 +25,10 @@
25 * 25 *
26 * Send feedback to <colpatch@us.ibm.com> 26 * Send feedback to <colpatch@us.ibm.com>
27 */ 27 */
28#include <linux/init.h>
29#include <linux/smp.h>
30#include <linux/nodemask.h> 28#include <linux/nodemask.h>
31#include <linux/mmzone.h> 29#include <linux/mmzone.h>
30#include <linux/init.h>
31#include <linux/smp.h>
32#include <asm/cpu.h> 32#include <asm/cpu.h>
33 33
34static DEFINE_PER_CPU(struct x86_cpu, cpu_devices); 34static DEFINE_PER_CPU(struct x86_cpu, cpu_devices);
@@ -47,6 +47,7 @@ int __ref arch_register_cpu(int num)
47 */ 47 */
48 if (num) 48 if (num)
49 per_cpu(cpu_devices, num).cpu.hotpluggable = 1; 49 per_cpu(cpu_devices, num).cpu.hotpluggable = 1;
50
50 return register_cpu(&per_cpu(cpu_devices, num).cpu, num); 51 return register_cpu(&per_cpu(cpu_devices, num).cpu, num);
51} 52}
52EXPORT_SYMBOL(arch_register_cpu); 53EXPORT_SYMBOL(arch_register_cpu);
@@ -56,12 +57,13 @@ void arch_unregister_cpu(int num)
56 unregister_cpu(&per_cpu(cpu_devices, num).cpu); 57 unregister_cpu(&per_cpu(cpu_devices, num).cpu);
57} 58}
58EXPORT_SYMBOL(arch_unregister_cpu); 59EXPORT_SYMBOL(arch_unregister_cpu);
59#else 60#else /* CONFIG_HOTPLUG_CPU */
61
60static int __init arch_register_cpu(int num) 62static int __init arch_register_cpu(int num)
61{ 63{
62 return register_cpu(&per_cpu(cpu_devices, num).cpu, num); 64 return register_cpu(&per_cpu(cpu_devices, num).cpu, num);
63} 65}
64#endif /*CONFIG_HOTPLUG_CPU*/ 66#endif /* CONFIG_HOTPLUG_CPU */
65 67
66static int __init topology_init(void) 68static int __init topology_init(void)
67{ 69{
@@ -70,11 +72,11 @@ static int __init topology_init(void)
70#ifdef CONFIG_NUMA 72#ifdef CONFIG_NUMA
71 for_each_online_node(i) 73 for_each_online_node(i)
72 register_one_node(i); 74 register_one_node(i);
73#endif /* CONFIG_NUMA */ 75#endif
74 76
75 for_each_present_cpu(i) 77 for_each_present_cpu(i)
76 arch_register_cpu(i); 78 arch_register_cpu(i);
79
77 return 0; 80 return 0;
78} 81}
79
80subsys_initcall(topology_init); 82subsys_initcall(topology_init);
diff --git a/arch/x86/kernel/uv_time.c b/arch/x86/kernel/uv_time.c
new file mode 100644
index 000000000000..2ffb6c53326e
--- /dev/null
+++ b/arch/x86/kernel/uv_time.c
@@ -0,0 +1,393 @@
1/*
2 * SGI RTC clock/timer routines.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 *
18 * Copyright (c) 2009 Silicon Graphics, Inc. All Rights Reserved.
19 * Copyright (c) Dimitri Sivanich
20 */
21#include <linux/clockchips.h>
22
23#include <asm/uv/uv_mmrs.h>
24#include <asm/uv/uv_hub.h>
25#include <asm/uv/bios.h>
26#include <asm/uv/uv.h>
27#include <asm/apic.h>
28#include <asm/cpu.h>
29
30#define RTC_NAME "sgi_rtc"
31
32static cycle_t uv_read_rtc(void);
33static int uv_rtc_next_event(unsigned long, struct clock_event_device *);
34static void uv_rtc_timer_setup(enum clock_event_mode,
35 struct clock_event_device *);
36
37static struct clocksource clocksource_uv = {
38 .name = RTC_NAME,
39 .rating = 400,
40 .read = uv_read_rtc,
41 .mask = (cycle_t)UVH_RTC_REAL_TIME_CLOCK_MASK,
42 .shift = 10,
43 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
44};
45
46static struct clock_event_device clock_event_device_uv = {
47 .name = RTC_NAME,
48 .features = CLOCK_EVT_FEAT_ONESHOT,
49 .shift = 20,
50 .rating = 400,
51 .irq = -1,
52 .set_next_event = uv_rtc_next_event,
53 .set_mode = uv_rtc_timer_setup,
54 .event_handler = NULL,
55};
56
57static DEFINE_PER_CPU(struct clock_event_device, cpu_ced);
58
59/* There is one of these allocated per node */
60struct uv_rtc_timer_head {
61 spinlock_t lock;
62 /* next cpu waiting for timer, local node relative: */
63 int next_cpu;
64 /* number of cpus on this node: */
65 int ncpus;
66 struct {
67 int lcpu; /* systemwide logical cpu number */
68 u64 expires; /* next timer expiration for this cpu */
69 } cpu[1];
70};
71
72/*
73 * Access to uv_rtc_timer_head via blade id.
74 */
75static struct uv_rtc_timer_head **blade_info __read_mostly;
76
77static int uv_rtc_enable;
78
79/*
80 * Hardware interface routines
81 */
82
83/* Send IPIs to another node */
84static void uv_rtc_send_IPI(int cpu)
85{
86 unsigned long apicid, val;
87 int pnode;
88
89 apicid = cpu_physical_id(cpu);
90 pnode = uv_apicid_to_pnode(apicid);
91 val = (1UL << UVH_IPI_INT_SEND_SHFT) |
92 (apicid << UVH_IPI_INT_APIC_ID_SHFT) |
93 (GENERIC_INTERRUPT_VECTOR << UVH_IPI_INT_VECTOR_SHFT);
94
95 uv_write_global_mmr64(pnode, UVH_IPI_INT, val);
96}
97
98/* Check for an RTC interrupt pending */
99static int uv_intr_pending(int pnode)
100{
101 return uv_read_global_mmr64(pnode, UVH_EVENT_OCCURRED0) &
102 UVH_EVENT_OCCURRED0_RTC1_MASK;
103}
104
105/* Setup interrupt and return non-zero if early expiration occurred. */
106static int uv_setup_intr(int cpu, u64 expires)
107{
108 u64 val;
109 int pnode = uv_cpu_to_pnode(cpu);
110
111 uv_write_global_mmr64(pnode, UVH_RTC1_INT_CONFIG,
112 UVH_RTC1_INT_CONFIG_M_MASK);
113 uv_write_global_mmr64(pnode, UVH_INT_CMPB, -1L);
114
115 uv_write_global_mmr64(pnode, UVH_EVENT_OCCURRED0_ALIAS,
116 UVH_EVENT_OCCURRED0_RTC1_MASK);
117
118 val = (GENERIC_INTERRUPT_VECTOR << UVH_RTC1_INT_CONFIG_VECTOR_SHFT) |
119 ((u64)cpu_physical_id(cpu) << UVH_RTC1_INT_CONFIG_APIC_ID_SHFT);
120
121 /* Set configuration */
122 uv_write_global_mmr64(pnode, UVH_RTC1_INT_CONFIG, val);
123 /* Initialize comparator value */
124 uv_write_global_mmr64(pnode, UVH_INT_CMPB, expires);
125
126 return (expires < uv_read_rtc() && !uv_intr_pending(pnode));
127}
128
129/*
130 * Per-cpu timer tracking routines
131 */
132
133static __init void uv_rtc_deallocate_timers(void)
134{
135 int bid;
136
137 for_each_possible_blade(bid) {
138 kfree(blade_info[bid]);
139 }
140 kfree(blade_info);
141}
142
143/* Allocate per-node list of cpu timer expiration times. */
144static __init int uv_rtc_allocate_timers(void)
145{
146 int cpu;
147
148 blade_info = kmalloc(uv_possible_blades * sizeof(void *), GFP_KERNEL);
149 if (!blade_info)
150 return -ENOMEM;
151 memset(blade_info, 0, uv_possible_blades * sizeof(void *));
152
153 for_each_present_cpu(cpu) {
154 int nid = cpu_to_node(cpu);
155 int bid = uv_cpu_to_blade_id(cpu);
156 int bcpu = uv_cpu_hub_info(cpu)->blade_processor_id;
157 struct uv_rtc_timer_head *head = blade_info[bid];
158
159 if (!head) {
160 head = kmalloc_node(sizeof(struct uv_rtc_timer_head) +
161 (uv_blade_nr_possible_cpus(bid) *
162 2 * sizeof(u64)),
163 GFP_KERNEL, nid);
164 if (!head) {
165 uv_rtc_deallocate_timers();
166 return -ENOMEM;
167 }
168 spin_lock_init(&head->lock);
169 head->ncpus = uv_blade_nr_possible_cpus(bid);
170 head->next_cpu = -1;
171 blade_info[bid] = head;
172 }
173
174 head->cpu[bcpu].lcpu = cpu;
175 head->cpu[bcpu].expires = ULLONG_MAX;
176 }
177
178 return 0;
179}
180
181/* Find and set the next expiring timer. */
182static void uv_rtc_find_next_timer(struct uv_rtc_timer_head *head, int pnode)
183{
184 u64 lowest = ULLONG_MAX;
185 int c, bcpu = -1;
186
187 head->next_cpu = -1;
188 for (c = 0; c < head->ncpus; c++) {
189 u64 exp = head->cpu[c].expires;
190 if (exp < lowest) {
191 bcpu = c;
192 lowest = exp;
193 }
194 }
195 if (bcpu >= 0) {
196 head->next_cpu = bcpu;
197 c = head->cpu[bcpu].lcpu;
198 if (uv_setup_intr(c, lowest))
199 /* If we didn't set it up in time, trigger */
200 uv_rtc_send_IPI(c);
201 } else {
202 uv_write_global_mmr64(pnode, UVH_RTC1_INT_CONFIG,
203 UVH_RTC1_INT_CONFIG_M_MASK);
204 }
205}
206
207/*
208 * Set expiration time for current cpu.
209 *
210 * Returns 1 if we missed the expiration time.
211 */
212static int uv_rtc_set_timer(int cpu, u64 expires)
213{
214 int pnode = uv_cpu_to_pnode(cpu);
215 int bid = uv_cpu_to_blade_id(cpu);
216 struct uv_rtc_timer_head *head = blade_info[bid];
217 int bcpu = uv_cpu_hub_info(cpu)->blade_processor_id;
218 u64 *t = &head->cpu[bcpu].expires;
219 unsigned long flags;
220 int next_cpu;
221
222 spin_lock_irqsave(&head->lock, flags);
223
224 next_cpu = head->next_cpu;
225 *t = expires;
226 /* Will this one be next to go off? */
227 if (next_cpu < 0 || bcpu == next_cpu ||
228 expires < head->cpu[next_cpu].expires) {
229 head->next_cpu = bcpu;
230 if (uv_setup_intr(cpu, expires)) {
231 *t = ULLONG_MAX;
232 uv_rtc_find_next_timer(head, pnode);
233 spin_unlock_irqrestore(&head->lock, flags);
234 return 1;
235 }
236 }
237
238 spin_unlock_irqrestore(&head->lock, flags);
239 return 0;
240}
241
242/*
243 * Unset expiration time for current cpu.
244 *
245 * Returns 1 if this timer was pending.
246 */
247static int uv_rtc_unset_timer(int cpu)
248{
249 int pnode = uv_cpu_to_pnode(cpu);
250 int bid = uv_cpu_to_blade_id(cpu);
251 struct uv_rtc_timer_head *head = blade_info[bid];
252 int bcpu = uv_cpu_hub_info(cpu)->blade_processor_id;
253 u64 *t = &head->cpu[bcpu].expires;
254 unsigned long flags;
255 int rc = 0;
256
257 spin_lock_irqsave(&head->lock, flags);
258
259 if (head->next_cpu == bcpu && uv_read_rtc() >= *t)
260 rc = 1;
261
262 *t = ULLONG_MAX;
263
264 /* Was the hardware setup for this timer? */
265 if (head->next_cpu == bcpu)
266 uv_rtc_find_next_timer(head, pnode);
267
268 spin_unlock_irqrestore(&head->lock, flags);
269
270 return rc;
271}
272
273
274/*
275 * Kernel interface routines.
276 */
277
278/*
279 * Read the RTC.
280 */
281static cycle_t uv_read_rtc(void)
282{
283 return (cycle_t)uv_read_local_mmr(UVH_RTC);
284}
285
286/*
287 * Program the next event, relative to now
288 */
289static int uv_rtc_next_event(unsigned long delta,
290 struct clock_event_device *ced)
291{
292 int ced_cpu = cpumask_first(ced->cpumask);
293
294 return uv_rtc_set_timer(ced_cpu, delta + uv_read_rtc());
295}
296
297/*
298 * Setup the RTC timer in oneshot mode
299 */
300static void uv_rtc_timer_setup(enum clock_event_mode mode,
301 struct clock_event_device *evt)
302{
303 int ced_cpu = cpumask_first(evt->cpumask);
304
305 switch (mode) {
306 case CLOCK_EVT_MODE_PERIODIC:
307 case CLOCK_EVT_MODE_ONESHOT:
308 case CLOCK_EVT_MODE_RESUME:
309 /* Nothing to do here yet */
310 break;
311 case CLOCK_EVT_MODE_UNUSED:
312 case CLOCK_EVT_MODE_SHUTDOWN:
313 uv_rtc_unset_timer(ced_cpu);
314 break;
315 }
316}
317
318static void uv_rtc_interrupt(void)
319{
320 struct clock_event_device *ced = &__get_cpu_var(cpu_ced);
321 int cpu = smp_processor_id();
322
323 if (!ced || !ced->event_handler)
324 return;
325
326 if (uv_rtc_unset_timer(cpu) != 1)
327 return;
328
329 ced->event_handler(ced);
330}
331
332static int __init uv_enable_rtc(char *str)
333{
334 uv_rtc_enable = 1;
335
336 return 1;
337}
338__setup("uvrtc", uv_enable_rtc);
339
340static __init void uv_rtc_register_clockevents(struct work_struct *dummy)
341{
342 struct clock_event_device *ced = &__get_cpu_var(cpu_ced);
343
344 *ced = clock_event_device_uv;
345 ced->cpumask = cpumask_of(smp_processor_id());
346 clockevents_register_device(ced);
347}
348
349static __init int uv_rtc_setup_clock(void)
350{
351 int rc;
352
353 if (!uv_rtc_enable || !is_uv_system() || generic_interrupt_extension)
354 return -ENODEV;
355
356 generic_interrupt_extension = uv_rtc_interrupt;
357
358 clocksource_uv.mult = clocksource_hz2mult(sn_rtc_cycles_per_second,
359 clocksource_uv.shift);
360
361 rc = clocksource_register(&clocksource_uv);
362 if (rc) {
363 generic_interrupt_extension = NULL;
364 return rc;
365 }
366
367 /* Setup and register clockevents */
368 rc = uv_rtc_allocate_timers();
369 if (rc) {
370 clocksource_unregister(&clocksource_uv);
371 generic_interrupt_extension = NULL;
372 return rc;
373 }
374
375 clock_event_device_uv.mult = div_sc(sn_rtc_cycles_per_second,
376 NSEC_PER_SEC, clock_event_device_uv.shift);
377
378 clock_event_device_uv.min_delta_ns = NSEC_PER_SEC /
379 sn_rtc_cycles_per_second;
380
381 clock_event_device_uv.max_delta_ns = clocksource_uv.mask *
382 (NSEC_PER_SEC / sn_rtc_cycles_per_second);
383
384 rc = schedule_on_each_cpu(uv_rtc_register_clockevents);
385 if (rc) {
386 clocksource_unregister(&clocksource_uv);
387 generic_interrupt_extension = NULL;
388 uv_rtc_deallocate_timers();
389 }
390
391 return rc;
392}
393arch_initcall(uv_rtc_setup_clock);
diff --git a/arch/x86/kernel/visws_quirks.c b/arch/x86/kernel/visws_quirks.c
index 191a876e9e87..31ffc24eec4d 100644
--- a/arch/x86/kernel/visws_quirks.c
+++ b/arch/x86/kernel/visws_quirks.c
@@ -578,7 +578,7 @@ static struct irq_chip piix4_virtual_irq_type = {
578static irqreturn_t piix4_master_intr(int irq, void *dev_id) 578static irqreturn_t piix4_master_intr(int irq, void *dev_id)
579{ 579{
580 int realirq; 580 int realirq;
581 irq_desc_t *desc; 581 struct irq_desc *desc;
582 unsigned long flags; 582 unsigned long flags;
583 583
584 spin_lock_irqsave(&i8259A_lock, flags); 584 spin_lock_irqsave(&i8259A_lock, flags);
diff --git a/arch/x86/kernel/vmi_32.c b/arch/x86/kernel/vmi_32.c
index 2cc4a90e2cb3..95deb9f2211e 100644
--- a/arch/x86/kernel/vmi_32.c
+++ b/arch/x86/kernel/vmi_32.c
@@ -395,11 +395,6 @@ static void vmi_set_pte_atomic(pte_t *ptep, pte_t pteval)
395 vmi_ops.update_pte(ptep, VMI_PAGE_PT); 395 vmi_ops.update_pte(ptep, VMI_PAGE_PT);
396} 396}
397 397
398static void vmi_set_pte_present(struct mm_struct *mm, unsigned long addr, pte_t *ptep, pte_t pte)
399{
400 vmi_ops.set_pte(pte, ptep, vmi_flags_addr_defer(mm, addr, VMI_PAGE_PT, 1));
401}
402
403static void vmi_set_pud(pud_t *pudp, pud_t pudval) 398static void vmi_set_pud(pud_t *pudp, pud_t pudval)
404{ 399{
405 /* Um, eww */ 400 /* Um, eww */
@@ -750,7 +745,6 @@ static inline int __init activate_vmi(void)
750 pv_mmu_ops.set_pmd = vmi_set_pmd; 745 pv_mmu_ops.set_pmd = vmi_set_pmd;
751#ifdef CONFIG_X86_PAE 746#ifdef CONFIG_X86_PAE
752 pv_mmu_ops.set_pte_atomic = vmi_set_pte_atomic; 747 pv_mmu_ops.set_pte_atomic = vmi_set_pte_atomic;
753 pv_mmu_ops.set_pte_present = vmi_set_pte_present;
754 pv_mmu_ops.set_pud = vmi_set_pud; 748 pv_mmu_ops.set_pud = vmi_set_pud;
755 pv_mmu_ops.pte_clear = vmi_pte_clear; 749 pv_mmu_ops.pte_clear = vmi_pte_clear;
756 pv_mmu_ops.pmd_clear = vmi_pmd_clear; 750 pv_mmu_ops.pmd_clear = vmi_pmd_clear;
diff --git a/arch/x86/kernel/vmiclock_32.c b/arch/x86/kernel/vmiclock_32.c
index 33a788d5879c..d303369a7bad 100644
--- a/arch/x86/kernel/vmiclock_32.c
+++ b/arch/x86/kernel/vmiclock_32.c
@@ -202,7 +202,6 @@ static struct irqaction vmi_clock_action = {
202 .name = "vmi-timer", 202 .name = "vmi-timer",
203 .handler = vmi_timer_interrupt, 203 .handler = vmi_timer_interrupt,
204 .flags = IRQF_DISABLED | IRQF_NOBALANCING | IRQF_TIMER, 204 .flags = IRQF_DISABLED | IRQF_NOBALANCING | IRQF_TIMER,
205 .mask = CPU_MASK_ALL,
206}; 205};
207 206
208static void __devinit vmi_time_init_clockevent(void) 207static void __devinit vmi_time_init_clockevent(void)
diff --git a/arch/x86/kernel/vmlinux_32.lds.S b/arch/x86/kernel/vmlinux_32.lds.S
index 0d860963f268..62ad500d55f3 100644
--- a/arch/x86/kernel/vmlinux_32.lds.S
+++ b/arch/x86/kernel/vmlinux_32.lds.S
@@ -189,15 +189,24 @@ SECTIONS
189 *(.bss) 189 *(.bss)
190 . = ALIGN(4); 190 . = ALIGN(4);
191 __bss_stop = .; 191 __bss_stop = .;
192 _end = . ; 192 }
193 /* This is where the kernel creates the early boot page tables */ 193
194 .brk : AT(ADDR(.brk) - LOAD_OFFSET) {
194 . = ALIGN(PAGE_SIZE); 195 . = ALIGN(PAGE_SIZE);
195 pg0 = . ; 196 __brk_base = . ;
197 . += 64 * 1024 ; /* 64k alignment slop space */
198 *(.brk_reservation) /* areas brk users have reserved */
199 __brk_limit = . ;
200 }
201
202 .end : AT(ADDR(.end) - LOAD_OFFSET) {
203 _end = . ;
196 } 204 }
197 205
198 /* Sections to be discarded */ 206 /* Sections to be discarded */
199 /DISCARD/ : { 207 /DISCARD/ : {
200 *(.exitcall.exit) 208 *(.exitcall.exit)
209 *(.discard)
201 } 210 }
202 211
203 STABS_DEBUG 212 STABS_DEBUG
@@ -205,6 +214,12 @@ SECTIONS
205 DWARF_DEBUG 214 DWARF_DEBUG
206} 215}
207 216
217/*
218 * Build-time check on the image size:
219 */
220ASSERT((_end - LOAD_OFFSET <= KERNEL_IMAGE_SIZE),
221 "kernel image bigger than KERNEL_IMAGE_SIZE")
222
208#ifdef CONFIG_KEXEC 223#ifdef CONFIG_KEXEC
209/* Link time checks */ 224/* Link time checks */
210#include <asm/kexec.h> 225#include <asm/kexec.h>
diff --git a/arch/x86/kernel/vmlinux_64.lds.S b/arch/x86/kernel/vmlinux_64.lds.S
index fbfced6f6800..c8742507b030 100644
--- a/arch/x86/kernel/vmlinux_64.lds.S
+++ b/arch/x86/kernel/vmlinux_64.lds.S
@@ -29,8 +29,8 @@ SECTIONS
29{ 29{
30 . = __START_KERNEL; 30 . = __START_KERNEL;
31 phys_startup_64 = startup_64 - LOAD_OFFSET; 31 phys_startup_64 = startup_64 - LOAD_OFFSET;
32 _text = .; /* Text and read-only data */
33 .text : AT(ADDR(.text) - LOAD_OFFSET) { 32 .text : AT(ADDR(.text) - LOAD_OFFSET) {
33 _text = .; /* Text and read-only data */
34 /* First the code that has to be first for bootstrapping */ 34 /* First the code that has to be first for bootstrapping */
35 *(.text.head) 35 *(.text.head)
36 _stext = .; 36 _stext = .;
@@ -61,13 +61,13 @@ SECTIONS
61 .data : AT(ADDR(.data) - LOAD_OFFSET) { 61 .data : AT(ADDR(.data) - LOAD_OFFSET) {
62 DATA_DATA 62 DATA_DATA
63 CONSTRUCTORS 63 CONSTRUCTORS
64 _edata = .; /* End of data section */
64 } :data 65 } :data
65 66
66 _edata = .; /* End of data section */
67 67
68 . = ALIGN(PAGE_SIZE);
69 . = ALIGN(CONFIG_X86_L1_CACHE_BYTES);
70 .data.cacheline_aligned : AT(ADDR(.data.cacheline_aligned) - LOAD_OFFSET) { 68 .data.cacheline_aligned : AT(ADDR(.data.cacheline_aligned) - LOAD_OFFSET) {
69 . = ALIGN(PAGE_SIZE);
70 . = ALIGN(CONFIG_X86_L1_CACHE_BYTES);
71 *(.data.cacheline_aligned) 71 *(.data.cacheline_aligned)
72 } 72 }
73 . = ALIGN(CONFIG_X86_INTERNODE_CACHE_BYTES); 73 . = ALIGN(CONFIG_X86_INTERNODE_CACHE_BYTES);
@@ -125,29 +125,29 @@ SECTIONS
125#undef VVIRT_OFFSET 125#undef VVIRT_OFFSET
126#undef VVIRT 126#undef VVIRT
127 127
128 . = ALIGN(THREAD_SIZE); /* init_task */
129 .data.init_task : AT(ADDR(.data.init_task) - LOAD_OFFSET) { 128 .data.init_task : AT(ADDR(.data.init_task) - LOAD_OFFSET) {
129 . = ALIGN(THREAD_SIZE); /* init_task */
130 *(.data.init_task) 130 *(.data.init_task)
131 }:data.init 131 }:data.init
132 132
133 . = ALIGN(PAGE_SIZE);
134 .data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET) { 133 .data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET) {
134 . = ALIGN(PAGE_SIZE);
135 *(.data.page_aligned) 135 *(.data.page_aligned)
136 } 136 }
137 137
138 /* might get freed after init */
139 . = ALIGN(PAGE_SIZE);
140 __smp_alt_begin = .;
141 __smp_locks = .;
142 .smp_locks : AT(ADDR(.smp_locks) - LOAD_OFFSET) { 138 .smp_locks : AT(ADDR(.smp_locks) - LOAD_OFFSET) {
139 /* might get freed after init */
140 . = ALIGN(PAGE_SIZE);
141 __smp_alt_begin = .;
142 __smp_locks = .;
143 *(.smp_locks) 143 *(.smp_locks)
144 __smp_locks_end = .;
145 . = ALIGN(PAGE_SIZE);
146 __smp_alt_end = .;
144 } 147 }
145 __smp_locks_end = .;
146 . = ALIGN(PAGE_SIZE);
147 __smp_alt_end = .;
148 148
149 . = ALIGN(PAGE_SIZE); /* Init code and data */ 149 . = ALIGN(PAGE_SIZE); /* Init code and data */
150 __init_begin = .; 150 __init_begin = .; /* paired with __init_end */
151 .init.text : AT(ADDR(.init.text) - LOAD_OFFSET) { 151 .init.text : AT(ADDR(.init.text) - LOAD_OFFSET) {
152 _sinittext = .; 152 _sinittext = .;
153 INIT_TEXT 153 INIT_TEXT
@@ -159,40 +159,42 @@ SECTIONS
159 __initdata_end = .; 159 __initdata_end = .;
160 } 160 }
161 161
162 . = ALIGN(16); 162 .init.setup : AT(ADDR(.init.setup) - LOAD_OFFSET) {
163 __setup_start = .; 163 . = ALIGN(16);
164 .init.setup : AT(ADDR(.init.setup) - LOAD_OFFSET) { *(.init.setup) } 164 __setup_start = .;
165 __setup_end = .; 165 *(.init.setup)
166 __initcall_start = .; 166 __setup_end = .;
167 }
167 .initcall.init : AT(ADDR(.initcall.init) - LOAD_OFFSET) { 168 .initcall.init : AT(ADDR(.initcall.init) - LOAD_OFFSET) {
169 __initcall_start = .;
168 INITCALLS 170 INITCALLS
171 __initcall_end = .;
169 } 172 }
170 __initcall_end = .;
171 __con_initcall_start = .;
172 .con_initcall.init : AT(ADDR(.con_initcall.init) - LOAD_OFFSET) { 173 .con_initcall.init : AT(ADDR(.con_initcall.init) - LOAD_OFFSET) {
174 __con_initcall_start = .;
173 *(.con_initcall.init) 175 *(.con_initcall.init)
176 __con_initcall_end = .;
174 } 177 }
175 __con_initcall_end = .;
176 __x86_cpu_dev_start = .;
177 .x86_cpu_dev.init : AT(ADDR(.x86_cpu_dev.init) - LOAD_OFFSET) { 178 .x86_cpu_dev.init : AT(ADDR(.x86_cpu_dev.init) - LOAD_OFFSET) {
179 __x86_cpu_dev_start = .;
178 *(.x86_cpu_dev.init) 180 *(.x86_cpu_dev.init)
181 __x86_cpu_dev_end = .;
179 } 182 }
180 __x86_cpu_dev_end = .;
181 SECURITY_INIT 183 SECURITY_INIT
182 184
183 . = ALIGN(8); 185 . = ALIGN(8);
184 .parainstructions : AT(ADDR(.parainstructions) - LOAD_OFFSET) { 186 .parainstructions : AT(ADDR(.parainstructions) - LOAD_OFFSET) {
185 __parainstructions = .; 187 __parainstructions = .;
186 *(.parainstructions) 188 *(.parainstructions)
187 __parainstructions_end = .; 189 __parainstructions_end = .;
188 } 190 }
189 191
190 . = ALIGN(8);
191 __alt_instructions = .;
192 .altinstructions : AT(ADDR(.altinstructions) - LOAD_OFFSET) { 192 .altinstructions : AT(ADDR(.altinstructions) - LOAD_OFFSET) {
193 . = ALIGN(8);
194 __alt_instructions = .;
193 *(.altinstructions) 195 *(.altinstructions)
196 __alt_instructions_end = .;
194 } 197 }
195 __alt_instructions_end = .;
196 .altinstr_replacement : AT(ADDR(.altinstr_replacement) - LOAD_OFFSET) { 198 .altinstr_replacement : AT(ADDR(.altinstr_replacement) - LOAD_OFFSET) {
197 *(.altinstr_replacement) 199 *(.altinstr_replacement)
198 } 200 }
@@ -207,9 +209,11 @@ SECTIONS
207 209
208#ifdef CONFIG_BLK_DEV_INITRD 210#ifdef CONFIG_BLK_DEV_INITRD
209 . = ALIGN(PAGE_SIZE); 211 . = ALIGN(PAGE_SIZE);
210 __initramfs_start = .; 212 .init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET) {
211 .init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET) { *(.init.ramfs) } 213 __initramfs_start = .;
212 __initramfs_end = .; 214 *(.init.ramfs)
215 __initramfs_end = .;
216 }
213#endif 217#endif
214 218
215#ifdef CONFIG_SMP 219#ifdef CONFIG_SMP
@@ -229,20 +233,29 @@ SECTIONS
229 . = ALIGN(PAGE_SIZE); 233 . = ALIGN(PAGE_SIZE);
230 __init_end = .; 234 __init_end = .;
231 235
232 . = ALIGN(PAGE_SIZE);
233 __nosave_begin = .;
234 .data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) { 236 .data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) {
235 *(.data.nosave) 237 . = ALIGN(PAGE_SIZE);
238 __nosave_begin = .;
239 *(.data.nosave)
240 . = ALIGN(PAGE_SIZE);
241 __nosave_end = .;
236 } :data.init2 /* use another section data.init2, see PERCPU_VADDR() above */ 242 } :data.init2 /* use another section data.init2, see PERCPU_VADDR() above */
237 . = ALIGN(PAGE_SIZE);
238 __nosave_end = .;
239 243
240 __bss_start = .; /* BSS */
241 .bss : AT(ADDR(.bss) - LOAD_OFFSET) { 244 .bss : AT(ADDR(.bss) - LOAD_OFFSET) {
245 . = ALIGN(PAGE_SIZE);
246 __bss_start = .; /* BSS */
242 *(.bss.page_aligned) 247 *(.bss.page_aligned)
243 *(.bss) 248 *(.bss)
244 } 249 __bss_stop = .;
245 __bss_stop = .; 250 }
251
252 .brk : AT(ADDR(.brk) - LOAD_OFFSET) {
253 . = ALIGN(PAGE_SIZE);
254 __brk_base = . ;
255 . += 64 * 1024 ; /* 64k alignment slop space */
256 *(.brk_reservation) /* areas brk users have reserved */
257 __brk_limit = . ;
258 }
246 259
247 _end = . ; 260 _end = . ;
248 261
@@ -250,6 +263,7 @@ SECTIONS
250 /DISCARD/ : { 263 /DISCARD/ : {
251 *(.exitcall.exit) 264 *(.exitcall.exit)
252 *(.eh_frame) 265 *(.eh_frame)
266 *(.discard)
253 } 267 }
254 268
255 STABS_DEBUG 269 STABS_DEBUG
@@ -275,3 +289,10 @@ ASSERT((_end - _text <= KERNEL_IMAGE_SIZE),
275ASSERT((per_cpu__irq_stack_union == 0), 289ASSERT((per_cpu__irq_stack_union == 0),
276 "irq_stack_union is not at start of per-cpu area"); 290 "irq_stack_union is not at start of per-cpu area");
277#endif 291#endif
292
293#ifdef CONFIG_KEXEC
294#include <asm/kexec.h>
295
296ASSERT(kexec_control_code_size <= KEXEC_CONTROL_CODE_MAX_SIZE,
297 "kexec control code size is too big")
298#endif
diff --git a/arch/x86/kernel/vsmp_64.c b/arch/x86/kernel/vsmp_64.c
index 74de562812cc..a1d804bcd483 100644
--- a/arch/x86/kernel/vsmp_64.c
+++ b/arch/x86/kernel/vsmp_64.c
@@ -22,7 +22,7 @@
22#include <asm/paravirt.h> 22#include <asm/paravirt.h>
23#include <asm/setup.h> 23#include <asm/setup.h>
24 24
25#ifdef CONFIG_PARAVIRT 25#if defined CONFIG_PCI && defined CONFIG_PARAVIRT
26/* 26/*
27 * Interrupt control on vSMPowered systems: 27 * Interrupt control on vSMPowered systems:
28 * ~AC is a shadow of IF. If IF is 'on' AC should be 'off' 28 * ~AC is a shadow of IF. If IF is 'on' AC should be 'off'
@@ -114,6 +114,7 @@ static void __init set_vsmp_pv_ops(void)
114} 114}
115#endif 115#endif
116 116
117#ifdef CONFIG_PCI
117static int is_vsmp = -1; 118static int is_vsmp = -1;
118 119
119static void __init detect_vsmp_box(void) 120static void __init detect_vsmp_box(void)
@@ -139,6 +140,15 @@ int is_vsmp_box(void)
139 } 140 }
140} 141}
141 142
143#else
144static void __init detect_vsmp_box(void)
145{
146}
147int is_vsmp_box(void)
148{
149 return 0;
150}
151#endif
142void __init vsmp_init(void) 152void __init vsmp_init(void)
143{ 153{
144 detect_vsmp_box(); 154 detect_vsmp_box();
diff --git a/arch/x86/lguest/boot.c b/arch/x86/lguest/boot.c
index 9fe4ddaa8f6f..e94a11e42f98 100644
--- a/arch/x86/lguest/boot.c
+++ b/arch/x86/lguest/boot.c
@@ -107,7 +107,7 @@ static void async_hcall(unsigned long call, unsigned long arg1,
107 local_irq_save(flags); 107 local_irq_save(flags);
108 if (lguest_data.hcall_status[next_call] != 0xFF) { 108 if (lguest_data.hcall_status[next_call] != 0xFF) {
109 /* Table full, so do normal hcall which will flush table. */ 109 /* Table full, so do normal hcall which will flush table. */
110 hcall(call, arg1, arg2, arg3); 110 kvm_hypercall3(call, arg1, arg2, arg3);
111 } else { 111 } else {
112 lguest_data.hcalls[next_call].arg0 = call; 112 lguest_data.hcalls[next_call].arg0 = call;
113 lguest_data.hcalls[next_call].arg1 = arg1; 113 lguest_data.hcalls[next_call].arg1 = arg1;
@@ -134,13 +134,32 @@ static void async_hcall(unsigned long call, unsigned long arg1,
134 * 134 *
135 * So, when we're in lazy mode, we call async_hcall() to store the call for 135 * So, when we're in lazy mode, we call async_hcall() to store the call for
136 * future processing: */ 136 * future processing: */
137static void lazy_hcall(unsigned long call, 137static void lazy_hcall1(unsigned long call,
138 unsigned long arg1)
139{
140 if (paravirt_get_lazy_mode() == PARAVIRT_LAZY_NONE)
141 kvm_hypercall1(call, arg1);
142 else
143 async_hcall(call, arg1, 0, 0);
144}
145
146static void lazy_hcall2(unsigned long call,
147 unsigned long arg1,
148 unsigned long arg2)
149{
150 if (paravirt_get_lazy_mode() == PARAVIRT_LAZY_NONE)
151 kvm_hypercall2(call, arg1, arg2);
152 else
153 async_hcall(call, arg1, arg2, 0);
154}
155
156static void lazy_hcall3(unsigned long call,
138 unsigned long arg1, 157 unsigned long arg1,
139 unsigned long arg2, 158 unsigned long arg2,
140 unsigned long arg3) 159 unsigned long arg3)
141{ 160{
142 if (paravirt_get_lazy_mode() == PARAVIRT_LAZY_NONE) 161 if (paravirt_get_lazy_mode() == PARAVIRT_LAZY_NONE)
143 hcall(call, arg1, arg2, arg3); 162 kvm_hypercall3(call, arg1, arg2, arg3);
144 else 163 else
145 async_hcall(call, arg1, arg2, arg3); 164 async_hcall(call, arg1, arg2, arg3);
146} 165}
@@ -150,7 +169,7 @@ static void lazy_hcall(unsigned long call,
150static void lguest_leave_lazy_mode(void) 169static void lguest_leave_lazy_mode(void)
151{ 170{
152 paravirt_leave_lazy(paravirt_get_lazy_mode()); 171 paravirt_leave_lazy(paravirt_get_lazy_mode());
153 hcall(LHCALL_FLUSH_ASYNC, 0, 0, 0); 172 kvm_hypercall0(LHCALL_FLUSH_ASYNC);
154} 173}
155 174
156/*G:033 175/*G:033
@@ -229,7 +248,7 @@ static void lguest_write_idt_entry(gate_desc *dt,
229 /* Keep the local copy up to date. */ 248 /* Keep the local copy up to date. */
230 native_write_idt_entry(dt, entrynum, g); 249 native_write_idt_entry(dt, entrynum, g);
231 /* Tell Host about this new entry. */ 250 /* Tell Host about this new entry. */
232 hcall(LHCALL_LOAD_IDT_ENTRY, entrynum, desc[0], desc[1]); 251 kvm_hypercall3(LHCALL_LOAD_IDT_ENTRY, entrynum, desc[0], desc[1]);
233} 252}
234 253
235/* Changing to a different IDT is very rare: we keep the IDT up-to-date every 254/* Changing to a different IDT is very rare: we keep the IDT up-to-date every
@@ -241,7 +260,7 @@ static void lguest_load_idt(const struct desc_ptr *desc)
241 struct desc_struct *idt = (void *)desc->address; 260 struct desc_struct *idt = (void *)desc->address;
242 261
243 for (i = 0; i < (desc->size+1)/8; i++) 262 for (i = 0; i < (desc->size+1)/8; i++)
244 hcall(LHCALL_LOAD_IDT_ENTRY, i, idt[i].a, idt[i].b); 263 kvm_hypercall3(LHCALL_LOAD_IDT_ENTRY, i, idt[i].a, idt[i].b);
245} 264}
246 265
247/* 266/*
@@ -261,8 +280,8 @@ static void lguest_load_idt(const struct desc_ptr *desc)
261 */ 280 */
262static void lguest_load_gdt(const struct desc_ptr *desc) 281static void lguest_load_gdt(const struct desc_ptr *desc)
263{ 282{
264 BUG_ON((desc->size+1)/8 != GDT_ENTRIES); 283 BUG_ON((desc->size + 1) / 8 != GDT_ENTRIES);
265 hcall(LHCALL_LOAD_GDT, __pa(desc->address), GDT_ENTRIES, 0); 284 kvm_hypercall2(LHCALL_LOAD_GDT, __pa(desc->address), GDT_ENTRIES);
266} 285}
267 286
268/* For a single GDT entry which changes, we do the lazy thing: alter our GDT, 287/* For a single GDT entry which changes, we do the lazy thing: alter our GDT,
@@ -272,7 +291,7 @@ static void lguest_write_gdt_entry(struct desc_struct *dt, int entrynum,
272 const void *desc, int type) 291 const void *desc, int type)
273{ 292{
274 native_write_gdt_entry(dt, entrynum, desc, type); 293 native_write_gdt_entry(dt, entrynum, desc, type);
275 hcall(LHCALL_LOAD_GDT, __pa(dt), GDT_ENTRIES, 0); 294 kvm_hypercall2(LHCALL_LOAD_GDT, __pa(dt), GDT_ENTRIES);
276} 295}
277 296
278/* OK, I lied. There are three "thread local storage" GDT entries which change 297/* OK, I lied. There are three "thread local storage" GDT entries which change
@@ -284,7 +303,7 @@ static void lguest_load_tls(struct thread_struct *t, unsigned int cpu)
284 * can't handle us removing entries we're currently using. So we clear 303 * can't handle us removing entries we're currently using. So we clear
285 * the GS register here: if it's needed it'll be reloaded anyway. */ 304 * the GS register here: if it's needed it'll be reloaded anyway. */
286 lazy_load_gs(0); 305 lazy_load_gs(0);
287 lazy_hcall(LHCALL_LOAD_TLS, __pa(&t->tls_array), cpu, 0); 306 lazy_hcall2(LHCALL_LOAD_TLS, __pa(&t->tls_array), cpu);
288} 307}
289 308
290/*G:038 That's enough excitement for now, back to ploughing through each of 309/*G:038 That's enough excitement for now, back to ploughing through each of
@@ -382,7 +401,7 @@ static void lguest_cpuid(unsigned int *ax, unsigned int *bx,
382static unsigned long current_cr0; 401static unsigned long current_cr0;
383static void lguest_write_cr0(unsigned long val) 402static void lguest_write_cr0(unsigned long val)
384{ 403{
385 lazy_hcall(LHCALL_TS, val & X86_CR0_TS, 0, 0); 404 lazy_hcall1(LHCALL_TS, val & X86_CR0_TS);
386 current_cr0 = val; 405 current_cr0 = val;
387} 406}
388 407
@@ -396,7 +415,7 @@ static unsigned long lguest_read_cr0(void)
396 * the vowels have been optimized out. */ 415 * the vowels have been optimized out. */
397static void lguest_clts(void) 416static void lguest_clts(void)
398{ 417{
399 lazy_hcall(LHCALL_TS, 0, 0, 0); 418 lazy_hcall1(LHCALL_TS, 0);
400 current_cr0 &= ~X86_CR0_TS; 419 current_cr0 &= ~X86_CR0_TS;
401} 420}
402 421
@@ -418,7 +437,7 @@ static bool cr3_changed = false;
418static void lguest_write_cr3(unsigned long cr3) 437static void lguest_write_cr3(unsigned long cr3)
419{ 438{
420 lguest_data.pgdir = cr3; 439 lguest_data.pgdir = cr3;
421 lazy_hcall(LHCALL_NEW_PGTABLE, cr3, 0, 0); 440 lazy_hcall1(LHCALL_NEW_PGTABLE, cr3);
422 cr3_changed = true; 441 cr3_changed = true;
423} 442}
424 443
@@ -490,11 +509,17 @@ static void lguest_write_cr4(unsigned long val)
490 * into a process' address space. We set the entry then tell the Host the 509 * into a process' address space. We set the entry then tell the Host the
491 * toplevel and address this corresponds to. The Guest uses one pagetable per 510 * toplevel and address this corresponds to. The Guest uses one pagetable per
492 * process, so we need to tell the Host which one we're changing (mm->pgd). */ 511 * process, so we need to tell the Host which one we're changing (mm->pgd). */
512static void lguest_pte_update(struct mm_struct *mm, unsigned long addr,
513 pte_t *ptep)
514{
515 lazy_hcall3(LHCALL_SET_PTE, __pa(mm->pgd), addr, ptep->pte_low);
516}
517
493static void lguest_set_pte_at(struct mm_struct *mm, unsigned long addr, 518static void lguest_set_pte_at(struct mm_struct *mm, unsigned long addr,
494 pte_t *ptep, pte_t pteval) 519 pte_t *ptep, pte_t pteval)
495{ 520{
496 *ptep = pteval; 521 *ptep = pteval;
497 lazy_hcall(LHCALL_SET_PTE, __pa(mm->pgd), addr, pteval.pte_low); 522 lguest_pte_update(mm, addr, ptep);
498} 523}
499 524
500/* The Guest calls this to set a top-level entry. Again, we set the entry then 525/* The Guest calls this to set a top-level entry. Again, we set the entry then
@@ -503,8 +528,8 @@ static void lguest_set_pte_at(struct mm_struct *mm, unsigned long addr,
503static void lguest_set_pmd(pmd_t *pmdp, pmd_t pmdval) 528static void lguest_set_pmd(pmd_t *pmdp, pmd_t pmdval)
504{ 529{
505 *pmdp = pmdval; 530 *pmdp = pmdval;
506 lazy_hcall(LHCALL_SET_PMD, __pa(pmdp)&PAGE_MASK, 531 lazy_hcall2(LHCALL_SET_PMD, __pa(pmdp) & PAGE_MASK,
507 (__pa(pmdp)&(PAGE_SIZE-1))/4, 0); 532 (__pa(pmdp) & (PAGE_SIZE - 1)) / 4);
508} 533}
509 534
510/* There are a couple of legacy places where the kernel sets a PTE, but we 535/* There are a couple of legacy places where the kernel sets a PTE, but we
@@ -520,7 +545,7 @@ static void lguest_set_pte(pte_t *ptep, pte_t pteval)
520{ 545{
521 *ptep = pteval; 546 *ptep = pteval;
522 if (cr3_changed) 547 if (cr3_changed)
523 lazy_hcall(LHCALL_FLUSH_TLB, 1, 0, 0); 548 lazy_hcall1(LHCALL_FLUSH_TLB, 1);
524} 549}
525 550
526/* Unfortunately for Lguest, the pv_mmu_ops for page tables were based on 551/* Unfortunately for Lguest, the pv_mmu_ops for page tables were based on
@@ -536,7 +561,7 @@ static void lguest_set_pte(pte_t *ptep, pte_t pteval)
536static void lguest_flush_tlb_single(unsigned long addr) 561static void lguest_flush_tlb_single(unsigned long addr)
537{ 562{
538 /* Simply set it to zero: if it was not, it will fault back in. */ 563 /* Simply set it to zero: if it was not, it will fault back in. */
539 lazy_hcall(LHCALL_SET_PTE, lguest_data.pgdir, addr, 0); 564 lazy_hcall3(LHCALL_SET_PTE, lguest_data.pgdir, addr, 0);
540} 565}
541 566
542/* This is what happens after the Guest has removed a large number of entries. 567/* This is what happens after the Guest has removed a large number of entries.
@@ -544,7 +569,7 @@ static void lguest_flush_tlb_single(unsigned long addr)
544 * have changed, ie. virtual addresses below PAGE_OFFSET. */ 569 * have changed, ie. virtual addresses below PAGE_OFFSET. */
545static void lguest_flush_tlb_user(void) 570static void lguest_flush_tlb_user(void)
546{ 571{
547 lazy_hcall(LHCALL_FLUSH_TLB, 0, 0, 0); 572 lazy_hcall1(LHCALL_FLUSH_TLB, 0);
548} 573}
549 574
550/* This is called when the kernel page tables have changed. That's not very 575/* This is called when the kernel page tables have changed. That's not very
@@ -552,7 +577,7 @@ static void lguest_flush_tlb_user(void)
552 * slow), so it's worth separating this from the user flushing above. */ 577 * slow), so it's worth separating this from the user flushing above. */
553static void lguest_flush_tlb_kernel(void) 578static void lguest_flush_tlb_kernel(void)
554{ 579{
555 lazy_hcall(LHCALL_FLUSH_TLB, 1, 0, 0); 580 lazy_hcall1(LHCALL_FLUSH_TLB, 1);
556} 581}
557 582
558/* 583/*
@@ -689,7 +714,7 @@ static int lguest_clockevent_set_next_event(unsigned long delta,
689 } 714 }
690 715
691 /* Please wake us this far in the future. */ 716 /* Please wake us this far in the future. */
692 hcall(LHCALL_SET_CLOCKEVENT, delta, 0, 0); 717 kvm_hypercall1(LHCALL_SET_CLOCKEVENT, delta);
693 return 0; 718 return 0;
694} 719}
695 720
@@ -700,7 +725,7 @@ static void lguest_clockevent_set_mode(enum clock_event_mode mode,
700 case CLOCK_EVT_MODE_UNUSED: 725 case CLOCK_EVT_MODE_UNUSED:
701 case CLOCK_EVT_MODE_SHUTDOWN: 726 case CLOCK_EVT_MODE_SHUTDOWN:
702 /* A 0 argument shuts the clock down. */ 727 /* A 0 argument shuts the clock down. */
703 hcall(LHCALL_SET_CLOCKEVENT, 0, 0, 0); 728 kvm_hypercall0(LHCALL_SET_CLOCKEVENT);
704 break; 729 break;
705 case CLOCK_EVT_MODE_ONESHOT: 730 case CLOCK_EVT_MODE_ONESHOT:
706 /* This is what we expect. */ 731 /* This is what we expect. */
@@ -775,8 +800,8 @@ static void lguest_time_init(void)
775static void lguest_load_sp0(struct tss_struct *tss, 800static void lguest_load_sp0(struct tss_struct *tss,
776 struct thread_struct *thread) 801 struct thread_struct *thread)
777{ 802{
778 lazy_hcall(LHCALL_SET_STACK, __KERNEL_DS|0x1, thread->sp0, 803 lazy_hcall3(LHCALL_SET_STACK, __KERNEL_DS | 0x1, thread->sp0,
779 THREAD_SIZE/PAGE_SIZE); 804 THREAD_SIZE / PAGE_SIZE);
780} 805}
781 806
782/* Let's just say, I wouldn't do debugging under a Guest. */ 807/* Let's just say, I wouldn't do debugging under a Guest. */
@@ -849,7 +874,7 @@ static void set_lguest_basic_apic_ops(void)
849/* STOP! Until an interrupt comes in. */ 874/* STOP! Until an interrupt comes in. */
850static void lguest_safe_halt(void) 875static void lguest_safe_halt(void)
851{ 876{
852 hcall(LHCALL_HALT, 0, 0, 0); 877 kvm_hypercall0(LHCALL_HALT);
853} 878}
854 879
855/* The SHUTDOWN hypercall takes a string to describe what's happening, and 880/* The SHUTDOWN hypercall takes a string to describe what's happening, and
@@ -859,7 +884,8 @@ static void lguest_safe_halt(void)
859 * rather than virtual addresses, so we use __pa() here. */ 884 * rather than virtual addresses, so we use __pa() here. */
860static void lguest_power_off(void) 885static void lguest_power_off(void)
861{ 886{
862 hcall(LHCALL_SHUTDOWN, __pa("Power down"), LGUEST_SHUTDOWN_POWEROFF, 0); 887 kvm_hypercall2(LHCALL_SHUTDOWN, __pa("Power down"),
888 LGUEST_SHUTDOWN_POWEROFF);
863} 889}
864 890
865/* 891/*
@@ -869,7 +895,7 @@ static void lguest_power_off(void)
869 */ 895 */
870static int lguest_panic(struct notifier_block *nb, unsigned long l, void *p) 896static int lguest_panic(struct notifier_block *nb, unsigned long l, void *p)
871{ 897{
872 hcall(LHCALL_SHUTDOWN, __pa(p), LGUEST_SHUTDOWN_POWEROFF, 0); 898 kvm_hypercall2(LHCALL_SHUTDOWN, __pa(p), LGUEST_SHUTDOWN_POWEROFF);
873 /* The hcall won't return, but to keep gcc happy, we're "done". */ 899 /* The hcall won't return, but to keep gcc happy, we're "done". */
874 return NOTIFY_DONE; 900 return NOTIFY_DONE;
875} 901}
@@ -910,7 +936,7 @@ static __init int early_put_chars(u32 vtermno, const char *buf, int count)
910 len = sizeof(scratch) - 1; 936 len = sizeof(scratch) - 1;
911 scratch[len] = '\0'; 937 scratch[len] = '\0';
912 memcpy(scratch, buf, len); 938 memcpy(scratch, buf, len);
913 hcall(LHCALL_NOTIFY, __pa(scratch), 0, 0); 939 kvm_hypercall1(LHCALL_NOTIFY, __pa(scratch));
914 940
915 /* This routine returns the number of bytes actually written. */ 941 /* This routine returns the number of bytes actually written. */
916 return len; 942 return len;
@@ -920,7 +946,7 @@ static __init int early_put_chars(u32 vtermno, const char *buf, int count)
920 * Launcher to reboot us. */ 946 * Launcher to reboot us. */
921static void lguest_restart(char *reason) 947static void lguest_restart(char *reason)
922{ 948{
923 hcall(LHCALL_SHUTDOWN, __pa(reason), LGUEST_SHUTDOWN_RESTART, 0); 949 kvm_hypercall2(LHCALL_SHUTDOWN, __pa(reason), LGUEST_SHUTDOWN_RESTART);
924} 950}
925 951
926/*G:050 952/*G:050
@@ -1040,6 +1066,8 @@ __init void lguest_init(void)
1040 pv_mmu_ops.read_cr3 = lguest_read_cr3; 1066 pv_mmu_ops.read_cr3 = lguest_read_cr3;
1041 pv_mmu_ops.lazy_mode.enter = paravirt_enter_lazy_mmu; 1067 pv_mmu_ops.lazy_mode.enter = paravirt_enter_lazy_mmu;
1042 pv_mmu_ops.lazy_mode.leave = lguest_leave_lazy_mode; 1068 pv_mmu_ops.lazy_mode.leave = lguest_leave_lazy_mode;
1069 pv_mmu_ops.pte_update = lguest_pte_update;
1070 pv_mmu_ops.pte_update_defer = lguest_pte_update;
1043 1071
1044#ifdef CONFIG_X86_LOCAL_APIC 1072#ifdef CONFIG_X86_LOCAL_APIC
1045 /* apic read/write intercepts */ 1073 /* apic read/write intercepts */
@@ -1058,14 +1086,6 @@ __init void lguest_init(void)
1058 * lguest_init() where the rest of the fairly chaotic boot setup 1086 * lguest_init() where the rest of the fairly chaotic boot setup
1059 * occurs. */ 1087 * occurs. */
1060 1088
1061 /* The native boot code sets up initial page tables immediately after
1062 * the kernel itself, and sets init_pg_tables_end so they're not
1063 * clobbered. The Launcher places our initial pagetables somewhere at
1064 * the top of our physical memory, so we don't need extra space: set
1065 * init_pg_tables_end to the end of the kernel. */
1066 init_pg_tables_start = __pa(pg0);
1067 init_pg_tables_end = __pa(pg0);
1068
1069 /* As described in head_32.S, we map the first 128M of memory. */ 1089 /* As described in head_32.S, we map the first 128M of memory. */
1070 max_pfn_mapped = (128*1024*1024) >> PAGE_SHIFT; 1090 max_pfn_mapped = (128*1024*1024) >> PAGE_SHIFT;
1071 1091
diff --git a/arch/x86/lguest/i386_head.S b/arch/x86/lguest/i386_head.S
index 10b9bd35a8ff..f79541989471 100644
--- a/arch/x86/lguest/i386_head.S
+++ b/arch/x86/lguest/i386_head.S
@@ -27,8 +27,8 @@ ENTRY(lguest_entry)
27 /* We make the "initialization" hypercall now to tell the Host about 27 /* We make the "initialization" hypercall now to tell the Host about
28 * us, and also find out where it put our page tables. */ 28 * us, and also find out where it put our page tables. */
29 movl $LHCALL_LGUEST_INIT, %eax 29 movl $LHCALL_LGUEST_INIT, %eax
30 movl $lguest_data - __PAGE_OFFSET, %edx 30 movl $lguest_data - __PAGE_OFFSET, %ebx
31 int $LGUEST_TRAP_ENTRY 31 .byte 0x0f,0x01,0xc1 /* KVM_HYPERCALL */
32 32
33 /* Set up the initial stack so we can run C code. */ 33 /* Set up the initial stack so we can run C code. */
34 movl $(init_thread_union+THREAD_SIZE),%esp 34 movl $(init_thread_union+THREAD_SIZE),%esp
diff --git a/arch/x86/lib/memcpy_64.S b/arch/x86/lib/memcpy_64.S
index c22981fa2f3a..ad5441ed1b57 100644
--- a/arch/x86/lib/memcpy_64.S
+++ b/arch/x86/lib/memcpy_64.S
@@ -1,30 +1,38 @@
1/* Copyright 2002 Andi Kleen */ 1/* Copyright 2002 Andi Kleen */
2 2
3#include <linux/linkage.h> 3#include <linux/linkage.h>
4#include <asm/dwarf2.h> 4
5#include <asm/cpufeature.h> 5#include <asm/cpufeature.h>
6#include <asm/dwarf2.h>
6 7
7/* 8/*
8 * memcpy - Copy a memory block. 9 * memcpy - Copy a memory block.
9 * 10 *
10 * Input: 11 * Input:
11 * rdi destination 12 * rdi destination
12 * rsi source 13 * rsi source
13 * rdx count 14 * rdx count
14 * 15 *
15 * Output: 16 * Output:
16 * rax original destination 17 * rax original destination
17 */ 18 */
18 19
20/*
21 * memcpy_c() - fast string ops (REP MOVSQ) based variant.
22 *
23 * Calls to this get patched into the kernel image via the
24 * alternative instructions framework:
25 */
19 ALIGN 26 ALIGN
20memcpy_c: 27memcpy_c:
21 CFI_STARTPROC 28 CFI_STARTPROC
22 movq %rdi,%rax 29 movq %rdi, %rax
23 movl %edx,%ecx 30
24 shrl $3,%ecx 31 movl %edx, %ecx
25 andl $7,%edx 32 shrl $3, %ecx
33 andl $7, %edx
26 rep movsq 34 rep movsq
27 movl %edx,%ecx 35 movl %edx, %ecx
28 rep movsb 36 rep movsb
29 ret 37 ret
30 CFI_ENDPROC 38 CFI_ENDPROC
@@ -33,99 +41,110 @@ ENDPROC(memcpy_c)
33ENTRY(__memcpy) 41ENTRY(__memcpy)
34ENTRY(memcpy) 42ENTRY(memcpy)
35 CFI_STARTPROC 43 CFI_STARTPROC
36 pushq %rbx
37 CFI_ADJUST_CFA_OFFSET 8
38 CFI_REL_OFFSET rbx, 0
39 movq %rdi,%rax
40 44
41 movl %edx,%ecx 45 /*
42 shrl $6,%ecx 46 * Put the number of full 64-byte blocks into %ecx.
47 * Tail portion is handled at the end:
48 */
49 movq %rdi, %rax
50 movl %edx, %ecx
51 shrl $6, %ecx
43 jz .Lhandle_tail 52 jz .Lhandle_tail
44 53
45 .p2align 4 54 .p2align 4
46.Lloop_64: 55.Lloop_64:
56 /*
57 * We decrement the loop index here - and the zero-flag is
58 * checked at the end of the loop (instructions inbetween do
59 * not change the zero flag):
60 */
47 decl %ecx 61 decl %ecx
48 62
49 movq (%rsi),%r11 63 /*
50 movq 8(%rsi),%r8 64 * Move in blocks of 4x16 bytes:
65 */
66 movq 0*8(%rsi), %r11
67 movq 1*8(%rsi), %r8
68 movq %r11, 0*8(%rdi)
69 movq %r8, 1*8(%rdi)
51 70
52 movq %r11,(%rdi) 71 movq 2*8(%rsi), %r9
53 movq %r8,1*8(%rdi) 72 movq 3*8(%rsi), %r10
73 movq %r9, 2*8(%rdi)
74 movq %r10, 3*8(%rdi)
54 75
55 movq 2*8(%rsi),%r9 76 movq 4*8(%rsi), %r11
56 movq 3*8(%rsi),%r10 77 movq 5*8(%rsi), %r8
78 movq %r11, 4*8(%rdi)
79 movq %r8, 5*8(%rdi)
57 80
58 movq %r9,2*8(%rdi) 81 movq 6*8(%rsi), %r9
59 movq %r10,3*8(%rdi) 82 movq 7*8(%rsi), %r10
83 movq %r9, 6*8(%rdi)
84 movq %r10, 7*8(%rdi)
60 85
61 movq 4*8(%rsi),%r11 86 leaq 64(%rsi), %rsi
62 movq 5*8(%rsi),%r8 87 leaq 64(%rdi), %rdi
63 88
64 movq %r11,4*8(%rdi)
65 movq %r8,5*8(%rdi)
66
67 movq 6*8(%rsi),%r9
68 movq 7*8(%rsi),%r10
69
70 movq %r9,6*8(%rdi)
71 movq %r10,7*8(%rdi)
72
73 leaq 64(%rsi),%rsi
74 leaq 64(%rdi),%rdi
75 jnz .Lloop_64 89 jnz .Lloop_64
76 90
77.Lhandle_tail: 91.Lhandle_tail:
78 movl %edx,%ecx 92 movl %edx, %ecx
79 andl $63,%ecx 93 andl $63, %ecx
80 shrl $3,%ecx 94 shrl $3, %ecx
81 jz .Lhandle_7 95 jz .Lhandle_7
96
82 .p2align 4 97 .p2align 4
83.Lloop_8: 98.Lloop_8:
84 decl %ecx 99 decl %ecx
85 movq (%rsi),%r8 100 movq (%rsi), %r8
86 movq %r8,(%rdi) 101 movq %r8, (%rdi)
87 leaq 8(%rdi),%rdi 102 leaq 8(%rdi), %rdi
88 leaq 8(%rsi),%rsi 103 leaq 8(%rsi), %rsi
89 jnz .Lloop_8 104 jnz .Lloop_8
90 105
91.Lhandle_7: 106.Lhandle_7:
92 movl %edx,%ecx 107 movl %edx, %ecx
93 andl $7,%ecx 108 andl $7, %ecx
94 jz .Lende 109 jz .Lend
110
95 .p2align 4 111 .p2align 4
96.Lloop_1: 112.Lloop_1:
97 movb (%rsi),%r8b 113 movb (%rsi), %r8b
98 movb %r8b,(%rdi) 114 movb %r8b, (%rdi)
99 incq %rdi 115 incq %rdi
100 incq %rsi 116 incq %rsi
101 decl %ecx 117 decl %ecx
102 jnz .Lloop_1 118 jnz .Lloop_1
103 119
104.Lende: 120.Lend:
105 popq %rbx
106 CFI_ADJUST_CFA_OFFSET -8
107 CFI_RESTORE rbx
108 ret 121 ret
109.Lfinal:
110 CFI_ENDPROC 122 CFI_ENDPROC
111ENDPROC(memcpy) 123ENDPROC(memcpy)
112ENDPROC(__memcpy) 124ENDPROC(__memcpy)
113 125
114 /* Some CPUs run faster using the string copy instructions. 126 /*
115 It is also a lot simpler. Use this when possible */ 127 * Some CPUs run faster using the string copy instructions.
128 * It is also a lot simpler. Use this when possible:
129 */
116 130
117 .section .altinstr_replacement,"ax" 131 .section .altinstr_replacement, "ax"
1181: .byte 0xeb /* jmp <disp8> */ 1321: .byte 0xeb /* jmp <disp8> */
119 .byte (memcpy_c - memcpy) - (2f - 1b) /* offset */ 133 .byte (memcpy_c - memcpy) - (2f - 1b) /* offset */
1202: 1342:
121 .previous 135 .previous
122 .section .altinstructions,"a" 136
137 .section .altinstructions, "a"
123 .align 8 138 .align 8
124 .quad memcpy 139 .quad memcpy
125 .quad 1b 140 .quad 1b
126 .byte X86_FEATURE_REP_GOOD 141 .byte X86_FEATURE_REP_GOOD
127 /* Replace only beginning, memcpy is used to apply alternatives, so it 142
128 * is silly to overwrite itself with nops - reboot is only outcome... */ 143 /*
144 * Replace only beginning, memcpy is used to apply alternatives,
145 * so it is silly to overwrite itself with nops - reboot is the
146 * only outcome...
147 */
129 .byte 2b - 1b 148 .byte 2b - 1b
130 .byte 2b - 1b 149 .byte 2b - 1b
131 .previous 150 .previous
diff --git a/arch/x86/mm/highmem_32.c b/arch/x86/mm/highmem_32.c
index 00f127c80b0e..522db5e3d0bf 100644
--- a/arch/x86/mm/highmem_32.c
+++ b/arch/x86/mm/highmem_32.c
@@ -121,22 +121,13 @@ void kunmap_atomic(void *kvaddr, enum km_type type)
121 pagefault_enable(); 121 pagefault_enable();
122} 122}
123 123
124/* This is the same as kmap_atomic() but can map memory that doesn't 124/*
125 * This is the same as kmap_atomic() but can map memory that doesn't
125 * have a struct page associated with it. 126 * have a struct page associated with it.
126 */ 127 */
127void *kmap_atomic_pfn(unsigned long pfn, enum km_type type) 128void *kmap_atomic_pfn(unsigned long pfn, enum km_type type)
128{ 129{
129 enum fixed_addresses idx; 130 return kmap_atomic_prot_pfn(pfn, type, kmap_prot);
130 unsigned long vaddr;
131
132 pagefault_disable();
133
134 idx = type + KM_TYPE_NR*smp_processor_id();
135 vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
136 set_pte(kmap_pte-idx, pfn_pte(pfn, kmap_prot));
137 arch_flush_lazy_mmu_mode();
138
139 return (void*) vaddr;
140} 131}
141EXPORT_SYMBOL_GPL(kmap_atomic_pfn); /* temporarily in use by i915 GEM until vmap */ 132EXPORT_SYMBOL_GPL(kmap_atomic_pfn); /* temporarily in use by i915 GEM until vmap */
142 133
@@ -158,7 +149,6 @@ EXPORT_SYMBOL(kunmap);
158EXPORT_SYMBOL(kmap_atomic); 149EXPORT_SYMBOL(kmap_atomic);
159EXPORT_SYMBOL(kunmap_atomic); 150EXPORT_SYMBOL(kunmap_atomic);
160 151
161#ifdef CONFIG_NUMA
162void __init set_highmem_pages_init(void) 152void __init set_highmem_pages_init(void)
163{ 153{
164 struct zone *zone; 154 struct zone *zone;
@@ -182,11 +172,3 @@ void __init set_highmem_pages_init(void)
182 } 172 }
183 totalram_pages += totalhigh_pages; 173 totalram_pages += totalhigh_pages;
184} 174}
185#else
186void __init set_highmem_pages_init(void)
187{
188 add_highpages_with_active_regions(0, highstart_pfn, highend_pfn);
189
190 totalram_pages += totalhigh_pages;
191}
192#endif /* CONFIG_NUMA */
diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c
index ce6a722587d8..fd3da1dda1c9 100644
--- a/arch/x86/mm/init.c
+++ b/arch/x86/mm/init.c
@@ -1,8 +1,345 @@
1#include <linux/ioport.h>
1#include <linux/swap.h> 2#include <linux/swap.h>
3
2#include <asm/cacheflush.h> 4#include <asm/cacheflush.h>
5#include <asm/e820.h>
6#include <asm/init.h>
3#include <asm/page.h> 7#include <asm/page.h>
8#include <asm/page_types.h>
4#include <asm/sections.h> 9#include <asm/sections.h>
5#include <asm/system.h> 10#include <asm/system.h>
11#include <asm/tlbflush.h>
12
13unsigned long __initdata e820_table_start;
14unsigned long __meminitdata e820_table_end;
15unsigned long __meminitdata e820_table_top;
16
17int after_bootmem;
18
19int direct_gbpages
20#ifdef CONFIG_DIRECT_GBPAGES
21 = 1
22#endif
23;
24
25static void __init find_early_table_space(unsigned long end, int use_pse,
26 int use_gbpages)
27{
28 unsigned long puds, pmds, ptes, tables, start;
29
30 puds = (end + PUD_SIZE - 1) >> PUD_SHIFT;
31 tables = roundup(puds * sizeof(pud_t), PAGE_SIZE);
32
33 if (use_gbpages) {
34 unsigned long extra;
35
36 extra = end - ((end>>PUD_SHIFT) << PUD_SHIFT);
37 pmds = (extra + PMD_SIZE - 1) >> PMD_SHIFT;
38 } else
39 pmds = (end + PMD_SIZE - 1) >> PMD_SHIFT;
40
41 tables += roundup(pmds * sizeof(pmd_t), PAGE_SIZE);
42
43 if (use_pse) {
44 unsigned long extra;
45
46 extra = end - ((end>>PMD_SHIFT) << PMD_SHIFT);
47#ifdef CONFIG_X86_32
48 extra += PMD_SIZE;
49#endif
50 ptes = (extra + PAGE_SIZE - 1) >> PAGE_SHIFT;
51 } else
52 ptes = (end + PAGE_SIZE - 1) >> PAGE_SHIFT;
53
54 tables += roundup(ptes * sizeof(pte_t), PAGE_SIZE);
55
56#ifdef CONFIG_X86_32
57 /* for fixmap */
58 tables += roundup(__end_of_fixed_addresses * sizeof(pte_t), PAGE_SIZE);
59#endif
60
61 /*
62 * RED-PEN putting page tables only on node 0 could
63 * cause a hotspot and fill up ZONE_DMA. The page tables
64 * need roughly 0.5KB per GB.
65 */
66#ifdef CONFIG_X86_32
67 start = 0x7000;
68 e820_table_start = find_e820_area(start, max_pfn_mapped<<PAGE_SHIFT,
69 tables, PAGE_SIZE);
70#else /* CONFIG_X86_64 */
71 start = 0x8000;
72 e820_table_start = find_e820_area(start, end, tables, PAGE_SIZE);
73#endif
74 if (e820_table_start == -1UL)
75 panic("Cannot find space for the kernel page tables");
76
77 e820_table_start >>= PAGE_SHIFT;
78 e820_table_end = e820_table_start;
79 e820_table_top = e820_table_start + (tables >> PAGE_SHIFT);
80
81 printk(KERN_DEBUG "kernel direct mapping tables up to %lx @ %lx-%lx\n",
82 end, e820_table_start << PAGE_SHIFT, e820_table_top << PAGE_SHIFT);
83}
84
85struct map_range {
86 unsigned long start;
87 unsigned long end;
88 unsigned page_size_mask;
89};
90
91#ifdef CONFIG_X86_32
92#define NR_RANGE_MR 3
93#else /* CONFIG_X86_64 */
94#define NR_RANGE_MR 5
95#endif
96
97static int __meminit save_mr(struct map_range *mr, int nr_range,
98 unsigned long start_pfn, unsigned long end_pfn,
99 unsigned long page_size_mask)
100{
101 if (start_pfn < end_pfn) {
102 if (nr_range >= NR_RANGE_MR)
103 panic("run out of range for init_memory_mapping\n");
104 mr[nr_range].start = start_pfn<<PAGE_SHIFT;
105 mr[nr_range].end = end_pfn<<PAGE_SHIFT;
106 mr[nr_range].page_size_mask = page_size_mask;
107 nr_range++;
108 }
109
110 return nr_range;
111}
112
113#ifdef CONFIG_X86_64
114static void __init init_gbpages(void)
115{
116 if (direct_gbpages && cpu_has_gbpages)
117 printk(KERN_INFO "Using GB pages for direct mapping\n");
118 else
119 direct_gbpages = 0;
120}
121#else
122static inline void init_gbpages(void)
123{
124}
125#endif
126
127/*
128 * Setup the direct mapping of the physical memory at PAGE_OFFSET.
129 * This runs before bootmem is initialized and gets pages directly from
130 * the physical memory. To access them they are temporarily mapped.
131 */
132unsigned long __init_refok init_memory_mapping(unsigned long start,
133 unsigned long end)
134{
135 unsigned long page_size_mask = 0;
136 unsigned long start_pfn, end_pfn;
137 unsigned long ret = 0;
138 unsigned long pos;
139
140 struct map_range mr[NR_RANGE_MR];
141 int nr_range, i;
142 int use_pse, use_gbpages;
143
144 printk(KERN_INFO "init_memory_mapping: %016lx-%016lx\n", start, end);
145
146 if (!after_bootmem)
147 init_gbpages();
148
149#ifdef CONFIG_DEBUG_PAGEALLOC
150 /*
151 * For CONFIG_DEBUG_PAGEALLOC, identity mapping will use small pages.
152 * This will simplify cpa(), which otherwise needs to support splitting
153 * large pages into small in interrupt context, etc.
154 */
155 use_pse = use_gbpages = 0;
156#else
157 use_pse = cpu_has_pse;
158 use_gbpages = direct_gbpages;
159#endif
160
161#ifdef CONFIG_X86_32
162#ifdef CONFIG_X86_PAE
163 set_nx();
164 if (nx_enabled)
165 printk(KERN_INFO "NX (Execute Disable) protection: active\n");
166#endif
167
168 /* Enable PSE if available */
169 if (cpu_has_pse)
170 set_in_cr4(X86_CR4_PSE);
171
172 /* Enable PGE if available */
173 if (cpu_has_pge) {
174 set_in_cr4(X86_CR4_PGE);
175 __supported_pte_mask |= _PAGE_GLOBAL;
176 }
177#endif
178
179 if (use_gbpages)
180 page_size_mask |= 1 << PG_LEVEL_1G;
181 if (use_pse)
182 page_size_mask |= 1 << PG_LEVEL_2M;
183
184 memset(mr, 0, sizeof(mr));
185 nr_range = 0;
186
187 /* head if not big page alignment ? */
188 start_pfn = start >> PAGE_SHIFT;
189 pos = start_pfn << PAGE_SHIFT;
190#ifdef CONFIG_X86_32
191 /*
192 * Don't use a large page for the first 2/4MB of memory
193 * because there are often fixed size MTRRs in there
194 * and overlapping MTRRs into large pages can cause
195 * slowdowns.
196 */
197 if (pos == 0)
198 end_pfn = 1<<(PMD_SHIFT - PAGE_SHIFT);
199 else
200 end_pfn = ((pos + (PMD_SIZE - 1))>>PMD_SHIFT)
201 << (PMD_SHIFT - PAGE_SHIFT);
202#else /* CONFIG_X86_64 */
203 end_pfn = ((pos + (PMD_SIZE - 1)) >> PMD_SHIFT)
204 << (PMD_SHIFT - PAGE_SHIFT);
205#endif
206 if (end_pfn > (end >> PAGE_SHIFT))
207 end_pfn = end >> PAGE_SHIFT;
208 if (start_pfn < end_pfn) {
209 nr_range = save_mr(mr, nr_range, start_pfn, end_pfn, 0);
210 pos = end_pfn << PAGE_SHIFT;
211 }
212
213 /* big page (2M) range */
214 start_pfn = ((pos + (PMD_SIZE - 1))>>PMD_SHIFT)
215 << (PMD_SHIFT - PAGE_SHIFT);
216#ifdef CONFIG_X86_32
217 end_pfn = (end>>PMD_SHIFT) << (PMD_SHIFT - PAGE_SHIFT);
218#else /* CONFIG_X86_64 */
219 end_pfn = ((pos + (PUD_SIZE - 1))>>PUD_SHIFT)
220 << (PUD_SHIFT - PAGE_SHIFT);
221 if (end_pfn > ((end>>PMD_SHIFT)<<(PMD_SHIFT - PAGE_SHIFT)))
222 end_pfn = ((end>>PMD_SHIFT)<<(PMD_SHIFT - PAGE_SHIFT));
223#endif
224
225 if (start_pfn < end_pfn) {
226 nr_range = save_mr(mr, nr_range, start_pfn, end_pfn,
227 page_size_mask & (1<<PG_LEVEL_2M));
228 pos = end_pfn << PAGE_SHIFT;
229 }
230
231#ifdef CONFIG_X86_64
232 /* big page (1G) range */
233 start_pfn = ((pos + (PUD_SIZE - 1))>>PUD_SHIFT)
234 << (PUD_SHIFT - PAGE_SHIFT);
235 end_pfn = (end >> PUD_SHIFT) << (PUD_SHIFT - PAGE_SHIFT);
236 if (start_pfn < end_pfn) {
237 nr_range = save_mr(mr, nr_range, start_pfn, end_pfn,
238 page_size_mask &
239 ((1<<PG_LEVEL_2M)|(1<<PG_LEVEL_1G)));
240 pos = end_pfn << PAGE_SHIFT;
241 }
242
243 /* tail is not big page (1G) alignment */
244 start_pfn = ((pos + (PMD_SIZE - 1))>>PMD_SHIFT)
245 << (PMD_SHIFT - PAGE_SHIFT);
246 end_pfn = (end >> PMD_SHIFT) << (PMD_SHIFT - PAGE_SHIFT);
247 if (start_pfn < end_pfn) {
248 nr_range = save_mr(mr, nr_range, start_pfn, end_pfn,
249 page_size_mask & (1<<PG_LEVEL_2M));
250 pos = end_pfn << PAGE_SHIFT;
251 }
252#endif
253
254 /* tail is not big page (2M) alignment */
255 start_pfn = pos>>PAGE_SHIFT;
256 end_pfn = end>>PAGE_SHIFT;
257 nr_range = save_mr(mr, nr_range, start_pfn, end_pfn, 0);
258
259 /* try to merge same page size and continuous */
260 for (i = 0; nr_range > 1 && i < nr_range - 1; i++) {
261 unsigned long old_start;
262 if (mr[i].end != mr[i+1].start ||
263 mr[i].page_size_mask != mr[i+1].page_size_mask)
264 continue;
265 /* move it */
266 old_start = mr[i].start;
267 memmove(&mr[i], &mr[i+1],
268 (nr_range - 1 - i) * sizeof(struct map_range));
269 mr[i--].start = old_start;
270 nr_range--;
271 }
272
273 for (i = 0; i < nr_range; i++)
274 printk(KERN_DEBUG " %010lx - %010lx page %s\n",
275 mr[i].start, mr[i].end,
276 (mr[i].page_size_mask & (1<<PG_LEVEL_1G))?"1G":(
277 (mr[i].page_size_mask & (1<<PG_LEVEL_2M))?"2M":"4k"));
278
279 /*
280 * Find space for the kernel direct mapping tables.
281 *
282 * Later we should allocate these tables in the local node of the
283 * memory mapped. Unfortunately this is done currently before the
284 * nodes are discovered.
285 */
286 if (!after_bootmem)
287 find_early_table_space(end, use_pse, use_gbpages);
288
289#ifdef CONFIG_X86_32
290 for (i = 0; i < nr_range; i++)
291 kernel_physical_mapping_init(mr[i].start, mr[i].end,
292 mr[i].page_size_mask);
293 ret = end;
294#else /* CONFIG_X86_64 */
295 for (i = 0; i < nr_range; i++)
296 ret = kernel_physical_mapping_init(mr[i].start, mr[i].end,
297 mr[i].page_size_mask);
298#endif
299
300#ifdef CONFIG_X86_32
301 early_ioremap_page_table_range_init();
302
303 load_cr3(swapper_pg_dir);
304#endif
305
306#ifdef CONFIG_X86_64
307 if (!after_bootmem)
308 mmu_cr4_features = read_cr4();
309#endif
310 __flush_tlb_all();
311
312 if (!after_bootmem && e820_table_end > e820_table_start)
313 reserve_early(e820_table_start << PAGE_SHIFT,
314 e820_table_end << PAGE_SHIFT, "PGTABLE");
315
316 if (!after_bootmem)
317 early_memtest(start, end);
318
319 return ret >> PAGE_SHIFT;
320}
321
322
323/*
324 * devmem_is_allowed() checks to see if /dev/mem access to a certain address
325 * is valid. The argument is a physical page number.
326 *
327 *
328 * On x86, access has to be given to the first megabyte of ram because that area
329 * contains bios code and data regions used by X and dosemu and similar apps.
330 * Access has to be given to non-kernel-ram areas as well, these contain the PCI
331 * mmio resources as well as potential bios/acpi data regions.
332 */
333int devmem_is_allowed(unsigned long pagenr)
334{
335 if (pagenr <= 256)
336 return 1;
337 if (iomem_is_exclusive(pagenr << PAGE_SHIFT))
338 return 0;
339 if (!page_is_ram(pagenr))
340 return 1;
341 return 0;
342}
6 343
7void free_init_pages(char *what, unsigned long begin, unsigned long end) 344void free_init_pages(char *what, unsigned long begin, unsigned long end)
8{ 345{
@@ -47,3 +384,10 @@ void free_initmem(void)
47 (unsigned long)(&__init_begin), 384 (unsigned long)(&__init_begin),
48 (unsigned long)(&__init_end)); 385 (unsigned long)(&__init_end));
49} 386}
387
388#ifdef CONFIG_BLK_DEV_INITRD
389void free_initrd_mem(unsigned long start, unsigned long end)
390{
391 free_init_pages("initrd memory", start, end);
392}
393#endif
diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c
index 47df0e1bbeb9..db81e9a8556b 100644
--- a/arch/x86/mm/init_32.c
+++ b/arch/x86/mm/init_32.c
@@ -49,6 +49,7 @@
49#include <asm/paravirt.h> 49#include <asm/paravirt.h>
50#include <asm/setup.h> 50#include <asm/setup.h>
51#include <asm/cacheflush.h> 51#include <asm/cacheflush.h>
52#include <asm/init.h>
52 53
53unsigned long max_low_pfn_mapped; 54unsigned long max_low_pfn_mapped;
54unsigned long max_pfn_mapped; 55unsigned long max_pfn_mapped;
@@ -58,19 +59,14 @@ unsigned long highstart_pfn, highend_pfn;
58 59
59static noinline int do_test_wp_bit(void); 60static noinline int do_test_wp_bit(void);
60 61
61 62bool __read_mostly __vmalloc_start_set = false;
62static unsigned long __initdata table_start;
63static unsigned long __meminitdata table_end;
64static unsigned long __meminitdata table_top;
65
66static int __initdata after_init_bootmem;
67 63
68static __init void *alloc_low_page(void) 64static __init void *alloc_low_page(void)
69{ 65{
70 unsigned long pfn = table_end++; 66 unsigned long pfn = e820_table_end++;
71 void *adr; 67 void *adr;
72 68
73 if (pfn >= table_top) 69 if (pfn >= e820_table_top)
74 panic("alloc_low_page: ran out of memory"); 70 panic("alloc_low_page: ran out of memory");
75 71
76 adr = __va(pfn * PAGE_SIZE); 72 adr = __va(pfn * PAGE_SIZE);
@@ -90,7 +86,7 @@ static pmd_t * __init one_md_table_init(pgd_t *pgd)
90 86
91#ifdef CONFIG_X86_PAE 87#ifdef CONFIG_X86_PAE
92 if (!(pgd_val(*pgd) & _PAGE_PRESENT)) { 88 if (!(pgd_val(*pgd) & _PAGE_PRESENT)) {
93 if (after_init_bootmem) 89 if (after_bootmem)
94 pmd_table = (pmd_t *)alloc_bootmem_low_pages(PAGE_SIZE); 90 pmd_table = (pmd_t *)alloc_bootmem_low_pages(PAGE_SIZE);
95 else 91 else
96 pmd_table = (pmd_t *)alloc_low_page(); 92 pmd_table = (pmd_t *)alloc_low_page();
@@ -117,7 +113,7 @@ static pte_t * __init one_page_table_init(pmd_t *pmd)
117 if (!(pmd_val(*pmd) & _PAGE_PRESENT)) { 113 if (!(pmd_val(*pmd) & _PAGE_PRESENT)) {
118 pte_t *page_table = NULL; 114 pte_t *page_table = NULL;
119 115
120 if (after_init_bootmem) { 116 if (after_bootmem) {
121#ifdef CONFIG_DEBUG_PAGEALLOC 117#ifdef CONFIG_DEBUG_PAGEALLOC
122 page_table = (pte_t *) alloc_bootmem_pages(PAGE_SIZE); 118 page_table = (pte_t *) alloc_bootmem_pages(PAGE_SIZE);
123#endif 119#endif
@@ -168,12 +164,12 @@ static pte_t *__init page_table_kmap_check(pte_t *pte, pmd_t *pmd,
168 if (pmd_idx_kmap_begin != pmd_idx_kmap_end 164 if (pmd_idx_kmap_begin != pmd_idx_kmap_end
169 && (vaddr >> PMD_SHIFT) >= pmd_idx_kmap_begin 165 && (vaddr >> PMD_SHIFT) >= pmd_idx_kmap_begin
170 && (vaddr >> PMD_SHIFT) <= pmd_idx_kmap_end 166 && (vaddr >> PMD_SHIFT) <= pmd_idx_kmap_end
171 && ((__pa(pte) >> PAGE_SHIFT) < table_start 167 && ((__pa(pte) >> PAGE_SHIFT) < e820_table_start
172 || (__pa(pte) >> PAGE_SHIFT) >= table_end)) { 168 || (__pa(pte) >> PAGE_SHIFT) >= e820_table_end)) {
173 pte_t *newpte; 169 pte_t *newpte;
174 int i; 170 int i;
175 171
176 BUG_ON(after_init_bootmem); 172 BUG_ON(after_bootmem);
177 newpte = alloc_low_page(); 173 newpte = alloc_low_page();
178 for (i = 0; i < PTRS_PER_PTE; i++) 174 for (i = 0; i < PTRS_PER_PTE; i++)
179 set_pte(newpte + i, pte[i]); 175 set_pte(newpte + i, pte[i]);
@@ -242,11 +238,14 @@ static inline int is_kernel_text(unsigned long addr)
242 * of max_low_pfn pages, by creating page tables starting from address 238 * of max_low_pfn pages, by creating page tables starting from address
243 * PAGE_OFFSET: 239 * PAGE_OFFSET:
244 */ 240 */
245static void __init kernel_physical_mapping_init(pgd_t *pgd_base, 241unsigned long __init
246 unsigned long start_pfn, 242kernel_physical_mapping_init(unsigned long start,
247 unsigned long end_pfn, 243 unsigned long end,
248 int use_pse) 244 unsigned long page_size_mask)
249{ 245{
246 int use_pse = page_size_mask == (1<<PG_LEVEL_2M);
247 unsigned long start_pfn, end_pfn;
248 pgd_t *pgd_base = swapper_pg_dir;
250 int pgd_idx, pmd_idx, pte_ofs; 249 int pgd_idx, pmd_idx, pte_ofs;
251 unsigned long pfn; 250 unsigned long pfn;
252 pgd_t *pgd; 251 pgd_t *pgd;
@@ -255,6 +254,9 @@ static void __init kernel_physical_mapping_init(pgd_t *pgd_base,
255 unsigned pages_2m, pages_4k; 254 unsigned pages_2m, pages_4k;
256 int mapping_iter; 255 int mapping_iter;
257 256
257 start_pfn = start >> PAGE_SHIFT;
258 end_pfn = end >> PAGE_SHIFT;
259
258 /* 260 /*
259 * First iteration will setup identity mapping using large/small pages 261 * First iteration will setup identity mapping using large/small pages
260 * based on use_pse, with other attributes same as set by 262 * based on use_pse, with other attributes same as set by
@@ -369,26 +371,6 @@ repeat:
369 mapping_iter = 2; 371 mapping_iter = 2;
370 goto repeat; 372 goto repeat;
371 } 373 }
372}
373
374/*
375 * devmem_is_allowed() checks to see if /dev/mem access to a certain address
376 * is valid. The argument is a physical page number.
377 *
378 *
379 * On x86, access has to be given to the first megabyte of ram because that area
380 * contains bios code and data regions used by X and dosemu and similar apps.
381 * Access has to be given to non-kernel-ram areas as well, these contain the PCI
382 * mmio resources as well as potential bios/acpi data regions.
383 */
384int devmem_is_allowed(unsigned long pagenr)
385{
386 if (pagenr <= 256)
387 return 1;
388 if (iomem_is_exclusive(pagenr << PAGE_SHIFT))
389 return 0;
390 if (!page_is_ram(pagenr))
391 return 1;
392 return 0; 374 return 0;
393} 375}
394 376
@@ -545,8 +527,9 @@ void __init native_pagetable_setup_done(pgd_t *base)
545 * be partially populated, and so it avoids stomping on any existing 527 * be partially populated, and so it avoids stomping on any existing
546 * mappings. 528 * mappings.
547 */ 529 */
548static void __init early_ioremap_page_table_range_init(pgd_t *pgd_base) 530void __init early_ioremap_page_table_range_init(void)
549{ 531{
532 pgd_t *pgd_base = swapper_pg_dir;
550 unsigned long vaddr, end; 533 unsigned long vaddr, end;
551 534
552 /* 535 /*
@@ -641,7 +624,7 @@ static int __init noexec_setup(char *str)
641} 624}
642early_param("noexec", noexec_setup); 625early_param("noexec", noexec_setup);
643 626
644static void __init set_nx(void) 627void __init set_nx(void)
645{ 628{
646 unsigned int v[4], l, h; 629 unsigned int v[4], l, h;
647 630
@@ -793,6 +776,8 @@ void __init initmem_init(unsigned long start_pfn,
793#ifdef CONFIG_FLATMEM 776#ifdef CONFIG_FLATMEM
794 max_mapnr = num_physpages; 777 max_mapnr = num_physpages;
795#endif 778#endif
779 __vmalloc_start_set = true;
780
796 printk(KERN_NOTICE "%ldMB LOWMEM available.\n", 781 printk(KERN_NOTICE "%ldMB LOWMEM available.\n",
797 pages_to_mb(max_low_pfn)); 782 pages_to_mb(max_low_pfn));
798 783
@@ -814,176 +799,66 @@ static void __init zone_sizes_init(void)
814 free_area_init_nodes(max_zone_pfns); 799 free_area_init_nodes(max_zone_pfns);
815} 800}
816 801
802static unsigned long __init setup_node_bootmem(int nodeid,
803 unsigned long start_pfn,
804 unsigned long end_pfn,
805 unsigned long bootmap)
806{
807 unsigned long bootmap_size;
808
809 /* don't touch min_low_pfn */
810 bootmap_size = init_bootmem_node(NODE_DATA(nodeid),
811 bootmap >> PAGE_SHIFT,
812 start_pfn, end_pfn);
813 printk(KERN_INFO " node %d low ram: %08lx - %08lx\n",
814 nodeid, start_pfn<<PAGE_SHIFT, end_pfn<<PAGE_SHIFT);
815 printk(KERN_INFO " node %d bootmap %08lx - %08lx\n",
816 nodeid, bootmap, bootmap + bootmap_size);
817 free_bootmem_with_active_regions(nodeid, end_pfn);
818 early_res_to_bootmem(start_pfn<<PAGE_SHIFT, end_pfn<<PAGE_SHIFT);
819
820 return bootmap + bootmap_size;
821}
822
817void __init setup_bootmem_allocator(void) 823void __init setup_bootmem_allocator(void)
818{ 824{
819 int i; 825 int nodeid;
820 unsigned long bootmap_size, bootmap; 826 unsigned long bootmap_size, bootmap;
821 /* 827 /*
822 * Initialize the boot-time allocator (with low memory only): 828 * Initialize the boot-time allocator (with low memory only):
823 */ 829 */
824 bootmap_size = bootmem_bootmap_pages(max_low_pfn)<<PAGE_SHIFT; 830 bootmap_size = bootmem_bootmap_pages(max_low_pfn)<<PAGE_SHIFT;
825 bootmap = find_e820_area(min_low_pfn<<PAGE_SHIFT, 831 bootmap = find_e820_area(0, max_pfn_mapped<<PAGE_SHIFT, bootmap_size,
826 max_pfn_mapped<<PAGE_SHIFT, bootmap_size,
827 PAGE_SIZE); 832 PAGE_SIZE);
828 if (bootmap == -1L) 833 if (bootmap == -1L)
829 panic("Cannot find bootmem map of size %ld\n", bootmap_size); 834 panic("Cannot find bootmem map of size %ld\n", bootmap_size);
830 reserve_early(bootmap, bootmap + bootmap_size, "BOOTMAP"); 835 reserve_early(bootmap, bootmap + bootmap_size, "BOOTMAP");
831 836
832 /* don't touch min_low_pfn */
833 bootmap_size = init_bootmem_node(NODE_DATA(0), bootmap >> PAGE_SHIFT,
834 min_low_pfn, max_low_pfn);
835 printk(KERN_INFO " mapped low ram: 0 - %08lx\n", 837 printk(KERN_INFO " mapped low ram: 0 - %08lx\n",
836 max_pfn_mapped<<PAGE_SHIFT); 838 max_pfn_mapped<<PAGE_SHIFT);
837 printk(KERN_INFO " low ram: %08lx - %08lx\n", 839 printk(KERN_INFO " low ram: 0 - %08lx\n", max_low_pfn<<PAGE_SHIFT);
838 min_low_pfn<<PAGE_SHIFT, max_low_pfn<<PAGE_SHIFT);
839 printk(KERN_INFO " bootmap %08lx - %08lx\n",
840 bootmap, bootmap + bootmap_size);
841 for_each_online_node(i)
842 free_bootmem_with_active_regions(i, max_low_pfn);
843 early_res_to_bootmem(0, max_low_pfn<<PAGE_SHIFT);
844
845 after_init_bootmem = 1;
846}
847
848static void __init find_early_table_space(unsigned long end, int use_pse)
849{
850 unsigned long puds, pmds, ptes, tables, start;
851 840
852 puds = (end + PUD_SIZE - 1) >> PUD_SHIFT; 841 for_each_online_node(nodeid) {
853 tables = roundup(puds * sizeof(pud_t), PAGE_SIZE); 842 unsigned long start_pfn, end_pfn;
854 843
855 pmds = (end + PMD_SIZE - 1) >> PMD_SHIFT; 844#ifdef CONFIG_NEED_MULTIPLE_NODES
856 tables += roundup(pmds * sizeof(pmd_t), PAGE_SIZE); 845 start_pfn = node_start_pfn[nodeid];
857 846 end_pfn = node_end_pfn[nodeid];
858 if (use_pse) { 847 if (start_pfn > max_low_pfn)
859 unsigned long extra; 848 continue;
860 849 if (end_pfn > max_low_pfn)
861 extra = end - ((end>>PMD_SHIFT) << PMD_SHIFT); 850 end_pfn = max_low_pfn;
862 extra += PMD_SIZE;
863 ptes = (extra + PAGE_SIZE - 1) >> PAGE_SHIFT;
864 } else
865 ptes = (end + PAGE_SIZE - 1) >> PAGE_SHIFT;
866
867 tables += roundup(ptes * sizeof(pte_t), PAGE_SIZE);
868
869 /* for fixmap */
870 tables += roundup(__end_of_fixed_addresses * sizeof(pte_t), PAGE_SIZE);
871
872 /*
873 * RED-PEN putting page tables only on node 0 could
874 * cause a hotspot and fill up ZONE_DMA. The page tables
875 * need roughly 0.5KB per GB.
876 */
877 start = 0x7000;
878 table_start = find_e820_area(start, max_pfn_mapped<<PAGE_SHIFT,
879 tables, PAGE_SIZE);
880 if (table_start == -1UL)
881 panic("Cannot find space for the kernel page tables");
882
883 table_start >>= PAGE_SHIFT;
884 table_end = table_start;
885 table_top = table_start + (tables>>PAGE_SHIFT);
886
887 printk(KERN_DEBUG "kernel direct mapping tables up to %lx @ %lx-%lx\n",
888 end, table_start << PAGE_SHIFT,
889 (table_start << PAGE_SHIFT) + tables);
890}
891
892unsigned long __init_refok init_memory_mapping(unsigned long start,
893 unsigned long end)
894{
895 pgd_t *pgd_base = swapper_pg_dir;
896 unsigned long start_pfn, end_pfn;
897 unsigned long big_page_start;
898#ifdef CONFIG_DEBUG_PAGEALLOC
899 /*
900 * For CONFIG_DEBUG_PAGEALLOC, identity mapping will use small pages.
901 * This will simplify cpa(), which otherwise needs to support splitting
902 * large pages into small in interrupt context, etc.
903 */
904 int use_pse = 0;
905#else 851#else
906 int use_pse = cpu_has_pse; 852 start_pfn = 0;
853 end_pfn = max_low_pfn;
907#endif 854#endif
908 855 bootmap = setup_node_bootmem(nodeid, start_pfn, end_pfn,
909 /* 856 bootmap);
910 * Find space for the kernel direct mapping tables.
911 */
912 if (!after_init_bootmem)
913 find_early_table_space(end, use_pse);
914
915#ifdef CONFIG_X86_PAE
916 set_nx();
917 if (nx_enabled)
918 printk(KERN_INFO "NX (Execute Disable) protection: active\n");
919#endif
920
921 /* Enable PSE if available */
922 if (cpu_has_pse)
923 set_in_cr4(X86_CR4_PSE);
924
925 /* Enable PGE if available */
926 if (cpu_has_pge) {
927 set_in_cr4(X86_CR4_PGE);
928 __supported_pte_mask |= _PAGE_GLOBAL;
929 }
930
931 /*
932 * Don't use a large page for the first 2/4MB of memory
933 * because there are often fixed size MTRRs in there
934 * and overlapping MTRRs into large pages can cause
935 * slowdowns.
936 */
937 big_page_start = PMD_SIZE;
938
939 if (start < big_page_start) {
940 start_pfn = start >> PAGE_SHIFT;
941 end_pfn = min(big_page_start>>PAGE_SHIFT, end>>PAGE_SHIFT);
942 } else {
943 /* head is not big page alignment ? */
944 start_pfn = start >> PAGE_SHIFT;
945 end_pfn = ((start + (PMD_SIZE - 1))>>PMD_SHIFT)
946 << (PMD_SHIFT - PAGE_SHIFT);
947 } 857 }
948 if (start_pfn < end_pfn)
949 kernel_physical_mapping_init(pgd_base, start_pfn, end_pfn, 0);
950
951 /* big page range */
952 start_pfn = ((start + (PMD_SIZE - 1))>>PMD_SHIFT)
953 << (PMD_SHIFT - PAGE_SHIFT);
954 if (start_pfn < (big_page_start >> PAGE_SHIFT))
955 start_pfn = big_page_start >> PAGE_SHIFT;
956 end_pfn = (end>>PMD_SHIFT) << (PMD_SHIFT - PAGE_SHIFT);
957 if (start_pfn < end_pfn)
958 kernel_physical_mapping_init(pgd_base, start_pfn, end_pfn,
959 use_pse);
960
961 /* tail is not big page alignment ? */
962 start_pfn = end_pfn;
963 if (start_pfn > (big_page_start>>PAGE_SHIFT)) {
964 end_pfn = end >> PAGE_SHIFT;
965 if (start_pfn < end_pfn)
966 kernel_physical_mapping_init(pgd_base, start_pfn,
967 end_pfn, 0);
968 }
969
970 early_ioremap_page_table_range_init(pgd_base);
971 858
972 load_cr3(swapper_pg_dir); 859 after_bootmem = 1;
973
974 __flush_tlb_all();
975
976 if (!after_init_bootmem)
977 reserve_early(table_start << PAGE_SHIFT,
978 table_end << PAGE_SHIFT, "PGTABLE");
979
980 if (!after_init_bootmem)
981 early_memtest(start, end);
982
983 return end >> PAGE_SHIFT;
984} 860}
985 861
986
987/* 862/*
988 * paging_init() sets up the page tables - note that the first 8MB are 863 * paging_init() sets up the page tables - note that the first 8MB are
989 * already mapped by head.S. 864 * already mapped by head.S.
@@ -1217,13 +1092,6 @@ void mark_rodata_ro(void)
1217} 1092}
1218#endif 1093#endif
1219 1094
1220#ifdef CONFIG_BLK_DEV_INITRD
1221void free_initrd_mem(unsigned long start, unsigned long end)
1222{
1223 free_init_pages("initrd memory", start, end);
1224}
1225#endif
1226
1227int __init reserve_bootmem_generic(unsigned long phys, unsigned long len, 1095int __init reserve_bootmem_generic(unsigned long phys, unsigned long len,
1228 int flags) 1096 int flags)
1229{ 1097{
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index 07f44d491df1..54efa57d1c03 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -48,6 +48,7 @@
48#include <asm/kdebug.h> 48#include <asm/kdebug.h>
49#include <asm/numa.h> 49#include <asm/numa.h>
50#include <asm/cacheflush.h> 50#include <asm/cacheflush.h>
51#include <asm/init.h>
51 52
52/* 53/*
53 * end_pfn only includes RAM, while max_pfn_mapped includes all e820 entries. 54 * end_pfn only includes RAM, while max_pfn_mapped includes all e820 entries.
@@ -61,12 +62,6 @@ static unsigned long dma_reserve __initdata;
61 62
62DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); 63DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
63 64
64int direct_gbpages
65#ifdef CONFIG_DIRECT_GBPAGES
66 = 1
67#endif
68;
69
70static int __init parse_direct_gbpages_off(char *arg) 65static int __init parse_direct_gbpages_off(char *arg)
71{ 66{
72 direct_gbpages = 0; 67 direct_gbpages = 0;
@@ -87,12 +82,10 @@ early_param("gbpages", parse_direct_gbpages_on);
87 * around without checking the pgd every time. 82 * around without checking the pgd every time.
88 */ 83 */
89 84
90int after_bootmem;
91
92pteval_t __supported_pte_mask __read_mostly = ~_PAGE_IOMAP; 85pteval_t __supported_pte_mask __read_mostly = ~_PAGE_IOMAP;
93EXPORT_SYMBOL_GPL(__supported_pte_mask); 86EXPORT_SYMBOL_GPL(__supported_pte_mask);
94 87
95static int do_not_nx __cpuinitdata; 88static int disable_nx __cpuinitdata;
96 89
97/* 90/*
98 * noexec=on|off 91 * noexec=on|off
@@ -107,9 +100,9 @@ static int __init nonx_setup(char *str)
107 return -EINVAL; 100 return -EINVAL;
108 if (!strncmp(str, "on", 2)) { 101 if (!strncmp(str, "on", 2)) {
109 __supported_pte_mask |= _PAGE_NX; 102 __supported_pte_mask |= _PAGE_NX;
110 do_not_nx = 0; 103 disable_nx = 0;
111 } else if (!strncmp(str, "off", 3)) { 104 } else if (!strncmp(str, "off", 3)) {
112 do_not_nx = 1; 105 disable_nx = 1;
113 __supported_pte_mask &= ~_PAGE_NX; 106 __supported_pte_mask &= ~_PAGE_NX;
114 } 107 }
115 return 0; 108 return 0;
@@ -121,7 +114,7 @@ void __cpuinit check_efer(void)
121 unsigned long efer; 114 unsigned long efer;
122 115
123 rdmsrl(MSR_EFER, efer); 116 rdmsrl(MSR_EFER, efer);
124 if (!(efer & EFER_NX) || do_not_nx) 117 if (!(efer & EFER_NX) || disable_nx)
125 __supported_pte_mask &= ~_PAGE_NX; 118 __supported_pte_mask &= ~_PAGE_NX;
126} 119}
127 120
@@ -325,13 +318,9 @@ void __init cleanup_highmap(void)
325 } 318 }
326} 319}
327 320
328static unsigned long __initdata table_start;
329static unsigned long __meminitdata table_end;
330static unsigned long __meminitdata table_top;
331
332static __ref void *alloc_low_page(unsigned long *phys) 321static __ref void *alloc_low_page(unsigned long *phys)
333{ 322{
334 unsigned long pfn = table_end++; 323 unsigned long pfn = e820_table_end++;
335 void *adr; 324 void *adr;
336 325
337 if (after_bootmem) { 326 if (after_bootmem) {
@@ -341,7 +330,7 @@ static __ref void *alloc_low_page(unsigned long *phys)
341 return adr; 330 return adr;
342 } 331 }
343 332
344 if (pfn >= table_top) 333 if (pfn >= e820_table_top)
345 panic("alloc_low_page: ran out of memory"); 334 panic("alloc_low_page: ran out of memory");
346 335
347 adr = early_memremap(pfn * PAGE_SIZE, PAGE_SIZE); 336 adr = early_memremap(pfn * PAGE_SIZE, PAGE_SIZE);
@@ -581,58 +570,10 @@ phys_pud_update(pgd_t *pgd, unsigned long addr, unsigned long end,
581 return phys_pud_init(pud, addr, end, page_size_mask); 570 return phys_pud_init(pud, addr, end, page_size_mask);
582} 571}
583 572
584static void __init find_early_table_space(unsigned long end, int use_pse, 573unsigned long __init
585 int use_gbpages) 574kernel_physical_mapping_init(unsigned long start,
586{ 575 unsigned long end,
587 unsigned long puds, pmds, ptes, tables, start; 576 unsigned long page_size_mask)
588
589 puds = (end + PUD_SIZE - 1) >> PUD_SHIFT;
590 tables = roundup(puds * sizeof(pud_t), PAGE_SIZE);
591 if (use_gbpages) {
592 unsigned long extra;
593 extra = end - ((end>>PUD_SHIFT) << PUD_SHIFT);
594 pmds = (extra + PMD_SIZE - 1) >> PMD_SHIFT;
595 } else
596 pmds = (end + PMD_SIZE - 1) >> PMD_SHIFT;
597 tables += roundup(pmds * sizeof(pmd_t), PAGE_SIZE);
598
599 if (use_pse) {
600 unsigned long extra;
601 extra = end - ((end>>PMD_SHIFT) << PMD_SHIFT);
602 ptes = (extra + PAGE_SIZE - 1) >> PAGE_SHIFT;
603 } else
604 ptes = (end + PAGE_SIZE - 1) >> PAGE_SHIFT;
605 tables += roundup(ptes * sizeof(pte_t), PAGE_SIZE);
606
607 /*
608 * RED-PEN putting page tables only on node 0 could
609 * cause a hotspot and fill up ZONE_DMA. The page tables
610 * need roughly 0.5KB per GB.
611 */
612 start = 0x8000;
613 table_start = find_e820_area(start, end, tables, PAGE_SIZE);
614 if (table_start == -1UL)
615 panic("Cannot find space for the kernel page tables");
616
617 table_start >>= PAGE_SHIFT;
618 table_end = table_start;
619 table_top = table_start + (tables >> PAGE_SHIFT);
620
621 printk(KERN_DEBUG "kernel direct mapping tables up to %lx @ %lx-%lx\n",
622 end, table_start << PAGE_SHIFT, table_top << PAGE_SHIFT);
623}
624
625static void __init init_gbpages(void)
626{
627 if (direct_gbpages && cpu_has_gbpages)
628 printk(KERN_INFO "Using GB pages for direct mapping\n");
629 else
630 direct_gbpages = 0;
631}
632
633static unsigned long __meminit kernel_physical_mapping_init(unsigned long start,
634 unsigned long end,
635 unsigned long page_size_mask)
636{ 577{
637 578
638 unsigned long next, last_map_addr = end; 579 unsigned long next, last_map_addr = end;
@@ -669,176 +610,6 @@ static unsigned long __meminit kernel_physical_mapping_init(unsigned long start,
669 return last_map_addr; 610 return last_map_addr;
670} 611}
671 612
672struct map_range {
673 unsigned long start;
674 unsigned long end;
675 unsigned page_size_mask;
676};
677
678#define NR_RANGE_MR 5
679
680static int save_mr(struct map_range *mr, int nr_range,
681 unsigned long start_pfn, unsigned long end_pfn,
682 unsigned long page_size_mask)
683{
684
685 if (start_pfn < end_pfn) {
686 if (nr_range >= NR_RANGE_MR)
687 panic("run out of range for init_memory_mapping\n");
688 mr[nr_range].start = start_pfn<<PAGE_SHIFT;
689 mr[nr_range].end = end_pfn<<PAGE_SHIFT;
690 mr[nr_range].page_size_mask = page_size_mask;
691 nr_range++;
692 }
693
694 return nr_range;
695}
696
697/*
698 * Setup the direct mapping of the physical memory at PAGE_OFFSET.
699 * This runs before bootmem is initialized and gets pages directly from
700 * the physical memory. To access them they are temporarily mapped.
701 */
702unsigned long __init_refok init_memory_mapping(unsigned long start,
703 unsigned long end)
704{
705 unsigned long last_map_addr = 0;
706 unsigned long page_size_mask = 0;
707 unsigned long start_pfn, end_pfn;
708 unsigned long pos;
709
710 struct map_range mr[NR_RANGE_MR];
711 int nr_range, i;
712 int use_pse, use_gbpages;
713
714 printk(KERN_INFO "init_memory_mapping: %016lx-%016lx\n", start, end);
715
716 /*
717 * Find space for the kernel direct mapping tables.
718 *
719 * Later we should allocate these tables in the local node of the
720 * memory mapped. Unfortunately this is done currently before the
721 * nodes are discovered.
722 */
723 if (!after_bootmem)
724 init_gbpages();
725
726#ifdef CONFIG_DEBUG_PAGEALLOC
727 /*
728 * For CONFIG_DEBUG_PAGEALLOC, identity mapping will use small pages.
729 * This will simplify cpa(), which otherwise needs to support splitting
730 * large pages into small in interrupt context, etc.
731 */
732 use_pse = use_gbpages = 0;
733#else
734 use_pse = cpu_has_pse;
735 use_gbpages = direct_gbpages;
736#endif
737
738 if (use_gbpages)
739 page_size_mask |= 1 << PG_LEVEL_1G;
740 if (use_pse)
741 page_size_mask |= 1 << PG_LEVEL_2M;
742
743 memset(mr, 0, sizeof(mr));
744 nr_range = 0;
745
746 /* head if not big page alignment ?*/
747 start_pfn = start >> PAGE_SHIFT;
748 pos = start_pfn << PAGE_SHIFT;
749 end_pfn = ((pos + (PMD_SIZE - 1)) >> PMD_SHIFT)
750 << (PMD_SHIFT - PAGE_SHIFT);
751 if (end_pfn > (end >> PAGE_SHIFT))
752 end_pfn = end >> PAGE_SHIFT;
753 if (start_pfn < end_pfn) {
754 nr_range = save_mr(mr, nr_range, start_pfn, end_pfn, 0);
755 pos = end_pfn << PAGE_SHIFT;
756 }
757
758 /* big page (2M) range*/
759 start_pfn = ((pos + (PMD_SIZE - 1))>>PMD_SHIFT)
760 << (PMD_SHIFT - PAGE_SHIFT);
761 end_pfn = ((pos + (PUD_SIZE - 1))>>PUD_SHIFT)
762 << (PUD_SHIFT - PAGE_SHIFT);
763 if (end_pfn > ((end>>PMD_SHIFT)<<(PMD_SHIFT - PAGE_SHIFT)))
764 end_pfn = ((end>>PMD_SHIFT)<<(PMD_SHIFT - PAGE_SHIFT));
765 if (start_pfn < end_pfn) {
766 nr_range = save_mr(mr, nr_range, start_pfn, end_pfn,
767 page_size_mask & (1<<PG_LEVEL_2M));
768 pos = end_pfn << PAGE_SHIFT;
769 }
770
771 /* big page (1G) range */
772 start_pfn = ((pos + (PUD_SIZE - 1))>>PUD_SHIFT)
773 << (PUD_SHIFT - PAGE_SHIFT);
774 end_pfn = (end >> PUD_SHIFT) << (PUD_SHIFT - PAGE_SHIFT);
775 if (start_pfn < end_pfn) {
776 nr_range = save_mr(mr, nr_range, start_pfn, end_pfn,
777 page_size_mask &
778 ((1<<PG_LEVEL_2M)|(1<<PG_LEVEL_1G)));
779 pos = end_pfn << PAGE_SHIFT;
780 }
781
782 /* tail is not big page (1G) alignment */
783 start_pfn = ((pos + (PMD_SIZE - 1))>>PMD_SHIFT)
784 << (PMD_SHIFT - PAGE_SHIFT);
785 end_pfn = (end >> PMD_SHIFT) << (PMD_SHIFT - PAGE_SHIFT);
786 if (start_pfn < end_pfn) {
787 nr_range = save_mr(mr, nr_range, start_pfn, end_pfn,
788 page_size_mask & (1<<PG_LEVEL_2M));
789 pos = end_pfn << PAGE_SHIFT;
790 }
791
792 /* tail is not big page (2M) alignment */
793 start_pfn = pos>>PAGE_SHIFT;
794 end_pfn = end>>PAGE_SHIFT;
795 nr_range = save_mr(mr, nr_range, start_pfn, end_pfn, 0);
796
797 /* try to merge same page size and continuous */
798 for (i = 0; nr_range > 1 && i < nr_range - 1; i++) {
799 unsigned long old_start;
800 if (mr[i].end != mr[i+1].start ||
801 mr[i].page_size_mask != mr[i+1].page_size_mask)
802 continue;
803 /* move it */
804 old_start = mr[i].start;
805 memmove(&mr[i], &mr[i+1],
806 (nr_range - 1 - i) * sizeof (struct map_range));
807 mr[i--].start = old_start;
808 nr_range--;
809 }
810
811 for (i = 0; i < nr_range; i++)
812 printk(KERN_DEBUG " %010lx - %010lx page %s\n",
813 mr[i].start, mr[i].end,
814 (mr[i].page_size_mask & (1<<PG_LEVEL_1G))?"1G":(
815 (mr[i].page_size_mask & (1<<PG_LEVEL_2M))?"2M":"4k"));
816
817 if (!after_bootmem)
818 find_early_table_space(end, use_pse, use_gbpages);
819
820 for (i = 0; i < nr_range; i++)
821 last_map_addr = kernel_physical_mapping_init(
822 mr[i].start, mr[i].end,
823 mr[i].page_size_mask);
824
825 if (!after_bootmem)
826 mmu_cr4_features = read_cr4();
827 __flush_tlb_all();
828
829 if (!after_bootmem && table_end > table_start)
830 reserve_early(table_start << PAGE_SHIFT,
831 table_end << PAGE_SHIFT, "PGTABLE");
832
833 printk(KERN_INFO "last_map_addr: %lx end: %lx\n",
834 last_map_addr, end);
835
836 if (!after_bootmem)
837 early_memtest(start, end);
838
839 return last_map_addr >> PAGE_SHIFT;
840}
841
842#ifndef CONFIG_NUMA 613#ifndef CONFIG_NUMA
843void __init initmem_init(unsigned long start_pfn, unsigned long end_pfn) 614void __init initmem_init(unsigned long start_pfn, unsigned long end_pfn)
844{ 615{
@@ -910,28 +681,6 @@ EXPORT_SYMBOL_GPL(memory_add_physaddr_to_nid);
910 681
911#endif /* CONFIG_MEMORY_HOTPLUG */ 682#endif /* CONFIG_MEMORY_HOTPLUG */
912 683
913/*
914 * devmem_is_allowed() checks to see if /dev/mem access to a certain address
915 * is valid. The argument is a physical page number.
916 *
917 *
918 * On x86, access has to be given to the first megabyte of ram because that area
919 * contains bios code and data regions used by X and dosemu and similar apps.
920 * Access has to be given to non-kernel-ram areas as well, these contain the PCI
921 * mmio resources as well as potential bios/acpi data regions.
922 */
923int devmem_is_allowed(unsigned long pagenr)
924{
925 if (pagenr <= 256)
926 return 1;
927 if (iomem_is_exclusive(pagenr << PAGE_SHIFT))
928 return 0;
929 if (!page_is_ram(pagenr))
930 return 1;
931 return 0;
932}
933
934
935static struct kcore_list kcore_mem, kcore_vmalloc, kcore_kernel, 684static struct kcore_list kcore_mem, kcore_vmalloc, kcore_kernel,
936 kcore_modules, kcore_vsyscall; 685 kcore_modules, kcore_vsyscall;
937 686
@@ -1019,13 +768,6 @@ void mark_rodata_ro(void)
1019 768
1020#endif 769#endif
1021 770
1022#ifdef CONFIG_BLK_DEV_INITRD
1023void free_initrd_mem(unsigned long start, unsigned long end)
1024{
1025 free_init_pages("initrd memory", start, end);
1026}
1027#endif
1028
1029int __init reserve_bootmem_generic(unsigned long phys, unsigned long len, 771int __init reserve_bootmem_generic(unsigned long phys, unsigned long len,
1030 int flags) 772 int flags)
1031{ 773{
diff --git a/arch/x86/mm/iomap_32.c b/arch/x86/mm/iomap_32.c
index 04102d42ff42..699c9b2895ae 100644
--- a/arch/x86/mm/iomap_32.c
+++ b/arch/x86/mm/iomap_32.c
@@ -31,16 +31,27 @@ int is_io_mapping_possible(resource_size_t base, unsigned long size)
31} 31}
32EXPORT_SYMBOL_GPL(is_io_mapping_possible); 32EXPORT_SYMBOL_GPL(is_io_mapping_possible);
33 33
34/* Map 'pfn' using fixed map 'type' and protections 'prot' 34void *kmap_atomic_prot_pfn(unsigned long pfn, enum km_type type, pgprot_t prot)
35 */
36void *
37iomap_atomic_prot_pfn(unsigned long pfn, enum km_type type, pgprot_t prot)
38{ 35{
39 enum fixed_addresses idx; 36 enum fixed_addresses idx;
40 unsigned long vaddr; 37 unsigned long vaddr;
41 38
42 pagefault_disable(); 39 pagefault_disable();
43 40
41 idx = type + KM_TYPE_NR * smp_processor_id();
42 vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
43 set_pte(kmap_pte - idx, pfn_pte(pfn, prot));
44 arch_flush_lazy_mmu_mode();
45
46 return (void *)vaddr;
47}
48
49/*
50 * Map 'pfn' using fixed map 'type' and protections 'prot'
51 */
52void *
53iomap_atomic_prot_pfn(unsigned long pfn, enum km_type type, pgprot_t prot)
54{
44 /* 55 /*
45 * For non-PAT systems, promote PAGE_KERNEL_WC to PAGE_KERNEL_UC_MINUS. 56 * For non-PAT systems, promote PAGE_KERNEL_WC to PAGE_KERNEL_UC_MINUS.
46 * PAGE_KERNEL_WC maps to PWT, which translates to uncached if the 57 * PAGE_KERNEL_WC maps to PWT, which translates to uncached if the
@@ -50,12 +61,7 @@ iomap_atomic_prot_pfn(unsigned long pfn, enum km_type type, pgprot_t prot)
50 if (!pat_enabled && pgprot_val(prot) == pgprot_val(PAGE_KERNEL_WC)) 61 if (!pat_enabled && pgprot_val(prot) == pgprot_val(PAGE_KERNEL_WC))
51 prot = PAGE_KERNEL_UC_MINUS; 62 prot = PAGE_KERNEL_UC_MINUS;
52 63
53 idx = type + KM_TYPE_NR*smp_processor_id(); 64 return kmap_atomic_prot_pfn(pfn, type, prot);
54 vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
55 set_pte(kmap_pte-idx, pfn_pte(pfn, prot));
56 arch_flush_lazy_mmu_mode();
57
58 return (void*) vaddr;
59} 65}
60EXPORT_SYMBOL_GPL(iomap_atomic_prot_pfn); 66EXPORT_SYMBOL_GPL(iomap_atomic_prot_pfn);
61 67
diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c
index 433f7bd4648a..0dfa09d69e80 100644
--- a/arch/x86/mm/ioremap.c
+++ b/arch/x86/mm/ioremap.c
@@ -22,13 +22,17 @@
22#include <asm/pgalloc.h> 22#include <asm/pgalloc.h>
23#include <asm/pat.h> 23#include <asm/pat.h>
24 24
25#ifdef CONFIG_X86_64 25static inline int phys_addr_valid(resource_size_t addr)
26
27static inline int phys_addr_valid(unsigned long addr)
28{ 26{
29 return addr < (1UL << boot_cpu_data.x86_phys_bits); 27#ifdef CONFIG_PHYS_ADDR_T_64BIT
28 return !(addr >> boot_cpu_data.x86_phys_bits);
29#else
30 return 1;
31#endif
30} 32}
31 33
34#ifdef CONFIG_X86_64
35
32unsigned long __phys_addr(unsigned long x) 36unsigned long __phys_addr(unsigned long x)
33{ 37{
34 if (x >= __START_KERNEL_map) { 38 if (x >= __START_KERNEL_map) {
@@ -38,8 +42,7 @@ unsigned long __phys_addr(unsigned long x)
38 } else { 42 } else {
39 VIRTUAL_BUG_ON(x < PAGE_OFFSET); 43 VIRTUAL_BUG_ON(x < PAGE_OFFSET);
40 x -= PAGE_OFFSET; 44 x -= PAGE_OFFSET;
41 VIRTUAL_BUG_ON(system_state == SYSTEM_BOOTING ? x > MAXMEM : 45 VIRTUAL_BUG_ON(!phys_addr_valid(x));
42 !phys_addr_valid(x));
43 } 46 }
44 return x; 47 return x;
45} 48}
@@ -56,10 +59,8 @@ bool __virt_addr_valid(unsigned long x)
56 if (x < PAGE_OFFSET) 59 if (x < PAGE_OFFSET)
57 return false; 60 return false;
58 x -= PAGE_OFFSET; 61 x -= PAGE_OFFSET;
59 if (system_state == SYSTEM_BOOTING ? 62 if (!phys_addr_valid(x))
60 x > MAXMEM : !phys_addr_valid(x)) {
61 return false; 63 return false;
62 }
63 } 64 }
64 65
65 return pfn_valid(x >> PAGE_SHIFT); 66 return pfn_valid(x >> PAGE_SHIFT);
@@ -68,18 +69,12 @@ EXPORT_SYMBOL(__virt_addr_valid);
68 69
69#else 70#else
70 71
71static inline int phys_addr_valid(unsigned long addr)
72{
73 return 1;
74}
75
76#ifdef CONFIG_DEBUG_VIRTUAL 72#ifdef CONFIG_DEBUG_VIRTUAL
77unsigned long __phys_addr(unsigned long x) 73unsigned long __phys_addr(unsigned long x)
78{ 74{
79 /* VMALLOC_* aren't constants; not available at the boot time */ 75 /* VMALLOC_* aren't constants */
80 VIRTUAL_BUG_ON(x < PAGE_OFFSET); 76 VIRTUAL_BUG_ON(x < PAGE_OFFSET);
81 VIRTUAL_BUG_ON(system_state != SYSTEM_BOOTING && 77 VIRTUAL_BUG_ON(__vmalloc_start_set && is_vmalloc_addr((void *) x));
82 is_vmalloc_addr((void *) x));
83 return x - PAGE_OFFSET; 78 return x - PAGE_OFFSET;
84} 79}
85EXPORT_SYMBOL(__phys_addr); 80EXPORT_SYMBOL(__phys_addr);
@@ -89,7 +84,9 @@ bool __virt_addr_valid(unsigned long x)
89{ 84{
90 if (x < PAGE_OFFSET) 85 if (x < PAGE_OFFSET)
91 return false; 86 return false;
92 if (system_state != SYSTEM_BOOTING && is_vmalloc_addr((void *) x)) 87 if (__vmalloc_start_set && is_vmalloc_addr((void *) x))
88 return false;
89 if (x >= FIXADDR_START)
93 return false; 90 return false;
94 return pfn_valid((x - PAGE_OFFSET) >> PAGE_SHIFT); 91 return pfn_valid((x - PAGE_OFFSET) >> PAGE_SHIFT);
95} 92}
@@ -508,13 +505,19 @@ static inline pte_t * __init early_ioremap_pte(unsigned long addr)
508 return &bm_pte[pte_index(addr)]; 505 return &bm_pte[pte_index(addr)];
509} 506}
510 507
508static unsigned long slot_virt[FIX_BTMAPS_SLOTS] __initdata;
509
511void __init early_ioremap_init(void) 510void __init early_ioremap_init(void)
512{ 511{
513 pmd_t *pmd; 512 pmd_t *pmd;
513 int i;
514 514
515 if (early_ioremap_debug) 515 if (early_ioremap_debug)
516 printk(KERN_INFO "early_ioremap_init()\n"); 516 printk(KERN_INFO "early_ioremap_init()\n");
517 517
518 for (i = 0; i < FIX_BTMAPS_SLOTS; i++)
519 slot_virt[i] = __fix_to_virt(FIX_BTMAP_BEGIN - NR_FIX_BTMAPS*i);
520
518 pmd = early_ioremap_pmd(fix_to_virt(FIX_BTMAP_BEGIN)); 521 pmd = early_ioremap_pmd(fix_to_virt(FIX_BTMAP_BEGIN));
519 memset(bm_pte, 0, sizeof(bm_pte)); 522 memset(bm_pte, 0, sizeof(bm_pte));
520 pmd_populate_kernel(&init_mm, pmd, bm_pte); 523 pmd_populate_kernel(&init_mm, pmd, bm_pte);
@@ -581,6 +584,7 @@ static inline void __init early_clear_fixmap(enum fixed_addresses idx)
581 584
582static void __iomem *prev_map[FIX_BTMAPS_SLOTS] __initdata; 585static void __iomem *prev_map[FIX_BTMAPS_SLOTS] __initdata;
583static unsigned long prev_size[FIX_BTMAPS_SLOTS] __initdata; 586static unsigned long prev_size[FIX_BTMAPS_SLOTS] __initdata;
587
584static int __init check_early_ioremap_leak(void) 588static int __init check_early_ioremap_leak(void)
585{ 589{
586 int count = 0; 590 int count = 0;
@@ -602,7 +606,8 @@ static int __init check_early_ioremap_leak(void)
602} 606}
603late_initcall(check_early_ioremap_leak); 607late_initcall(check_early_ioremap_leak);
604 608
605static void __init __iomem *__early_ioremap(unsigned long phys_addr, unsigned long size, pgprot_t prot) 609static void __init __iomem *
610__early_ioremap(unsigned long phys_addr, unsigned long size, pgprot_t prot)
606{ 611{
607 unsigned long offset, last_addr; 612 unsigned long offset, last_addr;
608 unsigned int nrpages; 613 unsigned int nrpages;
@@ -668,9 +673,9 @@ static void __init __iomem *__early_ioremap(unsigned long phys_addr, unsigned lo
668 --nrpages; 673 --nrpages;
669 } 674 }
670 if (early_ioremap_debug) 675 if (early_ioremap_debug)
671 printk(KERN_CONT "%08lx + %08lx\n", offset, fix_to_virt(idx0)); 676 printk(KERN_CONT "%08lx + %08lx\n", offset, slot_virt[slot]);
672 677
673 prev_map[slot] = (void __iomem *)(offset + fix_to_virt(idx0)); 678 prev_map[slot] = (void __iomem *)(offset + slot_virt[slot]);
674 return prev_map[slot]; 679 return prev_map[slot];
675} 680}
676 681
@@ -738,8 +743,3 @@ void __init early_iounmap(void __iomem *addr, unsigned long size)
738 } 743 }
739 prev_map[slot] = NULL; 744 prev_map[slot] = NULL;
740} 745}
741
742void __this_fixmap_does_not_exist(void)
743{
744 WARN_ON(1);
745}
diff --git a/arch/x86/mm/kmmio.c b/arch/x86/mm/kmmio.c
index 6a518dd08a36..4f115e00486b 100644
--- a/arch/x86/mm/kmmio.c
+++ b/arch/x86/mm/kmmio.c
@@ -310,7 +310,7 @@ static int post_kmmio_handler(unsigned long condition, struct pt_regs *regs)
310 struct kmmio_context *ctx = &get_cpu_var(kmmio_ctx); 310 struct kmmio_context *ctx = &get_cpu_var(kmmio_ctx);
311 311
312 if (!ctx->active) { 312 if (!ctx->active) {
313 pr_warning("kmmio: spurious debug trap on CPU %d.\n", 313 pr_debug("kmmio: spurious debug trap on CPU %d.\n",
314 smp_processor_id()); 314 smp_processor_id());
315 goto out; 315 goto out;
316 } 316 }
diff --git a/arch/x86/mm/memtest.c b/arch/x86/mm/memtest.c
index 0bcd7883d036..605c8be06217 100644
--- a/arch/x86/mm/memtest.c
+++ b/arch/x86/mm/memtest.c
@@ -100,6 +100,9 @@ static int __init parse_memtest(char *arg)
100{ 100{
101 if (arg) 101 if (arg)
102 memtest_pattern = simple_strtoul(arg, NULL, 0); 102 memtest_pattern = simple_strtoul(arg, NULL, 0);
103 else
104 memtest_pattern = ARRAY_SIZE(patterns);
105
103 return 0; 106 return 0;
104} 107}
105 108
diff --git a/arch/x86/mm/numa_32.c b/arch/x86/mm/numa_32.c
index 451fe95a0352..3daefa04ace5 100644
--- a/arch/x86/mm/numa_32.c
+++ b/arch/x86/mm/numa_32.c
@@ -416,10 +416,11 @@ void __init initmem_init(unsigned long start_pfn,
416 for_each_online_node(nid) 416 for_each_online_node(nid)
417 propagate_e820_map_node(nid); 417 propagate_e820_map_node(nid);
418 418
419 for_each_online_node(nid) 419 for_each_online_node(nid) {
420 memset(NODE_DATA(nid), 0, sizeof(struct pglist_data)); 420 memset(NODE_DATA(nid), 0, sizeof(struct pglist_data));
421 NODE_DATA(nid)->bdata = &bootmem_node_data[nid];
422 }
421 423
422 NODE_DATA(0)->bdata = &bootmem_node_data[0];
423 setup_bootmem_allocator(); 424 setup_bootmem_allocator();
424} 425}
425 426
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
index 9c4294986af7..d71e1b636ce6 100644
--- a/arch/x86/mm/pageattr.c
+++ b/arch/x86/mm/pageattr.c
@@ -16,6 +16,7 @@
16#include <asm/processor.h> 16#include <asm/processor.h>
17#include <asm/tlbflush.h> 17#include <asm/tlbflush.h>
18#include <asm/sections.h> 18#include <asm/sections.h>
19#include <asm/setup.h>
19#include <asm/uaccess.h> 20#include <asm/uaccess.h>
20#include <asm/pgalloc.h> 21#include <asm/pgalloc.h>
21#include <asm/proto.h> 22#include <asm/proto.h>
@@ -33,6 +34,7 @@ struct cpa_data {
33 unsigned long pfn; 34 unsigned long pfn;
34 unsigned force_split : 1; 35 unsigned force_split : 1;
35 int curpage; 36 int curpage;
37 struct page **pages;
36}; 38};
37 39
38/* 40/*
@@ -45,6 +47,7 @@ static DEFINE_SPINLOCK(cpa_lock);
45 47
46#define CPA_FLUSHTLB 1 48#define CPA_FLUSHTLB 1
47#define CPA_ARRAY 2 49#define CPA_ARRAY 2
50#define CPA_PAGES_ARRAY 4
48 51
49#ifdef CONFIG_PROC_FS 52#ifdef CONFIG_PROC_FS
50static unsigned long direct_pages_count[PG_LEVEL_NUM]; 53static unsigned long direct_pages_count[PG_LEVEL_NUM];
@@ -95,7 +98,7 @@ static inline unsigned long highmap_start_pfn(void)
95 98
96static inline unsigned long highmap_end_pfn(void) 99static inline unsigned long highmap_end_pfn(void)
97{ 100{
98 return __pa(roundup((unsigned long)_end, PMD_SIZE)) >> PAGE_SHIFT; 101 return __pa(roundup(_brk_end, PMD_SIZE)) >> PAGE_SHIFT;
99} 102}
100 103
101#endif 104#endif
@@ -201,10 +204,10 @@ static void cpa_flush_range(unsigned long start, int numpages, int cache)
201 } 204 }
202} 205}
203 206
204static void cpa_flush_array(unsigned long *start, int numpages, int cache) 207static void cpa_flush_array(unsigned long *start, int numpages, int cache,
208 int in_flags, struct page **pages)
205{ 209{
206 unsigned int i, level; 210 unsigned int i, level;
207 unsigned long *addr;
208 211
209 BUG_ON(irqs_disabled()); 212 BUG_ON(irqs_disabled());
210 213
@@ -225,14 +228,22 @@ static void cpa_flush_array(unsigned long *start, int numpages, int cache)
225 * will cause all other CPUs to flush the same 228 * will cause all other CPUs to flush the same
226 * cachelines: 229 * cachelines:
227 */ 230 */
228 for (i = 0, addr = start; i < numpages; i++, addr++) { 231 for (i = 0; i < numpages; i++) {
229 pte_t *pte = lookup_address(*addr, &level); 232 unsigned long addr;
233 pte_t *pte;
234
235 if (in_flags & CPA_PAGES_ARRAY)
236 addr = (unsigned long)page_address(pages[i]);
237 else
238 addr = start[i];
239
240 pte = lookup_address(addr, &level);
230 241
231 /* 242 /*
232 * Only flush present addresses: 243 * Only flush present addresses:
233 */ 244 */
234 if (pte && (pte_val(*pte) & _PAGE_PRESENT)) 245 if (pte && (pte_val(*pte) & _PAGE_PRESENT))
235 clflush_cache_range((void *) *addr, PAGE_SIZE); 246 clflush_cache_range((void *)addr, PAGE_SIZE);
236 } 247 }
237} 248}
238 249
@@ -584,7 +595,9 @@ static int __change_page_attr(struct cpa_data *cpa, int primary)
584 unsigned int level; 595 unsigned int level;
585 pte_t *kpte, old_pte; 596 pte_t *kpte, old_pte;
586 597
587 if (cpa->flags & CPA_ARRAY) 598 if (cpa->flags & CPA_PAGES_ARRAY)
599 address = (unsigned long)page_address(cpa->pages[cpa->curpage]);
600 else if (cpa->flags & CPA_ARRAY)
588 address = cpa->vaddr[cpa->curpage]; 601 address = cpa->vaddr[cpa->curpage];
589 else 602 else
590 address = *cpa->vaddr; 603 address = *cpa->vaddr;
@@ -687,7 +700,9 @@ static int cpa_process_alias(struct cpa_data *cpa)
687 * No need to redo, when the primary call touched the direct 700 * No need to redo, when the primary call touched the direct
688 * mapping already: 701 * mapping already:
689 */ 702 */
690 if (cpa->flags & CPA_ARRAY) 703 if (cpa->flags & CPA_PAGES_ARRAY)
704 vaddr = (unsigned long)page_address(cpa->pages[cpa->curpage]);
705 else if (cpa->flags & CPA_ARRAY)
691 vaddr = cpa->vaddr[cpa->curpage]; 706 vaddr = cpa->vaddr[cpa->curpage];
692 else 707 else
693 vaddr = *cpa->vaddr; 708 vaddr = *cpa->vaddr;
@@ -698,7 +713,7 @@ static int cpa_process_alias(struct cpa_data *cpa)
698 alias_cpa = *cpa; 713 alias_cpa = *cpa;
699 temp_cpa_vaddr = (unsigned long) __va(cpa->pfn << PAGE_SHIFT); 714 temp_cpa_vaddr = (unsigned long) __va(cpa->pfn << PAGE_SHIFT);
700 alias_cpa.vaddr = &temp_cpa_vaddr; 715 alias_cpa.vaddr = &temp_cpa_vaddr;
701 alias_cpa.flags &= ~CPA_ARRAY; 716 alias_cpa.flags &= ~(CPA_PAGES_ARRAY | CPA_ARRAY);
702 717
703 718
704 ret = __change_page_attr_set_clr(&alias_cpa, 0); 719 ret = __change_page_attr_set_clr(&alias_cpa, 0);
@@ -711,7 +726,7 @@ static int cpa_process_alias(struct cpa_data *cpa)
711 * No need to redo, when the primary call touched the high 726 * No need to redo, when the primary call touched the high
712 * mapping already: 727 * mapping already:
713 */ 728 */
714 if (within(vaddr, (unsigned long) _text, (unsigned long) _end)) 729 if (within(vaddr, (unsigned long) _text, _brk_end))
715 return 0; 730 return 0;
716 731
717 /* 732 /*
@@ -724,7 +739,7 @@ static int cpa_process_alias(struct cpa_data *cpa)
724 alias_cpa = *cpa; 739 alias_cpa = *cpa;
725 temp_cpa_vaddr = (cpa->pfn << PAGE_SHIFT) + __START_KERNEL_map - phys_base; 740 temp_cpa_vaddr = (cpa->pfn << PAGE_SHIFT) + __START_KERNEL_map - phys_base;
726 alias_cpa.vaddr = &temp_cpa_vaddr; 741 alias_cpa.vaddr = &temp_cpa_vaddr;
727 alias_cpa.flags &= ~CPA_ARRAY; 742 alias_cpa.flags &= ~(CPA_PAGES_ARRAY | CPA_ARRAY);
728 743
729 /* 744 /*
730 * The high mapping range is imprecise, so ignore the return value. 745 * The high mapping range is imprecise, so ignore the return value.
@@ -745,7 +760,7 @@ static int __change_page_attr_set_clr(struct cpa_data *cpa, int checkalias)
745 */ 760 */
746 cpa->numpages = numpages; 761 cpa->numpages = numpages;
747 /* for array changes, we can't use large page */ 762 /* for array changes, we can't use large page */
748 if (cpa->flags & CPA_ARRAY) 763 if (cpa->flags & (CPA_ARRAY | CPA_PAGES_ARRAY))
749 cpa->numpages = 1; 764 cpa->numpages = 1;
750 765
751 if (!debug_pagealloc) 766 if (!debug_pagealloc)
@@ -769,7 +784,7 @@ static int __change_page_attr_set_clr(struct cpa_data *cpa, int checkalias)
769 */ 784 */
770 BUG_ON(cpa->numpages > numpages); 785 BUG_ON(cpa->numpages > numpages);
771 numpages -= cpa->numpages; 786 numpages -= cpa->numpages;
772 if (cpa->flags & CPA_ARRAY) 787 if (cpa->flags & (CPA_PAGES_ARRAY | CPA_ARRAY))
773 cpa->curpage++; 788 cpa->curpage++;
774 else 789 else
775 *cpa->vaddr += cpa->numpages * PAGE_SIZE; 790 *cpa->vaddr += cpa->numpages * PAGE_SIZE;
@@ -786,7 +801,8 @@ static inline int cache_attr(pgprot_t attr)
786 801
787static int change_page_attr_set_clr(unsigned long *addr, int numpages, 802static int change_page_attr_set_clr(unsigned long *addr, int numpages,
788 pgprot_t mask_set, pgprot_t mask_clr, 803 pgprot_t mask_set, pgprot_t mask_clr,
789 int force_split, int array) 804 int force_split, int in_flag,
805 struct page **pages)
790{ 806{
791 struct cpa_data cpa; 807 struct cpa_data cpa;
792 int ret, cache, checkalias; 808 int ret, cache, checkalias;
@@ -801,15 +817,7 @@ static int change_page_attr_set_clr(unsigned long *addr, int numpages,
801 return 0; 817 return 0;
802 818
803 /* Ensure we are PAGE_SIZE aligned */ 819 /* Ensure we are PAGE_SIZE aligned */
804 if (!array) { 820 if (in_flag & CPA_ARRAY) {
805 if (*addr & ~PAGE_MASK) {
806 *addr &= PAGE_MASK;
807 /*
808 * People should not be passing in unaligned addresses:
809 */
810 WARN_ON_ONCE(1);
811 }
812 } else {
813 int i; 821 int i;
814 for (i = 0; i < numpages; i++) { 822 for (i = 0; i < numpages; i++) {
815 if (addr[i] & ~PAGE_MASK) { 823 if (addr[i] & ~PAGE_MASK) {
@@ -817,6 +825,18 @@ static int change_page_attr_set_clr(unsigned long *addr, int numpages,
817 WARN_ON_ONCE(1); 825 WARN_ON_ONCE(1);
818 } 826 }
819 } 827 }
828 } else if (!(in_flag & CPA_PAGES_ARRAY)) {
829 /*
830 * in_flag of CPA_PAGES_ARRAY implies it is aligned.
831 * No need to cehck in that case
832 */
833 if (*addr & ~PAGE_MASK) {
834 *addr &= PAGE_MASK;
835 /*
836 * People should not be passing in unaligned addresses:
837 */
838 WARN_ON_ONCE(1);
839 }
820 } 840 }
821 841
822 /* Must avoid aliasing mappings in the highmem code */ 842 /* Must avoid aliasing mappings in the highmem code */
@@ -832,6 +852,7 @@ static int change_page_attr_set_clr(unsigned long *addr, int numpages,
832 arch_flush_lazy_mmu_mode(); 852 arch_flush_lazy_mmu_mode();
833 853
834 cpa.vaddr = addr; 854 cpa.vaddr = addr;
855 cpa.pages = pages;
835 cpa.numpages = numpages; 856 cpa.numpages = numpages;
836 cpa.mask_set = mask_set; 857 cpa.mask_set = mask_set;
837 cpa.mask_clr = mask_clr; 858 cpa.mask_clr = mask_clr;
@@ -839,8 +860,8 @@ static int change_page_attr_set_clr(unsigned long *addr, int numpages,
839 cpa.curpage = 0; 860 cpa.curpage = 0;
840 cpa.force_split = force_split; 861 cpa.force_split = force_split;
841 862
842 if (array) 863 if (in_flag & (CPA_ARRAY | CPA_PAGES_ARRAY))
843 cpa.flags |= CPA_ARRAY; 864 cpa.flags |= in_flag;
844 865
845 /* No alias checking for _NX bit modifications */ 866 /* No alias checking for _NX bit modifications */
846 checkalias = (pgprot_val(mask_set) | pgprot_val(mask_clr)) != _PAGE_NX; 867 checkalias = (pgprot_val(mask_set) | pgprot_val(mask_clr)) != _PAGE_NX;
@@ -866,9 +887,10 @@ static int change_page_attr_set_clr(unsigned long *addr, int numpages,
866 * wbindv): 887 * wbindv):
867 */ 888 */
868 if (!ret && cpu_has_clflush) { 889 if (!ret && cpu_has_clflush) {
869 if (cpa.flags & CPA_ARRAY) 890 if (cpa.flags & (CPA_PAGES_ARRAY | CPA_ARRAY)) {
870 cpa_flush_array(addr, numpages, cache); 891 cpa_flush_array(addr, numpages, cache,
871 else 892 cpa.flags, pages);
893 } else
872 cpa_flush_range(*addr, numpages, cache); 894 cpa_flush_range(*addr, numpages, cache);
873 } else 895 } else
874 cpa_flush_all(cache); 896 cpa_flush_all(cache);
@@ -888,14 +910,28 @@ static inline int change_page_attr_set(unsigned long *addr, int numpages,
888 pgprot_t mask, int array) 910 pgprot_t mask, int array)
889{ 911{
890 return change_page_attr_set_clr(addr, numpages, mask, __pgprot(0), 0, 912 return change_page_attr_set_clr(addr, numpages, mask, __pgprot(0), 0,
891 array); 913 (array ? CPA_ARRAY : 0), NULL);
892} 914}
893 915
894static inline int change_page_attr_clear(unsigned long *addr, int numpages, 916static inline int change_page_attr_clear(unsigned long *addr, int numpages,
895 pgprot_t mask, int array) 917 pgprot_t mask, int array)
896{ 918{
897 return change_page_attr_set_clr(addr, numpages, __pgprot(0), mask, 0, 919 return change_page_attr_set_clr(addr, numpages, __pgprot(0), mask, 0,
898 array); 920 (array ? CPA_ARRAY : 0), NULL);
921}
922
923static inline int cpa_set_pages_array(struct page **pages, int numpages,
924 pgprot_t mask)
925{
926 return change_page_attr_set_clr(NULL, numpages, mask, __pgprot(0), 0,
927 CPA_PAGES_ARRAY, pages);
928}
929
930static inline int cpa_clear_pages_array(struct page **pages, int numpages,
931 pgprot_t mask)
932{
933 return change_page_attr_set_clr(NULL, numpages, __pgprot(0), mask, 0,
934 CPA_PAGES_ARRAY, pages);
899} 935}
900 936
901int _set_memory_uc(unsigned long addr, int numpages) 937int _set_memory_uc(unsigned long addr, int numpages)
@@ -1043,7 +1079,7 @@ int set_memory_np(unsigned long addr, int numpages)
1043int set_memory_4k(unsigned long addr, int numpages) 1079int set_memory_4k(unsigned long addr, int numpages)
1044{ 1080{
1045 return change_page_attr_set_clr(&addr, numpages, __pgprot(0), 1081 return change_page_attr_set_clr(&addr, numpages, __pgprot(0),
1046 __pgprot(0), 1, 0); 1082 __pgprot(0), 1, 0, NULL);
1047} 1083}
1048 1084
1049int set_pages_uc(struct page *page, int numpages) 1085int set_pages_uc(struct page *page, int numpages)
@@ -1054,6 +1090,35 @@ int set_pages_uc(struct page *page, int numpages)
1054} 1090}
1055EXPORT_SYMBOL(set_pages_uc); 1091EXPORT_SYMBOL(set_pages_uc);
1056 1092
1093int set_pages_array_uc(struct page **pages, int addrinarray)
1094{
1095 unsigned long start;
1096 unsigned long end;
1097 int i;
1098 int free_idx;
1099
1100 for (i = 0; i < addrinarray; i++) {
1101 start = (unsigned long)page_address(pages[i]);
1102 end = start + PAGE_SIZE;
1103 if (reserve_memtype(start, end, _PAGE_CACHE_UC_MINUS, NULL))
1104 goto err_out;
1105 }
1106
1107 if (cpa_set_pages_array(pages, addrinarray,
1108 __pgprot(_PAGE_CACHE_UC_MINUS)) == 0) {
1109 return 0; /* Success */
1110 }
1111err_out:
1112 free_idx = i;
1113 for (i = 0; i < free_idx; i++) {
1114 start = (unsigned long)page_address(pages[i]);
1115 end = start + PAGE_SIZE;
1116 free_memtype(start, end);
1117 }
1118 return -EINVAL;
1119}
1120EXPORT_SYMBOL(set_pages_array_uc);
1121
1057int set_pages_wb(struct page *page, int numpages) 1122int set_pages_wb(struct page *page, int numpages)
1058{ 1123{
1059 unsigned long addr = (unsigned long)page_address(page); 1124 unsigned long addr = (unsigned long)page_address(page);
@@ -1062,6 +1127,26 @@ int set_pages_wb(struct page *page, int numpages)
1062} 1127}
1063EXPORT_SYMBOL(set_pages_wb); 1128EXPORT_SYMBOL(set_pages_wb);
1064 1129
1130int set_pages_array_wb(struct page **pages, int addrinarray)
1131{
1132 int retval;
1133 unsigned long start;
1134 unsigned long end;
1135 int i;
1136
1137 retval = cpa_clear_pages_array(pages, addrinarray,
1138 __pgprot(_PAGE_CACHE_MASK));
1139
1140 for (i = 0; i < addrinarray; i++) {
1141 start = (unsigned long)page_address(pages[i]);
1142 end = start + PAGE_SIZE;
1143 free_memtype(start, end);
1144 }
1145
1146 return retval;
1147}
1148EXPORT_SYMBOL(set_pages_array_wb);
1149
1065int set_pages_x(struct page *page, int numpages) 1150int set_pages_x(struct page *page, int numpages)
1066{ 1151{
1067 unsigned long addr = (unsigned long)page_address(page); 1152 unsigned long addr = (unsigned long)page_address(page);
diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c
index 2ed37158012d..640339ee4fb2 100644
--- a/arch/x86/mm/pat.c
+++ b/arch/x86/mm/pat.c
@@ -677,10 +677,11 @@ static int reserve_pfn_range(u64 paddr, unsigned long size, pgprot_t *vma_prot,
677 is_ram = pat_pagerange_is_ram(paddr, paddr + size); 677 is_ram = pat_pagerange_is_ram(paddr, paddr + size);
678 678
679 /* 679 /*
680 * reserve_pfn_range() doesn't support RAM pages. 680 * reserve_pfn_range() doesn't support RAM pages. Maintain the current
681 * behavior with RAM pages by returning success.
681 */ 682 */
682 if (is_ram != 0) 683 if (is_ram != 0)
683 return -EINVAL; 684 return 0;
684 685
685 ret = reserve_memtype(paddr, paddr + size, want_flags, &flags); 686 ret = reserve_memtype(paddr, paddr + size, want_flags, &flags);
686 if (ret) 687 if (ret)
diff --git a/arch/x86/mm/pgtable_32.c b/arch/x86/mm/pgtable_32.c
index f2e477c91c1b..46c8834aedc0 100644
--- a/arch/x86/mm/pgtable_32.c
+++ b/arch/x86/mm/pgtable_32.c
@@ -50,7 +50,7 @@ void set_pte_vaddr(unsigned long vaddr, pte_t pteval)
50 } 50 }
51 pte = pte_offset_kernel(pmd, vaddr); 51 pte = pte_offset_kernel(pmd, vaddr);
52 if (pte_val(pteval)) 52 if (pte_val(pteval))
53 set_pte_present(&init_mm, vaddr, pte, pteval); 53 set_pte_at(&init_mm, vaddr, pte, pteval);
54 else 54 else
55 pte_clear(&init_mm, vaddr, pte); 55 pte_clear(&init_mm, vaddr, pte);
56 56
diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c
index a654d59e4483..821e97017e95 100644
--- a/arch/x86/mm/tlb.c
+++ b/arch/x86/mm/tlb.c
@@ -187,11 +187,6 @@ static void flush_tlb_others_ipi(const struct cpumask *cpumask,
187 cpumask, cpumask_of(smp_processor_id())); 187 cpumask, cpumask_of(smp_processor_id()));
188 188
189 /* 189 /*
190 * Make the above memory operations globally visible before
191 * sending the IPI.
192 */
193 smp_mb();
194 /*
195 * We have to send the IPI only to 190 * We have to send the IPI only to
196 * CPUs affected. 191 * CPUs affected.
197 */ 192 */
diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c
index 82d22fc601ae..8c362b96b644 100644
--- a/arch/x86/pci/common.c
+++ b/arch/x86/pci/common.c
@@ -90,7 +90,7 @@ static int __devinit can_skip_ioresource_align(const struct dmi_system_id *d)
90 return 0; 90 return 0;
91} 91}
92 92
93static struct dmi_system_id can_skip_pciprobe_dmi_table[] __devinitdata = { 93static const struct dmi_system_id can_skip_pciprobe_dmi_table[] __devinitconst = {
94/* 94/*
95 * Systems where PCI IO resource ISA alignment can be skipped 95 * Systems where PCI IO resource ISA alignment can be skipped
96 * when the ISA enable bit in the bridge control is not set 96 * when the ISA enable bit in the bridge control is not set
@@ -183,7 +183,7 @@ static int __devinit assign_all_busses(const struct dmi_system_id *d)
183} 183}
184#endif 184#endif
185 185
186static struct dmi_system_id __devinitdata pciprobe_dmi_table[] = { 186static const struct dmi_system_id __devinitconst pciprobe_dmi_table[] = {
187#ifdef __i386__ 187#ifdef __i386__
188/* 188/*
189 * Laptops which need pci=assign-busses to see Cardbus cards 189 * Laptops which need pci=assign-busses to see Cardbus cards
diff --git a/arch/x86/pci/fixup.c b/arch/x86/pci/fixup.c
index 7d388d5cf548..9c49919e4d1c 100644
--- a/arch/x86/pci/fixup.c
+++ b/arch/x86/pci/fixup.c
@@ -356,7 +356,7 @@ static void __devinit pci_fixup_video(struct pci_dev *pdev)
356DECLARE_PCI_FIXUP_FINAL(PCI_ANY_ID, PCI_ANY_ID, pci_fixup_video); 356DECLARE_PCI_FIXUP_FINAL(PCI_ANY_ID, PCI_ANY_ID, pci_fixup_video);
357 357
358 358
359static struct dmi_system_id __devinitdata msi_k8t_dmi_table[] = { 359static const struct dmi_system_id __devinitconst msi_k8t_dmi_table[] = {
360 { 360 {
361 .ident = "MSI-K8T-Neo2Fir", 361 .ident = "MSI-K8T-Neo2Fir",
362 .matches = { 362 .matches = {
@@ -413,7 +413,7 @@ DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8237,
413 */ 413 */
414static u16 toshiba_line_size; 414static u16 toshiba_line_size;
415 415
416static struct dmi_system_id __devinitdata toshiba_ohci1394_dmi_table[] = { 416static const struct dmi_system_id __devinitconst toshiba_ohci1394_dmi_table[] = {
417 { 417 {
418 .ident = "Toshiba PS5 based laptop", 418 .ident = "Toshiba PS5 based laptop",
419 .matches = { 419 .matches = {
diff --git a/arch/x86/pci/i386.c b/arch/x86/pci/i386.c
index 5ead808dd70c..f234a37bd428 100644
--- a/arch/x86/pci/i386.c
+++ b/arch/x86/pci/i386.c
@@ -319,6 +319,9 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
319 return -EINVAL; 319 return -EINVAL;
320 } 320 }
321 flags = new_flags; 321 flags = new_flags;
322 vma->vm_page_prot = __pgprot(
323 (pgprot_val(vma->vm_page_prot) & ~_PAGE_CACHE_MASK) |
324 flags);
322 } 325 }
323 326
324 if (((vma->vm_pgoff < max_low_pfn_mapped) || 327 if (((vma->vm_pgoff < max_low_pfn_mapped) ||
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
index cb6afa4ec95c..db3802fb7b84 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -1723,9 +1723,9 @@ __init pgd_t *xen_setup_kernel_pagetable(pgd_t *pgd,
1723{ 1723{
1724 pmd_t *kernel_pmd; 1724 pmd_t *kernel_pmd;
1725 1725
1726 init_pg_tables_start = __pa(pgd); 1726 max_pfn_mapped = PFN_DOWN(__pa(xen_start_info->pt_base) +
1727 init_pg_tables_end = __pa(pgd) + xen_start_info->nr_pt_frames*PAGE_SIZE; 1727 xen_start_info->nr_pt_frames * PAGE_SIZE +
1728 max_pfn_mapped = PFN_DOWN(init_pg_tables_end + 512*1024); 1728 512*1024);
1729 1729
1730 kernel_pmd = m2v(pgd[KERNEL_PGD_BOUNDARY].pgd); 1730 kernel_pmd = m2v(pgd[KERNEL_PGD_BOUNDARY].pgd);
1731 memcpy(level2_kernel_pgt, kernel_pmd, sizeof(pmd_t) * PTRS_PER_PMD); 1731 memcpy(level2_kernel_pgt, kernel_pmd, sizeof(pmd_t) * PTRS_PER_PMD);
@@ -1870,7 +1870,6 @@ const struct pv_mmu_ops xen_mmu_ops __initdata = {
1870 1870
1871#ifdef CONFIG_X86_PAE 1871#ifdef CONFIG_X86_PAE
1872 .set_pte_atomic = xen_set_pte_atomic, 1872 .set_pte_atomic = xen_set_pte_atomic,
1873 .set_pte_present = xen_set_pte_at,
1874 .pte_clear = xen_pte_clear, 1873 .pte_clear = xen_pte_clear,
1875 .pmd_clear = xen_pmd_clear, 1874 .pmd_clear = xen_pmd_clear,
1876#endif /* CONFIG_X86_PAE */ 1875#endif /* CONFIG_X86_PAE */